diff --git a/CHANGELOG.md b/CHANGELOG.md index e43555b..15a4110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## v2.6.10 + +> `2024-09-16` + +### 🐞 Bug Fixes + - Option should display as selected even when value is an object + +### πŸŽ‰ Feature + - Optimization (πŸ™ @bettysteger) + ## v2.6.9 > `2024-07-29` diff --git a/dist/multiselect.global.js b/dist/multiselect.global.js index c0d7006..5af540e 100644 --- a/dist/multiselect.global.js +++ b/dist/multiselect.global.js @@ -1 +1 @@ -var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:o,mode:i}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[o.value])):e[o.value],d=e=>t(e)?"single"===i.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:o,valueProp:i}=e.toRefs(t),u=e.ref("single"!==o.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===o.value?u.value[i.value]:u.value.map((e=>e[i.value])))),d=l((()=>"single"!==o.value?u.value.map((e=>e[i.value])).join(","):u.value[i.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,o=l.isOpen,i=l.open,u=e.ref(null);return e.watch(u,(e=>{!o.value&&e&&i(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function o(t,a,l){const{groupSelect:n,mode:r,groups:o,disabledProp:i}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[i.value]||o.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function i(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}function u(a,n,r){const{options:o,mode:u,trackBy:s,limit:c,hideSelected:d,createTag:p,createOption:v,label:f,appendNewTag:m,appendNewOption:h,multipleLabel:g,object:b,loading:y,delay:w,resolveOnLoad:x,minChars:O,filterResults:k,clearOnSearch:S,clearOnSelect:C,valueProp:L,allowAbsent:E,groupLabel:B,canDeselect:T,max:V,strict:_,closeOnSelect:q,closeOnDeselect:P,groups:N,reverse:D,infinite:A,groupOptions:R,groupHideEmpty:I,groupSelect:j,onCreate:M,disabledProp:z,searchStart:$,searchFilter:W}=e.toRefs(a),H=e.getCurrentInstance().proxy,F=r.iv,K=r.ev,G=r.search,U=r.clearSearch,X=r.update,Y=r.pointer,J=r.setPointer,Q=r.clearPointer,Z=r.focus,ee=r.deactivate,te=r.close,ae=r.localize,le=e.ref([]),ne=e.ref([]),re=e.ref(!1),oe=e.ref(null),ie=e.ref(A.value&&-1===c.value?10:c.value),ue=e.computed({get:()=>ne.value,set:e=>ne.value=e}),se=l((()=>p.value||v.value||!1)),ce=l((()=>void 0!==m.value?m.value:void 0===h.value||h.value)),de=e.computed((()=>{if(N.value){let e=fe.value||[],t=[];return e.forEach((e=>{$e(e[R.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=$e(ne.value||[]);return le.value.length&&(e=e.concat(le.value)),e}})),pe=e.computed((()=>{let e=de.value;return D.value&&(e=e.reverse()),xe.value.length&&(e=xe.value.concat(e)),ze(e)})),ve=e.computed((()=>{let e=pe.value;return ie.value>0&&(e=e.slice(0,ie.value)),e})),fe=e.computed((()=>{if(!N.value)return[];let e=[],t=ne.value||[];return le.value.length&&e.push({[B.value]:" ",[R.value]:[...le.value],__CREATE__:!0}),e.concat(t)})),me=e.computed((()=>{let e=[...fe.value].map((e=>({...e})));return xe.value.length&&(e[0]&&e[0].__CREATE__?e[0][R.value]=[...xe.value,...e[0][R.value]]:e=[{[B.value]:" ",[R.value]:[...xe.value],__CREATE__:!0}].concat(e)),e})),he=e.computed((()=>{if(!N.value)return[];let e=me.value;return Me((e||[]).map(((e,t)=>{const a=$e(e[R.value]);return{...e,index:t,group:!0,[R.value]:ze(a,!1).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{}))),__VISIBLE__:ze(a).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{})))}})))})),ge=e.computed((()=>{switch(u.value){case"single":return!t(F.value[L.value]);case"multiple":case"tags":return!t(F.value)&&F.value.length>0}})),be=e.computed((()=>void 0!==g.value?g.value(F.value,H):F.value&&F.value.length>1?`${F.value.length} options selected`:"1 option selected")),ye=l((()=>!de.value.length&&!re.value&&!xe.value.length)),we=l((()=>de.value.length>0&&0==ve.value.length&&(G.value&&N.value||!N.value))),xe=e.computed((()=>!1!==se.value&&G.value?-1!==Ie(G.value)?[]:[{[L.value]:G.value,[Oe.value[0]]:G.value,[f.value]:G.value,__CREATE__:!0}]:[])),Oe=e.computed((()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[f.value])),ke=l((()=>{switch(u.value){case"single":return null;case"multiple":case"tags":return[]}})),Se=l((()=>y.value||re.value)),Ce=e=>{switch("object"!=typeof e&&(e=Re(e)),u.value){case"single":X(e);break;case"multiple":case"tags":X(F.value.concat(e))}n.emit("select",Ee(e),e,H)},Le=e=>{switch("object"!=typeof e&&(e=Re(e)),u.value){case"single":Te();break;case"tags":case"multiple":X(Array.isArray(e)?F.value.filter((t=>-1===e.map((e=>e[L.value])).indexOf(t[L.value]))):F.value.filter((t=>t[L.value]!=e[L.value])))}n.emit("deselect",Ee(e),e,H)},Ee=e=>b.value?e:e[L.value],Be=e=>{Le(e)},Te=()=>{X(ke.value),n.emit("clear",H)},Ve=e=>{if(void 0!==e.group)return"single"!==u.value&&(Ae(e[R.value])&&e[R.value].length);switch(u.value){case"single":return!t(F.value)&&F.value[L.value]==e[L.value];case"tags":case"multiple":return!t(F.value)&&-1!==F.value.map((e=>e[L.value])).indexOf(e[L.value])}},_e=e=>!0===e[z.value],qe=()=>!(void 0===V||-1===V.value||!ge.value&&V.value>0)&&F.value.length>=V.value,Pe=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,u.value){case"single":if(e&&Ve(e))return T.value&&Le(e),void(P.value&&(Q(),te()));e&&Ne(e),C.value&&U(),q.value&&(Q(),te()),e&&Ce(e);break;case"multiple":if(e&&Ve(e))return Le(e),void(P.value&&(Q(),te()));if(qe())return void n.emit("max",H);e&&(Ne(e),Ce(e)),C.value&&U(),d.value&&Q(),q.value&&te();break;case"tags":if(e&&Ve(e))return Le(e),void(P.value&&(Q(),te()));if(qe())return void n.emit("max",H);e&&Ne(e),C.value&&U(),e&&Ce(e),d.value&&Q(),q.value&&te()}q.value||Z()},Ne=e=>{void 0===Re(e[L.value])&&se.value&&(n.emit("tag",e[L.value],H),n.emit("option",e[L.value],H),n.emit("create",e[L.value],H),ce.value&&je(e),U())},De=e=>void 0===e.find((e=>!Ve(e)&&!e[z.value])),Ae=e=>void 0===e.find((e=>!Ve(e))),Re=e=>de.value[de.value.map((e=>String(e[L.value]))).indexOf(String(e))],Ie=e=>de.value.findIndex((t=>Oe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),je=e=>{le.value.push(e)},Me=e=>I.value?e.filter((e=>G.value?e.__VISIBLE__.length:e[R.value].length)):e.filter((e=>!G.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(G.value&&k.value){let e=W.value;e||(e=(e,t,a)=>Oe.value.some((a=>{let l=i(ae(e[a]),_.value);return $.value?l.startsWith(i(t,_.value)):-1!==l.indexOf(i(t,_.value))}))),a=a.filter((t=>e(t,G.value,H)))}return d.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(u.value)&&d.value&&Ve(e))(e)))),a},$e=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[L.value]:e,[Oe.value[0]]:a,[f.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[L.value]:e,[Oe.value[0]]:e,[f.value]:e})),t},We=()=>{t(K.value)||(F.value=Ke(K.value))},He=e=>(re.value=!0,new Promise(((t,a)=>{o.value(G.value,H).then((t=>{ne.value=t||[],"function"==typeof e&&e(t),re.value=!1})).catch((e=>{console.error(e),ne.value=[],re.value=!1})).finally((()=>{t()}))}))),Fe=()=>{if(ge.value)if("single"===u.value){let e=Re(F.value[L.value]);if(void 0!==e){let t=e[f.value];F.value[f.value]=t,b.value&&(K.value[f.value]=t)}}else F.value.forEach(((e,t)=>{let a=Re(F.value[t][L.value]);if(void 0!==a){let e=a[f.value];F.value[t][f.value]=e,b.value&&(K.value[t][f.value]=e)}}))},Ke=e=>t(e)?"single"===u.value?{}:[]:b.value?e:"single"===u.value?Re(e)||(E.value?{[f.value]:e,[L.value]:e,[Oe.value[0]]:e}:{}):e.filter((e=>!!Re(e)||E.value)).map((e=>Re(e)||{[f.value]:e,[L.value]:e,[Oe.value[0]]:e})),Ge=()=>{oe.value=e.watch(G,(e=>{e.length{e==G.value&&o.value(G.value,H).then((t=>{e!=G.value&&G.value||(ne.value=t,Y.value=ve.value.filter((e=>!0!==e[z.value]))[0]||null,re.value=!1)})).catch((e=>{console.error(e)}))}),w.value))}),{flush:"sync"})};if("single"!==u.value&&!t(K.value)&&!Array.isArray(K.value))throw new Error(`v-model must be an array when using "${u.value}" mode`);return o&&"function"==typeof o.value?x.value?He(We):1==b.value&&We():(ne.value=o.value,We()),w.value>-1&&Ge(),e.watch(w,((e,t)=>{oe.value&&oe.value(),e>=0&&Ge()})),e.watch(K,(e=>{if(t(e))X(Ke(e),!1);else switch(u.value){case"single":(b.value?e[L.value]!=F.value[L.value]:e!=F.value[L.value])&&X(Ke(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(b.value?e.map((e=>e[L.value])):e,F.value.map((e=>e[L.value])))||X(Ke(e),!1)}}),{deep:!0}),e.watch(o,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&He():(ne.value=a.options,Object.keys(F.value).length||We(),Fe())})),e.watch(f,Fe),e.watch(c,((e,t)=>{ie.value=A.value&&-1===e?10:e})),{resolvedOptions:ue,pfo:pe,fo:ve,filteredOptions:ve,hasSelected:ge,multipleLabelText:be,eo:de,extendedOptions:de,eg:fe,extendedGroups:fe,fg:he,filteredGroups:he,noOptions:ye,noResults:we,resolving:re,busy:Se,offset:ie,select:Ce,deselect:Le,remove:Be,selectAll:()=>{"single"!==u.value&&Ce(ve.value.filter((e=>!e.disabled&&!Ve(e))))},clear:Te,isSelected:Ve,isDisabled:_e,isMax:qe,getOption:Re,handleOptionClick:e=>{if(!_e(e))return M.value&&!Ve(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=M.value(e,H))instanceof Promise)?(re.value=!0,void e.then((e=>{re.value=!1,Pe(e)}))):void Pe(e)},handleGroupClick:e=>{if(!_e(e)&&"single"!==u.value&&j.value){switch(u.value){case"multiple":case"tags":De(e[R.value])?Le(e[R.value]):Ce(e[R.value].filter((e=>-1===F.value.map((e=>e[L.value])).indexOf(e[L.value]))).filter((e=>!e[z.value])).filter(((e,t)=>F.value.length+1+t<=V.value||-1===V.value))),d.value&&Y.value&&J(he.value.filter((e=>!e[z.value]))[Y.value.index])}q.value&&ee()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{He(e)},resolveOptions:He,refreshLabels:Fe}}function s(t,a,n){const{valueProp:r,showOptions:o,searchable:i,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,m=n.fg,h=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,x=n.clearPointer,O=n.multiselect,k=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),C=e.computed((()=>m.value.filter((e=>!e[p.value])))),L=l((()=>"single"!==c.value&&d.value)),E=l((()=>y.value&&y.value.group)),B=e.computed((()=>I(y.value))),T=e.computed((()=>{const e=E.value?y.value:I(y.value),t=C.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=C.value[t-1];return void 0===a&&(a=_.value),a})),V=e.computed((()=>{let e=C.value.map((e=>e.label)).indexOf(E.value?y.value[u.value]:I(y.value)[u.value])+1;return C.value.length<=e&&(e=0),C.value[e]})),_=e.computed((()=>[...C.value].slice(-1)[0])),q=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),P=e.computed((()=>{const e=B.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),N=e.computed((()=>{const e=I(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...T.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),A=e.computed((()=>[..._.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),R=()=>{w(S.value[0]||null)},I=e=>C.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),j=()=>{let e=O.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=E.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{i.value&&(e.length&&o.value?R():x())})),e.watch(k,(t=>{if(t&&O&&O.value){let t=O.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:L,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:R,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(E.value?g(y.value):h(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&L.value?C.value[0].__CREATE__?S.value[0]:C.value[0]:S.value[0])||null);else if(s.value&&L.value){let e=E.value?q.value:N.value;void 0===e&&(e=V.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{j()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&L.value&&(e=A.value,void 0===e&&(e=_.value)),w(e||null)}else if(s.value&&L.value){let e=E.value?D.value:P.value;void 0===e&&(e=E.value?T.value:B.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=T.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{j()}))}}}function c(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function d(e){return e instanceof c(e).Element||e instanceof Element}function p(e){return e instanceof c(e).HTMLElement||e instanceof HTMLElement}function v(e){return"undefined"!=typeof ShadowRoot&&(e instanceof c(e).ShadowRoot||e instanceof ShadowRoot)}var f=Math.max,m=Math.min,h=Math.round;function g(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function b(){return!/^((?!chrome|android).)*safari/i.test(g())}function y(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&p(e)&&(n=e.offsetWidth>0&&h(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&h(l.height)/e.offsetHeight||1);var o=(d(e)?c(e):window).visualViewport,i=!b()&&a,u=(l.left+(i&&o?o.offsetLeft:0))/n,s=(l.top+(i&&o?o.offsetTop:0))/r,v=l.width/n,f=l.height/r;return{width:v,height:f,top:s,right:u+v,bottom:s+f,left:u,x:u,y:s}}function w(e){var t=c(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(e){return e?(e.nodeName||"").toLowerCase():null}function O(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function k(e){return y(O(e)).left+w(e).scrollLeft}function S(e){return c(e).getComputedStyle(e)}function C(e){var t=S(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function L(e,t,a){void 0===a&&(a=!1);var l,n,r=p(t),o=p(t)&&function(e){var t=e.getBoundingClientRect(),a=h(t.width)/e.offsetWidth||1,l=h(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),i=O(t),u=y(e,o,a),s={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!a)&&(("body"!==x(t)||C(i))&&(s=(l=t)!==c(l)&&p(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:w(l)),p(t)?((d=y(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):i&&(d.x=k(i))),{x:u.left+s.scrollLeft-d.x,y:u.top+s.scrollTop-d.y,width:u.width,height:u.height}}function E(e){var t=y(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function B(e){return"html"===x(e)?e:e.assignedSlot||e.parentNode||(v(e)?e.host:null)||O(e)}function T(e){return["html","body","#document"].indexOf(x(e))>=0?e.ownerDocument.body:p(e)&&C(e)?e:T(B(e))}function V(e,t){var a;void 0===t&&(t=[]);var l=T(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=c(l),o=n?[r].concat(r.visualViewport||[],C(l)?l:[]):l,i=t.concat(o);return n?i:i.concat(V(B(o)))}function _(e){return["table","td","th"].indexOf(x(e))>=0}function q(e){return p(e)&&"fixed"!==S(e).position?e.offsetParent:null}function P(e){for(var t=c(e),a=q(e);a&&_(a)&&"static"===S(a).position;)a=q(a);return a&&("html"===x(a)||"body"===x(a)&&"static"===S(a).position)?t:a||function(e){var t=/firefox/i.test(g());if(/Trident/i.test(g())&&p(e)&&"fixed"===S(e).position)return null;var a=B(e);for(v(a)&&(a=a.host);p(a)&&["html","body"].indexOf(x(a))<0;){var l=S(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var N="top",D="bottom",A="right",R="left",I="auto",j=[N,D,A,R],M="start",z="end",$="clippingParents",W="viewport",H="popper",F="reference",K=j.reduce((function(e,t){return e.concat([t+"-"+M,t+"-"+z])}),[]),G=[].concat(j,[I]).reduce((function(e,t){return e.concat([t,t+"-"+M,t+"-"+z])}),[]),U=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function Y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J(e,t,a){return t===W?Y(function(e,t){var a=c(e),l=O(e),n=a.visualViewport,r=l.clientWidth,o=l.clientHeight,i=0,u=0;if(n){r=n.width,o=n.height;var s=b();(s||!s&&"fixed"===t)&&(i=n.offsetLeft,u=n.offsetTop)}return{width:r,height:o,x:i+k(e),y:u}}(e,a)):d(t)?function(e,t){var a=y(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):Y(function(e){var t,a=O(e),l=w(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=f(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=f(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),i=-l.scrollLeft+k(e),u=-l.scrollTop;return"rtl"===S(n||a).direction&&(i+=f(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:i,y:u}}(O(e)))}function Q(e){var t=V(B(e)),a=["absolute","fixed"].indexOf(S(e).position)>=0&&p(e)?P(e):e;return d(a)?t.filter((function(e){return d(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&v(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==x(e)})):[]}function Z(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ae(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?Z(n):null,o=n?ee(n):null,i=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case N:t={x:i,y:a.y-l.height};break;case D:t={x:i,y:a.y+a.height};break;case A:t={x:a.x+a.width,y:u};break;case R:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?te(r):null;if(null!=s){var c="y"===s?"height":"width";switch(o){case M:t[s]=t[s]-(a[c]/2-l[c]/2);break;case z:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function le(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,o=l.strategy,i=void 0===o?e.strategy:o,u=l.boundary,s=void 0===u?$:u,c=l.rootBoundary,p=void 0===c?W:c,v=l.elementContext,h=void 0===v?H:v,g=l.altBoundary,b=void 0!==g&&g,w=l.padding,x=void 0===w?0:w,k=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof x?x:(a=x,j.reduce((function(e,t){return e[t]=a,e}),{}))),S=h===H?F:H,C=e.rects.popper,L=e.elements[b?S:h],E=function(e,t,a,l){var n="clippingParents"===t?Q(e):[].concat(t),r=[].concat(n,[a]),o=r[0],i=r.reduce((function(t,a){var n=J(e,a,l);return t.top=f(n.top,t.top),t.right=m(n.right,t.right),t.bottom=m(n.bottom,t.bottom),t.left=f(n.left,t.left),t}),J(e,o,l));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}(d(L)?L:L.contextElement||O(e.elements.popper),s,p,i),B=y(e.elements.reference),T=ae({reference:B,element:C,strategy:"absolute",placement:r}),V=Y(Object.assign({},C,T)),_=h===H?V:B,q={top:E.top-_.top+k.top,bottom:_.bottom-E.bottom+k.bottom,left:E.left-_.left+k.left,right:_.right-E.right+k.right},P=e.modifiersData.offset;if(h===H&&P){var R=P[r];Object.keys(q).forEach((function(e){var t=[A,D].indexOf(e)>=0?1:-1,a=[N,D].indexOf(e)>=0?"y":"x";q[e]+=R[a]*t}))}return q}var ne={placement:"bottom",modifiers:[],strategy:"absolute"};function re(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(xe,me,Oe):de(v?xe:ge,me,v?Oe:be);S[k]=ke,_[k]=ke-me}t.modifiersData[l]=_}},requiresIfExists:["offset"]},ve={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ve[e]}))}var me={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return me[e]}))}function ge(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,o=a.padding,i=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?G:u,c=ee(l),d=c?i?K:K.filter((function(e){return ee(e)===c})):j,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=le(e,{placement:a,boundary:n,rootBoundary:r,padding:o})[Z(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,o=a.altAxis,i=void 0===o||o,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,m=a.allowedAutoPlacements,h=t.options.placement,g=Z(h),b=u||(g===h||!f?[fe(h)]:function(e){if(Z(e)===I)return[];var t=fe(e);return[he(e),t,he(t)]}(h)),y=[h].concat(b).reduce((function(e,a){return e.concat(Z(a)===I?ge(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:m}):a)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,k=!0,S=y[0],C=0;C=0,V=T?"width":"height",_=le(t,{placement:L,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),q=T?B?A:R:B?D:N;w[V]>x[V]&&(q=fe(q));var P=fe(q),j=[];if(r&&j.push(_[E]<=0),i&&j.push(_[q]<=0,_[P]<=0),j.every((function(e){return e}))){S=L,k=!1;break}O.set(L,j)}if(k)for(var z=function(e){var t=y.find((function(t){var a=O.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},$=f?3:1;$>0;$--){if("break"===z($))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(t,a,n){const{disabled:r,appendTo:o,appendToBody:i,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),m=l((()=>o.value||i.value)),h=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===h.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{m.value&&(v.value=ce(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[pe,be,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{m.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),m.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:h,updatePopper:g}}function we(t,a,n){const{searchable:r,disabled:o,clearOnBlur:i}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,m=e.ref(!1),h=e.ref(!1),g=l((()=>r.value||o.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{o.value||(m.value=!0,e&&s())},w=()=>{m.value=!1,setTimeout((()=>{m.value||(c(),i.value&&d())}),1)};return{tabindex:g,isActive:m,mouseClicked:h,blur:b,focus:()=>{r.value&&!o.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(h.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{h.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{h.value=!1}),0)}}}function xe(t,a,n){const{mode:r,addTagOn:o,openDirection:i,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:m}=e.toRefs(t),h=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,x=n.setPointer,O=n.selectPointer,k=n.backwardPointer,S=n.forwardPointer,C=n.multiselect,L=n.wrapper,E=n.tags,B=n.isOpen,T=n.open,V=n.blur,_=n.fo,q=l((()=>v.value||f.value||!1)),P=l((()=>void 0!==o.value?o.value:void 0!==p.value?p.value:["enter"])),N=()=>{"tags"===r.value&&!s.value&&q.value&&u.value&&!d.value&&x(_.value[_.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,h),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...C.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():L.value.focus()));if(-1===P.value.indexOf("enter")&&q.value)return;N(),O();break;case" ":if(!q.value&&!u.value)return e.preventDefault(),N(),void O();if(!q.value)return!1;if(-1===P.value.indexOf("space")&&q.value)return;e.preventDefault(),N(),O();break;case"Tab":case";":case",":if(-1===P.value.indexOf(e.key.toLowerCase())||!q.value)return;N(),O(),e.preventDefault();break;case"Escape":V();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;B.value||T(),k();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;B.value||T(),S();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?E.value.querySelector("input").focus():u.value||L.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,h)},preparePointer:N}}function Oe(t,a,n){const{classes:r,disabled:o,showOptions:i,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,m=n.resolving,h=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&i.value&&(!m.value||m.value&&h.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(o.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(o.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&i.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function ke(t,a,n){const{limit:r,infinite:o}=e.toRefs(t),i=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},h=()=>{i.value&&u.value{o.value&&h()})),e.watch(s,(()=>{o.value&&(u.value=r.value,h())}),{flush:"post"}),e.watch(d,(()=>{o.value&&h()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(m))})),{hasMore:f,infiniteLoader:v}}function Se(t,a,n){const{placeholder:r,id:o,valueProp:i,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,m=n.hasSelected,h=n.multipleLabelText,g=e.ref(null),b=l((()=>(o.value?o.value+"-":"")+"assist")),y=l((()=>(o.value?o.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=o.value?`${o.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[i.value],e}})),x=l((()=>r.value)),O=l((()=>"single"!==s.value)),k=e.computed((()=>"single"===s.value&&m.value?f.value[u.value]:"multiple"===s.value&&m.value?h.value:"tags"===s.value&&m.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(o.value&&document&&document.querySelector){let e=document.querySelector(`[for="${o.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:k,ariaAssist:b,ariaControls:y,ariaPlaceholder:x,ariaMultiselectable:O,ariaActiveDescendant:w,ariaOptionId:e=>`${o.value?o.value+"-":""}multiselect-option-${e[i.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${o.value?o.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Ce(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Le(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}var Ee={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Le,Ce,n,o,ye,r,a,we,u,ke,s,xe,Oe,Se]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Be=["id","dir"],Te=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Ve=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],_e=["onKeyup","aria-label"],qe=["onClick"],Pe=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],Ne=["innerHTML"],De=["id"],Ae=["id"],Re=["id","aria-label","aria-selected"],Ie=["data-pointed","onMouseenter","onClick"],je=["innerHTML"],Me=["aria-label"],ze=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],$e=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],We=["innerHTML"],He=["innerHTML"],Fe=["value"],Ke=["name","value"],Ge=["name","value"],Ue=["id"];return Ee.render=function(t,a,l,n,r,o){return e.openBlock(),e.createElementBlock("div",{ref:"multiselect",class:e.normalizeClass(t.classList.container),id:l.searchable?void 0:l.id,dir:l.rtl?"rtl":void 0,onFocusin:a[12]||(a[12]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[13]||(a[13]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e)),onKeyup:a[14]||(a[14]=(...e)=>t.handleKeyup&&t.handleKeyup(...e)),onKeydown:a[15]||(a[15]=(...e)=>t.handleKeydown&&t.handleKeydown(...e))},[e.createElementVNode("div",e.mergeProps({class:t.classList.wrapper,onMousedown:a[9]||(a[9]=(...e)=>t.handleMousedown&&t.handleMousedown(...e)),ref:"wrapper",tabindex:t.tabindex,"aria-controls":l.searchable?void 0:t.ariaControls,"aria-placeholder":l.searchable?void 0:t.ariaPlaceholder,"aria-expanded":l.searchable?void 0:t.isOpen,"aria-activedescendant":l.searchable?void 0:t.ariaActiveDescendant,"aria-multiselectable":l.searchable?void 0:t.ariaMultiselectable,role:l.searchable?void 0:"combobox"},l.searchable?{}:t.arias),[e.createCommentVNode(" Search "),"tags"!==l.mode&&l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.search,autocomplete:l.autocomplete,id:l.searchable?l.id:void 0,onInput:a[0]||(a[0]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[1]||(a[1]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[2]||(a[2]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,Ve)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Tags (with search) "),"tags"==l.mode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.classList.tags),"data-tags":""},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.iv,((a,n,r)=>e.renderSlot(t.$slots,"tag",{option:a,handleTagRemove:t.handleTagRemove,disabled:l.disabled},(()=>[(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([t.classList.tag,a.disabled?t.classList.tagDisabled:null]),tabindex:"-1",onKeyup:e.withKeys((e=>t.handleTagRemove(a,e)),["enter"]),key:r,"aria-label":t.ariaTagLabel(t.localize(a[l.label]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagWrapper)},e.toDisplayString(t.localize(a[l.label])),3),l.disabled||a.disabled?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.classList.tagRemove),onClick:e.withModifiers((e=>t.handleTagRemove(a,e)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagRemoveIcon)},null,2)],10,qe))],42,_e))])))),256)),e.createElementVNode("div",{class:e.normalizeClass(t.classList.tagsSearchWrapper),ref:"tags"},[e.createCommentVNode(" Used for measuring search width "),e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagsSearchCopy)},e.toDisplayString(t.search),3),e.createCommentVNode(" Actual search input "),l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.tagsSearch,id:l.searchable?l.id:void 0,autocomplete:l.autocomplete,onInput:a[3]||(a[3]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[4]||(a[4]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[5]||(a[5]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,Pe)):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Single label "),"single"==l.mode&&t.hasSelected&&!t.search&&t.iv?e.renderSlot(t.$slots,"singlelabel",{key:2,value:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.singleLabel)},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.singleLabelText)},e.toDisplayString(t.localize(t.iv[l.label])),3)],2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Multiple label "),"multiple"==l.mode&&t.hasSelected&&!t.search?e.renderSlot(t.$slots,"multiplelabel",{key:3,values:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.multipleLabel),innerHTML:t.multipleLabelText},null,10,Ne)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Placeholder "),!l.placeholder||t.hasSelected||t.search?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"placeholder",{key:4},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.placeholder),"aria-hidden":"true"},e.toDisplayString(l.placeholder),3)])),e.createCommentVNode(" Spinner "),l.loading||t.resolving?e.renderSlot(t.$slots,"spinner",{key:5},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.spinner),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Clear "),t.hasSelected&&!l.disabled&&l.canClear&&!t.busy?e.renderSlot(t.$slots,"clear",{key:6,clear:t.clear},(()=>[e.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:e.normalizeClass(t.classList.clear),onClick:a[6]||(a[6]=(...e)=>t.clear&&t.clear(...e)),onKeyup:a[7]||(a[7]=e.withKeys(((...e)=>t.clear&&t.clear(...e)),["enter"]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.clearIcon)},null,2)],34)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Caret "),l.caret&&l.showOptions?e.renderSlot(t.$slots,"caret",{key:7,handleCaretClick:t.handleCaretClick,isOpen:t.isOpen},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.caret),onClick:a[8]||(a[8]=(...e)=>t.handleCaretClick&&t.handleCaretClick(...e)),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0)],16,Te),e.createCommentVNode(" Options "),(e.openBlock(),e.createBlock(e.Teleport,{to:l.appendTo||"body",disabled:!l.appendToBody&&!l.appendTo},[e.createElementVNode("div",{id:l.id?`${l.id}-dropdown`:void 0,class:e.normalizeClass(t.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:a[10]||(a[10]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[11]||(a[11]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e))},[e.renderSlot(t.$slots,"beforelist",{options:t.fo}),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.options),id:t.ariaControls,role:"listbox"},[l.groups?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.fg,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.group),key:r,id:t.ariaGroupId(a),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),"aria-selected":t.isSelected(a),role:"option"},[a.__CREATE__?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.classList.groupLabel(a)),"data-pointed":t.isPointed(a),onMouseenter:e=>t.setPointer(a,n),onClick:e=>t.handleGroupClick(a)},[e.renderSlot(t.$slots,"grouplabel",{group:a,isSelected:t.isSelected,isPointed:t.isPointed},(()=>[e.createElementVNode("span",{innerHTML:t.localize(a[l.groupLabel])},null,8,je)]))],42,Ie)),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.groupOptions),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),role:"group"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.__VISIBLE__,((n,r,o)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(n,a)),"data-pointed":t.isPointed(n),"data-selected":t.isSelected(n)||void 0,key:o,onMouseenter:e=>t.setPointer(n),onClick:e=>t.handleOptionClick(n),id:t.ariaOptionId(n),"aria-selected":t.isSelected(n),"aria-label":t.ariaOptionLabel(t.localize(n[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:n,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(n[l.label])),1)]))],42,ze)))),128))],10,Me)],10,Re)))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.fo,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(a)),"data-pointed":t.isPointed(a),"data-selected":t.isSelected(a)||void 0,key:r,onMouseenter:e=>t.setPointer(a),onClick:e=>t.handleOptionClick(a),id:t.ariaOptionId(a),"aria-selected":t.isSelected(a),"aria-label":t.ariaOptionLabel(t.localize(a[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:a,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(a[l.label])),1)]))],42,$e)))),128))],10,Ae),t.noOptions?e.renderSlot(t.$slots,"nooptions",{key:0},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noOptions),innerHTML:t.localize(l.noOptionsText)},null,10,We)])):e.createCommentVNode("v-if",!0),t.noResults?e.renderSlot(t.$slots,"noresults",{key:1},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noResults),innerHTML:t.localize(l.noResultsText)},null,10,He)])):e.createCommentVNode("v-if",!0),l.infinite&&t.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.inifinite),ref:"infiniteLoader"},[e.renderSlot(t.$slots,"infinite",{},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.inifiniteSpinner)},null,2)]))],2)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"afterlist",{options:t.fo})],42,De)],8,["to","disabled"])),e.createCommentVNode(" Hacky input element to show HTML5 required warning "),l.required?(e.openBlock(),e.createElementBlock("input",{key:0,class:e.normalizeClass(t.classList.fakeInput),tabindex:"-1",value:t.textValue,required:""},null,10,Fe)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Native input support "),l.nativeSupport?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["single"==l.mode?(e.openBlock(),e.createElementBlock("input",{key:0,type:"hidden",name:l.name,value:void 0!==t.plainValue?t.plainValue:""},null,8,Ke)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.plainValue,((t,a)=>(e.openBlock(),e.createElementBlock("input",{type:"hidden",name:`${l.name}[]`,value:t,key:a},null,8,Ge)))),128))],64)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Screen reader assistive text "),l.searchable&&t.hasSelected?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.assist),id:t.ariaAssist,"aria-hidden":"true"},e.toDisplayString(t.ariaLabel),11,Ue)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Create height for empty input "),e.createElementVNode("div",{class:e.normalizeClass(t.classList.spacer)},null,2)],42,Be)},Ee.__file="src/Multiselect.vue",Ee}(Vue); +var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:o,mode:i}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[o.value])):e[o.value],d=e=>t(e)?"single"===i.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:o,valueProp:i}=e.toRefs(t),u=e.ref("single"!==o.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===o.value?u.value[i.value]:u.value.map((e=>e[i.value])))),d=l((()=>"single"!==o.value?u.value.map((e=>e[i.value])).join(","):u.value[i.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,o=l.isOpen,i=l.open,u=e.ref(null);return e.watch(u,(e=>{!o.value&&e&&i(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function o(t,a,l){const{groupSelect:n,mode:r,groups:o,disabledProp:i}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[i.value]||o.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function i(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}const u=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!u(e[n],t[n]))return!1}return!0};function s(a,n,r){const{options:o,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:m,appendNewTag:h,appendNewOption:g,multipleLabel:b,object:y,loading:w,delay:O,resolveOnLoad:x,minChars:k,filterResults:S,clearOnSearch:C,clearOnSelect:L,valueProp:E,allowAbsent:B,groupLabel:T,canDeselect:V,max:_,strict:q,closeOnSelect:P,closeOnDeselect:N,groups:D,reverse:A,infinite:R,groupOptions:I,groupHideEmpty:j,groupSelect:M,onCreate:z,disabledProp:$,searchStart:W,searchFilter:H}=e.toRefs(a),F=e.getCurrentInstance().proxy,K=r.iv,G=r.ev,U=r.search,X=r.clearSearch,Y=r.update,J=r.pointer,Q=r.setPointer,Z=r.clearPointer,ee=r.focus,te=r.deactivate,ae=r.close,le=r.localize,ne=e.ref([]),re=e.ref([]),oe=e.ref(!1),ie=e.ref(null),ue=e.ref(R.value&&-1===d.value?10:d.value),se=e.computed({get:()=>re.value,set:e=>re.value=e}),ce=l((()=>v.value||f.value||!1)),de=l((()=>void 0!==h.value?h.value:void 0===g.value||g.value)),pe=e.computed((()=>{if(D.value){let e=me.value||[],t=[];return e.forEach((e=>{We(e[I.value]).forEach((a=>{t.push(Object.assign({},a,e[$.value]?{[$.value]:!0}:{}))}))})),t}{let e=We(re.value||[]);return ne.value.length&&(e=e.concat(ne.value)),e}})),ve=e.computed((()=>{let e=pe.value;return A.value&&(e=e.reverse()),xe.value.length&&(e=xe.value.concat(e)),$e(e)})),fe=e.computed((()=>{let e=ve.value;return ue.value>0&&(e=e.slice(0,ue.value)),e})),me=e.computed((()=>{if(!D.value)return[];let e=[],t=re.value||[];return ne.value.length&&e.push({[T.value]:" ",[I.value]:[...ne.value],__CREATE__:!0}),e.concat(t)})),he=e.computed((()=>{let e=[...me.value].map((e=>({...e})));return xe.value.length&&(e[0]&&e[0].__CREATE__?e[0][I.value]=[...xe.value,...e[0][I.value]]:e=[{[T.value]:" ",[I.value]:[...xe.value],__CREATE__:!0}].concat(e)),e})),ge=e.computed((()=>{if(!D.value)return[];let e=he.value;return ze((e||[]).map(((e,t)=>{const a=We(e[I.value]);return{...e,index:t,group:!0,[I.value]:$e(a,!1).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{}))),__VISIBLE__:$e(a).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{})))}})))})),be=e.computed((()=>{switch(s.value){case"single":return!t(K.value[E.value]);case"multiple":case"tags":return!t(K.value)&&K.value.length>0}})),ye=e.computed((()=>void 0!==b.value?b.value(K.value,F):K.value&&K.value.length>1?`${K.value.length} options selected`:"1 option selected")),we=l((()=>!pe.value.length&&!oe.value&&!xe.value.length)),Oe=l((()=>pe.value.length>0&&0==fe.value.length&&(U.value&&D.value||!D.value))),xe=e.computed((()=>!1!==ce.value&&U.value?-1!==je(U.value)?[]:[{[E.value]:U.value,[ke.value[0]]:U.value,[m.value]:U.value,__CREATE__:!0}]:[])),ke=e.computed((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[m.value])),Se=l((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Ce=l((()=>w.value||oe.value)),Le=e=>{switch("object"!=typeof e&&(e=Ie(e)),s.value){case"single":Y(e);break;case"multiple":case"tags":Y(K.value.concat(e))}n.emit("select",Be(e),e,F)},Ee=e=>{switch("object"!=typeof e&&(e=Ie(e)),s.value){case"single":Ve();break;case"tags":case"multiple":Y(Array.isArray(e)?K.value.filter((t=>-1===e.map((e=>e[E.value])).indexOf(t[E.value]))):K.value.filter((t=>t[E.value]!=e[E.value])))}n.emit("deselect",Be(e),e,F)},Be=e=>y.value?e:e[E.value],Te=e=>{Ee(e)},Ve=()=>{Y(Se.value),n.emit("clear",F)},_e=e=>{if(void 0!==e.group)return"single"!==s.value&&(Re(e[I.value])&&e[I.value].length);switch(s.value){case"single":return!t(K.value)&&(K.value[E.value]==e[E.value]||"object"==typeof K.value[E.value]&&"object"==typeof e[E.value]&&u(K.value[E.value],e[E.value]));case"tags":case"multiple":return!t(K.value)&&-1!==K.value.map((e=>e[E.value])).indexOf(e[E.value])}},qe=e=>!0===e[$.value],Pe=()=>!(void 0===_||-1===_.value||!be.value&&_.value>0)&&K.value.length>=_.value,Ne=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&_e(e))return V.value&&Ee(e),void(N.value&&(Z(),ae()));e&&De(e),L.value&&X(),P.value&&(Z(),ae()),e&&Le(e);break;case"multiple":if(e&&_e(e))return Ee(e),void(N.value&&(Z(),ae()));if(Pe())return void n.emit("max",F);e&&(De(e),Le(e)),L.value&&X(),p.value&&Z(),P.value&&ae();break;case"tags":if(e&&_e(e))return Ee(e),void(N.value&&(Z(),ae()));if(Pe())return void n.emit("max",F);e&&De(e),L.value&&X(),e&&Le(e),p.value&&Z(),P.value&&ae()}P.value||ee()},De=e=>{void 0===Ie(e[E.value])&&ce.value&&(n.emit("tag",e[E.value],F),n.emit("option",e[E.value],F),n.emit("create",e[E.value],F),de.value&&Me(e),X())},Ae=e=>void 0===e.find((e=>!_e(e)&&!e[$.value])),Re=e=>void 0===e.find((e=>!_e(e))),Ie=e=>pe.value[pe.value.map((e=>String(e[E.value]))).indexOf(String(e))],je=e=>pe.value.findIndex((t=>ke.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Me=e=>{ne.value.push(e)},ze=e=>j.value?e.filter((e=>U.value?e.__VISIBLE__.length:e[I.value].length)):e.filter((e=>!U.value||e.__VISIBLE__.length)),$e=(e,t=!0)=>{let a=e;if(U.value&&S.value){let e=H.value;e||(e=(e,t,a)=>ke.value.some((a=>{let l=i(le(e[a]),q.value);return W.value?l.startsWith(i(t,q.value)):-1!==l.indexOf(i(t,q.value))}))),a=a.filter((t=>e(t,U.value,F)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&_e(e))(e)))),a},We=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[E.value]:e,[ke.value[0]]:a,[m.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[E.value]:e,[ke.value[0]]:e,[m.value]:e})),t},He=()=>{t(G.value)||(K.value=Ge(G.value))},Fe=e=>(oe.value=!0,new Promise(((t,a)=>{o.value(U.value,F).then((t=>{re.value=t||[],"function"==typeof e&&e(t),oe.value=!1})).catch((e=>{console.error(e),re.value=[],oe.value=!1})).finally((()=>{t()}))}))),Ke=()=>{if(be.value)if("single"===s.value){let e=Ie(K.value[E.value]);if(void 0!==e){let t=e[m.value];K.value[m.value]=t,y.value&&(G.value[m.value]=t)}}else K.value.forEach(((e,t)=>{let a=Ie(K.value[t][E.value]);if(void 0!==a){let e=a[m.value];K.value[t][m.value]=e,y.value&&(G.value[t][m.value]=e)}}))},Ge=e=>t(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?Ie(e)||(B.value?{[m.value]:e,[E.value]:e,[ke.value[0]]:e}:{}):e.filter((e=>!!Ie(e)||B.value)).map((e=>Ie(e)||{[m.value]:e,[E.value]:e,[ke.value[0]]:e})),Ue=()=>{ie.value=e.watch(U,(e=>{e.length{e==U.value&&o.value(U.value,F).then((t=>{e!=U.value&&U.value||(re.value=t,J.value=fe.value.filter((e=>!0!==e[$.value]))[0]||null,oe.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!t(G.value)&&!Array.isArray(G.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return o&&"function"==typeof o.value?x.value?Fe(He):1==y.value&&He():(re.value=o.value,He()),O.value>-1&&Ue(),e.watch(O,((e,t)=>{ie.value&&ie.value(),e>=0&&Ue()})),e.watch(G,(e=>{if(t(e))Y(Ge(e),!1);else switch(s.value){case"single":(y.value?e[E.value]!=K.value[E.value]:e!=K.value[E.value])&&Y(Ge(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(y.value?e.map((e=>e[E.value])):e,K.value.map((e=>e[E.value])))||Y(Ge(e),!1)}}),{deep:!0}),e.watch(o,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Fe():(re.value=a.options,Object.keys(K.value).length||He(),Ke())})),e.watch(m,Ke),e.watch(d,((e,t)=>{ue.value=R.value&&-1===e?10:e})),{resolvedOptions:se,pfo:ve,fo:fe,filteredOptions:fe,hasSelected:be,multipleLabelText:ye,eo:pe,extendedOptions:pe,eg:me,extendedGroups:me,fg:ge,filteredGroups:ge,noOptions:we,noResults:Oe,resolving:oe,busy:Ce,offset:ue,select:Le,deselect:Ee,remove:Te,selectAll:()=>{"single"!==s.value&&Le(fe.value.filter((e=>!e.disabled&&!_e(e))))},clear:Ve,isSelected:_e,isDisabled:qe,isMax:Pe,getOption:Ie,handleOptionClick:e=>{if(!qe(e))return z.value&&!_e(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=z.value(e,F))instanceof Promise)?(oe.value=!0,void e.then((e=>{oe.value=!1,Ne(e)}))):void Ne(e)},handleGroupClick:e=>{if(!qe(e)&&"single"!==s.value&&M.value){switch(s.value){case"multiple":case"tags":Ae(e[I.value])?Ee(e[I.value]):Le(e[I.value].filter((e=>-1===K.value.map((e=>e[E.value])).indexOf(e[E.value]))).filter((e=>!e[$.value])).filter(((e,t)=>K.value.length+1+t<=_.value||-1===_.value))),p.value&&J.value&&Q(ge.value.filter((e=>!e[$.value]))[J.value.index])}P.value&&te()}},handleTagRemove:(e,t)=>{0===t.button?Te(e):t.preventDefault()},refreshOptions:e=>{Fe(e)},resolveOptions:Fe,refreshLabels:Ke}}function c(t,a,n){const{valueProp:r,showOptions:o,searchable:i,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,m=n.fg,h=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,O=n.clearPointer,x=n.multiselect,k=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),C=e.computed((()=>m.value.filter((e=>!e[p.value])))),L=l((()=>"single"!==c.value&&d.value)),E=l((()=>y.value&&y.value.group)),B=e.computed((()=>I(y.value))),T=e.computed((()=>{const e=E.value?y.value:I(y.value),t=C.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=C.value[t-1];return void 0===a&&(a=_.value),a})),V=e.computed((()=>{let e=C.value.map((e=>e.label)).indexOf(E.value?y.value[u.value]:I(y.value)[u.value])+1;return C.value.length<=e&&(e=0),C.value[e]})),_=e.computed((()=>[...C.value].slice(-1)[0])),q=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),P=e.computed((()=>{const e=B.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),N=e.computed((()=>{const e=I(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...T.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),A=e.computed((()=>[..._.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),R=()=>{w(S.value[0]||null)},I=e=>C.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),j=()=>{let e=x.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=E.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{i.value&&(e.length&&o.value?R():O())})),e.watch(k,(t=>{if(t&&x&&x.value){let t=x.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:L,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:R,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(E.value?g(y.value):h(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&L.value?C.value[0].__CREATE__?S.value[0]:C.value[0]:S.value[0])||null);else if(s.value&&L.value){let e=E.value?q.value:N.value;void 0===e&&(e=V.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{j()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&L.value&&(e=A.value,void 0===e&&(e=_.value)),w(e||null)}else if(s.value&&L.value){let e=E.value?D.value:P.value;void 0===e&&(e=E.value?T.value:B.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=T.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{j()}))}}}function d(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function p(e){return e instanceof d(e).Element||e instanceof Element}function v(e){return e instanceof d(e).HTMLElement||e instanceof HTMLElement}function f(e){return"undefined"!=typeof ShadowRoot&&(e instanceof d(e).ShadowRoot||e instanceof ShadowRoot)}var m=Math.max,h=Math.min,g=Math.round;function b(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function y(){return!/^((?!chrome|android).)*safari/i.test(b())}function w(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&v(e)&&(n=e.offsetWidth>0&&g(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&g(l.height)/e.offsetHeight||1);var o=(p(e)?d(e):window).visualViewport,i=!y()&&a,u=(l.left+(i&&o?o.offsetLeft:0))/n,s=(l.top+(i&&o?o.offsetTop:0))/r,c=l.width/n,f=l.height/r;return{width:c,height:f,top:s,right:u+c,bottom:s+f,left:u,x:u,y:s}}function O(e){var t=d(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function x(e){return e?(e.nodeName||"").toLowerCase():null}function k(e){return((p(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return w(k(e)).left+O(e).scrollLeft}function C(e){return d(e).getComputedStyle(e)}function L(e){var t=C(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function E(e,t,a){void 0===a&&(a=!1);var l,n,r=v(t),o=v(t)&&function(e){var t=e.getBoundingClientRect(),a=g(t.width)/e.offsetWidth||1,l=g(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),i=k(t),u=w(e,o,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==x(t)||L(i))&&(s=(l=t)!==d(l)&&v(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:O(l)),v(t)?((c=w(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=S(i))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function B(e){var t=w(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function T(e){return"html"===x(e)?e:e.assignedSlot||e.parentNode||(f(e)?e.host:null)||k(e)}function V(e){return["html","body","#document"].indexOf(x(e))>=0?e.ownerDocument.body:v(e)&&L(e)?e:V(T(e))}function _(e,t){var a;void 0===t&&(t=[]);var l=V(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=d(l),o=n?[r].concat(r.visualViewport||[],L(l)?l:[]):l,i=t.concat(o);return n?i:i.concat(_(T(o)))}function q(e){return["table","td","th"].indexOf(x(e))>=0}function P(e){return v(e)&&"fixed"!==C(e).position?e.offsetParent:null}function N(e){for(var t=d(e),a=P(e);a&&q(a)&&"static"===C(a).position;)a=P(a);return a&&("html"===x(a)||"body"===x(a)&&"static"===C(a).position)?t:a||function(e){var t=/firefox/i.test(b());if(/Trident/i.test(b())&&v(e)&&"fixed"===C(e).position)return null;var a=T(e);for(f(a)&&(a=a.host);v(a)&&["html","body"].indexOf(x(a))<0;){var l=C(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var D="top",A="bottom",R="right",I="left",j="auto",M=[D,A,R,I],z="start",$="end",W="clippingParents",H="viewport",F="popper",K="reference",G=M.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+$])}),[]),U=[].concat(M,[j]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+$])}),[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function J(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q(e,t,a){return t===H?J(function(e,t){var a=d(e),l=k(e),n=a.visualViewport,r=l.clientWidth,o=l.clientHeight,i=0,u=0;if(n){r=n.width,o=n.height;var s=y();(s||!s&&"fixed"===t)&&(i=n.offsetLeft,u=n.offsetTop)}return{width:r,height:o,x:i+S(e),y:u}}(e,a)):p(t)?function(e,t){var a=w(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):J(function(e){var t,a=k(e),l=O(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=m(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=m(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),i=-l.scrollLeft+S(e),u=-l.scrollTop;return"rtl"===C(n||a).direction&&(i+=m(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:i,y:u}}(k(e)))}function Z(e){var t=_(T(e)),a=["absolute","fixed"].indexOf(C(e).position)>=0&&v(e)?N(e):e;return p(a)?t.filter((function(e){return p(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&f(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==x(e)})):[]}function ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function ae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function le(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ee(n):null,o=n?te(n):null,i=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case D:t={x:i,y:a.y-l.height};break;case A:t={x:i,y:a.y+a.height};break;case R:t={x:a.x+a.width,y:u};break;case I:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ae(r):null;if(null!=s){var c="y"===s?"height":"width";switch(o){case z:t[s]=t[s]-(a[c]/2-l[c]/2);break;case $:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function ne(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,o=l.strategy,i=void 0===o?e.strategy:o,u=l.boundary,s=void 0===u?W:u,c=l.rootBoundary,d=void 0===c?H:c,v=l.elementContext,f=void 0===v?F:v,g=l.altBoundary,b=void 0!==g&&g,y=l.padding,O=void 0===y?0:y,x=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof O?O:(a=O,M.reduce((function(e,t){return e[t]=a,e}),{}))),S=f===F?K:F,C=e.rects.popper,L=e.elements[b?S:f],E=function(e,t,a,l){var n="clippingParents"===t?Z(e):[].concat(t),r=[].concat(n,[a]),o=r[0],i=r.reduce((function(t,a){var n=Q(e,a,l);return t.top=m(n.top,t.top),t.right=h(n.right,t.right),t.bottom=h(n.bottom,t.bottom),t.left=m(n.left,t.left),t}),Q(e,o,l));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}(p(L)?L:L.contextElement||k(e.elements.popper),s,d,i),B=w(e.elements.reference),T=le({reference:B,element:C,strategy:"absolute",placement:r}),V=J(Object.assign({},C,T)),_=f===F?V:B,q={top:E.top-_.top+x.top,bottom:_.bottom-E.bottom+x.bottom,left:E.left-_.left+x.left,right:_.right-E.right+x.right},P=e.modifiersData.offset;if(f===F&&P){var N=P[r];Object.keys(q).forEach((function(e){var t=[R,A].indexOf(e)>=0?1:-1,a=[D,A].indexOf(e)>=0?"y":"x";q[e]+=N[a]*t}))}return q}var re={placement:"bottom",modifiers:[],strategy:"absolute"};function oe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(Oe,me,xe):pe(v?Oe:ge,me,v?xe:be);S[k]=ke,_[k]=ke-me}t.modifiersData[l]=_}},requiresIfExists:["offset"]},fe={left:"right",right:"left",bottom:"top",top:"bottom"};function me(e){return e.replace(/left|right|bottom|top/g,(function(e){return fe[e]}))}var he={start:"end",end:"start"};function ge(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function be(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,o=a.padding,i=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?U:u,c=te(l),d=c?i?G:G.filter((function(e){return te(e)===c})):M,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=ne(e,{placement:a,boundary:n,rootBoundary:r,padding:o})[ee(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ye={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,o=a.altAxis,i=void 0===o||o,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,m=a.allowedAutoPlacements,h=t.options.placement,g=ee(h),b=u||(g===h||!f?[me(h)]:function(e){if(ee(e)===j)return[];var t=me(e);return[ge(e),t,ge(t)]}(h)),y=[h].concat(b).reduce((function(e,a){return e.concat(ee(a)===j?be(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:m}):a)}),[]),w=t.rects.reference,O=t.rects.popper,x=new Map,k=!0,S=y[0],C=0;C=0,V=T?"width":"height",_=ne(t,{placement:L,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),q=T?B?R:I:B?A:D;w[V]>O[V]&&(q=me(q));var P=me(q),N=[];if(r&&N.push(_[E]<=0),i&&N.push(_[q]<=0,_[P]<=0),N.every((function(e){return e}))){S=L,k=!1;break}x.set(L,N)}if(k)for(var M=function(e){var t=y.find((function(t){var a=x.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},$=f?3:1;$>0;$--){if("break"===M($))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(t,a,n){const{disabled:r,appendTo:o,appendToBody:i,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),m=l((()=>o.value||i.value)),h=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===h.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{m.value&&(v.value=de(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[ve,ye,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{m.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),m.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:h,updatePopper:g}}function Oe(t,a,n){const{searchable:r,disabled:o,clearOnBlur:i}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,m=e.ref(!1),h=e.ref(!1),g=l((()=>r.value||o.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{o.value||(m.value=!0,e&&s())},w=()=>{m.value=!1,setTimeout((()=>{m.value||(c(),i.value&&d())}),1)};return{tabindex:g,isActive:m,mouseClicked:h,blur:b,focus:()=>{r.value&&!o.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(h.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{h.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{h.value=!1}),0)}}}function xe(t,a,n){const{mode:r,addTagOn:o,openDirection:i,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:m}=e.toRefs(t),h=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,O=n.setPointer,x=n.selectPointer,k=n.backwardPointer,S=n.forwardPointer,C=n.multiselect,L=n.wrapper,E=n.tags,B=n.isOpen,T=n.open,V=n.blur,_=n.fo,q=l((()=>v.value||f.value||!1)),P=l((()=>void 0!==o.value?o.value:void 0!==p.value?p.value:["enter"])),N=()=>{"tags"===r.value&&!s.value&&q.value&&u.value&&!d.value&&O(_.value[_.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,h),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...C.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():L.value.focus()));if(-1===P.value.indexOf("enter")&&q.value)return;N(),x();break;case" ":if(!q.value&&!u.value)return e.preventDefault(),N(),void x();if(!q.value)return!1;if(-1===P.value.indexOf("space")&&q.value)return;e.preventDefault(),N(),x();break;case"Tab":case";":case",":if(-1===P.value.indexOf(e.key.toLowerCase())||!q.value)return;N(),x(),e.preventDefault();break;case"Escape":V();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;B.value||T(),k();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;B.value||T(),S();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?E.value.querySelector("input").focus():u.value||L.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,h)},preparePointer:N}}function ke(t,a,n){const{classes:r,disabled:o,showOptions:i,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,m=n.resolving,h=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&i.value&&(!m.value||m.value&&h.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(o.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(o.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&i.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function Se(t,a,n){const{limit:r,infinite:o}=e.toRefs(t),i=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},h=()=>{i.value&&u.value{o.value&&h()})),e.watch(s,(()=>{o.value&&(u.value=r.value,h())}),{flush:"post"}),e.watch(d,(()=>{o.value&&h()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(m))})),{hasMore:f,infiniteLoader:v}}function Ce(t,a,n){const{placeholder:r,id:o,valueProp:i,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,m=n.hasSelected,h=n.multipleLabelText,g=e.ref(null),b=l((()=>(o.value?o.value+"-":"")+"assist")),y=l((()=>(o.value?o.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=o.value?`${o.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[i.value],e}})),O=l((()=>r.value)),x=l((()=>"single"!==s.value)),k=e.computed((()=>"single"===s.value&&m.value?f.value[u.value]:"multiple"===s.value&&m.value?h.value:"tags"===s.value&&m.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(o.value&&document&&document.querySelector){let e=document.querySelector(`[for="${o.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:k,ariaAssist:b,ariaControls:y,ariaPlaceholder:O,ariaMultiselectable:x,ariaActiveDescendant:w,ariaOptionId:e=>`${o.value?o.value+"-":""}multiselect-option-${e[i.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${o.value?o.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Le(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Ee(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}var Be={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Ee,Le,n,o,we,r,a,Oe,s,Se,c,xe,ke,Ce]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Te=["id","dir"],Ve=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],_e=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],qe=["onKeyup","aria-label"],Pe=["onClick"],Ne=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],De=["innerHTML"],Ae=["id"],Re=["id"],Ie=["id","aria-label","aria-selected"],je=["data-pointed","onMouseenter","onClick"],Me=["innerHTML"],ze=["aria-label"],$e=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],We=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],He=["innerHTML"],Fe=["innerHTML"],Ke=["value"],Ge=["name","value"],Ue=["name","value"],Xe=["id"];return Be.render=function(t,a,l,n,r,o){return e.openBlock(),e.createElementBlock("div",{ref:"multiselect",class:e.normalizeClass(t.classList.container),id:l.searchable?void 0:l.id,dir:l.rtl?"rtl":void 0,onFocusin:a[12]||(a[12]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[13]||(a[13]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e)),onKeyup:a[14]||(a[14]=(...e)=>t.handleKeyup&&t.handleKeyup(...e)),onKeydown:a[15]||(a[15]=(...e)=>t.handleKeydown&&t.handleKeydown(...e))},[e.createElementVNode("div",e.mergeProps({class:t.classList.wrapper,onMousedown:a[9]||(a[9]=(...e)=>t.handleMousedown&&t.handleMousedown(...e)),ref:"wrapper",tabindex:t.tabindex,"aria-controls":l.searchable?void 0:t.ariaControls,"aria-placeholder":l.searchable?void 0:t.ariaPlaceholder,"aria-expanded":l.searchable?void 0:t.isOpen,"aria-activedescendant":l.searchable?void 0:t.ariaActiveDescendant,"aria-multiselectable":l.searchable?void 0:t.ariaMultiselectable,role:l.searchable?void 0:"combobox"},l.searchable?{}:t.arias),[e.createCommentVNode(" Search "),"tags"!==l.mode&&l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.search,autocomplete:l.autocomplete,id:l.searchable?l.id:void 0,onInput:a[0]||(a[0]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[1]||(a[1]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[2]||(a[2]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,_e)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Tags (with search) "),"tags"==l.mode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.classList.tags),"data-tags":""},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.iv,((a,n,r)=>e.renderSlot(t.$slots,"tag",{option:a,handleTagRemove:t.handleTagRemove,disabled:l.disabled},(()=>[(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([t.classList.tag,a.disabled?t.classList.tagDisabled:null]),tabindex:"-1",onKeyup:e.withKeys((e=>t.handleTagRemove(a,e)),["enter"]),key:r,"aria-label":t.ariaTagLabel(t.localize(a[l.label]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagWrapper)},e.toDisplayString(t.localize(a[l.label])),3),l.disabled||a.disabled?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.classList.tagRemove),onClick:e.withModifiers((e=>t.handleTagRemove(a,e)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagRemoveIcon)},null,2)],10,Pe))],42,qe))])))),256)),e.createElementVNode("div",{class:e.normalizeClass(t.classList.tagsSearchWrapper),ref:"tags"},[e.createCommentVNode(" Used for measuring search width "),e.createElementVNode("span",{class:e.normalizeClass(t.classList.tagsSearchCopy)},e.toDisplayString(t.search),3),e.createCommentVNode(" Actual search input "),l.searchable&&!l.disabled?(e.openBlock(),e.createElementBlock("input",e.mergeProps({key:0,type:l.inputType,modelValue:t.search,value:t.search,class:t.classList.tagsSearch,id:l.searchable?l.id:void 0,autocomplete:l.autocomplete,onInput:a[3]||(a[3]=(...e)=>t.handleSearchInput&&t.handleSearchInput(...e)),onKeypress:a[4]||(a[4]=(...e)=>t.handleKeypress&&t.handleKeypress(...e)),onPaste:a[5]||(a[5]=e.withModifiers(((...e)=>t.handlePaste&&t.handlePaste(...e)),["stop"])),ref:"input","aria-controls":t.ariaControls,"aria-placeholder":t.ariaPlaceholder,"aria-expanded":t.isOpen,"aria-activedescendant":t.ariaActiveDescendant,"aria-multiselectable":t.ariaMultiselectable,role:"combobox"},{...l.attrs,...t.arias}),null,16,Ne)):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Single label "),"single"==l.mode&&t.hasSelected&&!t.search&&t.iv?e.renderSlot(t.$slots,"singlelabel",{key:2,value:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.singleLabel)},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.singleLabelText)},e.toDisplayString(t.localize(t.iv[l.label])),3)],2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Multiple label "),"multiple"==l.mode&&t.hasSelected&&!t.search?e.renderSlot(t.$slots,"multiplelabel",{key:3,values:t.iv},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.multipleLabel),innerHTML:t.multipleLabelText},null,10,De)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Placeholder "),!l.placeholder||t.hasSelected||t.search?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"placeholder",{key:4},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.placeholder),"aria-hidden":"true"},e.toDisplayString(l.placeholder),3)])),e.createCommentVNode(" Spinner "),l.loading||t.resolving?e.renderSlot(t.$slots,"spinner",{key:5},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.spinner),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Clear "),t.hasSelected&&!l.disabled&&l.canClear&&!t.busy?e.renderSlot(t.$slots,"clear",{key:6,clear:t.clear},(()=>[e.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:e.normalizeClass(t.classList.clear),onClick:a[6]||(a[6]=(...e)=>t.clear&&t.clear(...e)),onKeyup:a[7]||(a[7]=e.withKeys(((...e)=>t.clear&&t.clear(...e)),["enter"]))},[e.createElementVNode("span",{class:e.normalizeClass(t.classList.clearIcon)},null,2)],34)])):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Caret "),l.caret&&l.showOptions?e.renderSlot(t.$slots,"caret",{key:7,handleCaretClick:t.handleCaretClick,isOpen:t.isOpen},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.caret),onClick:a[8]||(a[8]=(...e)=>t.handleCaretClick&&t.handleCaretClick(...e)),"aria-hidden":"true"},null,2)])):e.createCommentVNode("v-if",!0)],16,Ve),e.createCommentVNode(" Options "),(e.openBlock(),e.createBlock(e.Teleport,{to:l.appendTo||"body",disabled:!l.appendToBody&&!l.appendTo},[e.createElementVNode("div",{id:l.id?`${l.id}-dropdown`:void 0,class:e.normalizeClass(t.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:a[10]||(a[10]=(...e)=>t.handleFocusIn&&t.handleFocusIn(...e)),onFocusout:a[11]||(a[11]=(...e)=>t.handleFocusOut&&t.handleFocusOut(...e))},[e.renderSlot(t.$slots,"beforelist",{options:t.fo}),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.options),id:t.ariaControls,role:"listbox"},[l.groups?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.fg,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.group),key:r,id:t.ariaGroupId(a),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),"aria-selected":t.isSelected(a),role:"option"},[a.__CREATE__?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.classList.groupLabel(a)),"data-pointed":t.isPointed(a),onMouseenter:e=>t.setPointer(a,n),onClick:e=>t.handleGroupClick(a)},[e.renderSlot(t.$slots,"grouplabel",{group:a,isSelected:t.isSelected,isPointed:t.isPointed},(()=>[e.createElementVNode("span",{innerHTML:t.localize(a[l.groupLabel])},null,8,Me)]))],42,je)),e.createElementVNode("ul",{class:e.normalizeClass(t.classList.groupOptions),"aria-label":t.ariaGroupLabel(t.localize(a[l.groupLabel])),role:"group"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.__VISIBLE__,((n,r,o)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(n,a)),"data-pointed":t.isPointed(n),"data-selected":t.isSelected(n)||void 0,key:o,onMouseenter:e=>t.setPointer(n),onClick:e=>t.handleOptionClick(n),id:t.ariaOptionId(n),"aria-selected":t.isSelected(n),"aria-label":t.ariaOptionLabel(t.localize(n[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:n,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(n[l.label])),1)]))],42,$e)))),128))],10,ze)],10,Ie)))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.fo,((a,n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.classList.option(a)),"data-pointed":t.isPointed(a),"data-selected":t.isSelected(a)||void 0,key:r,onMouseenter:e=>t.setPointer(a),onClick:e=>t.handleOptionClick(a),id:t.ariaOptionId(a),"aria-selected":t.isSelected(a),"aria-label":t.ariaOptionLabel(t.localize(a[l.label])),role:"option"},[e.renderSlot(t.$slots,"option",{option:a,isSelected:t.isSelected,isPointed:t.isPointed,search:t.search},(()=>[e.createElementVNode("span",null,e.toDisplayString(t.localize(a[l.label])),1)]))],42,We)))),128))],10,Re),t.noOptions?e.renderSlot(t.$slots,"nooptions",{key:0},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noOptions),innerHTML:t.localize(l.noOptionsText)},null,10,He)])):e.createCommentVNode("v-if",!0),t.noResults?e.renderSlot(t.$slots,"noresults",{key:1},(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.classList.noResults),innerHTML:t.localize(l.noResultsText)},null,10,Fe)])):e.createCommentVNode("v-if",!0),l.infinite&&t.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.inifinite),ref:"infiniteLoader"},[e.renderSlot(t.$slots,"infinite",{},(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.classList.inifiniteSpinner)},null,2)]))],2)):e.createCommentVNode("v-if",!0),e.renderSlot(t.$slots,"afterlist",{options:t.fo})],42,Ae)],8,["to","disabled"])),e.createCommentVNode(" Hacky input element to show HTML5 required warning "),l.required?(e.openBlock(),e.createElementBlock("input",{key:0,class:e.normalizeClass(t.classList.fakeInput),tabindex:"-1",value:t.textValue,required:""},null,10,Ke)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Native input support "),l.nativeSupport?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["single"==l.mode?(e.openBlock(),e.createElementBlock("input",{key:0,type:"hidden",name:l.name,value:void 0!==t.plainValue?t.plainValue:""},null,8,Ge)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.plainValue,((t,a)=>(e.openBlock(),e.createElementBlock("input",{type:"hidden",name:`${l.name}[]`,value:t,key:a},null,8,Ue)))),128))],64)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Screen reader assistive text "),l.searchable&&t.hasSelected?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.classList.assist),id:t.ariaAssist,"aria-hidden":"true"},e.toDisplayString(t.ariaLabel),11,Xe)):e.createCommentVNode("v-if",!0),e.createCommentVNode(" Create height for empty input "),e.createElementVNode("div",{class:e.normalizeClass(t.classList.spacer)},null,2)],42,Te)},Be.__file="src/Multiselect.vue",Be}(Vue); diff --git a/dist/multiselect.js b/dist/multiselect.js index 9f90005..a4faad4 100644 --- a/dist/multiselect.js +++ b/dist/multiselect.js @@ -243,6 +243,43 @@ function arraysEqual (array1, array2) { }) } +/* istanbul ignore next */ +const objectsEqual = (obj1, obj2) => { + // If both are strictly equal, return true + if (obj1 === obj2) { + return true + } + + // If either is not an object or is null, return false (handles primitive types and null) + if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) { + return false + } + + // Get the keys of both objects + const keys1 = Object.keys(obj1); + const keys2 = Object.keys(obj2); + + // If they have a different number of keys, they're not equal + if (keys1.length !== keys2.length) { + return false + } + + // Compare each key-value pair recursively + for (let key of keys1) { + // Check if both objects have the same key + if (!keys2.includes(key)) { + return false + } + + // Recursively compare the values + if (!objectsEqual(obj1[key], obj2[key])) { + return false + } + } + + return true +}; + function useOptions (props, context, dep) { const { @@ -563,7 +600,10 @@ function useOptions (props, context, dep) switch (mode.value) { case 'single': - return !isNullish(iv.value) && iv.value[valueProp.value] == option[valueProp.value] + return !isNullish(iv.value) && ( + iv.value[valueProp.value] == option[valueProp.value] || + (typeof iv.value[valueProp.value] === 'object' && typeof option[valueProp.value] === 'object' && objectsEqual(iv.value[valueProp.value], option[valueProp.value])) + ) case 'tags': case 'multiple': diff --git a/dist/multiselect.min.js b/dist/multiselect.min.js index 5fe375d..ca7e210 100644 --- a/dist/multiselect.min.js +++ b/dist/multiselect.min.js @@ -1 +1 @@ -import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as i,watch as n,nextTick as r,onMounted as o,onBeforeUnmount as u,shallowRef as s,openBlock as c,createElementBlock as d,normalizeClass as p,createElementVNode as v,mergeProps as f,createCommentVNode as h,withModifiers as g,Fragment as m,renderList as b,renderSlot as y,withKeys as w,toDisplayString as O,createBlock as x,Teleport as L}from"vue";function S(e){return null==e}function k(a,l,i){const{object:n,valueProp:r,mode:o}=e(a),u=t().proxy,s=i.iv,c=e=>n.value||S(e)?e:Array.isArray(e)?e.map((e=>e[r.value])):e[r.value],d=e=>S(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function T(e){return a((()=>({get:e,set:()=>{}})))}function E(t,a){const{value:n,modelValue:r,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=T((()=>void 0!==r.value?r.value:n.value)),d=i((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),p=T((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:p,plainValue:d}}function _(a,i,r){const{regex:o}=e(a),u=t().proxy,s=r.isOpen,c=r.open,d=l(null);return n(d,(e=>{!s.value&&e&&c(),i.emit("search-change",e,u)})),{search:d,clearSearch:()=>{d.value=""},handleSearchInput:e=>{d.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}i.emit("paste",e,u)}}}function q(t,a,i){const{groupSelect:n,mode:r,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===r.value||!n.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function P(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}function C(a,r,o){const{options:u,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:h,appendNewTag:g,appendNewOption:m,multipleLabel:b,object:y,loading:w,delay:O,resolveOnLoad:x,minChars:L,filterResults:k,clearOnSearch:E,clearOnSelect:_,valueProp:q,allowAbsent:C,groupLabel:A,canDeselect:B,max:D,strict:I,closeOnSelect:j,closeOnDeselect:R,groups:M,reverse:$,infinite:V,groupOptions:W,groupHideEmpty:H,groupSelect:F,onCreate:N,disabledProp:K,searchStart:z,searchFilter:G}=e(a),U=t().proxy,X=o.iv,Y=o.ev,J=o.search,Q=o.clearSearch,Z=o.update,ee=o.pointer,te=o.setPointer,ae=o.clearPointer,le=o.focus,ie=o.deactivate,ne=o.close,re=o.localize,oe=l([]),ue=l([]),se=l(!1),ce=l(null),de=l(V.value&&-1===d.value?10:d.value),pe=i({get:()=>ue.value,set:e=>ue.value=e}),ve=T((()=>v.value||f.value||!1)),fe=T((()=>void 0!==g.value?g.value:void 0===m.value||m.value)),he=i((()=>{if(M.value){let e=be.value||[],t=[];return e.forEach((e=>{ze(e[W.value]).forEach((a=>{t.push(Object.assign({},a,e[K.value]?{[K.value]:!0}:{}))}))})),t}{let e=ze(ue.value||[]);return oe.value.length&&(e=e.concat(oe.value)),e}})),ge=i((()=>{let e=he.value;return $.value&&(e=e.reverse()),ke.value.length&&(e=ke.value.concat(e)),Ke(e)})),me=i((()=>{let e=ge.value;return de.value>0&&(e=e.slice(0,de.value)),e})),be=i((()=>{if(!M.value)return[];let e=[],t=ue.value||[];return oe.value.length&&e.push({[A.value]:" ",[W.value]:[...oe.value],__CREATE__:!0}),e.concat(t)})),ye=i((()=>{let e=[...be.value].map((e=>({...e})));return ke.value.length&&(e[0]&&e[0].__CREATE__?e[0][W.value]=[...ke.value,...e[0][W.value]]:e=[{[A.value]:" ",[W.value]:[...ke.value],__CREATE__:!0}].concat(e)),e})),we=i((()=>{if(!M.value)return[];let e=ye.value;return Ne((e||[]).map(((e,t)=>{const a=ze(e[W.value]);return{...e,index:t,group:!0,[W.value]:Ke(a,!1).map((t=>Object.assign({},t,e[K.value]?{[K.value]:!0}:{}))),__VISIBLE__:Ke(a).map((t=>Object.assign({},t,e[K.value]?{[K.value]:!0}:{})))}})))})),Oe=i((()=>{switch(s.value){case"single":return!S(X.value[q.value]);case"multiple":case"tags":return!S(X.value)&&X.value.length>0}})),xe=i((()=>void 0!==b.value?b.value(X.value,U):X.value&&X.value.length>1?`${X.value.length} options selected`:"1 option selected")),Le=T((()=>!he.value.length&&!se.value&&!ke.value.length)),Se=T((()=>he.value.length>0&&0==me.value.length&&(J.value&&M.value||!M.value))),ke=i((()=>!1!==ve.value&&J.value?-1!==He(J.value)?[]:[{[q.value]:J.value,[Te.value[0]]:J.value,[h.value]:J.value,__CREATE__:!0}]:[])),Te=i((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),Ee=T((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),_e=T((()=>w.value||se.value)),qe=e=>{switch("object"!=typeof e&&(e=We(e)),s.value){case"single":Z(e);break;case"multiple":case"tags":Z(X.value.concat(e))}r.emit("select",Ce(e),e,U)},Pe=e=>{switch("object"!=typeof e&&(e=We(e)),s.value){case"single":Be();break;case"tags":case"multiple":Z(Array.isArray(e)?X.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):X.value.filter((t=>t[q.value]!=e[q.value])))}r.emit("deselect",Ce(e),e,U)},Ce=e=>y.value?e:e[q.value],Ae=e=>{Pe(e)},Be=()=>{Z(Ee.value),r.emit("clear",U)},De=e=>{if(void 0!==e.group)return"single"!==s.value&&(Ve(e[W.value])&&e[W.value].length);switch(s.value){case"single":return!S(X.value)&&X.value[q.value]==e[q.value];case"tags":case"multiple":return!S(X.value)&&-1!==X.value.map((e=>e[q.value])).indexOf(e[q.value])}},Ie=e=>!0===e[K.value],je=()=>!(void 0===D||-1===D.value||!Oe.value&&D.value>0)&&X.value.length>=D.value,Re=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&De(e))return B.value&&Pe(e),void(R.value&&(ae(),ne()));e&&Me(e),_.value&&Q(),j.value&&(ae(),ne()),e&&qe(e);break;case"multiple":if(e&&De(e))return Pe(e),void(R.value&&(ae(),ne()));if(je())return void r.emit("max",U);e&&(Me(e),qe(e)),_.value&&Q(),p.value&&ae(),j.value&&ne();break;case"tags":if(e&&De(e))return Pe(e),void(R.value&&(ae(),ne()));if(je())return void r.emit("max",U);e&&Me(e),_.value&&Q(),e&&qe(e),p.value&&ae(),j.value&&ne()}j.value||le()},Me=e=>{void 0===We(e[q.value])&&ve.value&&(r.emit("tag",e[q.value],U),r.emit("option",e[q.value],U),r.emit("create",e[q.value],U),fe.value&&Fe(e),Q())},$e=e=>void 0===e.find((e=>!De(e)&&!e[K.value])),Ve=e=>void 0===e.find((e=>!De(e))),We=e=>he.value[he.value.map((e=>String(e[q.value]))).indexOf(String(e))],He=e=>he.value.findIndex((t=>Te.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Fe=e=>{oe.value.push(e)},Ne=e=>H.value?e.filter((e=>J.value?e.__VISIBLE__.length:e[W.value].length)):e.filter((e=>!J.value||e.__VISIBLE__.length)),Ke=(e,t=!0)=>{let a=e;if(J.value&&k.value){let e=G.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=P(re(e[a]),I.value);return z.value?l.startsWith(P(t,I.value)):-1!==l.indexOf(P(t,I.value))}))),a=a.filter((t=>e(t,J.value,U)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&De(e))(e)))),a},ze=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[q.value]:e,[Te.value[0]]:a,[h.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Te.value[0]]:e,[h.value]:e})),t},Ge=()=>{S(Y.value)||(X.value=Ye(Y.value))},Ue=e=>(se.value=!0,new Promise(((t,a)=>{u.value(J.value,U).then((t=>{ue.value=t||[],"function"==typeof e&&e(t),se.value=!1})).catch((e=>{console.error(e),ue.value=[],se.value=!1})).finally((()=>{t()}))}))),Xe=()=>{if(Oe.value)if("single"===s.value){let e=We(X.value[q.value]);if(void 0!==e){let t=e[h.value];X.value[h.value]=t,y.value&&(Y.value[h.value]=t)}}else X.value.forEach(((e,t)=>{let a=We(X.value[t][q.value]);if(void 0!==a){let e=a[h.value];X.value[t][h.value]=e,y.value&&(Y.value[t][h.value]=e)}}))},Ye=e=>S(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?We(e)||(C.value?{[h.value]:e,[q.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!We(e)||C.value)).map((e=>We(e)||{[h.value]:e,[q.value]:e,[Te.value[0]]:e})),Je=()=>{ce.value=n(J,(e=>{e.length{e==J.value&&u.value(J.value,U).then((t=>{e!=J.value&&J.value||(ue.value=t,ee.value=me.value.filter((e=>!0!==e[K.value]))[0]||null,se.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!S(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?x.value?Ue(Ge):1==y.value&&Ge():(ue.value=u.value,Ge()),O.value>-1&&Je(),n(O,((e,t)=>{ce.value&&ce.value(),e>=0&&Je()})),n(Y,(e=>{if(S(e))Z(Ye(e),!1);else switch(s.value){case"single":(y.value?e[q.value]!=X.value[q.value]:e!=X.value[q.value])&&Z(Ye(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(y.value?e.map((e=>e[q.value])):e,X.value.map((e=>e[q.value])))||Z(Ye(e),!1)}}),{deep:!0}),n(u,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Ue():(ue.value=a.options,Object.keys(X.value).length||Ge(),Xe())})),n(h,Xe),n(d,((e,t)=>{de.value=V.value&&-1===e?10:e})),{resolvedOptions:pe,pfo:ge,fo:me,filteredOptions:me,hasSelected:Oe,multipleLabelText:xe,eo:he,extendedOptions:he,eg:be,extendedGroups:be,fg:we,filteredGroups:we,noOptions:Le,noResults:Se,resolving:se,busy:_e,offset:de,select:qe,deselect:Pe,remove:Ae,selectAll:()=>{"single"!==s.value&&qe(me.value.filter((e=>!e.disabled&&!De(e))))},clear:Be,isSelected:De,isDisabled:Ie,isMax:je,getOption:We,handleOptionClick:e=>{if(!Ie(e))return N.value&&!De(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=N.value(e,U))instanceof Promise)?(se.value=!0,void e.then((e=>{se.value=!1,Re(e)}))):void Re(e)},handleGroupClick:e=>{if(!Ie(e)&&"single"!==s.value&&F.value){switch(s.value){case"multiple":case"tags":$e(e[W.value])?Pe(e[W.value]):qe(e[W.value].filter((e=>-1===X.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[K.value])).filter(((e,t)=>X.value.length+1+t<=D.value||-1===D.value))),p.value&&ee.value&&te(we.value.filter((e=>!e[K.value]))[ee.value.index])}j.value&&ie()}},handleTagRemove:(e,t)=>{0===t.button?Ae(e):t.preventDefault()},refreshOptions:e=>{Ue(e)},resolveOptions:Ue,refreshLabels:Xe}}function A(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:d,mode:p,groupSelect:v,disabledProp:f,groupOptions:h}=e(t),g=l.fo,m=l.fg,b=l.handleOptionClick,y=l.handleGroupClick,w=l.search,O=l.pointer,x=l.setPointer,L=l.clearPointer,S=l.multiselect,k=l.isOpen,E=i((()=>g.value.filter((e=>!e[f.value])))),_=i((()=>m.value.filter((e=>!e[f.value])))),q=T((()=>"single"!==p.value&&v.value)),P=T((()=>O.value&&O.value.group)),C=i((()=>W(O.value))),A=i((()=>{const e=P.value?O.value:W(O.value),t=_.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=_.value[t-1];return void 0===a&&(a=D.value),a})),B=i((()=>{let e=_.value.map((e=>e.label)).indexOf(P.value?O.value[c.value]:W(O.value)[c.value])+1;return _.value.length<=e&&(e=0),_.value[e]})),D=i((()=>[..._.value].slice(-1)[0])),I=i((()=>O.value.__VISIBLE__.filter((e=>!e[f.value]))[0])),j=i((()=>{const e=C.value.__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])-1]})),R=i((()=>{const e=W(O.value).__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])+1]})),M=i((()=>[...A.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),$=i((()=>[...D.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),V=()=>{x(E.value[0]||null)},W=e=>_.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=S.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;d.value&&(t=P.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?V():L())})),n(k,(e=>{if(e&&S&&S.value){let e=S.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;r((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:O,canPointGroups:q,isPointed:e=>!(!O.value||!(!e.group&&O.value[o.value]===e[o.value]||void 0!==e.group&&O.value[c.value]===e[c.value]))||void 0,setPointerFirst:V,selectPointer:()=>{O.value&&!0!==O.value[f.value]&&(P.value?y(O.value):b(O.value))},forwardPointer:()=>{if(null===O.value)x((d.value&&q.value?_.value[0].__CREATE__?E.value[0]:_.value[0]:E.value[0])||null);else if(d.value&&q.value){let e=P.value?I.value:R.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[h.value][0])),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])+1;E.value.length<=e&&(e=0),x(E.value[e]||null)}r((()=>{H()}))},backwardPointer:()=>{if(null===O.value){let e=E.value[E.value.length-1];d.value&&q.value&&(e=$.value,void 0===e&&(e=D.value)),x(e||null)}else if(d.value&&q.value){let e=P.value?M.value:j.value;void 0===e&&(e=P.value?A.value:C.value,e.__CREATE__&&(e=M.value,void 0===e&&(e=A.value))),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])-1;e<0&&(e=E.value.length-1),x(E.value[e]||null)}r((()=>{H()}))}}}function B(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function D(e){return e instanceof B(e).Element||e instanceof Element}function I(e){return e instanceof B(e).HTMLElement||e instanceof HTMLElement}function j(e){return"undefined"!=typeof ShadowRoot&&(e instanceof B(e).ShadowRoot||e instanceof ShadowRoot)}var R=Math.max,M=Math.min,$=Math.round;function V(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function W(){return!/^((?!chrome|android).)*safari/i.test(V())}function H(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),i=1,n=1;t&&I(e)&&(i=e.offsetWidth>0&&$(l.width)/e.offsetWidth||1,n=e.offsetHeight>0&&$(l.height)/e.offsetHeight||1);var r=(D(e)?B(e):window).visualViewport,o=!W()&&a,u=(l.left+(o&&r?r.offsetLeft:0))/i,s=(l.top+(o&&r?r.offsetTop:0))/n,c=l.width/i,d=l.height/n;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function F(e){var t=B(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function N(e){return e?(e.nodeName||"").toLowerCase():null}function K(e){return((D(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return H(K(e)).left+F(e).scrollLeft}function G(e){return B(e).getComputedStyle(e)}function U(e){var t=G(e),a=t.overflow,l=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+i+l)}function X(e,t,a){void 0===a&&(a=!1);var l,i,n=I(t),r=I(t)&&function(e){var t=e.getBoundingClientRect(),a=$(t.width)/e.offsetWidth||1,l=$(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=K(t),u=H(e,r,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!a)&&(("body"!==N(t)||U(o))&&(s=(l=t)!==B(l)&&I(l)?{scrollLeft:(i=l).scrollLeft,scrollTop:i.scrollTop}:F(l)),I(t)?((c=H(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=z(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function Y(e){var t=H(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function J(e){return"html"===N(e)?e:e.assignedSlot||e.parentNode||(j(e)?e.host:null)||K(e)}function Q(e){return["html","body","#document"].indexOf(N(e))>=0?e.ownerDocument.body:I(e)&&U(e)?e:Q(J(e))}function Z(e,t){var a;void 0===t&&(t=[]);var l=Q(e),i=l===(null==(a=e.ownerDocument)?void 0:a.body),n=B(l),r=i?[n].concat(n.visualViewport||[],U(l)?l:[]):l,o=t.concat(r);return i?o:o.concat(Z(J(r)))}function ee(e){return["table","td","th"].indexOf(N(e))>=0}function te(e){return I(e)&&"fixed"!==G(e).position?e.offsetParent:null}function ae(e){for(var t=B(e),a=te(e);a&&ee(a)&&"static"===G(a).position;)a=te(a);return a&&("html"===N(a)||"body"===N(a)&&"static"===G(a).position)?t:a||function(e){var t=/firefox/i.test(V());if(/Trident/i.test(V())&&I(e)&&"fixed"===G(e).position)return null;var a=J(e);for(j(a)&&(a=a.host);I(a)&&["html","body"].indexOf(N(a))<0;){var l=G(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var le="top",ie="bottom",ne="right",re="left",oe="auto",ue=[le,ie,ne,re],se="start",ce="end",de="clippingParents",pe="viewport",ve="popper",fe="reference",he=ue.reduce((function(e,t){return e.concat([t+"-"+se,t+"-"+ce])}),[]),ge=[].concat(ue,[oe]).reduce((function(e,t){return e.concat([t,t+"-"+se,t+"-"+ce])}),[]),me=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function be(e){var t=new Map,a=new Set,l=[];function i(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&i(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||i(e)})),l}function ye(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function we(e,t,a){return t===pe?ye(function(e,t){var a=B(e),l=K(e),i=a.visualViewport,n=l.clientWidth,r=l.clientHeight,o=0,u=0;if(i){n=i.width,r=i.height;var s=W();(s||!s&&"fixed"===t)&&(o=i.offsetLeft,u=i.offsetTop)}return{width:n,height:r,x:o+z(e),y:u}}(e,a)):D(t)?function(e,t){var a=H(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):ye(function(e){var t,a=K(e),l=F(e),i=null==(t=e.ownerDocument)?void 0:t.body,n=R(a.scrollWidth,a.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),r=R(a.scrollHeight,a.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-l.scrollLeft+z(e),u=-l.scrollTop;return"rtl"===G(i||a).direction&&(o+=R(a.clientWidth,i?i.clientWidth:0)-n),{width:n,height:r,x:o,y:u}}(K(e)))}function Oe(e){var t=Z(J(e)),a=["absolute","fixed"].indexOf(G(e).position)>=0&&I(e)?ae(e):e;return D(a)?t.filter((function(e){return D(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&j(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==N(e)})):[]}function xe(e){return e.split("-")[0]}function Le(e){return e.split("-")[1]}function Se(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ke(e){var t,a=e.reference,l=e.element,i=e.placement,n=i?xe(i):null,r=i?Le(i):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(n){case le:t={x:o,y:a.y-l.height};break;case ie:t={x:o,y:a.y+a.height};break;case ne:t={x:a.x+a.width,y:u};break;case re:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=n?Se(n):null;if(null!=s){var c="y"===s?"height":"width";switch(r){case se:t[s]=t[s]-(a[c]/2-l[c]/2);break;case ce:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function Te(e,t){void 0===t&&(t={});var a,l=t,i=l.placement,n=void 0===i?e.placement:i,r=l.strategy,o=void 0===r?e.strategy:r,u=l.boundary,s=void 0===u?de:u,c=l.rootBoundary,d=void 0===c?pe:c,p=l.elementContext,v=void 0===p?ve:p,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,ue.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===ve?fe:ve,w=e.rects.popper,O=e.elements[h?y:v],x=function(e,t,a,l){var i="clippingParents"===t?Oe(e):[].concat(t),n=[].concat(i,[a]),r=n[0],o=n.reduce((function(t,a){var i=we(e,a,l);return t.top=R(i.top,t.top),t.right=M(i.right,t.right),t.bottom=M(i.bottom,t.bottom),t.left=R(i.left,t.left),t}),we(e,r,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(D(O)?O:O.contextElement||K(e.elements.popper),s,d,o),L=H(e.elements.reference),S=ke({reference:L,element:w,strategy:"absolute",placement:n}),k=ye(Object.assign({},w,S)),T=v===ve?k:L,E={top:x.top-T.top+b.top,bottom:T.bottom-x.bottom+b.bottom,left:x.left-T.left+b.left,right:T.right-x.right+b.right},_=e.modifiersData.offset;if(v===ve&&_){var q=_[n];Object.keys(E).forEach((function(e){var t=[ne,ie].indexOf(e)>=0?1:-1,a=[le,ie].indexOf(e)>=0?"y":"x";E[e]+=q[a]*t}))}return E}var Ee={placement:"bottom",modifiers:[],strategy:"absolute"};function _e(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(ge,ce,me):De(v?ge:pe,ce,v?me:ve);x[O]=be,_[O]=be-ce}t.modifiersData[l]=_}},requiresIfExists:["offset"]},je={left:"right",right:"left",bottom:"top",top:"bottom"};function Re(e){return e.replace(/left|right|bottom|top/g,(function(e){return je[e]}))}var Me={start:"end",end:"start"};function $e(e){return e.replace(/start|end/g,(function(e){return Me[e]}))}function Ve(e,t){void 0===t&&(t={});var a=t,l=a.placement,i=a.boundary,n=a.rootBoundary,r=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?ge:u,c=Le(l),d=c?o?he:he.filter((function(e){return Le(e)===c})):ue,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=Te(e,{placement:a,boundary:i,rootBoundary:n,padding:r})[xe(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var We={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var i=a.mainAxis,n=void 0===i||i,r=a.altAxis,o=void 0===r||r,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=xe(g),b=u||(m===g||!f?[Re(g)]:function(e){if(xe(e)===oe)return[];var t=Re(e);return[$e(e),t,$e(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(xe(a)===oe?Ve(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,O=t.rects.popper,x=new Map,L=!0,S=y[0],k=0;k=0,P=q?"width":"height",C=Te(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),A=q?_?ne:re:_?ie:le;w[P]>O[P]&&(A=Re(A));var B=Re(A),D=[];if(n&&D.push(C[E]<=0),o&&D.push(C[A]<=0,C[B]<=0),D.every((function(e){return e}))){S=T,L=!1;break}x.set(T,D)}if(L)for(var I=function(e){var t=y.find((function(t){var a=x.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},j=f?3:1;j>0;j--){if("break"===I(j))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function He(a,i,n){const{disabled:s,appendTo:c,appendToBody:d,openDirection:p}=e(a),v=t().proxy,f=n.multiselect,h=n.dropdown,g=l(!1),m=l(null),b=l(null),y=T((()=>c.value||d.value)),w=T((()=>"top"===p.value&&"bottom"===b.value||"bottom"===p.value&&"top"!==b.value?"bottom":"top")),O=()=>{if(!m.value)return;let e=parseInt(window.getComputedStyle(h.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(h.value).borderBottomWidth.replace("px",""));m.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===w.value?e:t)]}}]}))),m.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{y.value&&(m.value=Be(f.value,h.value,{strategy:x(f.value)?"fixed":void 0,placement:p.value,modifiers:[Ie,We,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){b.value=e.placement}}]}))})),u((()=>{y.value&&m.value&&(m.value.destroy(),m.value=null)})),{popper:m,isOpen:g,open:()=>{g.value||s.value||(g.value=!0,i.emit("open",v),y.value&&r((()=>{O()})))},close:()=>{g.value&&(g.value=!1,i.emit("close",v))},placement:w,updatePopper:O}}function Fe(t,a,i){const{searchable:n,disabled:r,clearOnBlur:o}=e(t),u=i.input,s=i.open,c=i.close,d=i.clearSearch,p=i.isOpen,v=i.wrapper,f=i.tags,h=l(!1),g=l(!1),m=T((()=>n.value||r.value?-1:0)),b=()=>{n.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{r.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:m,isActive:h,mouseClicked:g,blur:b,focus:()=>{n.value&&!r.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(g.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{g.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{g.value=!1}),0)}}}function Ne(a,l,i){const{mode:n,addTagOn:r,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e(a),g=t().proxy,m=i.iv,b=i.update,y=i.deselect,w=i.search,O=i.setPointer,x=i.selectPointer,L=i.backwardPointer,S=i.forwardPointer,k=i.multiselect,E=i.wrapper,_=i.tags,q=i.isOpen,P=i.open,C=i.blur,A=i.fo,B=T((()=>v.value||f.value||!1)),D=T((()=>void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"])),I=()=>{"tags"===n.value&&!s.value&&B.value&&u.value&&!d.value&&O(A.value[A.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,g),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===n.value&&(t=[...k.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==_.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===n.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===m.value.length)return;let l=m.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&y(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return b([...m.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?_.value.querySelector("input").focus():E.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;I(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),I(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),I(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;I(),x(),e.preventDefault();break;case"Escape":C();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;q.value||P(),L();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;q.value||P(),S();break;case"ArrowLeft":if(u.value&&_.value&&_.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==n.value||!m.value||!m.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==n.value||!m.value||!m.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?_.value.querySelector("input").focus():u.value||E.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,g)},preparePointer:I}}function Ke(t,a,l){const{classes:n,disabled:r,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,d=l.isSelected,p=l.isDisabled,v=l.isActive,f=l.canPointGroups,h=l.resolving,g=l.fo,m=l.placement,b=T((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...n.value}))),y=T((()=>!!(s.value&&o.value&&(!h.value||h.value&&g.value.length))));return{classList:i((()=>{const e=b.value;return{container:[e.container].concat(r.value?e.containerDisabled:[]).concat(y.value&&"top"===m.value?e.containerOpenTop:[]).concat(y.value&&"top"!==m.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(r.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===m.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===m.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function ze(t,a,i){const{limit:u,infinite:c}=e(t),d=i.isOpen,p=i.offset,v=i.search,f=i.pfo,h=i.eo,g=l(null),m=s(null),b=T((()=>p.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;p.value+=-1==u.value?10:u.value,r((()=>{e.scrollTop=t}))}},w=()=>{d.value&&p.value{c.value&&w()})),n(v,(()=>{c.value&&(p.value=u.value,w())}),{flush:"post"}),n(h,(()=>{c.value&&w()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(g.value=new IntersectionObserver(y))})),{hasMore:b,infiniteLoader:m}}function Ge(t,a,n){const{placeholder:r,id:u,valueProp:s,label:c,mode:d,groupLabel:p,aria:v,searchable:f}=e(t),h=n.pointer,g=n.iv,m=n.hasSelected,b=n.multipleLabelText,y=l(null),w=T((()=>(u.value?u.value+"-":"")+"assist")),O=T((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=T((()=>{if(h.value){let e=u.value?`${u.value}-`:"";return e+=(h.value.group?"multiselect-group":"multiselect-option")+"-",e+=h.value.group?h.value.index:h.value[s.value],e}})),L=T((()=>r.value)),S=T((()=>"single"!==d.value)),k=i((()=>"single"===d.value&&m.value?g.value[c.value]:"multiple"===d.value&&m.value?b.value:"tags"===d.value&&m.value?g.value.map((e=>e[c.value])).join(", "):"")),E=i((()=>{let e={...v.value};return f.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${w.value} ${e["aria-labelledby"]}`:w.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);y.value=e?e.innerText:null}})),{arias:E,ariaLabel:k,ariaAssist:w,ariaControls:O,ariaPlaceholder:L,ariaMultiselectable:S,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Ue(t,a,l){const{locale:i,fallbackLocale:n}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[i.value]?e[i.value]:e&&i.value&&e[i.value.toUpperCase()]?e[i.value.toUpperCase()]:e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Xe(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}var Ye={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Xe,Ue,E,q,He,_,k,Fe,C,ze,A,Ne,Ke,Ge]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Je=["id","dir"],Qe=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Ze=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],et=["onKeyup","aria-label"],tt=["onClick"],at=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],lt=["innerHTML"],it=["id"],nt=["id"],rt=["id","aria-label","aria-selected"],ot=["data-pointed","onMouseenter","onClick"],ut=["innerHTML"],st=["aria-label"],ct=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],dt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],pt=["innerHTML"],vt=["innerHTML"],ft=["value"],ht=["name","value"],gt=["name","value"],mt=["id"];Ye.render=function(e,t,a,l,i,n){return c(),d("div",{ref:"multiselect",class:p(e.classList.container),id:a.searchable?void 0:a.id,dir:a.rtl?"rtl":void 0,onFocusin:t[12]||(t[12]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[13]||(t[13]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t)),onKeyup:t[14]||(t[14]=(...t)=>e.handleKeyup&&e.handleKeyup(...t)),onKeydown:t[15]||(t[15]=(...t)=>e.handleKeydown&&e.handleKeydown(...t))},[v("div",f({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...t)=>e.handleMousedown&&e.handleMousedown(...t)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":a.searchable?void 0:e.ariaControls,"aria-placeholder":a.searchable?void 0:e.ariaPlaceholder,"aria-expanded":a.searchable?void 0:e.isOpen,"aria-activedescendant":a.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":a.searchable?void 0:e.ariaMultiselectable,role:a.searchable?void 0:"combobox"},a.searchable?{}:e.arias),[h(" Search "),"tags"!==a.mode&&a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:a.autocomplete,id:a.searchable?a.id:void 0,onInput:t[0]||(t[0]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[1]||(t[1]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[2]||(t[2]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,Ze)):h("v-if",!0),h(" Tags (with search) "),"tags"==a.mode?(c(),d("div",{key:1,class:p(e.classList.tags),"data-tags":""},[(c(!0),d(m,null,b(e.iv,((t,l,i)=>y(e.$slots,"tag",{option:t,handleTagRemove:e.handleTagRemove,disabled:a.disabled},(()=>[(c(),d("span",{class:p([e.classList.tag,t.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:w((a=>e.handleTagRemove(t,a)),["enter"]),key:i,"aria-label":e.ariaTagLabel(e.localize(t[a.label]))},[v("span",{class:p(e.classList.tagWrapper)},O(e.localize(t[a.label])),3),a.disabled||t.disabled?h("v-if",!0):(c(),d("span",{key:0,class:p(e.classList.tagRemove),onClick:g((a=>e.handleTagRemove(t,a)),["stop"])},[v("span",{class:p(e.classList.tagRemoveIcon)},null,2)],10,tt))],42,et))])))),256)),v("div",{class:p(e.classList.tagsSearchWrapper),ref:"tags"},[h(" Used for measuring search width "),v("span",{class:p(e.classList.tagsSearchCopy)},O(e.search),3),h(" Actual search input "),a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:a.searchable?a.id:void 0,autocomplete:a.autocomplete,onInput:t[3]||(t[3]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[4]||(t[4]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[5]||(t[5]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,at)):h("v-if",!0)],2)],2)):h("v-if",!0),h(" Single label "),"single"==a.mode&&e.hasSelected&&!e.search&&e.iv?y(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[v("div",{class:p(e.classList.singleLabel)},[v("span",{class:p(e.classList.singleLabelText)},O(e.localize(e.iv[a.label])),3)],2)])):h("v-if",!0),h(" Multiple label "),"multiple"==a.mode&&e.hasSelected&&!e.search?y(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[v("div",{class:p(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,lt)])):h("v-if",!0),h(" Placeholder "),!a.placeholder||e.hasSelected||e.search?h("v-if",!0):y(e.$slots,"placeholder",{key:4},(()=>[v("div",{class:p(e.classList.placeholder),"aria-hidden":"true"},O(a.placeholder),3)])),h(" Spinner "),a.loading||e.resolving?y(e.$slots,"spinner",{key:5},(()=>[v("span",{class:p(e.classList.spinner),"aria-hidden":"true"},null,2)])):h("v-if",!0),h(" Clear "),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?y(e.$slots,"clear",{key:6,clear:e.clear},(()=>[v("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:p(e.classList.clear),onClick:t[6]||(t[6]=(...t)=>e.clear&&e.clear(...t)),onKeyup:t[7]||(t[7]=w(((...t)=>e.clear&&e.clear(...t)),["enter"]))},[v("span",{class:p(e.classList.clearIcon)},null,2)],34)])):h("v-if",!0),h(" Caret "),a.caret&&a.showOptions?y(e.$slots,"caret",{key:7,handleCaretClick:e.handleCaretClick,isOpen:e.isOpen},(()=>[v("span",{class:p(e.classList.caret),onClick:t[8]||(t[8]=(...t)=>e.handleCaretClick&&e.handleCaretClick(...t)),"aria-hidden":"true"},null,2)])):h("v-if",!0)],16,Qe),h(" Options "),(c(),x(L,{to:a.appendTo||"body",disabled:!a.appendToBody&&!a.appendTo},[v("div",{id:a.id?`${a.id}-dropdown`:void 0,class:p(e.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:t[10]||(t[10]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[11]||(t[11]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t))},[y(e.$slots,"beforelist",{options:e.fo}),v("ul",{class:p(e.classList.options),id:e.ariaControls,role:"listbox"},[a.groups?(c(!0),d(m,{key:0},b(e.fg,((t,l,i)=>(c(),d("li",{class:p(e.classList.group),key:i,id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),"aria-selected":e.isSelected(t),role:"option"},[t.__CREATE__?h("v-if",!0):(c(),d("div",{key:0,class:p(e.classList.groupLabel(t)),"data-pointed":e.isPointed(t),onMouseenter:a=>e.setPointer(t,l),onClick:a=>e.handleGroupClick(t)},[y(e.$slots,"grouplabel",{group:t,isSelected:e.isSelected,isPointed:e.isPointed},(()=>[v("span",{innerHTML:e.localize(t[a.groupLabel])},null,8,ut)]))],42,ot)),v("ul",{class:p(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),role:"group"},[(c(!0),d(m,null,b(t.__VISIBLE__,((l,i,n)=>(c(),d("li",{class:p(e.classList.option(l,t)),"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,key:n,onMouseenter:t=>e.setPointer(l),onClick:t=>e.handleOptionClick(l),id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[a.label])),role:"option"},[y(e.$slots,"option",{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(l[a.label])),1)]))],42,ct)))),128))],10,st)],10,rt)))),128)):(c(!0),d(m,{key:1},b(e.fo,((t,l,i)=>(c(),d("li",{class:p(e.classList.option(t)),"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,key:i,onMouseenter:a=>e.setPointer(t),onClick:a=>e.handleOptionClick(t),id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[a.label])),role:"option"},[y(e.$slots,"option",{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(t[a.label])),1)]))],42,dt)))),128))],10,nt),e.noOptions?y(e.$slots,"nooptions",{key:0},(()=>[v("div",{class:p(e.classList.noOptions),innerHTML:e.localize(a.noOptionsText)},null,10,pt)])):h("v-if",!0),e.noResults?y(e.$slots,"noresults",{key:1},(()=>[v("div",{class:p(e.classList.noResults),innerHTML:e.localize(a.noResultsText)},null,10,vt)])):h("v-if",!0),a.infinite&&e.hasMore?(c(),d("div",{key:2,class:p(e.classList.inifinite),ref:"infiniteLoader"},[y(e.$slots,"infinite",{},(()=>[v("span",{class:p(e.classList.inifiniteSpinner)},null,2)]))],2)):h("v-if",!0),y(e.$slots,"afterlist",{options:e.fo})],42,it)],8,["to","disabled"])),h(" Hacky input element to show HTML5 required warning "),a.required?(c(),d("input",{key:0,class:p(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,ft)):h("v-if",!0),h(" Native input support "),a.nativeSupport?(c(),d(m,{key:1},["single"==a.mode?(c(),d("input",{key:0,type:"hidden",name:a.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,ht)):(c(!0),d(m,{key:1},b(e.plainValue,((e,t)=>(c(),d("input",{type:"hidden",name:`${a.name}[]`,value:e,key:t},null,8,gt)))),128))],64)):h("v-if",!0),h(" Screen reader assistive text "),a.searchable&&e.hasSelected?(c(),d("div",{key:2,class:p(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},O(e.ariaLabel),11,mt)):h("v-if",!0),h(" Create height for empty input "),v("div",{class:p(e.classList.spacer)},null,2)],42,Je)},Ye.__file="src/Multiselect.vue";export{Ye as default}; +import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as n,watch as i,nextTick as r,onMounted as o,onBeforeUnmount as u,shallowRef as s,openBlock as c,createElementBlock as d,normalizeClass as p,createElementVNode as v,mergeProps as f,createCommentVNode as h,withModifiers as g,Fragment as m,renderList as b,renderSlot as y,withKeys as w,toDisplayString as O,createBlock as x,Teleport as L}from"vue";function S(e){return null==e}function k(a,l,n){const{object:i,valueProp:r,mode:o}=e(a),u=t().proxy,s=n.iv,c=e=>i.value||S(e)?e:Array.isArray(e)?e.map((e=>e[r.value])):e[r.value],d=e=>S(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function T(e){return a((()=>({get:e,set:()=>{}})))}function E(t,a){const{value:i,modelValue:r,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=T((()=>void 0!==r.value?r.value:i.value)),d=n((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),p=T((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:p,plainValue:d}}function _(a,n,r){const{regex:o}=e(a),u=t().proxy,s=r.isOpen,c=r.open,d=l(null);return i(d,(e=>{!s.value&&e&&c(),n.emit("search-change",e,u)})),{search:d,clearSearch:()=>{d.value=""},handleSearchInput:e=>{d.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}n.emit("paste",e,u)}}}function q(t,a,n){const{groupSelect:i,mode:r,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===r.value||!i.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function P(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}const C=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!C(e[n],t[n]))return!1}return!0};function A(a,r,o){const{options:u,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:h,appendNewTag:g,appendNewOption:m,multipleLabel:b,object:y,loading:w,delay:O,resolveOnLoad:x,minChars:L,filterResults:k,clearOnSearch:E,clearOnSelect:_,valueProp:q,allowAbsent:A,groupLabel:B,canDeselect:D,max:j,strict:I,closeOnSelect:R,closeOnDeselect:M,groups:$,reverse:V,infinite:W,groupOptions:H,groupHideEmpty:F,groupSelect:N,onCreate:K,disabledProp:z,searchStart:G,searchFilter:U}=e(a),X=t().proxy,Y=o.iv,J=o.ev,Q=o.search,Z=o.clearSearch,ee=o.update,te=o.pointer,ae=o.setPointer,le=o.clearPointer,ne=o.focus,ie=o.deactivate,re=o.close,oe=o.localize,ue=l([]),se=l([]),ce=l(!1),de=l(null),pe=l(W.value&&-1===d.value?10:d.value),ve=n({get:()=>se.value,set:e=>se.value=e}),fe=T((()=>v.value||f.value||!1)),he=T((()=>void 0!==g.value?g.value:void 0===m.value||m.value)),ge=n((()=>{if($.value){let e=ye.value||[],t=[];return e.forEach((e=>{Ge(e[H.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=Ge(se.value||[]);return ue.value.length&&(e=e.concat(ue.value)),e}})),me=n((()=>{let e=ge.value;return V.value&&(e=e.reverse()),Te.value.length&&(e=Te.value.concat(e)),ze(e)})),be=n((()=>{let e=me.value;return pe.value>0&&(e=e.slice(0,pe.value)),e})),ye=n((()=>{if(!$.value)return[];let e=[],t=se.value||[];return ue.value.length&&e.push({[B.value]:" ",[H.value]:[...ue.value],__CREATE__:!0}),e.concat(t)})),we=n((()=>{let e=[...ye.value].map((e=>({...e})));return Te.value.length&&(e[0]&&e[0].__CREATE__?e[0][H.value]=[...Te.value,...e[0][H.value]]:e=[{[B.value]:" ",[H.value]:[...Te.value],__CREATE__:!0}].concat(e)),e})),Oe=n((()=>{if(!$.value)return[];let e=we.value;return Ke((e||[]).map(((e,t)=>{const a=Ge(e[H.value]);return{...e,index:t,group:!0,[H.value]:ze(a,!1).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{}))),__VISIBLE__:ze(a).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{})))}})))})),xe=n((()=>{switch(s.value){case"single":return!S(Y.value[q.value]);case"multiple":case"tags":return!S(Y.value)&&Y.value.length>0}})),Le=n((()=>void 0!==b.value?b.value(Y.value,X):Y.value&&Y.value.length>1?`${Y.value.length} options selected`:"1 option selected")),Se=T((()=>!ge.value.length&&!ce.value&&!Te.value.length)),ke=T((()=>ge.value.length>0&&0==be.value.length&&(Q.value&&$.value||!$.value))),Te=n((()=>!1!==fe.value&&Q.value?-1!==Fe(Q.value)?[]:[{[q.value]:Q.value,[Ee.value[0]]:Q.value,[h.value]:Q.value,__CREATE__:!0}]:[])),Ee=n((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),_e=T((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),qe=T((()=>w.value||ce.value)),Pe=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":ee(e);break;case"multiple":case"tags":ee(Y.value.concat(e))}r.emit("select",Ae(e),e,X)},Ce=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":De();break;case"tags":case"multiple":ee(Array.isArray(e)?Y.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):Y.value.filter((t=>t[q.value]!=e[q.value])))}r.emit("deselect",Ae(e),e,X)},Ae=e=>y.value?e:e[q.value],Be=e=>{Ce(e)},De=()=>{ee(_e.value),r.emit("clear",X)},je=e=>{if(void 0!==e.group)return"single"!==s.value&&(We(e[H.value])&&e[H.value].length);switch(s.value){case"single":return!S(Y.value)&&(Y.value[q.value]==e[q.value]||"object"==typeof Y.value[q.value]&&"object"==typeof e[q.value]&&C(Y.value[q.value],e[q.value]));case"tags":case"multiple":return!S(Y.value)&&-1!==Y.value.map((e=>e[q.value])).indexOf(e[q.value])}},Ie=e=>!0===e[z.value],Re=()=>!(void 0===j||-1===j.value||!xe.value&&j.value>0)&&Y.value.length>=j.value,Me=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&je(e))return D.value&&Ce(e),void(M.value&&(le(),re()));e&&$e(e),_.value&&Z(),R.value&&(le(),re()),e&&Pe(e);break;case"multiple":if(e&&je(e))return Ce(e),void(M.value&&(le(),re()));if(Re())return void r.emit("max",X);e&&($e(e),Pe(e)),_.value&&Z(),p.value&&le(),R.value&&re();break;case"tags":if(e&&je(e))return Ce(e),void(M.value&&(le(),re()));if(Re())return void r.emit("max",X);e&&$e(e),_.value&&Z(),e&&Pe(e),p.value&&le(),R.value&&re()}R.value||ne()},$e=e=>{void 0===He(e[q.value])&&fe.value&&(r.emit("tag",e[q.value],X),r.emit("option",e[q.value],X),r.emit("create",e[q.value],X),he.value&&Ne(e),Z())},Ve=e=>void 0===e.find((e=>!je(e)&&!e[z.value])),We=e=>void 0===e.find((e=>!je(e))),He=e=>ge.value[ge.value.map((e=>String(e[q.value]))).indexOf(String(e))],Fe=e=>ge.value.findIndex((t=>Ee.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Ne=e=>{ue.value.push(e)},Ke=e=>F.value?e.filter((e=>Q.value?e.__VISIBLE__.length:e[H.value].length)):e.filter((e=>!Q.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(Q.value&&k.value){let e=U.value;e||(e=(e,t,a)=>Ee.value.some((a=>{let l=P(oe(e[a]),I.value);return G.value?l.startsWith(P(t,I.value)):-1!==l.indexOf(P(t,I.value))}))),a=a.filter((t=>e(t,Q.value,X)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&je(e))(e)))),a},Ge=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[q.value]:e,[Ee.value[0]]:a,[h.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Ee.value[0]]:e,[h.value]:e})),t},Ue=()=>{S(J.value)||(Y.value=Je(J.value))},Xe=e=>(ce.value=!0,new Promise(((t,a)=>{u.value(Q.value,X).then((t=>{se.value=t||[],"function"==typeof e&&e(t),ce.value=!1})).catch((e=>{console.error(e),se.value=[],ce.value=!1})).finally((()=>{t()}))}))),Ye=()=>{if(xe.value)if("single"===s.value){let e=He(Y.value[q.value]);if(void 0!==e){let t=e[h.value];Y.value[h.value]=t,y.value&&(J.value[h.value]=t)}}else Y.value.forEach(((e,t)=>{let a=He(Y.value[t][q.value]);if(void 0!==a){let e=a[h.value];Y.value[t][h.value]=e,y.value&&(J.value[t][h.value]=e)}}))},Je=e=>S(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?He(e)||(A.value?{[h.value]:e,[q.value]:e,[Ee.value[0]]:e}:{}):e.filter((e=>!!He(e)||A.value)).map((e=>He(e)||{[h.value]:e,[q.value]:e,[Ee.value[0]]:e})),Qe=()=>{de.value=i(Q,(e=>{e.length{e==Q.value&&u.value(Q.value,X).then((t=>{e!=Q.value&&Q.value||(se.value=t,te.value=be.value.filter((e=>!0!==e[z.value]))[0]||null,ce.value=!1)})).catch((e=>{console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==s.value&&!S(J.value)&&!Array.isArray(J.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?x.value?Xe(Ue):1==y.value&&Ue():(se.value=u.value,Ue()),O.value>-1&&Qe(),i(O,((e,t)=>{de.value&&de.value(),e>=0&&Qe()})),i(J,(e=>{if(S(e))ee(Je(e),!1);else switch(s.value){case"single":(y.value?e[q.value]!=Y.value[q.value]:e!=Y.value[q.value])&&ee(Je(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(y.value?e.map((e=>e[q.value])):e,Y.value.map((e=>e[q.value])))||ee(Je(e),!1)}}),{deep:!0}),i(u,((e,t)=>{"function"==typeof a.options?x.value&&(!t||e&&e.toString()!==t.toString())&&Xe():(se.value=a.options,Object.keys(Y.value).length||Ue(),Ye())})),i(h,Ye),i(d,((e,t)=>{pe.value=W.value&&-1===e?10:e})),{resolvedOptions:ve,pfo:me,fo:be,filteredOptions:be,hasSelected:xe,multipleLabelText:Le,eo:ge,extendedOptions:ge,eg:ye,extendedGroups:ye,fg:Oe,filteredGroups:Oe,noOptions:Se,noResults:ke,resolving:ce,busy:qe,offset:pe,select:Pe,deselect:Ce,remove:Be,selectAll:()=>{"single"!==s.value&&Pe(be.value.filter((e=>!e.disabled&&!je(e))))},clear:De,isSelected:je,isDisabled:Ie,isMax:Re,getOption:He,handleOptionClick:e=>{if(!Ie(e))return K.value&&!je(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=K.value(e,X))instanceof Promise)?(ce.value=!0,void e.then((e=>{ce.value=!1,Me(e)}))):void Me(e)},handleGroupClick:e=>{if(!Ie(e)&&"single"!==s.value&&N.value){switch(s.value){case"multiple":case"tags":Ve(e[H.value])?Ce(e[H.value]):Pe(e[H.value].filter((e=>-1===Y.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[z.value])).filter(((e,t)=>Y.value.length+1+t<=j.value||-1===j.value))),p.value&&te.value&&ae(Oe.value.filter((e=>!e[z.value]))[te.value.index])}R.value&&ie()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{Xe(e)},resolveOptions:Xe,refreshLabels:Ye}}function B(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:d,mode:p,groupSelect:v,disabledProp:f,groupOptions:h}=e(t),g=l.fo,m=l.fg,b=l.handleOptionClick,y=l.handleGroupClick,w=l.search,O=l.pointer,x=l.setPointer,L=l.clearPointer,S=l.multiselect,k=l.isOpen,E=n((()=>g.value.filter((e=>!e[f.value])))),_=n((()=>m.value.filter((e=>!e[f.value])))),q=T((()=>"single"!==p.value&&v.value)),P=T((()=>O.value&&O.value.group)),C=n((()=>W(O.value))),A=n((()=>{const e=P.value?O.value:W(O.value),t=_.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=_.value[t-1];return void 0===a&&(a=D.value),a})),B=n((()=>{let e=_.value.map((e=>e.label)).indexOf(P.value?O.value[c.value]:W(O.value)[c.value])+1;return _.value.length<=e&&(e=0),_.value[e]})),D=n((()=>[..._.value].slice(-1)[0])),j=n((()=>O.value.__VISIBLE__.filter((e=>!e[f.value]))[0])),I=n((()=>{const e=C.value.__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])-1]})),R=n((()=>{const e=W(O.value).__VISIBLE__.filter((e=>!e[f.value]));return e[e.map((e=>e[o.value])).indexOf(O.value[o.value])+1]})),M=n((()=>[...A.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),$=n((()=>[...D.value.__VISIBLE__.filter((e=>!e[f.value]))].slice(-1)[0])),V=()=>{x(E.value[0]||null)},W=e=>_.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=S.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;d.value&&(t=P.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?V():L())})),i(k,(e=>{if(e&&S&&S.value){let e=S.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;r((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:O,canPointGroups:q,isPointed:e=>!(!O.value||!(!e.group&&O.value[o.value]===e[o.value]||void 0!==e.group&&O.value[c.value]===e[c.value]))||void 0,setPointerFirst:V,selectPointer:()=>{O.value&&!0!==O.value[f.value]&&(P.value?y(O.value):b(O.value))},forwardPointer:()=>{if(null===O.value)x((d.value&&q.value?_.value[0].__CREATE__?E.value[0]:_.value[0]:E.value[0])||null);else if(d.value&&q.value){let e=P.value?j.value:R.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[h.value][0])),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])+1;E.value.length<=e&&(e=0),x(E.value[e]||null)}r((()=>{H()}))},backwardPointer:()=>{if(null===O.value){let e=E.value[E.value.length-1];d.value&&q.value&&(e=$.value,void 0===e&&(e=D.value)),x(e||null)}else if(d.value&&q.value){let e=P.value?M.value:I.value;void 0===e&&(e=P.value?A.value:C.value,e.__CREATE__&&(e=M.value,void 0===e&&(e=A.value))),x(e||null)}else{let e=E.value.map((e=>e[o.value])).indexOf(O.value[o.value])-1;e<0&&(e=E.value.length-1),x(E.value[e]||null)}r((()=>{H()}))}}}function D(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function j(e){return e instanceof D(e).Element||e instanceof Element}function I(e){return e instanceof D(e).HTMLElement||e instanceof HTMLElement}function R(e){return"undefined"!=typeof ShadowRoot&&(e instanceof D(e).ShadowRoot||e instanceof ShadowRoot)}var M=Math.max,$=Math.min,V=Math.round;function W(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function H(){return!/^((?!chrome|android).)*safari/i.test(W())}function F(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,i=1;t&&I(e)&&(n=e.offsetWidth>0&&V(l.width)/e.offsetWidth||1,i=e.offsetHeight>0&&V(l.height)/e.offsetHeight||1);var r=(j(e)?D(e):window).visualViewport,o=!H()&&a,u=(l.left+(o&&r?r.offsetLeft:0))/n,s=(l.top+(o&&r?r.offsetTop:0))/i,c=l.width/n,d=l.height/i;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function N(e){var t=D(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function K(e){return e?(e.nodeName||"").toLowerCase():null}function z(e){return((j(e)?e.ownerDocument:e.document)||window.document).documentElement}function G(e){return F(z(e)).left+N(e).scrollLeft}function U(e){return D(e).getComputedStyle(e)}function X(e){var t=U(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function Y(e,t,a){void 0===a&&(a=!1);var l,n,i=I(t),r=I(t)&&function(e){var t=e.getBoundingClientRect(),a=V(t.width)/e.offsetWidth||1,l=V(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=z(t),u=F(e,r,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!a)&&(("body"!==K(t)||X(o))&&(s=(l=t)!==D(l)&&I(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:N(l)),I(t)?((c=F(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=G(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function J(e){var t=F(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function Q(e){return"html"===K(e)?e:e.assignedSlot||e.parentNode||(R(e)?e.host:null)||z(e)}function Z(e){return["html","body","#document"].indexOf(K(e))>=0?e.ownerDocument.body:I(e)&&X(e)?e:Z(Q(e))}function ee(e,t){var a;void 0===t&&(t=[]);var l=Z(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),i=D(l),r=n?[i].concat(i.visualViewport||[],X(l)?l:[]):l,o=t.concat(r);return n?o:o.concat(ee(Q(r)))}function te(e){return["table","td","th"].indexOf(K(e))>=0}function ae(e){return I(e)&&"fixed"!==U(e).position?e.offsetParent:null}function le(e){for(var t=D(e),a=ae(e);a&&te(a)&&"static"===U(a).position;)a=ae(a);return a&&("html"===K(a)||"body"===K(a)&&"static"===U(a).position)?t:a||function(e){var t=/firefox/i.test(W());if(/Trident/i.test(W())&&I(e)&&"fixed"===U(e).position)return null;var a=Q(e);for(R(a)&&(a=a.host);I(a)&&["html","body"].indexOf(K(a))<0;){var l=U(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var ne="top",ie="bottom",re="right",oe="left",ue="auto",se=[ne,ie,re,oe],ce="start",de="end",pe="clippingParents",ve="viewport",fe="popper",he="reference",ge=se.reduce((function(e,t){return e.concat([t+"-"+ce,t+"-"+de])}),[]),me=[].concat(se,[ue]).reduce((function(e,t){return e.concat([t,t+"-"+ce,t+"-"+de])}),[]),be=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ye(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function we(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Oe(e,t,a){return t===ve?we(function(e,t){var a=D(e),l=z(e),n=a.visualViewport,i=l.clientWidth,r=l.clientHeight,o=0,u=0;if(n){i=n.width,r=n.height;var s=H();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:i,height:r,x:o+G(e),y:u}}(e,a)):j(t)?function(e,t){var a=F(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):we(function(e){var t,a=z(e),l=N(e),n=null==(t=e.ownerDocument)?void 0:t.body,i=M(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=M(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+G(e),u=-l.scrollTop;return"rtl"===U(n||a).direction&&(o+=M(a.clientWidth,n?n.clientWidth:0)-i),{width:i,height:r,x:o,y:u}}(z(e)))}function xe(e){var t=ee(Q(e)),a=["absolute","fixed"].indexOf(U(e).position)>=0&&I(e)?le(e):e;return j(a)?t.filter((function(e){return j(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&R(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==K(e)})):[]}function Le(e){return e.split("-")[0]}function Se(e){return e.split("-")[1]}function ke(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Te(e){var t,a=e.reference,l=e.element,n=e.placement,i=n?Le(n):null,r=n?Se(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(i){case ne:t={x:o,y:a.y-l.height};break;case ie:t={x:o,y:a.y+a.height};break;case re:t={x:a.x+a.width,y:u};break;case oe:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=i?ke(i):null;if(null!=s){var c="y"===s?"height":"width";switch(r){case ce:t[s]=t[s]-(a[c]/2-l[c]/2);break;case de:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function Ee(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,i=void 0===n?e.placement:n,r=l.strategy,o=void 0===r?e.strategy:r,u=l.boundary,s=void 0===u?pe:u,c=l.rootBoundary,d=void 0===c?ve:c,p=l.elementContext,v=void 0===p?fe:p,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,se.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===fe?he:fe,w=e.rects.popper,O=e.elements[h?y:v],x=function(e,t,a,l){var n="clippingParents"===t?xe(e):[].concat(t),i=[].concat(n,[a]),r=i[0],o=i.reduce((function(t,a){var n=Oe(e,a,l);return t.top=M(n.top,t.top),t.right=$(n.right,t.right),t.bottom=$(n.bottom,t.bottom),t.left=M(n.left,t.left),t}),Oe(e,r,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(j(O)?O:O.contextElement||z(e.elements.popper),s,d,o),L=F(e.elements.reference),S=Te({reference:L,element:w,strategy:"absolute",placement:i}),k=we(Object.assign({},w,S)),T=v===fe?k:L,E={top:x.top-T.top+b.top,bottom:T.bottom-x.bottom+b.bottom,left:x.left-T.left+b.left,right:T.right-x.right+b.right},_=e.modifiersData.offset;if(v===fe&&_){var q=_[i];Object.keys(E).forEach((function(e){var t=[re,ie].indexOf(e)>=0?1:-1,a=[ne,ie].indexOf(e)>=0?"y":"x";E[e]+=q[a]*t}))}return E}var _e={placement:"bottom",modifiers:[],strategy:"absolute"};function qe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(ge,se,me):je(v?ge:pe,se,v?me:ve);x[O]=be,_[O]=be-se}t.modifiersData[l]=_}},requiresIfExists:["offset"]},Re={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e){return e.replace(/left|right|bottom|top/g,(function(e){return Re[e]}))}var $e={start:"end",end:"start"};function Ve(e){return e.replace(/start|end/g,(function(e){return $e[e]}))}function We(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,i=a.rootBoundary,r=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?me:u,c=Se(l),d=c?o?ge:ge.filter((function(e){return Se(e)===c})):se,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=Ee(e,{placement:a,boundary:n,rootBoundary:i,padding:r})[Le(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var He={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,i=void 0===n||n,r=a.altAxis,o=void 0===r||r,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=Le(g),b=u||(m===g||!f?[Me(g)]:function(e){if(Le(e)===ue)return[];var t=Me(e);return[Ve(e),t,Ve(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(Le(a)===ue?We(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,O=t.rects.popper,x=new Map,L=!0,S=y[0],k=0;k=0,P=q?"width":"height",C=Ee(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),A=q?_?re:oe:_?ie:ne;w[P]>O[P]&&(A=Me(A));var B=Me(A),D=[];if(i&&D.push(C[E]<=0),o&&D.push(C[A]<=0,C[B]<=0),D.every((function(e){return e}))){S=T,L=!1;break}x.set(T,D)}if(L)for(var j=function(e){var t=y.find((function(t){var a=x.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},I=f?3:1;I>0;I--){if("break"===j(I))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Fe(a,n,i){const{disabled:s,appendTo:c,appendToBody:d,openDirection:p}=e(a),v=t().proxy,f=i.multiselect,h=i.dropdown,g=l(!1),m=l(null),b=l(null),y=T((()=>c.value||d.value)),w=T((()=>"top"===p.value&&"bottom"===b.value||"bottom"===p.value&&"top"!==b.value?"bottom":"top")),O=()=>{if(!m.value)return;let e=parseInt(window.getComputedStyle(h.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(h.value).borderBottomWidth.replace("px",""));m.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===w.value?e:t)]}}]}))),m.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{y.value&&(m.value=De(f.value,h.value,{strategy:x(f.value)?"fixed":void 0,placement:p.value,modifiers:[Ie,He,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){b.value=e.placement}}]}))})),u((()=>{y.value&&m.value&&(m.value.destroy(),m.value=null)})),{popper:m,isOpen:g,open:()=>{g.value||s.value||(g.value=!0,n.emit("open",v),y.value&&r((()=>{O()})))},close:()=>{g.value&&(g.value=!1,n.emit("close",v))},placement:w,updatePopper:O}}function Ne(t,a,n){const{searchable:i,disabled:r,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,h=l(!1),g=l(!1),m=T((()=>i.value||r.value?-1:0)),b=()=>{i.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{r.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:m,isActive:h,mouseClicked:g,blur:b,focus:()=>{i.value&&!r.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(g.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{g.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{g.value=!1}),0)}}}function Ke(a,l,n){const{mode:i,addTagOn:r,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e(a),g=t().proxy,m=n.iv,b=n.update,y=n.deselect,w=n.search,O=n.setPointer,x=n.selectPointer,L=n.backwardPointer,S=n.forwardPointer,k=n.multiselect,E=n.wrapper,_=n.tags,q=n.isOpen,P=n.open,C=n.blur,A=n.fo,B=T((()=>v.value||f.value||!1)),D=T((()=>void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"])),j=()=>{"tags"===i.value&&!s.value&&B.value&&u.value&&!d.value&&O(A.value[A.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,g),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===i.value&&(t=[...k.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==_.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===i.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===m.value.length)return;let l=m.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&y(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return b([...m.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?_.value.querySelector("input").focus():E.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;j(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),j(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),j(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;j(),x(),e.preventDefault();break;case"Escape":C();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;q.value||P(),L();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;q.value||P(),S();break;case"ArrowLeft":if(u.value&&_.value&&_.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==i.value||!m.value||!m.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==i.value||!m.value||!m.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?_.value.querySelector("input").focus():u.value||E.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,g)},preparePointer:j}}function ze(t,a,l){const{classes:i,disabled:r,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,d=l.isSelected,p=l.isDisabled,v=l.isActive,f=l.canPointGroups,h=l.resolving,g=l.fo,m=l.placement,b=T((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...i.value}))),y=T((()=>!!(s.value&&o.value&&(!h.value||h.value&&g.value.length))));return{classList:n((()=>{const e=b.value;return{container:[e.container].concat(r.value?e.containerDisabled:[]).concat(y.value&&"top"===m.value?e.containerOpenTop:[]).concat(y.value&&"top"!==m.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(r.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===m.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===m.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function Ge(t,a,n){const{limit:u,infinite:c}=e(t),d=n.isOpen,p=n.offset,v=n.search,f=n.pfo,h=n.eo,g=l(null),m=s(null),b=T((()=>p.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;p.value+=-1==u.value?10:u.value,r((()=>{e.scrollTop=t}))}},w=()=>{d.value&&p.value{c.value&&w()})),i(v,(()=>{c.value&&(p.value=u.value,w())}),{flush:"post"}),i(h,(()=>{c.value&&w()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(g.value=new IntersectionObserver(y))})),{hasMore:b,infiniteLoader:m}}function Ue(t,a,i){const{placeholder:r,id:u,valueProp:s,label:c,mode:d,groupLabel:p,aria:v,searchable:f}=e(t),h=i.pointer,g=i.iv,m=i.hasSelected,b=i.multipleLabelText,y=l(null),w=T((()=>(u.value?u.value+"-":"")+"assist")),O=T((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=T((()=>{if(h.value){let e=u.value?`${u.value}-`:"";return e+=(h.value.group?"multiselect-group":"multiselect-option")+"-",e+=h.value.group?h.value.index:h.value[s.value],e}})),L=T((()=>r.value)),S=T((()=>"single"!==d.value)),k=n((()=>"single"===d.value&&m.value?g.value[c.value]:"multiple"===d.value&&m.value?b.value:"tags"===d.value&&m.value?g.value.map((e=>e[c.value])).join(", "):"")),E=n((()=>{let e={...v.value};return f.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${w.value} ${e["aria-labelledby"]}`:w.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);y.value=e?e.innerText:null}})),{arias:E,ariaLabel:k,ariaAssist:w,ariaControls:O,ariaPlaceholder:L,ariaMultiselectable:S,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Xe(t,a,l){const{locale:n,fallbackLocale:i}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[i.value]?e[i.value]:e&&i.value&&e[i.value.toUpperCase()]?e[i.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Ye(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}var Je={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Ye,Xe,E,q,Fe,_,k,Ne,A,Ge,B,Ke,ze,Ue]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};const Qe=["id","dir"],Ze=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],et=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],tt=["onKeyup","aria-label"],at=["onClick"],lt=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],nt=["innerHTML"],it=["id"],rt=["id"],ot=["id","aria-label","aria-selected"],ut=["data-pointed","onMouseenter","onClick"],st=["innerHTML"],ct=["aria-label"],dt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],pt=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],vt=["innerHTML"],ft=["innerHTML"],ht=["value"],gt=["name","value"],mt=["name","value"],bt=["id"];Je.render=function(e,t,a,l,n,i){return c(),d("div",{ref:"multiselect",class:p(e.classList.container),id:a.searchable?void 0:a.id,dir:a.rtl?"rtl":void 0,onFocusin:t[12]||(t[12]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[13]||(t[13]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t)),onKeyup:t[14]||(t[14]=(...t)=>e.handleKeyup&&e.handleKeyup(...t)),onKeydown:t[15]||(t[15]=(...t)=>e.handleKeydown&&e.handleKeydown(...t))},[v("div",f({class:e.classList.wrapper,onMousedown:t[9]||(t[9]=(...t)=>e.handleMousedown&&e.handleMousedown(...t)),ref:"wrapper",tabindex:e.tabindex,"aria-controls":a.searchable?void 0:e.ariaControls,"aria-placeholder":a.searchable?void 0:e.ariaPlaceholder,"aria-expanded":a.searchable?void 0:e.isOpen,"aria-activedescendant":a.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":a.searchable?void 0:e.ariaMultiselectable,role:a.searchable?void 0:"combobox"},a.searchable?{}:e.arias),[h(" Search "),"tags"!==a.mode&&a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:a.autocomplete,id:a.searchable?a.id:void 0,onInput:t[0]||(t[0]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[1]||(t[1]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[2]||(t[2]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,et)):h("v-if",!0),h(" Tags (with search) "),"tags"==a.mode?(c(),d("div",{key:1,class:p(e.classList.tags),"data-tags":""},[(c(!0),d(m,null,b(e.iv,((t,l,n)=>y(e.$slots,"tag",{option:t,handleTagRemove:e.handleTagRemove,disabled:a.disabled},(()=>[(c(),d("span",{class:p([e.classList.tag,t.disabled?e.classList.tagDisabled:null]),tabindex:"-1",onKeyup:w((a=>e.handleTagRemove(t,a)),["enter"]),key:n,"aria-label":e.ariaTagLabel(e.localize(t[a.label]))},[v("span",{class:p(e.classList.tagWrapper)},O(e.localize(t[a.label])),3),a.disabled||t.disabled?h("v-if",!0):(c(),d("span",{key:0,class:p(e.classList.tagRemove),onClick:g((a=>e.handleTagRemove(t,a)),["stop"])},[v("span",{class:p(e.classList.tagRemoveIcon)},null,2)],10,at))],42,tt))])))),256)),v("div",{class:p(e.classList.tagsSearchWrapper),ref:"tags"},[h(" Used for measuring search width "),v("span",{class:p(e.classList.tagsSearchCopy)},O(e.search),3),h(" Actual search input "),a.searchable&&!a.disabled?(c(),d("input",f({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,id:a.searchable?a.id:void 0,autocomplete:a.autocomplete,onInput:t[3]||(t[3]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onKeypress:t[4]||(t[4]=(...t)=>e.handleKeypress&&e.handleKeypress(...t)),onPaste:t[5]||(t[5]=g(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input","aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},{...a.attrs,...e.arias}),null,16,lt)):h("v-if",!0)],2)],2)):h("v-if",!0),h(" Single label "),"single"==a.mode&&e.hasSelected&&!e.search&&e.iv?y(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[v("div",{class:p(e.classList.singleLabel)},[v("span",{class:p(e.classList.singleLabelText)},O(e.localize(e.iv[a.label])),3)],2)])):h("v-if",!0),h(" Multiple label "),"multiple"==a.mode&&e.hasSelected&&!e.search?y(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[v("div",{class:p(e.classList.multipleLabel),innerHTML:e.multipleLabelText},null,10,nt)])):h("v-if",!0),h(" Placeholder "),!a.placeholder||e.hasSelected||e.search?h("v-if",!0):y(e.$slots,"placeholder",{key:4},(()=>[v("div",{class:p(e.classList.placeholder),"aria-hidden":"true"},O(a.placeholder),3)])),h(" Spinner "),a.loading||e.resolving?y(e.$slots,"spinner",{key:5},(()=>[v("span",{class:p(e.classList.spinner),"aria-hidden":"true"},null,2)])):h("v-if",!0),h(" Clear "),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?y(e.$slots,"clear",{key:6,clear:e.clear},(()=>[v("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:p(e.classList.clear),onClick:t[6]||(t[6]=(...t)=>e.clear&&e.clear(...t)),onKeyup:t[7]||(t[7]=w(((...t)=>e.clear&&e.clear(...t)),["enter"]))},[v("span",{class:p(e.classList.clearIcon)},null,2)],34)])):h("v-if",!0),h(" Caret "),a.caret&&a.showOptions?y(e.$slots,"caret",{key:7,handleCaretClick:e.handleCaretClick,isOpen:e.isOpen},(()=>[v("span",{class:p(e.classList.caret),onClick:t[8]||(t[8]=(...t)=>e.handleCaretClick&&e.handleCaretClick(...t)),"aria-hidden":"true"},null,2)])):h("v-if",!0)],16,Ze),h(" Options "),(c(),x(L,{to:a.appendTo||"body",disabled:!a.appendToBody&&!a.appendTo},[v("div",{id:a.id?`${a.id}-dropdown`:void 0,class:p(e.classList.dropdown),tabindex:"-1",ref:"dropdown",onFocusin:t[10]||(t[10]=(...t)=>e.handleFocusIn&&e.handleFocusIn(...t)),onFocusout:t[11]||(t[11]=(...t)=>e.handleFocusOut&&e.handleFocusOut(...t))},[y(e.$slots,"beforelist",{options:e.fo}),v("ul",{class:p(e.classList.options),id:e.ariaControls,role:"listbox"},[a.groups?(c(!0),d(m,{key:0},b(e.fg,((t,l,n)=>(c(),d("li",{class:p(e.classList.group),key:n,id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),"aria-selected":e.isSelected(t),role:"option"},[t.__CREATE__?h("v-if",!0):(c(),d("div",{key:0,class:p(e.classList.groupLabel(t)),"data-pointed":e.isPointed(t),onMouseenter:a=>e.setPointer(t,l),onClick:a=>e.handleGroupClick(t)},[y(e.$slots,"grouplabel",{group:t,isSelected:e.isSelected,isPointed:e.isPointed},(()=>[v("span",{innerHTML:e.localize(t[a.groupLabel])},null,8,st)]))],42,ut)),v("ul",{class:p(e.classList.groupOptions),"aria-label":e.ariaGroupLabel(e.localize(t[a.groupLabel])),role:"group"},[(c(!0),d(m,null,b(t.__VISIBLE__,((l,n,i)=>(c(),d("li",{class:p(e.classList.option(l,t)),"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,key:i,onMouseenter:t=>e.setPointer(l),onClick:t=>e.handleOptionClick(l),id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[a.label])),role:"option"},[y(e.$slots,"option",{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(l[a.label])),1)]))],42,dt)))),128))],10,ct)],10,ot)))),128)):(c(!0),d(m,{key:1},b(e.fo,((t,l,n)=>(c(),d("li",{class:p(e.classList.option(t)),"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,key:n,onMouseenter:a=>e.setPointer(t),onClick:a=>e.handleOptionClick(t),id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[a.label])),role:"option"},[y(e.$slots,"option",{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search},(()=>[v("span",null,O(e.localize(t[a.label])),1)]))],42,pt)))),128))],10,rt),e.noOptions?y(e.$slots,"nooptions",{key:0},(()=>[v("div",{class:p(e.classList.noOptions),innerHTML:e.localize(a.noOptionsText)},null,10,vt)])):h("v-if",!0),e.noResults?y(e.$slots,"noresults",{key:1},(()=>[v("div",{class:p(e.classList.noResults),innerHTML:e.localize(a.noResultsText)},null,10,ft)])):h("v-if",!0),a.infinite&&e.hasMore?(c(),d("div",{key:2,class:p(e.classList.inifinite),ref:"infiniteLoader"},[y(e.$slots,"infinite",{},(()=>[v("span",{class:p(e.classList.inifiniteSpinner)},null,2)]))],2)):h("v-if",!0),y(e.$slots,"afterlist",{options:e.fo})],42,it)],8,["to","disabled"])),h(" Hacky input element to show HTML5 required warning "),a.required?(c(),d("input",{key:0,class:p(e.classList.fakeInput),tabindex:"-1",value:e.textValue,required:""},null,10,ht)):h("v-if",!0),h(" Native input support "),a.nativeSupport?(c(),d(m,{key:1},["single"==a.mode?(c(),d("input",{key:0,type:"hidden",name:a.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,gt)):(c(!0),d(m,{key:1},b(e.plainValue,((e,t)=>(c(),d("input",{type:"hidden",name:`${a.name}[]`,value:e,key:t},null,8,mt)))),128))],64)):h("v-if",!0),h(" Screen reader assistive text "),a.searchable&&e.hasSelected?(c(),d("div",{key:2,class:p(e.classList.assist),id:e.ariaAssist,"aria-hidden":"true"},O(e.ariaLabel),11,bt)):h("v-if",!0),h(" Create height for empty input "),v("div",{class:p(e.classList.spacer)},null,2)],42,Qe)},Je.__file="src/Multiselect.vue";export{Je as default}; diff --git a/dist/multiselect.mjs b/dist/multiselect.mjs index 9f90005..a4faad4 100644 --- a/dist/multiselect.mjs +++ b/dist/multiselect.mjs @@ -243,6 +243,43 @@ function arraysEqual (array1, array2) { }) } +/* istanbul ignore next */ +const objectsEqual = (obj1, obj2) => { + // If both are strictly equal, return true + if (obj1 === obj2) { + return true + } + + // If either is not an object or is null, return false (handles primitive types and null) + if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) { + return false + } + + // Get the keys of both objects + const keys1 = Object.keys(obj1); + const keys2 = Object.keys(obj2); + + // If they have a different number of keys, they're not equal + if (keys1.length !== keys2.length) { + return false + } + + // Compare each key-value pair recursively + for (let key of keys1) { + // Check if both objects have the same key + if (!keys2.includes(key)) { + return false + } + + // Recursively compare the values + if (!objectsEqual(obj1[key], obj2[key])) { + return false + } + } + + return true +}; + function useOptions (props, context, dep) { const { @@ -563,7 +600,10 @@ function useOptions (props, context, dep) switch (mode.value) { case 'single': - return !isNullish(iv.value) && iv.value[valueProp.value] == option[valueProp.value] + return !isNullish(iv.value) && ( + iv.value[valueProp.value] == option[valueProp.value] || + (typeof iv.value[valueProp.value] === 'object' && typeof option[valueProp.value] === 'object' && objectsEqual(iv.value[valueProp.value], option[valueProp.value])) + ) case 'tags': case 'multiple': diff --git a/dist/multiselect.vue2.global.js b/dist/multiselect.vue2.global.js index e45891d..4b46772 100644 --- a/dist/multiselect.vue2.global.js +++ b/dist/multiselect.vue2.global.js @@ -1 +1 @@ -var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:i,mode:o}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],d=e=>t(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:i,valueProp:o}=e.toRefs(t),u=e.ref("single"!==i.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===i.value?u.value[o.value]:u.value.map((e=>e[o.value])))),d=l((()=>"single"!==i.value?u.value.map((e=>e[o.value])).join(","):u.value[o.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,i=l.isOpen,o=l.open,u=e.ref(null);return e.watch(u,(e=>{!i.value&&e&&o(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function i(t,a,l){const{groupSelect:n,mode:r,groups:i,disabledProp:o}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[o.value]||i.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function o(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}function u(a,n,r){const{options:i,mode:u,trackBy:s,limit:c,hideSelected:d,createTag:p,createOption:v,label:f,appendNewTag:h,appendNewOption:m,multipleLabel:g,object:b,loading:y,delay:w,resolveOnLoad:_,minChars:O,filterResults:x,clearOnSearch:S,clearOnSelect:L,valueProp:T,allowAbsent:k,groupLabel:E,canDeselect:P,max:q,strict:R,closeOnSelect:C,closeOnDeselect:A,groups:B,reverse:D,infinite:I,groupOptions:j,groupHideEmpty:V,groupSelect:M,onCreate:W,disabledProp:$,searchStart:H,searchFilter:N}=e.toRefs(a),F=e.getCurrentInstance().proxy,z=r.iv,U=r.ev,G=r.search,K=r.clearSearch,X=r.update,Y=r.pointer,J=r.setPointer,Q=r.clearPointer,Z=r.focus,ee=r.deactivate,te=r.close,ae=r.localize,le=e.ref([]),ne=e.ref([]),re=e.ref(!1),ie=e.ref(null),oe=e.ref(I.value&&-1===c.value?10:c.value),ue=e.computed({get:()=>ne.value,set:e=>ne.value=e}),se=l((()=>p.value||v.value||!1)),ce=l((()=>void 0!==h.value?h.value:void 0===m.value||m.value)),de=e.computed((()=>{if(B.value){let e=fe.value||[],t=[];return e.forEach((e=>{He(e[j.value]).forEach((a=>{t.push(Object.assign({},a,e[$.value]?{[$.value]:!0}:{}))}))})),t}{let e=He(ne.value||[]);return le.value.length&&(e=e.concat(le.value)),e}})),pe=e.computed((()=>{let e=de.value;return D.value&&(e=e.reverse()),_e.value.length&&(e=_e.value.concat(e)),$e(e)})),ve=e.computed((()=>{let e=pe.value;return oe.value>0&&(e=e.slice(0,oe.value)),e})),fe=e.computed((()=>{if(!B.value)return[];let e=[],t=ne.value||[];return le.value.length&&e.push({[E.value]:" ",[j.value]:[...le.value],__CREATE__:!0}),e.concat(t)})),he=e.computed((()=>{let e=[...fe.value].map((e=>({...e})));return _e.value.length&&(e[0]&&e[0].__CREATE__?e[0][j.value]=[..._e.value,...e[0][j.value]]:e=[{[E.value]:" ",[j.value]:[..._e.value],__CREATE__:!0}].concat(e)),e})),me=e.computed((()=>{if(!B.value)return[];let e=he.value;return We((e||[]).map(((e,t)=>{const a=He(e[j.value]);return{...e,index:t,group:!0,[j.value]:$e(a,!1).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{}))),__VISIBLE__:$e(a).map((t=>Object.assign({},t,e[$.value]?{[$.value]:!0}:{})))}})))})),ge=e.computed((()=>{switch(u.value){case"single":return!t(z.value[T.value]);case"multiple":case"tags":return!t(z.value)&&z.value.length>0}})),be=e.computed((()=>void 0!==g.value?g.value(z.value,F):z.value&&z.value.length>1?`${z.value.length} options selected`:"1 option selected")),ye=l((()=>!de.value.length&&!re.value&&!_e.value.length)),we=l((()=>de.value.length>0&&0==ve.value.length&&(G.value&&B.value||!B.value))),_e=e.computed((()=>!1!==se.value&&G.value?-1!==Ve(G.value)?[]:[{[T.value]:G.value,[Oe.value[0]]:G.value,[f.value]:G.value,__CREATE__:!0}]:[])),Oe=e.computed((()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[f.value])),xe=l((()=>{switch(u.value){case"single":return null;case"multiple":case"tags":return[]}})),Se=l((()=>y.value||re.value)),Le=e=>{switch("object"!=typeof e&&(e=je(e)),u.value){case"single":X(e);break;case"multiple":case"tags":X(z.value.concat(e))}n.emit("select",ke(e),e,F)},Te=e=>{switch("object"!=typeof e&&(e=je(e)),u.value){case"single":Pe();break;case"tags":case"multiple":X(Array.isArray(e)?z.value.filter((t=>-1===e.map((e=>e[T.value])).indexOf(t[T.value]))):z.value.filter((t=>t[T.value]!=e[T.value])))}n.emit("deselect",ke(e),e,F)},ke=e=>b.value?e:e[T.value],Ee=e=>{Te(e)},Pe=()=>{X(xe.value),n.emit("clear",F)},qe=e=>{if(void 0!==e.group)return"single"!==u.value&&(Ie(e[j.value])&&e[j.value].length);switch(u.value){case"single":return!t(z.value)&&z.value[T.value]==e[T.value];case"tags":case"multiple":return!t(z.value)&&-1!==z.value.map((e=>e[T.value])).indexOf(e[T.value])}},Re=e=>!0===e[$.value],Ce=()=>!(void 0===q||-1===q.value||!ge.value&&q.value>0)&&z.value.length>=q.value,Ae=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,u.value){case"single":if(e&&qe(e))return P.value&&Te(e),void(A.value&&(Q(),te()));e&&Be(e),L.value&&K(),C.value&&(Q(),te()),e&&Le(e);break;case"multiple":if(e&&qe(e))return Te(e),void(A.value&&(Q(),te()));if(Ce())return void n.emit("max",F);e&&(Be(e),Le(e)),L.value&&K(),d.value&&Q(),C.value&&te();break;case"tags":if(e&&qe(e))return Te(e),void(A.value&&(Q(),te()));if(Ce())return void n.emit("max",F);e&&Be(e),L.value&&K(),e&&Le(e),d.value&&Q(),C.value&&te()}C.value||Z()},Be=e=>{void 0===je(e[T.value])&&se.value&&(n.emit("tag",e[T.value],F),n.emit("option",e[T.value],F),n.emit("create",e[T.value],F),ce.value&&Me(e),K())},De=e=>void 0===e.find((e=>!qe(e)&&!e[$.value])),Ie=e=>void 0===e.find((e=>!qe(e))),je=e=>de.value[de.value.map((e=>String(e[T.value]))).indexOf(String(e))],Ve=e=>de.value.findIndex((t=>Oe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Me=e=>{le.value.push(e)},We=e=>V.value?e.filter((e=>G.value?e.__VISIBLE__.length:e[j.value].length)):e.filter((e=>!G.value||e.__VISIBLE__.length)),$e=(e,t=!0)=>{let a=e;if(G.value&&x.value){let e=N.value;e||(e=(e,t,a)=>Oe.value.some((a=>{let l=o(ae(e[a]),R.value);return H.value?l.startsWith(o(t,R.value)):-1!==l.indexOf(o(t,R.value))}))),a=a.filter((t=>e(t,G.value,F)))}return d.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(u.value)&&d.value&&qe(e))(e)))),a},He=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[T.value]:e,[Oe.value[0]]:a,[f.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[T.value]:e,[Oe.value[0]]:e,[f.value]:e})),t},Ne=()=>{t(U.value)||(z.value=Ue(U.value))},Fe=e=>(re.value=!0,new Promise(((t,a)=>{i.value(G.value,F).then((t=>{ne.value=t||[],"function"==typeof e&&e(t),re.value=!1})).catch((e=>{console.error(e),ne.value=[],re.value=!1})).finally((()=>{t()}))}))),ze=()=>{if(ge.value)if("single"===u.value){let e=je(z.value[T.value]);if(void 0!==e){let t=e[f.value];z.value[f.value]=t,b.value&&(U.value[f.value]=t)}}else z.value.forEach(((e,t)=>{let a=je(z.value[t][T.value]);if(void 0!==a){let e=a[f.value];z.value[t][f.value]=e,b.value&&(U.value[t][f.value]=e)}}))},Ue=e=>t(e)?"single"===u.value?{}:[]:b.value?e:"single"===u.value?je(e)||(k.value?{[f.value]:e,[T.value]:e,[Oe.value[0]]:e}:{}):e.filter((e=>!!je(e)||k.value)).map((e=>je(e)||{[f.value]:e,[T.value]:e,[Oe.value[0]]:e})),Ge=()=>{ie.value=e.watch(G,(e=>{e.length{e==G.value&&i.value(G.value,F).then((t=>{e!=G.value&&G.value||(ne.value=t,Y.value=ve.value.filter((e=>!0!==e[$.value]))[0]||null,re.value=!1)})).catch((e=>{console.error(e)}))}),w.value))}),{flush:"sync"})};if("single"!==u.value&&!t(U.value)&&!Array.isArray(U.value))throw new Error(`v-model must be an array when using "${u.value}" mode`);return i&&"function"==typeof i.value?_.value?Fe(Ne):1==b.value&&Ne():(ne.value=i.value,Ne()),w.value>-1&&Ge(),e.watch(w,((e,t)=>{ie.value&&ie.value(),e>=0&&Ge()})),e.watch(U,(e=>{if(t(e))X(Ue(e),!1);else switch(u.value){case"single":(b.value?e[T.value]!=z.value[T.value]:e!=z.value[T.value])&&X(Ue(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(b.value?e.map((e=>e[T.value])):e,z.value.map((e=>e[T.value])))||X(Ue(e),!1)}}),{deep:!0}),e.watch(i,((e,t)=>{"function"==typeof a.options?_.value&&(!t||e&&e.toString()!==t.toString())&&Fe():(ne.value=a.options,Object.keys(z.value).length||Ne(),ze())})),e.watch(f,ze),e.watch(c,((e,t)=>{oe.value=I.value&&-1===e?10:e})),{resolvedOptions:ue,pfo:pe,fo:ve,filteredOptions:ve,hasSelected:ge,multipleLabelText:be,eo:de,extendedOptions:de,eg:fe,extendedGroups:fe,fg:me,filteredGroups:me,noOptions:ye,noResults:we,resolving:re,busy:Se,offset:oe,select:Le,deselect:Te,remove:Ee,selectAll:()=>{"single"!==u.value&&Le(ve.value.filter((e=>!e.disabled&&!qe(e))))},clear:Pe,isSelected:qe,isDisabled:Re,isMax:Ce,getOption:je,handleOptionClick:e=>{if(!Re(e))return W.value&&!qe(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=W.value(e,F))instanceof Promise)?(re.value=!0,void e.then((e=>{re.value=!1,Ae(e)}))):void Ae(e)},handleGroupClick:e=>{if(!Re(e)&&"single"!==u.value&&M.value){switch(u.value){case"multiple":case"tags":De(e[j.value])?Te(e[j.value]):Le(e[j.value].filter((e=>-1===z.value.map((e=>e[T.value])).indexOf(e[T.value]))).filter((e=>!e[$.value])).filter(((e,t)=>z.value.length+1+t<=q.value||-1===q.value))),d.value&&Y.value&&J(me.value.filter((e=>!e[$.value]))[Y.value.index])}C.value&&ee()}},handleTagRemove:(e,t)=>{0===t.button?Ee(e):t.preventDefault()},refreshOptions:e=>{Fe(e)},resolveOptions:Fe,refreshLabels:ze}}function s(t,a,n){const{valueProp:r,showOptions:i,searchable:o,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,h=n.fg,m=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,_=n.clearPointer,O=n.multiselect,x=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),L=e.computed((()=>h.value.filter((e=>!e[p.value])))),T=l((()=>"single"!==c.value&&d.value)),k=l((()=>y.value&&y.value.group)),E=e.computed((()=>V(y.value))),P=e.computed((()=>{const e=k.value?y.value:V(y.value),t=L.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=L.value[t-1];return void 0===a&&(a=R.value),a})),q=e.computed((()=>{let e=L.value.map((e=>e.label)).indexOf(k.value?y.value[u.value]:V(y.value)[u.value])+1;return L.value.length<=e&&(e=0),L.value[e]})),R=e.computed((()=>[...L.value].slice(-1)[0])),C=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),A=e.computed((()=>{const e=E.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),B=e.computed((()=>{const e=V(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...P.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),I=e.computed((()=>[...R.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),j=()=>{w(S.value[0]||null)},V=e=>L.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),M=()=>{let e=O.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=k.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{o.value&&(e.length&&i.value?j():_())})),e.watch(x,(t=>{if(t&&O&&O.value){let t=O.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:T,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:j,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(k.value?g(y.value):m(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&T.value?L.value[0].__CREATE__?S.value[0]:L.value[0]:S.value[0])||null);else if(s.value&&T.value){let e=k.value?C.value:B.value;void 0===e&&(e=q.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{M()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&T.value&&(e=I.value,void 0===e&&(e=R.value)),w(e||null)}else if(s.value&&T.value){let e=k.value?D.value:A.value;void 0===e&&(e=k.value?P.value:E.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=P.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{M()}))}}}function c(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function d(e){return e instanceof c(e).Element||e instanceof Element}function p(e){return e instanceof c(e).HTMLElement||e instanceof HTMLElement}function v(e){return"undefined"!=typeof ShadowRoot&&(e instanceof c(e).ShadowRoot||e instanceof ShadowRoot)}var f=Math.max,h=Math.min,m=Math.round;function g(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function b(){return!/^((?!chrome|android).)*safari/i.test(g())}function y(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&p(e)&&(n=e.offsetWidth>0&&m(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&m(l.height)/e.offsetHeight||1);var i=(d(e)?c(e):window).visualViewport,o=!b()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,v=l.width/n,f=l.height/r;return{width:v,height:f,top:s,right:u+v,bottom:s+f,left:u,x:u,y:s}}function w(e){var t=c(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _(e){return e?(e.nodeName||"").toLowerCase():null}function O(e){return((d(e)?e.ownerDocument:e.document)||window.document).documentElement}function x(e){return y(O(e)).left+w(e).scrollLeft}function S(e){return c(e).getComputedStyle(e)}function L(e){var t=S(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function T(e,t,a){void 0===a&&(a=!1);var l,n,r=p(t),i=p(t)&&function(e){var t=e.getBoundingClientRect(),a=m(t.width)/e.offsetWidth||1,l=m(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=O(t),u=y(e,i,a),s={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!a)&&(("body"!==_(t)||L(o))&&(s=(l=t)!==c(l)&&p(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:w(l)),p(t)?((d=y(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):o&&(d.x=x(o))),{x:u.left+s.scrollLeft-d.x,y:u.top+s.scrollTop-d.y,width:u.width,height:u.height}}function k(e){var t=y(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function E(e){return"html"===_(e)?e:e.assignedSlot||e.parentNode||(v(e)?e.host:null)||O(e)}function P(e){return["html","body","#document"].indexOf(_(e))>=0?e.ownerDocument.body:p(e)&&L(e)?e:P(E(e))}function q(e,t){var a;void 0===t&&(t=[]);var l=P(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=c(l),i=n?[r].concat(r.visualViewport||[],L(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(q(E(i)))}function R(e){return["table","td","th"].indexOf(_(e))>=0}function C(e){return p(e)&&"fixed"!==S(e).position?e.offsetParent:null}function A(e){for(var t=c(e),a=C(e);a&&R(a)&&"static"===S(a).position;)a=C(a);return a&&("html"===_(a)||"body"===_(a)&&"static"===S(a).position)?t:a||function(e){var t=/firefox/i.test(g());if(/Trident/i.test(g())&&p(e)&&"fixed"===S(e).position)return null;var a=E(e);for(v(a)&&(a=a.host);p(a)&&["html","body"].indexOf(_(a))<0;){var l=S(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var B="top",D="bottom",I="right",j="left",V="auto",M=[B,D,I,j],W="start",$="end",H="clippingParents",N="viewport",F="popper",z="reference",U=M.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+$])}),[]),G=[].concat(M,[V]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+$])}),[]),K=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function Y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J(e,t,a){return t===N?Y(function(e,t){var a=c(e),l=O(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=b();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+x(e),y:u}}(e,a)):d(t)?function(e,t){var a=y(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):Y(function(e){var t,a=O(e),l=w(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=f(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=f(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+x(e),u=-l.scrollTop;return"rtl"===S(n||a).direction&&(o+=f(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(O(e)))}function Q(e){var t=q(E(e)),a=["absolute","fixed"].indexOf(S(e).position)>=0&&p(e)?A(e):e;return d(a)?t.filter((function(e){return d(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&v(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==_(e)})):[]}function Z(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ae(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?Z(n):null,i=n?ee(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case B:t={x:o,y:a.y-l.height};break;case D:t={x:o,y:a.y+a.height};break;case I:t={x:a.x+a.width,y:u};break;case j:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?te(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case W:t[s]=t[s]-(a[c]/2-l[c]/2);break;case $:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function le(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?H:u,c=l.rootBoundary,p=void 0===c?N:c,v=l.elementContext,m=void 0===v?F:v,g=l.altBoundary,b=void 0!==g&&g,w=l.padding,_=void 0===w?0:w,x=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof _?_:(a=_,M.reduce((function(e,t){return e[t]=a,e}),{}))),S=m===F?z:F,L=e.rects.popper,T=e.elements[b?S:m],k=function(e,t,a,l){var n="clippingParents"===t?Q(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=J(e,a,l);return t.top=f(n.top,t.top),t.right=h(n.right,t.right),t.bottom=h(n.bottom,t.bottom),t.left=f(n.left,t.left),t}),J(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(d(T)?T:T.contextElement||O(e.elements.popper),s,p,o),E=y(e.elements.reference),P=ae({reference:E,element:L,strategy:"absolute",placement:r}),q=Y(Object.assign({},L,P)),R=m===F?q:E,C={top:k.top-R.top+x.top,bottom:R.bottom-k.bottom+x.bottom,left:k.left-R.left+x.left,right:R.right-k.right+x.right},A=e.modifiersData.offset;if(m===F&&A){var j=A[r];Object.keys(C).forEach((function(e){var t=[I,D].indexOf(e)>=0?1:-1,a=[B,D].indexOf(e)>=0?"y":"x";C[e]+=j[a]*t}))}return C}var ne={placement:"bottom",modifiers:[],strategy:"absolute"};function re(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,he,Oe):de(v?_e:ge,he,v?Oe:be);S[x]=xe,R[x]=xe-he}t.modifiersData[l]=R}},requiresIfExists:["offset"]},ve={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ve[e]}))}var he={start:"end",end:"start"};function me(e){return e.replace(/start|end/g,(function(e){return he[e]}))}function ge(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?G:u,c=ee(l),d=c?o?U:U.filter((function(e){return ee(e)===c})):M,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=le(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[Z(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,m=t.options.placement,g=Z(m),b=u||(g===m||!f?[fe(m)]:function(e){if(Z(e)===V)return[];var t=fe(e);return[me(e),t,me(t)]}(m)),y=[m].concat(b).reduce((function(e,a){return e.concat(Z(a)===V?ge(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,_=t.rects.popper,O=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",R=le(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?I:j:E?D:B;w[q]>_[q]&&(C=fe(C));var A=fe(C),M=[];if(r&&M.push(R[k]<=0),o&&M.push(R[C]<=0,R[A]<=0),M.every((function(e){return e}))){S=T,x=!1;break}O.set(T,M)}if(x)for(var $=function(e){var t=y.find((function(t){var a=O.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},H=f?3:1;H>0;H--){if("break"===$(H))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(t,a,n){const{disabled:r,appendTo:i,appendToBody:o,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),h=l((()=>i.value||o.value)),m=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===m.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{h.value&&(v.value=ce(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[pe,be,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{h.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),h.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:m,updatePopper:g}}function we(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,h=e.ref(!1),m=e.ref(!1),g=l((()=>r.value||i.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{i.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:g,isActive:h,mouseClicked:m,blur:b,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(m.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{m.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{m.value=!1}),0)}}}function _e(t,a,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e.toRefs(t),m=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,_=n.setPointer,O=n.selectPointer,x=n.backwardPointer,S=n.forwardPointer,L=n.multiselect,T=n.wrapper,k=n.tags,E=n.isOpen,P=n.open,q=n.blur,R=n.fo,C=l((()=>v.value||f.value||!1)),A=l((()=>void 0!==i.value?i.value:void 0!==p.value?p.value:["enter"])),B=()=>{"tags"===r.value&&!s.value&&C.value&&u.value&&!d.value&&_(R.value[R.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...L.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==k.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?k.value.querySelector("input").focus():T.value.focus()));if(-1===A.value.indexOf("enter")&&C.value)return;B(),O();break;case" ":if(!C.value&&!u.value)return e.preventDefault(),B(),void O();if(!C.value)return!1;if(-1===A.value.indexOf("space")&&C.value)return;e.preventDefault(),B(),O();break;case"Tab":case";":case",":if(-1===A.value.indexOf(e.key.toLowerCase())||!C.value)return;B(),O(),e.preventDefault();break;case"Escape":q();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;E.value||P(),x();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;E.value||P(),S();break;case"ArrowLeft":if(u.value&&k.value&&k.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?k.value.querySelector("input").focus():u.value||T.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,m)},preparePointer:B}}function Oe(t,a,n){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,h=n.resolving,m=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&o.value&&(!h.value||h.value&&m.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function xe(t,a,n){const{limit:r,infinite:i}=e.toRefs(t),o=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},m=()=>{o.value&&u.value{i.value&&m()})),e.watch(s,(()=>{i.value&&(u.value=r.value,m())}),{flush:"post"}),e.watch(d,(()=>{i.value&&m()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(h))})),{hasMore:f,infiniteLoader:v}}function Se(t,a,n){const{placeholder:r,id:i,valueProp:o,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,h=n.hasSelected,m=n.multipleLabelText,g=e.ref(null),b=l((()=>(i.value?i.value+"-":"")+"assist")),y=l((()=>(i.value?i.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=i.value?`${i.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[o.value],e}})),_=l((()=>r.value)),O=l((()=>"single"!==s.value)),x=e.computed((()=>"single"===s.value&&h.value?f.value[u.value]:"multiple"===s.value&&h.value?m.value:"tags"===s.value&&h.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,x.value&&e["aria-label"]&&(e["aria-label"]=`${x.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(i.value&&document&&document.querySelector){let e=document.querySelector(`[for="${i.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:x,ariaAssist:b,ariaControls:y,ariaPlaceholder:_,ariaMultiselectable:O,ariaActiveDescendant:w,ariaOptionId:e=>`${i.value?i.value+"-":""}multiselect-option-${e[o.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${i.value?i.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function Le(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Te(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}function ke(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let d;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):t&&(d=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(c.functional){const e=c.render;c.render=function(t,a){return d.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,d):[d]}return a}const Ee={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Te,Le,n,i,ye,r,a,we,u,xe,s,_e,Oe,Se]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var Pe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};Pe._withStripped=!0;return ke({render:Pe,staticRenderFns:[]},undefined,Ee,undefined,false,undefined,!1,void 0,void 0,void 0)}(Vue); +var VueformMultiselect=function(e){"use strict";function t(e){return null==e}function a(a,l,n){const{object:r,valueProp:i,mode:o}=e.toRefs(a),u=e.getCurrentInstance().proxy,s=n.iv,c=e=>r.value||t(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],d=e=>t(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=c(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function l(t){return e.customRef((()=>({get:t,set:()=>{}})))}function n(t,a){const{value:n,modelValue:r,mode:i,valueProp:o}=e.toRefs(t),u=e.ref("single"!==i.value?[]:{}),s=l((()=>void 0!==r.value?r.value:n.value)),c=e.computed((()=>"single"===i.value?u.value[o.value]:u.value.map((e=>e[o.value])))),d=l((()=>"single"!==i.value?u.value.map((e=>e[o.value])).join(","):u.value[o.value]));return{iv:u,internalValue:u,ev:s,externalValue:s,textValue:d,plainValue:c}}function r(t,a,l){const{regex:n}=e.toRefs(t),r=e.getCurrentInstance().proxy,i=l.isOpen,o=l.open,u=e.ref(null);return e.watch(u,(e=>{!i.value&&e&&o(),a.emit("search-change",e,r)})),{search:u,clearSearch:()=>{u.value=""},handleSearchInput:e=>{u.value=e.target.value},handleKeypress:e=>{if(n.value){let t=n.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(n.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=n.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}a.emit("paste",e,r)}}}function i(t,a,l){const{groupSelect:n,mode:r,groups:i,disabledProp:o}=e.toRefs(t),u=e.ref(null),s=e=>{void 0===e||null!==e&&e[o.value]||i.value&&e&&e.group&&("single"===r.value||!n.value)||(u.value=e)};return{pointer:u,setPointer:s,clearPointer:()=>{s(null)}}}function o(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}const u=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!u(e[n],t[n]))return!1}return!0};function s(a,n,r){const{options:i,mode:s,trackBy:c,limit:d,hideSelected:p,createTag:v,createOption:f,label:h,appendNewTag:m,appendNewOption:g,multipleLabel:b,object:y,loading:w,delay:_,resolveOnLoad:O,minChars:x,filterResults:S,clearOnSearch:L,clearOnSelect:k,valueProp:T,allowAbsent:E,groupLabel:P,canDeselect:q,max:R,strict:C,closeOnSelect:A,closeOnDeselect:B,groups:D,reverse:j,infinite:I,groupOptions:V,groupHideEmpty:M,groupSelect:W,onCreate:$,disabledProp:H,searchStart:N,searchFilter:F}=e.toRefs(a),z=e.getCurrentInstance().proxy,U=r.iv,G=r.ev,K=r.search,X=r.clearSearch,Y=r.update,J=r.pointer,Q=r.setPointer,Z=r.clearPointer,ee=r.focus,te=r.deactivate,ae=r.close,le=r.localize,ne=e.ref([]),re=e.ref([]),ie=e.ref(!1),oe=e.ref(null),ue=e.ref(I.value&&-1===d.value?10:d.value),se=e.computed({get:()=>re.value,set:e=>re.value=e}),ce=l((()=>v.value||f.value||!1)),de=l((()=>void 0!==m.value?m.value:void 0===g.value||g.value)),pe=e.computed((()=>{if(D.value){let e=he.value||[],t=[];return e.forEach((e=>{Ne(e[V.value]).forEach((a=>{t.push(Object.assign({},a,e[H.value]?{[H.value]:!0}:{}))}))})),t}{let e=Ne(re.value||[]);return ne.value.length&&(e=e.concat(ne.value)),e}})),ve=e.computed((()=>{let e=pe.value;return j.value&&(e=e.reverse()),Oe.value.length&&(e=Oe.value.concat(e)),He(e)})),fe=e.computed((()=>{let e=ve.value;return ue.value>0&&(e=e.slice(0,ue.value)),e})),he=e.computed((()=>{if(!D.value)return[];let e=[],t=re.value||[];return ne.value.length&&e.push({[P.value]:" ",[V.value]:[...ne.value],__CREATE__:!0}),e.concat(t)})),me=e.computed((()=>{let e=[...he.value].map((e=>({...e})));return Oe.value.length&&(e[0]&&e[0].__CREATE__?e[0][V.value]=[...Oe.value,...e[0][V.value]]:e=[{[P.value]:" ",[V.value]:[...Oe.value],__CREATE__:!0}].concat(e)),e})),ge=e.computed((()=>{if(!D.value)return[];let e=me.value;return $e((e||[]).map(((e,t)=>{const a=Ne(e[V.value]);return{...e,index:t,group:!0,[V.value]:He(a,!1).map((t=>Object.assign({},t,e[H.value]?{[H.value]:!0}:{}))),__VISIBLE__:He(a).map((t=>Object.assign({},t,e[H.value]?{[H.value]:!0}:{})))}})))})),be=e.computed((()=>{switch(s.value){case"single":return!t(U.value[T.value]);case"multiple":case"tags":return!t(U.value)&&U.value.length>0}})),ye=e.computed((()=>void 0!==b.value?b.value(U.value,z):U.value&&U.value.length>1?`${U.value.length} options selected`:"1 option selected")),we=l((()=>!pe.value.length&&!ie.value&&!Oe.value.length)),_e=l((()=>pe.value.length>0&&0==fe.value.length&&(K.value&&D.value||!D.value))),Oe=e.computed((()=>!1!==ce.value&&K.value?-1!==Me(K.value)?[]:[{[T.value]:K.value,[xe.value[0]]:K.value,[h.value]:K.value,__CREATE__:!0}]:[])),xe=e.computed((()=>c.value?Array.isArray(c.value)?c.value:[c.value]:[h.value])),Se=l((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Le=l((()=>w.value||ie.value)),ke=e=>{switch("object"!=typeof e&&(e=Ve(e)),s.value){case"single":Y(e);break;case"multiple":case"tags":Y(U.value.concat(e))}n.emit("select",Ee(e),e,z)},Te=e=>{switch("object"!=typeof e&&(e=Ve(e)),s.value){case"single":qe();break;case"tags":case"multiple":Y(Array.isArray(e)?U.value.filter((t=>-1===e.map((e=>e[T.value])).indexOf(t[T.value]))):U.value.filter((t=>t[T.value]!=e[T.value])))}n.emit("deselect",Ee(e),e,z)},Ee=e=>y.value?e:e[T.value],Pe=e=>{Te(e)},qe=()=>{Y(Se.value),n.emit("clear",z)},Re=e=>{if(void 0!==e.group)return"single"!==s.value&&(Ie(e[V.value])&&e[V.value].length);switch(s.value){case"single":return!t(U.value)&&(U.value[T.value]==e[T.value]||"object"==typeof U.value[T.value]&&"object"==typeof e[T.value]&&u(U.value[T.value],e[T.value]));case"tags":case"multiple":return!t(U.value)&&-1!==U.value.map((e=>e[T.value])).indexOf(e[T.value])}},Ce=e=>!0===e[H.value],Ae=()=>!(void 0===R||-1===R.value||!be.value&&R.value>0)&&U.value.length>=R.value,Be=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&Re(e))return q.value&&Te(e),void(B.value&&(Z(),ae()));e&&De(e),k.value&&X(),A.value&&(Z(),ae()),e&&ke(e);break;case"multiple":if(e&&Re(e))return Te(e),void(B.value&&(Z(),ae()));if(Ae())return void n.emit("max",z);e&&(De(e),ke(e)),k.value&&X(),p.value&&Z(),A.value&&ae();break;case"tags":if(e&&Re(e))return Te(e),void(B.value&&(Z(),ae()));if(Ae())return void n.emit("max",z);e&&De(e),k.value&&X(),e&&ke(e),p.value&&Z(),A.value&&ae()}A.value||ee()},De=e=>{void 0===Ve(e[T.value])&&ce.value&&(n.emit("tag",e[T.value],z),n.emit("option",e[T.value],z),n.emit("create",e[T.value],z),de.value&&We(e),X())},je=e=>void 0===e.find((e=>!Re(e)&&!e[H.value])),Ie=e=>void 0===e.find((e=>!Re(e))),Ve=e=>pe.value[pe.value.map((e=>String(e[T.value]))).indexOf(String(e))],Me=e=>pe.value.findIndex((t=>xe.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),We=e=>{ne.value.push(e)},$e=e=>M.value?e.filter((e=>K.value?e.__VISIBLE__.length:e[V.value].length)):e.filter((e=>!K.value||e.__VISIBLE__.length)),He=(e,t=!0)=>{let a=e;if(K.value&&S.value){let e=F.value;e||(e=(e,t,a)=>xe.value.some((a=>{let l=o(le(e[a]),C.value);return N.value?l.startsWith(o(t,C.value)):-1!==l.indexOf(o(t,C.value))}))),a=a.filter((t=>e(t,K.value,z)))}return p.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&p.value&&Re(e))(e)))),a},Ne=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[T.value]:e,[xe.value[0]]:a,[h.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[T.value]:e,[xe.value[0]]:e,[h.value]:e})),t},Fe=()=>{t(G.value)||(U.value=Ge(G.value))},ze=e=>(ie.value=!0,new Promise(((t,a)=>{i.value(K.value,z).then((t=>{re.value=t||[],"function"==typeof e&&e(t),ie.value=!1})).catch((e=>{console.error(e),re.value=[],ie.value=!1})).finally((()=>{t()}))}))),Ue=()=>{if(be.value)if("single"===s.value){let e=Ve(U.value[T.value]);if(void 0!==e){let t=e[h.value];U.value[h.value]=t,y.value&&(G.value[h.value]=t)}}else U.value.forEach(((e,t)=>{let a=Ve(U.value[t][T.value]);if(void 0!==a){let e=a[h.value];U.value[t][h.value]=e,y.value&&(G.value[t][h.value]=e)}}))},Ge=e=>t(e)?"single"===s.value?{}:[]:y.value?e:"single"===s.value?Ve(e)||(E.value?{[h.value]:e,[T.value]:e,[xe.value[0]]:e}:{}):e.filter((e=>!!Ve(e)||E.value)).map((e=>Ve(e)||{[h.value]:e,[T.value]:e,[xe.value[0]]:e})),Ke=()=>{oe.value=e.watch(K,(e=>{e.length{e==K.value&&i.value(K.value,z).then((t=>{e!=K.value&&K.value||(re.value=t,J.value=fe.value.filter((e=>!0!==e[H.value]))[0]||null,ie.value=!1)})).catch((e=>{console.error(e)}))}),_.value))}),{flush:"sync"})};if("single"!==s.value&&!t(G.value)&&!Array.isArray(G.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return i&&"function"==typeof i.value?O.value?ze(Fe):1==y.value&&Fe():(re.value=i.value,Fe()),_.value>-1&&Ke(),e.watch(_,((e,t)=>{oe.value&&oe.value(),e>=0&&Ke()})),e.watch(G,(e=>{if(t(e))Y(Ge(e),!1);else switch(s.value){case"single":(y.value?e[T.value]!=U.value[T.value]:e!=U.value[T.value])&&Y(Ge(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(y.value?e.map((e=>e[T.value])):e,U.value.map((e=>e[T.value])))||Y(Ge(e),!1)}}),{deep:!0}),e.watch(i,((e,t)=>{"function"==typeof a.options?O.value&&(!t||e&&e.toString()!==t.toString())&&ze():(re.value=a.options,Object.keys(U.value).length||Fe(),Ue())})),e.watch(h,Ue),e.watch(d,((e,t)=>{ue.value=I.value&&-1===e?10:e})),{resolvedOptions:se,pfo:ve,fo:fe,filteredOptions:fe,hasSelected:be,multipleLabelText:ye,eo:pe,extendedOptions:pe,eg:he,extendedGroups:he,fg:ge,filteredGroups:ge,noOptions:we,noResults:_e,resolving:ie,busy:Le,offset:ue,select:ke,deselect:Te,remove:Pe,selectAll:()=>{"single"!==s.value&&ke(fe.value.filter((e=>!e.disabled&&!Re(e))))},clear:qe,isSelected:Re,isDisabled:Ce,isMax:Ae,getOption:Ve,handleOptionClick:e=>{if(!Ce(e))return $.value&&!Re(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=$.value(e,z))instanceof Promise)?(ie.value=!0,void e.then((e=>{ie.value=!1,Be(e)}))):void Be(e)},handleGroupClick:e=>{if(!Ce(e)&&"single"!==s.value&&W.value){switch(s.value){case"multiple":case"tags":je(e[V.value])?Te(e[V.value]):ke(e[V.value].filter((e=>-1===U.value.map((e=>e[T.value])).indexOf(e[T.value]))).filter((e=>!e[H.value])).filter(((e,t)=>U.value.length+1+t<=R.value||-1===R.value))),p.value&&J.value&&Q(ge.value.filter((e=>!e[H.value]))[J.value.index])}A.value&&te()}},handleTagRemove:(e,t)=>{0===t.button?Pe(e):t.preventDefault()},refreshOptions:e=>{ze(e)},resolveOptions:ze,refreshLabels:Ue}}function c(t,a,n){const{valueProp:r,showOptions:i,searchable:o,groupLabel:u,groups:s,mode:c,groupSelect:d,disabledProp:p,groupOptions:v}=e.toRefs(t),f=n.fo,h=n.fg,m=n.handleOptionClick,g=n.handleGroupClick,b=n.search,y=n.pointer,w=n.setPointer,_=n.clearPointer,O=n.multiselect,x=n.isOpen,S=e.computed((()=>f.value.filter((e=>!e[p.value])))),L=e.computed((()=>h.value.filter((e=>!e[p.value])))),k=l((()=>"single"!==c.value&&d.value)),T=l((()=>y.value&&y.value.group)),E=e.computed((()=>V(y.value))),P=e.computed((()=>{const e=T.value?y.value:V(y.value),t=L.value.map((e=>e[u.value])).indexOf(e[u.value]);let a=L.value[t-1];return void 0===a&&(a=R.value),a})),q=e.computed((()=>{let e=L.value.map((e=>e.label)).indexOf(T.value?y.value[u.value]:V(y.value)[u.value])+1;return L.value.length<=e&&(e=0),L.value[e]})),R=e.computed((()=>[...L.value].slice(-1)[0])),C=e.computed((()=>y.value.__VISIBLE__.filter((e=>!e[p.value]))[0])),A=e.computed((()=>{const e=E.value.__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])-1]})),B=e.computed((()=>{const e=V(y.value).__VISIBLE__.filter((e=>!e[p.value]));return e[e.map((e=>e[r.value])).indexOf(y.value[r.value])+1]})),D=e.computed((()=>[...P.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),j=e.computed((()=>[...R.value.__VISIBLE__.filter((e=>!e[p.value]))].slice(-1)[0])),I=()=>{w(S.value[0]||null)},V=e=>L.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[r.value])).indexOf(e[r.value]))),M=()=>{let e=O.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;s.value&&(t=T.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{o.value&&(e.length&&i.value?I():_())})),e.watch(x,(t=>{if(t&&O&&O.value){let t=O.value.querySelectorAll("[data-selected]")[0];if(!t)return;let a=t.parentElement.parentElement;e.nextTick((()=>{a.scrollTop=t.offsetTop}))}})),{pointer:y,canPointGroups:k,isPointed:e=>!(!y.value||!(!e.group&&y.value[r.value]===e[r.value]||void 0!==e.group&&y.value[u.value]===e[u.value]))||void 0,setPointerFirst:I,selectPointer:()=>{y.value&&!0!==y.value[p.value]&&(T.value?g(y.value):m(y.value))},forwardPointer:()=>{if(null===y.value)w((s.value&&k.value?L.value[0].__CREATE__?S.value[0]:L.value[0]:S.value[0])||null);else if(s.value&&k.value){let e=T.value?C.value:B.value;void 0===e&&(e=q.value,e.__CREATE__&&(e=e[v.value][0])),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])+1;S.value.length<=e&&(e=0),w(S.value[e]||null)}e.nextTick((()=>{M()}))},backwardPointer:()=>{if(null===y.value){let e=S.value[S.value.length-1];s.value&&k.value&&(e=j.value,void 0===e&&(e=R.value)),w(e||null)}else if(s.value&&k.value){let e=T.value?D.value:A.value;void 0===e&&(e=T.value?P.value:E.value,e.__CREATE__&&(e=D.value,void 0===e&&(e=P.value))),w(e||null)}else{let e=S.value.map((e=>e[r.value])).indexOf(y.value[r.value])-1;e<0&&(e=S.value.length-1),w(S.value[e]||null)}e.nextTick((()=>{M()}))}}}function d(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function p(e){return e instanceof d(e).Element||e instanceof Element}function v(e){return e instanceof d(e).HTMLElement||e instanceof HTMLElement}function f(e){return"undefined"!=typeof ShadowRoot&&(e instanceof d(e).ShadowRoot||e instanceof ShadowRoot)}var h=Math.max,m=Math.min,g=Math.round;function b(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function y(){return!/^((?!chrome|android).)*safari/i.test(b())}function w(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&v(e)&&(n=e.offsetWidth>0&&g(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&g(l.height)/e.offsetHeight||1);var i=(p(e)?d(e):window).visualViewport,o=!y()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,f=l.height/r;return{width:c,height:f,top:s,right:u+c,bottom:s+f,left:u,x:u,y:s}}function _(e){var t=d(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function O(e){return e?(e.nodeName||"").toLowerCase():null}function x(e){return((p(e)?e.ownerDocument:e.document)||window.document).documentElement}function S(e){return w(x(e)).left+_(e).scrollLeft}function L(e){return d(e).getComputedStyle(e)}function k(e){var t=L(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function T(e,t,a){void 0===a&&(a=!1);var l,n,r=v(t),i=v(t)&&function(e){var t=e.getBoundingClientRect(),a=g(t.width)/e.offsetWidth||1,l=g(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=x(t),u=w(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==O(t)||k(o))&&(s=(l=t)!==d(l)&&v(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:_(l)),v(t)?((c=w(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=S(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function E(e){var t=w(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function P(e){return"html"===O(e)?e:e.assignedSlot||e.parentNode||(f(e)?e.host:null)||x(e)}function q(e){return["html","body","#document"].indexOf(O(e))>=0?e.ownerDocument.body:v(e)&&k(e)?e:q(P(e))}function R(e,t){var a;void 0===t&&(t=[]);var l=q(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=d(l),i=n?[r].concat(r.visualViewport||[],k(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(R(P(i)))}function C(e){return["table","td","th"].indexOf(O(e))>=0}function A(e){return v(e)&&"fixed"!==L(e).position?e.offsetParent:null}function B(e){for(var t=d(e),a=A(e);a&&C(a)&&"static"===L(a).position;)a=A(a);return a&&("html"===O(a)||"body"===O(a)&&"static"===L(a).position)?t:a||function(e){var t=/firefox/i.test(b());if(/Trident/i.test(b())&&v(e)&&"fixed"===L(e).position)return null;var a=P(e);for(f(a)&&(a=a.host);v(a)&&["html","body"].indexOf(O(a))<0;){var l=L(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var D="top",j="bottom",I="right",V="left",M="auto",W=[D,j,I,V],$="start",H="end",N="clippingParents",F="viewport",z="popper",U="reference",G=W.reduce((function(e,t){return e.concat([t+"-"+$,t+"-"+H])}),[]),K=[].concat(W,[M]).reduce((function(e,t){return e.concat([t,t+"-"+$,t+"-"+H])}),[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function J(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Q(e,t,a){return t===F?J(function(e,t){var a=d(e),l=x(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=y();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+S(e),y:u}}(e,a)):p(t)?function(e,t){var a=w(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):J(function(e){var t,a=x(e),l=_(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=h(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=h(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+S(e),u=-l.scrollTop;return"rtl"===L(n||a).direction&&(o+=h(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(x(e)))}function Z(e){var t=R(P(e)),a=["absolute","fixed"].indexOf(L(e).position)>=0&&v(e)?B(e):e;return p(a)?t.filter((function(e){return p(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&f(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==O(e)})):[]}function ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function ae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function le(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ee(n):null,i=n?te(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case D:t={x:o,y:a.y-l.height};break;case j:t={x:o,y:a.y+a.height};break;case I:t={x:a.x+a.width,y:u};break;case V:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ae(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case $:t[s]=t[s]-(a[c]/2-l[c]/2);break;case H:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function ne(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?N:u,c=l.rootBoundary,d=void 0===c?F:c,v=l.elementContext,f=void 0===v?z:v,g=l.altBoundary,b=void 0!==g&&g,y=l.padding,_=void 0===y?0:y,O=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof _?_:(a=_,W.reduce((function(e,t){return e[t]=a,e}),{}))),S=f===z?U:z,L=e.rects.popper,k=e.elements[b?S:f],T=function(e,t,a,l){var n="clippingParents"===t?Z(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=Q(e,a,l);return t.top=h(n.top,t.top),t.right=m(n.right,t.right),t.bottom=m(n.bottom,t.bottom),t.left=h(n.left,t.left),t}),Q(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(p(k)?k:k.contextElement||x(e.elements.popper),s,d,o),E=w(e.elements.reference),P=le({reference:E,element:L,strategy:"absolute",placement:r}),q=J(Object.assign({},L,P)),R=f===z?q:E,C={top:T.top-R.top+O.top,bottom:R.bottom-T.bottom+O.bottom,left:T.left-R.left+O.left,right:R.right-T.right+O.right},A=e.modifiersData.offset;if(f===z&&A){var B=A[r];Object.keys(C).forEach((function(e){var t=[I,j].indexOf(e)>=0?1:-1,a=[D,j].indexOf(e)>=0?"y":"x";C[e]+=B[a]*t}))}return C}var re={placement:"bottom",modifiers:[],strategy:"absolute"};function ie(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,he,Oe):pe(v?_e:ge,he,v?Oe:be);S[x]=xe,R[x]=xe-he}t.modifiersData[l]=R}},requiresIfExists:["offset"]},fe={left:"right",right:"left",bottom:"top",top:"bottom"};function he(e){return e.replace(/left|right|bottom|top/g,(function(e){return fe[e]}))}var me={start:"end",end:"start"};function ge(e){return e.replace(/start|end/g,(function(e){return me[e]}))}function be(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?K:u,c=te(l),d=c?o?G:G.filter((function(e){return te(e)===c})):W,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=ne(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[ee(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ye={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,m=t.options.placement,g=ee(m),b=u||(g===m||!f?[he(m)]:function(e){if(ee(e)===M)return[];var t=he(e);return[ge(e),t,ge(t)]}(m)),y=[m].concat(b).reduce((function(e,a){return e.concat(ee(a)===M?be(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),w=t.rects.reference,_=t.rects.popper,O=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",R=ne(t,{placement:k,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?I:V:E?j:D;w[q]>_[q]&&(C=he(C));var A=he(C),B=[];if(r&&B.push(R[T]<=0),o&&B.push(R[C]<=0,R[A]<=0),B.every((function(e){return e}))){S=k,x=!1;break}O.set(k,B)}if(x)for(var W=function(e){var t=y.find((function(t){var a=O.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},H=f?3:1;H>0;H--){if("break"===W(H))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(t,a,n){const{disabled:r,appendTo:i,appendToBody:o,openDirection:u}=e.toRefs(t),s=e.getCurrentInstance().proxy,c=n.multiselect,d=n.dropdown,p=e.ref(!1),v=e.ref(null),f=e.ref(null),h=l((()=>i.value||o.value)),m=l((()=>"top"===u.value&&"bottom"===f.value||"bottom"===u.value&&"top"!==f.value?"bottom":"top")),g=()=>{if(!v.value)return;let e=parseInt(window.getComputedStyle(d.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(d.value).borderBottomWidth.replace("px",""));v.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===m.value?e:t)]}}]}))),v.value.update()},b=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return e.onMounted((()=>{h.value&&(v.value=de(c.value,d.value,{strategy:b(c.value)?"fixed":void 0,placement:u.value,modifiers:[ve,ye,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){f.value=e.placement}}]}))})),e.onBeforeUnmount((()=>{h.value&&v.value&&(v.value.destroy(),v.value=null)})),{popper:v,isOpen:p,open:()=>{p.value||r.value||(p.value=!0,a.emit("open",s),h.value&&e.nextTick((()=>{g()})))},close:()=>{p.value&&(p.value=!1,a.emit("close",s))},placement:m,updatePopper:g}}function _e(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e.toRefs(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,p=n.isOpen,v=n.wrapper,f=n.tags,h=e.ref(!1),m=e.ref(!1),g=l((()=>r.value||i.value?-1:0)),b=()=>{r.value&&u.value.blur(),v.value.blur()},y=(e=!0)=>{i.value||(h.value=!0,e&&s())},w=()=>{h.value=!1,setTimeout((()=>{h.value||(c(),o.value&&d())}),1)};return{tabindex:g,isActive:h,mouseClicked:m,blur:b,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:y,deactivate:w,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||y(m.value)},handleFocusOut:()=>{w()},handleCaretClick:()=>{w(),b()},handleMousedown:e=>{m.value=!0,p.value&&(e.target.isEqualNode(v.value)||e.target.isEqualNode(f.value))?setTimeout((()=>{w()}),0):p.value||!document.activeElement.isEqualNode(v.value)&&!document.activeElement.isEqualNode(u.value)||y(),setTimeout((()=>{m.value=!1}),0)}}}function Oe(t,a,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:p,createTag:v,createOption:f,reverse:h}=e.toRefs(t),m=e.getCurrentInstance().proxy,g=n.iv,b=n.update,y=n.deselect,w=n.search,_=n.setPointer,O=n.selectPointer,x=n.backwardPointer,S=n.forwardPointer,L=n.multiselect,k=n.wrapper,T=n.tags,E=n.isOpen,P=n.open,q=n.blur,R=n.fo,C=l((()=>v.value||f.value||!1)),A=l((()=>void 0!==i.value?i.value:void 0!==p.value?p.value:["enter"])),B=()=>{"tags"===r.value&&!s.value&&C.value&&u.value&&!d.value&&_(R.value[R.value.map((e=>e[c.value])).indexOf(w.value)])};return{handleKeydown:e=>{let t,l;switch(a.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...L.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==T.value)),l=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(w.value))return;if(0===g.value.length)return;let a=g.value.filter((e=>!e.disabled&&!1!==e.remove));a.length&&y(a[a.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==l&&void 0!==l)return b([...g.value].filter(((e,t)=>t!==l))),void(l===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?T.value.querySelector("input").focus():k.value.focus()));if(-1===A.value.indexOf("enter")&&C.value)return;B(),O();break;case" ":if(!C.value&&!u.value)return e.preventDefault(),B(),void O();if(!C.value)return!1;if(-1===A.value.indexOf("space")&&C.value)return;e.preventDefault(),B(),O();break;case"Tab":case";":case",":if(-1===A.value.indexOf(e.key.toLowerCase())||!C.value)return;B(),O(),e.preventDefault();break;case"Escape":q();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;E.value||P(),x();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;E.value||P(),S();break;case"ArrowLeft":if(u.value&&T.value&&T.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),-1===l?t[t.length-1].focus():l>0&&t[l-1].focus();break;case"ArrowRight":if(-1===l||e.shiftKey||"tags"!==r.value||!g.value||!g.value.length)return;e.preventDefault(),t.length>l+1?t[l+1].focus():u.value?T.value.querySelector("input").focus():u.value||k.value.focus()}},handleKeyup:e=>{a.emit("keyup",e,m)},preparePointer:B}}function xe(t,a,n){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e.toRefs(t),s=n.isOpen,c=n.isPointed,d=n.isSelected,p=n.isDisabled,v=n.isActive,f=n.canPointGroups,h=n.resolving,m=n.fo,g=n.placement,b=l((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),y=l((()=>!!(s.value&&o.value&&(!h.value||h.value&&m.value.length))));return{classList:e.computed((()=>{const e=b.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(y.value&&"top"===g.value?e.containerOpenTop:[]).concat(y.value&&"top"!==g.value?e.containerOpen:[]).concat(v.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===g.value?e.dropdownTop:[]).concat(s.value&&o.value&&y.value?[]:e.dropdownHidden),options:[e.options].concat("top"===g.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&f.value?a.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&a.push(e.groupLabelDisabled),f.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||a&&p(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:y}}function Se(t,a,n){const{limit:r,infinite:i}=e.toRefs(t),o=n.isOpen,u=n.offset,s=n.search,c=n.pfo,d=n.eo,p=e.ref(null),v=e.shallowRef(null),f=l((()=>u.value{const{isIntersecting:a,target:l}=t[0];if(a){const t=l.offsetParent,a=t.scrollTop;u.value+=-1==r.value?10:r.value,e.nextTick((()=>{t.scrollTop=a}))}},m=()=>{o.value&&u.value{i.value&&m()})),e.watch(s,(()=>{i.value&&(u.value=r.value,m())}),{flush:"post"}),e.watch(d,(()=>{i.value&&m()}),{immediate:!1,flush:"post"}),e.onMounted((()=>{window&&window.IntersectionObserver&&(p.value=new IntersectionObserver(h))})),{hasMore:f,infiniteLoader:v}}function Le(t,a,n){const{placeholder:r,id:i,valueProp:o,label:u,mode:s,groupLabel:c,aria:d,searchable:p}=e.toRefs(t),v=n.pointer,f=n.iv,h=n.hasSelected,m=n.multipleLabelText,g=e.ref(null),b=l((()=>(i.value?i.value+"-":"")+"assist")),y=l((()=>(i.value?i.value+"-":"")+"multiselect-options")),w=l((()=>{if(v.value){let e=i.value?`${i.value}-`:"";return e+=(v.value.group?"multiselect-group":"multiselect-option")+"-",e+=v.value.group?v.value.index:v.value[o.value],e}})),_=l((()=>r.value)),O=l((()=>"single"!==s.value)),x=e.computed((()=>"single"===s.value&&h.value?f.value[u.value]:"multiple"===s.value&&h.value?m.value:"tags"===s.value&&h.value?f.value.map((e=>e[u.value])).join(", "):"")),S=e.computed((()=>{let e={...d.value};return p.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${b.value} ${e["aria-labelledby"]}`:b.value,x.value&&e["aria-label"]&&(e["aria-label"]=`${x.value}, ${e["aria-label"]}`)),e}));return e.onMounted((()=>{if(i.value&&document&&document.querySelector){let e=document.querySelector(`[for="${i.value}"]`);g.value=e?e.innerText:null}})),{arias:S,ariaLabel:x,ariaAssist:b,ariaControls:y,ariaPlaceholder:_,ariaMultiselectable:O,ariaActiveDescendant:w,ariaOptionId:e=>`${i.value?i.value+"-":""}multiselect-option-${e[o.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${i.value?i.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function ke(t,a,l){const{locale:n,fallbackLocale:r}=e.toRefs(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Te(t,a,l){return{multiselect:e.shallowRef(null),wrapper:e.shallowRef(null),tags:e.shallowRef(null),input:e.shallowRef(null),dropdown:e.shallowRef(null)}}function Ee(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let d;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):t&&(d=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(c.functional){const e=c.render;c.render=function(t,a){return d.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,d):[d]}return a}const Pe={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Te,ke,n,i,we,r,a,_e,s,Se,c,Oe,xe,Le]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var qe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};qe._withStripped=!0;return Ee({render:qe,staticRenderFns:[]},undefined,Pe,undefined,false,undefined,!1,void 0,void 0,void 0)}(Vue); diff --git a/dist/multiselect.vue2.js b/dist/multiselect.vue2.js index 2e1fea5..3fece9d 100644 --- a/dist/multiselect.vue2.js +++ b/dist/multiselect.vue2.js @@ -243,6 +243,43 @@ function arraysEqual (array1, array2) { }) } +/* istanbul ignore next */ +const objectsEqual = (obj1, obj2) => { + // If both are strictly equal, return true + if (obj1 === obj2) { + return true + } + + // If either is not an object or is null, return false (handles primitive types and null) + if (typeof obj1 !== 'object' || obj1 === null || typeof obj2 !== 'object' || obj2 === null) { + return false + } + + // Get the keys of both objects + const keys1 = Object.keys(obj1); + const keys2 = Object.keys(obj2); + + // If they have a different number of keys, they're not equal + if (keys1.length !== keys2.length) { + return false + } + + // Compare each key-value pair recursively + for (let key of keys1) { + // Check if both objects have the same key + if (!keys2.includes(key)) { + return false + } + + // Recursively compare the values + if (!objectsEqual(obj1[key], obj2[key])) { + return false + } + } + + return true +}; + function useOptions (props, context, dep) { const { @@ -563,7 +600,10 @@ function useOptions (props, context, dep) switch (mode.value) { case 'single': - return !isNullish(iv.value) && iv.value[valueProp.value] == option[valueProp.value] + return !isNullish(iv.value) && ( + iv.value[valueProp.value] == option[valueProp.value] || + (typeof iv.value[valueProp.value] === 'object' && typeof option[valueProp.value] === 'object' && objectsEqual(iv.value[valueProp.value], option[valueProp.value])) + ) case 'tags': case 'multiple': diff --git a/dist/multiselect.vue2.min.js b/dist/multiselect.vue2.min.js index ea2fa9a..610a366 100644 --- a/dist/multiselect.vue2.min.js +++ b/dist/multiselect.vue2.min.js @@ -1 +1 @@ -import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as n,watch as r,nextTick as i,onMounted as o,onBeforeUnmount as u,shallowRef as s}from"vue";function c(e){return null==e}function d(a,l,n){const{object:r,valueProp:i,mode:o}=e(a),u=t().proxy,s=n.iv,d=e=>r.value||c(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],p=e=>c(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=p(e);const a=d(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function p(e){return a((()=>({get:e,set:()=>{}})))}function v(t,a){const{value:r,modelValue:i,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=p((()=>void 0!==i.value?i.value:r.value)),d=n((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),v=p((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:v,plainValue:d}}function f(a,n,i){const{regex:o}=e(a),u=t().proxy,s=i.isOpen,c=i.open,d=l(null);return r(d,(e=>{!s.value&&e&&c(),n.emit("search-change",e,u)})),{search:d,clearSearch:()=>{d.value=""},handleSearchInput:e=>{d.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}n.emit("paste",e,u)}}}function h(t,a,n){const{groupSelect:r,mode:i,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function g(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}function m(a,i,o){const{options:u,mode:s,trackBy:d,limit:v,hideSelected:f,createTag:h,createOption:m,label:b,appendNewTag:y,appendNewOption:_,multipleLabel:O,object:w,loading:x,delay:S,resolveOnLoad:L,minChars:T,filterResults:k,clearOnSearch:E,clearOnSelect:P,valueProp:q,allowAbsent:A,groupLabel:C,canDeselect:B,max:D,strict:j,closeOnSelect:R,closeOnDeselect:I,groups:V,reverse:M,infinite:W,groupOptions:$,groupHideEmpty:H,groupSelect:N,onCreate:F,disabledProp:z,searchStart:G,searchFilter:U}=e(a),K=t().proxy,X=o.iv,Y=o.ev,J=o.search,Q=o.clearSearch,Z=o.update,ee=o.pointer,te=o.setPointer,ae=o.clearPointer,le=o.focus,ne=o.deactivate,re=o.close,ie=o.localize,oe=l([]),ue=l([]),se=l(!1),ce=l(null),de=l(W.value&&-1===v.value?10:v.value),pe=n({get:()=>ue.value,set:e=>ue.value=e}),ve=p((()=>h.value||m.value||!1)),fe=p((()=>void 0!==y.value?y.value:void 0===_.value||_.value)),he=n((()=>{if(V.value){let e=be.value||[],t=[];return e.forEach((e=>{Ge(e[$.value]).forEach((a=>{t.push(Object.assign({},a,e[z.value]?{[z.value]:!0}:{}))}))})),t}{let e=Ge(ue.value||[]);return oe.value.length&&(e=e.concat(oe.value)),e}})),ge=n((()=>{let e=he.value;return M.value&&(e=e.reverse()),Le.value.length&&(e=Le.value.concat(e)),ze(e)})),me=n((()=>{let e=ge.value;return de.value>0&&(e=e.slice(0,de.value)),e})),be=n((()=>{if(!V.value)return[];let e=[],t=ue.value||[];return oe.value.length&&e.push({[C.value]:" ",[$.value]:[...oe.value],__CREATE__:!0}),e.concat(t)})),ye=n((()=>{let e=[...be.value].map((e=>({...e})));return Le.value.length&&(e[0]&&e[0].__CREATE__?e[0][$.value]=[...Le.value,...e[0][$.value]]:e=[{[C.value]:" ",[$.value]:[...Le.value],__CREATE__:!0}].concat(e)),e})),_e=n((()=>{if(!V.value)return[];let e=ye.value;return Fe((e||[]).map(((e,t)=>{const a=Ge(e[$.value]);return{...e,index:t,group:!0,[$.value]:ze(a,!1).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{}))),__VISIBLE__:ze(a).map((t=>Object.assign({},t,e[z.value]?{[z.value]:!0}:{})))}})))})),Oe=n((()=>{switch(s.value){case"single":return!c(X.value[q.value]);case"multiple":case"tags":return!c(X.value)&&X.value.length>0}})),we=n((()=>void 0!==O.value?O.value(X.value,K):X.value&&X.value.length>1?`${X.value.length} options selected`:"1 option selected")),xe=p((()=>!he.value.length&&!se.value&&!Le.value.length)),Se=p((()=>he.value.length>0&&0==me.value.length&&(J.value&&V.value||!V.value))),Le=n((()=>!1!==ve.value&&J.value?-1!==He(J.value)?[]:[{[q.value]:J.value,[Te.value[0]]:J.value,[b.value]:J.value,__CREATE__:!0}]:[])),Te=n((()=>d.value?Array.isArray(d.value)?d.value:[d.value]:[b.value])),ke=p((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Ee=p((()=>x.value||se.value)),Pe=e=>{switch("object"!=typeof e&&(e=$e(e)),s.value){case"single":Z(e);break;case"multiple":case"tags":Z(X.value.concat(e))}i.emit("select",Ae(e),e,K)},qe=e=>{switch("object"!=typeof e&&(e=$e(e)),s.value){case"single":Be();break;case"tags":case"multiple":Z(Array.isArray(e)?X.value.filter((t=>-1===e.map((e=>e[q.value])).indexOf(t[q.value]))):X.value.filter((t=>t[q.value]!=e[q.value])))}i.emit("deselect",Ae(e),e,K)},Ae=e=>w.value?e:e[q.value],Ce=e=>{qe(e)},Be=()=>{Z(ke.value),i.emit("clear",K)},De=e=>{if(void 0!==e.group)return"single"!==s.value&&(We(e[$.value])&&e[$.value].length);switch(s.value){case"single":return!c(X.value)&&X.value[q.value]==e[q.value];case"tags":case"multiple":return!c(X.value)&&-1!==X.value.map((e=>e[q.value])).indexOf(e[q.value])}},je=e=>!0===e[z.value],Re=()=>!(void 0===D||-1===D.value||!Oe.value&&D.value>0)&&X.value.length>=D.value,Ie=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&De(e))return B.value&&qe(e),void(I.value&&(ae(),re()));e&&Ve(e),P.value&&Q(),R.value&&(ae(),re()),e&&Pe(e);break;case"multiple":if(e&&De(e))return qe(e),void(I.value&&(ae(),re()));if(Re())return void i.emit("max",K);e&&(Ve(e),Pe(e)),P.value&&Q(),f.value&&ae(),R.value&&re();break;case"tags":if(e&&De(e))return qe(e),void(I.value&&(ae(),re()));if(Re())return void i.emit("max",K);e&&Ve(e),P.value&&Q(),e&&Pe(e),f.value&&ae(),R.value&&re()}R.value||le()},Ve=e=>{void 0===$e(e[q.value])&&ve.value&&(i.emit("tag",e[q.value],K),i.emit("option",e[q.value],K),i.emit("create",e[q.value],K),fe.value&&Ne(e),Q())},Me=e=>void 0===e.find((e=>!De(e)&&!e[z.value])),We=e=>void 0===e.find((e=>!De(e))),$e=e=>he.value[he.value.map((e=>String(e[q.value]))).indexOf(String(e))],He=e=>he.value.findIndex((t=>Te.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Ne=e=>{oe.value.push(e)},Fe=e=>H.value?e.filter((e=>J.value?e.__VISIBLE__.length:e[$.value].length)):e.filter((e=>!J.value||e.__VISIBLE__.length)),ze=(e,t=!0)=>{let a=e;if(J.value&&k.value){let e=U.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=g(ie(e[a]),j.value);return G.value?l.startsWith(g(t,j.value)):-1!==l.indexOf(g(t,j.value))}))),a=a.filter((t=>e(t,J.value,K)))}return f.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&f.value&&De(e))(e)))),a},Ge=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[q.value]:e,[Te.value[0]]:a,[b.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[q.value]:e,[Te.value[0]]:e,[b.value]:e})),t},Ue=()=>{c(Y.value)||(X.value=Ye(Y.value))},Ke=e=>(se.value=!0,new Promise(((t,a)=>{u.value(J.value,K).then((t=>{ue.value=t||[],"function"==typeof e&&e(t),se.value=!1})).catch((e=>{console.error(e),ue.value=[],se.value=!1})).finally((()=>{t()}))}))),Xe=()=>{if(Oe.value)if("single"===s.value){let e=$e(X.value[q.value]);if(void 0!==e){let t=e[b.value];X.value[b.value]=t,w.value&&(Y.value[b.value]=t)}}else X.value.forEach(((e,t)=>{let a=$e(X.value[t][q.value]);if(void 0!==a){let e=a[b.value];X.value[t][b.value]=e,w.value&&(Y.value[t][b.value]=e)}}))},Ye=e=>c(e)?"single"===s.value?{}:[]:w.value?e:"single"===s.value?$e(e)||(A.value?{[b.value]:e,[q.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!$e(e)||A.value)).map((e=>$e(e)||{[b.value]:e,[q.value]:e,[Te.value[0]]:e})),Je=()=>{ce.value=r(J,(e=>{e.length{e==J.value&&u.value(J.value,K).then((t=>{e!=J.value&&J.value||(ue.value=t,ee.value=me.value.filter((e=>!0!==e[z.value]))[0]||null,se.value=!1)})).catch((e=>{console.error(e)}))}),S.value))}),{flush:"sync"})};if("single"!==s.value&&!c(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?L.value?Ke(Ue):1==w.value&&Ue():(ue.value=u.value,Ue()),S.value>-1&&Je(),r(S,((e,t)=>{ce.value&&ce.value(),e>=0&&Je()})),r(Y,(e=>{if(c(e))Z(Ye(e),!1);else switch(s.value){case"single":(w.value?e[q.value]!=X.value[q.value]:e!=X.value[q.value])&&Z(Ye(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(w.value?e.map((e=>e[q.value])):e,X.value.map((e=>e[q.value])))||Z(Ye(e),!1)}}),{deep:!0}),r(u,((e,t)=>{"function"==typeof a.options?L.value&&(!t||e&&e.toString()!==t.toString())&&Ke():(ue.value=a.options,Object.keys(X.value).length||Ue(),Xe())})),r(b,Xe),r(v,((e,t)=>{de.value=W.value&&-1===e?10:e})),{resolvedOptions:pe,pfo:ge,fo:me,filteredOptions:me,hasSelected:Oe,multipleLabelText:we,eo:he,extendedOptions:he,eg:be,extendedGroups:be,fg:_e,filteredGroups:_e,noOptions:xe,noResults:Se,resolving:se,busy:Ee,offset:de,select:Pe,deselect:qe,remove:Ce,selectAll:()=>{"single"!==s.value&&Pe(me.value.filter((e=>!e.disabled&&!De(e))))},clear:Be,isSelected:De,isDisabled:je,isMax:Re,getOption:$e,handleOptionClick:e=>{if(!je(e))return F.value&&!De(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=F.value(e,K))instanceof Promise)?(se.value=!0,void e.then((e=>{se.value=!1,Ie(e)}))):void Ie(e)},handleGroupClick:e=>{if(!je(e)&&"single"!==s.value&&N.value){switch(s.value){case"multiple":case"tags":Me(e[$.value])?qe(e[$.value]):Pe(e[$.value].filter((e=>-1===X.value.map((e=>e[q.value])).indexOf(e[q.value]))).filter((e=>!e[z.value])).filter(((e,t)=>X.value.length+1+t<=D.value||-1===D.value))),f.value&&ee.value&&te(_e.value.filter((e=>!e[z.value]))[ee.value.index])}R.value&&ne()}},handleTagRemove:(e,t)=>{0===t.button?Ce(e):t.preventDefault()},refreshOptions:e=>{Ke(e)},resolveOptions:Ke,refreshLabels:Xe}}function b(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:d,mode:v,groupSelect:f,disabledProp:h,groupOptions:g}=e(t),m=l.fo,b=l.fg,y=l.handleOptionClick,_=l.handleGroupClick,O=l.search,w=l.pointer,x=l.setPointer,S=l.clearPointer,L=l.multiselect,T=l.isOpen,k=n((()=>m.value.filter((e=>!e[h.value])))),E=n((()=>b.value.filter((e=>!e[h.value])))),P=p((()=>"single"!==v.value&&f.value)),q=p((()=>w.value&&w.value.group)),A=n((()=>$(w.value))),C=n((()=>{const e=q.value?w.value:$(w.value),t=E.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=E.value[t-1];return void 0===a&&(a=D.value),a})),B=n((()=>{let e=E.value.map((e=>e.label)).indexOf(q.value?w.value[c.value]:$(w.value)[c.value])+1;return E.value.length<=e&&(e=0),E.value[e]})),D=n((()=>[...E.value].slice(-1)[0])),j=n((()=>w.value.__VISIBLE__.filter((e=>!e[h.value]))[0])),R=n((()=>{const e=A.value.__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])-1]})),I=n((()=>{const e=$(w.value).__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])+1]})),V=n((()=>[...C.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),M=n((()=>[...D.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),W=()=>{x(k.value[0]||null)},$=e=>E.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=L.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;d.value&&(t=q.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?W():S())})),r(T,(e=>{if(e&&L&&L.value){let e=L.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;i((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:w,canPointGroups:P,isPointed:e=>!(!w.value||!(!e.group&&w.value[o.value]===e[o.value]||void 0!==e.group&&w.value[c.value]===e[c.value]))||void 0,setPointerFirst:W,selectPointer:()=>{w.value&&!0!==w.value[h.value]&&(q.value?_(w.value):y(w.value))},forwardPointer:()=>{if(null===w.value)x((d.value&&P.value?E.value[0].__CREATE__?k.value[0]:E.value[0]:k.value[0])||null);else if(d.value&&P.value){let e=q.value?j.value:I.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[g.value][0])),x(e||null)}else{let e=k.value.map((e=>e[o.value])).indexOf(w.value[o.value])+1;k.value.length<=e&&(e=0),x(k.value[e]||null)}i((()=>{H()}))},backwardPointer:()=>{if(null===w.value){let e=k.value[k.value.length-1];d.value&&P.value&&(e=M.value,void 0===e&&(e=D.value)),x(e||null)}else if(d.value&&P.value){let e=q.value?V.value:R.value;void 0===e&&(e=q.value?C.value:A.value,e.__CREATE__&&(e=V.value,void 0===e&&(e=C.value))),x(e||null)}else{let e=k.value.map((e=>e[o.value])).indexOf(w.value[o.value])-1;e<0&&(e=k.value.length-1),x(k.value[e]||null)}i((()=>{H()}))}}}function y(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function _(e){return e instanceof y(e).Element||e instanceof Element}function O(e){return e instanceof y(e).HTMLElement||e instanceof HTMLElement}function w(e){return"undefined"!=typeof ShadowRoot&&(e instanceof y(e).ShadowRoot||e instanceof ShadowRoot)}var x=Math.max,S=Math.min,L=Math.round;function T(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function k(){return!/^((?!chrome|android).)*safari/i.test(T())}function E(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&O(e)&&(n=e.offsetWidth>0&&L(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&L(l.height)/e.offsetHeight||1);var i=(_(e)?y(e):window).visualViewport,o=!k()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,d=l.height/r;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u,x:u,y:s}}function P(e){var t=y(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(e){return e?(e.nodeName||"").toLowerCase():null}function A(e){return((_(e)?e.ownerDocument:e.document)||window.document).documentElement}function C(e){return E(A(e)).left+P(e).scrollLeft}function B(e){return y(e).getComputedStyle(e)}function D(e){var t=B(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function j(e,t,a){void 0===a&&(a=!1);var l,n,r=O(t),i=O(t)&&function(e){var t=e.getBoundingClientRect(),a=L(t.width)/e.offsetWidth||1,l=L(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=A(t),u=E(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==q(t)||D(o))&&(s=(l=t)!==y(l)&&O(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:P(l)),O(t)?((c=E(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=C(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function R(e){var t=E(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function I(e){return"html"===q(e)?e:e.assignedSlot||e.parentNode||(w(e)?e.host:null)||A(e)}function V(e){return["html","body","#document"].indexOf(q(e))>=0?e.ownerDocument.body:O(e)&&D(e)?e:V(I(e))}function M(e,t){var a;void 0===t&&(t=[]);var l=V(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=y(l),i=n?[r].concat(r.visualViewport||[],D(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(M(I(i)))}function W(e){return["table","td","th"].indexOf(q(e))>=0}function $(e){return O(e)&&"fixed"!==B(e).position?e.offsetParent:null}function H(e){for(var t=y(e),a=$(e);a&&W(a)&&"static"===B(a).position;)a=$(a);return a&&("html"===q(a)||"body"===q(a)&&"static"===B(a).position)?t:a||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&O(e)&&"fixed"===B(e).position)return null;var a=I(e);for(w(a)&&(a=a.host);O(a)&&["html","body"].indexOf(q(a))<0;){var l=B(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var N="top",F="bottom",z="right",G="left",U="auto",K=[N,F,z,G],X="start",Y="end",J="clippingParents",Q="viewport",Z="popper",ee="reference",te=K.reduce((function(e,t){return e.concat([t+"-"+X,t+"-"+Y])}),[]),ae=[].concat(K,[U]).reduce((function(e,t){return e.concat([t,t+"-"+X,t+"-"+Y])}),[]),le=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ne(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ie(e,t,a){return t===Q?re(function(e,t){var a=y(e),l=A(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=k();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+C(e),y:u}}(e,a)):_(t)?function(e,t){var a=E(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):re(function(e){var t,a=A(e),l=P(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=x(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=x(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+C(e),u=-l.scrollTop;return"rtl"===B(n||a).direction&&(o+=x(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(A(e)))}function oe(e){var t=M(I(e)),a=["absolute","fixed"].indexOf(B(e).position)>=0&&O(e)?H(e):e;return _(a)?t.filter((function(e){return _(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&w(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==q(e)})):[]}function ue(e){return e.split("-")[0]}function se(e){return e.split("-")[1]}function ce(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function de(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?ue(n):null,i=n?se(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case N:t={x:o,y:a.y-l.height};break;case F:t={x:o,y:a.y+a.height};break;case z:t={x:a.x+a.width,y:u};break;case G:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?ce(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case X:t[s]=t[s]-(a[c]/2-l[c]/2);break;case Y:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function pe(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?J:u,c=l.rootBoundary,d=void 0===c?Q:c,p=l.elementContext,v=void 0===p?Z:p,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,K.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===Z?ee:Z,O=e.rects.popper,w=e.elements[h?y:v],L=function(e,t,a,l){var n="clippingParents"===t?oe(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=ie(e,a,l);return t.top=x(n.top,t.top),t.right=S(n.right,t.right),t.bottom=S(n.bottom,t.bottom),t.left=x(n.left,t.left),t}),ie(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(_(w)?w:w.contextElement||A(e.elements.popper),s,d,o),T=E(e.elements.reference),k=de({reference:T,element:O,strategy:"absolute",placement:r}),P=re(Object.assign({},O,k)),q=v===Z?P:T,C={top:L.top-q.top+b.top,bottom:q.bottom-L.bottom+b.bottom,left:L.left-q.left+b.left,right:q.right-L.right+b.right},B=e.modifiersData.offset;if(v===Z&&B){var D=B[r];Object.keys(C).forEach((function(e){var t=[z,F].indexOf(e)>=0?1:-1,a=[N,F].indexOf(e)>=0?"y":"x";C[e]+=D[a]*t}))}return C}var ve={placement:"bottom",modifiers:[],strategy:"absolute"};function fe(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(Oe,fe,we):_e(v?Oe:ge,fe,v?we:me);w[O]=xe,q[O]=xe-fe}t.modifiersData[l]=q}},requiresIfExists:["offset"]},we={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,(function(e){return we[e]}))}var Se={start:"end",end:"start"};function Le(e){return e.replace(/start|end/g,(function(e){return Se[e]}))}function Te(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?ae:u,c=se(l),d=c?o?te:te.filter((function(e){return se(e)===c})):K,p=d.filter((function(e){return s.indexOf(e)>=0}));0===p.length&&(p=d);var v=p.reduce((function(t,a){return t[a]=pe(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[ue(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var ke={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,d=a.rootBoundary,p=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=ue(g),b=u||(m===g||!f?[xe(g)]:function(e){if(ue(e)===U)return[];var t=xe(e);return[Le(e),t,Le(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(ue(a)===U?Te(t,{placement:a,boundary:c,rootBoundary:d,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),_=t.rects.reference,O=t.rects.popper,w=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",A=pe(t,{placement:T,boundary:c,rootBoundary:d,altBoundary:p,padding:s}),C=P?E?z:G:E?F:N;_[q]>O[q]&&(C=xe(C));var B=xe(C),D=[];if(r&&D.push(A[k]<=0),o&&D.push(A[C]<=0,A[B]<=0),D.every((function(e){return e}))){S=T,x=!1;break}w.set(T,D)}if(x)for(var j=function(e){var t=y.find((function(t){var a=w.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},R=f?3:1;R>0;R--){if("break"===j(R))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ee(a,n,r){const{disabled:s,appendTo:c,appendToBody:d,openDirection:v}=e(a),f=t().proxy,h=r.multiselect,g=r.dropdown,m=l(!1),b=l(null),y=l(null),_=p((()=>c.value||d.value)),O=p((()=>"top"===v.value&&"bottom"===y.value||"bottom"===v.value&&"top"!==y.value?"bottom":"top")),w=()=>{if(!b.value)return;let e=parseInt(window.getComputedStyle(g.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(g.value).borderBottomWidth.replace("px",""));b.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===O.value?e:t)]}}]}))),b.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{_.value&&(b.value=ye(h.value,g.value,{strategy:x(h.value)?"fixed":void 0,placement:v.value,modifiers:[Oe,ke,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){y.value=e.placement}}]}))})),u((()=>{_.value&&b.value&&(b.value.destroy(),b.value=null)})),{popper:b,isOpen:m,open:()=>{m.value||s.value||(m.value=!0,n.emit("open",f),_.value&&i((()=>{w()})))},close:()=>{m.value&&(m.value=!1,n.emit("close",f))},placement:O,updatePopper:w}}function Pe(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,d=n.clearSearch,v=n.isOpen,f=n.wrapper,h=n.tags,g=l(!1),m=l(!1),b=p((()=>r.value||i.value?-1:0)),y=()=>{r.value&&u.value.blur(),f.value.blur()},_=(e=!0)=>{i.value||(g.value=!0,e&&s())},O=()=>{g.value=!1,setTimeout((()=>{g.value||(c(),o.value&&d())}),1)};return{tabindex:b,isActive:g,mouseClicked:m,blur:y,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:_,deactivate:O,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{O()},handleCaretClick:()=>{O(),y()},handleMousedown:e=>{m.value=!0,v.value&&(e.target.isEqualNode(f.value)||e.target.isEqualNode(h.value))?setTimeout((()=>{O()}),0):v.value||!document.activeElement.isEqualNode(f.value)&&!document.activeElement.isEqualNode(u.value)||_(),setTimeout((()=>{m.value=!1}),0)}}}function qe(a,l,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:d,addOptionOn:v,createTag:f,createOption:h,reverse:g}=e(a),m=t().proxy,b=n.iv,y=n.update,_=n.deselect,O=n.search,w=n.setPointer,x=n.selectPointer,S=n.backwardPointer,L=n.forwardPointer,T=n.multiselect,k=n.wrapper,E=n.tags,P=n.isOpen,q=n.open,A=n.blur,C=n.fo,B=p((()=>f.value||h.value||!1)),D=p((()=>void 0!==i.value?i.value:void 0!==v.value?v.value:["enter"])),j=()=>{"tags"===r.value&&!s.value&&B.value&&u.value&&!d.value&&w(C.value[C.value.map((e=>e[c.value])).indexOf(O.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...T.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(O.value))return;if(0===b.value.length)return;let l=b.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&_(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return y([...b.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():k.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;j(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),j(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),j(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;j(),x(),e.preventDefault();break;case"Escape":A();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;P.value||q(),S();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;P.value||q(),L();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?E.value.querySelector("input").focus():u.value||k.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,m)},preparePointer:j}}function Ae(t,a,l){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,d=l.isSelected,v=l.isDisabled,f=l.isActive,h=l.canPointGroups,g=l.resolving,m=l.fo,b=l.placement,y=p((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),_=p((()=>!!(s.value&&o.value&&(!g.value||g.value&&m.value.length))));return{classList:n((()=>{const e=y.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(_.value&&"top"===b.value?e.containerOpenTop:[]).concat(_.value&&"top"!==b.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===b.value?e.dropdownTop:[]).concat(s.value&&o.value&&_.value?[]:e.dropdownHidden),options:[e.options].concat("top"===b.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&h.value?a.push(v(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):v(t)&&a.push(e.groupLabelDisabled),h.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?l.push(v(t)?e.optionSelectedDisabled:e.optionSelected):(v(t)||a&&v(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:_}}function Ce(t,a,n){const{limit:u,infinite:c}=e(t),d=n.isOpen,v=n.offset,f=n.search,h=n.pfo,g=n.eo,m=l(null),b=s(null),y=p((()=>v.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;v.value+=-1==u.value?10:u.value,i((()=>{e.scrollTop=t}))}},O=()=>{d.value&&v.value{c.value&&O()})),r(f,(()=>{c.value&&(v.value=u.value,O())}),{flush:"post"}),r(g,(()=>{c.value&&O()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(m.value=new IntersectionObserver(_))})),{hasMore:y,infiniteLoader:b}}function Be(t,a,r){const{placeholder:i,id:u,valueProp:s,label:c,mode:d,groupLabel:v,aria:f,searchable:h}=e(t),g=r.pointer,m=r.iv,b=r.hasSelected,y=r.multipleLabelText,_=l(null),O=p((()=>(u.value?u.value+"-":"")+"assist")),w=p((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=p((()=>{if(g.value){let e=u.value?`${u.value}-`:"";return e+=(g.value.group?"multiselect-group":"multiselect-option")+"-",e+=g.value.group?g.value.index:g.value[s.value],e}})),S=p((()=>i.value)),L=p((()=>"single"!==d.value)),T=n((()=>"single"===d.value&&b.value?m.value[c.value]:"multiple"===d.value&&b.value?y.value:"tags"===d.value&&b.value?m.value.map((e=>e[c.value])).join(", "):"")),k=n((()=>{let e={...f.value};return h.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${O.value} ${e["aria-labelledby"]}`:O.value,T.value&&e["aria-label"]&&(e["aria-label"]=`${T.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);_.value=e?e.innerText:null}})),{arias:k,ariaLabel:T,ariaAssist:O,ariaControls:w,ariaPlaceholder:S,ariaMultiselectable:L,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function De(t,a,l){const{locale:n,fallbackLocale:r}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function je(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}function Re(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let d;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=d):t&&(d=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(c.functional){const e=c.render;c.render=function(t,a){return d.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,d):[d]}return a}const Ie={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[je,De,v,h,Ee,f,d,Pe,m,Ce,b,qe,Ae,Be]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var Ve=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};Ve._withStripped=!0;const Me=Re({render:Ve,staticRenderFns:[]},undefined,Ie,undefined,false,undefined,!1,void 0,void 0,void 0);export{Me as default}; +import{toRefs as e,getCurrentInstance as t,customRef as a,ref as l,computed as n,watch as r,nextTick as i,onMounted as o,onBeforeUnmount as u,shallowRef as s}from"vue";function c(e){return null==e}function p(a,l,n){const{object:r,valueProp:i,mode:o}=e(a),u=t().proxy,s=n.iv,p=e=>r.value||c(e)?e:Array.isArray(e)?e.map((e=>e[i.value])):e[i.value],d=e=>c(e)?"single"===o.value?{}:[]:e;return{update:(e,t=!0)=>{s.value=d(e);const a=p(e);l.emit("change",a,u),t&&(l.emit("input",a),l.emit("update:modelValue",a))}}}function d(e){return a((()=>({get:e,set:()=>{}})))}function v(t,a){const{value:r,modelValue:i,mode:o,valueProp:u}=e(t),s=l("single"!==o.value?[]:{}),c=d((()=>void 0!==i.value?i.value:r.value)),p=n((()=>"single"===o.value?s.value[u.value]:s.value.map((e=>e[u.value])))),v=d((()=>"single"!==o.value?s.value.map((e=>e[u.value])).join(","):s.value[u.value]));return{iv:s,internalValue:s,ev:c,externalValue:c,textValue:v,plainValue:p}}function f(a,n,i){const{regex:o}=e(a),u=t().proxy,s=i.isOpen,c=i.open,p=l(null);return r(p,(e=>{!s.value&&e&&c(),n.emit("search-change",e,u)})),{search:p,clearSearch:()=>{p.value=""},handleSearchInput:e=>{p.value=e.target.value},handleKeypress:e=>{if(o.value){let t=o.value;"string"==typeof t&&(t=new RegExp(t)),e.key.match(t)||e.preventDefault()}},handlePaste:e=>{if(o.value){let t=(e.clipboardData||window.clipboardData).getData("Text"),a=o.value;"string"==typeof a&&(a=new RegExp(a)),t.split("").every((e=>!!e.match(a)))||e.preventDefault()}n.emit("paste",e,u)}}}function h(t,a,n){const{groupSelect:r,mode:i,groups:o,disabledProp:u}=e(t),s=l(null),c=e=>{void 0===e||null!==e&&e[u.value]||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:()=>{c(null)}}}function g(e,t=!0){return t?String(e).toLowerCase().trim():String(e).toLowerCase().normalize("NFD").trim().replace(/Γ¦/g,"ae").replace(/Ε“/g,"oe").replace(/ΓΈ/g,"o").replace(/\p{Diacritic}/gu,"")}const m=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(let n of a){if(!l.includes(n))return!1;if(!m(e[n],t[n]))return!1}return!0};function b(a,i,o){const{options:u,mode:s,trackBy:p,limit:v,hideSelected:f,createTag:h,createOption:b,label:y,appendNewTag:_,appendNewOption:O,multipleLabel:w,object:x,loading:S,delay:L,resolveOnLoad:k,minChars:T,filterResults:E,clearOnSearch:P,clearOnSelect:q,valueProp:A,allowAbsent:C,groupLabel:B,canDeselect:D,max:j,strict:R,closeOnSelect:I,closeOnDeselect:V,groups:M,reverse:W,infinite:$,groupOptions:H,groupHideEmpty:N,groupSelect:F,onCreate:z,disabledProp:G,searchStart:U,searchFilter:K}=e(a),X=t().proxy,Y=o.iv,J=o.ev,Q=o.search,Z=o.clearSearch,ee=o.update,te=o.pointer,ae=o.setPointer,le=o.clearPointer,ne=o.focus,re=o.deactivate,ie=o.close,oe=o.localize,ue=l([]),se=l([]),ce=l(!1),pe=l(null),de=l($.value&&-1===v.value?10:v.value),ve=n({get:()=>se.value,set:e=>se.value=e}),fe=d((()=>h.value||b.value||!1)),he=d((()=>void 0!==_.value?_.value:void 0===O.value||O.value)),ge=n((()=>{if(M.value){let e=ye.value||[],t=[];return e.forEach((e=>{Ue(e[H.value]).forEach((a=>{t.push(Object.assign({},a,e[G.value]?{[G.value]:!0}:{}))}))})),t}{let e=Ue(se.value||[]);return ue.value.length&&(e=e.concat(ue.value)),e}})),me=n((()=>{let e=ge.value;return W.value&&(e=e.reverse()),ke.value.length&&(e=ke.value.concat(e)),Ge(e)})),be=n((()=>{let e=me.value;return de.value>0&&(e=e.slice(0,de.value)),e})),ye=n((()=>{if(!M.value)return[];let e=[],t=se.value||[];return ue.value.length&&e.push({[B.value]:" ",[H.value]:[...ue.value],__CREATE__:!0}),e.concat(t)})),_e=n((()=>{let e=[...ye.value].map((e=>({...e})));return ke.value.length&&(e[0]&&e[0].__CREATE__?e[0][H.value]=[...ke.value,...e[0][H.value]]:e=[{[B.value]:" ",[H.value]:[...ke.value],__CREATE__:!0}].concat(e)),e})),Oe=n((()=>{if(!M.value)return[];let e=_e.value;return ze((e||[]).map(((e,t)=>{const a=Ue(e[H.value]);return{...e,index:t,group:!0,[H.value]:Ge(a,!1).map((t=>Object.assign({},t,e[G.value]?{[G.value]:!0}:{}))),__VISIBLE__:Ge(a).map((t=>Object.assign({},t,e[G.value]?{[G.value]:!0}:{})))}})))})),we=n((()=>{switch(s.value){case"single":return!c(Y.value[A.value]);case"multiple":case"tags":return!c(Y.value)&&Y.value.length>0}})),xe=n((()=>void 0!==w.value?w.value(Y.value,X):Y.value&&Y.value.length>1?`${Y.value.length} options selected`:"1 option selected")),Se=d((()=>!ge.value.length&&!ce.value&&!ke.value.length)),Le=d((()=>ge.value.length>0&&0==be.value.length&&(Q.value&&M.value||!M.value))),ke=n((()=>!1!==fe.value&&Q.value?-1!==Ne(Q.value)?[]:[{[A.value]:Q.value,[Te.value[0]]:Q.value,[y.value]:Q.value,__CREATE__:!0}]:[])),Te=n((()=>p.value?Array.isArray(p.value)?p.value:[p.value]:[y.value])),Ee=d((()=>{switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),Pe=d((()=>S.value||ce.value)),qe=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":ee(e);break;case"multiple":case"tags":ee(Y.value.concat(e))}i.emit("select",Ce(e),e,X)},Ae=e=>{switch("object"!=typeof e&&(e=He(e)),s.value){case"single":De();break;case"tags":case"multiple":ee(Array.isArray(e)?Y.value.filter((t=>-1===e.map((e=>e[A.value])).indexOf(t[A.value]))):Y.value.filter((t=>t[A.value]!=e[A.value])))}i.emit("deselect",Ce(e),e,X)},Ce=e=>x.value?e:e[A.value],Be=e=>{Ae(e)},De=()=>{ee(Ee.value),i.emit("clear",X)},je=e=>{if(void 0!==e.group)return"single"!==s.value&&($e(e[H.value])&&e[H.value].length);switch(s.value){case"single":return!c(Y.value)&&(Y.value[A.value]==e[A.value]||"object"==typeof Y.value[A.value]&&"object"==typeof e[A.value]&&m(Y.value[A.value],e[A.value]));case"tags":case"multiple":return!c(Y.value)&&-1!==Y.value.map((e=>e[A.value])).indexOf(e[A.value])}},Re=e=>!0===e[G.value],Ie=()=>!(void 0===j||-1===j.value||!we.value&&j.value>0)&&Y.value.length>=j.value,Ve=e=>{switch(e.__CREATE__&&delete(e={...e}).__CREATE__,s.value){case"single":if(e&&je(e))return D.value&&Ae(e),void(V.value&&(le(),ie()));e&&Me(e),q.value&&Z(),I.value&&(le(),ie()),e&&qe(e);break;case"multiple":if(e&&je(e))return Ae(e),void(V.value&&(le(),ie()));if(Ie())return void i.emit("max",X);e&&(Me(e),qe(e)),q.value&&Z(),f.value&&le(),I.value&&ie();break;case"tags":if(e&&je(e))return Ae(e),void(V.value&&(le(),ie()));if(Ie())return void i.emit("max",X);e&&Me(e),q.value&&Z(),e&&qe(e),f.value&&le(),I.value&&ie()}I.value||ne()},Me=e=>{void 0===He(e[A.value])&&fe.value&&(i.emit("tag",e[A.value],X),i.emit("option",e[A.value],X),i.emit("create",e[A.value],X),he.value&&Fe(e),Z())},We=e=>void 0===e.find((e=>!je(e)&&!e[G.value])),$e=e=>void 0===e.find((e=>!je(e))),He=e=>ge.value[ge.value.map((e=>String(e[A.value]))).indexOf(String(e))],Ne=e=>ge.value.findIndex((t=>Te.value.some((a=>(parseInt(t[a])==t[a]?parseInt(t[a]):t[a])===(parseInt(e)==e?parseInt(e):e))))),Fe=e=>{ue.value.push(e)},ze=e=>N.value?e.filter((e=>Q.value?e.__VISIBLE__.length:e[H.value].length)):e.filter((e=>!Q.value||e.__VISIBLE__.length)),Ge=(e,t=!0)=>{let a=e;if(Q.value&&E.value){let e=K.value;e||(e=(e,t,a)=>Te.value.some((a=>{let l=g(oe(e[a]),R.value);return U.value?l.startsWith(g(t,R.value)):-1!==l.indexOf(g(t,R.value))}))),a=a.filter((t=>e(t,Q.value,X)))}return f.value&&t&&(a=a.filter((e=>!(e=>-1!==["tags","multiple"].indexOf(s.value)&&f.value&&je(e))(e)))),a},Ue=e=>{let t=e;var a;return a=t,"[object Object]"===Object.prototype.toString.call(a)&&(t=Object.keys(t).map((e=>{let a=t[e];return{[A.value]:e,[Te.value[0]]:a,[y.value]:a}}))),t=t.map((e=>"object"==typeof e?e:{[A.value]:e,[Te.value[0]]:e,[y.value]:e})),t},Ke=()=>{c(J.value)||(Y.value=Je(J.value))},Xe=e=>(ce.value=!0,new Promise(((t,a)=>{u.value(Q.value,X).then((t=>{se.value=t||[],"function"==typeof e&&e(t),ce.value=!1})).catch((e=>{console.error(e),se.value=[],ce.value=!1})).finally((()=>{t()}))}))),Ye=()=>{if(we.value)if("single"===s.value){let e=He(Y.value[A.value]);if(void 0!==e){let t=e[y.value];Y.value[y.value]=t,x.value&&(J.value[y.value]=t)}}else Y.value.forEach(((e,t)=>{let a=He(Y.value[t][A.value]);if(void 0!==a){let e=a[y.value];Y.value[t][y.value]=e,x.value&&(J.value[t][y.value]=e)}}))},Je=e=>c(e)?"single"===s.value?{}:[]:x.value?e:"single"===s.value?He(e)||(C.value?{[y.value]:e,[A.value]:e,[Te.value[0]]:e}:{}):e.filter((e=>!!He(e)||C.value)).map((e=>He(e)||{[y.value]:e,[A.value]:e,[Te.value[0]]:e})),Qe=()=>{pe.value=r(Q,(e=>{e.length{e==Q.value&&u.value(Q.value,X).then((t=>{e!=Q.value&&Q.value||(se.value=t,te.value=be.value.filter((e=>!0!==e[G.value]))[0]||null,ce.value=!1)})).catch((e=>{console.error(e)}))}),L.value))}),{flush:"sync"})};if("single"!==s.value&&!c(J.value)&&!Array.isArray(J.value))throw new Error(`v-model must be an array when using "${s.value}" mode`);return u&&"function"==typeof u.value?k.value?Xe(Ke):1==x.value&&Ke():(se.value=u.value,Ke()),L.value>-1&&Qe(),r(L,((e,t)=>{pe.value&&pe.value(),e>=0&&Qe()})),r(J,(e=>{if(c(e))ee(Je(e),!1);else switch(s.value){case"single":(x.value?e[A.value]!=Y.value[A.value]:e!=Y.value[A.value])&&ee(Je(e),!1);break;case"multiple":case"tags":(function(e,t){if(e.length!==t.length)return!1;const a=t.slice().sort();return e.slice().sort().every((function(e,t){return e===a[t]}))})(x.value?e.map((e=>e[A.value])):e,Y.value.map((e=>e[A.value])))||ee(Je(e),!1)}}),{deep:!0}),r(u,((e,t)=>{"function"==typeof a.options?k.value&&(!t||e&&e.toString()!==t.toString())&&Xe():(se.value=a.options,Object.keys(Y.value).length||Ke(),Ye())})),r(y,Ye),r(v,((e,t)=>{de.value=$.value&&-1===e?10:e})),{resolvedOptions:ve,pfo:me,fo:be,filteredOptions:be,hasSelected:we,multipleLabelText:xe,eo:ge,extendedOptions:ge,eg:ye,extendedGroups:ye,fg:Oe,filteredGroups:Oe,noOptions:Se,noResults:Le,resolving:ce,busy:Pe,offset:de,select:qe,deselect:Ae,remove:Be,selectAll:()=>{"single"!==s.value&&qe(be.value.filter((e=>!e.disabled&&!je(e))))},clear:De,isSelected:je,isDisabled:Re,isMax:Ie,getOption:He,handleOptionClick:e=>{if(!Re(e))return z.value&&!je(e)&&e.__CREATE__&&(delete(e={...e}).__CREATE__,(e=z.value(e,X))instanceof Promise)?(ce.value=!0,void e.then((e=>{ce.value=!1,Ve(e)}))):void Ve(e)},handleGroupClick:e=>{if(!Re(e)&&"single"!==s.value&&F.value){switch(s.value){case"multiple":case"tags":We(e[H.value])?Ae(e[H.value]):qe(e[H.value].filter((e=>-1===Y.value.map((e=>e[A.value])).indexOf(e[A.value]))).filter((e=>!e[G.value])).filter(((e,t)=>Y.value.length+1+t<=j.value||-1===j.value))),f.value&&te.value&&ae(Oe.value.filter((e=>!e[G.value]))[te.value.index])}I.value&&re()}},handleTagRemove:(e,t)=>{0===t.button?Be(e):t.preventDefault()},refreshOptions:e=>{Xe(e)},resolveOptions:Xe,refreshLabels:Ye}}function y(t,a,l){const{valueProp:o,showOptions:u,searchable:s,groupLabel:c,groups:p,mode:v,groupSelect:f,disabledProp:h,groupOptions:g}=e(t),m=l.fo,b=l.fg,y=l.handleOptionClick,_=l.handleGroupClick,O=l.search,w=l.pointer,x=l.setPointer,S=l.clearPointer,L=l.multiselect,k=l.isOpen,T=n((()=>m.value.filter((e=>!e[h.value])))),E=n((()=>b.value.filter((e=>!e[h.value])))),P=d((()=>"single"!==v.value&&f.value)),q=d((()=>w.value&&w.value.group)),A=n((()=>$(w.value))),C=n((()=>{const e=q.value?w.value:$(w.value),t=E.value.map((e=>e[c.value])).indexOf(e[c.value]);let a=E.value[t-1];return void 0===a&&(a=D.value),a})),B=n((()=>{let e=E.value.map((e=>e.label)).indexOf(q.value?w.value[c.value]:$(w.value)[c.value])+1;return E.value.length<=e&&(e=0),E.value[e]})),D=n((()=>[...E.value].slice(-1)[0])),j=n((()=>w.value.__VISIBLE__.filter((e=>!e[h.value]))[0])),R=n((()=>{const e=A.value.__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])-1]})),I=n((()=>{const e=$(w.value).__VISIBLE__.filter((e=>!e[h.value]));return e[e.map((e=>e[o.value])).indexOf(w.value[o.value])+1]})),V=n((()=>[...C.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),M=n((()=>[...D.value.__VISIBLE__.filter((e=>!e[h.value]))].slice(-1)[0])),W=()=>{x(T.value[0]||null)},$=e=>E.value.find((t=>-1!==t.__VISIBLE__.map((e=>e[o.value])).indexOf(e[o.value]))),H=()=>{let e=L.value.querySelector("[data-pointed]");if(!e)return;let t=e.parentElement.parentElement;p.value&&(t=q.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{s.value&&(e.length&&u.value?W():S())})),r(k,(e=>{if(e&&L&&L.value){let e=L.value.querySelectorAll("[data-selected]")[0];if(!e)return;let t=e.parentElement.parentElement;i((()=>{t.scrollTop=e.offsetTop}))}})),{pointer:w,canPointGroups:P,isPointed:e=>!(!w.value||!(!e.group&&w.value[o.value]===e[o.value]||void 0!==e.group&&w.value[c.value]===e[c.value]))||void 0,setPointerFirst:W,selectPointer:()=>{w.value&&!0!==w.value[h.value]&&(q.value?_(w.value):y(w.value))},forwardPointer:()=>{if(null===w.value)x((p.value&&P.value?E.value[0].__CREATE__?T.value[0]:E.value[0]:T.value[0])||null);else if(p.value&&P.value){let e=q.value?j.value:I.value;void 0===e&&(e=B.value,e.__CREATE__&&(e=e[g.value][0])),x(e||null)}else{let e=T.value.map((e=>e[o.value])).indexOf(w.value[o.value])+1;T.value.length<=e&&(e=0),x(T.value[e]||null)}i((()=>{H()}))},backwardPointer:()=>{if(null===w.value){let e=T.value[T.value.length-1];p.value&&P.value&&(e=M.value,void 0===e&&(e=D.value)),x(e||null)}else if(p.value&&P.value){let e=q.value?V.value:R.value;void 0===e&&(e=q.value?C.value:A.value,e.__CREATE__&&(e=V.value,void 0===e&&(e=C.value))),x(e||null)}else{let e=T.value.map((e=>e[o.value])).indexOf(w.value[o.value])-1;e<0&&(e=T.value.length-1),x(T.value[e]||null)}i((()=>{H()}))}}}function _(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function O(e){return e instanceof _(e).Element||e instanceof Element}function w(e){return e instanceof _(e).HTMLElement||e instanceof HTMLElement}function x(e){return"undefined"!=typeof ShadowRoot&&(e instanceof _(e).ShadowRoot||e instanceof ShadowRoot)}var S=Math.max,L=Math.min,k=Math.round;function T(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function E(){return!/^((?!chrome|android).)*safari/i.test(T())}function P(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);var l=e.getBoundingClientRect(),n=1,r=1;t&&w(e)&&(n=e.offsetWidth>0&&k(l.width)/e.offsetWidth||1,r=e.offsetHeight>0&&k(l.height)/e.offsetHeight||1);var i=(O(e)?_(e):window).visualViewport,o=!E()&&a,u=(l.left+(o&&i?i.offsetLeft:0))/n,s=(l.top+(o&&i?i.offsetTop:0))/r,c=l.width/n,p=l.height/r;return{width:c,height:p,top:s,right:u+c,bottom:s+p,left:u,x:u,y:s}}function q(e){var t=_(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function A(e){return e?(e.nodeName||"").toLowerCase():null}function C(e){return((O(e)?e.ownerDocument:e.document)||window.document).documentElement}function B(e){return P(C(e)).left+q(e).scrollLeft}function D(e){return _(e).getComputedStyle(e)}function j(e){var t=D(e),a=t.overflow,l=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(a+n+l)}function R(e,t,a){void 0===a&&(a=!1);var l,n,r=w(t),i=w(t)&&function(e){var t=e.getBoundingClientRect(),a=k(t.width)/e.offsetWidth||1,l=k(t.height)/e.offsetHeight||1;return 1!==a||1!==l}(t),o=C(t),u=P(e,i,a),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!a)&&(("body"!==A(t)||j(o))&&(s=(l=t)!==_(l)&&w(l)?{scrollLeft:(n=l).scrollLeft,scrollTop:n.scrollTop}:q(l)),w(t)?((c=P(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=B(o))),{x:u.left+s.scrollLeft-c.x,y:u.top+s.scrollTop-c.y,width:u.width,height:u.height}}function I(e){var t=P(e),a=e.offsetWidth,l=e.offsetHeight;return Math.abs(t.width-a)<=1&&(a=t.width),Math.abs(t.height-l)<=1&&(l=t.height),{x:e.offsetLeft,y:e.offsetTop,width:a,height:l}}function V(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(x(e)?e.host:null)||C(e)}function M(e){return["html","body","#document"].indexOf(A(e))>=0?e.ownerDocument.body:w(e)&&j(e)?e:M(V(e))}function W(e,t){var a;void 0===t&&(t=[]);var l=M(e),n=l===(null==(a=e.ownerDocument)?void 0:a.body),r=_(l),i=n?[r].concat(r.visualViewport||[],j(l)?l:[]):l,o=t.concat(i);return n?o:o.concat(W(V(i)))}function $(e){return["table","td","th"].indexOf(A(e))>=0}function H(e){return w(e)&&"fixed"!==D(e).position?e.offsetParent:null}function N(e){for(var t=_(e),a=H(e);a&&$(a)&&"static"===D(a).position;)a=H(a);return a&&("html"===A(a)||"body"===A(a)&&"static"===D(a).position)?t:a||function(e){var t=/firefox/i.test(T());if(/Trident/i.test(T())&&w(e)&&"fixed"===D(e).position)return null;var a=V(e);for(x(a)&&(a=a.host);w(a)&&["html","body"].indexOf(A(a))<0;){var l=D(a);if("none"!==l.transform||"none"!==l.perspective||"paint"===l.contain||-1!==["transform","perspective"].indexOf(l.willChange)||t&&"filter"===l.willChange||t&&l.filter&&"none"!==l.filter)return a;a=a.parentNode}return null}(e)||t}var F="top",z="bottom",G="right",U="left",K="auto",X=[F,z,G,U],Y="start",J="end",Q="clippingParents",Z="viewport",ee="popper",te="reference",ae=X.reduce((function(e,t){return e.concat([t+"-"+Y,t+"-"+J])}),[]),le=[].concat(X,[K]).reduce((function(e,t){return e.concat([t,t+"-"+Y,t+"-"+J])}),[]),ne=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function re(e){var t=new Map,a=new Set,l=[];function n(e){a.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!a.has(e)){var l=t.get(e);l&&n(l)}})),l.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){a.has(e.name)||n(e)})),l}function ie(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function oe(e,t,a){return t===Z?ie(function(e,t){var a=_(e),l=C(e),n=a.visualViewport,r=l.clientWidth,i=l.clientHeight,o=0,u=0;if(n){r=n.width,i=n.height;var s=E();(s||!s&&"fixed"===t)&&(o=n.offsetLeft,u=n.offsetTop)}return{width:r,height:i,x:o+B(e),y:u}}(e,a)):O(t)?function(e,t){var a=P(e,!1,"fixed"===t);return a.top=a.top+e.clientTop,a.left=a.left+e.clientLeft,a.bottom=a.top+e.clientHeight,a.right=a.left+e.clientWidth,a.width=e.clientWidth,a.height=e.clientHeight,a.x=a.left,a.y=a.top,a}(t,a):ie(function(e){var t,a=C(e),l=q(e),n=null==(t=e.ownerDocument)?void 0:t.body,r=S(a.scrollWidth,a.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),i=S(a.scrollHeight,a.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),o=-l.scrollLeft+B(e),u=-l.scrollTop;return"rtl"===D(n||a).direction&&(o+=S(a.clientWidth,n?n.clientWidth:0)-r),{width:r,height:i,x:o,y:u}}(C(e)))}function ue(e){var t=W(V(e)),a=["absolute","fixed"].indexOf(D(e).position)>=0&&w(e)?N(e):e;return O(a)?t.filter((function(e){return O(e)&&function(e,t){var a=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(a&&x(a)){var l=t;do{if(l&&e.isSameNode(l))return!0;l=l.parentNode||l.host}while(l)}return!1}(e,a)&&"body"!==A(e)})):[]}function se(e){return e.split("-")[0]}function ce(e){return e.split("-")[1]}function pe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function de(e){var t,a=e.reference,l=e.element,n=e.placement,r=n?se(n):null,i=n?ce(n):null,o=a.x+a.width/2-l.width/2,u=a.y+a.height/2-l.height/2;switch(r){case F:t={x:o,y:a.y-l.height};break;case z:t={x:o,y:a.y+a.height};break;case G:t={x:a.x+a.width,y:u};break;case U:t={x:a.x-l.width,y:u};break;default:t={x:a.x,y:a.y}}var s=r?pe(r):null;if(null!=s){var c="y"===s?"height":"width";switch(i){case Y:t[s]=t[s]-(a[c]/2-l[c]/2);break;case J:t[s]=t[s]+(a[c]/2-l[c]/2)}}return t}function ve(e,t){void 0===t&&(t={});var a,l=t,n=l.placement,r=void 0===n?e.placement:n,i=l.strategy,o=void 0===i?e.strategy:i,u=l.boundary,s=void 0===u?Q:u,c=l.rootBoundary,p=void 0===c?Z:c,d=l.elementContext,v=void 0===d?ee:d,f=l.altBoundary,h=void 0!==f&&f,g=l.padding,m=void 0===g?0:g,b=function(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}("number"!=typeof m?m:(a=m,X.reduce((function(e,t){return e[t]=a,e}),{}))),y=v===ee?te:ee,_=e.rects.popper,w=e.elements[h?y:v],x=function(e,t,a,l){var n="clippingParents"===t?ue(e):[].concat(t),r=[].concat(n,[a]),i=r[0],o=r.reduce((function(t,a){var n=oe(e,a,l);return t.top=S(n.top,t.top),t.right=L(n.right,t.right),t.bottom=L(n.bottom,t.bottom),t.left=S(n.left,t.left),t}),oe(e,i,l));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}(O(w)?w:w.contextElement||C(e.elements.popper),s,p,o),k=P(e.elements.reference),T=de({reference:k,element:_,strategy:"absolute",placement:r}),E=ie(Object.assign({},_,T)),q=v===ee?E:k,A={top:x.top-q.top+b.top,bottom:q.bottom-x.bottom+b.bottom,left:x.left-q.left+b.left,right:q.right-x.right+b.right},B=e.modifiersData.offset;if(v===ee&&B){var D=B[r];Object.keys(A).forEach((function(e){var t=[G,z].indexOf(e)>=0?1:-1,a=[F,z].indexOf(e)>=0?"y":"x";A[e]+=D[a]*t}))}return A}var fe={placement:"bottom",modifiers:[],strategy:"absolute"};function he(){for(var e=arguments.length,t=new Array(e),a=0;aa?a:l}(_e,fe,we):Oe(v?_e:ge,fe,v?we:me);w[O]=xe,q[O]=xe-fe}t.modifiersData[l]=q}},requiresIfExists:["offset"]},xe={left:"right",right:"left",bottom:"top",top:"bottom"};function Se(e){return e.replace(/left|right|bottom|top/g,(function(e){return xe[e]}))}var Le={start:"end",end:"start"};function ke(e){return e.replace(/start|end/g,(function(e){return Le[e]}))}function Te(e,t){void 0===t&&(t={});var a=t,l=a.placement,n=a.boundary,r=a.rootBoundary,i=a.padding,o=a.flipVariations,u=a.allowedAutoPlacements,s=void 0===u?le:u,c=ce(l),p=c?o?ae:ae.filter((function(e){return ce(e)===c})):X,d=p.filter((function(e){return s.indexOf(e)>=0}));0===d.length&&(d=p);var v=d.reduce((function(t,a){return t[a]=ve(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[se(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}var Ee={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,a=e.options,l=e.name;if(!t.modifiersData[l]._skip){for(var n=a.mainAxis,r=void 0===n||n,i=a.altAxis,o=void 0===i||i,u=a.fallbackPlacements,s=a.padding,c=a.boundary,p=a.rootBoundary,d=a.altBoundary,v=a.flipVariations,f=void 0===v||v,h=a.allowedAutoPlacements,g=t.options.placement,m=se(g),b=u||(m===g||!f?[Se(g)]:function(e){if(se(e)===K)return[];var t=Se(e);return[ke(e),t,ke(t)]}(g)),y=[g].concat(b).reduce((function(e,a){return e.concat(se(a)===K?Te(t,{placement:a,boundary:c,rootBoundary:p,padding:s,flipVariations:f,allowedAutoPlacements:h}):a)}),[]),_=t.rects.reference,O=t.rects.popper,w=new Map,x=!0,S=y[0],L=0;L=0,q=P?"width":"height",A=ve(t,{placement:k,boundary:c,rootBoundary:p,altBoundary:d,padding:s}),C=P?E?G:U:E?z:F;_[q]>O[q]&&(C=Se(C));var B=Se(C),D=[];if(r&&D.push(A[T]<=0),o&&D.push(A[C]<=0,A[B]<=0),D.every((function(e){return e}))){S=k,x=!1;break}w.set(k,D)}if(x)for(var j=function(e){var t=y.find((function(t){var a=w.get(t);if(a)return a.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},R=f?3:1;R>0;R--){if("break"===j(R))break}t.placement!==S&&(t.modifiersData[l]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Pe(a,n,r){const{disabled:s,appendTo:c,appendToBody:p,openDirection:v}=e(a),f=t().proxy,h=r.multiselect,g=r.dropdown,m=l(!1),b=l(null),y=l(null),_=d((()=>c.value||p.value)),O=d((()=>"top"===v.value&&"bottom"===y.value||"bottom"===v.value&&"top"!==y.value?"bottom":"top")),w=()=>{if(!b.value)return;let e=parseInt(window.getComputedStyle(g.value).borderTopWidth.replace("px","")),t=parseInt(window.getComputedStyle(g.value).borderBottomWidth.replace("px",""));b.value.setOptions((a=>({...a,modifiers:[...a.modifiers,{name:"offset",options:{offset:[0,-1*("top"===O.value?e:t)]}}]}))),b.value.update()},x=e=>{for(;e&&e!==document.body;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1};return o((()=>{_.value&&(b.value=_e(h.value,g.value,{strategy:x(h.value)?"fixed":void 0,placement:v.value,modifiers:[we,Ee,{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>{e.elements.popper.style.width=`${e.elements.reference.offsetWidth}px`}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:e}){y.value=e.placement}}]}))})),u((()=>{_.value&&b.value&&(b.value.destroy(),b.value=null)})),{popper:b,isOpen:m,open:()=>{m.value||s.value||(m.value=!0,n.emit("open",f),_.value&&i((()=>{w()})))},close:()=>{m.value&&(m.value=!1,n.emit("close",f))},placement:O,updatePopper:w}}function qe(t,a,n){const{searchable:r,disabled:i,clearOnBlur:o}=e(t),u=n.input,s=n.open,c=n.close,p=n.clearSearch,v=n.isOpen,f=n.wrapper,h=n.tags,g=l(!1),m=l(!1),b=d((()=>r.value||i.value?-1:0)),y=()=>{r.value&&u.value.blur(),f.value.blur()},_=(e=!0)=>{i.value||(g.value=!0,e&&s())},O=()=>{g.value=!1,setTimeout((()=>{g.value||(c(),o.value&&p())}),1)};return{tabindex:b,isActive:g,mouseClicked:m,blur:y,focus:()=>{r.value&&!i.value&&u.value.focus()},activate:_,deactivate:O,handleFocusIn:e=>{e.target.closest("[data-tags]")&&"INPUT"!==e.target.nodeName||e.target.closest("[data-clear]")||_(m.value)},handleFocusOut:()=>{O()},handleCaretClick:()=>{O(),y()},handleMousedown:e=>{m.value=!0,v.value&&(e.target.isEqualNode(f.value)||e.target.isEqualNode(h.value))?setTimeout((()=>{O()}),0):v.value||!document.activeElement.isEqualNode(f.value)&&!document.activeElement.isEqualNode(u.value)||_(),setTimeout((()=>{m.value=!1}),0)}}}function Ae(a,l,n){const{mode:r,addTagOn:i,openDirection:o,searchable:u,showOptions:s,valueProp:c,groups:p,addOptionOn:v,createTag:f,createOption:h,reverse:g}=e(a),m=t().proxy,b=n.iv,y=n.update,_=n.deselect,O=n.search,w=n.setPointer,x=n.selectPointer,S=n.backwardPointer,L=n.forwardPointer,k=n.multiselect,T=n.wrapper,E=n.tags,P=n.isOpen,q=n.open,A=n.blur,C=n.fo,B=d((()=>f.value||h.value||!1)),D=d((()=>void 0!==i.value?i.value:void 0!==v.value?v.value:["enter"])),j=()=>{"tags"===r.value&&!s.value&&B.value&&u.value&&!p.value&&w(C.value[C.value.map((e=>e[c.value])).indexOf(O.value)])};return{handleKeydown:e=>{let t,a;switch(l.emit("keydown",e,m),-1!==["ArrowLeft","ArrowRight","Enter"].indexOf(e.key)&&"tags"===r.value&&(t=[...k.value.querySelectorAll("[data-tags] > *")].filter((e=>e!==E.value)),a=t.findIndex((e=>e===document.activeElement))),e.key){case"Backspace":if("single"===r.value)return;if(u.value&&-1===[null,""].indexOf(O.value))return;if(0===b.value.length)return;let l=b.value.filter((e=>!e.disabled&&!1!==e.remove));l.length&&_(l[l.length-1]);break;case"Enter":if(e.preventDefault(),229===e.keyCode)return;if(-1!==a&&void 0!==a)return y([...b.value].filter(((e,t)=>t!==a))),void(a===t.length-1&&(t.length-1?t[t.length-2].focus():u.value?E.value.querySelector("input").focus():T.value.focus()));if(-1===D.value.indexOf("enter")&&B.value)return;j(),x();break;case" ":if(!B.value&&!u.value)return e.preventDefault(),j(),void x();if(!B.value)return!1;if(-1===D.value.indexOf("space")&&B.value)return;e.preventDefault(),j(),x();break;case"Tab":case";":case",":if(-1===D.value.indexOf(e.key.toLowerCase())||!B.value)return;j(),x(),e.preventDefault();break;case"Escape":A();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;P.value||q(),S();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;P.value||q(),L();break;case"ArrowLeft":if(u.value&&E.value&&E.value.querySelector("input").selectionStart||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),-1===a?t[t.length-1].focus():a>0&&t[a-1].focus();break;case"ArrowRight":if(-1===a||e.shiftKey||"tags"!==r.value||!b.value||!b.value.length)return;e.preventDefault(),t.length>a+1?t[a+1].focus():u.value?E.value.querySelector("input").focus():u.value||T.value.focus()}},handleKeyup:e=>{l.emit("keyup",e,m)},preparePointer:j}}function Ce(t,a,l){const{classes:r,disabled:i,showOptions:o,breakTags:u}=e(t),s=l.isOpen,c=l.isPointed,p=l.isSelected,v=l.isDisabled,f=l.isActive,h=l.canPointGroups,g=l.resolving,m=l.fo,b=l.placement,y=d((()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagWrapper:"multiselect-tag-wrapper",tagWrapperBreak:"multiselect-tag-wrapper-break",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value}))),_=d((()=>!!(s.value&&o.value&&(!g.value||g.value&&m.value.length))));return{classList:n((()=>{const e=y.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(_.value&&"top"===b.value?e.containerOpenTop:[]).concat(_.value&&"top"!==b.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),wrapper:e.wrapper,spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagWrapper:[e.tagWrapper,u.value?e.tagWrapperBreak:null],tagDisabled:e.tagDisabled,tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,inifinite:e.inifinite,inifiniteSpinner:e.inifiniteSpinner,dropdown:[e.dropdown].concat("top"===b.value?e.dropdownTop:[]).concat(s.value&&o.value&&_.value?[]:e.dropdownHidden),options:[e.options].concat("top"===b.value?e.optionsTop:[]),group:e.group,groupLabel:t=>{let a=[e.groupLabel];return c(t)?a.push(p(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(t)&&h.value?a.push(v(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):v(t)&&a.push(e.groupLabelDisabled),h.value&&a.push(e.groupLabelPointable),a},groupOptions:e.groupOptions,option:(t,a)=>{let l=[e.option];return c(t)?l.push(p(t)?e.optionSelectedPointed:e.optionPointed):p(t)?l.push(v(t)?e.optionSelectedDisabled:e.optionSelected):(v(t)||a&&v(a))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,assist:e.assist,fakeInput:e.fakeInput}})),showDropdown:_}}function Be(t,a,n){const{limit:u,infinite:c}=e(t),p=n.isOpen,v=n.offset,f=n.search,h=n.pfo,g=n.eo,m=l(null),b=s(null),y=d((()=>v.value{const{isIntersecting:t,target:a}=e[0];if(t){const e=a.offsetParent,t=e.scrollTop;v.value+=-1==u.value?10:u.value,i((()=>{e.scrollTop=t}))}},O=()=>{p.value&&v.value{c.value&&O()})),r(f,(()=>{c.value&&(v.value=u.value,O())}),{flush:"post"}),r(g,(()=>{c.value&&O()}),{immediate:!1,flush:"post"}),o((()=>{window&&window.IntersectionObserver&&(m.value=new IntersectionObserver(_))})),{hasMore:y,infiniteLoader:b}}function De(t,a,r){const{placeholder:i,id:u,valueProp:s,label:c,mode:p,groupLabel:v,aria:f,searchable:h}=e(t),g=r.pointer,m=r.iv,b=r.hasSelected,y=r.multipleLabelText,_=l(null),O=d((()=>(u.value?u.value+"-":"")+"assist")),w=d((()=>(u.value?u.value+"-":"")+"multiselect-options")),x=d((()=>{if(g.value){let e=u.value?`${u.value}-`:"";return e+=(g.value.group?"multiselect-group":"multiselect-option")+"-",e+=g.value.group?g.value.index:g.value[s.value],e}})),S=d((()=>i.value)),L=d((()=>"single"!==p.value)),k=n((()=>"single"===p.value&&b.value?m.value[c.value]:"multiple"===p.value&&b.value?y.value:"tags"===p.value&&b.value?m.value.map((e=>e[c.value])).join(", "):"")),T=n((()=>{let e={...f.value};return h.value&&(e["aria-labelledby"]=e["aria-labelledby"]?`${O.value} ${e["aria-labelledby"]}`:O.value,k.value&&e["aria-label"]&&(e["aria-label"]=`${k.value}, ${e["aria-label"]}`)),e}));return o((()=>{if(u.value&&document&&document.querySelector){let e=document.querySelector(`[for="${u.value}"]`);_.value=e?e.innerText:null}})),{arias:T,ariaLabel:k,ariaAssist:O,ariaControls:w,ariaPlaceholder:S,ariaMultiselectable:L,ariaActiveDescendant:x,ariaOptionId:e=>`${u.value?u.value+"-":""}multiselect-option-${e[s.value]}`,ariaOptionLabel:e=>`${e}`,ariaGroupId:e=>`${u.value?u.value+"-":""}multiselect-group-${e.index}`,ariaGroupLabel:e=>`${e}`,ariaTagLabel:e=>`${e} ❎`}}function je(t,a,l){const{locale:n,fallbackLocale:r}=e(t);return{localize:e=>e&&"object"==typeof e?e&&e[n.value]?e[n.value]:e&&n.value&&e[n.value.toUpperCase()]?e[n.value.toUpperCase()]:e&&e[r.value]?e[r.value]:e&&r.value&&e[r.value.toUpperCase()]?e[r.value.toUpperCase()]:e&&Object.keys(e)[0]?e[Object.keys(e)[0]]:"":e}}function Re(e,t,a){return{multiselect:s(null),wrapper:s(null),tags:s(null),input:s(null),dropdown:s(null)}}function Ie(e,t,a,l,n,r,i,o,u,s){"boolean"!=typeof i&&(u=o,o=i,i=!1);const c="function"==typeof a?a.options:a;let p;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,n&&(c.functional=!0)),l&&(c._scopeId=l),r?(p=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,u(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=p):t&&(p=i?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),p)if(c.functional){const e=c.render;c.render=function(t,a){return p.call(a),e(t,a)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,p):[p]}return a}const Ve={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1,default:void 0},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:[String,Array],required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1,default:void 0},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1,default:void 0},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function,default:void 0},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1},appendToBody:{required:!1,type:Boolean,default:!1},closeOnScroll:{required:!1,type:Boolean,default:!1},breakTags:{required:!1,type:Boolean,default:!1},appendTo:{required:!1,type:String,default:void 0}},setup:(e,t)=>function(e,t,a,l={}){return a.forEach((a=>{l={...l,...a(e,t,l)}})),l}(e,t,[Re,je,v,h,Pe,f,p,qe,b,Be,y,Ae,Ce,De]),beforeMount(){(this.$root.constructor&&this.$root.constructor.version&&this.$root.constructor.version.match(/^2\./)||2===this.vueVersionMs)&&(this.$options.components.Teleport||(this.$options.components.Teleport={render(){return this.$slots.default?this.$slots.default[0]:null}}))}};var Me=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"multiselect",class:e.classList.container,attrs:{id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut,keyup:e.handleKeyup,keydown:e.handleKeydown}},[a("div",e._b({ref:"wrapper",class:e.classList.wrapper,attrs:{tabindex:e.tabindex,"aria-controls":e.searchable?void 0:e.ariaControls,"aria-placeholder":e.searchable?void 0:e.ariaPlaceholder,"aria-expanded":e.searchable?void 0:e.isOpen,"aria-activedescendant":e.searchable?void 0:e.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:e.ariaMultiselectable,role:e.searchable?void 0:"combobox"},on:{mousedown:e.handleMousedown}},"div",e.searchable?{}:e.arias,!1),["tags"!==e.mode&&e.searchable&&!e.disabled?[a("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1))]:e._e(),e._v(" "),"tags"==e.mode?[a("div",{class:e.classList.tags,attrs:{"data-tags":""}},[e._l(e.iv,(function(t,l,n){return e._t("tag",(function(){return[a("span",{key:n,class:[e.classList.tag,t.disabled?e.classList.tagDisabled:null],attrs:{tabindex:"-1","aria-label":e.ariaTagLabel(e.localize(t[e.label]))},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagWrapper},[e._v(e._s(e.localize(t[e.label])))]),e._v(" "),e.disabled||t.disabled?e._e():a("span",{class:e.classList.tagRemove,on:{click:function(a){return a.stopPropagation(),e.handleTagRemove(t,a)}}},[a("span",{class:e.classList.tagRemoveIcon})])])]}),{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),a("div",{ref:"tags",class:e.classList.tagsSearchWrapper},[a("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?a("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,"aria-controls":e.ariaControls,"aria-placeholder":e.ariaPlaceholder,"aria-expanded":e.isOpen,"aria-activedescendant":e.ariaActiveDescendant,"aria-multiselectable":e.ariaMultiselectable,role:"combobox"},domProps:{value:e.search},on:{input:e.handleSearchInput,keypress:e.handleKeypress,paste:function(t){return t.stopPropagation(),e.handlePaste.apply(null,arguments)}}},"input",Object.assign({},e.attrs,e.arias),!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",(function(){return[a("div",{class:e.classList.singleLabel},[a("span",{class:e.classList.singleLabelText},[e._v(e._s(e.localize(e.iv[e.label])))])])]}),{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",(function(){return[a("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})]}),{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",(function(){return[a("div",{class:e.classList.placeholder,attrs:{"aria-hidden":"true"}},[e._v("\n "+e._s(e.placeholder)+"\n ")])]}))],e._v(" "),e.loading||e.resolving?e._t("spinner",(function(){return[a("span",{class:e.classList.spinner,attrs:{"aria-hidden":"true"}})]})):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",(function(){return[a("span",{class:e.classList.clear,attrs:{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎"},on:{click:e.clear,keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.clear.apply(null,arguments)}}},[a("span",{class:e.classList.clearIcon})])]}),{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",(function(){return[a("span",{class:e.classList.caret,attrs:{"aria-hidden":"true"},on:{click:e.handleCaretClick}})]}),{handleCaretClick:e.handleCaretClick,isOpen:e.isOpen}):e._e()],2),e._v(" "),a("Teleport",{attrs:{to:e.appendTo||"body",disabled:!e.appendToBody&&!e.appendTo}},[a("div",{ref:"dropdown",class:e.classList.dropdown,attrs:{id:e.id?e.id+"-dropdown":void 0,tabindex:"-1"},on:{focusin:e.handleFocusIn,focusout:e.handleFocusOut}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),a("ul",{class:e.classList.options,attrs:{id:e.ariaControls,role:"listbox"}},[e.groups?e._l(e.fg,(function(t,l,n){return a("li",{key:n,class:e.classList.group,attrs:{id:e.ariaGroupId(t),"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),"aria-selected":e.isSelected(t),role:"option"}},[t.__CREATE__?e._e():a("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(a){return e.setPointer(t,l)},click:function(a){return e.handleGroupClick(t)}}},[e._t("grouplabel",(function(){return[a("span",{domProps:{innerHTML:e._s(e.localize(t[e.groupLabel]))}})]}),{group:t,isSelected:e.isSelected,isPointed:e.isPointed})],2),e._v(" "),a("ul",{class:e.classList.groupOptions,attrs:{"aria-label":e.ariaGroupLabel(e.localize(t[e.groupLabel])),role:"group"}},e._l(t.__VISIBLE__,(function(l,n,r){return a("li",{key:r,class:e.classList.option(l,t),attrs:{"data-pointed":e.isPointed(l),"data-selected":e.isSelected(l)||void 0,id:e.ariaOptionId(l),"aria-selected":e.isSelected(l),"aria-label":e.ariaOptionLabel(e.localize(l[e.label])),role:"option"},on:{mouseenter:function(t){return e.setPointer(l)},click:function(t){return e.handleOptionClick(l)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(l[e.label])))])]}),{option:l,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,l,n){return a("li",{key:n,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t),"data-selected":e.isSelected(t)||void 0,id:e.ariaOptionId(t),"aria-selected":e.isSelected(t),"aria-label":e.ariaOptionLabel(e.localize(t[e.label])),role:"option"},on:{mouseenter:function(a){return e.setPointer(t)},click:function(a){return e.handleOptionClick(t)}}},[e._t("option",(function(){return[a("span",[e._v(e._s(e.localize(t[e.label])))])]}),{option:t,isSelected:e.isSelected,isPointed:e.isPointed,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",(function(){return[a("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.localize(e.noOptionsText))}})]})):e._e(),e._v(" "),e.noResults?e._t("noresults",(function(){return[a("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.localize(e.noResultsText))}})]})):e._e(),e._v(" "),e.infinite&&e.hasMore?a("div",{ref:"infiniteLoader",class:e.classList.inifinite},[e._t("infinite",(function(){return[a("span",{class:e.classList.inifiniteSpinner})]}))],2):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2)]),e._v(" "),e.required?a("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?a("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,l){return a("input",{key:l,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),e.searchable&&e.hasSelected?a("div",{class:e.classList.assist,attrs:{id:e.ariaAssist,"aria-hidden":"true"}},[e._v("\n "+e._s(e.ariaLabel)+"\n ")]):e._e(),e._v(" "),a("div",{class:e.classList.spacer})],2)};Me._withStripped=!0;const We=Ie({render:Me,staticRenderFns:[]},undefined,Ve,undefined,false,undefined,!1,void 0,void 0,void 0);export{We as default}; diff --git a/package.json b/package.json index 1a90f91..cc23b4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vueform/multiselect", - "version": "2.6.9", + "version": "2.6.10", "private": false, "description": "Vue 3 multiselect component with single select, multiselect and tagging options.", "license": "MIT",