mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
9 lines
107 KiB
JavaScript
9 lines
107 KiB
JavaScript
(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_1"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_1"]||[]).push([[542],{60090:function(e,t,a){"use strict";a.d(t,{A:function(){return p}});var o=a(9274);const n={key:0,class:"label"},l={class:"text-label"},i={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",l,[(0,o.renderSlot)(e.$slots,"name",{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(a.name),1)]),!0)]),(0,o.createElementVNode)("div",i,[(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"},l={class:"text-label"},i={class:"value"};function r(e,t,a,r,s,d){return(0,o.openBlock)(),(0,o.createElementBlock)("div",n,[(0,o.createElementVNode)("div",l,[(0,o.renderSlot)(e.$slots,"name",{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(a.name),1)]),!0)]),(0,o.createElementVNode)("div",i,[(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},39996:function(e,t,a){"use strict";a.d(t,{A:function(){return j}});var o=a(9274);const n={class:"key-value"},l={key:0,class:"clearfix"},i={key:0,class:"icon icon-info"},r={class:"text-label"},s={key:0,class:"icon icon-info"},d={class:"text-label"},c=(0,o.createElementVNode)("span",null,null,-1),u=(0,o.createElementVNode)("div",{class:"kv-item key text-muted"}," — ",-1),p=(0,o.createElementVNode)("div",{class:"kv-item key text-muted"}," — ",-1),h={class:"kv-item key"},m=["onUpdate:modelValue","disabled","placeholder","data-testid","onPaste"],f=["data-testid"],v={key:0},g={key:1},y=["onUpdate:modelValue","disabled","type","placeholder","data-testid"],b=["data-testid"],w=["disabled","onClick"],k={key:1,class:"footer mt-20"},S=["disabled"],E={key:0,class:"mr-5 icon icon-spinner icon-spin icon-lg"};function x(e,t,a,x,N,B){const C=(0,o.resolveComponent)("Select"),D=(0,o.resolveComponent)("CodeMirror"),T=(0,o.resolveComponent)("TextAreaAutoGrow"),A=(0,o.resolveComponent)("FileSelector"),_=(0,o.resolveDirective)("clean-tooltip");return(0,o.openBlock)(),(0,o.createElementBlock)("div",n,[a.title||e.$slots.title?((0,o.openBlock)(),(0,o.createElementBlock)("div",l,[(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",i,null,512)),[[_,a.titleProtip]]):(0,o.createCommentVNode)("",!0)])]))])):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("div",{class:"kv-container",style:(0,o.normalizeStyle)(B.containerStyle)},[N.rows.length||B.isView?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createElementVNode)("label",r,[(0,o.createTextVNode)((0,o.toDisplayString)(B._keyLabel)+" ",1),B._protip&&!B.isView&&a.addAllowed?(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("i",s,null,512)),[[_,B._protip]]):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("label",d,(0,o.toDisplayString)(B._valueLabel),1),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(a.extraColumns,((t,a)=>((0,o.openBlock)(),(0,o.createElementBlock)("label",{key:a},[(0,o.renderSlot)(e.$slots,"label:"+t,{},(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(t),1)]))])))),128)),B.canRemove?(0,o.renderSlot)(e.$slots,"remove",{key:0},(()=>[c])):(0,o.createCommentVNode)("",!0)],64)):(0,o.createCommentVNode)("",!0),!N.rows.length&&B.isView?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[u,p],64)):((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,{key:2},(0,o.renderList)(B.filteredRows,((n,l)=>((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:l},[(0,o.createElementVNode)("div",h,[(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)(C,{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||B.isProtected(n.key),clearable:!1,taggable:a.keyTaggable,options:B.calculateOptions(n[a.keyName]),"data-testid":`select-kv-item-key-${l}`},null,8,["value","onUpdate:value","disabled","taggable","options","data-testid"])):(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:B.isView||a.disabled||!a.keyEditable||B.isProtected(n.key),placeholder:B._keyPlaceholder,"data-testid":`input-kv-item-key-${l}`,onInput:t[0]||(t[0]=(...t)=>e.queueUpdate&&e.queueUpdate(...t)),onPaste:e=>B.onPaste(l,e)},null,40,m)),[[o.vModelText,n[a.keyName]]])]))]),(0,o.createElementVNode)("div",{"data-testid":`kv-item-value-${l}`,class:"kv-item value"},[(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",g,(0,o.toDisplayString)(B.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)(D,{key:0,ref_for:!0,ref:"cm","data-testid":"code-mirror-multiline-field",class:(0,o.normalizeClass)({["focus"]:N.codeMirrorFocus[l]}),value:n[a.valueName],"as-text-area":!0,mode:a.mode,onOnInput:e=>B.onInputMarkdownMultiline(l,e),onOnFocus:e=>B.onFocusMarkdownMultiline(l,e)},null,8,["class","value","mode","onOnInput","onOnFocus"])):a.valueMultiline&&void 0!==n[a.valueName]?((0,o.openBlock)(),(0,o.createBlock)(T,{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||B.isProtected(n.key),mode:a.mode,placeholder:B._valuePlaceholder,"min-height":40,spellcheck:!1},null,8,["value","onUpdate:value","class","disabled","mode","placeholder"])):(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("input",{key:2,"onUpdate:modelValue":e=>n[a.valueName]=e,disabled:B.isView||a.disabled||B.isProtected(n.key),type:a.valueConcealed?"password":"text",placeholder:B._valuePlaceholder,autocorrect:"off",autocapitalize:"off",spellcheck:"false","data-testid":`input-kv-item-value-${l}`,onInput:t[1]||(t[1]=(...t)=>e.queueUpdate&&e.queueUpdate(...t))},null,40,y)),[[o.vModelDynamic,n[a.valueName]]]),a.parseValueFromFile&&a.readAllowed&&!B.isView&&B.isValueFieldEmpty(n[a.valueName])?((0,o.openBlock)(),(0,o.createBlock)(A,{key:3,class:"btn btn-sm role-secondary file-selector",label:e.t("generic.upload"),"include-file-name":!0,onSelected:e=>B.onValueFileSelected(l,e)},null,8,["label","onSelected"])):(0,o.createCommentVNode)("",!0)],2)):((0,o.openBlock)(),(0,o.createElementBlock)("div",v,(0,o.toDisplayString)(e.t("detailText.unsupported",null,!0)),1))]))],8,f),((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:`${l}-${a}`,class:"kv-item extra"},[(0,o.renderSlot)(e.$slots,"col:"+t,{row:n,queueUpdate:e.queueUpdate,i:l})])))),128)),B.canRemove?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:l,class:"kv-item remove","data-testid":`remove-column-${l}`},[(0,o.renderSlot)(e.$slots,"removeButton",{remove:B.remove,row:n,i:l},(()=>[(0,o.createElementVNode)("button",{type:"button",disabled:B.isView||B.isProtected(n.key)||a.disabled,class:"btn role-link",onClick:e=>B.remove(l)},(0,o.toDisplayString)(a.removeLabel||e.t("generic.remove")),9,w)]))],8,b)):(0,o.createCommentVNode)("",!0)],64)))),128))],4),!a.addAllowed&&!a.readAllowed||B.isView?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",k,[(0,o.renderSlot)(e.$slots,"add",{add:B.add},(()=>[a.addAllowed?((0,o.openBlock)(),(0,o.createElementBlock)("button",{key:0,type:"button",class:"btn role-tertiary add","data-testid":"add_link_button",disabled:a.loading||a.disabled||a.keyOptions&&0===B.filteredKeyOptions.length,onClick:t[2]||(t[2]=e=>B.add())},[a.loading?((0,o.openBlock)(),(0,o.createElementBlock)("i",E)):(0,o.createCommentVNode)("",!0),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(B._addLabel),1)],8,S)):(0,o.createCommentVNode)("",!0),a.readAllowed?((0,o.openBlock)(),(0,o.createBlock)(A,{key:1,disabled:B.isView,class:"role-tertiary",label:e.t("generic.readFromFile"),"include-file-name":!0,onSelected:B.onFileSelected},null,8,["disabled","label","onSelected"])):(0,o.createCommentVNode)("",!0)]))]))])}var N=a(12784),B=a.n(N),C=a(74302),D=a(68851),T=a(4514),A=a(6198),_=a(6879),V=a(76978),O=a(43073),I=a(15677),M=a(14220),L=a(92043),P=a(37534),$=a(46343),R=a.n($),U={name:"KeyValue",emits:["focusKey","update:value"],components:{CodeMirror:P.A,Select:O.A,TextAreaAutoGrow:_.V,FileSelector:I.A},props:{value:{type:[Array,Object],default:null},defaultValue:{type:[Array,Object],default:null},binaryValueKeys:{type:[Array,Object],default:null},mode:{type:String,default:M.G5},asMap:{type:Boolean,default:!0},initialEmptyRow:{type:Boolean,default:!1},title:{type:String,default:""},titleProtip:{type:String,default:""},protip:{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:""},protectedKeys:{type:Array,default:()=>[]},toggleFilter:{type:Boolean,default:!1},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:"icon-plus"},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:"icon-minus"},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}},data(){const e=this.getRows(this.value);return{rows:e,codeMirrorFocus:{},lastUpdated:null}},computed:{_protip(){return 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===M.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},filteredRows(){return this.rows.filter((e=>!(this.isProtected(e.key)&&!this.toggleFilter)))}},created(){this.queueUpdate=B()(this.update,500)},watch:{value:{deep:!0,handler(e,t){this.valuePropChanged(e,t)}}},methods:{valuePropChanged(e){R()(e,this.lastUpdated)||(this.rows=this.getRows(e))},isProtected(e){return this.protectedKeys&&this.protectedKeys.includes(e)},getRows(e){const t=[];if(this.asMap){const a=e||{};Object.keys(a).forEach((e=>{let o=a[e];const n=(0,T.u)(a[e]),l=(0,L.XC)(n);this.handleBase64&&l&&(o=(0,T.u)(o)),t.push({key:e,value:o,binary:this.displayValuesAsBinary||this.handleBase64&&!l,canEncode:this.handleBase64&&l,supported:!0})}))}else{const a=e||[];for(const e of a){let a=e[this.valueName]||"";const o=(0,T.u)(e[this.valueName]),n=(0,L.XC)(o);this.handleBase64&&n&&(a=(0,T.u)(a));const l={[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]&&(l[t]=e[t])})),t.push(l)}}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,D.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,A.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 l=(o[t]||"").trim();n&&"object"===(0,C.QP)(n)?e[l]=JSON.parse(JSON.stringify(n)):(n=n||"",this.valueTrim&&(0,L.XC)(n)&&(n=n.trim()),o.canEncode&&(n=(0,T.KA)(n)),l&&(n||this.valueCanBeEmpty)&&(e[l]=n))}}else{const t=this.preserveKeys||[];(0,D.Gj)(t,this.keyName),(0,D.Gj)(t,this.valueName),e=this.rows.map((e=>{let a=e[this.valueName];e.canEncode&&(a=(0,T.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=this.parserSeparators.find((t=>e.includes(t)));return t?e.split(t):""})).filter((e=>e&&e.length>0));if(0===n.length||1===n.length&&n[0].length<2)return;t.preventDefault();const l=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,...l),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,T.u)(e):e,a=e.length?(0,T.dQ)(t):0;return this.t("detailText.binary",{n:a},!0)},get:V.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}}},F=(a(65570),a(47433));const q=(0,F.A)(U,[["render",x]]);var j=q},93484:function(e,t,a){"use strict";a.d(t,{A:function(){return x}});var o=a(9274);const n=e=>((0,o.pushScopeId)("data-v-680c438c"),e=e(),(0,o.popScopeId)(),e),l={class:"labels"},i={class:"labels__header"},r={key:0},s={class:"mt-10 mb-10"},d=n((()=>(0,o.createElementVNode)("div",{class:"spacer"},null,-1)));function c(e,t,a,n,c,u){const p=(0,o.resolveComponent)("t"),h=(0,o.resolveComponent)("ToggleSwitch"),m=(0,o.resolveComponent)("KeyValue");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{class:(0,o.normalizeClass)(u.containerClass)},[(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)(a.defaultSectionClass)},[(0,o.createElementVNode)("div",l,[(0,o.createElementVNode)("div",i,[a.showLabelTitle?((0,o.openBlock)(),(0,o.createElementBlock)("h3",r,[(0,o.createVNode)(p,{k:"labels.labels.title"})])):(0,o.createCommentVNode)("",!0),a.value.hasSystemLabels?((0,o.openBlock)(),(0,o.createBlock)(h,{key:1,value:c.toggler,"onUpdate:value":t[0]||(t[0]=e=>c.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",s,[(0,o.createVNode)(p,{k:"labels.labels.description"})]),(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)(u.columnsClass)},[(0,o.renderSlot)(e.$slots,"labels",{toggler:c.toggler},(()=>[(0,o.createVNode)(m,{key:"labels",value:a.value.labels,"protected-keys":a.value.systemLabels||[],"toggle-filter":c.toggler,"add-label":e.t("labels.addLabel"),mode:a.mode,"read-allowed":!1,"value-can-be-empty":!0,"onUpdate:value":t[1]||(t[1]=e=>a.value.setLabels(e))},null,8,["value","protected-keys","toggle-filter","add-label","mode"])]),!0)],2)])],2),d,a.showAnnotations?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:0,class:(0,o.normalizeClass)(u.sectionClass)},[(0,o.createVNode)(m,{key:"annotations",value:a.value.annotations,"add-label":e.t("labels.addAnnotation"),mode:a.mode,"protected-keys":a.value.systemAnnotations||[],"toggle-filter":c.toggler,title:e.t("labels.annotations.title"),"title-protip":a.annotationTitleTooltip,"read-allowed":!1,"value-can-be-empty":!0,"onUpdate:value":t[2]||(t[2]=e=>a.value.setAnnotations(e))},null,8,["value","add-label","mode","protected-keys","toggle-filter","title","title-protip"])],2)):(0,o.createCommentVNode)("",!0)],2)}var u=a(39996);const p=e=>((0,o.pushScopeId)("data-v-6143aa66"),e=e(),(0,o.popScopeId)(),e),h={class:"toggle-container"},m={class:"switch hand"},f=["checked"],v=p((()=>(0,o.createElementVNode)("span",{class:"slider round"},null,-1)));function g(e,t,a,n,l,i){return(0,o.openBlock)(),(0,o.createElementBlock)("span",h,[(0,o.createElementVNode)("span",{class:(0,o.normalizeClass)(["label no-select hand",{active:!e.state}]),onClick:t[0]||(t[0]=t=>e.toggle(!1))},(0,o.toDisplayString)(e.offLabel),3),(0,o.createElementVNode)("label",m,[(0,o.createElementVNode)("input",{type:"checkbox",checked:e.state,onInput:t[1]||(t[1]=t=>e.toggle(null))},null,40,f),v]),(0,o.createElementVNode)("span",{class:(0,o.normalizeClass)(["label no-select hand",{active:e.state}]),onClick:t[2]||(t[2]=t=>e.toggle(!0))},(0,o.toDisplayString)(e.onLabel),3)])}var y=(0,o.defineComponent)({props:{value:{type:[Boolean,String,Number],default:!1},offValue:{type:[Boolean,String,Number],default:!1},onValue:{type:[Boolean,String,Number],default:!0},offLabel:{type:String,default:""},onLabel:{type:String,default:""}},data(){return{state:!1}},watch:{value:{handler(){this.state=this.value===this.onValue},immediate:!0}},methods:{toggle(e){this.state=null===e?!this.state:e,this.$emit("update:value",this.state?this.onValue:this.offValue)}}}),b=(a(92433),a(47433));const w=(0,b.A)(y,[["render",g],["__scopeId","data-v-6143aa66"]]);var k=w,S={components:{ToggleSwitch:k,KeyValue:u.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}},data(){return{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()}}};a(53788);const E=(0,b.A)(S,[["render",c],["__scopeId","data-v-680c438c"]]);var x=E},51270:function(e,t,a){"use strict";a.d(t,{A:function(){return L}});var o=a(9274);const n=e=>((0,o.pushScopeId)("data-v-023836b7"),e=e(),(0,o.popScopeId)(),e),l=n((()=>(0,o.createElementVNode)("i",{class:"icon icon-x"},null,-1))),i=[l],r={key:0},s=n((()=>(0,o.createElementVNode)("span",null,null,-1))),d=["data-testid"],c={key:0},u=["data-testid"],p={key:0},h=["onUpdate:modelValue","mode","data-testid"],m=["data-testid"],f={key:0},v={key:1,class:"no-value"},g=n((()=>(0,o.createElementVNode)("label",{class:"text-muted"},"…",-1))),y=[g],b=["data-testid"],w={key:0},k=["onUpdate:modelValue","mode","disabled","data-testid"],S={key:3,class:"remove-container"},E=["disabled","data-testid","onClick"],x={key:2,class:"mt-20"};function N(e,t,a,n,l,g){const N=(0,o.resolveComponent)("LabeledSelect"),B=(0,o.resolveComponent)("Select"),C=(0,o.resolveComponent)("t");return(0,o.openBlock)(),(0,o.createElementBlock)("div",null,[a.showRemove&&!g.isView?((0,o.openBlock)(),(0,o.createElementBlock)("button",{key:0,type:"button",class:"btn role-link remove-expression",onClick:t[0]||(t[0]=t=>e.$emit("remove"))},i)):(0,o.createCommentVNode)("",!0),l.rules.length?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:1,class:(0,o.normalizeClass)(["match-expression-header",{view:g.isView,"match-expression-header-matching":a.matchingSelectorDisplay}])},[a.matchingSelectorDisplay?((0,o.openBlock)(),(0,o.createElementBlock)("label",r,(0,o.toDisplayString)(e.t("workload.scheduling.affinity.matchExpressions.matchType")),1)):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("label",null,(0,o.toDisplayString)(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),s],2)):(0,o.createCommentVNode)("",!0),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(l.rules,((e,n)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:n,class:(0,o.normalizeClass)(["match-expression-row",{view:g.isView,"mb-10":n!==l.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}`},[g.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",c,(0,o.toDisplayString)(e.matching),1)):((0,o.openBlock)(),(0,o.createBlock)(N,{key:1,value:e.matching,"onUpdate:value":t=>e.matching=t,mode:a.mode,options:g.matchingSelectOptions,"data-testid":`input-match-type-field-control-${n}`,onSelecting:g.update},null,8,["value","onUpdate:value","mode","options","data-testid","onSelecting"]))],8,d)):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("div",{"data-testid":`input-match-expression-key-${n}`},[g.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",p,(0,o.toDisplayString)(e.key),1)):g.hasKeySelectOptions?((0,o.openBlock)(),(0,o.createBlock)(N,{key:2,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,"onUpdate:modelValue":t=>e.key=t,mode:a.mode,"data-testid":`input-match-expression-key-control-${n}`,onInput:t[1]||(t[1]=(...e)=>g.update&&g.update(...e))},null,40,h)),[[o.vModelText,e.key]])],8,u),(0,o.createElementVNode)("div",{"data-testid":`input-match-expression-operator-${n}`},[g.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",f,(0,o.toDisplayString)(e.operator),1)):((0,o.openBlock)(),(0,o.createBlock)(B,{key:1,value:e.operator,"onUpdate:value":[t=>e.operator=t,g.update],class:"operator single",options:l.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,m),"Exists"===e.operator||"DoesNotExist"===e.operator?((0,o.openBlock)(),(0,o.createElementBlock)("div",v,y)):((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:2,"data-testid":`input-match-expression-values-${n}`},[g.isView?((0,o.openBlock)(),(0,o.createElementBlock)("div",w,(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)=>g.update&&g.update(...e))},null,40,k)),[[o.vModelText,e.values]])],8,b)),a.showRemoveButton?((0,o.openBlock)(),(0,o.createElementBlock)("div",S,[g.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=>g.removeRule(e)},[(0,o.createVNode)(C,{k:"generic.remove"})],8,E))])):(0,o.createCommentVNode)("",!0)],2)))),128)),!g.isView&&a.showAddButton?((0,o.openBlock)(),(0,o.createElementBlock)("div",x,[(0,o.createElementVNode)("button",{type:"button",class:"btn role-tertiary add","data-testid":"input-match-expression-add-rule",onClick:t[3]||(t[3]=(...e)=>g.addRule&&g.addRule(...e))},[(0,o.createVNode)(C,{k:"workload.scheduling.affinity.matchExpressions.addRule"})])])):(0,o.createCommentVNode)("",!0)])}var B=a(35664),C=a(43073),D=a(65359),T=a(68851),A=a(76978),_=a(38823),V=a(40408),O={emits:["update:value","remove"],components:{Select:C.A,LabeledSelect:V.A},props:{value:{type:[Array,Object],default:()=>[]},mode:{type:String,default:"edit"},type:{type:String,default:B.NW},matchingSelectorDisplay:{type:Boolean,default:!1},initialEmptyRow:{type:Boolean,default:!1},showAddButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},keysSelectOptions:{type:Array,default:()=>[]}},data(){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"}],o=this.type===B.NW?a:t;let n;if(this.matchingSelectorDisplay){const e={matchFields:[],matchExpressions:[]};["matchFields","matchExpressions"].forEach((t=>{e[t]=this.parseRules(this.value[t],t)})),n=[...e.matchFields,...e.matchExpressions]}else(0,T.cy)(this.value)?(n=[...this.value],n=this.parseRules(n)):(n=(0,_.C6)(this.value.matchLabels,this.value.matchExpressions),n=this.parseRules(n));if(!n.length&&this.initialEmptyRow&&!this.isView){const e={key:"",operator:"In",values:""};this.matchingSelectorDisplay&&(e.matching="matchExpressions"),n.push(e)}return{ops:o,rules:n,custom:[]}},computed:{isView(){return"view"===this.mode},node(){return B.NW},pod(){return B.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,D.L8)({t:"i18n/t"})},methods:{parseRules(e,t){return e?.length?e.map((e=>{const a=(0,A.o8)(e);return a.values&&"string"!==typeof a.values&&(a.values=a.values.join(", ")),t&&(a.matching=t),a})):[]},removeRule(e){(0,T.Gj)(this.rules,e),this.update()},addRule(){const e={key:"",operator:"In",values:""};this.matchingSelectorDisplay&&(e.matching="matchExpressions"),this.rules.push(e)},update(){this.$nextTick((()=>{const e=this.rules.map((e=>{const t={key:e.key,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,T.cy)(this.value)||this.matchingSelectorDisplay?this.$emit("update:value",e):this.$emit("update:value",(0,_.CR)(e))}))}}},I=(a(93071),a(47433));const M=(0,I.A)(O,[["render",N],["__scopeId","data-v-023836b7"]]);var L=M},76655:function(e,t,a){"use strict";a.d(t,{A:function(){return O}});var o=a(9274);const n={class:"row mb-20"},l={key:0,class:"row"},i={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,onInput:d.update},null,8,["value","options","mode","onInput"])]),"nodeSelector"===s.selectNode?((0,o.openBlock)(),(0,o.createElementBlock)("div",l,[(0,o.createElementVNode)("div",i,[(0,o.createVNode)(u,{value:s.nodeName,"onUpdate:value":t[1]||(t[1]=e=>s.nodeName=e),label:e.t("workload.scheduling.affinity.nodeName"),options:a.nodes||[],mode:a.mode,multiple:!1,loading:a.loading,onInput:d.update},null,8,["value","label","options","mode","loading","onInput"])])])):"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,onInput:d.update},null,8,["value","mode","onInput"])):(0,o.createCommentVNode)("",!0)])}var s=a(65359),d=a(10196),c=a(40408);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,l,i){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:e.allSelectorTerms,"onUpdate:value":t[0]||(t[0]=t=>e.allSelectorTerms=t),class:"mt-20",mode:a.mode,"default-add-value":{matchExpressions:[]},"add-label":e.t("workload.scheduling.affinity.addNodeSelector"),onRemove:i.remove},{default:(0,o.withCtx)((t=>[(0,o.createElementVNode)("div",p,[(0,o.createElementVNode)("div",h,[(0,o.createVNode)(r,{options:i.affinityOptions,value:i.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=>i.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,i.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:i.node,"show-remove":!1,"data-testid":`node-affinity-expressions-index${t.i}`,"onUpdate:value":e=>i.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(51270),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(){if(this.value.required)return{nodeSelectorTerms:this.value.required.nodeSelectorTerms};{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}));return{allSelectorTerms:o,weightedNodeSelectorTerms:e,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(){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}},B=a(47433);const C=(0,B.A)(N,[["render",f]]);var D=C,T=a(11518),A=a(2841),_={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(){const e=this.$store.getters["currentProduct"].inStore===T.T;let{nodeName:t=""}=this.value;const{affinity:a={},nodeSelector:o={}}=this.value,{nodeAffinity:n={}}=a;let l=null;return this.value.nodeName?l="nodeSelector":e&&this.value?.nodeSelector?.[A.yA]?(l="nodeSelector",t=o[A.yA]):(0,b.Im)(n)||(l="affinity"),n.requiredDuringSchedulingIgnoredDuringExecution||(n["requiredDuringSchedulingIgnoredDuringExecution"]={nodeSelectorTerms:[]}),n.preferredDuringSchedulingIgnoredDuringExecution||(n["preferredDuringSchedulingIgnoredDuringExecution"]=[]),{selectNode:l,nodeName:t,nodeAffinity:n,nodeSelector:o}},computed:{...(0,s.L8)({t:"i18n/t"}),isView(){return this.mode===y.nW},isHarvester(){return this.$store.getters["currentProduct"].inStore===T.T},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:{[A.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?.[A.yA]){this.selectNode="nodeSelector";const t=e[A.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,B.A)(_,[["render",r]]);var O=V},21414:function(e,t,a){"use strict";a.d(t,{A:function(){return b}});var o=a(9274);const n=e=>((0,o.pushScopeId)("data-v-03da7481"),e=e(),(0,o.popScopeId)(),e),l={class:"password"},i={key:0,class:"addon"},r={key:1,class:"addon"},s={key:0,class:"mt-10 genPassword"},d=n((()=>(0,o.createElementVNode)("i",{class:"icon icon-refresh"},null,-1)));function c(e,t,a,n,c,u){const p=(0,o.resolveComponent)("LabeledInput");return(0,o.openBlock)(),(0,o.createElementBlock)("div",l,[(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",r,[c.reveal?((0,o.openBlock)(),(0,o.createElementBlock)("a",{key:0,tabindex:"-1",href:"#",onClick:t[1]||(t[1]=(0,o.withModifiers)((e=>c.reveal=!1),["prevent","stop"]))},(0,o.toDisplayString)(e.t("action.hide")),1)):((0,o.openBlock)(),(0,o.createElementBlock)("a",{key:1,tabindex:"-1",href:"#",onClick:t[2]||(t[2]=(0,o.withModifiers)((e=>c.reveal=!0),["prevent","stop"]))},(0,o.toDisplayString)(e.t("action.show")),1))]))])),_: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"]))},[d,(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e.t("changePassword.newGeneratedPassword")),1)])])):(0,o.createCommentVNode)("",!0)])}var u=a(65359),p=a(79380),h=a(92043),m=a(48881),f=a(14220),v={emits:["update:value","blur"],components:{LabeledInput:p.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:f.YQ}},data(){return{reveal:!1}},computed:{...(0,u.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}},watch:{isRandom(){this.isRandom&&this.generatePassword()}},created(){this.isRandom&&this.generatePassword()},methods:{copyTextToClipboard:m.e,generatePassword(){this.password=(0,h.vx)(16,h.LQ.ALPHA_NUM)},show(e){this.reveal=e},focus(){this.$refs.input.$refs.value.focus()}}},g=(a(22209),a(47433));const y=(0,g.A)(v,[["render",c],["__scopeId","data-v-03da7481"]]);var b=y},19413:function(e,t,a){"use strict";a.d(t,{A:function(){return V}});var o=a(9274);const n={class:"col span-12"},l={class:"row mt-20 mb-20"},i={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",l,[(0,o.createElementVNode)("div",i,[(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(51270),b=a(40408),w=a(10196),k=a(79380),S=a(92043),E=a(74302),x=a(12784),N=a.n(x),B=a(31097),C=a(68851);const D={POD:"pod",ALL:"all",SELECTED:"selected"};var T={emits:["update"],components:{ArrayListGrouped:B.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(){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})),n=[...a,...o];return{allSelectorTerms:n,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,C.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.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=(a(35567),a(47433));const _=(0,A.A)(T,[["render",h]]);var V=_},48377:function(e,t,a){"use strict";a.d(t,{A:function(){return _}});var o=a(9274);const n={class:"mt-20"};function l(e,t,a,l,i,r){const s=(0,o.resolveComponent)("Conditions"),d=(0,o.resolveComponent)("Tab"),c=(0,o.resolveComponent)("SortableTable"),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)(e.$attrs,{"default-tab":a.defaultTab,onChanged:r.tabChange}),{default:(0,o.withCtx)((()=>[(0,o.renderSlot)(e.$slots,"default"),i.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"===i.selectedTab?((0,o.openBlock)(),(0,o.createBlock)(c,{key:0,rows:r.events,headers:r.eventHeaders,"key-field":"id",search:!1,"table-actions":!1,"row-actions":!1,"default-sort-by":"date"},null,8,["rows","headers"])):(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),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(i.extensionTabs,((e,t)=>((0,o.openBlock)(),(0,o.createBlock)(d,{key:`${e.name}${t}`,name:e.name,label:e.label,"label-key":e.labelKey,weight:e.weight,tooltip:e.tooltip,"show-header":e.showHeader,"display-alert-icon":e.displayAlertIcon,error:e.error,badge:e.badge},{default:(0,o.withCtx)((()=>[((0,o.openBlock)(),(0,o.createBlock)((0,o.resolveDynamicComponent)(e.component),{resource:a.value},null,8,["resource"]))])),_:2},1032,["name","label","label-key","weight","tooltip","show-header","display-alert-icon","error","badge"])))),128))])),_:3},16,["default-tab","onChanged"])}var i=a(81594),r=a(49584),s=a(91825);function d(e,t,a,n,l,i){const r=(0,o.resolveComponent)("SortableTable");return(0,o.openBlock)(),(0,o.createBlock)(r,{headers:i.headers,rows:i.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(44138),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),v=a(14220);function g(e,t,a,n,l,i){const r=(0,o.resolveComponent)("BadgeState"),s=(0,o.resolveComponent)("ResourceTable");return(0,o.openBlock)(),(0,o.createBlock)(s,{schema:null,rows:i.rows,headers:i.headers,search:!1,"table-actions":!1,namespaced:!0,"mangle-action-resources":i.getRealResources,"paging-label":"sortableTable.paging.generic",groupable:!1},{"cell:state":(0,o.withCtx)((({row:e})=>[e.real?((0,o.openBlock)(),(0,o.createBlock)(r,{key:0,value:e.real},null,8,["value"])):((0,o.openBlock)(),(0,o.createBlock)(r,{key:1,value:e},null,8,["value"]))])),_:1},8,["rows","headers","mangle-action-resources"])}var y=a(81651),b=a(89631),w=a(68774),k=a(74302),S=a(27278),E=a(23005),x={components:{ResourceTable:y.A,BadgeState:E.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.state||"active",l=(0,b.uU)(n,o.error,o.transitioning),i=o[`${this.direction}Type`],r=this.$store.getters[`${t}/schemaFor`](i);let s=o[`${this.direction}Id`];if(!s)continue;let d=null;const c=s.indexOf("/"),u=`${i}/${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:S.o,cluster:"management"===t?"local":e,resource:i,namespace:d,id:s}};a.push({type:i,real:this.$store.getters[`${t}/byId`](i,o[`${this.direction}Id`]),id:o[`${this.direction}Id`],state:n,metadata:{namespace:d,name:s},_key:u,name:s,namespace:d,nameDisplay:s,nameSort:(0,k.RY)(s).toLowerCase(),stateColor:l,detailLocation:p,typeDisplay:this.$store.getters["type-map/labelFor"](r),stateDisplay:(0,b.ch)(n),stateBackground:l.replace("text-","bg-"),groupByLabel:d})}return a},headers(){return[w.c4,w.ZE,w.o_,w.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 N=(0,p.A)(x,[["render",g]]);var B=N,C=a(31915),D=a(25659),T={name:"ResourceTabs",components:{Tabbed:i.A,Tab:r.A,Conditions:m,SortableTable:c.A,RelatedResources:B},mixins:[s.A],props:{value:{type:Object,default:()=>({})},mode:{type:String,default:v.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}},data(){const e=this.$store.getters["currentStore"](f.ll);return{hasEvents:this.$store.getters[`${e}/schemaFor`](f.ll),allEvents:[],selectedTab:this.defaultTab,didLoadEvents:!1,extensionTabs:(0,D.A)(this,C.c7.TAB,C.lX.RESOURCE_DETAIL,this.$route,this,this.extensionParams),inStore:e,showConditions:!1}},beforeUnmount(){this.$store.dispatch("cluster/forgetType",f.ll)},fetch(){this.setShowConditions()},computed:{showEvents(){return this.isView&&this.needEvents&&this.hasEvents},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"}]},events(){return this.allEvents.filter((e=>e.involvedObject?.uid===this.value?.metadata?.uid)).map((e=>({reason:`${e.reason||this.t("generic.unknown")}${e.count>1?` (${e.count})`:""}`.trim(),message:e.message||this.t("generic.unknown"),date:e.lastTimestamp||e.firstTimestamp||e.metadata.creationTimestamp,eventType:e.eventType})))},conditionsHaveIssues(){return!!this.showConditions&&this.value.status?.conditions?.filter((e=>!(0,b.rv)(e))).some((e=>e.error))}},methods:{tabChange(e){if(this.selectedTab=e?.selectedName,!this.didLoadEvents&&"events"===this.selectedTab){const e=this.$store.getters["currentStore"](f.ll);this.$store.dispatch(`${e}/findAll`,{type:f.ll}).then((e=>{this.allEvents=e,this.didLoadEvents=!0}))}},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"))}}};const A=(0,p.A)(T,[["render",l]]);var _=A},84215:function(e,t,a){"use strict";a.d(t,{A:function(){return u}});var o=a(9274);function n(e,t,a,n,l,i){const r=(0,o.resolveComponent)("LabeledInput");return(0,o.openBlock)(),(0,o.createBlock)(r,(0,o.mergeProps)({ref:"value",value:i.displayValue},e.$attrs,{type:"number",min:a.min,mode:a.mode,label:a.label,delay:a.delay,"label-key":a.labelKey,tooltip:a.tooltip,"tooltip-key":a.tooltipKey,required:a.required,placeholder:a.placeholder,"hide-arrows":a.hideArrows,onChange:t[0]||(t[0]=e=>i.update(e.target.value)),onBlur:t[1]||(t[1]=e=>i.update(e.target.value))}),{suffix:(0,o.withCtx)((()=>[i.displayUnit?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:0,class:(0,o.normalizeClass)(["addon",{"with-tooltip":a.tooltip||a.tooltipKey}])},(0,o.toDisplayString)(i.displayUnit),3)):(0,o.createCommentVNode)("",!0)])),_:1},16,["value","min","mode","label","delay","label-key","tooltip","tooltip-key","required","placeholder","hide-arrows"])}var l=a(95799),i=a(79380),r=a(14220),s={components:{LabeledInput:i.o},emits:["update:value"],props:{outputAs:{type:String,default:"number"},outputModifier:{type:Boolean,default:!1},inputExponent:{type:Number,default:0},baseUnit:{type:String,default:"B"},hideArrows:{type:Boolean,default:!1},increment:{type:Number,default:1e3},suffix:{type:String,default:null},mode:{type:String,default:r.G5},value:{type:[Number,String],default:null},label:{type:String,default:null},labelKey:{type:String,default:null},tooltip:{type:[String,Object],default:null},tooltipKey:{type:String,default:null},required:{type:Boolean,default:!1},min:{type:[Number,String],default:0},placeholder:{type:[String,Number],default:""},delay:{type:Number,default:0},positive:{type:Boolean,default:!1}},computed:{unit(){let e;return e=this.inputExponent>=0?l.QN[this.inputExponent]:l.kq[-1*this.inputExponent],1024===this.increment&&e&&(e+="i"),e},parsedValue(){return"string"===typeof this.value?(0,l.ao)(this.value):this.value},displayValue(){let e="";return(this.parsedValue||0===this.parsedValue)&&(e=(0,l.Mo)(this.parsedValue,{increment:this.increment,addSuffix:!1,maxExponent:this.inputExponent,minExponent:this.inputExponent})),e},displayUnit(){return this.suffix?this.suffix:this.unit+this.baseUnit}},methods:{focus(){const e=this.$refs.value;e&&e.focus()},update(e){let t=""===e?null:e;this.positive&&e<0&&(t=0),this.outputModifier?t=null===t?null:`${e}${this.unit}`:"string"===this.outputAs?t=null===t?"":`${e}`:t&&(t=this.unit?(0,l.ao)(`${t}${this.unit}`):parseInt(t)),this.$emit("update:value",t)}}},d=(a(83528),a(47433));const c=(0,d.A)(s,[["render",n],["__scopeId","data-v-ec694e82"]]);var u=c},68454:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),l=a(40935),i=a.n(l),r=i()(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),l=a(40935),i=a.n(l),r=i()(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),l=a(40935),i=a.n(l),r=i()(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},42722:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),l=a(40935),i=a.n(l),r=i()(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 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 .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}",""]),t["default"]=r},85692:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),l=a(40935),i=a.n(l),r=i()(n());r.push([e.id,".labels__header[data-v-680c438c]{display:flex;justify-content:space-between}",""]),t["default"]=r},39823:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),l=a(40935),i=a.n(l),r=i()(n());r.push([e.id,".operator .vs__dropdown-option[data-v-023836b7]{padding:3px 6px 3px 6px!important}.remove-expression[data-v-023836b7]{padding:8px;position:absolute;margin-bottom:10px;right:0;top:0;z-index:2}.remove-expression i[data-v-023836b7]{font-size:2em}.remove-container[data-v-023836b7]{display:flex;justify-content:center}.match-expression-header[data-v-023836b7],.match-expression-row[data-v-023836b7]{display:grid;grid-template-columns:1fr 1fr 1fr;margin:5px 0;grid-gap:1.75%}.match-expression-header>LABEL[data-v-023836b7],.match-expression-row>LABEL[data-v-023836b7]{margin:0}.match-expression-header[data-v-023836b7]:not(.view),.match-expression-row[data-v-023836b7]:not(.view){grid-template-columns:repeat(3,1fr) 50px}.match-expression-row>div>input[data-v-023836b7]{min-height:40px!important}.match-expression-header-matching[data-v-023836b7],.match-expression-row-matching[data-v-023836b7]{grid-template-columns:1fr 1fr 1fr 1fr}.match-expression-header-matching[data-v-023836b7]:not(.view),.match-expression-row-matching[data-v-023836b7]:not(.view){grid-template-columns:1fr 1fr 1fr 1fr 100px}",""]),t["default"]=r},37729:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),l=a(40935),i=a.n(l),r=i()(n());r.push([e.id,".password[data-v-03da7481]{display:flex;flex-direction:column}.password .labeled-input .addon[data-v-03da7481]{padding-left:12px;min-width:65px}.password .genPassword[data-v-03da7481]{display:flex;justify-content:flex-end}",""]),t["default"]=r},27784:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),l=a(40935),i=a.n(l),r=i()(n());r.push([e.id,".addon.with-tooltip[data-v-ec694e82]{position:relative;right:30px}",""]),t["default"]=r},45489:function(e,t,a){"use strict";a.r(t);var o=a(36758),n=a.n(o),l=a(40935),i=a.n(l),r=i()(n());r.push([e.id,'.toggle-container[data-v-6143aa66]{align-items:center;display:flex}.toggle-container span[data-v-6143aa66]:first-child{padding-right:6px}.toggle-container span[data-v-6143aa66]:last-child{padding-left:6px}.switch[data-v-6143aa66]{position:relative;display:inline-block;width:48px;height:24px}.switch input[data-v-6143aa66]{opacity:0;width:0;height:0}.slider[data-v-6143aa66]{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:var(--checkbox-disabled-bg)}.slider[data-v-6143aa66],.slider[data-v-6143aa66]:before{position:absolute;transition:.4s}.slider[data-v-6143aa66]:before{content:"";height:16px;width:16px;left:4px;bottom:4px;background-color:var(--checkbox-tick)}input:checked+.slider[data-v-6143aa66]{background-color:var(--checkbox-ticked-bg)}input:focus+.slider[data-v-6143aa66]{box-shadow:0 0 1px var(--checkbox-ticked-bg)}input:checked+.slider[data-v-6143aa66]:before{transform:translateX(24px)}.slider.round[data-v-6143aa66]{border-radius:34px}.slider.round[data-v-6143aa66]:before{border-radius:50%}',""]),t["default"]=r},48052:function(e,t,a){"use strict";a.d(t,{L:function(){return Nt}});var o=a(9274);
|
|
/**!
|
|
* Sortable 1.15.3
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/
|
|
function n(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 l(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?n(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function i(e){return i="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},i(e)}function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function s(){return s=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},s.apply(this,arguments)}function d(e,t){if(null==e)return{};var a,o,n={},l=Object.keys(e);for(o=0;o<l.length;o++)a=l[o],t.indexOf(a)>=0||(n[a]=e[a]);return n}function c(e,t){if(null==e)return{};var a,o,n=d(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(o=0;o<l.length;o++)a=l[o],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var u="1.15.3";function p(e){if("undefined"!==typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var h=p(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),m=p(/Edge/i),f=p(/firefox/i),v=p(/safari/i)&&!p(/chrome/i)&&!p(/android/i),g=p(/iP(ad|od|hone)/i),y=p(/chrome/i)&&p(/android/i),b={capture:!1,passive:!1};function w(e,t,a){e.addEventListener(t,a,!h&&b)}function k(e,t,a){e.removeEventListener(t,a,!h&&b)}function S(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(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function x(e,t,a,o){if(e){a=a||document;do{if(null!=t&&(">"===t[0]?e.parentNode===a&&S(e,t):S(e,t))||o&&e===a)return e;if(e===a)break}while(e=E(e))}return null}var N,B=/\s+/g;function C(e,t,a){if(e&&t)if(e.classList)e.classList[a?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(B," ").replace(" "+t+" "," ");e.className=(o+(a?" "+t:"")).replace(B," ")}}function D(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 T(e,t){var a="";if("string"===typeof e)a=e;else do{var o=D(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 A(e,t,a){if(e){var o=e.getElementsByTagName(t),n=0,l=o.length;if(a)for(;n<l;n++)a(o[n],n);return o}return[]}function _(){var e=document.scrollingElement;return e||document.documentElement}function V(e,t,a,o,n){if(e.getBoundingClientRect||e===window){var l,i,r,s,d,c,u;if(e!==window&&e.parentNode&&e!==_()?(l=e.getBoundingClientRect(),i=l.top,r=l.left,s=l.bottom,d=l.right,c=l.height,u=l.width):(i=0,r=0,s=window.innerHeight,d=window.innerWidth,c=window.innerHeight,u=window.innerWidth),(t||a)&&e!==window&&(n=n||e.parentNode,!h))do{if(n&&n.getBoundingClientRect&&("none"!==D(n,"transform")||a&&"static"!==D(n,"position"))){var p=n.getBoundingClientRect();i-=p.top+parseInt(D(n,"border-top-width")),r-=p.left+parseInt(D(n,"border-left-width")),s=i+l.height,d=r+l.width;break}}while(n=n.parentNode);if(o&&e!==window){var m=T(n||e),f=m&&m.a,v=m&&m.d;m&&(i/=v,r/=f,u/=f,c/=v,s=i+c,d=r+u)}return{top:i,left:r,bottom:s,right:d,width:u,height:c}}}function O(e,t,a){var o=R(e,!0),n=V(e)[t];while(o){var l=V(o)[a],i=void 0;if(i="top"===a||"left"===a?n>=l:n<=l,!i)return o;if(o===_())break;o=R(o,!1)}return!1}function I(e,t,a,o){var n=0,l=0,i=e.children;while(l<i.length){if("none"!==i[l].style.display&&i[l]!==Ge.ghost&&(o||i[l]!==Ge.dragged)&&x(i[l],a.draggable,e,!1)){if(n===t)return i[l];n++}l++}return null}function M(e,t){var a=e.lastElementChild;while(a&&(a===Ge.ghost||"none"===D(a,"display")||t&&!S(a,t)))a=a.previousElementSibling;return a||null}function L(e,t){var a=0;if(!e||!e.parentNode)return-1;while(e=e.previousElementSibling)"TEMPLATE"===e.nodeName.toUpperCase()||e===Ge.clone||t&&!S(e,t)||a++;return a}function P(e){var t=0,a=0,o=_();if(e)do{var n=T(e),l=n.a,i=n.d;t+=e.scrollLeft*l,a+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[t,a]}function $(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 R(e,t){if(!e||!e.getBoundingClientRect)return _();var a=e,o=!1;do{if(a.clientWidth<a.scrollWidth||a.clientHeight<a.scrollHeight){var n=D(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 U(e,t){if(e&&t)for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e}function F(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 q(e,t){return function(){if(!N){var a=arguments,o=this;1===a.length?e.call(o,a[0]):e.apply(o,a),N=setTimeout((function(){N=void 0}),t)}}}function j(){clearTimeout(N),N=void 0}function K(e,t,a){e.scrollLeft+=t,e.scrollTop+=a}function X(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)}function H(e,t,a){var o={};return Array.from(e.children).forEach((function(n){var l,i,r,s;if(x(n,t.draggable,e,!1)&&!n.animated&&n!==a){var d=V(n);o.left=Math.min(null!==(l=o.left)&&void 0!==l?l:1/0,d.left),o.top=Math.min(null!==(i=o.top)&&void 0!==i?i:1/0,d.top),o.right=Math.max(null!==(r=o.right)&&void 0!==r?r:-1/0,d.right),o.bottom=Math.max(null!==(s=o.bottom)&&void 0!==s?s:-1/0,d.bottom)}})),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Y="Sortable"+(new Date).getTime();function z(){var e,t=[];return{captureAnimationState:function(){if(t=[],this.options.animation){var e=[].slice.call(this.el.children);e.forEach((function(e){if("none"!==D(e,"display")&&e!==Ge.ghost){t.push({target:e,rect:V(e)});var a=l({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=T(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($(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,l=0;t.forEach((function(e){var t=0,a=e.target,i=a.fromRect,r=V(a),s=a.prevFromRect,d=a.prevToRect,c=e.rect,u=T(a,!0);u&&(r.top-=u.f,r.left-=u.e),a.toRect=r,a.thisAnimationDuration&&F(s,r)&&!F(i,r)&&(c.top-r.top)/(c.left-r.left)===(i.top-r.top)/(i.left-r.left)&&(t=G(c,s,d,o.options)),F(r,i)||(a.prevFromRect=i,a.prevToRect=r,t||(t=o.options.animation),o.animate(a,c,r,t)),t&&(n=!0,l=Math.max(l,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()}),l):"function"===typeof a&&a(),t=[]},animate:function(e,t,a,o){if(o){D(e,"transition",""),D(e,"transform","");var n=T(this.el),l=n&&n.a,i=n&&n.d,r=(t.left-a.left)/(l||1),s=(t.top-a.top)/(i||1);e.animatingX=!!r,e.animatingY=!!s,D(e,"transform","translate3d("+r+"px,"+s+"px,0)"),this.forRepaintDummy=W(e),D(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),D(e,"transform","translate3d(0,0,0)"),"number"===typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){D(e,"transition",""),D(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),o)}}}}function W(e){return e.offsetWidth}function G(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 Q=[],J={initializeByDefault:!0},Z={mount:function(e){for(var t in J)J.hasOwnProperty(t)&&!(t in e)&&(e[t]=J[t]);Q.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),Q.push(e)},pluginEvent:function(e,t,a){var o=this;this.eventCanceled=!1,a.cancel=function(){o.eventCanceled=!0};var n=e+"Global";Q.forEach((function(o){t[o.pluginName]&&(t[o.pluginName][n]&&t[o.pluginName][n](l({sortable:t},a)),t.options[o.pluginName]&&t[o.pluginName][e]&&t[o.pluginName][e](l({sortable:t},a)))}))},initializePlugins:function(e,t,a,o){for(var n in Q.forEach((function(o){var n=o.pluginName;if(e.options[n]||o.initializeByDefault){var l=new o(e,t,e.options);l.sortable=e,l.options=e.options,e[n]=l,s(a,l.defaults)}})),e.options)if(e.options.hasOwnProperty(n)){var l=this.modifyOption(e,n,e.options[n]);"undefined"!==typeof l&&(e.options[n]=l)}},getEventProperties:function(e,t){var a={};return Q.forEach((function(o){"function"===typeof o.eventProperties&&s(a,o.eventProperties.call(t[o.pluginName],e))})),a},modifyOption:function(e,t,a){var o;return Q.forEach((function(n){e[n.pluginName]&&n.optionListeners&&"function"===typeof n.optionListeners[t]&&(o=n.optionListeners[t].call(e[n.pluginName],a))})),o}};function ee(e){var t=e.sortable,a=e.rootEl,o=e.name,n=e.targetEl,i=e.cloneEl,r=e.toEl,s=e.fromEl,d=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,p=e.newDraggableIndex,f=e.originalEvent,v=e.putSortable,g=e.extraEventProperties;if(t=t||a&&a[Y],t){var y,b=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||h||m?(y=document.createEvent("Event"),y.initEvent(o,!0,!0)):y=new CustomEvent(o,{bubbles:!0,cancelable:!0}),y.to=r||a,y.from=s||a,y.item=n||a,y.clone=i,y.oldIndex=d,y.newIndex=c,y.oldDraggableIndex=u,y.newDraggableIndex=p,y.originalEvent=f,y.pullMode=v?v.lastPutMode:void 0;var k=l(l({},g),Z.getEventProperties(o,t));for(var S in k)y[S]=k[S];a&&a.dispatchEvent(y),b[w]&&b[w].call(t,y)}}var te=["evt"],ae=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=a.evt,n=c(a,te);Z.pluginEvent.bind(Ge)(e,t,l({dragEl:ne,parentEl:le,ghostEl:ie,rootEl:re,nextEl:se,lastDownEl:de,cloneEl:ce,cloneHidden:ue,dragStarted:xe,putSortable:ge,activeSortable:Ge.active,originalEvent:o,oldIndex:pe,oldDraggableIndex:me,newIndex:he,newDraggableIndex:fe,hideGhostForTarget:He,unhideGhostForTarget:Ye,cloneNowHidden:function(){ue=!0},cloneNowShown:function(){ue=!1},dispatchSortableEvent:function(e){oe({sortable:t,name:e,originalEvent:o})}},n))};function oe(e){ee(l({putSortable:ge,cloneEl:ce,targetEl:ne,rootEl:re,oldIndex:pe,oldDraggableIndex:me,newIndex:he,newDraggableIndex:fe},e))}var ne,le,ie,re,se,de,ce,ue,pe,he,me,fe,ve,ge,ye,be,we,ke,Se,Ee,xe,Ne,Be,Ce,De,Te=!1,Ae=!1,_e=[],Ve=!1,Oe=!1,Ie=[],Me=!1,Le=[],Pe="undefined"!==typeof document,$e=g,Re=m||h?"cssFloat":"float",Ue=Pe&&!y&&!g&&"draggable"in document.createElement("div"),Fe=function(){if(Pe){if(h)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),qe=function(e,t){var a=D(e),o=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),n=I(e,0,t),l=I(e,1,t),i=n&&D(n),r=l&&D(l),s=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+V(n).width,d=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+V(l).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&&i["float"]&&"none"!==i["float"]){var c="left"===i["float"]?"left":"right";return!l||"both"!==r.clear&&r.clear!==c?"horizontal":"vertical"}return n&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||s>=o&&"none"===a[Re]||l&&"none"===a[Re]&&s+d>o)?"vertical":"horizontal"},je=function(e,t,a){var o=a?e.left:e.top,n=a?e.right:e.bottom,l=a?e.width:e.height,i=a?t.left:t.top,r=a?t.right:t.bottom,s=a?t.width:t.height;return o===i||n===r||o+l/2===i+s/2},Ke=function(e,t){var a;return _e.some((function(o){var n=o[Y].options.emptyInsertThreshold;if(n&&!M(o)){var l=V(o),i=e>=l.left-n&&e<=l.right+n,r=t>=l.top-n&&t<=l.bottom+n;return i&&r?a=o:void 0}})),a},Xe=function(e){function t(e,a){return function(o,n,l,i){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,l,i),a)(o,n,l,i);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"==i(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},He=function(){!Fe&&ie&&D(ie,"display","none")},Ye=function(){!Fe&&ie&&D(ie,"display","")};Pe&&!y&&document.addEventListener("click",(function(e){if(Ae)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ae=!1,!1}),!0);var ze=function(e){if(ne){e=e.touches?e.touches[0]:e;var t=Ke(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[Y]._onDragOver(a)}}},We=function(e){ne&&ne.parentNode[Y]._isOutsideThisEl(e.target)};function Ge(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=s({},t),e[Y]=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 qe(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!==Ge.supportPointer&&"PointerEvent"in window&&!v,emptyInsertThreshold:5};for(var o in Z.initializePlugins(this,e,a),a)!(o in t)&&(t[o]=a[o]);for(var n in Xe(t),this)"_"===n.charAt(0)&&"function"===typeof this[n]&&(this[n]=this[n].bind(this));this.nativeDraggable=!t.forceFallback&&Ue,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?w(e,"pointerdown",this._onTapStart):(w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),_e.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,z())}function Qe(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Je(e,t,a,o,n,l,i,r){var s,d,c=e[Y],u=c.options.onMove;return!window.CustomEvent||h||m?(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=l||V(t),s.willInsertAfter=r,s.originalEvent=i,e.dispatchEvent(s),u&&(d=u.call(c,s,i)),d}function Ze(e){e.draggable=!1}function et(){Me=!1}function tt(e,t,a){var o=V(I(a.el,0,a.options,!0)),n=H(a.el,a.options,ie),l=10;return t?e.clientX<n.left-l||e.clientY<o.top&&e.clientX<o.right:e.clientY<n.top-l||e.clientY<o.bottom&&e.clientX<o.left}function at(e,t,a){var o=V(M(a.el,a.options.draggable)),n=H(a.el,a.options,ie),l=10;return t?e.clientX>n.right+l||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>n.bottom+l||e.clientX>o.right&&e.clientY>o.top}function ot(e,t,a,o,n,l,i,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(!i)if(r&&Ce<d*n){if(!Ve&&(1===Be?s>c+d*l/2:s<u-d*l/2)&&(Ve=!0),Ve)p=!0;else if(1===Be?s<c+Ce:s>u-Ce)return-Be}else if(s>c+d*(1-n)/2&&s<u-d*(1-n)/2)return nt(t);return p=p||i,p&&(s<c+d*l/2||s>u-d*l/2)?s>c+d/2?1:-1:0}function nt(e){return L(ne)<L(e)?1:-1}function lt(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 it(e){Le.length=0;var t=e.getElementsByTagName("input"),a=t.length;while(a--){var o=t[a];o.checked&&Le.push(o)}}function rt(e){return setTimeout(e,0)}function st(e){return clearTimeout(e)}Ge.prototype={constructor:Ge,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ne=null)},_getDirection:function(e,t){return"function"===typeof this.options.direction?this.options.direction.call(this,e,t,ne):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,a=this.el,o=this.options,n=o.preventOnFilter,l=e.type,i=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,r=(i||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||r,d=o.filter;if(it(a),!ne&&!(/mousedown|pointerdown/.test(l)&&0!==e.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!v||!r||"SELECT"!==r.tagName.toUpperCase())&&(r=x(r,o.draggable,a,!1),(!r||!r.animated)&&de!==r)){if(pe=L(r),me=L(r,o.draggable),"function"===typeof d){if(d.call(this,e,r,this))return oe({sortable:t,rootEl:s,name:"filter",targetEl:r,toEl:a,fromEl:a}),ae("filter",t,{evt:e}),void(n&&e.cancelable&&e.preventDefault())}else if(d&&(d=d.split(",").some((function(o){if(o=x(s,o.trim(),a,!1),o)return oe({sortable:t,rootEl:o,name:"filter",targetEl:r,fromEl:a,toEl:a}),ae("filter",t,{evt:e}),!0})),d))return void(n&&e.cancelable&&e.preventDefault());o.handle&&!x(s,o.handle,a,!1)||this._prepareDragStart(e,i,r)}}},_prepareDragStart:function(e,t,a){var o,n=this,l=n.el,i=n.options,r=l.ownerDocument;if(a&&!ne&&a.parentNode===l){var s=V(a);if(re=l,ne=a,le=ne.parentNode,se=ne.nextSibling,de=a,ve=i.group,Ge.dragged=ne,ye={target:ne,clientX:(t||e).clientX,clientY:(t||e).clientY},Se=ye.clientX-s.left,Ee=ye.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ne.style["will-change"]="all",o=function(){ae("delayEnded",n,{evt:e}),Ge.eventCanceled?n._onDrop():(n._disableDelayedDragEvents(),!f&&n.nativeDraggable&&(ne.draggable=!0),n._triggerDragStart(e,t),oe({sortable:n,name:"choose",originalEvent:e}),C(ne,i.chosenClass,!0))},i.ignore.split(",").forEach((function(e){A(ne,e.trim(),Ze)})),w(r,"dragover",ze),w(r,"mousemove",ze),w(r,"touchmove",ze),w(r,"mouseup",n._onDrop),w(r,"touchend",n._onDrop),w(r,"touchcancel",n._onDrop),f&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ne.draggable=!0),ae("delayStart",this,{evt:e}),!i.delay||i.delayOnTouchOnly&&!t||this.nativeDraggable&&(m||h))o();else{if(Ge.eventCanceled)return void this._onDrop();w(r,"mouseup",n._disableDelayedDrag),w(r,"touchend",n._disableDelayedDrag),w(r,"touchcancel",n._disableDelayedDrag),w(r,"mousemove",n._delayedDragTouchMoveHandler),w(r,"touchmove",n._delayedDragTouchMoveHandler),i.supportPointer&&w(r,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(o,i.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(){ne&&Ze(ne),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;k(e,"mouseup",this._disableDelayedDrag),k(e,"touchend",this._disableDelayedDrag),k(e,"touchcancel",this._disableDelayedDrag),k(e,"mousemove",this._delayedDragTouchMoveHandler),k(e,"touchmove",this._delayedDragTouchMoveHandler),k(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):w(document,t?"touchmove":"mousemove",this._onTouchMove):(w(ne,"dragend",this),w(re,"dragstart",this._onDragStart));try{document.selection?rt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(a){}},_dragStarted:function(e,t){if(Te=!1,re&&ne){ae("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",We);var a=this.options;!e&&C(ne,a.dragClass,!1),C(ne,a.ghostClass,!0),Ge.active=this,e&&this._appendGhost(),oe({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(be){this._lastX=be.clientX,this._lastY=be.clientY,He();var e=document.elementFromPoint(be.clientX,be.clientY),t=e;while(e&&e.shadowRoot){if(e=e.shadowRoot.elementFromPoint(be.clientX,be.clientY),e===t)break;t=e}if(ne.parentNode[Y]._isOutsideThisEl(e),t)do{if(t[Y]){var a=void 0;if(a=t[Y]._onDragOver({clientX:be.clientX,clientY:be.clientY,target:e,rootEl:t}),a&&!this.options.dragoverBubble)break}e=t}while(t=E(t));Ye()}},_onTouchMove:function(e){if(ye){var t=this.options,a=t.fallbackTolerance,o=t.fallbackOffset,n=e.touches?e.touches[0]:e,l=ie&&T(ie,!0),i=ie&&l&&l.a,r=ie&&l&&l.d,s=$e&&De&&P(De),d=(n.clientX-ye.clientX+o.x)/(i||1)+(s?s[0]-Ie[0]:0)/(i||1),c=(n.clientY-ye.clientY+o.y)/(r||1)+(s?s[1]-Ie[1]:0)/(r||1);if(!Ge.active&&!Te){if(a&&Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))<a)return;this._onDragStart(e,!0)}if(ie){l?(l.e+=d-(we||0),l.f+=c-(ke||0)):l={a:1,b:0,c:0,d:1,e:d,f:c};var u="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");D(ie,"webkitTransform",u),D(ie,"mozTransform",u),D(ie,"msTransform",u),D(ie,"transform",u),we=d,ke=c,be=n}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ie){var e=this.options.fallbackOnBody?document.body:re,t=V(ne,!0,$e,!0,e),a=this.options;if($e){De=e;while("static"===D(De,"position")&&"none"===D(De,"transform")&&De!==document)De=De.parentNode;De!==document.body&&De!==document.documentElement?(De===document&&(De=_()),t.top+=De.scrollTop,t.left+=De.scrollLeft):De=_(),Ie=P(De)}ie=ne.cloneNode(!0),C(ie,a.ghostClass,!1),C(ie,a.fallbackClass,!0),C(ie,a.dragClass,!0),D(ie,"transition",""),D(ie,"transform",""),D(ie,"box-sizing","border-box"),D(ie,"margin",0),D(ie,"top",t.top),D(ie,"left",t.left),D(ie,"width",t.width),D(ie,"height",t.height),D(ie,"opacity","0.8"),D(ie,"position",$e?"absolute":"fixed"),D(ie,"zIndex","100000"),D(ie,"pointerEvents","none"),Ge.ghost=ie,e.appendChild(ie),D(ie,"transform-origin",Se/parseInt(ie.style.width)*100+"% "+Ee/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(e,t){var a=this,o=e.dataTransfer,n=a.options;ae("dragStart",this,{evt:e}),Ge.eventCanceled?this._onDrop():(ae("setupClone",this),Ge.eventCanceled||(ce=X(ne),ce.removeAttribute("id"),ce.draggable=!1,ce.style["will-change"]="",this._hideClone(),C(ce,this.options.chosenClass,!1),Ge.clone=ce),a.cloneId=rt((function(){ae("clone",a),Ge.eventCanceled||(a.options.removeCloneOnHide||re.insertBefore(ce,ne),a._hideClone(),oe({sortable:a,name:"clone"}))})),!t&&C(ne,n.dragClass,!0),t?(Ae=!0,a._loopId=setInterval(a._emulateDragOver,50)):(k(document,"mouseup",a._onDrop),k(document,"touchend",a._onDrop),k(document,"touchcancel",a._onDrop),o&&(o.effectAllowed="move",n.setData&&n.setData.call(a,o,ne)),w(document,"drop",a),D(ne,"transform","translateZ(0)")),Te=!0,a._dragStartId=rt(a._dragStarted.bind(a,t,e)),w(document,"selectstart",a),xe=!0,v&&D(document.body,"user-select","none"))},_onDragOver:function(e){var t,a,o,n,i=this.el,r=e.target,s=this.options,d=s.group,c=Ge.active,u=ve===d,p=s.sort,h=ge||c,m=this,f=!1;if(!Me){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),r=x(r,s.draggable,i,!0),$("dragOver"),Ge.eventCanceled)return f;if(ne.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||m._ignoreWhileAnimating===r)return U(!1);if(Ae=!1,c&&!s.disabled&&(u?p||(o=le!==re):ge===this||(this.lastPutMode=ve.checkPull(this,c,ne,e))&&d.checkPut(this,c,ne,e))){if(n="vertical"===this._getDirection(e,r),t=V(ne),$("dragOverValid"),Ge.eventCanceled)return f;if(o)return le=re,R(),this._hideClone(),$("revert"),Ge.eventCanceled||(se?re.insertBefore(ne,se):re.appendChild(ne)),U(!0);var v=M(i,s.draggable);if(!v||at(e,n,this)&&!v.animated){if(v===ne)return U(!1);if(v&&i===e.target&&(r=v),r&&(a=V(r)),!1!==Je(re,i,ne,t,r,a,e,!!r))return R(),v&&v.nextSibling?i.insertBefore(ne,v.nextSibling):i.appendChild(ne),le=i,F(),U(!0)}else if(v&&tt(e,n,this)){var g=I(i,0,s,!0);if(g===ne)return U(!1);if(r=g,a=V(r),!1!==Je(re,i,ne,t,r,a,e,!1))return R(),i.insertBefore(ne,g),le=i,F(),U(!0)}else if(r.parentNode===i){a=V(r);var y,b,w=0,k=ne.parentNode!==i,S=!je(ne.animated&&ne.toRect||t,r.animated&&r.toRect||a,n),E=n?"top":"left",N=O(r,"top","top")||O(ne,"top","top"),B=N?N.scrollTop:void 0;if(Ne!==r&&(y=a[E],Ve=!1,Oe=!S&&s.invertSwap||k),w=ot(e,r,a,n,S?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Oe,Ne===r),0!==w){var T=L(ne);do{T-=w,b=le.children[T]}while(b&&("none"===D(b,"display")||b===ie))}if(0===w||b===r)return U(!1);Ne=r,Be=w;var A=r.nextElementSibling,_=!1;_=1===w;var P=Je(re,i,ne,t,r,a,e,_);if(!1!==P)return 1!==P&&-1!==P||(_=1===P),Me=!0,setTimeout(et,30),R(),_&&!A?i.appendChild(ne):r.parentNode.insertBefore(ne,_?A:r),N&&K(N,0,B-N.scrollTop),le=ne.parentNode,void 0===y||Oe||(Ce=Math.abs(y-V(r)[E])),F(),U(!0)}if(i.contains(ne))return U(!1)}return!1}function $(s,d){ae(s,m,l({evt:e,isOwner:u,axis:n?"vertical":"horizontal",revert:o,dragRect:t,targetRect:a,canSort:p,fromSortable:h,target:r,completed:U,onMove:function(a,o){return Je(re,i,ne,t,a,V(a),e,o)},changed:F},d))}function R(){$("dragOverAnimationCapture"),m.captureAnimationState(),m!==h&&h.captureAnimationState()}function U(t){return $("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(m),m!==h&&(C(ne,ge?ge.options.ghostClass:c.options.ghostClass,!1),C(ne,s.ghostClass,!0)),ge!==m&&m!==Ge.active?ge=m:m===Ge.active&&ge&&(ge=null),h===m&&(m._ignoreWhileAnimating=r),m.animateAll((function(){$("dragOverAnimationComplete"),m._ignoreWhileAnimating=null})),m!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(r===ne&&!ne.animated||r===i&&!r.animated)&&(Ne=null),s.dragoverBubble||e.rootEl||r===document||(ne.parentNode[Y]._isOutsideThisEl(e.target),!t&&ze(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function F(){he=L(ne),fe=L(ne,s.draggable),oe({sortable:m,name:"change",toEl:i,newIndex:he,newDraggableIndex:fe,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){k(document,"mousemove",this._onTouchMove),k(document,"touchmove",this._onTouchMove),k(document,"pointermove",this._onTouchMove),k(document,"dragover",ze),k(document,"mousemove",ze),k(document,"touchmove",ze)},_offUpEvents:function(){var e=this.el.ownerDocument;k(e,"mouseup",this._onDrop),k(e,"touchend",this._onDrop),k(e,"pointerup",this._onDrop),k(e,"touchcancel",this._onDrop),k(document,"selectstart",this)},_onDrop:function(e){var t=this.el,a=this.options;he=L(ne),fe=L(ne,a.draggable),ae("drop",this,{evt:e}),le=ne&&ne.parentNode,he=L(ne),fe=L(ne,a.draggable),Ge.eventCanceled||(Te=!1,Oe=!1,Ve=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),st(this.cloneId),st(this._dragStartId),this.nativeDraggable&&(k(document,"drop",this),k(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),v&&D(document.body,"user-select",""),D(ne,"transform",""),e&&(xe&&(e.cancelable&&e.preventDefault(),!a.dropBubble&&e.stopPropagation()),ie&&ie.parentNode&&ie.parentNode.removeChild(ie),(re===le||ge&&"clone"!==ge.lastPutMode)&&ce&&ce.parentNode&&ce.parentNode.removeChild(ce),ne&&(this.nativeDraggable&&k(ne,"dragend",this),Ze(ne),ne.style["will-change"]="",xe&&!Te&&C(ne,ge?ge.options.ghostClass:this.options.ghostClass,!1),C(ne,this.options.chosenClass,!1),oe({sortable:this,name:"unchoose",toEl:le,newIndex:null,newDraggableIndex:null,originalEvent:e}),re!==le?(he>=0&&(oe({rootEl:le,name:"add",toEl:le,fromEl:re,originalEvent:e}),oe({sortable:this,name:"remove",toEl:le,originalEvent:e}),oe({rootEl:le,name:"sort",toEl:le,fromEl:re,originalEvent:e}),oe({sortable:this,name:"sort",toEl:le,originalEvent:e})),ge&&ge.save()):he!==pe&&he>=0&&(oe({sortable:this,name:"update",toEl:le,originalEvent:e}),oe({sortable:this,name:"sort",toEl:le,originalEvent:e})),Ge.active&&(null!=he&&-1!==he||(he=pe,fe=me),oe({sortable:this,name:"end",toEl:le,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){ae("nulling",this),re=ne=le=ie=se=ce=de=ue=ye=be=xe=he=fe=pe=me=Ne=Be=ge=ve=Ge.dragged=Ge.ghost=Ge.clone=Ge.active=null,Le.forEach((function(e){e.checked=!0})),Le.length=we=ke=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ne&&(this._onDragOver(e),Qe(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e,t=[],a=this.el.children,o=0,n=a.length,l=this.options;o<n;o++)e=a[o],x(e,l.draggable,this.el,!1)&&t.push(e.getAttribute(l.dataIdAttr)||lt(e));return t},sort:function(e,t){var a={},o=this.el;this.toArray().forEach((function(e,t){var n=o.children[t];x(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 x(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=Z.modifyOption(this,e,t);a[e]="undefined"!==typeof o?o:t,"group"===e&&Xe(a)},destroy:function(){ae("destroy",this);var e=this.el;e[Y]=null,k(e,"mousedown",this._onTapStart),k(e,"touchstart",this._onTapStart),k(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(k(e,"dragover",this),k(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),_e.splice(_e.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ue){if(ae("hideClone",this),Ge.eventCanceled)return;D(ce,"display","none"),this.options.removeCloneOnHide&&ce.parentNode&&ce.parentNode.removeChild(ce),ue=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(ue){if(ae("showClone",this),Ge.eventCanceled)return;ne.parentNode!=re||this.options.group.revertClone?se?re.insertBefore(ce,se):re.appendChild(ce):re.insertBefore(ce,ne),this.options.group.revertClone&&this.animate(ne,ce),D(ce,"display",""),ue=!1}}else this._hideClone()}},Pe&&w(document,"touchmove",(function(e){(Ge.active||Te)&&e.cancelable&&e.preventDefault()})),Ge.utils={on:w,off:k,css:D,find:A,is:function(e,t){return!!x(e,t,e,!1)},extend:U,throttle:q,closest:x,toggleClass:C,clone:X,index:L,nextTick:rt,cancelNextTick:st,detectDirection:qe,getChild:I,expando:Y},Ge.get=function(e){return e[Y]},Ge.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&&(Ge.utils=l(l({},Ge.utils),e.utils)),Z.mount(e)}))},Ge.create=function(e,t){return new Ge(e,t)},Ge.version=u;var dt,ct,ut,pt,ht,mt,ft=[],vt=!1;function gt(){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?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):t.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?k(document,"dragover",this._handleAutoScroll):(k(document,"pointermove",this._handleFallbackAutoScroll),k(document,"touchmove",this._handleFallbackAutoScroll),k(document,"mousemove",this._handleFallbackAutoScroll)),bt(),yt(),j()},nulling:function(){ht=ct=dt=vt=mt=ut=pt=null,ft.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,l=document.elementFromPoint(o,n);if(ht=e,t||this.options.forceAutoScrollFallback||m||h||v){wt(e,this.options,l,t);var i=R(l,!0);!vt||mt&&o===ut&&n===pt||(mt&&bt(),mt=setInterval((function(){var l=R(document.elementFromPoint(o,n),!0);l!==i&&(i=l,yt()),wt(e,a.options,l,t)}),10),ut=o,pt=n)}else{if(!this.options.bubbleScroll||R(l,!0)===_())return void yt();wt(e,this.options,R(l,!1),!1)}}},s(e,{pluginName:"scroll",initializeByDefault:!0})}function yt(){ft.forEach((function(e){clearInterval(e.pid)})),ft=[]}function bt(){clearInterval(mt)}var wt=q((function(e,t,a,o){if(t.scroll){var n,l=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,s=t.scrollSpeed,d=_(),c=!1;ct!==a&&(ct=a,yt(),dt=t.scroll,n=t.scrollFn,!0===dt&&(dt=R(a,!0)));var u=0,p=dt;do{var h=p,m=V(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=D(h),B=h.scrollLeft,C=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 T=k&&(Math.abs(y-l)<=r&&B+b<E)-(Math.abs(g-l)<=r&&!!B),A=S&&(Math.abs(v-i)<=r&&C+w<x)-(Math.abs(f-i)<=r&&!!C);if(!ft[u])for(var O=0;O<=u;O++)ft[O]||(ft[O]={});ft[u].vx==T&&ft[u].vy==A&&ft[u].el===h||(ft[u].el=h,ft[u].vx=T,ft[u].vy=A,clearInterval(ft[u].pid),0==T&&0==A||(c=!0,ft[u].pid=setInterval(function(){o&&0===this.layer&&Ge.active._onTouchMove(ht);var t=ft[this.layer].vy?ft[this.layer].vy*s:0,a=ft[this.layer].vx?ft[this.layer].vx*s:0;"function"===typeof n&&"continue"!==n.call(Ge.dragged.parentNode[Y],a,t,e,ht,ft[this.layer].el)||K(ft[this.layer].el,a,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&p!==d&&(p=R(p,!1)));vt=c}}),30),kt=function(e){var t=e.originalEvent,a=e.putSortable,o=e.dragEl,n=e.activeSortable,l=e.dispatchSortableEvent,i=e.hideGhostForTarget,r=e.unhideGhostForTarget;if(t){var s=a||n;i();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(d.clientX,d.clientY);r(),s&&!s.el.contains(c)&&(l("spill"),this.onSpill({dragEl:o,putSortable:a}))}};function St(){}function Et(){}St.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=I(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:kt},s(St,{pluginName:"revertOnSpill"}),Et.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:kt},s(Et,{pluginName:"removeOnSpill"});Ge.mount(new gt),Ge.mount(Et,St);var xt=Ge;const Nt=(0,o.defineComponent)({__name:"Sortable",props:{options:{type:Object,default:null,required:!1},list:{type:[Array,Object],default:[],required:!0},itemKey:{type:[String,Function],default:"",required:!0},tag:{type:String,default:"div",required:!1}},emits:["choose","unchoose","start","end","add","update","sort","remove","filter","move","clone","change"],setup(e,{expose:t,emit:a}){const n=e,l=a,i=(0,o.useAttrs)(),r=(0,o.ref)(!1),s=(0,o.ref)(null),d=(0,o.ref)(null),c=(0,o.computed)((()=>"string"===typeof n.itemKey?e=>e[n.itemKey]:n.itemKey));return t({containerRef:s,sortable:d,isDragging:r}),(0,o.watch)(s,(e=>{e&&(d.value=new xt(e,{...n.options,onChoose:e=>l("choose",e),onUnchoose:e=>l("unchoose",e),onStart:e=>{r.value=!0,l("start",e)},onEnd:e=>{setTimeout((()=>{r.value=!1,l("end",e)}))},onAdd:e=>l("add",e),onUpdate:e=>l("update",e),onSort:e=>l("sort",e),onRemove:e=>l("remove",e),onFilter:e=>l("filter",e),onMove:(e,t)=>"onMoveCapture"in i?i.onMoveCapture(e,t):l("move",e,t),onClone:e=>l("clone",e),onChange:e=>l("change",e)}))})),(0,o.watch)((()=>n.options),(e=>{if(e&&d?.value)for(const t in e)d.value.option(t,e[t])})),(0,o.onUnmounted)((()=>{d.value&&(d.value.destroy(),s.value=null,d.value=null)})),(t,a)=>((0,o.openBlock)(),(0,o.createBlock)((0,o.resolveDynamicComponent)(t.$props.tag),{ref_key:"containerRef",ref:s,class:(0,o.normalizeClass)(t.$props.class)},{default:(0,o.withCtx)((()=>[(0,o.renderSlot)(t.$slots,"header"),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(e.list,((e,a)=>(0,o.renderSlot)(t.$slots,"item",{key:c.value(e),element:e,index:a}))),128)),(0,o.renderSlot)(t.$slots,"footer")])),_:3},8,["class"]))}})},24989:function(e,t,a){"use strict";a.d(t,{J:function(){return o}});const o={OPAQUE:"Opaque",SERVICE_ACCT:"kubernetes.io/service-account-token",DOCKER_JSON:"kubernetes.io/dockerconfigjson",BASIC:"kubernetes.io/basic-auth",SSH:"kubernetes.io/ssh-auth",TLS:"kubernetes.io/tls",BOOTSTRAP:"bootstrap.kubernetes.io/token",ISTIO_TLS:"istio.io/key-and-cert",HELM_RELEASE:"helm.sh/release.v1",FLEET_CLUSTER:"fleet.cattle.io/cluster-registration-values",CLOUD_CREDENTIAL:"provisioning.cattle.io/cloud-credential",RKE_AUTH_CONFIG:"rke.cattle.io/auth-config"}},35567:function(e,t,a){var o=a(68454);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("4ba94651",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})},65570:function(e,t,a){var o=a(42722);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("641cbe26",o,!0,{sourceMap:!1,shadowMode:!1})},53788:function(e,t,a){var o=a(85692);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("2f431e88",o,!0,{sourceMap:!1,shadowMode:!1})},93071:function(e,t,a){var o=a(39823);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("3af37976",o,!0,{sourceMap:!1,shadowMode:!1})},22209:function(e,t,a){var o=a(37729);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("910fdbae",o,!0,{sourceMap:!1,shadowMode:!1})},83528:function(e,t,a){var o=a(27784);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("2e610f0d",o,!0,{sourceMap:!1,shadowMode:!1})},92433:function(e,t,a){var o=a(45489);o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[e.id,o,""]]),o.locals&&(e.exports=o.locals);var n=a(74825).A;n("26e85bfe",o,!0,{sourceMap:!1,shadowMode:!1})}}]);
|
|
//# sourceMappingURL=harvester-1.0.1.umd.min.542.js.map
|