@aminnausin/cedar-ui 0.0.1

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.
@@ -0,0 +1,13 @@
1
+ (function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w.CedarUI={},w.Vue,w.vueRouter))})(this,function(w,e,z){"use strict";var ro=Object.defineProperty;var oo=(w,e,z)=>e in w?ro(w,e,{enumerable:!0,configurable:!0,writable:!0,value:z}):w[e]=z;var O=(w,e,z)=>oo(w,typeof e!="symbol"?e+"":e,z);const gt=["for"],bt={key:0,class:"text-sm/6 text-gray-500 dark:text-gray-400"},de=e.defineComponent({__name:"FormInputLabel",props:{field:{},textSize:{},class:{}},setup(o){const t=o;return(n,r)=>{var a,s,l;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("label",{for:(a=n.field)==null?void 0:a.name,class:e.normalizeClass(["leading-none block font-medium text-gray-700 dark:text-neutral-200",n.textSize?n.textSize:"text-sm",`${t.class??""}`])},e.toDisplayString((s=n.field)==null?void 0:s.text),11,gt),(l=n.field)!=null&&l.subtext?(e.openBlock(),e.createElementBlock("p",bt,e.toDisplayString(n.field.subtext),1)):e.createCommentVNode("",!0)],64)}}}),yt={key:0,class:"text-rose-600 dark:text-rose-500 text-sm"},De=e.defineComponent({__name:"FormErrorList",props:{errors:{},fieldName:{}},setup(o){return(t,n)=>(t.fieldName?t.errors[t.fieldName]:Object.keys(t.errors).length>0)?(e.openBlock(),e.createElementBlock("ul",yt,[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fieldName?t.errors[t.fieldName]:t.errors,(r,a)=>(e.openBlock(),e.createElementBlock("li",{key:a},e.toDisplayString(r),1))),128))])])):e.createCommentVNode("",!0)}}),wt=["for"],kt=e.defineComponent({__name:"InputLabel",props:{name:{},text:{},subtext:{},class:{},subtextClass:{}},setup(o){const t=o;return(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("label",{for:n.name,class:e.normalizeClass(["font-medium text-gray-700 dark:text-neutral-200",t.class])},e.toDisplayString(n.text),11,wt),n.subtext?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(["text-sm/6 text-gray-500 dark:text-gray-400",n.subtextClass])},e.toDisplayString(n.subtext),3)):e.createCommentVNode("",!0)],64))}}),L=(o,t)=>{const n=o.__vccOpts||o;for(const[r,a]of t)n[r]=a;return n},vt={},Ct={class:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"};function xt(o,t){return e.openBlock(),e.createElementBlock("svg",Ct,t[0]||(t[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))}const Ve=L(vt,[["render",xt]]),Tt={},Bt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Et(o,t){return e.openBlock(),e.createElementBlock("svg",Bt,t[0]||(t[0]=[e.createElementVNode("g",{fill:"none"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M7.09 2.75a4 4 0 0 0-4 4v6.208a4 4 0 0 0 4 4h.093v3.792a.5.5 0 0 0 .839.368l4.52-4.16h4.369a4 4 0 0 0 4-4V6.75a4 4 0 0 0-4-4z"}),e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"1.5",d:"M12 6.25v4"}),e.createElementVNode("circle",{cx:"12",cy:"13.25",r:"1",fill:"currentColor"})],-1)]))}const Ae=L(Tt,[["render",Et]]),St={},Nt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function It(o,t){return e.openBlock(),e.createElementBlock("svg",Nt,t[0]||(t[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"m9.75 4.75l6.19 6.19a1.5 1.5 0 0 1 0 2.12l-6.19 6.19"},null,-1)]))}const Me=L(St,[["render",It]]),$t={},Pt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Dt(o,t){return e.openBlock(),e.createElementBlock("svg",Pt,t[0]||(t[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"m14.25 4.75l-6.19 6.19a1.5 1.5 0 0 0 0 2.12l6.19 6.19"},null,-1)]))}const Oe=L($t,[["render",Dt]]),Vt={},At={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256"};function Mt(o,t){return e.openBlock(),e.createElementBlock("svg",At,t[0]||(t[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M42 128a6 6 0 0 1 6-6h72a6 6 0 0 1 0 12H48a6 6 0 0 1-6-6m6-58h56a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m136 116H48a6 6 0 0 0 0 12h136a6 6 0 0 0 0-12m44.24-102.24l-40-40a6 6 0 0 0-8.48 0l-40 40a6 6 0 0 0 8.48 8.48L178 62.49V144a6 6 0 0 0 12 0V62.49l29.76 29.75a6 6 0 0 0 8.48-8.48"},null,-1)]))}const Ot=L(Vt,[["render",Mt]]),Lt={},Ft={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 256"};function _t(o,t){return e.openBlock(),e.createElementBlock("svg",Ft,t[0]||(t[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M126 128a6 6 0 0 1-6 6H48a6 6 0 0 1 0-12h72a6 6 0 0 1 6 6M48 70h136a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m56 116H48a6 6 0 0 0 0 12h56a6 6 0 0 0 0-12m124.24-22.24a6 6 0 0 0-8.48 0L190 193.51V112a6 6 0 0 0-12 0v81.51l-29.76-29.75a6 6 0 0 0-8.48 8.48l40 40a6 6 0 0 0 8.48 0l40-40a6 6 0 0 0 0-8.48"},null,-1)]))}const Rt=L(Lt,[["render",_t]]),jt={},zt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Kt(o,t){return e.openBlock(),e.createElementBlock("svg",zt,t[0]||(t[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",opacity:"0.25"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"},[e.createElementVNode("animateTransform",{attributeName:"transform",dur:"0.75s",repeatCount:"indefinite",type:"rotate",values:"0 12 12;360 12 12"})],-1)]))}const Yt=L(jt,[["render",Kt]]),Ht=["aria-label","title","disabled"],ue=e.defineComponent({__name:"ButtonCorner",props:["positionClasses","colourClasses","textClasses","to","label","disabled"],setup(o){const t=o;return(n,r)=>{const a=e.resolveComponent("router-link");return o.to?(e.openBlock(),e.createBlock(a,{key:0,"aria-label":o.label??"Link",title:o.label??"Link",to:o.to??"/",class:e.normalizeClass(["flex items-center justify-center rounded-full aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60",`${o.positionClasses??" absolute top-0 right-0 w-8 h-8 mt-5 mr-5"} ${(t==null?void 0:t.colourClasses)??"hover:bg-gray-50 hover:dark:bg-gray-700"} ${(t==null?void 0:t.textClasses)??"text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:dark:text-gray-200"}`]),"aria-disabled":o.disabled},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"icon",{},()=>[e.createVNode(e.unref(Ve))])]),_:3},8,["aria-label","title","to","class","aria-disabled"])):(e.openBlock(),e.createElementBlock("button",{key:1,"aria-label":(t==null?void 0:t.label)??"Close Modal",title:(t==null?void 0:t.label)??"Close Modal",class:e.normalizeClass(["flex items-center justify-center rounded-full disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:opacity-60",`${(t==null?void 0:t.positionClasses)??"absolute top-0 right-0 w-8 h-8 mt-5 mr-5"} ${(t==null?void 0:t.colourClasses)??"hover:bg-gray-50 hover:dark:bg-gray-700"} ${(t==null?void 0:t.textClasses)??"text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:dark:text-gray-200"}`]),disabled:o.disabled,type:"button"},[e.renderSlot(n.$slots,"icon",{},()=>[e.createVNode(e.unref(Ve))])],10,Ht))}}}),Ut=e.defineComponent({__name:"ChipTag",props:["label","colour","textClass","URL","removeable"],setup(o){const t=o;return(n,r)=>t.URL?(e.openBlock(),e.createBlock(e.unref(z.RouterLink),{key:0,class:e.normalizeClass(`p-1 px-2 text-sm ${t.textClass?`${t.textClass} `:""}leading-none rounded-xl truncate lowercase text-neutral-100 dark:text-neutral-300 ${t.colour?`${t.colour}`:"bg-violet-600 dark:bg-violet-900"} shrink-0 transition-colors duration-200 `),to:t.URL},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),o.removeable?(e.openBlock(),e.createBlock(ue,{key:0,positionClasses:"w-4 h-4",textClasses:"text-white dark:text-rose-700",colourClasses:"dark:bg-neutral-900/20 dark:hover:bg-rose-700 hover:bg-rose-300 hover:text-rose-700 dark:hover:text-white drop-shadow",label:"Remove",onClick:r[0]||(r[0]=e.withModifiers(a=>n.$emit("clickAction"),["stop","prevent"]))})):e.createCommentVNode("",!0)]),_:3},8,["class","to"])):(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(`p-1 px-2 text-sm ${t.textClass?`${t.textClass} `:""}leading-none rounded-xl truncate lowercase text-neutral-100 dark:text-neutral-300 ${t.colour?`${t.colour}`:"bg-violet-600 dark:bg-violet-900"} shrink-0 transition-colors duration-200 cursor-default ${o.removeable?"flex gap-1 items-center justify-between":""}`)},[e.renderSlot(n.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),o.removeable?(e.openBlock(),e.createBlock(ue,{key:0,positionClasses:"w-4 h-4",textClasses:`text-white dark:text-rose-700 ${o.textClass??""}`,colourClasses:"dark:bg-neutral-900/20 dark:hover:bg-rose-700 hover:bg-rose-300 hover:text-rose-700 dark:hover:text-white drop-shadow",label:"Remove",onClick:r[1]||(r[1]=e.withModifiers(a=>n.$emit("clickAction"),["stop","prevent"]))},null,8,["textClasses"])):e.createCommentVNode("",!0)],2))}}),Wt={class:"text-pretty h-fit w-full break-words whitespace-pre-wrap"},qt=e.defineComponent({__name:"RelativeHoverCard",props:{content:{},positionClasses:{},hoverCardDelay:{default:600},hoverCardLeaveDelay:{default:500},iconHidden:{type:Boolean},icon:{default:Ae}},setup(o){const t=o,n=e.ref(!1),r=e.ref(null),a=e.ref(null),s=e.ref({}),l=e.ref(!1),i=()=>{t.content!==""&&(a.value&&clearTimeout(a.value),!n.value&&(r.value&&clearTimeout(r.value),l.value||(l.value=!0),r.value=window.setTimeout(()=>{n.value=!0},t.hoverCardDelay)))},u=()=>{t.content!==""&&(r.value&&clearTimeout(r.value),n.value&&(a.value&&clearTimeout(a.value),a.value=window.setTimeout(()=>{n.value=!1},t.hoverCardLeaveDelay)))};return(c,f)=>(e.openBlock(),e.createElementBlock("div",{class:"relative",onMouseover:i,onMouseleave:u},[e.renderSlot(c.$slots,"trigger",{},()=>[f[0]||(f[0]=e.createElementVNode("a",{href:"#_",class:"hover:underline"},"@thedevdojo",-1))]),e.createVNode(e.Transition,{"enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[l.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,onMouseover:i,onMouseleave:u,class:e.normalizeClass(`${c.positionClasses??""} z-30 flex absolute overflow-auto transition-opacity ease-in-out duration-200 md:max-w-xl xl:max-w-3xl text-sm p-3 h-fit bg-white dark:odd:bg-primary-dark-600/70 dark:bg-neutral-800/70 backdrop-blur-lg border dark:border-none rounded-md shadow-md border-neutral-200/70 gap-2 items-center`),style:e.normalizeStyle(s.value)},[e.renderSlot(c.$slots,"icon",{},()=>[c.iconHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.icon),{key:0,class:"h-5 w-5 mb-auto shrink-0"}))]),e.renderSlot(c.$slots,"content",{},()=>[e.createElementVNode("p",Wt,e.toDisplayString(c.content),1)])],38)),[[e.vShow,n.value]]):e.createCommentVNode("",!0)]),_:3})],32))}}),Gt={},Zt={class:"flex gap-3 p-3 sm:p-6 flex-wrap sm:flex-nowrap rounded-xl shadow-md dark:bg-primary-dark-800/70 bg-white ring-1 ring-gray-900/5"};function Xt(o,t){return e.openBlock(),e.createElementBlock("section",Zt,[e.renderSlot(o.$slots,"heading"),e.renderSlot(o.$slots,"content")])}const Qt=L(Gt,[["render",Xt]]),Jt={class:"flex flex-col gap-2"},en={key:0},tn={key:1,class:"dark:text-neutral-400 text-pretty whitespace-pre-wrap w-full"},nn=e.defineComponent({__name:"HoverCard",props:{content:{},contentTitle:{},positionClasses:{},hoverCardDelay:{default:600},hoverCardLeaveDelay:{default:500},margin:{default:0},iconHidden:{type:Boolean},paddingLeft:{default:0},scrollContainer:{default:"body"},disabled:{type:Boolean,default:!1},icon:{default:Ae}},setup(o){const t=o,n=e.ref(!1),r=e.ref(null),a=e.ref(null),s=e.ref({}),l=e.ref(!1),i=f=>{t.content===""||t.disabled||(a.value&&clearTimeout(a.value),!n.value&&(r.value&&clearTimeout(r.value),l.value||(l.value=!0),r.value=window.setTimeout(()=>{n.value=!0,c(f)},t.hoverCardDelay)))},u=()=>{r.value&&clearTimeout(r.value),n.value&&(a.value&&clearTimeout(a.value),a.value=window.setTimeout(()=>{n.value=!1},t.hoverCardLeaveDelay))},c=f=>{var T;const g=f.target,b=(T=g.parentElement)==null?void 0:T.getBoundingClientRect();let p=g.getBoundingClientRect();b&&b.height<p.height&&(p=b);const h=t.scrollContainer==="body"?document.body.scrollTop:window.scrollY,v=t.scrollContainer==="body"?document.body.scrollLeft:window.scrollX;s.value={left:`${p.left+v+t.paddingLeft}px`,top:`${p.bottom+t.margin+h}px`}};return e.watch(()=>t.content,()=>{(!t.content||t.content.trim()==="")&&u()}),(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:"",onMouseover:i,onMouseleave:u},[e.renderSlot(f.$slots,"trigger",{},()=>[g[0]||(g[0]=e.createElementVNode("a",{href:"#_",class:"hover:underline"},null,-1))]),l.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createVNode(e.Transition,{"enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{onMouseover:i,onMouseleave:u,class:e.normalizeClass([f.positionClasses,"z-30 flex absolute overflow-auto transition-opacity ease-in-out duration-200 md:max-w-xl xl:max-w-3xl text-sm p-3 h-fit max-h-[50vh] scrollbar-minimal bg-white dark:odd:bg-primary-dark-600/70 dark:bg-neutral-800/70 backdrop-blur-lg border dark:border-none rounded-md shadow-md border-neutral-200/70 gap-2 items-center"]),style:e.normalizeStyle(s.value)},[e.renderSlot(f.$slots,"icon",{},()=>[f.iconHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.icon),{key:0,class:"h-5 w-5 mb-auto shrink-0"}))]),e.renderSlot(f.$slots,"content",{},()=>[e.createElementVNode("div",Jt,[f.contentTitle?(e.openBlock(),e.createElementBlock("h4",en,e.toDisplayString(f.contentTitle),1)):e.createCommentVNode("",!0),f.content?(e.openBlock(),e.createElementBlock("p",tn,e.toDisplayString(f.content),1)):e.createCommentVNode("",!0)])])],38),[[e.vShow,n.value]])]),_:3})])):e.createCommentVNode("",!0)],32))}}),rn=["type","disabled"],fe=e.defineComponent({__name:"ButtonForm",props:{disabled:{type:Boolean,default:!1},type:{default:"button"},variant:{}},setup(o){const t=o,n=e.computed(()=>{switch(t.variant){case"submit":return["inline-flex items-center justify-center h-10 max-h-full px-4 py-2 font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none","focus:ring-1 focus:ring-violet-900 focus:ring-offset-1 bg-neutral-950 hover:bg-neutral-800 dark:hover:bg-neutral-900","disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"];case"reset":return["inline-flex items-center justify-center h-10 max-h-full px-4 py-2 font-medium transition-colors border dark:border-neutral-600 rounded-md focus:outline-none","focus:ring-1 focus:ring-neutral-100 dark:focus:ring-neutral-400 focus:ring-offset-1 hover:bg-neutral-100 dark:hover:bg-neutral-900","disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"];case"auth":return["inline-flex items-center px-4 py-2","bg-gray-800 dark:bg-gray-200","border border-transparent rounded-md font-semibold text-xs uppercase tracking-widest","text-white dark:text-gray-800 hover:bg-gray-700 dark:hover:bg-white","focus:bg-gray-700 dark:focus:bg-white active:bg-gray-900 dark:active:bg-gray-300","focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800","transition ease-in-out duration-150"];default:return["inline-flex items-center justify-center px-4 py-2 text-sm transition-colors border dark:border-neutral-600 rounded-md focus:outline-none","focus:ring-1 focus:ring-neutral-100 dark:focus:ring-neutral-400 focus:ring-offset-1 hover:bg-neutral-100 dark:hover:bg-neutral-900","disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"]}});return(r,a)=>(e.openBlock(),e.createElementBlock("button",{type:r.type,class:e.normalizeClass([...n.value]),disabled:r.disabled},[e.renderSlot(r.$slots,"text"),e.renderSlot(r.$slots,"default")],10,rn))}}),on=["name","title","type","required","placeholder","autocomplete","aria-autocomplete","min","max"],Le=e.defineComponent({__name:"FormInput",props:e.mergeModels({field:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue");return(n,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{class:e.normalizeClass(["rounded-md shadow-sm block mt-1 w-full text-sm","focus:outline-none border-none","disabled:cursor-not-allowed disabled:opacity-50","text-gray-900 dark:text-neutral-100 bg-white dark:bg-neutral-700 placeholder:text-neutral-400","ring-inset focus:ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700","focus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500"]),name:n.field.name,title:n.field.text??n.field.name,type:n.field.type,required:n.field.required?"true":"false",placeholder:n.field.placeholder,autocomplete:n.field.autocomplete,"aria-autocomplete":n.field.ariaAutocomplete??(n.field.autocomplete?"list":"none"),min:n.field.min??"",max:n.field.max??"","onUpdate:modelValue":r[0]||(r[0]=a=>t.value=a)},null,8,on)),[[e.vModelDynamic,t.value]])}});function ne(){const o=e.ref(!1),t=e.ref(!1),n=e.ref(300),r=e.ref(null),a=e.reactive({}),s=e.shallowRef(null);function l(u,c={}){r.value&&clearTimeout(r.value),s.value=u,Object.assign(a,c),t.value=!0,o.value=!0,r.value=window.setTimeout(()=>{o.value=!1},n.value)}function i(){r.value&&clearTimeout(r.value),t.value=!1,o.value=!0,r.value=window.setTimeout(()=>{o.value=!1},n.value)}return{isOpen:t,isAnimating:o,animationTime:n,props:a,component:s,open:l,close:i}}function Fe(o="pv_id_"){return o+Math.random().toString(16).slice(2)}class an{constructor(){O(this,"subscribers");O(this,"toasts");O(this,"subscribe",t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}));O(this,"publish",t=>{this.subscribers.forEach(n=>n(t))});O(this,"addToast",t=>{this.publish(t),this.toasts=[...this.toasts,t]});O(this,"create",(t,n)=>{const r=n.id??Fe("toast_");return this.toasts.find(s=>s.id===r)?this.toasts=this.toasts.map(s=>s.id===r?(this.publish({...s,...n,id:r,title:t}),{...s,...n,id:r,title:t}):s):this.addToast({title:t,id:r,scale:1,zIndex:200,offsetY:0,...n}),r});O(this,"dismiss",t=>{t?(this.publish({id:t,dismiss:!0}),this.toasts=this.toasts.filter(n=>n.id!==t)):(this.toasts.forEach(n=>{this.publish({id:n.id,dismiss:!0})}),this.toasts=[])});O(this,"add",(t,n)=>this.create(t,{...n}));O(this,"success",(t,n)=>this.create(t,{type:"success",...n}));O(this,"error",(t,n)=>this.create(t,{type:"danger",...n}));O(this,"info",(t,n)=>this.create(t,{type:"info",...n}));O(this,"warning",(t,n)=>this.create(t,{type:"warning",...n}));this.subscribers=[],this.toasts=[]}}const F=new an;function ln(o,t){const n=Fe("toast_");return F.create(o,{...t,id:n}),n}const me=Object.assign(ln,{add:F.add,success:F.success,error:F.error,info:F.info,warning:F.warning,dismiss:F.dismiss}),sn={class:"flex flex-col gap-4"},cn=e.defineComponent({__name:"BaseForm",props:{footerClass:{}},setup(o){return(t,n)=>(e.openBlock(),e.createElementBlock("form",sn,[e.renderSlot(t.$slots,"default"),t.$slots.footer?(e.openBlock(),e.createElementBlock("footer",{key:0,class:e.normalizeClass(["mt-4",t.footerClass])},[e.renderSlot(t.$slots,"footer")],2)):e.createCommentVNode("",!0)]))}}),dn={},un={class:"grid gap-2"};function fn(o,t){return e.openBlock(),e.createElementBlock("div",un,[e.renderSlot(o.$slots,"default")])}const mn=L(dn,[["render",fn]]);function pn(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var pe,_e;function hn(){return _e||(_e=1,pe=function o(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,a,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!o(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[a]))return!1;for(a=r;a--!==0;){var l=s[a];if(!o(t[l],n[l]))return!1}return!0}return t!==t&&n!==n}),pe}var gn=hn();const bn=pn(gn);function Re(o){let t=o,n;const r=e.reactive({fields:structuredClone(o),errors:{},dirty:!1,hasErrors:!1,processing:!1,wasSuccessful:!1,recentlySuccessful:!1,async submit(a,s={}){if(this.processing)return;const l={onBefore:async()=>{this.processing=!0,this.wasSuccessful=!1,this.recentlySuccessful=!1,clearTimeout(n),s.onBefore&&await s.onBefore()},onSuccess:async i=>{this.clearErrors(),this.wasSuccessful=!0,this.recentlySuccessful=!0,n=window.setTimeout(()=>{this.recentlySuccessful=!1},2e3),s.onSuccess&&await s.onSuccess(i),t=structuredClone(this.fields)},onError:async i=>{var u,c,f,g,b;this.hasErrors=!0,(((u=i==null?void 0:i.response)==null?void 0:u.status)===422||((c=i==null?void 0:i.response)==null?void 0:c.status)===401)&&(this.clearErrors(),this.setErrors({message:(f=i==null?void 0:i.response)==null?void 0:f.data.message,...(b=(g=i==null?void 0:i.response)==null?void 0:g.data)==null?void 0:b.errors})),s.onError&&await s.onError(i)},onFinish:async()=>{this.processing=!1,s.onFinish&&await s.onFinish()}};await l.onBefore();try{const i=await a(this.fields);await l.onSuccess(i)}catch(i){await l.onError(i)}finally{await l.onFinish()}},reset(...a){const s=structuredClone(t);a.length===0?this.fields=s:a.forEach(l=>{s[l]!==void 0&&(this.fields[l]=s[l])})},clearErrors(...a){a.length===0?this.errors={}:a.forEach(s=>delete this.errors[s]),this.hasErrors=Object.keys(this.errors).length>0},setErrors(a){this.errors={...this.errors,...a},this.hasErrors=Object.keys(this.errors).length>0}});return e.watch(()=>r.fields,()=>{r.dirty=!bn(r.fields,t)},{immediate:!0,deep:!0}),r}const je=e.defineComponent({__name:"PasswordConfirm",props:{action:{},successAction:{},successMessage:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},passwordLabel:{}},emits:["confirm","cancel"],setup(o,{emit:t}){const n=t,r=o,a=[{name:"password",text:"Confirm Password",placeholder:"Password",autocomplete:"current-password",ariaAutocomplete:"inline",type:"password",required:!0,max:255}],s=Re({password:""}),l=async()=>{s.submit(async i=>r.action(i),{onSuccess:i=>{r.successMessage&&me.success(r.successMessage),r.successAction&&r.successAction(i),n("confirm")},onError(){s.reset("password")}})};return(i,u)=>(e.openBlock(),e.createBlock(cn,{onSubmit:e.withModifiers(l,["prevent"]),"footer-class":"flex flex-col-reverse sm:flex-row sm:justify-end gap-2 text-sm"},{footer:e.withCtx(()=>[e.createVNode(fe,{variant:"reset",type:"button",disabled:e.unref(s).processing,class:"!capitalize",onClick:u[0]||(u[0]=c=>i.$emit("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.cancelText),1)]),_:1},8,["disabled"]),e.createVNode(fe,{variant:"submit",type:"button",onClick:l,disabled:e.unref(s).processing,class:"!capitalize !bg-rose-600 hover:!bg-rose-500"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.confirmText),1)]),_:1},8,["disabled"])]),default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,(c,f)=>e.createVNode(mn,{key:f},{default:e.withCtx(()=>[i.passwordLabel?(e.openBlock(),e.createBlock(de,{key:0,field:{...c,text:i.passwordLabel}},null,8,["field"])):e.createCommentVNode("",!0),e.createVNode(Le,{modelValue:e.unref(s).fields[c.name],"onUpdate:modelValue":g=>e.unref(s).fields[c.name]=g,field:c,class:"!mt-0"},null,8,["modelValue","onUpdate:modelValue","field"]),e.createVNode(De,{errors:e.unref(s).errors,"field-name":c.name},null,8,["errors","field-name"])]),_:2},1024)),64))]),_:1}))}}),yn={class:"flex flex-wrap gap-2 items-center"},wn={ref:"modalTitle",id:"modalTitle",class:"text-xl font-semibold scroll-mt-16 sm:scroll-mt-12 flex-1"},kn={key:0,class:"text-neutral-500 dark:text-neutral-400 text-sm w-full",id:"modalDescription"},he=e.defineComponent({__name:"BaseModal",props:{modal:{}},setup(o){return(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("section",yn,[e.createElementVNode("h3",wn,[e.renderSlot(t.$slots,"title",{},()=>{var r;return[e.createTextVNode(e.toDisplayString(((r=t.modal.props)==null?void 0:r.title)??"Modal Title"),1)]})],512),e.createVNode(ue,{onClick:t.modal.close,class:"!m-0 !static"},null,8,["onClick"]),t.$slots.description?(e.openBlock(),e.createElementBlock("p",kn,[e.renderSlot(t.$slots,"description")])):e.createCommentVNode("",!0)]),e.renderSlot(t.$slots,"default")],64))}}),vn=e.defineComponent({__name:"LogoutSessionsModal",props:{onSuccess:{type:Function}},setup(o){const t=o,n=ne();function r(){var a;n.close(),(a=t.onSuccess)==null||a.call(t)}return(a,s)=>(e.openBlock(),e.createBlock(he,{modal:e.unref(n)},{title:e.withCtx(()=>s[0]||(s[0]=[e.createTextVNode("Sign Out of Other Devices",-1)])),description:e.withCtx(()=>s[1]||(s[1]=[e.createTextVNode("Are you sure you want to sign out of other devices? You won't be able to undo this action.",-1)])),default:e.withCtx(()=>[e.createVNode(je,{action:async()=>{},"success-message":"Other Sessions Logged Out Successfully",onConfirm:r,onCancel:e.unref(n).close},null,8,["onCancel"])]),_:1},8,["modal"]))}}),Cn=e.defineComponent({__name:"DeleteAccountModal",setup(o){const t=ne(),n=z.useRouter();function r(){t.close(),n.push("/")}async function a(){}return(s,l)=>(e.openBlock(),e.createBlock(he,{modal:e.unref(t)},{title:e.withCtx(()=>l[0]||(l[0]=[e.createTextVNode("Are you sure you want to delete your account?",-1)])),description:e.withCtx(()=>l[1]||(l[1]=[e.createTextVNode(" Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account. ",-1)])),default:e.withCtx(()=>[e.createVNode(je,{action:a,"success-message":"Account Deleted...",onConfirm:r,onCancel:e.unref(t).close},null,8,["onCancel"])]),_:1},8,["modal"]))}});function ge(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function K(o){return typeof o=="function"?o():e.unref(o)}const be=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xn=Object.prototype.toString,ze=o=>xn.call(o)==="[object Object]",q=()=>{},ye=Tn();function Tn(){var o,t;return be&&((o=window==null?void 0:window.navigator)==null?void 0:o.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Bn(...o){if(o.length!==1)return e.toRef(...o);const t=o[0];return typeof t=="function"?e.readonly(e.customRef(()=>({get:t,set:q}))):e.ref(t)}function X(o){var t;const n=K(o);return(t=n==null?void 0:n.$el)!=null?t:n}const Ke=be?window:void 0;function we(...o){let t,n,r,a;if(typeof o[0]=="string"||Array.isArray(o[0])?([n,r,a]=o,t=Ke):[t,n,r,a]=o,!t)return q;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],l=()=>{s.forEach(f=>f()),s.length=0},i=(f,g,b,p)=>(f.addEventListener(g,b,p),()=>f.removeEventListener(g,b,p)),u=e.watch(()=>[X(t),K(a)],([f,g])=>{if(l(),!f)return;const b=ze(g)?{...g}:g;s.push(...n.flatMap(p=>r.map(h=>i(f,p,h,b))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return ge(c),c}let Ye=!1;function En(o,t,n={}){const{window:r=Ke,ignore:a=[],capture:s=!0,detectIframe:l=!1}=n;if(!r)return q;ye&&!Ye&&(Ye=!0,Array.from(r.document.body.children).forEach(b=>b.addEventListener("click",q)),r.document.documentElement.addEventListener("click",q));let i=!0;const u=b=>a.some(p=>{if(typeof p=="string")return Array.from(r.document.querySelectorAll(p)).some(h=>h===b.target||b.composedPath().includes(h));{const h=X(p);return h&&(b.target===h||b.composedPath().includes(h))}}),f=[we(r,"click",b=>{const p=X(o);if(!(!p||p===b.target||b.composedPath().includes(p))){if(b.detail===0&&(i=!u(b)),!i){i=!0;return}t(b)}},{passive:!0,capture:s}),we(r,"pointerdown",b=>{const p=X(o);i=!u(b)&&!!(p&&!b.composedPath().includes(p))},{passive:!0}),l&&we(r,"blur",b=>{setTimeout(()=>{var p;const h=X(o);((p=r.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(r.document.activeElement))&&t(b)},0)})].filter(Boolean);return()=>f.forEach(b=>b())}const He=e.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(o,{slots:t,emit:n}){const r=e.ref();return En(r,a=>{n("trigger",a)},o.options),()=>{if(t.default)return e.h(o.as||"div",{ref:r},t.default())}}});function Sn(o){var t;const n=K(o);return(t=n==null?void 0:n.$el)!=null?t:n}const Nn=be?window:void 0;function In(...o){let t,n,r,a;if(typeof o[0]=="string"||Array.isArray(o[0])?([n,r,a]=o,t=Nn):[t,n,r,a]=o,!t)return q;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const s=[],l=()=>{s.forEach(f=>f()),s.length=0},i=(f,g,b,p)=>(f.addEventListener(g,b,p),()=>f.removeEventListener(g,b,p)),u=e.watch(()=>[Sn(t),K(a)],([f,g])=>{if(l(),!f)return;const b=ze(g)?{...g}:g;s.push(...n.flatMap(p=>r.map(h=>i(f,p,h,b))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return ge(c),c}function ke(o){return typeof Window<"u"&&o instanceof Window?o.document.documentElement:typeof Document<"u"&&o instanceof Document?o.documentElement:o}function Ue(o){const t=window.getComputedStyle(o);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&o.clientWidth<o.scrollWidth||t.overflowY==="auto"&&o.clientHeight<o.scrollHeight)return!0;{const n=o.parentNode;return!n||n.tagName==="BODY"?!1:Ue(n)}}function $n(o){const t=o||window.event,n=t.target;return Ue(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const ve=new WeakMap;function Pn(o,t=!1){const n=e.ref(t);let r=null,a="";e.watch(Bn(o),i=>{const u=ke(K(i));if(u){const c=u;if(ve.get(c)||ve.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(a=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const s=()=>{const i=ke(K(o));!i||n.value||(ye&&(r=In(i,"touchmove",u=>{$n(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=ke(K(o));!i||!n.value||(ye&&(r==null||r()),i.style.overflow=a,ve.delete(i),n.value=!1)};return ge(l),e.computed({get(){return n.value},set(i){i?s():l()}})}function Dn(){let o=!1;const t=e.ref(!1);return(n,r)=>{if(t.value=r.value,o)return;o=!0;const a=Pn(n,r.value);e.watch(t,s=>a.value=s)}}Dn();function Vn(o){return typeof o=="function"?o():e.unref(o)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function An(o){var t;const n=Vn(o);return(t=n==null?void 0:n.$el)!=null?t:n}/*!
2
+ * tabbable 6.2.0
3
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
+ */var We=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],re=We.join(","),qe=typeof Element>"u",Y=qe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oe=!qe&&Element.prototype.getRootNode?function(o){var t;return o==null||(t=o.getRootNode)===null||t===void 0?void 0:t.call(o)}:function(o){return o==null?void 0:o.ownerDocument},ae=function o(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=a===""||a==="true",l=s||n&&t&&o(t.parentNode);return l},Mn=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ge=function(t,n,r){if(ae(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(re));return n&&Y.call(t,re)&&a.unshift(t),a=a.filter(r),a},Ze=function o(t,n,r){for(var a=[],s=Array.from(t);s.length;){var l=s.shift();if(!ae(l,!1))if(l.tagName==="SLOT"){var i=l.assignedElements(),u=i.length?i:l.children,c=o(u,!0,r);r.flatten?a.push.apply(a,c):a.push({scopeParent:l,candidates:c})}else{var f=Y.call(l,re);f&&r.filter(l)&&(n||!t.includes(l))&&a.push(l);var g=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),b=!ae(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(g&&b){var p=o(g===!0?l.children:g.children,!0,r);r.flatten?a.push.apply(a,p):a.push({scopeParent:l,candidates:p})}else s.unshift.apply(s,l.children)}}return a},Xe=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},H=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Mn(t))&&!Xe(t)?0:t.tabIndex},On=function(t,n){var r=H(t);return r<0&&n&&!Xe(t)?0:r},Ln=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Qe=function(t){return t.tagName==="INPUT"},Fn=function(t){return Qe(t)&&t.type==="hidden"},_n=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Rn=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},jn=function(t){if(!t.name)return!0;var n=t.form||oe(t),r=function(i){return n.querySelectorAll('input[type="radio"][name="'+i+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var s=Rn(a,t.form);return!s||s===t},zn=function(t){return Qe(t)&&t.type==="radio"},Kn=function(t){return zn(t)&&!jn(t)},Yn=function(t){var n,r=t&&oe(t),a=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var l,i,u;for(s=!!((l=a)!==null&&l!==void 0&&(i=l.ownerDocument)!==null&&i!==void 0&&i.contains(a)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&a;){var c,f,g;r=oe(a),a=(c=r)===null||c===void 0?void 0:c.host,s=!!((f=a)!==null&&f!==void 0&&(g=f.ownerDocument)!==null&&g!==void 0&&g.contains(a))}}return s},Je=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},Hn=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Y.call(t,"details>summary:first-of-type"),l=s?t.parentElement:t;if(Y.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var i=t;t;){var u=t.parentElement,c=oe(t);if(u&&!u.shadowRoot&&a(u)===!0)return Je(t);t.assignedSlot?t=t.assignedSlot:!u&&c!==t.ownerDocument?t=c.host:t=u}t=i}if(Yn(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Je(t);return!1},Un=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return Y.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},le=function(t,n){return!(n.disabled||ae(n)||Fn(n)||Hn(n,t)||_n(n)||Un(n))},Ce=function(t,n){return!(Kn(n)||H(n)<0||!le(t,n))},Wn=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},qn=function o(t){var n=[],r=[];return t.forEach(function(a,s){var l=!!a.scopeParent,i=l?a.scopeParent:a,u=On(i,l),c=l?o(a.candidates):i;u===0?l?n.push.apply(n,c):n.push(i):r.push({documentOrder:s,tabIndex:u,item:a,isScope:l,content:c})}),r.sort(Ln).reduce(function(a,s){return s.isScope?a.push.apply(a,s.content):a.push(s.content),a},[]).concat(n)},Gn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ze([t],n.includeContainer,{filter:Ce.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Wn}):r=Ge(t,n.includeContainer,Ce.bind(null,n)),qn(r)},Zn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ze([t],n.includeContainer,{filter:le.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Ge(t,n.includeContainer,le.bind(null,n)),r},G=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Y.call(t,re)===!1?!1:Ce(n,t)},Xn=We.concat("iframe").join(","),xe=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Y.call(t,Xn)===!1?!1:le(n,t)};/*!
5
+ * focus-trap 7.6.5
6
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
7
+ */function Te(o,t){(t==null||t>o.length)&&(t=o.length);for(var n=0,r=Array(t);n<t;n++)r[n]=o[n];return r}function Qn(o){if(Array.isArray(o))return Te(o)}function Jn(o,t,n){return(t=or(t))in o?Object.defineProperty(o,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):o[t]=n,o}function er(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function tr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function et(o,t){var n=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),n.push.apply(n,r)}return n}function tt(o){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?et(Object(n),!0).forEach(function(r){Jn(o,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(n,r))})}return o}function nr(o){return Qn(o)||er(o)||ar(o)||tr()}function rr(o,t){if(typeof o!="object"||!o)return o;var n=o[Symbol.toPrimitive];if(n!==void 0){var r=n.call(o,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(o)}function or(o){var t=rr(o,"string");return typeof t=="symbol"?t:t+""}function ar(o,t){if(o){if(typeof o=="string")return Te(o,t);var n={}.toString.call(o).slice(8,-1);return n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set"?Array.from(o):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Te(o,t):void 0}}var nt={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r._setPausedState(!0)}var a=t.indexOf(n);a===-1||t.splice(a,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},lr=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},sr=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},Q=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},ir=function(t){return Q(t)&&!t.shiftKey},cr=function(t){return Q(t)&&t.shiftKey},rt=function(t){return setTimeout(t,0)},J=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,r):t},se=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},dr=[],ur=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||dr,s=tt({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:ir,isKeyBackward:cr},n),l={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i,u=function(m,d,y){return m&&m[d]!==void 0?m[d]:s[y||d]},c=function(m,d){var y=typeof(d==null?void 0:d.composedPath)=="function"?d.composedPath():void 0;return l.containerGroups.findIndex(function(C){var B=C.container,I=C.tabbableNodes;return B.contains(m)||(y==null?void 0:y.includes(B))||I.find(function(E){return E===m})})},f=function(m){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=d.hasFallback,C=y===void 0?!1:y,B=d.params,I=B===void 0?[]:B,E=s[m];if(typeof E=="function"&&(E=E.apply(void 0,nr(I))),E===!0&&(E=void 0),!E){if(E===void 0||E===!1)return E;throw new Error("`".concat(m,"` was specified but was not a node, or did not return a node"))}var $=E;if(typeof E=="string"){try{$=r.querySelector(E)}catch(A){throw new Error("`".concat(m,'` appears to be an invalid selector; error="').concat(A.message,'"'))}if(!$&&!C)throw new Error("`".concat(m,"` as selector refers to no known node"))}return $},g=function(){var m=f("initialFocus",{hasFallback:!0});if(m===!1)return!1;if(m===void 0||m&&!xe(m,s.tabbableOptions))if(c(r.activeElement)>=0)m=r.activeElement;else{var d=l.tabbableGroups[0],y=d&&d.firstTabbableNode;m=y||f("fallbackFocus")}else m===null&&(m=f("fallbackFocus"));if(!m)throw new Error("Your focus-trap needs to have at least one focusable element");return m},b=function(){if(l.containerGroups=l.containers.map(function(m){var d=Gn(m,s.tabbableOptions),y=Zn(m,s.tabbableOptions),C=d.length>0?d[0]:void 0,B=d.length>0?d[d.length-1]:void 0,I=y.find(function(A){return G(A)}),E=y.slice().reverse().find(function(A){return G(A)}),$=!!d.find(function(A){return H(A)>0});return{container:m,tabbableNodes:d,focusableNodes:y,posTabIndexesFound:$,firstTabbableNode:C,lastTabbableNode:B,firstDomTabbableNode:I,lastDomTabbableNode:E,nextTabbableNode:function(W){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,j=d.indexOf(W);return j<0?ee?y.slice(y.indexOf(W)+1).find(function(te){return G(te)}):y.slice(0,y.indexOf(W)).reverse().find(function(te){return G(te)}):d[j+(ee?1:-1)]}}}),l.tabbableGroups=l.containerGroups.filter(function(m){return m.tabbableNodes.length>0}),l.tabbableGroups.length<=0&&!f("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(l.containerGroups.find(function(m){return m.posTabIndexesFound})&&l.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.")},p=function(m){var d=m.activeElement;if(d)return d.shadowRoot&&d.shadowRoot.activeElement!==null?p(d.shadowRoot):d},h=function(m){if(m!==!1&&m!==p(document)){if(!m||!m.focus){h(g());return}m.focus({preventScroll:!!s.preventScroll}),l.mostRecentlyFocusedNode=m,lr(m)&&m.select()}},v=function(m){var d=f("setReturnFocus",{params:[m]});return d||(d===!1?!1:m)},T=function(m){var d=m.target,y=m.event,C=m.isBackward,B=C===void 0?!1:C;d=d||se(y),b();var I=null;if(l.tabbableGroups.length>0){var E=c(d,y),$=E>=0?l.containerGroups[E]:void 0;if(E<0)B?I=l.tabbableGroups[l.tabbableGroups.length-1].lastTabbableNode:I=l.tabbableGroups[0].firstTabbableNode;else if(B){var A=l.tabbableGroups.findIndex(function($e){var Pe=$e.firstTabbableNode;return d===Pe});if(A<0&&($.container===d||xe(d,s.tabbableOptions)&&!G(d,s.tabbableOptions)&&!$.nextTabbableNode(d,!1))&&(A=E),A>=0){var W=A===0?l.tabbableGroups.length-1:A-1,ee=l.tabbableGroups[W];I=H(d)>=0?ee.lastTabbableNode:ee.lastDomTabbableNode}else Q(y)||(I=$.nextTabbableNode(d,!1))}else{var j=l.tabbableGroups.findIndex(function($e){var Pe=$e.lastTabbableNode;return d===Pe});if(j<0&&($.container===d||xe(d,s.tabbableOptions)&&!G(d,s.tabbableOptions)&&!$.nextTabbableNode(d))&&(j=E),j>=0){var te=j===l.tabbableGroups.length-1?0:j+1,ht=l.tabbableGroups[te];I=H(d)>=0?ht.firstTabbableNode:ht.firstDomTabbableNode}else Q(y)||(I=$.nextTabbableNode(d))}}else I=f("fallbackFocus");return I},k=function(m){var d=se(m);if(!(c(d,m)>=0)){if(J(s.clickOutsideDeactivates,m)){i.deactivate({returnFocus:s.returnFocusOnDeactivate});return}J(s.allowOutsideClick,m)||m.preventDefault()}},S=function(m){var d=se(m),y=c(d,m)>=0;if(y||d instanceof Document)y&&(l.mostRecentlyFocusedNode=d);else{m.stopImmediatePropagation();var C,B=!0;if(l.mostRecentlyFocusedNode)if(H(l.mostRecentlyFocusedNode)>0){var I=c(l.mostRecentlyFocusedNode),E=l.containerGroups[I].tabbableNodes;if(E.length>0){var $=E.findIndex(function(A){return A===l.mostRecentlyFocusedNode});$>=0&&(s.isKeyForward(l.recentNavEvent)?$+1<E.length&&(C=E[$+1],B=!1):$-1>=0&&(C=E[$-1],B=!1))}}else l.containerGroups.some(function(A){return A.tabbableNodes.some(function(W){return H(W)>0})})||(B=!1);else B=!1;B&&(C=T({target:l.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(l.recentNavEvent)})),h(C||l.mostRecentlyFocusedNode||g())}l.recentNavEvent=void 0},D=function(m){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;l.recentNavEvent=m;var y=T({event:m,isBackward:d});y&&(Q(m)&&m.preventDefault(),h(y))},M=function(m){(s.isKeyForward(m)||s.isKeyBackward(m))&&D(m,s.isKeyBackward(m))},P=function(m){sr(m)&&J(s.escapeDeactivates,m)!==!1&&(m.preventDefault(),i.deactivate())},x=function(m){var d=se(m);c(d,m)>=0||J(s.clickOutsideDeactivates,m)||J(s.allowOutsideClick,m)||(m.preventDefault(),m.stopImmediatePropagation())},V=function(){if(l.active)return nt.activateTrap(a,i),l.delayInitialFocusTimer=s.delayInitialFocus?rt(function(){h(g())}):h(g()),r.addEventListener("focusin",S,!0),r.addEventListener("mousedown",k,{capture:!0,passive:!1}),r.addEventListener("touchstart",k,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",M,{capture:!0,passive:!1}),r.addEventListener("keydown",P),i},ce=function(){if(l.active)return r.removeEventListener("focusin",S,!0),r.removeEventListener("mousedown",k,!0),r.removeEventListener("touchstart",k,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",M,!0),r.removeEventListener("keydown",P),i},Z=function(m){var d=m.some(function(y){var C=Array.from(y.removedNodes);return C.some(function(B){return B===l.mostRecentlyFocusedNode})});d&&h(g())},U=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Z):void 0,R=function(){U&&(U.disconnect(),l.active&&!l.paused&&l.containers.map(function(m){U.observe(m,{subtree:!0,childList:!0})}))};return i={get active(){return l.active},get paused(){return l.paused},activate:function(m){if(l.active)return this;var d=u(m,"onActivate"),y=u(m,"onPostActivate"),C=u(m,"checkCanFocusTrap");C||b(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=p(r),d==null||d();var B=function(){C&&b(),V(),R(),y==null||y()};return C?(C(l.containers.concat()).then(B,B),this):(B(),this)},deactivate:function(m){if(!l.active)return this;var d=tt({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},m);clearTimeout(l.delayInitialFocusTimer),l.delayInitialFocusTimer=void 0,ce(),l.active=!1,l.paused=!1,R(),nt.deactivateTrap(a,i);var y=u(d,"onDeactivate"),C=u(d,"onPostDeactivate"),B=u(d,"checkCanReturnFocus"),I=u(d,"returnFocus","returnFocusOnDeactivate");y==null||y();var E=function(){rt(function(){I&&h(v(l.nodeFocusedBeforeActivation)),C==null||C()})};return I&&B?(B(v(l.nodeFocusedBeforeActivation)).then(E,E),this):(E(),this)},pause:function(m){return l.active?(l.manuallyPaused=!0,this._setPausedState(!0,m)):this},unpause:function(m){return l.active?(l.manuallyPaused=!1,a[a.length-1]!==this?this:this._setPausedState(!1,m)):this},updateContainerElements:function(m){var d=[].concat(m).filter(Boolean);return l.containers=d.map(function(y){return typeof y=="string"?r.querySelector(y):y}),l.active&&b(),R(),this}},Object.defineProperties(i,{_isManuallyPaused:{value:function(){return l.manuallyPaused}},_setPausedState:{value:function(m,d){if(l.paused===m)return this;if(l.paused=m,m){var y=u(d,"onPause"),C=u(d,"onPostPause");y==null||y(),ce(),R(),C==null||C()}else{var B=u(d,"onUnpause"),I=u(d,"onPostUnpause");B==null||B(),b(),V(),R(),I==null||I()}return this}}}),i.updateContainerElements(t),i};const fr=e.defineComponent({name:"UseFocusTrap",props:["as","options"],setup(o,{slots:t}){let n;const r=e.ref(),a=()=>n&&n.activate(),s=()=>n&&n.deactivate();return e.watch(()=>An(r),l=>{l&&(n=ur(l,o.options||{}),a())},{flush:"post"}),e.onScopeDispose(()=>s()),()=>{if(t.default)return e.h(o.as||"div",{ref:r},t.default())}}}),mr={class:"modal fixed top-0 left-0 z-[300] flex items-center justify-center w-screen h-screen text-gray-900 dark:text-neutral-200 bg-transparent","aria-modal":"true","aria-labelledby":"modalTitle","aria-describedby":"modalDescription"},pr={key:0,class:"absolute inset-0 w-full h-full backdrop-blur-sm bg-opacity-70"},hr=e.defineComponent({__name:"GlobalModal",setup(o){const t=ne();return(n,r)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("dialog",mr,[e.createVNode(e.Transition,{"enter-active-class":"ease-out duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"ease-in duration-300","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.unref(t).isOpen?(e.openBlock(),e.createElementBlock("div",pr)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"ease-out duration-300","enter-from-class":"opacity-0 sm:scale-95","enter-to-class":"opacity-100 sm:scale-100","leave-active-class":"ease-in duration-200","leave-from-class":"opacity-100 sm:scale-100","leave-to-class":"opacity-0 sm:scale-95"},{default:e.withCtx(()=>[e.unref(t).isOpen?(e.openBlock(),e.createBlock(e.unref(fr),{key:0,class:"relative w-full px-6 py-10 sm:py-6 max-h-screen h-full overflow-y-scroll scrollbar-hide flex items-center"},{default:e.withCtx(()=>[e.createVNode(e.unref(He),{onTrigger:e.unref(t).close,onKeydown:e.withKeys(e.unref(t).close,["esc"]),class:"gap-4 flex flex-col drop-shadow-md m-auto w-full p-6 bg-white dark:bg-neutral-800/90 backdrop-blur-lg border shadow-lg border-neutral-200 dark:border-neutral-700 sm:max-w-lg xl:max-w-xl 3xl:max-w-2xl rounded-md sm:rounded-lg",tabindex:"-1"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(t).component),e.normalizeProps(e.guardReactiveProps(e.unref(t).props)),null,16))]),_:1},8,["onTrigger","onKeydown"])]),_:1})):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,e.unref(t).isOpen||e.unref(t).isAnimating]])]))}}),gr=["disabled"],_=e.defineComponent({__name:"TablePaginationButton",props:{currentPage:{},pageNumber:{},text:{},underline:{type:Boolean,default:!1},sticky:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(o){const t=o;return(n,r)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([{hidden:t.currentPage!==t.pageNumber&&!t.text&&!t.sticky},"h-full md:block z-0"])},[e.createElementVNode("button",{class:e.normalizeClass(["relative inline-flex items-center h-full px-3 group hover:text-gray-900 hover:dark:text-white disabled:dark:text-neutral-500 disabled:text-neutral-400 disabled:cursor-not-allowed",{"text-gray-900 dark:text-white bg-gray-50 dark:bg-neutral-900":t.currentPage===t.pageNumber}]),disabled:t.disabled??!1},[e.renderSlot(n.$slots,"content",{},()=>[e.createElementVNode("span",null,e.toDisplayString((t==null?void 0:t.text)??t.pageNumber),1)]),!t.text||t.underline?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["box-content absolute bottom-0 w-0 h-px -mx-px duration-200 ease-out translate-y-px border-transparent group-hover:left-0 group-hover:w-full group-hover:border-l group-hover:border-r bg-violet-600 group-hover:border-violet-600",{"left-0 w-full border-l border-r":t.currentPage===t.pageNumber,"left-1/2":t.currentPage!==t.pageNumber}]),"bg-neutral-900":"","dark:bg-violet-600":"","group-hover:border-neutral-900":"","group-hover:dark:border-violet-600":""},null,2)):e.createCommentVNode("",!0)],10,gr)],2))}}),br={class:"dark:text-neutral-300 line-clamp-1 text-sm"},yr={class:"font-medium dark:text-white"},wr={class:"font-medium dark:text-white"},kr={class:"font-medium dark:text-white"},vr={class:"flex items-center text-sm leading-tight bg-white dark:bg-primary-dark-800/70 border divide-x rounded h-9 text-neutral-500 dark:text-neutral-300 divide-neutral-200 dark:divide-neutral-700 border-neutral-200 dark:border-neutral-700"},ot=e.defineComponent({__name:"TablePagination",props:{listLength:{},currentPage:{},itemsPerPage:{},useIcons:{type:Boolean},maxVisiblePages:{default:5}},emits:["setPage"],setup(o,{emit:t}){const n=o,r=e.ref(null),a=t,s=e.computed(()=>Math.ceil(n.listLength/n.itemsPerPage)),l=e.computed(()=>{const u=s.value,c=n.currentPage,f=n.maxVisiblePages,g=Math.max(f-1,3),b=Math.max(f-1,2);if(u<=f)return Array.from({length:u},(p,h)=>h+1);if(c<g)return Array.from({length:b},(p,h)=>h+1);if(s.value-c<g-1){let p=[];for(let h=s.value-b+1;h<=s.value;h++)p=[...p,h];return p}return f>=5?[c-1,c,c+1]:[c]}),i=async u=>{var c;a("setPage",u),await e.nextTick(),(c=r.value)==null||c.scrollIntoView({behavior:"instant",block:"end"})};return(u,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("flex items-center flex-col sm:flex-row sm:justify-between flex-wrap gap-2 scroll-mb-12"),ref_key:"$element",ref:r},[e.createElementVNode("p",br,[c[6]||(c[6]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",yr,e.toDisplayString(n.listLength?n.itemsPerPage*(u.currentPage-1)+1:0),1),c[7]||(c[7]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",wr,e.toDisplayString(Math.min(n.itemsPerPage*u.currentPage,n.listLength)),1),c[8]||(c[8]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",kr,e.toDisplayString(u.listLength),1)]),e.createElementVNode("ul",vr,[e.createVNode(_,{pageNumber:-1,text:"Previous",disabled:n.currentPage===1,onClick:c[0]||(c[0]=f=>i(Math.max(1,n.currentPage-1))),title:"Previous Page"},e.createSlots({_:2},[u.useIcons?{name:"content",fn:e.withCtx(()=>[e.createVNode(e.unref(Oe),{class:"w-4 h-4",title:"Previous"})]),key:"0"}:{name:"content",fn:e.withCtx(()=>[c[9]||(c[9]=e.createElementVNode("span",{class:"hidden sm:block"},e.toDisplayString("Previous"),-1)),e.createVNode(e.unref(Oe),{class:"w-4 h-4 sm:hidden",title:"Previous"})]),key:"1"}]),1032,["disabled"]),s.value>n.maxVisiblePages&&n.currentPage>Math.max(n.maxVisiblePages-2,2)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[u.maxVisiblePages>3?(e.openBlock(),e.createBlock(_,{key:0,pageNumber:1,currentPage:n.currentPage,onClick:c[1]||(c[1]=f=>i(1)),sticky:!0},null,8,["currentPage"])):e.createCommentVNode("",!0),e.createVNode(_,{pageNumber:-1,text:"...",onClick:c[2]||(c[2]=f=>i(Math.floor(u.currentPage/2))),underline:!0,title:`Page ${Math.floor(u.currentPage/2)}`},null,8,["title"])],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,f=>(e.openBlock(),e.createBlock(_,{key:f,pageNumber:f,currentPage:n.currentPage,onClick:g=>i(f),title:`Page ${f}`},null,8,["pageNumber","currentPage","onClick","title"]))),128)),s.value>n.maxVisiblePages&&s.value-n.currentPage>Math.max(n.maxVisiblePages-3,1)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(_,{pageNumber:-1,text:"...",title:`Page ${Math.floor((s.value-u.currentPage)/2+u.currentPage)}`,onClick:c[3]||(c[3]=f=>i(Math.floor((s.value-u.currentPage)/2+u.currentPage))),underline:!0},null,8,["title"]),u.maxVisiblePages>3?(e.openBlock(),e.createBlock(_,{key:0,pageNumber:s.value,currentPage:n.currentPage,onClick:c[4]||(c[4]=f=>i(s.value)),sticky:!0},null,8,["pageNumber","currentPage"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createVNode(_,{pageNumber:-1,text:"Next",disabled:n.currentPage===s.value,onClick:c[5]||(c[5]=f=>i(Math.min(s.value,n.currentPage+1))),title:"Next Page"},e.createSlots({_:2},[u.useIcons?{name:"content",fn:e.withCtx(()=>[e.createVNode(e.unref(Me),{class:"w-4 h-4",title:"Next"})]),key:"0"}:{name:"content",fn:e.withCtx(()=>[c[10]||(c[10]=e.createElementVNode("span",{class:"hidden sm:block"},e.toDisplayString("Next"),-1)),e.createVNode(e.unref(Me),{class:"w-4 h-4 sm:hidden",title:"Next"})]),key:"1"}]),1032,["disabled"])])],512))}}),Cr={class:"flex flex-col justify-center gap-2 text-sm"},xr=["name","id","placeholder"],Tr=e.defineComponent({__name:"TextInputLabelled",props:e.mergeModels(["text","placeholder","id"],{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue");return(n,r)=>(e.openBlock(),e.createElementBlock("div",Cr,[e.createVNode(de,{field:{name:o.id,text:o.text,type:"text"}},null,8,["field"]),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":r[0]||(r[0]=a=>t.value=a),name:o.id,id:o.id,placeholder:o.placeholder,class:e.normalizeClass(`h-10 p-2 px-3 shadow-sm rounded-md w-full text-sm
9
+ border-none outline-none
10
+ disabled:cursor-not-allowed disabled:opacity-50
11
+ text-gray-900 dark:text-neutral-100 bg-white dark:bg-primary-dark-800 placeholder:text-neutral-400
12
+ ring-inset focus:ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700
13
+ hocus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500 hover:ring-violet-400 hover:dark:ring-violet-700`)},null,8,xr),[[e.vModelText,t.value]])]))}});function at(o,t){const n=e.reactive({selectOpen:!1,selectedItem:"",selectableItems:o,selectableItemActive:null,selectId:"select-12",selectKeydownValue:"",selectKeydownTimeout:1e3,selectKeydownClearTimeout:null,selectDropdownPosition:"bottom",selectableItemsList:t.selectableItemsList,selectButton:t.selectButton,toggleSelect(a){a!==void 0?this.selectOpen=a===!0:this.selectOpen=!this.selectOpen},updateRefs(a){this.selectButton=a.selectButton,this.selectableItemsList=a.selectableItemsList},selectableItemIsActive(a){return this.selectableItemActive&&this.selectableItemActive.value==a.value},selectableItemActiveNext(){let a=this.selectableItems.indexOf(this.selectableItemActive);a<this.selectableItems.length-1&&(this.selectableItemActive=this.selectableItems[a+1],this.selectScrollToActiveItem())},selectableItemActivePrevious(){let a=this.selectableItems.indexOf(this.selectableItemActive);a>0&&(this.selectableItemActive=this.selectableItems[a-1],this.selectScrollToActiveItem())},selectScrollToActiveItem(){if(!this.selectableItemActive)return;let a=document.getElementById(this.selectableItemActive.value+"-"+this.selectId);a&&a.focus()},selectKeydown(a){if(a.keyCode>=65&&a.keyCode<=90){this.selectKeydownValue+=a.key;let s=this.selectItemsFindBestMatch();s&&(this.selectOpen?(this.selectableItemActive=s,this.selectScrollToActiveItem()):this.selectedItem=this.selectableItemActive===s),this.selectKeydownValue!=""&&(clearTimeout(this.selectKeydownClearTimeout),this.selectKeydownClearTimeout=window.setTimeout(()=>{this.selectKeydownValue=""},this.selectKeydownTimeout))}},selectItemsFindBestMatch(){let a=this.selectKeydownValue.toLowerCase(),s=null,l=-1;for(const i of this.selectableItems){let c=i.title.toLowerCase().indexOf(a);c>-1&&(l==-1||c<l)&&!i.disabled&&(s=i,l=c)}return s},selectPositionUpdate(){var s;if(!this.selectableItemsList||!this.selectButton)return;let a=((s=this.selectButton)==null?void 0:s.getBoundingClientRect().top)+this.selectButton.offsetHeight+parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);window.innerHeight<a?this.selectDropdownPosition="top":this.selectDropdownPosition="bottom"}}),r=()=>{n.selectOpen&&n.selectPositionUpdate()};return e.watch(()=>n.selectOpen,function(a){if(n.selectedItem?n.selectableItemActive=n.selectedItem:n.selectableItemActive=n.selectableItems[0],!a){window.removeEventListener("resize",r);return}window.setTimeout(function(){n.selectScrollToActiveItem()},10),r(),window.addEventListener("resize",r)},{immediate:!1}),n}const Br=["id","disabled","title"],Er={class:"truncate"},Sr={class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},Nr=["onClick","onKeydown","onFocus","onMousemove","id","title","data-disabled","tabindex","aria-selected"],Ir={key:0,class:"absolute left-0 w-4 h-4 ml-2 stroke-current text-neutral-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},$r={class:"block font-medium truncate"},Pr=e.defineComponent({__name:"InputSelect",props:{name:{},class:{default:""},rootClass:{default:""},placeholder:{},defaultItem:{default:null},options:{default:()=>[{title:"Title",value:"title",disabled:!1},{title:"Date Uploaded",value:"date",disabled:!1},{title:"Date released",value:"date_released",disabled:!1},{title:"Episode",value:"episode",disabled:!0},{title:"Season",value:"season",disabled:!0}]},disabled:{type:Boolean},title:{},prefix:{default:""},menuMargin:{}},emits:["selectItem"],setup(o,{emit:t}){const n=o,r=t,a=e.useTemplateRef("selectButton"),s=e.useTemplateRef("selectableItemsList"),l=e.useTemplateRef("selectableItemsRoot"),i=at(n.options,{selectableItemsList:s,selectButton:a}),u=e.ref(null),c=(p,h=!0)=>{var v;i.selectedItem=p,i.toggleSelect(!1),h&&((v=a.value)==null||v.focus()),r("selectItem",i.selectedItem)},f=p=>{i.selectableItemActive=p,i.selectScrollToActiveItem()},g=p=>{i.selectableItemActive=p},b=()=>{u.value&&clearTimeout(u.value),u.value=window.setTimeout(()=>{if(!l.value)return;const p=document.activeElement;l.value.contains(p)||i.toggleSelect(!1)},0)};return e.onMounted(()=>{n.disabled||n.defaultItem!=null&&n.defaultItem<n.options.length&&n.defaultItem>=0&&c(n.options[n.defaultItem],!1)}),e.watch(()=>n.options,()=>{i.selectableItems=n.options}),e.watch(a,()=>{a.value&&(i.selectButton=a)},{immediate:!0}),e.watch(()=>s.value,()=>{s.value&&(i.selectableItemsList=s)},{immediate:!0}),(p,h)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["relative",p.rootClass]),onFocusout:b,ref_key:"selectableItemsRoot",ref:l},[e.createElementVNode("button",{id:p.name??"Select",ref_key:"selectButton",ref:a,onClick:h[0]||(h[0]=v=>e.unref(i).toggleSelect()),class:e.normalizeClass([{"hocus:ring-0":e.unref(i).selectOpen},{"!text-neutral-400":p.placeholder&&!e.unref(i).selectedItem},"relative h-10 flex items-center justify-between w-full py-2 pl-3 pr-10","text-left rounded-md shadow-sm cursor-pointer text-sm border-none focus:outline-none","ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700 hocus:ring-[0.125rem] hover:ring-violet-400 hover:dark:ring-violet-700 focus:ring-purple-400 dark:focus:ring-purple-500","text-gray-900 dark:text-neutral-100 bg-white dark:bg-primary-dark-800","disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:opacity-60",n.class]),disabled:p.disabled,type:"button",title:p.title??"Make Selection"},[e.createElementVNode("span",Er,e.toDisplayString(e.unref(i).selectedItem?`${p.prefix}${e.unref(i).selectedItem.title}`:p.placeholder),1),e.createElementVNode("span",Sr,[e.renderSlot(p.$slots,"selectButtonIcon",{},()=>[h[7]||(h[7]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",class:"w-5 h-5 text-gray-400"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z","clip-rule":"evenodd"})],-1))])])],10,Br),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-50","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100"},{default:e.withCtx(()=>{var v,T;return[e.unref(i).selectOpen?(e.openBlock(),e.createBlock(e.unref(He),{key:0,class:e.normalizeClass([[e.unref(i).selectDropdownPosition=="top"?`bottom-0 ${((v=p.menuMargin)==null?void 0:v.bottom)??"mb-11"}`:`top-0 ${((T=p.menuMargin)==null?void 0:T.top)??"mt-11"}`],"z-30 absolute w-full mt-1 overflow-clip text-sm rounded-md shadow-md max-h-56 ring-1 ring-opacity-5 ring-black dark:ring-neutral-700 bg-white dark:bg-neutral-800/70 backdrop-blur-lg"]),onTrigger:h[1]||(h[1]=k=>e.unref(i).toggleSelect(!1)),onKeydown:[h[2]||(h[2]=e.withKeys(e.withModifiers(k=>{e.unref(i).selectOpen&&(e.unref(i).toggleSelect(!1),k.stopPropagation())},["stop"]),["esc"])),h[3]||(h[3]=e.withKeys(e.withModifiers(k=>{e.unref(i).selectOpen?e.unref(i).selectableItemActiveNext():e.unref(i).toggleSelect(!0),k.preventDefault()},["stop","prevent"]),["down"])),h[4]||(h[4]=e.withKeys(e.withModifiers(k=>{e.unref(i).selectOpen?e.unref(i).selectableItemActivePrevious():e.unref(i).toggleSelect(!0),k.preventDefault()},["stop","prevent"]),["up"])),h[5]||(h[5]=e.withKeys(e.withModifiers(k=>{e.unref(i).selectedItem=e.unref(i).selectableItemActive,e.unref(i).toggleSelect(!1)},["stop"]),["enter"])),h[6]||(h[6]=e.withModifiers(k=>e.unref(i).selectKeydown(k),["stop"]))]},{default:e.withCtx(()=>[e.createElementVNode("ul",{ref_key:"selectableItemsList",ref:s,class:"w-full overflow-auto max-h-56 scrollbar-thin focus:outline-none",tabindex:"-1",role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i).selectableItems,k=>(e.openBlock(),e.createElementBlock("li",{key:k.value,onClick:S=>c(k),onKeydown:[e.withKeys(S=>c(k),["enter"]),e.withKeys(S=>c(k),["space"])],onFocus:S=>g(k),onMousemove:S=>f(k),id:k.value+"-"+e.unref(i).selectId,title:k.title,"data-disabled":k.disabled?k.disabled:"",tabindex:e.unref(i).selectableItemIsActive(k)?0:-1,class:e.normalizeClass([{"bg-neutral-100 dark:bg-neutral-900/70 text-gray-900 dark:text-neutral-100":e.unref(i).selectableItemIsActive(k),"text-gray-700 dark:text-neutral-300":!e.unref(i).selectableItemIsActive(k)},"focus:rounded-md relative flex items-center h-full py-2 pl-8 cursor-pointer data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none"]),role:"option","aria-selected":e.unref(i).selectableItemIsActive(k)?"true":"false"},[e.unref(i).selectedItem.value==k.value?(e.openBlock(),e.createElementBlock("svg",Ir,h[8]||(h[8]=[e.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):e.createCommentVNode("",!0),e.createElementVNode("span",$r,e.toDisplayString(k.title),1)],42,Nr))),128))],512)]),_:1},8,["class"])):e.createCommentVNode("",!0)]}),_:1})],34))}}),Dr=["type","disabled","title"],Vr=e.defineComponent({__name:"ButtonIcon",props:{type:{default:"button"},disabled:{type:Boolean},title:{},variant:{default:"default"},to:{},target:{default:"_self"}},setup(o){const t=o,n=e.computed(()=>{switch(t.variant){case"ghost":return"";case"transparent":return["transition","hover:bg-white hover:dark:bg-primary-dark-800","focus:outline-none hover:text-gray-900 dark:text-neutral-100","hocus:ring-[0.125rem] hover:ring-violet-400 hover:dark:ring-violet-700 focus:ring-white","aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:ring-1 aria-disabled:opacity-60","disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"].join(" ");default:return["h-10 max-h-full aspect-square rounded-md ","p-2 shadow-sm","focus:outline-none text-gray-900 dark:text-neutral-100","ring-1 ring-neutral-200 dark:ring-neutral-700 hocus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500 hover:ring-violet-400 hover:dark:ring-violet-700","bg-white dark:bg-primary-dark-800","aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:ring-1 aria-disabled:opacity-60","disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:ring-1 disabled:opacity-60"].join(" ")}});return(r,a)=>{const s=e.resolveComponent("router-link");return r.to?(e.openBlock(),e.createBlock(s,{key:0,to:r.to,class:e.normalizeClass(["flex items-center justify-center cursor-pointer",n.value]),type:t.type,title:t.title??"Button","aria-disabled":r.disabled,target:r.target},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"text"),e.renderSlot(r.$slots,"icon")]),_:3},8,["to","class","type","title","aria-disabled","target"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["flex items-center justify-center cursor-pointer",n.value]),type:t.type,disabled:t.disabled,title:t.title??"Icon"},[e.renderSlot(r.$slots,"text"),e.renderSlot(r.$slots,"icon")],10,Dr))}}});function lt(o){const t=e.ref(1),n=e.ref(o.itemsPerPage??10),r=e.ref(o.searchQuery??""),a=e.reactive({filteredPage:e.computed(()=>{const s=n.value*(t.value-1),l=Math.min(n.value*t.value,o.data.length);return o.data.slice(s,l)}),props:o,fields:{currentPage:t,itemsPerPage:n,searchQuery:r},handlePageChange(s){t.value=s},handlePageReset(){t.value=1}});return e.watch(()=>o.data,(s,l)=>{var i,u;((s==null?void 0:s.length)!==(l==null?void 0:l.length)||s[0]&&l[0]&&((i=s[0])==null?void 0:i.id)!==((u=l[0])==null?void 0:u.id))&&a.handlePageReset()},{immediate:!0}),a}const Ar={class:"flex flex-col gap-4 w-full"},Mr={key:0,class:"flex justify-center sm:justify-between flex-col sm:flex-row gap-2"},Or={class:"flex items-end gap-2 flex-wrap"},Lr={class:"flex gap-2 flex-col w-full sm:w-40 flex-1"},Fr={key:0,class:"col-span-full flex items-center justify-center text-center text-lg text-gray-500 dark:text-gray-400 uppercase tracking-wider w-full gap-2"},_r=e.defineComponent({__name:"TableBase",props:e.mergeModels({useToolbar:{type:Boolean,default:!0},usePagination:{type:Boolean,default:!0},usePaginationIcons:{type:Boolean,default:!1},useGrid:{},data:{},row:{},rowAttributes:{},loading:{type:Boolean},clickAction:{},otherAction:{},sortAction:{},sortingOptions:{},itemsPerPage:{default:12},itemName:{},searchQuery:{default:""},selectedID:{default:null},tableStyles:{},startAscending:{type:Boolean,default:!0},paginationClass:{},maxVisiblePages:{default:5},noResultsMessage:{default:"No Results"}},{modelValue:{required:!1,default:void 0},modelModifiers:{}}),emits:e.mergeModels(["search"],["update:modelValue"]),setup(o,{emit:t}){const n=o,r=t,a=lt(n),s=e.ref(n.startAscending),l=e.ref(""),i=e.useModel(o,"modelValue"),u=f=>{var g;f!=null&&f.value&&(l.value=f.value),l.value&&((g=n.sortAction)==null||g.call(n,l.value,s.value?1:-1))},c=f=>{const b=f.target.value;i.value!==void 0?i.value=b:a.fields.searchQuery=b,r("search",b)};return e.onMounted(()=>{n.useToolbar&&n.sortAction&&n.sortAction(l.value,n.startAscending?1:-1)}),(f,g)=>{var b;return e.openBlock(),e.createElementBlock("section",Ar,[n.useToolbar?(e.openBlock(),e.createElementBlock("section",Mr,[e.createVNode(Tr,{value:i.value??e.unref(a).fields.searchQuery,text:"",placeholder:`Search ${n.itemName?`${n.itemName}...`:""}`,id:"table-search",class:"w-full sm:w-80",title:"Search with...",onInput:c},null,8,["value","placeholder"]),e.createElementVNode("span",Or,[e.createElementVNode("div",Lr,[e.createVNode(Pr,{name:"sort",placeholder:"Sort by...",prefix:"By ",options:f.sortingOptions,defaultItem:0,class:"w-full",title:"Sort by...",onSelectItem:u},null,8,["options"])]),e.createVNode(Vr,{onClick:g[0]||(g[0]=p=>{s.value=!s.value,u()}),title:"Reorder Results...","aria-label":"Reorder Results",class:"ring-inset"},{icon:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(e.unref(Ot),{key:0,width:"24",height:"24"})):(e.openBlock(),e.createBlock(e.unref(Rt),{key:1,width:"24",height:"24"}))]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass([f.useGrid||`flex w-full flex-wrap gap-2 ${f.tableStyles??""}`])},[f.loading||e.unref(a).filteredPage.length===0?(e.openBlock(),e.createElementBlock("div",Fr,[e.createElementVNode("p",null,e.toDisplayString(f.loading?"...Loading":f.noResultsMessage),1),e.withDirectives(e.createVNode(e.unref(Yt),null,null,512),[[e.vShow,f.loading]])])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(a).filteredPage,(p,h)=>e.renderSlot(f.$slots,"row",{key:(p==null?void 0:p.id)??h,row:p,index:h,selectedID:n.selectedID},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.row),e.mergeProps({data:p,index:h,currentID:n.selectedID??null},{ref_for:!0},f.rowAttributes,{onClickAction:(...v)=>{var T;return(T=n.clickAction)==null?void 0:T.call(n,p==null?void 0:p.id,...v)},onOtherAction:(...v)=>{var T;return(T=n.otherAction)==null?void 0:T.call(n,p==null?void 0:p.id,...v)}}),null,16,["data","index","currentID","onClickAction","onOtherAction"]))])),128))],2),f.usePagination?(e.openBlock(),e.createBlock(ot,{key:1,class:e.normalizeClass(f.paginationClass),listLength:((b=n.data)==null?void 0:b.length)??0,itemsPerPage:e.unref(a).fields.itemsPerPage,currentPage:e.unref(a).fields.currentPage,useIcons:n.usePaginationIcons,"max-visible-pages":n.maxVisiblePages,onSetPage:e.unref(a).handlePageChange},null,8,["class","listLength","itemsPerPage","currentPage","useIcons","max-visible-pages","onSetPage"])):e.createCommentVNode("",!0)])}}});function Rr({options:o,defaultItems:t},n){const r=e.reactive({selectOpen:!1,selectedItems:t,selectableItems:o,selectableItemActive:null,selectId:"select-12",selectKeydownValue:"",selectKeydownTimeout:1e3,selectKeydownClearTimeout:null,selectDropdownPosition:"bottom",selectableItemsList:n.selectableItemsList,selectButton:n.selectButton,toggleSelect(s){s!==void 0?this.selectOpen=s===!0:this.selectOpen=!this.selectOpen},updateRefs(s){this.selectButton=s.selectButton,this.selectableItemsList=s.selectableItemsList,this.selectPositionUpdate()},selectableItemIsActive(){return!1},async selectScrollToActiveItem(s,l=!0){let i=document.getElementById(s+"-"+this.selectId);i&&(i.scrollIntoView({behavior:"smooth",block:"center"}),l&&i.focus({preventScroll:!1}))},selectKeydown(s){if(s.keyCode<65||s.keyCode>90)return;this.selectKeydownValue+=s.key;let l=this.selectItemsFindBestMatch();l&&this.selectOpen&&(this.selectableItemActive=l),this.selectKeydownValue!==""&&(clearTimeout(this.selectKeydownClearTimeout),this.selectKeydownClearTimeout=window.setTimeout(()=>{this.selectKeydownValue=""},this.selectKeydownTimeout))},selectItemsFindBestMatch(){let s=this.selectKeydownValue.toLowerCase(),l=null,i=-1;for(const u of this.selectableItems){let f=u.name.toLowerCase().indexOf(s);f>-1&&(i==-1||f<i)&&!u.disabled&&(l=u,i=f)}return l},selectPositionUpdate(){var l;if(!this.selectButton||!this.selectableItemsList)return;let s=((l=this.selectButton)==null?void 0:l.getBoundingClientRect().top)+this.selectButton.offsetHeight+parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);this.selectDropdownPosition=window.innerHeight<s?"top":"bottom"},setOptions(s){Array.isArray(s)&&(this.selectableItems=s)}}),a=()=>{r.selectOpen&&r.selectPositionUpdate()};return e.watch(()=>r.selectOpen,function(s){if(r.selectedItems?r.selectableItemActive=r.selectedItem:r.selectableItemActive=r.selectableItems[0],!s){window.removeEventListener("resize",a);return}a(),window.addEventListener("resize",a)},{immediate:!1}),r}function jr(o,t,n){var m;const r=e.ref(!1),a=e.ref(((m=o.model)==null?void 0:m.value)??o.defaultDate??""),s=e.ref("F d, Y"),l=e.ref(0),i=e.ref(0),u=e.ref(0),c=e.ref([]),f=e.ref([]),g=e.ref("bottom"),b=["January","February","March","April","May","June","July","August","September","October","November","December"],p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=e.ref("D"),v=e.computed(()=>{let d=Math.max(l.value,0);return d>=b.length&&(d=0),b[d]}),T=e.computed(()=>{const d=Math.floor(i.value/10)*10;return Array.from({length:10},(y,C)=>d+C)});function k(d){r.value=d??!r.value,h.value="D"}function S(d="D"){h.value=d}function D(d){const y=p[d.getDay()],C=("0"+d.getDate()).slice(-2),B=b[d.getMonth()],I=B.substring(0,3),E=("0"+(d.getMonth()+1)).slice(-2),$=d.getFullYear();switch(s.value){case"F d, Y":return`${B} ${C}, ${$}`;case"d M, Y":return`${C} ${I}, ${$}`;case"Y M d":return`${$} ${I} ${C}`;case"MM-DD-YYYY":return`${E}-${C}-${$}`;case"DD-MM-YYYY":return`${C}-${E}-${$}`;case"YYYY-MM-DD":return`${$}-${E}-${C}`;case"D d M, Y":return`${y} ${C} ${I} ${$}`;default:return`${B} ${C}, ${$}`}}function M(d){switch(h.value){case"Y":i.value=d,h.value="M";break;case"M":l.value=d,h.value="D",Z();break;default:u.value=d,a.value=D(new Date(i.value,l.value,d)),r.value=!1,o.model&&(o.model.value=a.value);break}}function P(){switch(h.value){case"Y":i.value-=10;break;case"M":i.value-=1;break;default:l.value===0?(i.value--,l.value=11):l.value--,Z();break}}function x(){switch(h.value){case"Y":i.value+=10;break;case"M":i.value+=1;break;default:l.value===11?(l.value=0,i.value++):l.value++,Z();break}}function V(d){const y=new Date(i.value,l.value,d);return a.value===D(y)}function ce(d){const y=new Date,C=new Date(i.value,l.value,d);return y.toDateString()===C.toDateString()}function Z(){const d=new Date(i.value,l.value+1,0).getDate(),y=new Date(i.value,l.value).getDay();f.value=Array.from({length:y},(C,B)=>B+1),c.value=Array.from({length:d},(C,B)=>B+1)}function U(){if(!t.value||!n.value||!r.value)return;const d=t.value.getBoundingClientRect(),y=n.value.offsetHeight,C=d.top+d.height+y;g.value=C>window.innerHeight?"top":"bottom"}function R(d,y=!0){l.value=d.getMonth(),i.value=d.getFullYear(),u.value=d.getDate(),y&&(a.value=D(d)),Z()}function N(){if(a.value)return R(new Date(Date.parse(a.value)));R(new Date,o.useDefaultDate)}return e.onMounted(()=>{N()}),e.watch(r,async d=>{if(!d){window.removeEventListener("resize",U);return}await e.nextTick(),N(),U(),window.addEventListener("resize",U)}),{datePickerInput:t,datePickerCalendar:n,datePickerOpen:r,datePickerValue:a,datePickerPanel:h,datePickerFormat:s,datePickerMonth:l,datePickerMonthVerbose:v,datePickerYear:i,datePickerDecade:T,datePickerDay:u,datePickerDaysInMonth:c,datePickerBlankDaysInMonth:f,datePickerMonthNames:b,datePickerDays:p,datePickerPosition:g,toggleDatePicker:k,datePickerValueClicked:M,datePickerPrevious:P,datePickerNext:x,datePickerIsSelectedDate:V,datePickerIsToday:ce,showDatePickerPanel:S}}function zr(o){const t=e.ref(!1);return{copyNotification:t,copyToClipboard:async()=>{try{await navigator.clipboard.writeText(o.value),t.value=!0,setTimeout(()=>{t.value=!1},3e3)}catch(r){console.error(r),me.error("Error",{description:"Unable to copy. Network is not secure."})}}}}function Kr(o){const t=e.ref(null);return e.reactive({title:"",...o,modalOpen:!1,isAnimating:!1,animationTime:o.animationTime??300,toggleModal(n=null){this.isAnimating||(t.value&&clearTimeout(t.value),n!=null?this.modalOpen=n:this.modalOpen=!this.modalOpen,this.isAnimating=!0,t.value=window.setTimeout(()=>{this.isAnimating=!1},this.animationTime))},setTitle(n){this.title=n}})}function st({directions:o,threshold:t,onSwipeOut:n}){const r=e.ref(!1),a=e.ref({x:0,y:0}),s=e.ref(),l=e.ref({x:0,y:0}),i=g=>1/(1.5+Math.abs(g)/20);function u(g){s.value=Date.now(),g.target.setPointerCapture(g.pointerId),!g.target.closest("button, a, input, textarea, select")&&(l.value={x:g.clientX,y:g.clientY},r.value=!0)}function c(g){if(!r.value)return;const b={x:0,y:0},p=g.clientX-l.value.x,h=g.clientY-l.value.y;if(o.value.includes("left")&&p<0||o.value.includes("right")&&p>0)b.x=p;else{const v=p*i(p);b.x=Math.abs(v)<Math.abs(p)?v:p}if(o.value.includes("top")&&h<0||o.value.includes("bottom")&&h>0)b.y=h;else{const v=h*i(h);b.y=Math.abs(v)<Math.abs(h)?v:h}a.value=b}function f(){if(!r.value)return;const g=Date.now()-(s.value??0),b=a.value.x,p=Math.abs(b)/g;if(Math.abs(b)>=t||p>.11){n();return}r.value=!1,a.value={x:0,y:0}}return{offset:a,isSwiping:r,onPointerDown:u,onPointerMove:c,onPointerUp:f}}function it({duration:o,isPaused:t,onTimeout:n,immediate:r=!0}){const a=e.ref(),s=e.ref(0),l=e.ref(o);function i(){l.value===1/0||t()||(s.value=Date.now(),a.value=window.setTimeout(()=>{n()},l.value))}function u(){c();const f=Date.now()-s.value;l.value-=f}function c(){a.value&&(clearTimeout(a.value),a.value=null)}return e.watch(t,f=>{if(f){u();return}i()},{immediate:r}),e.onBeforeUnmount(()=>{c()}),{cancel:c}}function Yr(o,t){if(!o)return!1;let n=["INPUT","TEXTAREA","SELECT"];return(t===" "||t==="Enter")&&(n=[...n,"BUTTON"]),n.includes(o.tagName)}const Be=3,ct="24px",dt="16px",Ee=0,Se=3e3,ut=16,ft=45,Ne=10,Ie=.06,ie=16,Hr=["id","data-isSwiping"],Ur={class:"w-[18px] h-[18px] mr-1.5 -ml-1",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wr={class:"w-[18px] h-[18px] mr-1.5 -ml-1",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qr={class:"w-[18px] h-[18px] mr-1.5 -ml-1",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gr={class:"w-[18px] h-[18px] mr-1.5 -ml-1",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zr=["title"],Xr=L(e.defineComponent({__name:"ToastNotification",props:{id:{},index:{},stack:{},position:{default:"bottom-center"},toastCount:{},expanded:{type:Boolean},maxVisibleToasts:{default:Be},swipeDirections:{default:()=>[]},style:{default:""},title:{default:"Title"},description:{},type:{default:"default"},life:{default:Se},html:{default:""},component:{},scale:{},zIndex:{},offsetY:{},positionY:{}},emits:["close"],setup(o,{emit:t}){const n=t,r=o,a=e.ref("translate-y-0"),s=e.computed(()=>{if(r.swipeDirections.length>0)return r.swipeDirections;const[P,x]=r.position.split("-"),V=[];return M(P)&&V.push(P),M(x)&&V.push(x),x==="center"&&V.push("left","right"),V}),l=e.computed(()=>r.position.includes("bottom")),i=e.ref(null),u=e.ref(null),c=e.ref(!1),f=e.ref(!1),{offset:g,isSwiping:b,onPointerDown:p,onPointerMove:h,onPointerUp:v}=st({directions:s,threshold:ft,onSwipeOut:S}),{cancel:T}=it({duration:r.life||Se,isPaused:()=>r.expanded||r.type==="loading"||!r.life||r.life===1/0||c.value,onTimeout:S});function k(){return b.value?g.value.x>0?"translate-x-full":"-translate-x-full":r.toastCount===1?l.value?"translate-y-full":"-translate-y-full":"translate-y-0"}function S(){i.value||(a.value=k(),f.value=!1,T(),i.value=window.setTimeout(()=>{n("close",r.id)},350))}function D(){u.value&&(clearTimeout(u.value),u.value=null),i.value&&(clearTimeout(i.value),i.value=null)}function M(P){return["top","right","bottom","left"].includes(P)}return e.onMounted(()=>{f.value=!0,u.value&&clearTimeout(u.value),u.value=window.setTimeout(()=>{r.stack()})}),e.onBeforeUnmount(()=>{D()}),(P,x)=>(e.openBlock(),e.createElementBlock("li",{ref:"toastEl",id:r.id,class:e.normalizeClass(["toast w-full absolute duration-300 transition-all ease-out",{"toast-no-description":!P.description},{"opacity-0 pointer-events-none":P.index>=P.maxVisibleToasts},P.style]),style:e.normalizeStyle({"--offset-x":`${e.unref(g).x}px`,"--offset-y":`${P.offsetY}px`,"--scale":P.scale,"--z-index":P.zIndex,"--position-top":`${P.expanded?l.value?"auto":P.positionY:"inherit"}`,"--position-bottom":`${l.value&&P.expanded?P.positionY:"inherit"}`}),"data-isSwiping":e.unref(b),onMouseover:x[0]||(x[0]=V=>c.value=!0),onMouseout:x[1]||(x[1]=V=>c.value=!1),onDragend:x[2]||(x[2]=(...V)=>e.unref(v)&&e.unref(v)(...V)),onPointerdown:x[3]||(x[3]=(...V)=>e.unref(p)&&e.unref(p)(...V)),onPointermove:x[4]||(x[4]=(...V)=>e.unref(h)&&e.unref(h)(...V)),onPointerup:x[5]||(x[5]=(...V)=>e.unref(v)&&e.unref(v)(...V)),role:"alert"},[e.createVNode(e.Transition,{"enter-active-class":"","enter-from-class":`opacity-0 ${l.value?"translate-y-full":"-translate-y-full"}`,"enter-to-class":"opacity-100 translate-y-0","leave-active-class":"","leave-from-class":"opacity-100 translate-y-0","leave-to-class":`opacity-0 ${a.value}`},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("span",{class:e.normalizeClass([{"p-4":!r.html,"p-0":r.html},"flex flex-col items-start backdrop-blur-lg rounded-md ","group relative select-text","transition-all duration-300 ease-out","bg-white dark:bg-primary-dark-700/70 text-gray-800 dark:text-neutral-100 shadow-[0_5px_15px_-3px_rgb(0_0_0_/_0.08)]","ring-inset ring-1 ring-gray-100 dark:ring-neutral-800/50","!outline-none focus:ring-gray-400 dark:focus:ring-purple-500 focus:ring-2"])},[r.html?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center",{"text-green-500":r.type==="success","text-blue-500":r.type==="info","text-orange-400":r.type==="warning","text-rose-500":r.type==="danger","dark:text-neutral-100 text-gray-800":r.type==="default"}])},[e.withDirectives((e.openBlock(),e.createElementBlock("svg",Ur,x[6]||(x[6]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM16.7744 9.63269C17.1238 9.20501 17.0604 8.57503 16.6327 8.22559C16.2051 7.87615 15.5751 7.93957 15.2256 8.36725L10.6321 13.9892L8.65936 12.2524C8.24484 11.8874 7.61295 11.9276 7.248 12.3421C6.88304 12.7566 6.92322 13.3885 7.33774 13.7535L9.31046 15.4903C10.1612 16.2393 11.4637 16.1324 12.1808 15.2547L16.7744 9.63269Z",fill:"currentColor"},null,-1)]),512)),[[e.vShow,r.type==="success"]]),e.withDirectives((e.openBlock(),e.createElementBlock("svg",Wr,x[7]||(x[7]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9ZM13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V12Z",fill:"currentColor"},null,-1)]),512)),[[e.vShow,r.type==="info"]]),e.withDirectives((e.openBlock(),e.createElementBlock("svg",qr,x[8]||(x[8]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.44829 4.46472C10.5836 2.51208 13.4105 2.51168 14.5464 4.46401L21.5988 16.5855C22.7423 18.5509 21.3145 21 19.05 21L4.94967 21C2.68547 21 1.25762 18.5516 2.4004 16.5862L9.44829 4.46472ZM11.9995 8C12.5518 8 12.9995 8.44772 12.9995 9V13C12.9995 13.5523 12.5518 14 11.9995 14C11.4473 14 10.9995 13.5523 10.9995 13V9C10.9995 8.44772 11.4473 8 11.9995 8ZM12.0009 15.99C11.4486 15.9892 11.0003 16.4363 10.9995 16.9886L10.9995 16.9986C10.9987 17.5509 11.4458 17.9992 11.9981 18C12.5504 18.0008 12.9987 17.5537 12.9995 17.0014L12.9995 16.9914C13.0003 16.4391 12.5532 15.9908 12.0009 15.99Z",fill:"currentColor"},null,-1)]),512)),[[e.vShow,r.type==="warning"]]),e.withDirectives((e.openBlock(),e.createElementBlock("svg",Gr,x[9]||(x[9]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM11.9996 7C12.5519 7 12.9996 7.44772 12.9996 8V12C12.9996 12.5523 12.5519 13 11.9996 13C11.4474 13 10.9996 12.5523 10.9996 12V8C10.9996 7.44772 11.4474 7 11.9996 7ZM12.001 14.99C11.4488 14.9892 11.0004 15.4363 10.9997 15.9886L10.9996 15.9986C10.9989 16.5509 11.446 16.9992 11.9982 17C12.5505 17.0008 12.9989 16.5537 12.9996 16.0014L12.9996 15.9914C13.0004 15.4391 12.5533 14.9908 12.001 14.99Z",fill:"currentColor"},null,-1)]),512)),[[e.vShow,r.type==="danger"]]),e.createElementVNode("p",{class:"text-[13px] font-medium leading-none",title:r.title},e.toDisplayString(e.unref(ie)+" : "+r.title),9,Zr)],2)),e.withDirectives(e.createElementVNode("p",{class:e.normalizeClass([{"pl-5":r.type!=="default"},"mt-1.5 text-xs leading-tight opacity-70 w-full whitespace-pre-wrap break-words overflow-y-auto scrollbar-minimal max-h-32 min-h-3 pe-2"])},e.toDisplayString(P.description),3),[[e.vShow,r.description]]),r.html?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:1,onClick:S,class:e.normalizeClass(["absolute right-0 p-1.5 mr-2.5 text-gray-400 dark:text-rose-700 duration-100 ease-in-out rounded-full opacity-0 cursor-pointer hover:bg-gray-50 dark:bg-gray-800/50 hover:text-gray-500 dark:hover:text-rose-600",{"top-1/2 -translate-y-1/2":!r.description&&!r.html,"top-0 mt-2.5":r.description||r.html,"opacity-100":c.value,"opacity-0":!c.value}])},x[10]||(x[10]=[e.createElementVNode("svg",{class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]),2))],2),[[e.vShow,f.value]])]),_:1},8,["enter-from-class","leave-to-class"])],46,Hr))}}),[["__scopeId","data-v-68f0a34c"]]),Qr={class:"absolute top-0 left-0 text-3xl p-4 bg-amber-400/50 text-white"},Jr=e.defineComponent({__name:"ToastController",props:{layout:{default:"default"},position:{default:"bottom-right"},defaultLife:{default:3e3},viewportOffset:{default:ct},mobileViewportOffset:{default:dt},paddingBetweenToasts:{default:ut},maxVisibleToasts:{default:Be},closeButton:{type:Boolean},icons:{}},setup(o){const t=o,n=e.ref(),r=e.ref([]),a=e.ref(t.position),s=e.ref(t.layout),l=e.ref(!1),i=e.ref(t.layout==="expanded"),u=e.ref(t.paddingBetweenToasts),c=e.ref(null);e.ref(null);function f(v){r.value=r.value.filter(T=>T.id!==v),F.dismiss(v),g()}function g(v){r.value.length>0&&b(),p(),c.value&&clearTimeout(c.value),i.value&&(c.value=window.setTimeout(()=>{p()},100))}function b(v){try{const T=a.value.includes("bottom"),k=[];let S=0,D=1+Ie,M=-ie,P=200+Ne;for(const x of r.value){const V=document.getElementById(x.id);if(!V)return;if(P-=Ne,D-=Ie,M+=ie,x.scale=D,x.offsetY=M,x.zIndex=P,k.push(V),i.value){S=S+(S?u.value:0),x.positionY=S+"px",x.scale=1,x.offsetY=0,S+=V.offsetHeight;continue}x.scale=D,T?x.offsetY*=-1:h(k[0],x)}}catch(T){console.log(T)}}function p(){var D,M;if(!n.value)return;if(r.value.length==0){n.value.style.height="0px";return}const v=r.value[Math.max(Math.min(r.value.length-1,t.maxVisibleToasts-1),0)],T=(D=document.getElementById(`${v==null?void 0:v.id}`))==null?void 0:D.getBoundingClientRect(),k=r.value[0],S=(M=document.getElementById(`${k==null?void 0:k.id}`))==null?void 0:M.getBoundingClientRect();if(!(!S||!T)){if(!l.value){n.value.style.height=S.height+"px";return}if(a.value.includes("bottom")){n.value.style.height=S.top+S.height-T.top+"px";return}n.value.style.height=T.top+T.height-S.top+"px"}}function h(v,T){const k=document.getElementById(T.id);if(!k)return;const S=v.offsetTop,D=v.offsetHeight,M=k.offsetHeight,P=S+(D-M);T.positionY=P+"px"}return e.onMounted(()=>{g()}),e.watch(()=>l.value,v=>{if(s.value==="default"){if(v){i.value=!0,g();return}i.value=!1,g()}}),e.watch(()=>r.value,()=>{r.value.length<=1&&(i.value=!1)}),e.watchEffect(v=>{const T=F.subscribe(k=>{k.dismiss||e.nextTick(()=>{const S=r.value.findIndex(M=>M.id===k.id);if(S!==-1){r.value=[...r.value.slice(0,S),{...r.value[S],...k},...r.value.slice(S+1)];return}const D=k;D.position&&(a.value=D.position),r.value.unshift({...D,id:D.id,type:D.type??"default",position:D.position??a.value,life:D.life??t.defaultLife,title:D.title})})});v(T)}),(v,T)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("p",Qr,"toastsHovered: "+e.toDisplayString(l.value),1),e.createElementVNode("ol",{ref_key:"container",ref:n,class:e.normalizeClass([`fixed w-full group z-[500] [&>*]:px-4 [&>*]:px-[${v.mobileViewportOffset??v.viewportOffset}] [&>*]:sm:px-6 [&>*]:sm:px-[${v.viewportOffset}] my-4 sm:my-6 my-[${v.mobileViewportOffset??v.viewportOffset}] sm:my-[${v.viewportOffset}]`,`${e.unref(Ee)?`sm:w-[${e.unref(Ee)}px]`:"sm:max-w-sm"}`,`${a.value=="top-right"?"right-0 top-0":""}`,`${a.value=="top-left"?"left-0 top-0":""}`,`${a.value=="top-center"?"left-1/2 -translate-x-1/2 top-0":""}`,`${a.value=="bottom-right"?"right-0 bottom-0":""}`,`${a.value=="bottom-left"?"left-0 bottom-0":""}`,`${a.value=="bottom-center"?"left-1/2 -translate-x-1/2 bottom-0":""}`]),onMouseenter:T[0]||(T[0]=k=>l.value=!0),onMouseleave:T[1]||(T[1]=k=>l.value=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(k,S)=>(e.openBlock(),e.createBlock(Xr,e.mergeProps({ref_for:!0},k,{key:k.id,stack:()=>{g()},toastCount:r.value.length,position:a.value,expanded:i.value,index:S,maxVisibleToasts:v.maxVisibleToasts,onClose:f}),null,16,["stack","toastCount","position","expanded","index","maxVisibleToasts"]))),128))],34)]))}}),mt={stringInsensitive:(o,t)=>pt(o).localeCompare(pt(t)),date:(o,t)=>new Date(o).getTime()-new Date(t).getTime(),number:(o,t)=>parseFloat(o)-parseFloat(t)};function pt(o){return String(o??"").toLowerCase().replace(/\s+/g," ").trim()}function eo(o,t=1,n=["date","date_released"]){return(r,a)=>{const s=r[o],l=a[o];if(s instanceof Date&&l instanceof Date||n.includes(String(o))){const c=new Date(String(s));return(new Date(String(l)).getTime()-c.getTime())*t}const i=parseFloat(s),u=parseFloat(l);return!isNaN(i)&&!isNaN(u)?(i-u)*t:String(s).toLowerCase().replace(/\s+/g," ").localeCompare(String(l).toLowerCase().replace(/\s+/g," "))*t}}function to(o,t=1){return(n,r)=>{for(const{key:a,compareFn:s}of o){const l=a?n[a]??"":void 0,i=a?r[a]??"":void 0;let u;if(s?u=a?s(l,i):s(n,r):u=no(l,i),u!==0)return u*t}return 0}}function no(o,t){const n=parseFloat(o),r=parseFloat(t);if(!isNaN(n)&&!isNaN(r))return n-r;const a=new Date(o),s=new Date(t);return!isNaN(a.getTime())&&!isNaN(s.getTime())?a.getTime()-s.getTime():mt.stringInsensitive(o,t)}w.BaseModal=he,w.ButtonForm=fe,w.ChipTag=Ut,w.CompareStrategies=mt,w.DEFAULT_GAP=ut,w.DeleteAccountModal=Cn,w.FormErrorList=De,w.FormInput=Le,w.FormInputLabel=de,w.GlobalModal=hr,w.HoverCard=nn,w.InputLabel=kt,w.LogoutSessionsModal=vn,w.MOBILE_VIEWPORT_OFFSET=dt,w.RelativeHoverCard=qt,w.SCALE_STEP=Ie,w.SWIPE_THRESHOLD=ft,w.SettingsCard=Qt,w.TOAST_LIFE=Se,w.TOAST_WIDTH=Ee,w.TableBase=_r,w.TablePagination=ot,w.TablePaginationButton=_,w.ToastController=Jr,w.ToastState=F,w.VIEWPORT_OFFSET=ct,w.VISIBLE_TOASTS_AMOUNT=Be,w.Y_OFFSET_STEP=ie,w.Z_STEP=Ne,w.createModalCore=ne,w.isInputLikeElement=Yr,w.sortObject=eo,w.sortObjectNew=to,w.toast=me,w.useClipboard=zr,w.useDatePicker=jr,w.useForm=Re,w.useModal=Kr,w.useMultiSelect=Rr,w.useSelect=at,w.useSwipeHandler=st,w.useTable=lt,w.useToastTimer=it,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});