@speckle/ui-components 2.17.0 → 2.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Ke=Object.defineProperty;var Ge=(t,n,o)=>n in t?Ke(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var q=(t,n,o)=>(Ge(t,typeof n!="symbol"?n+"":n,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("lodash"),M=require("@heroicons/vue/24/solid"),j=require("@heroicons/vue/24/outline"),D=require("@heroicons/vue/20/solid"),re=require("vee-validate"),he=require("nanoid"),X=require("@speckle/shared"),O=require("@vueuse/core"),L=require("@headlessui/vue"),Ve=require("vue-tippy"),Xe=require("v3-infinite-loading");const Ze={key:2,style:{margin:"0 !important",width:"0.01px"}},Qe=e.defineComponent({__name:"Button",props:{to:{type:String,required:!1,default:void 0},size:{type:String,default:"base"},fullWidth:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},color:{type:String,default:"default"},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},submit:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1},linkComponent:{type:[Object,Function],default:null},loading:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,l=e.resolveDynamicComponent("NuxtLink"),s=e.resolveDynamicComponent("RouterLink"),a=e.computed(()=>o.linkComponent?o.linkComponent:o.external?"a":B.isObjectLike(l)?l:B.isObjectLike(s)?s:"a"),c=e.computed(()=>{if(!o.to)return o.submit?"submit":"button"}),r=e.computed(()=>o.disabled||o.loading),i=e.computed(()=>o.loading?M.ArrowPathIcon:o.iconLeft),u=e.computed(()=>{const p=[];if(p.push("border-2"),r.value)p.push(o.outlined?"border-foreground-disabled":"bg-foundation-disabled border-transparent");else switch(o.color){case"invert":p.push(o.outlined?"border-foundation dark:border-foreground":"bg-foundation dark:bg-foreground border-transparent");break;case"card":p.push(o.outlined?"border-foundation-2 shadow":"bg-foundation-2 dark:bg-foundation-2 border-foundation shadow");break;case"danger":p.push(o.outlined?"border-danger":"bg-danger border-danger");break;case"secondary":p.push(o.outlined?"border-foundation":"bg-foundation border-foundation-2");break;case"warning":p.push(o.outlined?"border-warning":"bg-warning border-warning");break;case"info":p.push(o.outlined?"border-info":"bg-info border-info");break;case"success":p.push(o.outlined?"border-success":"bg-success border-success");break;case"default":default:p.push(o.outlined?"border-primary hover:border-primary-focus":"bg-primary hover:bg-primary-focus border-transparent");break}return p.join(" ")}),v=e.computed(()=>{const p=[];if(!o.text&&!o.link)if(r.value)p.push((o.outlined,"text-foreground-disabled"));else switch(o.color){case"invert":p.push(o.outlined?"text-foundation dark:text-foreground":"text-primary");break;case"card":p.push((o.outlined,"text-foreground"));break;case"danger":p.push(o.outlined?"text-danger":"text-foundation dark:text-foreground");break;case"warning":p.push(o.outlined?"text-warning":"text-foundation dark:text-foreground");break;case"info":p.push(o.outlined?"text-info":"text-foundation dark:text-foreground");break;case"success":p.push(o.outlined?"text-success":"text-foundation dark:text-foreground");break;case"secondary":p.push((o.outlined,"text-foreground hover:text-primary"));break;case"default":default:p.push(o.outlined?"text-primary hover:text-primary-focus":"text-foundation dark:text-foreground");break}else r.value?p.push("text-foreground-disabled"):o.color==="invert"?p.push("text-foundation hover:text-foundation-2 dark:text-foreground dark:hover:text-foreground"):o.color==="secondary"?p.push("text-foreground-2 hover:text-primary-focus"):o.color==="success"?p.push("text-success"):o.color==="warning"?p.push("text-warning"):o.color==="info"?p.push("text-info"):o.color==="danger"?p.push("text-danger"):p.push("text-primary hover:text-primary-focus");return p.join(" ")}),f=e.computed(()=>{const p=[];return p.push(o.rounded?"rounded-full":"rounded-md"),p.join(" ")}),m=e.computed(()=>{const p=[];if(!r.value)switch(o.color){case"invert":p.push("hover:ring-4 ring-white/50");break;case"danger":p.push("hover:ring-4 ring-danger-lighter dark:ring-danger-darker");break;case"warning":p.push("hover:ring-4 ring-warning-lighter dark:ring-warning-darker");break;case"info":p.push("hover:ring-4 ring-info-lighter dark:ring-info-darker");break;case"success":p.push("hover:ring-4 ring-success-lighter dark:ring-success-darker");break;case"default":default:p.push("hover:ring-2");break}return p.join(" ")}),y=e.computed(()=>{switch(o.size){case"xs":return"h-5 text-xs font-medium xxx-tracking-wide";case"sm":return"h-6 text-sm font-medium xxx-tracking-wide";case"lg":return"h-10 text-lg font-semibold xxx-tracking-wide";case"xl":return"h-14 text-xl font-bold xxx-tracking-wide";default:case"base":return"h-8 text-sm sm:text-base font-medium xxx-tracking-wide"}}),d=e.computed(()=>{switch(o.size){case"xs":return"px-1";case"sm":return"px-2";case"lg":return"px-4";case"xl":return"px-5";default:case"base":return"px-3"}}),b=e.computed(()=>{const p=[];return o.fullWidth&&p.push("w-full"),r.value&&p.push("cursor-not-allowed"),p.join(" ")}),h=e.computed(()=>{const p=[];return!r.value&&!o.link&&!o.text&&p.push("active:scale-[0.97]"),!r.value&&o.link&&p.push("underline decoration-transparent decoration-2 underline-offset-4 hover:decoration-inherit"),p.join(" ")}),k=e.computed(()=>{const p=o.link||o.text;return["transition inline-flex justify-center text-center items-center space-x-2 outline-none select-none",b.value,y.value,v.value,p?"":u.value,p?"":f.value,p?"":m.value,o.link?"":d.value,h.value].join(" ")}),x=e.computed(()=>{const p=[""];switch(o.loading&&p.push("animate-spin"),o.size){case"xs":p.push("h-3 w-3");break;case"sm":p.push("h-4 w-4");break;case"lg":p.push("h-6 w-6");break;case"xl":p.push("h-8 w-8");break;case"base":default:p.push("h-5 w-5");break}return p.join(" ")}),I=p=>{if(r.value){p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation();return}n("click",p)};return(p,E)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.to?a.value:"button"),{href:t.to,to:t.to,type:c.value,external:t.external,class:e.normalizeClass(k.value),disabled:r.value,role:"button",onClick:I},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:0,class:e.normalizeClass(`${x.value} ${t.hideText?"":"mr-2"}`)},null,8,["class"])):e.createCommentVNode("",!0),t.hideText?(e.openBlock(),e.createElementBlock("div",Ze,"   ")):e.renderSlot(p.$slots,"default",{key:1},()=>[e.createTextVNode("Button")],!0),t.iconRight||!t.loading?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconRight),{key:3,class:e.normalizeClass(`${x.value} ${t.hideText?"":"ml-2"}`)},null,8,["class"])):e.createCommentVNode("",!0)]),_:3},8,["href","to","type","external","class","disabled"]))}});const Ee=(t,n)=>{const o=t.__vccOpts||t;for(const[l,s]of n)o[l]=s;return o},F=Ee(Qe,[["__scopeId","data-v-79f3f7d2"]]),Ne=e.defineComponent({__name:"Link",props:{to:{type:String,required:!1,default:void 0},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},size:{type:String,default:"base"},foregroundLink:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,l=s=>{if(o.disabled){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation();return}n("click",s)};return(s,a)=>(e.openBlock(),e.createBlock(F,{link:"",to:t.to,external:t.external,disabled:t.disabled,size:t.size,"foreground-link":t.foregroundLink,"icon-left":t.iconLeft,"icon-right":t.iconRight,"hide-text":t.hideText,role:"link",onClickCapture:l},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode("Link")])]),_:3},8,["to","external","disabled","size","foreground-link","icon-left","icon-right","hide-text"]))}});var Q=(t=>(t[t.Success=0]="Success",t[t.Warning=1]="Warning",t[t.Danger=2]="Danger",t[t.Info=3]="Info",t))(Q||{});const Je={"aria-live":"assertive",class:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 mt-10 sm:items-start sm:p-6 z-50"},Ye={class:"flex w-full flex-col items-center space-y-4 sm:items-end"},et={key:0,class:"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-foundation text-foreground shadow-lg ring-1 ring-primary-muted ring-opacity-5"},tt={class:"p-4"},nt={class:"flex items-start"},ot={class:"flex-shrink-0"},lt={class:"ml-2 w-0 flex-1 flex flex-col"},st={key:0,class:"text-foreground font-bold"},at={key:1,class:"label label--light text-foreground-2"},rt={key:2,class:"flex justify-start mt-2"},it=e.createElementVNode("span",{class:"sr-only"},"Close",-1),ct=e.defineComponent({__name:"ToastRenderer",props:{notification:null},emits:["update:notification"],setup(t,{emit:n}){const o=t,l=e.computed(()=>{var c,r;return!((c=o.notification)!=null&&c.description)&&!((r=o.notification)!=null&&r.cta)}),s=()=>{n("update:notification",null)},a=c=>{var r,i,u;(u=(i=(r=o.notification)==null?void 0:r.cta)==null?void 0:i.onClick)==null||u.call(i,c),s()};return(c,r)=>(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",Ye,[e.createVNode(e.Transition,{"enter-active-class":"transform ease-out duration-300 transition","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[t.notification?(e.openBlock(),e.createElementBlock("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",nt,[e.createElementVNode("div",ot,[t.notification.type===e.unref(Q).Success?(e.openBlock(),e.createBlock(e.unref(j.CheckCircleIcon),{key:0,class:"h-6 w-6 text-success","aria-hidden":"true"})):t.notification.type===e.unref(Q).Danger?(e.openBlock(),e.createBlock(e.unref(j.XCircleIcon),{key:1,class:"h-6 w-6 text-danger","aria-hidden":"true"})):t.notification.type===e.unref(Q).Warning?(e.openBlock(),e.createBlock(e.unref(j.ExclamationCircleIcon),{key:2,class:"h-6 w-6 text-warning","aria-hidden":"true"})):t.notification.type===e.unref(Q).Info?(e.openBlock(),e.createBlock(e.unref(j.InformationCircleIcon),{key:3,class:"h-6 w-6 text-info","aria-hidden":"true"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",lt,[t.notification.title?(e.openBlock(),e.createElementBlock("p",st,e.toDisplayString(t.notification.title),1)):e.createCommentVNode("",!0),t.notification.description?(e.openBlock(),e.createElementBlock("p",at,e.toDisplayString(t.notification.description),1)):e.createCommentVNode("",!0),t.notification.cta?(e.openBlock(),e.createElementBlock("div",rt,[e.createVNode(Ne,{to:t.notification.cta.url,class:"label",primary:"",onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.notification.cta.title),1)]),_:1},8,["to"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["ml-4 flex flex-shrink-0",{"self-center":l.value}])},[e.createElementVNode("button",{type:"button",class:"inline-flex rounded-md bg-foundation text-foreground-2 hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",onClick:s},[it,e.createVNode(e.unref(D.XMarkIcon),{class:"h-6 w-6","aria-hidden":"true"})])],2)])])])):e.createCommentVNode("",!0)]),_:1})])]))}}),ut="Enter";function Se(t){return n=>{n.code===ut&&t(n)}}const dt=e.createElementVNode("circle",{cx:"4",cy:"4",r:"3"},null,-1),mt=[dt],ie=e.defineComponent({__name:"Badge",props:{size:null,colorClasses:null,dot:{type:Boolean},dotIconColorClasses:null,iconLeft:null,rounded:{type:Boolean},clickableIcon:{type:Boolean}},emits:["click-icon"],setup(t,{emit:n}){const o=t,l=e.computed(()=>o.colorClasses||"bg-blue-100 text-blue-800"),s=e.computed(()=>o.dotIconColorClasses||"text-blue-400"),a=e.computed(()=>{const u=["inline-flex items-center",l.value,o.size==="lg"?"px-3 py-0.5 label":"px-2.5 py-0.5 caption font-medium"];return o.rounded?(u.push("rounded"),u.push(o.size==="lg"?"px-2 py-0.5 label":"px-2.5 py-0.5 caption font-medium")):(u.push("rounded-full"),u.push(o.size==="lg"?"px-2.5 py-0.5 label":"px-2.5 py-0.5 caption font-medium")),u.join(" ")}),c=e.computed(()=>{const u=["mt-0.5 ml-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-full focus:outline-none"];return o.clickableIcon?u.push("cursor-pointer"):u.push("cursor-default"),u.join(" ")}),r=e.computed(()=>["-ml-0.5 mr-1.5 h-2 w-2",s.value].join(" ")),i=u=>{if(!o.clickableIcon){u.stopPropagation(),u.stopImmediatePropagation(),u.preventDefault();return}n("click-icon",u)};return(u,v)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(a.value)},[t.dot?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(r.value),fill:"currentColor",viewBox:"0 0 8 8"},mt,2)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode("Badge")]),t.iconLeft?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(c.value),onClick:v[0]||(v[0]=f=>i(f))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconLeft),{class:e.normalizeClass(["h-4 w-4",s.value])},null,8,["class"]))],2)):e.createCommentVNode("",!0)],2))}});let we=[];function ft(t){we=we?t:t.slice()}var J=(t=>(t[t.sm=640]="sm",t[t.md=746]="md",t[t.lg=1024]="lg",t[t.xl=1280]="xl",t[t["2xl"]=1536]="2xl",t))(J||{});function $e(t){const{props:{modelValue:n,steps:o,orientation:l,goVerticalBelow:s,nonInteractive:a,stepsPadding:c},emit:r}=t,i=e.computed(()=>(l==null?void 0:l.value)==="vertical"?"vertical":"horizontal"),u=e.computed({get:()=>B.clamp((n==null?void 0:n.value)||0,-1,o.value.length),set:h=>r("update:modelValue",B.clamp(h,0,o.value.length))}),v=h=>`${h+1}`,f=h=>h===u.value,m=h=>h<u.value,y=(h,k)=>{var I;if(a!=null&&a.value){k==null||k.preventDefault(),k==null||k.stopPropagation(),k==null||k.stopImmediatePropagation();return}u.value=h;const x=o.value[u.value];(I=x==null?void 0:x.onClick)==null||I.call(x)},d=e.computed(()=>{const h=["flex"];let k,x;return(c==null?void 0:c.value)==="xs"?(k="space-x-2",x="space-y-1"):(c==null?void 0:c.value)==="sm"?(k="space-x-4",x="space-y-1"):(k="space-x-8",x="space-y-4"),h.push("flex"),i.value==="vertical"||s!=null&&s.value?(h.push(`flex-col ${x} justify-center`),(s==null?void 0:s.value)===J.sm?h.push(`sm:flex-row sm:space-y-0 sm:justify-start sm:${k} sm:items-center`):(s==null?void 0:s.value)===J.md?h.push(`md:flex-row md:space-y-0 md:justify-start md:${k} md:items-center`):(s==null?void 0:s.value)===J.lg?h.push(`lg:flex-row lg:space-y-0 lg:justify-start lg:${k} lg:items-center`):(s==null?void 0:s.value)===J.xl&&h.push(`xl:flex-row xl:space-y-0 xl:justify-start xl:${k} xl:items-center`)):h.push(`flex-row ${k} items-center`),h.join(" ")}),b=e.computed(()=>{const h=["flex items-center"];return a!=null&&a.value||h.push("cursor-pointer"),h.join(" ")});return{value:u,isCurrentStep:f,isFinishedStep:m,switchStep:y,getStepDisplayValue:v,listClasses:d,linkClasses:b,orientation:i}}ft(["sm:space-x-8","md:space-x-8","lg:space-x-8","xl:space-x-8","sm:space-x-2","md:space-x-2","lg:space-x-2","xl:space-x-2","sm:space-x-4","md:space-x-4","lg:space-x-4","xl:space-x-4"]);const pt=["aria-label"],ht=["href","onClick"],vt={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},gt={class:"shrink-0 h-8 w-8 rounded-full bg-primary-focus text-foreground-on-primary inline-flex items-center justify-center"},yt={class:"flex flex-col"},kt={key:0,class:"label label--light text-foreground"},bt=["href","onClick"],xt={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},Ct={class:"shrink-0 h-8 w-8 rounded-full border-2 border-primary-focus inline-flex items-center justify-center"},Bt={class:"flex flex-col"},wt={key:0,class:"label label--light text-foreground"},Vt=["href","onClick"],Et={class:"flex space-x-3 items-center text-foreground-disabled normal font-medium leading-5"},Nt={class:"shrink-0 h-8 w-8 rounded-full border-2 border-foreground-disabled inline-flex items-center justify-center"},St={class:"flex flex-col"},$t={key:0,class:"label label--light"},zt=e.defineComponent({__name:"Number",props:{ariaLabel:null,orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,{isCurrentStep:l,isFinishedStep:s,switchStep:a,getStepDisplayValue:c,listClasses:r,linkClasses:i}=$e({props:e.toRefs(o),emit:n});return(u,v)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass(e.unref(r))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(f,m)=>(e.openBlock(),e.createElementBlock("li",{key:f.name},[e.unref(s)(m)?(e.openBlock(),e.createElementBlock("a",{key:0,href:f.href,class:e.normalizeClass(e.unref(i)),onClick:y=>e.unref(a)(m,y)},[e.createElementVNode("div",vt,[e.createElementVNode("div",gt,[e.createVNode(e.unref(D.CheckIcon),{class:"w-5 h-5"})]),e.createElementVNode("div",yt,[e.createElementVNode("div",null,e.toDisplayString(f.name),1),f.description?(e.openBlock(),e.createElementBlock("div",kt,e.toDisplayString(f.description),1)):e.createCommentVNode("",!0)])])],10,ht)):e.unref(l)(m)?(e.openBlock(),e.createElementBlock("a",{key:1,href:f.href,class:e.normalizeClass(e.unref(i)),"aria-current":"step",onClick:y=>e.unref(a)(m,y)},[e.createElementVNode("div",xt,[e.createElementVNode("div",Ct,e.toDisplayString(e.unref(c)(m)),1),e.createElementVNode("div",Bt,[e.createElementVNode("div",null,e.toDisplayString(f.name),1),f.description?(e.openBlock(),e.createElementBlock("div",wt,e.toDisplayString(f.description),1)):e.createCommentVNode("",!0)])])],10,bt)):(e.openBlock(),e.createElementBlock("a",{key:2,href:f.href,class:e.normalizeClass(e.unref(i)),onClick:y=>e.unref(a)(m,y)},[e.createElementVNode("div",Et,[e.createElementVNode("div",Nt,e.toDisplayString(e.unref(c)(m)),1),e.createElementVNode("div",St,[e.createElementVNode("div",null,e.toDisplayString(f.name),1),f.description?(e.openBlock(),e.createElementBlock("div",$t,e.toDisplayString(f.description),1)):e.createCommentVNode("",!0)])])],10,Vt))]))),128))],2)],8,pt))}}),It=["aria-label"],Lt=["href","onClick"],Dt={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center"},Tt={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},Mt=["href","onClick"],Ot={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},At={key:0,class:"h-3 w-3 rounded-full bg-foreground"},Pt=e.createElementVNode("span",{class:"absolute h-4 w-4 rounded-full bg-outline-2"},null,-1),jt=e.createElementVNode("span",{class:"relative block h-2 w-2 rounded-full bg-primary-focus"},null,-1),Ft=["href","onClick"],Rt={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},_t={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},Ut={key:1,class:"h-4 w-4 rounded-full bg-foreground-disabled"},qt=e.defineComponent({__name:"Bullet",props:{ariaLabel:null,basic:{type:Boolean},orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,{isCurrentStep:l,isFinishedStep:s,switchStep:a,listClasses:c,linkClasses:r}=$e({props:e.toRefs(o),emit:n}),i=e.computed(()=>{const v=["h6 font-medium leading-7"];let f;return o.stepsPadding==="xs"?f="ml-1":o.stepsPadding==="sm"?f="ml-2":f="ml-3",v.push(f),o.basic&&v.push("sr-only"),v.join(" ")}),u=e.computed(()=>{const v=[];return o.basic&&v.push("basic"),v.join(" ")});return(v,f)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass([e.unref(c),u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(m,y)=>(e.openBlock(),e.createElementBlock("li",{key:m.name},[e.unref(s)(y)?(e.openBlock(),e.createElementBlock("a",{key:0,href:m.href,class:e.normalizeClass(e.unref(r)),onClick:d=>e.unref(a)(y,d)},[e.createElementVNode("span",Dt,[t.basic?(e.openBlock(),e.createElementBlock("span",Tt)):(e.openBlock(),e.createBlock(e.unref(D.CheckCircleIcon),{key:1,class:"h-full w-full text-primary","aria-hidden":"true"}))]),e.createElementVNode("span",{class:e.normalizeClass(["text-foreground",i.value])},e.toDisplayString(m.name),3)],10,Lt)):e.unref(l)(y)?(e.openBlock(),e.createElementBlock("a",{key:1,href:m.href,class:e.normalizeClass(e.unref(r)),"aria-current":"step",onClick:d=>e.unref(a)(y,d)},[e.createElementVNode("span",Ot,[t.basic?(e.openBlock(),e.createElementBlock("span",At)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[Pt,jt],64))]),e.createElementVNode("span",{class:e.normalizeClass(["text-primary-focus",i.value])},e.toDisplayString(m.name),3)],10,Mt)):(e.openBlock(),e.createElementBlock("a",{key:2,href:m.href,class:e.normalizeClass(e.unref(r)),onClick:d=>e.unref(a)(y,d)},[e.createElementVNode("div",Rt,[t.basic?(e.openBlock(),e.createElementBlock("span",_t)):(e.openBlock(),e.createElementBlock("div",Ut))]),e.createElementVNode("p",{class:e.normalizeClass(["text-foreground-disabled",i.value])},e.toDisplayString(m.name),3)],10,Ft))]))),128))],2)],8,It))}}),Wt=["disabled"],Ht=e.defineComponent({__name:"CardButton",props:{disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue","click"],setup(t,{emit:n}){const o=t,l=e.computed(()=>{const a=["h-20 bg-foundation-2 inline-flex justify-center items-center outline-none","normal px-16 py-5 shadow rounded transition active:scale-95"];return o.disabled?a.push("bg-foundation-disabled text-foreground-2 cursor-not-allowed"):(a.push(o.modelValue?"bg-primary-focus text-foreground-on-primary":"bg-foundation text-foreground"),a.push("ring-outline-2 hover:ring-4")),a.join(" ")}),s=a=>{if(o.disabled){a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation();return}n("update:modelValue",!o.modelValue),n("click",a)};return(a,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(l.value),disabled:t.disabled,onClick:s},[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode("Text")])],10,Wt))}}),Kt={class:"relative flex items-start"},Gt={class:"flex h-6 items-center"},Xt=["id","checked","aria-describedby","name","disabled","value"],Zt={class:"ml-2 text-sm",style:{"padding-top":"2px"}},Qt=["for"],Jt={key:0,class:"text-danger ml-1"},Yt=["id"],en=e.defineComponent({inheritAttrs:!1,__name:"Checkbox",props:{name:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String,default:void 0},description:{type:String,default:void 0},inlineDescription:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},showRequired:{type:Boolean,default:!1},modelValue:{type:[String,Boolean],default:void 0},value:{type:[String,Boolean],default:!0},id:{type:String,default:void 0},hideLabel:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const n=t,o=h=>`${h}-${he.nanoid()}`,l=e.computed(()=>n.value||n.name),{checked:s,errorMessage:a,handleChange:c,value:r}=re.useField(n.name,n.rules,{validateOnMount:n.validateOnMount,type:"checkbox",checkedValue:l,initialValue:n.modelValue||void 0}),i=e.computed(()=>n.label||n.name),u=e.computed(()=>a.value?"border-danger-lighter":"border-foreground-4 "),v=e.computed(()=>n.description||a.value),f=e.computed(()=>`${n.name}-description`),m=e.computed(()=>{const h=[];return n.inlineDescription?h.push("inline ml-2"):h.push("block"),a.value?h.push("text-danger"):h.push("text-foreground-2"),h.join(" ")}),y=e.ref(o("checkbox")),d=e.computed(()=>n.id||y.value),b=h=>{n.disabled||c(h)};return e.onMounted(()=>{const h=n.modelValue,k=r.value,x=Array.isArray(h)?h.includes(n.value):h===n.value,I=Array.isArray(k)?k.includes(n.value):k===n.value;x!==I&&c(h)}),(h,k)=>(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Gt,[e.createElementVNode("input",e.mergeProps({id:d.value,checked:e.unref(s),"aria-describedby":f.value,name:t.name,disabled:t.disabled,value:l.value,type:"checkbox",class:["h-4 w-4 rounded text-primary focus:ring-primary bg-foundation disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-2",u.value]},h.$attrs,{onChange:b}),null,16,Xt)]),e.createElementVNode("div",Zt,[e.createElementVNode("label",{for:d.value,class:e.normalizeClass(["font-medium text-foreground",{"sr-only":t.hideLabel}])},[e.createElementVNode("span",null,e.toDisplayString(i.value),1),t.showRequired?(e.openBlock(),e.createElementBlock("span",Jt,"*")):e.createCommentVNode("",!0)],10,Qt),v.value?(e.openBlock(),e.createElementBlock("p",{key:0,id:f.value,class:e.normalizeClass(m.value)},e.toDisplayString(v.value),11,Yt)):e.createCommentVNode("",!0)])]))}});function ve(t){const{props:n,inputEl:o,emit:l,options:s}=t,{value:a,errorMessage:c}=re.useField(n.name,n.rules,{validateOnMount:e.unref(n.validateOnMount),validateOnValueUpdate:e.unref(n.validateOnValueUpdate),initialValue:e.unref(n.modelValue)||void 0}),r=e.computed(()=>{const p=["block label text-foreground-2 mb-2"];return e.unref(n.showLabel)||p.push("sr-only"),p.join(" ")}),i=e.computed(()=>["focus:outline-none disabled:cursor-not-allowed disabled:bg-foundation-disabled","disabled:text-disabled-muted placeholder:text-foreground-2","rounded"].join(" ")),u=e.computed(()=>{const p=["block w-full text-foreground transition-all",i.value];c.value?p.push("focus:border-danger focus:ring-danger border-2 border-danger text-danger-darker"):p.push("border-0 focus:ring-2 focus:ring-outline-2");const E=e.unref(n.color);return E==="foundation"?p.push("bg-foundation shadow-sm hover:shadow"):E==="transparent"?p.push("bg-transparent"):p.push("bg-foundation-page"),p.join(" ")}),v=e.ref(he.nanoid()),f=e.computed(()=>e.unref(n.label)||e.unref(n.name)),m=e.computed(()=>{const p=c.value;return!p||!e.unref(n.useLabelInErrors)?p:p.replace("Value",f.value)}),y=e.computed(()=>m.value&&e.unref(n.hideErrorMessage)),d=e.computed(()=>m.value||e.unref(n.help)),b=e.computed(()=>!!d.value),h=e.computed(()=>b.value?`${e.unref(n.name)}-${v.value}`:void 0),k=e.computed(()=>{const p=["mt-2 text-xs sm:text-sm"];return p.push(c.value?"text-danger":"text-foreground-2"),p.join(" ")}),x=()=>{var p;(p=o.value)==null||p.focus()},I=()=>{var p;a.value=B.isArray(a.value)?[]:"",(p=s==null?void 0:s.customClear)==null||p.call(s),l("change",{value:a.value}),l("clear")};return e.onMounted(()=>{e.unref(n.autoFocus)&&x()}),{coreInputClasses:i,coreClasses:u,title:f,value:a,helpTipId:h,helpTipClasses:k,helpTip:d,hideHelpTip:y,errorMessage:m,clear:I,focus:x,labelClasses:r}}const tn=["for"],nn={class:"relative"},on=["id","name","placeholder","disabled","aria-invalid","aria-describedby"],ln=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),sn=["id"],ze=e.defineComponent({__name:"TextArea",props:{name:null,showLabel:{type:Boolean},help:null,placeholder:null,label:null,disabled:{type:Boolean},rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},useLabelInErrors:{type:Boolean,default:!0},autoFocus:{type:Boolean},modelValue:{default:""},showClear:{type:Boolean},fullWidth:{type:Boolean},showRequired:{type:Boolean},color:{default:"page"},textareaClasses:null},emits:["update:modelValue","change","input","clear"],setup(t,{expose:n,emit:o}){const l=t,s=e.ref(null),{coreClasses:a,title:c,value:r,helpTipId:i,helpTipClasses:u,helpTip:v,errorMessage:f,labelClasses:m,clear:y,focus:d}=ve({props:e.toRefs(l),emit:o,inputEl:s}),b=e.computed(()=>{const h=["pl-2"];return l.showClear&&f.value?h.push("pr-12"):(l.showClear||f.value)&&h.push("pr-8"),h.join(" ")});return n({focus:d}),(h,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":""])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(m))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(c)),1)],10,tn),e.createElementVNode("div",nn,[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:t.name,ref_key:"inputElement",ref:s,"onUpdate:modelValue":k[0]||(k[0]=x=>e.isRef(r)?r.value=x:null),name:t.name,class:[e.unref(a),b.value,t.textareaClasses||"","min-h-[3rem] simple-scrollbar text-sm"],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(f)?"true":"false","aria-describedby":e.unref(i)},h.$attrs,{onChange:k[1]||(k[1]=x=>h.$emit("change",{event:x,value:e.unref(r)})),onInput:k[2]||(k[2]=x=>h.$emit("input",{event:x,value:e.unref(r)}))}),null,16,on),[[e.vModelText,e.unref(r)]]),t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute top-2 right-0 flex items-center pr-2 cursor-pointer",onClick:k[3]||(k[3]=(...x)=>e.unref(y)&&e.unref(y)(...x)),onKeydown:k[4]||(k[4]=(...x)=>e.unref(y)&&e.unref(y)(...x))},[ln,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-start mt-2",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(D.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 mt-0.5 text-4xl right-0 flex items-start text-danger opacity-50",[t.showClear?"pr-8":"pr-2"]])}," * ",2)):e.createCommentVNode("",!0)]),e.unref(i)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(i),class:e.normalizeClass(e.unref(u))},e.toDisplayString(e.unref(v)),11,sn)):e.createCommentVNode("",!0)],2))}}),an=["for"],rn={class:"relative"},cn={key:0,class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},un=["id","type","name","placeholder","disabled","aria-invalid","aria-describedby"],dn=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),mn=["id"],Ie=e.defineComponent({inheritAttrs:!1,__name:"TextInput",props:{type:{type:String,default:"text"},name:{type:String,required:!0},showLabel:{type:Boolean,required:!1},help:{type:String,default:void 0},placeholder:{type:String,default:void 0},label:{type:String,default:void 0},showRequired:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},customIcon:{type:[Object,Function],default:void 0},autoFocus:{type:Boolean,default:!1},modelValue:{type:String,default:""},size:{type:String,default:"base"},showClear:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},inputClasses:{type:String,default:null},hideErrorMessage:{type:Boolean,default:!1},wrapperClasses:{type:String,default:()=>""},color:{type:String,default:"page"}},emits:["update:modelValue","change","input","clear","focus","blur"],setup(t,{expose:n,emit:o}){const l=t,s=e.useSlots(),a=e.ref(null),{coreClasses:c,title:r,value:i,helpTipId:u,helpTipClasses:v,helpTip:f,hideHelpTip:m,errorMessage:y,clear:d,focus:b,labelClasses:h}=ve({props:e.toRefs(l),emit:o,inputEl:a}),k=e.computed(()=>{const E=["h-5 w-5"];return y.value?E.push("text-danger"):E.push("text-foreground-2"),E.join(" ")}),x=e.computed(()=>["email","password"].includes(l.type)||l.customIcon),I=e.computed(()=>{const E=[];return x.value?E.push("pl-8"):E.push("pl-2"),s["input-right"]||(y.value||l.showClear)&&(y.value&&l.showClear?E.push("pr-12"):E.push("pr-8")),E.join(" ")}),p=e.computed(()=>{switch(l.size){case"sm":return"h-6 text-sm";case"lg":return"h-10";case"xl":return"h-14";case"base":default:return"h-8 text-sm"}});return n({focus:b}),(E,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":"",t.wrapperClasses])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(h))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)),1)],10,an),e.createElementVNode("div",rn,[x.value?(e.openBlock(),e.createElementBlock("div",cn,[t.customIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.customIcon),{key:0,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):t.type==="email"?(e.openBlock(),e.createBlock(e.unref(D.EnvelopeIcon),{key:1,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):t.type==="password"?(e.openBlock(),e.createBlock(e.unref(D.KeyIcon),{key:2,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.name,ref_key:"inputElement",ref:a,"onUpdate:modelValue":N[0]||(N[0]=S=>e.isRef(i)?i.value=S:null),type:t.type,name:t.name,class:[e.unref(c),I.value,p.value,t.inputClasses||""],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(y)?"true":"false","aria-describedby":e.unref(u),role:"textbox"},E.$attrs,{onChange:N[1]||(N[1]=S=>E.$emit("change",{event:S,value:e.unref(i)})),onInput:N[2]||(N[2]=S=>E.$emit("input",{event:S,value:e.unref(i)})),onFocus:N[3]||(N[3]=S=>E.$emit("focus")),onBlur:N[4]||(N[4]=S=>E.$emit("blur"))}),null,16,un),[[e.vModelDynamic,e.unref(i)]]),e.renderSlot(E.$slots,"input-right",{},()=>[t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer",onClick:N[5]||(N[5]=(...S)=>e.unref(d)&&e.unref(d)(...S)),onKeydown:N[6]||(N[6]=(...S)=>e.unref(d)&&e.unref(d)(...S))},[dn,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-center",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(D.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center text-danger opacity-50",[t.showClear?"pr-8":"pr-2"]])}," * ",2)):e.createCommentVNode("",!0)])]),e.unref(u)&&!e.unref(m)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(u),class:e.normalizeClass(e.unref(v))},e.toDisplayString(e.unref(f)),11,mn)):e.createCommentVNode("",!0)],2))}}),Le=/^https?:\/\//,ge=/^[\w-_.+]+@[\w-_.+]+$/,fn=t=>(t||"").match(ge)?!0:"Value should be a valid e-mail address",pn=t=>(t||"").split(",").map(l=>l.trim()).every(l=>l.match(ge))||"Value should be one or multiple comma-delimited e-mail addresses",hn=t=>(B.isString(t)&&(t=t.trim()),t?!0:"Value is required"),vn=(t,n)=>(o,l)=>o===l.form[t]?!0:`Value must be the same as in field '${n||t}'`,gn=t=>n=>{const{minLength:o,maxLength:l}=t;return n=X.isNullOrUndefined(n)?"":n,B.isString(n)?!B.isUndefined(o)&&n.length<o?`Value needs to be at least ${o} characters long`:!B.isUndefined(l)&&n.length>l?`Value needs to be no more than ${l} characters long`:!0:"Value should be a text string"},yn=t=>n=>{const{match:o,message:l}=t;return B.isString(n)?o?B.isString(o)?n.includes(o)?!0:l:o.test(n)?!0:l:!0:"Value should be a text string"},kn=t=>Le.test(t)?!0:"Value is not a valid URL",bn=t=>Array.isArray(t)&&t.length>0?!0:"Value should have at least a single item selected",xn=Object.freeze(Object.defineProperty({__proto__:null,VALID_EMAIL:ge,VALID_HTTP_URL:Le,isEmail:fn,isItemSelected:bn,isOneOrMultipleEmails:pn,isRequired:hn,isSameAs:vn,isStringOfLength:gn,isUrl:kn,stringContains:yn},Symbol.toStringTag,{value:"Module"}));function ye(t){const{skipCalculation:n,elementToWatchForChanges:o,itemContainer:l,trackResize:s=!1,trackMutations:a=!0}=t||{},c=e.ref(0),r=()=>{const i=l.value;if(n!=null&&n.value||!i)return;const u=i.children;let v=0,f=0,m;for(const y of u){const d=y.offsetTop;B.isUndefined(m)?(m=d,v+=1):d===m&&(v+=1),f+=1}c.value=f-v};return s&&O.useResizeObserver(o,r),a&&O.useMutationObserver(o,r,{childList:!0,subtree:!0}),{hiddenItemCount:c}}function ke(t){const{props:n,emit:o,dynamicVisibility:l}=t;let s;if(l){const{elementToWatchForChanges:u,itemContainer:v}=l;s=ye({skipCalculation:e.computed(()=>{var m;return!((m=n.multiple)!=null&&m.value)}),elementToWatchForChanges:u,itemContainer:v}).hiddenItemCount}else s=e.ref(0);const a=e.computed({get:()=>{var v,f;const u=(v=n.modelValue)==null?void 0:v.value;return(f=n.multiple)!=null&&f.value?B.isArray(u)?u:[]:B.isArray(u)?void 0:u},set:u=>{var v,f,m;if((v=n.multiple)!=null&&v.value&&!B.isArray(u)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!((f=n.multiple)!=null&&f.value)&&B.isArray(u)){console.warn("Attempting to set array value in selector w/ multiple=false");return}o("update:modelValue",(m=n.multiple)!=null&&m.value?u||[]:u)}}),c=u=>B.isArray(u);return{selectedValue:a,hiddenSelectedItemCount:s,isArrayValue:c,isMultiItemArrayValue:u=>B.isArray(u)&&u.length>1,firstItem:u=>c(u)?u[0]:u}}const Cn=t=>(e.pushScopeId("data-v-60cf597b"),t=t(),e.popScopeId(),t),Bn=Cn(()=>e.createElementVNode("div",{class:"swoosher relative top-0 bg-blue-500/50"},null,-1)),wn=[Bn],Vn=e.defineComponent({__name:"Bar",props:{loading:{type:Boolean}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full h-1 bg-blue-500/30 text-xs text-foreground-on-primary overflow-hidden rounded-xl",t.loading?"opacity-100":"opacity-0"])},wn,2))}});const ce=Ee(Vn,[["__scopeId","data-v-60cf597b"]]),En={class:"flex items-center justify-between w-full"},Nn={class:"block truncate grow text-left text-xs sm:text-sm"},Sn={class:"pointer-events-none shrink-0 ml-1 flex items-center space-x-2"},$n={key:1,class:"text-4xl text-danger opacity-50 h-4 w-4 leading-6"},zn=["disabled"],In={key:0,class:"flex flex-col mx-1 mb-1"},Ln=e.createElementVNode("span",{class:"sr-only label text-foreground"},"Search",-1),Dn={class:"relative"},Tn={class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},Mn=["placeholder"],On={key:0,class:"px-1"},An={key:1},Pn=e.createElementVNode("div",{class:"text-foreground-2 text-center"},"Nothing found 🤷‍♂️",-1),jn={class:e.normalizeClass(["block truncate"])},Fn=["id"],be=e.defineComponent({__name:"Base",props:{multiple:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},modelValue:{type:[Object,Array,String],default:void 0},search:{type:Boolean,default:!1},filterPredicate:{type:Function,default:void 0},disabledItemPredicate:{type:Function,default:void 0},getSearchResults:{type:Function,default:void 0},searchPlaceholder:{type:String,default:"Search"},label:{type:String,required:!0},placeholder:{type:String},showLabel:{type:Boolean,default:!1},name:{type:String,required:!0},by:{type:String,required:!1},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"base"},hideCheckmarks:{type:Boolean,default:!1},allowUnset:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},help:{type:String,default:void 0},fixedHeight:{type:Boolean,default:!1},fullyControlValue:{type:Boolean,default:!1},showRequired:{type:Boolean,default:!1},mountMenuOnBody:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{expose:n,emit:o}){const l=t,s=g=>B.isObjectLike(g),{value:a,errorMessage:c}=re.useField(l.name,l.rules,{validateOnMount:l.validateOnMount,validateOnValueUpdate:l.validateOnValueUpdate,initialValue:l.modelValue}),r=O.useMounted(),i=e.ref(null),u=e.ref(null),v=e.ref(""),f=e.ref([]),m=e.ref(!1),y=e.ref(1),d=e.ref(he.nanoid()),b=O.useElementBounding(e.computed(()=>{var g;return(g=u.value)==null?void 0:g.el}),{windowResize:!0,windowScroll:!0,immediate:!0}),h=e.computed(()=>e.unref(l.label)||e.unref(l.name)),k=e.computed(()=>{const g=c.value;return!g||!e.unref(l.useLabelInErrors)?g:g.replace("Value",h.value)}),x=e.computed(()=>k.value||e.unref(l.help)),I=e.computed(()=>!!x.value),p=e.computed(()=>I.value?`${e.unref(l.name)}-${d.value}`:void 0),E=e.computed(()=>c.value?"text-danger":"text-foreground-2"),N=e.computed(()=>l.buttonStyle!=="simple"&&l.clearable&&!l.disabled),S=e.computed(()=>{const g=["relative flex group"];return c.value?(g.push("hover:shadow rounded-md"),g.push("text-danger-darker focus:border-danger focus:ring-danger"),l.buttonStyle!=="simple"&&g.push("outline outline-2 outline-danger")):l.buttonStyle!=="simple"&&(g.push("hover:shadow rounded-md"),g.push("outline outline-2 outline-primary-muted")),l.fixedHeight&&g.push("h-8"),g.join(" ")}),ne=e.computed(()=>{const g=[];return l.buttonStyle!=="simple"&&g.push(K.value?"bg-foundation-disabled text-foreground-disabled":""),K.value&&g.push("cursor-not-allowed"),g.join(" ")}),H=e.computed(()=>{const g=["relative z-[1]","flex items-center justify-center text-center shrink-0","rounded-r-md overflow-hidden transition-all","text-foreground",oe.value?`w-6 ${ne.value}`:"w-0"];return K.value||(g.push("hover:bg-primary hover:text-foreground-on-primary dark:text-foreground-on-primary"),l.buttonStyle==="tinted"?g.push("bg-outline-3"):g.push("bg-primary-muted")),g.join(" ")}),de=e.computed(()=>{const g=["relative z-[2]","normal rounded-md cursor-pointer transition truncate flex-1","flex items-center",ne.value];return l.buttonStyle!=="simple"&&(g.push("py-2 px-3"),K.value||(l.buttonStyle==="tinted"?g.push("bg-foundation-page text-foreground"):g.push("bg-foundation text-foreground"))),N.value&&oe.value&&g.push("rounded-r-none"),g.join(" ")}),Z=e.computed(()=>!!(l.search&&(l.filterPredicate||l.getSearchResults))),R=e.computed(()=>Z.value&&l.getSearchResults),K=e.computed(()=>l.disabled||!l.items.length&&!R.value),T=e.computed({get:()=>{const g=a.value;return l.multiple?B.isArray(g)?g:[]:B.isArray(g)?void 0:g},set:g=>{if(l.multiple&&!B.isArray(g)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!l.multiple&&B.isArray(g)){console.warn("Attempting to set array value in selector w/ multiple=false");return}let z;if(l.multiple)z=g||[];else{const $=a.value;z=l.allowUnset&&$&&g&&w($)===w(g)?void 0:g}l.fullyControlValue?o("update:modelValue",z):a.value=z,y.value+=1}}),oe=e.computed(()=>l.multiple&&B.isArray(T.value)?T.value.length!==0:!!T.value),ee=()=>{l.multiple?T.value=[]:T.value=void 0},me=e.computed(()=>{const g=v.value;return!Z.value||!(g!=null&&g.length)?f.value:l.filterPredicate?f.value.filter(z=>{var $;return(($=l.filterPredicate)==null?void 0:$.call(l,z,g))||!1}):f.value}),fe=e.computed(()=>{const g=["rounded-md bg-foundation-2 py-1 label label--light outline outline-2 outline-primary-muted focus:outline-none shadow mt-1 "];return l.mountMenuOnBody?g.push("fixed z-50"):g.push("absolute top-[100%] w-full z-10"),g.join(" ")}),te=e.computed(()=>{const g={};if(l.mountMenuOnBody){const z=b.top.value,$=b.left.value,P=b.width.value,U=b.height.value;g.top=`${z+U}px`,g.left=`${$}px`,g.width=`${P}px`}return g}),C=g=>JSON.stringify(g),w=g=>s(g)?g[l.by||"id"]:g,V=async()=>{if(!(!R.value||!l.getSearchResults)){m.value=!0;try{f.value=await l.getSearchResults(v.value)}finally{m.value=!1}}},A=B.debounce(V,1e3),_=g=>{const{active:z,disabled:$}=g||{},{hideCheckmarks:P}=l,U=["relative transition cursor-pointer select-none py-1.5 pl-3",P?"":"pr-9"];return $?U.push("opacity-50 cursor-not-allowed"):U.push(z?"text-primary":"text-foreground"),U.join(" ")};return e.watch(()=>l.items,g=>{f.value=g.slice()},{immediate:!0}),e.watch(v,()=>{R.value&&A()}),e.onMounted(()=>{R.value&&!l.items.length&&V()}),n({triggerSearch:V}),(g,z)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createBlock(e.unref(L.Listbox),{key:y.value,modelValue:T.value,"onUpdate:modelValue":z[4]||(z[4]=$=>T.value=$),name:t.name,multiple:t.multiple,by:t.by,disabled:K.value,as:"div"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.ListboxLabel),{class:e.normalizeClass(["block label text-foreground-2 mb-2",{"sr-only":!t.showLabel}])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(S.value)},[e.createVNode(e.unref(L.ListboxButton),{ref_key:"listboxButton",ref:u,class:e.normalizeClass(de.value)},{default:e.withCtx(({open:$})=>[e.createElementVNode("div",En,[e.createElementVNode("div",Nn,[!T.value||e.unref(B.isArray)(T.value)&&!T.value.length?e.renderSlot(g.$slots,"nothing-selected",{key:0},()=>[e.createTextVNode(e.toDisplayString(t.placeholder?t.placeholder:t.label),1)]):e.renderSlot(g.$slots,"something-selected",{key:1,value:T.value},()=>[e.createTextVNode(e.toDisplayString(C(T.value)),1)])]),e.createElementVNode("div",Sn,[k.value?(e.openBlock(),e.createBlock(e.unref(M.ExclamationCircleIcon),{key:0,class:"h-4 w-4 text-danger","aria-hidden":"true"})):t.showRequired?(e.openBlock(),e.createElementBlock("div",$n," * ")):e.createCommentVNode("",!0),$?(e.openBlock(),e.createBlock(e.unref(M.ChevronUpIcon),{key:2,class:"h-4 w-4 text-foreground","aria-hidden":"true"})):(e.openBlock(),e.createBlock(e.unref(M.ChevronDownIcon),{key:3,class:"h-4 w-4 text-foreground","aria-hidden":"true"}))])])]),_:3},8,["class"]),N.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(H.value),disabled:t.disabled,onClick:z[0]||(z[0]=$=>ee())},[e.createVNode(e.unref(M.XMarkIcon),{class:"w-3 h-3"})],10,zn)),[[e.unref(Ve.directive),"Clear"]]):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.Transition,{key:1,"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!t.mountMenuOnBody},[e.createVNode(e.unref(L.ListboxOptions),{class:e.normalizeClass(fe.value),style:e.normalizeStyle(te.value),onFocus:z[3]||(z[3]=$=>{var P;return(P=i.value)==null?void 0:P.focus()})},{default:e.withCtx(()=>[Z.value?(e.openBlock(),e.createElementBlock("label",In,[Ln,e.createElementVNode("div",Dn,[e.createElementVNode("div",Tn,[e.createVNode(e.unref(M.MagnifyingGlassIcon),{class:"h-5 w-5 text-foreground"})]),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:i,"onUpdate:modelValue":z[1]||(z[1]=$=>v.value=$),type:"text",class:"pl-9 w-full border-0 bg-foundation-page rounded placeholder:font-normal normal placeholder:text-foreground-2 focus:outline-none focus:ring-1 focus:border-outline-1 focus:ring-outline-1",placeholder:t.searchPlaceholder,onKeydown:z[2]||(z[2]=e.withModifiers(()=>{},["stop"]))},null,40,Mn),[[e.vModelText,v.value]])])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-auto simple-scrollbar",[Z.value?"max-h-52":"max-h-40"]])},[R.value&&m.value?(e.openBlock(),e.createElementBlock("div",On,[e.createVNode(ce,{loading:!0})])):R.value&&!f.value.length?(e.openBlock(),e.createElementBlock("div",An,[e.renderSlot(g.$slots,"nothing-found",{},()=>[Pn])])):e.createCommentVNode("",!0),!R.value||!m.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(me.value,$=>{var P;return e.openBlock(),e.createBlock(e.unref(L.ListboxOption),{key:w($),value:$,disabled:((P=t.disabledItemPredicate)==null?void 0:P.call(t,$))||!1},{default:e.withCtx(({active:U,selected:xe})=>{var Ce,Be;return[e.createElementVNode("li",{class:e.normalizeClass(_({active:U,disabled:((Ce=t.disabledItemPredicate)==null?void 0:Ce.call(t,$))||!1}))},[e.createElementVNode("span",jn,[e.renderSlot(g.$slots,"option",{item:$,active:U,selected:xe,disabled:((Be=t.disabledItemPredicate)==null?void 0:Be.call(t,$))||!1},()=>[e.createTextVNode(e.toDisplayString(C($)),1)])]),!t.hideCheckmarks&&xe?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([U?"text-primary":"text-foreground","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(e.unref(M.CheckIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]}),_:2},1032,["value","disabled"])}),128)):e.createCommentVNode("",!0)],2)]),_:3},8,["class","style"])],8,["disabled"]))]),_:3})):e.createCommentVNode("",!0)],2)]),_:3},8,["modelValue","name","multiple","by","disabled"])),p.value?(e.openBlock(),e.createElementBlock("p",{key:0,id:p.value,class:e.normalizeClass(["mt-2 text-xs sm:text-sm",E.value])},e.toDisplayString(x.value),11,Fn)):e.createCommentVNode("",!0)]))}}),De=e.defineComponent({__name:"SourceAppBadge",props:{sourceApp:null},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(ie,{"color-classes":"text-foreground-on-primary",rounded:"",style:e.normalizeStyle({backgroundColor:t.sourceApp.bgColor})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.sourceApp.short),1)]),_:1},8,["style"]))}}),Rn={key:0,class:"text-foreground-2 normal"},_n={key:1,class:"flex items-center"},Un={class:"truncate"},qn={class:"flex items-center"},Wn={class:"truncate"},Hn=e.defineComponent({__name:"SourceApps",props:{multiple:{type:Boolean,default:!1},modelValue:{type:[Object,Array],default:void 0},search:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Search apps"},selectorPlaceholder:{type:String,default:void 0},label:{type:String,required:!0},showLabel:{type:Boolean,default:!1},name:{type:String,default:void 0},items:{type:Array,default:void 0},clearable:{type:Boolean},help:{type:String}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,l=e.ref(null),s=e.ref(null),{selectedValue:a,hiddenSelectedItemCount:c,isMultiItemArrayValue:r,firstItem:i}=ke({props:e.toRefs(o),emit:n,dynamicVisibility:{elementToWatchForChanges:l,itemContainer:s}}),u=(v,f)=>v.name.toLocaleLowerCase().includes(f.toLocaleLowerCase());return(v,f)=>(e.openBlock(),e.createBlock(be,{modelValue:e.unref(a),"onUpdate:modelValue":f[0]||(f[0]=m=>e.isRef(a)?a.value=m:null),multiple:t.multiple,items:t.items??e.unref(X.SourceApps),search:t.search,"search-placeholder":t.searchPlaceholder,label:t.label,"show-label":t.showLabel,name:t.name||"sourceApps","filter-predicate":u,clearable:t.clearable,help:t.help,by:"name"},{"nothing-selected":e.withCtx(()=>[t.selectorPlaceholder?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.selectorPlaceholder),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.multiple?"Select apps":"Select an app"),1)],64))]),"something-selected":e.withCtx(({value:m})=>[e.unref(r)(m)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"elementToWatchForChanges",ref:l,class:"flex items-center space-x-0.5 h-5"},[e.createElementVNode("div",{ref_key:"itemContainer",ref:s,class:"flex flex-wrap overflow-hidden space-x-0.5 h-5"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,y=>(e.openBlock(),e.createBlock(De,{key:y.name,"source-app":y},null,8,["source-app"]))),128))],512),e.unref(c)>0?(e.openBlock(),e.createElementBlock("div",Rn," +"+e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)],512)):(e.openBlock(),e.createElementBlock("div",_n,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:e.unref(i)(m).bgColor})},null,4),e.createElementVNode("span",Un,e.toDisplayString(e.unref(i)(m).name),1)]))]),option:e.withCtx(({item:m})=>[e.createElementVNode("div",qn,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:m.bgColor})},null,4),e.createElementVNode("span",Wn,e.toDisplayString(m.name),1)])]),_:1},8,["modelValue","multiple","items","search","search-placeholder","label","show-label","name","clearable","help"]))}}),Kn={class:"flex flex-wrap gap-1.5 text-xs"},Gn=e.defineComponent({__name:"Badges",props:{items:null,label:null,name:null,help:null,modelValue:null,multiple:{type:Boolean},rules:null,by:null},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,{selectedValue:l,isArrayValue:s}=ke({props:e.toRefs(o),emit:n}),a=c=>{s(l.value)?l.value=l.value.filter(r=>r.id!==c.id):l.value=void 0};return(c,r)=>(e.openBlock(),e.createBlock(be,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=i=>e.isRef(l)?l.value=i:null),multiple:t.multiple,items:t.items,label:t.label,name:t.name,help:t.help,rules:t.rules,by:t.by},{"something-selected":e.withCtx(({value:i})=>[e.createElementVNode("ul",Kn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s)(i)?i:[i],u=>(e.openBlock(),e.createElementBlock("li",{key:u[t.by]},[e.createVNode(ie,{size:"lg","clickable-icon":!0,"icon-left":e.unref(M.XMarkIcon),onClickIcon:e.withModifiers(v=>a(u),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["icon-left","onClickIcon"])]))),128))])]),option:e.withCtx(({item:i})=>[e.createTextVNode(e.toDisplayString(i.text),1)]),_:1},8,["modelValue","multiple","items","label","name","help","rules","by"]))}}),Xn={class:"flex items-center"},Zn={class:"absolute inset-0 flex items-center gap-2 px-1 text-white"},Qn=e.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue");return(o,l)=>(e.openBlock(),e.createElementBlock("div",Xn,[e.createVNode(e.unref(L.Switch),{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=s=>n.value=s),class:e.normalizeClass(["relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",{"bg-primary":n.value,"bg-primary-muted":!n.value}])},{default:e.withCtx(()=>[e.createElementVNode("div",Zn,[e.createVNode(e.unref(M.CheckIcon),{class:"h-5 w-5 drop-shadow-md"}),e.createVNode(e.unref(M.XMarkIcon),{class:"h-5 w-5 drop-shadow-md"})]),e.createElementVNode("span",{class:e.normalizeClass(["scale-95 pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200",{"translate-x-5":n.value,"translate-x-0":!n.value}])},null,2)]),_:1},8,["modelValue","class"])]))}}),Jn={class:"relative group bg-foundation-page p-2 rounded-lg pr-12"},Yn={class:"absolute inset-0 right-2 flex justify-end items-center"},eo=e.defineComponent({__name:"ClipboardInput",props:{value:null,isMultiline:{type:Boolean,default:!1},rows:null},emits:["copy"],setup(t,{emit:n}){const o=t,{copy:l}=O.useClipboard({legacy:!0}),s=async()=>{o.value&&(await l(o.value),n("copy",o.value))};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Jn,[t.isMultiline?(e.openBlock(),e.createBlock(e.unref(ze),{key:0,color:"transparent",name:"contentArea",readonly:"","model-value":t.value,class:"relative z-10 text-sm text-foreground font-mono",rows:t.rows},null,8,["model-value","rows"])):(e.openBlock(),e.createBlock(e.unref(Ie),{key:1,color:"transparent",name:"contentInput",readonly:"","model-value":t.value,class:"relative z-10 text-sm text-foreground font-mono"},null,8,["model-value"])),e.createElementVNode("div",Yn,[e.createVNode(e.unref(F),{color:"invert",size:"sm","icon-left":e.unref(j.ClipboardDocumentIcon),"hide-text":"",onClick:s},null,8,["icon-left"])])]))}});var Y=(t=>(t.CtrlOrCmd="cmd-or-ctrl",t.AltOrOpt="alt-or-opt",t.Shift="shift",t))(Y||{});const le=X.getClientOperatingSystem(),to={["cmd-or-ctrl"]:le===X.OperatingSystem.Mac?"Cmd":"Ctrl",["alt-or-opt"]:le===X.OperatingSystem.Mac?"Opt":"Alt",shift:"Shift"};function no(t){const n=o=>Object.values(Y).includes(o);return t.map(o=>n(o)?to[o]:o).join("+")}function oo(t,...n){O.onKeyDown(n[0],o=>{const l=o.getModifierState("Alt"),s=le===X.OperatingSystem.Mac?o.getModifierState("Meta"):o.getModifierState("Control"),a=o.getModifierState("Shift");for(const c of t)switch(c){case Y.CtrlOrCmd:if(!s)return;break;case Y.AltOrOpt:if(!l)return;break;case Y.Shift:if(!a)return;break}n[1](o)},n[2])}function lo(t){const n=(t==null?void 0:t.model)||e.ref(),o=e.computed({get:()=>!!n.value,set:l=>n.value=l?!0:void 0});return{model:n,isChecked:o}}const so=e.createElementVNode("div",{class:"fixed inset-0 bg-neutral-100/70 dark:bg-neutral-900/70 transition-opacity backdrop-blur-xs"},null,-1),ao={class:"fixed inset-0 z-10 h-screen w-screen"},ro={class:"flex justify-center items-center h-full w-full p-4 sm:p-0"},io={key:0,class:"flex items-center justify-start rounded-t-lg shrink-0 h-16 px-4 sm:px-8 truncate text-xl sm:text-2xl font-bold"},co={class:"w-full truncate pr-12"},uo=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},maxWidth:null,hideCloser:{type:Boolean},preventCloseOnClickOutside:{type:Boolean},title:null,buttons:null,onSubmit:{type:Function}},emits:["update:open","fully-closed"],setup(t,{emit:n}){const o=t,l=e.useSlots(),s=e.ref(!1),a=e.ref(!0),c=e.computed(()=>!!o.onSubmit),r=e.computed(()=>o.buttons||l.buttons),i=e.computed(()=>o.title||l.header),u=e.computed({get:()=>o.open,set:d=>n("update:open",d)}),v=e.computed(()=>{switch(o.maxWidth){case"sm":return 0;case"md":return 1;case"lg":return 2;case"xl":return 3;default:return 1e4}}),f=e.computed(()=>{const d=["w-full","sm:w-full sm:max-w-xl"];return v.value>=1&&d.push("md:max-w-2xl"),v.value>=2&&d.push("lg:max-w-4xl"),v.value>=3&&d.push("xl:max-w-6xl"),v.value>=4&&d.push("2xl:max-w-7xl"),d.join(" ")}),m=()=>{o.preventCloseOnClickOutside||(u.value=!1)},y=B.throttle(d=>{const b=d.target,{scrollTop:h,offsetHeight:k,scrollHeight:x}=b;s.value=h>0,a.value=h+k>=x},60);return(d,b)=>(e.openBlock(),e.createBlock(e.unref(L.TransitionRoot),{as:"template",show:u.value},{default:e.withCtx(()=>[e.createVNode(e.unref(L.Dialog),{as:"div",class:"relative z-40",onClose:m},{default:e.withCtx(()=>[e.createVNode(e.unref(L.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:e.withCtx(()=>[so]),_:1}),e.createElementVNode("div",ao,[e.createElementVNode("div",ro,[e.createVNode(e.unref(L.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",onAfterLeave:b[2]||(b[2]=h=>d.$emit("fully-closed"))},{default:e.withCtx(()=>[e.createVNode(e.unref(L.DialogPanel),{class:e.normalizeClass(["transform rounded-lg text-foreground overflow-hidden bg-foundation text-left shadow-xl transition-all flex flex-col max-h-[90vh]",f.value]),as:c.value?"form":"div",onSubmit:e.withModifiers(t.onSubmit,["prevent"])},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(s.value&&"relative z-10 shadow-lg")},[i.value?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("div",co,[e.createTextVNode(e.toDisplayString(t.title)+" ",1),e.renderSlot(d.$slots,"header")])])):e.createCommentVNode("",!0)],2),t.hideCloser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["absolute z-20 right-4 bg-foundation rounded-full p-1",i.value?"top-4":"top-3"]),onClick:b[0]||(b[0]=h=>u.value=!1)},[e.createVNode(e.unref(j.XMarkIcon),{class:"h-6 w-6"})],2)),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 simple-scrollbar overflow-y-auto bg-white dark:bg-foundation",i.value?"p-4 sm:py-6 sm:px-8":"p-10"]),onScroll:b[1]||(b[1]=(...h)=>e.unref(y)&&e.unref(y)(...h))},[e.renderSlot(d.$slots,"default",{},()=>[e.createTextVNode("Put your content here!")])],34),r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex px-4 py-2 sm:py-4 sm:px-6 gap-2 shrink-0",!a.value&&"shadow-t"])},[t.buttons?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.buttons,(h,k)=>(e.openBlock(),e.createBlock(e.unref(F),e.mergeProps({key:k},h.props,{disabled:h.disabled,type:h.submit&&"submit",onClick:h.onClick}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.text),1)]),_:2},1040,["disabled","type","onClick"]))),128)):e.renderSlot(d.$slots,"buttons",{key:1})],2)):e.createCommentVNode("",!0)]),_:3},8,["class","as","onSubmit"])]),_:3})])])]),_:3})]),_:3},8,["show"]))}}),mo={class:"h-4 sm:h-5 h-4 sm:w-5 empty:h-0 empty:w-0"},fo=e.defineComponent({__name:"DialogSection",props:{title:String,borderT:Boolean,borderB:Boolean,allowOverflow:Boolean,titleColor:{type:String,default:"default"},button:Object,alwaysOpen:Boolean},setup(t){const n=t,o=e.ref(null),l=e.ref(0),s=e.ref(!1),a=e.computed(()=>{const i=[];return!n.button&&!n.alwaysOpen&&i.push("cursor-pointer","hover:bg-foundation"),s.value&&i.push("bg-foundation"),i}),c=e.computed(()=>{switch(n.titleColor){case"danger":return"text-danger";case"warning":return"text-warning";case"success":return"text-success";case"secondary":return"text-secondary";case"info":return"text-info";default:return"text-foreground"}}),r=()=>{var i;s.value=!s.value,s.value&&(l.value=(((i=e.unref(o))==null?void 0:i.scrollHeight)||0)+64)};return(i,u)=>{var v,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col border-primary-muted",{"border-t":t.borderT,"border-b":t.borderB,"relative z-10":s.value}])},[e.createElementVNode("div",e.mergeProps({class:["flex justify-between items-center gap-4 sm:gap-8 py-3 sm:py-4 px-2",a.value],tabindex:"0"},e.toHandlers(!t.button&&!t.alwaysOpen?{click:r,keypress:e.unref(Se)(r)}:{},!0)),[e.createElementVNode("div",{class:e.normalizeClass(["text-sm sm:text-base font-bold flex items-center gap-1 sm:gap-2 select-none",c.value])},[e.createElementVNode("div",mo,[e.renderSlot(i.$slots,"icon")]),e.createElementVNode("span",null,e.toDisplayString(t.title),1)],2),e.createElementVNode("div",null,[!t.button&&!t.alwaysOpen?(e.openBlock(),e.createBlock(e.unref(j.ChevronDownIcon),{key:0,class:e.normalizeClass(["w-4 h-4 sm:w-5 sm:h-5 transition-all duration-400",s.value&&"rotate-180"])},null,8,["class"])):e.createCommentVNode("",!0),t.button?(e.openBlock(),e.createBlock(e.unref(F),e.mergeProps({key:1,size:"sm",to:t.button.expandContent?void 0:t.button.to,color:t.button.expandContent&&s.value?"invert":t.button.color,"icon-right":t.button.expandContent&&s.value?void 0:t.button.iconRight,onClick:(v=t.button)==null?void 0:v.onClick},e.toHandlers((f=t.button)!=null&&f.expandContent?{click:r}:{})),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.button.expandContent&&s.value?"Cancel":t.button.text),1)]),_:1},16,["to","color","icon-right","onClick"])):e.createCommentVNode("",!0)])],16),e.createElementVNode("div",{class:e.normalizeClass(["transition-all duration-700 overflow-hidden",[t.allowOverflow&&s.value?"!overflow-visible":"",s.value?"mb-3 mt-1":"",!t.button&&!t.alwaysOpen?"cursor-pointer hover:bg-foundation":""]]),style:e.normalizeStyle(t.alwaysOpen?"max-height: none;":`max-height: ${s.value?l.value+"px":"0px"}`)},[e.createElementVNode("div",{ref_key:"content",ref:o,class:"rounded-md text-sm pb-3 px-2 mt-1"},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode("Panel contents")])],512)],6)],2)}}}),po={class:"inline-flex items-center space-x-2"},ho={class:"label-light"},vo=e.defineComponent({__name:"Disclosure",props:{title:null,icon:null,color:{default:"default"}},setup(t){const n=t,o=e.computed(()=>{const s=["pr-3 h-10 w-full flex items-center justify-between border-l-2 px-2 rounded transition","ring-1 font-medium"];switch(n.color){case"warning":s.push("border-warning text-warning ring-warning-lighter hover:ring-warning");break;case"success":s.push("border-success text-success ring-success-lighter hover:ring-success");break;case"danger":s.push("border-danger text-danger ring-danger-lighter hover:ring-danger");break;case"default":default:s.push("border-primary text-primary ring-primary-muted hover:ring-primary");break}return s.join(" ")}),l=e.computed(()=>{const s=["p-3 border-x border-b rounded-b-md"];switch(n.color){case"warning":s.push("border-warning-lighter");break;case"success":s.push("border-success-lighter");break;case"danger":s.push("border-danger-lighter");break;case"default":default:s.push("border-primary-muted");break}return s.join(" ")});return(s,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(L.Disclosure),null,{default:e.withCtx(({open:c})=>[e.createVNode(e.unref(L.DisclosureButton),{class:e.normalizeClass(o.value)},{default:e.withCtx(()=>[e.createElementVNode("div",po,[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"h-5 w-5"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.title),1)]),e.createVNode(e.unref(M.ChevronUpIcon),{class:e.normalizeClass([c?"":"rotate-180 transform","h-5 w-5"])},null,8,["class"])]),_:2},1032,["class"]),e.createVNode(e.unref(L.DisclosurePanel),{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[e.createElementVNode("div",ho,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode("Panel contents")])])]),_:3},8,["class"])]),_:3})]))}});var G=(t=>(t.Grid="grid",t.List="list",t))(G||{});const go=e.defineComponent({__name:"GridListToggle",props:{modelValue:null},emits:["click","update:modelValue"],setup(t,{emit:n}){const o=t,l=e.computed({get:()=>o.modelValue||G.Grid,set:c=>n("update:modelValue",c)}),s=e.computed(()=>l.value===G.Grid?M.Bars3Icon:j.Squares2X2Icon),a=c=>{n("click",c);const r=l.value===G.Grid?G.List:G.Grid;l.value=r};return(c,r)=>(e.openBlock(),e.createElementBlock("button",{class:"flex items-center justify-center rounded bg-foundation h-8 w-8 shadow cursor-pointer text-foreground",onClick:a},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),{class:"h-5 w-5"}))]))}});var Te=(t=>(t[t.Throttle=0]="Throttle",t[t.Debounce=1]="Debounce",t))(Te||{}),se=(t=>(t[t.Left=0]="Left",t[t.Right=1]="Right",t))(se||{});function Me(t,n){if(!O.isClient)return;const{wait:o=100,throttleOrDebounce:l=0}=n||{},s=o?l===0?B.throttle(t,o):B.debounce(t,o):t;e.onMounted(()=>window.addEventListener("resize",s)),e.onBeforeUnmount(()=>window.removeEventListener("resize",s))}function yo(t){e.onMounted(()=>{window.addEventListener("beforeunload",t)}),e.onBeforeUnmount(()=>{window.removeEventListener("beforeunload",t)})}function Oe(t){const{el:n,defaultDirection:o}=t,l=e.ref(B.isUndefined(o)?1:o),s=e.computed(()=>{const c=e.unref(t.stopUpdatesBelowWidth);if(!B.isUndefined(c))return c;const r=e.unref(n);return r!=null&&r.offsetWidth?r.offsetWidth*2:void 0}),a=()=>{if(!O.isClient)return;const c=e.unref(n);if(!c)return;const r=c.getBoundingClientRect(),i=r.x+r.width>window.innerWidth,u=r.x<0;i&&u||!B.isUndefined(s.value)&&window.innerWidth<s.value||(i?l.value=0:u&&(l.value=1))};return Me(()=>a()),e.watch(()=>e.unref(n),c=>{c&&a()}),{direction:e.computed(()=>l.value),recalculateDirection:a}}const ko=["disabled","onClick"],bo=e.defineComponent({__name:"Menu",props:{open:{type:Boolean},items:null},emits:["update:open","chosen"],setup(t,{emit:n}){const o=t,l=e.ref(null),{direction:s}=Oe({el:e.computed(()=>{var m;return((m=l.value)==null?void 0:m.el)||null}),defaultDirection:se.Left,stopUpdatesBelowWidth:300}),a=e.ref(null),c=e.ref(!1),r=e.computed({get:()=>o.open||!1,set:m=>n("update:open",m)}),i=m=>{const{active:y,disabled:d}=m,b=["group flex w-full items-center rounded-md px-2 py-2 text-sm"];return y?b.push("bg-primary text-foreground-on-primary"):d?b.push("text-foreground-disabled"):b.push("text-foreground"),b.join(" ")},u=(m,y)=>{n("chosen",{item:m,event:y})},v=()=>{var m;return(m=a.value)==null?void 0:m.el.click()},f=m=>{const y=!!m;return c.value=y,y};return e.watch(c,(m,y)=>{m!==y&&(r.value=m)}),e.watch(r,m=>{(m&&!c.value||!m&&c.value)&&v()}),(m,y)=>(e.openBlock(),e.createBlock(e.unref(L.Menu),{as:"div",class:"relative inline-block"},{default:e.withCtx(({open:d})=>[e.createElementVNode("div",null,[e.createVNode(e.unref(L.MenuButton),{ref_key:"menuButton",ref:a,class:"hidden",onClick:y[0]||(y[0]=e.withModifiers(()=>{},["stop","prevent"]))},null,512),e.createElementVNode("div",{class:e.normalizeClass(d?"pointer-events-none":"")},[e.renderSlot(m.$slots,"default",{toggle:v,open:f(d)})],2)]),e.createVNode(e.Transition,{"enter-active-class":"transition duration-100 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.MenuItems),{ref_key:"menuItems",ref:l,class:e.normalizeClass(["absolute mt-2 w-56 origin-top-right divide-y divide-outline-3 rounded-md bg-foundation shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-40",e.unref(s)===e.unref(se).Left?"right-0":""])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(b,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"px-1 py-1"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b,k=>(e.openBlock(),e.createBlock(e.unref(L.MenuItem),{key:k.id,disabled:k.disabled},{default:e.withCtx(({active:x,disabled:I})=>[e.withDirectives((e.openBlock(),e.createElementBlock("span",null,[e.createElementVNode("button",{class:e.normalizeClass(i({active:x,disabled:I})),disabled:I,onClick:p=>u(k,p)},[e.renderSlot(m.$slots,"item",{item:k},()=>[e.createTextVNode(e.toDisplayString(k.title),1)])],10,ko)])),[[e.unref(Ve.directive),k.disabled&&k.disabledTooltip]])]),_:2},1032,["disabled"]))),128))]))),128))]),_:3},8,["class"])]),_:3})]),_:3}))}}),xo={class:"flex flex-col space-y-4"},Co={class:"flex space-x-6"},Bo=e.defineComponent({__name:"Tabs",props:{items:null},setup(t){const n=t,o=e.ref(null),l=e.computed(()=>o.value&&n.items.find(a=>a.id===o.value)||n.items[0]),s=a=>{o.value=a.id};return(a,c)=>(e.openBlock(),e.createElementBlock("div",xo,[e.createElementVNode("div",Co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createBlock(F,{key:r.id,link:"",color:l.value.id===r.id?"default":"secondary",onClick:i=>s(r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.title),1)]),_:2},1032,["color","onClick"]))),128))]),e.renderSlot(a.$slots,"default",{activeItem:l.value})]))}}),wo={class:"text-foreground"},Vo={class:"w-full text-sm overflow-x-auto overflow-y-visible simple-scrollbar"},Eo=["onClick","onKeypress"],No=e.createElementVNode("div",{class:"text-gray-900 font-medium order-1"},"Placeholder",-1),So={class:"absolute right-1.5 gap-1 flex items-center p-0"},$o=e.defineComponent({__name:"Table",props:{items:null,buttons:null,columns:null,overflowCells:{type:Boolean},onRowClick:{type:Function}},setup(t){const n=t,o=e.computed(()=>{const c=(n.buttons||[]).length;let r=16;return c>0&&(r=48+(c-1)*42),`${r}px`}),l=c=>{var r;return((r=n.columns.find(i=>i.id===c))==null?void 0:r.classes)||""},s=(c,r)=>{const i=l(c);return r===0?`bg-transparent py-3 pr-5 px-1 ${i}`:`lg:p-0 px-1 my-2 ${i}`},a=c=>{var r;(r=n.onRowClick)==null||r.call(n,c)};return(c,r)=>(e.openBlock(),e.createElementBlock("div",wo,[e.createElementVNode("div",Vo,[t.items.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"grid z-10 grid-cols-12 items-center gap-6 font-semibold bg-foundation rounded-t-lg w-full border-b border-outline-3 pb-2 pt-4 px-4 min-w-[900px]",style:e.normalizeStyle({paddingRight:o.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,class:e.normalizeClass([l(i.id),"capitalize"])},e.toDisplayString(i.header),3))),128))],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["divide-y divide-outline-3 h-full overflow-visible",{"pb-32":t.overflowCells}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,class:e.normalizeClass(["relative grid grid-cols-12 items-center gap-6 px-4 py-1 min-w-[900px] bg-foundation",{"cursor-pointer hover:bg-primary-muted":!!t.onRowClick}]),style:e.normalizeStyle({paddingRight:o.value}),tabindex:"0",onClick:u=>a(i),onKeypress:u=>a(i)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(u,v)=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:e.normalizeClass(s(u.id,v)),tabindex:"0"},[e.renderSlot(c.$slots,u.id,{item:i},()=>[No])],2))),128)),e.createElementVNode("div",So,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,u=>(e.openBlock(),e.createElementBlock("div",{key:u.label},[e.createVNode(e.unref(F),{"icon-left":u.icon,size:"sm",color:"secondary","hide-text":"",class:e.normalizeClass(u.class),onClick:e.withModifiers(v=>u.action(i),["stop"])},null,8,["icon-left","class","onClick"])]))),128))])],46,Eo))),128))],2)])]))}}),zo={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},Io={class:"inline-flex items-center space-x-1"},Lo=e.createElementVNode("span",{class:"text-foreground-2"},"That's it, you've loaded everything!",-1),Do={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},To={class:"inline-flex items-center space-x-1"},Mo=e.createElementVNode("span",{class:"text-foreground-2"},"An error occurred while loading",-1),Oo=e.defineComponent({__name:"InfiniteLoading",props:{settings:null,allowRetry:{type:Boolean}},emits:["infinite"],setup(t){const n=e.ref(null),o=e.ref(!1);return O.isClient&&e.onMounted(()=>{const l=setInterval(()=>{var s;(s=n.value)!=null&&s.isConnected&&(o.value=!0,clearInterval(l))},200)}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapper",ref:n},[o.value?(e.openBlock(),e.createBlock(e.unref(Xe),e.mergeProps({key:0},l.$props.settings||{},{onInfinite:s[0]||(s[0]=a=>l.$emit("infinite",a))}),{spinner:e.withCtx(()=>[e.createVNode(ce,{loading:!0,class:"my-2"})]),complete:e.withCtx(()=>[e.createElementVNode("div",zo,[e.createElementVNode("div",Io,[e.createVNode(e.unref(j.CheckIcon),{class:"w-5 h-5 text-success"}),Lo])])]),error:e.withCtx(({retry:a})=>[e.createElementVNode("div",Do,[e.createElementVNode("div",To,[e.createVNode(e.unref(j.ExclamationTriangleIcon),{class:"w-5 h-5 text-danger"}),Mo]),t.allowRetry?(e.openBlock(),e.createBlock(F,{key:0,onClick:a},{default:e.withCtx(()=>[e.createTextVNode("Retry")]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:1},16)):e.createCommentVNode("",!0)],512))}}),Ao={class:"relative group"},Po={key:0,class:"absolute -inset-1 bg-blue-300 dark:bg-blue-500 opacity-5 dark:opacity-0 rounded-md blur-sm group-hover:opacity-60 dark:group-hover:opacity-30 transition duration-500"},jo=e.defineComponent({__name:"Panel",props:{form:{type:Boolean,default:!1},ring:{type:Boolean,default:!1},fancyGlow:{type:Boolean,default:!1},customPadding:{type:Boolean,default:!1},noShadow:{type:Boolean,default:!1},panelClasses:{type:String}},emits:["submit"],setup(t,{emit:n}){const o=t,l=e.computed(()=>o.customPadding?"":"px-4 py-4 sm:px-6"),s=e.computed(()=>o.customPadding?"":"px-4 py-4 sm:p-6"),a=e.computed(()=>{const c=["rounded-lg"];return o.noShadow||c.push("shadow"),o.ring&&c.push("ring-outline-2 hover:ring-2"),o.panelClasses&&c.push(o.panelClasses),c.join(" ")});return(c,r)=>(e.openBlock(),e.createElementBlock("div",Ao,[t.fancyGlow?(e.openBlock(),e.createElementBlock("div",Po)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.form?"form":"div"),{class:e.normalizeClass(["relative divide-outline-3 bg-foundation text-foreground flex flex-col divide-y overflow-hidden",a.value]),onSubmit:r[0]||(r[0]=i=>n("submit",i))},{default:e.withCtx(()=>[c.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.value)},[e.renderSlot(c.$slots,"header")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grow",s.value])},[e.renderSlot(c.$slots,"default")],2),c.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(l.value)},[e.renderSlot(c.$slots,"footer")],2)):e.createCommentVNode("",!0)]),_:3},40,["class"]))]))}}),Fo={class:"flex-shrink-0"},Ro=e.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),_o=e.defineComponent({__name:"Alert",props:{color:{default:"success"},withDismiss:{type:Boolean},actions:null,customIcon:null,size:{default:"default"}},emits:["dismiss"],setup(t){const n=t,o=e.useSlots(),l=e.computed(()=>!!o.description),s=e.computed(()=>{if(n.customIcon)return n.customIcon;switch(n.color){case"info":return D.InformationCircleIcon;case"warning":return D.ExclamationCircleIcon;case"danger":return D.XCircleIcon;case"success":default:return D.CheckCircleIcon}}),a=e.computed(()=>{const d=[];switch(n.size){case"xs":d.push("p-1");break;case"default":default:d.push(l.value?"p-4":"p-2");break}switch(n.color){case"success":d.push("bg-success-lighter border-l-4 border-success");break;case"info":d.push("bg-info-lighter border-l-4 border-info");break;case"danger":d.push("bg-danger-lighter border-l-4 border-danger");break;case"warning":d.push("bg-warning-lighter border-l-4 border-warning");break}return d.join(" ")}),c=e.computed(()=>{const d=[];if(l.value)d.push("");else switch(d.push("items-center"),n.size){case"xs":d.push("space-x-1");break;case"default":default:d.push("space-x-2");break}return d.join(" ")}),r=e.computed(()=>{const d=["grow"];switch(l.value||d.push("flex items-center space-x-2"),n.size){case"xs":d.push("ml-1");break;case"default":default:d.push("ml-3");break}return d.join(" ")}),i=e.computed(()=>{const d=[];switch(n.size){case"xs":d.push("text-xs");break;case"default":default:d.push("mt-2 text-sm");break}return d.join(" ")}),u=e.computed(()=>{var h;const d=["flex"];l.value||d.push("grow justify-end");const b=l.value&&((h=n.actions)==null?void 0:h.length);switch(n.size){case"xs":d.push("space-x-1"),b&&d.push("mt-1");break;case"default":default:d.push("space-x-2"),b&&d.push("mt-4");break}return d.join(" ")}),v=e.computed(()=>{const d=[];switch(n.color){case"success":d.push("text-success-darker");break;case"info":d.push("text-info-darker");break;case"danger":d.push("text-danger-darker");break;case"warning":d.push("text-warning-darker");break}return d.join(" ")}),f=e.computed(()=>{const d=[];switch(n.size){case"xs":d.push("h-4 w-4"),d.push(l.value?"mt-0.5":"");break;case"default":default:d.push("h-5 w-5");break}switch(n.color){case"success":d.push("text-success");break;case"info":d.push("text-info");break;case"danger":d.push("text-danger");break;case"warning":d.push("text-warning");break}return d.join(" ")}),m=e.computed(()=>{const d=[];switch(n.color){case"success":d.push("bg-success-lighter ring-success");break;case"info":d.push("bg-info-lighter ring-info");break;case"danger":d.push("bg-danger-lighter ring-danger");break;case"warning":d.push("bg-warning-lighter ring-warning");break}return d.join(" ")}),y=e.computed(()=>{switch(n.size){case"xs":return"xs";case"default":default:return"sm"}});return(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded-md",[a.value,v.value]])},[e.createElementVNode("div",{class:e.normalizeClass(["flex",c.value])},[e.createElementVNode("div",Fo,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),{class:e.normalizeClass(f.value),"aria-hidden":"true"},null,8,["class"]))]),e.createElementVNode("div",{class:e.normalizeClass(r.value)},[e.createElementVNode("h3",{class:e.normalizeClass(["text-sm",[l.value?"font-medium":""]])},[e.renderSlot(d.$slots,"title",{},()=>[e.createTextVNode("Title")])],2),l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value)},[e.renderSlot(d.$slots,"description",{},()=>[e.createTextVNode(" Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam. ")])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(u.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions||[],(h,k)=>(e.openBlock(),e.createBlock(F,{key:k,color:t.color,size:y.value,to:h.url,external:h.externalUrl||!1,onClick:x=>h.onClick||e.unref(B.noop)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.title),1)]),_:2},1032,["color","size","to","external","onClick"]))),128))],2)],2),t.withDismiss?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex",[l.value?"items-start":"items-center"]])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["inline-flex rounded-md focus:outline-none focus:ring-2",m.value]),onClick:b[0]||(b[0]=h=>d.$emit("dismiss"))},[Ro,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)],2)):e.createCommentVNode("",!0)],2)],2))}});function Uo(t){var d,b;const{get:n,initialState:o,readOptions:l,set:s,asyncRead:a=!0,debugging:c}=t,r=c==null?void 0:c.log,i=()=>(new Error("Trace:").stack||"").substring(7),u=((b=(d=t.debugging)==null?void 0:d.log)==null?void 0:b.logger)||console.debug,v=r&&!r.writesOnly?()=>{const h=n();return u(`debugging: '${r.name}' read`,h,i()),h}:n,f=r&&!r.readsOnly?h=>(u(`debugging: '${r.name}' written to`,h,i()),s(h)):s,m=a?O.computedAsync(v,o,l):e.computed(v),y=e.computed(()=>m.value);return y.update=f,y}const qo=e.defineComponent({__name:"ContextManager",setup(t,{expose:n}){const l=e.getCurrentInstance().provides,s=Object.getOwnPropertySymbols(l).find(m=>m.description==="ComboboxContext");s||console.error("FormTagsContextManager ctx key not found!");const a=e.inject(s||"__undefined");return a||console.error("FormTagsContextManager ctx not found!"),n({goUp:()=>{a==null||a.goToOption(1)},goDown:()=>{a==null||a.goToOption(2)},open:()=>{a&&a.openCombobox()},close:()=>{a==null||a.closeCombobox()},selectActive:()=>{a==null||a.selectActiveOption()},isOpen:()=>(a==null?void 0:a.comboboxState.value)===0}),(m,y)=>e.renderSlot(m.$slots,"default")}}),Wo=["for"],Ho=["disabled","placeholder","onKeydown"],Ko=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),Go={key:1},Xo=e.createElementVNode("div",{class:"text-foreground-2 text-center"},[e.createTextVNode(" Press "),e.createElementVNode("strong",null,"Enter"),e.createTextVNode(" to create tag ⚡ ")],-1),Zo=[Xo],Qo=["id"],Jo=e.defineComponent({__name:"Tags",props:{name:null,help:null,label:null,showLabel:{type:Boolean},rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},autoFocus:{type:Boolean},showClear:{type:Boolean},showRequired:{type:Boolean},color:{default:"page"},wrapperClasses:null,size:{default:"base"},placeholder:null,disabled:{type:Boolean},useLabelInErrors:{type:Boolean,default:!0},getAutocompleteItems:{type:Function},modelValue:null},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const l=t,s=C=>C.type==="input",a=e.ref(null),{focused:c}=O.useFocus(a),r=e.ref(null),{coreInputClasses:i,coreClasses:u,labelClasses:v,title:f,helpTip:m,helpTipId:y,hideHelpTip:d,helpTipClasses:b,errorMessage:h,clear:k,value:x}=ve({props:e.toRefs(l),emit:o,inputEl:a}),I=e.ref([]),p=e.ref(!1),E=e.ref(!1),N=e.ref(""),S=e.computed({get:()=>x.value||[],set:C=>{x.value=B.uniq(C).filter(w=>!!w.length)}}),ne=e.computed(()=>{switch(l.size){case"sm":return"h-6";case"lg":return"h-10";case"xl":return"h-14";case"base":default:return"h-8"}}),H=e.computed(()=>l.showClear&&!!S.value.length),de=e.computed(()=>{const C=[u.value,l.disabled?"cursor-not-allowed !bg-foundation-disabled !text-disabled-muted":""];return H.value&&(h.value||l.showRequired)?C.push("pr-14"):(H.value||h.value||l.showRequired)&&C.push("pr-8"),h.value?(C.push("border-2 border-danger text-danger-darker"),c.value&&C.push("ring-1 ring-danger")):(C.push("border-2 border-transparent"),c.value&&C.push("ring-2 ring-outline-2")),C.join(" ")}),Z=C=>{if(l.disabled)return;const w=S.value.indexOf(C);if(w!==-1){const V=S.value.slice();V.splice(w,1),S.value=V}},R=()=>{var C;(C=a.value)==null||C.blur(),E.value=!1},K=C=>{if(C.key!=="Backspace"||N.value.length)return;const w=S.value.slice();w.pop(),S.value=w,E.value=!1},T=()=>{var C,w,V;(C=r.value)!=null&&C.isOpen()?(w=r.value)==null||w.goUp():(V=r.value)==null||V.open()},oe=()=>{var C,w,V;(C=r.value)!=null&&C.isOpen()?(w=r.value)==null||w.goDown():(V=r.value)==null||V.open()},ee=async()=>{l.getAutocompleteItems&&(p.value=!0,I.value=await Promise.resolve(l.getAutocompleteItems(N.value)),p.value=!1)},me=B.debounce(ee,1e3),fe=()=>{p.value=!0,me()},te=(C,w)=>{var A,_;if(s(C)?C.data===" "||C.data===","||C.data===";":!0){let g=!1;if((A=r.value)!=null&&A.isOpen()&&I.value.length&&!w)(_=r.value)==null||_.selectActive(),g=!0;else{const z=N.value.trim().substring(0,N.value.length-(s(C)?1:0)),$=S.value.includes(z);z.length>0&&!$&&(S.value=[...S.value,z],g=!0)}g&&(N.value="",E.value=!1)}else E.value=!!N.value.length};return e.watch(E,(C,w)=>{var V,A;C&&!w?l.getAutocompleteItems&&((V=r.value)==null||V.open()):!C&&w&&((A=r.value)==null||A.close())}),e.watch(N,()=>{fe()}),e.onMounted(()=>{ee()}),n({resolveAutocompleteItems:ee}),(C,w)=>(e.openBlock(),e.createBlock(e.unref(L.Combobox),{modelValue:S.value,"onUpdate:modelValue":w[5]||(w[5]=V=>S.value=V),as:"div",multiple:"",clearable:"",class:e.normalizeClass([t.wrapperClasses])},{default:e.withCtx(()=>[e.createVNode(qo,{ref_key:"ctxManager",ref:r},{default:e.withCtx(()=>[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(v))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(f)),1)],10,Wo),e.createElementVNode("div",{class:e.normalizeClass(["relative flex flex-wrap items-center space-x-1 px-2 py-1",de.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,V=>(e.openBlock(),e.createBlock(ie,{key:V,"icon-left":t.disabled?void 0:e.unref(D.XMarkIcon),"clickable-icon":"",size:"lg",onClickIcon:()=>Z(V)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V),1)]),_:2},1032,["icon-left","onClickIcon"]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputEl",ref:a,"onUpdate:modelValue":w[0]||(w[0]=V=>N.value=V),disabled:t.disabled,class:e.normalizeClass(["bg-transparent grow shrink border-0 focus:ring-0 p-0",[e.unref(i),ne.value]]),style:{"flex-basis":"70px","min-width":"70px"},placeholder:S.value.length?void 0:t.placeholder,onInput:te,onKeydown:[e.withKeys(R,["escape"]),w[1]||(w[1]=e.withKeys(e.withModifiers(V=>te(V,!0),["stop","prevent"]),["enter"])),e.withKeys(te,["tab"]),e.withKeys(K,["backspace"]),e.withKeys(T,["arrow-up"]),e.withKeys(oe,["arrow-down"])],onBlur:w[2]||(w[2]=V=>E.value=!1)},null,42,Ho),[[e.vModelText,N.value]]),H.value?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute top-2 right-0 flex items-center pr-2 cursor-pointer",onClick:w[3]||(w[3]=(...V)=>e.unref(k)&&e.unref(k)(...V)),onKeydown:w[4]||(w[4]=(...V)=>e.unref(k)&&e.unref(k)(...V))},[Ko,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute top-[10px] right-0 flex items-center",H.value?"pr-8":"pr-2"])},[e.createVNode(e.unref(D.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["pointer-events-none absolute top-[2px] text-4xl right-0 flex items-center text-danger opacity-50",H.value?"pr-8":"pr-2"])}," * ",2)):e.createCommentVNode("",!0)],2),e.createVNode(e.unref(L.TransitionRoot),{leave:"transition ease-in duration-100","leave-from":"opacity-100","leave-to":"opacity-0",class:"relative px-0.5"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.ComboboxOptions),{class:"absolute top-1 max-h-60 w-full overflow-auto simple-scrollbar rounded-md bg-foundation-2 py-1 shadow label label--light outline outline-2 outline-primary-muted focus:outline-none"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["px-1",I.value.length?"mb-1":""])},[e.createVNode(ce,{loading:!0})],2)):e.createCommentVNode("",!0),!I.value.length&&!p.value?(e.openBlock(),e.createElementBlock("div",Go,Zo)):e.createCommentVNode("",!0),I.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(I.value,V=>(e.openBlock(),e.createBlock(e.unref(L.ComboboxOption),{key:V,as:"template",value:V},{default:e.withCtx(({selected:A,active:_})=>[e.createElementVNode("li",{class:e.normalizeClass(["relative cursor-pointer select-none py-1.5 pl-3",{"text-primary":_,"text-foreground":!_}])},[e.createElementVNode("span",{class:e.normalizeClass(["block truncate",{"font-medium":A,"font-normal":!A}])},e.toDisplayString(V),3),A?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["absolute inset-y-0 right-0 flex items-center pr-4",{"text-primary":_,"text-foreground":!_}])},[e.createVNode(e.unref(D.CheckIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]),_:2},1032,["value"]))),128)):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.unref(y)&&!e.unref(d)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(y),class:e.normalizeClass(e.unref(b))},e.toDisplayString(e.unref(m)),11,Qo)):e.createCommentVNode("",!0)]),_:1},512)]),_:1},8,["modelValue","class"]))}});function Ae(t){const{props:n}=t,o=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"h-5";case"sm":return"h-6";case"lg":return"h-10";case"xl":return"h-14";case"xxl":return"h-32";case"editable":return"h-60";case"base":default:return"h-8"}}),l=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"w-5";case"sm":return"w-6";case"lg":return"w-10";case"xl":return"w-14";case"xxl":return"w-32";case"editable":return"w-60";case"base":default:return"w-8"}}),s=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"text-tiny";case"sm":return"text-xs";case"lg":return"text-md";case"xl":return"text-2xl";case"xxl":return"text-3xl";case"editable":return"h1";case"base":default:return"text-sm"}}),a=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"w-3 h-3";case"sm":return"w-3 h-3";case"lg":return"w-5 h-5";case"xl":return"w-8 h-8";case"xxl":return"w-10 h-10";case"editable":return"w-20 h-20";case"base":default:return"w-4 h-4"}}),c=e.computed(()=>`${l.value} ${o.value} ${s.value}`);return{heightClasses:o,widthClasses:l,sizeClasses:c,iconClasses:a}}const Yo={key:1,class:"flex h-full w-full select-none items-center justify-center"},el={key:2},ae=e.defineComponent({__name:"Avatar",props:{user:{default:null},size:{default:"base"},hoverEffect:{type:Boolean,default:!1},active:{type:Boolean},noBorder:{type:Boolean},noBg:{type:Boolean}},setup(t){const n=t,{sizeClasses:o,iconClasses:l}=Ae({props:e.toRefs(n)}),s=e.computed(()=>{var m,y,d;if(!((m=n.user)!=null&&m.name.length))return;const u=n.user.name.split(" "),v=((y=u[0])==null?void 0:y[0])||"",f=((d=u[1])==null?void 0:d[0])||"";return n.size==="sm"||n.size==="xs"?v:v+f}),a=e.computed(()=>n.noBorder?"":"border-2 border-foundation"),c=e.computed(()=>n.noBg?"":"bg-primary"),r=e.computed(()=>n.hoverEffect?"hover:border-primary focus:border-primary active:scale-95":""),i=e.computed(()=>n.active?"border-primary":"");return(u,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-foreground-on-primary flex shrink-0 items-center justify-center overflow-hidden rounded-full font-semibold uppercase transition",e.unref(o),c.value,a.value,r.value,i.value])},[e.renderSlot(u.$slots,"default",{},()=>{var f;return[(f=t.user)!=null&&f.avatar?(e.openBlock(),e.createElementBlock("div",{key:0,class:"h-full w-full bg-cover bg-center bg-no-repeat",style:e.normalizeStyle({backgroundImage:`url('${t.user.avatar}')`})},null,4)):s.value?(e.openBlock(),e.createElementBlock("div",Yo,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",el,[e.createVNode(e.unref(M.UserCircleIcon),{class:e.normalizeClass(e.unref(l))},null,8,["class"])]))]}),e.renderSlot(u.$slots,"absolute-anchor")],2))}}),tl=e.defineComponent({__name:"AvatarGroup",props:{users:{default:()=>[]},overlap:{type:Boolean,default:!0},size:{default:"base"},maxCount:{default:void 0}},setup(t){const n=t,o=e.ref(null),l=e.ref(null),{hiddenItemCount:s}=ye({elementToWatchForChanges:o,itemContainer:l,trackResize:!0,trackMutations:!0}),{heightClasses:a}=Ae({props:e.toRefs(n)}),c=e.computed(()=>n.maxCount?Math.max(n.users.length-n.maxCount,0):0),r=e.computed(()=>s.value+c.value),i=e.computed(()=>n.maxCount?n.users.slice(0,n.maxCount):n.users);return(u,v)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"elementToWatchForChanges",ref:o,class:e.normalizeClass(`flex ${t.overlap?"-space-x-2":""}`)},[e.createElementVNode("div",{ref_key:"itemContainer",ref:l,class:e.normalizeClass(`flex flex-wrap overflow-hidden ${t.overlap?"-space-x-2 ":""} ${e.unref(a)}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(f,m)=>(e.openBlock(),e.createBlock(ae,{key:f.id||m,user:f,size:t.size},null,8,["user","size"]))),128))],2),r.value?(e.openBlock(),e.createBlock(ae,{key:0,size:t.size},{default:e.withCtx(()=>[e.createTextVNode(" +"+e.toDisplayString(r.value),1)]),_:1},8,["size"])):e.createCommentVNode("",!0)],2))}}),Pe=e.defineComponent({__name:"Icon",props:{loading:{type:Boolean,default:!0},size:{default:"base"}},setup(t){const n=t,o=e.computed(()=>{const l=["text-primary transition-all animate-spin"];switch(l.push(n.loading?"opacity-100":"opacity-0"),n.size){case"base":l.push("h-8 w-8");break;case"sm":l.push("h-5 w-5");break;case"lg":l.push("h-12 w-12");break}return l.join(" ")});return(l,s)=>(e.openBlock(),e.createBlock(e.unref(M.ArrowPathIcon),{class:e.normalizeClass(o.value)},null,8,["class"]))}}),nl={class:"flex flex-col items-center space-y-2"},ol={key:1,class:"relative group"},ll={class:"opacity-0 transition-all absolute group-hover:opacity-100 inset-0 flex items-end justify-center bottom-4"},sl={key:2,class:"w-full text-center text-danger text-sm"},al=e.defineComponent({__name:"AvatarEditable",props:e.mergeModels({modelValue:null,placeholder:null,name:null,rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},disabled:{type:Boolean},size:null},{editMode:{type:Boolean,local:!0}}),emits:e.mergeModels(["save","update:modelValue"],["update:editMode"]),setup(t,{expose:n,emit:o}){const l=t,s=e.defineAsyncComponent({loader:()=>Promise.resolve().then(()=>require("./AvatarEditor-0cf61750.cjs")),loadingComponent:Pe,delay:100}),{value:a,errorMessage:c}=re.useField(l.name,l.rules,{validateOnMount:l.validateOnMount,validateOnValueUpdate:l.validateOnValueUpdate,initialValue:l.modelValue||void 0}),r=e.useModel(t,"editMode",{local:!0}),i=e.computed(()=>({avatar:a.value,name:l.placeholder})),u=m=>{a.value=m,o("save",m)};return n({open:()=>r.value=!0,close:()=>r.value=!1}),(m,y)=>(e.openBlock(),e.createElementBlock("div",nl,[r.value?(e.openBlock(),e.createBlock(e.unref(s),{key:0,user:i.value,disabled:t.disabled,size:t.size,onCancel:y[0]||(y[0]=d=>r.value=!1),onSave:u},null,8,["user","disabled","size"])):(e.openBlock(),e.createElementBlock("div",ol,[e.createVNode(ae,{user:i.value,size:t.size},null,8,["user","size"]),e.createElementVNode("div",ll,[e.createVNode(F,{disabled:t.disabled,color:"secondary",onClick:y[1]||(y[1]=d=>r.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(" Change ")]),_:1},8,["disabled"])])])),e.unref(c)?(e.openBlock(),e.createElementBlock("div",sl,e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)]))}});class W extends Error{constructor(n,o){n||(n=new.target.defaultMessage),super(n,o)}}q(W,"defaultMessage","Unexpected error occurred");class je extends W{}q(je,"defaultMessage","An unexpected logic error occurred!");class Fe extends W{}q(Fe,"defaultMessage","Attempting to access an uninitialized resource");class Re extends W{}q(Re,"defaultMessage","getCurrentInstance() returned null. Method must be called at the top of a setup function");class _e extends W{}q(_e,"defaultMessage","Operation not supported in current (server or client) environment");var ue=(t=>(t.AnyAudio="audio/*",t.AnyVideo="video/*",t.AnyImage="image/*",t))(ue||{});function rl(t,n){const o=B.intersection(Object.values(ue),n);for(const a of o)switch(a){case"audio/*":if(t.type.startsWith("audio"))return!0;break;case"image/*":if(t.type.startsWith("image"))return!0;break;case"video/*":if(t.type.startsWith("video"))return!0;break}const l=B.difference(n,o),s=il(t.name);if(!s)return new Ue;for(const a of l)if(a.toLowerCase()===s.toLowerCase())return!0;return new qe}function il(t){const n=t.split(".").pop()||null;return n?`.${n}`:null}function cl(t){return t.startsWith(".")||Object.values(ue).includes(t)}function pe(t){const n=a=>parseFloat(a.toFixed(2)).toString();if(t<1024)return`${t}bytes`;const o=t/1024;if(o<1024)return`${n(o)}KB`;const l=o/1024;if(l<1024)return`${n(l)}MB`;const s=l/1024;return`${n(s)}GB`}function ul(t){const n={name:t.name,lastModified:t.lastModified,size:t.size,type:t.type};return X.md5(JSON.stringify(n))}class Ue extends W{}q(Ue,"defaultMessage","The selected file has a missing extension");class qe extends W{}q(qe,"defaultMessage","The selected file type is forbidden");var We=(t=>(t[t.Success=1]="Success",t[t.Failure=2]="Failure",t))(We||{});function dl(t){if(!t)return;const n=t.split(",").map(o=>cl(o)?o:null).filter(o=>o!==null);return n.length?n:void 0}function ml(t){const{disabled:n,accept:o,multiple:l,sizeLimit:s,countLimit:a}=t,c=e.computed(()=>dl(e.unref(o))),r=i=>{const u=[],v=c.value;for(const f of i){const m=ul(f),y=e.unref(l)?e.unref(a):1;if(!u.find(d=>d.id===m)){if(y&&u.length>=y)break;if(v){const d=rl(f,v);if(d instanceof Error){u.push({file:f,id:m,error:d});continue}}if(f.size>e.unref(s)){u.push({file:f,id:m,error:new He(`The selected file's size (${pe(f.size)}) is too big (over ${pe(e.unref(s))})`)});continue}u.push({file:f,id:m,error:null})}}return u};return{buildUploadableFiles:i=>{if(!e.unref(n||!1))return r(i)}}}class He extends W{}q(He,"defaultMessage","The selected file's size is too large");const fl=["accept","multiple"],pl=e.defineComponent({__name:"Zone",props:{accept:null,multiple:{type:Boolean},sizeLimit:{default:1024*1024*100},countLimit:null,disabled:{type:Boolean}},emits:["files-selected"],setup(t,{expose:n,emit:o}){const l=t,s=e.ref(null),a=e.ref(null),{buildUploadableFiles:c}=ml({sizeLimit:e.computed(()=>l.sizeLimit),countLimit:e.computed(()=>l.countLimit),accept:e.computed(()=>l.accept),multiple:e.computed(()=>l.multiple),disabled:e.computed(()=>l.disabled)}),r=f=>{const m=c(f);m!=null&&m.length&&o("files-selected",{files:m})},{isOverDropZone:i}=O.useDropZone(s,f=>{f!=null&&f.length&&r(f)}),u=()=>{const f=a.value;if(!f)return;const m=[...f.files||[]];f.value="",m.length&&r(m)},v=()=>{var f;(f=a.value)==null||f.click()};return n({triggerPicker:v}),(f,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"fileUploadZone",ref:s,class:"file-upload-zone"},[e.renderSlot(f.$slots,"default",{isDraggingFiles:e.unref(i),openFilePicker:v,activatorOn:{click:v}}),e.createElementVNode("input",{ref_key:"fileInput",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.multiple,onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"])),onChange:u},null,40,fl)],512))}});exports.BaseError=W;exports.BlobUploadStatus=We;exports.CommonAlert=_o;exports.CommonBadge=ie;exports.CommonLoadingBar=ce;exports.CommonLoadingIcon=Pe;exports.CommonStepsBullet=qt;exports.CommonStepsNumber=zt;exports.CommonTextLink=Ne;exports.ComposableInvokedOutOfScopeError=Re;exports.FormButton=F;exports.FormCardButton=Ht;exports.FormCheckbox=en;exports.FormClipboardInput=eo;exports.FormFileUploadZone=pl;exports.FormSelectBadges=Gn;exports.FormSelectBase=be;exports.FormSelectSourceApps=Hn;exports.FormSwitch=Qn;exports.FormTags=Jo;exports.FormTextArea=ze;exports.FormTextInput=Ie;exports.GlobalToastRenderer=ct;exports.GridListToggleValue=G;exports.HorizontalDirection=se;exports.InfiniteLoading=Oo;exports.LayoutDialog=uo;exports.LayoutDialogSection=fo;exports.LayoutDisclosure=vo;exports.LayoutGridListToggle=go;exports.LayoutMenu=bo;exports.LayoutPanel=jo;exports.LayoutTable=$o;exports.LayoutTabs=Bo;exports.LogicError=je;exports.ModifierKeys=Y;exports.SourceAppBadge=De;exports.TailwindBreakpoints=J;exports.ThrottleOrDebounce=Te;exports.ToastNotificationType=Q;exports.UninitializedResourceAccessError=Fe;exports.UniqueFileTypeSpecifier=ue;exports.UnsupportedEnvironmentError=_e;exports.UserAvatar=ae;exports.UserAvatarEditable=al;exports.UserAvatarGroup=tl;exports.ValidationHelpers=xn;exports.clientOs=le;exports.getKeyboardShortcutTitle=no;exports.keyboardClick=Se;exports.onKeyboardShortcut=oo;exports.prettyFileSize=pe;exports.useFormCheckboxModel=lo;exports.useFormSelectChildInternals=ke;exports.useOnBeforeWindowUnload=yo;exports.useResponsiveHorizontalDirectionCalculation=Oe;exports.useWindowResizeHandler=Me;exports.useWrappingContainerHiddenCount=ye;exports.writableAsyncComputed=Uo;
1
+ "use strict";var Ke=Object.defineProperty;var Ge=(t,n,o)=>n in t?Ke(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var q=(t,n,o)=>(Ge(t,typeof n!="symbol"?n+"":n,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("lodash"),M=require("@heroicons/vue/24/solid"),j=require("@heroicons/vue/24/outline"),D=require("@heroicons/vue/20/solid"),re=require("vee-validate"),he=require("nanoid"),X=require("@speckle/shared"),O=require("@vueuse/core"),L=require("@headlessui/vue"),Ve=require("vue-tippy"),Xe=require("v3-infinite-loading");const Ze={key:2,style:{margin:"0 !important",width:"0.01px"}},Qe=e.defineComponent({__name:"Button",props:{to:{type:String,required:!1,default:void 0},size:{type:String,default:"base"},fullWidth:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},color:{type:String,default:"default"},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},submit:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1},linkComponent:{type:[Object,Function],default:null},loading:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,l=e.resolveDynamicComponent("NuxtLink"),s=e.resolveDynamicComponent("RouterLink"),a=e.computed(()=>o.linkComponent?o.linkComponent:o.external?"a":B.isObjectLike(l)?l:B.isObjectLike(s)?s:"a"),c=e.computed(()=>{if(!o.to)return o.submit?"submit":"button"}),r=e.computed(()=>o.disabled||o.loading),i=e.computed(()=>o.loading?M.ArrowPathIcon:o.iconLeft),u=e.computed(()=>{const p=[];if(p.push("border-2"),r.value)p.push(o.outlined?"border-foreground-disabled":"bg-foundation-disabled border-transparent");else switch(o.color){case"invert":p.push(o.outlined?"border-foundation dark:border-foreground":"bg-foundation dark:bg-foreground border-transparent");break;case"card":p.push(o.outlined?"border-foundation-2 shadow":"bg-foundation-2 dark:bg-foundation-2 border-foundation shadow");break;case"danger":p.push(o.outlined?"border-danger":"bg-danger border-danger");break;case"secondary":p.push(o.outlined?"border-foundation":"bg-foundation border-foundation-2");break;case"warning":p.push(o.outlined?"border-warning":"bg-warning border-warning");break;case"info":p.push(o.outlined?"border-info":"bg-info border-info");break;case"success":p.push(o.outlined?"border-success":"bg-success border-success");break;case"default":default:p.push(o.outlined?"border-primary hover:border-primary-focus":"bg-primary hover:bg-primary-focus border-transparent");break}return p.join(" ")}),v=e.computed(()=>{const p=[];if(!o.text&&!o.link)if(r.value)p.push((o.outlined,"text-foreground-disabled"));else switch(o.color){case"invert":p.push(o.outlined?"text-foundation dark:text-foreground":"text-primary");break;case"card":p.push((o.outlined,"text-foreground"));break;case"danger":p.push(o.outlined?"text-danger":"text-foundation dark:text-foreground");break;case"warning":p.push(o.outlined?"text-warning":"text-foundation dark:text-foreground");break;case"info":p.push(o.outlined?"text-info":"text-foundation dark:text-foreground");break;case"success":p.push(o.outlined?"text-success":"text-foundation dark:text-foreground");break;case"secondary":p.push((o.outlined,"text-foreground hover:text-primary"));break;case"default":default:p.push(o.outlined?"text-primary hover:text-primary-focus":"text-foundation dark:text-foreground");break}else r.value?p.push("text-foreground-disabled"):o.color==="invert"?p.push("text-foundation hover:text-foundation-2 dark:text-foreground dark:hover:text-foreground"):o.color==="secondary"?p.push("text-foreground-2 hover:text-primary-focus"):o.color==="success"?p.push("text-success"):o.color==="warning"?p.push("text-warning"):o.color==="info"?p.push("text-info"):o.color==="danger"?p.push("text-danger"):p.push("text-primary hover:text-primary-focus");return p.join(" ")}),f=e.computed(()=>{const p=[];return p.push(o.rounded?"rounded-full":"rounded-md"),p.join(" ")}),m=e.computed(()=>{const p=[];if(!r.value)switch(o.color){case"invert":p.push("hover:ring-4 ring-white/50");break;case"danger":p.push("hover:ring-4 ring-danger-lighter dark:ring-danger-darker");break;case"warning":p.push("hover:ring-4 ring-warning-lighter dark:ring-warning-darker");break;case"info":p.push("hover:ring-4 ring-info-lighter dark:ring-info-darker");break;case"success":p.push("hover:ring-4 ring-success-lighter dark:ring-success-darker");break;case"default":default:p.push("hover:ring-2");break}return p.join(" ")}),y=e.computed(()=>{switch(o.size){case"xs":return"h-5 text-xs font-medium xxx-tracking-wide";case"sm":return"h-6 text-sm font-medium xxx-tracking-wide";case"lg":return"h-10 text-lg font-semibold xxx-tracking-wide";case"xl":return"h-14 text-xl font-bold xxx-tracking-wide";default:case"base":return"h-8 text-sm sm:text-base font-medium xxx-tracking-wide"}}),d=e.computed(()=>{switch(o.size){case"xs":return"px-1";case"sm":return"px-2";case"lg":return"px-4";case"xl":return"px-5";default:case"base":return"px-3"}}),b=e.computed(()=>{const p=[];return o.fullWidth&&p.push("w-full"),r.value&&p.push("cursor-not-allowed"),p.join(" ")}),h=e.computed(()=>{const p=[];return!r.value&&!o.link&&!o.text&&p.push("active:scale-[0.97]"),!r.value&&o.link&&p.push("underline decoration-transparent decoration-2 underline-offset-4 hover:decoration-inherit"),p.join(" ")}),k=e.computed(()=>{const p=o.link||o.text;return["transition inline-flex justify-center text-center items-center space-x-2 outline-none select-none",b.value,y.value,v.value,p?"":u.value,p?"":f.value,p?"":m.value,o.link?"":d.value,h.value].join(" ")}),x=e.computed(()=>{const p=[""];switch(o.loading&&p.push("animate-spin"),o.size){case"xs":p.push("h-3 w-3");break;case"sm":p.push("h-4 w-4");break;case"lg":p.push("h-6 w-6");break;case"xl":p.push("h-8 w-8");break;case"base":default:p.push("h-5 w-5");break}return p.join(" ")}),I=p=>{if(r.value){p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation();return}n("click",p)};return(p,E)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.to?a.value:"button"),{href:t.to,to:t.to,type:c.value,external:t.external,class:e.normalizeClass(k.value),disabled:r.value,role:"button",onClick:I},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:0,class:e.normalizeClass(`${x.value} ${t.hideText?"":"mr-2"}`)},null,8,["class"])):e.createCommentVNode("",!0),t.hideText?(e.openBlock(),e.createElementBlock("div",Ze,"   ")):e.renderSlot(p.$slots,"default",{key:1},()=>[e.createTextVNode("Button")],!0),t.iconRight||!t.loading?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconRight),{key:3,class:e.normalizeClass(`${x.value} ${t.hideText?"":"ml-2"}`)},null,8,["class"])):e.createCommentVNode("",!0)]),_:3},8,["href","to","type","external","class","disabled"]))}});const Ee=(t,n)=>{const o=t.__vccOpts||t;for(const[l,s]of n)o[l]=s;return o},F=Ee(Qe,[["__scopeId","data-v-79f3f7d2"]]),Ne=e.defineComponent({__name:"Link",props:{to:{type:String,required:!1,default:void 0},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},size:{type:String,default:"base"},foregroundLink:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,l=s=>{if(o.disabled){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation();return}n("click",s)};return(s,a)=>(e.openBlock(),e.createBlock(F,{link:"",to:t.to,external:t.external,disabled:t.disabled,size:t.size,"foreground-link":t.foregroundLink,"icon-left":t.iconLeft,"icon-right":t.iconRight,"hide-text":t.hideText,role:"link",onClickCapture:l},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode("Link")])]),_:3},8,["to","external","disabled","size","foreground-link","icon-left","icon-right","hide-text"]))}});var Q=(t=>(t[t.Success=0]="Success",t[t.Warning=1]="Warning",t[t.Danger=2]="Danger",t[t.Info=3]="Info",t))(Q||{});const Je={"aria-live":"assertive",class:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 mt-10 sm:items-start sm:p-6 z-50"},Ye={class:"flex w-full flex-col items-center space-y-4 sm:items-end"},et={key:0,class:"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-foundation text-foreground shadow-lg ring-1 ring-primary-muted ring-opacity-5"},tt={class:"p-4"},nt={class:"flex items-start"},ot={class:"flex-shrink-0"},lt={class:"ml-2 w-0 flex-1 flex flex-col"},st={key:0,class:"text-foreground font-bold"},at={key:1,class:"label label--light text-foreground-2"},rt={key:2,class:"flex justify-start mt-2"},it=e.createElementVNode("span",{class:"sr-only"},"Close",-1),ct=e.defineComponent({__name:"ToastRenderer",props:{notification:null},emits:["update:notification"],setup(t,{emit:n}){const o=t,l=e.computed(()=>{var c,r;return!((c=o.notification)!=null&&c.description)&&!((r=o.notification)!=null&&r.cta)}),s=()=>{n("update:notification",null)},a=c=>{var r,i,u;(u=(i=(r=o.notification)==null?void 0:r.cta)==null?void 0:i.onClick)==null||u.call(i,c),s()};return(c,r)=>(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",Ye,[e.createVNode(e.Transition,{"enter-active-class":"transform ease-out duration-300 transition","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[t.notification?(e.openBlock(),e.createElementBlock("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("div",nt,[e.createElementVNode("div",ot,[t.notification.type===e.unref(Q).Success?(e.openBlock(),e.createBlock(e.unref(j.CheckCircleIcon),{key:0,class:"h-6 w-6 text-success","aria-hidden":"true"})):t.notification.type===e.unref(Q).Danger?(e.openBlock(),e.createBlock(e.unref(j.XCircleIcon),{key:1,class:"h-6 w-6 text-danger","aria-hidden":"true"})):t.notification.type===e.unref(Q).Warning?(e.openBlock(),e.createBlock(e.unref(j.ExclamationCircleIcon),{key:2,class:"h-6 w-6 text-warning","aria-hidden":"true"})):t.notification.type===e.unref(Q).Info?(e.openBlock(),e.createBlock(e.unref(j.InformationCircleIcon),{key:3,class:"h-6 w-6 text-info","aria-hidden":"true"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",lt,[t.notification.title?(e.openBlock(),e.createElementBlock("p",st,e.toDisplayString(t.notification.title),1)):e.createCommentVNode("",!0),t.notification.description?(e.openBlock(),e.createElementBlock("p",at,e.toDisplayString(t.notification.description),1)):e.createCommentVNode("",!0),t.notification.cta?(e.openBlock(),e.createElementBlock("div",rt,[e.createVNode(Ne,{to:t.notification.cta.url,class:"label",primary:"",onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.notification.cta.title),1)]),_:1},8,["to"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["ml-4 flex flex-shrink-0",{"self-center":l.value}])},[e.createElementVNode("button",{type:"button",class:"inline-flex rounded-md bg-foundation text-foreground-2 hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",onClick:s},[it,e.createVNode(e.unref(D.XMarkIcon),{class:"h-6 w-6","aria-hidden":"true"})])],2)])])])):e.createCommentVNode("",!0)]),_:1})])]))}}),ut="Enter";function Se(t){return n=>{n.code===ut&&t(n)}}const dt=e.createElementVNode("circle",{cx:"4",cy:"4",r:"3"},null,-1),mt=[dt],ie=e.defineComponent({__name:"Badge",props:{size:null,colorClasses:null,dot:{type:Boolean},dotIconColorClasses:null,iconLeft:null,rounded:{type:Boolean},clickableIcon:{type:Boolean}},emits:["click-icon"],setup(t,{emit:n}){const o=t,l=e.computed(()=>o.colorClasses||"bg-blue-100 text-blue-800"),s=e.computed(()=>o.dotIconColorClasses||"text-blue-400"),a=e.computed(()=>{const u=["inline-flex items-center",l.value,o.size==="lg"?"px-3 py-0.5 label":"px-2.5 py-0.5 caption font-medium"];return o.rounded?(u.push("rounded"),u.push(o.size==="lg"?"px-2 py-0.5 label":"px-2.5 py-0.5 caption font-medium")):(u.push("rounded-full"),u.push(o.size==="lg"?"px-2.5 py-0.5 label":"px-2.5 py-0.5 caption font-medium")),u.join(" ")}),c=e.computed(()=>{const u=["mt-0.5 ml-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-full focus:outline-none"];return o.clickableIcon?u.push("cursor-pointer"):u.push("cursor-default"),u.join(" ")}),r=e.computed(()=>["-ml-0.5 mr-1.5 h-2 w-2",s.value].join(" ")),i=u=>{if(!o.clickableIcon){u.stopPropagation(),u.stopImmediatePropagation(),u.preventDefault();return}n("click-icon",u)};return(u,v)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(a.value)},[t.dot?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(r.value),fill:"currentColor",viewBox:"0 0 8 8"},mt,2)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode("Badge")]),t.iconLeft?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(c.value),onClick:v[0]||(v[0]=f=>i(f))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconLeft),{class:e.normalizeClass(["h-4 w-4",s.value])},null,8,["class"]))],2)):e.createCommentVNode("",!0)],2))}});let we=[];function ft(t){we=we?t:t.slice()}var J=(t=>(t[t.sm=640]="sm",t[t.md=746]="md",t[t.lg=1024]="lg",t[t.xl=1280]="xl",t[t["2xl"]=1536]="2xl",t))(J||{});function $e(t){const{props:{modelValue:n,steps:o,orientation:l,goVerticalBelow:s,nonInteractive:a,stepsPadding:c},emit:r}=t,i=e.computed(()=>(l==null?void 0:l.value)==="vertical"?"vertical":"horizontal"),u=e.computed({get:()=>B.clamp((n==null?void 0:n.value)||0,-1,o.value.length),set:h=>r("update:modelValue",B.clamp(h,0,o.value.length))}),v=h=>`${h+1}`,f=h=>h===u.value,m=h=>h<u.value,y=(h,k)=>{var I;if(a!=null&&a.value){k==null||k.preventDefault(),k==null||k.stopPropagation(),k==null||k.stopImmediatePropagation();return}u.value=h;const x=o.value[u.value];(I=x==null?void 0:x.onClick)==null||I.call(x)},d=e.computed(()=>{const h=["flex"];let k,x;return(c==null?void 0:c.value)==="xs"?(k="space-x-2",x="space-y-1"):(c==null?void 0:c.value)==="sm"?(k="space-x-4",x="space-y-1"):(k="space-x-8",x="space-y-4"),h.push("flex"),i.value==="vertical"||s!=null&&s.value?(h.push(`flex-col ${x} justify-center`),(s==null?void 0:s.value)===J.sm?h.push(`sm:flex-row sm:space-y-0 sm:justify-start sm:${k} sm:items-center`):(s==null?void 0:s.value)===J.md?h.push(`md:flex-row md:space-y-0 md:justify-start md:${k} md:items-center`):(s==null?void 0:s.value)===J.lg?h.push(`lg:flex-row lg:space-y-0 lg:justify-start lg:${k} lg:items-center`):(s==null?void 0:s.value)===J.xl&&h.push(`xl:flex-row xl:space-y-0 xl:justify-start xl:${k} xl:items-center`)):h.push(`flex-row ${k} items-center`),h.join(" ")}),b=e.computed(()=>{const h=["flex items-center"];return a!=null&&a.value||h.push("cursor-pointer"),h.join(" ")});return{value:u,isCurrentStep:f,isFinishedStep:m,switchStep:y,getStepDisplayValue:v,listClasses:d,linkClasses:b,orientation:i}}ft(["sm:space-x-8","md:space-x-8","lg:space-x-8","xl:space-x-8","sm:space-x-2","md:space-x-2","lg:space-x-2","xl:space-x-2","sm:space-x-4","md:space-x-4","lg:space-x-4","xl:space-x-4"]);const pt=["aria-label"],ht=["href","onClick"],vt={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},gt={class:"shrink-0 h-8 w-8 rounded-full bg-primary-focus text-foreground-on-primary inline-flex items-center justify-center"},yt={class:"flex flex-col"},kt={key:0,class:"label label--light text-foreground"},bt=["href","onClick"],xt={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},Ct={class:"shrink-0 h-8 w-8 rounded-full border-2 border-primary-focus inline-flex items-center justify-center"},Bt={class:"flex flex-col"},wt={key:0,class:"label label--light text-foreground"},Vt=["href","onClick"],Et={class:"flex space-x-3 items-center text-foreground-disabled normal font-medium leading-5"},Nt={class:"shrink-0 h-8 w-8 rounded-full border-2 border-foreground-disabled inline-flex items-center justify-center"},St={class:"flex flex-col"},$t={key:0,class:"label label--light"},zt=e.defineComponent({__name:"Number",props:{ariaLabel:null,orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,{isCurrentStep:l,isFinishedStep:s,switchStep:a,getStepDisplayValue:c,listClasses:r,linkClasses:i}=$e({props:e.toRefs(o),emit:n});return(u,v)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass(e.unref(r))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(f,m)=>(e.openBlock(),e.createElementBlock("li",{key:f.name},[e.unref(s)(m)?(e.openBlock(),e.createElementBlock("a",{key:0,href:f.href,class:e.normalizeClass(e.unref(i)),onClick:y=>e.unref(a)(m,y)},[e.createElementVNode("div",vt,[e.createElementVNode("div",gt,[e.createVNode(e.unref(D.CheckIcon),{class:"w-5 h-5"})]),e.createElementVNode("div",yt,[e.createElementVNode("div",null,e.toDisplayString(f.name),1),f.description?(e.openBlock(),e.createElementBlock("div",kt,e.toDisplayString(f.description),1)):e.createCommentVNode("",!0)])])],10,ht)):e.unref(l)(m)?(e.openBlock(),e.createElementBlock("a",{key:1,href:f.href,class:e.normalizeClass(e.unref(i)),"aria-current":"step",onClick:y=>e.unref(a)(m,y)},[e.createElementVNode("div",xt,[e.createElementVNode("div",Ct,e.toDisplayString(e.unref(c)(m)),1),e.createElementVNode("div",Bt,[e.createElementVNode("div",null,e.toDisplayString(f.name),1),f.description?(e.openBlock(),e.createElementBlock("div",wt,e.toDisplayString(f.description),1)):e.createCommentVNode("",!0)])])],10,bt)):(e.openBlock(),e.createElementBlock("a",{key:2,href:f.href,class:e.normalizeClass(e.unref(i)),onClick:y=>e.unref(a)(m,y)},[e.createElementVNode("div",Et,[e.createElementVNode("div",Nt,e.toDisplayString(e.unref(c)(m)),1),e.createElementVNode("div",St,[e.createElementVNode("div",null,e.toDisplayString(f.name),1),f.description?(e.openBlock(),e.createElementBlock("div",$t,e.toDisplayString(f.description),1)):e.createCommentVNode("",!0)])])],10,Vt))]))),128))],2)],8,pt))}}),It=["aria-label"],Lt=["href","onClick"],Dt={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center"},Tt={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},Mt=["href","onClick"],Ot={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},At={key:0,class:"h-3 w-3 rounded-full bg-foreground"},Pt=e.createElementVNode("span",{class:"absolute h-4 w-4 rounded-full bg-outline-2"},null,-1),jt=e.createElementVNode("span",{class:"relative block h-2 w-2 rounded-full bg-primary-focus"},null,-1),Ft=["href","onClick"],Rt={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},_t={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},Ut={key:1,class:"h-4 w-4 rounded-full bg-foreground-disabled"},qt=e.defineComponent({__name:"Bullet",props:{ariaLabel:null,basic:{type:Boolean},orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,{isCurrentStep:l,isFinishedStep:s,switchStep:a,listClasses:c,linkClasses:r}=$e({props:e.toRefs(o),emit:n}),i=e.computed(()=>{const v=["h6 font-medium leading-7"];let f;return o.stepsPadding==="xs"?f="ml-1":o.stepsPadding==="sm"?f="ml-2":f="ml-3",v.push(f),o.basic&&v.push("sr-only"),v.join(" ")}),u=e.computed(()=>{const v=[];return o.basic&&v.push("basic"),v.join(" ")});return(v,f)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass([e.unref(c),u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(m,y)=>(e.openBlock(),e.createElementBlock("li",{key:m.name},[e.unref(s)(y)?(e.openBlock(),e.createElementBlock("a",{key:0,href:m.href,class:e.normalizeClass(e.unref(r)),onClick:d=>e.unref(a)(y,d)},[e.createElementVNode("span",Dt,[t.basic?(e.openBlock(),e.createElementBlock("span",Tt)):(e.openBlock(),e.createBlock(e.unref(D.CheckCircleIcon),{key:1,class:"h-full w-full text-primary","aria-hidden":"true"}))]),e.createElementVNode("span",{class:e.normalizeClass(["text-foreground",i.value])},e.toDisplayString(m.name),3)],10,Lt)):e.unref(l)(y)?(e.openBlock(),e.createElementBlock("a",{key:1,href:m.href,class:e.normalizeClass(e.unref(r)),"aria-current":"step",onClick:d=>e.unref(a)(y,d)},[e.createElementVNode("span",Ot,[t.basic?(e.openBlock(),e.createElementBlock("span",At)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[Pt,jt],64))]),e.createElementVNode("span",{class:e.normalizeClass(["text-primary-focus",i.value])},e.toDisplayString(m.name),3)],10,Mt)):(e.openBlock(),e.createElementBlock("a",{key:2,href:m.href,class:e.normalizeClass(e.unref(r)),onClick:d=>e.unref(a)(y,d)},[e.createElementVNode("div",Rt,[t.basic?(e.openBlock(),e.createElementBlock("span",_t)):(e.openBlock(),e.createElementBlock("div",Ut))]),e.createElementVNode("p",{class:e.normalizeClass(["text-foreground-disabled",i.value])},e.toDisplayString(m.name),3)],10,Ft))]))),128))],2)],8,It))}}),Wt=["disabled"],Ht=e.defineComponent({__name:"CardButton",props:{disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue","click"],setup(t,{emit:n}){const o=t,l=e.computed(()=>{const a=["h-20 bg-foundation-2 inline-flex justify-center items-center outline-none","normal px-16 py-5 shadow rounded transition active:scale-95"];return o.disabled?a.push("bg-foundation-disabled text-foreground-2 cursor-not-allowed"):(a.push(o.modelValue?"bg-primary-focus text-foreground-on-primary":"bg-foundation text-foreground"),a.push("ring-outline-2 hover:ring-4")),a.join(" ")}),s=a=>{if(o.disabled){a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation();return}n("update:modelValue",!o.modelValue),n("click",a)};return(a,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(l.value),disabled:t.disabled,onClick:s},[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode("Text")])],10,Wt))}}),Kt={class:"relative flex items-start"},Gt={class:"flex h-6 items-center"},Xt=["id","checked","aria-describedby","name","disabled","value"],Zt={class:"ml-2 text-sm",style:{"padding-top":"2px"}},Qt=["for"],Jt={key:0,class:"text-danger ml-1"},Yt=["id"],en=e.defineComponent({inheritAttrs:!1,__name:"Checkbox",props:{name:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String,default:void 0},description:{type:String,default:void 0},inlineDescription:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},showRequired:{type:Boolean,default:!1},modelValue:{type:[String,Boolean],default:void 0},value:{type:[String,Boolean],default:!0},id:{type:String,default:void 0},hideLabel:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const n=t,o=h=>`${h}-${he.nanoid()}`,l=e.computed(()=>n.value||n.name),{checked:s,errorMessage:a,handleChange:c,value:r}=re.useField(n.name,n.rules,{validateOnMount:n.validateOnMount,type:"checkbox",checkedValue:l,initialValue:n.modelValue||void 0}),i=e.computed(()=>n.label||n.name),u=e.computed(()=>a.value?"border-danger-lighter":"border-foreground-4 "),v=e.computed(()=>n.description||a.value),f=e.computed(()=>`${n.name}-description`),m=e.computed(()=>{const h=[];return n.inlineDescription?h.push("inline ml-2"):h.push("block"),a.value?h.push("text-danger"):h.push("text-foreground-2"),h.join(" ")}),y=e.ref(o("checkbox")),d=e.computed(()=>n.id||y.value),b=h=>{n.disabled||c(h)};return e.onMounted(()=>{const h=n.modelValue,k=r.value,x=Array.isArray(h)?h.includes(n.value):h===n.value,I=Array.isArray(k)?k.includes(n.value):k===n.value;x!==I&&c(h)}),(h,k)=>(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Gt,[e.createElementVNode("input",e.mergeProps({id:d.value,checked:e.unref(s),"aria-describedby":f.value,name:t.name,disabled:t.disabled,value:l.value,type:"checkbox",class:["h-4 w-4 rounded text-primary focus:ring-primary bg-foundation disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-2",u.value]},h.$attrs,{onChange:b}),null,16,Xt)]),e.createElementVNode("div",Zt,[e.createElementVNode("label",{for:d.value,class:e.normalizeClass(["font-medium text-foreground",{"sr-only":t.hideLabel}])},[e.createElementVNode("span",null,e.toDisplayString(i.value),1),t.showRequired?(e.openBlock(),e.createElementBlock("span",Jt,"*")):e.createCommentVNode("",!0)],10,Qt),v.value?(e.openBlock(),e.createElementBlock("p",{key:0,id:f.value,class:e.normalizeClass(m.value)},e.toDisplayString(v.value),11,Yt)):e.createCommentVNode("",!0)])]))}});function ve(t){const{props:n,inputEl:o,emit:l,options:s}=t,{value:a,errorMessage:c}=re.useField(n.name,n.rules,{validateOnMount:e.unref(n.validateOnMount),validateOnValueUpdate:e.unref(n.validateOnValueUpdate),initialValue:e.unref(n.modelValue)||void 0}),r=e.computed(()=>{const p=["block label text-foreground-2 mb-2"];return e.unref(n.showLabel)||p.push("sr-only"),p.join(" ")}),i=e.computed(()=>["focus:outline-none disabled:cursor-not-allowed disabled:bg-foundation-disabled","disabled:text-disabled-muted placeholder:text-foreground-2","rounded"].join(" ")),u=e.computed(()=>{const p=["block w-full text-foreground transition-all",i.value];c.value?p.push("focus:border-danger focus:ring-danger border-2 border-danger text-danger-darker"):p.push("border-0 focus:ring-2 focus:ring-outline-2");const E=e.unref(n.color);return E==="foundation"?p.push("bg-foundation shadow-sm hover:shadow"):E==="transparent"?p.push("bg-transparent"):p.push("bg-foundation-page"),p.join(" ")}),v=e.ref(he.nanoid()),f=e.computed(()=>e.unref(n.label)||e.unref(n.name)),m=e.computed(()=>{const p=c.value;return!p||!e.unref(n.useLabelInErrors)?p:p.replace("Value",f.value)}),y=e.computed(()=>m.value&&e.unref(n.hideErrorMessage)),d=e.computed(()=>m.value||e.unref(n.help)),b=e.computed(()=>!!d.value),h=e.computed(()=>b.value?`${e.unref(n.name)}-${v.value}`:void 0),k=e.computed(()=>{const p=["mt-2 text-xs sm:text-sm"];return p.push(c.value?"text-danger":"text-foreground-2"),p.join(" ")}),x=()=>{var p;(p=o.value)==null||p.focus()},I=()=>{var p;a.value=B.isArray(a.value)?[]:"",(p=s==null?void 0:s.customClear)==null||p.call(s),l("change",{value:a.value}),l("clear")};return e.onMounted(()=>{e.unref(n.autoFocus)&&x()}),{coreInputClasses:i,coreClasses:u,title:f,value:a,helpTipId:h,helpTipClasses:k,helpTip:d,hideHelpTip:y,errorMessage:m,clear:I,focus:x,labelClasses:r}}const tn=["for"],nn={class:"relative"},on=["id","name","placeholder","disabled","aria-invalid","aria-describedby"],ln=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),sn=["id"],ze=e.defineComponent({__name:"TextArea",props:{name:null,showLabel:{type:Boolean},help:null,placeholder:null,label:null,disabled:{type:Boolean},rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},useLabelInErrors:{type:Boolean,default:!0},autoFocus:{type:Boolean},modelValue:{default:""},showClear:{type:Boolean},fullWidth:{type:Boolean},showRequired:{type:Boolean},color:{default:"page"},textareaClasses:null},emits:["update:modelValue","change","input","clear"],setup(t,{expose:n,emit:o}){const l=t,s=e.ref(null),{coreClasses:a,title:c,value:r,helpTipId:i,helpTipClasses:u,helpTip:v,errorMessage:f,labelClasses:m,clear:y,focus:d}=ve({props:e.toRefs(l),emit:o,inputEl:s}),b=e.computed(()=>{const h=["pl-2"];return l.showClear&&f.value?h.push("pr-12"):(l.showClear||f.value)&&h.push("pr-8"),h.join(" ")});return n({focus:d}),(h,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":""])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(m))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(c)),1)],10,tn),e.createElementVNode("div",nn,[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:t.name,ref_key:"inputElement",ref:s,"onUpdate:modelValue":k[0]||(k[0]=x=>e.isRef(r)?r.value=x:null),name:t.name,class:[e.unref(a),b.value,t.textareaClasses||"","min-h-[3rem] simple-scrollbar text-sm"],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(f)?"true":"false","aria-describedby":e.unref(i)},h.$attrs,{onChange:k[1]||(k[1]=x=>h.$emit("change",{event:x,value:e.unref(r)})),onInput:k[2]||(k[2]=x=>h.$emit("input",{event:x,value:e.unref(r)}))}),null,16,on),[[e.vModelText,e.unref(r)]]),t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute top-2 right-0 flex items-center pr-2 cursor-pointer",onClick:k[3]||(k[3]=(...x)=>e.unref(y)&&e.unref(y)(...x)),onKeydown:k[4]||(k[4]=(...x)=>e.unref(y)&&e.unref(y)(...x))},[ln,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-start mt-2",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(D.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(f)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 mt-0.5 text-4xl right-0 flex items-start text-danger opacity-50",[t.showClear?"pr-8":"pr-2"]])}," * ",2)):e.createCommentVNode("",!0)]),e.unref(i)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(i),class:e.normalizeClass(e.unref(u))},e.toDisplayString(e.unref(v)),11,sn)):e.createCommentVNode("",!0)],2))}}),an=["for"],rn={class:"relative"},cn={key:0,class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},un=["id","type","name","placeholder","disabled","aria-invalid","aria-describedby"],dn=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),mn=["id"],Ie=e.defineComponent({inheritAttrs:!1,__name:"TextInput",props:{type:{type:String,default:"text"},name:{type:String,required:!0},showLabel:{type:Boolean,required:!1},help:{type:String,default:void 0},placeholder:{type:String,default:void 0},label:{type:String,default:void 0},showRequired:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},customIcon:{type:[Object,Function],default:void 0},autoFocus:{type:Boolean,default:!1},modelValue:{type:String,default:""},size:{type:String,default:"base"},showClear:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},inputClasses:{type:String,default:null},hideErrorMessage:{type:Boolean,default:!1},wrapperClasses:{type:String,default:()=>""},color:{type:String,default:"page"}},emits:["update:modelValue","change","input","clear","focus","blur"],setup(t,{expose:n,emit:o}){const l=t,s=e.useSlots(),a=e.ref(null),{coreClasses:c,title:r,value:i,helpTipId:u,helpTipClasses:v,helpTip:f,hideHelpTip:m,errorMessage:y,clear:d,focus:b,labelClasses:h}=ve({props:e.toRefs(l),emit:o,inputEl:a}),k=e.computed(()=>{const E=["h-5 w-5"];return y.value?E.push("text-danger"):E.push("text-foreground-2"),E.join(" ")}),x=e.computed(()=>["email","password"].includes(l.type)||l.customIcon),I=e.computed(()=>{const E=[];return x.value?E.push("pl-8"):E.push("pl-2"),s["input-right"]||(y.value||l.showClear)&&(y.value&&l.showClear?E.push("pr-12"):E.push("pr-8")),E.join(" ")}),p=e.computed(()=>{switch(l.size){case"sm":return"h-6 text-sm";case"lg":return"h-10";case"xl":return"h-14";case"base":default:return"h-8 text-sm"}});return n({focus:b}),(E,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":"",t.wrapperClasses])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(h))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)),1)],10,an),e.createElementVNode("div",rn,[x.value?(e.openBlock(),e.createElementBlock("div",cn,[t.customIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.customIcon),{key:0,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):t.type==="email"?(e.openBlock(),e.createBlock(e.unref(D.EnvelopeIcon),{key:1,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):t.type==="password"?(e.openBlock(),e.createBlock(e.unref(D.KeyIcon),{key:2,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.name,ref_key:"inputElement",ref:a,"onUpdate:modelValue":N[0]||(N[0]=S=>e.isRef(i)?i.value=S:null),type:t.type,name:t.name,class:[e.unref(c),I.value,p.value,t.inputClasses||""],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(y)?"true":"false","aria-describedby":e.unref(u),role:"textbox"},E.$attrs,{onChange:N[1]||(N[1]=S=>E.$emit("change",{event:S,value:e.unref(i)})),onInput:N[2]||(N[2]=S=>E.$emit("input",{event:S,value:e.unref(i)})),onFocus:N[3]||(N[3]=S=>E.$emit("focus")),onBlur:N[4]||(N[4]=S=>E.$emit("blur"))}),null,16,un),[[e.vModelDynamic,e.unref(i)]]),e.renderSlot(E.$slots,"input-right",{},()=>[t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer",onClick:N[5]||(N[5]=(...S)=>e.unref(d)&&e.unref(d)(...S)),onKeydown:N[6]||(N[6]=(...S)=>e.unref(d)&&e.unref(d)(...S))},[dn,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-center",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(D.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center text-danger opacity-50",[t.showClear?"pr-8":"pr-2"]])}," * ",2)):e.createCommentVNode("",!0)])]),e.unref(u)&&!e.unref(m)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(u),class:e.normalizeClass(e.unref(v))},e.toDisplayString(e.unref(f)),11,mn)):e.createCommentVNode("",!0)],2))}}),Le=/^https?:\/\//,ge=/^[\w-_.+]+@[\w-_.+]+$/,fn=t=>(t||"").match(ge)?!0:"Value should be a valid e-mail address",pn=t=>(t||"").split(",").map(l=>l.trim()).every(l=>l.match(ge))||"Value should be one or multiple comma-delimited e-mail addresses",hn=t=>(B.isString(t)&&(t=t.trim()),t?!0:"Value is required"),vn=(t,n)=>(o,l)=>o===l.form[t]?!0:`Value must be the same as in field '${n||t}'`,gn=t=>n=>{const{minLength:o,maxLength:l}=t;return n=X.isNullOrUndefined(n)?"":n,B.isString(n)?!B.isUndefined(o)&&n.length<o?`Value needs to be at least ${o} characters long`:!B.isUndefined(l)&&n.length>l?`Value needs to be no more than ${l} characters long`:!0:"Value should be a text string"},yn=t=>n=>{const{match:o,message:l}=t;return B.isString(n)?o?B.isString(o)?n.includes(o)?!0:l:o.test(n)?!0:l:!0:"Value should be a text string"},kn=t=>Le.test(t)?!0:"Value is not a valid URL",bn=t=>Array.isArray(t)&&t.length>0?!0:"Value should have at least a single item selected",xn=Object.freeze(Object.defineProperty({__proto__:null,VALID_EMAIL:ge,VALID_HTTP_URL:Le,isEmail:fn,isItemSelected:bn,isOneOrMultipleEmails:pn,isRequired:hn,isSameAs:vn,isStringOfLength:gn,isUrl:kn,stringContains:yn},Symbol.toStringTag,{value:"Module"}));function ye(t){const{skipCalculation:n,elementToWatchForChanges:o,itemContainer:l,trackResize:s=!1,trackMutations:a=!0}=t||{},c=e.ref(0),r=()=>{const i=l.value;if(n!=null&&n.value||!i)return;const u=i.children;let v=0,f=0,m;for(const y of u){const d=y.offsetTop;B.isUndefined(m)?(m=d,v+=1):d===m&&(v+=1),f+=1}c.value=f-v};return s&&O.useResizeObserver(o,r),a&&O.useMutationObserver(o,r,{childList:!0,subtree:!0}),{hiddenItemCount:c}}function ke(t){const{props:n,emit:o,dynamicVisibility:l}=t;let s;if(l){const{elementToWatchForChanges:u,itemContainer:v}=l;s=ye({skipCalculation:e.computed(()=>{var m;return!((m=n.multiple)!=null&&m.value)}),elementToWatchForChanges:u,itemContainer:v}).hiddenItemCount}else s=e.ref(0);const a=e.computed({get:()=>{var v,f;const u=(v=n.modelValue)==null?void 0:v.value;return(f=n.multiple)!=null&&f.value?B.isArray(u)?u:[]:B.isArray(u)?void 0:u},set:u=>{var v,f,m;if((v=n.multiple)!=null&&v.value&&!B.isArray(u)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!((f=n.multiple)!=null&&f.value)&&B.isArray(u)){console.warn("Attempting to set array value in selector w/ multiple=false");return}o("update:modelValue",(m=n.multiple)!=null&&m.value?u||[]:u)}}),c=u=>B.isArray(u);return{selectedValue:a,hiddenSelectedItemCount:s,isArrayValue:c,isMultiItemArrayValue:u=>B.isArray(u)&&u.length>1,firstItem:u=>c(u)?u[0]:u}}const Cn=t=>(e.pushScopeId("data-v-60cf597b"),t=t(),e.popScopeId(),t),Bn=Cn(()=>e.createElementVNode("div",{class:"swoosher relative top-0 bg-blue-500/50"},null,-1)),wn=[Bn],Vn=e.defineComponent({__name:"Bar",props:{loading:{type:Boolean}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full h-1 bg-blue-500/30 text-xs text-foreground-on-primary overflow-hidden rounded-xl",t.loading?"opacity-100":"opacity-0"])},wn,2))}});const ce=Ee(Vn,[["__scopeId","data-v-60cf597b"]]),En={class:"flex items-center justify-between w-full"},Nn={class:"block truncate grow text-left text-xs sm:text-sm"},Sn={class:"pointer-events-none shrink-0 ml-1 flex items-center space-x-2"},$n={key:1,class:"text-4xl text-danger opacity-50 h-4 w-4 leading-6"},zn=["disabled"],In={key:0,class:"flex flex-col mx-1 mb-1"},Ln=e.createElementVNode("span",{class:"sr-only label text-foreground"},"Search",-1),Dn={class:"relative"},Tn={class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},Mn=["placeholder"],On={key:0,class:"px-1"},An={key:1},Pn=e.createElementVNode("div",{class:"text-foreground-2 text-center"},"Nothing found 🤷‍♂️",-1),jn={class:e.normalizeClass(["block truncate"])},Fn=["id"],be=e.defineComponent({__name:"Base",props:{multiple:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},modelValue:{type:[Object,Array,String],default:void 0},search:{type:Boolean,default:!1},filterPredicate:{type:Function,default:void 0},disabledItemPredicate:{type:Function,default:void 0},getSearchResults:{type:Function,default:void 0},searchPlaceholder:{type:String,default:"Search"},label:{type:String,required:!0},placeholder:{type:String},showLabel:{type:Boolean,default:!1},name:{type:String,required:!0},by:{type:String,required:!1},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"base"},hideCheckmarks:{type:Boolean,default:!1},allowUnset:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},help:{type:String,default:void 0},fixedHeight:{type:Boolean,default:!1},fullyControlValue:{type:Boolean,default:!1},showRequired:{type:Boolean,default:!1},mountMenuOnBody:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{expose:n,emit:o}){const l=t,s=g=>B.isObjectLike(g),{value:a,errorMessage:c}=re.useField(l.name,l.rules,{validateOnMount:l.validateOnMount,validateOnValueUpdate:l.validateOnValueUpdate,initialValue:l.modelValue}),r=O.useMounted(),i=e.ref(null),u=e.ref(null),v=e.ref(""),f=e.ref([]),m=e.ref(!1),y=e.ref(1),d=e.ref(he.nanoid()),b=O.useElementBounding(e.computed(()=>{var g;return(g=u.value)==null?void 0:g.el}),{windowResize:!0,windowScroll:!0,immediate:!0}),h=e.computed(()=>e.unref(l.label)||e.unref(l.name)),k=e.computed(()=>{const g=c.value;return!g||!e.unref(l.useLabelInErrors)?g:g.replace("Value",h.value)}),x=e.computed(()=>k.value||e.unref(l.help)),I=e.computed(()=>!!x.value),p=e.computed(()=>I.value?`${e.unref(l.name)}-${d.value}`:void 0),E=e.computed(()=>c.value?"text-danger":"text-foreground-2"),N=e.computed(()=>l.buttonStyle!=="simple"&&l.clearable&&!l.disabled),S=e.computed(()=>{const g=["relative flex group"];return c.value?(g.push("hover:shadow rounded-md"),g.push("text-danger-darker focus:border-danger focus:ring-danger"),l.buttonStyle!=="simple"&&g.push("outline outline-2 outline-danger")):l.buttonStyle!=="simple"&&(g.push("hover:shadow rounded-md"),g.push("outline outline-2 outline-primary-muted")),l.fixedHeight&&g.push("h-8"),g.join(" ")}),ne=e.computed(()=>{const g=[];return l.buttonStyle!=="simple"&&g.push(K.value?"bg-foundation-disabled text-foreground-disabled":""),K.value&&g.push("cursor-not-allowed"),g.join(" ")}),H=e.computed(()=>{const g=["relative z-[1]","flex items-center justify-center text-center shrink-0","rounded-r-md overflow-hidden transition-all","text-foreground",oe.value?`w-6 ${ne.value}`:"w-0"];return K.value||(g.push("hover:bg-primary hover:text-foreground-on-primary dark:text-foreground-on-primary"),l.buttonStyle==="tinted"?g.push("bg-outline-3"):g.push("bg-primary-muted")),g.join(" ")}),de=e.computed(()=>{const g=["relative z-[2]","normal rounded-md cursor-pointer transition truncate flex-1","flex items-center",ne.value];return l.buttonStyle!=="simple"&&(g.push("py-2 px-3"),K.value||(l.buttonStyle==="tinted"?g.push("bg-foundation-page text-foreground"):g.push("bg-foundation text-foreground"))),N.value&&oe.value&&g.push("rounded-r-none"),g.join(" ")}),Z=e.computed(()=>!!(l.search&&(l.filterPredicate||l.getSearchResults))),R=e.computed(()=>Z.value&&l.getSearchResults),K=e.computed(()=>l.disabled||!l.items.length&&!R.value),T=e.computed({get:()=>{const g=a.value;return l.multiple?B.isArray(g)?g:[]:B.isArray(g)?void 0:g},set:g=>{if(l.multiple&&!B.isArray(g)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!l.multiple&&B.isArray(g)){console.warn("Attempting to set array value in selector w/ multiple=false");return}let z;if(l.multiple)z=g||[];else{const $=a.value;z=l.allowUnset&&$&&g&&w($)===w(g)?void 0:g}l.fullyControlValue?o("update:modelValue",z):a.value=z,y.value+=1}}),oe=e.computed(()=>l.multiple&&B.isArray(T.value)?T.value.length!==0:!!T.value),ee=()=>{l.multiple?T.value=[]:T.value=void 0},me=e.computed(()=>{const g=v.value;return!Z.value||!(g!=null&&g.length)?f.value:l.filterPredicate?f.value.filter(z=>{var $;return(($=l.filterPredicate)==null?void 0:$.call(l,z,g))||!1}):f.value}),fe=e.computed(()=>{const g=["rounded-md bg-foundation-2 py-1 label label--light outline outline-2 outline-primary-muted focus:outline-none shadow mt-1 "];return l.mountMenuOnBody?g.push("fixed z-50"):g.push("absolute top-[100%] w-full z-10"),g.join(" ")}),te=e.computed(()=>{const g={};if(l.mountMenuOnBody){const z=b.top.value,$=b.left.value,P=b.width.value,U=b.height.value;g.top=`${z+U}px`,g.left=`${$}px`,g.width=`${P}px`}return g}),C=g=>JSON.stringify(g),w=g=>s(g)?g[l.by||"id"]:g,V=async()=>{if(!(!R.value||!l.getSearchResults)){m.value=!0;try{f.value=await l.getSearchResults(v.value)}finally{m.value=!1}}},A=B.debounce(V,1e3),_=g=>{const{active:z,disabled:$}=g||{},{hideCheckmarks:P}=l,U=["relative transition cursor-pointer select-none py-1.5 pl-3",P?"":"pr-9"];return $?U.push("opacity-50 cursor-not-allowed"):U.push(z?"text-primary":"text-foreground"),U.join(" ")};return e.watch(()=>l.items,g=>{f.value=g.slice()},{immediate:!0}),e.watch(v,()=>{R.value&&A()}),e.onMounted(()=>{R.value&&!l.items.length&&V()}),n({triggerSearch:V}),(g,z)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createBlock(e.unref(L.Listbox),{key:y.value,modelValue:T.value,"onUpdate:modelValue":z[4]||(z[4]=$=>T.value=$),name:t.name,multiple:t.multiple,by:t.by,disabled:K.value,as:"div"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.ListboxLabel),{class:e.normalizeClass(["block label text-foreground-2 mb-2",{"sr-only":!t.showLabel}])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(S.value)},[e.createVNode(e.unref(L.ListboxButton),{ref_key:"listboxButton",ref:u,class:e.normalizeClass(de.value)},{default:e.withCtx(({open:$})=>[e.createElementVNode("div",En,[e.createElementVNode("div",Nn,[!T.value||e.unref(B.isArray)(T.value)&&!T.value.length?e.renderSlot(g.$slots,"nothing-selected",{key:0},()=>[e.createTextVNode(e.toDisplayString(t.placeholder?t.placeholder:t.label),1)]):e.renderSlot(g.$slots,"something-selected",{key:1,value:T.value},()=>[e.createTextVNode(e.toDisplayString(C(T.value)),1)])]),e.createElementVNode("div",Sn,[k.value?(e.openBlock(),e.createBlock(e.unref(M.ExclamationCircleIcon),{key:0,class:"h-4 w-4 text-danger","aria-hidden":"true"})):t.showRequired?(e.openBlock(),e.createElementBlock("div",$n," * ")):e.createCommentVNode("",!0),$?(e.openBlock(),e.createBlock(e.unref(M.ChevronUpIcon),{key:2,class:"h-4 w-4 text-foreground","aria-hidden":"true"})):(e.openBlock(),e.createBlock(e.unref(M.ChevronDownIcon),{key:3,class:"h-4 w-4 text-foreground","aria-hidden":"true"}))])])]),_:3},8,["class"]),N.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(H.value),disabled:t.disabled,onClick:z[0]||(z[0]=$=>ee())},[e.createVNode(e.unref(M.XMarkIcon),{class:"w-3 h-3"})],10,zn)),[[e.unref(Ve.directive),"Clear"]]):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.Transition,{key:1,"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:!t.mountMenuOnBody},[e.createVNode(e.unref(L.ListboxOptions),{class:e.normalizeClass(fe.value),style:e.normalizeStyle(te.value),onFocus:z[3]||(z[3]=$=>{var P;return(P=i.value)==null?void 0:P.focus()})},{default:e.withCtx(()=>[Z.value?(e.openBlock(),e.createElementBlock("label",In,[Ln,e.createElementVNode("div",Dn,[e.createElementVNode("div",Tn,[e.createVNode(e.unref(M.MagnifyingGlassIcon),{class:"h-5 w-5 text-foreground"})]),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:i,"onUpdate:modelValue":z[1]||(z[1]=$=>v.value=$),type:"text",class:"pl-9 w-full border-0 bg-foundation-page rounded placeholder:font-normal normal placeholder:text-foreground-2 focus:outline-none focus:ring-1 focus:border-outline-1 focus:ring-outline-1",placeholder:t.searchPlaceholder,onKeydown:z[2]||(z[2]=e.withModifiers(()=>{},["stop"]))},null,40,Mn),[[e.vModelText,v.value]])])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-auto simple-scrollbar",[Z.value?"max-h-52":"max-h-40"]])},[R.value&&m.value?(e.openBlock(),e.createElementBlock("div",On,[e.createVNode(ce,{loading:!0})])):R.value&&!f.value.length?(e.openBlock(),e.createElementBlock("div",An,[e.renderSlot(g.$slots,"nothing-found",{},()=>[Pn])])):e.createCommentVNode("",!0),!R.value||!m.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(me.value,$=>{var P;return e.openBlock(),e.createBlock(e.unref(L.ListboxOption),{key:w($),value:$,disabled:((P=t.disabledItemPredicate)==null?void 0:P.call(t,$))||!1},{default:e.withCtx(({active:U,selected:xe})=>{var Ce,Be;return[e.createElementVNode("li",{class:e.normalizeClass(_({active:U,disabled:((Ce=t.disabledItemPredicate)==null?void 0:Ce.call(t,$))||!1}))},[e.createElementVNode("span",jn,[e.renderSlot(g.$slots,"option",{item:$,active:U,selected:xe,disabled:((Be=t.disabledItemPredicate)==null?void 0:Be.call(t,$))||!1},()=>[e.createTextVNode(e.toDisplayString(C($)),1)])]),!t.hideCheckmarks&&xe?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([U?"text-primary":"text-foreground","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(e.unref(M.CheckIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]}),_:2},1032,["value","disabled"])}),128)):e.createCommentVNode("",!0)],2)]),_:3},8,["class","style"])],8,["disabled"]))]),_:3})):e.createCommentVNode("",!0)],2)]),_:3},8,["modelValue","name","multiple","by","disabled"])),p.value?(e.openBlock(),e.createElementBlock("p",{key:0,id:p.value,class:e.normalizeClass(["mt-2 text-xs sm:text-sm",E.value])},e.toDisplayString(x.value),11,Fn)):e.createCommentVNode("",!0)]))}}),De=e.defineComponent({__name:"SourceAppBadge",props:{sourceApp:null},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(ie,{"color-classes":"text-foreground-on-primary",rounded:"",style:e.normalizeStyle({backgroundColor:t.sourceApp.bgColor})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.sourceApp.short),1)]),_:1},8,["style"]))}}),Rn={key:0,class:"text-foreground-2 normal"},_n={key:1,class:"flex items-center"},Un={class:"truncate"},qn={class:"flex items-center"},Wn={class:"truncate"},Hn=e.defineComponent({__name:"SourceApps",props:{multiple:{type:Boolean,default:!1},modelValue:{type:[Object,Array],default:void 0},search:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Search apps"},selectorPlaceholder:{type:String,default:void 0},label:{type:String,required:!0},showLabel:{type:Boolean,default:!1},name:{type:String,default:void 0},items:{type:Array,default:void 0},clearable:{type:Boolean},help:{type:String}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,l=e.ref(null),s=e.ref(null),{selectedValue:a,hiddenSelectedItemCount:c,isMultiItemArrayValue:r,firstItem:i}=ke({props:e.toRefs(o),emit:n,dynamicVisibility:{elementToWatchForChanges:l,itemContainer:s}}),u=(v,f)=>v.name.toLocaleLowerCase().includes(f.toLocaleLowerCase());return(v,f)=>(e.openBlock(),e.createBlock(be,{modelValue:e.unref(a),"onUpdate:modelValue":f[0]||(f[0]=m=>e.isRef(a)?a.value=m:null),multiple:t.multiple,items:t.items??e.unref(X.SourceApps),search:t.search,"search-placeholder":t.searchPlaceholder,label:t.label,"show-label":t.showLabel,name:t.name||"sourceApps","filter-predicate":u,clearable:t.clearable,help:t.help,by:"name"},{"nothing-selected":e.withCtx(()=>[t.selectorPlaceholder?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.selectorPlaceholder),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.multiple?"Select apps":"Select an app"),1)],64))]),"something-selected":e.withCtx(({value:m})=>[e.unref(r)(m)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"elementToWatchForChanges",ref:l,class:"flex items-center space-x-0.5 h-5"},[e.createElementVNode("div",{ref_key:"itemContainer",ref:s,class:"flex flex-wrap overflow-hidden space-x-0.5 h-5"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m,y=>(e.openBlock(),e.createBlock(De,{key:y.name,"source-app":y},null,8,["source-app"]))),128))],512),e.unref(c)>0?(e.openBlock(),e.createElementBlock("div",Rn," +"+e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)],512)):(e.openBlock(),e.createElementBlock("div",_n,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:e.unref(i)(m).bgColor})},null,4),e.createElementVNode("span",Un,e.toDisplayString(e.unref(i)(m).name),1)]))]),option:e.withCtx(({item:m})=>[e.createElementVNode("div",qn,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:m.bgColor})},null,4),e.createElementVNode("span",Wn,e.toDisplayString(m.name),1)])]),_:1},8,["modelValue","multiple","items","search","search-placeholder","label","show-label","name","clearable","help"]))}}),Kn={class:"flex flex-wrap gap-1.5 text-xs"},Gn=e.defineComponent({__name:"Badges",props:{items:null,label:null,name:null,help:null,modelValue:null,multiple:{type:Boolean},rules:null,by:null},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,{selectedValue:l,isArrayValue:s}=ke({props:e.toRefs(o),emit:n}),a=c=>{s(l.value)?l.value=l.value.filter(r=>r.id!==c.id):l.value=void 0};return(c,r)=>(e.openBlock(),e.createBlock(be,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=i=>e.isRef(l)?l.value=i:null),multiple:t.multiple,items:t.items,label:t.label,name:t.name,help:t.help,rules:t.rules,by:t.by},{"something-selected":e.withCtx(({value:i})=>[e.createElementVNode("ul",Kn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s)(i)?i:[i],u=>(e.openBlock(),e.createElementBlock("li",{key:u[t.by]},[e.createVNode(ie,{size:"lg","clickable-icon":!0,"icon-left":e.unref(M.XMarkIcon),onClickIcon:e.withModifiers(v=>a(u),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.text),1)]),_:2},1032,["icon-left","onClickIcon"])]))),128))])]),option:e.withCtx(({item:i})=>[e.createTextVNode(e.toDisplayString(i.text),1)]),_:1},8,["modelValue","multiple","items","label","name","help","rules","by"]))}}),Xn={class:"flex items-center"},Zn={class:"absolute inset-0 flex items-center gap-2 px-1 text-white"},Qn=e.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue");return(o,l)=>(e.openBlock(),e.createElementBlock("div",Xn,[e.createVNode(e.unref(L.Switch),{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=s=>n.value=s),class:e.normalizeClass(["relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",{"bg-primary":n.value,"bg-primary-muted":!n.value}])},{default:e.withCtx(()=>[e.createElementVNode("div",Zn,[e.createVNode(e.unref(M.CheckIcon),{class:"h-5 w-5 drop-shadow-md"}),e.createVNode(e.unref(M.XMarkIcon),{class:"h-5 w-5 drop-shadow-md"})]),e.createElementVNode("span",{class:e.normalizeClass(["scale-95 pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200",{"translate-x-5":n.value,"translate-x-0":!n.value}])},null,2)]),_:1},8,["modelValue","class"])]))}}),Jn={class:"relative group bg-foundation-page p-2 rounded-lg pr-12"},Yn={class:"absolute inset-0 right-2 flex justify-end items-center"},eo=e.defineComponent({__name:"ClipboardInput",props:{value:null,isMultiline:{type:Boolean,default:!1},rows:null},emits:["copy"],setup(t,{emit:n}){const o=t,{copy:l}=O.useClipboard({legacy:!0}),s=async()=>{o.value&&(await l(o.value),n("copy",o.value))};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Jn,[t.isMultiline?(e.openBlock(),e.createBlock(e.unref(ze),{key:0,color:"transparent",name:"contentArea",readonly:"","model-value":t.value,class:"relative z-10 text-sm text-foreground font-mono",rows:t.rows},null,8,["model-value","rows"])):(e.openBlock(),e.createBlock(e.unref(Ie),{key:1,color:"transparent",name:"contentInput",readonly:"","model-value":t.value,class:"relative z-10 text-sm text-foreground font-mono"},null,8,["model-value"])),e.createElementVNode("div",Yn,[e.createVNode(e.unref(F),{color:"invert",size:"sm","icon-left":e.unref(j.ClipboardDocumentIcon),"hide-text":"",onClick:s},null,8,["icon-left"])])]))}});var Y=(t=>(t.CtrlOrCmd="cmd-or-ctrl",t.AltOrOpt="alt-or-opt",t.Shift="shift",t))(Y||{});const le=X.getClientOperatingSystem(),to={["cmd-or-ctrl"]:le===X.OperatingSystem.Mac?"Cmd":"Ctrl",["alt-or-opt"]:le===X.OperatingSystem.Mac?"Opt":"Alt",shift:"Shift"};function no(t){const n=o=>Object.values(Y).includes(o);return t.map(o=>n(o)?to[o]:o).join("+")}function oo(t,...n){O.onKeyDown(n[0],o=>{const l=o.getModifierState("Alt"),s=le===X.OperatingSystem.Mac?o.getModifierState("Meta"):o.getModifierState("Control"),a=o.getModifierState("Shift");for(const c of t)switch(c){case Y.CtrlOrCmd:if(!s)return;break;case Y.AltOrOpt:if(!l)return;break;case Y.Shift:if(!a)return;break}n[1](o)},n[2])}function lo(t){const n=(t==null?void 0:t.model)||e.ref(),o=e.computed({get:()=>!!n.value,set:l=>n.value=l?!0:void 0});return{model:n,isChecked:o}}const so=e.createElementVNode("div",{class:"fixed inset-0 bg-neutral-100/70 dark:bg-neutral-900/70 transition-opacity backdrop-blur-xs"},null,-1),ao={class:"fixed inset-0 z-10 h-screen w-screen"},ro={class:"flex justify-center items-center h-full w-full p-4 sm:p-0"},io={key:0,class:"flex items-center justify-start rounded-t-lg shrink-0 min-h-[4rem] py-2 px-4 sm:px-8 truncate text-xl sm:text-2xl font-bold"},co={class:"w-full truncate pr-12"},uo=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},maxWidth:null,hideCloser:{type:Boolean},preventCloseOnClickOutside:{type:Boolean},title:null,buttons:null,onSubmit:{type:Function}},emits:["update:open","fully-closed"],setup(t,{emit:n}){const o=t,l=e.useSlots(),s=e.ref(!1),a=e.ref(!0),c=e.computed(()=>!!o.onSubmit),r=e.computed(()=>o.buttons||l.buttons),i=e.computed(()=>o.title||l.header),u=e.computed({get:()=>o.open,set:d=>n("update:open",d)}),v=e.computed(()=>{switch(o.maxWidth){case"sm":return 0;case"md":return 1;case"lg":return 2;case"xl":return 3;default:return 1e4}}),f=e.computed(()=>{const d=["w-full","sm:w-full sm:max-w-xl"];return v.value>=1&&d.push("md:max-w-2xl"),v.value>=2&&d.push("lg:max-w-4xl"),v.value>=3&&d.push("xl:max-w-6xl"),v.value>=4&&d.push("2xl:max-w-7xl"),d.join(" ")}),m=()=>{o.preventCloseOnClickOutside||(u.value=!1)},y=B.throttle(d=>{const b=d.target,{scrollTop:h,offsetHeight:k,scrollHeight:x}=b;s.value=h>0,a.value=h+k>=x},60);return(d,b)=>(e.openBlock(),e.createBlock(e.unref(L.TransitionRoot),{as:"template",show:u.value},{default:e.withCtx(()=>[e.createVNode(e.unref(L.Dialog),{as:"div",class:"relative z-40",onClose:m},{default:e.withCtx(()=>[e.createVNode(e.unref(L.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:e.withCtx(()=>[so]),_:1}),e.createElementVNode("div",ao,[e.createElementVNode("div",ro,[e.createVNode(e.unref(L.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",onAfterLeave:b[2]||(b[2]=h=>d.$emit("fully-closed"))},{default:e.withCtx(()=>[e.createVNode(e.unref(L.DialogPanel),{class:e.normalizeClass(["transform rounded-lg text-foreground overflow-hidden bg-foundation text-left shadow-xl transition-all flex flex-col max-h-[90vh]",f.value]),as:c.value?"form":"div",onSubmit:e.withModifiers(t.onSubmit,["prevent"])},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(s.value&&"relative z-10 shadow-lg")},[i.value?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("div",co,[e.createTextVNode(e.toDisplayString(t.title)+" ",1),e.renderSlot(d.$slots,"header")])])):e.createCommentVNode("",!0)],2),t.hideCloser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["absolute z-20 right-4 bg-foundation rounded-full p-1",i.value?"top-4":"top-3"]),onClick:b[0]||(b[0]=h=>u.value=!1)},[e.createVNode(e.unref(j.XMarkIcon),{class:"h-6 w-6"})],2)),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 simple-scrollbar overflow-y-auto bg-white dark:bg-foundation",i.value?"p-4 sm:py-6 sm:px-8":"p-10"]),onScroll:b[1]||(b[1]=(...h)=>e.unref(y)&&e.unref(y)(...h))},[e.renderSlot(d.$slots,"default",{},()=>[e.createTextVNode("Put your content here!")])],34),r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex px-4 py-2 sm:py-4 sm:px-6 gap-2 shrink-0",!a.value&&"shadow-t"])},[t.buttons?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.buttons,(h,k)=>(e.openBlock(),e.createBlock(e.unref(F),e.mergeProps({key:k},h.props,{disabled:h.disabled,type:h.submit&&"submit",onClick:h.onClick}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.text),1)]),_:2},1040,["disabled","type","onClick"]))),128)):e.renderSlot(d.$slots,"buttons",{key:1})],2)):e.createCommentVNode("",!0)]),_:3},8,["class","as","onSubmit"])]),_:3})])])]),_:3})]),_:3},8,["show"]))}}),mo={class:"h-4 sm:h-5 h-4 sm:w-5 empty:h-0 empty:w-0"},fo=e.defineComponent({__name:"DialogSection",props:{title:String,borderT:Boolean,borderB:Boolean,allowOverflow:Boolean,titleColor:{type:String,default:"default"},button:Object,alwaysOpen:Boolean},setup(t){const n=t,o=e.ref(null),l=e.ref(0),s=e.ref(!1),a=e.computed(()=>{const i=[];return!n.button&&!n.alwaysOpen&&i.push("cursor-pointer","hover:bg-foundation"),s.value&&i.push("bg-foundation"),i}),c=e.computed(()=>{switch(n.titleColor){case"danger":return"text-danger";case"warning":return"text-warning";case"success":return"text-success";case"secondary":return"text-secondary";case"info":return"text-info";default:return"text-foreground"}}),r=()=>{var i;s.value=!s.value,s.value&&(l.value=(((i=e.unref(o))==null?void 0:i.scrollHeight)||0)+64)};return(i,u)=>{var v,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col border-primary-muted",{"border-t":t.borderT,"border-b":t.borderB,"relative z-10":s.value}])},[e.createElementVNode("div",e.mergeProps({class:["flex justify-between items-center gap-4 sm:gap-8 py-3 sm:py-4 px-2",a.value],tabindex:"0"},e.toHandlers(!t.button&&!t.alwaysOpen?{click:r,keypress:e.unref(Se)(r)}:{},!0)),[e.createElementVNode("div",{class:e.normalizeClass(["text-sm sm:text-base font-bold flex items-center gap-1 sm:gap-2 select-none",c.value])},[e.createElementVNode("div",mo,[e.renderSlot(i.$slots,"icon")]),e.createElementVNode("span",null,e.toDisplayString(t.title),1)],2),e.createElementVNode("div",null,[!t.button&&!t.alwaysOpen?(e.openBlock(),e.createBlock(e.unref(j.ChevronDownIcon),{key:0,class:e.normalizeClass(["w-4 h-4 sm:w-5 sm:h-5 transition-all duration-400",s.value&&"rotate-180"])},null,8,["class"])):e.createCommentVNode("",!0),t.button?(e.openBlock(),e.createBlock(e.unref(F),e.mergeProps({key:1,size:"sm",to:t.button.expandContent?void 0:t.button.to,color:t.button.expandContent&&s.value?"invert":t.button.color,"icon-right":t.button.expandContent&&s.value?void 0:t.button.iconRight,onClick:(v=t.button)==null?void 0:v.onClick},e.toHandlers((f=t.button)!=null&&f.expandContent?{click:r}:{})),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.button.expandContent&&s.value?"Cancel":t.button.text),1)]),_:1},16,["to","color","icon-right","onClick"])):e.createCommentVNode("",!0)])],16),e.createElementVNode("div",{class:e.normalizeClass(["transition-all duration-700 overflow-hidden",[t.allowOverflow&&s.value?"!overflow-visible":"",s.value?"mb-3 mt-1":"",!t.button&&!t.alwaysOpen?"cursor-pointer hover:bg-foundation":""]]),style:e.normalizeStyle(t.alwaysOpen?"max-height: none;":`max-height: ${s.value?l.value+"px":"0px"}`)},[e.createElementVNode("div",{ref_key:"content",ref:o,class:"rounded-md text-sm pb-3 px-2 mt-1"},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode("Panel contents")])],512)],6)],2)}}}),po={class:"inline-flex items-center space-x-2"},ho={class:"label-light"},vo=e.defineComponent({__name:"Disclosure",props:{title:null,icon:null,color:{default:"default"}},setup(t){const n=t,o=e.computed(()=>{const s=["pr-3 h-10 w-full flex items-center justify-between border-l-2 px-2 rounded transition","ring-1 font-medium"];switch(n.color){case"warning":s.push("border-warning text-warning ring-warning-lighter hover:ring-warning");break;case"success":s.push("border-success text-success ring-success-lighter hover:ring-success");break;case"danger":s.push("border-danger text-danger ring-danger-lighter hover:ring-danger");break;case"default":default:s.push("border-primary text-primary ring-primary-muted hover:ring-primary");break}return s.join(" ")}),l=e.computed(()=>{const s=["p-3 border-x border-b rounded-b-md"];switch(n.color){case"warning":s.push("border-warning-lighter");break;case"success":s.push("border-success-lighter");break;case"danger":s.push("border-danger-lighter");break;case"default":default:s.push("border-primary-muted");break}return s.join(" ")});return(s,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(L.Disclosure),null,{default:e.withCtx(({open:c})=>[e.createVNode(e.unref(L.DisclosureButton),{class:e.normalizeClass(o.value)},{default:e.withCtx(()=>[e.createElementVNode("div",po,[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"h-5 w-5"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.title),1)]),e.createVNode(e.unref(M.ChevronUpIcon),{class:e.normalizeClass([c?"":"rotate-180 transform","h-5 w-5"])},null,8,["class"])]),_:2},1032,["class"]),e.createVNode(e.unref(L.DisclosurePanel),{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[e.createElementVNode("div",ho,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode("Panel contents")])])]),_:3},8,["class"])]),_:3})]))}});var G=(t=>(t.Grid="grid",t.List="list",t))(G||{});const go=e.defineComponent({__name:"GridListToggle",props:{modelValue:null},emits:["click","update:modelValue"],setup(t,{emit:n}){const o=t,l=e.computed({get:()=>o.modelValue||G.Grid,set:c=>n("update:modelValue",c)}),s=e.computed(()=>l.value===G.Grid?M.Bars3Icon:j.Squares2X2Icon),a=c=>{n("click",c);const r=l.value===G.Grid?G.List:G.Grid;l.value=r};return(c,r)=>(e.openBlock(),e.createElementBlock("button",{class:"flex items-center justify-center rounded bg-foundation h-8 w-8 shadow cursor-pointer text-foreground",onClick:a},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),{class:"h-5 w-5"}))]))}});var Te=(t=>(t[t.Throttle=0]="Throttle",t[t.Debounce=1]="Debounce",t))(Te||{}),se=(t=>(t[t.Left=0]="Left",t[t.Right=1]="Right",t))(se||{});function Me(t,n){if(!O.isClient)return;const{wait:o=100,throttleOrDebounce:l=0}=n||{},s=o?l===0?B.throttle(t,o):B.debounce(t,o):t;e.onMounted(()=>window.addEventListener("resize",s)),e.onBeforeUnmount(()=>window.removeEventListener("resize",s))}function yo(t){e.onMounted(()=>{window.addEventListener("beforeunload",t)}),e.onBeforeUnmount(()=>{window.removeEventListener("beforeunload",t)})}function Oe(t){const{el:n,defaultDirection:o}=t,l=e.ref(B.isUndefined(o)?1:o),s=e.computed(()=>{const c=e.unref(t.stopUpdatesBelowWidth);if(!B.isUndefined(c))return c;const r=e.unref(n);return r!=null&&r.offsetWidth?r.offsetWidth*2:void 0}),a=()=>{if(!O.isClient)return;const c=e.unref(n);if(!c)return;const r=c.getBoundingClientRect(),i=r.x+r.width>window.innerWidth,u=r.x<0;i&&u||!B.isUndefined(s.value)&&window.innerWidth<s.value||(i?l.value=0:u&&(l.value=1))};return Me(()=>a()),e.watch(()=>e.unref(n),c=>{c&&a()}),{direction:e.computed(()=>l.value),recalculateDirection:a}}const ko=["disabled","onClick"],bo=e.defineComponent({__name:"Menu",props:{open:{type:Boolean},items:null},emits:["update:open","chosen"],setup(t,{emit:n}){const o=t,l=e.ref(null),{direction:s}=Oe({el:e.computed(()=>{var m;return((m=l.value)==null?void 0:m.el)||null}),defaultDirection:se.Left,stopUpdatesBelowWidth:300}),a=e.ref(null),c=e.ref(!1),r=e.computed({get:()=>o.open||!1,set:m=>n("update:open",m)}),i=m=>{const{active:y,disabled:d}=m,b=["group flex w-full items-center rounded-md px-2 py-2 text-sm"];return y?b.push("bg-primary text-foreground-on-primary"):d?b.push("text-foreground-disabled"):b.push("text-foreground"),b.join(" ")},u=(m,y)=>{n("chosen",{item:m,event:y})},v=()=>{var m;return(m=a.value)==null?void 0:m.el.click()},f=m=>{const y=!!m;return c.value=y,y};return e.watch(c,(m,y)=>{m!==y&&(r.value=m)}),e.watch(r,m=>{(m&&!c.value||!m&&c.value)&&v()}),(m,y)=>(e.openBlock(),e.createBlock(e.unref(L.Menu),{as:"div",class:"relative inline-block"},{default:e.withCtx(({open:d})=>[e.createElementVNode("div",null,[e.createVNode(e.unref(L.MenuButton),{ref_key:"menuButton",ref:a,class:"hidden",onClick:y[0]||(y[0]=e.withModifiers(()=>{},["stop","prevent"]))},null,512),e.createElementVNode("div",{class:e.normalizeClass(d?"pointer-events-none":"")},[e.renderSlot(m.$slots,"default",{toggle:v,open:f(d)})],2)]),e.createVNode(e.Transition,{"enter-active-class":"transition duration-100 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.MenuItems),{ref_key:"menuItems",ref:l,class:e.normalizeClass(["absolute mt-2 w-56 origin-top-right divide-y divide-outline-3 rounded-md bg-foundation shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-40",e.unref(s)===e.unref(se).Left?"right-0":""])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(b,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"px-1 py-1"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b,k=>(e.openBlock(),e.createBlock(e.unref(L.MenuItem),{key:k.id,disabled:k.disabled},{default:e.withCtx(({active:x,disabled:I})=>[e.withDirectives((e.openBlock(),e.createElementBlock("span",null,[e.createElementVNode("button",{class:e.normalizeClass(i({active:x,disabled:I})),disabled:I,onClick:p=>u(k,p)},[e.renderSlot(m.$slots,"item",{item:k},()=>[e.createTextVNode(e.toDisplayString(k.title),1)])],10,ko)])),[[e.unref(Ve.directive),k.disabled&&k.disabledTooltip]])]),_:2},1032,["disabled"]))),128))]))),128))]),_:3},8,["class"])]),_:3})]),_:3}))}}),xo={class:"flex flex-col space-y-4"},Co={class:"flex space-x-6"},Bo=e.defineComponent({__name:"Tabs",props:{items:null},setup(t){const n=t,o=e.ref(null),l=e.computed(()=>o.value&&n.items.find(a=>a.id===o.value)||n.items[0]),s=a=>{o.value=a.id};return(a,c)=>(e.openBlock(),e.createElementBlock("div",xo,[e.createElementVNode("div",Co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,r=>(e.openBlock(),e.createBlock(F,{key:r.id,link:"",color:l.value.id===r.id?"default":"secondary",onClick:i=>s(r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.title),1)]),_:2},1032,["color","onClick"]))),128))]),e.renderSlot(a.$slots,"default",{activeItem:l.value})]))}}),wo={class:"text-foreground"},Vo={class:"w-full text-sm overflow-x-auto overflow-y-visible simple-scrollbar"},Eo=["onClick","onKeypress"],No=e.createElementVNode("div",{class:"text-gray-900 font-medium order-1"},"Placeholder",-1),So={class:"absolute right-1.5 gap-1 flex items-center p-0"},$o=e.defineComponent({__name:"Table",props:{items:null,buttons:null,columns:null,overflowCells:{type:Boolean},onRowClick:{type:Function}},setup(t){const n=t,o=e.computed(()=>{const c=(n.buttons||[]).length;let r=16;return c>0&&(r=48+(c-1)*42),`${r}px`}),l=c=>{var r;return((r=n.columns.find(i=>i.id===c))==null?void 0:r.classes)||""},s=(c,r)=>{const i=l(c);return r===0?`bg-transparent py-3 pr-5 px-1 ${i}`:`lg:p-0 px-1 my-2 ${i}`},a=c=>{var r;(r=n.onRowClick)==null||r.call(n,c)};return(c,r)=>(e.openBlock(),e.createElementBlock("div",wo,[e.createElementVNode("div",Vo,[t.items.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"grid z-10 grid-cols-12 items-center gap-6 font-semibold bg-foundation rounded-t-lg w-full border-b border-outline-3 pb-2 pt-4 px-4 min-w-[900px]",style:e.normalizeStyle({paddingRight:o.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,class:e.normalizeClass([l(i.id),"capitalize"])},e.toDisplayString(i.header),3))),128))],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["divide-y divide-outline-3 h-full overflow-visible",{"pb-32":t.overflowCells}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,class:e.normalizeClass(["relative grid grid-cols-12 items-center gap-6 px-4 py-1 min-w-[900px] bg-foundation",{"cursor-pointer hover:bg-primary-muted":!!t.onRowClick}]),style:e.normalizeStyle({paddingRight:o.value}),tabindex:"0",onClick:u=>a(i),onKeypress:u=>a(i)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(u,v)=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:e.normalizeClass(s(u.id,v)),tabindex:"0"},[e.renderSlot(c.$slots,u.id,{item:i},()=>[No])],2))),128)),e.createElementVNode("div",So,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,u=>(e.openBlock(),e.createElementBlock("div",{key:u.label},[e.createVNode(e.unref(F),{"icon-left":u.icon,size:"sm",color:"secondary","hide-text":"",class:e.normalizeClass(u.class),onClick:e.withModifiers(v=>u.action(i),["stop"])},null,8,["icon-left","class","onClick"])]))),128))])],46,Eo))),128))],2)])]))}}),zo={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},Io={class:"inline-flex items-center space-x-1"},Lo=e.createElementVNode("span",{class:"text-foreground-2"},"That's it, you've loaded everything!",-1),Do={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},To={class:"inline-flex items-center space-x-1"},Mo=e.createElementVNode("span",{class:"text-foreground-2"},"An error occurred while loading",-1),Oo=e.defineComponent({__name:"InfiniteLoading",props:{settings:null,allowRetry:{type:Boolean}},emits:["infinite"],setup(t){const n=e.ref(null),o=e.ref(!1);return O.isClient&&e.onMounted(()=>{const l=setInterval(()=>{var s;(s=n.value)!=null&&s.isConnected&&(o.value=!0,clearInterval(l))},200)}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapper",ref:n},[o.value?(e.openBlock(),e.createBlock(e.unref(Xe),e.mergeProps({key:0},l.$props.settings||{},{onInfinite:s[0]||(s[0]=a=>l.$emit("infinite",a))}),{spinner:e.withCtx(()=>[e.createVNode(ce,{loading:!0,class:"my-2"})]),complete:e.withCtx(()=>[e.createElementVNode("div",zo,[e.createElementVNode("div",Io,[e.createVNode(e.unref(j.CheckIcon),{class:"w-5 h-5 text-success"}),Lo])])]),error:e.withCtx(({retry:a})=>[e.createElementVNode("div",Do,[e.createElementVNode("div",To,[e.createVNode(e.unref(j.ExclamationTriangleIcon),{class:"w-5 h-5 text-danger"}),Mo]),t.allowRetry?(e.openBlock(),e.createBlock(F,{key:0,onClick:a},{default:e.withCtx(()=>[e.createTextVNode("Retry")]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:1},16)):e.createCommentVNode("",!0)],512))}}),Ao={class:"relative group"},Po={key:0,class:"absolute -inset-1 bg-blue-300 dark:bg-blue-500 opacity-5 dark:opacity-0 rounded-md blur-sm group-hover:opacity-60 dark:group-hover:opacity-30 transition duration-500"},jo=e.defineComponent({__name:"Panel",props:{form:{type:Boolean,default:!1},ring:{type:Boolean,default:!1},fancyGlow:{type:Boolean,default:!1},customPadding:{type:Boolean,default:!1},noShadow:{type:Boolean,default:!1},panelClasses:{type:String}},emits:["submit"],setup(t,{emit:n}){const o=t,l=e.computed(()=>o.customPadding?"":"px-4 py-4 sm:px-6"),s=e.computed(()=>o.customPadding?"":"px-4 py-4 sm:p-6"),a=e.computed(()=>{const c=["rounded-lg"];return o.noShadow||c.push("shadow"),o.ring&&c.push("ring-outline-2 hover:ring-2"),o.panelClasses&&c.push(o.panelClasses),c.join(" ")});return(c,r)=>(e.openBlock(),e.createElementBlock("div",Ao,[t.fancyGlow?(e.openBlock(),e.createElementBlock("div",Po)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.form?"form":"div"),{class:e.normalizeClass(["relative divide-outline-3 bg-foundation text-foreground flex flex-col divide-y overflow-hidden",a.value]),onSubmit:r[0]||(r[0]=i=>n("submit",i))},{default:e.withCtx(()=>[c.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.value)},[e.renderSlot(c.$slots,"header")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grow",s.value])},[e.renderSlot(c.$slots,"default")],2),c.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(l.value)},[e.renderSlot(c.$slots,"footer")],2)):e.createCommentVNode("",!0)]),_:3},40,["class"]))]))}}),Fo={class:"flex-shrink-0"},Ro=e.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),_o=e.defineComponent({__name:"Alert",props:{color:{default:"success"},withDismiss:{type:Boolean},actions:null,customIcon:null,size:{default:"default"}},emits:["dismiss"],setup(t){const n=t,o=e.useSlots(),l=e.computed(()=>!!o.description),s=e.computed(()=>{if(n.customIcon)return n.customIcon;switch(n.color){case"info":return D.InformationCircleIcon;case"warning":return D.ExclamationCircleIcon;case"danger":return D.XCircleIcon;case"success":default:return D.CheckCircleIcon}}),a=e.computed(()=>{const d=[];switch(n.size){case"xs":d.push("p-1");break;case"default":default:d.push(l.value?"p-4":"p-2");break}switch(n.color){case"success":d.push("bg-success-lighter border-l-4 border-success");break;case"info":d.push("bg-info-lighter border-l-4 border-info");break;case"danger":d.push("bg-danger-lighter border-l-4 border-danger");break;case"warning":d.push("bg-warning-lighter border-l-4 border-warning");break}return d.join(" ")}),c=e.computed(()=>{const d=[];if(l.value)d.push("");else switch(d.push("items-center"),n.size){case"xs":d.push("space-x-1");break;case"default":default:d.push("space-x-2");break}return d.join(" ")}),r=e.computed(()=>{const d=["grow"];switch(l.value||d.push("flex items-center space-x-2"),n.size){case"xs":d.push("ml-1");break;case"default":default:d.push("ml-3");break}return d.join(" ")}),i=e.computed(()=>{const d=[];switch(n.size){case"xs":d.push("text-xs");break;case"default":default:d.push("mt-2 text-sm");break}return d.join(" ")}),u=e.computed(()=>{var h;const d=["flex"];l.value||d.push("grow justify-end");const b=l.value&&((h=n.actions)==null?void 0:h.length);switch(n.size){case"xs":d.push("space-x-1"),b&&d.push("mt-1");break;case"default":default:d.push("space-x-2"),b&&d.push("mt-4");break}return d.join(" ")}),v=e.computed(()=>{const d=[];switch(n.color){case"success":d.push("text-success-darker");break;case"info":d.push("text-info-darker");break;case"danger":d.push("text-danger-darker");break;case"warning":d.push("text-warning-darker");break}return d.join(" ")}),f=e.computed(()=>{const d=[];switch(n.size){case"xs":d.push("h-4 w-4"),d.push(l.value?"mt-0.5":"");break;case"default":default:d.push("h-5 w-5");break}switch(n.color){case"success":d.push("text-success");break;case"info":d.push("text-info");break;case"danger":d.push("text-danger");break;case"warning":d.push("text-warning");break}return d.join(" ")}),m=e.computed(()=>{const d=[];switch(n.color){case"success":d.push("bg-success-lighter ring-success");break;case"info":d.push("bg-info-lighter ring-info");break;case"danger":d.push("bg-danger-lighter ring-danger");break;case"warning":d.push("bg-warning-lighter ring-warning");break}return d.join(" ")}),y=e.computed(()=>{switch(n.size){case"xs":return"xs";case"default":default:return"sm"}});return(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded-md",[a.value,v.value]])},[e.createElementVNode("div",{class:e.normalizeClass(["flex",c.value])},[e.createElementVNode("div",Fo,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),{class:e.normalizeClass(f.value),"aria-hidden":"true"},null,8,["class"]))]),e.createElementVNode("div",{class:e.normalizeClass(r.value)},[e.createElementVNode("h3",{class:e.normalizeClass(["text-sm",[l.value?"font-medium":""]])},[e.renderSlot(d.$slots,"title",{},()=>[e.createTextVNode("Title")])],2),l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value)},[e.renderSlot(d.$slots,"description",{},()=>[e.createTextVNode(" Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam. ")])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(u.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions||[],(h,k)=>(e.openBlock(),e.createBlock(F,{key:k,color:t.color,size:y.value,to:h.url,external:h.externalUrl||!1,onClick:x=>h.onClick||e.unref(B.noop)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.title),1)]),_:2},1032,["color","size","to","external","onClick"]))),128))],2)],2),t.withDismiss?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex",[l.value?"items-start":"items-center"]])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["inline-flex rounded-md focus:outline-none focus:ring-2",m.value]),onClick:b[0]||(b[0]=h=>d.$emit("dismiss"))},[Ro,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)],2)):e.createCommentVNode("",!0)],2)],2))}});function Uo(t){var d,b;const{get:n,initialState:o,readOptions:l,set:s,asyncRead:a=!0,debugging:c}=t,r=c==null?void 0:c.log,i=()=>(new Error("Trace:").stack||"").substring(7),u=((b=(d=t.debugging)==null?void 0:d.log)==null?void 0:b.logger)||console.debug,v=r&&!r.writesOnly?()=>{const h=n();return u(`debugging: '${r.name}' read`,h,i()),h}:n,f=r&&!r.readsOnly?h=>(u(`debugging: '${r.name}' written to`,h,i()),s(h)):s,m=a?O.computedAsync(v,o,l):e.computed(v),y=e.computed(()=>m.value);return y.update=f,y}const qo=e.defineComponent({__name:"ContextManager",setup(t,{expose:n}){const l=e.getCurrentInstance().provides,s=Object.getOwnPropertySymbols(l).find(m=>m.description==="ComboboxContext");s||console.error("FormTagsContextManager ctx key not found!");const a=e.inject(s||"__undefined");return a||console.error("FormTagsContextManager ctx not found!"),n({goUp:()=>{a==null||a.goToOption(1)},goDown:()=>{a==null||a.goToOption(2)},open:()=>{a&&a.openCombobox()},close:()=>{a==null||a.closeCombobox()},selectActive:()=>{a==null||a.selectActiveOption()},isOpen:()=>(a==null?void 0:a.comboboxState.value)===0}),(m,y)=>e.renderSlot(m.$slots,"default")}}),Wo=["for"],Ho=["disabled","placeholder","onKeydown"],Ko=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),Go={key:1},Xo=e.createElementVNode("div",{class:"text-foreground-2 text-center"},[e.createTextVNode(" Press "),e.createElementVNode("strong",null,"Enter"),e.createTextVNode(" to create tag ⚡ ")],-1),Zo=[Xo],Qo=["id"],Jo=e.defineComponent({__name:"Tags",props:{name:null,help:null,label:null,showLabel:{type:Boolean},rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},autoFocus:{type:Boolean},showClear:{type:Boolean},showRequired:{type:Boolean},color:{default:"page"},wrapperClasses:null,size:{default:"base"},placeholder:null,disabled:{type:Boolean},useLabelInErrors:{type:Boolean,default:!0},getAutocompleteItems:{type:Function},modelValue:null},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const l=t,s=C=>C.type==="input",a=e.ref(null),{focused:c}=O.useFocus(a),r=e.ref(null),{coreInputClasses:i,coreClasses:u,labelClasses:v,title:f,helpTip:m,helpTipId:y,hideHelpTip:d,helpTipClasses:b,errorMessage:h,clear:k,value:x}=ve({props:e.toRefs(l),emit:o,inputEl:a}),I=e.ref([]),p=e.ref(!1),E=e.ref(!1),N=e.ref(""),S=e.computed({get:()=>x.value||[],set:C=>{x.value=B.uniq(C).filter(w=>!!w.length)}}),ne=e.computed(()=>{switch(l.size){case"sm":return"h-6";case"lg":return"h-10";case"xl":return"h-14";case"base":default:return"h-8"}}),H=e.computed(()=>l.showClear&&!!S.value.length),de=e.computed(()=>{const C=[u.value,l.disabled?"cursor-not-allowed !bg-foundation-disabled !text-disabled-muted":""];return H.value&&(h.value||l.showRequired)?C.push("pr-14"):(H.value||h.value||l.showRequired)&&C.push("pr-8"),h.value?(C.push("border-2 border-danger text-danger-darker"),c.value&&C.push("ring-1 ring-danger")):(C.push("border-2 border-transparent"),c.value&&C.push("ring-2 ring-outline-2")),C.join(" ")}),Z=C=>{if(l.disabled)return;const w=S.value.indexOf(C);if(w!==-1){const V=S.value.slice();V.splice(w,1),S.value=V}},R=()=>{var C;(C=a.value)==null||C.blur(),E.value=!1},K=C=>{if(C.key!=="Backspace"||N.value.length)return;const w=S.value.slice();w.pop(),S.value=w,E.value=!1},T=()=>{var C,w,V;(C=r.value)!=null&&C.isOpen()?(w=r.value)==null||w.goUp():(V=r.value)==null||V.open()},oe=()=>{var C,w,V;(C=r.value)!=null&&C.isOpen()?(w=r.value)==null||w.goDown():(V=r.value)==null||V.open()},ee=async()=>{l.getAutocompleteItems&&(p.value=!0,I.value=await Promise.resolve(l.getAutocompleteItems(N.value)),p.value=!1)},me=B.debounce(ee,1e3),fe=()=>{p.value=!0,me()},te=(C,w)=>{var A,_;if(s(C)?C.data===" "||C.data===","||C.data===";":!0){let g=!1;if((A=r.value)!=null&&A.isOpen()&&I.value.length&&!w)(_=r.value)==null||_.selectActive(),g=!0;else{const z=N.value.trim().substring(0,N.value.length-(s(C)?1:0)),$=S.value.includes(z);z.length>0&&!$&&(S.value=[...S.value,z],g=!0)}g&&(N.value="",E.value=!1)}else E.value=!!N.value.length};return e.watch(E,(C,w)=>{var V,A;C&&!w?l.getAutocompleteItems&&((V=r.value)==null||V.open()):!C&&w&&((A=r.value)==null||A.close())}),e.watch(N,()=>{fe()}),e.onMounted(()=>{ee()}),n({resolveAutocompleteItems:ee}),(C,w)=>(e.openBlock(),e.createBlock(e.unref(L.Combobox),{modelValue:S.value,"onUpdate:modelValue":w[5]||(w[5]=V=>S.value=V),as:"div",multiple:"",clearable:"",class:e.normalizeClass([t.wrapperClasses])},{default:e.withCtx(()=>[e.createVNode(qo,{ref_key:"ctxManager",ref:r},{default:e.withCtx(()=>[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(v))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(f)),1)],10,Wo),e.createElementVNode("div",{class:e.normalizeClass(["relative flex flex-wrap items-center space-x-1 px-2 py-1",de.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,V=>(e.openBlock(),e.createBlock(ie,{key:V,"icon-left":t.disabled?void 0:e.unref(D.XMarkIcon),"clickable-icon":"",size:"lg",onClickIcon:()=>Z(V)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V),1)]),_:2},1032,["icon-left","onClickIcon"]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputEl",ref:a,"onUpdate:modelValue":w[0]||(w[0]=V=>N.value=V),disabled:t.disabled,class:e.normalizeClass(["bg-transparent grow shrink border-0 focus:ring-0 p-0",[e.unref(i),ne.value]]),style:{"flex-basis":"70px","min-width":"70px"},placeholder:S.value.length?void 0:t.placeholder,onInput:te,onKeydown:[e.withKeys(R,["escape"]),w[1]||(w[1]=e.withKeys(e.withModifiers(V=>te(V,!0),["stop","prevent"]),["enter"])),e.withKeys(te,["tab"]),e.withKeys(K,["backspace"]),e.withKeys(T,["arrow-up"]),e.withKeys(oe,["arrow-down"])],onBlur:w[2]||(w[2]=V=>E.value=!1)},null,42,Ho),[[e.vModelText,N.value]]),H.value?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute top-2 right-0 flex items-center pr-2 cursor-pointer",onClick:w[3]||(w[3]=(...V)=>e.unref(k)&&e.unref(k)(...V)),onKeydown:w[4]||(w[4]=(...V)=>e.unref(k)&&e.unref(k)(...V))},[Ko,e.createVNode(e.unref(D.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute top-[10px] right-0 flex items-center",H.value?"pr-8":"pr-2"])},[e.createVNode(e.unref(D.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["pointer-events-none absolute top-[2px] text-4xl right-0 flex items-center text-danger opacity-50",H.value?"pr-8":"pr-2"])}," * ",2)):e.createCommentVNode("",!0)],2),e.createVNode(e.unref(L.TransitionRoot),{leave:"transition ease-in duration-100","leave-from":"opacity-100","leave-to":"opacity-0",class:"relative px-0.5"},{default:e.withCtx(()=>[e.createVNode(e.unref(L.ComboboxOptions),{class:"absolute top-1 max-h-60 w-full overflow-auto simple-scrollbar rounded-md bg-foundation-2 py-1 shadow label label--light outline outline-2 outline-primary-muted focus:outline-none"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["px-1",I.value.length?"mb-1":""])},[e.createVNode(ce,{loading:!0})],2)):e.createCommentVNode("",!0),!I.value.length&&!p.value?(e.openBlock(),e.createElementBlock("div",Go,Zo)):e.createCommentVNode("",!0),I.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(I.value,V=>(e.openBlock(),e.createBlock(e.unref(L.ComboboxOption),{key:V,as:"template",value:V},{default:e.withCtx(({selected:A,active:_})=>[e.createElementVNode("li",{class:e.normalizeClass(["relative cursor-pointer select-none py-1.5 pl-3",{"text-primary":_,"text-foreground":!_}])},[e.createElementVNode("span",{class:e.normalizeClass(["block truncate",{"font-medium":A,"font-normal":!A}])},e.toDisplayString(V),3),A?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["absolute inset-y-0 right-0 flex items-center pr-4",{"text-primary":_,"text-foreground":!_}])},[e.createVNode(e.unref(D.CheckIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]),_:2},1032,["value"]))),128)):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.unref(y)&&!e.unref(d)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(y),class:e.normalizeClass(e.unref(b))},e.toDisplayString(e.unref(m)),11,Qo)):e.createCommentVNode("",!0)]),_:1},512)]),_:1},8,["modelValue","class"]))}});function Ae(t){const{props:n}=t,o=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"h-5";case"sm":return"h-6";case"lg":return"h-10";case"xl":return"h-14";case"xxl":return"h-32";case"editable":return"h-60";case"base":default:return"h-8"}}),l=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"w-5";case"sm":return"w-6";case"lg":return"w-10";case"xl":return"w-14";case"xxl":return"w-32";case"editable":return"w-60";case"base":default:return"w-8"}}),s=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"text-tiny";case"sm":return"text-xs";case"lg":return"text-md";case"xl":return"text-2xl";case"xxl":return"text-3xl";case"editable":return"h1";case"base":default:return"text-sm"}}),a=e.computed(()=>{var i;switch((i=n.size)==null?void 0:i.value){case"xs":return"w-3 h-3";case"sm":return"w-3 h-3";case"lg":return"w-5 h-5";case"xl":return"w-8 h-8";case"xxl":return"w-10 h-10";case"editable":return"w-20 h-20";case"base":default:return"w-4 h-4"}}),c=e.computed(()=>`${l.value} ${o.value} ${s.value}`);return{heightClasses:o,widthClasses:l,sizeClasses:c,iconClasses:a}}const Yo={key:1,class:"flex h-full w-full select-none items-center justify-center"},el={key:2},ae=e.defineComponent({__name:"Avatar",props:{user:{default:null},size:{default:"base"},hoverEffect:{type:Boolean,default:!1},active:{type:Boolean},noBorder:{type:Boolean},noBg:{type:Boolean}},setup(t){const n=t,{sizeClasses:o,iconClasses:l}=Ae({props:e.toRefs(n)}),s=e.computed(()=>{var m,y,d;if(!((m=n.user)!=null&&m.name.length))return;const u=n.user.name.split(" "),v=((y=u[0])==null?void 0:y[0])||"",f=((d=u[1])==null?void 0:d[0])||"";return n.size==="sm"||n.size==="xs"?v:v+f}),a=e.computed(()=>n.noBorder?"":"border-2 border-foundation"),c=e.computed(()=>n.noBg?"":"bg-primary"),r=e.computed(()=>n.hoverEffect?"hover:border-primary focus:border-primary active:scale-95":""),i=e.computed(()=>n.active?"border-primary":"");return(u,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-foreground-on-primary flex shrink-0 items-center justify-center overflow-hidden rounded-full font-semibold uppercase transition",e.unref(o),c.value,a.value,r.value,i.value])},[e.renderSlot(u.$slots,"default",{},()=>{var f;return[(f=t.user)!=null&&f.avatar?(e.openBlock(),e.createElementBlock("div",{key:0,class:"h-full w-full bg-cover bg-center bg-no-repeat",style:e.normalizeStyle({backgroundImage:`url('${t.user.avatar}')`})},null,4)):s.value?(e.openBlock(),e.createElementBlock("div",Yo,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",el,[e.createVNode(e.unref(M.UserCircleIcon),{class:e.normalizeClass(e.unref(l))},null,8,["class"])]))]}),e.renderSlot(u.$slots,"absolute-anchor")],2))}}),tl=e.defineComponent({__name:"AvatarGroup",props:{users:{default:()=>[]},overlap:{type:Boolean,default:!0},size:{default:"base"},maxCount:{default:void 0}},setup(t){const n=t,o=e.ref(null),l=e.ref(null),{hiddenItemCount:s}=ye({elementToWatchForChanges:o,itemContainer:l,trackResize:!0,trackMutations:!0}),{heightClasses:a}=Ae({props:e.toRefs(n)}),c=e.computed(()=>n.maxCount?Math.max(n.users.length-n.maxCount,0):0),r=e.computed(()=>s.value+c.value),i=e.computed(()=>n.maxCount?n.users.slice(0,n.maxCount):n.users);return(u,v)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"elementToWatchForChanges",ref:o,class:e.normalizeClass(`flex ${t.overlap?"-space-x-2":""}`)},[e.createElementVNode("div",{ref_key:"itemContainer",ref:l,class:e.normalizeClass(`flex flex-wrap overflow-hidden ${t.overlap?"-space-x-2 ":""} ${e.unref(a)}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(f,m)=>(e.openBlock(),e.createBlock(ae,{key:f.id||m,user:f,size:t.size},null,8,["user","size"]))),128))],2),r.value?(e.openBlock(),e.createBlock(ae,{key:0,size:t.size},{default:e.withCtx(()=>[e.createTextVNode(" +"+e.toDisplayString(r.value),1)]),_:1},8,["size"])):e.createCommentVNode("",!0)],2))}}),Pe=e.defineComponent({__name:"Icon",props:{loading:{type:Boolean,default:!0},size:{default:"base"}},setup(t){const n=t,o=e.computed(()=>{const l=["text-primary transition-all animate-spin"];switch(l.push(n.loading?"opacity-100":"opacity-0"),n.size){case"base":l.push("h-8 w-8");break;case"sm":l.push("h-5 w-5");break;case"lg":l.push("h-12 w-12");break}return l.join(" ")});return(l,s)=>(e.openBlock(),e.createBlock(e.unref(M.ArrowPathIcon),{class:e.normalizeClass(o.value)},null,8,["class"]))}}),nl={class:"flex flex-col items-center space-y-2"},ol={key:1,class:"relative group"},ll={class:"opacity-0 transition-all absolute group-hover:opacity-100 inset-0 flex items-end justify-center bottom-4"},sl={key:2,class:"w-full text-center text-danger text-sm"},al=e.defineComponent({__name:"AvatarEditable",props:e.mergeModels({modelValue:null,placeholder:null,name:null,rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},disabled:{type:Boolean},size:null},{editMode:{type:Boolean,local:!0}}),emits:e.mergeModels(["save","update:modelValue"],["update:editMode"]),setup(t,{expose:n,emit:o}){const l=t,s=e.defineAsyncComponent({loader:()=>Promise.resolve().then(()=>require("./AvatarEditor-0cf61750.cjs")),loadingComponent:Pe,delay:100}),{value:a,errorMessage:c}=re.useField(l.name,l.rules,{validateOnMount:l.validateOnMount,validateOnValueUpdate:l.validateOnValueUpdate,initialValue:l.modelValue||void 0}),r=e.useModel(t,"editMode",{local:!0}),i=e.computed(()=>({avatar:a.value,name:l.placeholder})),u=m=>{a.value=m,o("save",m)};return n({open:()=>r.value=!0,close:()=>r.value=!1}),(m,y)=>(e.openBlock(),e.createElementBlock("div",nl,[r.value?(e.openBlock(),e.createBlock(e.unref(s),{key:0,user:i.value,disabled:t.disabled,size:t.size,onCancel:y[0]||(y[0]=d=>r.value=!1),onSave:u},null,8,["user","disabled","size"])):(e.openBlock(),e.createElementBlock("div",ol,[e.createVNode(ae,{user:i.value,size:t.size},null,8,["user","size"]),e.createElementVNode("div",ll,[e.createVNode(F,{disabled:t.disabled,color:"secondary",onClick:y[1]||(y[1]=d=>r.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(" Change ")]),_:1},8,["disabled"])])])),e.unref(c)?(e.openBlock(),e.createElementBlock("div",sl,e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)]))}});class W extends Error{constructor(n,o){n||(n=new.target.defaultMessage),super(n,o)}}q(W,"defaultMessage","Unexpected error occurred");class je extends W{}q(je,"defaultMessage","An unexpected logic error occurred!");class Fe extends W{}q(Fe,"defaultMessage","Attempting to access an uninitialized resource");class Re extends W{}q(Re,"defaultMessage","getCurrentInstance() returned null. Method must be called at the top of a setup function");class _e extends W{}q(_e,"defaultMessage","Operation not supported in current (server or client) environment");var ue=(t=>(t.AnyAudio="audio/*",t.AnyVideo="video/*",t.AnyImage="image/*",t))(ue||{});function rl(t,n){const o=B.intersection(Object.values(ue),n);for(const a of o)switch(a){case"audio/*":if(t.type.startsWith("audio"))return!0;break;case"image/*":if(t.type.startsWith("image"))return!0;break;case"video/*":if(t.type.startsWith("video"))return!0;break}const l=B.difference(n,o),s=il(t.name);if(!s)return new Ue;for(const a of l)if(a.toLowerCase()===s.toLowerCase())return!0;return new qe}function il(t){const n=t.split(".").pop()||null;return n?`.${n}`:null}function cl(t){return t.startsWith(".")||Object.values(ue).includes(t)}function pe(t){const n=a=>parseFloat(a.toFixed(2)).toString();if(t<1024)return`${t}bytes`;const o=t/1024;if(o<1024)return`${n(o)}KB`;const l=o/1024;if(l<1024)return`${n(l)}MB`;const s=l/1024;return`${n(s)}GB`}function ul(t){const n={name:t.name,lastModified:t.lastModified,size:t.size,type:t.type};return X.md5(JSON.stringify(n))}class Ue extends W{}q(Ue,"defaultMessage","The selected file has a missing extension");class qe extends W{}q(qe,"defaultMessage","The selected file type is forbidden");var We=(t=>(t[t.Success=1]="Success",t[t.Failure=2]="Failure",t))(We||{});function dl(t){if(!t)return;const n=t.split(",").map(o=>cl(o)?o:null).filter(o=>o!==null);return n.length?n:void 0}function ml(t){const{disabled:n,accept:o,multiple:l,sizeLimit:s,countLimit:a}=t,c=e.computed(()=>dl(e.unref(o))),r=i=>{const u=[],v=c.value;for(const f of i){const m=ul(f),y=e.unref(l)?e.unref(a):1;if(!u.find(d=>d.id===m)){if(y&&u.length>=y)break;if(v){const d=rl(f,v);if(d instanceof Error){u.push({file:f,id:m,error:d});continue}}if(f.size>e.unref(s)){u.push({file:f,id:m,error:new He(`The selected file's size (${pe(f.size)}) is too big (over ${pe(e.unref(s))})`)});continue}u.push({file:f,id:m,error:null})}}return u};return{buildUploadableFiles:i=>{if(!e.unref(n||!1))return r(i)}}}class He extends W{}q(He,"defaultMessage","The selected file's size is too large");const fl=["accept","multiple"],pl=e.defineComponent({__name:"Zone",props:{accept:null,multiple:{type:Boolean},sizeLimit:{default:1024*1024*100},countLimit:null,disabled:{type:Boolean}},emits:["files-selected"],setup(t,{expose:n,emit:o}){const l=t,s=e.ref(null),a=e.ref(null),{buildUploadableFiles:c}=ml({sizeLimit:e.computed(()=>l.sizeLimit),countLimit:e.computed(()=>l.countLimit),accept:e.computed(()=>l.accept),multiple:e.computed(()=>l.multiple),disabled:e.computed(()=>l.disabled)}),r=f=>{const m=c(f);m!=null&&m.length&&o("files-selected",{files:m})},{isOverDropZone:i}=O.useDropZone(s,f=>{f!=null&&f.length&&r(f)}),u=()=>{const f=a.value;if(!f)return;const m=[...f.files||[]];f.value="",m.length&&r(m)},v=()=>{var f;(f=a.value)==null||f.click()};return n({triggerPicker:v}),(f,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"fileUploadZone",ref:s,class:"file-upload-zone"},[e.renderSlot(f.$slots,"default",{isDraggingFiles:e.unref(i),openFilePicker:v,activatorOn:{click:v}}),e.createElementVNode("input",{ref_key:"fileInput",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.multiple,onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"])),onChange:u},null,40,fl)],512))}});exports.BaseError=W;exports.BlobUploadStatus=We;exports.CommonAlert=_o;exports.CommonBadge=ie;exports.CommonLoadingBar=ce;exports.CommonLoadingIcon=Pe;exports.CommonStepsBullet=qt;exports.CommonStepsNumber=zt;exports.CommonTextLink=Ne;exports.ComposableInvokedOutOfScopeError=Re;exports.FormButton=F;exports.FormCardButton=Ht;exports.FormCheckbox=en;exports.FormClipboardInput=eo;exports.FormFileUploadZone=pl;exports.FormSelectBadges=Gn;exports.FormSelectBase=be;exports.FormSelectSourceApps=Hn;exports.FormSwitch=Qn;exports.FormTags=Jo;exports.FormTextArea=ze;exports.FormTextInput=Ie;exports.GlobalToastRenderer=ct;exports.GridListToggleValue=G;exports.HorizontalDirection=se;exports.InfiniteLoading=Oo;exports.LayoutDialog=uo;exports.LayoutDialogSection=fo;exports.LayoutDisclosure=vo;exports.LayoutGridListToggle=go;exports.LayoutMenu=bo;exports.LayoutPanel=jo;exports.LayoutTable=$o;exports.LayoutTabs=Bo;exports.LogicError=je;exports.ModifierKeys=Y;exports.SourceAppBadge=De;exports.TailwindBreakpoints=J;exports.ThrottleOrDebounce=Te;exports.ToastNotificationType=Q;exports.UninitializedResourceAccessError=Fe;exports.UniqueFileTypeSpecifier=ue;exports.UnsupportedEnvironmentError=_e;exports.UserAvatar=ae;exports.UserAvatarEditable=al;exports.UserAvatarGroup=tl;exports.ValidationHelpers=xn;exports.clientOs=le;exports.getKeyboardShortcutTitle=no;exports.keyboardClick=Se;exports.onKeyboardShortcut=oo;exports.prettyFileSize=pe;exports.useFormCheckboxModel=lo;exports.useFormSelectChildInternals=ke;exports.useOnBeforeWindowUnload=yo;exports.useResponsiveHorizontalDirectionCalculation=Oe;exports.useWindowResizeHandler=Me;exports.useWrappingContainerHiddenCount=ye;exports.writableAsyncComputed=Uo;
2
2
  //# sourceMappingURL=lib.cjs.map