@davincihealthcare/elty-design-system-vue 1.70.1 → 1.70.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,5 +39,5 @@ function print() { __p += __j.call(arguments, '') }
39
39
  * focus-trap 7.6.4
40
40
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
41
41
  */function Na(n,t){(t==null||t>n.length)&&(t=n.length);for(var r=0,a=Array(t);r<t;r++)a[r]=n[r];return a}function Pp(n){if(Array.isArray(n))return Na(n)}function Zp(n,t,r){return(t=yp(t))in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}function kp(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function vp(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ui(n,t){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter(function(A){return Object.getOwnPropertyDescriptor(n,A).enumerable})),r.push.apply(r,a)}return r}function bi(n){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ui(Object(r),!0).forEach(function(a){Zp(n,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ui(Object(r)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(r,a))})}return n}function Fp(n){return Pp(n)||kp(n)||Up(n)||vp()}function xp(n,t){if(typeof n!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var a=r.call(n,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function yp(n){var t=xp(n,"string");return typeof t=="symbol"?t:t+""}function Up(n,t){if(n){if(typeof n=="string")return Na(n,t);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Na(n,t):void 0}}var Hi={activateTrap:function(t,r){if(t.length>0){var a=t[t.length-1];a!==r&&a._setPausedState(!0)}var A=t.indexOf(r);A===-1||t.splice(A,1),t.push(r)},deactivateTrap:function(t,r){var a=t.indexOf(r);a!==-1&&t.splice(a,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},bp=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Hp=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},An=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},_p=function(t){return An(t)&&!t.shiftKey},$p=function(t){return An(t)&&t.shiftKey},_i=function(t){return setTimeout(t,0)},sn=function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),A=1;A<r;A++)a[A-1]=arguments[A];return typeof t=="function"?t.apply(void 0,a):t},Lr=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},zp=[],jp=function(t,r){var a=(r==null?void 0:r.document)||document,A=(r==null?void 0:r.trapStack)||zp,i=bi({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:_p,isKeyBackward:$p},r),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},E,O=function(w,x,$){return w&&w[x]!==void 0?w[x]:i[$||x]},I=function(w,x){var $=typeof(x==null?void 0:x.composedPath)=="function"?x.composedPath():void 0;return s.containerGroups.findIndex(function(ee){var j=ee.container,ne=ee.tabbableNodes;return j.contains(w)||($==null?void 0:$.includes(j))||ne.find(function(X){return X===w})})},u=function(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=x.hasFallback,ee=$===void 0?!1:$,j=x.params,ne=j===void 0?[]:j,X=i[w];if(typeof X=="function"&&(X=X.apply(void 0,Fp(ne))),X===!0&&(X=void 0),!X){if(X===void 0||X===!1)return X;throw new Error("`".concat(w,"` was specified but was not a node, or did not return a node"))}var te=X;if(typeof X=="string"){try{te=a.querySelector(X)}catch(Ae){throw new Error("`".concat(w,'` appears to be an invalid selector; error="').concat(Ae.message,'"'))}if(!te&&!ee)throw new Error("`".concat(w,"` as selector refers to no known node"))}return te},C=function(){var w=u("initialFocus",{hasFallback:!0});if(w===!1)return!1;if(w===void 0||w&&!Ia(w,i.tabbableOptions))if(I(a.activeElement)>=0)w=a.activeElement;else{var x=s.tabbableGroups[0],$=x&&x.firstTabbableNode;w=$||u("fallbackFocus")}else w===null&&(w=u("fallbackFocus"));if(!w)throw new Error("Your focus-trap needs to have at least one focusable element");return w},S=function(){if(s.containerGroups=s.containers.map(function(w){var x=wp(w,i.tabbableOptions),$=gp(w,i.tabbableOptions),ee=x.length>0?x[0]:void 0,j=x.length>0?x[x.length-1]:void 0,ne=$.find(function(Ae){return p1(Ae)}),X=$.slice().reverse().find(function(Ae){return p1(Ae)}),te=!!x.find(function(Ae){return e1(Ae)>0});return{container:w,tabbableNodes:x,focusableNodes:$,posTabIndexesFound:te,firstTabbableNode:ee,lastTabbableNode:j,firstDomTabbableNode:ne,lastDomTabbableNode:X,nextTabbableNode:function(Le){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ve=x.indexOf(Le);return Ve<0?pe?$.slice($.indexOf(Le)+1).find(function(be){return p1(be)}):$.slice(0,$.indexOf(Le)).reverse().find(function(be){return p1(be)}):x[Ve+(pe?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(w){return w.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(w){return w.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},N=function(w){var x=w.activeElement;if(x)return x.shadowRoot&&x.shadowRoot.activeElement!==null?N(x.shadowRoot):x},L=function(w){if(w!==!1&&w!==N(document)){if(!w||!w.focus){L(C());return}w.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=w,bp(w)&&w.select()}},p=function(w){var x=u("setReturnFocus",{params:[w]});return x||(x===!1?!1:w)},m=function(w){var x=w.target,$=w.event,ee=w.isBackward,j=ee===void 0?!1:ee;x=x||Lr($),S();var ne=null;if(s.tabbableGroups.length>0){var X=I(x,$),te=X>=0?s.containerGroups[X]:void 0;if(X<0)j?ne=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:ne=s.tabbableGroups[0].firstTabbableNode;else if(j){var Ae=s.tabbableGroups.findIndex(function(Qe){var _e=Qe.firstTabbableNode;return x===_e});if(Ae<0&&(te.container===x||Ia(x,i.tabbableOptions)&&!p1(x,i.tabbableOptions)&&!te.nextTabbableNode(x,!1))&&(Ae=X),Ae>=0){var Le=Ae===0?s.tabbableGroups.length-1:Ae-1,pe=s.tabbableGroups[Le];ne=e1(x)>=0?pe.lastTabbableNode:pe.lastDomTabbableNode}else An($)||(ne=te.nextTabbableNode(x,!1))}else{var Ve=s.tabbableGroups.findIndex(function(Qe){var _e=Qe.lastTabbableNode;return x===_e});if(Ve<0&&(te.container===x||Ia(x,i.tabbableOptions)&&!p1(x,i.tabbableOptions)&&!te.nextTabbableNode(x))&&(Ve=X),Ve>=0){var be=Ve===s.tabbableGroups.length-1?0:Ve+1,xe=s.tabbableGroups[be];ne=e1(x)>=0?xe.firstTabbableNode:xe.firstDomTabbableNode}else An($)||(ne=te.nextTabbableNode(x))}}else ne=u("fallbackFocus");return ne},f=function(w){var x=Lr(w);if(!(I(x,w)>=0)){if(sn(i.clickOutsideDeactivates,w)){E.deactivate({returnFocus:i.returnFocusOnDeactivate});return}sn(i.allowOutsideClick,w)||w.preventDefault()}},T=function(w){var x=Lr(w),$=I(x,w)>=0;if($||x instanceof Document)$&&(s.mostRecentlyFocusedNode=x);else{w.stopImmediatePropagation();var ee,j=!0;if(s.mostRecentlyFocusedNode)if(e1(s.mostRecentlyFocusedNode)>0){var ne=I(s.mostRecentlyFocusedNode),X=s.containerGroups[ne].tabbableNodes;if(X.length>0){var te=X.findIndex(function(Ae){return Ae===s.mostRecentlyFocusedNode});te>=0&&(i.isKeyForward(s.recentNavEvent)?te+1<X.length&&(ee=X[te+1],j=!1):te-1>=0&&(ee=X[te-1],j=!1))}}else s.containerGroups.some(function(Ae){return Ae.tabbableNodes.some(function(Le){return e1(Le)>0})})||(j=!1);else j=!1;j&&(ee=m({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),L(ee||s.mostRecentlyFocusedNode||C())}s.recentNavEvent=void 0},h=function(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=w;var $=m({event:w,isBackward:x});$&&(An(w)&&w.preventDefault(),L($))},P=function(w){(i.isKeyForward(w)||i.isKeyBackward(w))&&h(w,i.isKeyBackward(w))},Z=function(w){Hp(w)&&sn(i.escapeDeactivates,w)!==!1&&(w.preventDefault(),E.deactivate())},G=function(w){var x=Lr(w);I(x,w)>=0||sn(i.clickOutsideDeactivates,w)||sn(i.allowOutsideClick,w)||(w.preventDefault(),w.stopImmediatePropagation())},k=function(){if(s.active)return Hi.activateTrap(A,E),s.delayInitialFocusTimer=i.delayInitialFocus?_i(function(){L(C())}):L(C()),a.addEventListener("focusin",T,!0),a.addEventListener("mousedown",f,{capture:!0,passive:!1}),a.addEventListener("touchstart",f,{capture:!0,passive:!1}),a.addEventListener("click",G,{capture:!0,passive:!1}),a.addEventListener("keydown",P,{capture:!0,passive:!1}),a.addEventListener("keydown",Z),E},H=function(){if(s.active)return a.removeEventListener("focusin",T,!0),a.removeEventListener("mousedown",f,!0),a.removeEventListener("touchstart",f,!0),a.removeEventListener("click",G,!0),a.removeEventListener("keydown",P,!0),a.removeEventListener("keydown",Z),E},V=function(w){var x=w.some(function($){var ee=Array.from($.removedNodes);return ee.some(function(j){return j===s.mostRecentlyFocusedNode})});x&&L(C())},D=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,F=function(){D&&(D.disconnect(),s.active&&!s.paused&&s.containers.map(function(w){D.observe(w,{subtree:!0,childList:!0})}))};return E={get active(){return s.active},get paused(){return s.paused},activate:function(w){if(s.active)return this;var x=O(w,"onActivate"),$=O(w,"onPostActivate"),ee=O(w,"checkCanFocusTrap");ee||S(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=a.activeElement,x==null||x();var j=function(){ee&&S(),k(),F(),$==null||$()};return ee?(ee(s.containers.concat()).then(j,j),this):(j(),this)},deactivate:function(w){if(!s.active)return this;var x=bi({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},w);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,H(),s.active=!1,s.paused=!1,F(),Hi.deactivateTrap(A,E);var $=O(x,"onDeactivate"),ee=O(x,"onPostDeactivate"),j=O(x,"checkCanReturnFocus"),ne=O(x,"returnFocus","returnFocusOnDeactivate");$==null||$();var X=function(){_i(function(){ne&&L(p(s.nodeFocusedBeforeActivation)),ee==null||ee()})};return ne&&j?(j(p(s.nodeFocusedBeforeActivation)).then(X,X),this):(X(),this)},pause:function(w){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,w)):this},unpause:function(w){return s.active?(s.manuallyPaused=!1,A[A.length-1]!==this?this:this._setPausedState(!1,w)):this},updateContainerElements:function(w){var x=[].concat(w).filter(Boolean);return s.containers=x.map(function($){return typeof $=="string"?a.querySelector($):$}),s.active&&S(),F(),this}},Object.defineProperties(E,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(w,x){if(s.paused===w)return this;if(s.paused=w,w){var $=O(x,"onPause"),ee=O(x,"onPostPause");$==null||$(),H(),F(),ee==null||ee()}else{var j=O(x,"onUnpause"),ne=O(x,"onPostUnpause");j==null||j(),S(),k(),F(),ne==null||ne()}return this}}}),E.updateContainerElements(t),E};function Wp(n,t={}){let r;const{immediate:a,...A}=t,i=e.ref(!1),s=e.ref(!1),E=S=>r&&r.activate(S),O=S=>r&&r.deactivate(S),I=()=>{r&&(r.pause(),s.value=!0)},u=()=>{r&&(r.unpause(),s.value=!1)},C=e.computed(()=>{const S=e.toValue(n);return Ip(S).map(N=>{const L=e.toValue(N);return typeof L=="string"?L:Np(L)}).filter(dp)});return e.watch(C,S=>{S.length&&(r=jp(S,{...A,onActivate(){i.value=!0,t.onActivate&&t.onActivate()},onDeactivate(){i.value=!1,t.onDeactivate&&t.onDeactivate()}}),a&&E())},{flush:"post"}),Ep(()=>O()),{hasFocus:i,isPaused:s,activate:E,deactivate:O,pause:I,unpause:u}}const Qp={class:"flex flex-row items-center gap-3 bg-neutral-surface rounded-2xl"},qp=["name","placeholder"],Yp={class:"flex flex-col gap-y-6"},Kp={key:1,class:"flex flex-col items-center justify-center flex-1 gap-4 py-8 text-neutral-lighter"},Xp={class:"text-sm font-semibold text-neutral-darker"},Jp={class:"text-sm font-normal"},eM={key:2,class:"flex py-2"},tM={key:0,class:"text-sm font-medium text-neutral-darker"},nM={class:"flex flex-col gap-1 w-full"},rM={key:0},oM={key:1,class:"flex-1 pl-6"},aM={key:3,class:"flex items-center gap-1 self-stretch"},lM={class:"text-sm font-normal text-neutral-darker"},AM={class:"fixed inset-0 transition-opacity"},iM={ref:"backdrop",class:"absolute inset-0 bg-gray-500 opacity-75"},sM=["primary","secondary"],cM=["default","filled","blank"],OM=e.defineComponent({__name:"ElInputSearch",props:e.mergeModels({...qn(),status:{type:String,default:"default"},text:{type:String,default:void 0},results:{type:Array,default:void 0},footer:{type:Object,default:void 0},blankResults:{type:Object,default:void 0},shouldHoverFirstResultOnOpen:{type:Boolean,default:!1},color:{type:String,default:"primary"}},{isOpen:{default:!0,required:!0,type:Boolean},isOpenModifiers:{}}),emits:e.mergeModels(["update:modelValue","onResultClick","onResultHover"],["update:isOpen"]),setup(n,{emit:t}){const r=n,a=t,A=e.useSlots(),i=yA(document.body),s=e.ref(null),E=e.computed(()=>r.modelValue),O=e.computed(()=>[r.validation]),I=e.computed(()=>({default:!r.results,filled:r.results&&r.results.length>0,blank:r.results&&r.results.length===0})),u=e.ref(!1),C=e.ref(!1),S=e.ref([]),N=e.ref(),{value:L,uuid:p,setValue:m}=e0(E,O,r.name,F=>{a("update:modelValue",F==null?void 0:F.trim())}),f=e.ref(),{hasFocus:T,activate:h,deactivate:P}=Wp(f),Z=e.useModel(n,"isOpen"),G=()=>{Z.value=!1,N.value=void 0},k=F=>{var b,w,x;(x=(w=(b=S.value)==null?void 0:b.at(F))==null?void 0:w.$el)==null||x.scrollIntoView({block:"nearest"})},H=F=>{a("onResultClick",F),m(""),N.value=void 0},V=F=>{N.value=F,k(F),a("onResultHover",F)},D=()=>G();return Wn("Escape",F=>{F.preventDefault(),G()}),Wn(["ArrowUp","ArrowDown","Enter"],F=>{var b;if(F.preventDefault(),F.stopPropagation(),T&&((b=r.results)!=null&&b.length))switch(F.key){case"ArrowUp":const w=Math.max((N.value??0)-1,0);V(w);break;case"ArrowDown":const x=N.value!==void 0?Math.min(N.value+1,r.results.length-1):0;V(x);break;case"Enter":N.value!==void 0&&H(N.value);break}}),e.watch([Z,s],async()=>{var F,b;i.value=Z.value,Z.value?((F=s.value)==null||F.focus(),r.shouldHoverFirstResultOnOpen&&((b=r.results)!=null&&b.length)&&V(0),await e.nextTick(),h()):P()}),(F,b)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(Q0,{name:"fade"},{default:e.withCtx(()=>[Z.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"searchBarRef",ref:f,class:"fixed inset-x-0 top-20 z-40 flex justify-center px-4 pb-6 sm:p-0"},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["m-10 z-50 md:max-w-3xl w-full flex flex-col p-6 border rounded-2xl border-neutral-surface bg-neutral-surface shadow-md",{"gap-6":r.results}])},[e.createElementVNode("div",Qp,[e.createVNode(Pe,{name:"MagnifyingGlassIcon",class:"text-neutral-lighter w-6 h-6"}),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:s,"onUpdate:modelValue":b[0]||(b[0]=w=>e.isRef(L)?L.value=w:null),name:F.id||`${e.unref(p)}`,type:"text",class:"p-0 text-lg font-normal flex-1 outline-none border-none bg-neutral-surface focus:ring-none focus:border-none focus:outline-none border-transparent focus:border-transparent focus:ring-0",placeholder:F.placeholder,onFocusin:b[1]||(b[1]=()=>{C.value=!0,u.value=!1}),onFocusout:b[2]||(b[2]=()=>{C.value=!1})},null,40,qp),[[e.vModelText,e.unref(L)]])]),e.createElementVNode("span",Yp,[n.results?(e.openBlock(),e.createBlock(Qo,{key:0,direction:"horizontal"})):e.createCommentVNode("",!0),n.blankResults&&I.value.blank?(e.openBlock(),e.createElementBlock("div",Kp,[e.createVNode(Pe,e.mergeProps(n.blankResults.icon,{class:"w-7 h-7"}),null,16),e.createElementVNode("p",Xp,e.toDisplayString(n.blankResults.primaryRow),1),e.createElementVNode("p",Jp,e.toDisplayString(n.blankResults.secondaryRow),1)])):e.createCommentVNode("",!0),n.results&&I.value.filled?(e.openBlock(),e.createElementBlock("div",eM,[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col items-start flex-1 gap-6 overflow-y-auto max-h-50-screen",{"pr-6":e.unref(A).info&&n.results.length>0}])},[n.text?(e.openBlock(),e.createElementBlock("span",tM,e.toDisplayString(n.text),1)):e.createCommentVNode("",!0),e.createElementVNode("div",nM,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.results,(w,x)=>(e.openBlock(),e.createBlock(di,e.mergeProps({key:x,ref_for:!0,ref_key:"itemRefs",ref:S,color:n.color},w,{status:N.value===x?"hover":"default",tabindex:"-1",onClick:()=>H(x),onMouseover:()=>V(x)}),null,16,["color","status","onClick","onMouseover"]))),128))])],2),e.unref(A).info?(e.openBlock(),e.createElementBlock("div",rM,[e.createVNode(Qo,{direction:"vertical"})])):e.createCommentVNode("",!0),e.unref(A).info?(e.openBlock(),e.createElementBlock("div",oM,[e.renderSlot(F.$slots,"info")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.results&&n.footer?(e.openBlock(),e.createElementBlock("div",aM,[e.createElementVNode("span",lM,e.toDisplayString(n.footer.text),1),e.createVNode(e.unref(Ct),e.mergeProps(n.footer.button,{variant:"tertiary"}),null,16)])):e.createCommentVNode("",!0)])],2)),[[e.unref(ci),D]]),e.createElementVNode("div",AM,[e.createElementVNode("div",iM,null,512)])],512)):e.createCommentVNode("",!0)]),_:3})]))}}),EM=e.defineComponent({__name:"ElResponsiveTable",props:{columns:{},data:{},tableId:{},noFilters:{type:Boolean},rowsSelectionMode:{},rowsSelectionDisabled:{type:Boolean},color:{},loading:{type:Boolean},sortBy:{},desktopBehaviour:{},mobileBehaviour:{}},emits:["rows-selected","mobile:bulk:click","mobile:destructive:click","mobile:selection:exit","mobile:item:click"],setup(n,{expose:t,emit:r}){const a=window.matchMedia("(max-width: 768px)"),A=e.ref(a.matches),i=n,s=V=>{A.value=V.matches};e.onMounted(()=>{a.addEventListener("change",s)}),e.onUnmounted(()=>{a.removeEventListener("change",s)});const E=e.ref(null),O=e.ref(null),I=e.computed(()=>i.data.reduce((V,D)=>(V[D.id]=D,V),{})),u=e.computed(()=>{var V,D;return A.value?(V=O.value)==null?void 0:V.filteredData:(D=E.value)==null?void 0:D.filteredData}),C=async V=>{var D,F;A.value?(D=O.value)==null||D.selectRows(V):(F=E.value)==null||F.selectRows(V)},S=()=>{var V,D;A.value?(V=O.value)==null||V.unselectAllRows():(D=E.value)==null||D.unselectAllRows()},N=V=>({id:V.id,rowNotSelectable:V.rowNotSelectable,relatedObject:V.relatedObject,cells:V.cells.map(D=>{var F,b,w,x,$,ee,j;if(!D.type)return{type:"default",...D};switch(D.type){case"default":return{type:"default",mainIcon:(F=D.desktopBehaviour)==null?void 0:F.mainIcon,mainText:D.mainText,mainTextStyle:D.mainTextStyle,mainTextColor:D.mainTextColor,subIcon:(b=D.desktopBehaviour)==null?void 0:b.subIcon,subText:D.subText,avatar:D.avatar,clickAction:D.clickAction,longText:(w=D.desktopBehaviour)==null?void 0:w.longText,truncateSubText:(x=D.desktopBehaviour)==null?void 0:x.truncateSubText};case"tag":return{type:"tag",tag:{text:D.text??"",color:D.color,...($=D.desktopBehaviour)==null?void 0:$.tag},subText:(ee=D.desktopBehaviour)==null?void 0:ee.subText,truncateSubText:(j=D.desktopBehaviour)==null?void 0:j.truncateSubText};case"action":return{type:"action",buttons:D.buttons,iconButtons:D.iconButtons,dropdown:D.dropdown}}})});t({filteredData:u,selectRows:C,unselectAllRows:S,getDataRows:()=>{var V,D;return A.value?((D=O.value)==null?void 0:D.getDataRows().map(F=>I.value[F.id]))||[]:((V=E.value)==null?void 0:V.getDataRows().map(F=>I.value[F.id]))||[]},getSelectedRows:()=>{var V,D;return A.value?((D=O.value)==null?void 0:D.getSelectedRows().map(F=>I.value[F.id]))||[]:((V=E.value)==null?void 0:V.getSelectedRows().map(F=>I.value[F.id]))||[]},closeMobileTableItemDetails:()=>{var V;(V=O.value)==null||V.closeItemDetails()}});const f=e.computed(()=>i.data.map(V=>{var Ve,be,xe,Qe,_e,Et,c0,wt,gt,n0,et,ht,W,se,Ee;let D,F,b,w,x,$,ee,j,ne;const X=[];let te,Ae;const Le=[];for(const[Oe,ae]of V.cells.entries()){const Ze=i.columns[Oe];if(!Ze)throw new Error("Missing column for cell at index "+Oe);if(ae.type==="default")if(Array.isArray((Ve=Ze.mobileBehaviour)==null?void 0:Ve.position))for(const le of Ze.mobileBehaviour.position)le.to==="avatar"?Le.push({label:le.withLabel,value:{type:"avatar",...ae.avatar}}):Le.push({label:le.withLabel,value:{type:"default",text:ae[le.take]??""}});else ae.avatar?Le.push({label:Ze.title,value:{type:"avatar",...ae.avatar}}):Le.push({label:Ze.title,value:{type:"default",text:ae.mainText}});else ae.type==="tag"&&Le.push({label:Ze.title,value:{type:"tag",text:((be=ae.desktopBehaviour)==null?void 0:be.tag.text)??ae.text??"",color:((xe=ae.desktopBehaviour)==null?void 0:xe.tag.color)??ae.color}});const ue=Ze.mobileBehaviour;if(!(!ue&&ae.type!=="action")){if(ae.type==="default")if(Array.isArray(ue.position))for(const le of ue.position)switch(le.to){case"time":ne=ae[le.take];break;case"mainText":D=ae[le.take],F=ae.mainTextStyle,b=ae.mainTextColor;break;case"secondaryRow":w=ae[le.take];break;case"tertiaryRow":x=ae[le.take];break;case"amount":$=ae[le.take];break;case"avatar":ee=(Qe=ae.avatar)==null?void 0:Qe.label,j=(_e=ae.avatar)==null?void 0:_e.picture;break}else{switch(ue.position){case"mainText":D=ae.mainText,F=ae.mainTextStyle,b=ae.mainTextColor;break;case"secondaryRow":w=ae.subText??ae.mainText;break;case"avatar":ee=(Et=ae.avatar)==null?void 0:Et.label,j=(c0=ae.avatar)==null?void 0:c0.picture;break;case"amount":$=((wt=ae.mobileBehaviour)==null?void 0:wt.amountText)??ae.mainText;break;case"tertiaryRow":x=((gt=ae.mobileBehaviour)==null?void 0:gt.tertiaryText)??ae.mainText;break;case"tags":console.warn("Skipping tags mobile position on cell type default, for tags to be used in mobile table, use cell type tag");break;case"time":ne=((n0=ae.mobileBehaviour)==null?void 0:n0.timeText)??ae.mainText;break}continue}if(ae.type==="tag"&&ue.position==="tags"){const le=((et=ae.desktopBehaviour)==null?void 0:et.tag.text)??ae.text??"";X.push({key:le,text:le,color:((ht=ae.desktopBehaviour)==null?void 0:ht.tag.color)??ae.color});continue}ae.type=="action"&&((W=ae.mobileBehaviour)!=null&&W.primary&&(te=ae.mobileBehaviour.primary),(se=ae.mobileBehaviour)!=null&&se.secondary&&(Ae=ae.mobileBehaviour.secondary))}}let pe;if(te&&(pe={primary:te,secondary:Ae}),!D)throw new Error("Missing mainText for mobile item");return{id:V.id,rowNotSelectable:V.rowNotSelectable,relatedObject:V.relatedObject,time:ne,mainText:{label:D,style:F,color:b},secondaryRow:w,tertiaryRow:x,tags:X,amount:$,avatar:ee||j?{label:ee,picture:j}:void 0,trailingIcon:(Ee=V.mobileBehaviour)==null?void 0:Ee.trailingIcon,actions:pe,details:Le}})),T=e.computed(()=>i.data.map(N)),h=e.computed(()=>{const V={};return i.noFilters||i.columns.filter(D=>!!D.filter).forEach(D=>{var F,b,w,x,$;switch(D.filter.type){case"FREE_SEARCH":if(!((F=D.mobileBehaviour)!=null&&F.position))return;V.freeSearch||(V.freeSearch={filterOn:[]}),D.filter.initialValue&&(V.freeSearch.initialValue=D.filter.initialValue,V.freeSearch.placeholder=D.filter.placeholder),(b=V.freeSearch)==null||b.filterOn.push(...Array.isArray(D.mobileBehaviour.position)?D.mobileBehaviour.position.map(j=>j.to):[D.mobileBehaviour.position]);break;case"DATE_RANGE":V.dateRange||(V.dateRange={label:D.title,enabled:!0,initialValue:D.filter.initialValue,placeholder:D.filter.placeholder});break;case"MULTI_VALUE":if(!((w=D.mobileBehaviour)!=null&&w.position))return;V.multiValue||(V.multiValue={});let ee;if(Array.isArray(D.mobileBehaviour.position)?ee=((x=D.filter.mobileBehaviour)==null?void 0:x.position)??(($=D.mobileBehaviour.position.at(0))==null?void 0:$.to):ee=D.mobileBehaviour.position,!ee)return;V.multiValue[ee]={enabled:!0,initialValue:D.filter.initialValue,selectOptions:D.filter.selectOptions,label:D.title};break;case"RESET_FILTERS_BUTTON":V.resetButton=!0;break}}),V}),P=e.computed(()=>{var V,D,F,b,w;if(((V=i.mobileBehaviour)==null?void 0:V.selection)!==void 0)return{enabled:i.rowsSelectionMode!==void 0&&i.rowsSelectionDisabled!==!0,selectionMode:i.rowsSelectionMode||"multiple",destructiveAction:(D=i.mobileBehaviour)==null?void 0:D.selection.destructiveAction,bulkActionButton:(F=i.mobileBehaviour)==null?void 0:F.selection.bulkActionButton,selectedLabel:(b=i.mobileBehaviour)==null?void 0:b.selection.selectedLabel,cancelText:(w=i.mobileBehaviour)==null?void 0:w.selection.cancelText}}),Z=V=>V.map(F=>F.id).map(F=>i.data.findIndex(b=>b.id===F)).map(F=>i.data[F]),G=V=>V.map(F=>F.id).map(F=>i.data.findIndex(b=>b.id===F)).map(F=>i.data[F]),k=V=>{const D=i.data.findIndex(F=>F.id===V.id);return i.data[D]},H=e.computed(()=>{var D,F;if(!i.sortBy||!i.sortBy.column)return;const V=i.columns[i.sortBy.column];if(!(!((D=V.mobileBehaviour)!=null&&D.position)||Array.isArray(V.mobileBehaviour.position)))return{on:(F=V.mobileBehaviour)==null?void 0:F.position,order:i.sortBy.order??"desc"}});return(V,D)=>{var F,b,w,x,$;return A.value?(e.openBlock(),e.createBlock(Ea,{key:1,ref_key:"mobileTable",ref:O,data:f.value,"sort-by":H.value,color:i.color,filters:h.value,selection:P.value,loading:i==null?void 0:i.loading,"prevent-default-item-click":($=i.mobileBehaviour)==null?void 0:$.preventDefaultItemClick,onRowsSelected:D[1]||(D[1]=ee=>V.$emit("rows-selected",G(ee))),"onSelection:exit":D[2]||(D[2]=()=>V.$emit("mobile:selection:exit")),"onBulk:click":D[3]||(D[3]=ee=>V.$emit("mobile:bulk:click",G(ee))),"onDestructive:click":D[4]||(D[4]=ee=>V.$emit("mobile:destructive:click",G(ee))),"onItem:click":D[5]||(D[5]=ee=>V.$emit("mobile:item:click",k(ee)))},{default:e.withCtx(()=>[e.renderSlot(V.$slots,"mobile")]),_:3},8,["data","sort-by","color","filters","selection","loading","prevent-default-item-click"])):(e.openBlock(),e.createBlock(ni,{key:0,ref_key:"desktopTable",ref:E,data:T.value,columns:i.columns,"table-id":i.tableId,"sort-by-col":(F=i.sortBy)==null?void 0:F.column,"sort-by-col-asc":((b=i.sortBy)==null?void 0:b.order)==="asc","no-filters":i.noFilters,"no-footer":(w=i.desktopBehaviour)==null?void 0:w.noFooter,"rows-selection-mode":i.rowsSelectionMode,"rows-selection-disabled":i.rowsSelectionDisabled,"initial-rows":(x=i.desktopBehaviour)==null?void 0:x.initialRows,loading:i==null?void 0:i.loading,onRowsSelected:D[0]||(D[0]=ee=>V.$emit("rows-selected",Z(ee)))},null,8,["data","columns","table-id","sort-by-col","sort-by-col-asc","no-filters","no-footer","rows-selection-mode","rows-selection-disabled","initial-rows","loading"]))}}}),$i=e.defineComponent({__name:"ElServerSideMobileTable",props:{selection:{},color:{},preventDefaultItemClick:{type:Boolean},filters:{},dataController:{type:Function}},emits:["bulk:click","destructive:click","selection:exit","rows-selected","item:click"],setup(n,{expose:t,emit:r}){const a=e.ref(!1),A=n,i=e.ref([]),s=e.ref(1),E=e.ref(void 0),O=e.ref({freeSearch:"",fromDate:0,multiSelect:{avatar:"",mainText:"",secondaryRow:"",tertiaryRow:"",amount:"",tags:"",time:""}}),I=()=>{a.value=!0,A.dataController({paginationStatus:{currentPage:s.value+1},filterStatus:O.value,triggeredEvent:"paginate"}).then(G=>{i.value.push(...G.data),E.value=G.totalRows}).finally(()=>{e.nextTick(()=>e.nextTick(()=>{a.value=!1})),s.value+=1})},u=G=>(a.value=!0,s.value=0,i.value=[],A.dataController({paginationStatus:{currentPage:0},filterStatus:O.value,triggeredEvent:G}).then(k=>{i.value=k.data,E.value=k.totalRows}).finally(()=>{e.nextTick(()=>e.nextTick(()=>{a.value=!1}))})),C=G=>{O.value=G,u("filter")};e.onMounted(()=>{u("firstLoad")});const S=()=>{E.value&&i.value.length<E.value&&I()},N=e.ref(),L=e.ref(void 0);e.onMounted(()=>{L.value=new IntersectionObserver(G=>{G.some(k=>k.isIntersecting)&&!a.value&&S()},{threshold:1}),N.value&&L.value.observe(N.value)}),e.watch(N,(G,k)=>{k&&L.value.unobserve(k),G&&L.value.observe(G)}),e.onUnmounted(()=>{L.value&&(L.value.disconnect(),L.value=void 0)});const p=e.ref(null);return t({selectRows:G=>{var k;(k=p.value)==null||k.selectRows(G)},unselectAllRows:()=>{var G;return(G=p.value)==null?void 0:G.unselectAllRows()},getSelectedRows:()=>{var G;return((G=p.value)==null?void 0:G.getSelectedRows())??[]},resetAllAndFetch:()=>{var G;return O.value={freeSearch:"",fromDate:0,multiSelect:{avatar:"",mainText:"",secondaryRow:"",tertiaryRow:"",amount:"",tags:"",time:""}},(G=p.value)==null||G.unselectAllRows(),u("firstLoad")},triggerDataController:async()=>{a.value=!0;const G=await A.dataController({paginationStatus:{currentPage:s.value},filterStatus:O.value,triggeredEvent:"trigger"});i.value=G.data,E.value=G.totalRows,a.value=!1},closeItemDetails:()=>{var G;(G=p.value)==null||G.closeItemDetails()}}),(G,k)=>{var H;return e.openBlock(),e.createBlock(Ea,{ref_key:"table",ref:p,color:A.color,selection:A.selection,data:i.value,filters:{...A.filters,freeSearch:(H=A.filters)!=null&&H.freeSearch?{placeholder:A.filters.freeSearch.placeholder,initialValue:A.filters.freeSearch.initialValue,filterOn:[]}:void 0,managed:!0},loading:a.value,"prevent-default-item-click":A.preventDefaultItemClick,onRowsSelected:k[0]||(k[0]=V=>G.$emit("rows-selected",V)),onFiltersUpdated:C,"onBulk:click":k[1]||(k[1]=V=>G.$emit("bulk:click",V)),"onSelection:exit":k[2]||(k[2]=V=>G.$emit("selection:exit")),"onDestructive:click":k[3]||(k[3]=V=>G.$emit("destructive:click",V)),"onItem:click":k[4]||(k[4]=V=>G.$emit("item:click",V))},{default:e.withCtx(()=>[e.renderSlot(G.$slots,"default")]),"after-list":e.withCtx(()=>[e.createElementVNode("div",{ref_key:"infiniteScrollEl",ref:N,class:"h-1 mb-2 shrink-0"},null,512)]),_:3},8,["color","selection","data","filters","loading","prevent-default-item-click"])}}}),dM=e.defineComponent({__name:"ElServerSideResponsiveTable",props:{mobileBehaviour:{},desktopBehaviour:{},sortBy:{},color:{},rowsSelectionMode:{},rowsSelectionDisabled:{type:Boolean},columns:{},dataController:{type:Function},rowsPerPage:{}},emits:["rows-selected","mobile:bulk:click","mobile:destructive:click","mobile:selection:exit","mobile:item:click"],setup(n,{expose:t,emit:r}){const a=window.matchMedia("(max-width: 768px)"),A=e.ref(a.matches),i=n,s=e.ref(null),E=e.ref(null),O=G=>{A.value=G.matches};e.onMounted(()=>{a.addEventListener("change",O)}),e.onUnmounted(()=>{a.removeEventListener("change",O)});const I=r,u=G=>{var k,H,V,D,F,b,w;if(!G.type)return{type:"default",...G};switch(G.type){case"default":return{type:"default",mainIcon:(k=G.desktopBehaviour)==null?void 0:k.mainIcon,mainText:G.mainText,mainTextStyle:G.mainTextStyle,mainTextColor:G.mainTextColor,subIcon:(H=G.desktopBehaviour)==null?void 0:H.subIcon,subText:G.subText,avatar:G.avatar,clickAction:G.clickAction,longText:(V=G.desktopBehaviour)==null?void 0:V.longText,truncateSubText:(D=G.desktopBehaviour)==null?void 0:D.truncateSubText,sortableAndFilterableValue:G.sortableAndFilterableValue};case"tag":return{type:"tag",tag:{text:((F=G.desktopBehaviour)==null?void 0:F.tag.text)??G.text??"",color:G.color},subText:(b=G.desktopBehaviour)==null?void 0:b.subText,truncateSubText:(w=G.desktopBehaviour)==null?void 0:w.truncateSubText,sortableAndFilterableValue:G.sortableAndFilterableValue};case"action":return{type:"action",buttons:G.buttons,iconButtons:G.iconButtons,dropdown:G.dropdown}}},C=G=>({id:G.id,rowNotSelectable:G.rowNotSelectable,cells:G.cells.map(u),relatedObject:G.relatedObject}),S=G=>{var Ae,Le,pe,Ve,be,xe,Qe,_e,Et,c0,wt,gt,n0,et;let k,H,V,D,F,b,w,x,$;const ee=[];let j,ne;const X=[];for(const[ht,W]of G.cells.entries()){const se=i.columns[ht];if(!se)throw new Error("Missing column for cell at index "+ht);if(W.type==="default")if(Array.isArray((Ae=se.mobileBehaviour)==null?void 0:Ae.position))for(const Oe of se.mobileBehaviour.position)Oe.to==="avatar"?X.push({label:Oe.withLabel,value:{type:"avatar",...W.avatar}}):X.push({label:Oe.withLabel,value:{type:"default",text:W[Oe.take]??""}});else W.avatar?X.push({label:se.title,value:{type:"avatar",...W.avatar}}):X.push({label:se.title,value:{type:"default",text:W.mainText}});else W.type==="tag"&&X.push({label:se.title,value:{type:"tag",text:((Le=W.desktopBehaviour)==null?void 0:Le.tag.text)??W.text??"",color:W.color}});const Ee=se.mobileBehaviour;if(!(!Ee&&W.type!=="action")){if(W.type==="default")if(Array.isArray(Ee.position))for(const Oe of Ee.position)switch(Oe.to){case"time":$=W[Oe.take];break;case"mainText":k=W[Oe.take],H=W.mainTextStyle,V=W.mainTextColor;break;case"secondaryRow":D=W[Oe.take];break;case"tertiaryRow":F=W[Oe.take];break;case"amount":b=W[Oe.take];break;case"avatar":w=(pe=W.avatar)==null?void 0:pe.label,x=(Ve=W.avatar)==null?void 0:Ve.picture;break}else{switch(Ee.position){case"mainText":k=W.mainText,H=W.mainTextStyle,V=W.mainTextColor;break;case"secondaryRow":D=W.subText??W.mainText;break;case"avatar":w=(be=W.avatar)==null?void 0:be.label,x=(xe=W.avatar)==null?void 0:xe.picture;break;case"amount":b=((Qe=W.mobileBehaviour)==null?void 0:Qe.amountText)??W.mainText;break;case"tertiaryRow":F=((_e=W.mobileBehaviour)==null?void 0:_e.tertiaryText)??W.mainText;break;case"tags":console.warn("Skipping tags mobile position on cell type default, for tags to be used in mobile table, use cell type tag");break;case"time":$=((Et=W.mobileBehaviour)==null?void 0:Et.timeText)??W.mainText;break}continue}if(W.type==="tag"&&Ee.position==="tags"){ee.push({key:W.text,text:((c0=W.desktopBehaviour)==null?void 0:c0.tag.text)??W.text??"",color:((wt=W.desktopBehaviour)==null?void 0:wt.tag.color)??W.color});continue}W.type=="action"&&((gt=W.mobileBehaviour)!=null&&gt.primary&&(j=W.mobileBehaviour.primary),(n0=W.mobileBehaviour)!=null&&n0.secondary&&(ne=W.mobileBehaviour.secondary))}}let te;if(j&&(te={primary:j,secondary:ne}),!k)throw new Error("Missing mainText for mobile item");return{id:G.id,rowNotSelectable:G.rowNotSelectable,relatedObject:G.relatedObject,time:$,mainText:{label:k,style:H,color:V},secondaryRow:D,tertiaryRow:F,tags:ee,amount:b,avatar:w||x?{label:w,picture:x}:void 0,trailingIcon:(et=G.mobileBehaviour)==null?void 0:et.trailingIcon,actions:te,details:X}},N=e.computed(()=>{var G,k,H,V,D,F,b,w,x;if(!(i.rowsSelectionDisabled||!((G=i.mobileBehaviour)!=null&&G.selection)))return{enabled:!i.rowsSelectionDisabled,selectionMode:i.rowsSelectionMode||"multiple",destructiveAction:(H=(k=i.mobileBehaviour)==null?void 0:k.selection)==null?void 0:H.destructiveAction,bulkActionButton:(D=(V=i.mobileBehaviour)==null?void 0:V.selection)==null?void 0:D.bulkActionButton,cancelText:(b=(F=i.mobileBehaviour)==null?void 0:F.selection)==null?void 0:b.cancelText,selectedLabel:(x=(w=i.mobileBehaviour)==null?void 0:w.selection)==null?void 0:x.selectedLabel}}),L=e.ref([]),p=G=>i.dataController({tableType:"desktop",...G}).then(k=>(G.triggeredEvent==="paginate"?L.value=[...L.value,...k.data]:L.value=k.data,{data:k.data.map(C),totalRows:k.totalRows})),m=G=>i.dataController({tableType:"mobile",...G,mobileFiltersStatus:G.filterStatus,filterStatus:i.columns.map(k=>{var V,D;const H=k.filter;if(H)switch(H.type){case"FREE_SEARCH":return{id:H.id,type:"FREE_SEARCH",columnTitle:k.title,textSearch:G.filterStatus.freeSearch??""};case"DATE_RANGE":return{id:H.id,type:"DATE_RANGE",columnTitle:k.title,dateFrom:G.filterStatus.fromDate??0};case"MULTI_VALUE":const F=((V=H.mobileBehaviour)==null?void 0:V.position)??((D=k.mobileBehaviour)==null?void 0:D.position);if(!F)return;if(Array.isArray(F)){console.warn(`Cannot map column ${k.title} mobile filter value since multiple mappings are defined, please specify the mobileBehaviour on the column.filter`);return}return{id:H.id,type:"MULTI_VALUE",columnTitle:k.title,textSearch:G.filterStatus.multiSelect[F]??""};case"RESET_FILTERS_BUTTON":return}}).filter(k=>k!==void 0)}).then(k=>(G.triggeredEvent==="paginate"?L.value=[...L.value,...k.data]:L.value=k.data,{data:k.data.map(S),totalRows:k.totalRows})),f=e.computed(()=>{const G={};return i.columns.forEach(k=>{var V,D;if(!k.filter)return;const H=k.mobileBehaviour;if(H){if(k.filter.type==="FREE_SEARCH"){G.freeSearch||(G.freeSearch={placeholder:k.title,initialValue:k.filter.initialValue});return}if(k.filter.type==="DATE_RANGE"){G.dateRange||(G.dateRange={enabled:!0,label:k.title,initialValue:k.filter.initialValue});return}if(k.filter.type==="RESET_FILTERS_BUTTON"){G.resetButton=!0;return}if(k.filter.type==="MULTI_VALUE")if(G.multiValue||(G.multiValue={}),Array.isArray(H.position)){const F=((V=k.filter.mobileBehaviour)==null?void 0:V.position)??((D=H.position.at(0))==null?void 0:D.to);if(!F)return;G.multiValue[F]={enabled:!0,label:k.title,selectOptions:k.filter.selectOptions,initialValue:k.filter.initialValue}}else G.multiValue[H.position]={enabled:!0,label:k.title,selectOptions:k.filter.selectOptions,initialValue:k.filter.initialValue}}}),G}),T=G=>G.map(H=>H.id).map(H=>L.value.findIndex(V=>V.id===H)).map(H=>L.value[H]),h=G=>{const k=L.value.findIndex(H=>H.id===G.id);return L.value[k]},P=G=>G.map(H=>H.id).map(H=>L.value.findIndex(V=>V.id===H)).map(H=>L.value[H]),Z=G=>{const k=L.value.findIndex(H=>H.id===G.id);return L.value[k]};return t({selectRows:G=>{var k,H;A.value?(k=E.value)==null||k.selectRows(G):(H=s.value)==null||H.selectRows(G)},resetAllAndFetch:()=>{var G,k;return A.value?(G=E.value)==null?void 0:G.resetAllAndFetch():(k=s.value)==null?void 0:k.resetAllAndFetch()},unselectAllRows:()=>{var G,k;A.value?(G=E.value)==null||G.unselectAllRows():(k=s.value)==null||k.unselectAllRows()},getDataRows:()=>L.value,getSelectedRows:()=>{var G,k;return A.value?(((G=E.value)==null?void 0:G.getSelectedRows())??[]).map(Z):(((k=s.value)==null?void 0:k.getSelectedRows())??[]).map(h)},triggerDataController:async()=>{var G,k;return A.value?(G=E.value)==null?void 0:G.triggerDataController():(k=s.value)==null?void 0:k.triggerDataController()},closeMobileTableItemDetails:()=>{var G;(G=E.value)==null||G.closeItemDetails()}}),(G,k)=>{var H;return A.value?(e.openBlock(),e.createBlock($i,{key:1,ref_key:"mobileTable",ref:E,color:i.color,selection:N.value,"data-controller":m,filters:f.value,"prevent-default-item-click":(H=i.mobileBehaviour)==null?void 0:H.preventDefaultItemClick,"onSelection:exit":k[1]||(k[1]=V=>I("mobile:selection:exit")),"onBulk:click":k[2]||(k[2]=V=>I("mobile:bulk:click",P(V))),onRowsSelected:k[3]||(k[3]=V=>G.$emit("rows-selected",P(V))),"onDestructive:click":k[4]||(k[4]=V=>G.$emit("mobile:destructive:click",P(V))),"onItem:click":k[5]||(k[5]=V=>I("mobile:item:click",Z(V)))},{default:e.withCtx(()=>[e.renderSlot(G.$slots,"mobile")]),_:3},8,["color","selection","filters","prevent-default-item-click"])):(e.openBlock(),e.createBlock(ri,{key:0,ref_key:"desktopTable",ref:s,columns:i.columns.map(V=>({...V,...V.desktopBehaviour})),"data-controller":p,"rows-per-page":i.rowsPerPage,onRowsSelected:k[0]||(k[0]=V=>G.$emit("rows-selected",T(V)))},null,8,["columns","rows-per-page"]))}}});Q.DrugDurationMeasures=Do,Q.DrugTimeMeasures=Po,Q.DrugUnitMeasures=Zo,Q.ElAccordion=oR,Q.ElActionButton=VB,Q.ElAvatar=W0,Q.ElBadge=J1,Q.ElButton=Ct,Q.ElCalendarCard=TR,Q.ElCalendarCell=qR,Q.ElCarousel=TB,Q.ElClipToAnchor=xo,Q.ElContainerTemplate=gh,Q.ElDivider=Qo,Q.ElDrawer=$A,Q.ElDropdown=_o,Q.ElFile=zA,Q.ElIcon=Pe,Q.ElIconButton=lt,Q.ElInlineBanner=tf,Q.ElInputCheckbox=Y0,Q.ElInputContainer=t0,Q.ElInputDate=Kn,Q.ElInputFile=e9,Q.ElInputMeasureUnit=o9,Q.ElInputNumber=l9,Q.ElInputPhone=E9,Q.ElInputRadioButton=sf,Q.ElInputSearch=OM,Q.ElInputSelect=Xn,Q.ElInputSwitch=Fh,Q.ElInputText=m1,Q.ElInputTextarea=R9,Q.ElItem=Ho,Q.ElListItem=Di,Q.ElLogo=P9,Q.ElMobileTable=Ea,Q.ElModal=Ko,Q.ElResponsiveTable=EM,Q.ElServerSideMobileTable=$i,Q.ElServerSideResponsiveTable=dM,Q.ElServerSideTable=ri,Q.ElSortingHeader=YA,Q.ElSpinner=tn,Q.ElSuggestionChip=F9,Q.ElTab=yo,Q.ElTabGroup=Uo,Q.ElTable=ni,Q.ElTableHead=y9,Q.ElTabs=H9,Q.ElTag=Jn,Q.ElToast=QS,Q.ElTooltip=h1,Q.ElVerticalTab=di,Q.EltyTailwindPlugin=K7,Q.EltyTailwindPluginWithoutStyle=X7,Q.EltyTailwindPreset=q7,Q.EltyVuePlugin=$7,Q.Role=zn,Q.defineValidationRules=TA,Q.elAccordionColors=rR,Q.elActionButtonColors=pB,Q.elActionButtonSizes=BB,Q.elActionButtonStatus=MB,Q.elAvatarSizes=AR,Q.elBadgeColors=iR,Q.elButtonSizes=IR,Q.elButtonVariants=NR,Q.elCalendarCardColors=SR,Q.elCalendarCardStatuses=fR,Q.elCalendarCellAvailabilities=QR,Q.elCalendarCellColors=WR,Q.elCarouselSizes=fB,Q.elClipToAnchorPositions=bA,Q.elContainerTemplateVariants=wh,Q.elDividerDirection=KT,Q.elDropdownMaxHeight=wS,Q.elFileVariants=PS,Q.elIconButtonSizes=iS,Q.elIconColors=GA,Q.elInlineBannerStatuses=ef,Q.elInputCheckboxColors=xS,Q.elInputCheckboxModelValues=yS,Q.elInputCheckboxSizes=FS,Q.elInputDateTypes=bS,Q.elInputFileTypes=JS,Q.elInputSearchColors=sM,Q.elInputSearchStatus=cM,Q.elInputTextTypes=IS,Q.elLogoColors=g9,Q.elLogoVariants=D9,Q.elModalColors=ch,Q.elModalSizes=or,Q.elModalSizesBreakpoints=Ei,Q.elRadioButtonColors=Af,Q.elRadioButtonSizes=lf,Q.elSortingHeaderDirections=v9,Q.elSpinnerSize=q9,Q.elSwitchAligns=vh,Q.elSwitchColors=kh,Q.elSwitchSizes=Zh,Q.elTabColors=JR,Q.elTabStatuses=XR,Q.elTagColors=$9,Q.elTagSizes=z9,Q.elToastStates=jS,Q.elTooltipPositions=$R,Q.elVerticalTabColors=Lh,Q.elVerticalTabStatus=uh,Q.toast=WA,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ui(n,t){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);t&&(a=a.filter(function(A){return Object.getOwnPropertyDescriptor(n,A).enumerable})),r.push.apply(r,a)}return r}function bi(n){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ui(Object(r),!0).forEach(function(a){Zp(n,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ui(Object(r)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(r,a))})}return n}function Fp(n){return Pp(n)||kp(n)||Up(n)||vp()}function xp(n,t){if(typeof n!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var a=r.call(n,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function yp(n){var t=xp(n,"string");return typeof t=="symbol"?t:t+""}function Up(n,t){if(n){if(typeof n=="string")return Na(n,t);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Na(n,t):void 0}}var Hi={activateTrap:function(t,r){if(t.length>0){var a=t[t.length-1];a!==r&&a._setPausedState(!0)}var A=t.indexOf(r);A===-1||t.splice(A,1),t.push(r)},deactivateTrap:function(t,r){var a=t.indexOf(r);a!==-1&&t.splice(a,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},bp=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Hp=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},An=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},_p=function(t){return An(t)&&!t.shiftKey},$p=function(t){return An(t)&&t.shiftKey},_i=function(t){return setTimeout(t,0)},sn=function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),A=1;A<r;A++)a[A-1]=arguments[A];return typeof t=="function"?t.apply(void 0,a):t},Lr=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},zp=[],jp=function(t,r){var a=(r==null?void 0:r.document)||document,A=(r==null?void 0:r.trapStack)||zp,i=bi({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:_p,isKeyBackward:$p},r),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},E,O=function(w,x,$){return w&&w[x]!==void 0?w[x]:i[$||x]},I=function(w,x){var $=typeof(x==null?void 0:x.composedPath)=="function"?x.composedPath():void 0;return s.containerGroups.findIndex(function(ee){var j=ee.container,ne=ee.tabbableNodes;return j.contains(w)||($==null?void 0:$.includes(j))||ne.find(function(X){return X===w})})},u=function(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=x.hasFallback,ee=$===void 0?!1:$,j=x.params,ne=j===void 0?[]:j,X=i[w];if(typeof X=="function"&&(X=X.apply(void 0,Fp(ne))),X===!0&&(X=void 0),!X){if(X===void 0||X===!1)return X;throw new Error("`".concat(w,"` was specified but was not a node, or did not return a node"))}var te=X;if(typeof X=="string"){try{te=a.querySelector(X)}catch(Ae){throw new Error("`".concat(w,'` appears to be an invalid selector; error="').concat(Ae.message,'"'))}if(!te&&!ee)throw new Error("`".concat(w,"` as selector refers to no known node"))}return te},C=function(){var w=u("initialFocus",{hasFallback:!0});if(w===!1)return!1;if(w===void 0||w&&!Ia(w,i.tabbableOptions))if(I(a.activeElement)>=0)w=a.activeElement;else{var x=s.tabbableGroups[0],$=x&&x.firstTabbableNode;w=$||u("fallbackFocus")}else w===null&&(w=u("fallbackFocus"));if(!w)throw new Error("Your focus-trap needs to have at least one focusable element");return w},S=function(){if(s.containerGroups=s.containers.map(function(w){var x=wp(w,i.tabbableOptions),$=gp(w,i.tabbableOptions),ee=x.length>0?x[0]:void 0,j=x.length>0?x[x.length-1]:void 0,ne=$.find(function(Ae){return p1(Ae)}),X=$.slice().reverse().find(function(Ae){return p1(Ae)}),te=!!x.find(function(Ae){return e1(Ae)>0});return{container:w,tabbableNodes:x,focusableNodes:$,posTabIndexesFound:te,firstTabbableNode:ee,lastTabbableNode:j,firstDomTabbableNode:ne,lastDomTabbableNode:X,nextTabbableNode:function(Le){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ve=x.indexOf(Le);return Ve<0?pe?$.slice($.indexOf(Le)+1).find(function(be){return p1(be)}):$.slice(0,$.indexOf(Le)).reverse().find(function(be){return p1(be)}):x[Ve+(pe?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(w){return w.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(w){return w.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},N=function(w){var x=w.activeElement;if(x)return x.shadowRoot&&x.shadowRoot.activeElement!==null?N(x.shadowRoot):x},L=function(w){if(w!==!1&&w!==N(document)){if(!w||!w.focus){L(C());return}w.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=w,bp(w)&&w.select()}},p=function(w){var x=u("setReturnFocus",{params:[w]});return x||(x===!1?!1:w)},m=function(w){var x=w.target,$=w.event,ee=w.isBackward,j=ee===void 0?!1:ee;x=x||Lr($),S();var ne=null;if(s.tabbableGroups.length>0){var X=I(x,$),te=X>=0?s.containerGroups[X]:void 0;if(X<0)j?ne=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:ne=s.tabbableGroups[0].firstTabbableNode;else if(j){var Ae=s.tabbableGroups.findIndex(function(Qe){var _e=Qe.firstTabbableNode;return x===_e});if(Ae<0&&(te.container===x||Ia(x,i.tabbableOptions)&&!p1(x,i.tabbableOptions)&&!te.nextTabbableNode(x,!1))&&(Ae=X),Ae>=0){var Le=Ae===0?s.tabbableGroups.length-1:Ae-1,pe=s.tabbableGroups[Le];ne=e1(x)>=0?pe.lastTabbableNode:pe.lastDomTabbableNode}else An($)||(ne=te.nextTabbableNode(x,!1))}else{var Ve=s.tabbableGroups.findIndex(function(Qe){var _e=Qe.lastTabbableNode;return x===_e});if(Ve<0&&(te.container===x||Ia(x,i.tabbableOptions)&&!p1(x,i.tabbableOptions)&&!te.nextTabbableNode(x))&&(Ve=X),Ve>=0){var be=Ve===s.tabbableGroups.length-1?0:Ve+1,xe=s.tabbableGroups[be];ne=e1(x)>=0?xe.firstTabbableNode:xe.firstDomTabbableNode}else An($)||(ne=te.nextTabbableNode(x))}}else ne=u("fallbackFocus");return ne},f=function(w){var x=Lr(w);if(!(I(x,w)>=0)){if(sn(i.clickOutsideDeactivates,w)){E.deactivate({returnFocus:i.returnFocusOnDeactivate});return}sn(i.allowOutsideClick,w)||w.preventDefault()}},T=function(w){var x=Lr(w),$=I(x,w)>=0;if($||x instanceof Document)$&&(s.mostRecentlyFocusedNode=x);else{w.stopImmediatePropagation();var ee,j=!0;if(s.mostRecentlyFocusedNode)if(e1(s.mostRecentlyFocusedNode)>0){var ne=I(s.mostRecentlyFocusedNode),X=s.containerGroups[ne].tabbableNodes;if(X.length>0){var te=X.findIndex(function(Ae){return Ae===s.mostRecentlyFocusedNode});te>=0&&(i.isKeyForward(s.recentNavEvent)?te+1<X.length&&(ee=X[te+1],j=!1):te-1>=0&&(ee=X[te-1],j=!1))}}else s.containerGroups.some(function(Ae){return Ae.tabbableNodes.some(function(Le){return e1(Le)>0})})||(j=!1);else j=!1;j&&(ee=m({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),L(ee||s.mostRecentlyFocusedNode||C())}s.recentNavEvent=void 0},h=function(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=w;var $=m({event:w,isBackward:x});$&&(An(w)&&w.preventDefault(),L($))},P=function(w){(i.isKeyForward(w)||i.isKeyBackward(w))&&h(w,i.isKeyBackward(w))},Z=function(w){Hp(w)&&sn(i.escapeDeactivates,w)!==!1&&(w.preventDefault(),E.deactivate())},G=function(w){var x=Lr(w);I(x,w)>=0||sn(i.clickOutsideDeactivates,w)||sn(i.allowOutsideClick,w)||(w.preventDefault(),w.stopImmediatePropagation())},k=function(){if(s.active)return Hi.activateTrap(A,E),s.delayInitialFocusTimer=i.delayInitialFocus?_i(function(){L(C())}):L(C()),a.addEventListener("focusin",T,!0),a.addEventListener("mousedown",f,{capture:!0,passive:!1}),a.addEventListener("touchstart",f,{capture:!0,passive:!1}),a.addEventListener("click",G,{capture:!0,passive:!1}),a.addEventListener("keydown",P,{capture:!0,passive:!1}),a.addEventListener("keydown",Z),E},H=function(){if(s.active)return a.removeEventListener("focusin",T,!0),a.removeEventListener("mousedown",f,!0),a.removeEventListener("touchstart",f,!0),a.removeEventListener("click",G,!0),a.removeEventListener("keydown",P,!0),a.removeEventListener("keydown",Z),E},V=function(w){var x=w.some(function($){var ee=Array.from($.removedNodes);return ee.some(function(j){return j===s.mostRecentlyFocusedNode})});x&&L(C())},D=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,F=function(){D&&(D.disconnect(),s.active&&!s.paused&&s.containers.map(function(w){D.observe(w,{subtree:!0,childList:!0})}))};return E={get active(){return s.active},get paused(){return s.paused},activate:function(w){if(s.active)return this;var x=O(w,"onActivate"),$=O(w,"onPostActivate"),ee=O(w,"checkCanFocusTrap");ee||S(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=a.activeElement,x==null||x();var j=function(){ee&&S(),k(),F(),$==null||$()};return ee?(ee(s.containers.concat()).then(j,j),this):(j(),this)},deactivate:function(w){if(!s.active)return this;var x=bi({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},w);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,H(),s.active=!1,s.paused=!1,F(),Hi.deactivateTrap(A,E);var $=O(x,"onDeactivate"),ee=O(x,"onPostDeactivate"),j=O(x,"checkCanReturnFocus"),ne=O(x,"returnFocus","returnFocusOnDeactivate");$==null||$();var X=function(){_i(function(){ne&&L(p(s.nodeFocusedBeforeActivation)),ee==null||ee()})};return ne&&j?(j(p(s.nodeFocusedBeforeActivation)).then(X,X),this):(X(),this)},pause:function(w){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,w)):this},unpause:function(w){return s.active?(s.manuallyPaused=!1,A[A.length-1]!==this?this:this._setPausedState(!1,w)):this},updateContainerElements:function(w){var x=[].concat(w).filter(Boolean);return s.containers=x.map(function($){return typeof $=="string"?a.querySelector($):$}),s.active&&S(),F(),this}},Object.defineProperties(E,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(w,x){if(s.paused===w)return this;if(s.paused=w,w){var $=O(x,"onPause"),ee=O(x,"onPostPause");$==null||$(),H(),F(),ee==null||ee()}else{var j=O(x,"onUnpause"),ne=O(x,"onPostUnpause");j==null||j(),S(),k(),F(),ne==null||ne()}return this}}}),E.updateContainerElements(t),E};function Wp(n,t={}){let r;const{immediate:a,...A}=t,i=e.ref(!1),s=e.ref(!1),E=S=>r&&r.activate(S),O=S=>r&&r.deactivate(S),I=()=>{r&&(r.pause(),s.value=!0)},u=()=>{r&&(r.unpause(),s.value=!1)},C=e.computed(()=>{const S=e.toValue(n);return Ip(S).map(N=>{const L=e.toValue(N);return typeof L=="string"?L:Np(L)}).filter(dp)});return e.watch(C,S=>{S.length&&(r=jp(S,{...A,onActivate(){i.value=!0,t.onActivate&&t.onActivate()},onDeactivate(){i.value=!1,t.onDeactivate&&t.onDeactivate()}}),a&&E())},{flush:"post"}),Ep(()=>O()),{hasFocus:i,isPaused:s,activate:E,deactivate:O,pause:I,unpause:u}}const Qp={class:"flex flex-row items-center gap-3 bg-neutral-surface rounded-2xl"},qp=["name","placeholder"],Yp={class:"flex flex-col gap-y-6 overflow-y-hidden"},Kp={key:1,class:"flex flex-col items-center justify-center flex-1 gap-4 py-8 text-neutral-lighter"},Xp={class:"text-sm font-semibold text-neutral-darker"},Jp={class:"text-sm font-normal"},eM={key:2,class:"flex py-2 overflow-y-hidden"},tM={key:0,class:"text-sm font-medium text-neutral-darker"},nM={class:"flex flex-col gap-1 w-full"},rM={key:0},oM={key:1,class:"flex-1 pl-6 overflow-y-auto"},aM={key:3,class:"flex items-center gap-1 self-stretch"},lM={class:"text-sm font-normal text-neutral-darker"},AM={class:"fixed inset-0 transition-opacity"},iM={ref:"backdrop",class:"absolute inset-0 bg-gray-500 opacity-75"},sM=["primary","secondary"],cM=["default","filled","blank"],OM=e.defineComponent({__name:"ElInputSearch",props:e.mergeModels({...qn(),status:{type:String,default:"default"},text:{type:String,default:void 0},results:{type:Array,default:void 0},footer:{type:Object,default:void 0},blankResults:{type:Object,default:void 0},shouldHoverFirstResultOnOpen:{type:Boolean,default:!1},color:{type:String,default:"primary"}},{isOpen:{default:!0,required:!0,type:Boolean},isOpenModifiers:{}}),emits:e.mergeModels(["update:modelValue","onResultClick","onResultHover"],["update:isOpen"]),setup(n,{emit:t}){const r=n,a=t,A=e.useSlots(),i=yA(document.body),s=e.ref(null),E=e.computed(()=>r.modelValue),O=e.computed(()=>[r.validation]),I=e.computed(()=>({default:!r.results,filled:r.results&&r.results.length>0,blank:r.results&&r.results.length===0})),u=e.ref(!1),C=e.ref(!1),S=e.ref([]),N=e.ref(),{value:L,uuid:p,setValue:m}=e0(E,O,r.name,F=>{a("update:modelValue",F==null?void 0:F.trim())}),f=e.ref(),{hasFocus:T,activate:h,deactivate:P}=Wp(f),Z=e.useModel(n,"isOpen"),G=()=>{Z.value=!1,N.value=void 0},k=F=>{var b,w,x;(x=(w=(b=S.value)==null?void 0:b.at(F))==null?void 0:w.$el)==null||x.scrollIntoView({block:"nearest"})},H=F=>{a("onResultClick",F),m(""),N.value=void 0},V=F=>{N.value=F,k(F),a("onResultHover",F)},D=()=>G();return Wn("Escape",F=>{F.preventDefault(),G()}),Wn(["ArrowUp","ArrowDown","Enter"],F=>{var b;if(F.preventDefault(),F.stopPropagation(),T&&((b=r.results)!=null&&b.length))switch(F.key){case"ArrowUp":const w=Math.max((N.value??0)-1,0);V(w);break;case"ArrowDown":const x=N.value!==void 0?Math.min(N.value+1,r.results.length-1):0;V(x);break;case"Enter":N.value!==void 0&&H(N.value);break}}),e.watch([Z,s],async()=>{var F,b;i.value=Z.value,Z.value?((F=s.value)==null||F.focus(),r.shouldHoverFirstResultOnOpen&&((b=r.results)!=null&&b.length)&&V(0),await e.nextTick(),h()):P()}),(F,b)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(Q0,{name:"fade"},{default:e.withCtx(()=>[Z.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"searchBarRef",ref:f,class:"fixed inset-x-0 top-0 z-40 flex justify-center max-h-full overflow-y-auto px-4 pt-20 pb-6 max-sm:p-0"},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["m-10 z-50 md:max-w-3xl w-full flex flex-col p-6 border rounded-2xl border-neutral-surface bg-neutral-surface shadow-md",{"gap-6":r.results}])},[e.createElementVNode("div",Qp,[e.createVNode(Pe,{name:"MagnifyingGlassIcon",class:"text-neutral-lighter w-6 h-6"}),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:s,"onUpdate:modelValue":b[0]||(b[0]=w=>e.isRef(L)?L.value=w:null),name:F.id||`${e.unref(p)}`,type:"text",class:"p-0 text-lg font-normal flex-1 outline-none border-none bg-neutral-surface focus:ring-none focus:border-none focus:outline-none border-transparent focus:border-transparent focus:ring-0",placeholder:F.placeholder,onFocusin:b[1]||(b[1]=()=>{C.value=!0,u.value=!1}),onFocusout:b[2]||(b[2]=()=>{C.value=!1})},null,40,qp),[[e.vModelText,e.unref(L)]])]),e.createElementVNode("span",Yp,[n.results?(e.openBlock(),e.createBlock(Qo,{key:0,direction:"horizontal"})):e.createCommentVNode("",!0),n.blankResults&&I.value.blank?(e.openBlock(),e.createElementBlock("div",Kp,[e.createVNode(Pe,e.mergeProps(n.blankResults.icon,{class:"w-7 h-7"}),null,16),e.createElementVNode("p",Xp,e.toDisplayString(n.blankResults.primaryRow),1),e.createElementVNode("p",Jp,e.toDisplayString(n.blankResults.secondaryRow),1)])):e.createCommentVNode("",!0),n.results&&I.value.filled?(e.openBlock(),e.createElementBlock("div",eM,[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col items-start flex-1 gap-6 overflow-y-auto max-h-50-screen",{"pr-6":e.unref(A).info&&n.results.length>0}])},[n.text?(e.openBlock(),e.createElementBlock("span",tM,e.toDisplayString(n.text),1)):e.createCommentVNode("",!0),e.createElementVNode("div",nM,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.results,(w,x)=>(e.openBlock(),e.createBlock(di,e.mergeProps({key:x,ref_for:!0,ref_key:"itemRefs",ref:S,color:n.color},w,{status:N.value===x?"hover":"default",tabindex:"-1",onClick:()=>H(x),onMouseover:()=>V(x)}),null,16,["color","status","onClick","onMouseover"]))),128))])],2),e.unref(A).info?(e.openBlock(),e.createElementBlock("div",rM,[e.createVNode(Qo,{direction:"vertical"})])):e.createCommentVNode("",!0),e.unref(A).info?(e.openBlock(),e.createElementBlock("div",oM,[e.renderSlot(F.$slots,"info")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.results&&n.footer?(e.openBlock(),e.createElementBlock("div",aM,[e.createElementVNode("span",lM,e.toDisplayString(n.footer.text),1),e.createVNode(e.unref(Ct),e.mergeProps(n.footer.button,{variant:"tertiary"}),null,16)])):e.createCommentVNode("",!0)])],2)),[[e.unref(ci),D]]),e.createElementVNode("div",AM,[e.createElementVNode("div",iM,null,512)])],512)):e.createCommentVNode("",!0)]),_:3})]))}}),EM=e.defineComponent({__name:"ElResponsiveTable",props:{columns:{},data:{},tableId:{},noFilters:{type:Boolean},rowsSelectionMode:{},rowsSelectionDisabled:{type:Boolean},color:{},loading:{type:Boolean},sortBy:{},desktopBehaviour:{},mobileBehaviour:{}},emits:["rows-selected","mobile:bulk:click","mobile:destructive:click","mobile:selection:exit","mobile:item:click"],setup(n,{expose:t,emit:r}){const a=window.matchMedia("(max-width: 768px)"),A=e.ref(a.matches),i=n,s=V=>{A.value=V.matches};e.onMounted(()=>{a.addEventListener("change",s)}),e.onUnmounted(()=>{a.removeEventListener("change",s)});const E=e.ref(null),O=e.ref(null),I=e.computed(()=>i.data.reduce((V,D)=>(V[D.id]=D,V),{})),u=e.computed(()=>{var V,D;return A.value?(V=O.value)==null?void 0:V.filteredData:(D=E.value)==null?void 0:D.filteredData}),C=async V=>{var D,F;A.value?(D=O.value)==null||D.selectRows(V):(F=E.value)==null||F.selectRows(V)},S=()=>{var V,D;A.value?(V=O.value)==null||V.unselectAllRows():(D=E.value)==null||D.unselectAllRows()},N=V=>({id:V.id,rowNotSelectable:V.rowNotSelectable,relatedObject:V.relatedObject,cells:V.cells.map(D=>{var F,b,w,x,$,ee,j;if(!D.type)return{type:"default",...D};switch(D.type){case"default":return{type:"default",mainIcon:(F=D.desktopBehaviour)==null?void 0:F.mainIcon,mainText:D.mainText,mainTextStyle:D.mainTextStyle,mainTextColor:D.mainTextColor,subIcon:(b=D.desktopBehaviour)==null?void 0:b.subIcon,subText:D.subText,avatar:D.avatar,clickAction:D.clickAction,longText:(w=D.desktopBehaviour)==null?void 0:w.longText,truncateSubText:(x=D.desktopBehaviour)==null?void 0:x.truncateSubText};case"tag":return{type:"tag",tag:{text:D.text??"",color:D.color,...($=D.desktopBehaviour)==null?void 0:$.tag},subText:(ee=D.desktopBehaviour)==null?void 0:ee.subText,truncateSubText:(j=D.desktopBehaviour)==null?void 0:j.truncateSubText};case"action":return{type:"action",buttons:D.buttons,iconButtons:D.iconButtons,dropdown:D.dropdown}}})});t({filteredData:u,selectRows:C,unselectAllRows:S,getDataRows:()=>{var V,D;return A.value?((D=O.value)==null?void 0:D.getDataRows().map(F=>I.value[F.id]))||[]:((V=E.value)==null?void 0:V.getDataRows().map(F=>I.value[F.id]))||[]},getSelectedRows:()=>{var V,D;return A.value?((D=O.value)==null?void 0:D.getSelectedRows().map(F=>I.value[F.id]))||[]:((V=E.value)==null?void 0:V.getSelectedRows().map(F=>I.value[F.id]))||[]},closeMobileTableItemDetails:()=>{var V;(V=O.value)==null||V.closeItemDetails()}});const f=e.computed(()=>i.data.map(V=>{var Ve,be,xe,Qe,_e,Et,c0,wt,gt,n0,et,ht,W,se,Ee;let D,F,b,w,x,$,ee,j,ne;const X=[];let te,Ae;const Le=[];for(const[Oe,ae]of V.cells.entries()){const Ze=i.columns[Oe];if(!Ze)throw new Error("Missing column for cell at index "+Oe);if(ae.type==="default")if(Array.isArray((Ve=Ze.mobileBehaviour)==null?void 0:Ve.position))for(const le of Ze.mobileBehaviour.position)le.to==="avatar"?Le.push({label:le.withLabel,value:{type:"avatar",...ae.avatar}}):Le.push({label:le.withLabel,value:{type:"default",text:ae[le.take]??""}});else ae.avatar?Le.push({label:Ze.title,value:{type:"avatar",...ae.avatar}}):Le.push({label:Ze.title,value:{type:"default",text:ae.mainText}});else ae.type==="tag"&&Le.push({label:Ze.title,value:{type:"tag",text:((be=ae.desktopBehaviour)==null?void 0:be.tag.text)??ae.text??"",color:((xe=ae.desktopBehaviour)==null?void 0:xe.tag.color)??ae.color}});const ue=Ze.mobileBehaviour;if(!(!ue&&ae.type!=="action")){if(ae.type==="default")if(Array.isArray(ue.position))for(const le of ue.position)switch(le.to){case"time":ne=ae[le.take];break;case"mainText":D=ae[le.take],F=ae.mainTextStyle,b=ae.mainTextColor;break;case"secondaryRow":w=ae[le.take];break;case"tertiaryRow":x=ae[le.take];break;case"amount":$=ae[le.take];break;case"avatar":ee=(Qe=ae.avatar)==null?void 0:Qe.label,j=(_e=ae.avatar)==null?void 0:_e.picture;break}else{switch(ue.position){case"mainText":D=ae.mainText,F=ae.mainTextStyle,b=ae.mainTextColor;break;case"secondaryRow":w=ae.subText??ae.mainText;break;case"avatar":ee=(Et=ae.avatar)==null?void 0:Et.label,j=(c0=ae.avatar)==null?void 0:c0.picture;break;case"amount":$=((wt=ae.mobileBehaviour)==null?void 0:wt.amountText)??ae.mainText;break;case"tertiaryRow":x=((gt=ae.mobileBehaviour)==null?void 0:gt.tertiaryText)??ae.mainText;break;case"tags":console.warn("Skipping tags mobile position on cell type default, for tags to be used in mobile table, use cell type tag");break;case"time":ne=((n0=ae.mobileBehaviour)==null?void 0:n0.timeText)??ae.mainText;break}continue}if(ae.type==="tag"&&ue.position==="tags"){const le=((et=ae.desktopBehaviour)==null?void 0:et.tag.text)??ae.text??"";X.push({key:le,text:le,color:((ht=ae.desktopBehaviour)==null?void 0:ht.tag.color)??ae.color});continue}ae.type=="action"&&((W=ae.mobileBehaviour)!=null&&W.primary&&(te=ae.mobileBehaviour.primary),(se=ae.mobileBehaviour)!=null&&se.secondary&&(Ae=ae.mobileBehaviour.secondary))}}let pe;if(te&&(pe={primary:te,secondary:Ae}),!D)throw new Error("Missing mainText for mobile item");return{id:V.id,rowNotSelectable:V.rowNotSelectable,relatedObject:V.relatedObject,time:ne,mainText:{label:D,style:F,color:b},secondaryRow:w,tertiaryRow:x,tags:X,amount:$,avatar:ee||j?{label:ee,picture:j}:void 0,trailingIcon:(Ee=V.mobileBehaviour)==null?void 0:Ee.trailingIcon,actions:pe,details:Le}})),T=e.computed(()=>i.data.map(N)),h=e.computed(()=>{const V={};return i.noFilters||i.columns.filter(D=>!!D.filter).forEach(D=>{var F,b,w,x,$;switch(D.filter.type){case"FREE_SEARCH":if(!((F=D.mobileBehaviour)!=null&&F.position))return;V.freeSearch||(V.freeSearch={filterOn:[]}),D.filter.initialValue&&(V.freeSearch.initialValue=D.filter.initialValue,V.freeSearch.placeholder=D.filter.placeholder),(b=V.freeSearch)==null||b.filterOn.push(...Array.isArray(D.mobileBehaviour.position)?D.mobileBehaviour.position.map(j=>j.to):[D.mobileBehaviour.position]);break;case"DATE_RANGE":V.dateRange||(V.dateRange={label:D.title,enabled:!0,initialValue:D.filter.initialValue,placeholder:D.filter.placeholder});break;case"MULTI_VALUE":if(!((w=D.mobileBehaviour)!=null&&w.position))return;V.multiValue||(V.multiValue={});let ee;if(Array.isArray(D.mobileBehaviour.position)?ee=((x=D.filter.mobileBehaviour)==null?void 0:x.position)??(($=D.mobileBehaviour.position.at(0))==null?void 0:$.to):ee=D.mobileBehaviour.position,!ee)return;V.multiValue[ee]={enabled:!0,initialValue:D.filter.initialValue,selectOptions:D.filter.selectOptions,label:D.title};break;case"RESET_FILTERS_BUTTON":V.resetButton=!0;break}}),V}),P=e.computed(()=>{var V,D,F,b,w;if(((V=i.mobileBehaviour)==null?void 0:V.selection)!==void 0)return{enabled:i.rowsSelectionMode!==void 0&&i.rowsSelectionDisabled!==!0,selectionMode:i.rowsSelectionMode||"multiple",destructiveAction:(D=i.mobileBehaviour)==null?void 0:D.selection.destructiveAction,bulkActionButton:(F=i.mobileBehaviour)==null?void 0:F.selection.bulkActionButton,selectedLabel:(b=i.mobileBehaviour)==null?void 0:b.selection.selectedLabel,cancelText:(w=i.mobileBehaviour)==null?void 0:w.selection.cancelText}}),Z=V=>V.map(F=>F.id).map(F=>i.data.findIndex(b=>b.id===F)).map(F=>i.data[F]),G=V=>V.map(F=>F.id).map(F=>i.data.findIndex(b=>b.id===F)).map(F=>i.data[F]),k=V=>{const D=i.data.findIndex(F=>F.id===V.id);return i.data[D]},H=e.computed(()=>{var D,F;if(!i.sortBy||!i.sortBy.column)return;const V=i.columns[i.sortBy.column];if(!(!((D=V.mobileBehaviour)!=null&&D.position)||Array.isArray(V.mobileBehaviour.position)))return{on:(F=V.mobileBehaviour)==null?void 0:F.position,order:i.sortBy.order??"desc"}});return(V,D)=>{var F,b,w,x,$;return A.value?(e.openBlock(),e.createBlock(Ea,{key:1,ref_key:"mobileTable",ref:O,data:f.value,"sort-by":H.value,color:i.color,filters:h.value,selection:P.value,loading:i==null?void 0:i.loading,"prevent-default-item-click":($=i.mobileBehaviour)==null?void 0:$.preventDefaultItemClick,onRowsSelected:D[1]||(D[1]=ee=>V.$emit("rows-selected",G(ee))),"onSelection:exit":D[2]||(D[2]=()=>V.$emit("mobile:selection:exit")),"onBulk:click":D[3]||(D[3]=ee=>V.$emit("mobile:bulk:click",G(ee))),"onDestructive:click":D[4]||(D[4]=ee=>V.$emit("mobile:destructive:click",G(ee))),"onItem:click":D[5]||(D[5]=ee=>V.$emit("mobile:item:click",k(ee)))},{default:e.withCtx(()=>[e.renderSlot(V.$slots,"mobile")]),_:3},8,["data","sort-by","color","filters","selection","loading","prevent-default-item-click"])):(e.openBlock(),e.createBlock(ni,{key:0,ref_key:"desktopTable",ref:E,data:T.value,columns:i.columns,"table-id":i.tableId,"sort-by-col":(F=i.sortBy)==null?void 0:F.column,"sort-by-col-asc":((b=i.sortBy)==null?void 0:b.order)==="asc","no-filters":i.noFilters,"no-footer":(w=i.desktopBehaviour)==null?void 0:w.noFooter,"rows-selection-mode":i.rowsSelectionMode,"rows-selection-disabled":i.rowsSelectionDisabled,"initial-rows":(x=i.desktopBehaviour)==null?void 0:x.initialRows,loading:i==null?void 0:i.loading,onRowsSelected:D[0]||(D[0]=ee=>V.$emit("rows-selected",Z(ee)))},null,8,["data","columns","table-id","sort-by-col","sort-by-col-asc","no-filters","no-footer","rows-selection-mode","rows-selection-disabled","initial-rows","loading"]))}}}),$i=e.defineComponent({__name:"ElServerSideMobileTable",props:{selection:{},color:{},preventDefaultItemClick:{type:Boolean},filters:{},dataController:{type:Function}},emits:["bulk:click","destructive:click","selection:exit","rows-selected","item:click"],setup(n,{expose:t,emit:r}){const a=e.ref(!1),A=n,i=e.ref([]),s=e.ref(1),E=e.ref(void 0),O=e.ref({freeSearch:"",fromDate:0,multiSelect:{avatar:"",mainText:"",secondaryRow:"",tertiaryRow:"",amount:"",tags:"",time:""}}),I=()=>{a.value=!0,A.dataController({paginationStatus:{currentPage:s.value+1},filterStatus:O.value,triggeredEvent:"paginate"}).then(G=>{i.value.push(...G.data),E.value=G.totalRows}).finally(()=>{e.nextTick(()=>e.nextTick(()=>{a.value=!1})),s.value+=1})},u=G=>(a.value=!0,s.value=0,i.value=[],A.dataController({paginationStatus:{currentPage:0},filterStatus:O.value,triggeredEvent:G}).then(k=>{i.value=k.data,E.value=k.totalRows}).finally(()=>{e.nextTick(()=>e.nextTick(()=>{a.value=!1}))})),C=G=>{O.value=G,u("filter")};e.onMounted(()=>{u("firstLoad")});const S=()=>{E.value&&i.value.length<E.value&&I()},N=e.ref(),L=e.ref(void 0);e.onMounted(()=>{L.value=new IntersectionObserver(G=>{G.some(k=>k.isIntersecting)&&!a.value&&S()},{threshold:1}),N.value&&L.value.observe(N.value)}),e.watch(N,(G,k)=>{k&&L.value.unobserve(k),G&&L.value.observe(G)}),e.onUnmounted(()=>{L.value&&(L.value.disconnect(),L.value=void 0)});const p=e.ref(null);return t({selectRows:G=>{var k;(k=p.value)==null||k.selectRows(G)},unselectAllRows:()=>{var G;return(G=p.value)==null?void 0:G.unselectAllRows()},getSelectedRows:()=>{var G;return((G=p.value)==null?void 0:G.getSelectedRows())??[]},resetAllAndFetch:()=>{var G;return O.value={freeSearch:"",fromDate:0,multiSelect:{avatar:"",mainText:"",secondaryRow:"",tertiaryRow:"",amount:"",tags:"",time:""}},(G=p.value)==null||G.unselectAllRows(),u("firstLoad")},triggerDataController:async()=>{a.value=!0;const G=await A.dataController({paginationStatus:{currentPage:s.value},filterStatus:O.value,triggeredEvent:"trigger"});i.value=G.data,E.value=G.totalRows,a.value=!1},closeItemDetails:()=>{var G;(G=p.value)==null||G.closeItemDetails()}}),(G,k)=>{var H;return e.openBlock(),e.createBlock(Ea,{ref_key:"table",ref:p,color:A.color,selection:A.selection,data:i.value,filters:{...A.filters,freeSearch:(H=A.filters)!=null&&H.freeSearch?{placeholder:A.filters.freeSearch.placeholder,initialValue:A.filters.freeSearch.initialValue,filterOn:[]}:void 0,managed:!0},loading:a.value,"prevent-default-item-click":A.preventDefaultItemClick,onRowsSelected:k[0]||(k[0]=V=>G.$emit("rows-selected",V)),onFiltersUpdated:C,"onBulk:click":k[1]||(k[1]=V=>G.$emit("bulk:click",V)),"onSelection:exit":k[2]||(k[2]=V=>G.$emit("selection:exit")),"onDestructive:click":k[3]||(k[3]=V=>G.$emit("destructive:click",V)),"onItem:click":k[4]||(k[4]=V=>G.$emit("item:click",V))},{default:e.withCtx(()=>[e.renderSlot(G.$slots,"default")]),"after-list":e.withCtx(()=>[e.createElementVNode("div",{ref_key:"infiniteScrollEl",ref:N,class:"h-1 mb-2 shrink-0"},null,512)]),_:3},8,["color","selection","data","filters","loading","prevent-default-item-click"])}}}),dM=e.defineComponent({__name:"ElServerSideResponsiveTable",props:{mobileBehaviour:{},desktopBehaviour:{},sortBy:{},color:{},rowsSelectionMode:{},rowsSelectionDisabled:{type:Boolean},columns:{},dataController:{type:Function},rowsPerPage:{}},emits:["rows-selected","mobile:bulk:click","mobile:destructive:click","mobile:selection:exit","mobile:item:click"],setup(n,{expose:t,emit:r}){const a=window.matchMedia("(max-width: 768px)"),A=e.ref(a.matches),i=n,s=e.ref(null),E=e.ref(null),O=G=>{A.value=G.matches};e.onMounted(()=>{a.addEventListener("change",O)}),e.onUnmounted(()=>{a.removeEventListener("change",O)});const I=r,u=G=>{var k,H,V,D,F,b,w;if(!G.type)return{type:"default",...G};switch(G.type){case"default":return{type:"default",mainIcon:(k=G.desktopBehaviour)==null?void 0:k.mainIcon,mainText:G.mainText,mainTextStyle:G.mainTextStyle,mainTextColor:G.mainTextColor,subIcon:(H=G.desktopBehaviour)==null?void 0:H.subIcon,subText:G.subText,avatar:G.avatar,clickAction:G.clickAction,longText:(V=G.desktopBehaviour)==null?void 0:V.longText,truncateSubText:(D=G.desktopBehaviour)==null?void 0:D.truncateSubText,sortableAndFilterableValue:G.sortableAndFilterableValue};case"tag":return{type:"tag",tag:{text:((F=G.desktopBehaviour)==null?void 0:F.tag.text)??G.text??"",color:G.color},subText:(b=G.desktopBehaviour)==null?void 0:b.subText,truncateSubText:(w=G.desktopBehaviour)==null?void 0:w.truncateSubText,sortableAndFilterableValue:G.sortableAndFilterableValue};case"action":return{type:"action",buttons:G.buttons,iconButtons:G.iconButtons,dropdown:G.dropdown}}},C=G=>({id:G.id,rowNotSelectable:G.rowNotSelectable,cells:G.cells.map(u),relatedObject:G.relatedObject}),S=G=>{var Ae,Le,pe,Ve,be,xe,Qe,_e,Et,c0,wt,gt,n0,et;let k,H,V,D,F,b,w,x,$;const ee=[];let j,ne;const X=[];for(const[ht,W]of G.cells.entries()){const se=i.columns[ht];if(!se)throw new Error("Missing column for cell at index "+ht);if(W.type==="default")if(Array.isArray((Ae=se.mobileBehaviour)==null?void 0:Ae.position))for(const Oe of se.mobileBehaviour.position)Oe.to==="avatar"?X.push({label:Oe.withLabel,value:{type:"avatar",...W.avatar}}):X.push({label:Oe.withLabel,value:{type:"default",text:W[Oe.take]??""}});else W.avatar?X.push({label:se.title,value:{type:"avatar",...W.avatar}}):X.push({label:se.title,value:{type:"default",text:W.mainText}});else W.type==="tag"&&X.push({label:se.title,value:{type:"tag",text:((Le=W.desktopBehaviour)==null?void 0:Le.tag.text)??W.text??"",color:W.color}});const Ee=se.mobileBehaviour;if(!(!Ee&&W.type!=="action")){if(W.type==="default")if(Array.isArray(Ee.position))for(const Oe of Ee.position)switch(Oe.to){case"time":$=W[Oe.take];break;case"mainText":k=W[Oe.take],H=W.mainTextStyle,V=W.mainTextColor;break;case"secondaryRow":D=W[Oe.take];break;case"tertiaryRow":F=W[Oe.take];break;case"amount":b=W[Oe.take];break;case"avatar":w=(pe=W.avatar)==null?void 0:pe.label,x=(Ve=W.avatar)==null?void 0:Ve.picture;break}else{switch(Ee.position){case"mainText":k=W.mainText,H=W.mainTextStyle,V=W.mainTextColor;break;case"secondaryRow":D=W.subText??W.mainText;break;case"avatar":w=(be=W.avatar)==null?void 0:be.label,x=(xe=W.avatar)==null?void 0:xe.picture;break;case"amount":b=((Qe=W.mobileBehaviour)==null?void 0:Qe.amountText)??W.mainText;break;case"tertiaryRow":F=((_e=W.mobileBehaviour)==null?void 0:_e.tertiaryText)??W.mainText;break;case"tags":console.warn("Skipping tags mobile position on cell type default, for tags to be used in mobile table, use cell type tag");break;case"time":$=((Et=W.mobileBehaviour)==null?void 0:Et.timeText)??W.mainText;break}continue}if(W.type==="tag"&&Ee.position==="tags"){ee.push({key:W.text,text:((c0=W.desktopBehaviour)==null?void 0:c0.tag.text)??W.text??"",color:((wt=W.desktopBehaviour)==null?void 0:wt.tag.color)??W.color});continue}W.type=="action"&&((gt=W.mobileBehaviour)!=null&&gt.primary&&(j=W.mobileBehaviour.primary),(n0=W.mobileBehaviour)!=null&&n0.secondary&&(ne=W.mobileBehaviour.secondary))}}let te;if(j&&(te={primary:j,secondary:ne}),!k)throw new Error("Missing mainText for mobile item");return{id:G.id,rowNotSelectable:G.rowNotSelectable,relatedObject:G.relatedObject,time:$,mainText:{label:k,style:H,color:V},secondaryRow:D,tertiaryRow:F,tags:ee,amount:b,avatar:w||x?{label:w,picture:x}:void 0,trailingIcon:(et=G.mobileBehaviour)==null?void 0:et.trailingIcon,actions:te,details:X}},N=e.computed(()=>{var G,k,H,V,D,F,b,w,x;if(!(i.rowsSelectionDisabled||!((G=i.mobileBehaviour)!=null&&G.selection)))return{enabled:!i.rowsSelectionDisabled,selectionMode:i.rowsSelectionMode||"multiple",destructiveAction:(H=(k=i.mobileBehaviour)==null?void 0:k.selection)==null?void 0:H.destructiveAction,bulkActionButton:(D=(V=i.mobileBehaviour)==null?void 0:V.selection)==null?void 0:D.bulkActionButton,cancelText:(b=(F=i.mobileBehaviour)==null?void 0:F.selection)==null?void 0:b.cancelText,selectedLabel:(x=(w=i.mobileBehaviour)==null?void 0:w.selection)==null?void 0:x.selectedLabel}}),L=e.ref([]),p=G=>i.dataController({tableType:"desktop",...G}).then(k=>(G.triggeredEvent==="paginate"?L.value=[...L.value,...k.data]:L.value=k.data,{data:k.data.map(C),totalRows:k.totalRows})),m=G=>i.dataController({tableType:"mobile",...G,mobileFiltersStatus:G.filterStatus,filterStatus:i.columns.map(k=>{var V,D;const H=k.filter;if(H)switch(H.type){case"FREE_SEARCH":return{id:H.id,type:"FREE_SEARCH",columnTitle:k.title,textSearch:G.filterStatus.freeSearch??""};case"DATE_RANGE":return{id:H.id,type:"DATE_RANGE",columnTitle:k.title,dateFrom:G.filterStatus.fromDate??0};case"MULTI_VALUE":const F=((V=H.mobileBehaviour)==null?void 0:V.position)??((D=k.mobileBehaviour)==null?void 0:D.position);if(!F)return;if(Array.isArray(F)){console.warn(`Cannot map column ${k.title} mobile filter value since multiple mappings are defined, please specify the mobileBehaviour on the column.filter`);return}return{id:H.id,type:"MULTI_VALUE",columnTitle:k.title,textSearch:G.filterStatus.multiSelect[F]??""};case"RESET_FILTERS_BUTTON":return}}).filter(k=>k!==void 0)}).then(k=>(G.triggeredEvent==="paginate"?L.value=[...L.value,...k.data]:L.value=k.data,{data:k.data.map(S),totalRows:k.totalRows})),f=e.computed(()=>{const G={};return i.columns.forEach(k=>{var V,D;if(!k.filter)return;const H=k.mobileBehaviour;if(H){if(k.filter.type==="FREE_SEARCH"){G.freeSearch||(G.freeSearch={placeholder:k.title,initialValue:k.filter.initialValue});return}if(k.filter.type==="DATE_RANGE"){G.dateRange||(G.dateRange={enabled:!0,label:k.title,initialValue:k.filter.initialValue});return}if(k.filter.type==="RESET_FILTERS_BUTTON"){G.resetButton=!0;return}if(k.filter.type==="MULTI_VALUE")if(G.multiValue||(G.multiValue={}),Array.isArray(H.position)){const F=((V=k.filter.mobileBehaviour)==null?void 0:V.position)??((D=H.position.at(0))==null?void 0:D.to);if(!F)return;G.multiValue[F]={enabled:!0,label:k.title,selectOptions:k.filter.selectOptions,initialValue:k.filter.initialValue}}else G.multiValue[H.position]={enabled:!0,label:k.title,selectOptions:k.filter.selectOptions,initialValue:k.filter.initialValue}}}),G}),T=G=>G.map(H=>H.id).map(H=>L.value.findIndex(V=>V.id===H)).map(H=>L.value[H]),h=G=>{const k=L.value.findIndex(H=>H.id===G.id);return L.value[k]},P=G=>G.map(H=>H.id).map(H=>L.value.findIndex(V=>V.id===H)).map(H=>L.value[H]),Z=G=>{const k=L.value.findIndex(H=>H.id===G.id);return L.value[k]};return t({selectRows:G=>{var k,H;A.value?(k=E.value)==null||k.selectRows(G):(H=s.value)==null||H.selectRows(G)},resetAllAndFetch:()=>{var G,k;return A.value?(G=E.value)==null?void 0:G.resetAllAndFetch():(k=s.value)==null?void 0:k.resetAllAndFetch()},unselectAllRows:()=>{var G,k;A.value?(G=E.value)==null||G.unselectAllRows():(k=s.value)==null||k.unselectAllRows()},getDataRows:()=>L.value,getSelectedRows:()=>{var G,k;return A.value?(((G=E.value)==null?void 0:G.getSelectedRows())??[]).map(Z):(((k=s.value)==null?void 0:k.getSelectedRows())??[]).map(h)},triggerDataController:async()=>{var G,k;return A.value?(G=E.value)==null?void 0:G.triggerDataController():(k=s.value)==null?void 0:k.triggerDataController()},closeMobileTableItemDetails:()=>{var G;(G=E.value)==null||G.closeItemDetails()}}),(G,k)=>{var H;return A.value?(e.openBlock(),e.createBlock($i,{key:1,ref_key:"mobileTable",ref:E,color:i.color,selection:N.value,"data-controller":m,filters:f.value,"prevent-default-item-click":(H=i.mobileBehaviour)==null?void 0:H.preventDefaultItemClick,"onSelection:exit":k[1]||(k[1]=V=>I("mobile:selection:exit")),"onBulk:click":k[2]||(k[2]=V=>I("mobile:bulk:click",P(V))),onRowsSelected:k[3]||(k[3]=V=>G.$emit("rows-selected",P(V))),"onDestructive:click":k[4]||(k[4]=V=>G.$emit("mobile:destructive:click",P(V))),"onItem:click":k[5]||(k[5]=V=>I("mobile:item:click",Z(V)))},{default:e.withCtx(()=>[e.renderSlot(G.$slots,"mobile")]),_:3},8,["color","selection","filters","prevent-default-item-click"])):(e.openBlock(),e.createBlock(ri,{key:0,ref_key:"desktopTable",ref:s,columns:i.columns.map(V=>({...V,...V.desktopBehaviour})),"data-controller":p,"rows-per-page":i.rowsPerPage,onRowsSelected:k[0]||(k[0]=V=>G.$emit("rows-selected",T(V)))},null,8,["columns","rows-per-page"]))}}});Q.DrugDurationMeasures=Do,Q.DrugTimeMeasures=Po,Q.DrugUnitMeasures=Zo,Q.ElAccordion=oR,Q.ElActionButton=VB,Q.ElAvatar=W0,Q.ElBadge=J1,Q.ElButton=Ct,Q.ElCalendarCard=TR,Q.ElCalendarCell=qR,Q.ElCarousel=TB,Q.ElClipToAnchor=xo,Q.ElContainerTemplate=gh,Q.ElDivider=Qo,Q.ElDrawer=$A,Q.ElDropdown=_o,Q.ElFile=zA,Q.ElIcon=Pe,Q.ElIconButton=lt,Q.ElInlineBanner=tf,Q.ElInputCheckbox=Y0,Q.ElInputContainer=t0,Q.ElInputDate=Kn,Q.ElInputFile=e9,Q.ElInputMeasureUnit=o9,Q.ElInputNumber=l9,Q.ElInputPhone=E9,Q.ElInputRadioButton=sf,Q.ElInputSearch=OM,Q.ElInputSelect=Xn,Q.ElInputSwitch=Fh,Q.ElInputText=m1,Q.ElInputTextarea=R9,Q.ElItem=Ho,Q.ElListItem=Di,Q.ElLogo=P9,Q.ElMobileTable=Ea,Q.ElModal=Ko,Q.ElResponsiveTable=EM,Q.ElServerSideMobileTable=$i,Q.ElServerSideResponsiveTable=dM,Q.ElServerSideTable=ri,Q.ElSortingHeader=YA,Q.ElSpinner=tn,Q.ElSuggestionChip=F9,Q.ElTab=yo,Q.ElTabGroup=Uo,Q.ElTable=ni,Q.ElTableHead=y9,Q.ElTabs=H9,Q.ElTag=Jn,Q.ElToast=QS,Q.ElTooltip=h1,Q.ElVerticalTab=di,Q.EltyTailwindPlugin=K7,Q.EltyTailwindPluginWithoutStyle=X7,Q.EltyTailwindPreset=q7,Q.EltyVuePlugin=$7,Q.Role=zn,Q.defineValidationRules=TA,Q.elAccordionColors=rR,Q.elActionButtonColors=pB,Q.elActionButtonSizes=BB,Q.elActionButtonStatus=MB,Q.elAvatarSizes=AR,Q.elBadgeColors=iR,Q.elButtonSizes=IR,Q.elButtonVariants=NR,Q.elCalendarCardColors=SR,Q.elCalendarCardStatuses=fR,Q.elCalendarCellAvailabilities=QR,Q.elCalendarCellColors=WR,Q.elCarouselSizes=fB,Q.elClipToAnchorPositions=bA,Q.elContainerTemplateVariants=wh,Q.elDividerDirection=KT,Q.elDropdownMaxHeight=wS,Q.elFileVariants=PS,Q.elIconButtonSizes=iS,Q.elIconColors=GA,Q.elInlineBannerStatuses=ef,Q.elInputCheckboxColors=xS,Q.elInputCheckboxModelValues=yS,Q.elInputCheckboxSizes=FS,Q.elInputDateTypes=bS,Q.elInputFileTypes=JS,Q.elInputSearchColors=sM,Q.elInputSearchStatus=cM,Q.elInputTextTypes=IS,Q.elLogoColors=g9,Q.elLogoVariants=D9,Q.elModalColors=ch,Q.elModalSizes=or,Q.elModalSizesBreakpoints=Ei,Q.elRadioButtonColors=Af,Q.elRadioButtonSizes=lf,Q.elSortingHeaderDirections=v9,Q.elSpinnerSize=q9,Q.elSwitchAligns=vh,Q.elSwitchColors=kh,Q.elSwitchSizes=Zh,Q.elTabColors=JR,Q.elTabStatuses=XR,Q.elTagColors=$9,Q.elTagSizes=z9,Q.elToastStates=jS,Q.elTooltipPositions=$R,Q.elVerticalTabColors=Lh,Q.elVerticalTabStatus=uh,Q.toast=WA,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
43
43
  //# sourceMappingURL=index.umd.cjs.map