mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
14 lines
112 KiB
JavaScript
14 lines
112 KiB
JavaScript
(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_6_1"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_6_1"]||[]).push([[909],{60090:function(e,t,a){"use strict";a.d(t,{A:function(){return p}});var o=a(9274);const n={key:0,class:"label"},i={class:"text-label"},l={class:"value"};function r(e,t,a,r,s,d){return d.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",n,[(0,o.createElementVNode)("div",i,[(0,o.renderSlot)(e.$slots,"name",{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(a.name),1)]),!0)]),(0,o.createElementVNode)("div",l,[(0,o.renderSlot)(e.$slots,"value",{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(d.displayValue),1)]),!0)])])):(0,o.renderSlot)(e.$slots,"default",{key:1},void 0,!0)}var s=a(14220),d={name:"InputOrDisplay",props:{name:{type:String,required:!0},value:{type:[Number,String,Array,void 0],default:""},mode:{type:String,default:"edit"}},computed:{isView(){return this.mode===s.nW},displayValue(){return Array.isArray(this.value)&&0===this.value.length?"":this.value}}},c=(a(18071),a(47433));const u=(0,c.A)(d,[["render",r],["__scopeId","data-v-a3d99010"]]);var p=u},39412:function(e,t,a){"use strict";a.d(t,{A:function(){return u}});var o=a(9274);const n={class:"label"},i={class:"text-label"},l={class:"value"};function r(e,t,a,r,s,d){return(0,o.openBlock)(),(0,o.createElementBlock)("div",n,[(0,o.createElementVNode)("div",i,[(0,o.renderSlot)(e.$slots,"name",{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(a.name),1)]),!0)]),(0,o.createElementVNode)("div",l,[(0,o.renderSlot)(e.$slots,"value",{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(a.value),1)]),!0)])])}var s={props:{name:{type:String,required:!0},value:{type:[Number,String,void 0],default:""}}},d=(a(88405),a(47433));const c=(0,d.A)(s,[["render",r],["__scopeId","data-v-357627fa"]]);var u=c},38094:function(e,t,a){"use strict";a.d(t,{A:function(){return X}});var o=a(9274);const n={class:"key-value"},i={key:0,class:"clearfix"},l={key:0,class:"icon icon-info"},r=["aria-label","aria-rowcount","aria-colcount"],s={key:0,class:"rowgroup"},d={class:"row"},c={class:"text-label key-value-label",role:"columnheader"},u={key:0,class:"icon icon-info",tabindex:"0",role:"tooltip"},p={class:"text-label key-value-label",role:"columnheader"},h={key:0,class:"icon icon-info",tabindex:"0",role:"tooltip"},m={key:1,class:"rowgroup"},f={class:"row"},v=["aria-rowindex"],g=["onUpdate:modelValue","disabled","placeholder","data-testid","aria-label","onPaste"],y=["data-testid","aria-rowindex"],b={key:0},w={key:1},k=["onUpdate:modelValue","disabled","type","placeholder","data-testid","aria-label"],S=["aria-rowindex","aria-colindex"],E=["aria-rowindex","aria-colindex","data-testid"],x=["disabled","aria-label","onClick"],N={key:1,class:"footer mt-10"},C=["disabled","aria-label"];function B(e,t,a,B,D,T){const _=(0,o.resolveComponent)("Select"),A=(0,o.resolveComponent)("LabeledTooltip"),V=(0,o.resolveComponent)("CodeMirror"),O=(0,o.resolveComponent)("TextAreaAutoGrow"),I=(0,o.resolveComponent)("FileSelector"),P=(0,o.resolveDirective)("clean-tooltip"),L=(0,o.resolveDirective)("stripped-aria-label");return(0,o.openBlock)(),(0,o.createElementBlock)("div",n,[a.title||e.$slots.title?((0,o.openBlock)(),(0,o.createElementBlock)("div",i,[(0,o.renderSlot)(e.$slots,"title",{},(()=>[(0,o.createElementVNode)("h3",null,[(0,o.createTextVNode)((0,o.toDisplayString)(a.title)+" ",1),a.titleProtip?(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("i",l,null,512)),[[P,a.titleProtip]]):(0,o.createCommentVNode)("",!0)])]))])):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("div",{class:"kv-container",role:"grid","aria-label":a.title||e.t("generic.ariaLabel.keyValue"),"aria-rowcount":D.rows.length,"aria-colcount":a.extraColumns.length+2,style:(0,o.normalizeStyle)(T.containerStyle)},[D.rows.length||T.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",s,[(0,o.createElementVNode)("div",d,[(0,o.createElementVNode)("div",c,[(0,o.createTextVNode)((0,o.toDisplayString)(T._keyLabel)+" ",1),T._protip&&!T.isView&&a.addAllowed?(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("i",u,null,512)),[[P,{content:T._protip,triggers:["hover","touch","focus"]}],[L,T._protip]]):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("div",p,[(0,o.createTextVNode)((0,o.toDisplayString)(T._valueLabel)+" ",1),a.protipValue&&!T.isView&&a.addAllowed?(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("i",h,null,512)),[[P,{content:a.protipValue,triggers:["hover","touch","focus"]}],[L,a.protipValue]]):(0,o.createCommentVNode)("",!0)]),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(a.extraColumns,((t,a)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:a,role:"columnheader"},[(0,o.renderSlot)(e.$slots,"label:"+t,{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(t),1)]))])))),128)),T.canRemove?(0,o.renderSlot)(e.$slots,"remove",{key:0},(()=>[t[3]||(t[3]=(0,o.createElementVNode)("span",null,null,-1))])):(0,o.createCommentVNode)("",!0)])])):(0,o.createCommentVNode)("",!0),!D.rows.length&&T.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",m,t[4]||(t[4]=[(0,o.createElementVNode)("div",{class:"row"},[(0,o.createElementVNode)("div",{class:"kv-item key text-muted",role:"gridcell"}," — "),(0,o.createElementVNode)("div",{class:"kv-item key text-muted",role:"gridcell"}," — ")],-1)]))):((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,{key:2},(0,o.renderList)(D.rows,((n,i)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:i,class:"rowgroup"},[(0,o.createElementVNode)("div",f,[(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)(["kv-item key",{"labeled-input-key":a.keyErrors[n.key],"v-popper--has-tooltip":a.keyErrors[n.key]}]),role:"gridcell","aria-rowindex":i+1,"aria-colindex":1},[(0,o.renderSlot)(e.$slots,"key",{row:n,mode:a.mode,keyName:a.keyName,valueName:a.valueName,queueUpdate:e.queueUpdate,disabled:a.disabled},(()=>[a.keyOptions?((0,o.openBlock)(),(0,o.createBlock)(_,{key:0,ref_for:!0,ref:"key",value:n[a.keyName],"onUpdate:value":[e=>n[a.keyName]=e,e.queueUpdate],searchable:!0,disabled:a.disabled,clearable:!1,taggable:a.keyTaggable,options:T.calculateOptions(n[a.keyName]),"data-testid":`select-kv-item-key-${i}`,"aria-label":e.t("generic.ariaLabel.key",{index:i+1})},null,8,["value","onUpdate:value","disabled","taggable","options","data-testid","aria-label"])):(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("input",{key:1,ref_for:!0,ref:"key","onUpdate:modelValue":e=>n[a.keyName]=e,disabled:T.isView||a.disabled||!a.keyEditable,placeholder:T._keyPlaceholder,"data-testid":`input-kv-item-key-${i}`,"aria-label":e.t("generic.ariaLabel.key",{index:i+1}),onInput:t[0]||(t[0]=(...t)=>e.queueUpdate&&e.queueUpdate(...t)),onPaste:e=>T.onPaste(i,e)},null,40,g)),[[o.vModelText,n[a.keyName]]]),a.keyErrors[n.key]?((0,o.openBlock)(),(0,o.createBlock)(A,{key:2,value:a.keyErrors[n.key],hover:!0},null,8,["value"])):(0,o.createCommentVNode)("",!0)]))],10,v),(0,o.createElementVNode)("div",{"data-testid":`kv-item-value-${i}`,class:"kv-item value",role:"gridcell","aria-rowindex":i+1,"aria-colindex":2},[(0,o.renderSlot)(e.$slots,"value",{row:n,mode:a.mode,keyName:a.keyName,valueName:a.valueName,queueUpdate:e.queueUpdate},(()=>[n.supported?n.binary?((0,o.openBlock)(),(0,o.createElementBlock)("div",w,(0,o.toDisplayString)(T.binaryTextSize(n.value)),1)):((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:2,class:(0,o.normalizeClass)(["value-container",{"upload-button":a.parseValueFromFile}])},[a.valueMarkdownMultiline?((0,o.openBlock)(),(0,o.createBlock)(V,{key:0,ref_for:!0,ref:"cm","data-testid":"code-mirror-multiline-field",class:(0,o.normalizeClass)({["focus"]:D.codeMirrorFocus[i]}),value:n[a.valueName],"as-text-area":!0,mode:a.mode,options:{screenReaderLabel:e.t("generic.ariaLabel.value",{index:i})},onOnInput:e=>T.onInputMarkdownMultiline(i,e),onOnFocus:e=>T.onFocusMarkdownMultiline(i,e)},null,8,["class","value","mode","options","onOnInput","onOnFocus"])):a.valueMultiline&&void 0!==n[a.valueName]?((0,o.openBlock)(),(0,o.createBlock)(O,{key:1,value:n[a.valueName],"onUpdate:value":[e=>n[a.valueName]=e,e.queueUpdate],"data-testid":"value-multiline",class:(0,o.normalizeClass)({conceal:a.valueConcealed}),disabled:a.disabled,mode:a.mode,placeholder:T._valuePlaceholder,"min-height":40,spellcheck:!1,"aria-label":e.t("generic.ariaLabel.value",{index:i+1})},null,8,["value","onUpdate:value","class","disabled","mode","placeholder","aria-label"])):(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("input",{key:2,"onUpdate:modelValue":e=>n[a.valueName]=e,disabled:T.isView||a.disabled,type:a.valueConcealed?"password":"text",placeholder:T._valuePlaceholder,autocorrect:"off",autocapitalize:"off",spellcheck:"false","data-testid":`input-kv-item-value-${i}`,"aria-label":e.t("generic.ariaLabel.value",{index:i+1}),onInput:t[1]||(t[1]=(...t)=>e.queueUpdate&&e.queueUpdate(...t))},null,40,k)),[[o.vModelDynamic,n[a.valueName]]]),a.parseValueFromFile&&a.readAllowed&&!T.isView&&T.isValueFieldEmpty(n[a.valueName])?((0,o.openBlock)(),(0,o.createBlock)(I,{key:3,class:"btn btn-sm role-secondary file-selector",label:e.t("generic.upload"),"include-file-name":!0,"aria-label":e.t("generic.ariaLabel.value",{index:i+1}),onSelected:e=>T.onValueFileSelected(i,e)},null,8,["label","aria-label","onSelected"])):(0,o.createCommentVNode)("",!0)],2)):((0,o.openBlock)(),(0,o.createElementBlock)("div",b,(0,o.toDisplayString)(e.t("detailText.unsupported",null,!0)),1))]))],8,y),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(a.extraColumns,((t,a)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:`${i}-${a}`,class:"kv-item extra",role:"gridcell","aria-rowindex":i+1,"aria-colindex":a+3},[(0,o.renderSlot)(e.$slots,"col:"+t,{row:n,queueUpdate:e.queueUpdate,i:i})],8,S)))),128)),T.canRemove?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:i,class:"kv-item remove",role:"gridcell","aria-rowindex":i+1,"aria-colindex":a.extraColumns.length+3,"data-testid":`remove-column-${i}`},[(0,o.renderSlot)(e.$slots,"removeButton",{remove:T.remove,row:n,i:i},(()=>[(0,o.createElementVNode)("button",{type:"button",role:"button",disabled:T.isView||a.disabled,"aria-label":e.t("generic.ariaLabel.remove",{index:i+1}),class:"btn role-link",onClick:e=>T.remove(i)},[(0,o.createTextVNode)((0,o.toDisplayString)(a.removeLabel||e.t("generic.remove"))+" ",1),a.removeIcon?((0,o.openBlock)(),(0,o.createElementBlock)("i",{key:0,class:(0,o.normalizeClass)([a.removeIcon])},null,2)):(0,o.createCommentVNode)("",!0)],8,x)]))],8,E)):(0,o.createCommentVNode)("",!0)])])))),128))],12,r),!a.addAllowed&&!a.readAllowed||T.isView?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",N,[(0,o.renderSlot)(e.$slots,"add",{add:T.add},(()=>[a.addAllowed?((0,o.openBlock)(),(0,o.createElementBlock)("button",{key:0,type:"button",role:"button",class:(0,o.normalizeClass)(["btn role-tertiary add",[a.addClass]]),"data-testid":"add_row_item_button",disabled:a.loading||a.disabled||a.keyOptions&&0===T.filteredKeyOptions.length,"aria-label":e.t("generic.ariaLabel.addKeyValue"),onClick:t[2]||(t[2]=e=>T.add())},[(0,o.createElementVNode)("i",{class:(0,o.normalizeClass)(["mr-5 icon",a.loading?["icon-lg","icon-spinner","icon-spin"]:[a.addIcon]])},null,2),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(T._addLabel),1)],10,C)):(0,o.createCommentVNode)("",!0),a.readAllowed?((0,o.openBlock)(),(0,o.createBlock)(I,{key:1,"aria-label":e.t("generic.ariaLabel.readKeyValue"),disabled:T.isView,class:"role-tertiary",label:e.t("generic.readFromFile"),"include-file-name":!0,"data-testid":"read_all_key_value_button",onSelected:T.onFileSelected},null,8,["aria-label","disabled","label","onSelected"])):(0,o.createCommentVNode)("",!0)]))]))])}var D=a(12784),T=a.n(D),_=a(74302),A=a(68851),V=a(4514),O=a(6198),I=a(6879),P=a(76978),L=a(28968),M=a(29649),$=a(14220),R=a(92043),U=a(62138),F=a(46343),j=a.n(F),q=a(49924),H={name:"KeyValue",emits:["focusKey","update:value"],components:{CodeMirror:U.A,Select:L.A,TextAreaAutoGrow:I.V,FileSelector:M.A,LabeledTooltip:q.Z},props:{value:{type:[Array,Object],default:null},defaultValue:{type:[Array,Object],default:null},binaryValueKeys:{type:[Array,Object],default:null},mode:{type:String,default:$.G5},asMap:{type:Boolean,default:!0},initialEmptyRow:{type:Boolean,default:!1},title:{type:String,default:""},titleProtip:{type:String,default:""},protip:{type:[String,Boolean],default:""},protipValue:{type:[String,Boolean],default:""},keyName:{type:String,default:"key"},keyLabel:{type:String,default:""},keyEditable:{type:Boolean,default:!0},keyOptions:{type:Array,default:null},keyTaggable:{type:Boolean,default:!0},keyOptionUnique:{type:Boolean,default:!1},keyPlaceholder:{type:String,default:""},separatorLabel:{type:String,default:""},valueName:{type:String,default:"value"},valueLabel:{type:String,default:""},valuePlaceholder:{type:String,default:""},valueCanBeEmpty:{type:Boolean,default:!1},displayValuesAsBinary:{type:Boolean,default:!1},valueMarkdownMultiline:{type:Boolean,default:!1},valueMultiline:{type:Boolean,default:!0},valueTrim:{type:Boolean,default:!0},handleBase64:{type:Boolean,default:!1},valueConcealed:{type:Boolean,default:!1},supported:{type:Function,default:e=>!0},preserveKeys:{type:Array,default:null},extraColumns:{type:Array,default:()=>[]},defaultAddData:{type:Object,default:()=>{}},addLabel:{type:String,default:""},addIcon:{type:String,default:""},addClass:{type:String,default:""},addAllowed:{type:Boolean,default:!0},readIcon:{type:String,default:"icon-upload"},readAllowed:{type:Boolean,default:!0},readAccept:{type:String,default:"*"},readMultiple:{type:Boolean,default:!1},removeLabel:{type:String,default:""},removeIcon:{type:String,default:""},removeAllowed:{type:Boolean,default:!0},fileModifier:{type:Function,default:(e,t)=>({name:e,value:t})},parserSeparators:{type:Array,default:()=>[":","="]},loading:{default:!1,type:Boolean},parseLinesFromFile:{default:!1,type:Boolean},parseValueFromFile:{default:!1,type:Boolean},disabled:{default:!1,type:Boolean},keyErrors:{type:Object,default:()=>({})}},data(){const e=this.getRows(this.value);return{rows:e,codeMirrorFocus:{},lastUpdated:null}},computed:{_protip(){return!1===this.protip?null:this.protip||this.t("keyValue.protip",null,!0)},_keyLabel(){return this.keyLabel||this.t("generic.key")},_keyPlaceholder(){return this.keyPlaceholder||this.t("keyValue.keyPlaceholder")},_valueLabel(){return this.valueLabel||this.t("generic.value")},_valuePlaceholder(){return this.valuePlaceholder||this.t("keyValue.valuePlaceholder")},_addLabel(){return this.addLabel||this.t("generic.add")},isView(){return this.mode===$.nW},containerStyle(){const e=this.canRemove?" 50px":"",t=2+this.extraColumns.length;return`grid-template-columns: repeat(${t}, 1fr)${e};`},usedKeyOptions(){return this.rows.map((e=>e[this.keyName]))},filteredKeyOptions(){return this.keyOptionUnique?this.keyOptions.filter((e=>!this.usedKeyOptions.includes(e.value))):this.keyOptions},canRemove(){return!this.isView&&this.removeAllowed}},created(){this.queueUpdate=T()(this.update,500)},watch:{value:{deep:!0,handler(e,t){this.valuePropChanged(e,t)}}},methods:{valuePropChanged(e){j()(e,this.lastUpdated)||(this.rows=this.getRows(e))},getRows(e){const t=[];if(this.asMap){const a=e||{};Object.keys(a).forEach((e=>{let o=a[e];const n=(0,V.u)(a[e]),i=(0,R.XC)(n);this.handleBase64&&i&&(o=(0,V.u)(o)),t.push({key:e,value:o,binary:this.displayValuesAsBinary||this.handleBase64&&!i,canEncode:this.handleBase64&&i,supported:!0})}))}else{const a=e||[];for(const e of a){let a=e[this.valueName]||"";const o=(0,V.u)(e[this.valueName]),n=(0,R.XC)(o);this.handleBase64&&n&&(a=(0,V.u)(a));const i={[this.keyName]:e[this.keyName]||"",[this.valueName]:a,binary:this.displayValuesAsBinary||this.handleBase64&&!n,canEncode:this.handleBase64&&n,supported:this.supported(e)};this.preserveKeys?.map((t=>{"undefined"!==typeof e[t]&&(i[t]=e[t])})),t.push(i)}}return t&&!t.length&&this.initialEmptyRow&&t.push({[this.keyName]:"",[this.valueName]:"",binary:!1,canEncode:this.handleBase64,supported:!0}),t},add(e="",t=""){const a={...this.defaultAddData,[this.keyName]:e,[this.valueName]:t};a.binary=!1,a.canEncode=this.handleBase64,a.supported=!0,this.rows.push(a),this.queueUpdate(),this.$nextTick((()=>{if(this.$refs.key){const e=this.$refs.key,t=e[e.length-1];t.focus()}else this.$emit("focusKey")}))},remove(e){(0,A.Wq)(this.rows,e),this.queueUpdate()},removeEmptyRows(){const e=this.rows.filter((e=>e.value.length||e.key.length));this["rows"]=e},onFileSelected(e){const{name:t,value:a}=this.fileModifier(e.name,e.value);if(this.parseLinesFromFile){const e=a.split("\n");e.forEach((e=>{if(e.length){const[t,a]=e.split("=");this.add(t,a)}})),e.length>0&&this.removeEmptyRows()}else this.add(t,a,this.displayValuesAsBinary)},download(e,t){const a=this.rows[e],o=a[this.keyName],n=a[this.valueName];(0,O.PE)(o,n,"application/octet-stream")},update(){let e;if(this.asMap){e={};const t=this.keyName,a=this.valueName;for(const o of this.rows){let n=o[a]||"";const i=(o[t]||"").trim();n&&"object"===(0,_.QP)(n)?e[i]=JSON.parse(JSON.stringify(n)):(n=n||"",this.valueTrim&&(0,R.XC)(n)&&(n=n.trim()),o.canEncode&&(n=(0,V.KA)(n)),i&&(n||this.valueCanBeEmpty)&&(e[i]=n))}}else{const t=this.preserveKeys||[];(0,A.Gj)(t,this.keyName),(0,A.Gj)(t,this.valueName),e=this.rows.map((e=>{let a=e[this.valueName];e.canEncode&&(a=(0,V.KA)(a));const o={[this.keyName]:e[this.keyName],[this.valueName]:a};for(const n of t)"undefined"!==typeof e[n]&&(o[n]=e[n]);return o}))}this.lastUpdated=e,this.$emit("update:value",e)},onPaste(e,t){const a=t.clipboardData.getData("text/plain"),o=a.split("\n"),n=o.map((e=>{const t=e.search(new RegExp(this.parserSeparators.join("|")));if(-1===t)return[];const a=e.substring(0,t).trim(),o=e.substring(t+1).trim();return[a,o]})).filter((e=>e.length>0));if(0===n.length||1===n.length&&n[0].length<2)return;t.preventDefault();const i=n.map((e=>({[this.keyName]:(e[0]||"").trim(),[this.valueName]:(e[1]||"").trim(),supported:!0,canEncode:this.handleBase64,binary:this.displayValuesAsBinary})));this.rows.splice(e,1,...i),this.queueUpdate()},calculateOptions(e){const t=this.keyOptions.find((t=>t.value===e));return t?[t,...this.filteredKeyOptions]:this.filteredKeyOptions},binaryTextSize(e){const t=this.handleBase64?(0,V.u)(e):e,a=e.length?(0,V.dQ)(t):0;return this.t("detailText.binary",{n:a},!0)},get:P.Jt,onInputMarkdownMultiline(e,t){this.rows=this.rows.map(((a,o)=>o===e?{...a,value:t}:a)),this.queueUpdate()},onFocusMarkdownMultiline(e,t){this.codeMirrorFocus[e]=t},onValueFileSelected(e,t){const{name:a,value:o}=t;this.rows[e][this.keyName]||(this.rows[e][this.keyName]=a),this.rows[e][this.valueName]=o},isValueFieldEmpty(e){return!e||0===e.trim().length}}},K=(a(980),a(47433));const z=(0,K.A)(H,[["render",B]]);var X=z},51449:function(e,t,a){"use strict";a.d(t,{A:function(){return b}});var o=a(9274);const n={class:"labels"},i={class:"labels__header"},l={key:0},r={class:"mt-10 mb-10"};function s(e,t,a,s,d,c){const u=(0,o.resolveComponent)("t"),p=(0,o.resolveComponent)("ToggleSwitch"),h=(0,o.resolveComponent)("KeyValue");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{class:(0,o.normalizeClass)(c.containerClass)},[(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)(a.defaultSectionClass)},[(0,o.createElementVNode)("div",n,[(0,o.createElementVNode)("div",i,[a.showLabelTitle?((0,o.openBlock)(),(0,o.createElementBlock)("h3",l,[(0,o.createVNode)(u,{k:"labels.labels.title"})])):(0,o.createCommentVNode)("",!0),c.showToggler?((0,o.openBlock)(),(0,o.createBlock)(p,{key:1,value:d.toggler,"onUpdate:value":t[0]||(t[0]=e=>d.toggler=e),name:"label-system-toggle","on-label":e.t("labels.labels.show")},null,8,["value","on-label"])):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("p",r,[(0,o.createVNode)(u,{k:"labels.labels.description"})]),(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)(c.columnsClass)},[(0,o.renderSlot)(e.$slots,"labels",{},(()=>[(0,o.createVNode)(h,{key:"labels",value:d.toggler?d.labels.initValue:d.labels.value,"add-label":e.t("labels.addLabel"),"add-icon":a.addIcon,mode:a.mode,"read-allowed":!1,"value-can-be-empty":!0,"key-errors":d.labels.keyErrors,"onUpdate:value":t[1]||(t[1]=e=>d.labels.update(e,(e=>a.value.setLabels(e))))},null,8,["value","add-label","add-icon","mode","key-errors"])]),!0)],2)])],2),t[3]||(t[3]=(0,o.createElementVNode)("div",{class:"spacer"},null,-1)),a.showAnnotations?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:0,class:(0,o.normalizeClass)(c.sectionClass)},[(0,o.createVNode)(h,{key:"annotations",value:d.toggler?d.annotations.initValue:d.annotations.value,"add-label":e.t("labels.addAnnotation"),"add-icon":a.addIcon,mode:a.mode,title:e.t("labels.annotations.title"),"title-protip":a.annotationTitleTooltip,"read-allowed":!1,"value-can-be-empty":!0,"key-errors":d.annotations.keyErrors,"onUpdate:value":t[2]||(t[2]=e=>d.annotations.update(e,(e=>a.value.setAnnotations(e))))},null,8,["value","add-label","add-icon","mode","title","title-protip","key-errors"])],2)):(0,o.createCommentVNode)("",!0)],2)}var d=a(45250),c=a(92043),u=a(2841),p=a(38094),h=a(2614),m=a(14220);class f{isProtected(e){return this.protectedKeys.includes(e)||(0,c.HV)(e,this.protectedRegexes)}omitProtected(e){return(0,d.omitBy)(e,((e,t)=>this.isProtected(t)))}pickProtected(e){return(0,d.pickBy)(e,((e,t)=>this.isProtected(t)))}keyErrorMap(e){return(0,d.mapValues)(this.pickProtected(e),(()=>this.protectedWarning))}constructor(e,t,a,o){this.protectedKeys=[],this.protectedRegexes=[],this.protectedWarning="",this.initValue={},this.value={},this.keyErrors={},this.hasProtectedKeys=!1,this.protectedKeys=e||[],this.protectedRegexes=t||[],this.protectedWarning=a||"",this.initValue=o||{},this.value=this.omitProtected(this.initValue),this.keyErrors=this.keyErrorMap(this.value),this.hasProtectedKeys=Object.keys(this.pickProtected(this.initValue)).length>0}update(e,t){const a=e||{};t({...this.omitProtected(a),...this.pickProtected(this.initValue)}),this.value=a,this.keyErrors=this.keyErrorMap(a)}}var v={components:{ToggleSwitch:h.j,KeyValue:p.A},props:{value:{type:Object,required:!0},mode:{type:String,required:!0},displaySideBySide:{type:Boolean,default:!1},defaultContainerClass:{type:String,default:""},defaultSectionClass:{type:String,default:""},labelTitleTooltip:{type:String,default:""},annotationTitleTooltip:{type:String,default:""},showAnnotations:{type:Boolean,default:!0},showLabelTitle:{type:Boolean,default:!0},addIcon:{type:String,default:""}},data(){const e=this.t("labels.protectedWarning");return{labels:new f(this.value.systemLabels,u.lq,e,this.value.labels),annotations:new f(this.value.systemAnnotations,u.S5,e,this.value.annotations),toggler:!1}},computed:{containerClass(){return`${this.displaySideBySide?"row":""} ${this.defaultContainerClass}`.trim()},sectionClass(){return`${this.displaySideBySide?"col span-6":"row"} ${this.defaultSectionClass}`.trim()},columnsClass(){return(""+(this.displaySideBySide?"col span-6":"row")).trim()},showToggler(){return this.mode===m.nW&&(this.labels.hasProtectedKeys||this.annotations.hasProtectedKeys)}}},g=(a(91872),a(47433));const y=(0,g.A)(v,[["render",s],["__scopeId","data-v-d91f8768"]]);var b=y},56872:function(e,t,a){"use strict";a.d(t,{A:function(){return _}});var o=a(9274);const n={key:0},i=["data-testid"],l={key:0},r=["data-testid"],s={key:0},d=["onUpdate:modelValue","mode","data-testid"],c=["data-testid"],u={key:0},p={key:1,class:"no-value"},h=["data-testid"],m={key:0},f=["onUpdate:modelValue","mode","disabled","data-testid"],v={key:3,class:"remove-container"},g=["disabled","data-testid","onClick"],y={key:3,class:"mmt-4"};function b(e,t,a,b,w,k){const S=(0,o.resolveComponent)("LabeledSelect"),E=(0,o.resolveComponent)("Select"),x=(0,o.resolveComponent)("t");return(0,o.openBlock)(),(0,o.createElementBlock)("div",null,[w.rules.length?(0,o.renderSlot)(e.$slots,"header",{key:0},void 0,!0):(0,o.createCommentVNode)("",!0),a.showRemove&&!k.isView?((0,o.openBlock)(),(0,o.createElementBlock)("button",{key:1,type:"button",class:"btn role-link remove-expression",onClick:t[0]||(t[0]=t=>e.$emit("remove"))},t[4]||(t[4]=[(0,o.createElementVNode)("i",{class:"icon icon-x"},null,-1)]))):(0,o.createCommentVNode)("",!0),w.rules.length?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:2,class:(0,o.normalizeClass)(["match-expression-header",{view:k.isView,"match-expression-header-matching":a.matchingSelectorDisplay}])},[a.matchingSelectorDisplay?((0,o.openBlock)(),(0,o.createElementBlock)("label",n,(0,o.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.matchType")),1)):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("label",null,(0,o.toDisplayString)(a.labelKey||e.t("workload.scheduling.affinity.matchExpressions.key")),1),(0,o.createElementVNode)("label",null,(0,o.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.operator")),1),(0,o.createElementVNode)("label",null,(0,o.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.value")),1),t[5]||(t[5]=(0,o.createElementVNode)("span",null,null,-1))],2)):(0,o.createCommentVNode)("",!0),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(w.rules,((e,n)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:n,class:(0,o.normalizeClass)(["match-expression-row",{view:k.isView,"mb-10":n!==w.rules.length-1,"match-expression-row-matching":a.matchingSelectorDisplay}])},[a.matchingSelectorDisplay?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:0,"data-testid":`input-match-type-field-${n}`},[k.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",l,(0,o.toDisplayString)(e.matching),1)):((0,o.openBlock)(),(0,o.createBlock)(S,{key:1,value:e.matching,"onUpdate:value":t=>e.matching=t,mode:a.mode,options:k.matchingSelectOptions,"data-testid":`input-match-type-field-control-${n}`,onSelecting:k.update},null,8,["value","onUpdate:value","mode","options","data-testid","onSelecting"]))],8,i)):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("div",{"data-testid":`input-match-expression-key-${n}`},[k.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",s,(0,o.toDisplayString)(e.key),1)):k.hasKeySelectOptions?((0,o.openBlock)(),(0,o.createBlock)(S,{key:2,ref_for:!0,ref:`input-match-expression-key-${n}`,value:e.key,"onUpdate:value":t=>e.key=t,mode:a.mode,options:a.keysSelectOptions,"data-testid":`input-match-expression-key-control-select-${n}`},null,8,["value","onUpdate:value","mode","options","data-testid"])):(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("input",{key:1,ref_for:!0,ref:`input-match-expression-key-${n}`,"onUpdate:modelValue":t=>e.key=t,mode:a.mode,"data-testid":`input-match-expression-key-control-${n}`,onInput:t[1]||(t[1]=(...e)=>k.update&&k.update(...e))},null,40,d)),[[o.vModelText,e.key]])],8,r),(0,o.createElementVNode)("div",{"data-testid":`input-match-expression-operator-${n}`},[k.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",u,(0,o.toDisplayString)(e.operator),1)):((0,o.openBlock)(),(0,o.createBlock)(E,{key:1,value:e.operator,"onUpdate:value":[t=>e.operator=t,k.update],class:"operator single",options:w.ops,clearable:!1,reduce:e=>e.value,mode:a.mode,"data-testid":`input-match-expression-operator-control-${n}`},null,8,["value","onUpdate:value","options","reduce","mode","data-testid"]))],8,c),"Exists"===e.operator||"DoesNotExist"===e.operator?((0,o.openBlock)(),(0,o.createElementBlock)("div",p,t[6]||(t[6]=[(0,o.createElementVNode)("label",{class:"text-muted"},"…",-1)]))):((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:2,"data-testid":`input-match-expression-values-${n}`},[k.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",m,(0,o.toDisplayString)(e.values),1)):(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("input",{key:1,"onUpdate:modelValue":t=>e.values=t,mode:a.mode,disabled:"Exists"===e.operator||"DoesNotExist"===e.operator,"data-testid":`input-match-expression-values-control-${n}`,onInput:t[2]||(t[2]=(...e)=>k.update&&k.update(...e))},null,40,f)),[[o.vModelText,e.values]])],8,h)),a.showRemoveButton?((0,o.openBlock)(),(0,o.createElementBlock)("div",v,[k.isView?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("button",{key:0,type:"button",class:"btn role-link",style:{padding:"0px"},disabled:"view"===a.mode,"data-testid":`input-match-expression-remove-control-${n}`,onClick:t=>k.removeRule(e)},[(0,o.createVNode)(x,{k:"generic.remove"})],8,g))])):(0,o.createCommentVNode)("",!0)],2)))),128)),!k.isView&&a.showAddButton?((0,o.openBlock)(),(0,o.createElementBlock)("div",y,[(0,o.createElementVNode)("button",{type:"button",class:(0,o.normalizeClass)(["btn role-tertiary add",[a.addClass]]),"data-testid":"input-match-expression-add-rule",onClick:t[3]||(t[3]=(...e)=>k.addRule&&k.addRule(...e))},[a.addIcon?((0,o.openBlock)(),(0,o.createElementBlock)("i",{key:0,class:(0,o.normalizeClass)(["mr-5 icon",[a.addIcon]])},null,2)):(0,o.createCommentVNode)("",!0),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(k._addLabel),1)],2)])):(0,o.createCommentVNode)("",!0)])}var w=a(35664),k=a(28968),S=a(65359),E=a(68851),x=a(76978),N=a(38823),C=a(7571),B={emits:["update:value","add","remove"],components:{Select:k.A,LabeledSelect:C.A},props:{value:{type:[Array,Object],default:()=>[]},mode:{type:String,default:"edit"},type:{type:String,default:w.NW},matchingSelectorDisplay:{type:Boolean,default:!1},initialEmptyRow:{type:Boolean,default:!1},showAddButton:{type:Boolean,default:!0},labelKey:{type:String,default:""},addLabel:{type:String,default:""},addIcon:{type:String,default:""},addClass:{type:String,default:""},showRemoveButton:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},keysSelectOptions:{type:Array,default:()=>[]}},data(){return{ops:[],rules:[],custom:[]}},created(){const e=this.$store.getters["i18n/t"],t=[{label:e("workload.scheduling.affinity.matchExpressions.in"),value:"In"},{label:e("workload.scheduling.affinity.matchExpressions.notIn"),value:"NotIn"},{label:e("workload.scheduling.affinity.matchExpressions.exists"),value:"Exists"},{label:e("workload.scheduling.affinity.matchExpressions.doesNotExist"),value:"DoesNotExist"}],a=[{label:e("workload.scheduling.affinity.matchExpressions.in"),value:"In"},{label:e("workload.scheduling.affinity.matchExpressions.notIn"),value:"NotIn"},{label:e("workload.scheduling.affinity.matchExpressions.exists"),value:"Exists"},{label:e("workload.scheduling.affinity.matchExpressions.doesNotExist"),value:"DoesNotExist"},{label:e("workload.scheduling.affinity.matchExpressions.lessThan"),value:"Lt"},{label:e("workload.scheduling.affinity.matchExpressions.greaterThan"),value:"Gt"}];let o;if(this.matchingSelectorDisplay){const e={matchFields:[],matchExpressions:[]};["matchFields","matchExpressions"].forEach((t=>{e[t]=this.parseRules(this.value[t],t)})),o=[...e.matchFields,...e.matchExpressions]}else(0,E.cy)(this.value)?(o=[...this.value],o=this.parseRules(o)):(o=(0,N.C6)(this.value.matchLabels,this.value.matchExpressions),o=this.parseRules(o));if(!o.length&&this.initialEmptyRow&&!this.isView){const e={key:"",operator:"In",values:""};this.matchingSelectorDisplay&&(e.matching="matchExpressions"),o.push(e)}this.rules=o,this.ops=this.type===w.NW?a:t},computed:{isView(){return"view"===this.mode},_addLabel(){return this.addLabel||this.t("workload.scheduling.affinity.matchExpressions.addRule")},node(){return w.NW},pod(){return w.Sm},hasKeySelectOptions(){return!!this.keysSelectOptions?.length},matchingSelectOptions(){return[{label:this.t("workload.scheduling.affinity.matchExpressions.label"),value:"matchExpressions"},{label:this.t("workload.scheduling.affinity.matchFields.label"),value:"matchFields"}]},...(0,S.L8)({t:"i18n/t"})},methods:{parseRules(e,t){return e?.length?e.map((e=>{const a=(0,x.o8)(e);return a.values&&"string"!==typeof a.values&&(a.values=a.values.join(", ")),t&&(a.matching=t),a})):[]},removeRule(e){(0,E.Gj)(this.rules,e),this.update()},addRule(){const e={key:"",operator:"In",values:""};this.matchingSelectorDisplay&&(e.matching="matchExpressions"),this.rules.push(e),this.$nextTick((()=>{this.focus(this.rules.length-1),this.$emit("add")}))},update(){this.$nextTick((()=>{const e=this.rules.map((e=>{const t={key:e.key.trim(),operator:e.operator};this.matchingSelectorDisplay&&(t.matching=e.matching);let a=(e.values||"").trim();return"Exists"!==e.operator&&"DoesNotExist"!==e.operator||(a=null),null!==a&&(t.values=a.split(/\s*,\s*/)),t})).filter((e=>!!e));(0,E.cy)(this.value)||this.matchingSelectorDisplay?this.$emit("update:value",e):this.$emit("update:value",(0,N.CR)(e))}))},focus(e=0){this.$refs[`input-match-expression-key-${e}`]?.[0]?.focus()}}},D=(a(76769),a(47433));const T=(0,D.A)(B,[["render",b],["__scopeId","data-v-6b569773"]]);var _=T},37329:function(e,t,a){"use strict";a.d(t,{A:function(){return O}});var o=a(9274);const n={class:"row mb-20"},i={key:0,class:"row"},l={class:"col span-6"};function r(e,t,a,r,s,d){const c=(0,o.resolveComponent)("RadioGroup"),u=(0,o.resolveComponent)("LabeledSelect"),p=(0,o.resolveComponent)("NodeAffinity");return(0,o.openBlock)(),(0,o.createElementBlock)("div",null,[(0,o.createElementVNode)("div",n,[(0,o.createVNode)(c,{value:s.selectNode,"onUpdate:value":t[0]||(t[0]=e=>s.selectNode=e),name:"selectNode",options:d.selectNodeOptions,mode:a.mode,"data-testid":"node-scheduling-selectNode",onInput:d.update},null,8,["value","options","mode","onInput"])]),"nodeSelector"===s.selectNode?((0,o.openBlock)(),(0,o.createElementBlock)("div",i,[(0,o.createElementVNode)("div",l,[(0,o.createVNode)(u,{value:s.nodeName,"onUpdate:value":[t[1]||(t[1]=e=>s.nodeName=e),d.update],label:e.t("workload.scheduling.affinity.nodeName"),options:a.nodes||[],mode:a.mode,multiple:!1,loading:a.loading,"data-testid":"node-scheduling-nodeSelector"},null,8,["value","label","options","mode","loading","onUpdate:value"])])])):"affinity"===s.selectNode?((0,o.openBlock)(),(0,o.createBlock)(p,{key:1,value:s.nodeAffinity,"onUpdate:value":t[2]||(t[2]=e=>s.nodeAffinity=e),mode:a.mode,"data-testid":"node-scheduling-nodeAffinity",onInput:d.update},null,8,["value","mode","onInput"])):(0,o.createCommentVNode)("",!0)])}var s=a(65359),d=a(10196),c=a(7571);const u={class:"col span-12"},p={class:"row"},h={class:"col span-9"},m={key:0,class:"col span-3"};function f(e,t,a,n,i,l){const r=(0,o.resolveComponent)("LabeledSelect"),s=(0,o.resolveComponent)("LabeledInput"),d=(0,o.resolveComponent)("MatchExpressions"),c=(0,o.resolveComponent)("ArrayListGrouped");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"row","onUpdate:value":t[1]||(t[1]=(...t)=>e.queueUpdate&&e.queueUpdate(...t))},[(0,o.createElementVNode)("div",u,[(0,o.createVNode)(c,{value:i.allSelectorTerms,"onUpdate:value":t[0]||(t[0]=e=>i.allSelectorTerms=e),class:"mt-20",mode:a.mode,"default-add-value":{matchExpressions:[]},"add-label":e.t("workload.scheduling.affinity.addNodeSelector"),onRemove:l.remove},{default:(0,o.withCtx)((t=>[(0,o.createElementVNode)("div",p,[(0,o.createElementVNode)("div",h,[(0,o.createVNode)(r,{options:l.affinityOptions,value:l.priorityDisplay(t.row.value),label:e.t("workload.scheduling.affinity.priority"),mode:a.mode,"data-testid":`node-affinity-priority-index${t.i}`,"onUpdate:value":e=>l.changePriority(t.row.value)},null,8,["options","value","label","mode","data-testid","onUpdate:value"])]),"weight"in t.row.value?((0,o.openBlock)(),(0,o.createElementBlock)("div",m,[(0,o.createVNode)(s,{value:t.row.value.weight,"onUpdate:value":[e=>t.row.value.weight=e,l.update],valueModifiers:{number:!0},mode:a.mode,type:"number",min:"1",max:"100",label:e.t("workload.scheduling.affinity.weight.label"),placeholder:e.t("workload.scheduling.affinity.weight.placeholder"),"data-testid":`node-affinity-weight-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"])])):(0,o.createCommentVNode)("",!0)]),(0,o.createVNode)(d,{value:a.matchingSelectorDisplay?t.row.value:t.row.value.matchExpressions,"matching-selector-display":a.matchingSelectorDisplay,mode:a.mode,class:"col span-12 mt-20",type:l.node,"show-remove":!1,"data-testid":`node-affinity-expressions-index${t.i}`,"onUpdate:value":e=>l.updateExpressions(t.row.value,e)},null,8,["value","matching-selector-display","mode","type","data-testid","onUpdate:value"])])),_:1},8,["value","mode","add-label","onRemove"])])],32)}var v=a(12784),g=a.n(v),y=a(14220),b=a(76978),w=a(35664),k=a(56872),S=a(79380),E=a(92043),x=a(31097),N={emits:["update:value"],components:{ArrayListGrouped:x.A,MatchExpressions:k.A,LabeledSelect:c.A,LabeledInput:S.o},props:{value:{type:Object,default:()=>({})},mode:{type:String,default:"create"},matchingSelectorDisplay:{type:Boolean,default:!1}},data(){return this.value.required,{nodeSelectorTerms:null,allSelectorTerms:null,weightedNodeSelectorTerms:null,defaultWeight:1,rerenderNums:(0,E.vx)(4)}},computed:{...(0,s.L8)({t:"i18n/t"}),isView(){return this.mode===y.nW},hasWeighted(){return!!this.weightedNodeSelectorTerms},node(){return w.NW},affinityOptions(){const e=[this.t("workload.scheduling.affinity.preferred"),this.t("workload.scheduling.affinity.required")];return e}},created(){if(this.value.required)this.nodeSelectorTerms=this.value.required.nodeSelectorTerms;else{const{preferredDuringSchedulingIgnoredDuringExecution:e=[],requiredDuringSchedulingIgnoredDuringExecution:t={}}=this.value,{nodeSelectorTerms:a=[]}=t,o=[...e,...a].map((e=>{const t=(0,b.o8)(e);return t._id=(0,E.vx)(4),e.preference&&(Object.assign(t,e.preference),delete t.preference),t}));this.allSelectorTerms=o,this.weightedNodeSelectorTerms=e}this.queueUpdate=g()(this.update,500)},methods:{update(){const e={},t={nodeSelectorTerms:[]},a=[];this.allSelectorTerms.forEach((e=>{const o={...e};if(o.matchExpressions&&(o.matchExpressions=(o.matchExpressions||[]).map((e=>{const t={...e};return delete t.matching,t}))),o.matchFields&&(o.matchFields=(o.matchFields||[]).map((e=>{const t={...e};return delete t.matching,t}))),o.weight){const e={weight:o.weight,preference:o};delete e.preference.weight,a.push(e)}else t.nodeSelectorTerms.push(o)})),a.length&&(e.preferredDuringSchedulingIgnoredDuringExecution=a),t.nodeSelectorTerms.length&&(e.requiredDuringSchedulingIgnoredDuringExecution=t),this.$emit("update:value",e)},remove(){this.rerenderNums=(0,E.vx)(4),this.queueUpdate()},changePriority(e){e.weight?delete e["weight"]:e["weight"]=1,this.update()},priorityDisplay(e){return"weight"in e?this.t("workload.scheduling.affinity.preferred"):this.t("workload.scheduling.affinity.required")},updateExpressions(e,t){const a={matchFields:[],matchExpressions:[]};t.length&&(t.forEach((e=>{a[e.matching||"matchExpressions"].push(e)})),e["matchFields"]=a.matchFields,e["matchExpressions"]=a.matchExpressions,this.update())},get:b.Jt,isEmpty:b.Im}},C=a(47433);const B=(0,C.A)(N,[["render",f]]);var D=B,T=a(11518),_=a(2841),A={components:{RadioGroup:d.z,LabeledSelect:c.A,NodeAffinity:D},props:{value:{type:Object,default:()=>({})},nodes:{type:Array,default:()=>[]},mode:{type:String,default:"create"},loading:{default:!1,type:Boolean}},data(){return{selectNode:null,nodeName:"",nodeAffinity:{},nodeSelector:{}}},created(){const e=this.$store.getters["currentProduct"].inStore===T.T3;let{nodeName:t=""}=this.value;const{affinity:a={},nodeSelector:o={}}=this.value,{nodeAffinity:n={}}=a;let i=null;this.value.nodeName?i="nodeSelector":e&&this.value?.nodeSelector?.[_.yA]?(i="nodeSelector",t=o[_.yA]):(0,b.Im)(n)||(i="affinity"),n.requiredDuringSchedulingIgnoredDuringExecution||(n["requiredDuringSchedulingIgnoredDuringExecution"]={nodeSelectorTerms:[]}),n.preferredDuringSchedulingIgnoredDuringExecution||(n["preferredDuringSchedulingIgnoredDuringExecution"]=[]),this.selectNode=i,this.nodeName=t,this.nodeAffinity=n,this.nodeSelector=o},computed:{...(0,s.L8)({t:"i18n/t"}),isView(){return this.mode===y.nW},isHarvester(){return this.$store.getters["currentProduct"].inStore===T.T3},selectNodeOptions(){const e=this.isHarvester?"harvester.virtualMachine":"workload",t=[{label:this.t(`${e}.scheduling.affinity.anyNode`),value:null},{label:this.t(`${e}.scheduling.affinity.specificNode`),value:"nodeSelector"},{label:this.t(`${e}.scheduling.affinity.schedulingRules`),value:"affinity"}];return t}},methods:{update(){const{nodeName:e,nodeSelector:t,nodeAffinity:a}=this;switch(this.selectNode){case"nodeSelector":this.isHarvester?Object.assign(this.value,{nodeSelector:{[_.yA]:e}}):Object.assign(this.value,{nodeSelector:t,nodeName:e}),this.value?.affinity?.nodeAffinity&&delete this.value.affinity.nodeAffinity;break;case"affinity":delete this.value.nodeName,delete this.value.nodeSelector,this.value.affinity?Object.assign(this.value.affinity,{nodeAffinity:a}):Object.assign(this.value,{affinity:{nodeAffinity:a}});break;default:delete this.value.nodeName,delete this.value.nodeSelector,this.value?.affinity?.nodeAffinity&&delete this.value.affinity.nodeAffinity}},isEmpty:b.Im},watch:{"value.nodeSelector":{handler(e){if(this.isHarvester&&e?.[_.yA]){this.selectNode="nodeSelector";const t=e[_.yA];this.nodeName=t;const a=this.nodes.map((e=>e.value));t&&!a.includes(t)&&(this.$store.dispatch("growl/error",{title:this.$store.getters["i18n/t"]("harvester.vmTemplate.tips.notExistNode.title",{name:t}),message:this.$store.getters["i18n/t"]("harvester.vmTemplate.tips.notExistNode.message")},{root:!0}),delete this.value.nodeSelector,this["nodeName"]="",this["selectNode"]=null)}}}}};const V=(0,C.A)(A,[["render",r]]);var O=V},7274:function(e,t,a){"use strict";a.d(t,{A:function(){return y}});var o=a(9274);const n={class:"password"},i={key:0,class:"addon"},l={key:1,class:"addon"},r=["aria-label"],s={key:0,class:"mt-10 genPassword"};function d(e,t,a,d,c,u){const p=(0,o.resolveComponent)("LabeledInput");return(0,o.openBlock)(),(0,o.createElementBlock)("div",n,[(0,o.createVNode)(p,(0,o.mergeProps)({ref:"input",value:u.password,"onUpdate:value":t[3]||(t[3]=e=>u.password=e)},u.attributes,{type:a.isRandom||c.reveal?"text":"password",readonly:a.isRandom,label:a.label,required:a.required,disabled:a.isRandom,"ignore-password-managers":a.ignorePasswordManagers,mode:a.mode,onBlur:t[4]||(t[4]=t=>e.$emit("blur",t))}),{suffix:(0,o.withCtx)((()=>[a.isRandom?((0,o.openBlock)(),(0,o.createElementBlock)("div",i,[(0,o.createElementVNode)("a",{href:"#",onClick:t[0]||(t[0]=(0,o.withModifiers)((e=>u.copyTextToClipboard(u.password)),["prevent","stop"]))},(0,o.toDisplayString)(e.t("action.copy")),1)])):((0,o.openBlock)(),(0,o.createElementBlock)("div",l,[(0,o.createElementVNode)("a",{href:"#",tabindex:"0",class:"hide-show",role:"button","aria-label":c.reveal?e.t("action.ariaLabel.hidePass",{area:a.label}):e.t("action.ariaLabel.showPass",{area:a.label}),onClick:t[1]||(t[1]=(0,o.withModifiers)(((...e)=>u.hideShowFn&&u.hideShowFn(...e)),["prevent","stop"])),onKeyup:t[2]||(t[2]=(0,o.withKeys)((0,o.withModifiers)(((...e)=>u.hideShowFn&&u.hideShowFn(...e)),["prevent","stop"]),["space"]))},(0,o.toDisplayString)(u.hideShowLabel),41,r)]))])),_:1},16,["value","type","readonly","label","required","disabled","ignore-password-managers","mode"]),a.isRandom?((0,o.openBlock)(),(0,o.createElementBlock)("div",s,[(0,o.createElementVNode)("a",{href:"#",onClick:t[5]||(t[5]=(0,o.withModifiers)(((...e)=>u.generatePassword&&u.generatePassword(...e)),["prevent","stop"]))},[t[6]||(t[6]=(0,o.createElementVNode)("i",{class:"icon icon-refresh"},null,-1)),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e.t("changePassword.newGeneratedPassword")),1)])])):(0,o.createCommentVNode)("",!0)])}var c=a(65359),u=a(79380),p=a(92043),h=a(48881),m=a(14220),f={emits:["update:value","blur"],components:{LabeledInput:u.o},props:{value:{default:"",type:String},isRandom:{default:!1,type:Boolean},label:{default:"",type:String},name:{default:"",type:String},autocomplete:{type:String,default:""},required:{default:!1,type:Boolean},ignorePasswordManagers:{default:!1,type:Boolean},mode:{type:String,default:m.YQ}},data(){return{reveal:!1}},computed:{...(0,c.L8)({t:"i18n/t"}),password:{get(){return this.value},set(e){this.$emit("update:value",e)}},attributes(){const e={};return this.name&&(e.id=this.name,e.name=this.name),this.autocomplete&&(e.autocomplete=this.autocomplete),e},hideShowLabel(){return this.reveal?this.t("action.hide"):this.t("action.show")}},watch:{isRandom(){this.isRandom&&this.generatePassword()}},created(){this.isRandom&&this.generatePassword()},methods:{copyTextToClipboard:h.e,generatePassword(){this.password=(0,p.vx)(16,p.LQ.ALPHA_NUM)},show(e){this.reveal=e},focus(){this.$refs.input.$refs.value.focus()},hideShowFn(){this.reveal?this.reveal=!1:this.reveal=!0}}},v=(a(72170),a(47433));const g=(0,v.A)(f,[["render",d],["__scopeId","data-v-3b3998e6"]]);var y=g},1018:function(e,t,a){"use strict";a.d(t,{A:function(){return V}});var o=a(9274);const n={class:"col span-12"},i={class:"row mt-20 mb-20"},l={class:"col span-6"},r={class:"col span-6"},s={class:"row"},d={key:0,class:"row mt-10 mb-20"},c={class:"row mt-20"},u={class:"col span-9"},p={key:0,class:"col span-3"};function h(e,t,a,h,m,f){const v=(0,o.resolveComponent)("LabeledSelect"),g=(0,o.resolveComponent)("RadioGroup"),y=(0,o.resolveComponent)("LabeledInput"),b=(0,o.resolveComponent)("MatchExpressions"),w=(0,o.resolveComponent)("ArrayListGrouped");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{style:{width:"100%"},class:"row","onUpdate:value":t[1]||(t[1]=(...t)=>e.queueUpdate&&e.queueUpdate(...t))},[(0,o.createElementVNode)("div",n,[(0,o.createVNode)(w,{value:m.allSelectorTerms,"onUpdate:value":t[0]||(t[0]=e=>m.allSelectorTerms=e),class:"mt-20","default-add-value":m.defaultAddValue,mode:a.mode,"add-label":f.addLabel,onRemove:f.remove},{default:(0,o.withCtx)((t=>[(0,o.createElementVNode)("div",i,[(0,o.createElementVNode)("div",l,[(0,o.createVNode)(v,{mode:a.mode,options:[e.t("workload.scheduling.affinity.affinityOption"),e.t("workload.scheduling.affinity.antiAffinityOption")],value:t.row.value._anti?e.t("workload.scheduling.affinity.antiAffinityOption"):e.t("workload.scheduling.affinity.affinityOption"),label:e.t("workload.scheduling.affinity.type"),"data-testid":`pod-affinity-type-index${t.i}`,"onUpdate:value":e=>t.row.value._anti=!t.row.value._anti},null,8,["mode","options","value","label","data-testid","onUpdate:value"])]),(0,o.createElementVNode)("div",r,[(0,o.createVNode)(v,{mode:a.mode,options:[e.t("workload.scheduling.affinity.preferred"),e.t("workload.scheduling.affinity.required")],value:f.priorityDisplay(t.row.value),label:e.t("workload.scheduling.affinity.priority"),"data-testid":`pod-affinity-priority-index${t.i}`,"onUpdate:value":e=>f.changePriority(t.row.value,t.i)},null,8,["mode","options","value","label","data-testid","onUpdate:value"])])]),(0,o.createElementVNode)("div",s,[(0,o.createVNode)(g,{options:f.namespaceSelectionOptions,labels:f.namespaceSelectionLabels,name:`namespaces-${t.row.value._id}`,mode:a.mode,value:t.row.value._namespaceOption,"data-testid":`pod-affinity-namespacetype-index${t.i}`,"onUpdate:value":e=>f.changeNamespaceMode(e,t.row.value,t.i)},null,8,["options","labels","name","mode","value","data-testid","onUpdate:value"])]),t.row.value._namespaceOption===m.NAMESPACE_SELECTION_OPTION_VALUES.SELECTED?((0,o.openBlock)(),(0,o.createElementBlock)("div",d,[f.hasNamespaces&&!a.forceInputNamespaceSelection?((0,o.openBlock)(),(0,o.createBlock)(v,{key:0,value:t.row.value.namespaces,"onUpdate:value":[e=>t.row.value.namespaces=e,e=>f.updateNamespaces(t.row.value,t.row.value.namespaces)],mode:a.mode,multiple:!0,taggable:!0,options:f.allNamespacesOptions,label:f.labeledInputNamespaceLabel,"data-testid":`pod-affinity-namespace-select-index${t.i}`},null,8,["value","onUpdate:value","mode","options","label","data-testid"])):((0,o.openBlock)(),(0,o.createBlock)(y,{key:1,value:t.row.value._namespaces,"onUpdate:value":[e=>t.row.value._namespaces=e,e=>f.updateNamespaces(t.row.value,t.row.value._namespaces)],mode:a.mode,label:f.labeledInputNamespaceLabel,placeholder:e.t("harvesterManager.affinity.namespaces.placeholder"),"data-testid":`pod-affinity-namespace-input-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"]))])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(b,{mode:a.mode,class:"col span-12 mt-20",type:f.pod,value:f.get(t.row.value,"labelSelector.matchExpressions"),"show-remove":!1,"data-testid":`pod-affinity-expressions-index${t.i}`,"onUpdate:value":e=>f.updateLabelSelector(e,t)},null,8,["mode","type","value","data-testid","onUpdate:value"]),(0,o.createElementVNode)("div",c,[(0,o.createElementVNode)("div",u,[f.hasNodes?((0,o.openBlock)(),(0,o.createBlock)(v,{key:0,value:t.row.value.topologyKey,"onUpdate:value":[e=>t.row.value.topologyKey=e,f.update],taggable:!0,searchable:!0,"close-on-select":!1,mode:a.mode,required:"",label:e.t("workload.scheduling.affinity.topologyKey.label"),placeholder:f.topologyKeyPlaceholder,options:f.existingNodeLabels,disabled:"view"===a.mode,loading:a.loading,"data-testid":`pod-affinity-topology-select-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","options","disabled","loading","data-testid"])):((0,o.openBlock)(),(0,o.createBlock)(y,{key:1,value:t.row.value.topologyKey,"onUpdate:value":[e=>t.row.value.topologyKey=e,f.update],mode:a.mode,label:e.t("workload.scheduling.affinity.topologyKey.label"),placeholder:f.topologyKeyPlaceholder,required:"","data-testid":`pod-affinity-topology-input-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"]))]),"weight"in t.row.value?((0,o.openBlock)(),(0,o.createElementBlock)("div",p,[(0,o.createVNode)(y,{value:t.row.value.weight,"onUpdate:value":[e=>t.row.value.weight=e,f.update],valueModifiers:{number:!0},mode:a.mode,type:"number",min:"1",max:"100",label:e.t("workload.scheduling.affinity.weight.label"),placeholder:e.t("workload.scheduling.affinity.weight.placeholder"),"data-testid":`pod-affinity-weight-index${t.i}`},null,8,["value","onUpdate:value","mode","label","placeholder","data-testid"])])):(0,o.createCommentVNode)("",!0)])])),_:1},8,["value","default-add-value","mode","add-label","onRemove"])])],32)}var m=a(65359),f=a(14220),v=a(76978),g=a(35664),y=a(56872),b=a(7571),w=a(10196),k=a(79380),S=a(92043),E=a(74302),x=a(12784),N=a.n(x),C=a(31097),B=a(68851);const D={POD:"pod",ALL:"all",SELECTED:"selected"};var T={emits:["update"],components:{ArrayListGrouped:C.A,MatchExpressions:y.A,LabeledSelect:b.A,RadioGroup:w.z,LabeledInput:k.o},props:{value:{type:Object,default:()=>({})},field:{type:String,default:"affinity"},mode:{type:String,default:"create"},nodes:{type:Array,default:()=>[]},namespaces:{type:Array,default:null},allNamespacesOptionAvailable:{default:!1,type:Boolean},forceInputNamespaceSelection:{default:!1,type:Boolean},removeLabeledInputNamespaceLabel:{default:!1,type:Boolean},overwriteLabels:{type:Object,default:null},loading:{default:!1,type:Boolean}},data(){return{allSelectorTerms:[],defaultWeight:1,rerenderNums:(0,S.vx)(4),NAMESPACE_SELECTION_OPTION_VALUES:D,defaultAddValue:{_namespaceOption:D.POD,matchExpressions:[],namespaces:null,_namespaces:null}}},computed:{...(0,m.L8)({t:"i18n/t"}),isView(){return this.mode===f.nW},pod(){return g.Sm},node(){return g.NW},labeledInputNamespaceLabel(){return this.removeLabeledInputNamespaceLabel?"":this.overwriteLabels?.namespaceInputLabel||this.t("workload.scheduling.affinity.matchExpressions.inNamespaces")},allNamespacesOptions(){const e=this.$store.getters["currentStore"](g.CU),t=this.namespaces||this.$store.getters[`${e}/all`](g.CU),a=(0,E.Ul)(t.map((e=>({label:e.nameDisplay,value:e.id}))),"label");return a},existingNodeLabels(){return(0,B.oQ)(this.nodes)},hasNodes(){return this.nodes.length},namespaceSelectionOptions(){return this.allNamespacesOptionAvailable?[D.POD,D.ALL,D.SELECTED]:[D.POD,D.SELECTED]},namespaceSelectionLabels(){return this.overwriteLabels?.namespaceSelectionLabels?this.overwriteLabels?.namespaceSelectionLabels:this.allNamespacesOptionAvailable?[this.t("workload.scheduling.affinity.thisPodNamespace"),this.t("workload.scheduling.affinity.allNamespaces"),this.t("workload.scheduling.affinity.matchExpressions.inNamespaces")]:[this.t("workload.scheduling.affinity.thisPodNamespace"),this.t("workload.scheduling.affinity.matchExpressions.inNamespaces")]},addLabel(){return this.overwriteLabels?.addLabel||this.t("podAffinity.addLabel")},topologyKeyPlaceholder(){return this.overwriteLabels?.topologyKeyPlaceholder||this.t("workload.scheduling.affinity.topologyKey.placeholder")},hasNamespaces(){return this.allNamespacesOptions.length}},created(){this.value[this.field]||(this.value[this.field]={});const{podAffinity:e={},podAntiAffinity:t={}}=this.value[this.field],a=[...e.preferredDuringSchedulingIgnoredDuringExecution||[],...e.requiredDuringSchedulingIgnoredDuringExecution||[]].map((e=>{let t=(0,v.o8)(e);return t._id=(0,S.vx)(4),t._anti=!1,e.podAffinityTerm?(Object.assign(t,e.podAffinityTerm),t=this.parsePodAffinityTerm(t),delete t.podAffinityTerm):t=this.parsePodAffinityTerm(t),t})),o=[...t.preferredDuringSchedulingIgnoredDuringExecution||[],...t.requiredDuringSchedulingIgnoredDuringExecution||[]].map((e=>{let t=(0,v.o8)(e);return t._id=(0,S.vx)(4),t._anti=!0,e.podAffinityTerm?(Object.assign(t,e.podAffinityTerm),t=this.parsePodAffinityTerm(t),delete t.podAffinityTerm):t=this.parsePodAffinityTerm(t),t}));this.allSelectorTerms=[...a,...o],this.queueUpdate=N()(this.update,500)},methods:{parsePodAffinityTerm(e){return e.namespaceSelector&&"object"===typeof e.namespaceSelector&&!Object.keys(e.namespaceSelector).length&&this.allNamespacesOptionAvailable?e._namespaceOption=D.ALL:e.namespaces?.length?e._namespaceOption=D.SELECTED:e._namespaceOption=D.POD,e._namespaces=(e.namespaces||[]).toString(),e},update(){const e={requiredDuringSchedulingIgnoredDuringExecution:[],preferredDuringSchedulingIgnoredDuringExecution:[]},t={requiredDuringSchedulingIgnoredDuringExecution:[],preferredDuringSchedulingIgnoredDuringExecution:[]};this.allSelectorTerms.forEach((a=>{if(a._anti)if(a.weight){const e={podAffinityTerm:{...a},weight:a.weight||this.defaultWeight};delete e.podAffinityTerm.weight,t.preferredDuringSchedulingIgnoredDuringExecution.push(e)}else t.requiredDuringSchedulingIgnoredDuringExecution.push(a);else if(a.weight){const t={podAffinityTerm:a,weight:a.weight||this.defaultWeight};e.preferredDuringSchedulingIgnoredDuringExecution.push(t)}else e.requiredDuringSchedulingIgnoredDuringExecution.push(a)})),Object.assign(this.value[this.field],{podAffinity:e,podAntiAffinity:t}),this.$emit("update",this.value)},remove(){this.rerenderNums=(0,S.vx)(4),this.queueUpdate()},changePriority(e,t){e.weight?delete e.weight:e.weight=this.defaultWeight,this.allSelectorTerms[t]=(0,v.o8)(e),this.queueUpdate()},priorityDisplay(e){return"weight"in e?this.t("workload.scheduling.affinity.preferred"):this.t("workload.scheduling.affinity.required")},changeNamespaceMode(e,t,a){switch(t["_namespaceOption"]=e,e){case D.POD:t.namespaces=null,t._namespaces=null,(t.namespaceSelector||null===t.namespaceSelector)&&delete t.namespaceSelector;break;case D.ALL:t.namespaceSelector={},(t.namespaces||null===t.namespaces)&&delete t.namespaces,(t._namespaces||null===t._namespaces)&&delete t._namespaces;break;default:t["namespaces"]=[],t["_namespaces"]="",(t.namespaceSelector||null===t.namespaceSelector)&&delete t.namespaceSelector;break}this.allSelectorTerms[a]=t,this.queueUpdate()},updateNamespaces(e,t){let a=t;"string"===typeof t&&(a=t.split(",").map((e=>e.trim())).filter((e=>e?.length))),e["namespaces"]=a,this.queueUpdate()},updateLabelSelector(e,t){this.set(t.row.value,"labelSelector.matchExpressions",e),this.queueUpdate()},isEmpty:v.Im,get:v.Jt,set:v.hZ}},_=(a(93946),a(47433));const A=(0,_.A)(T,[["render",h]]);var V=A},60219:function(e,t,a){"use strict";a.d(t,{A:function(){return M}});var o=a(9274);const n={class:"mt-20"};function i(e,t,a,i,l,r){const s=(0,o.resolveComponent)("Conditions"),d=(0,o.resolveComponent)("Tab"),c=(0,o.resolveComponent)("PaginatedResourceTable"),u=(0,o.resolveComponent)("RelatedResources"),p=(0,o.resolveComponent)("Tabbed"),h=(0,o.resolveDirective)("t");return(0,o.openBlock)(),(0,o.createBlock)(p,(0,o.mergeProps)({class:["resource-tabs",{[a.mode]:!0}]},e.$attrs,{"default-tab":a.defaultTab,resource:a.value,"use-hash":a.useHash,onChanged:r.tabChange}),{default:(0,o.withCtx)((()=>[(0,o.renderSlot)(e.$slots,"default",{},void 0,!0),l.showConditions?((0,o.openBlock)(),(0,o.createBlock)(d,{key:0,"label-key":"resourceTabs.conditions.tab",name:"conditions",weight:-1,"display-alert-icon":r.conditionsHaveIssues},{default:(0,o.withCtx)((()=>[(0,o.createVNode)(s,{value:a.value},null,8,["value"])])),_:1},8,["display-alert-icon"])):(0,o.createCommentVNode)("",!0),r.showEvents?((0,o.openBlock)(),(0,o.createBlock)(d,{key:1,"label-key":"resourceTabs.events.tab",name:"events",weight:-2},{default:(0,o.withCtx)((()=>["events"===l.selectedTab?((0,o.openBlock)(),(0,o.createBlock)(c,{key:0,schema:l.eventSchema,"local-filter":r.filterEventsLocal,"api-filter":r.filterEventsApi,"use-query-params-for-simple-filtering":!1,headers:r.eventHeaders,paginationHeaders:l.paginationHeaders,namespaced:!1},null,8,["schema","local-filter","api-filter","headers","paginationHeaders"])):(0,o.createCommentVNode)("",!0)])),_:1})):(0,o.createCommentVNode)("",!0),r.showRelated?((0,o.openBlock)(),(0,o.createBlock)(d,{key:2,name:"related","label-key":"resourceTabs.related.tab",weight:-3},{default:(0,o.withCtx)((()=>[(0,o.withDirectives)((0,o.createElementVNode)("h3",null,null,512),[[h,"resourceTabs.related.from"]]),(0,o.createVNode)(u,{"ignore-types":[a.value.type],value:a.value,direction:"from"},null,8,["ignore-types","value"]),(0,o.withDirectives)((0,o.createElementVNode)("h3",n,null,512),[[h,"resourceTabs.related.to"]]),(0,o.createVNode)(u,{"ignore-types":[a.value.type],value:a.value,direction:"to"},null,8,["ignore-types","value"])])),_:1})):(0,o.createCommentVNode)("",!0)])),_:3},16,["class","default-tab","resource","use-hash","onChanged"])}var l=a(68980),r=a(49584),s=a(91825);function d(e,t,a,n,i,l){const r=(0,o.resolveComponent)("SortableTable");return(0,o.openBlock)(),(0,o.createBlock)(r,{headers:l.headers,rows:l.rows,"key-field":"condition","default-sort-by":"condition","table-actions":!1,"row-actions":!1,search:!1},{"cell:condition":(0,o.withCtx)((({row:e})=>[(0,o.createElementVNode)("span",{class:(0,o.normalizeClass)({"text-error":e.error})},(0,o.toDisplayString)(e.condition),3)])),"cell:status":(0,o.withCtx)((({row:e})=>[(0,o.createElementVNode)("span",{class:(0,o.normalizeClass)({"text-error":e.error})},(0,o.toDisplayString)(e.status),3)])),_:1},8,["headers","rows"])}var c=a(81657),u={components:{SortableTable:c.A},props:{value:{type:Object,default:()=>({})}},computed:{headers(){return[{name:"condition",labelKey:"tableHeaders.condition",value:"condition",width:150,sort:"condition",dashIfEmpty:!0},{name:"status",labelKey:"tableHeaders.status",value:"status",width:75,sort:"status",dashIfEmpty:!0},{name:"time",labelKey:"tableHeaders.updated",value:"time",sort:"time",formatter:"LiveDate",formatterOpts:{addSuffix:!0},width:125,dashIfEmpty:!0},{name:"message",labelKey:"tableHeaders.message",value:"message",sort:["message"],dashIfEmpty:!0}]},rows(){return(this.value.status?.conditions||[]).map((e=>{let t=e.message||"";return e.reason&&(t=`[${e.reason}] ${t}`.trim()),{condition:e.type||"Unknown",status:e.status||"Unknown",error:e.error,time:e.lastProbeTime||e.lastUpdateTime||e.lastTransitionTime,message:t}}))}}},p=a(47433);const h=(0,p.A)(u,[["render",d]]);var m=h,f=a(35664);function v(e,t,a,n,i,l){const r=(0,o.resolveComponent)("ResourceTable");return(0,o.openBlock)(),(0,o.createElementBlock)("div",null,[(0,o.createVNode)(r,(0,o.mergeProps)({ref:"table"},e.$attrs,{schema:e.schema,rows:e.rows,"alt-loading":e.canPaginate&&!e.isFirstLoad,loading:e.loading,"group-by":e.groupBy,"group-sort":e.groupSort,groupable:e.groupable,groupTooltip:e.groupTooltip,groupOptions:e.groupOptions,"override-in-store":e.overrideInStore,headers:e.safeHeaders,namespaced:e.namespaced,"external-pagination-enabled":e.canPaginate,"external-pagination-result":e.paginationResult,onPaginationChanged:e.paginationChanged}),(0,o.createSlots)({_:2},[(0,o.renderList)(e.$slots,((t,a)=>({name:a,fn:(0,o.withCtx)((t=>[(0,o.renderSlot)(e.$slots,a,(0,o.normalizeProps)((0,o.guardReactiveProps)(t)))]))})))]),1040,["schema","rows","alt-loading","loading","group-by","group-sort","groupable","groupTooltip","groupOptions","override-in-store","headers","namespaced","external-pagination-enabled","external-pagination-result","onPaginationChanged"])])}var g=a(23667),y=a(71680),b=(0,o.defineComponent)({name:"PaginatedResourceTable",components:{ResourceTable:y.A},mixins:[g.A],props:{schema:{type:Object,required:!0},headers:{type:Array,default:null},paginationHeaders:{type:Array,default:null},groupTooltip:{type:String,default:"resourceTable.groupBy.namespace"},groupBy:{type:String,default:null},groupSort:{type:String,default:null},groupOptions:{type:Array,default:null},groupable:{type:Boolean,default:null},namespaced:{type:Boolean,default:null},fetchSecondaryResources:{type:Function,default:null},overrideInStore:{type:String,default:void 0},fetchPageSecondaryResources:{type:Function,default:null}},data(){return{resource:this.schema.id}},async fetch(){const e=[this.$fetchType(this.resource,[],this.overrideInStore||this.inStore)];this.fetchSecondaryResources&&e.push(this.fetchSecondaryResources({canPaginate:this.canPaginate})),await Promise.all(e)},computed:{safeHeaders(){const e=this.canPaginate?this.paginationHeaders:this.headers;return e||this.$store.getters["type-map/headersFor"](this.schema,this.canPaginate)}},methods:{clearSelection(){this.$refs.table.clearSelection()}}});const w=(0,p.A)(b,[["render",v]]);var k=w,S=a(14220);function E(e,t,a,n,i,l){const r=(0,o.resolveComponent)("BadgeState"),s=(0,o.resolveComponent)("ResourceTable");return(0,o.openBlock)(),(0,o.createBlock)(s,{schema:null,rows:l.rows,headers:l.headers,search:!1,"table-actions":!1,namespaced:!0,"mangle-action-resources":l.getRealResources,"paging-label":"sortableTable.paging.generic",groupable:!1},{"cell:state":(0,o.withCtx)((({row:e})=>[(0,o.createVNode)(r,{value:e},null,8,["value"])])),_:1},8,["rows","headers","mangle-action-resources"])}var x=a(73883),N=a(68774),C=a(74302),B=a(27278),D=a(41418),T={components:{ResourceTable:y.A,BadgeState:D.j},props:{value:{type:Object,required:!0},rel:{type:String,default:null},direction:{type:String,default:"to"},ignoreTypes:{type:Array,default:()=>[]}},data(){return{loadedResources:1}},computed:{filteredRelationships(){let e=this.value?.metadata?.relationships||[];return e=e.filter((e=>{const t=e[`${this.direction}Type`];return!(!t||this.ignoreTypes.includes(t))&&(!this.rel||e.rel===this.rel)})),e},rows(){if(this.loadedResources<1)return;const e=this.$store.getters["clusterId"],t=this.$store.getters["currentStore"](),a=[];for(const o of this.filteredRelationships){const n=o[`${this.direction}Type`],i=o.state||this.$store.getters[`${t}/byId`](n,o[`${this.direction}Id`])?.state||x.jv.MISSING,l=(0,x.uU)(i,o.error,o.transitioning),r=this.$store.getters[`${t}/schemaFor`](n);let s=o[`${this.direction}Id`];if(!s)continue;let d=null;const c=s.indexOf("/"),u=`${n}/${d}/${s}`;c>0&&(d=s.substr(0,c),s=s.substr(c+1));const p={name:`c-cluster-product-resource${d?"-namespace":""}-id`,params:{product:B.o,cluster:"management"===t?"local":e,resource:n,namespace:d,id:s}};a.push({type:n,id:o[`${this.direction}Id`],state:i,metadata:{namespace:d,name:s},_key:u,name:s,namespace:d,nameDisplay:s,nameSort:(0,C.RY)(s).toLowerCase(),stateColor:l,detailLocation:p,typeDisplay:this.$store.getters["type-map/labelFor"](r),stateDisplay:(0,x.ch)(i),stateBackground:l.replace("text-","bg-"),groupByLabel:d})}return a},headers(){return[N.c4,N.ZE,N.o_,N.CU]}},methods:{async getRealResources(e){const t=this.$store.getters["currentStore"](),a=await Promise.allSettled(e.map((e=>this.$store.dispatch(`${t}/find`,{type:e.type,id:e.id})))),o=[];for(let n=0;n<a.length;n++)"fulfilled"===a[n].status&&o.push(a[n].value);return this.loadedResources++,o}}};const _=(0,p.A)(T,[["render",E]]);var A=_,V=a(50025),O=a(57699),I=a(46392),P={name:"ResourceTabs",components:{Tabbed:l.A,Tab:r.A,Conditions:m,PaginatedResourceTable:k,RelatedResources:A},mixins:[s.A],props:{value:{type:Object,default:()=>({})},mode:{type:String,default:S.nW},defaultTab:{type:String,default:null},needConditions:{type:Boolean,default:!0},needEvents:{type:Boolean,default:!0},needRelated:{type:Boolean,default:!0},extensionParams:{type:Object,default:null},useHash:{type:Boolean,default:!0}},data(){const e=this.$store.getters["currentStore"](f.ll),t=this.$store.getters[`${e}/schemaFor`](f.ll),a=t?[O.ke,O.qI,N.rh,(0,I.UQ)("Subobject",t,this.$store.getters,!0),(0,I.UQ)("Source",t,this.$store.getters,!0),N.w5,(0,I.UQ)("First Seen",t,this.$store.getters,!0),(0,I.UQ)("Count",t,this.$store.getters,!0),O.l3]:[];return{eventSchema:t,EVENT:f.ll,selectedTab:this.defaultTab,inStore:e,showConditions:!1,paginationHeaders:a}},beforeUnmount(){this.$store.dispatch("cluster/forgetType",f.ll)},fetch(){this.setShowConditions()},computed:{showEvents(){return this.isView&&this.needEvents&&this.eventSchema},showRelated(){return this.isView&&this.needRelated},eventHeaders(){return[{name:"type",label:this.t("tableHeaders.type"),value:"eventType",sort:"eventType"},{name:"reason",label:this.t("tableHeaders.reason"),value:"reason",sort:"reason"},{name:"date",label:this.t("tableHeaders.updated"),value:"date",sort:"date:desc",formatter:"LiveDate",formatterOpts:{addSuffix:!0},width:125},{name:"message",label:this.t("tableHeaders.message"),value:"message",sort:"message"}]},conditionsHaveIssues(){return!!this.showConditions&&this.value.status?.conditions?.filter((e=>!(0,x.rv)(e))).some((e=>e.error))}},methods:{tabChange(e){this.selectedTab=e?.selectedName},async setShowConditions(){this.isView&&this.needConditions&&this.value?.type&&this.schema?.fetchResourceFields&&(await this.schema.fetchResourceFields(),this.showConditions=this.$store.getters[`${this.inStore}/pathExistsInSchema`](this.value.type,"status.conditions"))},filterEventsLocal(e){return e.filter((e=>e.involvedObject?.uid===this.value?.metadata?.uid))},filterEventsApi(e){e.filters||(e.filters=[]);const t="involvedObject.uid";let a=null;for(let n=0;n<e.filters.length;n++){const o=e.filters[n];if(o.fields.find((e=>e.field===t))){a=o;break}}const o=V.eY.createSingleField({field:t,exact:!0,value:this.value.metadata.uid,equals:!0});return a?Object.assign(a,o):e.filters.push(o),e}}};a(98746);const L=(0,p.A)(P,[["render",i],["__scopeId","data-v-051f04e8"]]);var M=L},24243:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".node-selector{position:relative}",""]),t["default"]=r},40439:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".label[data-v-a3d99010]{display:flex;flex-direction:column}.label .value[data-v-a3d99010]{font-size:14px;line-height:18px}",""]),t["default"]=r},15829:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".label[data-v-357627fa]{display:flex;flex-direction:column}.label .value[data-v-357627fa]{font-size:14px;line-height:18px}",""]),t["default"]=r},20916:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".key-value{width:100%}.key-value .file-selector.role-link{text-transform:none;padding:0}.key-value .kv-container{display:grid;align-items:center;-moz-column-gap:20px;column-gap:20px}.key-value .kv-container .key-value-label{margin-bottom:0}.key-value .kv-container .kv-item{width:100%;margin:10px 0 10px 0}.key-value .kv-container .kv-item.extra,.key-value .kv-container .kv-item.key{align-self:flex-start}.key-value .kv-container .kv-item.value .value-container.upload-button{position:relative;display:flex;justify-content:right;align-items:center}.key-value .kv-container .kv-item.value .value-container .file-selector{position:absolute;margin-right:5px}.key-value .kv-container .kv-item.value textarea{padding:10px 10px 10px 10px}.key-value .kv-container .kv-item .text-monospace:not(.conceal){font-family:monospace,monospace}.key-value .row,.key-value .rowgroup{display:grid;grid-column-start:1;grid-column-end:span end;grid-template-columns:subgrid}.key-value .row:before{display:none}.key-value .remove{text-align:center}.key-value .remove BUTTON{padding:0}.key-value .title{margin-bottom:10px}.key-value .title .read-from-file{float:right}.key-value input{height:40px;line-height:1}.key-value .footer .protip{float:right;padding:5px 0}.key-value .download{text-align:right}.key-value .copy-value{padding:0 0 0 10px}.labeled-input-key{position:relative;display:flex;border-collapse:separate;z-index:0}",""]),t["default"]=r},71488:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".labels__header[data-v-d91f8768]{display:flex;justify-content:space-between}",""]),t["default"]=r},52865:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".operator .vs__dropdown-option[data-v-6b569773]{padding:3px 6px 3px 6px!important}.remove-expression[data-v-6b569773]{padding:8px;position:absolute;margin-bottom:10px;right:0;top:0;z-index:2}.remove-expression i[data-v-6b569773]{font-size:2em}.remove-container[data-v-6b569773]{display:flex;justify-content:center}.match-expression-header[data-v-6b569773],.match-expression-row[data-v-6b569773]{display:grid;grid-template-columns:1fr 1fr 1fr;margin:5px 0;grid-gap:1.75%}.match-expression-header>LABEL[data-v-6b569773],.match-expression-row>LABEL[data-v-6b569773]{margin:0}.match-expression-header[data-v-6b569773]:not(.view),.match-expression-row[data-v-6b569773]:not(.view){grid-template-columns:repeat(3,1fr) 50px}.match-expression-row>div>input[data-v-6b569773]{min-height:40px!important}.match-expression-header-matching[data-v-6b569773],.match-expression-row-matching[data-v-6b569773]{grid-template-columns:1fr 1fr 1fr 1fr}.match-expression-header-matching[data-v-6b569773]:not(.view),.match-expression-row-matching[data-v-6b569773]:not(.view){grid-template-columns:1fr 1fr 1fr 1fr 100px}",""]),t["default"]=r},52618:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".password[data-v-3b3998e6]{display:flex;flex-direction:column}.password .labeled-input .addon[data-v-3b3998e6]{display:flex;align-items:center;justify-content:center;padding-left:12px;min-width:65px}.password .labeled-input .addon .hide-show[data-v-3b3998e6]:focus-visible{outline:2px solid var(--primary-keyboard-focus);outline-offset:4px}.password .genPassword[data-v-3b3998e6]{display:flex;justify-content:flex-end}",""]),t["default"]=r},61562:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),i=a(40935),l=a.n(i),r=l()(n());r.push([e.id,".resource-tabs.view[data-v-051f04e8] .tabs.horizontal{border:none}.resource-tabs.view[data-v-051f04e8] .tabs.horizontal+.tab-container{border:none;border-top:1px solid var(--border);padding:0;padding-top:24px}",""]),t["default"]=r},98285:function(e,t,a){"use strict";a.d(t,{Hi:function(){return Rt}});var o=a(9274);
|
|
/*!
|
|
* vue-draggable-next v2.3.0
|
|
* (c) 2025 Anish George
|
|
* @license MIT
|
|
*/
|
|
function n(){return"undefined"!==typeof window?window.console:a.g.console}const i=n();function l(e){const t=Object.create(null);return function(a){const o=t[a];return o||(t[a]=e(a))}}const r=/-(\w)/g,s=l((e=>e.replace(r,((e,t)=>t?t.toUpperCase():""))));function d(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function c(e,t,a){const o=0===a?e.children[0]:e.children[a-1].nextSibling;e.insertBefore(t,o)}
|
|
/**!
|
|
* Sortable 1.14.0
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function p(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach((function(t){m(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function h(e){return h="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function m(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},f.apply(this,arguments)}function v(e,t){if(null==e)return{};var a,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)a=i[o],t.indexOf(a)>=0||(n[a]=e[a]);return n}function g(e,t){if(null==e)return{};var a,o,n=v(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)a=i[o],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var y="1.14.0";function b(e){if("undefined"!==typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var w=b(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),k=b(/Edge/i),S=b(/firefox/i),E=b(/safari/i)&&!b(/chrome/i)&&!b(/android/i),x=b(/iP(ad|od|hone)/i),N=b(/chrome/i)&&b(/android/i),C={capture:!1,passive:!1};function B(e,t,a){e.addEventListener(t,a,!w&&C)}function D(e,t,a){e.removeEventListener(t,a,!w&&C)}function T(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(a){return!1}return!1}}function _(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function A(e,t,a,o){if(e){a=a||document;do{if(null!=t&&(">"===t[0]?e.parentNode===a&&T(e,t):T(e,t))||o&&e===a)return e;if(e===a)break}while(e=_(e))}return null}var V,O=/\s+/g;function I(e,t,a){if(e&&t)if(e.classList)e.classList[a?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(O," ").replace(" "+t+" "," ");e.className=(o+(a?" "+t:"")).replace(O," ")}}function P(e,t,a){var o=e&&e.style;if(o){if(void 0===a)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(a=e.currentStyle),void 0===t?a:a[t];t in o||-1!==t.indexOf("webkit")||(t="-webkit-"+t),o[t]=a+("string"===typeof a?"":"px")}}function L(e,t){var a="";if("string"===typeof e)a=e;else do{var o=P(e,"transform");o&&"none"!==o&&(a=o+" "+a)}while(!t&&(e=e.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(a)}function M(e,t,a){if(e){var o=e.getElementsByTagName(t),n=0,i=o.length;if(a)for(;n<i;n++)a(o[n],n);return o}return[]}function $(){var e=document.scrollingElement;return e||document.documentElement}function R(e,t,a,o,n){if(e.getBoundingClientRect||e===window){var i,l,r,s,d,c,u;if(e!==window&&e.parentNode&&e!==$()?(i=e.getBoundingClientRect(),l=i.top,r=i.left,s=i.bottom,d=i.right,c=i.height,u=i.width):(l=0,r=0,s=window.innerHeight,d=window.innerWidth,c=window.innerHeight,u=window.innerWidth),(t||a)&&e!==window&&(n=n||e.parentNode,!w))do{if(n&&n.getBoundingClientRect&&("none"!==P(n,"transform")||a&&"static"!==P(n,"position"))){var p=n.getBoundingClientRect();l-=p.top+parseInt(P(n,"border-top-width")),r-=p.left+parseInt(P(n,"border-left-width")),s=l+i.height,d=r+i.width;break}}while(n=n.parentNode);if(o&&e!==window){var h=L(n||e),m=h&&h.a,f=h&&h.d;h&&(l/=f,r/=m,u/=m,c/=f,s=l+c,d=r+u)}return{top:l,left:r,bottom:s,right:d,width:u,height:c}}}function U(e,t,a){var o=z(e,!0),n=R(e)[t];while(o){var i=R(o)[a],l=void 0;if(l="top"===a||"left"===a?n>=i:n<=i,!l)return o;if(o===$())break;o=z(o,!1)}return!1}function F(e,t,a,o){var n=0,i=0,l=e.children;while(i<l.length){if("none"!==l[i].style.display&&l[i]!==at.ghost&&(o||l[i]!==at.dragged)&&A(l[i],a.draggable,e,!1)){if(n===t)return l[i];n++}i++}return null}function j(e,t){var a=e.lastElementChild;while(a&&(a===at.ghost||"none"===P(a,"display")||t&&!T(a,t)))a=a.previousElementSibling;return a||null}function q(e,t){var a=0;if(!e||!e.parentNode)return-1;while(e=e.previousElementSibling)"TEMPLATE"===e.nodeName.toUpperCase()||e===at.clone||t&&!T(e,t)||a++;return a}function H(e){var t=0,a=0,o=$();if(e)do{var n=L(e),i=n.a,l=n.d;t+=e.scrollLeft*i,a+=e.scrollTop*l}while(e!==o&&(e=e.parentNode));return[t,a]}function K(e,t){for(var a in e)if(e.hasOwnProperty(a))for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[a][o])return Number(a);return-1}function z(e,t){if(!e||!e.getBoundingClientRect)return $();var a=e,o=!1;do{if(a.clientWidth<a.scrollWidth||a.clientHeight<a.scrollHeight){var n=P(a);if(a.clientWidth<a.scrollWidth&&("auto"==n.overflowX||"scroll"==n.overflowX)||a.clientHeight<a.scrollHeight&&("auto"==n.overflowY||"scroll"==n.overflowY)){if(!a.getBoundingClientRect||a===document.body)return $();if(o||t)return a;o=!0}}}while(a=a.parentNode);return $()}function X(e,t){if(e&&t)for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e}function Y(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function W(e,t){return function(){if(!V){var a=arguments,o=this;1===a.length?e.call(o,a[0]):e.apply(o,a),V=setTimeout((function(){V=void 0}),t)}}}function G(){clearTimeout(V),V=void 0}function Q(e,t,a){e.scrollLeft+=t,e.scrollTop+=a}function J(e){var t=window.Polymer,a=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):a?a(e).clone(!0)[0]:e.cloneNode(!0)}var Z="Sortable"+(new Date).getTime();function ee(){var e,t=[];return{captureAnimationState:function(){if(t=[],this.options.animation){var e=[].slice.call(this.el.children);e.forEach((function(e){if("none"!==P(e,"display")&&e!==at.ghost){t.push({target:e,rect:R(e)});var a=p({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=L(e,!0);o&&(a.top-=o.f,a.left-=o.e)}e.fromRect=a}}))}},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(K(t,{target:e}),1)},animateAll:function(a){var o=this;if(!this.options.animation)return clearTimeout(e),void("function"===typeof a&&a());var n=!1,i=0;t.forEach((function(e){var t=0,a=e.target,l=a.fromRect,r=R(a),s=a.prevFromRect,d=a.prevToRect,c=e.rect,u=L(a,!0);u&&(r.top-=u.f,r.left-=u.e),a.toRect=r,a.thisAnimationDuration&&Y(s,r)&&!Y(l,r)&&(c.top-r.top)/(c.left-r.left)===(l.top-r.top)/(l.left-r.left)&&(t=ae(c,s,d,o.options)),Y(r,l)||(a.prevFromRect=l,a.prevToRect=r,t||(t=o.options.animation),o.animate(a,c,r,t)),t&&(n=!0,i=Math.max(i,t),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout((function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null}),t),a.thisAnimationDuration=t)})),clearTimeout(e),n?e=setTimeout((function(){"function"===typeof a&&a()}),i):"function"===typeof a&&a(),t=[]},animate:function(e,t,a,o){if(o){P(e,"transition",""),P(e,"transform","");var n=L(this.el),i=n&&n.a,l=n&&n.d,r=(t.left-a.left)/(i||1),s=(t.top-a.top)/(l||1);e.animatingX=!!r,e.animatingY=!!s,P(e,"transform","translate3d("+r+"px,"+s+"px,0)"),this.forRepaintDummy=te(e),P(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),P(e,"transform","translate3d(0,0,0)"),"number"===typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){P(e,"transition",""),P(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),o)}}}}function te(e){return e.offsetWidth}function ae(e,t,a,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))*o.animation}var oe=[],ne={initializeByDefault:!0},ie={mount:function(e){for(var t in ne)ne.hasOwnProperty(t)&&!(t in e)&&(e[t]=ne[t]);oe.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),oe.push(e)},pluginEvent:function(e,t,a){var o=this;this.eventCanceled=!1,a.cancel=function(){o.eventCanceled=!0};var n=e+"Global";oe.forEach((function(o){t[o.pluginName]&&(t[o.pluginName][n]&&t[o.pluginName][n](p({sortable:t},a)),t.options[o.pluginName]&&t[o.pluginName][e]&&t[o.pluginName][e](p({sortable:t},a)))}))},initializePlugins:function(e,t,a,o){for(var n in oe.forEach((function(o){var n=o.pluginName;if(e.options[n]||o.initializeByDefault){var i=new o(e,t,e.options);i.sortable=e,i.options=e.options,e[n]=i,f(a,i.defaults)}})),e.options)if(e.options.hasOwnProperty(n)){var i=this.modifyOption(e,n,e.options[n]);"undefined"!==typeof i&&(e.options[n]=i)}},getEventProperties:function(e,t){var a={};return oe.forEach((function(o){"function"===typeof o.eventProperties&&f(a,o.eventProperties.call(t[o.pluginName],e))})),a},modifyOption:function(e,t,a){var o;return oe.forEach((function(n){e[n.pluginName]&&n.optionListeners&&"function"===typeof n.optionListeners[t]&&(o=n.optionListeners[t].call(e[n.pluginName],a))})),o}};function le(e){var t=e.sortable,a=e.rootEl,o=e.name,n=e.targetEl,i=e.cloneEl,l=e.toEl,r=e.fromEl,s=e.oldIndex,d=e.newIndex,c=e.oldDraggableIndex,u=e.newDraggableIndex,h=e.originalEvent,m=e.putSortable,f=e.extraEventProperties;if(t=t||a&&a[Z],t){var v,g=t.options,y="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||w||k?(v=document.createEvent("Event"),v.initEvent(o,!0,!0)):v=new CustomEvent(o,{bubbles:!0,cancelable:!0}),v.to=l||a,v.from=r||a,v.item=n||a,v.clone=i,v.oldIndex=s,v.newIndex=d,v.oldDraggableIndex=c,v.newDraggableIndex=u,v.originalEvent=h,v.pullMode=m?m.lastPutMode:void 0;var b=p(p({},f),ie.getEventProperties(o,t));for(var S in b)v[S]=b[S];a&&a.dispatchEvent(v),g[y]&&g[y].call(t,v)}}var re=["evt"],se=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=a.evt,n=g(a,re);ie.pluginEvent.bind(at)(e,t,p({dragEl:ce,parentEl:ue,ghostEl:pe,rootEl:he,nextEl:me,lastDownEl:fe,cloneEl:ve,cloneHidden:ge,dragStarted:_e,putSortable:Ee,activeSortable:at.active,originalEvent:o,oldIndex:ye,oldDraggableIndex:we,newIndex:be,newDraggableIndex:ke,hideGhostForTarget:Je,unhideGhostForTarget:Ze,cloneNowHidden:function(){ge=!0},cloneNowShown:function(){ge=!1},dispatchSortableEvent:function(e){de({sortable:t,name:e,originalEvent:o})}},n))};function de(e){le(p({putSortable:Ee,cloneEl:ve,targetEl:ce,rootEl:he,oldIndex:ye,oldDraggableIndex:we,newIndex:be,newDraggableIndex:ke},e))}var ce,ue,pe,he,me,fe,ve,ge,ye,be,we,ke,Se,Ee,xe,Ne,Ce,Be,De,Te,_e,Ae,Ve,Oe,Ie,Pe=!1,Le=!1,Me=[],$e=!1,Re=!1,Ue=[],Fe=!1,je=[],qe="undefined"!==typeof document,He=x,Ke=k||w?"cssFloat":"float",ze=qe&&!N&&!x&&"draggable"in document.createElement("div"),Xe=function(){if(qe){if(w)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Ye=function(e,t){var a=P(e),o=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),n=F(e,0,t),i=F(e,1,t),l=n&&P(n),r=i&&P(i),s=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+R(n).width,d=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+R(i).width;if("flex"===a.display)return"column"===a.flexDirection||"column-reverse"===a.flexDirection?"vertical":"horizontal";if("grid"===a.display)return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(n&&l["float"]&&"none"!==l["float"]){var c="left"===l["float"]?"left":"right";return!i||"both"!==r.clear&&r.clear!==c?"horizontal":"vertical"}return n&&("block"===l.display||"flex"===l.display||"table"===l.display||"grid"===l.display||s>=o&&"none"===a[Ke]||i&&"none"===a[Ke]&&s+d>o)?"vertical":"horizontal"},We=function(e,t,a){var o=a?e.left:e.top,n=a?e.right:e.bottom,i=a?e.width:e.height,l=a?t.left:t.top,r=a?t.right:t.bottom,s=a?t.width:t.height;return o===l||n===r||o+i/2===l+s/2},Ge=function(e,t){var a;return Me.some((function(o){var n=o[Z].options.emptyInsertThreshold;if(n&&!j(o)){var i=R(o),l=e>=i.left-n&&e<=i.right+n,r=t>=i.top-n&&t<=i.bottom+n;return l&&r?a=o:void 0}})),a},Qe=function(e){function t(e,a){return function(o,n,i,l){var r=o.options.group.name&&n.options.group.name&&o.options.group.name===n.options.group.name;if(null==e&&(a||r))return!0;if(null==e||!1===e)return!1;if(a&&"clone"===e)return e;if("function"===typeof e)return t(e(o,n,i,l),a)(o,n,i,l);var s=(a?o:n).options.group.name;return!0===e||"string"===typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var a={},o=e.group;o&&"object"==h(o)||(o={name:o}),a.name=o.name,a.checkPull=t(o.pull,!0),a.checkPut=t(o.put),a.revertClone=o.revertClone,e.group=a},Je=function(){!Xe&&pe&&P(pe,"display","none")},Ze=function(){!Xe&&pe&&P(pe,"display","")};qe&&document.addEventListener("click",(function(e){if(Le)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Le=!1,!1}),!0);var et=function(e){if(ce){e=e.touches?e.touches[0]:e;var t=Ge(e.clientX,e.clientY);if(t){var a={};for(var o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);a.target=a.rootEl=t,a.preventDefault=void 0,a.stopPropagation=void 0,t[Z]._onDragOver(a)}}},tt=function(e){ce&&ce.parentNode[Z]._isOutsideThisEl(e.target)};function at(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=f({},t),e[Z]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ye(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==at.supportPointer&&"PointerEvent"in window&&!E,emptyInsertThreshold:5};for(var o in ie.initializePlugins(this,e,a),a)!(o in t)&&(t[o]=a[o]);for(var n in Qe(t),this)"_"===n.charAt(0)&&"function"===typeof this[n]&&(this[n]=this[n].bind(this));this.nativeDraggable=!t.forceFallback&&ze,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?B(e,"pointerdown",this._onTapStart):(B(e,"mousedown",this._onTapStart),B(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(B(e,"dragover",this),B(e,"dragenter",this)),Me.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),f(this,ee())}function ot(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function nt(e,t,a,o,n,i,l,r){var s,d,c=e[Z],u=c.options.onMove;return!window.CustomEvent||w||k?(s=document.createEvent("Event"),s.initEvent("move",!0,!0)):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=a,s.draggedRect=o,s.related=n||t,s.relatedRect=i||R(t),s.willInsertAfter=r,s.originalEvent=l,e.dispatchEvent(s),u&&(d=u.call(c,s,l)),d}function it(e){e.draggable=!1}function lt(){Fe=!1}function rt(e,t,a){var o=R(F(a.el,0,a.options,!0)),n=10;return t?e.clientX<o.left-n||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-n||e.clientY<o.bottom&&e.clientX<o.left}function st(e,t,a){var o=R(j(a.el,a.options.draggable)),n=10;return t?e.clientX>o.right+n||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+n}function dt(e,t,a,o,n,i,l,r){var s=o?e.clientY:e.clientX,d=o?a.height:a.width,c=o?a.top:a.left,u=o?a.bottom:a.right,p=!1;if(!l)if(r&&Oe<d*n){if(!$e&&(1===Ve?s>c+d*i/2:s<u-d*i/2)&&($e=!0),$e)p=!0;else if(1===Ve?s<c+Oe:s>u-Oe)return-Ve}else if(s>c+d*(1-n)/2&&s<u-d*(1-n)/2)return ct(t);return p=p||l,p&&(s<c+d*i/2||s>u-d*i/2)?s>c+d/2?1:-1:0}function ct(e){return q(ce)<q(e)?1:-1}function ut(e){var t=e.tagName+e.className+e.src+e.href+e.textContent,a=t.length,o=0;while(a--)o+=t.charCodeAt(a);return o.toString(36)}function pt(e){je.length=0;var t=e.getElementsByTagName("input"),a=t.length;while(a--){var o=t[a];o.checked&&je.push(o)}}function ht(e){return setTimeout(e,0)}function mt(e){return clearTimeout(e)}at.prototype={constructor:at,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ae=null)},_getDirection:function(e,t){return"function"===typeof this.options.direction?this.options.direction.call(this,e,t,ce):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,a=this.el,o=this.options,n=o.preventOnFilter,i=e.type,l=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,r=(l||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||r,d=o.filter;if(pt(a),!ce&&!(/mousedown|pointerdown/.test(i)&&0!==e.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!E||!r||"SELECT"!==r.tagName.toUpperCase())&&(r=A(r,o.draggable,a,!1),(!r||!r.animated)&&fe!==r)){if(ye=q(r),we=q(r,o.draggable),"function"===typeof d){if(d.call(this,e,r,this))return de({sortable:t,rootEl:s,name:"filter",targetEl:r,toEl:a,fromEl:a}),se("filter",t,{evt:e}),void(n&&e.cancelable&&e.preventDefault())}else if(d&&(d=d.split(",").some((function(o){if(o=A(s,o.trim(),a,!1),o)return de({sortable:t,rootEl:o,name:"filter",targetEl:r,fromEl:a,toEl:a}),se("filter",t,{evt:e}),!0})),d))return void(n&&e.cancelable&&e.preventDefault());o.handle&&!A(s,o.handle,a,!1)||this._prepareDragStart(e,l,r)}}},_prepareDragStart:function(e,t,a){var o,n=this,i=n.el,l=n.options,r=i.ownerDocument;if(a&&!ce&&a.parentNode===i){var s=R(a);if(he=i,ce=a,ue=ce.parentNode,me=ce.nextSibling,fe=a,Se=l.group,at.dragged=ce,xe={target:ce,clientX:(t||e).clientX,clientY:(t||e).clientY},De=xe.clientX-s.left,Te=xe.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ce.style["will-change"]="all",o=function(){se("delayEnded",n,{evt:e}),at.eventCanceled?n._onDrop():(n._disableDelayedDragEvents(),!S&&n.nativeDraggable&&(ce.draggable=!0),n._triggerDragStart(e,t),de({sortable:n,name:"choose",originalEvent:e}),I(ce,l.chosenClass,!0))},l.ignore.split(",").forEach((function(e){M(ce,e.trim(),it)})),B(r,"dragover",et),B(r,"mousemove",et),B(r,"touchmove",et),B(r,"mouseup",n._onDrop),B(r,"touchend",n._onDrop),B(r,"touchcancel",n._onDrop),S&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ce.draggable=!0),se("delayStart",this,{evt:e}),!l.delay||l.delayOnTouchOnly&&!t||this.nativeDraggable&&(k||w))o();else{if(at.eventCanceled)return void this._onDrop();B(r,"mouseup",n._disableDelayedDrag),B(r,"touchend",n._disableDelayedDrag),B(r,"touchcancel",n._disableDelayedDrag),B(r,"mousemove",n._delayedDragTouchMoveHandler),B(r,"touchmove",n._delayedDragTouchMoveHandler),l.supportPointer&&B(r,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(o,l.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ce&&it(ce),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;D(e,"mouseup",this._disableDelayedDrag),D(e,"touchend",this._disableDelayedDrag),D(e,"touchcancel",this._disableDelayedDrag),D(e,"mousemove",this._delayedDragTouchMoveHandler),D(e,"touchmove",this._delayedDragTouchMoveHandler),D(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?B(document,"pointermove",this._onTouchMove):B(document,t?"touchmove":"mousemove",this._onTouchMove):(B(ce,"dragend",this),B(he,"dragstart",this._onDragStart));try{document.selection?ht((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(a){}},_dragStarted:function(e,t){if(Pe=!1,he&&ce){se("dragStarted",this,{evt:t}),this.nativeDraggable&&B(document,"dragover",tt);var a=this.options;!e&&I(ce,a.dragClass,!1),I(ce,a.ghostClass,!0),at.active=this,e&&this._appendGhost(),de({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Ne){this._lastX=Ne.clientX,this._lastY=Ne.clientY,Je();var e=document.elementFromPoint(Ne.clientX,Ne.clientY),t=e;while(e&&e.shadowRoot){if(e=e.shadowRoot.elementFromPoint(Ne.clientX,Ne.clientY),e===t)break;t=e}if(ce.parentNode[Z]._isOutsideThisEl(e),t)do{if(t[Z]){var a=void 0;if(a=t[Z]._onDragOver({clientX:Ne.clientX,clientY:Ne.clientY,target:e,rootEl:t}),a&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Ze()}},_onTouchMove:function(e){if(xe){var t=this.options,a=t.fallbackTolerance,o=t.fallbackOffset,n=e.touches?e.touches[0]:e,i=pe&&L(pe,!0),l=pe&&i&&i.a,r=pe&&i&&i.d,s=He&&Ie&&H(Ie),d=(n.clientX-xe.clientX+o.x)/(l||1)+(s?s[0]-Ue[0]:0)/(l||1),c=(n.clientY-xe.clientY+o.y)/(r||1)+(s?s[1]-Ue[1]:0)/(r||1);if(!at.active&&!Pe){if(a&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))<a)return;this._onDragStart(e,!0)}if(pe){i?(i.e+=d-(Ce||0),i.f+=c-(Be||0)):i={a:1,b:0,c:0,d:1,e:d,f:c};var u="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");P(pe,"webkitTransform",u),P(pe,"mozTransform",u),P(pe,"msTransform",u),P(pe,"transform",u),Ce=d,Be=c,Ne=n}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!pe){var e=this.options.fallbackOnBody?document.body:he,t=R(ce,!0,He,!0,e),a=this.options;if(He){Ie=e;while("static"===P(Ie,"position")&&"none"===P(Ie,"transform")&&Ie!==document)Ie=Ie.parentNode;Ie!==document.body&&Ie!==document.documentElement?(Ie===document&&(Ie=$()),t.top+=Ie.scrollTop,t.left+=Ie.scrollLeft):Ie=$(),Ue=H(Ie)}pe=ce.cloneNode(!0),I(pe,a.ghostClass,!1),I(pe,a.fallbackClass,!0),I(pe,a.dragClass,!0),P(pe,"transition",""),P(pe,"transform",""),P(pe,"box-sizing","border-box"),P(pe,"margin",0),P(pe,"top",t.top),P(pe,"left",t.left),P(pe,"width",t.width),P(pe,"height",t.height),P(pe,"opacity","0.8"),P(pe,"position",He?"absolute":"fixed"),P(pe,"zIndex","100000"),P(pe,"pointerEvents","none"),at.ghost=pe,e.appendChild(pe),P(pe,"transform-origin",De/parseInt(pe.style.width)*100+"% "+Te/parseInt(pe.style.height)*100+"%")}},_onDragStart:function(e,t){var a=this,o=e.dataTransfer,n=a.options;se("dragStart",this,{evt:e}),at.eventCanceled?this._onDrop():(se("setupClone",this),at.eventCanceled||(ve=J(ce),ve.draggable=!1,ve.style["will-change"]="",this._hideClone(),I(ve,this.options.chosenClass,!1),at.clone=ve),a.cloneId=ht((function(){se("clone",a),at.eventCanceled||(a.options.removeCloneOnHide||he.insertBefore(ve,ce),a._hideClone(),de({sortable:a,name:"clone"}))})),!t&&I(ce,n.dragClass,!0),t?(Le=!0,a._loopId=setInterval(a._emulateDragOver,50)):(D(document,"mouseup",a._onDrop),D(document,"touchend",a._onDrop),D(document,"touchcancel",a._onDrop),o&&(o.effectAllowed="move",n.setData&&n.setData.call(a,o,ce)),B(document,"drop",a),P(ce,"transform","translateZ(0)")),Pe=!0,a._dragStartId=ht(a._dragStarted.bind(a,t,e)),B(document,"selectstart",a),_e=!0,E&&P(document.body,"user-select","none"))},_onDragOver:function(e){var t,a,o,n,i=this.el,l=e.target,r=this.options,s=r.group,d=at.active,c=Se===s,u=r.sort,h=Ee||d,m=this,f=!1;if(!Fe){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),l=A(l,r.draggable,i,!0),_("dragOver"),at.eventCanceled)return f;if(ce.contains(e.target)||l.animated&&l.animatingX&&l.animatingY||m._ignoreWhileAnimating===l)return O(!1);if(Le=!1,d&&!r.disabled&&(c?u||(o=ue!==he):Ee===this||(this.lastPutMode=Se.checkPull(this,d,ce,e))&&s.checkPut(this,d,ce,e))){if(n="vertical"===this._getDirection(e,l),t=R(ce),_("dragOverValid"),at.eventCanceled)return f;if(o)return ue=he,V(),this._hideClone(),_("revert"),at.eventCanceled||(me?he.insertBefore(ce,me):he.appendChild(ce)),O(!0);var v=j(i,r.draggable);if(!v||st(e,n,this)&&!v.animated){if(v===ce)return O(!1);if(v&&i===e.target&&(l=v),l&&(a=R(l)),!1!==nt(he,i,ce,t,l,a,e,!!l))return V(),i.appendChild(ce),ue=i,L(),O(!0)}else if(v&&rt(e,n,this)){var g=F(i,0,r,!0);if(g===ce)return O(!1);if(l=g,a=R(l),!1!==nt(he,i,ce,t,l,a,e,!1))return V(),i.insertBefore(ce,g),ue=i,L(),O(!0)}else if(l.parentNode===i){a=R(l);var y,b,w=0,k=ce.parentNode!==i,S=!We(ce.animated&&ce.toRect||t,l.animated&&l.toRect||a,n),E=n?"top":"left",x=U(l,"top","top")||U(ce,"top","top"),N=x?x.scrollTop:void 0;if(Ae!==l&&(y=a[E],$e=!1,Re=!S&&r.invertSwap||k),w=dt(e,l,a,n,S?1:r.swapThreshold,null==r.invertedSwapThreshold?r.swapThreshold:r.invertedSwapThreshold,Re,Ae===l),0!==w){var C=q(ce);do{C-=w,b=ue.children[C]}while(b&&("none"===P(b,"display")||b===pe))}if(0===w||b===l)return O(!1);Ae=l,Ve=w;var B=l.nextElementSibling,D=!1;D=1===w;var T=nt(he,i,ce,t,l,a,e,D);if(!1!==T)return 1!==T&&-1!==T||(D=1===T),Fe=!0,setTimeout(lt,30),V(),D&&!B?i.appendChild(ce):l.parentNode.insertBefore(ce,D?B:l),x&&Q(x,0,N-x.scrollTop),ue=ce.parentNode,void 0===y||Re||(Oe=Math.abs(y-R(l)[E])),L(),O(!0)}if(i.contains(ce))return O(!1)}return!1}function _(r,s){se(r,m,p({evt:e,isOwner:c,axis:n?"vertical":"horizontal",revert:o,dragRect:t,targetRect:a,canSort:u,fromSortable:h,target:l,completed:O,onMove:function(a,o){return nt(he,i,ce,t,a,R(a),e,o)},changed:L},s))}function V(){_("dragOverAnimationCapture"),m.captureAnimationState(),m!==h&&h.captureAnimationState()}function O(t){return _("dragOverCompleted",{insertion:t}),t&&(c?d._hideClone():d._showClone(m),m!==h&&(I(ce,Ee?Ee.options.ghostClass:d.options.ghostClass,!1),I(ce,r.ghostClass,!0)),Ee!==m&&m!==at.active?Ee=m:m===at.active&&Ee&&(Ee=null),h===m&&(m._ignoreWhileAnimating=l),m.animateAll((function(){_("dragOverAnimationComplete"),m._ignoreWhileAnimating=null})),m!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(l===ce&&!ce.animated||l===i&&!l.animated)&&(Ae=null),r.dragoverBubble||e.rootEl||l===document||(ce.parentNode[Z]._isOutsideThisEl(e.target),!t&&et(e)),!r.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function L(){be=q(ce),ke=q(ce,r.draggable),de({sortable:m,name:"change",toEl:i,newIndex:be,newDraggableIndex:ke,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){D(document,"mousemove",this._onTouchMove),D(document,"touchmove",this._onTouchMove),D(document,"pointermove",this._onTouchMove),D(document,"dragover",et),D(document,"mousemove",et),D(document,"touchmove",et)},_offUpEvents:function(){var e=this.el.ownerDocument;D(e,"mouseup",this._onDrop),D(e,"touchend",this._onDrop),D(e,"pointerup",this._onDrop),D(e,"touchcancel",this._onDrop),D(document,"selectstart",this)},_onDrop:function(e){var t=this.el,a=this.options;be=q(ce),ke=q(ce,a.draggable),se("drop",this,{evt:e}),ue=ce&&ce.parentNode,be=q(ce),ke=q(ce,a.draggable),at.eventCanceled||(Pe=!1,Re=!1,$e=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),mt(this.cloneId),mt(this._dragStartId),this.nativeDraggable&&(D(document,"drop",this),D(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),E&&P(document.body,"user-select",""),P(ce,"transform",""),e&&(_e&&(e.cancelable&&e.preventDefault(),!a.dropBubble&&e.stopPropagation()),pe&&pe.parentNode&&pe.parentNode.removeChild(pe),(he===ue||Ee&&"clone"!==Ee.lastPutMode)&&ve&&ve.parentNode&&ve.parentNode.removeChild(ve),ce&&(this.nativeDraggable&&D(ce,"dragend",this),it(ce),ce.style["will-change"]="",_e&&!Pe&&I(ce,Ee?Ee.options.ghostClass:this.options.ghostClass,!1),I(ce,this.options.chosenClass,!1),de({sortable:this,name:"unchoose",toEl:ue,newIndex:null,newDraggableIndex:null,originalEvent:e}),he!==ue?(be>=0&&(de({rootEl:ue,name:"add",toEl:ue,fromEl:he,originalEvent:e}),de({sortable:this,name:"remove",toEl:ue,originalEvent:e}),de({rootEl:ue,name:"sort",toEl:ue,fromEl:he,originalEvent:e}),de({sortable:this,name:"sort",toEl:ue,originalEvent:e})),Ee&&Ee.save()):be!==ye&&be>=0&&(de({sortable:this,name:"update",toEl:ue,originalEvent:e}),de({sortable:this,name:"sort",toEl:ue,originalEvent:e})),at.active&&(null!=be&&-1!==be||(be=ye,ke=we),de({sortable:this,name:"end",toEl:ue,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){se("nulling",this),he=ce=ue=pe=me=ve=fe=ge=xe=Ne=_e=be=ke=ye=we=Ae=Ve=Ee=Se=at.dragged=at.ghost=at.clone=at.active=null,je.forEach((function(e){e.checked=!0})),je.length=Ce=Be=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ce&&(this._onDragOver(e),ot(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e,t=[],a=this.el.children,o=0,n=a.length,i=this.options;o<n;o++)e=a[o],A(e,i.draggable,this.el,!1)&&t.push(e.getAttribute(i.dataIdAttr)||ut(e));return t},sort:function(e,t){var a={},o=this.el;this.toArray().forEach((function(e,t){var n=o.children[t];A(n,this.options.draggable,o,!1)&&(a[e]=n)}),this),t&&this.captureAnimationState(),e.forEach((function(e){a[e]&&(o.removeChild(a[e]),o.appendChild(a[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return A(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var a=this.options;if(void 0===t)return a[e];var o=ie.modifyOption(this,e,t);a[e]="undefined"!==typeof o?o:t,"group"===e&&Qe(a)},destroy:function(){se("destroy",this);var e=this.el;e[Z]=null,D(e,"mousedown",this._onTapStart),D(e,"touchstart",this._onTapStart),D(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(D(e,"dragover",this),D(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Me.splice(Me.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ge){if(se("hideClone",this),at.eventCanceled)return;P(ve,"display","none"),this.options.removeCloneOnHide&&ve.parentNode&&ve.parentNode.removeChild(ve),ge=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(ge){if(se("showClone",this),at.eventCanceled)return;ce.parentNode!=he||this.options.group.revertClone?me?he.insertBefore(ve,me):he.appendChild(ve):he.insertBefore(ve,ce),this.options.group.revertClone&&this.animate(ce,ve),P(ve,"display",""),ge=!1}}else this._hideClone()}},qe&&B(document,"touchmove",(function(e){(at.active||Pe)&&e.cancelable&&e.preventDefault()})),at.utils={on:B,off:D,css:P,find:M,is:function(e,t){return!!A(e,t,e,!1)},extend:X,throttle:W,closest:A,toggleClass:I,clone:J,index:q,nextTick:ht,cancelNextTick:mt,detectDirection:Ye,getChild:F},at.get=function(e){return e[Z]},at.mount=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(at.utils=p(p({},at.utils),e.utils)),ie.mount(e)}))},at.create=function(e,t){return new at(e,t)},at.version=y;var ft,vt,gt,yt,bt,wt,kt=[],St=!1;function Et(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"===typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?B(document,"dragover",this._handleAutoScroll):this.options.supportPointer?B(document,"pointermove",this._handleFallbackAutoScroll):t.touches?B(document,"touchmove",this._handleFallbackAutoScroll):B(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?D(document,"dragover",this._handleAutoScroll):(D(document,"pointermove",this._handleFallbackAutoScroll),D(document,"touchmove",this._handleFallbackAutoScroll),D(document,"mousemove",this._handleFallbackAutoScroll)),Nt(),xt(),G()},nulling:function(){bt=vt=ft=St=wt=gt=yt=null,kt.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var a=this,o=(e.touches?e.touches[0]:e).clientX,n=(e.touches?e.touches[0]:e).clientY,i=document.elementFromPoint(o,n);if(bt=e,t||this.options.forceAutoScrollFallback||k||w||E){Ct(e,this.options,i,t);var l=z(i,!0);!St||wt&&o===gt&&n===yt||(wt&&Nt(),wt=setInterval((function(){var i=z(document.elementFromPoint(o,n),!0);i!==l&&(l=i,xt()),Ct(e,a.options,i,t)}),10),gt=o,yt=n)}else{if(!this.options.bubbleScroll||z(i,!0)===$())return void xt();Ct(e,this.options,z(i,!1),!1)}}},f(e,{pluginName:"scroll",initializeByDefault:!0})}function xt(){kt.forEach((function(e){clearInterval(e.pid)})),kt=[]}function Nt(){clearInterval(wt)}var Ct=W((function(e,t,a,o){if(t.scroll){var n,i=(e.touches?e.touches[0]:e).clientX,l=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,s=t.scrollSpeed,d=$(),c=!1;vt!==a&&(vt=a,xt(),ft=t.scroll,n=t.scrollFn,!0===ft&&(ft=z(a,!0)));var u=0,p=ft;do{var h=p,m=R(h),f=m.top,v=m.bottom,g=m.left,y=m.right,b=m.width,w=m.height,k=void 0,S=void 0,E=h.scrollWidth,x=h.scrollHeight,N=P(h),C=h.scrollLeft,B=h.scrollTop;h===d?(k=b<E&&("auto"===N.overflowX||"scroll"===N.overflowX||"visible"===N.overflowX),S=w<x&&("auto"===N.overflowY||"scroll"===N.overflowY||"visible"===N.overflowY)):(k=b<E&&("auto"===N.overflowX||"scroll"===N.overflowX),S=w<x&&("auto"===N.overflowY||"scroll"===N.overflowY));var D=k&&(Math.abs(y-i)<=r&&C+b<E)-(Math.abs(g-i)<=r&&!!C),T=S&&(Math.abs(v-l)<=r&&B+w<x)-(Math.abs(f-l)<=r&&!!B);if(!kt[u])for(var _=0;_<=u;_++)kt[_]||(kt[_]={});kt[u].vx==D&&kt[u].vy==T&&kt[u].el===h||(kt[u].el=h,kt[u].vx=D,kt[u].vy=T,clearInterval(kt[u].pid),0==D&&0==T||(c=!0,kt[u].pid=setInterval(function(){o&&0===this.layer&&at.active._onTouchMove(bt);var t=kt[this.layer].vy?kt[this.layer].vy*s:0,a=kt[this.layer].vx?kt[this.layer].vx*s:0;"function"===typeof n&&"continue"!==n.call(at.dragged.parentNode[Z],a,t,e,bt,kt[this.layer].el)||Q(kt[this.layer].el,a,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&p!==d&&(p=z(p,!1)));St=c}}),30),Bt=function(e){var t=e.originalEvent,a=e.putSortable,o=e.dragEl,n=e.activeSortable,i=e.dispatchSortableEvent,l=e.hideGhostForTarget,r=e.unhideGhostForTarget;if(t){var s=a||n;l();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(d.clientX,d.clientY);r(),s&&!s.el.contains(c)&&(i("spill"),this.onSpill({dragEl:o,putSortable:a}))}};function Dt(){}function Tt(){}function _t(e,t){return Object.values(e).indexOf(t)}function At(e,t,a,o){if(!e)return[];const n=Object.values(e),i=t.length-o,l=[...t].map(((e,t)=>t>=i?n.length:n.indexOf(e)));return l}function Vt(e){return["transition-group","TransitionGroup"].includes(e)}function Ot(e){if(!e||1!==e.length)return!1;const[{type:t}]=e;return!!t&&Vt(t.name)}function It(e,t){return t?{...t.props,...t.attrs}:e}Dt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,a=e.putSortable;this.sortable.captureAnimationState(),a&&a.captureAnimationState();var o=F(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),a&&a.animateAll()},drop:Bt},f(Dt,{pluginName:"revertOnSpill"}),Tt.prototype={onSpill:function(e){var t=e.dragEl,a=e.putSortable,o=a||this.sortable;o.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),o.animateAll()},drop:Bt},f(Tt,{pluginName:"removeOnSpill"}),at.mount(new Et),at.mount(Tt,Dt);const Pt=["Start","Add","Remove","Update","End"],Lt=["Choose","Unchoose","Sort","Filter","Clone"],Mt=["Move",...Pt,...Lt].map((e=>"on"+e));let $t=null;const Rt=(0,o.defineComponent)({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...Pt.map((e=>e.toLowerCase())),...Lt.map((e=>e.toLowerCase()))],setup(e,{emit:t,slots:a,attrs:n}){const l=(0,o.ref)(!1),r=(0,o.ref)(!1),u=(0,o.ref)(0),p=(0,o.ref)(0),h=(0,o.ref)([]),m=(0,o.ref)(null),f=(0,o.ref)(null),v=(0,o.computed)((()=>e.list?e.list:e.modelValue)),g=(0,o.getCurrentInstance)();function y(){return e.component?(0,o.resolveComponent)(e.component):e.tag}function b(e){if(f.value)for(const t in e){const a=s(t);-1===Mt.indexOf(a)&&f.value.option(a,e[t])}}function w(){return g?.proxy?.$el.children||[]}async function k(){await(0,o.nextTick)(),h.value=At(w(),g?.proxy?.$el.children||[],l.value,p.value)}function S(e){const t=_t(w()||[],e);if(-1===t)return null;const a=v.value?v.value[t]:null;return{index:t,element:a}}function E(e){(0,o.nextTick)((()=>t("change",e)))}function x(a){if(e.list)return void a(e.list);const o=[...e.modelValue||[]];a(o),t("update:modelValue",o)}function N(...e){const t=t=>t.splice(...e);x(t)}function C(e,t){const a=a=>a.splice(t,0,a.splice(e,1)[0]);x(a)}function B(e){const t=h.value,a=t.length;return e>a-1?a:t[e]}function D(){if(!a.default)return null;const e=a.default();return e[0]?.component?.proxy||null}function T(t){if(!e.noTransitionOnDrag||!l.value)return;const a=w();a[t]&&(a[t].data=null);const o=D();o&&(o.children=[],o.kept=void 0)}function _(t){k(),m.value=S(t.item),m.value&&(t.item._underlying_vm_=e.clone(m.value.element),$t=t.item)}function A(e){const t=e.item._underlying_vm_;if(void 0===t)return;d(e.item);const a=B(e.newIndex);N(a,0,t),k(),E({added:{element:t,newIndex:a}})}function V(e){if(c(g?.proxy?.$el,e.item,e.oldIndex),"clone"===e.pullMode)return void d(e.clone);if(!m.value)return;const t=m.value.index;N(t,1),T(t),E({removed:{element:m.value.element,oldIndex:t}})}function O(e){d(e.item),c(e.from,e.item,e.oldIndex);const t=m.value?.index,a=B(e.newIndex);C(t,a),E({moved:{element:m.value?.element,oldIndex:t,newIndex:a}})}function I(e,t){Object.prototype.hasOwnProperty.call(e,t)&&(e[t]+=u.value)}function P(e){return e.__draggable_component__}function L({to:e,related:t}){const a=P(e);if(!a)return{component:a};const o=a.realList,n={list:o,component:a};if(e!==t&&o&&a.getUnderlyingVm){const e=a.getUnderlyingVm(t);if(e)return Object.assign(e,n)}return n}function M(e,t){const a=[...t.to.children].filter((e=>"none"!==e.style["display"]));if(0===a.length)return 0;const o=a.indexOf(t.related),n=e.component.getVmIndex(o),i=-1!==a.indexOf($t);return i||!t.willInsertAfter?n:n+1}const $=()=>{const e={};Pt.forEach((t=>{e["on"+t]=U(t)})),Lt.forEach((t=>{e["on"+t]=R.bind(null,t)}));const t=Object.keys(n).reduce(((e,t)=>(e[s(t)]=n[t],e)),{}),a=Object.assign({},t,e,{onMove:(e,t)=>F(e,t)});"draggable"in a||(a.draggable=">*");const o=1===g?.proxy?.$el.nodeType?g.proxy.$el:g?.proxy?.$el.parentElement||null;o&&(f.value=new at(o,a),o.__draggable_component__=g?.proxy,k())};function R(e,a){(0,o.nextTick)((()=>t(e.toLowerCase(),a)))}function U(e){return t=>{if(null!==v.value){const a="onDrag"+e,o=q[a];o&&o(t)}R(e,t)}}function F(t,a){const o=e.move;if(!o||!v.value)return!0;const n=L(t),i=m.value,l=M(n,t);i&&Object.assign(i,{futureIndex:l});const r=Object.assign({},t,{relatedContext:n,draggedContext:i});return o(r,a)}function j(){k(),$t=null}const q={onDragStart:_,onDragAdd:A,onDragRemove:V,onDragUpdate:O,onDragMove:F,onDragEnd:j};return(0,o.onMounted)((()=>{$()})),null!==e.list&&null!==e.modelValue&&i.error("list props are mutually exclusive! Please set one."),{getTag:y,realList:v,visibleIndexes:h,noneFunctionalComponentMode:r,headerOffset:u,footerOffset:p,transitionMode:l,computeIndexes:k,updateOptions:b,getChildrenNodes:w,getUnderlyingVm:S,emitChanges:E,alterList:x,spliceList:N,updatePosition:C,getVmIndex:B,getComponent:D,resetTransitionData:T,onDragStart:_,onDragAdd:A,onDragRemove:V,onDragUpdate:O,updateProperty:I,onDragMove:F,onDragEnd:j,mounted:$,context:m,sortableInstance:f,getRelatedContextFromMoveEvent:L,getTargetedComponent:P,computeFutureIndex:M}},render(){const e=this.getTag(),t=It(this.$attrs,this.componentData);if("string"===typeof e){const a=this.$slots.default&&"function"===typeof this.$slots.default?this.$slots.default():null;return a?(this.transitionMode=Ot(a),(0,o.h)(e,t,a)):(0,o.h)(e,t,[])}const a=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const e="function"===typeof this.$slots.default?this.$slots.default():null;this.transitionMode=Ot(e||[])}return(0,o.h)(e,t,a)}})},93946:function(e,t,a){var o=a(24243);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("42782740",o,!0,{sourceMap:!1,shadowMode:!1})},18071:function(e,t,a){var o=a(40439);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("a1c3e378",o,!0,{sourceMap:!1,shadowMode:!1})},88405:function(e,t,a){var o=a(15829);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("0b86ac08",o,!0,{sourceMap:!1,shadowMode:!1})},980:function(e,t,a){var o=a(20916);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("6a7a0a32",o,!0,{sourceMap:!1,shadowMode:!1})},91872:function(e,t,a){var o=a(71488);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("27ff987c",o,!0,{sourceMap:!1,shadowMode:!1})},76769:function(e,t,a){var o=a(52865);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("f64683e4",o,!0,{sourceMap:!1,shadowMode:!1})},72170:function(e,t,a){var o=a(52618);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("787acd5a",o,!0,{sourceMap:!1,shadowMode:!1})},98746:function(e,t,a){var o=a(61562);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("e331bd18",o,!0,{sourceMap:!1,shadowMode:!1})}}]);
|
|
//# sourceMappingURL=harvester-1.6.1.umd.min.909.js.map
|