@wisemen/vue-core-design-system 1.27.1 → 1.27.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/index.cjs CHANGED
@@ -286,7 +286,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
286
286
  fixed inset-0 bg-linear-to-t from-black/50 to-black/25
287
287
  will-change-[opacity]
288
288
  dark:from-black/80 dark:to-black/50
289
- `},variants:{isDrawer:{false:{chin:`top-0`},true:{chin:`bottom-0 rounded-b-none`}},size:{"full-screen":{content:`max-h-[90vh]`,contentWrapper:`max-w-[90vw]`,drawerContent:`h-[85dvh]`},lg:{contentWrapper:`max-w-160`},md:{contentWrapper:`max-w-140`},sm:{contentWrapper:`max-w-120`},xl:{contentWrapper:`max-w-180`},xs:{contentWrapper:`max-w-100`},xxs:{contentWrapper:`max-w-90`}}}}),hy={ref:`chinContent`,class:`w-full`},gy=(0,f.defineComponent)({__name:`DialogChin`,props:{chin:{}},setup(e){let t=e,n=(0,f.computed)(()=>t.chin!==null),r=(0,f.useTemplateRef)(`chinContent`),i=(0,f.ref)(38);(0,f.watch)(r,(e,t,n)=>{if(e==null)return;i.value=e.getBoundingClientRect().height;let r=new ResizeObserver(([e])=>{i.value=e?.contentRect.height??0});r.observe(e),n(()=>{r.disconnect()})},{immediate:!0});let a={default:`from-white/60 dark:from-white/15`,error:`from-error-secondary dark:from-error-secondary/20`},o=(0,f.computed)(()=>a[t.chin?.variant??`default`]),s={brand:`minimal-color`,default:`tertiary`,destructive:`destructive-tertiary`},c={brand:`primary`,default:`tertiary`,destructive:`destructive-tertiary`},l=(0,f.computed)(()=>t.chin?.variant===`error`?`text-error-500`:`text-primary`),{isDrawer:u,style:d}=py(),p=Kp(),m=(0,f.computed)(()=>t.chin?.pulseKey??`rest`),h=(0,f.computed)(()=>t.chin?.pulseKey!=null&&!p.value);return(e,r)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(_.Motion),{animate:{height:n.value?`calc(100% + ${i.value+14}px)`:`100%`},initial:!1,transition:{duration:(0,f.unref)(p)?0:.3,type:`spring`,bounce:0},class:(0,f.normalizeClass)([(0,f.unref)(d).chin(),`bg-white/20 dark:bg-white/10`]),as:`div`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(_.AnimatePresence),null,{default:(0,f.withCtx)(()=>[n.value?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(_.Motion),{key:0,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:(0,f.unref)(p)?0:.3,type:`spring`,bounce:0},as:`div`,class:`h-full`},{default:(0,f.withCtx)(()=>[((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(_.Motion),{key:m.value,initial:{opacity:1,scale:1},animate:h.value?{opacity:1,scale:[1,1,1],y:[0,3,0]}:{opacity:1,scale:1},transition:{duration:(0,f.unref)(p)?0:.2,ease:`easeInOut`,times:h.value?[0,.45,1]:void 0,type:`tween`},class:(0,f.normalizeClass)([[o.value,(0,f.unref)(u)?`rounded-t-[calc(1rem+5px)] rounded-b-none bg-linear-to-b`:`rounded-[calc(1rem+5px)] bg-linear-to-t`],`h-full to-transparent`]),as:`div`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(U,{class:(0,f.normalizeClass)([(0,f.unref)(u)?`justify-start`:`justify-end`,`h-full p-lg px-xl`])},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,hy,[(0,f.createVNode)(P,{align:`center`,justify:`between`,class:`min-w-0 gap-md`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(P,{class:`min-w-0 flex-1 gap-md`},{default:(0,f.withCtx)(()=>[t.chin?.icon??!1?((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(t.chin?.icon),{key:0,class:(0,f.normalizeClass)([l.value,`size-4 shrink-0`])},null,8,[`class`])):(0,f.createCommentVNode)(``,!0),t.chin!==null&&t.chin.text?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(V),{key:1,text:t.chin.text,truncate:2,class:`min-w-0 flex-1 text-xs font-medium text-secondary`},null,8,[`text`])):(0,f.createCommentVNode)(``,!0)]),_:1}),(0,f.createVNode)(P,{items:`center`,gap:`none`,class:`shrink-0`},{default:(0,f.withCtx)(()=>[t.chin?.secondaryAction?((0,f.openBlock)(),(0,f.createElementBlock)(f.Fragment,{key:0},[t.chin.secondaryAction.type===`button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(q),{key:0,label:t.chin.secondaryAction.label,"is-loading":t.chin.secondaryAction.isLoading,"is-disabled":t.chin.secondaryAction.isDisabled,"disabled-reason":t.chin.secondaryAction.disabledReason,variant:s[t.chin.secondaryAction.variant??`default`],onClick:t.chin.secondaryAction.action},null,8,[`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):t.chin.secondaryAction.type===`link`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Gv),{key:1,label:t.chin.secondaryAction.label,to:t.chin.secondaryAction.to,link:t.chin.secondaryAction.link,variant:c[t.chin.secondaryAction.variant??`default`]},null,8,[`label`,`to`,`link`,`variant`])):t.chin.secondaryAction.type===`icon-button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(J),{key:2,icon:t.chin.secondaryAction.icon,label:t.chin.secondaryAction.label,"is-loading":t.chin.secondaryAction.isLoading,"is-disabled":t.chin.secondaryAction.isDisabled,"disabled-reason":t.chin.secondaryAction.disabledReason,variant:c[t.chin.secondaryAction.variant??`default`],onClick:t.chin.secondaryAction.action},null,8,[`icon`,`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):(0,f.createCommentVNode)(``,!0)],64)):(0,f.createCommentVNode)(``,!0),t.chin?.primaryAction?((0,f.openBlock)(),(0,f.createElementBlock)(f.Fragment,{key:1},[t.chin.primaryAction.type===`button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(q),{key:0,label:t.chin.primaryAction.label,"is-loading":t.chin.primaryAction.isLoading,"is-disabled":t.chin.primaryAction.isDisabled,"disabled-reason":t.chin.primaryAction.disabledReason,variant:s[t.chin.primaryAction.variant??`brand`],onClick:t.chin.primaryAction.action},null,8,[`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):t.chin.primaryAction.type===`link`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Gv),{key:1,label:t.chin.primaryAction.label,to:t.chin.primaryAction.to,link:t.chin.primaryAction.link,variant:c[t.chin.primaryAction.variant??`brand`]},null,8,[`label`,`to`,`link`,`variant`])):t.chin.primaryAction.type===`icon-button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(J),{key:2,icon:t.chin.primaryAction.icon,label:t.chin.primaryAction.label,"is-loading":t.chin.primaryAction.isLoading,"is-disabled":t.chin.primaryAction.isDisabled,"disabled-reason":t.chin.primaryAction.disabledReason,variant:c[t.chin.primaryAction.variant??`brand`],onClick:t.chin.primaryAction.action},null,8,[`icon`,`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):(0,f.createCommentVNode)(``,!0)],64)):(0,f.createCommentVNode)(``,!0)]),_:1})]),_:1})],512)]),_:1},8,[`class`])]),_:1},8,[`animate`,`transition`,`class`]))]),_:1},8,[`transition`])):(0,f.createCommentVNode)(``,!0)]),_:1})]),_:1},8,[`animate`,`transition`,`class`]))}}),_y=(0,f.defineComponent)({__name:`DialogClose`,setup(e){let t=py(null);return(e,n)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)((0,f.unref)(t)?.isDrawer.value===!0?(0,f.unref)(h.DrawerClose):(0,f.unref)(h.DialogClose)),{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`default`)]),_:3}))}}),vy=(0,f.defineComponent)({__name:`DialogCloseButton`,setup(e){let t=(0,g.useI18n)();return(e,n)=>((0,f.openBlock)(),(0,f.createBlock)(_y,null,{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(J),{icon:(0,f.unref)(ki),label:(0,f.unref)(t).t(`component.dialog.close`),"keyboard-shortcut":{key:`Escape`},class:`absolute top-0 right-0 z-10 m-lg`,variant:`tertiary`},null,8,[`icon`,`label`])]),_:1}))}});function yy(e){let t=py(null);(0,f.watch)(e,(e,n)=>{e?t?.registerNestedLayer():n&&t?.unregisterNestedLayer()}),(0,f.onBeforeUnmount)(()=>{e.value&&t?.unregisterNestedLayer()})}function by(){let e=(0,f.ref)(0),t=(0,f.computed)(()=>e.value>0);function n(){e.value+=1}function r(){--e.value}return{hasOpenNestedLayer:t,registerNestedLayer:n,unregisterNestedLayer:r}}function xy(){let e=(0,f.ref)(null),t=(0,f.ref)(!0),n=(0,f.ref)(!0);function r(){let r=e.value;r!==null&&(t.value=r.scrollTop<=1,n.value=r.scrollTop+r.clientHeight>=r.scrollHeight-1)}let i=null;return(0,f.watch)(e,(e,t,n)=>{e!==null&&(e.addEventListener(`scroll`,r,{passive:!0}),i=new ResizeObserver(r),i.observe(e),r(),n(()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),i=null}))},{immediate:!0}),{isScrolledToBottom:n,isScrolledToTop:t,bodyRef:e}}var Sy={class:`relative flex max-h-full flex-col overflow-hidden rounded-t-3xl border-x border-t border-secondary bg-primary pb-[env(safe-area-inset-bottom)] shadow-lg`},Cy=(0,f.defineComponent)({__name:`ResponsiveDrawer`,props:(0,f.mergeModels)({title:{default:null},isSwipeToCloseDisabled:{type:Boolean,default:!1}},{isOpen:{type:Boolean,default:!1,required:!1},isOpenModifiers:{}}),emits:(0,f.mergeModels)([`afterLeave`,`autoFocusOnClose`,`escapeKeyDown`,`focusOutside`,`interactOutside`,`pointerDownOutside`],[`update:isOpen`]),setup(e,{emit:t}){let n=e,r=t,i=(0,f.useModel)(e,`isOpen`),a=dy(),o=(0,f.ref)(0);(0,f.watch)(i,e=>{e&&(o.value=a.registerOverlay())},{immediate:!0});function s(e){r(`escapeKeyDown`,e)}function c(e){r(`focusOutside`,e)}function l(e){r(`interactOutside`,e)}function u(e){r(`pointerDownOutside`,e)}function d(e){r(`autoFocusOnClose`,e)}function p(e,t){!e&&t?.reason===`swipe`&&n.isSwipeToCloseDisabled||(i.value=e)}function m(e){e||r(`afterLeave`)}return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.DrawerRoot),{open:i.value,"onUpdate:open":p,"onUpdate:openComplete":m},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DrawerTrigger),(0,f.mergeProps)({"as-child":!0},(0,f.toHandlers)(e.$attrs)),{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`trigger`)]),_:3},16),(0,f.createVNode)((0,f.unref)(h.DrawerPortal),{to:`body`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(Wi,{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DrawerOverlay),{style:(0,f.normalizeStyle)({zIndex:o.value}),class:`fixed inset-0 bg-linear-to-t from-black/50 to-black/25 dark:from-black/80 dark:to-black/50`,"data-animation":`drawer-overlay`,"data-drawer-overlay":``},null,8,[`style`])]),_:1}),(0,f.createVNode)(Wi,{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DrawerContent),{style:(0,f.normalizeStyle)({zIndex:o.value}),class:`fixed inset-x-0 bottom-0 flex max-h-[95dvh] flex-col will-change-transform outline-none`,"data-animation":`drawer-content`,onCloseAutoFocus:d,onEscapeKeyDown:s,onFocusOutside:c,onInteractOutside:l,onPointerDownOutside:u},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`behind`),(0,f.createElementVNode)(`div`,Sy,[(0,f.createVNode)((0,f.unref)(h.DrawerHandle),{class:`flex w-full shrink-0 justify-center py-md`},{default:(0,f.withCtx)(()=>[...t[0]||=[(0,f.createElementVNode)(`span`,{class:`h-1.5 w-10 rounded-full bg-quaternary`},null,-1)]]),_:1}),n.title===null?(0,f.createCommentVNode)(``,!0):((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.DrawerTitle),{key:0,class:`sr-only`},{default:(0,f.withCtx)(()=>[(0,f.createTextVNode)((0,f.toDisplayString)(n.title),1)]),_:1})),(0,f.renderSlot)(e.$slots,`content`)])]),_:3},8,[`style`])]),_:3})]),_:3})]),_:3},8,[`open`]))}}),wy=(0,f.defineComponent)({__name:`Dialog`,props:(0,f.mergeModels)({hasCloseButton:{type:Boolean,default:!0},isClickOutsideDisabled:{type:Boolean,default:!1},isEscDisabled:{type:Boolean,default:!1},chin:{default:null},preventClickOutside:{type:Boolean},preventEsc:{type:Boolean},showCloseButton:{type:Boolean},size:{default:`md`}},{isOpen:{type:Boolean,default:!1},isOpenModifiers:{}}),emits:(0,f.mergeModels)([`afterLeave`,`close`,`escapeKeyDown`,`update:isOpen`],[`update:isOpen`]),setup(e,{emit:t}){let n=e,r=t,i=(0,f.computed)(()=>n.isClickOutsideDisabled||n.preventClickOutside===!0),a=(0,f.computed)(()=>n.isEscDisabled||n.preventEsc===!0),o=(0,f.useModel)(e,`isOpen`),s=cy(),c=(0,f.computed)(()=>my({isDrawer:s.value,size:n.size})),{isScrolledToBottom:l,isScrolledToTop:u,bodyRef:d}=xy(),{hasOpenNestedLayer:p,registerNestedLayer:m,unregisterNestedLayer:g}=by();fy({hasOpenNestedLayer:p,isDrawer:s,isScrolledToBottom:l,isScrolledToTop:u,bodyRef:d,registerNestedLayer:m,style:c,unregisterNestedLayer:g});function _(e){r(`escapeKeyDown`,e),a.value&&e.preventDefault()}function v(e){i.value&&e.preventDefault()}function y(e){e||r(`close`)}function b(e){if(p.value){e.preventDefault();return}e.target instanceof Element&&(e.target.hasAttribute(`data-dialog-overlay`)||e.target.hasAttribute(`data-drawer-overlay`)||e.preventDefault())}let x=dy(),S=(0,f.ref)(0);return(0,f.watch)(o,e=>{e&&!s.value&&(S.value=x.registerOverlay())},{immediate:!0}),(e,t)=>(0,f.unref)(s)?((0,f.openBlock)(),(0,f.createBlock)(Cy,{key:0,"is-open":o.value,"onUpdate:isOpen":[t[0]||=e=>o.value=e,y],"is-swipe-to-close-disabled":i.value,onAfterLeave:t[1]||=e=>r(`afterLeave`),onEscapeKeyDown:_,onPointerDownOutside:v,onInteractOutside:b},{behind:(0,f.withCtx)(()=>[(0,f.createVNode)(gy,{chin:n.chin},null,8,[`chin`])]),content:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,{class:(0,f.normalizeClass)(c.value.drawerContent())},[(0,f.renderSlot)(e.$slots,`default`),n.hasCloseButton?((0,f.openBlock)(),(0,f.createBlock)(vy,{key:0})):(0,f.createCommentVNode)(``,!0)],2)]),_:3},8,[`is-open`,`is-swipe-to-close-disabled`])):((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.DialogRoot),{key:1,open:o.value,"onUpdate:open":[t[3]||=e=>o.value=e,y],modal:!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DialogOverlay),{class:(0,f.normalizeClass)(c.value.overlay()),style:(0,f.normalizeStyle)({zIndex:S.value}),"data-animation":`dialog`,"data-dialog-overlay":``},null,8,[`class`,`style`]),(0,f.createVNode)((0,f.unref)(h.DialogContent),{class:(0,f.normalizeClass)(c.value.contentWrapper()),style:(0,f.normalizeStyle)({zIndex:S.value}),"data-animation":`dialog`,onEscapeKeyDown:_,onPointerDownOutside:v,onAfterLeave:t[2]||=e=>r(`afterLeave`),onInteractOutside:b},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,{class:(0,f.normalizeClass)(c.value.content())},[(0,f.renderSlot)(e.$slots,`default`),n.hasCloseButton?((0,f.openBlock)(),(0,f.createBlock)(vy,{key:0})):(0,f.createCommentVNode)(``,!0)],2),(0,f.createVNode)(gy,{chin:n.chin},null,8,[`chin`])]),_:3},8,[`class`,`style`])]),_:3},8,[`open`]))}}),Ty=(0,f.defineComponent)({__name:`DialogFooter`,props:{hasSeparator:{type:Boolean,default:!0},showSeparator:{type:Boolean}},setup(e){let t=e,n=py(null);return(e,r)=>((0,f.openBlock)(),(0,f.createElementBlock)(`div`,{class:(0,f.normalizeClass)((0,f.unref)(n)?.style.value.footer()),"data-dialog-footer":``},[t.hasSeparator?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Us),{key:0,class:(0,f.normalizeClass)([(0,f.unref)(n)!==null&&(0,f.unref)(n).isScrolledToBottom.value?`opacity-0`:`opacity-100`,`transition-opacity duration-150`])},null,8,[`class`])):(0,f.createCommentVNode)(``,!0),(0,f.createVNode)(P,{align:`center`,justify:`between`,gap:`lg`,class:`p-xl`},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,null,[(0,f.renderSlot)(e.$slots,`left`)]),(0,f.createVNode)(P,{align:`center`},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`right`),(0,f.renderSlot)(e.$slots,`default`)]),_:3})]),_:3})],2))}}),Ey=(0,f.defineComponent)({__name:`DialogFooterCancel`,props:{isAutoFocusDisabled:{type:Boolean},isDestructive:{type:Boolean},disableAutoFocus:{type:Boolean},disabledReason:{default:null},form:{default:null},iconLeft:{default:null},iconRight:{default:null},isDisabled:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},type:{default:`button`},label:{default:null}},emits:[`click`],setup(e,{emit:t}){let n=e,r=t,i=(0,g.useI18n)();return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)(_y,null,{default:(0,f.withCtx)(()=>[(0,f.createVNode)(q,(0,f.mergeProps)(n,{label:n.label??(0,f.unref)(i).t(`component.dialog.cancel`),variant:`secondary`,onClick:t[0]||=e=>r(`click`)}),null,16,[`label`])]),_:1}))}}),Dy=(0,f.defineComponent)({__name:`AutoFocus`,props:{isDisabled:{type:Boolean,default:!1}},setup(e){let t=e,n=(0,f.ref)(null);function r(e){let t=e.querySelectorAll(`a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])`),[n]=Array.from(t);return n??null}return(0,f.onMounted)(()=>{if(t.isDisabled)return;let e=n.value?.$el;if(e===null)return;let i=r(e);i!==null&&setTimeout(()=>{i.focus()})}),(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.Primitive),{ref_key:`primitiveRef`,ref:n},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`default`)]),_:3},512))}}),Oy=(0,f.defineComponent)({__name:`DialogFooterPrimary`,props:{isAutoFocusDisabled:{type:Boolean,default:!1},isDestructive:{type:Boolean,default:!1},disableAutoFocus:{type:Boolean},disabledReason:{default:null},form:{default:null},iconLeft:{default:null},iconRight:{default:null},isDisabled:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},label:{},type:{default:`button`}},emits:[`click`],setup(e,{emit:t}){let n=e,r=t,i=(0,f.computed)(()=>n.isAutoFocusDisabled||n.disableAutoFocus===!0);return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Dy),{"is-disabled":i.value},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(q,(0,f.mergeProps)(n,{variant:n.isDestructive?`destructive-primary`:`primary`,onClick:t[0]||=e=>r(`click`)}),null,16,[`variant`])]),_:1},8,[`is-disabled`]))}}),ky=(0,f.defineComponent)({__name:`DialogHeader`,props:{title:{},hasSeparator:{type:Boolean,default:!0},isDescriptionHidden:{type:Boolean},description:{},hideDescription:{type:Boolean},icon:{default:null},iconVariant:{default:`brand`},showSeparator:{type:Boolean}},setup(e){let t=e,n=z({slots:{bg:``,text:``},variants:{variant:{brand:{bg:`bg-brand-secondary`,text:`text-brand-primary`},error:{bg:`bg-error-secondary`,text:`text-error-primary`},success:{bg:`bg-success-secondary`,text:`text-success-primary`},warning:{bg:`bg-warning-secondary`,text:`text-warning-primary`}}}}),r=(0,f.computed)(()=>n({variant:t.iconVariant})),i=(0,f.computed)(()=>t.isDescriptionHidden||t.hideDescription===!0),a=py(null),o=(0,f.computed)(()=>a?.isDrawer.value===!0);return(e,n)=>((0,f.openBlock)(),(0,f.createBlock)(U,{class:(0,f.normalizeClass)((0,f.unref)(a)?.style.value.header()),gap:`none`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(P,{align:t.hideDescription?`center`:`start`,gap:`xl`,class:`p-xl pb-0 group-has-data-dialog-body/dialog:pb-xl`},{default:(0,f.withCtx)(()=>[t.icon===null?(0,f.createCommentVNode)(``,!0):((0,f.openBlock)(),(0,f.createElementBlock)(`div`,{key:0,class:(0,f.normalizeClass)([r.value.bg(),`flex size-10 shrink-0 items-center justify-center rounded-full`])},[((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(t.icon),{class:(0,f.normalizeClass)([r.value.text(),`size-5`])},null,8,[`class`]))],2)),(0,f.createVNode)((0,f.unref)(U),{gap:`xxs`,class:`min-w-0 flex-1`},{default:(0,f.withCtx)(()=>[((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(o.value?(0,f.unref)(h.DrawerTitle):(0,f.unref)(h.DialogTitle)),{as:`h2`,class:`text-sm font-semibold text-primary`},{default:(0,f.withCtx)(()=>[(0,f.createTextVNode)((0,f.toDisplayString)(t.title),1)]),_:1})),((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(o.value?(0,f.unref)(h.DrawerDescription):(0,f.unref)(h.DialogDescription)),{class:(0,f.normalizeClass)([{"sr-only":i.value},`text-xs text-tertiary`]),as:`p`,innerHTML:t.description},null,8,[`class`,`innerHTML`]))]),_:1})]),_:1},8,[`align`]),t.hasSeparator?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Us),{key:0,class:(0,f.normalizeClass)([(0,f.unref)(a)!==null&&(0,f.unref)(a).isScrolledToTop.value?`opacity-0`:`opacity-100`,`transition-opacity duration-150`])},null,8,[`class`])):(0,f.createCommentVNode)(``,!0)]),_:1},8,[`class`]))}}),Ay=(0,f.defineComponent)({__name:`ConfirmDialog`,props:{title:{},isDestructive:{type:Boolean,default:!1},cancelLabel:{default:null},confirmLabel:{default:null},description:{},icon:{default:null},onConfirm:{},isClickOutsideDisabled:{type:Boolean,default:!1},isEscDisabled:{type:Boolean,default:!1},preventClickOutside:{type:Boolean},preventEsc:{type:Boolean}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=(0,g.useI18n)(),a=(0,f.ref)(!1);async function o(){a.value=!0;try{await n.onConfirm()}finally{a.value=!1}}function s(){r(`close`)}function c(){r(`close`)}return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)(wy,{"has-close-button":!1,"is-click-outside-disabled":n.isClickOutsideDisabled,"is-esc-disabled":n.isEscDisabled,"prevent-click-outside":n.preventClickOutside,"prevent-esc":n.preventEsc,size:`xxs`,onClose:c},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(ky,{title:n.title,description:n.description,icon:n.icon,"icon-variant":n.isDestructive?`error`:`brand`,"has-close-button":!1},null,8,[`title`,`description`,`icon`,`icon-variant`]),(0,f.createVNode)(Ty,null,{right:(0,f.withCtx)(()=>[(0,f.createVNode)(Ey,{label:n.cancelLabel,"is-disabled":a.value,onClick:s},null,8,[`label`,`is-disabled`]),(0,f.createVNode)(Oy,{label:n.confirmLabel??(0,f.unref)(i).t(`component.unsaved_changes_dialog.confirm`),"is-loading":a.value,"is-destructive":n.isDestructive,onClick:o},null,8,[`label`,`is-loading`,`is-destructive`])]),_:1})]),_:1},8,[`is-click-outside-disabled`,`is-esc-disabled`,`prevent-click-outside`,`prevent-esc`]))}});function jy(e){let t=(0,g.useI18n)(),n=PC().create(Ay);function r(){return new Promise(e=>{n.open({title:t.t(`component.unsaved_changes_dialog.title`),isDestructive:!0,cancelLabel:t.t(`component.unsaved_changes_dialog.cancel`),confirmLabel:t.t(`component.unsaved_changes_dialog.confirm`),description:t.t(`component.unsaved_changes_dialog.description`),onClose:()=>{e(!1)},onConfirm:()=>{n.close(),e(!0)}})})}(0,y.onBeforeRouteLeave)(async()=>{if(e.value)return await r()}),window.addEventListener(`beforeunload`,()=>{if(e.value)return t.t(`component.unsaved_changes_dialog.description`)})}var My=[`id`],Ny=(0,f.defineComponent)({__name:`Form`,props:{id:{default:null},isUnsavedChangesPromptEnabled:{type:Boolean,default:!0},form:{},promptOnUnsavedChanges:{type:Boolean,default:!0}},setup(e){let t=e,n=(0,f.useId)();return(0,f.computed)(()=>t.promptOnUnsavedChanges===!0?t.isUnsavedChangesPromptEnabled:!1).value&&jy(t.form.isDirty),iy({formId:t.id??n,form:t.form}),(e,r)=>((0,f.openBlock)(),(0,f.createElementBlock)(`form`,{id:t.id??(0,f.unref)(n),novalidate:!0,onSubmit:r[0]||=(0,f.withModifiers)(e=>t.form.submit(),[`prevent`])},[(0,f.renderSlot)(e.$slots,`default`)],40,My))}}),Py={alt:``,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,backspace:`⌫`,capslock:`⇪`,command:`⌘`,control:`⌃`,ctrl:``,delete:`⌦`,end:`↘`,enter:`↵`,escape:`Esc`,home:`↖`,option:`⌥`,pagedown:`⇟`,pageup:`⇞`,shift:`⇧`,tab:`⇥`,win:`⊞`,meta:``},Fy=/Macintosh;/,Iy=Ly();function Ly(){return typeof navigator>`u`||typeof navigator.userAgent!=`string`?!1:Fy.test(navigator.userAgent)}var Ry=(0,m.createSharedComposable)(()=>{let e=(0,f.reactive)({alt:` `,ctrl:` `,meta:` `});(0,f.onMounted)(()=>{e.meta=Iy?Py.command:`Ctrl`,e.ctrl=Iy?Py.control:`Ctrl`,e.alt=Iy?Py.option:`Alt`});function t(t){return[`meta`,`alt`,`ctrl`].includes(t)?e[t]:Py[t]||t}return{getKbdKey:t,IS_MACOS:Iy}}),zy=/^[^-]+.*-.*[^-]+$/,By=/^[^_]+.*_.*[^_]+$/,Vy=/^[a-z]$/i,Hy=/^\d$/,Uy=/^f\d+$/i,Wy=/^Key[A-Z]$/i,Gy=/^[a-z]{1}$/i,Ky=[`arrowleft`,`arrowright`,`arrowup`,`arrowright`,`tab`,`escape`,`enter`,`backspace`];function qy(e){return Vy.test(e)?`Key${e.toUpperCase()}`:Hy.test(e)?`Digit${e}`:Uy.test(e)?e.toUpperCase():{arrowdown:`ArrowDown`,arrowleft:`ArrowLeft`,arrowright:`ArrowRight`,arrowup:`ArrowUp`,backspace:`Backspace`,delete:`Delete`,enter:`Enter`,escape:`Escape`,space:`Space`,tab:`Tab`}[e.toLowerCase()]||e}function Jy(e,t={}){let n=(0,f.ref)([]);function r(){n.value.splice(0,n.value.length)}let i=(0,m.useDebounceFn)(r,t.chainDelay??800),{IS_MACOS:a}=Ry(),o=(0,m.useActiveElement)(),s=t.layoutIndependent??!1,c=new Set(Ky.map(e=>qy(e))),l=(0,f.computed)(()=>{let e=o.value?.tagName,t=o.value?.contentEditable;return e===`INPUT`||e===`TEXTAREA`||t===`true`||t===`plaintext-only`}),u=(0,f.computed)(()=>Object.entries((0,f.toValue)(e)).map(([e,t])=>{if(!t)return null;let n;e.includes(`-`)&&e!==`-`&&!e.includes(`_`)&&!e.match(zy)?.length&&console.warn(`[Shortcut] Invalid key: "${e}"`),e.includes(`_`)&&e!==`_`&&!e.match(By)?.length&&console.warn(`[Shortcut] Invalid key: "${e}"`);let r=e.includes(`-`)&&e!==`-`&&!e.includes(`_`);if(r)n=s?{altKey:!1,ctrlKey:!1,key:e.split(`-`).map(e=>qy(e)).join(`-`),metaKey:!1,shiftKey:!1}:{altKey:!1,ctrlKey:!1,key:e.toLowerCase(),metaKey:!1,shiftKey:!1};else{let t=e.toLowerCase().split(`_`).map(e=>e),r=t.filter(e=>![`meta`,`command`,`ctrl`,`shift`,`alt`,`option`].includes(e)).join(`_`);s&&(r=qy(r)),n={altKey:t.includes(`alt`)||t.includes(`option`),ctrlKey:t.includes(`ctrl`),key:r,metaKey:t.includes(`meta`)||t.includes(`command`),shiftKey:t.includes(`shift`)}}if(n.chained=r,!a&&n.metaKey&&!n.ctrlKey&&(n.metaKey=!1,n.ctrlKey=!0),typeof t==`function`?n.handler=t:typeof t==`object`&&(n={...n,handler:t.handler}),!n.handler)return console.warn(`[Shortcut] Invalid value`),null;let i=!0,o=e.split(r?`-`:`_`)[0];return o===`meta`||o===`command`||(t.usingInput?typeof t.usingInput==`string`&&(i=l.value===t.usingInput):i=!l.value),n.enabled=i,n}).filter(Boolean));function d(e){if(!e.key)return;let t=s?Wy.test(e.code):Gy.test(e.key),a=s?c.has(e.code):Ky.includes(e.key.toLowerCase()),o;if(n.value.push(s?e.code:e.key),n.value.length>=2){o=n.value.slice(-2).join(`-`);for(let t of u.value.filter(e=>e.chained))if(t.key===o){t.enabled&&t.handler(e),r();return}}for(let n of u.value.filter(e=>!e.chained)){if(s){if(e.code!==n.key)continue}else if(e.key.toLowerCase()!==n.key)continue;if(e.metaKey===n.metaKey&&e.ctrlKey===n.ctrlKey&&!((t||a)&&e.shiftKey!==n.shiftKey)){n.enabled&&n.handler(e),r();return}}i()}return(0,m.useEventListener)(`keydown`,d)}var Yy=(0,f.defineComponent)({__name:`FormSubmitButton`,props:{isKeyboardShortcutDisabled:{type:Boolean,default:!1},disableKeyboardShortcut:{type:Boolean},label:{},variant:{default:`primary`}},setup(e){let t=e,n=(0,f.computed)(()=>t.isKeyboardShortcutDisabled||t.disableKeyboardShortcut===!0),r={submit:{keys:[`meta`,`enter`],shortcutKey:`meta_enter`}},{formId:i,form:a}=ay();return Jy({[r.submit.shortcutKey]:()=>{n.value||a.submit()}}),(e,o)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.Primitive),(0,f.mergeProps)({"as-child":!0},t,{"is-loading":(0,f.unref)(a).isSubmitting.value,form:(0,f.unref)(i),type:`submit`}),{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`default`,{},()=>[(0,f.createVNode)((0,f.unref)(q),{label:t.label,form:(0,f.unref)(i),variant:t.variant,"keyboard-shortcut-keys":n.value?null:r.submit.keys},null,8,[`label`,`form`,`variant`,`keyboard-shortcut-keys`])])]),_:3},16,[`is-loading`,`form`]))}}),Xy=(0,f.defineComponent)({__name:`PopoverArrow`,setup(e){return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.PopoverArrow),{class:`relative -mb-4 h-4 w-10 -translate-y-px overflow-hidden`,as:`div`},{default:(0,f.withCtx)(()=>[...t[0]||=[(0,f.createElementVNode)(`div`,{class:`absolute left-1/2 size-4 -translate-x-1/2 -translate-y-3 rotate-45 rounded-xxs border border-secondary bg-primary shadow-lg`},null,-1)]]),_:1}))}}),Zy={class:`relative size-full overflow-hidden rounded-md border border-secondary bg-primary shadow-lg`},Qy=(0,f.defineComponent)({__name:`Popover`,props:(0,f.mergeModels)((0,f.mergeDefaults)({isPrioritizedPosition:{type:Boolean},isSideFlipDisabled:{type:Boolean},isUpdateOnLayoutShiftDisabled:{type:Boolean},disableSideFlip:{type:Boolean},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},isPopoverArrowVisible:{type:Boolean},popoverAlign:{},popoverAlignOffset:{},popoverAnchorReferenceElement:{},popoverAnimationName:{},popoverCollisionPadding:{},popoverContainerElement:{},popoverSide:{},popoverSideOffset:{},popoverWidth:{}},{...Ji,isPrioritizedPosition:!1,isSideFlipDisabled:!1,isUpdateOnLayoutShiftDisabled:!1}),{isOpen:{type:Boolean,default:!1,required:!1},isOpenModifiers:{}}),emits:(0,f.mergeModels)([`autoFocusOnClose`,`escapeKeyDown`,`focusOutside`,`interactOutside`],[`update:isOpen`]),setup(e,{emit:t}){let n=e,r=t,i=(0,f.computed)(()=>n.isPrioritizedPosition||n.prioritizePosition===!0),a=(0,f.computed)(()=>n.isSideFlipDisabled||n.disableSideFlip===!0),o=(0,f.computed)(()=>n.isUpdateOnLayoutShiftDisabled||n.disableUpdateOnLayoutShift===!0),s=(0,f.useModel)(e,`isOpen`);yy(s);function c(e){r(`escapeKeyDown`,e)}function l(e){r(`focusOutside`,e)}function u(e){r(`interactOutside`,e)}function d(e){r(`autoFocusOnClose`,e)}return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.PopoverRoot),{open:s.value,"onUpdate:open":t[0]||=e=>s.value=e},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.PopoverAnchor),{"as-child":!0,reference:n.popoverAnchorReferenceElement??void 0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.PopoverTrigger),(0,f.mergeProps)({"as-child":!0},(0,f.toHandlers)(e.$attrs)),{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`trigger`)]),_:3},16)]),_:3},8,[`reference`]),(0,f.createVNode)((0,f.unref)(h.PopoverPortal),{to:`body`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(Wi,{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.PopoverContent),{align:n.popoverAlign,"align-offset":n.popoverAlignOffset,"collision-padding":n.popoverCollisionPadding,"collision-boundary":n.popoverContainerElement,side:n.popoverSide,"side-offset":n.popoverSideOffset,class:(0,f.normalizeClass)([{"w-(--reka-popover-trigger-width)":n.popoverWidth===`anchor-width`,"w-(--reka-popover-content-available-width)":n.popoverWidth===`available-width`},`z-50 origin-(--reka-popover-content-transform-origin)`]),"prioritize-position":i.value,"data-animation":n.popoverAnimationName??`popover-default`,"disable-update-on-layout-shift":o.value,"side-flip":!a.value,"position-strategy":`absolute`,sticky:`always`,onCloseAutoFocus:d,onEscapeKeyDown:c,onFocusOutside:l,onInteractOutside:u},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,Zy,[(0,f.renderSlot)(e.$slots,`content`)]),n.isPopoverArrowVisible?((0,f.openBlock)(),(0,f.createBlock)(Xy,{key:0})):(0,f.createCommentVNode)(``,!0)]),_:3},8,[`align`,`align-offset`,`collision-padding`,`collision-boundary`,`side`,`side-offset`,`class`,`prioritize-position`,`data-animation`,`disable-update-on-layout-shift`,`side-flip`])]),_:3})]),_:3})]),_:3},8,[`open`]))}});function $y(e){return e.map(e=>({type:`option`,value:e}))}function eb(e,t){let n=(0,f.computed)(()=>{if(t.errorMessage===null&&t.hint===null)return;let n=[];return t.errorMessage!==null&&n.push(`${e}-error-message`),t.hint!==null&&n.push(`${e}-hint`),n.join(` `)}),r=(0,f.computed)(()=>t.errorMessage?`true`:void 0),i=(0,f.computed)(()=>t.isRequired?`true`:void 0),a=(0,f.computed)(()=>t.isLoading?`true`:void 0);return{isError:(0,f.computed)(()=>t.errorMessage!==void 0&&t.errorMessage!==null),ariaBusy:a,ariaDescribedBy:n,ariaInvalid:r,ariaRequired:i}}var tb={isDisabled:!1,disabledReason:null},nb={...tb,id:null,isReadonly:!1,isRequired:!1,name:null,class:null,style:null},rb={...tb,isErrorMessageHidden:!1,isHorizontal:!1,isLabelHidden:!1,isRequired:!1,errorMessage:null,for:null,helpText:null,hideErrorMessage:!1,hint:null,label:null},ib={isDisabled:!1,isLoading:!1,isReadonly:!1,iconLeft:null,iconRight:null,placeholder:null},ab={autocomplete:`off`};function ob(e,...t){let n={...e};for(let e of t)delete n[e];return n}var[sb,cb]=N(`badgeContext`),lb=z({compoundVariants:[{class:{base:`
289
+ `},variants:{isDrawer:{false:{chin:`top-0`},true:{chin:`bottom-0 rounded-b-none`}},size:{"full-screen":{content:`max-h-[90vh]`,contentWrapper:`max-w-[90vw]`,drawerContent:`h-[85dvh]`},lg:{contentWrapper:`max-w-160`},md:{contentWrapper:`max-w-140`},sm:{contentWrapper:`max-w-120`},xl:{contentWrapper:`max-w-180`},xs:{contentWrapper:`max-w-100`},xxs:{contentWrapper:`max-w-90`}}}}),hy={ref:`chinContent`,class:`w-full`},gy=(0,f.defineComponent)({__name:`DialogChin`,props:{chin:{}},setup(e){let t=e,n=(0,f.computed)(()=>t.chin!==null),r=(0,f.useTemplateRef)(`chinContent`),i=(0,f.ref)(38);(0,f.watch)(r,(e,t,n)=>{if(e==null)return;i.value=e.getBoundingClientRect().height;let r=new ResizeObserver(([e])=>{i.value=e?.contentRect.height??0});r.observe(e),n(()=>{r.disconnect()})},{immediate:!0});let a={default:`from-white/60 dark:from-white/15`,error:`from-error-secondary dark:from-error-secondary/20`},o=(0,f.computed)(()=>a[t.chin?.variant??`default`]),s={brand:`minimal-color`,default:`tertiary`,destructive:`destructive-tertiary`},c={brand:`primary`,default:`tertiary`,destructive:`destructive-tertiary`},l=(0,f.computed)(()=>t.chin?.variant===`error`?`text-error-500`:`text-primary`),{isDrawer:u,style:d}=py(),p=Kp(),m=(0,f.computed)(()=>t.chin?.pulseKey??`rest`),h=(0,f.computed)(()=>t.chin?.pulseKey!=null&&!p.value);return(e,r)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(_.Motion),{animate:{height:n.value?`calc(100% + ${i.value+14}px)`:`100%`},initial:!1,transition:{duration:(0,f.unref)(p)?0:.3,type:`spring`,bounce:0},class:(0,f.normalizeClass)([(0,f.unref)(d).chin(),`bg-white/20 dark:bg-white/10`]),as:`div`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(_.AnimatePresence),null,{default:(0,f.withCtx)(()=>[n.value?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(_.Motion),{key:0,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:(0,f.unref)(p)?0:.3,type:`spring`,bounce:0},as:`div`,class:`h-full`},{default:(0,f.withCtx)(()=>[((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(_.Motion),{key:m.value,initial:{opacity:1,scale:1},animate:h.value?{opacity:1,scale:[1,1,1],y:[0,3,0]}:{opacity:1,scale:1},transition:{duration:(0,f.unref)(p)?0:.2,ease:`easeInOut`,times:h.value?[0,.45,1]:void 0,type:`tween`},class:(0,f.normalizeClass)([[o.value,(0,f.unref)(u)?`rounded-t-[calc(1rem+5px)] rounded-b-none bg-linear-to-b`:`rounded-[calc(1rem+5px)] bg-linear-to-t`],`h-full to-transparent`]),as:`div`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(U,{justify:(0,f.unref)(u)?`start`:`end`,class:`h-full p-lg px-xl`},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,hy,[(0,f.createVNode)(P,{align:`center`,justify:`between`,class:`min-w-0 gap-md`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(P,{class:`min-w-0 flex-1 gap-md`},{default:(0,f.withCtx)(()=>[t.chin?.icon??!1?((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(t.chin?.icon),{key:0,class:(0,f.normalizeClass)([l.value,`size-4 shrink-0`])},null,8,[`class`])):(0,f.createCommentVNode)(``,!0),t.chin!==null&&t.chin.text?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(V),{key:1,text:t.chin.text,truncate:2,class:`min-w-0 flex-1 text-xs font-medium text-secondary`},null,8,[`text`])):(0,f.createCommentVNode)(``,!0)]),_:1}),(0,f.createVNode)(P,{items:`center`,gap:`none`,class:`shrink-0`},{default:(0,f.withCtx)(()=>[t.chin?.secondaryAction?((0,f.openBlock)(),(0,f.createElementBlock)(f.Fragment,{key:0},[t.chin.secondaryAction.type===`button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(q),{key:0,label:t.chin.secondaryAction.label,"is-loading":t.chin.secondaryAction.isLoading,"is-disabled":t.chin.secondaryAction.isDisabled,"disabled-reason":t.chin.secondaryAction.disabledReason,variant:s[t.chin.secondaryAction.variant??`default`],onClick:t.chin.secondaryAction.action},null,8,[`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):t.chin.secondaryAction.type===`link`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Gv),{key:1,label:t.chin.secondaryAction.label,to:t.chin.secondaryAction.to,link:t.chin.secondaryAction.link,variant:c[t.chin.secondaryAction.variant??`default`]},null,8,[`label`,`to`,`link`,`variant`])):t.chin.secondaryAction.type===`icon-button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(J),{key:2,icon:t.chin.secondaryAction.icon,label:t.chin.secondaryAction.label,"is-loading":t.chin.secondaryAction.isLoading,"is-disabled":t.chin.secondaryAction.isDisabled,"disabled-reason":t.chin.secondaryAction.disabledReason,variant:c[t.chin.secondaryAction.variant??`default`],onClick:t.chin.secondaryAction.action},null,8,[`icon`,`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):(0,f.createCommentVNode)(``,!0)],64)):(0,f.createCommentVNode)(``,!0),t.chin?.primaryAction?((0,f.openBlock)(),(0,f.createElementBlock)(f.Fragment,{key:1},[t.chin.primaryAction.type===`button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(q),{key:0,label:t.chin.primaryAction.label,"is-loading":t.chin.primaryAction.isLoading,"is-disabled":t.chin.primaryAction.isDisabled,"disabled-reason":t.chin.primaryAction.disabledReason,variant:s[t.chin.primaryAction.variant??`brand`],onClick:t.chin.primaryAction.action},null,8,[`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):t.chin.primaryAction.type===`link`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Gv),{key:1,label:t.chin.primaryAction.label,to:t.chin.primaryAction.to,link:t.chin.primaryAction.link,variant:c[t.chin.primaryAction.variant??`brand`]},null,8,[`label`,`to`,`link`,`variant`])):t.chin.primaryAction.type===`icon-button`?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(J),{key:2,icon:t.chin.primaryAction.icon,label:t.chin.primaryAction.label,"is-loading":t.chin.primaryAction.isLoading,"is-disabled":t.chin.primaryAction.isDisabled,"disabled-reason":t.chin.primaryAction.disabledReason,variant:c[t.chin.primaryAction.variant??`brand`],onClick:t.chin.primaryAction.action},null,8,[`icon`,`label`,`is-loading`,`is-disabled`,`disabled-reason`,`variant`,`onClick`])):(0,f.createCommentVNode)(``,!0)],64)):(0,f.createCommentVNode)(``,!0)]),_:1})]),_:1})],512)]),_:1},8,[`justify`])]),_:1},8,[`animate`,`transition`,`class`]))]),_:1},8,[`transition`])):(0,f.createCommentVNode)(``,!0)]),_:1})]),_:1},8,[`animate`,`transition`,`class`]))}}),_y=(0,f.defineComponent)({__name:`DialogClose`,setup(e){let t=py(null);return(e,n)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)((0,f.unref)(t)?.isDrawer.value===!0?(0,f.unref)(h.DrawerClose):(0,f.unref)(h.DialogClose)),{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`default`)]),_:3}))}}),vy=(0,f.defineComponent)({__name:`DialogCloseButton`,setup(e){let t=(0,g.useI18n)();return(e,n)=>((0,f.openBlock)(),(0,f.createBlock)(_y,null,{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(J),{icon:(0,f.unref)(ki),label:(0,f.unref)(t).t(`component.dialog.close`),"keyboard-shortcut":{key:`Escape`},class:`absolute top-0 right-0 z-10 m-lg`,variant:`tertiary`},null,8,[`icon`,`label`])]),_:1}))}});function yy(e){let t=py(null);(0,f.watch)(e,(e,n)=>{e?t?.registerNestedLayer():n&&t?.unregisterNestedLayer()}),(0,f.onBeforeUnmount)(()=>{e.value&&t?.unregisterNestedLayer()})}function by(){let e=(0,f.ref)(0),t=(0,f.computed)(()=>e.value>0);function n(){e.value+=1}function r(){--e.value}return{hasOpenNestedLayer:t,registerNestedLayer:n,unregisterNestedLayer:r}}function xy(){let e=(0,f.ref)(null),t=(0,f.ref)(!0),n=(0,f.ref)(!0);function r(){let r=e.value;r!==null&&(t.value=r.scrollTop<=1,n.value=r.scrollTop+r.clientHeight>=r.scrollHeight-1)}let i=null;return(0,f.watch)(e,(e,t,n)=>{e!==null&&(e.addEventListener(`scroll`,r,{passive:!0}),i=new ResizeObserver(r),i.observe(e),r(),n(()=>{e.removeEventListener(`scroll`,r),i?.disconnect(),i=null}))},{immediate:!0}),{isScrolledToBottom:n,isScrolledToTop:t,bodyRef:e}}var Sy={class:`relative flex max-h-full flex-col overflow-hidden rounded-t-3xl border-x border-t border-secondary bg-primary pb-[env(safe-area-inset-bottom)] shadow-lg`},Cy=(0,f.defineComponent)({__name:`ResponsiveDrawer`,props:(0,f.mergeModels)({title:{default:null},isSwipeToCloseDisabled:{type:Boolean,default:!1}},{isOpen:{type:Boolean,default:!1,required:!1},isOpenModifiers:{}}),emits:(0,f.mergeModels)([`afterLeave`,`autoFocusOnClose`,`escapeKeyDown`,`focusOutside`,`interactOutside`,`pointerDownOutside`],[`update:isOpen`]),setup(e,{emit:t}){let n=e,r=t,i=(0,f.useModel)(e,`isOpen`),a=dy(),o=(0,f.ref)(0);(0,f.watch)(i,e=>{e&&(o.value=a.registerOverlay())},{immediate:!0});function s(e){r(`escapeKeyDown`,e)}function c(e){r(`focusOutside`,e)}function l(e){r(`interactOutside`,e)}function u(e){r(`pointerDownOutside`,e)}function d(e){r(`autoFocusOnClose`,e)}function p(e,t){!e&&t?.reason===`swipe`&&n.isSwipeToCloseDisabled||(i.value=e)}function m(e){e||r(`afterLeave`)}return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.DrawerRoot),{open:i.value,"onUpdate:open":p,"onUpdate:openComplete":m},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DrawerTrigger),(0,f.mergeProps)({"as-child":!0},(0,f.toHandlers)(e.$attrs)),{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`trigger`)]),_:3},16),(0,f.createVNode)((0,f.unref)(h.DrawerPortal),{to:`body`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(Wi,{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DrawerOverlay),{style:(0,f.normalizeStyle)({zIndex:o.value}),class:`fixed inset-0 bg-linear-to-t from-black/50 to-black/25 dark:from-black/80 dark:to-black/50`,"data-animation":`drawer-overlay`,"data-drawer-overlay":``},null,8,[`style`])]),_:1}),(0,f.createVNode)(Wi,{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DrawerContent),{style:(0,f.normalizeStyle)({zIndex:o.value}),class:`fixed inset-x-0 bottom-0 flex max-h-[95dvh] flex-col will-change-transform outline-none`,"data-animation":`drawer-content`,onCloseAutoFocus:d,onEscapeKeyDown:s,onFocusOutside:c,onInteractOutside:l,onPointerDownOutside:u},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`behind`),(0,f.createElementVNode)(`div`,Sy,[(0,f.createVNode)((0,f.unref)(h.DrawerHandle),{class:`flex w-full shrink-0 justify-center py-md`},{default:(0,f.withCtx)(()=>[...t[0]||=[(0,f.createElementVNode)(`span`,{class:`h-1.5 w-10 rounded-full bg-quaternary`},null,-1)]]),_:1}),n.title===null?(0,f.createCommentVNode)(``,!0):((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.DrawerTitle),{key:0,class:`sr-only`},{default:(0,f.withCtx)(()=>[(0,f.createTextVNode)((0,f.toDisplayString)(n.title),1)]),_:1})),(0,f.renderSlot)(e.$slots,`content`)])]),_:3},8,[`style`])]),_:3})]),_:3})]),_:3},8,[`open`]))}}),wy=(0,f.defineComponent)({__name:`Dialog`,props:(0,f.mergeModels)({hasCloseButton:{type:Boolean,default:!0},isClickOutsideDisabled:{type:Boolean,default:!1},isEscDisabled:{type:Boolean,default:!1},chin:{default:null},preventClickOutside:{type:Boolean},preventEsc:{type:Boolean},showCloseButton:{type:Boolean},size:{default:`md`}},{isOpen:{type:Boolean,default:!1},isOpenModifiers:{}}),emits:(0,f.mergeModels)([`afterLeave`,`close`,`escapeKeyDown`,`update:isOpen`],[`update:isOpen`]),setup(e,{emit:t}){let n=e,r=t,i=(0,f.computed)(()=>n.isClickOutsideDisabled||n.preventClickOutside===!0),a=(0,f.computed)(()=>n.isEscDisabled||n.preventEsc===!0),o=(0,f.useModel)(e,`isOpen`),s=cy(),c=(0,f.computed)(()=>my({isDrawer:s.value,size:n.size})),{isScrolledToBottom:l,isScrolledToTop:u,bodyRef:d}=xy(),{hasOpenNestedLayer:p,registerNestedLayer:m,unregisterNestedLayer:g}=by();fy({hasOpenNestedLayer:p,isDrawer:s,isScrolledToBottom:l,isScrolledToTop:u,bodyRef:d,registerNestedLayer:m,style:c,unregisterNestedLayer:g});function _(e){r(`escapeKeyDown`,e),a.value&&e.preventDefault()}function v(e){i.value&&e.preventDefault()}function y(e){e||r(`close`)}function b(e){if(p.value){e.preventDefault();return}e.target instanceof Element&&(e.target.hasAttribute(`data-dialog-overlay`)||e.target.hasAttribute(`data-drawer-overlay`)||e.preventDefault())}let x=dy(),S=(0,f.ref)(0);return(0,f.watch)(o,e=>{e&&!s.value&&(S.value=x.registerOverlay())},{immediate:!0}),(e,t)=>(0,f.unref)(s)?((0,f.openBlock)(),(0,f.createBlock)(Cy,{key:0,"is-open":o.value,"onUpdate:isOpen":[t[0]||=e=>o.value=e,y],"is-swipe-to-close-disabled":i.value,onAfterLeave:t[1]||=e=>r(`afterLeave`),onEscapeKeyDown:_,onPointerDownOutside:v,onInteractOutside:b},{behind:(0,f.withCtx)(()=>[(0,f.createVNode)(gy,{chin:n.chin},null,8,[`chin`])]),content:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,{class:(0,f.normalizeClass)(c.value.drawerContent())},[(0,f.renderSlot)(e.$slots,`default`),n.hasCloseButton?((0,f.openBlock)(),(0,f.createBlock)(vy,{key:0})):(0,f.createCommentVNode)(``,!0)],2)]),_:3},8,[`is-open`,`is-swipe-to-close-disabled`])):((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.DialogRoot),{key:1,open:o.value,"onUpdate:open":[t[3]||=e=>o.value=e,y],modal:!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.DialogOverlay),{class:(0,f.normalizeClass)(c.value.overlay()),style:(0,f.normalizeStyle)({zIndex:S.value}),"data-animation":`dialog`,"data-dialog-overlay":``},null,8,[`class`,`style`]),(0,f.createVNode)((0,f.unref)(h.DialogContent),{class:(0,f.normalizeClass)(c.value.contentWrapper()),style:(0,f.normalizeStyle)({zIndex:S.value}),"data-animation":`dialog`,onEscapeKeyDown:_,onPointerDownOutside:v,onAfterLeave:t[2]||=e=>r(`afterLeave`),onInteractOutside:b},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,{class:(0,f.normalizeClass)(c.value.content())},[(0,f.renderSlot)(e.$slots,`default`),n.hasCloseButton?((0,f.openBlock)(),(0,f.createBlock)(vy,{key:0})):(0,f.createCommentVNode)(``,!0)],2),(0,f.createVNode)(gy,{chin:n.chin},null,8,[`chin`])]),_:3},8,[`class`,`style`])]),_:3},8,[`open`]))}}),Ty=(0,f.defineComponent)({__name:`DialogFooter`,props:{hasSeparator:{type:Boolean,default:!0},showSeparator:{type:Boolean}},setup(e){let t=e,n=py(null);return(e,r)=>((0,f.openBlock)(),(0,f.createElementBlock)(`div`,{class:(0,f.normalizeClass)((0,f.unref)(n)?.style.value.footer()),"data-dialog-footer":``},[t.hasSeparator?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Us),{key:0,class:(0,f.normalizeClass)([(0,f.unref)(n)!==null&&(0,f.unref)(n).isScrolledToBottom.value?`opacity-0`:`opacity-100`,`transition-opacity duration-150`])},null,8,[`class`])):(0,f.createCommentVNode)(``,!0),(0,f.createVNode)(P,{align:`center`,justify:`between`,gap:`lg`,class:`p-xl`},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,null,[(0,f.renderSlot)(e.$slots,`left`)]),(0,f.createVNode)(P,{align:`center`},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`right`),(0,f.renderSlot)(e.$slots,`default`)]),_:3})]),_:3})],2))}}),Ey=(0,f.defineComponent)({__name:`DialogFooterCancel`,props:{isAutoFocusDisabled:{type:Boolean},isDestructive:{type:Boolean},disableAutoFocus:{type:Boolean},disabledReason:{default:null},form:{default:null},iconLeft:{default:null},iconRight:{default:null},isDisabled:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},type:{default:`button`},label:{default:null}},emits:[`click`],setup(e,{emit:t}){let n=e,r=t,i=(0,g.useI18n)();return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)(_y,null,{default:(0,f.withCtx)(()=>[(0,f.createVNode)(q,(0,f.mergeProps)(n,{label:n.label??(0,f.unref)(i).t(`component.dialog.cancel`),variant:`secondary`,onClick:t[0]||=e=>r(`click`)}),null,16,[`label`])]),_:1}))}}),Dy=(0,f.defineComponent)({__name:`AutoFocus`,props:{isDisabled:{type:Boolean,default:!1}},setup(e){let t=e,n=(0,f.ref)(null);function r(e){let t=e.querySelectorAll(`a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])`),[n]=Array.from(t);return n??null}return(0,f.onMounted)(()=>{if(t.isDisabled)return;let e=n.value?.$el;if(e===null)return;let i=r(e);i!==null&&setTimeout(()=>{i.focus()})}),(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.Primitive),{ref_key:`primitiveRef`,ref:n},{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`default`)]),_:3},512))}}),Oy=(0,f.defineComponent)({__name:`DialogFooterPrimary`,props:{isAutoFocusDisabled:{type:Boolean,default:!1},isDestructive:{type:Boolean,default:!1},disableAutoFocus:{type:Boolean},disabledReason:{default:null},form:{default:null},iconLeft:{default:null},iconRight:{default:null},isDisabled:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},label:{},type:{default:`button`}},emits:[`click`],setup(e,{emit:t}){let n=e,r=t,i=(0,f.computed)(()=>n.isAutoFocusDisabled||n.disableAutoFocus===!0);return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Dy),{"is-disabled":i.value},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(q,(0,f.mergeProps)(n,{variant:n.isDestructive?`destructive-primary`:`primary`,onClick:t[0]||=e=>r(`click`)}),null,16,[`variant`])]),_:1},8,[`is-disabled`]))}}),ky=(0,f.defineComponent)({__name:`DialogHeader`,props:{title:{},hasSeparator:{type:Boolean,default:!0},isDescriptionHidden:{type:Boolean},description:{},hideDescription:{type:Boolean},icon:{default:null},iconVariant:{default:`brand`},showSeparator:{type:Boolean}},setup(e){let t=e,n=z({slots:{bg:``,text:``},variants:{variant:{brand:{bg:`bg-brand-secondary`,text:`text-brand-primary`},error:{bg:`bg-error-secondary`,text:`text-error-primary`},success:{bg:`bg-success-secondary`,text:`text-success-primary`},warning:{bg:`bg-warning-secondary`,text:`text-warning-primary`}}}}),r=(0,f.computed)(()=>n({variant:t.iconVariant})),i=(0,f.computed)(()=>t.isDescriptionHidden||t.hideDescription===!0),a=py(null),o=(0,f.computed)(()=>a?.isDrawer.value===!0);return(e,n)=>((0,f.openBlock)(),(0,f.createBlock)(U,{class:(0,f.normalizeClass)((0,f.unref)(a)?.style.value.header()),gap:`none`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(P,{align:t.hideDescription?`center`:`start`,gap:`xl`,class:`p-xl pb-0 group-has-data-dialog-body/dialog:pb-xl`},{default:(0,f.withCtx)(()=>[t.icon===null?(0,f.createCommentVNode)(``,!0):((0,f.openBlock)(),(0,f.createElementBlock)(`div`,{key:0,class:(0,f.normalizeClass)([r.value.bg(),`flex size-10 shrink-0 items-center justify-center rounded-full`])},[((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(t.icon),{class:(0,f.normalizeClass)([r.value.text(),`size-5`])},null,8,[`class`]))],2)),(0,f.createVNode)((0,f.unref)(U),{gap:`xxs`,class:`min-w-0 flex-1`},{default:(0,f.withCtx)(()=>[((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(o.value?(0,f.unref)(h.DrawerTitle):(0,f.unref)(h.DialogTitle)),{as:`h2`,class:`text-sm font-semibold text-primary`},{default:(0,f.withCtx)(()=>[(0,f.createTextVNode)((0,f.toDisplayString)(t.title),1)]),_:1})),((0,f.openBlock)(),(0,f.createBlock)((0,f.resolveDynamicComponent)(o.value?(0,f.unref)(h.DrawerDescription):(0,f.unref)(h.DialogDescription)),{class:(0,f.normalizeClass)([{"sr-only":i.value},`text-xs text-tertiary`]),as:`p`,innerHTML:t.description},null,8,[`class`,`innerHTML`]))]),_:1})]),_:1},8,[`align`]),t.hasSeparator?((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(Us),{key:0,class:(0,f.normalizeClass)([(0,f.unref)(a)!==null&&(0,f.unref)(a).isScrolledToTop.value?`opacity-0`:`opacity-100`,`transition-opacity duration-150`])},null,8,[`class`])):(0,f.createCommentVNode)(``,!0)]),_:1},8,[`class`]))}}),Ay=(0,f.defineComponent)({__name:`ConfirmDialog`,props:{title:{},isDestructive:{type:Boolean,default:!1},cancelLabel:{default:null},confirmLabel:{default:null},description:{},icon:{default:null},onConfirm:{},isClickOutsideDisabled:{type:Boolean,default:!1},isEscDisabled:{type:Boolean,default:!1},preventClickOutside:{type:Boolean},preventEsc:{type:Boolean}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=(0,g.useI18n)(),a=(0,f.ref)(!1);async function o(){a.value=!0;try{await n.onConfirm()}finally{a.value=!1}}function s(){r(`close`)}function c(){r(`close`)}return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)(wy,{"has-close-button":!1,"is-click-outside-disabled":n.isClickOutsideDisabled,"is-esc-disabled":n.isEscDisabled,"prevent-click-outside":n.preventClickOutside,"prevent-esc":n.preventEsc,size:`xxs`,onClose:c},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(ky,{title:n.title,description:n.description,icon:n.icon,"icon-variant":n.isDestructive?`error`:`brand`,"has-close-button":!1},null,8,[`title`,`description`,`icon`,`icon-variant`]),(0,f.createVNode)(Ty,null,{right:(0,f.withCtx)(()=>[(0,f.createVNode)(Ey,{label:n.cancelLabel,"is-disabled":a.value,onClick:s},null,8,[`label`,`is-disabled`]),(0,f.createVNode)(Oy,{label:n.confirmLabel??(0,f.unref)(i).t(`component.unsaved_changes_dialog.confirm`),"is-loading":a.value,"is-destructive":n.isDestructive,onClick:o},null,8,[`label`,`is-loading`,`is-destructive`])]),_:1})]),_:1},8,[`is-click-outside-disabled`,`is-esc-disabled`,`prevent-click-outside`,`prevent-esc`]))}});function jy(e){let t=(0,g.useI18n)(),n=PC().create(Ay);function r(){return new Promise(e=>{n.open({title:t.t(`component.unsaved_changes_dialog.title`),isDestructive:!0,cancelLabel:t.t(`component.unsaved_changes_dialog.cancel`),confirmLabel:t.t(`component.unsaved_changes_dialog.confirm`),description:t.t(`component.unsaved_changes_dialog.description`),onClose:()=>{e(!1)},onConfirm:()=>{n.close(),e(!0)}})})}(0,y.onBeforeRouteLeave)(async()=>{if(e.value)return await r()}),window.addEventListener(`beforeunload`,()=>{if(e.value)return t.t(`component.unsaved_changes_dialog.description`)})}var My=[`id`],Ny=(0,f.defineComponent)({__name:`Form`,props:{id:{default:null},isUnsavedChangesPromptEnabled:{type:Boolean,default:!0},form:{},promptOnUnsavedChanges:{type:Boolean,default:!0}},setup(e){let t=e,n=(0,f.useId)();return(0,f.computed)(()=>t.promptOnUnsavedChanges===!0?t.isUnsavedChangesPromptEnabled:!1).value&&jy(t.form.isDirty),iy({formId:t.id??n,form:t.form}),(e,r)=>((0,f.openBlock)(),(0,f.createElementBlock)(`form`,{id:t.id??(0,f.unref)(n),novalidate:!0,onSubmit:r[0]||=(0,f.withModifiers)(e=>t.form.submit(),[`prevent`])},[(0,f.renderSlot)(e.$slots,`default`)],40,My))}}),Py={alt:``,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,backspace:`⌫`,capslock:`⇪`,command:`⌘`,control:`⌃`,ctrl:``,delete:`⌦`,end:`↘`,enter:`↵`,escape:`Esc`,home:`↖`,option:`⌥`,pagedown:`⇟`,pageup:`⇞`,shift:`⇧`,tab:`⇥`,win:`⊞`,meta:``},Fy=/Macintosh;/,Iy=Ly();function Ly(){return typeof navigator>`u`||typeof navigator.userAgent!=`string`?!1:Fy.test(navigator.userAgent)}var Ry=(0,m.createSharedComposable)(()=>{let e=(0,f.reactive)({alt:` `,ctrl:` `,meta:` `});(0,f.onMounted)(()=>{e.meta=Iy?Py.command:`Ctrl`,e.ctrl=Iy?Py.control:`Ctrl`,e.alt=Iy?Py.option:`Alt`});function t(t){return[`meta`,`alt`,`ctrl`].includes(t)?e[t]:Py[t]||t}return{getKbdKey:t,IS_MACOS:Iy}}),zy=/^[^-]+.*-.*[^-]+$/,By=/^[^_]+.*_.*[^_]+$/,Vy=/^[a-z]$/i,Hy=/^\d$/,Uy=/^f\d+$/i,Wy=/^Key[A-Z]$/i,Gy=/^[a-z]{1}$/i,Ky=[`arrowleft`,`arrowright`,`arrowup`,`arrowright`,`tab`,`escape`,`enter`,`backspace`];function qy(e){return Vy.test(e)?`Key${e.toUpperCase()}`:Hy.test(e)?`Digit${e}`:Uy.test(e)?e.toUpperCase():{arrowdown:`ArrowDown`,arrowleft:`ArrowLeft`,arrowright:`ArrowRight`,arrowup:`ArrowUp`,backspace:`Backspace`,delete:`Delete`,enter:`Enter`,escape:`Escape`,space:`Space`,tab:`Tab`}[e.toLowerCase()]||e}function Jy(e,t={}){let n=(0,f.ref)([]);function r(){n.value.splice(0,n.value.length)}let i=(0,m.useDebounceFn)(r,t.chainDelay??800),{IS_MACOS:a}=Ry(),o=(0,m.useActiveElement)(),s=t.layoutIndependent??!1,c=new Set(Ky.map(e=>qy(e))),l=(0,f.computed)(()=>{let e=o.value?.tagName,t=o.value?.contentEditable;return e===`INPUT`||e===`TEXTAREA`||t===`true`||t===`plaintext-only`}),u=(0,f.computed)(()=>Object.entries((0,f.toValue)(e)).map(([e,t])=>{if(!t)return null;let n;e.includes(`-`)&&e!==`-`&&!e.includes(`_`)&&!e.match(zy)?.length&&console.warn(`[Shortcut] Invalid key: "${e}"`),e.includes(`_`)&&e!==`_`&&!e.match(By)?.length&&console.warn(`[Shortcut] Invalid key: "${e}"`);let r=e.includes(`-`)&&e!==`-`&&!e.includes(`_`);if(r)n=s?{altKey:!1,ctrlKey:!1,key:e.split(`-`).map(e=>qy(e)).join(`-`),metaKey:!1,shiftKey:!1}:{altKey:!1,ctrlKey:!1,key:e.toLowerCase(),metaKey:!1,shiftKey:!1};else{let t=e.toLowerCase().split(`_`).map(e=>e),r=t.filter(e=>![`meta`,`command`,`ctrl`,`shift`,`alt`,`option`].includes(e)).join(`_`);s&&(r=qy(r)),n={altKey:t.includes(`alt`)||t.includes(`option`),ctrlKey:t.includes(`ctrl`),key:r,metaKey:t.includes(`meta`)||t.includes(`command`),shiftKey:t.includes(`shift`)}}if(n.chained=r,!a&&n.metaKey&&!n.ctrlKey&&(n.metaKey=!1,n.ctrlKey=!0),typeof t==`function`?n.handler=t:typeof t==`object`&&(n={...n,handler:t.handler}),!n.handler)return console.warn(`[Shortcut] Invalid value`),null;let i=!0,o=e.split(r?`-`:`_`)[0];return o===`meta`||o===`command`||(t.usingInput?typeof t.usingInput==`string`&&(i=l.value===t.usingInput):i=!l.value),n.enabled=i,n}).filter(Boolean));function d(e){if(!e.key)return;let t=s?Wy.test(e.code):Gy.test(e.key),a=s?c.has(e.code):Ky.includes(e.key.toLowerCase()),o;if(n.value.push(s?e.code:e.key),n.value.length>=2){o=n.value.slice(-2).join(`-`);for(let t of u.value.filter(e=>e.chained))if(t.key===o){t.enabled&&t.handler(e),r();return}}for(let n of u.value.filter(e=>!e.chained)){if(s){if(e.code!==n.key)continue}else if(e.key.toLowerCase()!==n.key)continue;if(e.metaKey===n.metaKey&&e.ctrlKey===n.ctrlKey&&!((t||a)&&e.shiftKey!==n.shiftKey)){n.enabled&&n.handler(e),r();return}}i()}return(0,m.useEventListener)(`keydown`,d)}var Yy=(0,f.defineComponent)({__name:`FormSubmitButton`,props:{isKeyboardShortcutDisabled:{type:Boolean,default:!1},disableKeyboardShortcut:{type:Boolean},label:{},variant:{default:`primary`}},setup(e){let t=e,n=(0,f.computed)(()=>t.isKeyboardShortcutDisabled||t.disableKeyboardShortcut===!0),r={submit:{keys:[`meta`,`enter`],shortcutKey:`meta_enter`}},{formId:i,form:a}=ay();return Jy({[r.submit.shortcutKey]:()=>{n.value||a.submit()}}),(e,o)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.Primitive),(0,f.mergeProps)({"as-child":!0},t,{"is-loading":(0,f.unref)(a).isSubmitting.value,form:(0,f.unref)(i),type:`submit`}),{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`default`,{},()=>[(0,f.createVNode)((0,f.unref)(q),{label:t.label,form:(0,f.unref)(i),variant:t.variant,"keyboard-shortcut-keys":n.value?null:r.submit.keys},null,8,[`label`,`form`,`variant`,`keyboard-shortcut-keys`])])]),_:3},16,[`is-loading`,`form`]))}}),Xy=(0,f.defineComponent)({__name:`PopoverArrow`,setup(e){return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.PopoverArrow),{class:`relative -mb-4 h-4 w-10 -translate-y-px overflow-hidden`,as:`div`},{default:(0,f.withCtx)(()=>[...t[0]||=[(0,f.createElementVNode)(`div`,{class:`absolute left-1/2 size-4 -translate-x-1/2 -translate-y-3 rotate-45 rounded-xxs border border-secondary bg-primary shadow-lg`},null,-1)]]),_:1}))}}),Zy={class:`relative size-full overflow-hidden rounded-md border border-secondary bg-primary shadow-lg`},Qy=(0,f.defineComponent)({__name:`Popover`,props:(0,f.mergeModels)((0,f.mergeDefaults)({isPrioritizedPosition:{type:Boolean},isSideFlipDisabled:{type:Boolean},isUpdateOnLayoutShiftDisabled:{type:Boolean},disableSideFlip:{type:Boolean},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},isPopoverArrowVisible:{type:Boolean},popoverAlign:{},popoverAlignOffset:{},popoverAnchorReferenceElement:{},popoverAnimationName:{},popoverCollisionPadding:{},popoverContainerElement:{},popoverSide:{},popoverSideOffset:{},popoverWidth:{}},{...Ji,isPrioritizedPosition:!1,isSideFlipDisabled:!1,isUpdateOnLayoutShiftDisabled:!1}),{isOpen:{type:Boolean,default:!1,required:!1},isOpenModifiers:{}}),emits:(0,f.mergeModels)([`autoFocusOnClose`,`escapeKeyDown`,`focusOutside`,`interactOutside`],[`update:isOpen`]),setup(e,{emit:t}){let n=e,r=t,i=(0,f.computed)(()=>n.isPrioritizedPosition||n.prioritizePosition===!0),a=(0,f.computed)(()=>n.isSideFlipDisabled||n.disableSideFlip===!0),o=(0,f.computed)(()=>n.isUpdateOnLayoutShiftDisabled||n.disableUpdateOnLayoutShift===!0),s=(0,f.useModel)(e,`isOpen`);yy(s);function c(e){r(`escapeKeyDown`,e)}function l(e){r(`focusOutside`,e)}function u(e){r(`interactOutside`,e)}function d(e){r(`autoFocusOnClose`,e)}return(e,t)=>((0,f.openBlock)(),(0,f.createBlock)((0,f.unref)(h.PopoverRoot),{open:s.value,"onUpdate:open":t[0]||=e=>s.value=e},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.PopoverAnchor),{"as-child":!0,reference:n.popoverAnchorReferenceElement??void 0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.PopoverTrigger),(0,f.mergeProps)({"as-child":!0},(0,f.toHandlers)(e.$attrs)),{default:(0,f.withCtx)(()=>[(0,f.renderSlot)(e.$slots,`trigger`)]),_:3},16)]),_:3},8,[`reference`]),(0,f.createVNode)((0,f.unref)(h.PopoverPortal),{to:`body`},{default:(0,f.withCtx)(()=>[(0,f.createVNode)(Wi,{"as-child":!0},{default:(0,f.withCtx)(()=>[(0,f.createVNode)((0,f.unref)(h.PopoverContent),{align:n.popoverAlign,"align-offset":n.popoverAlignOffset,"collision-padding":n.popoverCollisionPadding,"collision-boundary":n.popoverContainerElement,side:n.popoverSide,"side-offset":n.popoverSideOffset,class:(0,f.normalizeClass)([{"w-(--reka-popover-trigger-width)":n.popoverWidth===`anchor-width`,"w-(--reka-popover-content-available-width)":n.popoverWidth===`available-width`},`z-50 origin-(--reka-popover-content-transform-origin)`]),"prioritize-position":i.value,"data-animation":n.popoverAnimationName??`popover-default`,"disable-update-on-layout-shift":o.value,"side-flip":!a.value,"position-strategy":`absolute`,sticky:`always`,onCloseAutoFocus:d,onEscapeKeyDown:c,onFocusOutside:l,onInteractOutside:u},{default:(0,f.withCtx)(()=>[(0,f.createElementVNode)(`div`,Zy,[(0,f.renderSlot)(e.$slots,`content`)]),n.isPopoverArrowVisible?((0,f.openBlock)(),(0,f.createBlock)(Xy,{key:0})):(0,f.createCommentVNode)(``,!0)]),_:3},8,[`align`,`align-offset`,`collision-padding`,`collision-boundary`,`side`,`side-offset`,`class`,`prioritize-position`,`data-animation`,`disable-update-on-layout-shift`,`side-flip`])]),_:3})]),_:3})]),_:3},8,[`open`]))}});function $y(e){return e.map(e=>({type:`option`,value:e}))}function eb(e,t){let n=(0,f.computed)(()=>{if(t.errorMessage===null&&t.hint===null)return;let n=[];return t.errorMessage!==null&&n.push(`${e}-error-message`),t.hint!==null&&n.push(`${e}-hint`),n.join(` `)}),r=(0,f.computed)(()=>t.errorMessage?`true`:void 0),i=(0,f.computed)(()=>t.isRequired?`true`:void 0),a=(0,f.computed)(()=>t.isLoading?`true`:void 0);return{isError:(0,f.computed)(()=>t.errorMessage!==void 0&&t.errorMessage!==null),ariaBusy:a,ariaDescribedBy:n,ariaInvalid:r,ariaRequired:i}}var tb={isDisabled:!1,disabledReason:null},nb={...tb,id:null,isReadonly:!1,isRequired:!1,name:null,class:null,style:null},rb={...tb,isErrorMessageHidden:!1,isHorizontal:!1,isLabelHidden:!1,isRequired:!1,errorMessage:null,for:null,helpText:null,hideErrorMessage:!1,hint:null,label:null},ib={isDisabled:!1,isLoading:!1,isReadonly:!1,iconLeft:null,iconRight:null,placeholder:null},ab={autocomplete:`off`};function ob(e,...t){let n={...e};for(let e of t)delete n[e];return n}var[sb,cb]=N(`badgeContext`),lb=z({compoundVariants:[{class:{base:`
290
290
  border-brand-400
291
291
  dark:border-brand-600
292
292
  `,dot:`bg-brand-500`,icon:`
package/dist/index.js CHANGED
@@ -20844,7 +20844,10 @@ var KC = Ve(GC), [qC, JC] = G("dialogContext"), YC = X({
20844
20844
  class: E([[f.value, R(_) ? "rounded-t-[calc(1rem+5px)] rounded-b-none bg-linear-to-b" : "rounded-[calc(1rem+5px)] bg-linear-to-t"], "h-full to-transparent"]),
20845
20845
  as: "div"
20846
20846
  }, {
20847
- default: V(() => [m(Md, { class: E([R(_) ? "justify-start" : "justify-end", "h-full p-lg px-xl"]) }, {
20847
+ default: V(() => [m(Md, {
20848
+ justify: R(_) ? "start" : "end",
20849
+ class: "h-full p-lg px-xl"
20850
+ }, {
20848
20851
  default: V(() => [u("div", XC, [m(K, {
20849
20852
  align: "center",
20850
20853
  justify: "between",
@@ -20958,7 +20961,7 @@ var KC = Ve(GC), [qC, JC] = G("dialogContext"), YC = X({
20958
20961
  _: 1
20959
20962
  })], 512)]),
20960
20963
  _: 1
20961
- }, 8, ["class"])]),
20964
+ }, 8, ["justify"])]),
20962
20965
  _: 1
20963
20966
  }, 8, [
20964
20967
  "animate",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "type": "module",
7
- "version": "1.27.1",
7
+ "version": "1.27.2",
8
8
  "license": "SEE LICENSE IN LICENSE.md",
9
9
  "repository": {
10
10
  "type": "git",
@@ -49,8 +49,8 @@
49
49
  "vue-router": "^4.6.4",
50
50
  "vue-sonner": "2.0.9",
51
51
  "zod": "4.3.5",
52
- "@wisemen/vue-core-actions": "^0.5.0",
53
52
  "@wisemen/vue-core-dates": "^1.1.1",
53
+ "@wisemen/vue-core-actions": "^0.5.0",
54
54
  "formango": "^3.2.6"
55
55
  },
56
56
  "dependencies": {
@@ -67,9 +67,9 @@
67
67
  "vue-component-type-helpers": "3.3.0",
68
68
  "vue-sonner": "2.0.9",
69
69
  "@wisemen/vue-core-api-utils": "2.0.6",
70
+ "@wisemen/vue-core-dates": "1.1.1",
70
71
  "@wisemen/vue-core-utils": "0.1.2",
71
- "@wisemen/vue-core-icons": "0.0.4",
72
- "@wisemen/vue-core-dates": "1.1.1"
72
+ "@wisemen/vue-core-icons": "0.0.4"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@chromatic-com/storybook": "5.0.2",
@@ -107,8 +107,8 @@
107
107
  "@wisemen/eslint-config-vue": "2.1.6",
108
108
  "@wisemen/vue-core-actions": "0.5.0",
109
109
  "@wisemen/vue-core-dates": "1.1.1",
110
- "@wisemen/vue-core-tailwind-config": "0.1.2",
111
- "formango": "3.2.6"
110
+ "formango": "3.2.6",
111
+ "@wisemen/vue-core-tailwind-config": "0.1.2"
112
112
  },
113
113
  "scripts": {
114
114
  "build": "vite build",