263 lines
148 KiB
JavaScript
263 lines
148 KiB
JavaScript
var ic=Object.defineProperty;var ac=Object.getPrototypeOf;var lc=Reflect.get;var la=n=>{throw TypeError(n)};var cc=(n,t,e)=>t in n?ic(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var C=(n,t,e)=>cc(n,typeof t!="symbol"?t+"":t,e),Bs=(n,t,e)=>t.has(n)||la("Cannot "+e);var a=(n,t,e)=>(Bs(n,t,"read from private field"),e?e.call(n):t.get(n)),y=(n,t,e)=>t.has(n)?la("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),V=(n,t,e,r)=>(Bs(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),et=(n,t,e)=>(Bs(n,t,"access private method"),e);var ca=(n,t,e)=>lc(ac(n),e,t);import"./Bzak7iHL.js";import{h as Fn,i as za,j as uc,k as Ka,g as u,R as dc,H as fc,o as ua,m as da,p as Ls,N as ko,aw as hc,aT as gc,v as fa,G as vc,M as Hs,bi as pc,P as mc,ae as yc,b2 as bc,aS as Pi,bj as wc,z as Us,bk as xc,bl as _c,A as Pc,L as ha,bm as $e,I as Va,K as Ha,bn as Ws,bo as Sc,aQ as Cc,J as Oc,ax as Ac,D as G,c as z,F as nt,r as K,a as p,E as X,f as U,b0 as Z,a6 as fr,a7 as A,bp as ga,aA as rr,aZ as Ec,aY as va,a_ as Tc,ak as Fc,al as zt,a1 as Mc,u as S,aW as Ic,bh as sn,b as N,d as O,aX as kc,bq as Ua,s as D,br as Dc,bs as Nc,n as q,t as j,T as St,$ as Rc,ay as Bc}from"./m2dceAnU.js";import{c as qa,m as Lc,u as Wc,o as zc,s as At}from"./Db3dOJqt.js";import{B as Kc,i as yt}from"./DcegSV8N.js";import{c as L}from"./CS4xyx6M.js";import{e as Vc,h as Hc,B as or}from"./CM9au6ec.js";import{i as Uc,B as qc,f as Ya,g as F,h as Yc,t as Gc,j as Xc,k as jc,l as As,m as ce,n as Gn,o as Si,p as Ga,q as an,r as Dt,s as Mn,u as Xa,v as Ne,w as Zc,x as Jc,y as Qc,L as Ae,I as sr,c as ja,e as Za,d as $c,C as tu,a as eu,b as nu}from"./OSRdxUzr.js";import{a as Et,c as Qt,s as Y,r as Lo,d as Ja,e as pa,f as Qa,g as Do}from"./BtiMKAzw.js";import{p as b,b as On,r as rt,s as wt}from"./CvosxF64.js";import{B as $a}from"./D4Z6sX8n.js";import{o as Ft}from"./DKU_2deH.js";const ru=Symbol("NaN");function ou(n,t,e){Fn&&za();var r=new Kc(n),o=!uc();Ka(()=>{var i=t();i!==i&&(i=ru),o&&i!==null&&typeof i=="object"&&(i={}),r.ensure(i,e)})}function hn(n,t){return t}function su(n,t,e){for(var r=[],o=t.length,i,s=t.length,l=0;l<o;l++){let f=t[l];Ha(f,()=>{if(i){if(i.pending.delete(f),i.done.add(f),i.pending.size===0){var v=n.outrogroups;qs(Pi(i.done)),v.delete(i),v.size===0&&(n.outrogroups=null)}}else s-=1},!1)}if(s===0){var c=r.length===0&&e!==null;if(c){var d=e,h=d.parentNode;Cc(h),h.append(d),n.items.clear()}qs(t,!c)}else i={pending:new Set(t),done:new Set},(n.outrogroups??(n.outrogroups=new Set)).add(i)}function qs(n,t=!0){for(var e=0;e<n.length;e++)Oc(n[e],t)}var ma;function tn(n,t,e,r,o,i=null){var s=n,l=new Map;Fn&&za();var c=null,d=yc(()=>{var w=e();return bc(w)?w:w==null?[]:Pi(w)}),h,f=!0;function v(){g.fallback=c,iu(g,h,s,t,r),c!==null&&(h.length===0?(c.f&$e)===0?Va(c):(c.f^=$e,ur(c,null,s)):Ha(c,()=>{c=null}))}var m=Ka(()=>{h=u(d);var w=h.length;let _=!1;if(Fn){var P=dc(s)===fc;P!==(w===0)&&(s=ua(),da(s),Ls(!1),_=!0)}for(var T=new Set,I=vc,E=mc(),M=0;M<w;M+=1){Fn&&ko.nodeType===hc&&ko.data===gc&&(s=ko,_=!0,Ls(!1));var R=h[M],k=r(R,M),H=f?null:l.get(k);H?(H.v&&fa(H.v,R),H.i&&fa(H.i,M),E&&I.unskip_effect(H.e)):(H=au(l,f?s:ma??(ma=ha()),R,k,M,o,t,e),f||(H.e.f|=$e),l.set(k,H)),T.add(k)}if(w===0&&i&&!c&&(f?c=Hs(()=>i(s)):(c=Hs(()=>i(ma??(ma=ha()))),c.f|=$e)),w>T.size&&pc(),Fn&&w>0&&da(ua()),!f)if(E){for(const[ot,Q]of l)T.has(ot)||I.skip_effect(Q.e);I.oncommit(v),I.ondiscard(()=>{})}else v();_&&Ls(!0),u(d)}),g={effect:m,items:l,outrogroups:null,fallback:c};f=!1,Fn&&(s=ko)}function ir(n){for(;n!==null&&(n.f&Sc)===0;)n=n.next;return n}function iu(n,t,e,r,o){var H;var i=t.length,s=n.items,l=ir(n.effect.first),c,d=null,h=[],f=[],v,m,g,w;for(w=0;w<i;w+=1){if(v=t[w],m=o(v,w),g=s.get(m).e,n.outrogroups!==null)for(const ot of n.outrogroups)ot.pending.delete(g),ot.done.delete(g);if((g.f&$e)!==0)if(g.f^=$e,g===l)ur(g,null,e);else{var _=d?d.next:l;g===n.effect.last&&(n.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),qe(n,d,g),qe(n,g,_),ur(g,_,e),d=g,h=[],f=[],l=ir(d.next);continue}if((g.f&Ws)!==0&&Va(g),g!==l){if(c!==void 0&&c.has(g)){if(h.length<f.length){var P=f[0],T;d=P.prev;var I=h[0],E=h[h.length-1];for(T=0;T<h.length;T+=1)ur(h[T],P,e);for(T=0;T<f.length;T+=1)c.delete(f[T]);qe(n,I.prev,E.next),qe(n,d,I),qe(n,E,P),l=P,d=E,w-=1,h=[],f=[]}else c.delete(g),ur(g,l,e),qe(n,g.prev,g.next),qe(n,g,d===null?n.effect.first:d.next),qe(n,d,g),d=g;continue}for(h=[],f=[];l!==null&&l!==g;)(c??(c=new Set)).add(l),f.push(l),l=ir(l.next);if(l===null)continue}(g.f&$e)===0&&h.push(g),d=g,l=ir(g.next)}if(n.outrogroups!==null){for(const ot of n.outrogroups)ot.pending.size===0&&(qs(Pi(ot.done)),(H=n.outrogroups)==null||H.delete(ot));n.outrogroups.size===0&&(n.outrogroups=null)}if(l!==null||c!==void 0){var M=[];if(c!==void 0)for(g of c)(g.f&Ws)===0&&M.push(g);for(;l!==null;)(l.f&Ws)===0&&l!==n.fallback&&M.push(l),l=ir(l.next);var R=M.length;if(R>0){var k=null;su(n,M,k)}}}function au(n,t,e,r,o,i,s,l){var c=(s&xc)!==0?(s&_c)===0?Pc(e,!1,!1):Us(e):null,d=(s&wc)!==0?Us(o):null;return{v:c,i:d,e:Hs(()=>(i(t,c??e,d??o,l),()=>{n.delete(r)}))}}function ur(n,t,e){if(n.nodes)for(var r=n.nodes.start,o=n.nodes.end,i=t&&(t.f&$e)===0?t.nodes.start:e;r!==null;){var s=Ac(r);if(i.before(r),r===o)return;r=s}}function qe(n,t,e){t===null?n.effect.first=e:t.next=e,e===null?n.effect.last=t:e.prev=t}var lu=U('<div data-slot="table-container" class="relative w-full overflow-x-auto"><table><!></table></div>');function cu(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=lu(),i=z(o);Et(i,l=>({"data-slot":"table",class:l,...r}),[()=>Qt("w-full caption-bottom text-sm",t.class)]);var s=z(i);Y(s,()=>t.children??nt),K(i),On(i,l=>e(l),()=>e()),K(o),p(n,o),X()}var uu=U("<tbody><!></tbody>");function du(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=uu();Et(o,s=>({"data-slot":"table-body",class:s,...r}),[()=>Qt("[&_tr:last-child]:border-0",t.class)]);var i=z(o);Y(i,()=>t.children??nt),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var fu=U("<td><!></td>");function Wt(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=fu();Et(o,s=>({"data-slot":"table-cell",class:s,...r}),[()=>Qt("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",t.class)]);var i=z(o);Y(i,()=>t.children??nt),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var hu=U("<th><!></th>");function Ut(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=hu();Et(o,s=>({"data-slot":"table-head",class:s,...r}),[()=>Qt("text-foreground h-10 bg-clip-padding px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0",t.class)]);var i=z(o);Y(i,()=>t.children??nt),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var gu=U("<thead><!></thead>");function vu(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=gu();Et(o,s=>({"data-slot":"table-header",class:s,...r}),[()=>Qt("[&_tr]:border-b",t.class)]);var i=z(o);Y(i,()=>t.children??nt),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var pu=U("<tr><!></tr>");function zs(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=pu();Et(o,s=>({"data-slot":"table-row",class:s,...r}),[()=>Qt("hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t.class)]);var i=z(o);Y(i,()=>t.children??nt),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}function An(n){let t=Z(fr(n));return{[qc]:!0,[Uc]:!0,get current(){return u(t)},set current(e){A(t,e,!0)}}}An.from=Ya;An.with=F;An.flatten=Yc;An.readonly=Gc;An.isBox=Xc;An.isWritableBox=jc;const tl=typeof window<"u"?window:void 0;function mu(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var ge,ve,Ee,ns,le,dr,Wo;const Vi=class Vi extends Map{constructor(e){super();y(this,le);y(this,ge,new Map);y(this,ve,Z(0));y(this,Ee,Z(0));y(this,ns,ga||-1);if(e){for(var[r,o]of e)super.set(r,o);a(this,Ee).v=super.size}}has(e){var r=a(this,ge),o=r.get(e);if(o===void 0){var i=super.get(e);if(i!==void 0)o=et(this,le,dr).call(this,0),r.set(e,o);else return u(a(this,ve)),!1}return u(o),!0}forEach(e,r){et(this,le,Wo).call(this),super.forEach(e,r)}get(e){var r=a(this,ge),o=r.get(e);if(o===void 0){var i=super.get(e);if(i!==void 0)o=et(this,le,dr).call(this,0),r.set(e,o);else{u(a(this,ve));return}}return u(o),super.get(e)}set(e,r){var f;var o=a(this,ge),i=o.get(e),s=super.get(e),l=super.set(e,r),c=a(this,ve);if(i===void 0)i=et(this,le,dr).call(this,0),o.set(e,i),A(a(this,Ee),super.size),rr(c);else if(s!==r){rr(i);var d=c.reactions===null?null:new Set(c.reactions),h=d===null||!((f=i.reactions)!=null&&f.every(v=>d.has(v)));h&&rr(c)}return l}delete(e){var r=a(this,ge),o=r.get(e),i=super.delete(e);return o!==void 0&&(r.delete(e),A(a(this,Ee),super.size),A(o,-1),rr(a(this,ve))),i}clear(){if(super.size!==0){super.clear();var e=a(this,ge);A(a(this,Ee),0);for(var r of e.values())A(r,-1);rr(a(this,ve)),e.clear()}}keys(){return u(a(this,ve)),super.keys()}values(){return et(this,le,Wo).call(this),super.values()}entries(){return et(this,le,Wo).call(this),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return u(a(this,Ee)),super.size}};ge=new WeakMap,ve=new WeakMap,Ee=new WeakMap,ns=new WeakMap,le=new WeakSet,dr=function(e){return ga===a(this,ns)?Z(e):Us(e)},Wo=function(){u(a(this,ve));var e=a(this,ge);if(a(this,Ee).v!==e.size){for(var r of ca(Vi.prototype,this,"keys").call(this))if(!e.has(r)){var o=et(this,le,dr).call(this,0);e.set(r,o)}}for([,o]of a(this,ge))u(o)};let Ys=Vi;var kn,pr;class yu{constructor(t={}){y(this,kn);y(this,pr);const{window:e=tl,document:r=e==null?void 0:e.document}=t;e!==void 0&&(V(this,kn,r),V(this,pr,qa(o=>{const i=Ft(e,"focusin",o),s=Ft(e,"focusout",o);return()=>{i(),s()}})))}get current(){var t;return(t=a(this,pr))==null||t.call(this),a(this,kn)?mu(a(this,kn)):null}}kn=new WeakMap,pr=new WeakMap;new yu;function bu(n){return typeof n=="function"}var mr,Te;class ln{constructor(t){y(this,mr);y(this,Te);V(this,mr,t),V(this,Te,Symbol(t))}get key(){return a(this,Te)}exists(){return Ec(a(this,Te))}get(){const t=va(a(this,Te));if(t===void 0)throw new Error(`Context "${a(this,mr)}" not found`);return t}getOr(t){const e=va(a(this,Te));return e===void 0?t:e}set(t){return Tc(a(this,Te),t)}}mr=new WeakMap,Te=new WeakMap;function wu(n,t){switch(n){case"post":zt(t);break;case"pre":Fc(t);break}}function el(n,t,e,r={}){const{lazy:o=!1}=r;let i=!o,s=Array.isArray(n)?[]:void 0;wu(t,()=>{const l=Array.isArray(n)?n.map(d=>d()):n();if(!i){i=!0,s=l;return}const c=Mc(()=>e(l,s));return s=l,c})}function Nt(n,t,e){el(n,"post",t,e)}function xu(n,t,e){el(n,"pre",t,e)}Nt.pre=xu;function ya(n){return bu(n)?n():n}var Ye,Dn,Nn,Rn,Ge,rs,os,Bn;class _u{constructor(t,e={box:"border-box"}){y(this,Ye,{width:0,height:0});y(this,Dn,!1);y(this,Nn);y(this,Rn);y(this,Ge);y(this,rs,S(()=>{var t;return(t=u(a(this,Bn)))==null||t(),this.getSize().width}));y(this,os,S(()=>{var t;return(t=u(a(this,Bn)))==null||t(),this.getSize().height}));y(this,Bn,S(()=>{const t=ya(a(this,Rn));if(t)return qa(e=>{if(!a(this,Ge))return;const r=new(a(this,Ge)).ResizeObserver(o=>{V(this,Dn,!0);for(const i of o){const s=a(this,Nn).box==="content-box"?i.contentBoxSize:i.borderBoxSize,l=Array.isArray(s)?s:[s];a(this,Ye).width=l.reduce((c,d)=>Math.max(c,d.inlineSize),0),a(this,Ye).height=l.reduce((c,d)=>Math.max(c,d.blockSize),0)}e()});return r.observe(t),()=>{V(this,Dn,!1),r.disconnect()}})}));V(this,Ge,e.window??tl),V(this,Nn,e),V(this,Rn,t),V(this,Ye,{width:0,height:0})}calculateSize(){const t=ya(a(this,Rn));if(!t||!a(this,Ge))return;const e=t.offsetWidth,r=t.offsetHeight;if(a(this,Nn).box==="border-box")return{width:e,height:r};const o=a(this,Ge).getComputedStyle(t),i=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom),l=parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth),c=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),d=e-i-l,h=r-s-c;return{width:d,height:h}}getSize(){return a(this,Dn)?a(this,Ye):this.calculateSize()??a(this,Ye)}get current(){var t;return(t=u(a(this,Bn)))==null||t(),this.getSize()}get width(){return u(a(this,rs))}get height(){return u(a(this,os))}}Ye=new WeakMap,Dn=new WeakMap,Nn=new WeakMap,Rn=new WeakMap,Ge=new WeakMap,rs=new WeakMap,os=new WeakMap,Bn=new WeakMap;function Zn(n){zt(()=>()=>{n()})}function Pu(n,t){return setTimeout(t,n)}function Re(n){Ic().then(n)}const Su=1,Cu=9,Ou=11;function Gs(n){return As(n)&&n.nodeType===Su&&typeof n.nodeName=="string"}function nl(n){return As(n)&&n.nodeType===Cu}function Au(n){var t;return As(n)&&((t=n.constructor)==null?void 0:t.name)==="VisualViewport"}function Eu(n){return As(n)&&n.nodeType!==void 0}function rl(n){return Eu(n)&&n.nodeType===Ou&&"host"in n}function Tu(n,t){var r;if(!n||!t||!Gs(n)||!Gs(t))return!1;const e=(r=t.getRootNode)==null?void 0:r.call(t);if(n===t||n.contains(t))return!0;if(e&&rl(e)){let o=t;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function Fo(n){return nl(n)?n:Au(n)?n.document:(n==null?void 0:n.ownerDocument)??document}function Ci(n){var t;return rl(n)?Ci(n.host):nl(n)?n.defaultView??window:Gs(n)?((t=n.ownerDocument)==null?void 0:t.defaultView)??window:window}function Fu(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var yr;class Oi{constructor(t){C(this,"element");y(this,yr,S(()=>this.element.current?this.element.current.getRootNode()??document:document));C(this,"getDocument",()=>Fo(this.root));C(this,"getWindow",()=>this.getDocument().defaultView??window);C(this,"getActiveElement",()=>Fu(this.root));C(this,"isActiveElement",t=>t===this.getActiveElement());C(this,"querySelector",t=>this.root?this.root.querySelector(t):null);C(this,"querySelectorAll",t=>this.root?this.root.querySelectorAll(t):[]);C(this,"setTimeout",(t,e)=>this.getWindow().setTimeout(t,e));C(this,"clearTimeout",t=>this.getWindow().clearTimeout(t));typeof t=="function"?this.element=F(t):this.element=t}get root(){return u(a(this,yr))}set root(t){A(a(this,yr),t)}getElementById(t){return this.root.getElementById(t)}}yr=new WeakMap;const gr="ArrowDown",Ai="ArrowLeft",Ei="ArrowRight",Uo="ArrowUp",ol="End",Ti="Enter",Mu="Escape",sl="Home",Iu="PageDown",ku="PageUp",Es=" ",Du="Tab";function Nu(n){return window.getComputedStyle(n).getPropertyValue("direction")}function Ru(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Ai:Ei,vertical:gr}[t]}function Bu(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Ei:Ai,vertical:Uo}[t]}function Lu(n="ltr",t="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:Ru(n,t),prevKey:Bu(n,t)}}const il=typeof document<"u",ba=Wu();function Wu(){var n,t;return il&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Le(n){return n instanceof HTMLElement}function Xs(n){return n instanceof Element}function al(n){return n instanceof Element||n instanceof SVGElement}function zu(n){return n!==null}function Ku(n){return n instanceof HTMLInputElement&&"select"in n}var Bt,Fe;class Vu{constructor(t){y(this,Bt);y(this,Fe,An(null));V(this,Bt,t)}getCandidateNodes(){return a(this,Bt).rootNode.current?a(this,Bt).candidateSelector?Array.from(a(this,Bt).rootNode.current.querySelectorAll(a(this,Bt).candidateSelector)):a(this,Bt).candidateAttr?Array.from(a(this,Bt).rootNode.current.querySelectorAll(`[${a(this,Bt).candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){var e;const t=this.getCandidateNodes();t.length&&((e=t[0])==null||e.focus())}handleKeydown(t,e,r=!1){var g,w;const o=a(this,Bt).rootNode.current;if(!o||!t)return;const i=this.getCandidateNodes();if(!i.length)return;const s=i.indexOf(t),l=Nu(o),{nextKey:c,prevKey:d}=Lu(l,a(this,Bt).orientation.current),h=a(this,Bt).loop.current,f={[c]:s+1,[d]:s-1,[sl]:0,[ol]:i.length-1};if(r){const _=c===gr?Ei:gr,P=d===Uo?Ai:Uo;f[_]=s+1,f[P]=s-1}let v=f[e.key];if(v===void 0)return;e.preventDefault(),v<0&&h?v=i.length-1:v===i.length&&h&&(v=0);const m=i[v];if(m)return m.focus(),a(this,Fe).current=m.id,(w=(g=a(this,Bt)).onCandidateFocus)==null||w.call(g,m),m}getTabIndex(t){const e=this.getCandidateNodes(),r=a(this,Fe).current!==null;return t&&!r&&e[0]===t?(a(this,Fe).current=t.id,0):(t==null?void 0:t.id)===a(this,Fe).current?0:-1}setCurrentTabStopId(t){a(this,Fe).current=t}focusCurrentTabStop(){var r;const t=a(this,Fe).current;if(!t)return;const e=(r=a(this,Bt).rootNode.current)==null?void 0:r.querySelector(`#${t}`);!e||!Le(e)||e.focus()}}Bt=new WeakMap,Fe=new WeakMap;var Ln,gn,Be,js,zo;class Hu{constructor(t){y(this,Be);y(this,Ln);y(this,gn,null);V(this,Ln,t),Zn(()=>et(this,Be,js).call(this))}run(t){et(this,Be,js).call(this);const e=a(this,Ln).ref.current;if(e){if(typeof e.getAnimations!="function"){et(this,Be,zo).call(this,t);return}V(this,gn,window.requestAnimationFrame(()=>{const r=e.getAnimations();if(r.length===0){et(this,Be,zo).call(this,t);return}Promise.allSettled(r.map(o=>o.finished)).then(()=>{et(this,Be,zo).call(this,t)})}))}}}Ln=new WeakMap,gn=new WeakMap,Be=new WeakSet,js=function(){a(this,gn)&&(window.cancelAnimationFrame(a(this,gn)),V(this,gn,null))},zo=function(t){const e=()=>{t()};a(this,Ln).afterTick?Re(e):e()};var pe,br,wr,vn;class Zs{constructor(t){y(this,pe);y(this,br);y(this,wr);y(this,vn,Z(!1));V(this,pe,t),A(a(this,vn),t.open.current,!0),V(this,br,t.enabled??!0),V(this,wr,new Hu({ref:a(this,pe).ref,afterTick:a(this,pe).open})),Nt(()=>a(this,pe).open.current,e=>{e&&A(a(this,vn),!0),a(this,br)&&a(this,wr).run(()=>{var r,o;e===a(this,pe).open.current&&(a(this,pe).open.current||A(a(this,vn),!1),(o=(r=a(this,pe)).onComplete)==null||o.call(r))})})}get shouldRender(){return u(a(this,vn))}}pe=new WeakMap,br=new WeakMap,wr=new WeakMap,vn=new WeakMap;function bt(){}const Uu=Ga({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),Pn=new ln("Dialog.Root | AlertDialog.Root");var xr,_r,Pr,Sr,Cr,Or,Ar,Er,Tr,Fr,Mr;const Hi=class Hi{constructor(t,e){C(this,"opts");y(this,xr,Z(null));y(this,_r,Z(null));y(this,Pr,Z(null));y(this,Sr,Z(null));y(this,Cr,Z(void 0));y(this,Or,Z(void 0));y(this,Ar,Z(void 0));y(this,Er,Z(void 0));y(this,Tr,Z(null));y(this,Fr,Z(0));C(this,"depth");C(this,"parent");C(this,"contentPresence");C(this,"overlayPresence");C(this,"getBitsAttr",t=>Uu.getAttr(t,this.opts.variant.current));y(this,Mr,S(()=>({"data-state":Si(this.opts.open.current)})));this.opts=t,this.parent=e,this.depth=e?e.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Zs({ref:F(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Zs({ref:F(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Nt(()=>this.opts.open.current,r=>{this.parent&&(r?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),Zn(()=>{var r;this.opts.open.current&&((r=this.parent)==null||r.decrementNested())})}static create(t){const e=Pn.getOr(null);return Pn.set(new Hi(t,e))}get triggerNode(){return u(a(this,xr))}set triggerNode(t){A(a(this,xr),t,!0)}get contentNode(){return u(a(this,_r))}set contentNode(t){A(a(this,_r),t,!0)}get overlayNode(){return u(a(this,Pr))}set overlayNode(t){A(a(this,Pr),t,!0)}get descriptionNode(){return u(a(this,Sr))}set descriptionNode(t){A(a(this,Sr),t,!0)}get contentId(){return u(a(this,Cr))}set contentId(t){A(a(this,Cr),t,!0)}get titleId(){return u(a(this,Or))}set titleId(t){A(a(this,Or),t,!0)}get triggerId(){return u(a(this,Ar))}set triggerId(t){A(a(this,Ar),t,!0)}get descriptionId(){return u(a(this,Er))}set descriptionId(t){A(a(this,Er),t,!0)}get cancelNode(){return u(a(this,Tr))}set cancelNode(t){A(a(this,Tr),t,!0)}get nestedOpenCount(){return u(a(this,Fr))}set nestedOpenCount(t){A(a(this,Fr),t,!0)}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}incrementNested(){var t;this.nestedOpenCount++,(t=this.parent)==null||t.incrementNested()}decrementNested(){var t;this.nestedOpenCount!==0&&(this.nestedOpenCount--,(t=this.parent)==null||t.decrementNested())}get sharedProps(){return u(a(this,Mr))}set sharedProps(t){A(a(this,Mr),t)}};xr=new WeakMap,_r=new WeakMap,Pr=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,Or=new WeakMap,Ar=new WeakMap,Er=new WeakMap,Tr=new WeakMap,Fr=new WeakMap,Mr=new WeakMap;let Js=Hi;var Ir;const Ui=class Ui{constructor(t,e){C(this,"opts");C(this,"root");C(this,"attachment");y(this,Ir,S(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}static create(t){return new Ui(t,Pn.get())}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===Es||t.key===Ti)&&(t.preventDefault(),this.root.handleClose())}get props(){return u(a(this,Ir))}set props(t){A(a(this,Ir),t)}};Ir=new WeakMap;let Qs=Ui;var kr;const qi=class qi{constructor(t,e){C(this,"opts");C(this,"root");C(this,"attachment");y(this,kr,S(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.root.titleId=this.opts.id.current,this.attachment=ce(this.opts.ref),Nt.pre(()=>this.opts.id.current,r=>{this.root.titleId=r})}static create(t){return new qi(t,Pn.get())}get props(){return u(a(this,kr))}set props(t){A(a(this,kr),t)}};kr=new WeakMap;let $s=qi;var Dr;const Yi=class Yi{constructor(t,e){C(this,"opts");C(this,"root");C(this,"attachment");y(this,Dr,S(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.root.descriptionId=this.opts.id.current,this.attachment=ce(this.opts.ref,r=>{this.root.descriptionNode=r}),Nt.pre(()=>this.opts.id.current,r=>{this.root.descriptionId=r})}static create(t){return new Yi(t,Pn.get())}get props(){return u(a(this,Dr))}set props(t){A(a(this,Dr),t)}};Dr=new WeakMap;let ti=Yi;var Nr,Rr;const Gi=class Gi{constructor(t,e){C(this,"opts");C(this,"root");C(this,"attachment");y(this,Nr,S(()=>({open:this.root.opts.open.current})));y(this,Rr,S(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":Gn(this.root.nestedOpenCount>0),"data-nested":Gn(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref,r=>{this.root.contentNode=r,this.root.contentId=r==null?void 0:r.id})}static create(t){return new Gi(t,Pn.get())}get snippetProps(){return u(a(this,Nr))}set snippetProps(t){A(a(this,Nr),t)}get props(){return u(a(this,Rr))}set props(t){A(a(this,Rr),t)}get shouldRender(){return this.root.contentPresence.shouldRender}};Nr=new WeakMap,Rr=new WeakMap;let ei=Gi;var Br,Lr;const Xi=class Xi{constructor(t,e){C(this,"opts");C(this,"root");C(this,"attachment");y(this,Br,S(()=>({open:this.root.opts.open.current})));y(this,Lr,S(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Gn(this.root.nestedOpenCount>0),"data-nested":Gn(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref,r=>this.root.overlayNode=r)}static create(t){return new Xi(t,Pn.get())}get snippetProps(){return u(a(this,Br))}set snippetProps(t){A(a(this,Br),t)}get props(){return u(a(this,Lr))}set props(t){A(a(this,Lr),t)}get shouldRender(){return this.root.overlayPresence.shouldRender}};Br=new WeakMap,Lr=new WeakMap;let ni=Xi;var qu=U("<div><!></div>");function Yu(n,t){const e=sn();G(t,!0);let r=b(t,"id",19,()=>an(e)),o=b(t,"ref",15,null),i=b(t,"level",3,2),s=rt(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const l=$s.create({id:F(()=>r()),level:F(()=>i()),ref:F(()=>o(),m=>o(m))}),c=S(()=>Dt(s,l.props));var d=N(),h=O(d);{var f=m=>{var g=N(),w=O(g);Y(w,()=>t.child,()=>({props:u(c)})),p(m,g)},v=m=>{var g=qu();Et(g,()=>({...u(c)}));var w=z(g);Y(w,()=>t.children??nt),K(g),p(m,g)};yt(h,m=>{t.child?m(f):m(v,!1)})}p(n,d),X()}function Gu(n,t){var e=N(),r=O(e);ou(r,()=>t.children,o=>{var i=N(),s=O(i);Y(s,()=>t.children??nt),p(o,i)}),p(n,e)}const Xu=new ln("BitsConfig");function ju(){const n=new Zu(null,{});return Xu.getOr(n).opts}class Zu{constructor(t,e){C(this,"opts");const r=Ju(t,e);this.opts={defaultPortalTo:r(o=>o.defaultPortalTo),defaultLocale:r(o=>o.defaultLocale)}}}function Ju(n,t){return e=>F(()=>{var i,s;const o=(i=e(t))==null?void 0:i.current;if(o!==void 0)return o;if(n!==null)return(s=e(n.opts))==null?void 0:s.current})}function Qu(n,t){return e=>{const r=ju();return F(()=>{const o=e();if(o!==void 0)return o;const i=n(r).current;return i!==void 0?i:t})}}const $u=Qu(n=>n.defaultPortalTo,"body");function ll(n,t){G(t,!0);const e=$u(()=>t.to),r=kc();let o=S(i);function i(){if(!il||t.disabled)return null;let f=null;return typeof e.current=="string"?f=document.querySelector(e.current):f=e.current,f}let s;function l(){s&&(Wc(s),s=null)}Nt([()=>u(o),()=>t.disabled],([f,v])=>{if(!f||v){l();return}return s=Lc(Gu,{target:f,props:{children:t.children},context:r}),()=>{l()}});var c=N(),d=O(c);{var h=f=>{var v=N(),m=O(v);Y(m,()=>t.children??nt),p(f,v)};yt(d,f=>{t.disabled&&f(h)})}p(n,c),X()}class td{constructor(t,e={bubbles:!0,cancelable:!0}){C(this,"eventName");C(this,"options");this.eventName=t,this.options=e}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,e){const r=this.createEvent(e);return t.dispatchEvent(r),r}listen(t,e,r){const o=i=>{e(i)};return Ft(t,this.eventName,o,r)}}function wa(n,t=500){let e=null;const r=(...o)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{n(...o)},t)};return r.destroy=()=>{e!==null&&(clearTimeout(e),e=null)},r}function cl(n,t){return n===t||n.contains(t)}function ul(n){return(n==null?void 0:n.ownerDocument)??document}function ed(n,t){const{clientX:e,clientY:r}=n,o=t.getBoundingClientRect();return e<o.left||e>o.right||r<o.top||r>o.bottom}const nd=[Ti,Es],rd=[gr,ku,sl],dl=[Uo,Iu,ol],od=[...rd,...dl];function xa(n){return n.pointerType==="mouse"}function sd(n,{select:t=!1}={}){if(!n||!n.focus)return;const e=Fo(n);if(e.activeElement===n)return;const r=e.activeElement;n.focus({preventScroll:!0}),n!==r&&Ku(n)&&t&&n.select()}function id(n,{select:t=!1}={},e){const r=e();for(const o of n)if(sd(o,{select:t}),e()!==r)return!0}let ar=Z(!1);const ee=class ee{constructor(){zt(()=>(ee._refs===0&&(ee._cleanup=Ua(()=>{const t=[],e=o=>{A(ar,!1)},r=o=>{A(ar,!0)};return t.push(Ft(document,"pointerdown",e,{capture:!0}),Ft(document,"pointermove",e,{capture:!0}),Ft(document,"keydown",r,{capture:!0})),Mn(...t)})),ee._refs++,()=>{var t;ee._refs--,ee._refs===0&&(A(ar,!1),(t=ee._cleanup)==null||t.call(ee))}))}get current(){return u(ar)}set current(t){A(ar,t,!0)}};C(ee,"_refs",0),C(ee,"_cleanup");let ri=ee;/*!
|
||
* tabbable 6.4.0
|
||
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
||
*/var fl=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],qo=fl.join(","),hl=typeof Element>"u",Sn=hl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Yo=!hl&&Element.prototype.getRootNode?function(n){var t;return n==null||(t=n.getRootNode)===null||t===void 0?void 0:t.call(n)}:function(n){return n==null?void 0:n.ownerDocument},Go=function(t,e){var r;e===void 0&&(e=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Go(t.parentNode));return s},ad=function(t){var e,r=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return r===""||r==="true"},gl=function(t,e,r){if(Go(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(qo));return e&&Sn.call(t,qo)&&o.unshift(t),o=o.filter(r),o},Xo=function(t,e,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Go(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),c=l.length?l:s.children,d=Xo(c,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else{var h=Sn.call(s,qo);h&&r.filter(s)&&(e||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),v=!Go(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&v){var m=Xo(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return o},vl=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},pl=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ad(t))&&!vl(t)?0:t.tabIndex},ld=function(t,e){var r=pl(t);return r<0&&e&&!vl(t)?0:r},cd=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},ml=function(t){return t.tagName==="INPUT"},ud=function(t){return ml(t)&&t.type==="hidden"},dd=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return e},fd=function(t,e){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===e)return t[r]},hd=function(t){if(!t.name)return!0;var e=t.form||Yo(t),r=function(l){return e.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=fd(o,t.form);return!i||i===t},gd=function(t){return ml(t)&&t.type==="radio"},vd=function(t){return gd(t)&&!hd(t)},pd=function(t){var e,r=t&&Yo(t),o=(e=r)===null||e===void 0?void 0:e.host,i=!1;if(r&&r!==t){var s,l,c;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var d,h,f;r=Yo(o),o=(d=r)===null||d===void 0?void 0:d.host,i=!!((h=o)!==null&&h!==void 0&&(f=h.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},_a=function(t){var e=t.getBoundingClientRect(),r=e.width,o=e.height;return r===0&&o===0},md=function(t,e){var r=e.displayCheck,o=e.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var s=Sn.call(t,"details>summary:first-of-type"),l=s?t.parentElement:t;if(Sn.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var d=t.parentElement,h=Yo(t);if(d&&!d.shadowRoot&&o(d)===!0)return _a(t);t.assignedSlot?t=t.assignedSlot:!d&&h!==t.ownerDocument?t=h.host:t=d}t=c}if(pd(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _a(t);return!1},yd=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var r=0;r<e.children.length;r++){var o=e.children.item(r);if(o.tagName==="LEGEND")return Sn.call(e,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}e=e.parentElement}return!1},jo=function(t,e){return!(e.disabled||ud(e)||md(e,t)||dd(e)||yd(e))},oi=function(t,e){return!(vd(e)||pl(e)<0||!jo(t,e))},bd=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},yl=function(t){var e=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,c=ld(l,s),d=s?yl(o.candidates):l;c===0?s?e.push.apply(e,d):e.push(l):r.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:d})}),r.sort(cd).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(e)},bl=function(t,e){e=e||{};var r;return e.getShadowRoot?r=Xo([t],e.includeContainer,{filter:oi.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:bd}):r=gl(t,e.includeContainer,oi.bind(null,e)),yl(r)},wl=function(t,e){e=e||{};var r;return e.getShadowRoot?r=Xo([t],e.includeContainer,{filter:jo.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):r=gl(t,e.includeContainer,jo.bind(null,e)),r},Fi=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return Sn.call(t,qo)===!1?!1:oi(e,t)},wd=fl.concat("iframe:not([inert]):not([inert] *)").join(","),xl=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return Sn.call(t,wd)===!1?!1:jo(e,t)};function hr(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function xd(n,t){if(!Fi(n,hr()))return _d(n,t);const e=Fo(n),r=bl(e.body,hr());t==="prev"&&r.reverse();const o=r.indexOf(n);return o===-1?e.body:r.slice(o+1)[0]}function _d(n,t){const e=Fo(n);if(!xl(n,hr()))return e.body;const r=wl(e.body,hr());t==="prev"&&r.reverse();const o=r.indexOf(n);return o===-1?e.body:r.slice(o+1).find(s=>Fi(s,hr()))??e.body}function _l(n,t,e){const r=t.toLowerCase();if(r.endsWith(" ")){const f=r.slice(0,-1);if(n.filter(w=>w.toLowerCase().startsWith(f)).length<=1)return _l(n,f,e);const m=e==null?void 0:e.toLowerCase();if(m&&m.startsWith(f)&&m.charAt(f.length)===" "&&t.trim()===f)return e;const g=n.filter(w=>w.toLowerCase().startsWith(r));if(g.length>0){const w=e?n.indexOf(e):-1;return Pa(g,Math.max(w,0)).find(T=>T!==e)||e}}const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=i.toLowerCase(),l=e?n.indexOf(e):-1;let c=Pa(n,Math.max(l,0));i.length===1&&(c=c.filter(f=>f!==e));const h=c.find(f=>f==null?void 0:f.toLowerCase().startsWith(s));return h!==e?h:void 0}function Pa(n,t){return n.map((e,r)=>n[(t+r)%n.length])}const Pd={afterMs:1e4,onChange:bt};function Pl(n,t){const{afterMs:e,onChange:r,getWindow:o}={...Pd,...t};let i=null,s=Z(fr(n));function l(){return o().setTimeout(()=>{A(s,n,!0),r==null||r(n)},e)}return zt(()=>()=>{i&&o().clearTimeout(i)}),F(()=>u(s),c=>{A(s,c,!0),r==null||r(c),i&&o().clearTimeout(i),i=l()})}var Me,Ie,ss,is;class Sd{constructor(t){y(this,Me);y(this,Ie);y(this,ss,S(()=>a(this,Me).onMatch?a(this,Me).onMatch:t=>t.focus()));y(this,is,S(()=>a(this,Me).getCurrentItem?a(this,Me).getCurrentItem:a(this,Me).getActiveElement));V(this,Me,t),V(this,Ie,Pl("",{afterMs:1e3,getWindow:t.getWindow})),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,e){var c,d;if(!e.length)return;a(this,Ie).current=a(this,Ie).current+t;const r=u(a(this,is))(),o=((d=(c=e.find(h=>h===r))==null?void 0:c.textContent)==null?void 0:d.trim())??"",i=e.map(h=>{var f;return((f=h.textContent)==null?void 0:f.trim())??""}),s=_l(i,a(this,Ie).current,o),l=e.find(h=>{var f;return((f=h.textContent)==null?void 0:f.trim())===s});return l&&u(a(this,ss))(l),l}resetTypeahead(){a(this,Ie).current=""}get search(){return a(this,Ie).current}}Me=new WeakMap,Ie=new WeakMap,ss=new WeakMap,is=new WeakMap;var pn,Wr,Wn,Xe,on,si,ii;class Cd{constructor(t){y(this,on);y(this,pn);y(this,Wr);y(this,Wn);y(this,Xe,Z(null));V(this,pn,t),V(this,Wr,S(()=>a(this,pn).enabled())),V(this,Wn,Pl(!1,{afterMs:t.transitTimeout??300,onChange:e=>{var r,o;u(a(this,Wr))&&((o=(r=a(this,pn)).setIsPointerInTransit)==null||o.call(r,e))},getWindow:()=>Ci(a(this,pn).triggerNode())})),Nt([t.triggerNode,t.contentNode,t.enabled],([e,r,o])=>{if(!e||!r||!o)return;const i=l=>{et(this,on,ii).call(this,l,r)},s=l=>{et(this,on,ii).call(this,l,e)};return Mn(Ft(e,"pointerleave",i),Ft(r,"pointerleave",s))}),Nt(()=>u(a(this,Xe)),()=>{const e=o=>{var d,h;if(!u(a(this,Xe)))return;const i=o.target;if(!Xs(i))return;const s={x:o.clientX,y:o.clientY},l=((d=t.triggerNode())==null?void 0:d.contains(i))||((h=t.contentNode())==null?void 0:h.contains(i)),c=!Td(s,u(a(this,Xe)));l?et(this,on,si).call(this):c&&(et(this,on,si).call(this),t.onPointerExit())},r=Fo(t.triggerNode()??t.contentNode());if(r)return Ft(r,"pointermove",e)})}}pn=new WeakMap,Wr=new WeakMap,Wn=new WeakMap,Xe=new WeakMap,on=new WeakSet,si=function(){A(a(this,Xe),null),a(this,Wn).current=!1},ii=function(t,e){const r=t.currentTarget;if(!Le(r))return;const o={x:t.clientX,y:t.clientY},i=Od(o,r.getBoundingClientRect()),s=Ad(o,i),l=Ed(e.getBoundingClientRect()),c=Fd([...s,...l]);A(a(this,Xe),c,!0),a(this,Wn).current=!0};function Od(n,t){const e=Math.abs(t.top-n.y),r=Math.abs(t.bottom-n.y),o=Math.abs(t.right-n.x),i=Math.abs(t.left-n.x);switch(Math.min(e,r,o,i)){case i:return"left";case o:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ad(n,t,e=5){const r=e*1.5;switch(t){case"top":return[{x:n.x-e,y:n.y+e},{x:n.x,y:n.y-r},{x:n.x+e,y:n.y+e}];case"bottom":return[{x:n.x-e,y:n.y-e},{x:n.x,y:n.y+r},{x:n.x+e,y:n.y-e}];case"left":return[{x:n.x+e,y:n.y-e},{x:n.x-r,y:n.y},{x:n.x+e,y:n.y+e}];case"right":return[{x:n.x-e,y:n.y-e},{x:n.x+r,y:n.y},{x:n.x-e,y:n.y+e}]}}function Ed(n){const{top:t,right:e,bottom:r,left:o}=n;return[{x:o,y:t},{x:e,y:t},{x:e,y:r},{x:o,y:r}]}function Td(n,t){const{x:e,y:r}=n;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i].x,c=t[i].y,d=t[s].x,h=t[s].y;c>r!=h>r&&e<(d-l)*(r-c)/(h-c)+l&&(o=!o)}return o}function Fd(n){const t=n.slice();return t.sort((e,r)=>e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0),Md(t)}function Md(n){if(n.length<=1)return n.slice();const t=[];for(let r=0;r<n.length;r++){const o=n[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const e=[];for(let r=n.length-1;r>=0;r--){const o=n[r];for(;e.length>=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}return e.pop(),t.length===1&&e.length===1&&t[0].x===e[0].x&&t[0].y===e[0].y?t:t.concat(e)}const Id="data-context-menu-trigger",kd="data-context-menu-content",Dd=new ln("Menu.Root"),Mi=new ln("Menu.Root | Menu.Sub"),Sl=new ln("Menu.Content"),Nd=new td("bitsmenuopen",{bubbles:!1,cancelable:!0}),Rd=Ga({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});var zr,Kr;const ji=class ji{constructor(t){C(this,"opts");C(this,"isUsingKeyboard",new ri);y(this,zr,Z(!1));y(this,Kr,Z(!1));C(this,"getBitsAttr",t=>Rd.getAttr(t,this.opts.variant.current));this.opts=t}static create(t){const e=new ji(t);return Dd.set(e)}get ignoreCloseAutoFocus(){return u(a(this,zr))}set ignoreCloseAutoFocus(t){A(a(this,zr),t,!0)}get isPointerInTransit(){return u(a(this,Kr))}set isPointerInTransit(t){A(a(this,Kr),t,!0)}};zr=new WeakMap,Kr=new WeakMap;let ai=ji;var Vr,Hr;const Zi=class Zi{constructor(t,e,r){C(this,"opts");C(this,"root");C(this,"parentMenu");C(this,"contentId",F(()=>""));y(this,Vr,Z(null));C(this,"contentPresence");y(this,Hr,Z(null));this.opts=t,this.root=e,this.parentMenu=r,this.contentPresence=new Zs({ref:F(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&Nt(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}static create(t,e){return Mi.set(new Zi(t,e,null))}get contentNode(){return u(a(this,Vr))}set contentNode(t){A(a(this,Vr),t,!0)}get triggerNode(){return u(a(this,Hr))}set triggerNode(t){A(a(this,Hr),t,!0)}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}};Vr=new WeakMap,Hr=new WeakMap;let li=Zi;var Ur,qr,Yr,Gr,Xr,en,Cl,Ko,jr,Zr;const Ji=class Ji{constructor(t,e){y(this,en);C(this,"opts");C(this,"parentMenu");C(this,"rovingFocusGroup");C(this,"domContext");C(this,"attachment");y(this,Ur,Z(""));y(this,qr,0);y(this,Yr);y(this,Gr,Z(!1));y(this,Xr);C(this,"onCloseAutoFocus",t=>{var e,r;(r=(e=this.opts.onCloseAutoFocus).current)==null||r.call(e,t),!(t.defaultPrevented||a(this,Xr))&&this.parentMenu.triggerNode&&Fi(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())});y(this,jr,S(()=>({open:this.parentMenu.opts.open.current})));y(this,Zr,S(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Si(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment})));C(this,"popperProps",{onCloseAutoFocus:t=>this.onCloseAutoFocus(t)});this.opts=t,this.parentMenu=e,this.domContext=new Oi(t.ref),this.attachment=ce(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),e.contentId=t.id,V(this,Xr,t.isSub??!1),this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Cd({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>{var r;return this.parentMenu.opts.open.current&&!!((r=this.parentMenu.triggerNode)!=null&&r.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")))},onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),V(this,Yr,new Sd({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch),this.rovingFocusGroup=new Vu({rootNode:F(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:F(()=>"vertical")}),Nt(()=>this.parentMenu.contentNode,r=>{if(!r)return;const o=()=>{Re(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return Nd.listen(r,o)}),zt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(a(this,qr))})}static create(t){return Sl.set(new Ji(t,Mi.get()))}get search(){return u(a(this,Ur))}set search(t){A(a(this,Ur),t,!0)}get mounted(){return u(a(this,Gr))}set mounted(t){A(a(this,Gr),t,!0)}handleTabKeyDown(t){let e=this.parentMenu;for(;e.parentMenu!==null;)e=e.parentMenu;if(!e.triggerNode)return;t.preventDefault();const r=xd(e.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,e.onClose(),Re(()=>{r.focus(),Re(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){var d,h;if(t.defaultPrevented)return;if(t.key===Du){this.handleTabKeyDown(t);return}const e=t.target,r=t.currentTarget;if(!Le(e)||!Le(r))return;const o=((d=e.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`))==null?void 0:d.id)===this.parentMenu.contentId.current,i=t.ctrlKey||t.altKey||t.metaKey,s=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(e,t)||t.code==="Space")return;const c=et(this,en,Cl).call(this);o&&!i&&s&&a(this,Yr).call(this,t.key,c),((h=t.target)==null?void 0:h.id)===this.parentMenu.contentId.current&&od.includes(t.key)&&(t.preventDefault(),dl.includes(t.key)&&c.reverse(),id(c,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){var e,r;Xs(t.currentTarget)&&Xs(t.target)&&((r=(e=t.currentTarget).contains)!=null&&r.call(e,t.target)||(this.domContext.getWindow().clearTimeout(a(this,qr)),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Re(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return et(this,en,Ko).call(this)}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||et(this,en,Ko).call(this)||this.parentMenu.root.isUsingKeyboard.current)return;const e=this.parentMenu.contentNode;e==null||e.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!et(this,en,Ko).call(this)}handleInteractOutside(t){var r;if(!al(t.target))return;const e=(r=this.parentMenu.triggerNode)==null?void 0:r.id;if(t.target.id===e){t.preventDefault();return}t.target.closest(`#${e}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}get snippetProps(){return u(a(this,jr))}set snippetProps(t){A(a(this,jr),t)}get props(){return u(a(this,Zr))}set props(t){A(a(this,Zr),t)}};Ur=new WeakMap,qr=new WeakMap,Yr=new WeakMap,Gr=new WeakMap,Xr=new WeakMap,en=new WeakSet,Cl=function(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]},Ko=function(){return this.parentMenu.root.isPointerInTransit},jr=new WeakMap,Zr=new WeakMap;let ci=Ji;var zn,Jr;class Bd{constructor(t,e){C(this,"opts");C(this,"content");C(this,"attachment");y(this,zn,Z(!1));y(this,Jr,S(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":Xa(this.opts.disabled.current),"data-disabled":Gn(this.opts.disabled.current),"data-highlighted":u(a(this,zn))?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment})));this.opts=t,this.content=e,this.attachment=ce(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&xa(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!Le(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||xa(t)&&this.content.onItemLeave(t)}onfocus(t){Re(()=>{t.defaultPrevented||this.opts.disabled.current||A(a(this,zn),!0)})}onblur(t){Re(()=>{t.defaultPrevented||A(a(this,zn),!1)})}get props(){return u(a(this,Jr))}set props(t){A(a(this,Jr),t)}}zn=new WeakMap,Jr=new WeakMap;var Qr,as,Ol,$r;const Qi=class Qi{constructor(t,e){y(this,as);C(this,"opts");C(this,"item");C(this,"root");y(this,Qr,!1);y(this,$r,S(()=>Dt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown})));this.opts=t,this.item=e,this.root=e.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}static create(t){const e=new Bd(t,Sl.get());return new Qi(t,e)}onkeydown(t){const e=this.item.content.search!=="";if(!(this.item.opts.disabled.current||e&&t.key===Es)&&nd.includes(t.key)){if(!Le(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||et(this,as,Ol).call(this)}onpointerup(t){var e;if(!t.defaultPrevented&&!a(this,Qr)){if(!Le(t.currentTarget))return;(e=t.currentTarget)==null||e.click()}}onpointerdown(t){V(this,Qr,!0)}get props(){return u(a(this,$r))}set props(t){A(a(this,$r),t)}};Qr=new WeakMap,as=new WeakSet,Ol=function(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()},$r=new WeakMap;let ui=Qi;var ls,to;const $i=class $i{constructor(t,e){C(this,"opts");C(this,"parentMenu");C(this,"attachment");C(this,"onclick",t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())});C(this,"onpointerdown",t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}});C(this,"onpointerup",t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())});C(this,"onkeydown",t=>{if(!this.opts.disabled.current){if(t.key===Es||t.key===Ti){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===gr&&(this.parentMenu.onOpen(),t.preventDefault())}});y(this,ls,S(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current}));y(this,to,S(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":Xa(this.parentMenu.opts.open.current),"aria-controls":u(a(this,ls)),"data-disabled":Gn(this.opts.disabled.current),"data-state":Si(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment})));this.opts=t,this.parentMenu=e,this.attachment=ce(this.opts.ref,r=>this.parentMenu.triggerNode=r)}static create(t){return new $i(t,Mi.get())}get props(){return u(a(this,to))}set props(t){A(a(this,to),t)}};ls=new WeakMap,to=new WeakMap;let di=$i;globalThis.bitsDismissableLayers??(globalThis.bitsDismissableLayers=new Map);var Kn,mn,je,Vn,Hn,Ze,eo,ke,cs,jn,Al,us,Un,ds,fs,hs,gs,no,El,vs,ps;const ta=class ta{constructor(t){y(this,jn);C(this,"opts");y(this,Kn);y(this,mn);y(this,je,{pointerdown:!1});y(this,Vn,!1);y(this,Hn,!1);y(this,Ze);y(this,eo);y(this,ke,bt);y(this,cs,t=>{t.defaultPrevented||this.opts.ref.current&&Re(()=>{var e,r;!this.opts.ref.current||a(this,gs).call(this,t.target)||t.target&&!a(this,Hn)&&((r=(e=a(this,eo)).current)==null||r.call(e,t))})});y(this,us,t=>{let e=t;e.defaultPrevented&&(e=Sa(t)),a(this,Kn).current(t)});y(this,Un,wa(t=>{if(!this.opts.ref.current){a(this,ke).call(this);return}const e=this.opts.isValidEvent.current(t,this.opts.ref.current)||zd(t,this.opts.ref.current);if(!a(this,Vn)||et(this,jn,El).call(this)||!e){a(this,ke).call(this);return}let r=t;if(r.defaultPrevented&&(r=Sa(r)),a(this,mn).current!=="close"&&a(this,mn).current!=="defer-otherwise-close"){a(this,ke).call(this);return}t.pointerType==="touch"?(a(this,ke).call(this),V(this,ke,Ft(a(this,Ze),"click",a(this,us),{once:!0}))):a(this,Kn).current(r)},10));y(this,ds,t=>{a(this,je)[t.type]=!0});y(this,fs,t=>{a(this,je)[t.type]=!1});y(this,hs,()=>{this.opts.ref.current&&V(this,Vn,Wd(this.opts.ref.current))});y(this,gs,t=>this.opts.ref.current?cl(this.opts.ref.current,t):!1);y(this,no,wa(()=>{for(const t in a(this,je))a(this,je)[t]=!1;V(this,Vn,!1)},20));y(this,vs,()=>{V(this,Hn,!0)});y(this,ps,()=>{V(this,Hn,!1)});C(this,"props",{onfocuscapture:a(this,vs),onblurcapture:a(this,ps)});this.opts=t,V(this,mn,t.interactOutsideBehavior),V(this,Kn,t.onInteractOutside),V(this,eo,t.onFocusOutside),zt(()=>{V(this,Ze,ul(this.opts.ref.current))});let e=bt;const r=()=>{a(this,no).call(this),globalThis.bitsDismissableLayers.delete(this),a(this,Un).destroy(),e()};Nt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Pu(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,a(this,mn)),e(),e=et(this,jn,Al).call(this))}),r}),Zn(()=>{a(this,no).destroy(),globalThis.bitsDismissableLayers.delete(this),a(this,Un).destroy(),a(this,ke).call(this),e()})}static create(t){return new ta(t)}};Kn=new WeakMap,mn=new WeakMap,je=new WeakMap,Vn=new WeakMap,Hn=new WeakMap,Ze=new WeakMap,eo=new WeakMap,ke=new WeakMap,cs=new WeakMap,jn=new WeakSet,Al=function(){return Mn(Ft(a(this,Ze),"pointerdown",Mn(a(this,ds),a(this,hs)),{capture:!0}),Ft(a(this,Ze),"pointerdown",Mn(a(this,fs),a(this,Un))),Ft(a(this,Ze),"focusin",a(this,cs)))},us=new WeakMap,Un=new WeakMap,ds=new WeakMap,fs=new WeakMap,hs=new WeakMap,gs=new WeakMap,no=new WeakMap,El=function(){return Object.values(a(this,je)).some(Boolean)},vs=new WeakMap,ps=new WeakMap;let fi=ta;function Ld(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([t,{current:e}])=>e==="close"||e==="ignore")}function Wd(n){const t=[...globalThis.bitsDismissableLayers],e=Ld(t);if(e)return e[0].opts.ref.current===n;const[r]=t[0];return r.opts.ref.current===n}function zd(n,t){const e=n.target;if(!al(e))return!1;const r=!!e.closest(`[${Id}]`);if("button"in n&&n.button>0&&!r)return!1;if("button"in n&&n.button===0&&r)return!0;const o=!!t.closest(`[${kd}]`);return r&&o?!1:ul(e).documentElement.contains(e)&&!cl(t,e)&&ed(n,t)}function Sa(n){const t=n.currentTarget,e=n.target;let r;n instanceof PointerEvent?r=new PointerEvent(n.type,n):r=new PointerEvent("pointerdown",n);let o=!1;return new Proxy(r,{get:(s,l)=>l==="currentTarget"?t:l==="target"?e:l==="preventDefault"?()=>{o=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:l==="defaultPrevented"?o:l in s?s[l]:n[l]})}function Tl(n,t){G(t,!0);let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"onInteractOutside",3,bt),o=b(t,"onFocusOutside",3,bt),i=b(t,"isValidEvent",3,()=>!1);const s=fi.create({id:F(()=>t.id),interactOutsideBehavior:F(()=>e()),onInteractOutside:F(()=>r()),enabled:F(()=>t.enabled),onFocusOutside:F(()=>o()),isValidEvent:F(()=>i()),ref:t.ref});var l=N(),c=O(l);Y(c,()=>t.children??nt,()=>({props:s.props})),p(n,l),X()}globalThis.bitsEscapeLayers??(globalThis.bitsEscapeLayers=new Map);var ms,ys;const ea=class ea{constructor(t){C(this,"opts");C(this,"domContext");y(this,ms,()=>Ft(this.domContext.getDocument(),"keydown",a(this,ys),{passive:!1}));y(this,ys,t=>{if(t.key!==Mu||!Kd(this))return;const e=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(e)});this.opts=t,this.domContext=new Oi(this.opts.ref);let e=bt;Nt(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),e=a(this,ms).call(this)),()=>{e(),globalThis.bitsEscapeLayers.delete(this)}))}static create(t){return new ea(t)}};ms=new WeakMap,ys=new WeakMap;let hi=ea;function Kd(n){const t=[...globalThis.bitsEscapeLayers],e=t.findLast(([o,{current:i}])=>i==="close"||i==="ignore");if(e)return e[0]===n;const[r]=t[0];return r===n}function Fl(n,t){G(t,!0);let e=b(t,"escapeKeydownBehavior",3,"close"),r=b(t,"onEscapeKeydown",3,bt);hi.create({escapeKeydownBehavior:F(()=>e()),onEscapeKeydown:F(()=>r()),enabled:F(()=>t.enabled),ref:t.ref});var o=N(),i=O(o);Y(i,()=>t.children??nt),p(n,o),X()}var De,ro,yn;const bs=class bs{constructor(){y(this,De,Ne([]));y(this,ro,new WeakMap);y(this,yn,new WeakMap)}static getInstance(){return this.instance||(this.instance=new bs),this.instance}register(t){const e=this.getActive();e&&e!==t&&e.pause();const r=document.activeElement;r&&r!==document.body&&a(this,yn).set(t,r),a(this,De).current=a(this,De).current.filter(o=>o!==t),a(this,De).current.unshift(t)}unregister(t){a(this,De).current=a(this,De).current.filter(r=>r!==t);const e=this.getActive();e&&e.resume()}getActive(){return a(this,De).current[0]}setFocusMemory(t,e){a(this,ro).set(t,e)}getFocusMemory(t){return a(this,ro).get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,e){a(this,yn).set(t,e)}getPreFocusMemory(t){return a(this,yn).get(t)}clearPreFocusMemory(t){a(this,yn).delete(t)}};De=new WeakMap,ro=new WeakMap,yn=new WeakMap,C(bs,"instance");let gi=bs;var Je,Lt,qt,bn,Qe,Tt,Ml,Il,kl,Dl,pi,Vo,mi;const na=class na{constructor(t){y(this,Tt);y(this,Je,!1);y(this,Lt,null);y(this,qt,gi.getInstance());y(this,bn,[]);y(this,Qe);V(this,Qe,t)}get paused(){return a(this,Je)}pause(){V(this,Je,!0)}resume(){V(this,Je,!1)}mount(t){a(this,Lt)&&this.unmount(),V(this,Lt,t),a(this,qt).register(this),et(this,Tt,Dl).call(this),et(this,Tt,Il).call(this)}unmount(){a(this,Lt)&&(et(this,Tt,Ml).call(this),et(this,Tt,kl).call(this),a(this,qt).unregister(this),a(this,qt).clearPreFocusMemory(this),V(this,Lt,null))}static use(t){let e=null;return Nt([()=>t.ref.current,()=>t.enabled.current],([r,o])=>{r&&o?(e||(e=new na(t)),e.mount(r)):e&&(e.unmount(),e=null)}),Zn(()=>{e==null||e.unmount()}),{get props(){return{tabindex:-1}}}}};Je=new WeakMap,Lt=new WeakMap,qt=new WeakMap,bn=new WeakMap,Qe=new WeakMap,Tt=new WeakSet,Ml=function(){for(const t of a(this,bn))t();V(this,bn,[])},Il=function(){if(!a(this,Lt))return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});a(this,Qe).onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!a(this,Lt))return;const e=et(this,Tt,Vo).call(this);e?(e.focus(),a(this,qt).setFocusMemory(this,e)):a(this,Lt).focus()})},kl=function(){var e,r;const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if((r=(e=a(this,Qe).onCloseAutoFocus).current)==null||r.call(e,t),!t.defaultPrevented){const o=a(this,qt).getPreFocusMemory(this);if(o&&document.contains(o))try{o.focus()}catch{document.body.focus()}}},Dl=function(){if(!a(this,Lt)||!a(this,Qe).trap.current)return;const t=a(this,Lt),e=t.ownerDocument,r=s=>{if(a(this,Je)||!a(this,qt).isActiveScope(this))return;const l=s.target;if(!l)return;if(t.contains(l))a(this,qt).setFocusMemory(this,l);else{const d=a(this,qt).getFocusMemory(this);if(d&&t.contains(d)&&xl(d))s.preventDefault(),d.focus();else{const h=et(this,Tt,Vo).call(this),f=et(this,Tt,mi).call(this)[0];(h||f||t).focus()}}},o=s=>{if(!a(this,Qe).loop||a(this,Je)||s.key!=="Tab"||!a(this,qt).isActiveScope(this))return;const l=et(this,Tt,pi).call(this);if(l.length===0)return;const c=l[0],d=l[l.length-1];!s.shiftKey&&e.activeElement===d?(s.preventDefault(),c.focus()):s.shiftKey&&e.activeElement===c&&(s.preventDefault(),d.focus())};a(this,bn).push(Ft(e,"focusin",r,{capture:!0}),Ft(t,"keydown",o));const i=new MutationObserver(()=>{const s=a(this,qt).getFocusMemory(this);if(s&&!t.contains(s)){const l=et(this,Tt,Vo).call(this),c=et(this,Tt,mi).call(this)[0],d=l||c;d?(d.focus(),a(this,qt).setFocusMemory(this,d)):t.focus()}});i.observe(t,{childList:!0,subtree:!0}),a(this,bn).push(()=>i.disconnect())},pi=function(){return a(this,Lt)?bl(a(this,Lt),{includeContainer:!1,getShadowRoot:!0}):[]},Vo=function(){return et(this,Tt,pi).call(this)[0]||null},mi=function(){return a(this,Lt)?wl(a(this,Lt),{includeContainer:!1,getShadowRoot:!0}):[]};let vi=na;function Nl(n,t){G(t,!0);let e=b(t,"enabled",3,!1),r=b(t,"trapFocus",3,!1),o=b(t,"loop",3,!1),i=b(t,"onCloseAutoFocus",3,bt),s=b(t,"onOpenAutoFocus",3,bt);const l=vi.use({enabled:F(()=>e()),trap:F(()=>r()),loop:o(),onCloseAutoFocus:F(()=>i()),onOpenAutoFocus:F(()=>s()),ref:t.ref});var c=N(),d=O(c);Y(d,()=>t.focusScope??nt,()=>({props:l.props})),p(n,c),X()}globalThis.bitsTextSelectionLayers??(globalThis.bitsTextSelectionLayers=new Map);var qn,ws,Rl,xs,oo;const ra=class ra{constructor(t){y(this,ws);C(this,"opts");C(this,"domContext");y(this,qn,bt);y(this,xs,t=>{const e=this.opts.ref.current,r=t.target;!Le(e)||!Le(r)||!this.opts.enabled.current||!Hd(this)||!Tu(e,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&V(this,qn,Vd(e,this.domContext.getDocument().body)))});y(this,oo,()=>{a(this,qn).call(this),V(this,qn,bt)});this.opts=t,this.domContext=new Oi(t.ref);let e=bt;Nt(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),e(),e=et(this,ws,Rl).call(this)),()=>{e(),a(this,oo).call(this),globalThis.bitsTextSelectionLayers.delete(this)}))}static create(t){return new ra(t)}};qn=new WeakMap,ws=new WeakSet,Rl=function(){return Mn(Ft(this.domContext.getDocument(),"pointerdown",a(this,xs)),Ft(this.domContext.getDocument(),"pointerup",Zc(a(this,oo),this.opts.onPointerUp.current)))},xs=new WeakMap,oo=new WeakMap;let yi=ra;const Ca=n=>n.style.userSelect||n.style.webkitUserSelect;function Vd(n,t){const e=Ca(t),r=Ca(n);return No(t,"none"),No(n,"text"),()=>{No(t,e),No(n,r)}}function No(n,t){n.style.userSelect=t,n.style.webkitUserSelect=t}function Hd(n){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const e=t.at(-1);return e?e[0]===n:!1}function Bl(n,t){G(t,!0);let e=b(t,"preventOverflowTextSelection",3,!0),r=b(t,"onPointerDown",3,bt),o=b(t,"onPointerUp",3,bt);yi.create({id:F(()=>t.id),onPointerDown:F(()=>r()),onPointerUp:F(()=>o()),enabled:F(()=>t.enabled&&e()),ref:t.ref});var i=N(),s=O(i);Y(s,()=>t.children??nt),p(n,i),X()}globalThis.bitsIdCounter??(globalThis.bitsIdCounter={current:0});function Ii(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}var so,Yn,wn,xn,_s,Ll;class Ud{constructor(t){y(this,_s);y(this,so);y(this,Yn,0);y(this,wn,Z());y(this,xn);V(this,so,t)}get(...t){return V(this,Yn,a(this,Yn)+1),u(a(this,wn))===void 0&&V(this,xn,Ua(()=>{A(a(this,wn),a(this,so).call(this,...t),!0)})),zt(()=>()=>{et(this,_s,Ll).call(this)}),u(a(this,wn))}}so=new WeakMap,Yn=new WeakMap,wn=new WeakMap,xn=new WeakMap,_s=new WeakSet,Ll=function(){V(this,Yn,a(this,Yn)-1),a(this,xn)&&a(this,Yn)<=0&&(a(this,xn).call(this),A(a(this,wn),void 0),V(this,xn,void 0))};const Ho=new Ys;let Ro=Z(null),dn=null,lr=null,cr=!1;const Oa=F(()=>{for(const n of Ho.values())if(n)return!0;return!1});let Ks=null;const qd=new Ud(()=>{function n(){document.body.setAttribute("style",u(Ro)??""),document.body.style.removeProperty("--scrollbar-width"),ba&&(dn==null||dn()),A(Ro,null)}function t(){lr!==null&&(window.clearTimeout(lr),lr=null)}function e(o,i){t(),cr=!0,Ks=Date.now();const s=Ks,l=()=>{lr=null,Ks===s&&(Wl(Ho)?cr=!1:(cr=!1,i()))},c=o===null?24:o;lr=window.setTimeout(l,c)}function r(){u(Ro)===null&&Ho.size===0&&!cr&&A(Ro,document.body.getAttribute("style"),!0)}return Nt(()=>Oa.current,()=>{var h,f;if(!Oa.current)return;r(),cr=!1;const o=getComputedStyle(document.documentElement),i=getComputedStyle(document.body),s=((h=o.scrollbarGutter)==null?void 0:h.includes("stable"))||((f=i.scrollbarGutter)==null?void 0:f.includes("stable")),l=window.innerWidth-document.documentElement.clientWidth,d={padding:Number.parseInt(i.paddingRight??"0",10)+l,margin:Number.parseInt(i.marginRight??"0",10)};l>0&&!s&&(document.body.style.paddingRight=`${d.padding}px`,document.body.style.marginRight=`${d.margin}px`,document.body.style.setProperty("--scrollbar-width",`${l}px`)),document.body.style.overflow="hidden",ba&&(dn=Ft(document,"touchmove",v=>{v.target===document.documentElement&&(v.touches.length>1||v.preventDefault())},{passive:!1})),Re(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),Zn(()=>()=>{dn==null||dn()}),{get lockMap(){return Ho},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:e,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});var _n,io,ao,Yt;class Yd{constructor(t,e=()=>null){y(this,_n,Ii());y(this,io);y(this,ao,()=>null);y(this,Yt);C(this,"locked");V(this,io,t),V(this,ao,e),V(this,Yt,qd.get()),a(this,Yt)&&(a(this,Yt).cancelPendingCleanup(),a(this,Yt).ensureInitialStyleCaptured(),a(this,Yt).lockMap.set(a(this,_n),a(this,io)??!1),this.locked=F(()=>a(this,Yt).lockMap.get(a(this,_n))??!1,r=>a(this,Yt).lockMap.set(a(this,_n),r)),Zn(()=>{if(a(this,Yt).lockMap.delete(a(this,_n)),Wl(a(this,Yt).lockMap))return;const r=a(this,ao).call(this);a(this,Yt).scheduleCleanupIfNoNewLocks(r,()=>{a(this,Yt).resetBodyStyle()})}))}}_n=new WeakMap,io=new WeakMap,ao=new WeakMap,Yt=new WeakMap;function Wl(n){for(const[t,e]of n)if(e)return!0;return!1}function Zo(n,t){G(t,!0);let e=b(t,"preventScroll",3,!0),r=b(t,"restoreScrollDelay",3,null);e()&&new Yd(e(),()=>r()),X()}var Gd=U("<div><!></div>");function Xd(n,t){const e=sn();G(t,!0);let r=b(t,"id",19,()=>an(e)),o=b(t,"forceMount",3,!1),i=b(t,"ref",15,null),s=rt(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const l=ni.create({id:F(()=>r()),ref:F(()=>i(),v=>i(v))}),c=S(()=>Dt(s,l.props));var d=N(),h=O(d);{var f=v=>{var m=N(),g=O(m);{var w=P=>{var T=N(),I=O(T);{let E=S(()=>({props:Dt(u(c)),...l.snippetProps}));Y(I,()=>t.child,()=>u(E))}p(P,T)},_=P=>{var T=Gd();Et(T,E=>({...E}),[()=>Dt(u(c))]);var I=z(T);Y(I,()=>t.children??nt,()=>l.snippetProps),K(T),p(P,T)};yt(g,P=>{t.child?P(w):P(_,!1)})}p(v,m)};yt(h,v=>{(l.shouldRender||o())&&v(f)})}p(n,d),X()}var jd=U("<div><!></div>");function Zd(n,t){const e=sn();G(t,!0);let r=b(t,"id",19,()=>an(e)),o=b(t,"ref",15,null),i=rt(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const s=ti.create({id:F(()=>r()),ref:F(()=>o(),v=>o(v))}),l=S(()=>Dt(i,s.props));var c=N(),d=O(c);{var h=v=>{var m=N(),g=O(m);Y(g,()=>t.child,()=>({props:u(l)})),p(v,m)},f=v=>{var m=jd();Et(m,()=>({...u(l)}));var g=z(m);Y(g,()=>t.children??nt),K(m),p(v,m)};yt(d,v=>{t.child?v(h):v(f,!1)})}p(n,c),X()}const Jd=["top","right","bottom","left"],nn=Math.min,Zt=Math.max,Jo=Math.round,Bo=Math.floor,ye=n=>({x:n,y:n}),Qd={left:"right",right:"left",bottom:"top",top:"bottom"},$d={start:"end",end:"start"};function bi(n,t,e){return Zt(n,nn(t,e))}function We(n,t){return typeof n=="function"?n(t):n}function ze(n){return n.split("-")[0]}function Jn(n){return n.split("-")[1]}function ki(n){return n==="x"?"y":"x"}function Di(n){return n==="y"?"height":"width"}const tf=new Set(["top","bottom"]);function me(n){return tf.has(ze(n))?"y":"x"}function Ni(n){return ki(me(n))}function ef(n,t,e){e===void 0&&(e=!1);const r=Jn(n),o=Ni(n),i=Di(o);let s=o==="x"?r===(e?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Qo(s)),[s,Qo(s)]}function nf(n){const t=Qo(n);return[wi(n),t,wi(t)]}function wi(n){return n.replace(/start|end/g,t=>$d[t])}const Aa=["left","right"],Ea=["right","left"],rf=["top","bottom"],of=["bottom","top"];function sf(n,t,e){switch(n){case"top":case"bottom":return e?t?Ea:Aa:t?Aa:Ea;case"left":case"right":return t?rf:of;default:return[]}}function af(n,t,e,r){const o=Jn(n);let i=sf(ze(n),e==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(wi)))),i}function Qo(n){return n.replace(/left|right|bottom|top/g,t=>Qd[t])}function lf(n){return{top:0,right:0,bottom:0,left:0,...n}}function zl(n){return typeof n!="number"?lf(n):{top:n,right:n,bottom:n,left:n}}function $o(n){const{x:t,y:e,width:r,height:o}=n;return{width:r,height:o,top:e,left:t,right:t+r,bottom:e+o,x:t,y:e}}function Ta(n,t,e){let{reference:r,floating:o}=n;const i=me(t),s=Ni(t),l=Di(s),c=ze(t),d=i==="y",h=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,v=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:h,y:r.y-o.height};break;case"bottom":m={x:h,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Jn(t)){case"start":m[s]-=v*(e&&d?-1:1);break;case"end":m[s]+=v*(e&&d?-1:1);break}return m}async function cf(n,t){var e;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:c}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:v=!1,padding:m=0}=We(t,n),g=zl(m),_=l[v?f==="floating"?"reference":"floating":f],P=$o(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(_)))==null||e?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),T=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),E=await(i.isElement==null?void 0:i.isElement(I))?await(i.getScale==null?void 0:i.getScale(I))||{x:1,y:1}:{x:1,y:1},M=$o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:T,offsetParent:I,strategy:c}):T);return{top:(P.top-M.top+g.top)/E.y,bottom:(M.bottom-P.bottom+g.bottom)/E.y,left:(P.left-M.left+g.left)/E.x,right:(M.right-P.right+g.right)/E.x}}const uf=async(n,t,e)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=e,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:n,floating:t,strategy:o}),{x:h,y:f}=Ta(d,r,c),v=r,m={},g=0;for(let _=0;_<l.length;_++){var w;const{name:P,fn:T}=l[_],{x:I,y:E,data:M,reset:R}=await T({x:h,y:f,initialPlacement:r,placement:v,strategy:o,middlewareData:m,rects:d,platform:{...s,detectOverflow:(w=s.detectOverflow)!=null?w:cf},elements:{reference:n,floating:t}});h=I??h,f=E??f,m={...m,[P]:{...m[P],...M}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(d=R.rects===!0?await s.getElementRects({reference:n,floating:t,strategy:o}):R.rects),{x:h,y:f}=Ta(d,v,c)),_=-1)}return{x:h,y:f,placement:v,strategy:o,middlewareData:m}},df=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=We(n,t)||{};if(d==null)return{};const f=zl(h),v={x:e,y:r},m=Ni(o),g=Di(m),w=await s.getDimensions(d),_=m==="y",P=_?"top":"left",T=_?"bottom":"right",I=_?"clientHeight":"clientWidth",E=i.reference[g]+i.reference[m]-v[m]-i.floating[g],M=v[m]-i.reference[m],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let k=R?R[I]:0;(!k||!await(s.isElement==null?void 0:s.isElement(R)))&&(k=l.floating[I]||i.floating[g]);const H=E/2-M/2,ot=k/2-w[g]/2-1,Q=nn(f[P],ot),mt=nn(f[T],ot),ft=Q,xt=k-w[g]-mt,at=k/2-w[g]/2+H,lt=bi(ft,at,xt),J=!c.arrow&&Jn(o)!=null&&at!==lt&&i.reference[g]/2-(at<ft?Q:mt)-w[g]/2<0,st=J?at<ft?at-ft:at-xt:0;return{[m]:v[m]+st,data:{[m]:lt,centerOffset:at-lt-st,...J&&{alignmentOffset:st}},reset:J}}}),ff=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:v,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,..._}=We(n,t);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const P=ze(o),T=me(l),I=ze(l)===l,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),M=v||(I||!w?[Qo(l)]:nf(l)),R=g!=="none";!v&&R&&M.push(...af(l,w,g,E));const k=[l,...M],H=await c.detectOverflow(t,_),ot=[];let Q=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&ot.push(H[P]),f){const at=ef(o,s,E);ot.push(H[at[0]],H[at[1]])}if(Q=[...Q,{placement:o,overflows:ot}],!ot.every(at=>at<=0)){var mt,ft;const at=(((mt=i.flip)==null?void 0:mt.index)||0)+1,lt=k[at];if(lt&&(!(f==="alignment"?T!==me(lt):!1)||Q.every(tt=>me(tt.placement)===T?tt.overflows[0]>0:!0)))return{data:{index:at,overflows:Q},reset:{placement:lt}};let J=(ft=Q.filter(st=>st.overflows[0]<=0).sort((st,tt)=>st.overflows[1]-tt.overflows[1])[0])==null?void 0:ft.placement;if(!J)switch(m){case"bestFit":{var xt;const st=(xt=Q.filter(tt=>{if(R){const _t=me(tt.placement);return _t===T||_t==="y"}return!0}).map(tt=>[tt.placement,tt.overflows.filter(_t=>_t>0).reduce((_t,Rt)=>_t+Rt,0)]).sort((tt,_t)=>tt[1]-_t[1])[0])==null?void 0:xt[0];st&&(J=st);break}case"initialPlacement":J=l;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function Fa(n,t){return{top:n.top-t.height,right:n.right-t.width,bottom:n.bottom-t.height,left:n.left-t.width}}function Ma(n){return Jd.some(t=>n[t]>=0)}const hf=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(t){const{rects:e,platform:r}=t,{strategy:o="referenceHidden",...i}=We(n,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),l=Fa(s,e.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Ma(l)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),l=Fa(s,e.floating);return{data:{escapedOffsets:l,escaped:Ma(l)}}}default:return{}}}}},Kl=new Set(["left","top"]);async function gf(n,t){const{placement:e,platform:r,elements:o}=n,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ze(e),l=Jn(e),c=me(e)==="y",d=Kl.has(s)?-1:1,h=i&&c?-1:1,f=We(t,n);let{mainAxis:v,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*h,y:v*d}:{x:v*d,y:m*h}}const vf=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,r;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await gf(t,n);return s===((e=l.offset)==null?void 0:e.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},pf=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:P=>{let{x:T,y:I}=P;return{x:T,y:I}}},...d}=We(n,t),h={x:e,y:r},f=await i.detectOverflow(t,d),v=me(ze(o)),m=ki(v);let g=h[m],w=h[v];if(s){const P=m==="y"?"top":"left",T=m==="y"?"bottom":"right",I=g+f[P],E=g-f[T];g=bi(I,g,E)}if(l){const P=v==="y"?"top":"left",T=v==="y"?"bottom":"right",I=w+f[P],E=w-f[T];w=bi(I,w,E)}const _=c.fn({...t,[m]:g,[v]:w});return{..._,data:{x:_.x-e,y:_.y-r,enabled:{[m]:s,[v]:l}}}}}},mf=function(n){return n===void 0&&(n={}),{options:n,fn(t){const{x:e,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=We(n,t),h={x:e,y:r},f=me(o),v=ki(f);let m=h[v],g=h[f];const w=We(l,t),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const I=v==="y"?"height":"width",E=i.reference[v]-i.floating[I]+_.mainAxis,M=i.reference[v]+i.reference[I]-_.mainAxis;m<E?m=E:m>M&&(m=M)}if(d){var P,T;const I=v==="y"?"width":"height",E=Kl.has(ze(o)),M=i.reference[f]-i.floating[I]+(E&&((P=s.offset)==null?void 0:P[f])||0)+(E?0:_.crossAxis),R=i.reference[f]+i.reference[I]+(E?0:((T=s.offset)==null?void 0:T[f])||0)-(E?_.crossAxis:0);g<M?g=M:g>R&&(g=R)}return{[v]:m,[f]:g}}}},yf=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,r;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=We(n,t),h=await s.detectOverflow(t,d),f=ze(o),v=Jn(o),m=me(o)==="y",{width:g,height:w}=i.floating;let _,P;f==="top"||f==="bottom"?(_=f,P=v===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(P=f,_=v==="end"?"top":"bottom");const T=w-h.top-h.bottom,I=g-h.left-h.right,E=nn(w-h[_],T),M=nn(g-h[P],I),R=!t.middlewareData.shift;let k=E,H=M;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(H=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=T),R&&!v){const Q=Zt(h.left,0),mt=Zt(h.right,0),ft=Zt(h.top,0),xt=Zt(h.bottom,0);m?H=g-2*(Q!==0||mt!==0?Q+mt:Zt(h.left,h.right)):k=w-2*(ft!==0||xt!==0?ft+xt:Zt(h.top,h.bottom))}await c({...t,availableWidth:H,availableHeight:k});const ot=await s.getDimensions(l.floating);return g!==ot.width||w!==ot.height?{reset:{rects:!0}}:{}}}};function Ts(){return typeof window<"u"}function Qn(n){return Vl(n)?(n.nodeName||"").toLowerCase():"#document"}function Jt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function we(n){var t;return(t=(Vl(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Vl(n){return Ts()?n instanceof Node||n instanceof Jt(n).Node:!1}function ue(n){return Ts()?n instanceof Element||n instanceof Jt(n).Element:!1}function be(n){return Ts()?n instanceof HTMLElement||n instanceof Jt(n).HTMLElement:!1}function Ia(n){return!Ts()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Jt(n).ShadowRoot}const bf=new Set(["inline","contents"]);function Mo(n){const{overflow:t,overflowX:e,overflowY:r,display:o}=de(n);return/auto|scroll|overlay|hidden|clip/.test(t+r+e)&&!bf.has(o)}const wf=new Set(["table","td","th"]);function xf(n){return wf.has(Qn(n))}const _f=[":popover-open",":modal"];function Fs(n){return _f.some(t=>{try{return n.matches(t)}catch{return!1}})}const Pf=["transform","translate","scale","rotate","perspective"],Sf=["transform","translate","scale","rotate","perspective","filter"],Cf=["paint","layout","strict","content"];function Ri(n){const t=Bi(),e=ue(n)?de(n):n;return Pf.some(r=>e[r]?e[r]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||Sf.some(r=>(e.willChange||"").includes(r))||Cf.some(r=>(e.contain||"").includes(r))}function Of(n){let t=rn(n);for(;be(t)&&!Xn(t);){if(Ri(t))return t;if(Fs(t))return null;t=rn(t)}return null}function Bi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Af=new Set(["html","body","#document"]);function Xn(n){return Af.has(Qn(n))}function de(n){return Jt(n).getComputedStyle(n)}function Ms(n){return ue(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function rn(n){if(Qn(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Ia(n)&&n.host||we(n);return Ia(t)?t.host:t}function Hl(n){const t=rn(n);return Xn(t)?n.ownerDocument?n.ownerDocument.body:n.body:be(t)&&Mo(t)?t:Hl(t)}function vr(n,t,e){var r;t===void 0&&(t=[]),e===void 0&&(e=!0);const o=Hl(n),i=o===((r=n.ownerDocument)==null?void 0:r.body),s=Jt(o);if(i){const l=xi(s);return t.concat(s,s.visualViewport||[],Mo(o)?o:[],l&&e?vr(l):[])}return t.concat(o,vr(o,[],e))}function xi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Ul(n){const t=de(n);let e=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(n),i=o?n.offsetWidth:e,s=o?n.offsetHeight:r,l=Jo(e)!==i||Jo(r)!==s;return l&&(e=i,r=s),{width:e,height:r,$:l}}function Li(n){return ue(n)?n:n.contextElement}function In(n){const t=Li(n);if(!be(t))return ye(1);const e=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ul(t);let s=(i?Jo(e.width):e.width)/r,l=(i?Jo(e.height):e.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ef=ye(0);function ql(n){const t=Jt(n);return!Bi()||!t.visualViewport?Ef:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tf(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==Jt(n)?!1:t}function Cn(n,t,e,r){t===void 0&&(t=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),i=Li(n);let s=ye(1);t&&(r?ue(r)&&(s=In(r)):s=In(n));const l=Tf(i,e,r)?ql(i):ye(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,h=o.width/s.x,f=o.height/s.y;if(i){const v=Jt(i),m=r&&ue(r)?Jt(r):r;let g=v,w=xi(g);for(;w&&r&&m!==g;){const _=In(w),P=w.getBoundingClientRect(),T=de(w),I=P.left+(w.clientLeft+parseFloat(T.paddingLeft))*_.x,E=P.top+(w.clientTop+parseFloat(T.paddingTop))*_.y;c*=_.x,d*=_.y,h*=_.x,f*=_.y,c+=I,d+=E,g=Jt(w),w=xi(g)}}return $o({width:h,height:f,x:c,y:d})}function Is(n,t){const e=Ms(n).scrollLeft;return t?t.left+e:Cn(we(n)).left+e}function Yl(n,t){const e=n.getBoundingClientRect(),r=e.left+t.scrollLeft-Is(n,e),o=e.top+t.scrollTop;return{x:r,y:o}}function Ff(n){let{elements:t,rect:e,offsetParent:r,strategy:o}=n;const i=o==="fixed",s=we(r),l=t?Fs(t.floating):!1;if(r===s||l&&i)return e;let c={scrollLeft:0,scrollTop:0},d=ye(1);const h=ye(0),f=be(r);if((f||!f&&!i)&&((Qn(r)!=="body"||Mo(s))&&(c=Ms(r)),be(r))){const m=Cn(r);d=In(r),h.x=m.x+r.clientLeft,h.y=m.y+r.clientTop}const v=s&&!f&&!i?Yl(s,c):ye(0);return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-c.scrollLeft*d.x+h.x+v.x,y:e.y*d.y-c.scrollTop*d.y+h.y+v.y}}function Mf(n){return Array.from(n.getClientRects())}function If(n){const t=we(n),e=Ms(n),r=n.ownerDocument.body,o=Zt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Zt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-e.scrollLeft+Is(n);const l=-e.scrollTop;return de(r).direction==="rtl"&&(s+=Zt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}const ka=25;function kf(n,t){const e=Jt(n),r=we(n),o=e.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const h=Bi();(!h||h&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=Is(r);if(d<=0){const h=r.ownerDocument,f=h.body,v=getComputedStyle(f),m=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=ka&&(i-=g)}else d<=ka&&(i+=d);return{width:i,height:s,x:l,y:c}}const Df=new Set(["absolute","fixed"]);function Nf(n,t){const e=Cn(n,!0,t==="fixed"),r=e.top+n.clientTop,o=e.left+n.clientLeft,i=be(n)?In(n):ye(1),s=n.clientWidth*i.x,l=n.clientHeight*i.y,c=o*i.x,d=r*i.y;return{width:s,height:l,x:c,y:d}}function Da(n,t,e){let r;if(t==="viewport")r=kf(n,e);else if(t==="document")r=If(we(n));else if(ue(t))r=Nf(t,e);else{const o=ql(n);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $o(r)}function Gl(n,t){const e=rn(n);return e===t||!ue(e)||Xn(e)?!1:de(e).position==="fixed"||Gl(e,t)}function Rf(n,t){const e=t.get(n);if(e)return e;let r=vr(n,[],!1).filter(l=>ue(l)&&Qn(l)!=="body"),o=null;const i=de(n).position==="fixed";let s=i?rn(n):n;for(;ue(s)&&!Xn(s);){const l=de(s),c=Ri(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&Df.has(o.position)||Mo(s)&&!c&&Gl(n,s))?r=r.filter(h=>h!==s):o=l,s=rn(s)}return t.set(n,r),r}function Bf(n){let{element:t,boundary:e,rootBoundary:r,strategy:o}=n;const s=[...e==="clippingAncestors"?Fs(t)?[]:Rf(t,this._c):[].concat(e),r],l=s[0],c=s.reduce((d,h)=>{const f=Da(t,h,o);return d.top=Zt(f.top,d.top),d.right=nn(f.right,d.right),d.bottom=nn(f.bottom,d.bottom),d.left=Zt(f.left,d.left),d},Da(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Lf(n){const{width:t,height:e}=Ul(n);return{width:t,height:e}}function Wf(n,t,e){const r=be(t),o=we(t),i=e==="fixed",s=Cn(n,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=ye(0);function d(){c.x=Is(o)}if(r||!r&&!i)if((Qn(t)!=="body"||Mo(o))&&(l=Ms(t)),r){const m=Cn(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&d();i&&!r&&o&&d();const h=o&&!r&&!i?Yl(o,l):ye(0),f=s.left+l.scrollLeft-c.x-h.x,v=s.top+l.scrollTop-c.y-h.y;return{x:f,y:v,width:s.width,height:s.height}}function Vs(n){return de(n).position==="static"}function Na(n,t){if(!be(n)||de(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return we(n)===e&&(e=e.ownerDocument.body),e}function Xl(n,t){const e=Jt(n);if(Fs(n))return e;if(!be(n)){let o=rn(n);for(;o&&!Xn(o);){if(ue(o)&&!Vs(o))return o;o=rn(o)}return e}let r=Na(n,t);for(;r&&xf(r)&&Vs(r);)r=Na(r,t);return r&&Xn(r)&&Vs(r)&&!Ri(r)?e:r||Of(n)||e}const zf=async function(n){const t=this.getOffsetParent||Xl,e=this.getDimensions,r=await e(n.floating);return{reference:Wf(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Kf(n){return de(n).direction==="rtl"}const Vf={convertOffsetParentRelativeRectToViewportRelativeRect:Ff,getDocumentElement:we,getClippingRect:Bf,getOffsetParent:Xl,getElementRects:zf,getClientRects:Mf,getDimensions:Lf,getScale:In,isElement:ue,isRTL:Kf};function jl(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Hf(n,t){let e=null,r;const o=we(n);function i(){var l;clearTimeout(r),(l=e)==null||l.disconnect(),e=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=n.getBoundingClientRect(),{left:h,top:f,width:v,height:m}=d;if(l||t(),!v||!m)return;const g=Bo(f),w=Bo(o.clientWidth-(h+v)),_=Bo(o.clientHeight-(f+m)),P=Bo(h),I={rootMargin:-g+"px "+-w+"px "+-_+"px "+-P+"px",threshold:Zt(0,nn(1,c))||1};let E=!0;function M(R){const k=R[0].intersectionRatio;if(k!==c){if(!E)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!jl(d,n.getBoundingClientRect())&&s(),E=!1}try{e=new IntersectionObserver(M,{...I,root:o.ownerDocument})}catch{e=new IntersectionObserver(M,I)}e.observe(n)}return s(!0),i}function Uf(n,t,e,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Li(n),h=o||i?[...d?vr(d):[],...vr(t)]:[];h.forEach(P=>{o&&P.addEventListener("scroll",e,{passive:!0}),i&&P.addEventListener("resize",e)});const f=d&&l?Hf(d,e):null;let v=-1,m=null;s&&(m=new ResizeObserver(P=>{let[T]=P;T&&T.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var I;(I=m)==null||I.observe(t)})),e()}),d&&!c&&m.observe(d),m.observe(t));let g,w=c?Cn(n):null;c&&_();function _(){const P=Cn(n);w&&!jl(w,P)&&e(),w=P,g=requestAnimationFrame(_)}return e(),()=>{var P;h.forEach(T=>{o&&T.removeEventListener("scroll",e),i&&T.removeEventListener("resize",e)}),f==null||f(),(P=m)==null||P.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const qf=vf,Yf=pf,Gf=ff,Xf=yf,jf=hf,Zf=df,Jf=mf,Qf=(n,t,e)=>{const r=new Map,o={platform:Vf,...e},i={...o.platform,_c:r};return uf(n,t,{...o,platform:i})};function fn(n){return typeof n=="function"?n():n}function Zl(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ra(n,t){const e=Zl(n);return Math.round(t*e)/e}function Ba(n){return{[`--bits-${n}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${n}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${n}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${n}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${n}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function $f(n){const t=n.whileElementsMounted,e=S(()=>fn(n.open)??!0),r=S(()=>fn(n.middleware)),o=S(()=>fn(n.transform)??!0),i=S(()=>fn(n.placement)??"bottom"),s=S(()=>fn(n.strategy)??"absolute"),l=S(()=>fn(n.sideOffset)??0),c=S(()=>fn(n.alignOffset)??0),d=n.reference;let h=Z(0),f=Z(0);const v=Ne(null);let m=Z(fr(u(s))),g=Z(fr(u(i))),w=Z(fr({})),_=Z(!1);const P=S(()=>{const k=v.current?Ra(v.current,u(h)):u(h),H=v.current?Ra(v.current,u(f)):u(f);return u(o)?{position:u(m),left:"0",top:"0",transform:`translate(${k}px, ${H}px)`,...v.current&&Zl(v.current)>=1.5&&{willChange:"transform"}}:{position:u(m),left:`${k}px`,top:`${H}px`}});let T;function I(){d.current===null||v.current===null||Qf(d.current,v.current,{middleware:u(r),placement:u(i),strategy:u(s)}).then(k=>{if(!u(e)&&u(h)!==0&&u(f)!==0){const H=Math.max(Math.abs(u(l)),Math.abs(u(c)),15);if(k.x<=H&&k.y<=H)return}A(h,k.x,!0),A(f,k.y,!0),A(m,k.strategy,!0),A(g,k.placement,!0),A(w,k.middlewareData,!0),A(_,!0)})}function E(){typeof T=="function"&&(T(),T=void 0)}function M(){if(E(),t===void 0){I();return}d.current===null||v.current===null||(T=t(d.current,v.current,I))}function R(){u(e)||A(_,!1)}return zt(I),zt(M),zt(R),zt(()=>E),{floating:v,reference:d,get strategy(){return u(m)},get placement(){return u(g)},get middlewareData(){return u(w)},get isPositioned(){return u(_)},get floatingStyles(){return u(P)},get update(){return I}}}const th={top:"bottom",right:"left",bottom:"top",left:"right"},Wi=new ln("Floating.Root"),La=new ln("Floating.Content"),zi=new ln("Floating.Root");class ts{constructor(){C(this,"anchorNode",Ne(null));C(this,"customAnchorNode",Ne(null));C(this,"triggerNode",Ne(null));zt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}static create(t=!1){return t?zi.set(new ts):Wi.set(new ts)}}var lo,Ps,co,Ss,uo,Cs,fo,ho,go,vo,po,mo,yo,bo,wo,xo,_o,Po,So,Co,Oo,Ao,Eo,To;const Os=class Os{constructor(t,e){C(this,"opts");C(this,"root");C(this,"contentRef",Ne(null));C(this,"wrapperRef",Ne(null));C(this,"arrowRef",Ne(null));C(this,"contentAttachment",ce(this.contentRef));C(this,"wrapperAttachment",ce(this.wrapperRef));C(this,"arrowAttachment",ce(this.arrowRef));C(this,"arrowId",Ne(Ii()));y(this,lo,S(()=>{if(typeof this.opts.style=="string")return Jc(this.opts.style);if(!this.opts.style)return{}}));y(this,Ps);y(this,co,new _u(()=>this.arrowRef.current??void 0));y(this,Ss,S(()=>{var t;return((t=a(this,co))==null?void 0:t.width)??0}));y(this,uo,S(()=>{var t;return((t=a(this,co))==null?void 0:t.height)??0}));y(this,Cs,S(()=>{var t;return((t=this.opts.side)==null?void 0:t.current)+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:"")}));y(this,fo,S(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]));y(this,ho,S(()=>u(a(this,fo)).length>0));y(this,go,S(()=>({padding:this.opts.collisionPadding.current,boundary:u(a(this,fo)).filter(zu),altBoundary:this.hasExplicitBoundaries})));y(this,vo,Z(void 0));y(this,po,Z(void 0));y(this,mo,Z(void 0));y(this,yo,Z(void 0));y(this,bo,S(()=>[qf({mainAxis:this.opts.sideOffset.current+u(a(this,uo)),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&Yf({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?Jf():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&Gf({...this.detectOverflowOptions}),Xf({...this.detectOverflowOptions,apply:({rects:t,availableWidth:e,availableHeight:r})=>{const{width:o,height:i}=t.reference;A(a(this,vo),e,!0),A(a(this,po),r,!0),A(a(this,mo),o,!0),A(a(this,yo),i,!0)}}),this.arrowRef.current&&Zf({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),eh({arrowWidth:u(a(this,Ss)),arrowHeight:u(a(this,uo))}),this.opts.hideWhenDetached.current&&jf({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean)));C(this,"floating");y(this,wo,S(()=>nh(this.floating.placement)));y(this,xo,S(()=>rh(this.floating.placement)));y(this,_o,S(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.x)??0}));y(this,Po,S(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.y)??0}));y(this,So,S(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.centerOffset)!==0}));y(this,Co,Z());y(this,Oo,S(()=>th[this.placedSide]));y(this,Ao,S(()=>{var t,e,r;return{id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${(t=this.floating.middlewareData.transformOrigin)==null?void 0:t.x} ${(e=this.floating.middlewareData.transformOrigin)==null?void 0:e.y}`,"--bits-floating-available-width":`${u(a(this,vo))}px`,"--bits-floating-available-height":`${u(a(this,po))}px`,"--bits-floating-anchor-width":`${u(a(this,mo))}px`,"--bits-floating-anchor-height":`${u(a(this,yo))}px`,...((r=this.floating.middlewareData.hide)==null?void 0:r.referenceHidden)&&{visibility:"hidden","pointer-events":"none"},...u(a(this,lo))},dir:this.opts.dir.current,...this.wrapperAttachment}}));y(this,Eo,S(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Qc({...u(a(this,lo))}),...this.contentAttachment})));y(this,To,S(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0})));this.opts=t,this.root=e,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),Nt(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=$f({strategy:()=>this.opts.strategy.current,placement:()=>u(a(this,Cs)),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>{var i;return Uf(...r,{animationFrame:((i=a(this,Ps))==null?void 0:i.current)==="always"})},open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),zt(()=>{var r;this.floating.isPositioned&&((r=this.opts.onPlaced)==null||r.current())}),Nt(()=>this.contentRef.current,r=>{if(!r)return;const o=Ci(r);this.contentZIndex=o.getComputedStyle(r).zIndex}),zt(()=>{this.floating.floating.current=this.wrapperRef.current})}static create(t,e=!1){return e?La.set(new Os(t,zi.get())):La.set(new Os(t,Wi.get()))}get hasExplicitBoundaries(){return u(a(this,ho))}set hasExplicitBoundaries(t){A(a(this,ho),t)}get detectOverflowOptions(){return u(a(this,go))}set detectOverflowOptions(t){A(a(this,go),t)}get middleware(){return u(a(this,bo))}set middleware(t){A(a(this,bo),t)}get placedSide(){return u(a(this,wo))}set placedSide(t){A(a(this,wo),t)}get placedAlign(){return u(a(this,xo))}set placedAlign(t){A(a(this,xo),t)}get arrowX(){return u(a(this,_o))}set arrowX(t){A(a(this,_o),t)}get arrowY(){return u(a(this,Po))}set arrowY(t){A(a(this,Po),t)}get cannotCenterArrow(){return u(a(this,So))}set cannotCenterArrow(t){A(a(this,So),t)}get contentZIndex(){return u(a(this,Co))}set contentZIndex(t){A(a(this,Co),t,!0)}get arrowBaseSide(){return u(a(this,Oo))}set arrowBaseSide(t){A(a(this,Oo),t)}get wrapperProps(){return u(a(this,Ao))}set wrapperProps(t){A(a(this,Ao),t)}get props(){return u(a(this,Eo))}set props(t){A(a(this,Eo),t)}get arrowStyle(){return u(a(this,To))}set arrowStyle(t){A(a(this,To),t)}};lo=new WeakMap,Ps=new WeakMap,co=new WeakMap,Ss=new WeakMap,uo=new WeakMap,Cs=new WeakMap,fo=new WeakMap,ho=new WeakMap,go=new WeakMap,vo=new WeakMap,po=new WeakMap,mo=new WeakMap,yo=new WeakMap,bo=new WeakMap,wo=new WeakMap,xo=new WeakMap,_o=new WeakMap,Po=new WeakMap,So=new WeakMap,Co=new WeakMap,Oo=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,To=new WeakMap;let _i=Os;class es{constructor(t,e){C(this,"opts");C(this,"root");this.opts=t,this.root=e,t.virtualEl&&t.virtualEl.current?e.triggerNode=Ya(t.virtualEl.current):e.triggerNode=t.ref}static create(t,e=!1){return e?new es(t,zi.get()):new es(t,Wi.get())}}function eh(n){return{name:"transformOrigin",options:n,fn(t){var _,P,T;const{placement:e,rects:r,middlewareData:o}=t,s=((_=o.arrow)==null?void 0:_.centerOffset)!==0,l=s?0:n.arrowWidth,c=s?0:n.arrowHeight,[d,h]=Ki(e),f={start:"0%",center:"50%",end:"100%"}[h],v=(((P=o.arrow)==null?void 0:P.x)??0)+l/2,m=(((T=o.arrow)==null?void 0:T.y)??0)+c/2;let g="",w="";return d==="bottom"?(g=s?f:`${v}px`,w=`${-c}px`):d==="top"?(g=s?f:`${v}px`,w=`${r.floating.height+c}px`):d==="right"?(g=`${-c}px`,w=s?f:`${m}px`):d==="left"&&(g=`${r.floating.width+c}px`,w=s?f:`${m}px`),{data:{x:g,y:w}}}}}function Ki(n){const[t,e="center"]=n.split("-");return[t,e]}function nh(n){return Ki(n)[0]}function rh(n){return Ki(n)[1]}function oh(n,t){G(t,!0);let e=b(t,"tooltip",3,!1);ts.create(e());var r=N(),o=O(r);Y(o,()=>t.children??nt),p(n,r),X()}function sh(n,t){G(t,!0);let e=b(t,"tooltip",3,!1);es.create({id:F(()=>t.id),virtualEl:F(()=>t.virtualEl),ref:t.ref},e());var r=N(),o=O(r);Y(o,()=>t.children??nt),p(n,r),X()}function ih(n,t){G(t,!0);let e=b(t,"side",3,"bottom"),r=b(t,"sideOffset",3,0),o=b(t,"align",3,"center"),i=b(t,"alignOffset",3,0),s=b(t,"arrowPadding",3,0),l=b(t,"avoidCollisions",3,!0),c=b(t,"collisionBoundary",19,()=>[]),d=b(t,"collisionPadding",3,0),h=b(t,"hideWhenDetached",3,!1),f=b(t,"onPlaced",3,()=>{}),v=b(t,"sticky",3,"partial"),m=b(t,"updatePositionStrategy",3,"optimized"),g=b(t,"strategy",3,"fixed"),w=b(t,"dir",3,"ltr"),_=b(t,"style",19,()=>({})),P=b(t,"wrapperId",19,Ii),T=b(t,"customAnchor",3,null),I=b(t,"tooltip",3,!1);const E=_i.create({side:F(()=>e()),sideOffset:F(()=>r()),align:F(()=>o()),alignOffset:F(()=>i()),id:F(()=>t.id),arrowPadding:F(()=>s()),avoidCollisions:F(()=>l()),collisionBoundary:F(()=>c()),collisionPadding:F(()=>d()),hideWhenDetached:F(()=>h()),onPlaced:F(()=>f()),sticky:F(()=>v()),updatePositionStrategy:F(()=>m()),strategy:F(()=>g()),dir:F(()=>w()),style:F(()=>_()),enabled:F(()=>t.enabled),wrapperId:F(()=>P()),customAnchor:F(()=>T())},I()),M=S(()=>Dt(E.wrapperProps,{style:{pointerEvents:"auto"}}));var R=N(),k=O(R);Y(k,()=>t.content??nt,()=>({props:E.props,wrapperProps:u(M)})),p(n,R),X()}function ah(n,t){G(t,!0),zc(()=>{var o;(o=t.onPlaced)==null||o.call(t)});var e=N(),r=O(e);Y(r,()=>t.content??nt,()=>({props:{},wrapperProps:{}})),p(n,e),X()}function lh(n,t){let e=b(t,"isStatic",3,!1),r=rt(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var o=N(),i=O(o);{var s=c=>{ah(c,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},l=c=>{ih(c,wt({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};yt(i,c=>{e()?c(s):c(l,!1)})}p(n,o)}var ch=U("<!> <!>",1);function Jl(n,t){G(t,!0);let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=b(t,"tooltip",3,!1),c=b(t,"contentPointerEvents",3,"auto"),d=rt(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);lh(n,{get isStatic(){return s()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get enabled(){return t.enabled},get tooltip(){return l()},content:(f,v)=>{let m=()=>v==null?void 0:v().props,g=()=>v==null?void 0:v().wrapperProps;var w=ch(),_=O(w);{var P=E=>{Zo(E,{get preventScroll(){return t.preventScroll}})},T=E=>{Zo(E,{get preventScroll(){return t.preventScroll}})};yt(_,E=>{t.forceMount&&t.enabled?E(P):t.forceMount||E(T,1)})}var I=D(_,2);Nl(I,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(M,R)=>{let k=()=>R==null?void 0:R().props;Fl(M,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(H,ot)=>{Tl(H,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return e()},get isValidEvent(){return o()},get enabled(){return t.enabled},get ref(){return t.ref},children:(mt,ft)=>{let xt=()=>ft==null?void 0:ft().props;Bl(mt,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(at,lt)=>{var J=N(),st=O(J);{let tt=S(()=>({props:Dt(d,m(),xt(),k(),{style:{pointerEvents:c()}}),wrapperProps:g()}));Y(st,()=>t.popper??nt,()=>u(tt))}p(at,J)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),p(f,w)},$$slots:{content:!0}}),X()}function uh(n,t){let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=rt(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var c=N(),d=O(c);{var h=f=>{Jl(f,wt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return e()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>l))};yt(d,f=>{t.shouldRender&&f(h)})}p(n,c)}function dh(n,t){let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=rt(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);Jl(n,wt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return e()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside}},()=>l,{forceMount:!0}))}var fh=U("<div><!></div>");function hh(n,t){const e=sn();G(t,!0);let r=b(t,"ref",15,null),o=b(t,"id",19,()=>an(e)),i=b(t,"disabled",3,!1),s=b(t,"onSelect",3,bt),l=b(t,"closeOnSelect",3,!0),c=rt(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const d=ui.create({id:F(()=>o()),disabled:F(()=>i()),onSelect:F(()=>s()),ref:F(()=>r(),w=>r(w)),closeOnSelect:F(()=>l())}),h=S(()=>Dt(c,d.props));var f=N(),v=O(f);{var m=w=>{var _=N(),P=O(_);Y(P,()=>t.child,()=>({props:u(h)})),p(w,_)},g=w=>{var _=fh();Et(_,()=>({...u(h)}));var P=z(_);Y(P,()=>t.children??nt),K(_),p(w,_)};yt(v,w=>{t.child?w(m):w(g,!1)})}p(n,f),X()}function gh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=b(t,"onOpenChange",3,bt),o=b(t,"onOpenChangeComplete",3,bt);Js.create({variant:F(()=>"dialog"),open:F(()=>e(),l=>{e(l),r()(l)}),onOpenChangeComplete:F(()=>o())});var i=N(),s=O(i);Y(s,()=>t.children??nt),p(n,i),X()}var vh=U("<button><!></button>");function ph(n,t){const e=sn();G(t,!0);let r=b(t,"id",19,()=>an(e)),o=b(t,"ref",15,null),i=b(t,"disabled",3,!1),s=rt(t,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const l=Qs.create({variant:F(()=>"close"),id:F(()=>r()),ref:F(()=>o(),m=>o(m)),disabled:F(()=>!!i())}),c=S(()=>Dt(s,l.props));var d=N(),h=O(d);{var f=m=>{var g=N(),w=O(g);Y(w,()=>t.child,()=>({props:u(c)})),p(m,g)},v=m=>{var g=vh();Et(g,()=>({...u(c)}));var w=z(g);Y(w,()=>t.children??nt),K(g),p(m,g)};yt(h,m=>{t.child?m(f):m(v,!1)})}p(n,d),X()}var mh=U("<!> <!>",1),yh=U("<!> <div><!></div>",1);function bh(n,t){const e=sn();G(t,!0);let r=b(t,"id",19,()=>an(e)),o=b(t,"ref",15,null),i=b(t,"forceMount",3,!1),s=b(t,"onCloseAutoFocus",3,bt),l=b(t,"onOpenAutoFocus",3,bt),c=b(t,"onEscapeKeydown",3,bt),d=b(t,"onInteractOutside",3,bt),h=b(t,"trapFocus",3,!0),f=b(t,"preventScroll",3,!0),v=b(t,"restoreScrollDelay",3,null),m=rt(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const g=ei.create({id:F(()=>r()),ref:F(()=>o(),I=>o(I))}),w=S(()=>Dt(m,g.props));var _=N(),P=O(_);{var T=I=>{Nl(I,{get ref(){return g.opts.ref},loop:!0,get trapFocus(){return h()},get enabled(){return g.root.opts.open.current},get onOpenAutoFocus(){return l()},get onCloseAutoFocus(){return s()},focusScope:(M,R)=>{let k=()=>R==null?void 0:R().props;Fl(M,wt(()=>u(w),{get enabled(){return g.root.opts.open.current},get ref(){return g.opts.ref},onEscapeKeydown:H=>{c()(H),!H.defaultPrevented&&g.root.handleClose()},children:(H,ot)=>{Tl(H,wt(()=>u(w),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},onInteractOutside:Q=>{d()(Q),!Q.defaultPrevented&&g.root.handleClose()},children:(Q,mt)=>{Bl(Q,wt(()=>u(w),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},children:(ft,xt)=>{var at=N(),lt=O(at);{var J=tt=>{var _t=mh(),Rt=O(_t);{var $t=kt=>{Zo(kt,{get preventScroll(){return f()},get restoreScrollDelay(){return v()}})};yt(Rt,kt=>{g.root.opts.open.current&&kt($t)})}var Kt=D(Rt,2);{let kt=S(()=>({props:Dt(u(w),k()),...g.snippetProps}));Y(Kt,()=>t.child,()=>u(kt))}p(tt,_t)},st=tt=>{var _t=yh(),Rt=O(_t);Zo(Rt,{get preventScroll(){return f()}});var $t=D(Rt,2);Et($t,kt=>({...kt}),[()=>Dt(u(w),k())]);var Kt=z($t);Y(Kt,()=>t.children??nt),K($t),p(tt,_t)};yt(lt,tt=>{t.child?tt(J):tt(st,!1)})}p(ft,at)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};yt(P,I=>{(g.shouldRender||i())&&I(T)})}p(n,_),X()}function wh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=b(t,"dir",3,"ltr"),o=b(t,"onOpenChange",3,bt),i=b(t,"onOpenChangeComplete",3,bt),s=b(t,"_internal_variant",3,"dropdown-menu");const l=ai.create({variant:F(()=>s()),dir:F(()=>r()),onClose:()=>{e(!1),o()(!1)}});li.create({open:F(()=>e(),c=>{e(c),o()(c)}),onOpenChangeComplete:F(()=>i())},l),oh(n,{children:(c,d)=>{var h=N(),f=O(h);Y(f,()=>t.children??nt),p(c,h)},$$slots:{default:!0}}),X()}var xh=U("<div><div><!></div></div>"),_h=U("<div><div><!></div></div>");function Ph(n,t){const e=sn();G(t,!0);let r=b(t,"id",19,()=>an(e)),o=b(t,"ref",15,null),i=b(t,"loop",3,!0),s=b(t,"onInteractOutside",3,bt),l=b(t,"onEscapeKeydown",3,bt),c=b(t,"onCloseAutoFocus",3,bt),d=b(t,"forceMount",3,!1),h=b(t,"trapFocus",3,!1),f=rt(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const v=ci.create({id:F(()=>r()),loop:F(()=>i()),ref:F(()=>o(),E=>o(E)),onCloseAutoFocus:F(()=>c())}),m=S(()=>Dt(f,v.props));function g(E){if(v.handleInteractOutside(E),!E.defaultPrevented&&(s()(E),!E.defaultPrevented)){if(E.target&&E.target instanceof Element){const M=`[${v.parentMenu.root.getBitsAttr("sub-content")}]`;if(E.target.closest(M))return}v.parentMenu.onClose()}}function w(E){l()(E),!E.defaultPrevented&&v.parentMenu.onClose()}var _=N(),P=O(_);{var T=E=>{dh(E,wt(()=>u(m),()=>v.popperProps,{get ref(){return v.opts.ref},get enabled(){return v.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:w,get trapFocus(){return h()},get loop(){return i()},forceMount:!0,get id(){return r()},get shouldRender(){return v.shouldRender},popper:(R,k)=>{let H=()=>k==null?void 0:k().props,ot=()=>k==null?void 0:k().wrapperProps;const Q=S(()=>Dt(H(),{style:Ba("dropdown-menu")},{style:t.style}));var mt=N(),ft=O(mt);{var xt=lt=>{var J=N(),st=O(J);{let tt=S(()=>({props:u(Q),wrapperProps:ot(),...v.snippetProps}));Y(st,()=>t.child,()=>u(tt))}p(lt,J)},at=lt=>{var J=xh();Et(J,()=>({...ot()}));var st=z(J);Et(st,()=>({...u(Q)}));var tt=z(st);Y(tt,()=>t.children??nt),K(st),K(J),p(lt,J)};yt(ft,lt=>{t.child?lt(xt):lt(at,!1)})}p(R,mt)},$$slots:{popper:!0}}))},I=E=>{uh(E,wt(()=>u(m),()=>v.popperProps,{get ref(){return v.opts.ref},get open(){return v.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:w,get trapFocus(){return h()},get loop(){return i()},forceMount:!1,get id(){return r()},get shouldRender(){return v.shouldRender},popper:(R,k)=>{let H=()=>k==null?void 0:k().props,ot=()=>k==null?void 0:k().wrapperProps;const Q=S(()=>Dt(H(),{style:Ba("dropdown-menu")},{style:t.style}));var mt=N(),ft=O(mt);{var xt=lt=>{var J=N(),st=O(J);{let tt=S(()=>({props:u(Q),wrapperProps:ot(),...v.snippetProps}));Y(st,()=>t.child,()=>u(tt))}p(lt,J)},at=lt=>{var J=_h();Et(J,()=>({...ot()}));var st=z(J);Et(st,()=>({...u(Q)}));var tt=z(st);Y(tt,()=>t.children??nt),K(st),K(J),p(lt,J)};yt(ft,lt=>{t.child?lt(xt):lt(at,!1)})}p(R,mt)},$$slots:{popper:!0}}))};yt(P,E=>{d()?E(T):d()||E(I,1)})}p(n,_),X()}var Sh=U("<button><!></button>");function Ch(n,t){const e=sn();G(t,!0);let r=b(t,"id",19,()=>an(e)),o=b(t,"ref",15,null),i=b(t,"disabled",3,!1),s=b(t,"type",3,"button"),l=rt(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const c=di.create({id:F(()=>r()),disabled:F(()=>i()??!1),ref:F(()=>o(),h=>o(h))}),d=S(()=>Dt(l,c.props,{type:s()}));sh(n,{get id(){return r()},get ref(){return c.opts.ref},children:(h,f)=>{var v=N(),m=O(v);{var g=_=>{var P=N(),T=O(P);Y(T,()=>t.child,()=>({props:u(d)})),p(_,P)},w=_=>{var P=Sh();Et(P,()=>({...u(d)}));var T=z(P);Y(T,()=>t.children??nt),K(P),p(_,P)};yt(m,_=>{t.child?_(g):_(w,!1)})}p(h,v)},$$slots:{default:!0}}),X()}function Oh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=rt(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=O(o);L(i,()=>gh,(s,l)=>{l(s,wt(()=>r,{get open(){return e()},set open(c){e(c)}}))}),p(n,o),X()}function Ah(n,t){let e=rt(t,["$$slots","$$events","$$legacy"]);var r=N(),o=O(r);L(o,()=>ll,(i,s)=>{s(i,wt(()=>e))}),p(n,r)}function Eh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=O(o);{let s=S(()=>Qt("text-lg leading-none font-semibold",t.class));L(i,()=>Yu,(l,c)=>{c(l,wt({"data-slot":"dialog-title",get class(){return u(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}var Th=U("<div><!></div>");function Fh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=Th();Et(o,s=>({"data-slot":"dialog-header",class:s,...r}),[()=>Qt("flex flex-col gap-2 text-center sm:text-start",t.class)]);var i=z(o);Y(i,()=>t.children??nt),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}function Mh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=O(o);{let s=S(()=>Qt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t.class));L(i,()=>Xd,(l,c)=>{c(l,wt({"data-slot":"dialog-overlay",get class(){return u(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}/**
|
||
* @license @lucide/svelte v0.561.0 - ISC
|
||
*
|
||
* ISC License
|
||
*
|
||
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
|
||
*
|
||
* Permission to use, copy, modify, and/or distribute this software for any
|
||
* purpose with or without fee is hereby granted, provided that the above
|
||
* copyright notice and this permission notice appear in all copies.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||
*
|
||
* ---
|
||
*
|
||
* The MIT License (MIT) (for portions derived from Feather)
|
||
*
|
||
* Copyright (c) 2013-2023 Cole Bemis
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*
|
||
*/const Ih={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var kh=Dc("<svg><!><!></svg>");function Io(n,t){G(t,!0);const e=b(t,"color",3,"currentColor"),r=b(t,"size",3,24),o=b(t,"strokeWidth",3,2),i=b(t,"absoluteStrokeWidth",3,!1),s=b(t,"iconNode",19,()=>[]),l=rt(t,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var c=kh();Et(c,f=>({...Ih,...l,width:r(),height:r(),stroke:e(),"stroke-width":f,class:["lucide-icon lucide",t.name&&`lucide-${t.name}`,t.class]}),[()=>i()?Number(o())*24/Number(r()):o()]);var d=z(c);tn(d,17,s,hn,(f,v)=>{var m=S(()=>Nc(u(v),2));let g=()=>u(m)[0],w=()=>u(m)[1];var _=N(),P=O(_);Vc(P,g,!0,(T,I)=>{Et(T,()=>({...w()}))}),p(f,_)});var h=D(d);Y(h,()=>t.children??nt),K(c),p(n,c),X()}function Dh(n,t){G(t,!0);/**
|
||
* @license @lucide/svelte v0.561.0 - ISC
|
||
*
|
||
* ISC License
|
||
*
|
||
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
|
||
*
|
||
* Permission to use, copy, modify, and/or distribute this software for any
|
||
* purpose with or without fee is hereby granted, provided that the above
|
||
* copyright notice and this permission notice appear in all copies.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||
*
|
||
* ---
|
||
*
|
||
* The MIT License (MIT) (for portions derived from Feather)
|
||
*
|
||
* Copyright (c) 2013-2023 Cole Bemis
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*
|
||
*/let e=rt(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Io(n,wt({name:"x"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=O(s);Y(l,()=>t.children??nt),p(o,s)},$$slots:{default:!0}})),X()}var Nh=U('<!> <span class="sr-only">Close</span>',1),Rh=U("<!> <!>",1),Bh=U("<!> <!>",1);function Lh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"showCloseButton",3,!0),o=rt(t,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);Ah(n,wt(()=>t.portalProps,{children:(i,s)=>{var l=Bh(),c=O(l);L(c,()=>Mh,(h,f)=>{f(h,{})});var d=D(c,2);{let h=S(()=>Qt("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class));L(d,()=>bh,(f,v)=>{v(f,wt({"data-slot":"dialog-content",get class(){return u(h)}},()=>o,{get ref(){return e()},set ref(m){e(m)},children:(m,g)=>{var w=Rh(),_=O(w);Y(_,()=>t.children??nt);var P=D(_,2);{var T=I=>{var E=N(),M=O(E);L(M,()=>ph,(R,k)=>{k(R,{class:"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:(H,ot)=>{var Q=Nh(),mt=O(Q);Dh(mt,{}),q(2),p(H,Q)},$$slots:{default:!0}})}),p(I,E)};yt(P,I=>{r()&&I(T)})}p(m,w)},$$slots:{default:!0}}))})}p(i,l)},$$slots:{default:!0}})),X()}function Wh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=O(o);{let s=S(()=>Qt("text-muted-foreground text-sm",t.class));L(i,()=>Zd,(l,c)=>{c(l,wt({"data-slot":"dialog-description",get class(){return u(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}function zh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=rt(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=O(o);L(i,()=>wh,(s,l)=>{l(s,wt(()=>r,{get open(){return e()},set open(c){e(c)}}))}),p(n,o),X()}function Ql(n,t){let e=rt(t,["$$slots","$$events","$$legacy"]);var r=N(),o=O(r);L(o,()=>ll,(i,s)=>{s(i,wt(()=>e))}),p(n,r)}function Kh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"sideOffset",3,4),o=rt(t,["$$slots","$$events","$$legacy","ref","sideOffset","portalProps","class"]);Ql(n,wt(()=>t.portalProps,{children:(i,s)=>{var l=N(),c=O(l);{let d=S(()=>Qt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none",t.class));L(c,()=>Ph,(h,f)=>{f(h,wt({"data-slot":"dropdown-menu-content",get sideOffset(){return r()},get class(){return u(d)}},()=>o,{get ref(){return e()},set ref(v){e(v)}}))})}p(i,l)},$$slots:{default:!0}})),X()}function Wa(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"variant",3,"default"),o=rt(t,["$$slots","$$events","$$legacy","ref","class","inset","variant"]);var i=N(),s=O(i);{let l=S(()=>Qt("data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t.class));L(s,()=>hh,(c,d)=>{d(c,wt({"data-slot":"dropdown-menu-item",get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return u(l)}},()=>o,{get ref(){return e()},set ref(h){e(h)}}))})}p(n,i),X()}function Vh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=rt(t,["$$slots","$$events","$$legacy","ref"]);var o=N(),i=O(o);L(i,()=>Ch,(s,l)=>{l(s,wt({"data-slot":"dropdown-menu-trigger"},()=>r,{get ref(){return e()},set ref(c){e(c)}}))}),p(n,o),X()}const Hh=["EA","BX","CA","PK","PLT","LF"],Uh=["Framing","Insulation","Drywall","T-Bar","Painting","Masking","Misc"],qh=["ACT","Channel","Fasteners","Finishing Materials","Adhesives","Mud","Corner Bead","Sanding","Tape","Metal Studs","Metal Tracks","FRP","Gyp","Insulation","Paint","Weatherproofing","Misc"];var Yh=U('<input type="hidden" name="id"/>'),Gh=U("<option> </option>"),Xh=U("<option> </option>"),jh=U("<option> </option>"),Zh=U("<option> </option>"),Jh=U('<p class="text-destructive text-sm"> </p>'),Qh=U('<form method="POST" class="flex flex-col gap-4"><!> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <!></div> <div class="space-y-2"><!> <!></div></div> <div class="space-y-2"><!> <!></div> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <select id="UOM" name="UOM" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="space-y-2"><!> <!></div></div> <div class="space-y-2"><!> <!></div> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <select id="Catagory" name="Catagory" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="space-y-2"><!> <select id="Sub_Catagory" name="Sub_Catagory" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div></div> <div class="space-y-2"><!> <select id="Parent" name="Parent" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="flex flex-wrap gap-6"><label class="flex items-center gap-2 text-sm"><input type="checkbox" name="Has_Parent" value="on" class="border-input size-4 rounded"/> Has Parent</label> <label class="flex items-center gap-2 text-sm"><input type="checkbox" name="Stock" value="on" class="border-input size-4 rounded"/> Stock</label></div> <!> <div class="flex justify-end gap-2"><!></div></form>');function $h(n,t){G(t,!0);let e=b(t,"item",3,null),r=b(t,"itemsForParent",19,()=>[]);const o=S(()=>!!e()),i=S(()=>{var x;return((x=e())==null?void 0:x.Item)??""}),s=S(()=>{var x;return((x=e())==null?void 0:x.SKU)??""}),l=S(()=>{var x;return((x=e())==null?void 0:x.Description)??""}),c=S(()=>{var x;return((x=e())==null?void 0:x.UOM)??""}),d=S(()=>{var x;return((x=e())==null?void 0:x.Cost)!=null?String(e().Cost):""}),h=S(()=>{var x;return((x=e())==null?void 0:x.Vendor)??""}),f=S(()=>{var x,W;return Array.isArray((x=e())==null?void 0:x.Catagory)?e().Catagory[0]:((W=e())==null?void 0:W.Catagory)??""}),v=S(()=>{var x,W;return Array.isArray((x=e())==null?void 0:x.Sub_Catagory)?e().Sub_Catagory[0]:((W=e())==null?void 0:W.Sub_Catagory)??""}),m=S(()=>{var x;return((x=e())==null?void 0:x.Parent)??""}),g=S(()=>{var x;return!!((x=e())!=null&&x.Has_Parent)}),w=S(()=>{var x;return!!((x=e())!=null&&x.Stock)});var _=Qh(),P=z(_);{var T=x=>{var W=Yh();Lo(W),St(()=>Qa(W,e().id)),p(x,W)};yt(P,x=>{u(o)&&x(T)})}var I=D(P,2),E=z(I),M=z(E);Ae(M,{for:"Item",children:(x,W)=>{q();var B=j("Item");p(x,B)},$$slots:{default:!0}});var R=D(M,2);sr(R,{id:"Item",name:"Item",get value(){return u(i)},required:!0}),K(E);var k=D(E,2),H=z(k);Ae(H,{for:"SKU",children:(x,W)=>{q();var B=j("SKU");p(x,B)},$$slots:{default:!0}});var ot=D(H,2);sr(ot,{id:"SKU",name:"SKU",get value(){return u(s)}}),K(k),K(I);var Q=D(I,2),mt=z(Q);Ae(mt,{for:"Description",children:(x,W)=>{q();var B=j("Description");p(x,B)},$$slots:{default:!0}});var ft=D(mt,2);sr(ft,{id:"Description",name:"Description",get value(){return u(l)}}),K(Q);var xt=D(Q,2),at=z(xt),lt=z(at);Ae(lt,{for:"UOM",children:(x,W)=>{q();var B=j("UOM");p(x,B)},$$slots:{default:!0}});var J=D(lt,2),st=z(J);st.value=st.__value="";var tt=D(st);tn(tt,17,()=>Hh,hn,(x,W)=>{var B=Gh(),Xt=z(B,!0);K(B);var jt={};St(()=>{Do(B,u(c)===u(W)),At(Xt,u(W)),jt!==(jt=u(W))&&(B.value=(B.__value=u(W))??"")}),p(x,B)}),K(J),K(at);var _t=D(at,2),Rt=z(_t);Ae(Rt,{for:"Cost",children:(x,W)=>{q();var B=j("Cost");p(x,B)},$$slots:{default:!0}});var $t=D(Rt,2);sr($t,{id:"Cost",name:"Cost",type:"number",step:"any",get value(){return u(d)}}),K(_t),K(xt);var Kt=D(xt,2),kt=z(Kt);Ae(kt,{for:"Vendor",children:(x,W)=>{q();var B=j("Vendor");p(x,B)},$$slots:{default:!0}});var $n=D(kt,2);sr($n,{id:"Vendor",name:"Vendor",get value(){return u(h)}}),K(Kt);var Gt=D(Kt,2),ne=z(Gt),fe=z(ne);Ae(fe,{for:"Catagory",children:(x,W)=>{q();var B=j("Catagory");p(x,B)},$$slots:{default:!0}});var Ke=D(fe,2),Mt=z(Ke);Mt.value=Mt.__value="";var Ve=D(Mt);tn(Ve,17,()=>Uh,hn,(x,W)=>{var B=Xh(),Xt=z(B,!0);K(B);var jt={};St(()=>{Do(B,u(f)===u(W)),At(Xt,u(W)),jt!==(jt=u(W))&&(B.value=(B.__value=u(W))??"")}),p(x,B)}),K(Ke),K(ne);var xe=D(ne,2),re=z(xe);Ae(re,{for:"Sub_Catagory",children:(x,W)=>{q();var B=j("Sub_Catagory");p(x,B)},$$slots:{default:!0}});var it=D(re,2),oe=z(it);oe.value=oe.__value="";var cn=D(oe);tn(cn,17,()=>qh,hn,(x,W)=>{var B=jh(),Xt=z(B,!0);K(B);var jt={};St(()=>{Do(B,u(v)===u(W)),At(Xt,u(W)),jt!==(jt=u(W))&&(B.value=(B.__value=u(W))??"")}),p(x,B)}),K(it),K(xe),K(Gt);var se=D(Gt,2),_e=z(se);Ae(_e,{for:"Parent",children:(x,W)=>{q();var B=j("Parent");p(x,B)},$$slots:{default:!0}});var Pe=D(_e,2),Se=z(Pe);Se.value=Se.__value="";var Ce=D(Se);tn(Ce,17,r,hn,(x,W)=>{var B=Zh(),Xt=z(B,!0);K(B);var jt={};St(()=>{Do(B,u(m)===u(W).id),At(Xt,u(W).Item||u(W).SKU||u(W).id),jt!==(jt=u(W).id)&&(B.value=(B.__value=u(W).id)??"")}),p(x,B)}),K(Pe),K(se);var he=D(se,2),ie=z(he),He=z(ie);Lo(He),q(),K(ie);var Ue=D(ie,2),un=z(Ue);Lo(un),q(),K(Ue),K(he);var ct=D(he,2);{var dt=x=>{var W=Jh(),B=z(W,!0);K(W),St(()=>At(B,t.error)),p(x,W)};yt(ct,x=>{t.error&&x(dt)})}var ut=D(ct,2),It=z(ut);$a(It,{type:"submit",children:(x,W)=>{q();var B=j();St(()=>At(B,t.submitLabel)),p(x,B)},$$slots:{default:!0}}),K(ut),K(_),ja(_,(x,W)=>{var B;return(B=Za)==null?void 0:B(x,W)},()=>()=>async({update:x,result:W})=>{var B,Xt;await x(),W.type==="success"&&((B=W.data)!=null&&B.success)&&((Xt=t.onSuccess)==null||Xt.call(t))}),St(()=>{Ja(_,"action",t.action),pa(He,u(g)),pa(un,u(w))}),p(n,_),X()}function tg(n,t){G(t,!0);/**
|
||
* @license @lucide/svelte v0.561.0 - ISC
|
||
*
|
||
* ISC License
|
||
*
|
||
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
|
||
*
|
||
* Permission to use, copy, modify, and/or distribute this software for any
|
||
* purpose with or without fee is hereby granted, provided that the above
|
||
* copyright notice and this permission notice appear in all copies.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||
*
|
||
* ---
|
||
*
|
||
* The MIT License (MIT) (for portions derived from Feather)
|
||
*
|
||
* Copyright (c) 2013-2023 Cole Bemis
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*
|
||
*/let e=rt(t,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];Io(n,wt({name:"ellipsis"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=O(s);Y(l,()=>t.children??nt),p(o,s)},$$slots:{default:!0}})),X()}function eg(n,t){G(t,!0);/**
|
||
* @license @lucide/svelte v0.561.0 - ISC
|
||
*
|
||
* ISC License
|
||
*
|
||
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
|
||
*
|
||
* Permission to use, copy, modify, and/or distribute this software for any
|
||
* purpose with or without fee is hereby granted, provided that the above
|
||
* copyright notice and this permission notice appear in all copies.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||
*
|
||
* ---
|
||
*
|
||
* The MIT License (MIT) (for portions derived from Feather)
|
||
*
|
||
* Copyright (c) 2013-2023 Cole Bemis
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*
|
||
*/let e=rt(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];Io(n,wt({name:"pencil"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=O(s);Y(l,()=>t.children??nt),p(o,s)},$$slots:{default:!0}})),X()}function ng(n,t){G(t,!0);/**
|
||
* @license @lucide/svelte v0.561.0 - ISC
|
||
*
|
||
* ISC License
|
||
*
|
||
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
|
||
*
|
||
* Permission to use, copy, modify, and/or distribute this software for any
|
||
* purpose with or without fee is hereby granted, provided that the above
|
||
* copyright notice and this permission notice appear in all copies.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||
*
|
||
* ---
|
||
*
|
||
* The MIT License (MIT) (for portions derived from Feather)
|
||
*
|
||
* Copyright (c) 2013-2023 Cole Bemis
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*
|
||
*/let e=rt(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Io(n,wt({name:"plus"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=O(s);Y(l,()=>t.children??nt),p(o,s)},$$slots:{default:!0}})),X()}function rg(n,t){G(t,!0);/**
|
||
* @license @lucide/svelte v0.561.0 - ISC
|
||
*
|
||
* ISC License
|
||
*
|
||
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
|
||
*
|
||
* Permission to use, copy, modify, and/or distribute this software for any
|
||
* purpose with or without fee is hereby granted, provided that the above
|
||
* copyright notice and this permission notice appear in all copies.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||
*
|
||
* ---
|
||
*
|
||
* The MIT License (MIT) (for portions derived from Feather)
|
||
*
|
||
* Copyright (c) 2013-2023 Cole Bemis
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*
|
||
*/let e=rt(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];Io(n,wt({name:"trash-2"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=O(s);Y(l,()=>t.children??nt),p(o,s)},$$slots:{default:!0}})),X()}var og=U("<!> New item",1),sg=U('<!> <p class="text-muted-foreground text-sm">PocketBase collection: full CRUD.</p>',1),ig=U("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),ag=U('<span class="text-muted-foreground">—</span>'),lg=U("<!> <!>",1),cg=U('<span class="text-muted-foreground">—</span>'),ug=U("<!> <!>",1),dg=U('<span class="text-muted-foreground">No</span>'),fg=U('<span class="font-mono text-xs"> </span>'),hg=U('<span class="text-muted-foreground">—</span>'),gg=U("<!> Edit",1),vg=U("<!> Delete",1),pg=U('<!> <form method="POST" action="?/delete" class="hidden"><input type="hidden" name="id"/></form> <!>',1),mg=U("<!> <!>",1),yg=U("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),bg=U("<!> <!>",1),wg=U("<!> <!>",1),xg=U("<!> <!>",1),_g=U("<!> <!>",1),Pg=U('<main class="container mx-auto flex flex-col gap-6 py-8"><div class="flex items-center justify-between"><h1 class="text-2xl font-semibold">Stackq Items</h1> <div class="flex items-center gap-2"><span class="text-muted-foreground text-sm"> </span> <!></div></div> <!> <!></main>');function Bg(n,t){G(t,!0);let e=Z(!1),r=Z(null),o=Z("create");const i=S(()=>{var M;return((M=t.data)==null?void 0:M.items)??[]}),s=S(()=>{var M;return((M=t.data)==null?void 0:M.itemsForParent)??[]});function l(M){return M==null?[]:Array.isArray(M)?M:[M]}function c(M){if(!M)return"—";try{return new Date(M).toLocaleDateString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return M}}function d(){A(r,null),A(o,"create"),A(e,!0)}function h(M){A(r,M,!0),A(o,"update"),A(e,!0)}function f(){A(e,!1),A(r,null)}const v=S(()=>{var M,R,k;return((M=t.data)==null?void 0:M.form)==="create"||((R=t.data)==null?void 0:R.form)==="update"?((k=t.data)==null?void 0:k.error)??null:null});zt(()=>{var M,R;u(v)&&(((M=t.data)==null?void 0:M.form)==="create"||((R=t.data)==null?void 0:R.form)==="update")&&A(e,!0)});var m=Pg();Hc("1kn3tit",M=>{Rc(()=>{Bc.title="Items – Stackq"})});var g=z(m),w=D(z(g),2),_=z(w),P=z(_);K(_);var T=D(_,2);$a(T,{onclick:d,children:(M,R)=>{var k=og(),H=O(k);ng(H,{class:"mr-2 size-4"}),q(),p(M,k)},$$slots:{default:!0}}),K(w),K(g);var I=D(g,2);$c(I,{children:(M,R)=>{var k=wg(),H=O(k);tu(H,{children:(Q,mt)=>{var ft=sg(),xt=O(ft);eu(xt,{children:(at,lt)=>{q();var J=j("Stackq_Items");p(at,J)},$$slots:{default:!0}}),q(2),p(Q,ft)},$$slots:{default:!0}});var ot=D(H,2);nu(ot,{class:"p-0",children:(Q,mt)=>{var ft=N(),xt=O(ft);L(xt,()=>cu,(at,lt)=>{lt(at,{children:(J,st)=>{var tt=bg(),_t=O(tt);L(_t,()=>vu,($t,Kt)=>{Kt($t,{children:(kt,$n)=>{var Gt=N(),ne=O(Gt);L(ne,()=>zs,(fe,Ke)=>{Ke(fe,{children:(Mt,Ve)=>{var xe=ig(),re=O(xe);L(re,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("Item");p(ut,x)},$$slots:{default:!0}})});var it=D(re,2);L(it,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("SKU");p(ut,x)},$$slots:{default:!0}})});var oe=D(it,2);L(oe,()=>Ut,(ct,dt)=>{dt(ct,{class:"max-w-[200px]",children:(ut,It)=>{q();var x=j("Description");p(ut,x)},$$slots:{default:!0}})});var cn=D(oe,2);L(cn,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("UOM");p(ut,x)},$$slots:{default:!0}})});var se=D(cn,2);L(se,()=>Ut,(ct,dt)=>{dt(ct,{class:"text-right",children:(ut,It)=>{q();var x=j("Cost");p(ut,x)},$$slots:{default:!0}})});var _e=D(se,2);L(_e,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("Vendor");p(ut,x)},$$slots:{default:!0}})});var Pe=D(_e,2);L(Pe,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("Catagory");p(ut,x)},$$slots:{default:!0}})});var Se=D(Pe,2);L(Se,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("Sub_Catagory");p(ut,x)},$$slots:{default:!0}})});var Ce=D(Se,2);L(Ce,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("Has Parent");p(ut,x)},$$slots:{default:!0}})});var he=D(Ce,2);L(he,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("Parent");p(ut,x)},$$slots:{default:!0}})});var ie=D(he,2);L(ie,()=>Ut,(ct,dt)=>{dt(ct,{children:(ut,It)=>{q();var x=j("Stock");p(ut,x)},$$slots:{default:!0}})});var He=D(ie,2);L(He,()=>Ut,(ct,dt)=>{dt(ct,{class:"text-muted-foreground",children:(ut,It)=>{q();var x=j("created");p(ut,x)},$$slots:{default:!0}})});var Ue=D(He,2);L(Ue,()=>Ut,(ct,dt)=>{dt(ct,{class:"text-muted-foreground",children:(ut,It)=>{q();var x=j("updated");p(ut,x)},$$slots:{default:!0}})});var un=D(Ue,2);L(un,()=>Ut,(ct,dt)=>{dt(ct,{class:"w-[70px]",children:(ut,It)=>{q();var x=j("Actions");p(ut,x)},$$slots:{default:!0}})}),p(Mt,xe)},$$slots:{default:!0}})}),p(kt,Gt)},$$slots:{default:!0}})});var Rt=D(_t,2);L(Rt,()=>du,($t,Kt)=>{Kt($t,{children:(kt,$n)=>{var Gt=N(),ne=O(Gt);{var fe=Mt=>{var Ve=N(),xe=O(Ve);L(xe,()=>zs,(re,it)=>{it(re,{children:(oe,cn)=>{var se=N(),_e=O(se);L(_e,()=>Wt,(Pe,Se)=>{Se(Pe,{colspan:"14",class:"h-24 text-center text-muted-foreground",children:(Ce,he)=>{q();var ie=j("No items. Create one or check PocketBase collection name and auth.");p(Ce,ie)},$$slots:{default:!0}})}),p(oe,se)},$$slots:{default:!0}})}),p(Mt,Ve)},Ke=Mt=>{var Ve=N(),xe=O(Ve);tn(xe,17,()=>u(i),re=>re.id,(re,it)=>{var oe=N(),cn=O(oe);L(cn,()=>zs,(se,_e)=>{_e(se,{children:(Pe,Se)=>{var Ce=yg(),he=O(Ce);L(he,()=>Wt,(gt,vt)=>{vt(gt,{class:"font-medium",children:(pt,Vt)=>{q();var $=j();St(()=>At($,u(it).Item??"—")),p(pt,$)},$$slots:{default:!0}})});var ie=D(he,2);L(ie,()=>Wt,(gt,vt)=>{vt(gt,{class:"font-mono text-xs",children:(pt,Vt)=>{q();var $=j();St(()=>At($,u(it).SKU??"—")),p(pt,$)},$$slots:{default:!0}})});var He=D(ie,2);{let gt=S(()=>u(it).Description??"");L(He,()=>Wt,(vt,pt)=>{pt(vt,{class:"max-w-[200px] truncate",get title(){return u(gt)},children:(Vt,$)=>{q();var Ct=j();St(()=>At(Ct,u(it).Description??"—")),p(Vt,Ct)},$$slots:{default:!0}})})}var Ue=D(He,2);L(Ue,()=>Wt,(gt,vt)=>{vt(gt,{children:(pt,Vt)=>{or(pt,{variant:"outline",children:($,Ct)=>{q();var Ht=j();St(()=>At(Ht,u(it).UOM??"—")),p($,Ht)},$$slots:{default:!0}})},$$slots:{default:!0}})});var un=D(Ue,2);L(un,()=>Wt,(gt,vt)=>{vt(gt,{class:"text-right tabular-nums",children:(pt,Vt)=>{q();var $=j();St(Ct=>At($,Ct),[()=>u(it).Cost!=null?Number(u(it).Cost).toLocaleString():"—"]),p(pt,$)},$$slots:{default:!0}})});var ct=D(un,2);L(ct,()=>Wt,(gt,vt)=>{vt(gt,{class:"text-muted-foreground",children:(pt,Vt)=>{q();var $=j();St(()=>At($,u(it).Vendor??"—")),p(pt,$)},$$slots:{default:!0}})});var dt=D(ct,2);L(dt,()=>Wt,(gt,vt)=>{vt(gt,{children:(pt,Vt)=>{var $=lg(),Ct=O($);tn(Ct,17,()=>l(u(it).Catagory),hn,(ht,Pt)=>{or(ht,{variant:"secondary",class:"mr-1 text-xs",children:(te,ks)=>{q();var Oe=j();St(()=>At(Oe,u(Pt))),p(te,Oe)},$$slots:{default:!0}})});var Ht=D(Ct,2);{var ae=ht=>{var Pt=ag();p(ht,Pt)},Ot=S(()=>l(u(it).Catagory).length===0);yt(Ht,ht=>{u(Ot)&&ht(ae)})}p(pt,$)},$$slots:{default:!0}})});var ut=D(dt,2);L(ut,()=>Wt,(gt,vt)=>{vt(gt,{children:(pt,Vt)=>{var $=ug(),Ct=O($);tn(Ct,17,()=>l(u(it).Sub_Catagory),hn,(ht,Pt)=>{or(ht,{variant:"outline",class:"mr-1 text-xs",children:(te,ks)=>{q();var Oe=j();St(()=>At(Oe,u(Pt))),p(te,Oe)},$$slots:{default:!0}})});var Ht=D(Ct,2);{var ae=ht=>{var Pt=cg();p(ht,Pt)},Ot=S(()=>l(u(it).Sub_Catagory).length===0);yt(Ht,ht=>{u(Ot)&&ht(ae)})}p(pt,$)},$$slots:{default:!0}})});var It=D(ut,2);L(It,()=>Wt,(gt,vt)=>{vt(gt,{children:(pt,Vt)=>{var $=N(),Ct=O($);{var Ht=Ot=>{or(Ot,{children:(ht,Pt)=>{q();var te=j("Yes");p(ht,te)},$$slots:{default:!0}})},ae=Ot=>{var ht=dg();p(Ot,ht)};yt(Ct,Ot=>{u(it).Has_Parent?Ot(Ht):Ot(ae,!1)})}p(pt,$)},$$slots:{default:!0}})});var x=D(It,2);L(x,()=>Wt,(gt,vt)=>{vt(gt,{class:"text-muted-foreground",children:(pt,Vt)=>{var $=N(),Ct=O($);{var Ht=ht=>{var Pt=j();St(()=>At(Pt,u(it).expand.Parent.Item??u(it).expand.Parent.SKU??u(it).Parent)),p(ht,Pt)},ae=ht=>{var Pt=fg(),te=z(Pt,!0);K(Pt),St(()=>At(te,u(it).Parent)),p(ht,Pt)},Ot=ht=>{var Pt=j("—");p(ht,Pt)};yt(Ct,ht=>{var Pt;(Pt=u(it).expand)!=null&&Pt.Parent?ht(Ht):u(it).Parent?ht(ae,1):ht(Ot,!1)})}p(pt,$)},$$slots:{default:!0}})});var W=D(x,2);L(W,()=>Wt,(gt,vt)=>{vt(gt,{children:(pt,Vt)=>{var $=N(),Ct=O($);{var Ht=Ot=>{or(Ot,{variant:"default",children:(ht,Pt)=>{q();var te=j("Stock");p(ht,te)},$$slots:{default:!0}})},ae=Ot=>{var ht=hg();p(Ot,ht)};yt(Ct,Ot=>{u(it).Stock?Ot(Ht):Ot(ae,!1)})}p(pt,$)},$$slots:{default:!0}})});var B=D(W,2);L(B,()=>Wt,(gt,vt)=>{vt(gt,{class:"text-muted-foreground text-xs",children:(pt,Vt)=>{q();var $=j();St(Ct=>At($,Ct),[()=>c(u(it).created)]),p(pt,$)},$$slots:{default:!0}})});var Xt=D(B,2);L(Xt,()=>Wt,(gt,vt)=>{vt(gt,{class:"text-muted-foreground text-xs",children:(pt,Vt)=>{q();var $=j();St(Ct=>At($,Ct),[()=>c(u(it).updated)]),p(pt,$)},$$slots:{default:!0}})});var jt=D(Xt,2);L(jt,()=>Wt,(gt,vt)=>{vt(gt,{children:(pt,Vt)=>{var $=N(),Ct=O($);L(Ct,()=>zh,(Ht,ae)=>{ae(Ht,{children:(Ot,ht)=>{var Pt=mg(),te=O(Pt);L(te,()=>Vh,(Oe,Ds)=>{Ds(Oe,{class:"border-0 bg-transparent hover:bg-muted inline-flex size-8 items-center justify-center rounded-md",children:(Ns,$l)=>{tg(Ns,{class:"size-4"})},$$slots:{default:!0}})});var ks=D(te,2);L(ks,()=>Ql,(Oe,Ds)=>{Ds(Oe,{children:(Ns,$l)=>{var oa=N(),tc=O(oa);L(tc,()=>Kh,(ec,nc)=>{nc(ec,{align:"end",children:(rc,Sg)=>{var sa=pg(),ia=O(sa);L(ia,()=>Wa,(er,En)=>{En(er,{onclick:()=>h(u(it)),children:(Tn,sc)=>{var nr=gg(),Rs=O(nr);eg(Rs,{class:"mr-2 size-4"}),q(),p(Tn,nr)},$$slots:{default:!0}})});var tr=D(ia,2),aa=z(tr);Lo(aa),K(tr),ja(tr,er=>{var En;return(En=Za)==null?void 0:En(er)});var oc=D(tr,2);L(oc,()=>Wa,(er,En)=>{En(er,{class:"text-destructive focus:text-destructive cursor-pointer",onclick:()=>{var Tn;confirm("Delete this item? This cannot be undone.")&&((Tn=document.getElementById("delete-form-"+u(it).id))==null||Tn.requestSubmit())},children:(Tn,sc)=>{var nr=vg(),Rs=O(nr);rg(Rs,{class:"mr-2 size-4"}),q(),p(Tn,nr)},$$slots:{default:!0}})}),St(()=>{Ja(tr,"id",`delete-form-${u(it).id??""}`),Qa(aa,u(it).id)}),p(rc,sa)},$$slots:{default:!0}})}),p(Ns,oa)},$$slots:{default:!0}})}),p(Ot,Pt)},$$slots:{default:!0}})}),p(pt,$)},$$slots:{default:!0}})}),p(Pe,Ce)},$$slots:{default:!0}})}),p(re,oe)}),p(Mt,Ve)};yt(ne,Mt=>{u(i).length===0?Mt(fe):Mt(Ke,!1)})}p(kt,Gt)},$$slots:{default:!0}})}),p(J,tt)},$$slots:{default:!0}})}),p(Q,ft)},$$slots:{default:!0}}),p(M,k)},$$slots:{default:!0}});var E=D(I,2);L(E,()=>Oh,(M,R)=>{R(M,{get open(){return u(e)},set open(k){A(e,k,!0)},children:(k,H)=>{var ot=N(),Q=O(ot);L(Q,()=>Lh,(mt,ft)=>{ft(mt,{class:"max-h-[90vh] overflow-y-auto sm:max-w-[500px]",children:(xt,at)=>{var lt=_g(),J=O(lt);L(J,()=>Fh,(tt,_t)=>{_t(tt,{children:(Rt,$t)=>{var Kt=xg(),kt=O(Kt);L(kt,()=>Eh,(Gt,ne)=>{ne(Gt,{children:(fe,Ke)=>{q();var Mt=j();St(()=>At(Mt,u(r)?"Edit item":"New item")),p(fe,Mt)},$$slots:{default:!0}})});var $n=D(kt,2);L($n,()=>Wh,(Gt,ne)=>{ne(Gt,{children:(fe,Ke)=>{q();var Mt=j();St(()=>At(Mt,u(r)?"Update the item below.":"Add a new Stackq item.")),p(fe,Mt)},$$slots:{default:!0}})}),p(Rt,Kt)},$$slots:{default:!0}})});var st=D(J,2);{let tt=S(()=>u(r)?"?/update":"?/create"),_t=S(()=>u(r)?"Update":"Create"),Rt=S(()=>u(v)??null);$h(st,{get item(){return u(r)},get itemsForParent(){return u(s)},get action(){return u(tt)},get submitLabel(){return u(_t)},get error(){return u(Rt)},onSuccess:f})}p(xt,lt)},$$slots:{default:!0}})}),p(k,ot)},$$slots:{default:!0}})}),K(m),St(()=>At(P,`${u(i).length??""} items`)),p(n,m),X()}export{Bg as default};
|