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