PageSourceSearch

https://open.marblework.app/_nuxt/B6_Mmobk.js

js marblework.app collected 2026-10-02 00:26:51 UTC 176,778 bytes, 1 lines download raw bytes

1import{_ as Qe}from"./Dlp581so.js";import{aV as Kt,bn as fn,aD as ve,aI as Xt,aG as Ct,aJ as ke,o as s,c as D,w as y,P as V,g as e,aK as Ce,aL as He,bJ as St,x as j,l as ae,A as Me,a as Lt,e as C,R as oe,C as B,aN as Tt,n as P,E as Ot,aM as ma,am as Ia,bK as Je,bz as dt,bU as Ca,af as et,p as vn,bG as mn,M as Ze,N as Sa,b3 as ga,at as La,as as xt,b as O,F as re,bB as Gt,bH as gn,y as We,m as De,aw as tt,d as _,B as T,t as I,b6 as hn,u as xe,z as at,aa as ct,f as se,r as Le,V as wt,h as K,v as Be,a8 as yn,G as pt,H as ft,J as ze,a1 as Re,a2 as Yt,O as kt,Q as vt,bP as bn,S as Fe,T as st,W as zt,X as ot,a3 as we,L as Ae,bO as Vt,$ as _n,aY as Jt,s as $e,i as Oe,al as Ta,ar as Oa,ag as wn,ad as mt,a4 as Zt,U as xn,a6 as Qt,k as Te,ai as ea,bV as kn,j as ta,a9 as Dt,D as Ft,a$ as $n,bp as In,I as qt,bW as Cn,bX as Sn,bC as Ln,K as Da,bY as qa,bZ as Ba,Y as rt,Z as ut,b_ as Pa,b$ as Aa,ac as Ma,c0 as $t,c1 as It,c2 as Tn,c3 as Ea,c4 as za,aF as On,ah as Dn,aj as ha,aP as Ra,ak as qn,ae as Bn,aU as Pn,au as An,aA as Mn}from"./B0mNtK3X.js";import{u as En,_ as zn,n as Rn}from"./CkhDQqH9.js";import{_ as ja}from"./B2iP2pzw.js";import{u as gt}from"./BN1ohDtG.js";import{u as aa}from"./6OkFRQbn.js";import{u as Na}from"./32Bqtcn_.js";import{i as jn}from"./WsjsyaGz.js";import{u as na}from"./h8CpXX5r.js";import{_ as Bt}from"./Dli8s6NQ.js";import{_ as Ua}from"./B1cd7YQN.js";import{_ as Va}from"./DS6Jjn63.js";import{_ as Fa}from"./D0jBudSu.js";import{_ as Ha}from"./CzF6W6s8.js";import{_ as Wa}from"./DxqLuLv4.js";import{u as Nn}from"./BgRUeQjb.js";import{_ as Un}from"./C92Ia5on.js";import{u as Ka}from"./BxDrEhbb.js";import{u as Xa}from"./CkMw93QX.js";import{u as Vn}from"./CKIhMykQ.js";import{u as oa,d as Fn,a as Hn,_ as Wn,p as Kn,b as Xn,c as Gn}from"./DkoeFhFl.js";import{_ as Yn}from"./B0zzGWuo.js";import{d as je}from"./D84-0CRA.js";import{u as Jn}from"./B_tqnlA1.js";import{_ as la}from"./CbmQILVT.js";import{_ as Zn}from"./TZM0RZOJ.js";import{t as Qn}from"./BoxNsp0r.js";import{u as Ga}from"./CDYMLJfH.js";import{e as Rt}from"./Cibj3C8w.js";import{a as eo}from"./lhcyNJhe.js";import"./N6vRbo-F.js";import"./DMRyVoyL.js";import"./DI8I9sse.js";import"./Cp4VHxXp.js";import"./qCwQHWlQ.js";import"./CYkDGJwY.js";import"./BEP62XWZ.js";import"./AvbMIwz1.js";import"./fITo8g8I.js";import"./Dp3dgQIK.js";import"./eOZK6b21.js";import"./D1A-3Aho.js";import"./B6ftWAWB.js";import"./CJHIUm5B.js";import"./CwZPlw6g.js";import"./CXih95ct.js";import"./DSsE4Pl3.js";import"./DqhmIVNL.js";import"./B6xei8nG.js";function ya(t,i){const l=Kt().hook(t,i);fn(l)}const[Ya,to]=He("CollapsibleRoot");var ao=ve({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(t,{expose:i,emit:a}){const l=t,v=Xt(l,"open",a,{defaultValue:l.defaultOpen,passive:l.open===void 0}),{disabled:r,unmountOnHide:f}=Ct(l);return to({contentId:"",disabled:r,open:v,unmountOnHide:f,onOpenToggle:()=>{r.value||(v.value=!v.value)}}),i({open:v}),ke(),(g,L)=>(s(),D(e(Ce),{as:g.as,"as-child":l.asChild,"data-state":e(v)?"open":"closed","data-disabled":e(r)?"":void 0},{default:y(()=>[V(g.$slots,"default",{open:e(v)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),no=ao,oo=ve({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(t,{emit:i}){const a=t,l=i,n=Ya();n.contentId||=St(void 0,"reka-collapsible-content");const v=j(),{forwardRef:r,currentElement:f}=ke(),g=j(0),L=j(0),q=P(()=>n.open.value),h=j(q.value),p=j();ae(()=>[q.value,v.value?.present],async()=>{await Ot();const c=f.value;if(!c)return;p.value=p.value||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const k=c.getBoundingClientRect();L.value=k.height,g.value=k.width,h.value||(c.style.transitionDuration=p.value.transitionDuration,c.style.animationName=p.value.animationName)},{immediate:!0});const d=P(()=>h.value&&n.open.value);return Me(()=>{requestAnimationFrame(()=>{h.value=!1})}),Lt(f,"beforematch",c=>{requestAnimationFrame(()=>{n.onOpenToggle(),l("contentFound")})}),(c,k)=>(s(),D(e(Tt),{ref_key:"presentRef",ref:v,present:c.forceMount||e(n).open.value,"force-mount":!0},{default:y(({present:S})=>[C(e(Ce),oe(c.$attrs,{id:e(n).contentId,ref:e(r),"as-child":a.asChild,as:c.as,hidden:S?void 0:e(n).unmountOnHide.value?"":"until-found","data-state":d.value?void 0:e(n).open.value?"open":"closed","data-disabled":e(n).disabled?.value?"":void 0,style:{"--reka-collapsible-content-height":`${L.value}px`,"--reka-collapsible-content-width":`${g.value}px`}}),{default:y(()=>[!e(n).unmountOnHide.value||S?V(c.$slots,"default",{key:0}):B("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]),_:3},8,["present"]))}}),lo=oo,so=ve({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const i=t;ke();const a=Ya();return(l,n)=>(s(),D(e(Ce),{type:l.as==="button"?"button":void 0,as:l.as,"as-child":i.asChild,"aria-controls":e(a).contentId,"aria-expanded":e(a).open.value,"data-state":e(a).open.value?"open":"closed","data-disabled":e(a).disabled?.value?"":void 0,disabled:e(a).disabled?.value,onClick:e(a).onOpenToggle},{default:y(()=>[V(l.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"]))}}),io=so;function ro({type:t,defaultValue:i,modelValue:a}){const l=a||i;return a!==void 0||i!==void 0?Array.isArray(l)?"multiple":"single":t??"single"}function uo({type:t,defaultValue:i,modelValue:a}){return t||ro({type:t,defaultValue:i,modelValue:a})}function co({type:t,defaultValue:i}){return i!==void 0?i:t==="single"?void 0:[]}function po(t,i){const a=P(()=>uo(t)),l=Xt(t,"modelValue",i,{defaultValue:co(t),passive:t.modelValue===void 0,deep:!0});function n(r){if(a.value==="single")l.value=ma(r,l.value)?void 0:r;else{const f=Array.isArray(l.value)?[...l.value||[]]:[l.value].filter(
1Boolean);if(jn(f,r)){const g=f.findIndex(L=>ma(L,r));f.splice(g,1)}else f.push(r);l.value=f}}const v=P(()=>a.value==="single");return{modelValue:l,changeModelValue:n,isSingle:v}}const[sa,fo]=He("AccordionRoot");var vo=ve({__name:"AccordionRoot",props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:"vertical"},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const a=t,l=i,{dir:n,disabled:v,unmountOnHide:r}=Ct(a),f=Na(n),{modelValue:g,changeModelValue:L,isSingle:q}=po(a,l),{forwardRef:h,currentElement:p}=ke();return fo({disabled:v,direction:f,orientation:a.orientation,parentElement:p,isSingle:q,collapsible:a.collapsible,modelValue:g,changeModelValue:L,unmountOnHide:r}),(d,c)=>(s(),D(e(Ce),{ref:e(h),"as-child":d.asChild,as:d.as},{default:y(()=>[V(d.$slots,"default",{modelValue:e(g)})]),_:3},8,["as-child","as"]))}}),ba=vo,Ht=(function(t){return t.Open="open",t.Closed="closed",t})(Ht||{});const[Ja,mo]=He("AccordionItem");var go=ve({__name:"AccordionItem",props:{disabled:{type:Boolean,required:!1},value:{type:String,required:!0},unmountOnHide:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t,{expose:i}){const a=t,l=sa(),n=P(()=>l.isSingle.value?a.value===l.modelValue.value:Array.isArray(l.modelValue.value)&&l.modelValue.value.includes(a.value)),v=P(()=>l.disabled.value||a.disabled),r=P(()=>v.value?"":void 0),f=P(()=>n.value?Ht.Open:Ht.Closed);i({open:n,dataDisabled:r});const{currentRef:g,currentElement:L}=ke();mo({open:n,dataState:f,disabled:v,dataDisabled:r,triggerId:"",currentRef:g,currentElement:L,value:P(()=>a.value)});function q(h){const p=h.target;if(Array.from(l.parentElement.value?.querySelectorAll("[data-reka-collection-item]")??[]).findIndex(k=>k===p)===-1)return null;na(h,p,l.parentElement.value,{arrowKeyOptions:l.orientation,dir:l.direction.value,focus:!0})}return(h,p)=>(s(),D(e(no),{"data-orientation":e(l).orientation,"data-disabled":r.value,"data-state":f.value,disabled:v.value,open:n.value,as:a.as,"as-child":a.asChild,"unmount-on-hide":a.unmountOnHide??e(l).unmountOnHide.value,onKeydown:Ia(q,["up","down","left","right","home","end"])},{default:y(()=>[V(h.$slots,"default",{open:n.value})]),_:3},8,["data-orientation","data-disabled","data-state","disabled","open","as","as-child","unmount-on-hide"]))}}),ho=go,yo=ve({__name:"AccordionContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const i=t,a=sa(),l=Ja();return ke(),(n,v)=>(s(),D(e(lo),{role:"region","as-child":i.asChild,as:n.as,"force-mount":i.forceMount,"aria-labelledby":e(l).triggerId,"data-state":e(l).dataState.value,"data-disabled":e(l).dataDisabled.value,"data-orientation":e(a).orientation,style:{"--reka-accordion-content-width":"var(--reka-collapsible-content-width)","--reka-accordion-content-height":"var(--reka-collapsible-content-height)"},onContentFound:v[0]||(v[0]=r=>e(a).changeModelValue(e(l).value.value))},{default:y(()=>[V(n.$slots,"default")]),_:3},8,["as-child","as","force-mount","aria-labelledby","data-state","data-disabled","data-orientation"]))}}),bo=yo,_o=ve({__name:"AccordionTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const i=t,a=sa(),l=Ja();l.triggerId||=St(void 0,"reka-accordion-trigger");function n(){const v=a.isSingle.value&&l.open.value&&!a.collapsible;l.disabled.value||v||a.changeModelValue(l.value.value)}return(v,r)=>(s(),D(e(io),{id:e(l).triggerId,ref:e(l).currentRef,"data-reka-collection-item":"",as:i.as,"as-child":i.asChild,"aria-disabled":e(l).disabled.value||void 0,"aria-expanded":e(l).open.value||!1,"data-disabled":e(l).dataDisabled.value,"data-orientation":e(a).orientation,"data-state":e(l).dataState.value,disabled:e(l).disabled.value,onClick:n},{default:y(()=>[V(v.$slots,"default")]),_:3},8,["id","as","as-child","aria-disabled","aria-expanded","data-disabled","data-orientation","data-state","disabled"]))}}),_a=_o;function Pt(t){return t?"open":"closed"}function Za(t,i){return`${t}-trigger-${i}`}function ia(t,i){return`${t}-content-${i}`}const wo="navigationMenu.linkSelect",it="navigationMenu.rootContentDism
1iss";function Wt(t){const i=[],a=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const n=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||n?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)i.push(a.currentNode);return i}function Qa(t){const i=Je();return t.some(a=>a===i?!0:(a.focus(),Je()!==i))}function xo(t){return t.forEach(i=>{i.dataset.tabindex=i.getAttribute("tabindex")||"",i.setAttribute("tabindex","-1")}),()=>{t.forEach(i=>{const a=i.dataset.tabindex;i.setAttribute("tabindex",a)})}}function en(t){return i=>i.pointerType==="mouse"?t(i):void 0}const[Ke,ko]=He(["NavigationMenuRoot","NavigationMenuSub"],"NavigationMenuContext");var $o=ve({__name:"NavigationMenuRoot",props:{modelValue:{type:String,required:!1,default:void 0},defaultValue:{type:String,required:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:"horizontal"},delayDuration:{type:Number,required:!1,default:200},skipDelayDuration:{type:Number,required:!1,default:300},disableClickTrigger:{type:Boolean,required:!1,default:!1},disableHoverTrigger:{type:Boolean,required:!1,default:!1},disablePointerLeaveClose:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"nav"}},emits:["update:modelValue"],setup(t,{emit:i}){const a=t,n=Xt(a,"modelValue",i,{defaultValue:a.defaultValue??"",passive:a.modelValue===void 0}),v=j(""),{forwardRef:r,currentElement:f}=ke(),g=j(),L=j(),q=j(),{getItems:h,CollectionSlot:p}=dt({key:"NavigationMenu",isProvider:!0}),{delayDuration:d,skipDelayDuration:c,dir:k,disableClickTrigger:S,disableHoverTrigger:z,unmountOnHide:b}=Ct(a),m=Na(k),w=Ca(!1,c),x=P(()=>n.value!==""||w.value?150:d.value),A=vn(u=>{typeof u=="string"&&(v.value=n.value,n.value=u)},x);et(()=>{if(!n.value)return;const u=h().map($=>$.ref);q.value=u.find($=>$.id.includes(n.value))}),Lt(f,it,o),ko({isRootMenu:!0,modelValue:n,previousValue:v,baseId:St(void 0,"reka-navigation-menu"),disableClickTrigger:S,disableHoverTrigger:z,dir:m,unmountOnHide:b,orientation:a.orientation,rootNavigationMenu:f,indicatorTrack:g,activeTrigger:q,onIndicatorTrackChange:u=>{g.value=u},viewport:L,onViewportChange:u=>{L.value=u},onTriggerEnter:u=>{A(u)},onTriggerLeave:()=>{w.value=!0,A("")},onContentEnter:()=>{A()},onContentLeave:()=>{a.disablePointerLeaveClose||A("")},onItemSelect:u=>{v.value=n.value,n.value=u},onItemDismiss:o});function o(){v.value=n.value,n.value=""}return(u,$)=>(s(),D(e(p),null,{default:y(()=>[C(e(Ce),{ref:e(r),as:u.as,"as-child":u.asChild,"data-orientation":u.orientation,dir:e(m),"data-reka-navigation-menu":""},{default:y(()=>[V(u.$slots,"default",{modelValue:e(n)})]),_:3},8,["as","as-child","data-orientation","dir"])]),_:3}))}}),Io=$o;const[ra,Co]=He("NavigationMenuItem");var So=ve({__name:"NavigationMenuItem",props:{value:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"li"}},setup(t){const i=t;ke();const{getItems:a}=dt({key:"NavigationMenu"}),l=Ke(),n=St(i.value),v=j(),r=j(),f=ia(l.baseId,n);let g=()=>({});const L=j(!1);async function q(c="start"){const k=document.getElementById(f);if(k){g();const S=Wt(k);S.length&&Qa(c==="start"?S:S.reverse())}}function h(){const c=document.getElementById(f);if(c){const k=Wt(c);k.length&&(g=xo(k))}}Co({value:n,contentId:f,triggerRef:v,focusProxyRef:r,wasEscapeCloseRef:L,onEntryKeyDown:q,onFocusProxyEnter:q,onContentFocusOutside:h,onRootContentClose:h});function p(){l.onItemDismiss(),v.value?.focus()}function d(c){const k=Je();if(c.keyCode===32||c.key==="Enter")if(l.modelValue.value===n){p(),c.preventDefault();return}else{c.target.click(),c.preventDefault();return}const S=a().filter(b=>b.ref.parentElement?.hasAttribute("data-menu-item")).map(b=>b.ref);if(!S.includes(k))return;const z=na(c,k,void 0,{itemsArray:S,loop:!1});z&&z?.focus(),c.preventDefault(),c.stopPropagation()}return(c,k)=>(s(),D(e(Ce),{"as-child":c.asChild,as:c.as,"data-menu-item":"",onKeydown:Ia(d,["up","down","left","right","home","end","space"])},{default:y(()=>[V(c.$slots,"default")]),_:3},8,["as-child","as"]))}}),Lo=So,To=ve({__name:"NavigationMenuContentImpl",props:{disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(t,{emit:i}){const a=t,l=i,{getItems:n}=dt({key:"NavigationMenu"}),{forwardRef:v,currentElement:r}=ke(),f=Ke(),g=ra(),L=Za(f.baseId,g.value),q=ia(f.baseId,g.value),h=j(null),p=P(()=>{const b=n().map(u=>u.ref.id.split("trigger-")[1]);f.dir.value==="rtl"&&b.reverse();const m=b.indexOf(f.modelValue.value),w=b.indexOf(f.previousValue.value),x=g.value===f.modelValue.value,A=w===b.indexOf(g.value);if(!x&&!A)return h.value;const o=(()=>
1{if(m!==w){if(x&&w!==-1)return m>w?"from-end":"from-start";if(A&&m!==-1)return m>w?"to-start":"to-end"}return null})();return h.value=o,o});function d(b){if(l("focusOutside",b),l("interactOutside",b),b.detail.originalEvent.target.hasAttribute("data-navigation-menu-trigger")&&b.preventDefault(),!b.defaultPrevented){g.onContentFocusOutside();const w=b.target;f.rootNavigationMenu?.value?.contains(w)&&b.preventDefault()}}function c(b){if(l("pointerDownOutside",b),!b.defaultPrevented){const m=b.target,w=n().some(A=>A.ref.contains(m)),x=f.isRootMenu&&f.viewport.value?.contains(m);(w||x||!f.isRootMenu)&&b.preventDefault()}}et(b=>{const m=r.value;if(f.isRootMenu&&m){const w=()=>{f.onItemDismiss(),g.onRootContentClose(),m.contains(Je())&&g.triggerRef.value?.focus()};m.addEventListener(it,w),b(()=>m.removeEventListener(it,w))}});function k(b){l("escapeKeyDown",b),b.defaultPrevented||(f.onItemDismiss(),g.triggerRef?.value?.focus(),g.wasEscapeCloseRef.value=!0)}function S(b){if(b.target.closest("[data-reka-navigation-menu]")!==f.rootNavigationMenu.value)return;const m=b.altKey||b.ctrlKey||b.metaKey,w=b.key==="Tab"&&!m,x=Wt(b.currentTarget);if(w){const o=Je(),u=x.findIndex(U=>U===o),R=b.shiftKey?x.slice(0,u).reverse():x.slice(u+1,x.length);if(Qa(R))b.preventDefault();else{g.focusProxyRef.value?.focus();return}}na(b,Je(),void 0,{itemsArray:x,loop:!1,enableIgnoredElement:!0})?.focus()}function z(){const b=new Event(it,{bubbles:!0,cancelable:!0});r.value?.dispatchEvent(b)}return(b,m)=>(s(),D(e(mn),oe({id:e(q),ref:e(v),"aria-labelledby":e(L),"data-motion":p.value,"data-state":e(Pt)(e(f).modelValue.value===e(g).value),"data-orientation":e(f).orientation},a,{onKeydown:S,onEscapeKeyDown:k,onPointerDownOutside:c,onFocusOutside:d,onDismiss:z}),{default:y(()=>[V(b.$slots,"default")]),_:3},16,["id","aria-labelledby","data-motion","data-state","data-orientation"]))}}),Oo=To,Do=ve({inheritAttrs:!1,__name:"NavigationMenuContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(t,{emit:i}){const a=t,l=i,n=Ze(Sa(a,"forceMount"),l),{forwardRef:v}=ke(),r=Ke(),f=ra(),g=P(()=>f.value===r.modelValue.value),L=P(()=>r.viewport.value&&!r.modelValue.value&&r.previousValue.value?r.previousValue.value===f.value:!1);return(q,h)=>(s(),D(La,{to:e(ga)&&e(r).viewport.value?e(r).viewport.value:"body",disabled:e(ga)&&e(r).viewport.value?!e(r).viewport.value:!0},[C(e(Tt),{present:q.forceMount||g.value||L.value,"force-mount":!e(r).unmountOnHide.value},{default:y(({present:p})=>[C(Oo,oe({ref:e(v),"data-state":e(Pt)(g.value),style:{pointerEvents:!g.value&&e(r).isRootMenu?"none":void 0}},{...q.$attrs,...e(n)},{hidden:!p,onPointerenter:h[0]||(h[0]=d=>e(r).onContentEnter(e(f).value)),onPointerleave:h[1]||(h[1]=d=>e(en)(()=>e(r).onContentLeave())(d)),onPointerDownOutside:h[2]||(h[2]=d=>l("pointerDownOutside",d)),onFocusOutside:h[3]||(h[3]=d=>l("focusOutside",d)),onInteractOutside:h[4]||(h[4]=d=>l("interactOutside",d))}),{default:y(()=>[V(q.$slots,"default")]),_:2},1040,["data-state","style","hidden"])]),_:3},8,["present","force-mount"])],8,["to","disabled"]))}}),qo=Do,Bo=ve({inheritAttrs:!1,__name:"NavigationMenuIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const i=t,{forwardRef:a}=ke(),l=Ke(),n=j(),v=P(()=>l.orientation==="horizontal"),r=P(()=>!!l.modelValue.value),{activeTrigger:f}=l;function g(){f.value&&(n.value={size:v.value?f.value.offsetWidth:f.value.offsetHeight,position:v.value?f.value.offsetLeft:f.value.offsetTop})}return et(()=>{l.modelValue.value&&g()}),xt(f,g),xt(l.indicatorTrack,g),(L,q)=>e(l).indicatorTrack.value?(s(),D(La,{key:0,to:e(l).indicatorTrack.value},[C(e(Tt),{present:L.forceMount||r.value},{default:y(()=>[C(e(Ce),oe({ref:e(a),"aria-hidden":"true","data-state":r.value?"visible":"hidden","data-orientation":e(l).orientation,"as-child":i.asChild,as:L.as,style:{...n.value?{"--reka-navigation-menu-indicator-size":`${n.value.size}px`,"--reka-navigation-menu-indicator-position":`${n.value.position}px`}:{}}},L.$attrs),{default:y(()=>[V(L.$slots,"default")]),_:3},16,["data-state","data-orientation","as-child","as","style"])]),_:3},8,["present"])],8,["to"])):B("v-if",!0)}}),Po=Bo,Ao=ve({__name:"NavigationMenuLink",props:{active:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"a"}},emits:["select"],setup(t,{emit:i}){const a=t,l=i,{CollectionItem:n}=dt({key:"NavigationMenu"});ke();async function v(r){const f=new CustomEvent(wo,{bubbles:!0,cancelable:!0,detail:{originalEvent:r}});if(l("select",f),!f.defaultPrevented&&!r.metaKey){const g=new CustomEvent(it,{bubbles:!0,cancelable:!0});r.target?.dispatchEvent(g)}}return(r,f)=>(s(),D(e(n),null,{default:y(()=>[C(e(Ce),{as:r.as,"data-active":r.active?"":void 0,"aria-current":r.active?"page":void 0,"as-child":a.asChild,onClick:v},{default:y(()=>[V(r.$slots,"default")]),_:3},8,["as","data-active","aria-current","as-child"])]),_:3}))}}),jt=Ao,Mo=ve({inheritAttrs:!1,__name:"NavigationMenuList",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"ul"}},setup(t){const i=t,a=Ke(),{forwardRef:l,currentElement:n}=ke();return Me(()=>{a.onIndicatorTrackChange(n.value)}),(v,r)=>(s(),D(e(Ce),{ref:e(l),style:{position:"relative"}}
1,{default:y(()=>[C(e(Ce),oe(v.$attrs,{"as-child":i.asChild,as:v.as,"data-orientation":e(a).orientation}),{default:y(()=>[V(v.$slots,"default")]),_:3},16,["as-child","as","data-orientation"])]),_:3},512))}}),Eo=Mo;const zo=["aria-owns"];var Ro=ve({inheritAttrs:!1,__name:"NavigationMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const i=t,a=Ke(),l=ra(),{CollectionItem:n}=dt({key:"NavigationMenu"}),{forwardRef:v,currentElement:r}=ke(),f=j(""),g=j(""),L=Ca(!1,300),q=j(!1),h=P(()=>l.value===a.modelValue.value);Me(()=>{l.triggerRef=r,f.value=Za(a.baseId,l.value),g.value=ia(a.baseId,l.value)});function p(){a.disableHoverTrigger.value||(q.value=!1,l.wasEscapeCloseRef.value=!1)}function d(m){if(!a.disableHoverTrigger.value&&m.pointerType==="mouse"){if(i.disabled||q.value||l.wasEscapeCloseRef.value||L.value)return;a.onTriggerEnter(l.value),L.value=!0}}function c(m){if(!a.disableHoverTrigger.value&&m.pointerType==="mouse"){if(i.disabled)return;a.onTriggerLeave(),L.value=!1}}function k(m){(!("pointerType"in m)||m.pointerType==="mouse")&&a.disableClickTrigger.value||L.value||(h.value?a.onItemSelect(""):a.onItemSelect(l.value),q.value=h.value)}function S(m){const x={horizontal:"ArrowDown",vertical:a.dir.value==="rtl"?"ArrowLeft":"ArrowRight"}[a.orientation];h.value&&m.key===x&&(l.onEntryKeyDown(),m.preventDefault(),m.stopPropagation())}function z(m){l.focusProxyRef.value=gn(m)}function b(m){const w=document.getElementById(l.contentId),x=m.relatedTarget,A=x===r.value,o=w?.contains(x);(A||!o)&&l.onFocusProxyEnter(A?"start":"end")}return(m,w)=>(s(),O(re,null,[C(e(n),null,{default:y(()=>[C(e(Ce),oe({id:f.value,ref:e(v),disabled:m.disabled,"data-disabled":m.disabled?"":void 0,"data-state":e(Pt)(h.value),"data-navigation-menu-trigger":"","aria-expanded":h.value,"aria-controls":g.value,"as-child":i.asChild,as:m.as},m.$attrs,{onPointerenter:p,onPointermove:d,onPointerleave:c,onClick:k,onKeydown:S}),{default:y(()=>[V(m.$slots,"default")]),_:3},16,["id","disabled","data-disabled","data-state","aria-expanded","aria-controls","as-child","as"])]),_:3}),h.value?(s(),O(re,{key:0},[C(e(Gt),{ref:z,"aria-hidden":"true",tabindex:0,onFocus:b}),e(a).viewport?(s(),O("span",{key:0,"aria-owns":g.value},null,8,zo)):B("v-if",!0)],64)):B("v-if",!0)],64))}}),jo=Ro,No=ve({inheritAttrs:!1,__name:"NavigationMenuViewport",props:{forceMount:{type:Boolean,required:!1},align:{type:String,required:!1,default:"center"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const i=t,{forwardRef:a,currentElement:l}=ke(),n=Ke(),{activeTrigger:v,rootNavigationMenu:r,modelValue:f}=n,g=j(),L=j(),q=P(()=>!!n.modelValue.value);ae(l,()=>{n.onViewportChange(l.value)});const h=j();ae([f,q],()=>{Ot(()=>{l.value&&requestAnimationFrame(()=>{const d=l.value?.querySelector("[data-state=open]");h.value=d})})},{immediate:!0});function p(){if(h.value&&v.value&&r.value){const d=document.documentElement.offsetWidth,c=document.documentElement.offsetHeight,k=r.value.getBoundingClientRect(),S=v.value.getBoundingClientRect(),{offsetWidth:z,offsetHeight:b}=h.value,m=S.left-k.left,w=S.top-k.top;let x=null,A=null;switch(i.align){case"start":x=m,A=w;break;case"end":x=m-z+S.width,A=w-b+S.height;break;default:x=m-z/2+S.width/2,A=w-b/2+S.height/2}const o=10;x+k.left<o&&(x=o-k.left);const u=x+k.left+z;u>d-o&&(x-=u-d+o,x<o-k.left&&(x=o-k.left)),A+k.top<o&&(A=o-k.top);const $=A+k.top+b;$>c-o&&(A-=$-c+o,A<o-k.top&&(A=o-k.top)),x=Math.round(x),A=Math.round(A),L.value={left:x,top:A}}}return xt(h,()=>{h.value&&(g.value={width:h.value.offsetWidth,height:h.value.offsetHeight},p())}),xt([globalThis.document?.body,r],()=>{p()}),(d,c)=>(s(),D(e(Tt),{present:d.forceMount||q.value,"force-mount":!e(n).unmountOnHide.value,onAfterLeave:c[2]||(c[2]=()=>{g.value=void 0,L.value=void 0})},{default:y(({present:k})=>[C(e(Ce),oe(d.$attrs,{ref:e(a),as:d.as,"as-child":d.asChild,"data-state":e(Pt)(q.value),"data-orientation":e(n).orientation,style:{pointerEvents:!q.value&&e(n).isRootMenu?"none":void 0,"--reka-navigation-menu-viewport-width":g.value?`${g.value?.width}px`:void 0,"--reka-navigation-menu-viewport-height":g.value?`${g.value?.height}px`:void 0,"--reka-navigation-menu-viewport-left":L.value?`${L.value?.left}px`:void 0,"--reka-navigation-menu-viewport-top":L.value?`${L.value?.top}px`:void 0},hidden:!k,onPointerenter:c[0]||(c[0]=S=>e(n).onContentEnter(e(n).modelValue.value)),onPointerleave:c[1]||(c[1]=S=>e(en)(()=>e(n).onContentLeave())(S))}),{default:y(()=>[V(d.$slots,"default")]),_:2},1040,["as","as-child","data-state","data-orientation","style","hidden"])]),_:3},8,["present","force-mount"]))}}),Uo=No;const Vo={key:0,class:"mo-org-brand min-w-0"},Fo=["src","alt"],Ho={key:0,class:"mo-org-name line-clamp-2 break-all-custom font-waden"},Wo={__name:"DashboardLogo",props:{showLabel:{type:Boolean,default:!0}},setup(t){const{currentOrg:i}=De();tt();const a=P(()=>!!i.value?.logo_url);return(l,n)=>{const v=hn;return e(a)?(s(),O("div",Vo,[_("div",{class:T(["mo-org-logo",{"mo-logo-signet":!t.showLabel}])},[_("img",{src:e(i).logo_url,alt:e(i).name},null,8,Fo)],2),t.showLabel?(s(),O("span",Ho,I(e(i).name),1)):B("",!0)])):(s(),O("div",{key:1,class:T(["mo-logo",{"mo-logo-signet":!t.showLabel}])},[t.showLabel?(s(),D(v,{key:0,src:"/_logo/marble_work_logo_4c.webp"})):(s(),D(v,{key:1,src:"/_logo/marble_work_logo_4c_signet_light.webp"}))],2))}}},Ko=We(Wo,[["__scopeId","data-v-a2dd8e21"]]),Xo=["aria-label"],Go={key:0,class:"absolute -top-1 -right-1 min-w-[17px] h-[17px] px-1 rounded-full bg-secondary-500 text-white text-[11px] font-bold leading-none flex items-center justify-center ring-2 ring-cream-100"},Yo={class:"relative flex items-center justify-center shrink-0"},Jo={key:0,class:"absolute -top-1.5 -right-1.5 min-w-[17px] h-[17px] px-1 rounded-full bg-marble-400 text-white text-[11px] font-bold leading-none flex items-center justify-center"},Zo={key:0,class:"text-sm truncate"},Qo={class:"mo-context w-96! mt-1 max-w-[92vw] flex flex-col bg-white rounded-2xl ring-1 ring-secondary-200 px-3"},el={class:"flex items-start gap-1.5 px-0 py-3 border-b border-secondary-200 flex-col"},tl={class:"text-md font-semibold font-waden text-secondary-700 translate-y-0.5"},al={class:"max-h-[58dvh] h-[480px] mo-notifications-container border-b border-secondary-200"},nl={key:0,class:"px-0 py-8 text-center text-[13px] leading-[1.2em] text-secondary-500 font-medium"},ol={key:1,class:"divide-y divide-secondary-200"},ll={__name:"AppNotificationBell",props:{showLabel:{type:Boolean,default:!0},variant:{type:String,default:"pill"}},setup(t){const i=t,a=P(()=>i.variant==="round"),l=j(!1),n=P(()=>({...a.value?{align:"center",side:"bottom",sideOffset:10}:{align:"center",side:"top",sideOffset:10},onCloseAutoFocus:u=>{l.value&&(u.preventDefault(),l.value=!1)}})),{t:v}=xe(),{labelParams:r}=gt(),{orgId:f}=De(),g=at(),L=ct(),{unreadItems:q,rawItems:h,unreadCount:p,fetch:d,markRead:c,markAllRead:k,dismiss:S}=En(),z=j(!1),{members:b,fetchMembers:m}=aa();Me(()=>{d(),b.value.length||m()});function w(u){return Rn(u,v,r.value)}async function x(u){await c(u.id),l.value=!0,z.value=!1;const $=yn(u,g);$&&pt($)}const A=j(null),o=j(null);return ae(h,u=>{if(A.value===null||o.value!==f.value){A.value=new Set(u.map(R=>R.id)),o.value=f.value;return}for(const R of u)if(!A.value.has(R.id)&&(A.value.add(R.id),R.status==="unread")){const{title:U,body:X}=w(R);
1L.add({class:"mo-toast",title:U,description:X,color:"info"})}},{deep:!0}),(u,$)=>{const R=se,U=zn,X=wt,M=ja;return s(),D(M,{open:e(z),"onUpdate:open":$[3]||($[3]=Z=>Be(z)?z.value=Z:null),content:e(n),ui:{content:"translate-x-2 max-mobile-menu:-translate-x-2"}},{content:y(()=>[_("div",Qo,[_("div",el,[_("p",tl,I(u.$t("agency.notifications.title")),1),e(p)>0?(s(),O("button",{key:0,class:"text-[13px] text-secondary-500 py-1 px-2 rounded-xl hover:bg-secondary-100/70 hover:text-secondary-600 cursor-pointer transition-colors leading-[1em]",onClick:$[0]||($[0]=(...Z)=>e(k)&&e(k)(...Z))},I(u.$t("agency.notifications.mark_all_read")),1)):B("",!0)]),_("div",al,[e(q).length?(s(),O("ul",ol,[(s(!0),O(re,null,Le(e(q),Z=>(s(),O("li",{key:Z.id},[C(U,{n:Z,compact:"",members:e(b),onSelect:x,onDismiss:$[1]||($[1]=G=>e(S)(G.id))},null,8,["n","members"])]))),128))])):(s(),O("p",nl,I(u.$t("agency.notifications.empty_unread")),1))]),C(X,{to:e(g)("notifications"),class:"block text-center text-[13px] text-secondary-500 py-1 px-2 rounded-xl hover:bg-secondary-100/70 hover:text-secondary-600 transition-colors my-2",onClick:$[2]||($[2]=Z=>z.value=!1)},{default:y(()=>[K(I(u.$t("agency.notifications.view_all")),1)]),_:1},8,["to"])])]),default:y(()=>[e(a)?(s(),O("button",{key:0,class:"relative flex items-center justify-center shrink-0 w-9 h-9 rounded-full text-secondary-700 bg-secondary-100/70 ring-1 ring-secondary-200 hover:bg-white hover:text-secondary-800 transition-colors cursor-pointer mo-notif-trigger","aria-label":u.$t("agency.notifications.title")},[C(R,{name:"mosy:bell",class:"w-[18px] h-[18px]"}),e(p)>0?(s(),O("span",Go,I(e(p)>99?"99+":e(p)),1)):B("",!0)],8,Xo)):(s(),O("button",{key:1,class:T(["flex items-center gap-2 w-full py-1.5 px-2 rounded-md cursor-pointer text-secondary-600 hover:bg-secondary-100 transition-colors mo-notif-trigger",{"justify-center px-0!":!t.showLabel}])},[_("span",Yo,[C(R,{name:"mosy:bell",class:"w-5 h-5"}),e(p)>0?(s(),O("span",Jo,I(e(p)>99?"99+":e(p)),1)):B("",!0)]),t.showLabel?(s(),O("span",Zo,I(u.$t("agency.notifications.title")),1)):B("",!0)],2))]),_:1},8,["open","content"])}}},sl=We(ll,[["__scopeId","data-v-744df745"]]),il={slots:{root:"relative flex gap-1.5 [&>div]:min-w-0",list:"isolate min-w-0",label:"w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5",item:"min-w-0",link:"group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",linkLeadingIcon:"shrink-0 size-5",linkLeadingAvatar:"shrink-0",linkLeadingAvatarSize:"2xs",linkLeadingChipSize:"sm",linkTrailing:"group ms-auto inline-flex gap-1.5 items-center",linkTrailingBadge:"shrink-0",linkTrailingBadgeSize:"sm",linkTrailingIcon:"size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",linkLabel:"truncate",linkLabelExternalIcon:"inline-block size-3 align-top text-dimmed",childList:"isolate",childLabel:"text-xs text-highlighted",childItem:"",childLink:"group relative size-full flex items-start text-start text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",childLinkWrapper:"min-w-0",childLinkIcon:"size-5 shrink-0",childLinkLabel:"truncate",childLinkLabelExternalIcon:"inline-block size-3 align-top text-dimmed",childLinkDescription:"text-muted",separator:"px-2 h-px bg-border",viewportWrapper:"absolute top-full left-0 flex w-full",viewport:"relative overflow-hidden bg-default shadow-lg rounded-md ring ring-default h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left] duration-200 origin-[top_center] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] z-[1]",content:"",indicator:"absolute data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] data-[state=hidden]:opacity-0 bottom-0 z-[2] w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200",arrow:"relative top-[50%] size-2.5 rotate-45 border border-default bg-default z-[1] rounded-xs"},variants:{color:{primary:{link:"focus-visible:before:ring-primary",childLink:"focus-visible:before:ring-primary"},secondary:{link:"focus-visible:before:ring-secondary",childLink:"focus-visible:before:ring-secondary"},success:{link:"focus-visible:before:ring-success",childLink:"focus-visible:before:ring-success"},info:{link:"focus-visible:before:ring-info",childLink:"focus-visible:before:ring-info"},warning:{link:"focus-visible:before:ring-warning",childLink:"focus-visible:before:ring-warning"},error:{link:"focus-visible:before:ring-error",childLink:"focus-visible:before:ring-error"},neutral:{link:"focus-visible:before:ring-inverted",childLink:"focus-visible:before:ring-inverted"}}
1,highlightColor:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{pill:"",link:""},orientation:{horizontal:{root:"items-center justify-between",list:"flex items-center",item:"py-2",link:"px-2.5 py-1.5 before:inset-x-px before:inset-y-0",childList:"grid p-2",childLink:"px-3 py-2 gap-2 before:inset-x-px before:inset-y-0",childLinkLabel:"font-medium",content:"absolute top-0 left-0 w-full max-h-[70vh] overflow-y-auto"},vertical:{root:"flex-col",link:"flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0",childLabel:"px-1.5 py-0.5",childLink:"p-1.5 gap-1.5 before:inset-y-px before:inset-x-0"}},contentOrientation:{horizontal:{viewportWrapper:"justify-center",content:"data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]"},vertical:{viewport:"sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left)"}},active:{true:{childLink:"before:bg-elevated text-highlighted",childLinkIcon:"text-default"},false:{link:"text-muted",linkLeadingIcon:"text-dimmed",childLink:["hover:before:bg-elevated/50 text-default hover:text-highlighted","transition-colors before:transition-colors"],childLinkIcon:["text-dimmed group-hover:text-default","transition-colors"]}},disabled:{true:{link:"cursor-not-allowed opacity-75"}},highlight:{true:""},level:{true:""},collapsed:{true:""}},compoundVariants:[{orientation:"horizontal",contentOrientation:"horizontal",class:{childList:"grid-cols-2 gap-2"}},{orientation:"horizontal",contentOrientation:"vertical",class:{childList:"gap-1",content:"w-60"}},{orientation:"vertical",collapsed:!1,class:{childList:"ms-5 border-s border-default",childItem:"ps-1.5 -ms-px",content:"data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"}},{orientation:"vertical",collapsed:!0,class:{link:"px-1.5",linkLabel:"hidden",linkTrailing:"hidden",content:"shadow-sm rounded-sm min-h-6 p-1"}},{orientation:"horizontal",highlight:!0,class:{link:["after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full","after:transition-colors"]}},{orientation:"vertical",highlight:!0,level:!0,class:{link:["after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full","after:transition-colors"]}},{disabled:!1,active:!1,variant:"pill",class:{link:["hover:text-highlighted hover:before:bg-elevated/50","transition-colors before:transition-colors"],linkLeadingIcon:["group-hover:text-default","transition-colors"]}},{disabled:!1,active:!1,variant:"pill",orientation:"horizontal",class:{link:"data-[state=open]:text-highlighted",linkLeadingIcon:"group-data-[state=open]:text-default"}},{disabled:!1,variant:"pill",highlight:!0,orientation:"horizontal",class:{link:"data-[state=open]:before:bg-elevated/50"}},{disabled:!1,variant:"pill",highlight:!1,active:!1,orientation:"horizontal",class:{link:"data-[state=open]:before:bg-elevated/50"}},{color:"primary",variant:"pill",active:!0,class:{link:"text-primary",linkLeadingIcon:"text-primary group-data-[state=open]:text-primary"}},{color:"secondary",variant:"pill",active:!0,class:{link:"text-secondary",linkLeadingIcon:"text-secondary group-data-[state=open]:text-secondary"}},{color:"success",variant:"pill",active:!0,class:{link:"text-success",linkLeadingIcon:"text-success group-data-[state=open]:text-success"}},{color:"info",variant:"pill",active:!0,class:{link:"text-info",linkLeadingIcon:"text-info group-data-[state=open]:text-info"}},{color:"warning",variant:"pill",active:!0,class:{link:"text-warning",linkLeadingIcon:"text-warning group-data-[state=open]:text-warning"}},{color:"error",variant:"pill",active:!0,class:{link:"text-error",linkLeadingIcon:"text-error group-data-[state=open]:text-error"}},{color:"neutral",variant:"pill",active:!0,class:{link:"text-highlighted",linkLeadingIcon:"text-highlighted group-data-[state=open]:text-highlighted"}},{variant:"pill",active:!0,highlight:!1,class:{link:"before:bg-elevated"}},{variant:"pill",active:!0,highlight:!0,disabled:!1,class:{link:["hover:before:bg-elevated/50","before:transition-colors"]}},{disabled:!1,active:!1,variant:"link",class:{link:["hover:text-highlighted","transition-colors"],linkLeadingIcon:["group-hover:text-default","transition-colors"]}},{disabled:!1,active:!1,variant:"link",orientation:"horizontal",class:{link:"data-[state=open]:text-highlighted",linkLeadingIcon:"group-data-[state=open]:text-default"}},{color:"primary",variant:"link",active:!0,class:{link:"text-primary",linkLeadingIcon:"text-primary group-data-[state=open]:text-primary"}}
1,{color:"secondary",variant:"link",active:!0,class:{link:"text-secondary",linkLeadingIcon:"text-secondary group-data-[state=open]:text-secondary"}},{color:"success",variant:"link",active:!0,class:{link:"text-success",linkLeadingIcon:"text-success group-data-[state=open]:text-success"}},{color:"info",variant:"link",active:!0,class:{link:"text-info",linkLeadingIcon:"text-info group-data-[state=open]:text-info"}},{color:"warning",variant:"link",active:!0,class:{link:"text-warning",linkLeadingIcon:"text-warning group-data-[state=open]:text-warning"}},{color:"error",variant:"link",active:!0,class:{link:"text-error",linkLeadingIcon:"text-error group-data-[state=open]:text-error"}},{color:"neutral",variant:"link",active:!0,class:{link:"text-highlighted",linkLeadingIcon:"text-highlighted group-data-[state=open]:text-highlighted"}},{highlightColor:"primary",highlight:!0,level:!0,active:!0,class:{link:"after:bg-primary"}},{highlightColor:"secondary",highlight:!0,level:!0,active:!0,class:{link:"after:bg-secondary"}},{highlightColor:"success",highlight:!0,level:!0,active:!0,class:{link:"after:bg-success"}},{highlightColor:"info",highlight:!0,level:!0,active:!0,class:{link:"after:bg-info"}},{highlightColor:"warning",highlight:!0,level:!0,active:!0,class:{link:"after:bg-warning"}},{highlightColor:"error",highlight:!0,level:!0,active:!0,class:{link:"after:bg-error"}},{highlightColor:"neutral",highlight:!0,level:!0,active:!0,class:{link:"after:bg-inverted"}}],defaultVariants:{color:"primary",highlightColor:"primary",variant:"pill"}},tn=Object.assign({inheritAttrs:!1},{__name:"UNavigationMenu",props:{as:{type:null,required:!1},type:{type:null,required:!1,default:"multiple"},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},trailingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},items:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},collapsed:{type:Boolean,required:!1},tooltip:{type:[Boolean,Object],required:!1},popover:{type:[Boolean,Object],required:!1},highlight:{type:Boolean,required:!1},highlightColor:{type:null,required:!1},content:{type:Object,required:!1},contentOrientation:{type:null,required:!1,default:"horizontal"},arrow:{type:Boolean,required:!1},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:Object,required:!1},delayDuration:{type:Number,required:!1,default:0},disableClickTrigger:{type:Boolean,required:!1},disableHoverTrigger:{type:Boolean,required:!1},skipDelayDuration:{type:Number,required:!1},disablePointerLeaveClose:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},disabled:{type:Boolean,required:!1},collapsible:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(t,{emit:i}){const a=t,l=i,n=ft(),v=ze(),r=Re("navigationMenu",a),f=Ze(P(()=>({as:a.as,delayDuration:a.delayDuration,skipDelayDuration:a.skipDelayDuration,orientation:a.orientation,disableClickTrigger:a.disableClickTrigger,disableHoverTrigger:a.disableHoverTrigger,disablePointerLeaveClose:a.disablePointerLeaveClose,unmountOnHide:a.unmountOnHide})),l),g=Ze(Yt(a,"collapsible","disabled","type","unmountOnHide"),l),L=Ae(()=>a.content),q=Ae(()=>Vt(typeof a.tooltip=="boolean"?{}:a.tooltip,{...a.orientation==="vertical"&&{delayDuration:0,content:{side:"right"}}})),h=Ae(()=>Vt(typeof a.popover=="boolean"?{}:a.popover,{mode:"hover",content:{side:"right",align:"start",alignOffset:2}})),[p,d]=kt(),[c,k]=kt({props:{item:Object,index:Number,level:Number,listIndex:Number}}),S=P(()=>we({extend:we(il),...v.ui?.navigationMenu||{}})({orientation:a.orientation,contentOrientation:a.orientation==="vertical"?void 0:a.contentOrientation,collapsed:a.collapsed,color:a.color,variant:a.variant,highlight:a.highlight,highlightColor:a.highlightColor||a.color})),z=P(()=>a.items?.length?_n(a.items)?a.items:[a.items]:[]);function b(x,A,o,u){const $=z.value.length>1?`group-${u}-`:"";return Fe(x,a.valueKey)??(o>0?`${$}item-${o}-${A}`:`${$}item-${A}`)}function m(x,A=0,o=0){const u=x.reduce(($,R,U)=>
1((R.defaultOpen||R.open)&&$.push(b(R,U,A,o)),$),[]);return a.type==="single"?u[0]:u}function w(x,A){A.children?.length&&(a.orientation==="horizontal"?x.preventDefault():a.orientation==="vertical"&&!a.collapsed&&(x.preventDefault(),x.stopPropagation()))}return(x,A)=>(s(),O(re,null,[C(e(p),null,{default:y(({item:o,active:u,index:$})=>[V(x.$slots,o.slot||"item",{item:o,index:$,active:u,ui:S.value},()=>[V(x.$slots,o.slot?`${o.slot}-leading`:"item-leading",{item:o,active:u,index:$,ui:S.value},()=>[o.avatar?(s(),D(vt,oe({key:0,size:o.ui?.linkLeadingAvatarSize||e(r)?.linkLeadingAvatarSize||S.value.linkLeadingAvatarSize()},o.avatar,{"data-slot":"linkLeadingAvatar",class:S.value.linkLeadingAvatar({class:[e(r)?.linkLeadingAvatar,o.ui?.linkLeadingAvatar],active:u,disabled:!!o.disabled})}),null,16,["size","class"])):o.icon&&o.chip?(s(),D(bn,oe({key:1,size:o.ui?.linkLeadingChipSize||e(r)?.linkLeadingChipSize||S.value.linkLeadingChipSize(),inset:""},typeof o.chip=="object"?o.chip:{},{"data-slot":"linkLeadingChip"}),{default:y(()=>[C(se,{name:o.icon,"data-slot":"linkLeadingIcon",class:T(S.value.linkLeadingIcon({class:[e(r)?.linkLeadingIcon,o.ui?.linkLeadingIcon],active:u,disabled:!!o.disabled}))},null,8,["name","class"])]),_:2},1040,["size"])):o.icon?(s(),D(se,{key:2,name:o.icon,"data-slot":"linkLeadingIcon",class:T(S.value.linkLeadingIcon({class:[e(r)?.linkLeadingIcon,o.ui?.linkLeadingIcon],active:u,disabled:!!o.disabled}))},null,8,["name","class"])):B("",!0)]),e(Fe)(o,a.labelKey)||n[o.slot?`${o.slot}-label`:"item-label"]?(s(),O("span",{key:0,"data-slot":"linkLabel",class:T(S.value.linkLabel({class:[e(r)?.linkLabel,o.ui?.linkLabel]}))},[V(x.$slots,o.slot?`${o.slot}-label`:"item-label",{item:o,active:u,index:$},()=>[K(I(e(Fe)(o,a.labelKey)),1)]),o.target==="_blank"&&t.externalIcon!==!1?(s(),D(se,{key:0,name:typeof t.externalIcon=="string"?t.externalIcon:e(v).ui.icons.external,"data-slot":"linkLabelExternalIcon",class:T(S.value.linkLabelExternalIcon({class:[e(r)?.linkLabelExternalIcon,o.ui?.linkLabelExternalIcon],active:u}))},null,8,["name","class"])):B("",!0)],2)):B("",!0),o.badge||o.badge===0||t.orientation==="horizontal"&&(o.children?.length||n[o.slot?`${o.slot}-content`:"item-content"])||t.orientation==="vertical"&&o.children?.length||o.trailingIcon||n[o.slot?`${o.slot}-trailing`:"item-trailing"]?(s(),D(st(t.orientation==="vertical"&&o.children?.length&&!t.collapsed?e(_a):"span"),{key:1,as:t.orientation==="vertical"&&o.children?.length&&!t.collapsed?"span":void 0,"data-slot":"linkTrailing",class:T(S.value.linkTrailing({class:[e(r)?.linkTrailing,o.ui?.linkTrailing]})),onClick:R=>w(R,o)},{default:y(()=>[V(x.$slots,o.slot?`${o.slot}-trailing`:"item-trailing",{item:o,active:u,index:$,ui:S.value},()=>[o.badge||o.badge===0?(s(),D(Qe,oe({key:0,color:"neutral",variant:"outline",size:o.ui?.linkTrailingBadgeSize||e(r)?.linkTrailingBadgeSize||S.value.linkTrailingBadgeSize()},typeof o.badge=="string"||typeof o.badge=="number"?{label:o.badge}:o.badge,{"data-slot":"linkTrailingBadge",class:S.value.linkTrailingBadge({class:[e(r)?.linkTrailingBadge,o.ui?.linkTrailingBadge]})}),null,16,["size","class"])):B("",!0),t.orientation==="horizontal"&&(o.children?.length||n[o.slot?`${o.slot}-content`:"item-content"])||t.orientation==="vertical"&&o.children?.length?(s(),D(se,{key:1,name:o.trailingIcon||t.trailingIcon||e(v).ui.icons.chevronDown,"data-slot":"linkTrailingIcon",class:T(S.value.linkTrailingIcon({class:[e(r)?.linkTrailingIcon,o.ui?.linkTrailingIcon],active:u}))},null,8,["name","class"])):o.trailingIcon?(s(),D(se,{key:2,name:o.trailingIcon,"data-slot":"linkTrailingIcon",class:T(S.value.linkTrailingIcon({class:[e(r)?.linkTrailingIcon,o.ui?.linkTrailingIcon],active:u}))},null,8,["name","class"])):B("",!0)])]),_:2},1032,["as","class","onClick"])):B("",!0)])]),_:3}),C(e(c),null,{default:y(({item:o,index:u,level:$=0,listIndex:R=0})=>[(s(),D(st(t.orientation==="vertical"&&!t.collapsed?e(ho):e(Lo)),{as:"li",value:b(o,u,$,R)},{default:y(()=>[t.orientation==="vertical"&&o.type==="label"&&!t.collapsed?(s(),O("div",{key:0,"data-slot":"label",class:T(S.value.label({class:[e(r)?.label,o.ui?.label,o.class]}))},[C(e(d),{item:o,index:u},null,8,["item","index"])],2)):o.type!=="label"?(s(),D(wt,oe({key:1},t.orientation==="vertical"&&o.children?.length&&!t.collapsed&&o.type==="trigger"?{}:e(zt)(o),{custom:""}),{default:y(({active:U,...X})=>[(s(),D(st(t.orientation==="horizontal"&&(o.children?.length||n[o.slot?`${o.slot}-content`:"item-content"])?e(jo):t.orientation==="vertical"&&o.children?.length&&!t.collapsed&&!X.href?e(_a):e(jt)),{"as-child":"",active:U||o.active,disabled:o.disabled,onSelect:o.onSelect},{default:y(()=>[t.orientation==="vertical"&&t.collapsed&&o.children?.length&&(a.popover||o.popover)?(s(),D(ja,oe({key:0},{...h.value,...typeof o.popover=="boolean"?{}:o.popover||{}},{ui:{content:S.value.content({class:[e(r)?.content,o.ui?.content]}
1)}}),{content:y(({close:M})=>[V(x.$slots,o.slot?`${o.slot}-content`:"item-content",{item:o,active:U||o.active,index:u,ui:S.value,close:M},()=>[_("ul",{"data-slot":"childList",class:T(S.value.childList({class:[e(r)?.childList,o.ui?.childList]}))},[_("li",{"data-slot":"childLabel",class:T(S.value.childLabel({class:[e(r)?.childLabel,o.ui?.childLabel]}))},I(e(Fe)(o,a.labelKey)),3),(s(!0),O(re,null,Le(o.children,(Z,G)=>(s(),O("li",{key:G,"data-slot":"childItem",class:T(S.value.childItem({class:[e(r)?.childItem,o.ui?.childItem]}))},[C(wt,oe({ref_for:!0},e(zt)(Z),{custom:""}),{default:y(({active:H,...F})=>[C(e(jt),{"as-child":"",active:H,onSelect:Z.onSelect},{default:y(()=>[C(ot,oe({ref_for:!0},F,{"data-slot":"childLink",class:S.value.childLink({class:[e(r)?.childLink,o.ui?.childLink,Z.class],active:H})}),{default:y(()=>[Z.icon?(s(),D(se,{key:0,name:Z.icon,"data-slot":"childLinkIcon",class:T(S.value.childLinkIcon({class:[e(r)?.childLinkIcon,o.ui?.childLinkIcon],active:H}))},null,8,["name","class"])):B("",!0),_("span",{"data-slot":"childLinkLabel",class:T(S.value.childLinkLabel({class:[e(r)?.childLinkLabel,o.ui?.childLinkLabel],active:H}))},[K(I(e(Fe)(Z,a.labelKey))+" ",1),Z.target==="_blank"&&t.externalIcon!==!1?(s(),D(se,{key:0,name:typeof t.externalIcon=="string"?t.externalIcon:e(v).ui.icons.external,"data-slot":"childLinkLabelExternalIcon",class:T(S.value.childLinkLabelExternalIcon({class:[e(r)?.childLinkLabelExternalIcon,o.ui?.childLinkLabelExternalIcon],active:H}))},null,8,["name","class"])):B("",!0)],2)]),_:2},1040,["class"])]),_:2},1032,["active","onSelect"])]),_:2},1040)],2))),128))],2)])]),default:y(()=>[C(ot,oe(X,{"data-slot":"link",class:S.value.link({class:[e(r)?.link,o.ui?.link,o.class],active:U||o.active,disabled:!!o.disabled,level:$>0})}),{default:y(()=>[C(e(d),{item:o,active:U||o.active,index:u},null,8,["item","active","index"])]),_:2},1040,["class"])]),_:2},1040,["ui"])):t.orientation==="vertical"&&t.collapsed&&(a.tooltip||o.tooltip)||t.orientation==="horizontal"&&o.tooltip?(s(),D(Bt,oe({key:1,text:e(Fe)(o,a.labelKey)},{...q.value,...typeof o.tooltip=="boolean"?{}:o.tooltip||{}}),{default:y(()=>[C(ot,oe(X,{"data-slot":"link",class:S.value.link({class:[e(r)?.link,o.ui?.link,o.class],active:U||o.active,disabled:!!o.disabled,level:$>0})}),{default:y(()=>[C(e(d),{item:o,active:U||o.active,index:u},null,8,["item","active","index"])]),_:2},1040,["class"])]),_:2},1040,["text"])):(s(),D(ot,oe({key:2},X,{"data-slot":"link",class:S.value.link({class:[e(r)?.link,o.ui?.link,o.class],active:U||o.active,disabled:!!o.disabled,level:t.orientation==="horizontal"||$>0})}),{default:y(()=>[C(e(d),{item:o,active:U||o.active,index:u},null,8,["item","active","index"])]),_:2},1040,["class"]))]),_:2},1064,["active","disabled","onSelect"])),t.orientation==="horizontal"&&(o.children?.length||n[o.slot?`${o.slot}-content`:"item-content"])?(s(),D(e(qo),oe({key:0},L.value,{"data-slot":"content",class:S.value.content({class:[e(r)?.content,o.ui?.content]})}),{default:y(()=>[V(x.$slots,o.slot?`${o.slot}-content`:"item-content",{item:o,active:U||o.active,index:u,ui:S.value},()=>[_("ul",{"data-slot":"childList",class:T(S.value.childList({class:[e(r)?.childList,o.ui?.childList]}))},[(s(!0),O(re,null,Le(o.children,(M,Z)=>(s(),O("li",{key:Z,"data-slot":"childItem",class:T(S.value.childItem({class:[e(r)?.childItem,o.ui?.childItem]}))},[C(wt,oe({ref_for:!0},e(zt)(M),{custom:""}),{default:y(({active:G,...H})=>[C(e(jt),{"as-child":"",active:G,onSelect:M.onSelect},{default:y(()=>[C(ot,oe({ref_for:!0},H,{"data-slot":"childLink",class:S.value.childLink({class:[e(r)?.childLink,o.ui?.childLink,M.class],active:G})}),{default:y(()=>[M.icon?(s(),D(se,{key:0,name:M.icon,"data-slot":"childLinkIcon",class:T(S.value.childLinkIcon({class:[e(r)?.childLinkIcon,o.ui?.childLinkIcon],active:G}))},null,8,["name","class"])):B("",!0),_("div",{"data-slot":"childLinkWrapper",class:T(S.value.childLinkWrapper({class:[e(r)?.childLinkWrapper,o.ui?.childLinkWrapper]}))},[_("p",{"data-slot":"childLinkLabel",class:T(S.value.childLinkLabel({class:[e(r)?.childLinkLabel,o.ui?.childLinkLabel],active:G}))},[K(I(e(Fe)(M,a.labelKey))+" ",1),M.target==="_blank"&&t.externalIcon!==!1?(s(),D(se,{key:0,name:typeof t.externalIcon=="str
1ing"?t.externalIcon:e(v).ui.icons.external,"data-slot":"childLinkLabelExternalIcon",class:T(S.value.childLinkLabelExternalIcon({class:[e(r)?.childLinkLabelExternalIcon,o.ui?.childLinkLabelExternalIcon],active:G}))},null,8,["name","class"])):B("",!0)],2),M.description?(s(),O("p",{key:0,"data-slot":"childLinkDescription",class:T(S.value.childLinkDescription({class:[e(r)?.childLinkDescription,o.ui?.childLinkDescription],active:G}))},I(M.description),3)):B("",!0)],2)]),_:2},1040,["class"])]),_:2},1032,["active","onSelect"])]),_:2},1040)],2))),128))],2)])]),_:2},1040,["class"])):B("",!0)]),_:2},1040)):B("",!0),t.orientation==="vertical"&&o.children?.length&&!t.collapsed?(s(),D(e(bo),{key:2,"data-slot":"content",class:T(S.value.content({class:[e(r)?.content,o.ui?.content]}))},{default:y(()=>[C(e(ba),oe({...e(g),defaultValue:m(o.children,$+1,R)},{as:"ul","data-slot":"childList",class:S.value.childList({class:[e(r)?.childList,o.ui?.childList]})}),{default:y(()=>[(s(!0),O(re,null,Le(o.children,(U,X)=>(s(),D(e(k),{key:X,item:U,index:X,level:$+1,"list-index":R,"data-slot":"childItem",class:T(S.value.childItem({class:[e(r)?.childItem,U.ui?.childItem]}))},null,8,["item","index","level","list-index","class"]))),128))]),_:2},1040,["class"])]),_:2},1032,["class"])):B("",!0)]),_:2},1032,["value"]))]),_:3}),C(e(Io),oe({...e(f),...t.orientation==="horizontal"?{modelValue:t.modelValue,defaultValue:t.defaultValue}:{},...x.$attrs},{"data-collapsed":t.collapsed,"data-slot":"root",class:S.value.root({class:[e(r)?.root,a.class]})}),{default:y(()=>[V(x.$slots,"list-leading"),(s(!0),O(re,null,Le(z.value,(o,u)=>(s(),O(re,{key:`list-${u}`},[(s(),D(st(t.orientation==="vertical"?e(ba):e(Eo)),oe({ref_for:!0},t.orientation==="vertical"&&!t.collapsed?{...e(g),modelValue:t.modelValue,defaultValue:t.defaultValue??m(o,0,u)}:{},{as:"ul","data-slot":"list",class:S.value.list({class:e(r)?.list})}),{default:y(()=>[(s(!0),O(re,null,Le(o,($,R)=>(s(),D(e(k),{key:`list-${u}-${R}`,item:$,index:R,"list-index":u,"data-slot":"item",class:T(S.value.item({class:[e(r)?.item,$.ui?.item]}))},null,8,["item","index","list-index","class"]))),128))]),_:2},1040,["class"])),t.orientation==="vertical"&&u<z.value.length-1?(s(),O("div",{key:0,"data-slot":"separator",class:T(S.value.separator({class:e(r)?.separator}))},null,2)):B("",!0)],64))),128)),V(x.$slots,"list-trailing"),t.orientation==="horizontal"?(s(),O("div",{key:0,"data-slot":"viewportWrapper",class:T(S.value.viewportWrapper({class:e(r)?.viewportWrapper}))},[t.arrow?(s(),D(e(Po),{key:0,"data-slot":"indicator",class:T(S.value.indicator({class:e(r)?.indicator}))},{default:y(()=>[_("div",{"data-slot":"arrow",class:T(S.value.arrow({class:e(r)?.arrow}))},null,2)]),_:1},8,["class"])):B("",!0),C(e(Uo),{"data-slot":"viewport",class:T(S.value.viewport({class:e(r)?.viewport}))},null,8,["class"])],2)):B("",!0)]),_:3},16,["data-collapsed","class"])],64))}}),rl={class:"space-y-4"},ul={class:"text-white font-medium"},dl={class:"text-sm italic text-secondary-100"},cl={class:"flex gap-2 justify-end w-full"},pl={__name:"WorkTimeTimerModal",props:{open:Boolean,mode:{type:String,default:"start"},entry:{type:Object,default:null}},emits:["update:open"],setup(t,{emit:i}){const a=t,l=i,{t:n}=xe(),{startWork:v,updateWork:r}=Jt(),{types:f,fetchTypes:g}=Nn(),{isAdmin:L,isOwner:q,currentOrg:h}=De(),p=P(()=>L.value||q.value||!!h.value?.members_can_set_start_time),d=j(!1),c=j(""),k=P(()=>a.mode==="edit"),S=j("");function z(){const u=new Date,$=u.getTimezoneOffset();S.value=new Date(u.getTime()-$*6e4).toISOString().slice(0,16)}function b(u){if(!u)return"";const $=new Date(u),R=$.getTimezoneOffset();return new Date($.getTime()-R*6e4).toISOString().slice(0,16)}const m=P(()=>!!(w.startedAt&&S.value&&w.startedAt>S.value)),w=Ta({attendanceTypeId:null,notes:"",startedAt:""}),x=P(()=>f.value.filter(u=>!u.is_day_type).map(u=>({label:u.name,value:u.id})));ae(()=>a.open,async u=>{if(!u)return;c.value="",z(),await g();const $=f.value.filter(R=>!R.is_day_type);k.value&&a.entry?(w.attendanceTypeId=a.entry.attendance_type_id||null,w.notes=a.entry.notes||"",w.startedAt=b(a.entry.started_at)):(w.attendanceTypeId=$[0]?.id||null,w.notes="",w.startedAt=S.value),w.attendanceTypeId&&!$.some(R=>R.id===w.attendanceTypeId)&&(w.attendanceTypeId=null)}),Lt("keydown",u=>{u.key==="Escape"&&a.open&&(u.preventDefault(),l("update:open",!1))});async function A(){if(!w.attendanceTypeId)return;d.value=!0,c.value="";const{error:u}=await v({attendanceTypeId:w.attendanceTypeId,notes:w.notes||null,startedAt:p.value&&w.startedAt?new Date(w.startedAt).toISOString():void 0});d.value=!1,u?c.value=u.message:l("update:open",!1)}async function o(){if(!w.attendanceTypeId)return;d.value=!0,c.value="";const{error:u}=await r({attendanceTypeId:w.attendanceTypeId,notes:w.notes||null,startedAt:p.value&&w.startedAt?new Date(w.startedAt).toISOString():void 0});d.value=!1,u?c.value=u.message:l("update:open",!1)}return(u,$)=>{const R=Ua,U=se,X=Va,M=Fa,Z=Ha,G=Wa,H=$e,F=Oe;return s(),D(F,{open:t.open,close:!1,title:e(k)?u.$t("work_time.modal.edit_title"):u.$t("work_time.modal.title"),ui:{width:"sm:max-w-md"},"onUpdate:open":$[4]||($[4]=W=>l("update:open",W))},{body:y(()=>[_("div",rl,[e(c)?(s(),D(R,{key:0,color:"primary",icon:"mosy:circle-exclamation",title:e(c)},null,8,["title"])):B("",!0),C(M,{label:u.$t("work_time.modal.type_label"),required:""},{default:y(()=>[C(X,{modelValue:e(w).attendanceTypeId,"onUpdate:modelValue":$[0]||($[0]=W=>e(w).attendanceTypeId=W),items:e(x),"value-key":"value",placeholder:u.$t("work_time.modal.type_placeholder"),class:"w-full"},{item:y(({item:W})=>[_("span",ul,I(W.label),1),e(w).attendanceTypeId===W.value?(s(),D(U,{key:0,name:"mosy:circle-check",class:"mo-custom-selected-icon ml-auto shrink-0"})):B("",!0)]),empty:y(()=>[_("span",dl,I(u.$t("common.no_results")),1)]),_:1},8,["modelValue","items","placeholder"])]),_:1},8,["label"]),C(M,{label:u.$t("work_time.modal.notes_label")},{default:y(()=>[C(Z,{modelValue:e(w).notes,"onUpdate:modelValue":$[1]||($[1]=W=>e(w).notes=W),placeholder:u.$t("work_time.modal.notes_placeholder"),rows:2,maxlength:256,autoresize:"",class:"w-full"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e(p)?(s(),D(M,{key:1,label:u.$t("work_time.modal.started_at_label"),error:e(m)?u.$t("timer.modal.start_in_future"):void 0},{default:y(()=>[C(G,{modelValue:e(w).startedAt,"onUpdate:modelValue":$[2]||($[2]=W=>e(w).startedAt=W),max:e(S),class:"w-full"},null,8,["modelValue","max"])]),_:1},8,["label","error"])):B("",!0)])]),footer:y(()=>[_("div",cl,[C(H,{color:"neutral",variant:"outline",onClick:$[3]||($[3]=W=>l("update:open",!1))},{default:y(()=>[K(I(u.$t("common.cancel")),1)]),_:1}),e(k)?(s(),D(H,{key:0,icon:"mosy:floppy-disk",class:"mo-button mo-button-medium",loading:e(d),disabled:!e(w).attendanceTypeId||e(m),onClick:o},{default:y(()=>[K(I(u.$t("common.save")),1)]),_:1},8,["loading","disabled"])):(s(),D(H,{key:1,icon:"mosy:user-clock",class:"mo-button mo-button-medium",loading:e(d),disabled:!e(w).attendanceTypeId,onClick:A},{default:y(()=>[K(I(u.$t("work_time.start")),1)]),_:1},8,["loading","disabled"]))])]),_:1},8,["open","title"])}}},fl={class:"w-full mb-3"},vl={key:0,class:"label"},ml={key:0,class:"flex flex-col min-w-0 flex-1"},gl={class:"text-[16px] font-bold leading-tight tracking-wide text-secondary-700"},hl={class:"text-[13px] truncate leading-tight mt-1 text-secondary-600"},yl={class:"text-[14px] font-semibold leading-tight text-secondary-700"},bl={class:"text-[16px] font-bold leading-tight mt-0.5 text-secondary-600"},_l={__name:"AppWorkTimerButton",props:{showLabel:{type:Boolean,default:!0},showSolo:{type:Boolean,default:!1}},setup(t){const{t:i}=xe(),a=ct(),{isWorking:l,isOnBreak:n,isActive:v,formattedWorkTime:r,activeWorkEntry:f,activeBreak:g,fetchActiveWorkEntry:L,startBreak:q,endBreak:h,stopWork:p}=Jt(),d=j(!1),c=j(!1),k=j(!1),S=j(!1),z=j(0);let b=null;ae(n,o=>{if(o&&g.value?.started_at){b&&clearInterval(b);const u=()=>{z.value=Math.max(0,Math.floor((Date.now()-new Date(g.value.started_at).getTime())/1e3))};u(),b=wn(u,1e3)}else b&&(clearInterval(b),b=null),z.value=0},{immediate:!0}),Oa(()=>{b&&clearInterval(b)}
1);const m=P(()=>{const o=z.value,u=Math.floor(o/3600),$=Math.floor(o%3600/60),R=o%60;return[u,$,R].map(U=>String(U).padStart(2,"0")).join(":")}),w=P(()=>f.value?.attendance_type?.name||null);Me(async()=>{await L()});async function x(){if(S.value=!0,n.value){const{error:o}=await h();o&&a.add({class:"mo-toast",title:i("common.error"),description:o.message,color:"error"})}else{const{error:o}=await q();o&&a.add({class:"mo-toast",title:i("common.error"),description:o.message,color:"error"})}S.value=!1}async function A(){k.value=!0;const o=r.value,{error:u}=await p();if(k.value=!1,u){a.add({title:u.overlap?i("work_time.overlap.title"):i("common.error"),description:u.message,class:"mo-toast",icon:"mosy:circle-exclamation",color:"error",duration:8e3});return}a.add({title:i("work_time.saved"),description:o,class:"mo-toast",icon:"mosy:circle-check",color:"success"})}return(o,u)=>{const $=se,R=$e,U=Bt,X=pl;return s(),O("div",fl,[e(v)?(s(),O("div",{key:1,class:T(["flex flex-col items-start gap-4 rounded-2xl px-3.5 py-3 bg-secondary-200/70",[{isOnBreak:"border-2 border-secondary-200!"},{"px-1!":!t.showLabel}]]),style:{"border-color":"var(--color-marble-secondary-300)"}},[t.showLabel?(s(),O("div",ml,[e(l)?(s(),O(re,{key:0},[_("span",gl,I(e(r)),1),_("span",hl,I(e(w)||o.$t("work_time.title")),1)],64)):(s(),O(re,{key:1},[_("span",yl,I(o.$t("work_time.on_break")),1),_("span",bl,I(e(m)),1)],64))])):B("",!0),_("div",{class:T(["w-full flex items-center gap-1 justify-end",{"flex-col":!t.showLabel}])},[C(U,{text:o.$t("work_time.edit_tooltip")},{default:y(()=>[C(R,{size:"md",variant:"subtle",icon:"mosy:pen",class:"mo-timer-edit-btn bg-secondary-500! hover:bg-secondary-600!",onClick:u[1]||(u[1]=M=>c.value=!0)})]),_:1},8,["text"]),C(U,{text:e(n)?o.$t("work_time.resume"):o.$t("work_time.pause")},{default:y(()=>[C(R,{size:"md",variant:"soft",icon:e(n)?"mosy:play":"mosy:mug-hot",class:"mo-timer-break-btn bg-secondary-500! hover:bg-secondary-600!",loading:e(S),onClick:x},null,8,["icon","loading"])]),_:1},8,["text"]),C(U,{text:o.$t("work_time.stop_tooltip")},{default:y(()=>[C(R,{size:"md",variant:"soft",icon:"i-lucide-circle-stop",class:"mo-timer-stop-btn bg-secondary-500! hover:bg-secondary-600!",loading:e(k),onClick:A},null,8,["loading"])]),_:1},8,["text"])],2)],2)):(s(),O("button",{key:0,class:"bg-secondary-100 w-full flex items-center justify-center gap-2 p-[14px]! rounded-[22px] text-secondary-600 text-base font-bold transition-all duration-150 hover:cursor-pointer hover:bg-secondary-200 hover:text-secondary-700",onClick:u[0]||(u[0]=M=>d.value=!0)},[C($,{name:"mosy:circle-play",class:T(["w-6 h-6",{"shrink-0":!t.showLabel}])},null,8,["class"]),t.showLabel?(s(),O("span",vl,I(o.$t("work_time.start")),1)):B("",!0)])),C(X,{open:e(d),"onUpdate:open":u[2]||(u[2]=M=>Be(d)?d.value=M:null)},null,8,["open"]),C(X,{open:e(c),"onUpdate:open":u[3]||(u[3]=M=>Be(c)?c.value=M:null),mode:"edit",entry:e(f)},null,8,["open","entry"])])}}},wl=We(_l,[["__scopeId","data-v-873b6192"]]),xl={class:"space-y-4"},kl={class:"text-sm italic text-secondary-100"},$l={key:1,class:"shrink-0 translate-y-[6px] h-2.5 flex w-7 justify-center"},Il={class:"text-sm italic text-secondary-100"},Cl={class:"text-xs text-muted"},Sl={class:"text-sm italic text-secondary-100"},Ll={class:"flex gap-2 justify-end w-full"},Tl={__name:"AppTimerModal",props:{open:Boolean,mode:{type:String,default:"start"},entry:{type:Object,default:null}},emits:["update:open"],setup(t,{emit:i}){const a=t,l=i,{t:n}=xe(),{labelProject:v,labelProjects:r,labelSubtask:f,labelClient:g,labelClients:L}=gt(),q=mt(),{startTimer:h,updateTimer:p}=Zt(),{sortedClients:d,fetchClients:c}=Ka(),{activeProjects:k,fetchProjects:S}=Xa(),{tags:z,fetchTags:b}=Vn(),m=j(!1),w=j(!1),x=j(""),A=j([]),o=j(!1),u=P(()=>a.mode==="edit"),$=j("");function R(){const E=new Date,N=E.getTimezoneOffset();$.value=new Date(E.getTime()-N*6e4).toISOString().slice(0,16)}const U=P(()=>!!(M.startedAt&&$.value&&M.startedAt>$.value));function X(E){if(!E)return"";const N=new Date(E),Q=N.getTimezoneOffset();return new Date(N.getTime()-Q*6e4).toISOString().slice(0,16)}const M=Ta({clientId:null,projectId:null,subtaskId:null,notes:"",startedAt:"",tagIds:[]}),Z=P(()=>[{label:n("timer.modal.client_placeholder",{clients:L.value}),value:null},...d.value.map(E=>({label:E.name,value:E.id,logo_url:E.logo_url}))]),G=P(()=>[...M.clientId?k.value.filter(N=>N.client_id===M.clientId):k.value].sort((N,Q)=>N.name.localeCompare(Q.name,"de",{sensitivity:"base"})).map(N=>({label:N.name,value:N.id,color:N.color,logo_url:N.logo_url}))),H=P(()=>[{label:n("timer.modal.subtask_placeholder",{subtask:f.value}),value:null},...A.value.map(E=>({label:E.name,value:E.id}))]);ae(()=>M.clientId,()=>{o.value||(M.projectId=null,M.subtaskId=null,A.value=[])},{flush:"sync"}),ae(()=>M.projectId,async E=>{if(o.value||(M.subtaskId=null,A.value=[],!E))return;const{data:N}=await q.from("subtasks").select("id, name").eq("project_id",E).order("sort_order");A.value=N||[]},{flush:"sync"}),ae(()=>a.open,async E=>{if(E)if(x.value="",R(),a.open?setTimeout(()=>{w.value=!0},300):w.value=!1,u.value&&a.entry){await Promise.all([c(),S(),b()]),o.value=!0;const N=a.entry?.project?.client_id||null,Q=N&&d.value.some(J=>J.id===N);M.clientId=Q?N:null;const pe=a.entry.project_id,ee=pe&&k.value.some(J=>J.id===pe);
1if(M.projectId=ee?pe:null,M.subtaskId=a.entry.subtask_id||null,M.notes=a.entry.notes||"",M.startedAt=X(a.entry.started_at),M.tagIds=(a.entry.entry_tags||[]).map(J=>J.tag?.id).filter(Boolean),o.value=!1,!ee&&pe&&(x.value=n("timer.modal.project_unavailable",{project:v.value})),a.entry.project_id){const{data:J}=await q.from("subtasks").select("id, name").eq("project_id",a.entry.project_id).order("sort_order");A.value=J||[]}}else M.clientId=null,M.projectId=null,M.subtaskId=null,M.notes="",M.startedAt=$.value,M.tagIds=[],A.value=[],x.value="",c(),S(),b()});async function F(){if(!M.projectId||!M.notes.trim())return;m.value=!0,x.value="";const{error:E}=await h({projectId:M.projectId,subtaskId:M.subtaskId,notes:M.notes||null,tagIds:M.tagIds,startedAt:M.startedAt?new Date(M.startedAt).toISOString():void 0});m.value=!1,E?x.value=E.message:l("update:open",!1)}Lt("keydown",E=>{E.key==="Escape"&&a.open&&(E.preventDefault(),l("update:open",!1))});async function W(){if(!M.projectId){x.value=n("timer.modal.project_required",{project:v.value});return}if(!M.notes.trim())return;m.value=!0,x.value="";const{error:E}=await p({projectId:M.projectId,subtaskId:M.subtaskId,notes:M.notes||null,startedAt:M.startedAt?new Date(M.startedAt).toISOString():void 0,tagIds:M.tagIds});m.value=!1,E?x.value=E.message:l("update:open",!1)}return(E,N)=>{const Q=Ua,pe=vt,ee=se,J=Va,ie=Fa,me=Un,ce=Ha,ne=Wa,_e=$e,Ne=Oe;return s(),D(Ne,{open:t.open,close:!1,title:e(u)?E.$t("timer.modal.edit_title"):E.$t("timer.modal.title"),ui:{width:"sm:max-w-md"},"onUpdate:open":N[7]||(N[7]=te=>l("update:open",te))},{body:y(()=>
1[_("div",xl,[e(x)?(s(),D(Q,{key:0,color:"primary",icon:"mosy:circle-exclamation",title:e(x)},null,8,["title"])):B("",!0),C(ie,{label:E.$t("timer.modal.client_label",{client:e(g)})},{default:y(()=>[C(J,{modelValue:e(M).clientId,"onUpdate:modelValue":N[0]||(N[0]=te=>e(M).clientId=te),items:e(Z),"value-key":"value",placeholder:E.$t("timer.modal.client_placeholder",{clients:e(L)}),"search-input":{placeholder:e(n)("common.search"),leadingIcon:"i-lucide-search"},class:"w-full pr-7.5!"},{item:y(({item:te})=>[te.value!==null?(s(),D(pe,{key:0,src:te.logo_url||void 0,text:te.logo_url?void 0:te.label?.slice(0,2).toUpperCase(),size:"2xs",class:"shrink-0 avatar avatar-extrasmall"},null,8,["src","text"])):B("",!0),_("span",{class:T(["font-medium text-white line-clamp-2 break-all-custom",{"translate-y-1":te.value!==null}])},I(te.label),3),e(M).clientId===te.value?(s(),D(ee,{key:1,name:"mosy:circle-check",class:T(["mo-custom-selected-icon ml-auto shrink-0",{"mo-custom-selected-icon-client":te.value!==null}])},null,8,["class"])):B("",!0)]),empty:y(()=>[_("span",kl,I(E.$t("clients.empty",{clients:e(L)})),1)]),_:1},8,["modelValue","items","placeholder","search-input"])]),_:1},8,["label"]),C(ie,{label:e(v),required:""},xn({default:y(()=>[C(J,{modelValue:e(M).projectId,"onUpdate:modelValue":N[1]||(N[1]=te=>e(M).projectId=te),items:e(G),"value-key":"value",placeholder:E.$t("timer.modal.project_placeholder",{project:e(v)}),disabled:e(G).length===0,"search-input":{placeholder:e(n)("common.search"),leadingIcon:"i-lucide-search"},class:"w-full pr-7.5!",ui:{item:"gap-[7px]!"}},{item:y(({item:te})=>[te.logo_url?(s(),D(pe,{key:0,src:te.logo_url,size:"2xs",class:"shrink-0 avatar avatar-extrasmall"},null,8,["src"])):(s(),O("div",$l,[_("span",{class:"w-2.5 h-2.5 rounded-full shrink-0 ring-1 ring-white",style:Qt({backgroundColor:te.color??"#488987"})},null,4)])),_("span",{class:T(["text-white font-medium line-clamp-2 break-all-custom",{"translate-y-1":te.logo_url}])},I(te.label),3),e(M).projectId===te.value?(s(),D(ee,{key:2,name:"mosy:circle-check",class:"mo-custom-selected-icon ml-auto shrink-0"})):B("",!0)]),empty:y(()=>[_("span",Il,I(E.$t("common.no_results")),1)]),_:1},8,["modelValue","items","placeholder","disabled","search-input"])]),_:2},[e(G).length===0&&e(w)?{name:"hint",fn:y(()=>[_("span",Cl,I(e(M).clientId?E.$t("timer.modal.no_projects_for_client",{projects:e(r),client:e(g)}):E.$t("timer.modal.no_projects",{projects:e(r)})),1)]),key:"0"}:void 0]),1032,["label"]),e(M).projectId&&e(H).length>1?(s(),D(ie,{key:1,label:E.$t("timer.modal.subtask_label",{subtask:e(f)})},{default:y(()=>[C(J,{modelValue:e(M).subtaskId,"onUpdate:modelValue":N[2]||(N[2]=te=>e(M).subtaskId=te),items:e(H),"value-key":"value",placeholder:E.$t("timer.modal.subtask_placeholder",{subtask:e(f)}),"search-input":{placeholder:e(n)("common.search"),leadingIcon:"i-lucide-search"},class:"w-full pr-7.5!"},{empty:y(()=>[_("span",Sl,I(E.$t("common.no_results")),1)]),_:1},8,["modelValue","items","placeholder","search-input"])]),_:1},8,["label"])):B("",!0),e(z).length?(s(),D(ie,{key:2,label:E.$t("timer.modal.tags_label")},{default:y(()=>[C(me,{modelValue:e(M).tagIds,"onUpdate:modelValue":N[3]||(N[3]=te=>e(M).tagIds=te),tags:e(z)},null,8,["modelValue","tags"])]),_:1},8,["label"])):B("",!0),C(ie,{required:"",label:E.$t("timer.modal.notes_label"),hint:E.$t("time_entries.modal.max_hint")},{default:y(()=>[C(ce,{modelValue:e(M).notes,"onUpdate:modelValue":N[4]||(N[4]=te=>e(M).notes=te),placeholder:E.$t("timer.modal.notes_placeholder"),rows:2,maxlength:256,autoresize:"",class:"w-full"},null,8,["modelValue","placeholder"])]),_:1},8,["label","hint"]),C(ie,{class:"mo-form-items",label:E.$t("timer.modal.started_at_label"),error:e(U)?E.$t("timer.modal.start_in_future"):void 0},{default:y(()=>[C(ne,{modelValue:e(M).startedAt,"onUpdate:modelValue":N[5]||(N[5]=te=>e(M).startedAt=te),max:e($),class:"w-full"},null,8,["modelValue","max"])]),_:1},8,["label","error"])])]),footer:y(()=>[_("div",Ll,[C(_e,{color:"neutral",variant:"outline",onClick:N[6]||(N[6]=te=>l("update:open",!1))},{default:y(()=>[K(I(E.$t("common.cancel")),1)]),_:1}),e(u)?(s(),D(_e,{key:0,icon:"mosy:floppy-disk",class:"mo-button mo-button-medium",loading:e(m),disabled:!e(M).projectId||!e(M).notes.trim()||e(U),onClick:W},{default:y(()=>[K(I(E.$t("common.save")),1)]),_:1},8,["loading","disabled"])):(s(),D(_e,{key:1,icon:"mosy:circle-play",class:"mo-button mo-button-medium",loading:e(m),disabled:!e(M).projectId||!e(M).notes.trim()||e(U),onClick:F},{default:y(()=>
1[K(I(E.$t("timer.modal.start_button")),1)]),_:1},8,["loading","disabled"]))])]),_:1},8,["open","title"])}}},Ol={key:0,class:"label"},Dl={key:0,class:"flex flex-col min-w-0 flex-1"},ql={class:"text-[16px] font-bold leading-tight tracking-wide text-secondary-50"},Bl={class:"text-[13px] truncate leading-tight mt-1 text-secondary-200"},Pl={__name:"AppTimerButton",props:{showLabel:{type:Boolean,default:!0}},setup(t){const{t:i}=xe(),{labelProject:a}=gt(),{isRunning:l,formattedTime:n,activeEntry:v,fetchActiveEntry:r,stopTimer:f}=Zt(),{currentOrg:g,ownOrg:L}=De(),{planName:q}=tt(),h=P(()=>g.value??L.value),p=ct(),d=j(!1),c=j(!1),k=j(!1),S=P(()=>h?.value.color&&q.value==="rocket");Me(async()=>{await r()});async function z(){k.value=!0;const b=v.value?.project?.name,m=n.value,{error:w}=await f();if(k.value=!1,w?.code==="project_missing"){p.add({title:i("timer.modal.project_unavailable",{project:a.value}),class:"mo-toast",icon:"mosy:circle-exclamation",color:"error"}),c.value=!0;return}if(w?.code==="entry_gone"){p.add({title:i("timer.entry_gone",{project:a.value}),class:"mo-toast",icon:"mosy:circle-exclamation",color:"error"});return}w||p.add({title:i("timer.saved"),class:"mo-toast",description:`${b?b+" · ":""}${m}`,icon:"mosy:circle-check",color:"success"})}return(b,m)=>{const w=se,x=$e,A=Bt,o=Tl;return s(),O("div",{class:T(["w-full mb-3.5",{"mb-3!":!t.showLabel}])},[e(l)?(s(),O("div",{key:1,class:T(["flex items-center gap-2 rounded-2xl px-3.5 py-3 border-2 border-secondary-200!",[{"bg-secondary-600":e(S)},{"bg-marble bg-marble-timer":!e(S)},{"flex-col py-1.5! px-1!":!t.showLabel}]]),style:{"border-color":"var(--color-marble-secondary-300)"}},[t.showLabel?(s(),O("div",Dl,[_("span",ql,I(e(n)),1),_("span",Bl,I(e(v)?.notes||e(v)?.project?.name),1)])):B("",!0),C(A,{text:b.$t("timer.edit_tooltip")},{default:y(()=>[C(x,{size:"md",variant:"soft",icon:"mosy:pen",class:"mo-timer-edit-btn",onClick:m[1]||(m[1]=u=>c.value=!0)})]),_:1},8,["text"]),C(A,{text:b.$t("timer.stop_tooltip")},{default:y(()=>[C(x,{size:"md",variant:"soft",icon:"i-lucide-circle-stop",class:"mo-timer-stop-btn",loading:e(k),onClick:z},null,8,["loading"])]),_:1},8,["text"])],2)):(s(),O("button",{key:0,class:"mb-btn-secondary w-full flex items-center justify-center gap-2 p-[14px]! rounded-[22px] text-white text-base font-bold transition-all duration-150 hover:cursor-pointer",onClick:m[0]||(m[0]=u=>d.value=!0)},[C(w,{name:"mosy:stopwatch",class:T(["w-6 h-6",{"shrink-0":!t.showLabel}])},null,8,["class"]),t.showLabel?(s(),O("span",Ol,I(b.$t("timer.start")),1)):B("",!0)])),C(o,{open:e(d),"onUpdate:open":m[2]||(m[2]=u=>Be(d)?d.value=u:null)},null,8,["open"]),C(o,{open:e(c),"onUpdate:open":m[3]||(m[3]=u=>Be(c)?c.value=u:null),mode:"edit",entry:e(v)},null,8,["open","entry"])],2)}}},Al=We(Pl,[["__scopeId","data-v-c8fad6dc"]]),Ml=5;function wa(t){return t==null||t<1||t>Ml?null:t<=1?1:t<=3?3:5}function an(){const{selfSubscription:t,isSelfTrialing:i,selfTrialDaysLeft:a,selfTrialEnd:l,selfPlan:n,selfIsCanceled:v}=tt(),{ownOrgId:r}=De(),{isNativeApp:f}=ea(),{openPortal:g,paymentStatus:L,loading:q}=oa(),h=Te("trialPaymentLive",()=>({})),p=Te("trialPaymentAsked",()=>({})),d=P(()=>!f.value&&!!r.value&&i.value&&!v.value&&wa(a.value)!==null),c=P(()=>{const m=t.value?.has_payment_method;return m===!0?!0:h.value[r.value]??m??null});ae([d,()=>t.value?.has_payment_method],async([m,w])=>{const x=r.value;if(!m||w===!0||!x||p.value[x])return;p.value={...p.value,[x]:!0};const A=await L();typeof A?.hasPaymentMethod=="boolean"&&(h.value={...h.value,[x]:A.hasPaymentMethod})},{immediate:!0});const k=P(()=>d.value&&c.value===!1),S=P(()=>wa(a.value)),z=P(()=>a.value),b=P(()=>n.value==="rocket"?"Rocket":"Pro");return{sichtbar:k,stufe:S,tage:z,endDatum:l,planLabel:b,orgId:r,openPortal:g,loading:q}}const El=["disabled","aria-label"],zl={key:1,class:"tabular-nums leading-6"},Rl={key:1,class:"mb-background mb-background-light-overlay rounded-[22px] p-4 flex flex-col gap-2.5"},jl={class:"flex items-center gap-2 text-white"},Nl={class:"font-waden text-[14px] leading-none translate-y-px"},Ul={class:"text-white text-[15px] font-bold leading-snug"},Vl=["disabled"],Fl={__name:"AppTrialReminderCard",props:{showLabel:{type:Boolean,default:!0}},setup(t){const{sichtbar:i,tage:a,planLabel:l,openPortal:n,loading:v}=an(),{t:r}=xe(),f=P(()=>
1a.value===1?r("trial_reminder.card_last_day"):r("trial_reminder.card_days",{days:a.value}));return(g,L)=>{const q=se,h=Bt;return e(i)?(s(),O("div",{key:0,class:T(["w-full mb-3.5",{"mb-3!":!t.showLabel}])},[t.showLabel?(s(),O("div",Rl,[_("div",jl,[C(q,{name:"mosy:hourglass-clock",class:"w-4 h-4 shrink-0"}),_("span",Nl,I(g.$t("trial_reminder.card_eyebrow",{plan:e(l)})),1)]),_("p",Ul,I(e(f)),1),_("button",{class:"bg-white shadow-none! flex items-center justify-center gap-2 px-3 py-2.5 rounded-[18px] border border-[#9CBDBF] text-[#639598] text-[13px] font-bold transition-all duration-150 hover:bg-secondary-100 hover:text-secondary-700 hover:cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",disabled:e(v),onClick:L[1]||(L[1]=p=>e(n)())},[e(v)?(s(),D(q,{key:0,name:"i-lucide-loader-circle",class:"w-4 h-4 animate-spin"})):(s(),O(re,{key:1},[C(q,{name:"mosy:money-check-pen",class:"w-4 h-4"}),_("span",null,I(g.$t("trial_reminder.cta")),1)],64))],8,Vl)])):(s(),D(h,{key:0,text:`${e(f)} · ${g.$t("trial_reminder.cta")}`},{default:y(()=>[_("button",{class:"mb-background mb-background-light-overlay w-full flex items-center justify-center rounded-[22px] p-[14px]! text-white font-bold text-base hover:cursor-pointer disabled:opacity-60",disabled:e(v),"aria-label":`${e(f)} · ${g.$t("trial_reminder.cta")}`,onClick:L[0]||(L[0]=p=>e(n)())},[e(v)?(s(),D(q,{key:0,name:"i-lucide-loader-circle",class:"w-6 h-6 animate-spin"})):(s(),O("span",zl,I(e(a)),1))],8,El)]),_:1},8,["text"]))],2)):B("",!0)}}},Hl={class:"space-y-2 py-1 mo-no-max"},Wl=["onClick"],Kl={class:"flex-1 font-semibold text-sm text-secondary-700 truncate"},Xl={__name:"AppOrgSwitcherModal",emits:["close"],setup(t,{emit:i}){const a=i,{t:l}=xe(),{currentOrg:n,organizations:v,switchOrganization:r}=De(),{activeEntry:f,stopTimer:g}=Zt(),{isActive:L,stopWork:q}=Jt(),h=at();je({escape:{usingInput:!0,handler:()=>{a("close")}}});async function p(d){if(d===n.value?.id){a("close");return}await Promise.all([f.value?g():Promise.resolve(),L.value?q({force:!0}):Promise.resolve()]),await r(d),a("close"),pt(h("index"))}return(d,c)=>{const k=vt,S=se,z=Oe;return s(),D(z,{open:!0,title:d.$t("org_switcher.title"),"onUpdate:open":c[0]||(c[0]=b=>a("close"))},{body:y(()=>[_("div",Hl,[(s(!0),O(re,null,Le(e(v),b=>(s(),O("button",{key:b.id,class:T(["w-full flex items-center gap-3 px-3 py-2.5 rounded-3xl hover:bg-secondary-100/70 cursor-pointer transition-colors text-left group",b.id===e(n)?.id?"bg-secondary-200/70":""]),onClick:m=>p(b.id)},[C(k,{src:b.logo_url||void 0,text:b.logo_url?void 0:(b.name||"").slice(0,2).toUpperCase(),size:"sm",ui:{fallback:"text-secondary-600! group-hover:text-secondary-700!"},class:T(["avatar avatar-small shrink-0 bg-secondary-100 group-hover:bg-white/90",b.id===e(n)?.id?"bg-white/90":""])},null,8,["src","text","class"]),_("span",Kl,I(b.name),1),b.id===e(n)?.id?(s(),D(S,{key:0,name:"mosy:circle-check",class:"text-secondary-700 w-4.5 h-4.5 shrink-0"})):B("",!0)],10,Wl))),128))])]),_:1},8,["title"])}}};function Gl(){const t=kn(),i=P(()=>t.value?"Online":"Offline"),a=P(()=>t.value?"success":"error");return{isOnline:t,statusLabel:i,statusColor:a}}function Yl(){const{$db:t}=Kt(),i=mt(),{isOnline:a}=Gl(),l=j(0),n=j(!1),v=j(null);async function r(){if(t)try{l.value=await t.sync_queue.where("synced").equals(0).count()}catch{l.value=0}}async function f(h,p,d,c){if(t){if(p==="INSERT"||p==="UPDATE"?await t[h].put(c):p==="DELETE"&&await t[h].delete(d),a.value)try{await g(h,p,d,c);return}catch{}await t.sync_queue.add({table:h,operation:p,recordId:d,payload:JSON.stringify(c),synced:0,retries:0,createdAt:Date.now()}),await r()}}async function g(h,p,d,c){if(p==="INSERT"){const{error:k}=await i.from(h).upsert(c);if(k)throw k}else if(p==="UPDATE"){const{error:k}=await i.from(h).update(c).eq("id",d);if(k)throw k}else if(p==="DELETE"){const{error:k}=await i.from(h).delete().eq("id",d);if(k)throw k}}async function L(){if(!(!t||n.value)){n.value=!0;try{const h=await t.sync_queue.where("synced").equals(0).sortBy("createdAt");for(const p of h)try{const d=JSON.parse(p.payload);if(p.operation==="UPDATE"){const{data:c}=await i.from(p.table).select("updated_at").eq("id",p.recordId).single();if(c&&new Date(c.updated_at)>new Date(d.updated_at)){const{data:k}=await i.from(p.table).select("*").eq("id",p.recordId).single();k&&await t[p.table].put(k),await t.sync_queue.update(p.localId,{synced:1});continue}}await g(p.table,p.operation,p.recordId,d),await t.sync_queue.update(p.localId,{synced:1})}catch{await t.sync_queue.update(p.localId,{retries:(p.retries||0)+1})}await t.sync_queue.where("synced").equals(1).delete(),v.value=new Date}finally{n.value=!1,await r()}}}ae(a,h=>{h&&L()}),Me(()=>{r()});const q=P(()=>n.value?"syncing":a.value?l.value>0?"pending":"idle":"offline");return{pendingCount:l,syncing:n,lastSyncAt:v,syncStatus:q,enqueue:f,flush:L,updatePendingCount:r}}const Jl={key:0,class:"flex-1 min-w-0"},Zl={key:0,class:"text-[17px] font-semibold truncate leading-5 text-secondary-700 pr-[8px]"},Ql={key:1,class:"truncate"},es={key:1,class:"text-[13px] text-slate-500/90 truncate block"},ts={class:"flex items-center gap-2 py-1.5 px-1 mo-nav-footer-mobile-profile"},as={class:"flex-1 min-w-0"},ns={class:"flex items-center gap-1.5 justify-between"},os={class:"text-[17px] font-semibold truncate leading-5 text-secondary-700"},ls={key:0,class:"inline-flex items-center justify-center min-w-[21px] h-[21px] px-1 rounded-full bg-secondary-500 text-white text-[12px] font-bold leading-none shrink-0 translate-y-[0px]"},ss={class:"truncate"},is={key:1,class:"text-[13px] text-slate-500/90 truncate block"},rs={key:2,class:"flex items-center gap-[5px] text-xs text-secondary-500 pl-1.5"},us={class:"font-semibold"},ds={class:"flex items-center gap-3"}
1,cs={class:"flex shrink-0 items-center justify-center w-10 h-10 rounded-full bg-secondary-100"},ps={class:"text-sm text-secondary-600 font-semibold"},fs={class:"flex justify-end gap-2 w-full"},vs={__name:"AppSidebarFooter",props:{showLabel:{type:Boolean,default:!0},isMobile:{type:Boolean,default:!1}},setup(t){const i=mt(),{displayName:a,initials:l,avatarUrl:n,fetchProfile:v,user:r,profile:f}=ta(),{ownOrgId:g,currentOrg:L,organizations:q,canAccessIntelligence:h,canAccessProjectTimes:p,canAccessWorkTimes:d}=De(),{myInvites:c,fetchMyInvites:k}=aa(g),{resetClientState:S}=Fn(),z=Dt();ae(r,me=>{me&&!f.value&&v(),me&&k()},{immediate:!0});const b=P(()=>c.value.length),{syncStatus:m,pendingCount:w}=Yl(),x=j(!1),A=j(!1),o=at(),{t:u}=xe(),$=j(!1),R=P(()=>q.value.length>1),U=P(()=>{switch(m.value){case"offline":return{color:"bg-red-500",label:u("sync.offline")};case"syncing":return{color:"bg-yellow-500 animate-pulse",label:u("sync.syncing")};case"pending":return{color:"bg-amber-500",label:u("sync.pending",{count:w.value})};default:return{color:"bg-green-400",label:u("sync.online")}}}),X=j(!1),M=j(!1),Z=()=>{X.value=!0};je({escape:{usingInput:!0,handler:()=>{X.value&&!M.value&&(X.value=!1)}},enter:{handler:()=>{X.value&&!M.value&&ee()}}});const G=In(null),H=P(()=>G.value?.name??a.value),F=P(()=>G.value?.initials??l.value),W=P(()=>G.value?G.value.avatar:n.value),E=P(()=>G.value?G.value.org:L.value),N=P(()=>G.value?.mehrereOrgs??R.value),Q=P(()=>G.value?.einladungen??b.value);function pe(){G.value={name:a.value,initials:l.value,avatar:n.value,org:L.value?{name:L.value.name,logo_url:L.value.logo_url}:null,mehrereOrgs:R.value,einladungen:b.value}}ae(r,(me,ce)=>{me||!ce||G.value||!f.value||pe()},{flush:"sync"});const ee=async()=>{M.value=!0,pe();try{await $n(),await i.auth.signOut({scope:"local"}),S(),X.value=!1,pt(o("auth-login"))}catch{G.value=null,M.value=!1}},J=P(()=>[[{label:u("nav.bug_report"),icon:"mosy:bug",href:u("nav.bug_report_url"),target:"_blank",rel:"noopener noreferrer"},{label:u("nav.help_center"),icon:"mosy:circle-question",href:u("nav.help_center_url"),target:"_blank",rel:"noopener noreferrer"},{label:u("nav.get_support"),icon:"mosy:comments",href:u("nav.get_support_url"),target:"_blank",rel:"noopener noreferrer"},{label:u("nav.whats_new"),icon:"mosy:megaphone",href:u("nav.whats_new_url"),target:"_blank",rel:"noopener noreferrer"}],[{label:u("nav.settings"),icon:"mosy:gear",to:o("settings")}],[{label:u("nav.logout"),icon:"mosy:arrow-right-from-bracket",onSelect(){Z()}}]]),ie=P(()=>[{label:u("nav.bug_report"),icon:"mosy:bug",href:u("nav.bug_report_url"),target:"_blank",rel:"noopener noreferrer"},{label:u("nav.help_center"),icon:"mosy:circle-question",href:u("nav.help_center_url"),target:"_blank",rel:"noopener noreferrer"},{label:u("nav.get_support"),icon:"mosy:comments",href:u("nav.get_support_url"),target:"_blank",rel:"noopener noreferrer"},{label:u("nav.whats_new"),icon:"mosy:megaphone",href:u("nav.whats_new_url"),target:"_blank",rel:"noopener noreferrer"},{label:u("nav.settings"),icon:"mosy:gear",to:o("settings"),active:z.name?.startsWith("settings")},{label:u("nav.logout"),icon:"mosy:arrow-right-from-bracket",class:"mo-nav-divider",onSelect(){Z()}}]);return(me,ce)=>{const ne=vt,_e=se,Ne=Yn,te=tn,Xe=Xl,Pe=$e,nt=Oe;return s(),O("div",{class:T(["space-y-1.5 w-full px-2 mb-[4px]",{"px-1.5!":!t.showLabel}])},[t.isMobile?(s(),O(re,{key:1},[C(te,{items:e(ie),orientation:"vertical",class:T(["space-y-0.5 mo-footer-mobile-nav",{"mo-no-border pt-0!":!e(h)&&!e(p)&&!e(d)}])},null,8,["items","class"]),_("div",ts,[C(ne,{src:e(W)||void 0,text:e(W)?void 0:e(F),class:"avatar avatar-medium"},null,8,["src","text"]),_("div",as,[_("div",ns,[_("p",os,I(e(H)),1),e(Q)>
10?(s(),O("span",ls,I(e(Q)),1)):B("",!0)]),e(E)?.name?(s(),O("div",{key:0,class:T(["flex items-center gap-1.5 mt-[1px]",{"mt-2!":e(N)}])},[e(N)?(s(),O("button",{key:0,class:"flex items-center gap-0.5 text-[13px] font-semibold text-white truncate hover:bg-secondary-600 cursor-pointer transition-colors bg-secondary-400 ring-1 ring-secondary-300 py-1 px-2 pr-2.5 rounded-xl max-w-full",onClick:ce[2]||(ce[2]=Ft(qe=>A.value=!0,["stop"]))},[e(E).logo_url!==null?(s(),D(ne,{key:0,src:e(E).logo_url||void 0,text:e(E).logo_url?void 0:e(E).name?.slice(0,2).toUpperCase(),size:"2xs",class:"shrink-0 avatar avatar-supersmall mr-1"},null,8,["src","text"])):B("",!0),_("span",ss,I(e(E).name),1),e(E).logo_url==null?(s(),D(_e,{key:1,name:"i-lucide-chevrons-up-down",class:"w-3 h-3 shrink-0 opacity-90"})):B("",!0)])):(s(),O("span",is,I(e(E).name),1))],2)):B("",!0)])])],64)):(s(),D(Ne,{key:0,items:e(J),open:e(x),"onUpdate:open":ce[1]||(ce[1]=qe=>Be(x)?x.value=qe:null),size:"lg",class:"group",ui:{content:"mo-context mo-context-sidebar",item:"before:bg-transparent!"},content:{align:t.showLabel?"center":"start",side:"top",sideOffset:10,collisionPadding:0}},{default:y(()=>[_("div",{class:T(["flex items-center gap-2 py-1.5 cursor-pointer rounded-md mo-nav-footer-context",[{"flex-col justify-center px-0 gap-0!":!t.showLabel},{"gap-2!":e(E)?.name&&e(N)}]])},[C(ne,{src:e(W)||void 0,text:e(W)?void 0:e(F),class:"avatar avatar-medium"},null,8,["src","text"]),t.showLabel||e(Q)>0||e(E)?.name&&e(N)?(s(),O("div",Jl,[_("div",{class:T(["flex items-center gap-1.5 mb-0.5 justify-between",{"mb-0!":!t.showLabel}])},[t.showLabel?(s(),O("p",Zl,I(e(H)),1)):B("",!0),e(Q)>0?(s(),O("span",{key:1,class:T(["inline-flex items-center justify-center min-w-[21px] h-[21px] px-1 rounded-full bg-secondary-500 text-white text-[12px] font-bold leading-none shrink-0",[{"translate-y-[-1px]":!t.showLabel&&e(E)?.name&&e(N)},{"-translate-y-[3px]":!t.showLabel&&e(E)?.name&&!e(N)},{"-translate-y-[4px]":t.showLabel&&e(E)?.name&&!e(N)},{"translate-y-[0px]":t.showLabel&&e(E)?.name&&e(N)},{"absolute right-0 top-0 translate-x-[8px]":!t.showLabel}]])},I(e(Q)),3)):B("",!0)],2),t.showLabel||!t.showLabel&&e(E)?.name&&e(N)?(s(),O("div",{key:0,class:T(["flex items-center gap-1.5 justify-between -mt-1",[{"mt-2":e(E)?.name&&e(N)},{"mt-1!":!t.showLabel}]])},[e(E)?.name&&e(N)?(s(),O("button",{key:0,class:T(["flex items-center gap-0.5 text-[13px] font-semibold text-white truncate hover:bg-secondary-600 cursor-pointer transition-colors bg-secondary-400 ring-1 ring-secondary-300 py-1 px-2 pr-2.5 rounded-xl max-w-full",{"px-1!":!t.showLabel}]),onClick:ce[0]||(ce[0]=Ft(qe=>A.value=!0,["stop"]))},[e(E).logo_url!==null||!t.showLabel?(s(),D(ne,{key:0,src:e(E).logo_url||void 0,text:e(E).logo_url?void 0:e(E).name?.slice(0,2).toUpperCase(),size:"2xs",class:T(["shrink-0 avatar mr-1",[{"avatar-supersmall":t.showLabel},{"mr-0! avatar-extrasmall text-[11px]!":!t.showLabel}]])},null,8,["src","text","class"])):B("",!0),t.showLabel?(s(),O("span",Ql,I(e(E).name),1)):B("",!0),e(E).logo_url==null&&t.showLabel?(s(),D(_e,{key:2,name:"i-lucide-chevrons-up-down",class:"w-3 h-3 shrink-0 opacity-90"})):B("",!0)],2)):e(E)?.name&&t.showLabel?(s(),O("span",es,I(e(E).name),1)):B("",!0),t.showLabel?(s(),O("div",{key:2,class:T(["flex items-center justify-center rounded-full bg-secondary-100 w-7 h-7 shrink-0 group-hover:bg-secondary-300",{"translate-y-[2px]":t.showLabel&&e(E)?.name&&!e(N)}])},[C(_e,{name:"mosy:gear",class:"w-3.5 h-3.5 text-secondary-500 group-hover:text-secondary-600"})],2)):B("",!0)],2)):B("",!0)])):B("",!0)],2)]),_:1},8,["items","open","content"])),e($)?(s(),O("div",rs,[_("div",{class:T(["w-2 h-2 rounded-full shrink-0",e(U).color])},null,2),_("span",us,I(e(U).label),1)])):B("",!0),e(A)?(s(),D(Xe,{key:3,onClose:ce[3]||(ce[3]=qe=>A.value=!1)})):B("",!0),C(nt,{open:e(X),"onUpdate:open":ce[5]||(ce[5]=qe=>Be(X)?X.value=qe:null)},{title:y(()=>[_("div",ds,[_("div",cs,[C(_e,{name:"mosy:arrow-right-from-bracket",class:"text-secondary-500 w-5 h-5"})]),K(" "+I(me.$t("logout_modal.title")),1)])]),body:y(()=>[_("p",ps,I(me.$t("logout_modal.description")),1)]),footer:y(()=>[_("div",fs,[C(Pe,{color:"secondary",variant:"subtle",disabled:e(M),onClick:ce[4]||(ce[4]=qe=>X.value=!1)},{default:y(()=>[K(I(me.$t("common.cancel")),1)]),_:1},8,["disabled"]),C(Pe,{color:"secondary",loading:e(M),onClick:ee},{default:y(()=>[K(I(me.$t("logout_modal.confirm")),1)]),_:1},8,["loading"])])]),_:1},8,["open"])],2)}}},ms=We(vs,[["__scopeId","data-v-f18ac2e1"]]);function nn(t,i={},{collapsed:a=j(!1)}={}){const l=j(null),n=P(()=>({side:"left",minSize:0,maxSize:100,defaultSize:0,storage:"cookie",persistent:!0,collapsible:!1,
1collapsedSize:0,resizable:!0,unit:"%",...Be(i)?i.value:i})),{dir:v}=qt(),r={size:n.value.defaultSize,collapsed:e(a)??!1},f=n.value.persistent&&(n.value.resizable||n.value.collapsible)?n.value.storage==="cookie"?Cn(t,{default:()=>r}):Sn(t,r):j(r),g=P({get:()=>f.value.collapsed,set:m=>{n.value.collapsible&&(Be(a)&&(a.value=m),f.value.collapsed=m)}}),L=j(n.value.defaultSize),q=P({get:()=>f.value.size,set:m=>{f.value.size=m}}),h=P(()=>g.value?n.value.collapsedSize:q.value),p=j(!1),d=(m,w,x)=>{if(!l.value||!n.value.resizable)return;const A=l.value.parentElement?.offsetWidth||1,o=v.value==="rtl";let u;o?u=n.value.side==="left"?w-m.clientX:m.clientX-w:u=n.value.side==="left"?m.clientX-w:w-m.clientX;const $=x+u;let R;if(n.value.unit==="rem"){const U=Number.parseFloat(getComputedStyle(document.documentElement).fontSize);R=$/U}else n.value.unit==="px"?R=$:R=$/A*100;if(n.value.collapsible&&R<n.value.collapsedSize+4){b(!0);return}else g.value&&b(!1);q.value=Math.min(n.value.maxSize,Math.max(n.value.minSize,R))},c=m=>{if(!l.value||!n.value.resizable)return;m.preventDefault(),m.stopPropagation();const w=l.value.getBoundingClientRect().width;if(!w)return;const x=m.clientX,A=w;p.value=!0;const o=$=>{d($,x,A)},u=()=>{p.value=!1,document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",u)},k=(m,w,x)=>{if(!l.value||!n.value.resizable||!m.touches[0])return;const A=l.value.parentElement?.offsetWidth||1,o=v.value==="rtl";let u;o?u=n.value.side==="left"?w-m.touches[0].clientX:m.touches[0].clientX-w:u=n.value.side==="left"?m.touches[0].clientX-w:w-m.touches[0].clientX;const $=x+u;let R;if(n.value.unit==="rem"){const U=Number.parseFloat(getComputedStyle(document.documentElement).fontSize);R=$/U}else n.value.unit==="px"?R=$:R=$/A*100;if(n.value.collapsible&&R<n.value.collapsedSize+4){b(!0);return}else g.value&&b(!1);q.value=Math.min(n.value.maxSize,Math.max(n.value.minSize,R))},S=m=>{if(!l.value||!n.value.resizable||!m.touches[0])return;m.preventDefault(),m.stopPropagation();const w=l.value.getBoundingClientRect().width;if(!w)return;const x=m.touches[0].clientX,A=w;p.value=!0;const o=$=>{k($,x,A)},u=()=>{p.value=!1,document.removeEventListener("touchmove",o),document.removeEventListener("touchend",u),document.removeEventListener("touchcancel",u)};document.addEventListener("touchmove",o,{passive:!1}),document.addEventListener("touchend",u),document.addEventListener("touchcancel",u)},z=m=>{!l.value||!n.value.resizable||(m.preventDefault(),m.stopPropagation(),g.value&&b(!1),q.value=n.value.defaultSize)},b=m=>{if(!n.value.collapsible)return;const w=m??!g.value;w&&!g.value?L.value=q.value:!w&&g.value&&(q.value=L.value),g.value=w};return Be(a)&&f.value.collapsed&&(a.value=f.value.collapsed),Be(a)&&ae(a,m=>{n.value.collapsible&&f.value.collapsed!==m&&(f.value.collapsed=m)}),{el:l,size:h,isDragging:p,isCollapsed:g,onMouseDown:c,onTouchStart:S,onDoubleClick:z,collapse:b}}const[ua,gs]=He("DashboardGroup"),hs={base:"hidden lg:block touch-none select-none cursor-ew-resize relative before:absolute before:inset-y-0 before:-left-1.5 before:-right-1.5 before:z-1"},on={__name:"UDashboardResizeHandle",props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(t){const i=t,a=ze(),l=Re("dashboardResizeHandle",i),n=P(()=>we({extend:we(hs),...a.ui?.dashboardResizeHandle||{}}));return(v,r)=>(s(),D(e(Ce),{as:t.as,role:"separator",class:T(n.value({class:[e(l)?.base,i.class]}))},{default:y(()=>[V(v.$slots,"default")]),_:3},8,["as","class"]))}},ys={base:"lg:hidden",variants:{side:{left:"",right:""}}},bs=Object.assign({inheritAttrs:!1},{__name:"UDashboardSidebarToggle",props:{color:{type:null,required:!1,default:"neutral"},variant:{type:null,required:!1,default:"ghost"},side:{type:String,required:!1,default:"left"},ui:{type:Object,required:!1},label:{type:String,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},class:{type:null,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},setup(t){const i=t,a=Ln(Sa(i,"icon","side","class")),{t:l}=qt(),n=ze(),v=Re("dashboardSidebarToggle",i),{sidebarOpen:r,toggleSidebar:f}=ua({sidebarOpen:j(!1),toggleSidebar:()=>{}}),g=P(()=>we({extend:we(ys),...n.ui?.dashboardSidebarToggle||{}}));return(L,q)=>(s(),D($e,oe({...e(a),icon:i.icon||(e(r)?e(n).ui.icons.close:e(n).ui.icons.menu),"aria-label":e(r)?e(l)("dashboardSidebarToggle.close"):e(l)("dashboardSidebarToggle.open"),...L.$attrs},{class:g.value({class:[e(v)?.base,i.class],side:i.side}),onClick:e(f)}),null,16,["class","onClick"]))}}),_s={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-16",wrapper:"",body:"flex-1 overflow-y-auto p-4 sm:p-6",footer
1:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{side:{top:{content:""},right:{content:"max-w-md"},bottom:{content:""},left:{content:"max-w-md"}},inset:{true:{content:"rounded-lg"}},transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"}}},compoundVariants:[{side:"top",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 top-4"}},{side:"top",inset:!1,class:{content:"max-h-full inset-x-0 top-0"}},{side:"right",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 right-4"}},{side:"right",inset:!1,class:{content:"w-full inset-y-0 right-0"}},{side:"bottom",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 bottom-4"}},{side:"bottom",inset:!1,class:{content:"max-h-full inset-x-0 bottom-0"}},{side:"left",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 left-4"}},{side:"left",inset:!1,class:{content:"w-full inset-y-0 left-0"}},{transition:!0,side:"top",class:{content:"data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"}},{transition:!0,side:"right",class:{content:"data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"}},{transition:!0,side:"bottom",class:{content:"data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"}},{transition:!0,side:"left",class:{content:"data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"}}]},ws={__name:"USlideover",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:"right"},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["after:leave","after:enter","close:prevent","update:open"],setup(t,{emit:i}){const a=t,l=i,n=ft(),{t:v}=qt(),r=ze(),f=Re("slideover",a),g=Ze(Yt(a,"open","defaultOpen","modal"),l),L=Da(Ae(()=>a.portal)),q=Ae(()=>a.content),h=P(()=>a.dismissible?{pointerDownOutside:za}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((c,k)=>(c[k]=S=>{S.preventDefault(),l("close:prevent")},c),{})),p=P(()=>we({extend:we(_s),...r.ui?.slideover||{}})({transition:a.transition,side:a.side,inset:a.inset}));return(d,c)=>(s(),D(e(Ea),rt(ut(e(g))),{default:y(({open:k,close:S})=>[n.default?(s(),D(e(qa),{key:0,"as-child":"",class:T(a.class)},{default:y(()=>[V(d.$slots,"default",{open:k})]),_:2},1032,["class"])):B("",!0),C(e(Ba),rt(ut(e(L))),{default:y(()=>[t.overlay?(s(),D(e(Pa),{key:0,"data-slot":"overlay",class:T(p.value.overlay({class:e(f)?.overlay}))},null,8,["class"])):B("",!0),C(e(Aa),oe({"data-side":t.side,"data-slot":"content",class:p.value.content({class:[!n.default&&a.class,e(f)?.content]})},q.value,{onAfterEnter:c[0]||(c[0]=z=>l("after:enter")),onAfterLeave:c[1]||(c[1]=z=>l("after:leave"))},Ma(h.value)),{default:y(()=>[n.content&&(t.title||n.title||t.description||n.description)?(s(),D(e(Gt),{key:0},{default:y(()=>[t.title||n.title?(s(),D(e($t),{key:0},{default:y(()=>[V(d.$slots,"title",{},()=>[K(I(t.title),1)])]),_:3})):B("",!0),t.description||n.description?(s(),D(e(It),{key:1},{default:y(()=>[V(d.$slots,"description",{},()=>[K(I(t.description),1)])]),_:3})):B("",!0)]),_:3})):B("",!0),V(d.$slots,"content",{close:S},()=>[n.header||t.title||n.title||t.description||n.description||a.close||n.close?(s(),O("div",{key:0,"data-slot":"header",class:T(p.value.header({class:e(f)?.header}))},[V(d.$slots,"header",{close:S},()=>[_("div",{"data-slot":"wrapper",class:T(p.value.wrapper({class:e(f)?.wrapper}))},[t.title||n.title?(s(),D(e($t),{key:0,"data-slot":"title",class:T(p.value.title({class:e(f)?.title}))},{default:y(()=>[V(d.$slots,"title",{},()=>
1[K(I(t.title),1)])]),_:3},8,["class"])):B("",!0),t.description||n.description?(s(),D(e(It),{key:1,"data-slot":"description",class:T(p.value.description({class:e(f)?.description}))},{default:y(()=>[V(d.$slots,"description",{},()=>[K(I(t.description),1)])]),_:3},8,["class"])):B("",!0)],2),V(d.$slots,"actions"),a.close||n.close?(s(),D(e(Tn),{key:0,"as-child":""},{default:y(()=>[V(d.$slots,"close",{ui:p.value},()=>[a.close?(s(),D($e,oe({key:0,icon:t.closeIcon||e(r).ui.icons.close,color:"neutral",variant:"ghost","aria-label":e(v)("slideover.close")},typeof a.close=="object"?a.close:{},{"data-slot":"close",class:p.value.close({class:e(f)?.close})}),null,16,["icon","aria-label","class"])):B("",!0)])]),_:2},1024)):B("",!0)])],2)):B("",!0),_("div",{"data-slot":"body",class:T(p.value.body({class:e(f)?.body}))},[V(d.$slots,"body",{close:S})],2),n.footer?(s(),O("div",{key:1,"data-slot":"footer",class:T(p.value.footer({class:e(f)?.footer}))},[V(d.$slots,"footer",{close:S})],2)):B("",!0)])]),_:2},1040,["data-side","class"])]),_:2},1040)]),_:3},16))}};(function(){var t;try{if(typeof document<"u"){var i=document.createElement("style");i.nonce=(t=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:t.content,i.appendChild(document.createTextNode('[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1);animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform, 100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform, 100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true]):after{content:"";position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}
1[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:hover,[data-vaul-handle]:active{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover: hover) and (pointer: fine){[data-vaul-drawer]{-webkit-user-select:none;user-select:none}}@media (pointer: fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{0%{transform:translate3d(0,var(--initial-transform, 100%),0)}to{transform:translateZ(0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform, 100%),0)}}@keyframes slideFromTop{0%{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}to{transform:translateZ(0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}}@keyframes slideFromLeft{0%{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}to{transform:translateZ(0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}}@keyframes slideFromRight{0%{transform:translate3d(var(--initial-transform, 100%),0,0)}to{transform:translateZ(0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform, 100%),0,0)}}')),document.head.appendChild(i)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();const xs=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ks=t=>typeof t<"u";function $s(t){return JSON.parse(JSON.stringify(t))}function xa(t,i,a,l={}){var n,v,r;const{clone:f=!1,passive:g=!1,eventName:L,deep:q=!1,defaultValue:h,shouldEmit:p}=l,d=On(),c=a||d?.emit||((n=d?.$emit)==null?void 0:n.bind(d))||((r=(v=d?.proxy)==null?void 0:v.$emit)==null?void 0:r.bind(d?.proxy));let k=L;i||(i="modelValue"),k=k||`update:${i.toString()}`;const S=m=>f?typeof f=="function"?f(m):$s(m):m,z=()=>ks(t[i])?S(t[i]):h,b=m=>{p?p(m)&&c(k,m):c(k,m)};if(g){const m=z(),w=j(m);let x=!1;return ae(()=>t[i],A=>{x||(x=!0,w.value=S(A),Ot(()=>x=!1))}),ae(w,A=>{!x&&(A!==t[i]||q)&&b(A)},{deep:q}),w}else return P({get(){return z()},set(m){b(m)}})}const[ht,Is]=He("DrawerRoot"),ln=new WeakMap;function ye(t,i,a=!1){if(!t||!(t instanceof HTMLElement)||!i)return;const l={};Object.entries(i).forEach(([n,v])=>{if(n.startsWith("--")){t.style.setProperty(n,v);return}l[n]=t.style[n],t.style[n]=v}),!a&&ln.set(t,l)}function Cs(t,i){if(!t||!(t instanceof HTMLElement))return;const a=ln.get(t);a&&Object.entries(a).forEach(([l,n])=>{t.style[l]=n})}function bt(t,i){const a=window.getComputedStyle(t),l=a.transform||a.webkitTransform||a.mozTransform;let n=l.match(/^matrix3d\((.+)\)$/);return n?Number.parseFloat(n[1].split(", ")[ge(i)?13:12]):(n=l.match(/^matrix\((.+)\)$/),n?Number.parseFloat(n[1].split(", ")[ge(i)?5:4]):null)}function Ss(t){return 8*(Math.log(t+1)-2)}function ge(t){switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}}function Nt(t,i){if(!t)return()=>{};const a=t.style.cssText;return Object.assign(t.style,i),()=>{t.style.cssText=a}}function Ls(...t){return(...i)=>{for(const a of t)typeof a=="function"&&a(...i)}}const de={DURATION:.5,EASE:[.32,.72,0,1]},sn=.4,Ts=.25,Os=100,rn=8,_t=16,un=26,ka="vaul-dragging";function Ds({activeSnapPoint:t,snapPoints:i,drawerRef:a,overlayRef:l,fadeFromIndex:n,onSnapPointChange:v,direction:r}){const f=j(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);function g(){f.value={innerWidth:window.innerWidth,innerHeight:window.innerHeight}}Me(()=>{typeof window<"u"&&window.addEventListener("resize",g)}),Dn(()=>{typeof window<"u"&&window.removeEventListener("resize",g)});const L=P(()=>(i.value&&t.value===i.value[i.value.length-1])??null),q=P(()=>i.value&&i.value.length>0&&(n?.value||n?.value===0)&&!Number.isNaN(n?.value)&&i.value[n?.value??-1]===t.value||!i.value),h=P(()=>{var b;return((b=i.value)==null?void 0:b.findIndex(m=>m===t.value))??null}),p=P(()=>{var b;return((b=i.value)==null?void 0:b.map(m=>{const w=typeof m=="string";let x=0;if(w&&(x=Number.parseInt(m,10)),ge(r.value)){const o=w?x:f.value?m*f.value.innerHe
1ight:0;return f.value?r.value==="bottom"?f.value.innerHeight-o:-f.value.innerHeight+o:o}const A=w?x:f.value?m*f.value.innerWidth:0;return f.value?r.value==="right"?f.value.innerWidth-A:-f.value.innerWidth+A:A}))??[]}),d=P(()=>{var b;return h.value!==null?(b=p.value)==null?void 0:b[h.value]:null}),c=b=>{var m,w,x,A;const o=((m=p.value)==null?void 0:m.findIndex(u=>u===b))??null;Ot(()=>{var u;v(o,p.value),ye((u=a.value)==null?void 0:u.$el,{transition:`transform ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`,transform:ge(r.value)?`translate3d(0, ${b}px, 0)`:`translate3d(${b}px, 0, 0)`})}),p.value&&o!==p.value.length-1&&o!==n?.value?ye((w=l.value)==null?void 0:w.$el,{transition:`opacity ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`,opacity:"0"}):ye((x=l.value)==null?void 0:x.$el,{transition:`opacity ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`,opacity:"1"}),t.value=o!==null?((A=i.value)==null?void 0:A[o])??null:null};ae([t,p,i],()=>{var b;if(t.value){const m=((b=i.value)==null?void 0:b.findIndex(w=>w===t.value))??-1;p.value&&m!==-1&&typeof p.value[m]=="number"&&c(p.value[m])}},{immediate:!0});function k({draggedDistance:b,closeDrawer:m,velocity:w,dismissible:x}){var A,o,u;if(n.value===void 0)return;const $=r.value==="bottom"||r.value==="right"?(d.value??0)-b:(d.value??0)+b,R=h.value===n.value-1,U=h.value===0,X=b>0;if(R&&ye((A=l.value)==null?void 0:A.$el,{transition:`opacity ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`}),w>2&&!X){x?m():c(p.value[0]);return}if(w>2&&X&&p&&i.value){c(p.value[i.value.length-1]);return}const M=(o=p.value)==null?void 0:o.reduce((G,H)=>typeof G!="number"||typeof H!="number"?G:Math.abs(H-$)<Math.abs(G-$)?H:G),Z=ge(r.value)?window.innerHeight:window.innerWidth;if(w>sn&&Math.abs(b)<Z*.4){const G=X?1:-1;if(G>0&&L){c(p.value[(((u=i.value)==null?void 0:u.length)??0)-1]);return}if(U&&G<0&&x&&m(),h.value===null)return;c(p.value[h.value+G]);return}c(M)}function S({draggedDistance:b}){var m;if(d.value===null)return;const w=r.value==="bottom"||r.value==="right"?d.value-b:d.value+b;(r.value==="bottom"||r.value==="right")&&w<p.value[p.value.length-1]||(r.value==="top"||r.value==="left")&&w>p.value[p.value.length-1]||ye((m=a.value)==null?void 0:m.$el,{transform:ge(r.value)?`translate3d(0, ${w}px, 0)`:`translate3d(${w}px, 0, 0)`})}function z(b,m){if(!i.value||typeof h.value!="number"||!p.value||n.value===void 0)return null;const w=h.value===n.value-1;if(h.value>=n.value&&m)return 0;if(w&&!m)return 1;if(!q.value&&!w)return null;const x=w?h.value+1:h.value-1,A=w?p.value[x]-p.value[x-1]:p.value[x+1]-p.value[x],o=b/Math.abs(A);return w?1-o:o}return{isLastSnapPoint:L,shouldFade:q,getPercentageDragged:z,activeSnapPointIndex:h,onRelease:k,onDrag:S,snapPointsOffset:p}}function $a(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}let lt=null;function qs(t){const{isOpen:i,modal:a,nested:l,hasBeenOpened:n,preventScrollRestoration:v,noBodyStyles:r}=t,f=j(typeof window<"u"?window.location.href:""),g=j(0);function L(){if($a()&&lt===null&&i.value&&!r.value){lt={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};const{scrollX:h,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-g.value}px`,left:`${-h}px`,right:"0px",height:"auto"}),setTimeout(()=>{requestAnimationFrame(()=>{const d=p-window.innerHeight;d&&g.value>=p&&(document.body.style.top=`-${g.value+d}px`)})},300)}}function q(){if($a()&&lt!==null&&!r.value){const h=-Number.parseInt(document.body.style.top,10),p=-Number.parseInt(document.body.style.left,10);Object.assign(document.body.style,lt),window.requestAnimationFrame(()=>{if(v.value&&f.value!==window.location.href){f.value=window.location.href;return}window.scrollTo(p,h)}),lt=null}}return Me(()=>{function h(){g.value=window.scrollY}h(),window.addEventListener("scroll",h),Oa(()=>{window.removeEventListener("scroll",h)})}),ae([i,n,f],()=>{l.value||!n.value||(i.value?(window.matchMedia("(display-mode: standalone)").matches||L(),a.value||setTimeout(()=>{q()},500)):q())}),{restorePositionSetting:q}}function Bs(t,i){return t&&t.value?t:i}function Ps(t){const{emitDrag:i,emitRelease:a,emitClose:l,emitOpenChange:n,open:v,dismissible:r,nested:f,modal:g,shouldScaleBackgroun
1d:L,setBackgroundColorOnScale:q,scrollLockTimeout:h,closeThreshold:p,activeSnapPoint:d,fadeFromIndex:c,direction:k,noBodyStyles:S,handleOnly:z,preventScrollRestoration:b}=t,m=j(v.value??!1),w=j(!1),x=j(!1),A=j(!1),o=j(null),u=j(null),$=j(null),R=j(null),U=j(null),X=j(!1),M=j(null),Z=j(0),G=j(!1),H=j(null),F=P(()=>{var Y;return((Y=H.value)==null?void 0:Y.$el.getBoundingClientRect().height)||0}),W=Bs(t.snapPoints,j(void 0)),E=P(()=>{var Y;return W&&(((Y=W.value)==null?void 0:Y.length)??0)>0}),N=j(null),{activeSnapPointIndex:Q,onRelease:pe,snapPointsOffset:ee,onDrag:J,shouldFade:ie,getPercentageDragged:me}=Ds({snapPoints:W,activeSnapPoint:d,drawerRef:H,fadeFromIndex:c,overlayRef:o,onSnapPointChange:ce,direction:k});function ce(Y,ue){W.value&&Y===ue.length-1&&(u.value=new Date)}qs({isOpen:m,modal:g,nested:f,hasBeenOpened:w,noBodyStyles:S,preventScrollRestoration:b});function ne(){return(window.innerWidth-un)/window.innerWidth}function _e(Y,ue){var fe;if(!Y)return!1;let le=Y;const he=(fe=window.getSelection())==null?void 0:fe.toString(),be=H.value?bt(H.value.$el,k.value):null,Se=new Date;if(le.hasAttribute("data-vaul-no-drag")||le.closest("[data-vaul-no-drag]"))return!1;if(k.value==="right"||k.value==="left")return!0;if(u.value&&Se.getTime()-u.value.getTime()<500)return!1;if(be!==null&&(k.value==="bottom"?be>0:be<0))return!0;if(he&&he.length>0)return!1;if(U.value&&Se.getTime()-U.value.getTime()<h.value&&be===0||ue)return U.value=Se,!1;for(;le;){if(le.scrollHeight>le.clientHeight){if(le.scrollTop!==0)return U.value=new Date,!1;if(le.getAttribute("role")==="dialog")return!0}le=le.parentNode}return!0}function Ne(Y){!r.value&&!W.value||H.value&&!H.value.$el.contains(Y.target)||(x.value=!0,$.value=new Date,Y.target.setPointerCapture(Y.pointerId),Z.value=ge(k.value)?Y.clientY:Y.clientX)}function te(Y){var ue,fe,le,he,be,Se;if(H.value&&x.value){const Ee=k.value==="bottom"||k.value==="right"?1:-1,Ge=(Z.value-(ge(k.value)?Y.clientY:Y.clientX))*Ee,Ye=Ge>0,ca=W.value&&!r.value&&!Ye;if(ca&&Q.value===0)return;const Et=Math.abs(Ge),pa=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");let Ue=Et/F.value;const fa=me(Et,Ye);if(fa!==null&&(Ue=fa),ca&&Ue>=1||!X.value&&!_e(Y.target,Ye))return;if((ue=H?.value)==null||ue.$el.classList.add(ka),X.value=!0,ye((fe=H.value)==null?void 0:fe.$el,{transition:"none"}),ye((le=o.value)==null?void 0:le.$el,{transition:"none"}),W.value&&J({draggedDistance:Ge}),Ye&&!W.value){const Ve=Ss(Ge),yt=Math.min(Ve*-1,0)*Ee;ye((he=H.value)==null?void 0:he.$el,{transform:ge(k.value)?`translate3d(0, ${yt}px, 0)`:`translate3d(${yt}px, 0, 0)`});return}const pn=1-Ue;if((ie.value||c.value&&Q.value===c.value-1)&&(i(Ue),ye((be=o.value)==null?void 0:be.$el,{opacity:`${pn}`,transition:"none"},!0)),pa&&o.value&&L.value){const Ve=Math.min(ne()+Ue*(1-ne()),1),yt=8-Ue*8,va=Math.max(0,14-Ue*14);ye(pa,{borderRadius:`${yt}px`,transform:ge(k.value)?`scale(${Ve}) translate3d(0, ${va}px, 0)`:`scale(${Ve}) translate3d(${va}px, 0, 0)`,transition:"none"},!0)}if(!W.value){const Ve=Et*Ee;ye((Se=H.value)==null?void 0:Se.$el,{transform:ge(k.value)?`translate3d(0, ${Ve}px, 0)`:`translate3d(${Ve}px, 0, 0)`})}}}function Xe(){var Y;if(!H.value)return;const ue=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]"),fe=bt(H.value.$el,k.value);ye(H.value.$el,{transform:"translate3d(0, 0, 0)",transition:`transform ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`}),ye((Y=o.value)==null?void 0:Y.$el,{transition:`opacity ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`,opacity:"1"}),L.value&&fe&&fe>0&&m.value&&ye(ue,{borderRadius:`${rn}px`,overflow:"hidden",...ge(k.value)?{transform:`scale(${ne()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${ne()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${de.DURATION}s`,transitionTimingFunction:`cubic-bezier(${de.EASE.join(",")})`},!0)}function Pe(Y){H.value&&(l(),Y||(m.value=!1),window.setTimeout(()=>{W.value&&(d.value=W.value[0])},de.DURATION*1e3))}et(()=>{if(!m.value&&L.value&&xs){const Y=setTimeout(()=>{Cs(document.body)},200);return()=>clearTimeout(Y)}}),ae(v,()=>{m.value=v.value,v.value||Pe()});function nt(Y){if(!x.value||!H.value)return;H.value.$el.classList.remove(ka),X.value=!1,x.value=!1,R.value=new Date;const ue=bt(H.value.$el,k.value);
1if(!_e(Y.target,!1)||!ue||Number.isNaN(ue)||$.value===null)return;const fe=R.value.getTime()-$.value.getTime(),le=Z.value-(ge(k.value)?Y.clientY:Y.clientX),he=Math.abs(le)/fe;if(he>.05&&(A.value=!0,window.setTimeout(()=>{A.value=!1},200)),W.value){const Se=k.value==="bottom"||k.value==="right"?1:-1;pe({draggedDistance:le*Se,closeDrawer:Pe,velocity:he,dismissible:r.value}),a(!0);return}if(k.value==="bottom"||k.value==="right"?le>0:le<0){Xe(),a(!0);return}if(he>sn){Pe(),a(!1);return}const be=Math.min(H.value.$el.getBoundingClientRect().height??0,window.innerHeight);if(ue>=be*p.value){Pe(),a(!1);return}a(!0),Xe()}ae(m,Y=>{Y&&(u.value=new Date),n(Y)},{immediate:!0});function qe(Y){var ue,fe;const le=Y?(window.innerWidth-_t)/window.innerWidth:1,he=Y?-16:0;M.value&&window.clearTimeout(M.value),ye((ue=H.value)==null?void 0:ue.$el,{transition:`transform ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`,transform:`scale(${le}) translate3d(0, ${he}px, 0)`}),!Y&&(fe=H.value)!=null&&fe.$el&&(M.value=window.setTimeout(()=>{var be,Se;const Ee=bt((be=H.value)==null?void 0:be.$el,k.value);ye((Se=H.value)==null?void 0:Se.$el,{transition:"none",transform:ge(k.value)?`translate3d(0, ${Ee}px, 0)`:`translate3d(${Ee}px, 0, 0)`})},500))}function At(Y){var ue;if(Y<0)return;const fe=ge(k.value)?window.innerHeight:window.innerWidth,le=(fe-_t)/fe,he=le+Y*(1-le),be=-16+Y*_t;ye((ue=H.value)==null?void 0:ue.$el,{transform:ge(k.value)?`scale(${he}) translate3d(0, ${be}px, 0)`:`scale(${he}) translate3d(${be}px, 0, 0)`,transition:"none"})}function Mt(Y){var ue;const fe=ge(k.value)?window.innerHeight:window.innerWidth,le=Y?(fe-_t)/fe:1,he=Y?-16:0;Y&&ye((ue=H.value)==null?void 0:ue.$el,{transition:`transform ${de.DURATION}s cubic-bezier(${de.EASE.join(",")})`,transform:ge(k.value)?`scale(${le}) translate3d(0, ${he}px, 0)`:`scale(${le}) translate3d(${he}px, 0, 0)`})}return{open:v,isOpen:m,modal:g,keyboardIsOpen:G,hasBeenOpened:w,drawerRef:H,drawerHeightRef:F,overlayRef:o,handleRef:N,isDragging:x,dragStartTime:$,isAllowedToDrag:X,snapPoints:W,activeSnapPoint:d,hasSnapPoints:E,pointerStart:Z,dismissible:r,snapPointsOffset:ee,direction:k,shouldFade:ie,fadeFromIndex:c,shouldScaleBackground:L,setBackgroundColorOnScale:q,onPress:Ne,onDrag:te,onRelease:nt,closeDrawer:Pe,onNestedDrag:At,onNestedRelease:Mt,onNestedOpenChange:qe,emitClose:l,emitDrag:i,emitRelease:a,emitOpenChange:n,nested:f,handleOnly:z,noBodyStyles:S}}const dn=ve({__name:"DrawerRoot",props:{activeSnapPoint:{default:void 0},closeThreshold:{default:Ts},shouldScaleBackground:{type:Boolean,default:void 0},setBackgroundColorOnScale:{type:Boolean,default:!0},scrollLockTimeout:{default:Os},fixed:{type:Boolean,default:void 0},dismissible:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},nested:{type:Boolean,default:!1},direction:{default:"bottom"},noBodyStyles:{type:Boolean},handleOnly:{type:Boolean,default:!1},preventScrollRestoration:{type:Boolean},snapPoints:{default:void 0},fadeFromIndex:{default:void 0}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(t,{expose:i,emit:a}){const l=t,n=a;ft();const v=P(()=>l.fadeFromIndex??(l.snapPoints&&l.snapPoints.length-1)),r=xa(l,"open",n,{defaultValue:l.defaultOpen,passive:l.open===void 0}),f=xa(l,"activeSnapPoint",n,{passive:l.activeSnapPoint===void 0}),g={emitDrag:c=>n("drag",c),emitRelease:c=>n("release",c),emitClose:()=>n("close"),emitOpenChange:c=>{n("update:open",c),setTimeout(()=>{n("animationEnd",c)},de.DURATION*1e3)}},{closeDrawer:L,hasBeenOpened:q,modal:h,isOpen:p}=Is(Ps({...g,...Ct(l),activeSnapPoint:f,fadeFromIndex:v,open:r}));function d(c){if(r.value!==void 0){g.emitOpenChange(c);return}p.value=c,c?q.value=!0:L()}return i({open:p}),(c,k)=>(s(),D(e(Ea),{open:e(p),modal:e(h),"onUpdate:open":d},{default:y(()=>[V(c.$slots,"default",{open:e(p)})]),_:3},8,["open","modal"]))}}),As=ve({__name:"DrawerRootNested",props:{activeSnapPoint:{},closeThreshold:{},shouldScaleBackground:{type:Boolean},setBackgroundColorOnScale:{type:Boolean},scrollLockTimeout:{},fixed:{type:Boolean},dismissible:{type:Boolean},modal:{type:Boolean},open:{type:Boolean},defaultOpen:{type:Boolean},nested:{type:Boolean},direction:{},noBodyStyles:{type:Boolean},handleOnly:{type:Boolean},preventScrollRestoration:{type:Boolean},snapPoints:{},fadeFromIndex:{}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(t,{emit:i}){const a=t,l=i,{onNestedDrag:n,onNestedOpenChange:v,onNestedRelease:r}=ht();function f(){v(!1)}function g(h){n(h)}function L(h){h&&v(h),l("update:open",h)}const q=Ze(a,l);
1return(h,p)=>(s(),D(dn,oe(e(q),{nested:"",onClose:f,onDrag:g,onRelease:e(r),"onUpdate:open":L}),{default:y(()=>[V(h.$slots,"default")]),_:3},16,["onRelease"]))}}),Ms=ve({__name:"DrawerOverlay",setup(t){const{overlayRef:i,hasSnapPoints:a,isOpen:l,shouldFade:n}=ht();return(v,r)=>(s(),D(e(Pa),{ref_key:"overlayRef",ref:i,"data-vaul-overlay":"","data-vaul-snap-points":e(l)&&e(a)?"true":"false","data-vaul-snap-points-overlay":e(l)&&e(n)?"true":"false"},null,8,["data-vaul-snap-points","data-vaul-snap-points-overlay"]))}}),Es=()=>()=>{};function zs(){const{direction:t,isOpen:i,shouldScaleBackground:a,setBackgroundColorOnScale:l,noBodyStyles:n}=ht(),v=j(null),r=j(document.body.style.backgroundColor);function f(){return(window.innerWidth-un)/window.innerWidth}et(g=>{if(i.value&&a.value){v.value&&clearTimeout(v.value);const L=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!L)return;Ls(l.value&&!n.value?Nt(document.body,{background:"black"}):Es,Nt(L,{transformOrigin:ge(t.value)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${de.DURATION}s`,transitionTimingFunction:`cubic-bezier(${de.EASE.join(",")})`}));const q=Nt(L,{borderRadius:`${rn}px`,overflow:"hidden",...ge(t.value)?{transform:`scale(${f()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${f()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});g(()=>{q(),v.value=window.setTimeout(()=>{r.value?document.body.style.background=r.value:document.body.style.removeProperty("background")},de.DURATION*1e3)})}},{flush:"pre"})}const Rs=ve({__name:"DrawerContent",setup(t){const{open:i,isOpen:a,snapPointsOffset:l,hasSnapPoints:n,drawerRef:v,onPress:r,onDrag:f,onRelease:g,modal:L,emitOpenChange:q,dismissible:h,keyboardIsOpen:p,closeDrawer:d,direction:c,handleOnly:k}=ht();zs();const S=j(!1),z=P(()=>l.value&&l.value.length>0?`${l.value[0]}px`:"0");function b(x){if(!L.value||x.defaultPrevented){x.preventDefault();return}p.value&&(p.value=!1),h.value?q(!1):x.preventDefault()}function m(x){k.value||r(x)}function w(x){k.value||f(x)}return et(()=>{n.value&&window.requestAnimationFrame(()=>{S.value=!0})}),(x,A)=>(s(),D(e(Aa),{ref_key:"drawerRef",ref:v,"data-vaul-drawer":"","data-vaul-drawer-direction":e(c),"data-vaul-delayed-snap-points":S.value?"true":"false","data-vaul-snap-points":e(a)&&e(n)?"true":"false",style:Qt({"--snap-point-height":z.value}),onPointerdown:m,onPointermove:w,onPointerup:e(g),onPointerDownOutside:b,onOpenAutoFocus:A[0]||(A[0]=Ft(()=>{},["prevent"])),onEscapeKeyDown:A[1]||(A[1]=o=>{e(h)||o.preventDefault()})},{default:y(()=>[V(x.$slots,"default")]),_:3},8,["data-vaul-drawer-direction","data-vaul-delayed-snap-points","data-vaul-snap-points","style","onPointerup"]))}}),js=["data-vaul-drawer-visible"],Ns={"data-vaul-handle-hitarea":"","aria-hidden":"true"},Us=250,Vs=120,Fs=ve({__name:"DrawerHandle",props:{preventCycle:{type:Boolean,default:!1}},setup(t){const i=t,{onPress:a,onDrag:l,handleRef:n,handleOnly:v,isOpen:r,snapPoints:f,activeSnapPoint:g,isDragging:L,dismissible:q,closeDrawer:h}=ht(),p=j(null),d=j(!1);function c(){if(d.value){z();return}window.setTimeout(()=>{k()},Vs)}function k(){if(L.value||i.preventCycle||d.value){z();return}if(z(),!f.value||f.value.length===0){q.value||h();return}const w=g.value===f.value[f.value.length-1];if(w&&q.value){h();return}const x=f.value.findIndex(o=>o===g.value);if(x===-1)return;const A=w?0:x+1;g.value=f.value[A]}function S(){p.value=window.setTimeout(()=>{d.value=!0},Us)}function z(){p.value&&window.clearTimeout(p.value),d.value=!1}function b(w){v.value&&a(w),S()}function m(w){v.value&&l(w)}return(w,x)=>(s(),O("div",{ref_key:"handleRef",ref:n,"data-vaul-drawer-visible":e(r)?"true":"false","data-vaul-handle":"","aria-hidden":"true",onClick:c,onPointercancel:z,onPointerdown:b,onPointermove:m},[_("span",Ns,[V(w.$slots,"default")])],40,js))}}),Hs={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default ring ring-default flex focus:outline-none",handle:["shrink-0 !bg-accented","transition-opacity"],container:"w-full flex flex-col gap-4 p-4 overflow-y-auto",header:"",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",body:"flex-1",footer
1:"flex flex-col gap-1.5"},variants:{direction:{top:{content:"mb-24 flex-col-reverse",handle:"mb-4"},right:{content:"flex-row",handle:"!ml-4"},bottom:{content:"mt-24 flex-col",handle:"mt-4"},left:{content:"flex-row-reverse",handle:"!mr-4"}},inset:{true:{content:"rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]"}},snapPoints:{true:""}},compoundVariants:[{direction:["top","bottom"],class:{content:"h-auto max-h-[96%]",handle:"!w-12 !h-1.5 mx-auto"}},{direction:["top","bottom"],snapPoints:!0,class:{content:"h-full"}},{direction:["right","left"],class:{content:"w-auto max-w-[calc(100%-2rem)]",handle:"!h-12 !w-1.5 mt-auto mb-auto"}},{direction:["right","left"],snapPoints:!0,class:{content:"w-full"}},{direction:"top",inset:!0,class:{content:"inset-x-4 top-4"}},{direction:"top",inset:!1,class:{content:"inset-x-0 top-0 rounded-b-lg"}},{direction:"bottom",inset:!0,class:{content:"inset-x-4 bottom-4"}},{direction:"bottom",inset:!1,class:{content:"inset-x-0 bottom-0 rounded-t-lg"}},{direction:"left",inset:!0,class:{content:"inset-y-4 left-4"}},{direction:"left",inset:!1,class:{content:"inset-y-0 left-0 rounded-r-lg"}},{direction:"right",inset:!0,class:{content:"inset-y-4 right-4"}},{direction:"right",inset:!1,class:{content:"inset-y-0 right-0 rounded-l-lg"}}]},Ws={__name:"UDrawer",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},inset:{type:Boolean,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},handle:{type:Boolean,required:!1,default:!0},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},nested:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},activeSnapPoint:{type:[Number,String,null],required:!1},closeThreshold:{type:Number,required:!1},shouldScaleBackground:{type:Boolean,required:!1},setBackgroundColorOnScale:{type:Boolean,required:!1},scrollLockTimeout:{type:Number,required:!1},fixed:{type:Boolean,required:!1},dismissible:{type:Boolean,required:!1,default:!0},modal:{type:Boolean,required:!1,default:!0},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},direction:{type:String,required:!1,default:"bottom"},noBodyStyles:{type:Boolean,required:!1},handleOnly:{type:Boolean,required:!1},preventScrollRestoration:{type:Boolean,required:!1},snapPoints:{type:Array,required:!1}},emits:["close:prevent","drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(t,{emit:i}){const a=t,l=i,n=ft(),v=ze(),r=Re("drawer",a),f=Ze(Yt(a,"activeSnapPoint","closeThreshold","shouldScaleBackground","setBackgroundColorOnScale","scrollLockTimeout","fixed","dismissible","modal","open","defaultOpen","nested","direction","noBodyStyles","handleOnly","preventScrollRestoration","snapPoints"),l),g=Da(Ae(()=>a.portal)),L=Ae(()=>a.content),q=P(()=>a.dismissible?{pointerDownOutside:za}:["pointerDownOutside","interactOutside","escapeKeyDown"].reduce((d,c)=>(d[c]=k=>{k.preventDefault(),l("close:prevent")},d),{})),h=P(()=>we({extend:we(Hs),...v.ui?.drawer||{}})({direction:a.direction,inset:a.inset,snapPoints:a.snapPoints&&a.snapPoints.length>0}));return(p,d)=>(s(),D(st(t.nested?e(As):e(dn)),rt(ut(e(f))),{default:y(()=>[n.default?(s(),D(e(qa),{key:0,"as-child":"",class:T(a.class)},{default:y(()=>[V(p.$slots,"default")]),_:3},8,["class"])):B("",!0),C(e(Ba),rt(ut(e(g))),{default:y(()=>[t.overlay?(s(),D(e(Ms),{key:0,"data-slot":"overlay",class:T(h.value.overlay({class:e(r)?.overlay}))},null,8,["class"])):B("",!0),C(e(Rs),oe({"data-slot":"content",class:h.value.content({class:[!n.default&&a.class,e(r)?.content]})},L.value,Ma(q.value)),{default:y(()=>[t.handle?(s(),D(e(Fs),{key:0,"data-slot":"handle",class:T(h.value.handle({class:e(r)?.handle}))},null,8,["class"])):B("",!0),n.content&&(t.title||n.title||t.description||n.description)?(s(),D(e(Gt),{key:1},{default:y(()=>[t.title||n.title?(s(),D(e($t),{key:0},{default:y(()=>[V(p.$slots,"title",{},()=>[K(I(t.title),1)])]),_:3})):B("",!0),t.description||n.description?(s(),D(e(It),{key:1},{default:y(()=>[V(p.$slots,"description",{},()=>[K(I(t.description),1)])]),_:3})):B("",!0)]),_:3})):B("",!0),V(p.$slots,"content",{},()=>[_("div",{"data-slot":"container",class:T(h.value.container({class:e(r)?.container}))},[n.header||t.title||n.title||t.description||n.description?(s(),O("div",{key:0,"data-slot":"header",class:T(h.value.header({class:e(r)?.header}))},[V(p.$slots,"header",{},()=>[t.title||n.title?(s(),D(e($t),{key:0,"data-slot":"title",class:T(h.value.title({class:e(r)?.title}))},{default:y(()=>[V(p.$slots,"title",{},()=>
1[K(I(t.title),1)])]),_:3},8,["class"])):B("",!0),t.description||n.description?(s(),D(e(It),{key:1,"data-slot":"description",class:T(h.value.description({class:e(r)?.description}))},{default:y(()=>[V(p.$slots,"description",{},()=>[K(I(t.description),1)])]),_:3},8,["class"])):B("",!0)])],2)):B("",!0),n.body?(s(),O("div",{key:1,"data-slot":"body",class:T(h.value.body({class:e(r)?.body}))},[V(p.$slots,"body")],2)):B("",!0),n.footer?(s(),O("div",{key:2,"data-slot":"footer",class:T(h.value.footer({class:e(r)?.footer}))},[V(p.$slots,"footer")],2)):B("",!0)],2)])]),_:3},16,["class"])]),_:3},16)]),_:3},16))}},Ks={slots:{root:"relative hidden lg:flex flex-col min-h-svh min-w-16 w-(--width) shrink-0",header:"h-(--ui-header-height) shrink-0 flex items-center gap-1.5 px-4",body:"flex flex-col gap-4 flex-1 overflow-y-auto px-4 py-2",footer:"shrink-0 flex items-center gap-1.5 px-4 py-2",toggle:"",handle:"",content:"lg:hidden",overlay:"lg:hidden"},variants:{menu:{true:{header:"sm:px-6",body:"sm:px-6",footer:"sm:px-6"}},side:{left:{root:"border-e border-default"},right:{root:""}},toggleSide:{left:{toggle:""},right:{toggle:"ms-auto"}}}},Xs=["data-collapsed","data-dragging"],Gs=Object.assign({inheritAttrs:!1},{__name:"UDashboardSidebar",props:qn({mode:{type:null,required:!1,default:"slideover"},menu:{type:null,required:!1},toggle:{type:[Boolean,Object],required:!1,default:!0},toggleSide:{type:String,required:!1,default:"left"},autoClose:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},id:{type:String,required:!1},side:{type:String,required:!1,default:"left"},minSize:{type:Number,required:!1,default:10},maxSize:{type:Number,required:!1,default:20},defaultSize:{type:Number,required:!1,default:15},resizable:{type:Boolean,required:!1,default:!1},collapsible:{type:Boolean,required:!1,default:!1},collapsedSize:{type:Number,required:!1,default:0}},{open:{type:Boolean,default:!1},openModifiers:{},collapsed:{type:Boolean,default:!1},collapsedModifiers:{}}),emits:["update:open","update:collapsed"],setup(t){const i=t,a=ft(),l=ha(t,"open",{type:Boolean,default:!1}),n=ha(t,"collapsed",{type:Boolean,default:!1}),v=Dt(),{t:r}=qt(),f=ze(),g=Re("dashboardSidebar",i),L=ua({storageKey:"dashboard",unit:"%",sidebarOpen:j(!1),sidebarCollapsed:j(!1)}),q=`${L.storageKey}-sidebar-${i.id||Ra()}`,{el:h,size:p,collapse:d,isCollapsed:c,isDragging:k,onMouseDown:S,onTouchStart:z,onDoubleClick:b}=nn(q,Ae(()=>({...L,...i})),{collapsed:n}),[m,w]=kt(),[x,A]=kt();ya("dashboard:sidebar:toggle",()=>{l.value=!l.value}),ya("dashboard:sidebar:collapse",U=>{c.value=U}),ae(l,()=>L.sidebarOpen.value=l.value,{immediate:!0}),ae(c,()=>L.sidebarCollapsed.value=c.value,{immediate:!0}),ae(()=>v.fullPath,()=>{i.autoClose&&(l.value=!1)});const o=P(()=>we({extend:we(Ks),...f.ui?.dashboardSidebar||{}})({side:i.side})),u=P(()=>({slideover:ws,modal:Oe,drawer:Ws})[i.mode]),$=Ae(()=>Vt(i.menu,{content:{onOpenAutoFocus:U=>U.preventDefault()}},i.mode==="modal"?{fullscreen:!0,transition:!1}:i.mode==="slideover"?{side:"left"}:{}));function R(){l.value=!l.value}return(U,X)=>(s(),O(re,null,[C(e(m),null,{default:y(()=>[V(U.$slots,"toggle",{open:l.value,toggle:R,ui:o.value},()=>[t.toggle?(s(),D(bs,oe({key:0},typeof t.toggle=="object"?t.toggle:{},{side:t.toggleSide,"data-slot":"toggle",class:o.value.toggle({class:e(g)?.toggle,toggleSide:t.toggleSide})}),null,16,["side","class"])):B("",!0)])]),_:3}),C(e(x),null,{default:y(()=>[V(U.$slots,"resize-handle",{onMouseDown:e(S),onTouchStart:e(z),onDoubleClick:e(b),ui:o.value},()=>[t.resizable?(s(),D(on,{key:0,"aria-controls":q,"data-slot":"handle",class:T(o.value.handle({class:e(g)?.handle})),onMousedown:e(S),onTouchstart:e(z),onDblclick:e(b)},null,8,["class","onMousedown","onTouchstart","onDblclick"])):B("",!0)])]),_:3}),t.side==="right"?(s(),D(e(A),{key:0})):B("",!0),_("div",oe({id:q,ref_key:"el",ref:h},U.$attrs,{"data-collapsed":e(c),"data-dragging":e(k),"data-slot":"root",class:o.value.root({class:[e(g)?.root,i.class]}),style:{"--width":`${e(p)||0}${e(L).unit}`}}),[a.header?(s(),O("div",{key:0,"data-slot":"header",class:T(o.value.header({class:e(g)?.header}))}
1,[V(U.$slots,"header",{collapsed:e(c),collapse:e(d)})],2)):B("",!0),_("div",{"data-slot":"body",class:T(o.value.body({class:e(g)?.body}))},[V(U.$slots,"default",{collapsed:e(c),collapse:e(d)})],2),a.footer?(s(),O("div",{key:1,"data-slot":"footer",class:T(o.value.footer({class:e(g)?.footer}))},[V(U.$slots,"footer",{collapsed:e(c),collapse:e(d)})],2)):B("",!0)],16,Xs),t.side==="left"?(s(),D(e(A),{key:1})):B("",!0),C(e(u),oe({open:l.value,"onUpdate:open":X[0]||(X[0]=M=>l.value=M),title:e(r)("dashboardSidebar.title"),description:e(r)("dashboardSidebar.description")},$.value,{ui:{overlay:o.value.overlay({class:e(g)?.overlay}),content:o.value.content({class:e(g)?.content})}}),{content:y(M=>[V(U.$slots,"content",rt(ut(M)),()=>[a.header||t.mode!=="drawer"?(s(),O("div",{key:0,"data-slot":"header",class:T(o.value.header({class:e(g)?.header,menu:!0}))},[t.mode!=="drawer"&&t.toggleSide==="left"?(s(),D(e(w),{key:0})):B("",!0),V(U.$slots,"header",{collapsed:e(c),collapse:e(d)}),t.mode!=="drawer"&&t.toggleSide==="right"?(s(),D(e(w),{key:1})):B("",!0)],2)):B("",!0),_("div",{"data-slot":"body",class:T(o.value.body({class:e(g)?.body,menu:!0}))},[V(U.$slots,"default",{collapsed:e(c),collapse:e(d)})],2),a.footer?(s(),O("div",{key:1,"data-slot":"footer",class:T(o.value.footer({class:e(g)?.footer,menu:!0}))},[V(U.$slots,"footer",{collapsed:e(c),collapse:e(d)})],2)):B("",!0)])]),_:3},16,["open","title","description","ui"])],64))}}),Ys={slots:{root:"relative flex flex-col min-w-0 min-h-svh lg:not-last:border-e lg:not-last:border-default shrink-0",body:"flex flex-col gap-4 sm:gap-6 flex-1 overflow-y-auto p-4 sm:p-6",handle:""},variants:{size:{true:{root:"w-full lg:w-(--width)"},false:{root:"flex-1"}}}},Js=["data-dragging"],Zs=Object.assign({inheritAttrs:!1},{__name:"UDashboardPanel",props:{class:{type:null,required:!1},ui:{type:Object,required:!1},id:{type:String,required:!1},minSize:{type:Number,required:!1,default:15},maxSize:{type:Number,required:!1},defaultSize:{type:Number,required:!1},resizable:{type:Boolean,required:!1,default:!1}},setup(t){const i=t,a=ze(),l=Re("dashboardPanel",i),n=ua({storageKey:"dashboard",unit:"%"}),v=`${n.storageKey}-panel-${i.id||Ra()}`,{el:r,size:f,isDragging:g,onMouseDown:L,onTouchStart:q,onDoubleClick:h}=nn(v,Ae(()=>({...n,...i}))),p=P(()=>we({extend:we(Ys),...a.ui?.dashboardPanel||{}})({size:!!f.value}));return(d,c)=>(s(),O(re,null,[_("div",oe({id:v,ref_key:"el",ref:r},d.$attrs,{"data-dragging":e(g),"data-slot":"root",class:p.value.root({class:[e(l)?.root,i.class]}),style:[e(f)?{"--width":`${e(f)}${e(n).unit}`}:void 0]}),[V(d.$slots,"default",{},()=>[V(d.$slots,"header"),_("div",{"data-slot":"body",class:T(p.value.body({class:e(l)?.body}))},[V(d.$slots,"body")],2),V(d.$slots,"footer")])],16,Js),V(d.$slots,"resize-handle",{onMouseDown:e(L),onTouchStart:e(q),onDoubleClick:e(h)},()=>[t.resizable?(s(),D(on,{key:0,"aria-controls":v,"data-slot":"handle",class:T(p.value.handle({class:e(l)?.handle})),onMousedown:e(L),onTouchstart:e(q),onDblclick:e(h)},null,8,["class","onMousedown","onTouchstart","onDblclick"])):B("",!0)])],64))}}),Qs={class:"flex items-center gap-3"},ei={class:"flex shrink-0 items-center justify-center w-10 h-10 rounded-full bg-rose-100"},ti={class:"space-y-3"},ai={class:"text-sm text-secondary-600 font-semibold"},ni={class:"text-[15px] text-secondary-500 font-semibold"},oi={class:"flex justify-start w-full"},li={__name:"AppOrgRemovedModal",setup(t){const i=at(),a=Te("orgRemovedModal",()=>!1),l=Te("orgRemovedName",()=>""),{fetchOrganizations:n}=De();async function v(){a.value=!1,l.value="",await n(),pt(i("index"))}return(r,f)=>{const g=se,L=$e,q=Oe;return s(),D(q,{open:e(a),close:!1,dismissible:!1},{title:y(()=>[_("div",Qs,[_("div",ei,[C(g,{name:"mosy:triangle-exclamation",class:"text-rose-500 w-5 h-5"})]),K(" "+I(r.$t("org_removed_modal.title")),1)])]),body:y(()=>[_("div",ti,[_("p",ai,I(e(l)?r.$t("org_removed_modal.description_named",{name:e(l)}):r.$t("org_removed_modal.description")),1),_("p",ni,I(r.$t("org_removed_modal.hint")),1)])]),footer:y(()=>[_("div",oi,[C(L,{color:"secondary",onClick:v},{default:y(()=>[K(I(r.$t("org_removed_modal.cta")),1)]),_:1})])]),_:1},8,["open"])}}},si={class:"flex items-center gap-3"},ii={class:"flex shrink-0 items-center justify-center w-10 h-10 rounded-full bg-rose-100"},ri={class:"space-y-3"},ui={class:"text-sm text-secondary-700 font-semibold"},di={class:"text-sm font-medium bg-amber-50 rounded-2xl ring-1 ring-amber-300 px-2 py-1 text-amber-700 gap-2 inline-flex"},ci={class:"text-[13px] text-secondary-500 font-medium"},pi={class:"flex justify-end gap-2 w-full"},fi={__name:"AppStorageLimitModal",setup(t){const i=at(),{isAdmin:a,isOwner:l}=De(),{open:n,usage:v,closeStorageLimit:r}=Jn(),f=P(()=>v.value?.limit_mb??500),g=P(()=>v.value?.used_bytes??0);function L(d){const c=Number(d)||0;return c>=1024&&c%1024===0?`${c/1024} GB`:`${c} MB`}function q(d){return d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(0)} KB`:d<1024*1024*1024?`${(d/1024/1024).toFixed(1)} MB`:`${(d/1024/1024/1024).toFixed(2)} GB`}const h=P(()=>a.value||l.value);function p(){r(),pt(`${i("settings")}#organisation`)}return je({escape:{usingInput:!0,handler:()=>{n.value&&r()}}}),(d,c)=>{const k=se,S=$e,z=Oe;return s(),D(z,{open:e(n),close:!1,"onUpdate:open":e(r)},{title:y(()=>[_("div",si,[_("div",ii,[C(k,{name:"mosy:triangle-exclamation",class:"text-rose-500 w-5 h-5"})]),K(" "+I(d.$t("agency.tasks.storage_full_title")),1)])]),body:y(()=>[_("div",ri,[_("p",ui,I(d.$t("agency.tasks.storage_full_desc")),1
1),_("p",di,[C(k,{name:"mosy:triangle-exclamation",class:"w-3.5 h-3.5 mt-0.5 shrink-0"}),_("span",null,I(d.$t("settings.organisation.storage_usage",{used:q(e(g)),total:L(e(f))})),1)]),_("p",ci,I(e(h)?d.$t("agency.tasks.storage_full_hint_admin"):d.$t("agency.tasks.storage_full_hint_member")),1)])]),footer:y(()=>[_("div",pi,[C(S,{variant:"subtle",color:"secondary",onClick:e(r)},{default:y(()=>[K(I(d.$t("common.close")),1)]),_:1},8,["onClick"]),C(S,{color:"secondary",icon:"mosy:gear",onClick:p},{default:y(()=>[K(I(d.$t("settings.organisation.storage_manage")),1)]),_:1})])]),_:1},8,["open","onUpdate:open"])}}},vi={key:0,class:"flex items-center gap-3"},mi={class:"flex shrink-0 items-center justify-center w-10 h-10 rounded-full bg-secondary-500"},gi={key:1,class:"flex items-center gap-3"},hi={class:"flex shrink-0 items-center justify-center w-10 h-10 rounded-full bg-secondary-500"},yi={key:0,class:"space-y-4"},bi={class:"text-sm text-secondary-600 font-medium leading-snug"},_i={class:"flex items-start gap-2 text-xs text-white bg-primary-500 rounded-xl px-3 py-2 font-medium"},wi={class:"text-xs text-secondary-500 font-medium"},xi={class:"space-y-1.5 max-h-64 overflow-y-auto pr-1"},ki=["onClick"],$i={class:"truncate"},Ii={class:"ml-auto shrink-0 flex items-center"},Ci={key:0,class:"text-xs text-rose-500 font-semibold"},Si={key:1,class:"space-y-4"},Li={class:"text-sm text-secondary-600 font-medium leading-snug"},Ti={class:"text-xs text-secondary-500 font-medium"},Oi={class:"space-y-1.5 max-h-64 overflow-y-auto pr-1"},Di=["onClick"],qi={class:"truncate"},Bi={key:1,class:"ml-auto text-xs text-rose-500 font-semibold shrink-0"},Pi={key:0,class:"flex justify-between items-center w-full gap-3"},Ai={class:"text-xs text-secondary-500 font-medium"},Mi={key:1,class:"flex justify-between items-center w-full gap-3"},Ei={class:"flex items-center gap-3"},zi={class:"text-xs text-secondary-500 font-medium"},Ie=3,Ri={__name:"AppDowngradeEnforceModal",setup(t){const i=mt(),{t:a}=xe(),l=ct(),{labelProjects:n,labelClients:v}=gt(),{isPro:r,previouslyPro:f}=tt(),{isOwner:g,orgId:L}=De(),{billableClients:q,billableClientsCount:h,fetchClients:p}=Ka(),{billableProjects:d,billableProjectsCount:c,projectsByClient:k,fetchProjects:S}=Xa(),z=P(()=>g.value&&!r.value&&f.value);let b=null;ae([z,L],([F,W])=>{!F||!W||b===W||(b=W,Promise.all([p(),S()]).catch(E=>console.warn("[DowngradeEnforce] load",E)))},{immediate:!0});const m=P(()=>g.value&&!r.value&&f.value&&(h.value>Ie||c.value>Ie)),w=Te("downgradeEnforceOpen",()=>!1);ae(m,F=>{w.value=F},{immediate:!0});const x=j("clients");ae([m,h],([F,W])=>{if(!F){x.value="clients";return}W>Ie?x.value="clients":x.value==="clients"&&(x.value="projects")},{immediate:!0});const A=P(()=>new Set(q.value.map(F=>F.id).filter(F=>!$.value.includes(F)))),o=P(()=>d.value.filter(F=>!A.value.has(F.client_id))),u=P(()=>c.value>Ie),$=j([]),R=j([]);function U(F){$.value.indexOf(F)>=0?$.value=$.value.filter(E=>E!==F):$.value.length<Ie&&($.value=[...$.value,F])}function X(F){R.value.indexOf(F)>=0?R.value=R.value.filter(E=>E!==F):R.value.length<Ie&&(R.value=[...R.value,F])}function M(){R.value=[],x.value="projects"}function Z(){x.value="clients"}const G=j(!1);async function H(){G.value=!0;try{const F=q.value.map(W=>W.id).filter(W=>!$.value.includes(W));if(F.length>0){const{error:W}=await i.from("clients").update({archive_cold:!0}).in("id",F);if(W)throw W;const{error:E}=await i.from("projects").update({archive_cold:!0}).in("client_id",F);if(E)throw E}if(u.value){const W=o.value.map(E=>E.id).filter(E=>!R.value.includes(E));if(W.length>0){const{error:E}=await i.from("projects").update({archive_cold:!0}).in("id",W);if(E)throw E}}}catch(F){console.error("[DowngradeEnforce] confirmAll error:",F),l.add({class:"mo-toast",title:a("common.error"),description:F.message,color:"error"})}finally{G.value=!1}}return(F,W)=>{const E=se,N=vt,Q=$e,pe=Oe;return s(),D(pe,{open:e(m),close:!1,dismissible:!1,ui:{width:"sm:max-w-lg"}},{title:y(()=>[e(x)==="clients"?(s(),O("div",vi,[_("div",mi,[C(E,{name:"mosy:users",class:"text-secondary-50 w-5 h-5"})]),K(" "+I(F.$t("downgrade_enforce.clients_title",{clients:e(v)})),1)])):e(x)==="projects"?(s(),O("div",gi,[_("div",hi,[C(E,{name:"mosy:folder-open",class:"text-secondary-50 w-5 h-5"})]),K(" "+I(F.$t("downgrade_enforce.projects_title",{projects:e(n)})),1)])):B("",!0)]),body:y(()=>[e(x)==="clients"?(s(),O("div",yi,[_("p",bi,I(F.$t("downgrade_enforce.clients_desc",{clients:e(v),limit:Ie})),1),_("div",_i,[C(E,{name:"mosy:circle-info",class:"w-3.5 h-3.5 mt-px shrink-0 translate-y-[1px]"}),K(" "+I(F.$t("downgrade_enforce.cascade_hint",{projects:e(n),clients:e(v)})),1)]),_("p",wi,I(F.$t("downgrade_enforce.keep_label",{count:e($).length,limit:Ie})),1),_("div",xi,[(s(!0),O(re,null,Le(e(q),ee=>(s(),O("button",{key:ee.id,class:T(["w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border text-sm font-medium transition-all",e($).includes(ee.id)?"bg-secondary-100 border-secondary-200 text-secondary-700":"bg-white border-secondary-200 text-secondary-400 opacity-60"]),onClick:J=>U(ee.id)},[C(E,{name:e($).includes(ee.id)?"mosy:circle-check":"i-lucide-circle",class:T(["w-4 h-4 shrink-0",e($).includes(ee.id)?"text-secondary-600":"text-secondary-300"])},null,8,["name","class"]),ee.logo_url?(s(),D(N,{key:0,src:ee.logo_url,size:"xs",class:"shrink-0"},null,8,["src"])):B("",!0),_("span",$i,I(ee.name),1),_("div",Ii,[!e($).includes(ee.id)&&e($).length>
1=Ie?(s(),O("span",Ci,I(F.$t("downgrade_enforce.will_archive")),1)):(s(),O("span",{key:1,class:T(["text-xs font-medium",e($).includes(ee.id)?"text-secondary-500":"text-secondary-300"])},I(e(k)(ee.id).length)+" "+I(e(n)),3))])],10,ki))),128))])])):e(x)==="projects"?(s(),O("div",Si,[_("p",Li,I(F.$t("downgrade_enforce.projects_desc",{projects:e(n),limit:Ie})),1),_("p",Ti,I(F.$t("downgrade_enforce.keep_label",{count:e(R).length,limit:Ie})),1),_("div",Oi,[(s(!0),O(re,null,Le(e(o),ee=>(s(),O("button",{key:ee.id,class:T(["w-full flex items-center gap-3 px-3 py-2.5 rounded-xl border text-sm font-medium transition-all",e(R).includes(ee.id)?"bg-secondary-100 border-secondary-200 text-secondary-700":"bg-white border-secondary-200 text-secondary-400 opacity-60"]),onClick:J=>X(ee.id)},[C(E,{name:e(R).includes(ee.id)?"mosy:circle-check":"i-lucide-circle",class:T(["w-4 h-4 shrink-0",e(R).includes(ee.id)?"text-secondary-500":"text-secondary-300"])},null,8,["name","class"]),ee.color?(s(),O("span",{key:0,class:"w-3 h-3 rounded-full shrink-0",style:Qt({backgroundColor:ee.color})},null,4)):B("",!0),_("span",qi,I(ee.name),1),!e(R).includes(ee.id)&&e(R).length>=Ie?(s(),O("span",Bi,I(F.$t("downgrade_enforce.will_archive")),1)):B("",!0)],10,Di))),128))])])):B("",!0)]),footer:y(()=>[e(x)==="clients"?(s(),O("div",Pi,[_("p",Ai,I(F.$t("downgrade_enforce.step",{current:1,total:e(u)?2:1})),1),C(Q,{class:"mo-button",loading:e(G),disabled:e($).length>Ie,onClick:W[0]||(W[0]=ee=>e(u)?M():H())},{default:y(()=>[K(I(e(u)?F.$t("common.next"):F.$t("downgrade_enforce.confirm_btn")),1)]),_:1},8,["loading","disabled"])])):e(x)==="projects"?(s(),O("div",Mi,[C(Q,{variant:"ghost",color:"secondary",disabled:e(G),onClick:Z},{default:y(()=>[K(I(F.$t("common.back")),1)]),_:1},8,["disabled"]),_("div",Ei,[_("p",zi,I(F.$t("downgrade_enforce.step",{current:2,total:2})),1),C(Q,{class:"mo-button",loading:e(G),disabled:e(R).length>Ie,onClick:H},{default:y(()=>[K(I(F.$t("downgrade_enforce.confirm_btn")),1)]),_:1},8,["loading","disabled"])])])):B("",!0)]),_:1},8,["open"])}}},ji={class:"flex items-center gap-2"},Ni={class:"rounded-2xl p-3 mt-1 mb-background mb-background-light-overlay flex flex-col gap-3"},Ui={class:"flex items-center gap-2.5 px-1 pt-1"},Vi=["disabled","onClick"],Fi={class:"flex items-center gap-2.5"},Hi={key:0,class:"w-2 h-2 rounded-full bg-white"},Wi={key:0,class:"px-1 text-white text-sm font-medium flex flex-col gap-2"},Ki={key:1},Xi={class:"text-[11px] text-white/80"},Gi={class:"rounded-xl bg-white/15 ring-1 ring-white/70 px-3 py-2 text-[13px] leading-snug"},Yi={key:1},Ji={class:"text-[11px] text-white/80"},Zi={key:2,class:"text-white/80"},Qi={key:0,class:"w-2 h-2 rounded-full bg-white"},er={class:"flex flex-col gap-0.5 flex-1"},tr={class:"flex flex-col items-end gap-0.5 ml-auto shrink-0"},ar={key:0,class:"w-2 h-2 rounded-full bg-white"},nr={class:"flex flex-col gap-0.5 flex-1"},or={class:"flex items-center gap-x-2 gap-y-0.5 flex-wrap"},lr={class:"flex flex-col items-end gap-0.5 ml-auto shrink-0"},sr={key:0,class:"px-1 text-[12px] leading-snug text-white/90 font-medium"},ir={class:"flex justify-end gap-2 w-full flex-wrap"},rr={__name:"AppUpgradeIntervalModal",setup(t){const i=Te("upgradeIntervalModal",()=>!1),{startCheckout:a,previewPlanChange:l,changePlan:n,loading:v}=oa(),{fetchPlanPrices:r,priceLabel:f,perMonthLabel:g,seatLabel:L,hasPlan:q,trialWithoutCard:h,loading:p}=Hn(),{isNativeApp:d}=ea(),{previouslyPro:c,selfPlan:k,fetchSubscription:S}=tt(),{t:z,locale:b}=xe(),m=ct(),w=j(null),x=j(!1),A=N=>new Intl.DateTimeFormat(b.value,{day:"2-digit",month:"2-digit",year:"numeric"}).format(N),o=P(()=>Kn(z,w.value,{formatDate:A,planLabel:"Rocket"})),u=j("rocket"),$=j(null),R=P(()=>k.value==="pro"),U=P(()=>q("rocket"));ae(i,async N=>{if(N&&d.value){i.value=!1;return}if(N&&k.value==="rocket"){i.value=!1;return}N?(u.value=!R.value&&N==="pro"?"pro":"rocket",R.value&&Z(),await r(),!U.value&&u.value==="rocket"&&!R.value&&(u.value="pro")):($.value=null,w.value=null)}),ae(U,N=>{!N&&u.value==="rocket"&&!R.value&&(u.value="pro")});function X(){i.value=!1}je({escape:{usingInput:!0,handler:()=>{i.value&&X()}}});const M=P(()=>R.value?U.value&&!x.value:!!$.value);async function Z(){x.value=!0;try{w.value=await l("rocket")}finally{x.value=!1}}const G=P(()=>!R.value&&!c.value&&h.value);async function H(N=!1){if(!(!M.value||v.value)){if(R.value){const Q=await n("rocket");if(Q?.ok){await S();const pe=Q.trialing&&Q.trial_end?z("settings.organisation.plan_changed_trial_hint",{date:A(new Date(Q.trial_end*1e3)),plan:"Rocket"}):void 0;m.add({class:"mo-toast",title:z("settings.organisation.plan_changed_toast",{plan:"Rocket"}),description:pe,color:"success"}),X()}return}await a($.value,u.value,{withCard:N})}}const F=P(()=>u.value==="rocket"?"Rocket":"Pro"),W=P(()=>R.value?z("upsell.cta_confirm_change"):c.value?z("upsell.cta_label"):z("upsell.cta_label_test")),E=P(()=>[{value:"pro",label:"Pro",features:z("upsell.plan_pro_features"),available:!0},{value:"rocket",label:"Rocket",features:z("upsell.plan_rocket_features"),available:U.value}].filter(N=>!R.value||N.value==="rocket"));return(N,Q)=>{const pe=se,ee=la,J=Qe,ie=Wn,me=$e,ce=Oe;return s(),D(ce,{open:!!e(i),close:!1,"onUpdate:open":X},{title:y(()=>[_("div",ji,[C(pe,{name:"mosy:rocket-launch",class:"text-secondary-500 shrink-0"}),K(" "+I(e(R)?N.$t("upsell.plan_choose_title"):N.$t("upsell.interval_modal_title")),1)])]),description:y(()=>[K(I(e(R)?N.$t("upsell.description_rocket"):N.$t("upsell.interval_modal_desc",{plan:e(F)})),1)]),body:y(()=>[_("div",Ni,[_("div",Ui,[C(ee,{class:"max-w-[28px]! shrink-0",light:!0}),Q[4]||(Q[4]=_("p",{class:"font-waden text-white text-base translate-y-0.5 leading-none"},"marble work",-1)),C(J,{color:"neutral",variant:"solid",size:"sm",class:"px-2.5 rounded-xl bg-[#537C7F]! font-bold ring-1 ring-white/70 text-white! text-[11px]"},{default:y(()=>[K(I(e(F)),1)]),_:1})]),_("div",{class:T(["grid gap-2",e(E).length>1?"grid-cols-2 max-[479px]:grid-cols-1":"grid-cols-1"])},[(s(!0),O(re,null,Le(e(E),ne=>(s(),O("button",{key:ne.value,type:"button",class:T(["flex flex-col gap-1 px-4 py-3 rounded-2xl border-2 transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed",e(u)===ne.value?"border-secondary-500 bg-white":"border-secondary-100/50 bg-secondary-400/60 hover:border-secondary-300"]),disabled:!ne.available,onClick:_e=>u.value=ne.value},[_("span",Fi,[_("span",{class:T(["w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 transition-all",e(u)===ne.value?"border-secondary-500 bg-secondary-500":"border-secondary-200"])},[e(u)===ne.value?(s(),O("span",Hi)):B("",!0)],2),_("span",{class:T(["text-[15px] font-bold",e(u)===ne.value?"text-secondary-700":"text-white"])},"marble work "+I(ne.label),3)]),_("span",{class:T(["text-xs font-medium leading-snug pl-[30px]",e(u)===ne.value?"text-secondary-600/85":"text-white"])},I(ne.features),3),ne.available?e(L)(ne.value,e($)||"month")?(s(),O("span",{key:1,class:T(["text-[11px] font-medium pl-[30px]",e(u)===ne.value?"text-secondary-600/85":"text-white/80"])},I(N.$t("upsell.plan_seat_line",{price:e(L)(ne.value,e($)||"month"),interval:e($)==="year"?N.$t("upsell.interval_per_year"):N.$t("upsell.interval_suffix_month")})),3)):B("",!0):(s(),O("span",{key:0,class:T(["text-[11px] font-medium pl-[30px]",e(u)===ne.value?"text-secondary-600/85":"text-white/80"])},I(N.$t("upsell.plan_unavailable")),3))],10,Vi))),128))],2),e(R)?(s(),O("div",Wi,[e(p)&&!e(f)("rocket","month")?(s(),D(ie,{key:0,class:"h-5 w-40 rounded-lg"})):e(U)?(s(),O("span",Ki,[K(I(N.$t("upsell.plan_rocket_price_line",{month:e(f)("rocket","month"),year:e(f)("rocket","year")}))+" ",1),_("span",Xi,I(N.$t("upsell.interval_excl_vat")),1)])):B("",!0),_("div",Gi,[e(x)?(s(),D(ie,{key:0,class:"h-4 w-56 rounded-lg"})):e(o)?(s(),O("span",Yi,[K(I(e(o))+" ",1),_("span",Ji,I(N.$t("upsell.interval_excl_vat")),1)])):(s(),O("span",Zi,I(N.$t("upsell.change_preview_unavailable")),1))])])):(s(),O(re,{key:1},[_("button",{class:T(["flex items-center gap-4 px-4 py-4 rounded-2xl border-2 transition-all text-left",e($)==="month"?"border-secondary-500 bg-white":"border-secondary-100/50 bg-secondary-400/60 hover:border-secondary-300"]),onClick:Q[0]||(Q[0]=ne=>$.value="month")},[_("div",{class:T(["w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 transition-all",e($)==="month"?"border-secondary-500 bg-secondary-500":"border-secondary-200"])},[e($)==="month"?(s(),O("div",Qi)):B("",!0)],2),_("div",er,[_("span",{class:T(["text-[15px] font-bold text-secondary-700",{"text-white!":e($)!="month"}])},I(N.$t("stripe.interval_month")),3),_("span",{class:T(["text-xs text-secondary-500 font-medium",{"text-white!":e($)!="month"}])},I(N.$t("upsell.interval_month_hint")),3)]),_("div",tr,[e(p)&&!e(f)(e(u),"month")?(s(),D(ie,{key:0,class:"h-5 w-14 roun
1ded-lg"})):(s(),O("span",{key:1,class:T(["text-[15px] font-bold tabular-nums",e($)==="month"?"text-secondary-700":"text-white"])},I(e(f)(e(u),"month")),3)),_("span",{class:T(["text-[10px] font-medium",e($)==="month"?"text-secondary-600/85":"text-white/80"])},I(N.$t("upsell.interval_excl_vat")),3)])],2),_("button",{class:T(["flex items-center gap-4 px-4 py-4 rounded-2xl border-2 transition-all text-left",e($)==="year"?"border-secondary-500 bg-white":"border-secondary-100/50 bg-secondary-400/60 hover:border-secondary-300"]),onClick:Q[1]||(Q[1]=ne=>$.value="year")},[_("div",{class:T(["w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 transition-all",e($)==="year"?"border-secondary-500 bg-secondary-500":"border-secondary-200"])},[e($)==="year"?(s(),O("div",ar)):B("",!0)],2),_("div",nr,[_("div",or,[_("span",{class:T(["text-[15px] font-bold text-secondary-700",{"text-white!":e($)!="year"}])},I(N.$t("stripe.interval_year")),3),_("span",{class:T(["text-[10px] font-bold px-1.5 py-0.5 rounded-md",e($)==="year"?"bg-secondary-500 text-white":"bg-secondary-100 text-secondary-700"])},I(N.$t("upsell.interval_year_save")),3)]),_("span",{class:T(["text-xs text-secondary-500 font-medium",{"text-white!":e($)!="year"}])},I(N.$t("upsell.interval_year_hint")),3)]),_("div",lr,[e(p)&&!e(f)(e(u),"year")?(s(),D(ie,{key:0,class:"h-5 w-14 rounded-lg"})):(s(),O("span",{key:1,class:T(["text-[15px] font-bold tabular-nums",e($)==="year"?"text-secondary-700":"text-white"])},I(e(f)(e(u),"year")),3)),_("span",{class:T(["text-[11px] font-medium",e($)==="year"?"text-secondary-600/85":"text-white/80"])},I(N.$t("upsell.interval_excl_vat")),3),e(g)(e(u))?(s(),O("span",{key:2,class:T(["text-[11px] font-medium",e($)==="year"?"text-secondary-600/85":"text-white/80"])},I(e(g)(e(u)))+" "+I(N.$t("upsell.interval_suffix_month")),3)):B("",!0)])],2),e(G)?(s(),O("p",sr,I(N.$t("upsell.trial_card_choice_hint")),1)):B("",!0)],64))])]),footer:y(()=>[_("div",ir,[C(me,{variant:"ghost",color:"secondary",onClick:X,class:"text-secondary-600 text-[14px]! px-3! py-1.5!"},{default:y(()=>[K(I(N.$t("common.cancel")),1)]),_:1}),e(G)?(s(),D(me,{key:0,variant:"subtle",color:"secondary",icon:"mosy:money-check-pen",disabled:!e(M)||e(v),class:"text-secondary-600 text-[14px]! px-3! py-1.5!",onClick:Q[2]||(Q[2]=ne=>H(!0))},{default:y(()=>[K(I(N.$t("upsell.cta_trial_with_card")),1)]),_:1},8,["disabled"])):B("",!0),C(me,{class:"mo-button",icon:"mosy:rocket-launch",loading:e(v),disabled:!e(M),onClick:Q[3]||(Q[3]=ne=>H(!1))},{default:y(()=>[K(I(e(G)?N.$t("upsell.cta_trial_card_later"):e(W)),1)]),_:1},8,["loading","disabled"])])]),_:1},8,["open"])}}},ur={class:"flex items-center gap-3"},dr={class:"rounded-2xl p-4 flex items-start flex-col gap-3 mb-background mb-background-light-overlay mt-1"},cr={class:"flex items-center gap-3"},pr={class:"text-white/90 text-sm font-medium leading-snug ml-1"},fr={class:"flex justify-end gap-2 w-full flex-wrap"},vr={__name:"AppTrialReminderModal",setup(t){const{sichtbar:i,stufe:a,tage:l,endDatum:n,planLabel:v,orgId:r,openPortal:f,loading:g}=an(),{t:L,locale:q}=xe(),h=j(!1),p=Te("trialReminderShown",()=>({}));function d(){return`mw-trial-reminder:${r.value}:${a.value}`}function c(){if(p.value[d()])return!0;try{return localStorage.getItem(d())==="1"}catch{return!1}}function k(){p.value={...p.value,[d()]:!0};try{localStorage.setItem(d(),"1")}catch{}}ae([i,a],([w,x])=>{!w||!x||h.value||c()||(k(),h.value=!0)},{immediate:!0});const S=P(()=>l.value===1?L("trial_reminder.modal_title_last_day",{plan:v.value}):L("trial_reminder.modal_title_days",{plan:v.value,days:l.value})),z=P(()=>n.value?new Intl.DateTimeFormat(q.value,{day:"numeric",month:"long",year:"numeric"}).format(n.value):"");function b(){h.value=!1}async function m(){await f()}return je({escape:{usingInput:!0,handler:()=>{h.value&&b()}}}),(w,x)=>{const A=se,o=la,u=Qe,$=$e,R=Oe;return s(),D(R,{open:e(h),close:!1,"onUpdate:open":b},{title:y(()=>[_("div",ur,[C(A,{name:"mosy:hourglass-clock",class:"text-secondary-500 shrink-0"}),K(" "+I(e(S)),1)])]),description:y(()=>[K(I(w.$t("trial_reminder.modal_desc",{date:e(z)})),1)]),body:y(()=>[_("div",dr,[_("div",cr,[C(o,{class:"max-w-[36px]! shrink-0",light:!0}),x[0]||(x[0]=_("p",{class:"font-waden text-white text-base translate-y-0.5 leading-none mb-1"},"marble work",-1)),C(u,{color:"neutral",variant:"solid",size:"sm",class:"px-2.5 rounded-xl bg-[#537C7F]! font-bold ring-1 ring-white/70 text-white! text-[11px]"},{default:y(()=>[K(I(e(v)),1)]),_:1})]),_("p",pr,I(w.$t("trial_reminder.modal_card",{plan:e(v)})),1)])]),footer:y(()=>[_("div",fr,[C($,{class:"ring-1!",variant:"subtle",color:"secondary",onClick:b},{default:y(()=>[K(I(w.$t("trial_reminder.later")),1)]),_:1}),C($,{class:"mo-button",icon:"mosy:money-check-pen",loading:e(g),onClick:m},{default:y(()=>[K(I(w.$t("trial_reminder.cta")),1)]),_:1},8,["loading"])])]),_:1},8,["open"])}}},mr={class:"flex items-center gap-3"},gr={class:"rounded-2xl p-4 flex items-start flex-col gap-3 mb-background mb-background-light-overlay mt-1"},hr={class:"flex items-center gap-3"},yr={class:"text-white/90 text-sm font-medium leading-snug ml-1"},br={class:"flex justify-end gap-2 w-full flex-wrap"}
1,_r={__name:"AppTrialStartPaymentPrompt",setup(t){const i=Dt(),a=Bn(),{isNativeApp:l}=ea(),{ownOrgId:n}=De(),{selfSubscription:v,isSelfTrialing:r,selfIsCanceled:f,selfTrialEnd:g,selfPlan:L}=tt(),{openPortal:q,loading:h}=oa(),{t:p,locale:d}=xe(),c=Te("trialStartPromptPending",()=>!1),k=j(!1);ae(()=>i.query.card,A=>{A==="later"&&(c.value=!0,a.replace({query:{...i.query,card:void 0}}))},{immediate:!0});function S(){return`mw-trial-start-prompt:${n.value}`}function z(){try{return localStorage.getItem(S())==="1"}catch{return!1}}function b(){try{localStorage.setItem(S(),"1")}catch{}}ae([c,r,f,()=>v.value?.has_payment_method,n],([A,o,u,$,R])=>{!A||l.value||!R||!o||(c.value=!1,!(u||$===!0||z())&&(b(),k.value=!0))},{immediate:!0});const m=P(()=>L.value==="rocket"?"Rocket":"Pro"),w=P(()=>g.value?new Intl.DateTimeFormat(d.value,{day:"numeric",month:"long",year:"numeric"}).format(g.value):"");function x(){k.value=!1}return je({escape:{usingInput:!0,handler:()=>{k.value&&x()}}}),(A,o)=>{const u=se,$=la,R=Qe,U=$e,X=Oe;return s(),D(X,{open:e(k),close:!1,"onUpdate:open":x},{title:y(()=>[_("div",mr,[C(u,{name:"mosy:rocket-launch",class:"text-secondary-500 shrink-0"}),K(" "+I(e(p)("trial_reminder.start_title",{plan:e(m)})),1)])]),description:y(()=>[K(I(e(p)("trial_reminder.start_desc",{date:e(w)})),1)]),body:y(()=>[_("div",gr,[_("div",hr,[C($,{class:"max-w-[36px]! shrink-0",light:!0}),o[1]||(o[1]=_("p",{class:"font-waden text-white text-base translate-y-0.5 leading-none mb-1"},"marble work",-1)),C(R,{color:"neutral",variant:"solid",size:"sm",class:"px-2.5 rounded-xl bg-[#537C7F]! font-bold ring-1 ring-white/70 text-white! text-[11px]"},{default:y(()=>[K(I(e(m)),1)]),_:1})]),_("p",yr,I(e(p)("trial_reminder.start_card")),1)])]),footer:y(()=>[_("div",br,[C(U,{class:"ring-1!",variant:"subtle",color:"secondary",onClick:x},{default:y(()=>[K(I(e(p)("trial_reminder.later")),1)]),_:1}),C(U,{class:"mo-button",icon:"mosy:money-check-pen",loading:e(h),onClick:o[0]||(o[0]=M=>e(q)())},{default:y(()=>[K(I(e(p)("trial_reminder.cta")),1)]),_:1},8,["loading"])])]),_:1},8,["open"])}}},wr={__name:"AppPlanLimitModal",setup(t){const{t:i,te:a}=xe(),{planLimitModal:l,limit:n}=Ga(),v=P(()=>l.value),r=P(()=>!!v.value),f=P(()=>Qn(v.value));function g(p){const d=`upsell.plan_limit.${v.value}.${p}`,c={limit:n(v.value)??""};return a(d)?i(d,c):i(`upsell.plan_limit.generic.${p}`,c)}const L=P(()=>v.value?g("title"):""),q=P(()=>v.value?g("desc"):"");function h(){l.value=null}return(p,d)=>{const c=Zn;return s(),D(c,{open:e(r),title:e(L),description:e(q),plan:e(f),onClose:h},null,8,["open","title","description","plan"])}}},xr={class:"flex items-center gap-2"},kr={class:"flex justify-end w-full"},$r={__name:"AppStripeUnavailableModal",setup(t){const i=Te("stripeUnavailableModal",()=>!1);return(a,l)=>{const n=se,v=$e,r=Oe;return s(),D(r,{open:e(i),"onUpdate:open":l[1]||(l[1]=f=>i.value=!1)},{title:y(()=>[_("div",xr,[C(n,{name:"mosy:triangle-exclamation",class:"text-warning shrink-0"}),K(" "+I(a.$t("stripe_error.unavailable_title")),1)])]),description:y(()=>[K(I(a.$t("stripe_error.unavailable_desc")),1)]),footer:y(()=>[_("div",kr,[C(v,{class:"mo-button",onClick:l[0]||(l[0]=f=>i.value=!1)},{default:y(()=>[K(I(a.$t("stripe_error.try_later")),1)]),_:1})])]),_:1},8,["open"])}}},Ir=720*60*1e3,da="mo:appUpdateProbe";function Ut(t){try{localStorage.setItem(da,JSON.stringify({major:t,at:Date.now()}))}catch{}}function Cr(t){try{const i=localStorage.getItem(da);if(!i)return!1;const{major:a,at:l}=JSON.parse(i);return a===t&&Date.now()-l<Ir}catch{return!1}}function cn(){const t=Te("appUpdateOpen",()=>!1),i=Te("appUpdateData",()=>null),a=Te("appUpdateChecked",()=>!1),{profile:l,updateProfile:n}=ta(),v=mt(),{locale:r}=xe(),f=Pn(),g=P(()=>Rt(f.public.appVersion));function L(){ae(()=>l.value?.id,async h=>{if(!(!h||a.value||!g.value)&&(a.value=!0,Rt(l.value.seen_update_version)!==g.value&&!Cr(g.value)))try{const p=r.value==="de"?"de":"en",{data:d,error:c}=await v.functions.invoke("app-update",{body:{lang:p}});if(c||!d?.update){Ut(g.value);return}if(Rt(d.update.version)!==g.value){Ut(g.value);return}i.value=d.update,t.value=!0}catch{Ut(g.value)}},{immediate:!0})}function q(){if(t.value=!1,!!g.value){try{localStorage.removeItem(da)}catch{}n({seen_update_version:g.value}).catch(()=>{})}}return{open:t,update:i,appMajor:g,initUpdateCheck:L,markSeen:q}}const Sr={key:0,class:"flex flex-col gap-6 mo-update-modal"},Lr=["src"],Tr={class:"flex flex-col gap-2"},Or={key:0,class:"text-[14px] text-secondary-500 uppercase tracking-widest"},Dr={class:"flex items-start gap-0.5 flex-wrap flex-col"},qr={class:"text-[23px] max-sm:text-[22px] font-waden font-bold text-secondary-700"},Br={class:"text-[14px]"},Pr=["innerHTML"],Ar={key:2,class:"flex flex-col gap-3"},Mr={class:"text-[18px] font-waden text-secondary-600 pb-1"},Er={class:"flex flex-col gap-2 w-full pl-0!"},zr={name:"update-features"},Rr={class:"list-none flex gap-2"},jr={class:"flex flex-col gap-1 min-w-0"},Nr={key:0,class:"flex w-5 h-5 items-center justify-center rounded-full bg-secondary-100 mt-0.5 shrink-0"},Ur=["innerHTML"],Vr={key:3,class:"flex flex-col gap-3"},Fr={class:"text-[18px] font-waden text-secondary-600 pb-1"},Hr={class:"flex flex-col gap-2 w-full pl-0!"},Wr={name:"update-bugfixes"},Kr={class:"list-none flex gap-2"},Xr={class:"flex flex-col gap-1 min-w-0"},Gr={key:0,class:"flex w-5 h-5 items-center justify-center rounded-full bg-secondary-100 mt-0.5 shrink-0"},Yr=["innerHTML"],Jr={key:4,class:"flex items-center gap-1.5 flex-wrap"},Zr={class:"flex items-center justify-between gap-2 w-full flex-wrap"},Qr={__name:"AppUpdateModal",setup(t){const{open:i,update:a,markSeen:l}=cn(),{locale:n}=xe();je({escape:{usingInput:!0,handler:()=>{i.value&&l()}}});const v=P(()=>{const h=Number(a.value?.date);return h?new Intl.DateTimeFormat(n.value,{day:"numeric",month:"long",year:"numeric"}).format(new Date(h*1e3)):""});function r(h){if(!h||typeof window>"u")return"";const p=new DOMParser().parseFromString(String(h),"text/html");for(const d of p.body.querySelectorAll("script, style, iframe, object, embed, form"))d.remove();for(const d of p.body.querySelectorAll("*"))for(const c of[...d.attributes])c.name.startsWith("on")&&d.removeAttribute(c.name);for(const d of p.body.querySelectorAll("a[href]")){const c=d.getAttribute("href");c.startsWith("/")&&d.setAttribute("href",`https://marblework.app${c}`),d.setAttribute("target","_blank"),d.setAttribute("rel","noopener noreferrer")}return p.body.innerHTML}const f=P(()=>r(a.value?.description)),g=P(()=>a.value?.features??[]),L=P(()=>a.value?.bugfixes??[]),q=P(()=>a.value?.tags??[]);
1return(h,p)=>{const d=Qe,c=se,k=$e,S=Oe;return s(),D(S,{open:e(i),class:"mo-modal-with-close",title:h.$t("update_modal.title"),ui:{content:"max-w-2xl",body:"max-h-[70dvh] overflow-y-auto"},"onUpdate:open":p[0]||(p[0]=z=>{z||e(l)()})},{body:y(()=>[e(a)?(s(),O("div",Sr,[e(a).cover?(s(),O("div",{key:0,class:T(["w-full mb-2",e(a).isDefaultImage?"mo-cover-border":""])},[_("img",{src:e(a).cover,alt:"",class:T(["w-full",e(a).isDefaultImage?"rounded-3xl mo-cover-shadow max-[479px]:rounded-2xl":""])},null,10,Lr)],2)):B("",!0),_("div",Tr,[e(v)?(s(),O("p",Or,I(e(v)),1)):B("",!0),_("div",Dr,[_("h3",qr,I(e(a).title),1),e(a).version?(s(),D(d,{key:0,size:"sm",color:"secondary",variant:"subtle",class:"rounded-xl! ring-1 ring-secondary-300 mo-custom-badge mo-custom-badge-no-colors shrink-0 py-1.5!"},{default:y(()=>[_("span",Br,"v"+I(e(a).version),1)]),_:1})):B("",!0)])]),e(f)?(s(),O("div",{key:1,class:"text-[15px] text-secondary-600 leading-[1.4em] -mt-2",innerHTML:e(f)},null,8,Pr)):B("",!0),e(g).length?(s(),O("div",Ar,[_("p",Mr,I(h.$t("update_modal.features")),1),_("ul",Er,[(s(!0),O(re,null,Le(e(g),(z,b)=>(s(),O("li",{key:`f${b}`,class:T(["flex items-start gap-2.5",{"cursor-pointer":z.description}])},[_("details",zr,[_("summary",Rr,[C(c,{name:"mosy:circle-check",class:"w-4 h-4 mt-0.5 shrink-0 text-secondary-500"}),_("div",jr,[_("p",{class:T(["text-[15px] font-medium text-secondary-700",{"hover:text-secondary-500":z.description}])},I(z.title),3)]),z.description?(s(),O("div",Nr,[C(c,{name:"mosy:align-left",class:"w-3.5 h-3.5 text-secondary-600"})])):B("",!0)]),z.description?(s(),O("div",{key:0,class:"text-[14px] text-secondary-600 leading-snug pl-[25px] pt-1",innerHTML:r(z.description)},null,8,Ur)):B("",!0)])],2))),128))])])):B("",!0),e(L).length?(s(),O("div",Vr,[_("p",Fr,I(h.$t("update_modal.bugfixes")),1),_("ul",Hr,[(s(!0),O(re,null,Le(e(L),(z,b)=>(s(),O("li",{key:`b${b}`,class:T(["flex items-start gap-2.5",{"cursor-pointer":z.description}])},[_("details",Wr,[_("summary",Kr,[C(c,{name:"mosy:circle-check",class:"w-4 h-4 mt-0.5 shrink-0 text-secondary-500"}),_("div",Xr,[_("p",{class:T(["text-[15px] font-medium text-secondary-700",{"hover:text-secondary-500":z.description}])},I(z.title),3)]),z.description?(s(),O("div",Gr,[C(c,{name:"mosy:align-left",class:"w-3.5 h-3.5 text-secondary-600"})])):B("",!0)]),z.description?(s(),O("div",{key:0,class:"text-[14px] text-secondary-600 leading-snug pl-[25px] pt-1",innerHTML:r(z.description)},null,8,Yr)):B("",!0)])],2))),128))])])):B("",!0),e(q).length?(s(),O("div",Jr,[(s(!0),O(re,null,Le(e(q),z=>(s(),D(d,{key:z,size:"sm",color:"secondary",variant:"subtle",class:"bg-secondary-100! text-secondary-700! mo-cu
1stom-badge mo-custom-badge-no-colors"},{default:y(()=>[K(" #"+I(z),1)]),_:2},1024))),128))])):B("",!0)])):B("",!0)]),footer:y(()=>[_("div",Zr,[C(k,{variant:"subtle",color:"secondary",icon:"mosy:globe-pointer",to:h.$t("nav.whats_new_url"),target:"_blank",rel:"noopener noreferrer"},{default:y(()=>[K(I(h.$t("update_modal.link")),1)]),_:1},8,["to"]),C(k,{color:"secondary",icon:"mosy:circle-arrow-right",onClick:e(l)},{default:y(()=>[K(I(h.$t("update_modal.cta")),1)]),_:1},8,["onClick"])])]),_:1},8,["open","title"])}}},eu=We(Qr,[["__scopeId","data-v-374116fa"]]),tu={base:"fixed inset-0 flex overflow-hidden"},au={__name:"UDashboardGroup",props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},storage:{type:String,required:!1,default:"cookie"},storageKey:{type:String,required:!1,default:"dashboard"},persistent:{type:Boolean,required:!1,default:!0},unit:{type:String,required:!1,default:"%"}},setup(t){const i=t,a=Kt(),l=ze(),n=Re("dashboardGroup",i),v=P(()=>we({extend:we(tu),...l.ui?.dashboardGroup||{}})),r=j(!1),f=j(!1);return gs({storage:i.storage,storageKey:i.storageKey,persistent:i.persistent,unit:i.unit,sidebarOpen:r,toggleSidebar:()=>{a.hooks.callHook("dashboard:sidebar:toggle")},sidebarCollapsed:f,collapseSidebar:g=>{a.hooks.callHook("dashboard:sidebar:collapse",g)},toggleSearch:()=>{a.hooks.callHook("dashboard:search:toggle")}}),(g,L)=>(s(),D(e(Ce),{as:t.as,class:T(v.value({class:[e(n)?.base,i.class]}))},{default:y(()=>[V(g.$slots,"default")]),_:3},8,["as","class"]))}},nu={class:"pb-0! space-y-2.5 w-full mt-auto"},ou={class:"mo-sidebar-mobile"},lu={key:0,class:"mo-mobile-bar-badge inline-flex items-center justify-center min-w-[21px] h-[21px] px-1 rounded-full bg-secondary-500 text-white text-[12px]! font-bold leading-none shrink-0 pointer-events-none"},su={__name:"default",async setup(t){let i,a;const{profile:l}=ta(),n=Dt();eo();const v=at(),{t:r,locale:f,setLocale:g}=xe(),{labelProject:L,labelProjects:q,labelClients:h,labelTasks:p}=gt(),d=j(!1),c=An("mo:sidebarMinimized",!1),{ownOrgId:k,currentOrg:S,canAccessIntelligence:z,canAccessProjectTimes:b,canAccessWorkTimes:m}=De(),{myInvites:w}=aa(k),x=P(()=>w.value.length),{istDowngrade:A,hatVerstoesse:o,pruefen:u,plan:$,planChangedAt:R}=Xn(),U=Te("downgradeEnforceOpen",()=>!1),X=P(()=>A.value&&o.value&&!U.value);ae([A,k,R,$],()=>u(),{immediate:!0});const M=P(()=>[{label:r("nav.dashboard"),icon:"mosy:objects-column",to:"/",active:n.name.startsWith("index")},{label:q.value,icon:"mosy:folder-open",to:v("projects"),active:n.name.startsWith("projects")},{label:h.value,icon:"mosy:users",to:v("clients"),active:n.name.startsWith("clients")},{label:r("nav.tasks",{tasks:p.value}),icon:"mosy:list-check",class:"mo-nav-divider",to:v("tasks"),active:n.name.startsWith("tasks")},...z.value?[{label:r("nav.chat"),icon:"mosy:comments",to:v("chat"),active:n.name.startsWith("chat")}]:[],...z.value?[{label:r("nav.intelligence"),icon:"mosy:sparkles",to:v("intelligence"),active:n.name.startsWith("intelligence")}]:[],...b.value?[{label:r("nav.time_entries",{project:L.value}),icon:"mosy:timer",class:"mo-nav-divider",to:v("timeentries"),active:n.name.startsWith("timeentries")}]:[],...m.value?[{label:r("nav.work_accounts"),icon:"mosy:user-clock",class:b.value?void 0:"mo-nav-divider",to:v("work-accounts"),active:n.name.startsWith("work-accounts")}]:[]]),Z=P(()=>new Set([v("intelligence"),v("work-accounts")])),G=P(()=>M.value.filter(J=>Z.value.has(J.to)).map(J=>({...J,class:void 0}))),H=P(()=>[...M.value.filter(J=>!Z.value.has(J.to)).map(J=>({...J,class:void 0})),{label:r("nav.menu"),icon:"mosy:bars-staggered",active:n.name.startsWith("settings"),slot:"menu",ui:{linkTrailing:"!absolute !top-0 !right-0 !m-0 !p-0 !w-auto !min-w-0 pointer-events-none"},onSelect(){F()}}]);je({escape:{usingInput:!0,handler:()=>{d.value&&E()}}});const F=function(){d.value=!d.value},W=function(){c.value=!c.value},E=function(){d.value=!1};l.value?.locale&&l.value.locale!==f.value&&([i,a]=Mn(()=>g(l.value.locale)),await i,a()),cn().initUpdateCheck();const{fetchPlanLimits:N}=Ga();function Q(){return window.innerWidth<1024||window.innerHeight<=800}const pe=j(!1),ee=function(){const J=Q();pe.value=J,d.value&&!J&&(d.value=!1),J&&c.value&&(c.value=!1)};return ae(()=>n.name,()=>{d.value=!1;
1{const J=document.querySelector(".fixed.inset-0.flex.overflow-hidden");J&&J.scrollLeft&&(J.scrollLeft=0)}}),ae(()=>S.value?.id,(J,ie)=>{ie&&J!==ie&&(d.value=!1)}),Me(()=>{window.addEventListener("resize",ee),ee(),N()}),(J,ie)=>{const me=Qe,ce=Ko,ne=sl,_e=tn,Ne=wl,te=Al,Xe=Fl,Pe=ms,nt=Gs,qe=Zs,At=li,Mt=fi,Y=Ri,ue=rr,fe=vr,le=_r,he=wr,be=Gn,Se=$r,Ee=eu,Ge=au;return s(),D(Ge,null,{default:y(()=>[C(nt,{class:T(["mo-sidebar pt-5",[{open:e(d)},{minimized:e(c)}]]),ui:{header:[{"px-0! pb-3! items-center!":e(c)},"flex-col px-3 items-start grow h-full! pb-4"],body:"hide-el"}},{header:y(()=>[C(me,{icon:"mosy:bars-staggered",variant:"subtle",color:"secondary",size:"xl",class:"mo-nav-toggle mo-nav-toggle-top p-[4px]!",onClick:ie[0]||(ie[0]=Ye=>W()),ui:{leadingIcon:"size-5"}}),_("div",{class:T(["flex items-center gap-1.5 px-1 pt-8 pb-2 mo-nav-logo justify-between w-full pr-[5px]",{"px-2.5! flex-col! gap-4!":e(c)}])},[C(ce,{showLabel:!e(c)},null,8,["showLabel"]),C(ne,{variant:"round",class:T(["ml-auto shrink-0",{"ml-0!":e(c)}])},null,8,["class"])],2),_("div",{class:T(["w-full flex flex-col gap-1.5 items-center grow mo-sidebar-body",{"px-2.5!":e(c)},{"mt-0!":!e(m)&&!e(b)&&e(z)}])},[_("div",{class:T(["pt-3 mb-1 w-full mo-main-nav",{"self-start pt-0!":e(c)}])},[C(_e,{items:e(M),orientation:"vertical",class:T(["space-y-0.5",{minimized:e(c)}])},null,8,["items","class"])],2),_("div",nu,[e(m)?(s(),D(Ne,{key:0,showLabel:!e(c),showSolo:!e(b),class:T([{"mo-work-time-button-solo":!e(b)&&!e(c)},{"mo-work-time-button-solo-minimized":!e(b)&&e(c)}])},null,8,["showLabel","showSolo","class"])):B("",!0),e(b)?(s(),D(te,{key:1,class:"max-mobile-menu:mb-0!",showLabel:!e(c)},null,8,["showLabel"])):B("",!0),e(m)||e(b)||e(z)?(s(),O("div",{key:2,class:T(["pt-1 w-full mo-mobile-overflow-nav",{"pt-0!":!e(m)&&!e(b)&&e(z)},{"mb-1!":!e(m)&&!e(z)&&e(b)}])},[C(_e,{items:e(G),orientation:"vertical",class:T(["space-y-1.5 w-full px-2 mo-footer-mobile-nav mo-no-border pb-0! pt-2!",{"pt-0!":!e(m)&&!e(b)&&e(z)}])},null,8,["items","class"])],2)):B("",!0),C(Xe,{showLabel:!e(c)},null,8,["showLabel"]),C(Pe,{showLabel:!e(c),isMobile:e(pe)},null,8,["showLabel","isMobile"])])],2)]),_:1},8,["class","ui"]),_("div",ou,[C(_e,{items:e(H),orientation:"horizontal",class:"space-y-0.5 minimized"},{"menu-trailing":y(()=>[e(x)>0?(s(),O("span",lu,I(e(x)),1)):B("",!0)]),_:1},8,["items"])]),C(qe,{class:T(["mo-dashboard-panel max-w-[1920px]",{"menu-open":e(d)}])},{default:y(()=>[_("div",{class:"mo-menu-overlay",onClick:ie[1]||(ie[1]=Ye=>E())}),V(J.$slots,"default",{},void 0,!0)]),_:3},8,["class"]),C(At),C(Mt),C(Y),C(ue),C(fe),C(le),C(he),C(be,{open:e(X),enforced:"",onDone:e(u)},null,8,["open","onDone"]),C(Se),C(Ee)]),_:3})}}},ad=We(su,[["__scopeId","data-v-e540c7af"]]);export{ad as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.