@stacksjs/components 0.2.870 → 0.2.872
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-pg8mzsq3.stx → Button-1qmncazg.stx} +12 -5
- package/dist/{FilterChips-mpmev5v5.stx → FilterChips-xg7pgkk2.stx} +6 -1
- package/dist/{Pager-5e7knyqh.stx → Pager-7gn8jygq.stx} +4 -1
- package/dist/{PasswordInput-n2ven456.stx → PasswordInput-z2g5ha65.stx} +16 -6
- package/dist/{TextInput-tyqzz3jy.stx → TextInput-m4a4kpfy.stx} +5 -3
- package/dist/{Tooltip-tt73d42w.stx → Tooltip-wy1nrv9a.stx} +10 -0
- package/dist/index.js +2 -2
- package/dist/ui/button/Button.d.ts +7 -0
- package/dist/ui/input/TextInput.d.ts +3 -1
- package/dist/ui/mobile/FilterChips.d.ts +5 -0
- package/package.json +3 -3
- package/src/ui/button/Button.stx +12 -5
- package/src/ui/input/PasswordInput.stx +16 -6
- package/src/ui/input/TextInput.stx +5 -3
- package/src/ui/mobile/FilterChips.stx +6 -1
- package/src/ui/pager/Pager.stx +4 -1
- package/src/ui/tooltip/Tooltip.stx +10 -0
package/dist/index.js
CHANGED
|
@@ -8,9 +8,9 @@ var Ia={__stx:!0,src:"./components/CodeBlock.stx"};var Aa={__stx:!0,src:"./compo
|
|
|
8
8
|
Documentation: ${s.docsUrl}`;else if(e)a+=`
|
|
9
9
|
Documentation: https://stacksjs.com/components/${e.toLowerCase()}`;return a}toJSON(){return{name:this.name,message:this.message,component:this.component,context:this.context,stack:this.stack}}}var ue={invalidProp(e,t,s,a){return new Y(e,`Invalid prop value for "${t}"`,{prop:t,received:s,expected:a,details:Array.isArray(a)?`The "${t}" prop must be one of the allowed values`:`The "${t}" prop does not match the expected type`})},requiredProp(e,t){return new Y(e,`Required prop "${t}" is missing`,{prop:t,details:`The "${t}" prop is required for ${e} to function correctly`})},invalidType(e,t,s,a){return new Y(e,`Invalid type for prop "${t}"`,{prop:t,received:typeof s,expected:a,details:`Expected "${t}" to be of type ${a}, but received ${typeof s}`})},componentNotFound(e){return new Y("ComponentLoader",`Component "${e}" not found`,{component:e,details:"Make sure the component is properly imported and registered"})},invalidChildren(e,t,s){return new Y(e,"Invalid children",{received:typeof t,expected:s,details:`${e} expects ${s} as children`})},stateUpdate(e,t,s){return new Y(e,`Failed to update state "${t}"`,{details:s.message})},eventHandler(e,t,s){return new Y(e,`Error in "${t}" event handler`,{details:s.message})},render(e,t){return new Y(e,"Failed to render component",{details:t.message})}},Me=null;function Gh(e){Me=e}function Uh(){Me=null}function Re(e,t={}){let{throwError:s=!0,logError:a=!0}=t;if(a){if(console.error("Component Error:",e),e instanceof Y)console.group("Error Details"),console.log("Component:",e.component),console.log("Context:",e.context),console.groupEnd()}if(Me)try{Me(e)}catch(o){console.error("Error in error handler:",o)}if(s)throw e}function Dt(e,t,s){return(...a)=>{try{let o=e(...a);if(o instanceof Promise)return o.catch((n)=>{let r=ue.eventHandler(t,s,n);throw Re(r,{throwError:!1}),r});return o}catch(o){let n=ue.eventHandler(t,s,o);throw Re(n,{throwError:!1}),n}}}function vo(e,t){if(!e)throw t}function wo(e,t,s={}){let a=Y.formatMessage(e,t,s);console.warn(`\u26A0\uFE0F ${a}`)}function Jh(e,t){vo(e,t)}function Yh(e){let t=typeof process<"u"&&process.env.DEBUG==="true";return{log(...s){if(t)console.log(`[${e}]`,...s)},warn(s,a){wo(e,s,a)},error(s,a){let o=new Y(e,s,a);Re(o,{throwError:!1})}}}function Xh(e,t,s){try{return t()}catch(a){let o=ue.render(e,a);return Re(o,{throwError:!1}),s}}class q{validate;message;isRequired;constructor(e,t,s=!1){this.validate=e;this.message=t;this.isRequired=s}get required(){return new q(this.validate,this.message,!0)}}var f={string:new q((e)=>typeof e==="string",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`string\`.`),number:new q((e)=>typeof e==="number"&&!Number.isNaN(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`number\`.`),boolean:new q((e)=>typeof e==="boolean",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`boolean\`.`),func:new q((e)=>typeof e==="function",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`function\`.`),object:new q((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`object\`.`),array:new q((e)=>Array.isArray(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`array\`.`),any:new q(()=>!0,()=>""),oneOf(e){return new q((t)=>e.includes(t),(t,s,a)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${a}\`, expected one of [${e.map((o)=>JSON.stringify(o)).join(", ")}].`)},oneOfType(e){return new q((t,s,a)=>e.some((o)=>o.validate(t,s,a)),(t,s,a)=>`Invalid prop \`${s}\` supplied to \`${a}\`, expected one of the specified types.`)},arrayOf(e){return new q((t,s,a)=>{if(!Array.isArray(t))return!1;return t.every((o,n)=>e.validate(o,`${s}[${n}]`,a))},(t,s,a)=>`Invalid prop \`${s}\` supplied to \`${a}\`, expected array of specified type.`)},shape(e){return new q((t,s,a)=>{if(typeof t!=="object"||t===null||Array.isArray(t))return!1;for(let[o,n]of Object.entries(e)){if(n.isRequired&&!(o in t))return!1;if(o in t&&!n.validate(t[o],`${s}.${o}`,a))return!1}return!0},(t,s,a)=>`Invalid prop \`${s}\` supplied to \`${a}\`, expected object matching specified shape.`)},instanceOf(e){return new q((t)=>t instanceof e,(t,s,a)=>`Invalid prop \`${s}\` supplied to \`${a}\`, expected instance of \`${e.name}\`.`)},custom(e,t){return new q(e,typeof t==="string"?()=>t:t)},min(e){return new q((t)=>typeof t==="number"&&t>=e,(t,s,a)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${a}\`, expected value >= ${e}.`)},max(e){return new q((t)=>typeof t==="number"&&t<=e,(t,s,a)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${a}\`, expected value <= ${e}.`)},range(e,t){return new q((s)=>typeof s==="number"&&s>=e&&s<=t,(s,a,o)=>`Invalid prop \`${a}\` of value \`${s}\` supplied to \`${o}\`, expected value between ${e} and ${t}.`)},pattern(e){return new q((t)=>typeof t==="string"&&e.test(t),(t,s,a)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${a}\`, expected value matching pattern ${e}.`)},email:new q((e)=>typeof e==="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),(e,t,s)=>`Invalid prop \`${t}\` of value \`${e}\` supplied to \`${s}\`, expected valid email address.`),url:new q((e)=>{if(typeof e!=="string")return!1;try{let t=new URL(e);return!0}catch{return!1}},(e,t,s)=>`Invalid prop \`${t}\` of value \`${e}\` supplied to \`${s}\`, expected valid URL.`)};function yo(e,t,s,a={}){let{throwOnError:o=!1,logWarnings:n=!0}=a,r=[];for(let[i,c]of Object.entries(s)){let l=t[i],d=l===void 0;if(c.isRequired&&d){let h=`Required prop \`${i}\` was not specified in \`${e}\`.`;r.push(h);continue}if(d)continue;if(!c.validate(l,i,e)){let h=c.message(l,i,e);r.push(h)}}if(r.length>0){if(n)console.group(`\u26A0\uFE0F Prop validation failed for \`${e}\``),r.forEach((i)=>console.warn(i)),console.groupEnd();if(o)throw Error(`Prop validation failed for \`${e}\`:
|
|
10
10
|
${r.join(`
|
|
11
|
-
`)}`)}return{valid:r.length===0,errors:r}}function se(e,t,s){return(a)=>yo(e,a,t,s)}function Qh(e,t,s="value"){if(!t.validate(e,s,"assertion"))throw Error(t.message(e,s,"assertion"))}function eu(e,t,s="value"){if(!t.validate(e,s,"warning"))console.warn(t.message(e,s,"warning"))}var So="./Button-pg8mzsq3.stx";var Co={variant:f.oneOf(["primary","secondary","outline","ghost","danger"]),appearance:f.oneOf(["mac"]),size:f.oneOf(["xs","sm","md","lg","xl"]),disabled:f.boolean,loading:f.boolean,type:f.oneOf(["button","submit","reset"]),fullWidth:f.boolean,label:f.string,text:f.string,leftIcon:f.string,rightIcon:f.string,className:f.string,onClick:f.func},nu=se("Button",Co);function ru(e){return Dt(e,"Button","onClick")}function iu(e){if(e&&!["primary","secondary","outline","ghost","danger"].includes(e))throw ue.invalidProp("Button","variant",e,["primary","secondary","outline","ghost","danger"])}function lu(e){if(e&&!["xs","sm","md","lg","xl"].includes(e))throw ue.invalidProp("Button","size",e,["xs","sm","md","lg","xl"])}var To="./Calendar-5vs6x7gj.stx";var Io="./DateRangePicker-4zmf34e4.stx";var Po="./EmptyState-snj7gbsn.stx";var Ro="./ErrorState-qb7af5zb.stx";var Lo="./ThemeToggle-4wm9zare.stx";var zo="./Card-r55zpjqh.stx";var Ho="./Checkbox-52mhrzkz.stx";var Vo="./ChoiceChips-8dcf172n.stx";var Bo="./CodeEditor-kaywcb83.stx";var Ko="./ColorSwatches-ecfxphjy.stx";var Wo="./Combobox-9n04ec5w.stx";var Uo="./ComboboxButton-4r6a45s1.stx";var Yo="./ComboboxInput-1gyfpnca.stx";var Zo="./ComboboxOption-wkw70js7.stx";var en="./ComboboxOptions-zhr9b6rx.stx";var sn="./CommandPalette-qqjdbcyg.stx";var on="./CommandPaletteItem-7290ce1z.stx";var rn="./ContextMenu-43g3w5tp.stx";function at(e,t=[]){let s=[];if(!Array.isArray(e))return s;for(let a of e){if(!a||typeof a!=="object")continue;if(a.separator){if(s.length>0&&!s[s.length-1].separator)s.push({separator:!0,id:"",path:[]});continue}s.push({...a,id:a.id==null?"":String(a.id),path:[]})}while(s.length>0&&s[s.length-1].separator)s.pop();return s.forEach((a,o)=>{if(a.path=[...t,o],a.separator||a.id==="")a.id=a.path.join(".");if(!a.separator&&Array.isArray(a.children))a.children=at(a.children,a.path)}),s}function Ht(e){return Boolean(e)&&!e.separator}function jt(e){return Boolean(e)&&!e.separator&&!e.disabled}function fe(e){return Boolean(e)&&!e.separator&&Array.isArray(e.children)&&e.children.length>0}function be(e,t,s){let a=e.length;if(a===0)return-1;let o=t;for(let n=0;n<a;n++)if(o=o<0?s===1?0:a-1:(o+s+a)%a,Ht(e[o]))return o;return-1}function ve(e){return be(e,-1,1)}function Vt(e){return be(e,-1,-1)}function Ft(e,t,s){let a=s.toLowerCase();if(a===""||e.length===0)return-1;let o=a.length>1&&a.split("").every((i)=>i===a.charAt(0)),n=o?a.charAt(0):a,r=a.length===1||o?t+1:Math.max(t,0);for(let i=0;i<e.length;i++){let c=(r+i+e.length)%e.length,l=e[c];if(Ht(l)&&(l.label||"").toLowerCase().startsWith(n))return c}return-1}function ln(e,t){for(let s of e){if(s.separator)continue;if(s.id===t)return s;if(s.children){let a=ln(s.children,t);if(a)return a}}return null}function Bt(e,t,s,a=8){let o=(n,r,i)=>{if(n+r<=i-a)return n;if(n-r>=a)return n-r;return Math.max(a,i-a-r)};return{x:o(e.x,t.width,s.width),y:o(e.y,t.height,s.height)}}function qt(e,t,s,a=8,o=4){let n=e.left;if(n+t.width>s.width-a)n=Math.max(a,Math.min(e.right-t.width,s.width-a-t.width));let r=e.bottom+o;if(r+t.height>s.height-a){let i=e.top-o-t.height;r=i>=a?i:Math.max(a,s.height-a-t.height)}return{x:Math.max(a,n),y:r}}function Kt(e,t,s,a=8,o=4){let n="right",r=e.right-o;if(r+t.width>s.width-a){let c=e.left+o-t.width;if(c>=a)r=c,n="left";else r=Math.max(a,s.width-a-t.width)}let i=Math.max(a,Math.min(e.top-o,s.height-a-t.height));return{x:r,y:i,side:n}}var cn={mod:"\u2318",meta:"\u2318",cmd:"\u2318",command:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7"},dn={mod:"Ctrl",meta:"Win",cmd:"Ctrl",command:"Ctrl",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift"},pn={enter:"\u21A9",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",space:"Space"},hn={escape:"Esc",esc:"Esc",delete:"Del",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",space:"Space"},un=["ctrl","control","alt","option","shift","mod","meta","cmd","command"],fn=["mod","ctrl","control","cmd","command","meta","alt","option","shift"];function _t(e){let s=(e.endsWith("++")?[...e.slice(0,-2).split("+"),"+"]:e.split("+")).map((o)=>o.trim()).filter((o)=>o!==""),a=s.pop()||"";return{modifiers:s.map((o)=>o.toLowerCase()),key:a}}function Ne(e){return e.length===1?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function Wt(e,t){if(!e)return"";let{modifiers:s,key:a}=_t(e),o=t?un:fn,r=[...s].sort((c,l)=>o.indexOf(c)-o.indexOf(l)).map((c)=>(t?cn:dn)[c]??Ne(c)),i=(t?pn:hn)[a.toLowerCase()]??Ne(a);return t?r.join("")+i:[...new Set(r),i].join("+")}function Gt(e,t){if(!e)return"";let{modifiers:s,key:a}=_t(e),o={mod:t?"Meta":"Control",meta:"Meta",cmd:"Meta",command:"Meta",ctrl:"Control",control:"Control",alt:"Alt",option:"Alt",shift:"Shift"};return[...new Set(s.map((n)=>o[n]??Ne(n))),Ne(a)].join("+")}var mn=160,gn=600;function xn(){let e=typeof navigator>"u"?"":navigator.platform||navigator.userAgent||"";return/mac|iphone|ipad/i.test(e)}var bn=0;class vn{root;callbacks;items;label;disabled;apple;layer;uid=`stx-menu-${++bn}`;stack=[];target=null;returnFocus=null;hoverTimer=null;typed="";typedAt=0;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.items=t.items??null,this.label=t.label||"Context menu",this.disabled=Boolean(t.disabled),this.apple=t.apple??xn(),this.layer=document.createElement("div"),this.layer.className="stx-menu-layer",this.layer.setAttribute("data-menu-layer",""),this.layer.__stx_inert_content=!0,"popover"in HTMLElement.prototype)this.layer.setAttribute("popover","manual");else this.layer.hidden=!0;this.root.appendChild(this.layer),this.listen(this.root,"contextmenu",(a)=>this.onContextMenu(a)),this.listen(this.root,"keydown",(a)=>this.onHostKeyDown(a)),this.listen(this.layer,"keydown",(a)=>this.onMenuKeyDown(a)),this.listen(this.layer,"click",(a)=>this.onMenuClick(a)),this.listen(this.layer,"pointermove",(a)=>this.onMenuPointerMove(a)),this.listen(this.layer,"contextmenu",(a)=>a.preventDefault()),this.root.setAttribute("data-menu-ready","")}get isOpen(){return this.stack.length>0}setItems(e){this.items=e??null}setDisabled(e){if(this.disabled=e,e)this.close("api")}setLabel(e){this.label=e||"Context menu"}open(e,t,s={}){this.close("api",!1);let a=e instanceof Element?e:null,o=s.target??a??null,n=t??(typeof this.items==="function"?this.items(o):this.items),r=at(n);if(r.length===0)return!1;this.target=o;let i=document.activeElement;this.returnFocus=i instanceof HTMLElement&&i!==document.body?i:null,this.showLayer();let c=this.buildMenu(r,null),l=c.element.getBoundingClientRect(),d={width:window.innerWidth,height:window.innerHeight},h=a?qt(Ut(a),l,d):Bt(e,l,d);if(this.position(c.element,h),this.listenWhileOpen(),s.keyboard||a)this.focusItem(c,ve(c.items));else c.element.focus({preventScroll:!0});return this.callbacks.onOpen?.({x:h.x,y:h.y,target:o,keyboard:Boolean(s.keyboard)}),!0}close(e="api",t=!0){if(!this.isOpen)return;this.clearHover();for(let a of this.stack)a.element.remove();this.stack=[],this.hideLayer(),this.stopListeningWhileOpen();let s=this.returnFocus;if(this.returnFocus=null,this.target=null,t&&e!=="outside"&&e!=="blur"&&s&&s.isConnected)s.focus({preventScroll:!0});this.callbacks.onClose?.({reason:e})}destroy(){this.close("api",!1);for(let e of this.disposers)e();this.layer.remove(),this.root.removeAttribute("data-menu-ready")}listen(e,t,s,a){e.addEventListener(t,s,a);let o=()=>e.removeEventListener(t,s,a);return this.disposers.push(o),o}whileOpen=[];listenWhileOpen(){let e=(s,a,o,n)=>{s.addEventListener(a,o,n),this.whileOpen.push(()=>s.removeEventListener(a,o,n))},t=(s)=>{if(!(s.target instanceof Node)||!this.layer.contains(s.target))this.close("outside")};e(document,"pointerdown",t,{capture:!0}),e(document,"scroll",t,{capture:!0,passive:!0}),e(window,"resize",()=>this.close("blur")),e(window,"blur",()=>this.close("blur"))}stopListeningWhileOpen(){for(let e of this.whileOpen)e();this.whileOpen=[]}showLayer(){if(this.layer.hasAttribute("popover"))try{this.layer.showPopover()}catch{}else this.layer.hidden=!1}hideLayer(){if(this.layer.hasAttribute("popover"))try{this.layer.hidePopover()}catch{}else this.layer.hidden=!0}position(e,t){e.style.left=`${Math.round(t.x)}px`,e.style.top=`${Math.round(t.y)}px`}buildMenu(e,t){let s=document.createElement("div");if(s.className="stx-menu",s.setAttribute("role","menu"),s.setAttribute("tabindex","-1"),s.setAttribute("data-menu-depth",String(this.stack.length)),t)s.setAttribute("aria-labelledby",t.id);else s.setAttribute("aria-label",this.label);e.forEach((o,n)=>{if(o.separator){let l=document.createElement("div");l.className="stx-menu-separator",l.setAttribute("role","separator"),s.appendChild(l);return}let r=document.createElement("div");if(r.className="stx-menu-item",r.id=`${this.uid}-${o.path.join("-")}`,r.setAttribute("role",typeof o.checked==="boolean"?"menuitemcheckbox":"menuitem"),r.setAttribute("tabindex","-1"),r.setAttribute("data-menu-index",String(n)),r.setAttribute("data-menu-id",o.id),typeof o.checked==="boolean")r.setAttribute("aria-checked",String(o.checked));if(o.disabled)r.setAttribute("aria-disabled","true");if(o.danger)r.setAttribute("data-danger","");let i=document.createElement("span");i.className="stx-menu-check",i.setAttribute("aria-hidden","true"),i.textContent=o.checked===!0?"\u2713":"",r.appendChild(i);let c=document.createElement("span");if(c.className="stx-menu-label",c.textContent=o.label||"",r.appendChild(c),fe(o)){r.setAttribute("aria-haspopup","menu"),r.setAttribute("aria-expanded","false");let l=document.createElement("span");l.className="stx-menu-arrow",l.setAttribute("aria-hidden","true"),l.textContent="\u203A",r.appendChild(l)}else if(o.shortcut){r.setAttribute("aria-keyshortcuts",Gt(o.shortcut,this.apple));let l=document.createElement("span");l.className="stx-menu-shortcut",l.setAttribute("aria-hidden","true"),l.textContent=Wt(o.shortcut,this.apple),r.appendChild(l)}s.appendChild(r)}),this.layer.appendChild(s);let a={element:s,items:e,opener:t};return this.stack.push(a),a}menuOf(e){if(!(e instanceof Element))return null;let t=e.closest(".stx-menu");return this.stack.find((s)=>s.element===t)??null}rowAt(e,t){return t<0?null:e.element.querySelector(`:scope > [data-menu-index="${t}"]`)}activeIndex(e){let t=document.activeElement;if(!(t instanceof HTMLElement)||t.parentElement!==e.element)return-1;let s=Number(t.getAttribute("data-menu-index"));return Number.isInteger(s)?s:-1}focusItem(e,t){let s=this.rowAt(e,t);if(s)s.focus({preventScroll:!1});else e.element.focus({preventScroll:!0})}closeBelow(e){let t=this.stack.indexOf(e);for(let s of this.stack.splice(t+1))s.opener?.setAttribute("aria-expanded","false"),s.element.remove()}openSubmenu(e,t,s){let a=e.items[t],o=this.rowAt(e,t);if(!o||!fe(a)||a.disabled)return;let n=this.stack[this.stack.indexOf(e)+1];if(n&&n.opener===o){if(s)this.focusItem(n,ve(n.items));return}this.closeBelow(e),o.setAttribute("aria-expanded","true");let r=this.buildMenu(a.children,o),i=Kt(Ut(o),r.element.getBoundingClientRect(),{width:window.innerWidth,height:window.innerHeight});if(r.element.setAttribute("data-side",i.side),this.position(r.element,i),s)this.focusItem(r,ve(r.items))}choose(e,t){let s=e.items[t];if(!jt(s))return;if(fe(s)){this.openSubmenu(e,t,!0);return}let{children:a,path:o,id:n,...r}=s,i={item:{...r,id:n},id:n,path:[...o],target:this.target};this.close("select"),this.callbacks.onSelect?.(i)}clearHover(){if(this.hoverTimer)clearTimeout(this.hoverTimer);this.hoverTimer=null}onContextMenu(e){if(this.disabled||this.layer.contains(e.target))return;let t=e.target instanceof Element?e.target:null;if(e.button!==2&&e.detail===0&&e.clientX===0&&e.clientY===0&&t?this.open(t,null,{keyboard:!0,target:t}):this.open({x:e.clientX,y:e.clientY},null,{target:t}))e.preventDefault()}onHostKeyDown(e){if(this.disabled||this.isOpen||this.layer.contains(e.target))return;if(e.key!=="ContextMenu"&&!(e.key==="F10"&&e.shiftKey))return;let t=e.target instanceof Element?e.target:null;if(t&&this.open(t,null,{keyboard:!0,target:t}))e.preventDefault()}onMenuClick(e){let t=this.menuOf(e.target),s=e.target instanceof Element?e.target.closest(".stx-menu-item"):null;if(!t||!s)return;this.choose(t,Number(s.getAttribute("data-menu-index")))}onMenuPointerMove(e){let t=this.menuOf(e.target),s=e.target instanceof Element?e.target.closest(".stx-menu-item"):null;if(!t||!s||document.activeElement===s)return;let a=Number(s.getAttribute("data-menu-index"));s.focus({preventScroll:!0}),this.clearHover(),this.hoverTimer=setTimeout(()=>{if(document.activeElement!==s)return;if(fe(t.items[a]))this.openSubmenu(t,a,!1);else this.closeBelow(t)},mn)}onMenuKeyDown(e){let t=this.menuOf(e.target)??this.stack[this.stack.length-1];if(!t)return;let s=this.activeIndex(t),a=this.stack.indexOf(t),o=!0;switch(e.key){case"ArrowDown":this.focusItem(t,be(t.items,s,1));break;case"ArrowUp":this.focusItem(t,be(t.items,s,-1));break;case"Home":case"PageUp":this.focusItem(t,ve(t.items));break;case"End":case"PageDown":this.focusItem(t,Vt(t.items));break;case"ArrowRight":if(fe(t.items[s]))this.openSubmenu(t,s,!0);break;case"ArrowLeft":if(a>0)this.closeSubmenu(t);break;case"Escape":if(a>0)this.closeSubmenu(t);else this.close("escape");break;case"Enter":case" ":if(s>=0)this.choose(t,s);break;case"Tab":this.close("tab"),o=!1;break;default:o=this.typeAhead(t,s,e)}if(o)e.preventDefault(),e.stopPropagation()}closeSubmenu(e){let t=e.opener,s=this.stack[this.stack.indexOf(e)-1];if(s)this.closeBelow(s);t?.focus({preventScroll:!0})}typeAhead(e,t,s){if(s.key.length!==1||s.metaKey||s.ctrlKey||s.altKey)return!1;let a=Date.now();this.typed=a-this.typedAt>gn?s.key:this.typed+s.key,this.typedAt=a;let o=Ft(e.items,t,this.typed);if(o>=0)this.focusItem(e,o);return!0}}function Ut(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}var hf=48,uf=2000,ff=420,mf=160,wn=/^-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,yn=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/;function ye(e,t){let s=new WeakSet,a=JSON.stringify(e,(o,n)=>{if(typeof n==="bigint")return n.toString();if(typeof n==="object"&&n!==null){if(s.has(n))return"[Circular]";s.add(n)}return n},t);return a===void 0?"null":a}function ae(e,t){if(t.accessor)return t.accessor(e);return e==null?void 0:e[t.key]}function kn(e){let t=0,s=0,a=0,o=0,n=0;for(let r of e){if(r===null||r===void 0||r==="")continue;if(t++,typeof r==="number"||typeof r==="bigint")s++;else if(typeof r==="boolean")o++;else if(r instanceof Date)a++;else if(typeof r==="object")n++;else if(typeof r==="string"){let i=r.trim();if(wn.test(i))s++;else if(yn.test(i)&&!Number.isNaN(Date.parse(i)))a++}}if(t===0)return"string";if(s===t)return"number";if(a===t)return"date";if(o===t)return"boolean";if(n===t)return"json";return"string"}function Sn(e,t=200){let s=[],a=new Set,o=Math.min(e.length,t);for(let n=0;n<o;n++){let r=e[n];if(r===null||typeof r!=="object")continue;if(Array.isArray(r)){for(let i=0;i<r.length;i++){let c=String(i);if(!a.has(c))a.add(c),s.push(c)}continue}for(let i in r)if(!a.has(i))a.add(i),s.push(i)}if(s.length>0&&s.every((n)=>/^\d+$/.test(n)))s.sort((n,r)=>Number(n)-Number(r));return s.map((n)=>({key:n}))}function Xt(e){if(e===null)return"null";return e===void 0?"undefined":"value"}function we(e,t="string"){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e==="string")return e;if(typeof e==="number"||typeof e==="boolean"||typeof e==="bigint")return String(e);if(e instanceof Date)return Number.isNaN(e.getTime())?"Invalid Date":e.toISOString();if(typeof e==="object"||t==="json"){let s=ye(e);return s.length>160?`${s.slice(0,160)}...`:s}return String(e)}function Zt(e){return ye(e)}function Qt(e,t){let s={};for(let a of t){let o=ae(e,a);s[a.key]=o===void 0?null:o}return s}function es(e,t){return ye(Qt(e,t),2)}function Cn(e,t){return ye(e.map((s)=>Qt(s,t)),2)}function Jt(e){if(e===null||e===void 0)return"";let t;if(typeof e==="string")t=e;else if(e instanceof Date)t=Number.isNaN(e.getTime())?"":e.toISOString();else if(typeof e==="object")t=ye(e);else t=String(e);if(/[",\r\n]/.test(t)||t!==t.trim())return`"${t.replace(/"/g,'""')}"`;return t}function $n(e,t){let s=Array.from({length:e.length+1});s[0]=t.map((o)=>Jt(o.label??o.key)).join(",");let a=t.length;for(let o=0;o<e.length;o++){let n=e[o],r="";for(let i=0;i<a;i++){if(i>0)r+=",";r+=Jt(ae(n,t[i]))}s[o+1]=r}return`${s.join(`\r
|
|
11
|
+
`)}`)}return{valid:r.length===0,errors:r}}function se(e,t,s){return(a)=>yo(e,a,t,s)}function Qh(e,t,s="value"){if(!t.validate(e,s,"assertion"))throw Error(t.message(e,s,"assertion"))}function eu(e,t,s="value"){if(!t.validate(e,s,"warning"))console.warn(t.message(e,s,"warning"))}var So="./Button-1qmncazg.stx";var Co={variant:f.oneOf(["primary","secondary","outline","ghost","danger"]),appearance:f.oneOf(["mac"]),size:f.oneOf(["xs","sm","md","lg","xl"]),disabled:f.boolean,loading:f.boolean,type:f.oneOf(["button","submit","reset"]),fullWidth:f.boolean,label:f.string,text:f.string,leftIcon:f.string,rightIcon:f.string,className:f.string,onClick:f.func},nu=se("Button",Co);function ru(e){return Dt(e,"Button","onClick")}function iu(e){if(e&&!["primary","secondary","outline","ghost","danger"].includes(e))throw ue.invalidProp("Button","variant",e,["primary","secondary","outline","ghost","danger"])}function lu(e){if(e&&!["xs","sm","md","lg","xl"].includes(e))throw ue.invalidProp("Button","size",e,["xs","sm","md","lg","xl"])}var To="./Calendar-5vs6x7gj.stx";var Io="./DateRangePicker-4zmf34e4.stx";var Po="./EmptyState-snj7gbsn.stx";var Ro="./ErrorState-qb7af5zb.stx";var Lo="./ThemeToggle-4wm9zare.stx";var zo="./Card-r55zpjqh.stx";var Ho="./Checkbox-52mhrzkz.stx";var Vo="./ChoiceChips-8dcf172n.stx";var Bo="./CodeEditor-kaywcb83.stx";var Ko="./ColorSwatches-ecfxphjy.stx";var Wo="./Combobox-9n04ec5w.stx";var Uo="./ComboboxButton-4r6a45s1.stx";var Yo="./ComboboxInput-1gyfpnca.stx";var Zo="./ComboboxOption-wkw70js7.stx";var en="./ComboboxOptions-zhr9b6rx.stx";var sn="./CommandPalette-qqjdbcyg.stx";var on="./CommandPaletteItem-7290ce1z.stx";var rn="./ContextMenu-43g3w5tp.stx";function at(e,t=[]){let s=[];if(!Array.isArray(e))return s;for(let a of e){if(!a||typeof a!=="object")continue;if(a.separator){if(s.length>0&&!s[s.length-1].separator)s.push({separator:!0,id:"",path:[]});continue}s.push({...a,id:a.id==null?"":String(a.id),path:[]})}while(s.length>0&&s[s.length-1].separator)s.pop();return s.forEach((a,o)=>{if(a.path=[...t,o],a.separator||a.id==="")a.id=a.path.join(".");if(!a.separator&&Array.isArray(a.children))a.children=at(a.children,a.path)}),s}function Ht(e){return Boolean(e)&&!e.separator}function jt(e){return Boolean(e)&&!e.separator&&!e.disabled}function fe(e){return Boolean(e)&&!e.separator&&Array.isArray(e.children)&&e.children.length>0}function be(e,t,s){let a=e.length;if(a===0)return-1;let o=t;for(let n=0;n<a;n++)if(o=o<0?s===1?0:a-1:(o+s+a)%a,Ht(e[o]))return o;return-1}function ve(e){return be(e,-1,1)}function Vt(e){return be(e,-1,-1)}function Ft(e,t,s){let a=s.toLowerCase();if(a===""||e.length===0)return-1;let o=a.length>1&&a.split("").every((i)=>i===a.charAt(0)),n=o?a.charAt(0):a,r=a.length===1||o?t+1:Math.max(t,0);for(let i=0;i<e.length;i++){let c=(r+i+e.length)%e.length,l=e[c];if(Ht(l)&&(l.label||"").toLowerCase().startsWith(n))return c}return-1}function ln(e,t){for(let s of e){if(s.separator)continue;if(s.id===t)return s;if(s.children){let a=ln(s.children,t);if(a)return a}}return null}function Bt(e,t,s,a=8){let o=(n,r,i)=>{if(n+r<=i-a)return n;if(n-r>=a)return n-r;return Math.max(a,i-a-r)};return{x:o(e.x,t.width,s.width),y:o(e.y,t.height,s.height)}}function qt(e,t,s,a=8,o=4){let n=e.left;if(n+t.width>s.width-a)n=Math.max(a,Math.min(e.right-t.width,s.width-a-t.width));let r=e.bottom+o;if(r+t.height>s.height-a){let i=e.top-o-t.height;r=i>=a?i:Math.max(a,s.height-a-t.height)}return{x:Math.max(a,n),y:r}}function Kt(e,t,s,a=8,o=4){let n="right",r=e.right-o;if(r+t.width>s.width-a){let c=e.left+o-t.width;if(c>=a)r=c,n="left";else r=Math.max(a,s.width-a-t.width)}let i=Math.max(a,Math.min(e.top-o,s.height-a-t.height));return{x:r,y:i,side:n}}var cn={mod:"\u2318",meta:"\u2318",cmd:"\u2318",command:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7"},dn={mod:"Ctrl",meta:"Win",cmd:"Ctrl",command:"Ctrl",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift"},pn={enter:"\u21A9",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",space:"Space"},hn={escape:"Esc",esc:"Esc",delete:"Del",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",space:"Space"},un=["ctrl","control","alt","option","shift","mod","meta","cmd","command"],fn=["mod","ctrl","control","cmd","command","meta","alt","option","shift"];function _t(e){let s=(e.endsWith("++")?[...e.slice(0,-2).split("+"),"+"]:e.split("+")).map((o)=>o.trim()).filter((o)=>o!==""),a=s.pop()||"";return{modifiers:s.map((o)=>o.toLowerCase()),key:a}}function Ne(e){return e.length===1?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function Wt(e,t){if(!e)return"";let{modifiers:s,key:a}=_t(e),o=t?un:fn,r=[...s].sort((c,l)=>o.indexOf(c)-o.indexOf(l)).map((c)=>(t?cn:dn)[c]??Ne(c)),i=(t?pn:hn)[a.toLowerCase()]??Ne(a);return t?r.join("")+i:[...new Set(r),i].join("+")}function Gt(e,t){if(!e)return"";let{modifiers:s,key:a}=_t(e),o={mod:t?"Meta":"Control",meta:"Meta",cmd:"Meta",command:"Meta",ctrl:"Control",control:"Control",alt:"Alt",option:"Alt",shift:"Shift"};return[...new Set(s.map((n)=>o[n]??Ne(n))),Ne(a)].join("+")}var mn=160,gn=600;function xn(){let e=typeof navigator>"u"?"":navigator.platform||navigator.userAgent||"";return/mac|iphone|ipad/i.test(e)}var bn=0;class vn{root;callbacks;items;label;disabled;apple;layer;uid=`stx-menu-${++bn}`;stack=[];target=null;returnFocus=null;hoverTimer=null;typed="";typedAt=0;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.items=t.items??null,this.label=t.label||"Context menu",this.disabled=Boolean(t.disabled),this.apple=t.apple??xn(),this.layer=document.createElement("div"),this.layer.className="stx-menu-layer",this.layer.setAttribute("data-menu-layer",""),this.layer.__stx_inert_content=!0,"popover"in HTMLElement.prototype)this.layer.setAttribute("popover","manual");else this.layer.hidden=!0;this.root.appendChild(this.layer),this.listen(this.root,"contextmenu",(a)=>this.onContextMenu(a)),this.listen(this.root,"keydown",(a)=>this.onHostKeyDown(a)),this.listen(this.layer,"keydown",(a)=>this.onMenuKeyDown(a)),this.listen(this.layer,"click",(a)=>this.onMenuClick(a)),this.listen(this.layer,"pointermove",(a)=>this.onMenuPointerMove(a)),this.listen(this.layer,"contextmenu",(a)=>a.preventDefault()),this.root.setAttribute("data-menu-ready","")}get isOpen(){return this.stack.length>0}setItems(e){this.items=e??null}setDisabled(e){if(this.disabled=e,e)this.close("api")}setLabel(e){this.label=e||"Context menu"}open(e,t,s={}){this.close("api",!1);let a=e instanceof Element?e:null,o=s.target??a??null,n=t??(typeof this.items==="function"?this.items(o):this.items),r=at(n);if(r.length===0)return!1;this.target=o;let i=document.activeElement;this.returnFocus=i instanceof HTMLElement&&i!==document.body?i:null,this.showLayer();let c=this.buildMenu(r,null),l=c.element.getBoundingClientRect(),d={width:window.innerWidth,height:window.innerHeight},h=a?qt(Ut(a),l,d):Bt(e,l,d);if(this.position(c.element,h),this.listenWhileOpen(),s.keyboard||a)this.focusItem(c,ve(c.items));else c.element.focus({preventScroll:!0});return this.callbacks.onOpen?.({x:h.x,y:h.y,target:o,keyboard:Boolean(s.keyboard)}),!0}close(e="api",t=!0){if(!this.isOpen)return;this.clearHover();for(let a of this.stack)a.element.remove();this.stack=[],this.hideLayer(),this.stopListeningWhileOpen();let s=this.returnFocus;if(this.returnFocus=null,this.target=null,t&&e!=="outside"&&e!=="blur"&&s&&s.isConnected)s.focus({preventScroll:!0});this.callbacks.onClose?.({reason:e})}destroy(){this.close("api",!1);for(let e of this.disposers)e();this.layer.remove(),this.root.removeAttribute("data-menu-ready")}listen(e,t,s,a){e.addEventListener(t,s,a);let o=()=>e.removeEventListener(t,s,a);return this.disposers.push(o),o}whileOpen=[];listenWhileOpen(){let e=(s,a,o,n)=>{s.addEventListener(a,o,n),this.whileOpen.push(()=>s.removeEventListener(a,o,n))},t=(s)=>{if(!(s.target instanceof Node)||!this.layer.contains(s.target))this.close("outside")};e(document,"pointerdown",t,{capture:!0}),e(document,"scroll",t,{capture:!0,passive:!0}),e(window,"resize",()=>this.close("blur")),e(window,"blur",()=>this.close("blur"))}stopListeningWhileOpen(){for(let e of this.whileOpen)e();this.whileOpen=[]}showLayer(){if(this.layer.hasAttribute("popover"))try{this.layer.showPopover()}catch{}else this.layer.hidden=!1}hideLayer(){if(this.layer.hasAttribute("popover"))try{this.layer.hidePopover()}catch{}else this.layer.hidden=!0}position(e,t){e.style.left=`${Math.round(t.x)}px`,e.style.top=`${Math.round(t.y)}px`}buildMenu(e,t){let s=document.createElement("div");if(s.className="stx-menu",s.setAttribute("role","menu"),s.setAttribute("tabindex","-1"),s.setAttribute("data-menu-depth",String(this.stack.length)),t)s.setAttribute("aria-labelledby",t.id);else s.setAttribute("aria-label",this.label);e.forEach((o,n)=>{if(o.separator){let l=document.createElement("div");l.className="stx-menu-separator",l.setAttribute("role","separator"),s.appendChild(l);return}let r=document.createElement("div");if(r.className="stx-menu-item",r.id=`${this.uid}-${o.path.join("-")}`,r.setAttribute("role",typeof o.checked==="boolean"?"menuitemcheckbox":"menuitem"),r.setAttribute("tabindex","-1"),r.setAttribute("data-menu-index",String(n)),r.setAttribute("data-menu-id",o.id),typeof o.checked==="boolean")r.setAttribute("aria-checked",String(o.checked));if(o.disabled)r.setAttribute("aria-disabled","true");if(o.danger)r.setAttribute("data-danger","");let i=document.createElement("span");i.className="stx-menu-check",i.setAttribute("aria-hidden","true"),i.textContent=o.checked===!0?"\u2713":"",r.appendChild(i);let c=document.createElement("span");if(c.className="stx-menu-label",c.textContent=o.label||"",r.appendChild(c),fe(o)){r.setAttribute("aria-haspopup","menu"),r.setAttribute("aria-expanded","false");let l=document.createElement("span");l.className="stx-menu-arrow",l.setAttribute("aria-hidden","true"),l.textContent="\u203A",r.appendChild(l)}else if(o.shortcut){r.setAttribute("aria-keyshortcuts",Gt(o.shortcut,this.apple));let l=document.createElement("span");l.className="stx-menu-shortcut",l.setAttribute("aria-hidden","true"),l.textContent=Wt(o.shortcut,this.apple),r.appendChild(l)}s.appendChild(r)}),this.layer.appendChild(s);let a={element:s,items:e,opener:t};return this.stack.push(a),a}menuOf(e){if(!(e instanceof Element))return null;let t=e.closest(".stx-menu");return this.stack.find((s)=>s.element===t)??null}rowAt(e,t){return t<0?null:e.element.querySelector(`:scope > [data-menu-index="${t}"]`)}activeIndex(e){let t=document.activeElement;if(!(t instanceof HTMLElement)||t.parentElement!==e.element)return-1;let s=Number(t.getAttribute("data-menu-index"));return Number.isInteger(s)?s:-1}focusItem(e,t){let s=this.rowAt(e,t);if(s)s.focus({preventScroll:!1});else e.element.focus({preventScroll:!0})}closeBelow(e){let t=this.stack.indexOf(e);for(let s of this.stack.splice(t+1))s.opener?.setAttribute("aria-expanded","false"),s.element.remove()}openSubmenu(e,t,s){let a=e.items[t],o=this.rowAt(e,t);if(!o||!fe(a)||a.disabled)return;let n=this.stack[this.stack.indexOf(e)+1];if(n&&n.opener===o){if(s)this.focusItem(n,ve(n.items));return}this.closeBelow(e),o.setAttribute("aria-expanded","true");let r=this.buildMenu(a.children,o),i=Kt(Ut(o),r.element.getBoundingClientRect(),{width:window.innerWidth,height:window.innerHeight});if(r.element.setAttribute("data-side",i.side),this.position(r.element,i),s)this.focusItem(r,ve(r.items))}choose(e,t){let s=e.items[t];if(!jt(s))return;if(fe(s)){this.openSubmenu(e,t,!0);return}let{children:a,path:o,id:n,...r}=s,i={item:{...r,id:n},id:n,path:[...o],target:this.target};this.close("select"),this.callbacks.onSelect?.(i)}clearHover(){if(this.hoverTimer)clearTimeout(this.hoverTimer);this.hoverTimer=null}onContextMenu(e){if(this.disabled||this.layer.contains(e.target))return;let t=e.target instanceof Element?e.target:null;if(e.button!==2&&e.detail===0&&e.clientX===0&&e.clientY===0&&t?this.open(t,null,{keyboard:!0,target:t}):this.open({x:e.clientX,y:e.clientY},null,{target:t}))e.preventDefault()}onHostKeyDown(e){if(this.disabled||this.isOpen||this.layer.contains(e.target))return;if(e.key!=="ContextMenu"&&!(e.key==="F10"&&e.shiftKey))return;let t=e.target instanceof Element?e.target:null;if(t&&this.open(t,null,{keyboard:!0,target:t}))e.preventDefault()}onMenuClick(e){let t=this.menuOf(e.target),s=e.target instanceof Element?e.target.closest(".stx-menu-item"):null;if(!t||!s)return;this.choose(t,Number(s.getAttribute("data-menu-index")))}onMenuPointerMove(e){let t=this.menuOf(e.target),s=e.target instanceof Element?e.target.closest(".stx-menu-item"):null;if(!t||!s||document.activeElement===s)return;let a=Number(s.getAttribute("data-menu-index"));s.focus({preventScroll:!0}),this.clearHover(),this.hoverTimer=setTimeout(()=>{if(document.activeElement!==s)return;if(fe(t.items[a]))this.openSubmenu(t,a,!1);else this.closeBelow(t)},mn)}onMenuKeyDown(e){let t=this.menuOf(e.target)??this.stack[this.stack.length-1];if(!t)return;let s=this.activeIndex(t),a=this.stack.indexOf(t),o=!0;switch(e.key){case"ArrowDown":this.focusItem(t,be(t.items,s,1));break;case"ArrowUp":this.focusItem(t,be(t.items,s,-1));break;case"Home":case"PageUp":this.focusItem(t,ve(t.items));break;case"End":case"PageDown":this.focusItem(t,Vt(t.items));break;case"ArrowRight":if(fe(t.items[s]))this.openSubmenu(t,s,!0);break;case"ArrowLeft":if(a>0)this.closeSubmenu(t);break;case"Escape":if(a>0)this.closeSubmenu(t);else this.close("escape");break;case"Enter":case" ":if(s>=0)this.choose(t,s);break;case"Tab":this.close("tab"),o=!1;break;default:o=this.typeAhead(t,s,e)}if(o)e.preventDefault(),e.stopPropagation()}closeSubmenu(e){let t=e.opener,s=this.stack[this.stack.indexOf(e)-1];if(s)this.closeBelow(s);t?.focus({preventScroll:!0})}typeAhead(e,t,s){if(s.key.length!==1||s.metaKey||s.ctrlKey||s.altKey)return!1;let a=Date.now();this.typed=a-this.typedAt>gn?s.key:this.typed+s.key,this.typedAt=a;let o=Ft(e.items,t,this.typed);if(o>=0)this.focusItem(e,o);return!0}}function Ut(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}var hf=48,uf=2000,ff=420,mf=160,wn=/^-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,yn=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/;function ye(e,t){let s=new WeakSet,a=JSON.stringify(e,(o,n)=>{if(typeof n==="bigint")return n.toString();if(typeof n==="object"&&n!==null){if(s.has(n))return"[Circular]";s.add(n)}return n},t);return a===void 0?"null":a}function ae(e,t){if(t.accessor)return t.accessor(e);return e==null?void 0:e[t.key]}function kn(e){let t=0,s=0,a=0,o=0,n=0;for(let r of e){if(r===null||r===void 0||r==="")continue;if(t++,typeof r==="number"||typeof r==="bigint")s++;else if(typeof r==="boolean")o++;else if(r instanceof Date)a++;else if(typeof r==="object")n++;else if(typeof r==="string"){let i=r.trim();if(wn.test(i))s++;else if(yn.test(i)&&!Number.isNaN(Date.parse(i)))a++}}if(t===0)return"string";if(s===t)return"number";if(a===t)return"date";if(o===t)return"boolean";if(n===t)return"json";return"string"}function Sn(e,t=200){let s=[],a=new Set,o=Math.min(e.length,t);for(let n=0;n<o;n++){let r=e[n];if(r===null||typeof r!=="object")continue;if(Array.isArray(r)){for(let i=0;i<r.length;i++){let c=String(i);if(!a.has(c))a.add(c),s.push(c)}continue}for(let i in r)if(!a.has(i))a.add(i),s.push(i)}if(s.length>0&&s.every((n)=>/^\d+$/.test(n)))s.sort((n,r)=>Number(n)-Number(r));return s.map((n)=>({key:n}))}function Xt(e){if(e===null)return"null";return e===void 0?"undefined":"value"}function we(e,t="string"){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e==="string")return e;if(typeof e==="number"||typeof e==="boolean"||typeof e==="bigint")return String(e);if(e instanceof Date)return Number.isNaN(e.getTime())?"Invalid Date":e.toISOString();if(typeof e==="object"||t==="json"){let s=ye(e);return s.length>160?`${s.slice(0,160)}...`:s}return String(e)}function Zt(e){return ye(e)}function Qt(e,t){let s={};for(let a of t){let o=ae(e,a);s[a.key]=o===void 0?null:o}return s}function es(e,t){return ye(Qt(e,t),2)}function Cn(e,t){return ye(e.map((s)=>Qt(s,t)),2)}function Jt(e){if(e===null||e===void 0)return"";let t;if(typeof e==="string")t=e;else if(e instanceof Date)t=Number.isNaN(e.getTime())?"":e.toISOString();else if(typeof e==="object")t=ye(e);else t=String(e);if(/[",\r\n]/.test(t)||t!==t.trim())return`"${t.replace(/"/g,'""')}"`;return t}function $n(e,t){let s=Array.from({length:e.length+1});s[0]=t.map((o)=>Jt(o.label??o.key)).join(",");let a=t.length;for(let o=0;o<e.length;o++){let n=e[o],r="";for(let i=0;i<a;i++){if(i>0)r+=",";r+=Jt(ae(n,t[i]))}s[o+1]=r}return`${s.join(`\r
|
|
12
12
|
`)}\r
|
|
13
|
-
`}function ts(e,t,s,a,o=0){if(a<=0||s<=0)return{start:0,end:0};let n=Math.floor(Math.max(0,e)/s),r=Math.ceil((Math.max(0,e)+Math.max(0,t))/s),i=Math.min(a,Math.max(0,n-o));return{start:i,end:Math.max(i,Math.min(a,r+o))}}function ss(e,t,s){let a=s.rows-1,o=Math.max(0,s.columns-1),n=Math.max(1,s.page),{row:r,column:i}=e;switch(t){case"ArrowUp":r=Math.max(-1,r-1);break;case"ArrowDown":r=Math.min(a,r+1);break;case"ArrowLeft":i-=1;break;case"ArrowRight":i+=1;break;case"PageUp":r=r<=0?r:Math.max(0,r-n);break;case"PageDown":r=Math.min(a,Math.max(0,r)+(r<0?0:n));break;case"Home":if(i=0,s.mod)r=Math.min(0,a);break;case"End":if(i=o,s.mod)r=a;break;default:return e}return{row:Math.max(-1,Math.min(a,r)),column:Math.max(0,Math.min(o,i))}}function Tn(e,t,s=!1){let a=e.find((n)=>n.key===t),o=!a?{key:t,direction:"asc"}:a.direction==="asc"?{key:t,direction:"desc"}:null;if(!s)return o?[o]:[];if(!a)return[...e,o];return o?e.map((n)=>n.key===t?o:n):e.filter((n)=>n.key!==t)}var Yt=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});class ot{rows=[];columns=[];view=new Uint32Array(0);sort=[];filter="";selected=new Set;given=null;filtered=new Uint32Array(0);searchText=null;sortKeys=new Map;offsets=new Float64Array(1);anchor=-1;charWidth;cellPadding;constructor(e=[],t=null,s={}){this.charWidth=s.charWidth??7.25,this.cellPadding=s.cellPadding??24,this.given=t&&t.length>0?[...t]:null,this.setRows(e)}get count(){return this.view.length}get totalWidth(){return this.offsets[this.columns.length]}setRows(e){this.rows=Array.isArray(e)?e:[],this.selected.clear(),this.anchor=-1,this.forget(),this.resolveColumns(),this.refilter()}setColumns(e){this.given=e&&e.length>0?[...e]:null,this.forget(),this.resolveColumns(),this.sort=this.sort.filter((t)=>this.columns.some((s)=>s.key===t.key)),this.refilter()}setFilter(e){return this.filter=e==null?"":String(e),this.refilter(),this.count}setSort(e){this.sort=(e??[]).filter((t)=>t&&(t.direction==="asc"||t.direction==="desc")&&this.columns.some((s)=>s.key===t.key)),this.resort()}toggleSort(e,t=!1){let s=this.columns.find((a)=>a.key===e);if(!s||!s.sortable)return this.sort;return this.sort=Tn(this.sort,e,t),this.resort(),this.sort}sortOf(e){let t=this.sort.findIndex((s)=>s.key===e);return t<0?null:{direction:this.sort[t].direction,priority:t+1}}rowAt(e){return e>=0&&e<this.view.length?this.rows[this.view[e]]:void 0}valueAt(e,t){let s=this.columns[t],a=this.rowAt(e);return s&&a!==void 0?ae(a,s):void 0}viewRows(){let e=Array.from({length:this.view.length});for(let t=0;t<e.length;t++)e[t]=this.rows[this.view[t]];return e}toCsv(){return $n(this.viewRows(),this.columns)}toJson(){return Cn(this.viewRows(),this.columns)}select(e,t="replace"){if(e<0||e>=this.view.length)return;let s=this.view[e];if(t==="range"&&this.anchor>=0){let a=Math.min(this.anchor,e),o=Math.max(this.anchor,e);this.selected.clear();for(let n=a;n<=o&&n<this.view.length;n++)this.selected.add(this.view[n]);return}if(t==="toggle")if(this.selected.has(s))this.selected.delete(s);else this.selected.add(s);else this.selected.clear(),this.selected.add(s);this.anchor=e}selectAll(){this.selected.clear();for(let e=0;e<this.view.length;e++)this.selected.add(this.view[e])}clearSelection(){this.selected.clear(),this.anchor=-1}isSelected(e){return e>=0&&e<this.view.length&&this.selected.has(this.view[e])}selectedIndices(){return[...this.selected].sort((e,t)=>e-t)}selectedRows(){return this.selectedIndices().map((e)=>this.rows[e])}offsetOf(e){return this.offsets[Math.max(0,Math.min(this.columns.length,e))]}columnAt(e){let t=this.columns.length;if(t===0)return-1;let s=0,a=t-1;while(s<a){let o=s+a+1>>1;if(this.offsets[o]<=e)s=o;else a=o-1}return s}columnRange(e,t,s=0){let a=this.columns.length;if(a===0)return{start:0,end:0};let o=this.columnAt(Math.max(0,e)),n=this.columnAt(Math.max(0,e)+Math.max(0,t));return{start:Math.max(0,o-s),end:Math.min(a,n+1+s)}}resizeColumn(e,t){let s=this.columns[e];if(!s)return 0;return s.width=Math.round(Math.max(s.minWidth,Math.min(s.maxWidth,t))),this.measure(),s.width}autoWidth(e,t=200){let s=this.columns[e];if(!s)return 0;let a=s.label.length+3,o=Math.min(this.view.length,t);for(let r=0;r<o;r++){let i=we(ae(this.rows[this.view[r]],s),s.type).length;if(i>a)a=i}let n=Math.ceil(a*this.charWidth+this.cellPadding);return Math.max(s.minWidth,Math.min(s.maxWidth,420,n))}forget(){this.searchText=null,this.sortKeys.clear()}resolveColumns(){let e=this.given??Sn(this.rows),t=Math.min(this.rows.length,200),s=this.view;this.view=new Uint32Array(t);for(let a=0;a<t;a++)this.view[a]=a;this.columns=e.map((a)=>{let o=a.type;if(!o){let n=[];for(let r=0;r<t;r++)n.push(ae(this.rows[r],a));o=kn(n)}return{...a,label:a.label??a.key,type:o,width:a.width??0,minWidth:a.minWidth??48,maxWidth:a.maxWidth??2000,align:a.align??(o==="number"?"right":"left"),sortable:a.sortable!==!1}}),this.columns.forEach((a,o)=>{if(!a.width)a.width=this.autoWidth(o);a.width=Math.max(a.minWidth,Math.min(a.maxWidth,a.width))}),this.view=s,this.measure()}measure(){let e=new Float64Array(this.columns.length+1);for(let t=0;t<this.columns.length;t++)e[t+1]=e[t]+this.columns[t].width;this.offsets=e}searchable(){if(this.searchText)return this.searchText;let e=this.rows,t=this.columns,s=Array.from({length:e.length});for(let a=0;a<e.length;a++){let o=e[a],n="";for(let r=0;r<t.length;r++){let i=ae(o,t[r]);if(i===null||i===void 0)continue;n+=typeof i==="string"?i:we(i,t[r].type),n+="\x01"}s[a]=n.toLowerCase()}return this.searchText=s,s}refilter(){let e=this.rows.length,t=this.filter.toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0){let s=new Uint32Array(e);for(let a=0;a<e;a++)s[a]=a;this.filtered=s}else{let s=this.searchable(),a=new Uint32Array(e),o=0,n=t.length===1?t[0]:null;for(let r=0;r<e;r++){let i=s[r];if(n!==null){if(i.includes(n))a[o++]=r;continue}let c=!0;for(let l=0;l<t.length;l++)if(!i.includes(t[l])){c=!1;break}if(c)a[o++]=r}this.filtered=a.slice(0,o)}this.anchor=-1,this.resort()}keysFor(e){let t=this.sortKeys.get(e.key);if(t)return t;let s=this.rows,a=new Float64Array(s.length);if(e.type==="number"||e.type==="date"||e.type==="boolean")for(let o=0;o<s.length;o++){let n=ae(s[o],e),r=Number.NaN;if(n===null||n===void 0||n==="")r=Number.NaN;else if(typeof n==="number")r=n;else if(typeof n==="boolean")r=n?1:0;else if(n instanceof Date)r=n.getTime();else if(e.type==="date")r=Date.parse(String(n));else if(e.type==="boolean")r=String(n).toLowerCase()==="true"?1:0;else r=Number(n);a[o]=r}else{let o=Array.from({length:s.length}),n=new Map;for(let c=0;c<s.length;c++){let l=ae(s[c],e);if(l===null||l===void 0){o[c]=null;continue}let d=typeof l==="string"?l:we(l,e.type);if(o[c]=d,!n.has(d))n.set(d,0)}let r=[...n.keys()].sort(Yt.compare),i=0;for(let c=0;c<r.length;c++){if(c>0&&Yt.compare(r[c-1],r[c])!==0)i++;n.set(r[c],i)}for(let c=0;c<s.length;c++){let l=o[c];a[c]=l===null?Number.NaN:n.get(l)}}return this.sortKeys.set(e.key,a),a}resort(){let e=[];for(let s of this.sort){let a=this.columns.find((o)=>o.key===s.key);if(a)e.push({keys:this.keysFor(a),sign:s.direction==="desc"?-1:1})}let t=this.filtered.slice();if(e.length===1){let{keys:s,sign:a}=e[0];t.sort((o,n)=>{let r=s[o],i=s[n];if(r<i)return-a;if(r>i)return a;if(r===i)return o-n;let c=r!==r;return c===(i!==i)?o-n:c?1:-1})}else if(e.length>1)t.sort((s,a)=>{for(let o=0;o<e.length;o++){let n=e[o].keys[s],r=e[o].keys[a];if(n<r)return-e[o].sign;if(n>r)return e[o].sign;if(n===r)continue;let i=n!==n;if(i!==(r!==r))return i?1:-1}return s-a});this.view=t}}var In="./DataGrid-7rt7v865.stx";var An=120,Le=new Intl.NumberFormat("en-US");function re(e,t){return e.querySelector(`[data-dg="${t}"]`)}function Pn(e){let t=()=>{let s=document.createElement("textarea");s.value=e,s.setAttribute("aria-hidden","true"),s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(s);let a=document.activeElement;s.select();try{document.execCommand("copy")}catch{}s.remove(),a?.focus({preventScroll:!0})};if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText==="function")navigator.clipboard.writeText(e).catch(t);else t()}class Mn{root;callbacks;model;scroller;content;header;body;status;filterInput;prefix;rowHeight;headerHeight;overscan;columnOverscan;selectable;resizeStep;fileName;contextMenu;slots=new Map;pool=[];headerCells=[];rows={start:0,end:0};cols={start:0,end:0};stale=!0;active={row:0,column:0};activeEl=null;filterTimer=null;resize=null;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=re(e,"scroller"),o=re(e,"content"),n=re(e,"header"),r=re(e,"body");if(!a||!o||!n||!r)throw Error("DataGridView: the root is missing its scroller, content, header or body");if(this.scroller=a,this.content=o,this.header=n,this.body=r,this.status=re(e,"status"),this.filterInput=re(e,"filter"),this.prefix=a.id||`data-grid-${Math.random().toString(36).slice(2,8)}`,this.rowHeight=Math.max(8,t.rowHeight??28),this.headerHeight=Math.max(8,t.headerHeight??32),this.overscan=t.overscan??6,this.columnOverscan=t.columnOverscan??2,this.selectable=t.selectable!==!1,this.resizeStep=t.resizeStep??16,this.fileName=t.fileName||"data",this.contextMenu=Boolean(t.contextMenu),this.header.__stx_inert_content=!0,this.body.__stx_inert_content=!0,e.style.setProperty("--stx-grid-row-height",`${this.rowHeight}px`),e.style.setProperty("--stx-grid-header-height",`${this.headerHeight}px`),this.model=new ot(t.rows??[],t.columns??null),t.filter){if(this.model.setFilter(t.filter),this.filterInput)this.filterInput.value=t.filter}if(this.listen(this.scroller,"scroll",()=>this.render()),this.listen(this.scroller,"keydown",(l)=>this.onKeyDown(l)),this.listen(this.body,"click",(l)=>this.onBodyClick(l)),this.listen(this.body,"dblclick",(l)=>this.onBodyDoubleClick(l)),this.listen(this.body,"contextmenu",(l)=>this.onContextMenu(l)),this.listen(this.header,"click",(l)=>this.onHeaderClick(l)),this.listen(this.header,"dblclick",(l)=>this.onHeaderDoubleClick(l)),this.listen(this.header,"pointerdown",(l)=>this.onResizeStart(l)),this.listen(this.header,"pointermove",(l)=>this.onResizeMove(l)),this.listen(this.header,"pointerup",(l)=>this.onResizeEnd(l)),this.listen(this.header,"pointercancel",(l)=>this.onResizeEnd(l)),this.filterInput)this.listen(this.filterInput,"input",()=>this.onFilterInput());let i=re(e,"export-csv"),c=re(e,"export-json");if(i)this.listen(i,"click",()=>this.download("csv"));if(c)this.listen(c,"click",()=>this.download("json"));if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.refresh(),e.setAttribute("data-dg-ready","")}setRows(e){this.model.setRows(e),this.active={row:Math.min(0,this.model.count-1),column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.scroller.scrollTop=0,this.refresh()}setColumns(e){this.model.setColumns(e),this.active={row:this.active.row,column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.refresh()}setFilter(e){let t=e==null?"":String(e);if(this.filterInput&&this.filterInput.value!==t)this.filterInput.value=t;this.applyFilter(t)}setSort(e){this.model.setSort(e),this.refresh()}setFileName(e){this.fileName=e||"data"}getView(){return this.model.viewRows()}getSelection(){let e=this.model.selectedIndices();return{rows:e.map((t)=>this.model.rows[t]),indices:e}}clearSelection(){this.model.clearSelection(),this.paintSelection(),this.reportSelection()}exportCsv(){return this.model.toCsv()}exportJson(){return this.model.toJson()}download(e){let t=e==="json"?this.model.toJson():this.model.toCsv(),s=new Blob([t],{type:e==="json"?"application/json":"text/csv;charset=utf-8"}),a=URL.createObjectURL(s),o=document.createElement("a");return o.href=a,o.download=`${this.fileName}.${e}`,o.style.display="none",this.root.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(a),1000),this.callbacks.onExport?.({format:e,text:t,rows:this.model.count}),t}scrollToRow(e){let t=Math.max(0,Math.min(this.model.count-1,e));this.revealRow(t),this.render()}focus(){this.scroller.focus({preventScroll:!0})}getActiveCell(){return{...this.active}}setActiveCell(e,t){this.moveTo({row:e,column:t},!1)}destroy(){if(this.observer?.disconnect(),this.filterTimer)clearTimeout(this.filterTimer);for(let e of this.disposers)e();this.header.replaceChildren(),this.body.replaceChildren(),this.slots.clear(),this.pool.length=0,this.root.removeAttribute("data-dg-ready")}refresh(){let e=this.model;this.content.style.width=`${e.totalWidth}px`,this.content.style.height=`${this.headerHeight+e.count*this.rowHeight}px`,this.header.style.width=`${e.totalWidth}px`,this.body.style.height=`${e.count*this.rowHeight}px`,this.scroller.setAttribute("aria-rowcount",String(e.count+1)),this.scroller.setAttribute("aria-colcount",String(e.columns.length)),this.root.toggleAttribute("data-empty",e.count===0),this.stale=!0,this.render(),this.paintStatus()}render(){let e=this.model,t=this.scroller,s=ts(t.scrollTop,Math.max(0,t.clientHeight-this.headerHeight),this.rowHeight,e.count,this.overscan),a=e.columnRange(t.scrollLeft,t.clientWidth,this.columnOverscan),o=this.stale||a.start!==this.cols.start||a.end!==this.cols.end;if(!o&&s.start===this.rows.start&&s.end===this.rows.end)return;if(this.rows=s,this.cols=a,o)this.renderHeader();for(let[n,r]of this.slots)if(n<s.start||n>=s.end)this.slots.delete(n),r.index=-1,r.el.style.display="none",this.pool.push(r);for(let n=s.start;n<s.end;n++){let r=this.slots.get(n);if(r){if(o)this.fill(r);continue}r=this.pool.pop()??this.createSlot(),r.index=n,r.el.style.display="",this.slots.set(n,r),this.fill(r)}this.stale=!1,this.paintActive()}createSlot(){let e=document.createElement("div");return e.className="stx-dg-row",e.setAttribute("role","row"),this.body.appendChild(e),{el:e,index:-1,cells:[]}}fill(e){let t=this.model,s=e.index,a=t.rowAt(s),o=this.selectable&&t.isSelected(s),n=e.el;if(n.__dgRow=s,n.style.transform=`translateY(${s*this.rowHeight}px)`,n.setAttribute("aria-rowindex",String(s+2)),this.selectable)n.setAttribute("aria-selected",o?"true":"false");let r=this.cols.end-this.cols.start;while(e.cells.length<r){let i=document.createElement("div");i.className="stx-dg-cell",i.setAttribute("role","gridcell"),i.appendChild(document.createTextNode("")),n.appendChild(i),e.cells.push(i)}while(e.cells.length>r)e.cells.pop().remove();for(let i=0;i<r;i++){let c=this.cols.start+i,l=t.columns[c],d=e.cells[i],h=a===void 0?void 0:ae(a,l),p=Xt(h);if(d.__dgColumn=c,d.id=`${this.prefix}-r${s}-c${c}`,d.style.left=`${t.offsetOf(c)}px`,d.style.width=`${l.width}px`,d.setAttribute("aria-colindex",String(c+1)),d.setAttribute("data-type",l.type),d.setAttribute("data-align",l.align),p==="value")d.removeAttribute("data-empty");else d.setAttribute("data-empty",p);if(this.selectable)d.setAttribute("aria-selected",o?"true":"false");d.firstChild.data=typeof h==="string"?h:we(h,l.type)}}renderHeader(){let e=this.model,t=this.cols.end-this.cols.start;while(this.headerCells.length<t){let s=document.createElement("div");s.className="stx-dg-head",s.setAttribute("role","columnheader");let a=document.createElement("span");a.className="stx-dg-head-label",a.appendChild(document.createTextNode(""));let o=document.createElement("span");o.className="stx-dg-sort",o.setAttribute("aria-hidden","true"),o.appendChild(document.createTextNode(""));let n=document.createElement("span");n.className="stx-dg-resize",n.setAttribute("aria-hidden","true"),s.append(a,o,n),this.header.appendChild(s),this.headerCells.push(s)}while(this.headerCells.length>t)this.headerCells.pop().remove();for(let s=0;s<t;s++){let a=this.cols.start+s,o=e.columns[a],n=this.headerCells[s],r=e.sortOf(o.key);if(n.__dgColumn=a,n.id=`${this.prefix}-h-c${a}`,n.style.left=`${e.offsetOf(a)}px`,n.style.width=`${o.width}px`,n.setAttribute("aria-colindex",String(a+1)),n.setAttribute("data-align",o.align),n.toggleAttribute("data-sortable",o.sortable),o.sortable)n.setAttribute("aria-sort",r?r.direction==="asc"?"ascending":"descending":"none");else n.removeAttribute("aria-sort");n.children[0].firstChild.data=o.label,n.children[1].firstChild.data=r?`${r.direction==="asc"?"\u25B2":"\u25BC"}${e.sort.length>1?r.priority:""}`:""}}cellElement(e){if(e.column<this.cols.start||e.column>=this.cols.end)return null;let t=e.column-this.cols.start;if(e.row<0)return this.headerCells[t]??null;return this.slots.get(e.row)?.cells[t]??null}paintActive(){let e=this.cellElement(this.active);if(this.activeEl&&this.activeEl!==e)this.activeEl.removeAttribute("data-active");if(this.activeEl=e,e)e.setAttribute("data-active",""),this.scroller.setAttribute("aria-activedescendant",e.id);else this.scroller.removeAttribute("aria-activedescendant")}paintSelection(){if(!this.selectable)return;for(let[e,t]of this.slots){let s=this.model.isSelected(e)?"true":"false";t.el.setAttribute("aria-selected",s);for(let a of t.cells)a.setAttribute("aria-selected",s)}this.paintStatus()}paintStatus(){if(!this.status)return;let e=this.model,t=e.rows.length,s=e.count===t?`${Le.format(t)} ${t===1?"row":"rows"}`:`${Le.format(e.count)} of ${Le.format(t)} rows`;if(e.selected.size>0)s+=`, ${Le.format(e.selected.size)} selected`;if(this.status.textContent!==s)this.status.textContent=s}revealRow(e){let t=this.scroller,s=e*this.rowHeight,a=t.clientHeight-this.headerHeight;if(s<t.scrollTop)t.scrollTop=s;else if(s+this.rowHeight>t.scrollTop+a)t.scrollTop=s+this.rowHeight-a}revealColumn(e){let t=this.scroller,s=this.model.offsetOf(e),a=this.model.offsetOf(e+1);if(s<t.scrollLeft)t.scrollLeft=s;else if(a>t.scrollLeft+t.clientWidth)t.scrollLeft=Math.min(s,a-t.clientWidth)}detail(e){return{row:this.model.rowAt(e.row),rowIndex:e.row,column:this.model.columns[e.column],value:e.row<0?void 0:this.model.valueAt(e.row,e.column)}}moveTo(e,t=!0){let s=this.model,a={row:Math.max(-1,Math.min(s.count-1,e.row)),column:Math.max(0,Math.min(s.columns.length-1,e.column))};if(this.active=a,a.row>=0)this.revealRow(a.row);if(this.revealColumn(a.column),this.render(),this.paintActive(),t)this.callbacks.onCell?.(this.detail(a))}reportSelection(){this.callbacks.onSelect?.(this.getSelection())}applyFilter(e){let t=this.model.setFilter(e);this.active={row:Math.min(0,t-1),column:this.active.column},this.scroller.scrollTop=0,this.refresh(),this.callbacks.onFilter?.({text:e,count:t})}sortBy(e,t){let s=this.model.columns[e];if(!s||!s.sortable)return;let a=this.model.toggleSort(s.key,t);this.refresh(),this.callbacks.onSort?.([...a])}setColumnWidth(e,t){this.model.resizeColumn(e,t),this.content.style.width=`${this.model.totalWidth}px`,this.header.style.width=`${this.model.totalWidth}px`,this.stale=!0,this.render()}copy(e){if(this.active.row<0)return;let t=this.model.rowAt(this.active.row);if(t===void 0)return;let s=e==="row"?es(t,this.model.columns):Zt(this.model.valueAt(this.active.row,this.active.column));Pn(s),this.callbacks.onCopy?.({what:e,text:s})}listen(e,t,s){e.addEventListener(t,s),this.disposers.push(()=>e.removeEventListener(t,s))}cellFrom(e){let s=e.target?.closest(".stx-dg-cell"),a=s?.parentElement;if(!s||!a||s.__dgColumn===void 0||a.__dgRow===void 0)return null;return{row:a.__dgRow,column:s.__dgColumn}}headFrom(e){let t=e.target,s=t?.closest(".stx-dg-head");if(!s||s.__dgColumn===void 0)return null;let a=t.closest(".stx-dg-resize");return{column:s.__dgColumn,onHandle:Boolean(a),handle:a}}onBodyClick(e){let t=this.cellFrom(e);if(!t)return;if(this.selectable)this.model.select(t.row,e.shiftKey?"range":e.metaKey||e.ctrlKey?"toggle":"replace"),this.paintSelection(),this.reportSelection();this.moveTo(t)}onBodyDoubleClick(e){let t=this.cellFrom(e),s=t?this.model.rowAt(t.row):void 0;if(t&&s!==void 0)this.callbacks.onActivate?.({row:s,rowIndex:t.row})}onContextMenu(e){let t=this.cellFrom(e);if(!t)return;if(this.contextMenu)e.preventDefault();this.moveTo(t,!1),this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onHeaderClick(e){let t=this.headFrom(e);if(!t||t.onHandle)return;this.active={row:-1,column:t.column},this.sortBy(t.column,e.shiftKey)}onHeaderDoubleClick(e){let t=this.headFrom(e);if(t&&t.onHandle)this.setColumnWidth(t.column,this.model.autoWidth(t.column))}onResizeStart(e){let t=this.headFrom(e);if(!t||!t.onHandle||!t.handle||e.button!==0)return;e.preventDefault();try{t.handle.setPointerCapture(e.pointerId)}catch{}this.resize={column:t.column,start:e.clientX,width:this.model.columns[t.column].width,pointer:e.pointerId,handle:t.handle},this.root.setAttribute("data-resizing","")}onResizeMove(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.setColumnWidth(t.column,t.width+e.clientX-t.start)}onResizeEnd(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.resize=null,this.root.removeAttribute("data-resizing");try{t.handle.releasePointerCapture(e.pointerId)}catch{}}onFilterInput(){if(this.filterTimer)clearTimeout(this.filterTimer);this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.applyFilter(this.filterInput?this.filterInput.value:"")},An)}onKeyDown(e){if(e.target!==this.scroller)return;let t=this.model,s=e.metaKey||e.ctrlKey,a=this.active.row<0,o=e.key;if(s&&(o==="a"||o==="A")){if(!this.selectable)return;e.preventDefault(),t.selectAll(),this.paintSelection(),this.reportSelection();return}if(s&&(o==="c"||o==="C")){if(a)return;e.preventDefault(),this.copy(e.shiftKey?"row":"cell");return}if(a&&e.altKey&&(o==="ArrowLeft"||o==="ArrowRight")){e.preventDefault();let i=t.columns[this.active.column];if(i)this.setColumnWidth(this.active.column,i.width+(o==="ArrowRight"?this.resizeStep:-this.resizeStep));this.paintActive();return}if(o==="Enter"||o===" "){if(e.preventDefault(),a){this.sortBy(this.active.column,e.shiftKey);return}if(o===" "){if(!this.selectable)return;t.select(this.active.row,"toggle"),this.paintSelection(),this.reportSelection();return}let i=t.rowAt(this.active.row);if(i!==void 0)this.callbacks.onActivate?.({row:i,rowIndex:this.active.row});return}if(o==="Escape"&&this.selectable&&t.selected.size>0){e.preventDefault(),this.clearSelection();return}let n=Math.max(1,Math.floor((this.scroller.clientHeight-this.headerHeight)/this.rowHeight)-1),r=ss(this.active,o,{rows:t.count,columns:t.columns.length,page:n,mod:s});if(r===this.active)return;if(e.preventDefault(),r.row===this.active.row&&r.column===this.active.column)return;if(e.shiftKey&&this.selectable&&r.row>=0&&r.row!==this.active.row){if(t.selected.size===0&&this.active.row>=0)t.select(this.active.row,"replace");t.select(r.row,"range"),this.paintSelection(),this.reportSelection()}this.moveTo(r)}}var Nn="./Dialog-wm7zjqnb.stx";var On="./DialogBackdrop-de5m5m4w.stx";var Dn="./DialogDescription-yd2jgt2m.stx";var jn="./DialogPanel-v972ztcc.stx";var Fn="./DialogTitle-nw0pw114.stx";var qn="./Drawer-d78cdr6d.stx";var _n="./Dropdown-hb8ks69x.stx";var Gn="./DropdownButton-wxc25hsy.stx";var Jn="./DropdownItem-af0vzc8a.stx";var Xn="./DropdownItems-bkz7jkyz.stx";var Qn="./Form-cybgg9ym.stx";var er={action:f.string,method:f.oneOf(["GET","POST","PUT","DELETE","PATCH"]),validationSchema:f.object,initialValues:f.object,validateOnChange:f.boolean,validateOnBlur:f.boolean,onSubmit:f.func,onError:f.func,className:f.string},Jf=se("Form",er);var as=(e)=>Math.round(e*100)/100,Z=(e)=>`${as(e.x)} ${as(e.y)}`;function os(e,t,s){let a=s.x-e.x,o=s.y-e.y;if(a===0&&o===0)return{x:e.x,y:e.y};let n=a===0?Number.POSITIVE_INFINITY:t.width/2/Math.abs(a),r=o===0?Number.POSITIVE_INFINITY:t.height/2/Math.abs(o),i=Math.min(n,r);return{x:e.x+a*i,y:e.y+o*i}}function ns(e,t,s){let a=e.x-t.x,o=e.y-t.y,n=Math.sqrt(a*a+o*o);if(s<=0||n<=s)return e;return{x:e.x-a/n*s,y:e.y-o/n*s}}function tr(e,t,s=0){let a=26+Math.abs(s),o={x:e.x+t.width/4,y:e.y-t.height/2},n={x:e.x+t.width/2,y:e.y-t.height/4},r={x:o.x,y:o.y-a},i={x:n.x+a,y:n.y};return{d:`M ${Z(o)} C ${Z(r)}, ${Z(i)}, ${Z(n)}`,start:o,end:n,label:rs(o,r,i,n,0.5),angle:Math.atan2(n.y-i.y,n.x-i.x)}}function rs(e,t,s,a,o){let n=1-o;return{x:n*n*n*e.x+3*n*n*o*t.x+3*n*o*o*s.x+o*o*o*a.x,y:n*n*n*e.y+3*n*n*o*t.y+3*n*o*o*s.y+o*o*o*a.y}}function is(e,t={}){let{source:s,sourceSize:a,target:o,targetSize:n}=e,r=t.offset??0,i=t.inset??0;if(s.x===o.x&&s.y===o.y)return tr(s,a,r);if(t.curve==="bezier"){let w=t.direction!=="TB",y=(w?o.x-s.x:o.y-s.y)>=0?1:-1,v=w?{x:s.x+y*a.width/2,y:s.y}:{x:s.x,y:s.y+y*a.height/2},b=w?{x:o.x-y*n.width/2,y:o.y}:{x:o.x,y:o.y-y*n.height/2},C=Math.abs(w?b.x-v.x:b.y-v.y),P=Math.max(C/2,24)*y,T=w?{x:b.x-y*i,y:b.y}:{x:b.x,y:b.y-y*i},j=w?{x:v.x+P,y:v.y+r}:{x:v.x+r,y:v.y+P},V=w?{x:T.x-P,y:T.y+r}:{x:T.x+r,y:T.y-P};return{d:`M ${Z(v)} C ${Z(j)}, ${Z(V)}, ${Z(T)}`,start:v,end:T,label:rs(v,j,V,T,0.5),angle:Math.atan2(T.y-V.y,T.x-V.x)}}let c=os(s,a,o),l=os(o,n,s);if(r===0){let w=ns(l,c,i);return{d:`M ${Z(c)} L ${Z(w)}`,start:c,end:w,label:{x:(c.x+w.x)/2,y:(c.y+w.y)/2},angle:Math.atan2(w.y-c.y,w.x-c.x)}}let d=s.x<o.x||s.x===o.x&&s.y<o.y?1:-1,h=(o.x-s.x)*d,p=(o.y-s.y)*d,u=Math.sqrt(h*h+p*p)||1,g={x:(c.x+l.x)/2+-p/u*r*2,y:(c.y+l.y)/2+h/u*r*2},m=ns(l,g,i);return{d:`M ${Z(c)} Q ${Z(g)}, ${Z(m)}`,start:c,end:m,label:{x:0.25*c.x+0.5*g.x+0.25*m.x,y:0.25*c.y+0.5*g.y+0.25*m.y},angle:Math.atan2(m.y-g.y,m.x-g.x)}}function ls(e,t=14){let s=new Map;for(let o of e){let n=o.source<o.target?`${o.source}\x00${o.target}`:`${o.target}\x00${o.source}`,r=s.get(n);if(r)r.push(o);else s.set(n,[o])}let a=new Map;for(let o of s.values()){if(o.length<2)continue;o.forEach((n,r)=>{let i=(r-(o.length-1)/2)*t;a.set(n.id,n.source===n.target?r*t:i)})}return a}var nt={charWidth:7,paddingX:12,minWidth:48,maxWidth:220,height:32,detailHeight:14};function oe(e){return e.label==null||e.label===""?e.id:String(e.label)}function cs(e){return e.id!=null&&e.id!==""?String(e.id):`${e.source}->${e.target}${e.label?`:${e.label}`:""}`}function ds(e,t=nt){let s=Math.max(oe(e).length,e.detail?e.detail.length*0.85:0),a=e.expandable===!0?t.charWidth+4:0;return{width:Math.min(t.maxWidth,Math.max(t.minWidth,Math.ceil(s*t.charWidth)+t.paddingX*2+a)),height:t.height+(e.detail?t.detailHeight:0)}}function ps(e=nt){return Math.floor((e.maxWidth-e.paddingX*2)/e.charWidth)}function Oe(e,t){return e.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`}class ze{metrics;nodeMap=new Map;edgeMap=new Map;incident=new Map;sizes=new Map;constructor(e=[],t=[],s=nt){this.metrics=s;this.merge(e,t)}get nodes(){return[...this.nodeMap.values()]}get edges(){return[...this.edgeMap.values()]}get nodeCount(){return this.nodeMap.size}get edgeCount(){return this.edgeMap.size}has(e){return this.nodeMap.has(e)}node(e){return this.nodeMap.get(e)}edge(e){return this.edgeMap.get(e)}addNode(e){if(!e||e.id==null||e.id==="")return!1;let t=String(e.id);if(this.nodeMap.has(t))return!1;let s={...e,id:t};return this.nodeMap.set(t,s),this.incident.set(t,new Set),this.sizes.set(t,ds(s,this.metrics)),!0}addEdge(e){if(!e)return!1;let t=String(e.source),s=String(e.target);if(!this.nodeMap.has(t)||!this.nodeMap.has(s))return!1;let a=cs({...e,source:t,target:s});if(this.edgeMap.has(a))return!1;return this.edgeMap.set(a,{...e,id:a,source:t,target:s}),this.incident.get(t).add(a),this.incident.get(s).add(a),!0}updateNode(e,t){let s=this.nodeMap.get(e);if(!s)return!1;let a={...s,...t,id:e};return this.nodeMap.set(e,a),this.sizes.set(e,ds(a,this.metrics)),!0}removeNode(e){if(!this.nodeMap.has(e))return!1;for(let t of[...this.incident.get(e)])this.removeEdge(t);return this.nodeMap.delete(e),this.incident.delete(e),this.sizes.delete(e),!0}removeEdge(e){let t=this.edgeMap.get(e);if(!t)return!1;return this.edgeMap.delete(e),this.incident.get(t.source)?.delete(e),this.incident.get(t.target)?.delete(e),!0}merge(e=[],t=[]){let s={nodes:[],edges:[]};for(let a of e)if(this.addNode(a))s.nodes.push(String(a.id));for(let a of t)if(this.addEdge(a))s.edges.push(cs({...a,source:String(a.source),target:String(a.target)}));return s}edgesOf(e){let t=this.incident.get(e);return t?[...t].map((s)=>this.edgeMap.get(s)):[]}neighbours(e){let t=new Set;for(let s of this.edgesOf(e)){let a=s.source===e?s.target:s.source;if(a!==e)t.add(a)}return[...t]}degree(e){return this.neighbours(e).length}size(e){return this.sizes.get(e)??{width:this.metrics.minWidth,height:this.metrics.height}}bounds(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:o}=Number;for(let[n,r]of e){if(!this.nodeMap.has(n))continue;let i=this.size(n);t=Math.min(t,r.x-i.width/2),a=Math.max(a,r.x+i.width/2),s=Math.min(s,r.y-i.height/2),o=Math.max(o,r.y+i.height/2)}return Number.isFinite(t)?{x:t,y:s,width:a-t,height:o-s}:null}}function hs(e){let t=e>>>0||1;return()=>{t=t+1831565813>>>0;let s=t;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}var sr=0.15,us=0.06;function fs(e,t={}){let s=e.nodes,a=s.length,o=new Map;if(a===0)return o;let n=t.linkDistance??90,r=t.padding??16,i=hs(t.seed??1),c=t.positions??null,l=new Set(t.pinned??[]),d=new Map(s.map((R,N)=>[R.id,N])),h=new Float64Array(a),p=new Float64Array(a),u=new Float64Array(a),g=new Float64Array(a),m=new Uint8Array(a),w=new Uint8Array(a),y=new Float64Array(a).fill(1),v=0;s.forEach((R,N)=>{let E=e.size(R.id);u[N]=E.width/2,g[N]=E.height/2;let M=c?.get(R.id);if(M&&Number.isFinite(M.x)&&Number.isFinite(M.y))h[N]=M.x,p[N]=M.y,w[N]=1,m[N]=l.has(R.id)?1:0,y[N]=0,v++});let b=n*Math.sqrt(a)*0.6;s.forEach((R,N)=>{if(w[N])return;let E=e.neighbours(R.id).map((k)=>d.get(k)).find((k)=>w[k]),M=i()*Math.PI*2;if(E!==void 0)h[N]=h[E]+Math.cos(M)*n*0.5,p[N]=p[E]+Math.sin(M)*n*0.5;else{let k=Math.sqrt(i())*b;h[N]=Math.cos(M)*k,p[N]=Math.sin(M)*k}});let C=Uint8Array.from(w),P=v>0,T=Math.max(0,t.iterations??(P?80:300)),j=[],V=new Set;for(let R of e.edges){let N=d.get(R.source),E=d.get(R.target);if(N===E)continue;let M=N<E?N*a+E:E*a+N;if(!V.has(M))V.add(M),j.push(N,E)}let F=new Float64Array(a),x=new Float64Array(a),S=n,L=P?S*0.5:S*1.5;for(let R=0;R<T;R++){let N=L*(1-R/T);F.fill(0),x.fill(0);for(let E=0;E<a;E++)for(let M=E+1;M<a;M++){if(C[E]&&C[M])continue;let k=h[E]-h[M],z=p[E]-p[M],O=Math.sqrt(k*k+z*z);if(O<0.01){let K=(E*31+M*17)%360*Math.PI/180;k=Math.cos(K)*0.01,z=Math.sin(K)*0.01,O=0.01}let J=Math.max(1,O-(u[E]+u[M])*0.5),H=S*S*sr/J/O;F[E]+=k*H,x[E]+=z*H,F[M]-=k*H,x[M]-=z*H}for(let E=0;E<j.length;E+=2){let M=j[E],k=j[E+1];if(C[M]&&C[k])continue;let z=h[M]-h[k],O=p[M]-p[k],J=Math.sqrt(z*z+O*O)||0.01,H=(u[M]+u[k])*0.5,K=Math.max(0,J-H),Q=K*K/S/J;F[M]-=z*Q,x[M]-=O*Q,F[k]+=z*Q,x[k]+=O*Q}for(let E=0;E<a;E++){if(m[E])continue;if(!C[E])F[E]-=h[E]*us,x[E]-=p[E]*us;let M=Math.sqrt(F[E]*F[E]+x[E]*x[E]);if(M>0){let k=Math.min(M,N)/M*y[E];h[E]+=F[E]*k,p[E]+=x[E]*k}}}return ar(h,p,u,g,m,r),s.forEach((R,N)=>{o.set(R.id,{x:Math.round(h[N]*100)/100,y:Math.round(p[N]*100)/100})}),o}function ar(e,t,s,a,o,n){let r=e.length;for(let i=0;i<40;i++){let c=!1;for(let l=0;l<r;l++)for(let d=l+1;d<r;d++){let h=s[l]+s[d]+n-Math.abs(e[l]-e[d]);if(h<=0)continue;let p=a[l]+a[d]+n-Math.abs(t[l]-t[d]);if(p<=0)continue;if(o[l]&&o[d])continue;c=!0;let u=o[l]?0:o[d]?1:0.5,g=1-u;if(h<p){let m=e[l]<e[d]||e[l]===e[d]&&l<d?-1:1;e[l]+=m*h*u,e[d]-=m*h*g}else{let m=t[l]<t[d]||t[l]===t[d]&&l<d?-1:1;t[l]+=m*p*u,t[d]-=m*p*g}}if(!c)break}}function or(e){let t=new Set,s=[];for(let o of e.nodes){if(t.has(o.id))continue;let n=[],r=[o.id];t.add(o.id);while(r.length){let i=r.shift();n.push(i);for(let c of e.neighbours(i))if(!t.has(c))t.add(c),r.push(c)}s.push(n)}let a=new Map(e.nodes.map((o,n)=>[o.id,n]));for(let o of s)o.sort((n,r)=>a.get(n)-a.get(r));return s}function nr(e){let t=new Map;for(let o of e.nodes)t.set(o.id,[]);for(let o of e.edges)if(o.source!==o.target)t.get(o.source).push({id:o.id,to:o.target});let s=new Set,a=new Map;for(let o of e.nodes){if(a.has(o.id))continue;let n=[{id:o.id,next:0}];a.set(o.id,1);while(n.length){let r=n[n.length-1],i=t.get(r.id);if(r.next>=i.length){a.set(r.id,2),n.pop();continue}let c=i[r.next++],l=a.get(c.to);if(l===1)s.add(c.id);else if(l===void 0)a.set(c.to,1),n.push({id:c.to,next:0})}}return s}function ms(e,t){let s=e.map((o)=>[t.get(o.from),t.get(o.to)]).sort((o,n)=>o[0]-n[0]||o[1]-n[1]),a=0;for(let o=0;o<s.length;o++)for(let n=o+1;n<s.length;n++)if(s[o][0]<s[n][0]&&s[o][1]>s[n][1])a++;return a}function gs(e,t={}){let s=t.direction==="TB"?"TB":"LR",a=t.nodeGap??24,o=t.layerGap??80,n=t.componentGap??48,r=t.sweeps??4,i=s==="LR",c=nr(e),l=[],d=new Set;for(let b of e.edges){if(b.source===b.target)continue;let C=c.has(b.id)?b.target:b.source,P=c.has(b.id)?b.source:b.target,T=`${C}\x00${P}`;if(!d.has(T))d.add(T),l.push({from:C,to:P})}let h=new Map,p=new Map;for(let b of e.nodes)h.set(b.id,[]),p.set(b.id,[]);for(let b of l)h.get(b.from).push(b.to),p.get(b.to).push(b.from);let u=new Map,g=new Map,m=[];for(let b of e.nodes)if(g.set(b.id,p.get(b.id).length),p.get(b.id).length===0)m.push(b.id),u.set(b.id,0);for(let b=0;b<m.length;b++){let C=m[b];for(let P of h.get(C)){u.set(P,Math.max(u.get(P)??0,u.get(C)+1));let T=g.get(P)-1;if(g.set(P,T),T===0)m.push(P)}}let w=new Map,y=[],v=0;for(let b of or(e)){let C=[];for(let k of b){let z=u.get(k)??0;while(C.length<=z)C.push([]);C[z].push(k)}let P=new Set(b),T=l.filter((k)=>P.has(k.from)&&u.get(k.to)-u.get(k.from)===1),j=new Map,V=()=>{for(let k of C)k.forEach((z,O)=>j.set(z,k.length>1?O/(k.length-1):0.5))},F=(k,z)=>{let O=new Map;k.forEach((H,K)=>{let Q=z.get(H),Ee=k.length>1?K/(k.length-1):0.5;O.set(H,Q.length?Q.reduce((Ye,Ie)=>Ye+j.get(Ie),0)/Q.length:Ee)});let J=new Map(k.map((H,K)=>[H,K]));k.sort((H,K)=>O.get(H)-O.get(K)||J.get(H)-J.get(K)),k.forEach((H,K)=>j.set(H,k.length>1?K/(k.length-1):0.5))};V();let x=C.map((k)=>[...k]),S=ms(T,j);for(let k=0;k<r&&S>0;k++){for(let O=1;O<C.length;O++)F(C[O],p);for(let O=C.length-2;O>=0;O--)F(C[O],h);let z=ms(T,j);if(z<S)S=z,x=C.map((O)=>[...O])}let L=(k)=>i?e.size(k).width:e.size(k).height,R=(k)=>i?e.size(k).height:e.size(k).width,N=x.map((k)=>k.reduce((z,O)=>z+R(O),0)+a*Math.max(0,k.length-1)),E=Math.max(0,...N),M=0;x.forEach((k,z)=>{let O=Math.max(0,...k.map(L)),J=v+(E-N[z])/2;for(let H of k){let K=J+R(H)/2;w.set(H,i?{x:M+O/2,y:K}:{x:K,y:M+O/2}),J+=R(H)+a}M+=O+o}),y.push(x),v+=E+n}return{positions:w,layerOf:u,reversed:c,components:y,bounds:e.bounds(w)}}var rr={x:0,y:0,k:1};function xs(e,t,s){return Math.min(Math.max(e,t),s)}function am(e,t){return{x:t.x*e.k+e.x,y:t.y*e.k+e.y}}function rt(e,t){return{x:(t.x-e.x)/e.k,y:(t.y-e.y)/e.k}}function De(e,t,s){return{x:e.x+t,y:e.y+s,k:e.k}}function bs(e,t,s,a=0.1,o=4){let n=xs(e.k*s,a,o),r=n/e.k;return{x:t.x-(t.x-e.x)*r,y:t.y-(t.y-e.y)*r,k:n}}function vs(e,t,s=24,a=0.1,o=1){if(!e||t.width<=0||t.height<=0)return{...rr};let n=Math.max(1,t.width-s*2),r=Math.max(1,t.height-s*2),i=xs(Math.min(n/Math.max(1,e.width),r/Math.max(1,e.height)),a,o);return{x:t.width/2-(e.x+e.width/2)*i,y:t.height/2-(e.y+e.height/2)*i,k:i}}function ws(e,t,s){return{x:s.width/2-t.x*e.k,y:s.height/2-t.y*e.k,k:e.k}}function ys(e,t,s,a=16){let o=t.x*e.k+e.x,n=t.y*e.k+e.y,r=o+t.width*e.k,i=n+t.height*e.k,c=0,l=0;if(o<a)c=a-o;else if(r>s.width-a)c=s.width-a-r;if(n<a)l=a-n;else if(i>s.height-a)l=s.height-a-i;return c===0&&l===0?e:De(e,c,l)}function ks(e,t,s){let a=e.get(t);if(!a)return null;let o=s==="left"?-1:s==="right"?1:0,n=s==="up"?-1:s==="down"?1:0,r=null,i=Number.POSITIVE_INFINITY;for(let[c,l]of e){if(c===t)continue;let d=l.x-a.x,h=l.y-a.y,p=d*o+h*n;if(p<=0.5)continue;let u=Math.abs(d*n)+Math.abs(h*o);if(u>p*2)continue;let g=p+u*2;if(g<i)i=g,r=c}return r}function Ss(e,t){let s=null,a=Number.POSITIVE_INFINITY;for(let[o,n]of e){let r=(n.x-t.x)**2+(n.y-t.y)**2;if(r<a)a=r,s=o}return s}function om(e,t,s){let a=null;for(let[o,n]of t){let r=e.size(o);if(Math.abs(s.x-n.x)<=r.width/2&&Math.abs(s.y-n.y)<=r.height/2)a=o}return a}var lr="./GraphView-0t3t9mec.stx";var cr="http://www.w3.org/2000/svg",Cs=3,$s=350,dr=240,pr=6.2;function _(e,t={}){let s=document.createElementNS(cr,e);for(let a in t)s.setAttribute(a,String(t[a]));return s}var hr=0;class ur{root;callbacks;timings={layout:0,render:0};model=new ze;positions=new Map;shown=new Map;pinned=new Set;view={x:0,y:0,k:1};size={width:0,height:0};layoutName;direction;selected=null;autoFit=!0;animate;minZoom;maxZoom;contextMenu;prefix;surface;status;svg;stage;edgeLayer;nodeLayer;labelLayer;nodeEls=new Map;edgeEls=new Map;idOf=new WeakMap;offsets=new Map;serial=0;gesture=null;pinch=null;lastClick={id:"",at:0};lastExpand=0;frame=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.prefix=`${e.id||"graph"}-${++hr}`,this.layoutName=t.layout==="force"?"force":"layered",this.direction=t.direction==="TB"?"TB":"LR",this.minZoom=t.minZoom??0.1,this.maxZoom=t.maxZoom??4,this.contextMenu=Boolean(t.contextMenu),this.animate=t.animate!==!1,this.surface=e.querySelector('[data-gv="surface"]')??e,this.status=e.querySelector('[data-gv="status"]'),t.label)this.surface.setAttribute("aria-label",t.label);this.svg=_("svg",{class:"stx-gv-svg","aria-hidden":"false",focusable:"false"}),this.svg.__stx_inert_content=!0;let a=_("defs");for(let o of["arrow","arrow-active"]){let n=_("marker",{id:`${this.prefix}-${o}`,viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",class:`stx-gv-${o}`});n.append(_("path",{d:"M 0 0 L 10 5 L 0 10 z"})),a.append(n)}if(this.stage=_("g",{class:"stx-gv-stage"}),this.edgeLayer=_("g",{class:"stx-gv-edges"}),this.nodeLayer=_("g",{class:"stx-gv-nodes"}),this.labelLayer=_("g",{class:"stx-gv-edge-labels"}),this.stage.append(this.edgeLayer,this.nodeLayer,this.labelLayer),this.svg.append(a,this.stage),this.surface.append(this.svg),this.listen(),this.measure(),this.setGraph(t.nodes??[],t.edges??[]),t.selected)this.select(t.selected,{silent:!0});if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{if(this.measure(),this.autoFit)this.fit()}),this.observer.observe(this.surface);e.setAttribute("data-gv-ready","")}graph(){return this.model}getViewport(){return{...this.view}}getLayout(){return this.layoutName}getSelected(){return this.selected}getPositions(){return Object.fromEntries([...this.positions].map(([e,t])=>[e,{...t}]))}setGraph(e,t){if(this.stop(),this.model=new ze(e??[],t??[]),this.positions=new Map,this.pinned.clear(),this.selected&&!this.model.has(this.selected))this.selected=null;this.layout(!1),this.shown=new Map(this.positions),this.render(),this.autoFit=!0,this.fit(),this.mark()}addNeighbours(e,t,s){let a=this.model.merge(t??[],s??[]);if(a.nodes.length===0&&a.edges.length===0)return a;let o=this.shown.get(e)??this.positions.get(e)??rt(this.view,{x:this.size.width/2,y:this.size.height/2});for(let n of a.nodes)this.shown.set(n,{...o});if(this.layout(!0),this.sync(),this.moveToPlace(),this.mark(),a.nodes.length)this.announce(`${a.nodes.length} ${a.nodes.length===1?"node":"nodes"} added${this.model.has(e)?` to ${oe(this.model.node(e))}`:""}`);return a}updateNode(e,t){if(!this.model.updateNode(e,t))return;let s=this.nodeEls.get(e);if(s)s.remove(),this.nodeEls.delete(e);this.sync(),this.draw(),this.mark()}setLayout(e){let t=e==="force"?"force":"layered";if(t===this.layoutName)return;this.layoutName=t,this.relayout(),this.callbacks.onLayout?.({layout:t})}setDirection(e){let t=e==="TB"?"TB":"LR";if(t===this.direction)return;if(this.direction=t,this.layoutName==="layered")this.relayout()}select(e,t={}){let s=e!=null&&this.model.has(e)?e:null;if(s===this.selected)return;if(this.selected=s,this.mark(),s)this.describe(s);if(!t.silent)this.callbacks.onSelect?.(this.selection())}focusNode(e){if(!this.model.has(e))return;this.select(e);let t=this.positions.get(e);if(t)this.autoFit=!1,this.setView(ws(this.view,t,this.size))}fit(){this.measure(),this.setView(vs(this.model.bounds(this.positions),this.size,32,this.minZoom,Math.min(1,this.maxZoom))),this.autoFit=!0}zoomIn(){this.zoomBy(1.25)}zoomOut(){this.zoomBy(0.8)}zoomBy(e,t){this.autoFit=!1,this.setView(bs(this.view,t??{x:this.size.width/2,y:this.size.height/2},e,this.minZoom,this.maxZoom))}panBy(e,t){this.autoFit=!1,this.setView(De(this.view,e,t))}setZoomLimits(e,t){this.minZoom=e,this.maxZoom=t}destroy(){this.stop(),this.observer?.disconnect();for(let e of this.disposers)e();this.svg.remove(),this.root.removeAttribute("data-gv-ready")}selection(){let e=this.selected?this.model.node(this.selected)??null:null;return{node:e,neighbours:e?this.model.neighbours(e.id).map((t)=>this.model.node(t)):[]}}measure(){let e=this.surface.getBoundingClientRect();this.size={width:e.width,height:e.height}}layout(e){let t=performance.now();if(this.layoutName==="layered")this.positions=gs(this.model,{direction:this.direction}).positions;else this.positions=fs(this.model,{positions:e&&this.positions.size?this.positions:null,pinned:e?this.pinned:null});this.timings.layout=performance.now()-t}relayout(){if(this.pinned.clear(),this.layout(!1),this.sync(),this.moveToPlace(),this.autoFit)this.fit()}render(){let e=performance.now();this.sync(),this.draw(),this.timings.render=performance.now()-e}sync(){let e=ps(this.model.metrics);for(let[t,s]of this.nodeEls)if(!this.model.has(t))s.remove(),this.nodeEls.delete(t);for(let t of this.model.nodes){let s=this.nodeEls.get(t.id);if(!s)s=this.buildNode(t,e),this.nodeEls.set(t.id,s),this.idOf.set(s,t.id),this.nodeLayer.append(s);let a=this.model.degree(t.id);s.setAttribute("aria-label",`${oe(t)}, ${a} ${a===1?"connection":"connections"}`)}for(let[t,s]of this.edgeEls)if(!this.model.edge(t))s.group.remove(),s.label?.remove(),this.edgeEls.delete(t);for(let t of this.model.edges)if(!this.edgeEls.has(t.id))this.edgeEls.set(t.id,this.buildEdge(t));this.offsets=ls(this.model.edges)}buildNode(e,t){let s=this.model.size(e.id),a=_("g",{class:"stx-gv-node",id:`${this.prefix}-node-${this.serial++}`,role:"group","data-node":e.id});if(e.kind)a.setAttribute("data-kind",e.kind);if(e.expandable===!0)a.setAttribute("data-expandable","");let o=_("title");o.textContent=e.detail?`${oe(e)}: ${e.detail}`:oe(e);let n=_("rect",{x:-s.width/2,y:-s.height/2,width:s.width,height:s.height,rx:6,ry:6}),r=e.expandable===!0?(this.model.metrics.charWidth+4)/2:0,i=_("text",{class:"stx-gv-node-label",x:-r,y:e.detail?-6:0,"text-anchor":"middle","dominant-baseline":"central"});if(i.textContent=Oe(oe(e),t),a.append(o,n,i),e.detail){let c=_("text",{class:"stx-gv-node-detail",x:-r,y:9,"text-anchor":"middle","dominant-baseline":"central"});c.textContent=Oe(e.detail,Math.floor(t/0.85)),a.append(c)}if(e.expandable===!0){let c=_("text",{class:"stx-gv-node-mark",x:s.width/2-10,y:0,"text-anchor":"middle","dominant-baseline":"central","aria-hidden":"true"});c.textContent="+",a.append(c)}return a}buildEdge(e){let t=_("g",{class:"stx-gv-edge","data-edge":e.id}),s=_("path",{fill:"none"});if(e.directed!==!1)s.setAttribute("marker-end",`url(#${this.prefix}-arrow)`);t.append(s),this.edgeLayer.append(t);let a=null;if(e.label){let o=Oe(String(e.label),32),n=Math.ceil(o.length*pr)+8;a=_("g",{class:"stx-gv-edge-label","data-edge":e.id});let r=_("rect",{x:-n/2,y:-8,width:n,height:16,rx:3,ry:3}),i=_("text",{"text-anchor":"middle","dominant-baseline":"central"});i.textContent=o,a.append(r,i),this.labelLayer.append(a)}return{group:t,path:s,label:a}}draw(){for(let[e,t]of this.nodeEls){let s=this.shown.get(e)??this.positions.get(e);if(s)t.setAttribute("transform",`translate(${s.x} ${s.y})`)}for(let e of this.model.edges)this.drawEdge(e)}shape(e){let t=this.shown.get(e.source)??this.positions.get(e.source),s=this.shown.get(e.target)??this.positions.get(e.target);if(!t||!s)return null;return is({source:t,sourceSize:this.model.size(e.source),target:s,targetSize:this.model.size(e.target)},{curve:this.layoutName==="layered"?"bezier":"straight",direction:this.direction,offset:this.offsets.get(e.id)??0,inset:e.directed!==!1?1:0})}drawEdge(e){let t=this.edgeEls.get(e.id),s=t&&this.shape(e);if(!t||!s)return;t.path.setAttribute("d",s.d),t.label?.setAttribute("transform",`translate(${Math.round(s.label.x*10)/10} ${Math.round(s.label.y*10)/10})`)}moveToPlace(){this.stop();let e=typeof matchMedia==="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!this.animate||e||typeof requestAnimationFrame!=="function"){this.shown=new Map(this.positions),this.draw();return}let t=new Map;for(let[o,n]of this.positions)t.set(o,this.shown.get(o)??n);let s=performance.now(),a=(o)=>{let n=Math.min(1,(o-s)/dr),r=1-(1-n)**3;for(let[i,c]of this.positions){let l=t.get(i);this.shown.set(i,{x:l.x+(c.x-l.x)*r,y:l.y+(c.y-l.y)*r})}if(this.draw(),this.frame=n<1?requestAnimationFrame(a):0,n>=1)this.shown=new Map(this.positions)};this.frame=requestAnimationFrame(a)}stop(){if(this.frame)cancelAnimationFrame(this.frame);this.frame=0}setView(e){this.view=e,this.stage.setAttribute("transform",`translate(${e.x} ${e.y}) scale(${e.k})`),this.callbacks.onViewport?.({...e})}mark(){let e=this.selected,t=new Set(e?this.model.neighbours(e):[]);this.root.toggleAttribute("data-has-selection",Boolean(e));for(let[a,o]of this.nodeEls)if(o.toggleAttribute("data-selected",a===e),o.toggleAttribute("data-neighbour",t.has(a)),a===e)o.setAttribute("aria-current","true");else o.removeAttribute("aria-current");for(let a of this.model.edges){let o=this.edgeEls.get(a.id);if(!o)continue;let n=e!=null&&(a.source===e||a.target===e);if(o.group.toggleAttribute("data-active",n),o.label?.toggleAttribute("data-active",n),a.directed!==!1)o.path.setAttribute("marker-end",`url(#${this.prefix}-${n?"arrow-active":"arrow"})`)}let s=e?this.nodeEls.get(e):null;if(s)this.surface.setAttribute("aria-activedescendant",s.id);else this.surface.removeAttribute("aria-activedescendant")}describe(e){let t=this.model.node(e);if(!t)return;let s=this.model.neighbours(e).map((n)=>oe(this.model.node(n))),a=s.slice(0,5).join(", "),o=s.length>5?` and ${s.length-5} more`:"";this.announce(s.length===0?`${oe(t)}, no connections`:`${oe(t)}, ${s.length} ${s.length===1?"connection":"connections"}: ${a}${o}`)}announce(e){if(this.status)this.status.textContent=e}expand(e,t=!1){let s=this.model.node(e);if(!s)return;if(this.lastExpand=performance.now(),t||s.expandable===!1)this.callbacks.onOpen?.({node:s});else this.callbacks.onExpand?.({node:s})}nodeUnder(e){let t=e instanceof Element?e.closest(".stx-gv-node"):null;return t?this.idOf.get(t)??null:null}local(e){let t=this.surface.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}listen(){let e=(s,a,o)=>{this.surface.addEventListener(s,a,o),this.disposers.push(()=>this.surface.removeEventListener(s,a,o))};e("pointerdown",(s)=>this.onPointerDown(s)),e("pointermove",(s)=>this.onPointerMove(s)),e("pointerup",(s)=>this.onPointerUp(s)),e("pointercancel",()=>this.endGesture()),e("dblclick",(s)=>{let a=this.nodeUnder(s.target);if(a&&performance.now()-this.lastExpand>$s)this.expand(a,s.metaKey||s.ctrlKey)}),e("wheel",(s)=>this.onWheel(s),{passive:!1}),e("keydown",(s)=>this.onKeyDown(s)),e("contextmenu",(s)=>{if(this.contextMenu)s.preventDefault();let a=this.nodeUnder(s.target);if(a)this.select(a);this.callbacks.onContext?.({node:a?this.model.node(a):null,x:s.clientX,y:s.clientY})});let t=(s,a)=>{this.surface.addEventListener(s,a),this.disposers.push(()=>this.surface.removeEventListener(s,a))};t("gesturestart",(s)=>{s.preventDefault();let a=this.local(s);this.pinch={k:this.view.k,x:a.x,y:a.y}}),t("gesturechange",(s)=>{if(!this.pinch)return;s.preventDefault(),this.zoomBy(this.pinch.k*s.scale/this.view.k,{x:this.pinch.x,y:this.pinch.y})}),t("gestureend",()=>{this.pinch=null})}onPointerDown(e){if(e.button!==0)return;let t=this.nodeUnder(e.target);this.surface.focus({preventScroll:!0});try{this.surface.setPointerCapture(e.pointerId)}catch{}this.gesture={pointer:e.pointerId,node:t,startX:e.clientX,startY:e.clientY,origin:t?{...this.positions.get(t)??{x:0,y:0}}:{x:0,y:0},view:{...this.view},moved:!1}}onPointerMove(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;let s=e.clientX-t.startX,a=e.clientY-t.startY;if(!t.moved){if(Math.abs(s)<Cs&&Math.abs(a)<Cs)return;t.moved=!0,this.stop(),this.shown=new Map(this.positions),this.root.setAttribute("data-dragging",t.node?"node":"pan")}if(t.node){let o={x:t.origin.x+s/this.view.k,y:t.origin.y+a/this.view.k};this.positions.set(t.node,o),this.shown.set(t.node,o),this.nodeEls.get(t.node)?.setAttribute("transform",`translate(${o.x} ${o.y})`);for(let n of this.model.edgesOf(t.node))this.drawEdge(n)}else this.autoFit=!1,this.setView(De(t.view,s,a))}onPointerUp(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;if(this.endGesture(),t.moved){if(t.node){this.pinned.add(t.node),this.autoFit=!1;let o=this.positions.get(t.node);this.callbacks.onMove?.({node:this.model.node(t.node),x:o.x,y:o.y})}return}if(!t.node){this.select(null);return}let s=performance.now(),a=this.lastClick.id===t.node&&s-this.lastClick.at<$s;if(this.lastClick=a?{id:"",at:0}:{id:t.node,at:s},this.select(t.node),a)this.expand(t.node,e.metaKey||e.ctrlKey)}endGesture(){let e=this.gesture;if(this.gesture=null,this.root.removeAttribute("data-dragging"),e)try{this.surface.releasePointerCapture(e.pointer)}catch{}}onWheel(e){if(e.preventDefault(),e.ctrlKey||e.metaKey){this.zoomBy(Math.exp(-e.deltaY*(e.deltaMode===1?0.05:0.01)),this.local(e));return}let t=e.deltaMode===1?16:1;this.panBy(-e.deltaX*t,-e.deltaY*t)}onKeyDown(e){let s={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"}[e.key];if(s){e.preventDefault();let o=this.selected?ks(this.positions,this.selected,s):Ss(this.positions,rt(this.view,{x:this.size.width/2,y:this.size.height/2}));if(o)this.select(o),this.bringIntoView(o);return}let a=e.metaKey||e.ctrlKey;if(e.key==="Enter"||e.key===" "){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,a)}else if(a||e.altKey);else if(e.key==="+"||e.key==="=")e.preventDefault(),this.zoomIn();else if(e.key==="-"||e.key==="_")e.preventDefault(),this.zoomOut();else if(e.key==="0")e.preventDefault(),this.fit();else if(e.key==="f"||e.key==="F"){if(!this.selected)return;e.preventDefault(),this.focusNode(this.selected)}else if(e.key==="o"||e.key==="O"){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,!0)}else if(e.key==="Escape"&&this.selected)e.preventDefault(),this.select(null)}bringIntoView(e){let t=this.positions.get(e);if(!t)return;let s=this.model.size(e),a=ys(this.view,{x:t.x-s.width/2,y:t.y-s.height/2,width:s.width,height:s.height},this.size);if(a!==this.view)this.autoFit=!1,this.setView(a)}}var mr="./GroupedList-j3sxv5pb.stx";var xr="./GroupedListRow-v52zmzpk.stx";var vr="./Image-6x38ddd7.stx";var yr="./EmailInput-sf9jfrgz.stx";var Sr="./NumberInput-e2afxyh3.stx";var $r="./PasswordInput-n2ven456.stx";var Er="./SearchInput-w15r5t95.stx";var Ar="./TextInput-tyqzz3jy.stx";var Pr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string},Mr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,leftIcon:f.string,rightIcon:f.string,clearable:f.boolean,maxLength:f.number,showCount:f.boolean,type:f.oneOf(["text","date","time","datetime-local","month","week","url","tel","color","search","email","number","password"]),pattern:f.string,list:f.string,minLength:f.number,htmlSize:f.number,autofocus:f.boolean},Rr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,min:f.number,max:f.number,step:f.number,showControls:f.boolean},Nr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,showStrength:f.boolean},Lr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,onSearch:f.func,loading:f.boolean},Em=se("TextInput",Mr),Im=se("EmailInput",Pr),Am=se("PasswordInput",Nr),Pm=se("NumberInput",Rr),Mm=se("SearchInput",Lr);var Or=new Set(["array","set"]),zr=/^[A-Z_$][\w$]*$/i;function ct(e){return Or.has(e.kind)}function it(e){return e.ref===void 0&&(e.children!==void 0&&e.children.length>0||(e.more??0)>0)}function dt(e,t="$"){let s=t;for(let a of e)if(typeof a==="number")s+=`[${a}]`;else if(zr.test(a))s+=`.${a}`;else s+=`[${JSON.stringify(a)}]`;return s}function lt(e){if(e.ref!==void 0)return"[Circular]";if(e.children){if(ct(e))return e.children.map((s)=>lt(s));let t={};return e.children.forEach((s,a)=>{t[s.key!==void 0?String(s.key):s.label??String(a)]=lt(s)}),t}if("value"in e){let t=e.value;if(typeof t==="bigint")return t.toString();if(typeof t==="number"&&!Number.isFinite(t))return String(t);if(typeof t==="function"||typeof t==="symbol")return e.preview??String(t);return t}return e.preview??null}function Es(e,t=2){let s=lt(e);return s===void 0?"undefined":JSON.stringify(s,null,t)}var Ts=80;function pt(e){if(e.preview!==void 0)return e.preview;if(e.ref!==void 0)return"[Circular]";if(e.children||e.more){let t=(e.children?.length??0)+(e.more??0);if(ct(e))return`${e.kind==="set"?"Set":"Array"}(${t})`;return t===0?"{}":`{${t}}`}if("value"in e){let t=e.value;if(typeof t==="string")return JSON.stringify(t.length>Ts?`${t.slice(0,Ts)}\u2026`:t);if(typeof t==="bigint")return`${t}n`;return String(t)}return e.kind}function Hm(e,t,s={}){let a=s.maxItems??1000,o=s.maxDepth??32,n=new Map,r=1,i=(l,d)=>{if(d!==void 0)l.label=d;return l},c=(l,d,h)=>{if(l===null)return i({kind:"null",value:null,preview:"null"},d);switch(typeof l){case"undefined":return i({kind:"undefined",value:void 0,preview:"undefined"},d);case"string":case"number":case"boolean":case"bigint":return i({kind:typeof l,value:l},d);case"symbol":return i({kind:"symbol",preview:l.toString()},d);case"function":return i({kind:"function",preview:`\u0192 ${l.name||"(anonymous)"}()`},d)}let p=l,u=n.get(p);if(u!==void 0)return i({kind:"ref",ref:u},d);if(p instanceof Date)return i({kind:"date",value:Number.isNaN(p.getTime())?null:p.toISOString(),preview:Number.isNaN(p.getTime())?"Invalid Date":p.toISOString()},d);if(p instanceof RegExp)return i({kind:"regexp",value:p.toString(),preview:p.toString()},d);let g=`v${r++}`;n.set(p,g);let m=Array.isArray(p),w=p instanceof Set,y=p instanceof Map,v=i({id:g,kind:m?"array":w?"set":y?"map":"object",children:[]},d);if(h>=o)return v.preview=m?"Array":"Object",delete v.children,v;let b=v.children,C=0;if(m||w)for(let P of p){if(C<a)b.push(c(P,String(C),h+1));C++}else if(y)for(let[P,T]of p){if(C<a)b.push(c(T,typeof P==="string"?P:pt(c(P,void 0,o)),h+1));C++}else{for(let T of Object.keys(p)){if(C<a)b.push(c(p[T],T,h+1));C++}let P=p.constructor?.name;if(P&&P!=="Object")v.preview=`${P} {${C}}`}if(C>b.length)v.more=C-b.length;if(y)v.preview=`Map(${C})`;return v};return c(e,t,0)}class ht{rows=[];version=0;roots=[];depth;opened=new Set;closed=new Set;index=null;constructor(e,t={}){this.depth=t.depth??1,this.setValue(e)}setValue(e){this.roots=e==null?[]:Array.isArray(e)?e:[e],this.opened.clear(),this.closed.clear(),this.flatten()}setDepth(e){this.depth=e,this.opened.clear(),this.closed.clear(),this.flatten()}getRoots(){return this.roots}indexOf(e){if(!this.index){this.index=new Map;for(let t=0;t<this.rows.length;t++)this.index.set(this.rows[t].id,t)}return this.index.get(e)??-1}pathOf(e){let t=[];for(let s=e;s>=0;s=this.rows[s].parent){let a=this.rows[s];if(a.isMore)continue;if(a.parent!==-1||this.roots.length>1)t.push(a.key)}return t.reverse()}isExpanded(e,t){return this.opened.has(e)||t<this.depth&&!this.closed.has(e)}expand(e){return this.set(e,!0)}collapse(e){return this.set(e,!1)}toggle(e){let t=this.indexOf(e);if(t===-1)return!1;return this.set(e,!this.rows[t].expanded)}expandAll(e){let t=(s,a,o)=>{if(!it(s))return;if(o>=this.depth)this.opened.add(a);this.closed.delete(a),s.children?.forEach((n,r)=>t(n,n.id??`${a}.${r}`,o+1))};if(e===void 0)this.roots.forEach((s,a)=>t(s,s.id??String(a),0));else{let s=this.find(e);if(!s)return;t(s.node,e,s.ancestors.length)}this.flatten()}collapseAll(){this.opened.clear(),this.closed.clear();let e=(t,s,a)=>{if(a>=this.depth||!it(t))return;this.closed.add(s),t.children?.forEach((o,n)=>e(o,o.id??`${s}.${n}`,a+1))};this.roots.forEach((t,s)=>e(t,t.id??String(s),0)),this.flatten()}reveal(e){let t=this.find(e);if(!t)return-1;return t.ancestors.forEach((s,a)=>{if(this.closed.delete(s),a>=this.depth)this.opened.add(s)}),this.flatten(),this.indexOf(e)}appendChildren(e,t,s=0){let a=this.find(e);if(!a)return!1;let o=a.node;if(o.children=[...o.children??[],...t],s>0)o.more=s;else delete o.more;return this.flatten(),!0}move(e,t,s=10){let a=this.rows.length-1;if(a<0)return{index:-1,changed:!1};let o=Math.min(Math.max(e,0),a),n=this.rows[o],r=(i)=>({index:Math.min(Math.max(i,0),a),changed:!1});switch(t){case"ArrowDown":return r(e<0?0:o+1);case"ArrowUp":return r(o-1);case"Home":return r(0);case"End":return r(a);case"PageDown":return r(o+s);case"PageUp":return r(o-s);case"ArrowRight":if(!n.expandable||n.isMore)return r(o);if(!n.expanded)return{index:o,changed:this.expand(n.id)};return r(o+1);case"ArrowLeft":if(n.expanded&&!n.isMore)return{index:o,changed:this.collapse(n.id)};return r(n.parent===-1?o:n.parent);case"*":{let i=!1,c=n.parent,l=this.rows.filter((d)=>d.parent===c&&d.depth===n.depth&&d.expandable&&!d.expanded&&!d.isMore);for(let d of l)this.mark(d.id,d.depth,!0),i=!0;if(i)this.flatten();return{index:this.indexOf(n.id),changed:i}}}return r(o)}typeahead(e,t){let s=t.toLowerCase(),a=this.rows.length;if(s===""||a===0)return-1;let o=s.length===1?e+1:Math.max(e,0);for(let n=0;n<a;n++){let r=(o+n+a)%a,i=this.rows[r];if(!i.isMore&&(i.node.label??"").toLowerCase().startsWith(s))return r}return-1}set(e,t){let s=this.indexOf(e);if(s===-1)return!1;let a=this.rows[s];if(!a.expandable||a.isMore||a.expanded===t)return!1;return this.mark(e,a.depth,t),this.flatten(),!0}mark(e,t,s){if(s){if(this.closed.delete(e),t>=this.depth)this.opened.add(e)}else if(this.opened.delete(e),t<this.depth)this.closed.add(e)}find(e){let t=[];for(let s=this.roots.length-1;s>=0;s--)t.push({node:this.roots[s],id:this.roots[s].id??String(s),ancestors:[]});while(t.length>0){let s=t.pop();if(s.id===e)return{node:s.node,ancestors:s.ancestors};let a=s.node.children;if(!a||s.node.ref!==void 0)continue;let o=[...s.ancestors,s.id];for(let n=a.length-1;n>=0;n--)t.push({node:a[n],id:a[n].id??`${s.id}.${n}`,ancestors:o})}return null}flatten(){let e=[],t=(s,a,o,n,r,i,c)=>{let l=it(s),d=l&&this.isExpanded(a,o),h=e.length;if(e.push({id:a,node:s,depth:o,key:r,parent:n,expandable:l,expanded:d,posInSet:i,setSize:c,isMore:!1}),!d)return;let p=s.children??[],u=s.more??0,g=ct(s),m=p.length+(u>0?1:0);for(let w=0;w<p.length;w++){let y=p[w];t(y,y.id??`${a}.${w}`,o+1,h,y.key??(g?w:y.label??w),w+1,m)}if(u>0)e.push({id:`${a}.+`,node:s,depth:o+1,key:"",parent:h,expandable:!1,expanded:!1,posInSet:m,setSize:m,isMore:!0})};this.roots.forEach((s,a)=>t(s,s.id??String(a),0,-1,s.key??a,a+1,this.roots.length)),this.rows=e,this.index=null,this.version++}}var Hr="./JsonTree-satc4010.stx";var Ps=new Set(["array","object","map","set","model","error"]);function jr(e){return e.t==="object"||e.t==="model"}function Is(e){return e.length>0&&e.slice(0,20).every(jr)}function As(e){return e.some((t)=>Ps.has(t.t))}function ut(e,t){let s=e.length>120?`${e.slice(0,120)}\u2026`:e;return t?`${JSON.stringify(s)} (${t} more characters)`:JSON.stringify(s)}function Vr(e){if(!e.file)return"";return[e.file,e.line,e.column].filter((t)=>t!==void 0).join(":")}function Fm(e,t,s={}){let a=s.idPrefix??"t",o=(l)=>`${a}${l}`,n=(l,d)=>{if(d!==void 0)l.label=d;return l},r=(l)=>c(l,void 0).preview??l.t,i=(l,d)=>{if(d.length>0)l.openable=d.length===1?d[0]:d;return l};function c(l,d){switch(l.t){case"undefined":return n({kind:"undefined",value:void 0,preview:"undefined"},d);case"null":return n({kind:"null",value:null,preview:"null"},d);case"boolean":return n({kind:"boolean",value:l.v,preview:String(l.v)},d);case"number":{let h=typeof l.v==="number"?l.v:l.v==="-0"?-0:Number(l.v);return n({kind:"number",value:h,preview:String(l.v)},d)}case"bigint":return n({kind:"bigint",value:l.v,preview:`${l.v}n`},d);case"string":return n({kind:"string",value:l.v,preview:ut(l.v,l.truncated)},d);case"symbol":return n({kind:"symbol",preview:`Symbol(${l.v})`},d);case"function":{let h=l.kind==="class"?`class ${l.name}`:`${l.kind==="async"?"async ":""}\u0192${l.kind==="generator"?"*":""} ${l.name}()`;return n({kind:"function",preview:h},d)}case"date":return n({kind:"date",value:l.v,preview:l.v??"Invalid Date"},d);case"regexp":return n({kind:"regexp",value:l.v,preview:l.v},d);case"url":return n({kind:"url",value:l.v,preview:l.v},d);case"promise":return n({kind:"promise",preview:"Promise"},d);case"bytes":{let h=l.length*2>l.hex.length;return n({kind:"bytes",value:l.hex,preview:`${l.ctor}(${l.length}) <${l.hex}${h?"\u2026":""}>`},d)}case"ref":return n({kind:"ref",ref:o(l.id),preview:"[Circular]"},d);case"cut":return n({kind:"cut",preview:`${l.ctor??"Object"} \u2026 (${l.reason==="depth"?"too deep to show":"result too large to show"})`},d);case"array":{let h={id:o(l.id),kind:"array",preview:`${l.ctor??"Array"}(${l.length})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(i(h,Is(l.items)?["table"]:[]),d)}case"set":{let h={id:o(l.id),kind:"set",preview:`Set(${l.size})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(i(h,Is(l.items)?["table"]:[]),d)}case"object":{let h=l.entries.slice(0,5).map(([m])=>m).join(", "),p=l.entries.length+(l.more??0),u=p===0?"{}":`{${h}${p>5?", \u2026":""}}`,g={id:o(l.id),kind:"object",preview:l.ctor&&l.ctor!=="Object"?`${l.ctor} ${u}`:u,children:l.entries.map(([m,w])=>c(w,m))};if(l.more)g.more=l.more;return n(i(g,As(l.entries.map((m)=>m[1]))?["graph"]:[]),d)}case"map":{let h={id:o(l.id),kind:"map",preview:`Map(${l.size})`,children:l.entries.map(([p,u],g)=>{if(!Ps.has(p.t)){let m=c(u,r(p));return m.key=p.t==="string"?p.v:r(p),m}return{kind:"entry",label:String(g),key:g,preview:`${r(p)} => ${r(u)}`,children:[c(p,"key"),c(u,"value")]}})};if(l.more)h.more=l.more;return n(i(h,As(l.entries.map((p)=>p[1]))?["graph"]:[]),d)}case"model":{let h=l.attributes.map(([g,m])=>c(m,g));for(let[g,m]of l.loaded??[]){let w=c(m,g);w.meta=w.meta??{relation:!0},h.push(w)}if(l.hidden?.length)h.push({kind:"hidden",label:"[hidden]",key:"[hidden]",preview:l.hidden.join(", "),children:l.hidden.map((g,m)=>({kind:"hidden",label:String(m),value:g,preview:g}))});if(l.relations?.length)h.push({kind:"relations",label:"[relations]",key:"[relations]",preview:`${l.relations.length} declared`,children:l.relations.map((g)=>({kind:"relation",label:g.name??g.model,value:g,preview:`${g.kind} ${g.model}`}))});let p={model:l.model,hidden:l.hidden??[],relations:l.relations??[]};if(l.table)p.table=l.table;if(l.primaryKey)p.primaryKey=l.primaryKey;let u={id:o(l.id),kind:"model",preview:l.key?`${l.model} #${r(l.key).replace(/^"|"$/g,"")}`:l.model,children:h,meta:p};if(l.more)u.more=l.more;return n(i(u,["graph"]),d)}case"html":{let h={kind:l.kind};if(l.title)h.title=l.title;if(l.text)h.text=l.text;if(l.truncated)h.truncated=l.truncated;let p=l.truncated?`, ${l.truncated} more cut`:"",u=l.title?`: ${l.title}`:"";return n(i({kind:"html",value:l.html,preview:`${l.kind}${u} (${l.html.length} characters${p})`,meta:h},["preview"]),d)}case"error":{let h=[{kind:"string",label:"message",value:l.message,preview:ut(l.message)}];if(l.frames?.length)h.push({kind:"stack",label:"stack",preview:`${l.frames.length} frames`,value:l.stack,children:l.frames.map((p,u)=>({kind:"frame",label:String(u),value:p,preview:[p.function,Vr(p)].filter(Boolean).join(" at ")||"(unknown)",meta:p}))});else if(l.stack)h.push({kind:"string",label:"stack",value:l.stack,preview:ut(l.stack)});if(l.cause)h.push(c(l.cause,"cause"));for(let[p,u]of l.entries??[])h.push(c(u,p));return n({kind:"error",preview:l.message?`${l.name}: ${l.message}`:l.name,children:h},d)}}return n({kind:"unknown",preview:String(l.t??"unknown")},d)}return c(e,t)}var Fr=600,Ms=400,Rs={table:"Table",graph:"Graph",preview:"Preview"};function Ns(e){return e.length>Ms?`${e.slice(0,Ms)}\u2026`:e}function Ls(e){if(e==null||e==="")return[];return Array.isArray(e)?e:[e]}class Br{root;callbacks;model;scroller;content;rowsEl;status;prefix;rowHeight;overscan;openable;contextMenu;pool=[];parts=new WeakMap;active=-1;activeId="";typed="";typedAt=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=(n)=>e.querySelector(`[data-jt="${n}"]`);this.scroller=a("scroller")??e,this.content=a("content")??this.scroller,this.rowsEl=a("rows")??this.content,this.status=a("status"),this.prefix=`${e.id||`json-tree-${Math.random().toString(36).slice(2,8)}`}-row-`,this.rowHeight=t.rowHeight&&t.rowHeight>0?t.rowHeight:22,this.overscan=t.overscan??6,this.openable=t.openable??null,this.contextMenu=Boolean(t.contextMenu),this.model=new ht(t.value,{depth:t.depth??1}),this.rowsEl.__stx_inert_content=!0,e.style.setProperty("--stx-tree-row-height",`${this.rowHeight}px`);let o=(n,r,i,c)=>{n.addEventListener(r,i,c),this.disposers.push(()=>n.removeEventListener(r,i,c))};if(o(this.scroller,"scroll",()=>this.render(),{passive:!0}),o(this.scroller,"keydown",(n)=>this.onKeyDown(n)),o(this.scroller,"focus",()=>{if(this.active===-1&&this.model.rows.length>0)this.setActive(0,!1)}),o(this.rowsEl,"mousedown",(n)=>{if(n.target.closest("[data-jt-action]"))n.preventDefault()}),o(this.rowsEl,"click",(n)=>this.onClick(n)),o(this.rowsEl,"dblclick",(n)=>this.onDoubleClick(n)),o(this.rowsEl,"contextmenu",(n)=>this.onContextMenu(n)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.render(),e.setAttribute("data-jt-ready","")}setValue(e){this.model.setValue(e),this.active=-1,this.activeId="",this.scroller.scrollTop=0,this.render()}setDepth(e){this.model.setDepth(e),this.afterChange()}setOpenable(e){this.openable=e??null,this.model.version++,this.render()}setContextMenu(e){this.contextMenu=e}expandAll(e){this.model.expandAll(e),this.afterChange()}collapseAll(){this.model.collapseAll(),this.afterChange()}expand(e){let t=this.model.expand(e);if(t)this.afterChange();return t}collapse(e){let t=this.model.collapse(e);if(t)this.afterChange();return t}reveal(e){let t=this.model.reveal(e);if(t===-1)return this.afterChange(),!1;return this.active=t,this.activeId=e,this.scrollToRow(t),this.render(),this.emitSelect(),!0}appendChildren(e,t,s=0){let a=this.model.appendChildren(e,t,s);if(a)this.afterChange();return a}getSelected(){return this.active===-1?null:this.detail(this.active)}select(e){let t=this.model.indexOf(e);if(t===-1)return!1;return this.setActive(t,!0),!0}focus(){this.scroller.focus()}get drawn(){return this.pool.filter((e)=>e.style.display!=="none").length}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();this.rowsEl.textContent="",this.pool=[],this.root.removeAttribute("data-jt-ready")}afterChange(){if(this.activeId){let e=this.model.indexOf(this.activeId);if(this.active=e,e===-1)this.activeId=""}this.render()}detail(e){let t=this.model.rows[e],s=this.model.pathOf(e);return{id:t.id,node:t.node,path:s,pathText:dt(s)}}emitSelect(){if(this.active!==-1)this.callbacks.onSelect?.(this.detail(this.active))}setActive(e,t){if(e<0||e>=this.model.rows.length)return;let s=e!==this.active;if(this.active=e,this.activeId=this.model.rows[e].id,t)this.scrollToRow(e);if(this.render(),s)this.emitSelect()}scrollToRow(e){let t=e*this.rowHeight,s=this.scroller.clientHeight;if(t<this.scroller.scrollTop)this.scroller.scrollTop=t;else if(t+this.rowHeight>this.scroller.scrollTop+s)this.scroller.scrollTop=t+this.rowHeight-s}pageSize(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.rowHeight)-1)}createRow(){let e=document.createElement("div");e.setAttribute("role","treeitem"),e.className="stx-jt-row";let t=(a,o)=>{let n=document.createElement("span");if(n.className=a,o)n.setAttribute("aria-hidden","true");return e.appendChild(n),n},s={twisty:t("stx-jt-twisty",!0),label:t("stx-jt-label",!1),separator:t("stx-jt-separator",!0),preview:t("stx-jt-preview",!1),actions:t("stx-jt-actions",!1)};return s.separator.textContent=": ",this.parts.set(e,s),this.rowsEl.appendChild(e),e}button(e,t,s,a){let o=document.createElement("button");if(o.type="button",o.tabIndex=-1,o.className="stx-jt-action",o.setAttribute("data-jt-action",e),a)o.setAttribute("data-jt-as",a);return o.setAttribute("aria-label",s),o.textContent=t,o}opensOf(e,t){if(e.isMore)return[];if(this.openable){let s=this.openable(e.node,this.model.pathOf(t));if(s!==void 0)return Ls(s)}return Ls(e.node.openable)}render(){let e=this.model.rows,t=e.length,s=this.scroller.clientHeight;this.content.style.height=`${t*this.rowHeight}px`;let a=Math.max(0,Math.min(this.scroller.scrollTop,t*this.rowHeight-s)),o=Math.max(0,Math.floor(a/this.rowHeight)-this.overscan),n=Math.min(t,Math.ceil((a+s)/this.rowHeight)+this.overscan),r=Math.max(0,n-o);while(this.pool.length<r)this.pool.push(this.createRow());let i=this.pool.length,c=new Uint8Array(i);for(let d=o;d<n;d++){let h=d%i;c[h]=1,this.paint(this.pool[h],e[d],d)}for(let d=0;d<i;d++)if(!c[d]&&this.pool[d].style.display!=="none")this.pool[d].style.display="none",this.pool[d].__jt=void 0,this.pool[d].removeAttribute("id");if(this.active>=o&&this.active<n)this.scroller.setAttribute("aria-activedescendant",this.prefix+this.active);else this.scroller.removeAttribute("aria-activedescendant")}paint(e,t,s){let a=this.model.version,o=s===this.active,n=e.__jt;if(!n||n.index!==s||n.version!==a){let r=this.parts.get(e),i=t.node;if(e.style.display="",e.style.transform=`translateY(${s*this.rowHeight}px)`,e.style.setProperty("--stx-tree-depth",String(t.depth)),e.id=this.prefix+s,e.setAttribute("data-jt-index",String(s)),e.setAttribute("aria-level",String(t.depth+1)),e.setAttribute("aria-posinset",String(t.posInSet)),e.setAttribute("aria-setsize",String(t.setSize)),t.expandable)e.setAttribute("aria-expanded",t.expanded?"true":"false");else e.removeAttribute("aria-expanded");if(t.isMore)e.setAttribute("data-kind","more"),r.twisty.textContent="",r.label.textContent="",r.separator.style.display="none",r.preview.textContent=`\u2026 ${i.more} more`,r.preview.setAttribute("data-kind","more");else{e.setAttribute("data-kind",i.kind),r.twisty.textContent=t.expandable?t.expanded?"\u25BE":"\u25B8":"";let d=i.label??(typeof t.key==="number"&&t.parent!==-1?String(t.key):"");r.label.textContent=Ns(d),r.separator.style.display=d===""?"none":"",r.preview.textContent=Ns(pt(i)),r.preview.setAttribute("data-kind",i.kind)}let c=this.opensOf(t,s),l=t.isMore?"+":c.join("|");if(!n||n.opens!==l)if(r.actions.textContent="",t.isMore)r.actions.appendChild(this.button("more","Load","Load more"));else{for(let d of c)r.actions.appendChild(this.button("open",Rs[d]??d,`Open as ${Rs[d]?.toLowerCase()??d}`,d));r.actions.appendChild(this.button("copy-value","Copy","Copy value")),r.actions.appendChild(this.button("copy-path","Path","Copy path"))}e.__jt={index:s,version:a,opens:l}}if(o)e.setAttribute("aria-selected","true"),e.setAttribute("data-active","");else e.setAttribute("aria-selected","false"),e.removeAttribute("data-active")}rowIndexOf(e){let t=e instanceof Element?e.closest("[data-jt-index]"):null;if(!t||t.style.display==="none")return-1;return Number(t.getAttribute("data-jt-index"))}say(e){if(this.status)this.status.textContent=e}toggleRow(e){let t=this.model.rows[e];if(!t)return;if(t.isMore){this.loadMore(e);return}if(t.node.ref!==void 0){this.follow(e);return}if(!t.expandable)return;let s=t.id;this.model.toggle(s),this.afterChange();let a=this.model.indexOf(s);if(a!==-1)this.callbacks.onToggle?.({...this.detail(a),expanded:this.model.rows[a].expanded})}follow(e){let t=this.model.rows[e].node.ref;if(t===void 0)return;if(!this.reveal(t))this.say("The value this points back to is not part of what was sent.")}loadMore(e){let s=this.model.rows[e].parent;if(s===-1)return;this.callbacks.onLoadMore?.(this.detail(s))}copy(e,t){let s=this.model.rows[e];if(!s)return;let a=s.isMore?s.parent:e,o=this.model.pathOf(a),n=this.model.rows[a].node,r=t==="path"?dt(o):Es(n);try{navigator.clipboard?.writeText(r)?.catch(()=>{})}catch{}this.say(t==="path"?`Copied path ${r}`:"Copied value"),this.callbacks.onCopy?.({what:t,text:r,path:o,node:n})}open(e,t){let s=this.model.rows[e];if(!s||s.isMore)return;let a=t??this.opensOf(s,e)[0];if(a===void 0)return;this.callbacks.onOpen?.({...this.detail(e),as:a})}onClick(e){let t=this.rowIndexOf(e.target);if(t===-1)return;let s=e.target instanceof Element?e.target.closest("[data-jt-action]"):null;if(this.setActive(t,!1),s){let o=s.getAttribute("data-jt-action");if(o==="copy-value")this.copy(t,"value");else if(o==="copy-path")this.copy(t,"path");else if(o==="open")this.open(t,s.getAttribute("data-jt-as")??void 0);else if(o==="more")this.loadMore(t);return}let a=this.model.rows[t];if(a.expandable||a.isMore||a.node.ref!==void 0)this.toggleRow(t)}onDoubleClick(e){let t=this.rowIndexOf(e.target);if(t===-1||e.target instanceof Element&&e.target.closest("[data-jt-action]"))return;let s=this.model.rows[t];if(!s.expandable&&!s.isMore&&s.node.ref===void 0)this.open(t)}onContextMenu(e){let t=this.rowIndexOf(e.target);if(t===-1)return;if(this.setActive(t,!1),this.contextMenu)e.preventDefault();this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onKeyDown(e){let t=this.model.rows;if(t.length===0)return;let s=e.metaKey||e.ctrlKey,a=e.key;if(s&&(a==="c"||a==="C")){if(this.active===-1)return;e.preventDefault(),this.copy(this.active,e.shiftKey?"path":"value");return}if(s||e.altKey)return;if(a==="Enter"&&e.shiftKey){if(e.preventDefault(),this.active!==-1)this.open(this.active);return}let o=this.typed!==""&&Date.now()-this.typedAt<=Fr;if(a==="Enter"||a===" "&&!o){if(e.preventDefault(),this.active!==-1)this.toggleRow(this.active);return}if(a==="ArrowDown"||a==="ArrowUp"||a==="ArrowLeft"||a==="ArrowRight"||a==="Home"||a==="End"||a==="PageDown"||a==="PageUp"||a==="*"){e.preventDefault(),this.typed="";let n=this.active===-1?null:t[this.active],r=n?.expanded,i=this.model.move(this.active,a,this.pageSize());if(i.changed){if(this.active=i.index,this.activeId=this.model.rows[i.index]?.id??"",this.scrollToRow(i.index),this.render(),n&&a!=="*"){let c=this.model.indexOf(n.id);if(c!==-1&&this.model.rows[c].expanded!==r)this.callbacks.onToggle?.({...this.detail(c),expanded:this.model.rows[c].expanded})}}else this.setActive(i.index,!0);return}if(a.length===1){let n=Date.now();if(!o)this.typed="";this.typedAt=n,this.typed+=a;let r=this.model.typeahead(this.active,this.typed);if(r!==-1)e.preventDefault(),this.setActive(r,!0)}}}var Kr="./List-q8ff8gdr.stx";var Wr="./Listbox-83j2q4x6.stx";var Ur="./ListboxButton-gan8e3nw.stx";var Yr="./ListboxLabel-ka0hfm7b.stx";var Zr="./ListboxOption-gpaqvk3s.stx";var ei="./ListboxOptions-2928864k.stx";var si="./FilterChip-bynt5maa.stx";var oi="./FilterChips-mpmev5v5.stx";var ri="./ListRow-nvyg2fwb.stx";var li="./NavBar-ky8tedjb.stx";var di="./SectionCard-8b5fyrjd.stx";var hi="./TabBar-6m1ajm1d.stx";var fi="./TabBarItem-kddfnhk3.stx";var gi="./Navigator-1yk1c3pp.stx";var bi="./Notification-b3cz24f0.stx";var wi="./Pager-5e7knyqh.stx";var ki="./PagerDots-076w890y.stx";var Ci="./Pagination-8bhbkpcp.stx";var Ti="./Checkout-crbegxyv.stx";var Ii="./DefaultPaymentMethod-ss3x61tr.stx";var Pi="./PaymentMethods-z4hhr0kv.stx";var Ri="./SubscriptionCheckout-rdcv32n1.stx";var Li="./Popover-jjt7p7sn.stx";var zi="./PopoverButton-ks3cttd9.stx";var Hi="./PopoverPanel-ddgj4gz3.stx";var Vi="./Portal-m73vz879.stx";var zs=[{name:"phone",label:"Phone",width:390,height:844},{name:"tablet",label:"Tablet",width:820,height:1180},{name:"desktop",label:"Desktop",width:1280,height:800}];function Os(e){let t=typeof e==="string"?Number.parseFloat(e):e;return typeof t==="number"&&Number.isFinite(t)&&t>0?Math.round(t):null}function ft(e,t={}){let s=Os(t.width),a=Os(t.height),o=Boolean(t.landscape);if(s&&a)return{name:"custom",size:{width:s,height:a},landscape:!1};let n=zs.find((i)=>i.name===e);if(!n)return{name:"fill",size:null,landscape:!1};let r=o&&n.height>n.width;return{name:n.name,size:r?{width:n.height,height:n.width}:{width:n.width,height:n.height},landscape:r}}function Ds(e,t,s=0){let a=t.width-s*2,o=t.height-s*2;if(a<=0||o<=0||e.width<=0||e.height<=0)return 1;return Math.min(1,a/e.width,o/e.height)}function Hs(e,t=1){if(!e.size)return"Fills the frame";let s=`${e.size.width} \xD7 ${e.size.height}`;return t<0.995?`${s} at ${Math.round(t*100)}%`:s}function mt(e){return e==="light"||e==="dark"?e:"auto"}var Fi=["allow-same-origin","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols","allow-popups","allow-popups-to-escape-sandbox","allow-modals","allow-downloads","allow-pointer-lock","allow-presentation","allow-storage-access-by-user-activation"];function js(e={}){let t=[];if(e.scripts)t.push("allow-scripts");if(e.forms)t.push("allow-forms");return t.join(" ")}function ox(e){return!e.toLowerCase().split(/\s+/).filter(Boolean).some((s)=>Fi.includes(s))}var Bi=/<!doctype\s|<html[\s>]/i,He=/<head(?:\s[^>]*)?>/i,je=/<html(?:\s[^>]*)?>/i,qi=/<base[\s>]/i,Ki=/<meta[^>]+name\s*=\s*["']?color-scheme/i,_i=/\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)/gi,Wi=/(<(style|script)\b[^>]*>)([\s\S]*?)(<\/\2\s*>)/gi,Gi=/(\smedia\s*=\s*)("[^"]*"|'[^']*')/gi,Ui="(min-width: 0px)",Ji="(max-width: 0px)";function Yi(e,t){let s=(n)=>n.replace(_i,(r,i)=>i.toLowerCase()===t?Ui:Ji),a=e.replace(Wi,(n,r,i,c,l)=>r+s(c)+l).replace(Gi,(n,r,i)=>r+s(i)),o=`<style data-stx-preview-scheme>:root{color-scheme:${t} !important}</style>`;if(He.test(a))return a.replace(He,(n)=>n+o);if(je.test(a))return a.replace(je,(n)=>`${n}<head>${o}</head>`);return o+a}function Xi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Vs(e,t={}){let s=Zi(e,t);return t.forceScheme?Yi(s,t.forceScheme):s}function Zi(e,t){let s=e==null?"":String(e),a='<base target="_blank">';if(!Bi.test(s))return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="color-scheme" content="light dark"><base target="_blank">${t.title?`<title>${Xi(t.title)}</title>`:""}</head><body>${s}</body></html>`;if(qi.test(s))return s;if(He.test(s))return s.replace(He,(o)=>o+'<base target="_blank">');if(je.test(s))return s.replace(je,(o)=>`${o}<head><base target="_blank"></head>`);return'<base target="_blank">'+s}function nx(e){return Ki.test(e)}function Fs(e,t){let s=["fill",...zs.map((o)=>o.name)],a=s.indexOf(e);return s[((a<0?0:a)+t+s.length)%s.length]}var el="./PreviewFrame-erbgvzj8.stx";var tl=16,Bs="(prefers-color-scheme: dark)",ke;function sl(){if(ke!==void 0)return ke;try{if(typeof matchMedia!=="function"||!document.body)return!0;let e=matchMedia(Bs).matches,t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.tabIndex=-1,t.style.cssText=`position:absolute;width:1px;height:1px;border:0;opacity:0;pointer-events:none;color-scheme:${e?"light":"dark"}`,document.body.appendChild(t),t.offsetWidth;let s=t.contentWindow?.matchMedia?.(Bs).matches;t.remove(),ke=typeof s==="boolean"?s!==e:!0}catch{ke=!0}return ke}class al{root;callbacks;html;viewportName;frameWidth;frameHeight;landscape;scheme;scripts;forms;title;viewport;scale=1;frame=null;written;stage;device;observer=null;pending=0;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;this.html=t.html??"",this.viewportName=t.viewport||"fill",this.frameWidth=t.frameWidth??null,this.frameHeight=t.frameHeight??null,this.landscape=Boolean(t.landscape),this.scheme=mt(t.scheme),this.scripts=Boolean(t.scripts),this.forms=Boolean(t.forms),this.title=t.title||"Preview",this.viewport=this.resolve(),this.stage=this.part("stage"),this.device=this.part("device");let a=(n)=>this.onToolbarClick(n),o=(n)=>this.onToolbarKey(n);if(this.root.addEventListener("click",a),this.root.addEventListener("keydown",o),this.disposers.push(()=>this.root.removeEventListener("click",a),()=>this.root.removeEventListener("keydown",o)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{cancelAnimationFrame(this.pending),this.pending=requestAnimationFrame(()=>this.layout())}),this.observer.observe(this.stage);this.load(),this.reflect(),this.root.setAttribute("data-preview-ready","")}getState(){return{viewport:this.viewport.name,width:this.viewport.size?.width??null,height:this.viewport.size?.height??null,landscape:this.viewport.landscape,scale:this.scale,scheme:this.scheme,effectiveScheme:this.effectiveScheme()}}setHtml(e){let t=e==null?"":String(e);if(t===this.html)return;this.html=t,this.load()}setViewport(e,t={}){if(this.viewportName=e||"fill","landscape"in t)this.landscape=Boolean(t.landscape);if("width"in t)this.frameWidth=t.width??null;if("height"in t)this.frameHeight=t.height??null;let s=JSON.stringify(this.viewport);if(this.viewport=this.resolve(),this.layout(),this.reflect(),JSON.stringify(this.viewport)!==s)this.callbacks.onViewport?.(this.getState())}setScheme(e){let t=mt(e);if(t===this.scheme)return;if(this.scheme=t,this.schemeToWrite()!==this.written)this.load();else this.applyScheme();this.reflect(),this.callbacks.onScheme?.(this.getState())}setPermissions(e){let t=e.scripts??this.scripts,s=e.forms??this.forms;if(t===this.scripts&&s===this.forms)return;this.scripts=t,this.forms=s,this.load()}reload(){this.load(),this.callbacks.onReload?.(this.getState())}destroy(){this.observer?.disconnect(),cancelAnimationFrame(this.pending);for(let e of this.disposers)e();this.frame?.remove(),this.frame=null,this.root.removeAttribute("data-preview-ready")}part(e){let t=this.root.querySelector(`[data-pf="${e}"]`);if(!t)throw Error(`PreviewFrame: the template has no ${e} part`);return t}resolve(){return ft(this.viewportName,{width:this.frameWidth,height:this.frameHeight,landscape:this.landscape})}effectiveScheme(){if(this.scheme!=="auto")return this.scheme;if(this.root.closest(".dark"))return"dark";if(this.root.closest(".light"))return"light";return typeof matchMedia==="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}schemeToWrite(){if(sl())return;if(this.scheme==="auto"&&!this.root.closest(".dark, .light"))return;return this.effectiveScheme()}load(){let e=document.createElement("iframe");e.setAttribute("sandbox",js({scripts:this.scripts,forms:this.forms})),e.setAttribute("referrerpolicy","no-referrer"),e.setAttribute("title",this.title),e.setAttribute("data-pf","frame"),e.className="stx-preview-frame",e.addEventListener("load",()=>{if(e===this.frame)this.callbacks.onLoad?.(this.getState())}),this.written=this.schemeToWrite(),e.srcdoc=Vs(this.html,{title:this.title,forceScheme:this.written}),this.frame?.remove(),this.frame=e,this.applyScheme(),this.device.appendChild(e),this.layout()}applyScheme(){let e=this.effectiveScheme();if(this.root.setAttribute("data-scheme",e),this.frame)this.frame.style.colorScheme=e}layout(){let e=this.frame;if(!e)return;let t=this.viewport.size;if(this.root.setAttribute("data-viewport",this.viewport.name),!t)this.scale=1,this.device.style.width="",this.device.style.height="",e.style.width="",e.style.height="",e.style.transform="";else{let a=this.stage.getBoundingClientRect();this.scale=Ds(t,{width:a.width,height:a.height},tl),this.device.style.width=`${t.width*this.scale}px`,this.device.style.height=`${t.height*this.scale}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.style.transform=this.scale===1?"":`scale(${this.scale})`}let s=this.root.querySelector('[data-pf="size"]');if(s)s.textContent=Hs(this.viewport,this.scale)}reflect(){for(let a of this.root.querySelectorAll("[data-pf-viewport]")){let o=a.getAttribute("data-pf-viewport")===this.viewport.name;a.setAttribute("aria-checked",String(o)),a.tabIndex=o?0:-1}if(!this.root.querySelector('[data-pf-viewport][tabindex="0"]'))this.root.querySelector("[data-pf-viewport]")?.setAttribute("tabindex","0");let e=this.effectiveScheme()==="dark",t=this.root.querySelector('[data-pf-action="scheme"]');if(t){t.setAttribute("aria-pressed",String(e));let a=t.querySelector('[data-pf="scheme-text"]');if(a)a.textContent=e?"Dark":"Light"}let s=this.root.querySelector('[data-pf-action="rotate"]');if(s){let a=ft(this.viewportName,{width:this.frameWidth,height:this.frameHeight}).size;s.disabled=!a||this.viewport.name==="custom"||a.height<=a.width,s.setAttribute("aria-pressed",String(this.viewport.landscape))}}onToolbarClick(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport], [data-pf-action]"):null;if(!t||!this.root.contains(t))return;let s=t.getAttribute("data-pf-viewport");if(s){this.setViewport(s,{width:null,height:null});return}switch(t.getAttribute("data-pf-action")){case"scheme":this.setScheme(this.effectiveScheme()==="dark"?"light":"dark");break;case"rotate":this.setViewport(this.viewportName,{landscape:!this.landscape});break;case"reload":this.reload();break}}onToolbarKey(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport]"):null;if(!t)return;let s=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(s===0)return;e.preventDefault();let a=t.getAttribute("data-pf-viewport")||"fill",o=Fs(a,s);this.setViewport(o,{width:null,height:null}),this.root.querySelector(`[data-pf-viewport="${o}"]`)?.focus()}}var nl="./Progress-2qzb77kc.stx";var il="./Radio-8153x74w.stx";var cl="./RadioGroup-ps9kn22f.stx";var pl="./RadioGroupDescription-z34r9avr.stx";var ul="./RadioGroupLabel-ka0hfm7b.stx";var ml="./RadioGroupOption-6hyy1bvb.stx";var xl="./SegmentedControl-7q0t8c9s.stx";var vl="./Select-ygzchedx.stx";var X={NONE:0,KEYWORD:1,SUBSTRING:2,WORD_PREFIX:3,PREFIX:4},Ox=700,Ws=1600;function gt(e){return`stx:settings:${e}`}function te(e,t){if(!t)return null;return e.find((s)=>s.id===t)??null}function wl(e){return(e.find((s)=>!s.parent)??e[0])?.id??""}function Gs(e,...t){for(let s of t)if(te(e,s))return s;return wl(e)}function Us(e,t){let s=new Set,a=te(e,t);while(a&&a.parent&&!s.has(a.id)){s.add(a.id);let o=te(e,a.parent);if(!o)break;a=o}return a?.id??""}function Se(e,t){let s=te(e,t);if(!s?.parent||s.parent===t)return"";return te(e,s.parent)?s.parent:""}function Js(){return{trail:[],cursor:-1}}function Ce(e){return e.trail[e.cursor]??""}function Ys(e,t){if(!t||Ce(e)===t)return e;let s=[...e.trail.slice(0,e.cursor+1),t];return{trail:s,cursor:s.length-1}}function xt(e){return e.cursor<e.trail.length-1}function Xs(e,t=[]){if(e.cursor>0)return!0;return e.cursor===0&&Se(t,Ce(e))!==""}function Zs(e,t=[]){if(e.cursor>0)return{trail:e.trail,cursor:e.cursor-1};if(e.cursor===0){let s=Se(t,Ce(e));if(s)return{trail:[s,...e.trail],cursor:0}}return e}function Qs(e){return xt(e)?{trail:e.trail,cursor:e.cursor+1}:e}function ce(e){return String(e??"").normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/\s+/g," ").trim()}function qs(e,t){let s=e.indexOf(t);while(s!==-1){if(s===0||!/[\p{L}\p{N}]/u.test(e.charAt(s-1)))return!0;s=e.indexOf(t,s+1)}return!1}function Ks(e,t,s){if(t.startsWith(e))return X.PREFIX;if(qs(t,e))return X.WORD_PREFIX;if(t.includes(e))return X.SUBSTRING;if(qs(s,e))return X.KEYWORD;return X.NONE}function _s(e,t,s=""){let a=ce(e);if(a==="")return X.NONE;let o=ce(t),n=ce(s),r=Ks(a,o,n),i=a.split(" ");if(r!==X.NONE||i.length===1)return r;let c=X.PREFIX;for(let l of i){let d=Ks(l,o,n);if(d===X.NONE)return X.NONE;c=Math.min(c,d===X.PREFIX&&l!==i[0]?X.WORD_PREFIX:d)}return c}function ea(e,t){let s=ce(e);if(s==="")return{query:"",panes:[],settings:[]};let a=[];for(let n of t.items){let r=te(t.panes,n.id),i=`${n.keywords??""} ${r?.keywords??""} ${r&&r.title!==n.label?r.title:""}`;if(_s(s,n.label,i)!==X.NONE)a.push(n.id)}let o=[];return t.rows.forEach((n,r)=>{if(!n.label)return;let c=te(t.panes,n.pane)?.title??"",l=_s(s,n.label,`${n.keywords??""} ${c}`);if(l!==X.NONE)o.push({id:n.id,label:n.label,pane:n.pane,paneTitle:c,row:r,rank:l})}),o.sort((n,r)=>r.rank-n.rank||n.row-r.row),{query:s,panes:a,settings:o}}function ta(e){if(e<=0)return"No results";return e===1?"1 result":`${e} results`}function bt(e,t,s){if(s<=0)return-1;if(e==="ArrowDown")return Math.min(s-1,t+1);if(e==="ArrowUp")return t<0?s-1:Math.max(0,t-1);if(e==="Home")return 0;if(e==="End")return s-1;return-1}function sa(e,t,s,a=700){return{buffer:(!e||s-e.at>a?"":e.buffer)+ce(t),at:s}}function aa(e,t,s){let a=e.length,o=ce(t);if(a===0||o==="")return-1;let n=o.split("").every((c)=>c===o.charAt(0)),r=n?o.charAt(0):o,i=n?s+1:Math.max(0,s);for(let c=0;c<a;c++){let l=((i+c)%a+a)%a;if(ce(e[l]).startsWith(r))return l}return-1}var kl="./SettingsGroup-dkae46k5.stx";var Cl="./SettingsPane-jbd1gbdt.stx";var Tl="./SettingsPaneHeader-f0cvkqs7.stx";var Il="./SettingsRow-4cxbsf1q.stx";var Pl="./SettingsSidebarGroup-p2ygv5yy.stx";var Rl="./SettingsSidebarItem-x8fsn3w5.stx";var Ll="./SettingsWindow-mm490ymt.stx";var vt="[data-stx-settings]",Ve="[data-settings-item]",oa="[data-settings-pane]",Ol="[data-settings-row]",wt="[data-settings-result]",zl='button, a[href], input, select, textarea, label, [role="switch"], [role="checkbox"], [role="radio"], [role="slider"], [role="button"], [contenteditable]';function na(e){return e.replace(/[^\w-]+/g,"-")}class Dl{root;callbacks;history=Js();current="";query="";storageKey;typed=null;hits=[];highlighted=null;highlightTimer=null;disposers=[];list;account;input;field;results;empty;live;backButton;forwardButton;title;body;constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.storageKey=t.storageKey||"",!e.id)e.id=`settings-${Math.random().toString(36).slice(2,8)}`;this.list=this.own("[data-settings-list]"),this.account=this.own("[data-settings-account]"),this.input=this.own("[data-settings-search-input]"),this.field=this.own("[data-settings-search]"),this.results=this.own("[data-settings-results]"),this.empty=this.own("[data-settings-empty]"),this.live=this.own("[data-settings-live]"),this.backButton=this.own("[data-settings-back]"),this.forwardButton=this.own("[data-settings-forward]"),this.title=this.own("[data-settings-title]"),this.body=this.own("[data-settings-body]");for(let n of[this.results,this.live,this.title])if(n)n.__stx_inert_content=!0;if(this.listen(e,"click",(n)=>this.onClick(n)),this.listen(t.globalKeys?document:e,"keydown",(n)=>this.onKeyDown(n)),this.input)this.listen(this.input,"input",()=>this.search(this.input.value));if(this.body)this.listen(this.body,"scroll",()=>this.syncScrolled(),{passive:!0});this.listen(window,"focus",()=>e.setAttribute("data-stx-window-active","true")),this.listen(window,"blur",()=>e.setAttribute("data-stx-window-active","false")),this.describe();let a=this.panes(),o=this.paneElements().find((n)=>!n.hidden)?.getAttribute("data-settings-pane");this.open(Gs(a,this.stored(),t.pane,o)),e.setAttribute("data-settings-ready","")}getPane(){return this.current}showPane(e){if(!te(this.panes(),e))return!1;return this.open(e),!0}revealSetting(e){if(!e)return!1;let t=this.rowElements().find((a)=>a.getAttribute("data-setting")===e),s=t?this.paneOf(t):"";if(!t||!s)return!1;return this.open(s),this.reveal(t),!0}back(){this.travel(Zs(this.history,this.panes()))}forward(){this.travel(Qs(this.history))}focusSearch(){if(!this.input)return;this.input.focus(),this.input.select()}search(e){if(this.query=e,this.input&&this.input.value!==e)this.input.value=e;this.applySearch(!0)}destroy(){for(let e of this.disposers)e();this.disposers.length=0,this.clearHighlight(),this.root.removeAttribute("data-settings-ready")}own(e){return this.all(e)[0]??null}all(e,t=this.root){return Array.from(t.querySelectorAll(e)).filter((s)=>s.closest(vt)===this.root)}listen(e,t,s,a){e.addEventListener(t,s,a),this.disposers.push(()=>e.removeEventListener(t,s,a))}paneElements(){return this.all(oa)}paneElement(e){return this.paneElements().find((t)=>t.getAttribute("data-settings-pane")===e)??null}panes(){return this.paneElements().map((e)=>({id:e.getAttribute("data-settings-pane")||"",title:e.getAttribute("data-title")||e.getAttribute("data-settings-pane")||"",keywords:e.getAttribute("data-keywords")||"",parent:e.getAttribute("data-parent")||""})).filter((e)=>e.id!=="")}itemElements(){return this.list?this.all(Ve,this.list):[]}visibleItems(){return this.itemElements().filter((e)=>!e.hidden&&!e.disabled)}labelOf(e){return(e.querySelector(".stx-settings-item-label")?.textContent||e.getAttribute("aria-label")||e.textContent||"").trim()}items(){return this.itemElements().map((e)=>({id:e.getAttribute("data-settings-item")||"",label:this.labelOf(e),keywords:e.getAttribute("data-keywords")||""}))}rowElements(){return this.all(Ol).filter((e)=>this.paneOf(e)!=="")}paneOf(e){return e.closest(oa)?.getAttribute("data-settings-pane")||""}stored(){if(!this.storageKey)return"";try{return localStorage.getItem(gt(this.storageKey))||""}catch{return""}}store(){if(!this.storageKey||!this.current)return;try{localStorage.setItem(gt(this.storageKey),this.current)}catch{}}describe(){let e=this.root.id,t=new Map;for(let s of this.itemElements()){let a=s.getAttribute("data-settings-item")||"";if(!s.id)s.id=`${e}-item-${na(a)}`;s.setAttribute("role","tab"),t.set(a,s);for(let o=s.parentElement;o&&o!==this.list;o=o.parentElement)if(!o.hasAttribute("role"))o.setAttribute("role","presentation")}for(let s of this.paneElements()){let a=s.getAttribute("data-settings-pane")||"";if(!s.id)s.id=`${e}-pane-${na(a)}`;let o=t.get(a);if(o)o.setAttribute("aria-controls",s.id),s.setAttribute("role","tabpanel"),s.setAttribute("aria-labelledby",o.id),s.removeAttribute("aria-label");else if(this.title?.id){if(s.setAttribute("role","region"),!s.hasAttribute("aria-label"))s.setAttribute("aria-label",s.getAttribute("data-title")||a)}}}open(e){if(!e)return;this.history=Ys(this.history,e),this.show()}travel(e){if(e===this.history)return;this.history=e,this.show()}show(){this.describe();let e=this.panes(),t=Ce(this.history),s=te(e,t),a=this.paneElement(t);if(!s||!a)return;let o=document.activeElement,n=o instanceof HTMLElement&&this.paneElements().some((c)=>c!==a&&c.contains(o));for(let c of this.paneElements())c.hidden=c!==a,c.toggleAttribute("data-active",c===a);let r=Us(e,t);for(let c of this.itemElements()){let l=c.getAttribute("data-settings-item")===r;c.setAttribute("aria-selected",l?"true":"false"),c.toggleAttribute("data-active",l)}if(this.syncTabStops(),this.title)this.title.textContent=s.title;this.root.setAttribute("data-pane",t),this.root.toggleAttribute("data-subpane",Se(e,t)!==""),this.syncHistoryButtons(e);let i=t!==this.current;if(this.current=t,i){if(this.clearHighlight(),this.body)this.body.scrollTop=0;if(this.syncScrolled(),n){if(!a.hasAttribute("tabindex"))a.setAttribute("tabindex","-1");a.focus({preventScroll:!0})}this.store(),this.callbacks.onPane?.({id:t,title:s.title,parent:Se(e,t)})}}syncTabStops(){let e=this.visibleItems(),t=e.find((s)=>s.getAttribute("aria-selected")==="true")??e[0];for(let s of this.itemElements())s.setAttribute("tabindex",s===t?"0":"-1")}syncHistoryButtons(e){let t=(o,n,r)=>{if(!o)return;let i=document.activeElement===o;if(o.disabled=!n,i&&!n&&r&&!r.disabled)r.focus()},s=Xs(this.history,e),a=xt(this.history);if(s)t(this.backButton,!0,null),t(this.forwardButton,a,this.backButton);else t(this.forwardButton,a,null),t(this.backButton,!1,this.forwardButton)}syncScrolled(){this.root.toggleAttribute("data-scrolled",Boolean(this.body&&this.body.scrollTop>0))}applySearch(e){let t=this.rowElements(),s=t.map((r)=>({id:r.getAttribute("data-setting")||"",label:(r.getAttribute("data-label")||"").trim(),keywords:r.getAttribute("data-keywords")||"",pane:this.paneOf(r)})),a=ea(this.query,{panes:this.panes(),items:this.items(),rows:s}),o=a.query!=="";this.root.toggleAttribute("data-searching",o),this.field?.toggleAttribute("data-filled",this.query!=="");for(let r of this.itemElements())r.hidden=o&&!a.panes.includes(r.getAttribute("data-settings-item")||"");if(this.list){for(let r of this.all("[data-settings-group]",this.list))r.hidden=o&&this.all(Ve,r).every((i)=>i.hidden);this.list.hidden=o&&a.panes.length===0}if(this.account)this.account.hidden=o;this.hits=a.settings.map((r)=>({hit:r,row:t[r.row]})),this.drawResults();let n=a.panes.length+a.settings.length;if(this.empty)this.empty.hidden=!o||n>0;if(this.live)this.live.textContent=o?ta(n):"";if(this.syncTabStops(),e)this.callbacks.onSearch?.({query:this.query.trim(),panes:a.panes,settings:a.settings.map((r)=>({id:r.id,label:r.label,pane:r.pane}))})}drawResults(){let e=this.results;if(!e)return;e.replaceChildren(),e.hidden=this.hits.length===0,this.hits.forEach(({hit:t},s)=>{let a=document.createElement("button");a.type="button",a.className="stx-settings-result",a.setAttribute("data-settings-result",String(s)),a.setAttribute("tabindex","-1");let o=document.createElement("span");o.className="stx-settings-result-label",o.textContent=t.label;let n=document.createElement("span");n.className="stx-settings-result-pane",n.textContent=t.paneTitle,a.append(o,n),e.append(a)})}chooseResult(e){let t=this.hits[e];if(!t||!t.row.isConnected)return;this.open(t.hit.pane),this.reveal(t.row)}clearSearch(){if(this.query===""&&(!this.input||this.input.value===""))return;this.search("")}reveal(e){if(this.body){let t=this.body.getBoundingClientRect(),s=e.getBoundingClientRect();this.body.scrollTop+=s.top-t.top-(t.height-s.height)/2,this.syncScrolled()}this.clearHighlight(),e.setAttribute("data-highlight",""),this.highlighted=e,this.highlightTimer=setTimeout(()=>this.clearHighlight(),Ws)}clearHighlight(){if(this.highlightTimer)clearTimeout(this.highlightTimer);this.highlightTimer=null,this.highlighted?.removeAttribute("data-highlight"),this.highlighted=null}inside(e){return e instanceof Element&&e.closest(vt)===this.root}navigationRow(e){let t=e.closest("[data-navigate]");if(!t||t.closest(vt)!==this.root||t.getAttribute("aria-disabled")==="true")return null;let s=e.closest(zl);if(s&&s!==t&&t.contains(s))return null;return t}navigate(e){let t=e.getAttribute("data-navigate")||"";if(!te(this.panes(),t))return;let s=this.current;this.open(t),this.callbacks.onNavigate?.({id:t,from:s,setting:e.getAttribute("data-setting")||""})}onClick(e){let t=e.target;if(!this.inside(t))return;let s=t.closest(Ve);if(s&&this.list?.contains(s)){this.open(s.getAttribute("data-settings-item")||"");return}let a=t.closest(wt);if(a){this.chooseResult(Number(a.getAttribute("data-settings-result")));return}if(t.closest("[data-settings-back]")){this.back();return}if(t.closest("[data-settings-forward]")){this.forward();return}if(t.closest("[data-settings-search-clear]")){this.clearSearch(),this.input?.focus();return}let o=this.navigationRow(t);if(o)this.navigate(o)}onKeyDown(e){if(e.defaultPrevented)return;let t=(e.metaKey||e.ctrlKey)&&!e.altKey;if(t&&!e.shiftKey){let n=e.key.toLowerCase();if(n==="f"&&this.input){e.preventDefault(),this.focusSearch();return}if(n==="["){e.preventDefault(),this.back();return}if(n==="]"){e.preventDefault(),this.forward();return}}let s=e.target;if(!this.inside(s))return;if(e.key==="Escape"&&this.query!==""){e.preventDefault(),this.clearSearch(),this.visibleItems().find((n)=>n.getAttribute("tabindex")==="0")?.focus();return}if(s===this.input){this.onSearchKey(e);return}let a=s.closest(wt);if(a){this.onResultKey(e,a);return}let o=s.closest(Ve);if(o&&this.list?.contains(o)){this.onItemKey(e,o);return}if((e.key==="Enter"||e.key===" ")&&!t&&!e.altKey){let n=s.closest("[data-navigate]");if(n&&n===s&&this.navigationRow(s))e.preventDefault(),this.navigate(n)}}resultButtons(){return this.results?Array.from(this.results.querySelectorAll(wt)):[]}onSearchKey(e){if(e.key==="ArrowDown"){let t=this.visibleItems()[0]??this.resultButtons()[0];if(t)e.preventDefault(),t.focus()}else if(e.key==="Enter"&&this.query.trim()!==""){e.preventDefault();let t=this.visibleItems()[0];if(t)this.open(t.getAttribute("data-settings-item")||"");else this.chooseResult(0)}}onResultKey(e,t){let s=this.resultButtons(),a=s.indexOf(t);if(e.key==="ArrowUp"&&a===0){let n=this.visibleItems(),r=n[n.length-1]??this.input;if(r)e.preventDefault(),r.focus();return}let o=bt(e.key,a,s.length);if(o===-1)return;e.preventDefault(),s[o].focus()}onItemKey(e,t){if(e.metaKey||e.ctrlKey||e.altKey)return;let s=this.visibleItems(),a=s.indexOf(t);if(e.key==="ArrowDown"&&a===s.length-1){let n=this.resultButtons()[0];if(n){e.preventDefault(),n.focus();return}}let o=bt(e.key,a,s.length);if(o===-1&&e.key.length===1&&(e.key!==" "||this.typed!==null)){let n=sa(this.typed,e.key,Date.now());if(e.key===" "&&n.buffer.trim()===""){this.typed=null;return}if(this.typed=n,o=aa(s.map((r)=>this.labelOf(r)),n.buffer,a),o===-1){e.preventDefault();return}}if(o===-1)return;e.preventDefault(),s[o].focus(),this.open(s[o].getAttribute("data-settings-item")||"")}}var jl="./Sidebar-8dygywjv.stx";var Fl="./SidebarFooter-s7skj92y.stx";var ql="./SidebarHeader-x7jdhmyr.stx";var _l="./SidebarItem-64sjb2fe.stx";var Gl="./SidebarPinned-48kyk193.stx";var Jl="./SidebarSection-vx5bahsk.stx";var Xl="./SidebarSpace-bwv98azf.stx";var Ql="./SidebarSpaces-mdtrynr2.stx";var tc="./SidebarSpaceSwitcher-1mycft2g.stx";var Fe={blue:"#0088ff",red:"#ff383c",pink:"#ff2d55",orange:"#ff8d28",yellow:"#ffcc00",green:"#34c759",teal:"#00c3d0",cyan:"#00c0e8",indigo:"#6155f5",purple:"#cb30e0",brown:"#ac7f5e",gray:"#8e8e93"},de={pane:["bg-[#f2f2f4]/90 dark:bg-[#1c1c1e]/88","backdrop-blur-[50px] backdrop-saturate-[180%]","text-black dark:text-white","select-none"].join(" "),selection:"accent",layers:{shimmerRim:!0},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[10px] pb-[10px]",sectionHeader:["group/section flex w-full items-center","pl-[8px] pr-[6px] pt-[16px] pb-[5px]","text-[11px] font-semibold leading-[13px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),sectionChevron:["i-f7-chevron-down h-[11px] w-[11px] ml-auto","text-[#3c3c43]/60 dark:text-[#ebebf5]/45","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col",item:{base:["flex w-full items-center","h-[32px] rounded-[8px] pl-[4px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-black dark:text-white","transition-colors duration-150 ease-out"].join(" "),hover:"hover:bg-black/4 dark:hover:bg-white/6",active:"",pressed:"active:bg-black/10 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[18px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[11px] w-[11px]","text-[#3c3c43]/60 dark:text-[#ebebf5]/55","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[20px] w-[22px] shrink-0 items-center justify-center mr-[7px]",icon:"h-[17px] w-[17px]",image:"h-[20px] w-[20px] rounded-[4px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[13px] leading-[16px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),indentPerLevel:16}},sc={selection:"classes",pane:"bg-[#f4f4f3] dark:bg-neutral-950 text-zinc-950 dark:text-white select-none",layers:{},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",sectionHeader:"group/section flex w-full items-center gap-2.5 px-4 pb-2 pt-5 text-[13px] font-semibold uppercase tracking-[0.12em] text-zinc-400 dark:text-zinc-500",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[16px] px-3.5 py-2 text-[14px] leading-tight transition-colors duration-150",hover:"hover:bg-[#ececea] hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e7e7e5] text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-[#e2e2e0] dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-500 dark:text-zinc-500",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/70 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},ac={selection:"classes",pane:"bg-[#f3f3f1]/48 dark:bg-neutral-950/32 backdrop-blur-3xl backdrop-saturate-150 text-zinc-950 dark:text-white select-none",layers:{tint:"bg-[linear-gradient(112deg,rgba(255,255,255,0.20)_0%,rgba(255,255,255,0.04)_45%,rgba(226,226,222,0.16)_100%)] dark:bg-[linear-gradient(112deg,rgba(255,255,255,0.08)_0%,rgba(255,255,255,0.02)_46%,rgba(255,255,255,0.06)_100%)]"},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-2",sectionHeader:"group/section flex w-full items-center gap-2.5 px-3 pb-1.5 pt-3 rounded-[14px] text-[12px] font-semibold uppercase tracking-[0.10em] text-zinc-500/80 dark:text-zinc-400/80",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[14px] px-3 py-1.5 text-[13.5px] leading-tight transition-colors duration-150",hover:"hover:bg-white/38 hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e8e8e6]/90 text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-white/50 dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-600 dark:text-zinc-400",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/72 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},oc={selection:"classes",pane:["bg-[#f7f5f1]/92 dark:bg-[#1a1a1c]/92","backdrop-blur-[40px] backdrop-saturate-[160%]","text-[#2c2a28] dark:text-[#ededf0]","select-none"].join(" "),layers:{tint:["bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,251,242,0.55))_0%,rgba(255,255,255,0)_38%)]","dark:bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,255,255,0.05))_0%,rgba(255,255,255,0)_42%)]"].join(" ")},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[16px] pb-[8px]",sectionHeader:["group/section flex w-full items-center","px-[8px] pt-[14px] pb-[4px]","text-[11px] font-medium leading-[13px]","opacity-55"].join(" "),sectionChevron:["i-f7-chevron-down h-[10px] w-[10px] ml-auto","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col space-y-[2px]",item:{base:["flex w-full items-center","h-[30px] rounded-[8px] pl-[6px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-current","transition-[background-color,box-shadow,color] duration-150 ease-out"].join(" "),hover:"hover:bg-white/55 dark:hover:bg-white/8",active:["bg-white dark:bg-white/14","font-medium","shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]","ring-1 ring-black/5 dark:ring-white/8"].join(" "),pressed:"active:bg-white/80 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[16px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[10px] w-[10px] opacity-45","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[18px] w-[18px] shrink-0 items-center justify-center mr-[8px]",icon:"h-[16px] w-[16px]",image:"h-[18px] w-[18px] rounded-[5px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[12px] leading-[16px] opacity-45"].join(" "),indentPerLevel:14}},nc={...de,pane:"bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",layers:{}},rc={...de,pane:"bg-transparent text-black dark:text-white select-none",layers:{}},ic={...de,pane:"bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",layers:{}},ra={macos:de,tahoe:de,"macos-tahoe":de,"macos-latest":de,arc:oc,workspace:sc,desktop:ac,solid:nc,transparent:rc,vibrancy:ic};function pb(e){return ra[e||"macos"]||ra.macos}function hb(e){if(!e)return;return Fe[e]||e}var lc=Fe.gray;function ie(e,t,s){return`color-mix(in oklab, ${e} ${t}%, ${s})`}function ia(e){return{light:{from:ie(e,35,"#ffffff"),to:ie(e,12.5,"#ffffff"),ink:ie(e,22,"#17171b"),accent:ie(e,88,"#2a2a30")},dark:{from:ie(e,27,"#101014"),to:ie(e,10,"#08080b"),ink:ie(e,12,"#f4f4f7"),accent:ie(e,74,"#ffffff")}}}function mb(e,t){return`linear-gradient(180deg, ${e} 0%, ${t} 100%)`}function cc(e){if(!e)return ia(lc);if(typeof e!=="string")return e;return ia(Fe[e]||e)}function dc(e){return[`--stx-space-light-from: ${e.light.from}`,`--stx-space-light-to: ${e.light.to}`,`--stx-space-light-ink: ${e.light.ink}`,`--stx-space-light-accent: ${e.light.accent}`,`--stx-space-dark-from: ${e.dark.from}`,`--stx-space-dark-to: ${e.dark.to}`,`--stx-space-dark-ink: ${e.dark.ink}`,`--stx-space-dark-accent: ${e.dark.accent}`].join("; ")}function la(e,t,s,a){if(!e||!e.label)return null;return{id:e.id||`${t}-${s}`,label:e.label,icon:e.icon||a}}function pc(e){let t=cc(e.tint);return{id:e.id,label:e.label||"",icon:e.icon||"",pinned:e.pinned||[],sections:e.sections||[],action:la(e.action,e.id,"action","i-f7-plus"),clear:la(e.clear,e.id,"clear","i-f7-arrow-down"),tint:t,style:dc(t),deferred:e.deferred===!0,showTitle:e.showTitle??!0}}function gb(e){return(e||[]).map(pc)}function xb(e,t){if(!t)return 0;let s=e.findIndex((a)=>a.id===t);return s===-1?0:s}function bb(e){return e.map((t)=>t.tint)}var uc="./Skeleton-m4p66zcs.stx";var zb=101;function me(e,t){let s=typeof e==="number"?e:Number.parseFloat(String(e));return Number.isFinite(s)?s:t}function Db(e,t,s){let a=me(e,0),o=me(t,100),n=me(s,1);return{min:Math.min(a,o),max:Math.max(a,o),step:n>0?n:0}}function ca(e){if(!Number.isFinite(e))return 0;let t=String(e).toLowerCase(),s=t.indexOf("e-");if(s!==-1)return Number.parseInt(t.slice(s+2),10)+Math.max(0,t.slice(0,s).split(".")[1]?.length??0);return t.split(".")[1]?.length??0}function pe(e,t){let{min:s,max:a,step:o}=t,n=Math.min(a,Math.max(s,me(e,s)));if(o<=0)return n;let r=Math.round((n-s)/o),i=Math.floor((a-s)/o+0.0000001);if(r>i)r=i;let c=Math.max(ca(o),ca(s));return Number((s+r*o).toFixed(Math.min(c,20)))}function Hb(e,t){let s=t.max-t.min;if(s<=0)return 0;return(Math.min(t.max,Math.max(t.min,me(e,t.min)))-t.min)/s}function jb(e,t){let s=Math.min(1,Math.max(0,Number.isFinite(e)?e:0));return pe(t.min+s*(t.max-t.min),t)}function Vb(e,t){let s=t.max-t.min;if(s<=0||e===!1||e==null||e===""||e==="false")return[];if(e===!0||e==="true"){if(t.step<=0)return[];let o=Math.floor(s/t.step+0.0000001)+1;if(o<2||o>101)return[];return Array.from({length:o},(n,r)=>Math.min(1,r*t.step/s))}let a=Math.floor(me(e,0));if(a<2||a>101)return[];return Array.from({length:a},(o,n)=>n/(a-1))}function Fb(e,t,s,a=10){let o=s.step>0?s.step:(s.max-s.min)/100;if(e==="ArrowRight"||e==="ArrowUp")return pe(t+o,s);if(e==="ArrowLeft"||e==="ArrowDown")return pe(t-o,s);if(e==="PageUp")return pe(t+o*a,s);if(e==="PageDown")return pe(t-o*a,s);if(e==="Home")return pe(s.min,s);if(e==="End")return pe(s.max,s);return null}var mc="./Slider-j59dgw1c.stx";var xc="./Spinner-vhnc3y03.stx";function bc(e){return Array.from({length:e},()=>1/e)}function Be(e,t){if(t<=0)return[];if(!e||e.length!==t||e.some((a)=>typeof a!=="number"||!Number.isFinite(a)||a<=0))return bc(t);let s=e.reduce((a,o)=>a+o,0);return e.map((a)=>a/s)}function da(e){let t=e;if(typeof e==="string"){let a=e.trim();if(a==="")return null;if(a.charAt(0)==="[")try{t=JSON.parse(a)}catch{return null}else t=a.split(/[\s,]+/).map((o)=>Number.parseFloat(o))}if(!Array.isArray(t)||t.length===0)return null;let s=t.map((a)=>typeof a==="string"?Number.parseFloat(a):a);return s.every((a)=>typeof a==="number"&&Number.isFinite(a)&&a>0)?s:null}function yt(e,t){if(typeof e==="number")return Number.isFinite(e)&&e>=0?e:t;if(typeof e!=="string"||e.trim()==="")return t;let s=Number.parseFloat(e);return Number.isFinite(s)&&s>=0?s:t}function pa(e,t,s){let a=e.length;if(a===0||t<=0)return[...e];let o=s.map((c)=>Math.max(0,c.min)),n=o.reduce((c,l)=>c+l,0);if(n>=t)return n===0?[...e]:o.map((c)=>c/n);let r=e.map((c)=>c*t);for(let c=0;c<=a;c++){let l=0;for(let p=0;p<a;p++){let u=Math.min(Math.max(r[p],o[p]),s[p].max);l+=r[p]-u,r[p]=u}if(Math.abs(l)<0.000000001)break;let d=r.map((p,u)=>l>0?s[u].max-p:p-o[u]),h=d.reduce((p,u)=>p+(Number.isFinite(u)?u:t),0);if(h<0.000000001)break;for(let p=0;p<a;p++){let u=(Number.isFinite(d[p])?d[p]:t)/h;r[p]+=l*u}}let i=r.reduce((c,l)=>c+l,0);return r.map((c)=>c/i)}function kt(e,t,s,a,o){let n=e.length;if(t<0||t>=n-1||a<=0||s===0)return[...e];let r=e.map((p)=>p*a),i=s>0,c=i?t:t+1,l=i?1:-1,d=Math.min(Math.abs(s),o[c].max-r[c]);if(d<=0)return[...e];let h=0;for(let p=i?t+1:t;p>=0&&p<n&&d>0.000000001;p+=l){let u=Math.min(d,Math.max(0,r[p]-Math.max(0,o[p].min)));r[p]-=u,h+=u,d-=u}return r[c]+=h,r.map((p)=>p/a)}function qe(e,t,s,a){let o=e.map((r)=>r*s),n=(r,i)=>{let c=0;for(let l=r;l<=i;l++)c+=Math.max(0,o[l]-Math.max(0,a[l].min));return c};return{back:Math.min(n(0,t),a[t+1].max-o[t+1]),forward:Math.min(n(t+1,e.length-1),a[t].max-o[t])}}function ha(e,t,s,a){let o=qe(e,t,s,a),n=e[t]*100,r=s>0?100/s:0;return{now:Math.round(n),min:Math.round(n-o.back*r),max:Math.round(n+o.forward*r)}}function St(e){return`stx:split-pane:${e}`}function ua(e){return JSON.stringify(e.map((t)=>Math.round(t*1e4)/1e4))}var wc="./SplitPane-7sqfdwqa.stx";var fa="data-split-separator";class yc{root;callbacks;direction;panes=[];separators=[];sizes=[];initial=[];limits=[];minSize;step;label;storageKey;observer=null;drag=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.direction=t.direction==="vertical"?"vertical":"horizontal",this.minSize=t.minSize??48,this.step=t.step??16,this.label=t.label||"Resize panes",this.storageKey=t.storageKey||"",this.collect(),this.initial=this.startingSizes(t.sizes),this.sizes=Be(this.stored()??this.initial,this.panes.length),this.build(),this.apply(!1),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.apply(!1)),this.observer.observe(this.root);this.root.setAttribute("data-split-ready","")}getSizes(){return[...this.sizes]}setSizes(e){if(!e||e.length!==this.panes.length)return;this.sizes=Be(e,this.panes.length),this.apply(!0),this.report(-1,"api",!0)}reset(e=-1){this.sizes=[...this.initial],this.apply(!0),this.report(e,"reset",!0)}setDirection(e){let t=e==="vertical"?"vertical":"horizontal";if(t===this.direction)return;this.direction=t,this.root.setAttribute("data-direction",t);for(let s of this.separators)s.setAttribute("aria-orientation",t==="horizontal"?"vertical":"horizontal");this.apply(!1)}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();for(let e of this.separators)e.remove();for(let e of this.panes)e.style.removeProperty("flex"),e.removeAttribute("data-split-pane");this.root.removeAttribute("data-split-ready")}available(){let e=this.root.getBoundingClientRect(),t=this.direction==="horizontal"?e.width:e.height,s=0;for(let a of this.separators){let o=a.getBoundingClientRect();s+=this.direction==="horizontal"?o.width:o.height}return Math.max(0,t-s)}collect(){this.panes=Array.from(this.root.children).filter((e)=>e instanceof HTMLElement&&!e.hasAttribute(fa)),this.limits=this.panes.map((e)=>({min:yt(e.getAttribute("data-min-size"),this.minSize),max:yt(e.getAttribute("data-max-size"),Number.POSITIVE_INFINITY)}))}startingSizes(e){let t=this.panes.map((a)=>Number.parseFloat(a.getAttribute("data-size")||"")),s=t.every((a)=>Number.isFinite(a)&&a>0)?t:null;return Be(e&&e.length===this.panes.length?e:s,this.panes.length)}stored(){if(!this.storageKey)return null;try{let e=da(localStorage.getItem(St(this.storageKey)));return e&&e.length===this.panes.length?e:null}catch{return null}}store(){if(!this.storageKey)return;try{localStorage.setItem(St(this.storageKey),ua(this.sizes))}catch{}}build(){let e=this.root.id||`split-${Math.random().toString(36).slice(2,8)}`;this.panes.forEach((t,s)=>{if(t.setAttribute("data-split-pane",""),!t.id)t.id=`${e}-pane-${s}`;if(s===this.panes.length-1)return;let a=document.createElement("div");a.setAttribute(fa,""),a.setAttribute("role","separator"),a.setAttribute("tabindex","0"),a.setAttribute("aria-orientation",this.direction==="horizontal"?"vertical":"horizontal"),a.setAttribute("aria-controls",t.id),a.setAttribute("aria-label",this.panes.length>2?`${this.label} ${s+1} and ${s+2}`:this.label),a.className="stx-split-separator",t.after(a),this.separators.push(a);let o=(n,r)=>{a.addEventListener(n,r),this.disposers.push(()=>a.removeEventListener(n,r))};o("pointerdown",(n)=>this.onPointerDown(n,s)),o("pointermove",(n)=>this.onPointerMove(n)),o("pointerup",(n)=>this.onPointerEnd(n)),o("pointercancel",(n)=>this.onPointerEnd(n)),o("dblclick",()=>this.reset(s)),o("keydown",(n)=>this.onKeyDown(n,s))})}apply(e){let t=this.available();if(t>0)this.sizes=pa(this.sizes,t,this.limits);if(this.panes.forEach((s,a)=>{s.style.flex=`${(this.sizes[a]*1000).toFixed(3)} 1 0px`}),this.separators.forEach((s,a)=>{let o=ha(this.sizes,a,t,this.limits);s.setAttribute("aria-valuenow",String(o.now)),s.setAttribute("aria-valuemin",String(o.min)),s.setAttribute("aria-valuemax",String(o.max))}),e)this.store()}report(e,t,s){let a=this.available(),o={sizes:[...this.sizes],pixels:this.sizes.map((n)=>Math.round(n*a)),index:e,source:t};if(this.callbacks.onResize?.(o),s)this.callbacks.onResizeEnd?.(o)}position(e){return this.direction==="horizontal"?e.clientX:e.clientY}onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();let s=this.separators[t];try{s.setPointerCapture(e.pointerId)}catch{}this.drag={index:t,start:this.position(e),sizes:[...this.sizes],pointer:e.pointerId},this.root.setAttribute("data-dragging",""),s.setAttribute("data-active","")}onPointerMove(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.sizes=kt(t.sizes,t.index,this.position(e)-t.start,this.available(),this.limits),this.apply(!1),this.report(t.index,"pointer",!1)}onPointerEnd(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.drag=null,this.root.removeAttribute("data-dragging"),this.separators[t.index].removeAttribute("data-active");try{this.separators[t.index].releasePointerCapture(e.pointerId)}catch{}this.store(),this.report(t.index,"pointer",!0)}onKeyDown(e,t){let s=this.direction==="horizontal",a=this.available(),o=this.step*(e.shiftKey?5:1),n=0;if(e.key===(s?"ArrowLeft":"ArrowUp"))n=-o;else if(e.key===(s?"ArrowRight":"ArrowDown"))n=o;else if(e.key==="Home")n=-qe(this.sizes,t,a,this.limits).back;else if(e.key==="End")n=qe(this.sizes,t,a,this.limits).forward;else if(e.key==="Enter"){e.preventDefault(),this.reset(t);return}else return;e.preventDefault(),this.sizes=kt(this.sizes,t,n,a,this.limits),this.apply(!0),this.report(t,"keyboard",!0)}}var Sc="./Stepper-68gxcmej.stx";var $c="./StepperStep-zf4pq1s0.stx";class Ke{storage;namespace;watchers=new Map;encryptionKey="stx-storage-key";constructor(e="local",t=""){if(this.storage=e==="local"?globalThis.localStorage:globalThis.sessionStorage,this.namespace=t,typeof window<"u")window.addEventListener("storage",this.handleStorageEvent.bind(this))}handleStorageEvent(e){if(!e.key)return;let t=this.namespace&&e.key.startsWith(`${this.namespace}:`)?e.key.slice(this.namespace.length+1):e.key,s=this.watchers.get(t);if(s){let a=e.oldValue?JSON.parse(e.oldValue).value:null,o=e.newValue?JSON.parse(e.newValue).value:null;s.forEach((n)=>n(o,a,t))}}encrypt(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCharCode(e.charCodeAt(s)^this.encryptionKey.charCodeAt(s%this.encryptionKey.length));return btoa(t)}decrypt(e){try{let t=atob(e),s="";for(let a=0;a<t.length;a++)s+=String.fromCharCode(t.charCodeAt(a)^this.encryptionKey.charCodeAt(a%this.encryptionKey.length));return s}catch{return e}}compress(e){if(e.length<100)return e;let t={},s=256,a=[],o="";for(let n=0;n<e.length;n++){let r=e.charAt(n),i=o+r;if(t[i]!==void 0)o=i;else a.push(o.length>1?t[o]:o.charCodeAt(0)),t[i]=s++,o=r}if(o!=="")a.push(o.length>1?t[o]:o.charCodeAt(0));return JSON.stringify(a)}decompress(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return e;let s={},a=256,o=String.fromCharCode(t[0]),n=o;for(let r=1;r<t.length;r++){let i=t[r],c;if(s[i]!==void 0)c=s[i];else if(i===a)c=o+o.charAt(0);else return e;n+=c,s[a++]=o+c.charAt(0),o=c}return n}catch{return e}}getKey(e){return this.namespace?`${this.namespace}:${e}`:e}set(e,t,s){let a=this.getKey(e),o=this.get(e),n={value:t,timestamp:Date.now(),expire:s?.expire,encrypted:s?.encrypt||!1,compressed:s?.compress||!1};try{let r=JSON.stringify(n);if(s?.compress)r=this.compress(r);if(s?.encrypt)r=this.encrypt(r);this.storage.setItem(a,r),this.notifyWatchers(e,t,o)}catch(r){console.error("Storage set error:",r)}}get(e){let t=this.getKey(e);try{let s=this.storage.getItem(t);if(!s)return null;if(s.match(/^[A-Z0-9+/]+=*$/i))try{s=this.decrypt(s)}catch{}if(s.startsWith("["))try{s=this.decompress(s)}catch{}let a=JSON.parse(s);if(a.expire&&Date.now()-a.timestamp>a.expire)return this.remove(e),null;return a.value}catch(s){return console.error("Storage get error:",s),null}}watch(e,t){if(!this.watchers.has(e))this.watchers.set(e,new Set);return this.watchers.get(e).add(t),()=>{let s=this.watchers.get(e);if(s){if(s.delete(t),s.size===0)this.watchers.delete(e)}}}notifyWatchers(e,t,s){let a=this.watchers.get(e);if(a)a.forEach((o)=>o(t,s,e))}remove(e){let t=this.getKey(e),s=this.get(e);this.storage.removeItem(t),this.notifyWatchers(e,null,s)}clear(){if(this.namespace)this.keys().forEach((t)=>this.remove(t));else this.storage.clear()}has(e){return this.get(e)!==null}keys(){let e=Object.keys(this.storage);if(this.namespace){let t=`${this.namespace}:`;return e.filter((s)=>s.startsWith(t)).map((s)=>s.slice(t.length))}return e}size(){return this.keys().length}getQuota(){if("storage"in navigator&&"estimate"in navigator.storage)return null;try{let e=0;for(let s=0;s<this.storage.length;s++){let a=this.storage.key(s);if(a){let o=this.storage.getItem(a)||"";e+=a.length+o.length}}let t=5242880;return{usage:e*2,quota:t,percentage:e*2/t*100}}catch{return null}}setMany(e,t){Object.entries(e).forEach(([s,a])=>{this.set(s,a,t)})}getMany(e){let t={};return e.forEach((s)=>{t[s]=this.get(s)}),t}removeMany(e){e.forEach((t)=>this.remove(t))}}var cv={local:new Ke("local"),session:new Ke("session")};function dv(e="local",t){return new Ke(e,t)}var Ec="./Switch-ga9ap8n8.stx";var Ac="./Table-0a4y46vd.stx";var Mc="./TableBody-y49bqb1p.stx";var Nc="./TableCell-jhvsxw8b.stx";var Oc="./TableHead-e9xvjx2j.stx";var Dc="./TableHeader-krzcx4sv.stx";var jc="./TableRow-dt8e11aj.stx";var Fc="./Tab-j9f4t166.stx";var qc="./TabList-r1pc87xs.stx";var _c="./TabPanel-5htevsq6.stx";var Gc="./Tabs-psm5wj7c.stx";var Jc="./Teleport-vqs75x36.stx";var Xc="./Textarea-bb63fsz0.stx";var Qc="./AiTextarea-bg6xq5wc.stx";var td="./Tooltip-tt73d42w.stx";var ad="./Transition-7m0mk45s.stx";var nd="./Video-bqsx3wr8.stx";var id="./VirtualList-fa7v5a3h.stx";var cd="./VirtualTable-kp7b3wyv.stx";var dd=0;function ma(e="a11y"){return`${e}-${++dd}-${Date.now()}`}function rw(e,t,s={}){let{visible:a=!1,id:o=ma("label")}=s,n=document.createElement(a?"label":"span");if(n.id=o,n.textContent=e,!a)Object.assign(n.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"});if(t)if(t.setAttribute("aria-labelledby",o),t.parentElement)t.parentElement.insertBefore(n,t);else document.body.appendChild(n);return o}function iw(e,t){let s=ma("desc"),a=document.createElement("span");if(a.id=s,a.textContent=e,Object.assign(a.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t)if(t.setAttribute("aria-describedby",s),t.parentElement)t.parentElement.insertBefore(a,t);else document.body.appendChild(a);return s}function lw(e,t="polite"){let s=document.createElement("div");s.setAttribute("role","status"),s.setAttribute("aria-live",t),s.setAttribute("aria-atomic","true"),Object.assign(s.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(s),setTimeout(()=>{s.textContent=e},100),setTimeout(()=>{s.parentNode?.removeChild(s)},1000)}function Ct(e){let t=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter((s)=>s.offsetParent!==null)}function cw(e,t={}){let{initialFocus:s,returnFocus:a,escapeDeactivates:o=!0,clickOutsideDeactivates:n=!0,allowOutsideClick:r=!1,onActivate:i,onDeactivate:c}=t,l=!1,d=!1,h=null,p=(v)=>{if(d)return;if(o&&v.key==="Escape"){v.preventDefault(),m();return}if(v.key==="Tab"){let b=Ct(e);if(b.length===0){v.preventDefault();return}let C=b[0],P=b[b.length-1];if(v.shiftKey){if(document.activeElement===C)v.preventDefault(),P.focus()}else if(document.activeElement===P)v.preventDefault(),C.focus()}},u=(v)=>{if(d)return;if(!e.contains(v.target)){if(typeof r==="function"){if(!r(v)&&n)m()}else if(!r&&n)m()}};function g(){if(l)return;l=!0,h=document.activeElement;let v=s||Ct(e)[0];if(v&&typeof v.focus==="function")v.focus();document.addEventListener("keydown",p),document.addEventListener("click",u),i?.()}function m(){if(!l)return;l=!1;let v=a||h;if(v&&typeof v.focus==="function")v.focus();document.removeEventListener("keydown",p),document.removeEventListener("click",u),c?.()}function w(){d=!0}function y(){d=!1}return{activate:g,deactivate:m,pause:w,unpause:y}}function dw(e,t={}){let{selector:s='[role="option"], [role="menuitem"], [role="tab"], button',initialIndex:a=0,orientation:o="both",loop:n=!0,onFocusChange:r}=t,i=a,c=()=>Array.from(e.querySelectorAll(s)),l=(h)=>{let p=c();if(h<0||h>=p.length)return;p.forEach((u,g)=>{if(g===h){if(u.setAttribute("tabindex","0"),typeof u.focus==="function")u.focus()}else u.setAttribute("tabindex","-1")}),i=h,r?.(h,p[h])},d=(h)=>{let u=c().length-1,g=!1,m=i;switch(h.key){case"ArrowRight":if(o==="horizontal"||o==="both"){if(m=i+1,m>u)m=n?0:u;g=!0}break;case"ArrowLeft":if(o==="horizontal"||o==="both"){if(m=i-1,m<0)m=n?u:0;g=!0}break;case"ArrowDown":if(o==="vertical"||o==="both"){if(m=i+1,m>u)m=n?0:u;g=!0}break;case"ArrowUp":if(o==="vertical"||o==="both"){if(m=i-1,m<0)m=n?u:0;g=!0}break;case"Home":m=0,g=!0;break;case"End":m=u,g=!0;break}if(g)h.preventDefault(),l(m)};return l(a),e.addEventListener("keydown",d),()=>{e.removeEventListener("keydown",d)}}var pw={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Tab:"Tab",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown"};function hw(e){return document.activeElement===e}function uw(e,t){let s=t||document.activeElement,a=Ct(document.body),o=a.indexOf(s);if(o===-1)return;let n=e==="next"?o+1:o-1,r=a[n];if(r)r.focus()}function fw(e){if(e.getAttribute("aria-hidden")==="true")return!1;let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1;return!0}var mw={setExpanded(e,t){e.setAttribute("aria-expanded",String(t))},setSelected(e,t){e.setAttribute("aria-selected",String(t))},setChecked(e,t){e.setAttribute("aria-checked",String(t))},setDisabled(e,t){if(e.setAttribute("aria-disabled",String(t)),t)e.setAttribute("tabindex","-1");else e.removeAttribute("tabindex")},setHidden(e,t){if(t)e.setAttribute("aria-hidden","true");else e.removeAttribute("aria-hidden")},setPressed(e,t){e.setAttribute("aria-pressed",String(t))},setInvalid(e,t){e.setAttribute("aria-invalid",String(t))},setRequired(e,t){e.setAttribute("aria-required",String(t))},setLive(e,t){e.setAttribute("aria-live",t)},setBusy(e,t){e.setAttribute("aria-busy",String(t))}};function gw(e){let t=document.createElement("span");return t.textContent=e,t.className="sr-only",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t}function xw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return!1}function bw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-contrast: high)").matches;return!1}function vw(){if(typeof window.matchMedia==="function"){if(window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark";if(window.matchMedia("(prefers-color-scheme: light)").matches)return"light"}return null}function ww(e,t="Skip to main content"){let s=document.createElement("a");return s.href=`#${e}`,s.textContent=t,s.className="skip-link",Object.assign(s.style,{position:"absolute",top:"-40px",left:"0",background:"#000",color:"#fff",padding:"8px",textDecoration:"none",zIndex:"100"}),s.addEventListener("focus",()=>{s.style.top="0"}),s.addEventListener("blur",()=>{s.style.top="-40px"}),s}function yw(e){let t=[],s=(a)=>{let o=e.getAttribute(a);if(o){let n=o.split(" ");for(let r of n)if(!document.getElementById(r))t.push(`${a} references non-existent ID: ${r}`)}};return s("aria-labelledby"),s("aria-describedby"),s("aria-controls"),s("aria-owns"),s("aria-activedescendant"),t}var pd=(e,t,s,a)=>s*e/a+t,hd=(e,t,s,a)=>(e/=a,s*e*e+t),ud=(e,t,s,a)=>(e/=a,-s*e*(e-2)+t),fd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e+t;return e--,-s/2*(e*(e-2)-1)+t},md=(e,t,s,a)=>(e/=a,s*e*e*e+t),gd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e+1)+t),xd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e+t;return e-=2,s/2*(e*e*e+2)+t},bd=(e,t,s,a)=>(e/=a,s*e*e*e*e+t),vd=(e,t,s,a)=>(e/=a,e--,-s*(e*e*e*e-1)+t),wd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e+t;return e-=2,-s/2*(e*e*e*e-2)+t},yd=(e,t,s,a)=>(e/=a,s*e*e*e*e*e+t),kd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e*e*e+1)+t),Sd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e*e+t;return e-=2,s/2*(e*e*e*e*e+2)+t},Cd=(e,t,s,a)=>-s*Math.cos(e/a*(Math.PI/2))+s+t,$d=(e,t,s,a)=>s*Math.sin(e/a*(Math.PI/2))+t,Td=(e,t,s,a)=>-s/2*(Math.cos(Math.PI*e/a)-1)+t,Ed=(e,t,s,a)=>e===0?t:s*2**(10*(e/a-1))+t,Id=(e,t,s,a)=>e===a?t+s:s*(-(2**(-10*e/a))+1)+t,Ad=(e,t,s,a)=>{if(e===0)return t;if(e===a)return t+s;if(e/=a/2,e<1)return s/2*2**(10*(e-1))+t;return e--,s/2*(-(2**(-10*e))+2)+t},Pd=(e,t,s,a)=>(e/=a,-s*(Math.sqrt(1-e*e)-1)+t),Md=(e,t,s,a)=>(e/=a,e--,s*Math.sqrt(1-e*e)+t),Rd=(e,t,s,a)=>{if(e/=a/2,e<1)return-s/2*(Math.sqrt(1-e*e)-1)+t;return e-=2,s/2*(Math.sqrt(1-e*e)+1)+t},Nd=(e,t,s,a)=>{let o=1.70158,n=0,r=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(r<Math.abs(s))r=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/r);return e-=1,-(r*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t},Ld=(e,t,s,a)=>{let o=1.70158,n=0,r=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(r<Math.abs(s))r=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/r);return r*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)+s+t},Od=(e,t,s,a)=>{let o=1.70158,n=0,r=s;if(e===0)return t;if(e/=a/2,e===2)return t+s;if(!n)n=a*0.44999999999999996;if(r<Math.abs(s))r=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/r);if(e<1)return e-=1,-0.5*(r*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t;return e-=1,r*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)*0.5+s+t},zd=(e,t,s,a)=>(e/=a,s*e*e*(2.70158*e-1.70158)+t),Dd=(e,t,s,a)=>(e/=a,e--,s*(e*e*(2.70158*e+1.70158)+1)+t),Hd=(e,t,s,a)=>{let o=1.70158;if(e/=a/2,e<1)return o*=1.525,s/2*(e*e*((o+1)*e-o))+t;return e-=2,o*=1.525,s/2*(e*e*((o+1)*e+o)+2)+t},$t=(e,t,s,a)=>{if(e/=a,e<0.36363636363636365)return s*(7.5625*e*e)+t;else if(e<0.7272727272727273)return e-=0.5454545454545454,s*(7.5625*e*e+0.75)+t;else if(e<0.9090909090909091)return e-=0.8181818181818182,s*(7.5625*e*e+0.9375)+t;else return e-=0.9545454545454546,s*(7.5625*e*e+0.984375)+t},ga=(e,t,s,a)=>s-$t(a-e,0,s,a)+t,jd=(e,t,s,a)=>{if(e<a/2)return ga(e*2,0,s,a)*0.5+t;return $t(e*2-a,0,s,a)*0.5+s*0.5+t},Sw={linear:pd,easeInQuad:hd,easeOutQuad:ud,easeInOutQuad:fd,easeInCubic:md,easeOutCubic:gd,easeInOutCubic:xd,easeInQuart:bd,easeOutQuart:vd,easeInOutQuart:wd,easeInQuint:yd,easeOutQuint:kd,easeInOutQuint:Sd,easeInSine:Cd,easeOutSine:$d,easeInOutSine:Td,easeInExpo:Ed,easeOutExpo:Id,easeInOutExpo:Ad,easeInCirc:Pd,easeOutCirc:Md,easeInOutCirc:Rd,easeInElastic:Nd,easeOutElastic:Ld,easeInOutElastic:Od,easeInBack:zd,easeOutBack:Dd,easeInOutBack:Hd,easeInBounce:ga,easeOutBounce:$t,easeInOutBounce:jd};function Vd(e,t={}){let{duration:s="1s",timing:a="ease",delay:o="0s",iteration:n="1",direction:r="normal",fill:i="both",playState:c="running"}=t;return`${e} ${s} ${a} ${o} ${n} ${r} ${i} ${c}`}function xa(e,t,s={}){e.style.animation=Vd(t,s)}function $w(e){e.style.animation=""}function Fd(e){return new Promise((t)=>{let s=()=>{e.removeEventListener("animationend",s),t()};e.addEventListener("animationend",s)})}function Tw(e,t,s={}){let{stagger:a=100,...o}=s;e.forEach((n,r)=>{let i=`${r*a}ms`;xa(n,t,{...o,delay:i})})}async function Ew(e,t){for(let s of t)xa(e,s.name,s.options),await Fd(e)}var Iw={fadeIn:"animate-fade-in",fadeOut:"animate-fade-out",slideInUp:"animate-slide-in-up",slideInDown:"animate-slide-in-down",slideInLeft:"animate-slide-in-left",slideInRight:"animate-slide-in-right",zoomIn:"animate-zoom-in",zoomOut:"animate-zoom-out",bounce:"animate-bounce",spin:"animate-spin",ping:"animate-ping",pulse:"animate-pulse"};function Aw(e,t,s=1000){return new Promise((a)=>{e.classList.add(t),setTimeout(()=>{e.classList.remove(t),a()},s)})}function Pw(e,t){let s=`
|
|
13
|
+
`}function ts(e,t,s,a,o=0){if(a<=0||s<=0)return{start:0,end:0};let n=Math.floor(Math.max(0,e)/s),r=Math.ceil((Math.max(0,e)+Math.max(0,t))/s),i=Math.min(a,Math.max(0,n-o));return{start:i,end:Math.max(i,Math.min(a,r+o))}}function ss(e,t,s){let a=s.rows-1,o=Math.max(0,s.columns-1),n=Math.max(1,s.page),{row:r,column:i}=e;switch(t){case"ArrowUp":r=Math.max(-1,r-1);break;case"ArrowDown":r=Math.min(a,r+1);break;case"ArrowLeft":i-=1;break;case"ArrowRight":i+=1;break;case"PageUp":r=r<=0?r:Math.max(0,r-n);break;case"PageDown":r=Math.min(a,Math.max(0,r)+(r<0?0:n));break;case"Home":if(i=0,s.mod)r=Math.min(0,a);break;case"End":if(i=o,s.mod)r=a;break;default:return e}return{row:Math.max(-1,Math.min(a,r)),column:Math.max(0,Math.min(o,i))}}function Tn(e,t,s=!1){let a=e.find((n)=>n.key===t),o=!a?{key:t,direction:"asc"}:a.direction==="asc"?{key:t,direction:"desc"}:null;if(!s)return o?[o]:[];if(!a)return[...e,o];return o?e.map((n)=>n.key===t?o:n):e.filter((n)=>n.key!==t)}var Yt=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});class ot{rows=[];columns=[];view=new Uint32Array(0);sort=[];filter="";selected=new Set;given=null;filtered=new Uint32Array(0);searchText=null;sortKeys=new Map;offsets=new Float64Array(1);anchor=-1;charWidth;cellPadding;constructor(e=[],t=null,s={}){this.charWidth=s.charWidth??7.25,this.cellPadding=s.cellPadding??24,this.given=t&&t.length>0?[...t]:null,this.setRows(e)}get count(){return this.view.length}get totalWidth(){return this.offsets[this.columns.length]}setRows(e){this.rows=Array.isArray(e)?e:[],this.selected.clear(),this.anchor=-1,this.forget(),this.resolveColumns(),this.refilter()}setColumns(e){this.given=e&&e.length>0?[...e]:null,this.forget(),this.resolveColumns(),this.sort=this.sort.filter((t)=>this.columns.some((s)=>s.key===t.key)),this.refilter()}setFilter(e){return this.filter=e==null?"":String(e),this.refilter(),this.count}setSort(e){this.sort=(e??[]).filter((t)=>t&&(t.direction==="asc"||t.direction==="desc")&&this.columns.some((s)=>s.key===t.key)),this.resort()}toggleSort(e,t=!1){let s=this.columns.find((a)=>a.key===e);if(!s||!s.sortable)return this.sort;return this.sort=Tn(this.sort,e,t),this.resort(),this.sort}sortOf(e){let t=this.sort.findIndex((s)=>s.key===e);return t<0?null:{direction:this.sort[t].direction,priority:t+1}}rowAt(e){return e>=0&&e<this.view.length?this.rows[this.view[e]]:void 0}valueAt(e,t){let s=this.columns[t],a=this.rowAt(e);return s&&a!==void 0?ae(a,s):void 0}viewRows(){let e=Array.from({length:this.view.length});for(let t=0;t<e.length;t++)e[t]=this.rows[this.view[t]];return e}toCsv(){return $n(this.viewRows(),this.columns)}toJson(){return Cn(this.viewRows(),this.columns)}select(e,t="replace"){if(e<0||e>=this.view.length)return;let s=this.view[e];if(t==="range"&&this.anchor>=0){let a=Math.min(this.anchor,e),o=Math.max(this.anchor,e);this.selected.clear();for(let n=a;n<=o&&n<this.view.length;n++)this.selected.add(this.view[n]);return}if(t==="toggle")if(this.selected.has(s))this.selected.delete(s);else this.selected.add(s);else this.selected.clear(),this.selected.add(s);this.anchor=e}selectAll(){this.selected.clear();for(let e=0;e<this.view.length;e++)this.selected.add(this.view[e])}clearSelection(){this.selected.clear(),this.anchor=-1}isSelected(e){return e>=0&&e<this.view.length&&this.selected.has(this.view[e])}selectedIndices(){return[...this.selected].sort((e,t)=>e-t)}selectedRows(){return this.selectedIndices().map((e)=>this.rows[e])}offsetOf(e){return this.offsets[Math.max(0,Math.min(this.columns.length,e))]}columnAt(e){let t=this.columns.length;if(t===0)return-1;let s=0,a=t-1;while(s<a){let o=s+a+1>>1;if(this.offsets[o]<=e)s=o;else a=o-1}return s}columnRange(e,t,s=0){let a=this.columns.length;if(a===0)return{start:0,end:0};let o=this.columnAt(Math.max(0,e)),n=this.columnAt(Math.max(0,e)+Math.max(0,t));return{start:Math.max(0,o-s),end:Math.min(a,n+1+s)}}resizeColumn(e,t){let s=this.columns[e];if(!s)return 0;return s.width=Math.round(Math.max(s.minWidth,Math.min(s.maxWidth,t))),this.measure(),s.width}autoWidth(e,t=200){let s=this.columns[e];if(!s)return 0;let a=s.label.length+3,o=Math.min(this.view.length,t);for(let r=0;r<o;r++){let i=we(ae(this.rows[this.view[r]],s),s.type).length;if(i>a)a=i}let n=Math.ceil(a*this.charWidth+this.cellPadding);return Math.max(s.minWidth,Math.min(s.maxWidth,420,n))}forget(){this.searchText=null,this.sortKeys.clear()}resolveColumns(){let e=this.given??Sn(this.rows),t=Math.min(this.rows.length,200),s=this.view;this.view=new Uint32Array(t);for(let a=0;a<t;a++)this.view[a]=a;this.columns=e.map((a)=>{let o=a.type;if(!o){let n=[];for(let r=0;r<t;r++)n.push(ae(this.rows[r],a));o=kn(n)}return{...a,label:a.label??a.key,type:o,width:a.width??0,minWidth:a.minWidth??48,maxWidth:a.maxWidth??2000,align:a.align??(o==="number"?"right":"left"),sortable:a.sortable!==!1}}),this.columns.forEach((a,o)=>{if(!a.width)a.width=this.autoWidth(o);a.width=Math.max(a.minWidth,Math.min(a.maxWidth,a.width))}),this.view=s,this.measure()}measure(){let e=new Float64Array(this.columns.length+1);for(let t=0;t<this.columns.length;t++)e[t+1]=e[t]+this.columns[t].width;this.offsets=e}searchable(){if(this.searchText)return this.searchText;let e=this.rows,t=this.columns,s=Array.from({length:e.length});for(let a=0;a<e.length;a++){let o=e[a],n="";for(let r=0;r<t.length;r++){let i=ae(o,t[r]);if(i===null||i===void 0)continue;n+=typeof i==="string"?i:we(i,t[r].type),n+="\x01"}s[a]=n.toLowerCase()}return this.searchText=s,s}refilter(){let e=this.rows.length,t=this.filter.toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0){let s=new Uint32Array(e);for(let a=0;a<e;a++)s[a]=a;this.filtered=s}else{let s=this.searchable(),a=new Uint32Array(e),o=0,n=t.length===1?t[0]:null;for(let r=0;r<e;r++){let i=s[r];if(n!==null){if(i.includes(n))a[o++]=r;continue}let c=!0;for(let l=0;l<t.length;l++)if(!i.includes(t[l])){c=!1;break}if(c)a[o++]=r}this.filtered=a.slice(0,o)}this.anchor=-1,this.resort()}keysFor(e){let t=this.sortKeys.get(e.key);if(t)return t;let s=this.rows,a=new Float64Array(s.length);if(e.type==="number"||e.type==="date"||e.type==="boolean")for(let o=0;o<s.length;o++){let n=ae(s[o],e),r=Number.NaN;if(n===null||n===void 0||n==="")r=Number.NaN;else if(typeof n==="number")r=n;else if(typeof n==="boolean")r=n?1:0;else if(n instanceof Date)r=n.getTime();else if(e.type==="date")r=Date.parse(String(n));else if(e.type==="boolean")r=String(n).toLowerCase()==="true"?1:0;else r=Number(n);a[o]=r}else{let o=Array.from({length:s.length}),n=new Map;for(let c=0;c<s.length;c++){let l=ae(s[c],e);if(l===null||l===void 0){o[c]=null;continue}let d=typeof l==="string"?l:we(l,e.type);if(o[c]=d,!n.has(d))n.set(d,0)}let r=[...n.keys()].sort(Yt.compare),i=0;for(let c=0;c<r.length;c++){if(c>0&&Yt.compare(r[c-1],r[c])!==0)i++;n.set(r[c],i)}for(let c=0;c<s.length;c++){let l=o[c];a[c]=l===null?Number.NaN:n.get(l)}}return this.sortKeys.set(e.key,a),a}resort(){let e=[];for(let s of this.sort){let a=this.columns.find((o)=>o.key===s.key);if(a)e.push({keys:this.keysFor(a),sign:s.direction==="desc"?-1:1})}let t=this.filtered.slice();if(e.length===1){let{keys:s,sign:a}=e[0];t.sort((o,n)=>{let r=s[o],i=s[n];if(r<i)return-a;if(r>i)return a;if(r===i)return o-n;let c=r!==r;return c===(i!==i)?o-n:c?1:-1})}else if(e.length>1)t.sort((s,a)=>{for(let o=0;o<e.length;o++){let n=e[o].keys[s],r=e[o].keys[a];if(n<r)return-e[o].sign;if(n>r)return e[o].sign;if(n===r)continue;let i=n!==n;if(i!==(r!==r))return i?1:-1}return s-a});this.view=t}}var In="./DataGrid-7rt7v865.stx";var An=120,Le=new Intl.NumberFormat("en-US");function re(e,t){return e.querySelector(`[data-dg="${t}"]`)}function Pn(e){let t=()=>{let s=document.createElement("textarea");s.value=e,s.setAttribute("aria-hidden","true"),s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(s);let a=document.activeElement;s.select();try{document.execCommand("copy")}catch{}s.remove(),a?.focus({preventScroll:!0})};if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText==="function")navigator.clipboard.writeText(e).catch(t);else t()}class Mn{root;callbacks;model;scroller;content;header;body;status;filterInput;prefix;rowHeight;headerHeight;overscan;columnOverscan;selectable;resizeStep;fileName;contextMenu;slots=new Map;pool=[];headerCells=[];rows={start:0,end:0};cols={start:0,end:0};stale=!0;active={row:0,column:0};activeEl=null;filterTimer=null;resize=null;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=re(e,"scroller"),o=re(e,"content"),n=re(e,"header"),r=re(e,"body");if(!a||!o||!n||!r)throw Error("DataGridView: the root is missing its scroller, content, header or body");if(this.scroller=a,this.content=o,this.header=n,this.body=r,this.status=re(e,"status"),this.filterInput=re(e,"filter"),this.prefix=a.id||`data-grid-${Math.random().toString(36).slice(2,8)}`,this.rowHeight=Math.max(8,t.rowHeight??28),this.headerHeight=Math.max(8,t.headerHeight??32),this.overscan=t.overscan??6,this.columnOverscan=t.columnOverscan??2,this.selectable=t.selectable!==!1,this.resizeStep=t.resizeStep??16,this.fileName=t.fileName||"data",this.contextMenu=Boolean(t.contextMenu),this.header.__stx_inert_content=!0,this.body.__stx_inert_content=!0,e.style.setProperty("--stx-grid-row-height",`${this.rowHeight}px`),e.style.setProperty("--stx-grid-header-height",`${this.headerHeight}px`),this.model=new ot(t.rows??[],t.columns??null),t.filter){if(this.model.setFilter(t.filter),this.filterInput)this.filterInput.value=t.filter}if(this.listen(this.scroller,"scroll",()=>this.render()),this.listen(this.scroller,"keydown",(l)=>this.onKeyDown(l)),this.listen(this.body,"click",(l)=>this.onBodyClick(l)),this.listen(this.body,"dblclick",(l)=>this.onBodyDoubleClick(l)),this.listen(this.body,"contextmenu",(l)=>this.onContextMenu(l)),this.listen(this.header,"click",(l)=>this.onHeaderClick(l)),this.listen(this.header,"dblclick",(l)=>this.onHeaderDoubleClick(l)),this.listen(this.header,"pointerdown",(l)=>this.onResizeStart(l)),this.listen(this.header,"pointermove",(l)=>this.onResizeMove(l)),this.listen(this.header,"pointerup",(l)=>this.onResizeEnd(l)),this.listen(this.header,"pointercancel",(l)=>this.onResizeEnd(l)),this.filterInput)this.listen(this.filterInput,"input",()=>this.onFilterInput());let i=re(e,"export-csv"),c=re(e,"export-json");if(i)this.listen(i,"click",()=>this.download("csv"));if(c)this.listen(c,"click",()=>this.download("json"));if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.refresh(),e.setAttribute("data-dg-ready","")}setRows(e){this.model.setRows(e),this.active={row:Math.min(0,this.model.count-1),column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.scroller.scrollTop=0,this.refresh()}setColumns(e){this.model.setColumns(e),this.active={row:this.active.row,column:Math.min(this.active.column,Math.max(0,this.model.columns.length-1))},this.refresh()}setFilter(e){let t=e==null?"":String(e);if(this.filterInput&&this.filterInput.value!==t)this.filterInput.value=t;this.applyFilter(t)}setSort(e){this.model.setSort(e),this.refresh()}setFileName(e){this.fileName=e||"data"}getView(){return this.model.viewRows()}getSelection(){let e=this.model.selectedIndices();return{rows:e.map((t)=>this.model.rows[t]),indices:e}}clearSelection(){this.model.clearSelection(),this.paintSelection(),this.reportSelection()}exportCsv(){return this.model.toCsv()}exportJson(){return this.model.toJson()}download(e){let t=e==="json"?this.model.toJson():this.model.toCsv(),s=new Blob([t],{type:e==="json"?"application/json":"text/csv;charset=utf-8"}),a=URL.createObjectURL(s),o=document.createElement("a");return o.href=a,o.download=`${this.fileName}.${e}`,o.style.display="none",this.root.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(a),1000),this.callbacks.onExport?.({format:e,text:t,rows:this.model.count}),t}scrollToRow(e){let t=Math.max(0,Math.min(this.model.count-1,e));this.revealRow(t),this.render()}focus(){this.scroller.focus({preventScroll:!0})}getActiveCell(){return{...this.active}}setActiveCell(e,t){this.moveTo({row:e,column:t},!1)}destroy(){if(this.observer?.disconnect(),this.filterTimer)clearTimeout(this.filterTimer);for(let e of this.disposers)e();this.header.replaceChildren(),this.body.replaceChildren(),this.slots.clear(),this.pool.length=0,this.root.removeAttribute("data-dg-ready")}refresh(){let e=this.model;this.content.style.width=`${e.totalWidth}px`,this.content.style.height=`${this.headerHeight+e.count*this.rowHeight}px`,this.header.style.width=`${e.totalWidth}px`,this.body.style.height=`${e.count*this.rowHeight}px`,this.scroller.setAttribute("aria-rowcount",String(e.count+1)),this.scroller.setAttribute("aria-colcount",String(e.columns.length)),this.root.toggleAttribute("data-empty",e.count===0),this.stale=!0,this.render(),this.paintStatus()}render(){let e=this.model,t=this.scroller,s=ts(t.scrollTop,Math.max(0,t.clientHeight-this.headerHeight),this.rowHeight,e.count,this.overscan),a=e.columnRange(t.scrollLeft,t.clientWidth,this.columnOverscan),o=this.stale||a.start!==this.cols.start||a.end!==this.cols.end;if(!o&&s.start===this.rows.start&&s.end===this.rows.end)return;if(this.rows=s,this.cols=a,o)this.renderHeader();for(let[n,r]of this.slots)if(n<s.start||n>=s.end)this.slots.delete(n),r.index=-1,r.el.style.display="none",this.pool.push(r);for(let n=s.start;n<s.end;n++){let r=this.slots.get(n);if(r){if(o)this.fill(r);continue}r=this.pool.pop()??this.createSlot(),r.index=n,r.el.style.display="",this.slots.set(n,r),this.fill(r)}this.stale=!1,this.paintActive()}createSlot(){let e=document.createElement("div");return e.className="stx-dg-row",e.setAttribute("role","row"),this.body.appendChild(e),{el:e,index:-1,cells:[]}}fill(e){let t=this.model,s=e.index,a=t.rowAt(s),o=this.selectable&&t.isSelected(s),n=e.el;if(n.__dgRow=s,n.style.transform=`translateY(${s*this.rowHeight}px)`,n.setAttribute("aria-rowindex",String(s+2)),this.selectable)n.setAttribute("aria-selected",o?"true":"false");let r=this.cols.end-this.cols.start;while(e.cells.length<r){let i=document.createElement("div");i.className="stx-dg-cell",i.setAttribute("role","gridcell"),i.appendChild(document.createTextNode("")),n.appendChild(i),e.cells.push(i)}while(e.cells.length>r)e.cells.pop().remove();for(let i=0;i<r;i++){let c=this.cols.start+i,l=t.columns[c],d=e.cells[i],h=a===void 0?void 0:ae(a,l),p=Xt(h);if(d.__dgColumn=c,d.id=`${this.prefix}-r${s}-c${c}`,d.style.left=`${t.offsetOf(c)}px`,d.style.width=`${l.width}px`,d.setAttribute("aria-colindex",String(c+1)),d.setAttribute("data-type",l.type),d.setAttribute("data-align",l.align),p==="value")d.removeAttribute("data-empty");else d.setAttribute("data-empty",p);if(this.selectable)d.setAttribute("aria-selected",o?"true":"false");d.firstChild.data=typeof h==="string"?h:we(h,l.type)}}renderHeader(){let e=this.model,t=this.cols.end-this.cols.start;while(this.headerCells.length<t){let s=document.createElement("div");s.className="stx-dg-head",s.setAttribute("role","columnheader");let a=document.createElement("span");a.className="stx-dg-head-label",a.appendChild(document.createTextNode(""));let o=document.createElement("span");o.className="stx-dg-sort",o.setAttribute("aria-hidden","true"),o.appendChild(document.createTextNode(""));let n=document.createElement("span");n.className="stx-dg-resize",n.setAttribute("aria-hidden","true"),s.append(a,o,n),this.header.appendChild(s),this.headerCells.push(s)}while(this.headerCells.length>t)this.headerCells.pop().remove();for(let s=0;s<t;s++){let a=this.cols.start+s,o=e.columns[a],n=this.headerCells[s],r=e.sortOf(o.key);if(n.__dgColumn=a,n.id=`${this.prefix}-h-c${a}`,n.style.left=`${e.offsetOf(a)}px`,n.style.width=`${o.width}px`,n.setAttribute("aria-colindex",String(a+1)),n.setAttribute("data-align",o.align),n.toggleAttribute("data-sortable",o.sortable),o.sortable)n.setAttribute("aria-sort",r?r.direction==="asc"?"ascending":"descending":"none");else n.removeAttribute("aria-sort");n.children[0].firstChild.data=o.label,n.children[1].firstChild.data=r?`${r.direction==="asc"?"\u25B2":"\u25BC"}${e.sort.length>1?r.priority:""}`:""}}cellElement(e){if(e.column<this.cols.start||e.column>=this.cols.end)return null;let t=e.column-this.cols.start;if(e.row<0)return this.headerCells[t]??null;return this.slots.get(e.row)?.cells[t]??null}paintActive(){let e=this.cellElement(this.active);if(this.activeEl&&this.activeEl!==e)this.activeEl.removeAttribute("data-active");if(this.activeEl=e,e)e.setAttribute("data-active",""),this.scroller.setAttribute("aria-activedescendant",e.id);else this.scroller.removeAttribute("aria-activedescendant")}paintSelection(){if(!this.selectable)return;for(let[e,t]of this.slots){let s=this.model.isSelected(e)?"true":"false";t.el.setAttribute("aria-selected",s);for(let a of t.cells)a.setAttribute("aria-selected",s)}this.paintStatus()}paintStatus(){if(!this.status)return;let e=this.model,t=e.rows.length,s=e.count===t?`${Le.format(t)} ${t===1?"row":"rows"}`:`${Le.format(e.count)} of ${Le.format(t)} rows`;if(e.selected.size>0)s+=`, ${Le.format(e.selected.size)} selected`;if(this.status.textContent!==s)this.status.textContent=s}revealRow(e){let t=this.scroller,s=e*this.rowHeight,a=t.clientHeight-this.headerHeight;if(s<t.scrollTop)t.scrollTop=s;else if(s+this.rowHeight>t.scrollTop+a)t.scrollTop=s+this.rowHeight-a}revealColumn(e){let t=this.scroller,s=this.model.offsetOf(e),a=this.model.offsetOf(e+1);if(s<t.scrollLeft)t.scrollLeft=s;else if(a>t.scrollLeft+t.clientWidth)t.scrollLeft=Math.min(s,a-t.clientWidth)}detail(e){return{row:this.model.rowAt(e.row),rowIndex:e.row,column:this.model.columns[e.column],value:e.row<0?void 0:this.model.valueAt(e.row,e.column)}}moveTo(e,t=!0){let s=this.model,a={row:Math.max(-1,Math.min(s.count-1,e.row)),column:Math.max(0,Math.min(s.columns.length-1,e.column))};if(this.active=a,a.row>=0)this.revealRow(a.row);if(this.revealColumn(a.column),this.render(),this.paintActive(),t)this.callbacks.onCell?.(this.detail(a))}reportSelection(){this.callbacks.onSelect?.(this.getSelection())}applyFilter(e){let t=this.model.setFilter(e);this.active={row:Math.min(0,t-1),column:this.active.column},this.scroller.scrollTop=0,this.refresh(),this.callbacks.onFilter?.({text:e,count:t})}sortBy(e,t){let s=this.model.columns[e];if(!s||!s.sortable)return;let a=this.model.toggleSort(s.key,t);this.refresh(),this.callbacks.onSort?.([...a])}setColumnWidth(e,t){this.model.resizeColumn(e,t),this.content.style.width=`${this.model.totalWidth}px`,this.header.style.width=`${this.model.totalWidth}px`,this.stale=!0,this.render()}copy(e){if(this.active.row<0)return;let t=this.model.rowAt(this.active.row);if(t===void 0)return;let s=e==="row"?es(t,this.model.columns):Zt(this.model.valueAt(this.active.row,this.active.column));Pn(s),this.callbacks.onCopy?.({what:e,text:s})}listen(e,t,s){e.addEventListener(t,s),this.disposers.push(()=>e.removeEventListener(t,s))}cellFrom(e){let s=e.target?.closest(".stx-dg-cell"),a=s?.parentElement;if(!s||!a||s.__dgColumn===void 0||a.__dgRow===void 0)return null;return{row:a.__dgRow,column:s.__dgColumn}}headFrom(e){let t=e.target,s=t?.closest(".stx-dg-head");if(!s||s.__dgColumn===void 0)return null;let a=t.closest(".stx-dg-resize");return{column:s.__dgColumn,onHandle:Boolean(a),handle:a}}onBodyClick(e){let t=this.cellFrom(e);if(!t)return;if(this.selectable)this.model.select(t.row,e.shiftKey?"range":e.metaKey||e.ctrlKey?"toggle":"replace"),this.paintSelection(),this.reportSelection();this.moveTo(t)}onBodyDoubleClick(e){let t=this.cellFrom(e),s=t?this.model.rowAt(t.row):void 0;if(t&&s!==void 0)this.callbacks.onActivate?.({row:s,rowIndex:t.row})}onContextMenu(e){let t=this.cellFrom(e);if(!t)return;if(this.contextMenu)e.preventDefault();this.moveTo(t,!1),this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onHeaderClick(e){let t=this.headFrom(e);if(!t||t.onHandle)return;this.active={row:-1,column:t.column},this.sortBy(t.column,e.shiftKey)}onHeaderDoubleClick(e){let t=this.headFrom(e);if(t&&t.onHandle)this.setColumnWidth(t.column,this.model.autoWidth(t.column))}onResizeStart(e){let t=this.headFrom(e);if(!t||!t.onHandle||!t.handle||e.button!==0)return;e.preventDefault();try{t.handle.setPointerCapture(e.pointerId)}catch{}this.resize={column:t.column,start:e.clientX,width:this.model.columns[t.column].width,pointer:e.pointerId,handle:t.handle},this.root.setAttribute("data-resizing","")}onResizeMove(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.setColumnWidth(t.column,t.width+e.clientX-t.start)}onResizeEnd(e){let t=this.resize;if(!t||e.pointerId!==t.pointer)return;this.resize=null,this.root.removeAttribute("data-resizing");try{t.handle.releasePointerCapture(e.pointerId)}catch{}}onFilterInput(){if(this.filterTimer)clearTimeout(this.filterTimer);this.filterTimer=setTimeout(()=>{this.filterTimer=null,this.applyFilter(this.filterInput?this.filterInput.value:"")},An)}onKeyDown(e){if(e.target!==this.scroller)return;let t=this.model,s=e.metaKey||e.ctrlKey,a=this.active.row<0,o=e.key;if(s&&(o==="a"||o==="A")){if(!this.selectable)return;e.preventDefault(),t.selectAll(),this.paintSelection(),this.reportSelection();return}if(s&&(o==="c"||o==="C")){if(a)return;e.preventDefault(),this.copy(e.shiftKey?"row":"cell");return}if(a&&e.altKey&&(o==="ArrowLeft"||o==="ArrowRight")){e.preventDefault();let i=t.columns[this.active.column];if(i)this.setColumnWidth(this.active.column,i.width+(o==="ArrowRight"?this.resizeStep:-this.resizeStep));this.paintActive();return}if(o==="Enter"||o===" "){if(e.preventDefault(),a){this.sortBy(this.active.column,e.shiftKey);return}if(o===" "){if(!this.selectable)return;t.select(this.active.row,"toggle"),this.paintSelection(),this.reportSelection();return}let i=t.rowAt(this.active.row);if(i!==void 0)this.callbacks.onActivate?.({row:i,rowIndex:this.active.row});return}if(o==="Escape"&&this.selectable&&t.selected.size>0){e.preventDefault(),this.clearSelection();return}let n=Math.max(1,Math.floor((this.scroller.clientHeight-this.headerHeight)/this.rowHeight)-1),r=ss(this.active,o,{rows:t.count,columns:t.columns.length,page:n,mod:s});if(r===this.active)return;if(e.preventDefault(),r.row===this.active.row&&r.column===this.active.column)return;if(e.shiftKey&&this.selectable&&r.row>=0&&r.row!==this.active.row){if(t.selected.size===0&&this.active.row>=0)t.select(this.active.row,"replace");t.select(r.row,"range"),this.paintSelection(),this.reportSelection()}this.moveTo(r)}}var Nn="./Dialog-wm7zjqnb.stx";var On="./DialogBackdrop-de5m5m4w.stx";var Dn="./DialogDescription-yd2jgt2m.stx";var jn="./DialogPanel-v972ztcc.stx";var Fn="./DialogTitle-nw0pw114.stx";var qn="./Drawer-d78cdr6d.stx";var _n="./Dropdown-hb8ks69x.stx";var Gn="./DropdownButton-wxc25hsy.stx";var Jn="./DropdownItem-af0vzc8a.stx";var Xn="./DropdownItems-bkz7jkyz.stx";var Qn="./Form-cybgg9ym.stx";var er={action:f.string,method:f.oneOf(["GET","POST","PUT","DELETE","PATCH"]),validationSchema:f.object,initialValues:f.object,validateOnChange:f.boolean,validateOnBlur:f.boolean,onSubmit:f.func,onError:f.func,className:f.string},Jf=se("Form",er);var as=(e)=>Math.round(e*100)/100,Z=(e)=>`${as(e.x)} ${as(e.y)}`;function os(e,t,s){let a=s.x-e.x,o=s.y-e.y;if(a===0&&o===0)return{x:e.x,y:e.y};let n=a===0?Number.POSITIVE_INFINITY:t.width/2/Math.abs(a),r=o===0?Number.POSITIVE_INFINITY:t.height/2/Math.abs(o),i=Math.min(n,r);return{x:e.x+a*i,y:e.y+o*i}}function ns(e,t,s){let a=e.x-t.x,o=e.y-t.y,n=Math.sqrt(a*a+o*o);if(s<=0||n<=s)return e;return{x:e.x-a/n*s,y:e.y-o/n*s}}function tr(e,t,s=0){let a=26+Math.abs(s),o={x:e.x+t.width/4,y:e.y-t.height/2},n={x:e.x+t.width/2,y:e.y-t.height/4},r={x:o.x,y:o.y-a},i={x:n.x+a,y:n.y};return{d:`M ${Z(o)} C ${Z(r)}, ${Z(i)}, ${Z(n)}`,start:o,end:n,label:rs(o,r,i,n,0.5),angle:Math.atan2(n.y-i.y,n.x-i.x)}}function rs(e,t,s,a,o){let n=1-o;return{x:n*n*n*e.x+3*n*n*o*t.x+3*n*o*o*s.x+o*o*o*a.x,y:n*n*n*e.y+3*n*n*o*t.y+3*n*o*o*s.y+o*o*o*a.y}}function is(e,t={}){let{source:s,sourceSize:a,target:o,targetSize:n}=e,r=t.offset??0,i=t.inset??0;if(s.x===o.x&&s.y===o.y)return tr(s,a,r);if(t.curve==="bezier"){let w=t.direction!=="TB",y=(w?o.x-s.x:o.y-s.y)>=0?1:-1,v=w?{x:s.x+y*a.width/2,y:s.y}:{x:s.x,y:s.y+y*a.height/2},b=w?{x:o.x-y*n.width/2,y:o.y}:{x:o.x,y:o.y-y*n.height/2},C=Math.abs(w?b.x-v.x:b.y-v.y),P=Math.max(C/2,24)*y,T=w?{x:b.x-y*i,y:b.y}:{x:b.x,y:b.y-y*i},j=w?{x:v.x+P,y:v.y+r}:{x:v.x+r,y:v.y+P},V=w?{x:T.x-P,y:T.y+r}:{x:T.x+r,y:T.y-P};return{d:`M ${Z(v)} C ${Z(j)}, ${Z(V)}, ${Z(T)}`,start:v,end:T,label:rs(v,j,V,T,0.5),angle:Math.atan2(T.y-V.y,T.x-V.x)}}let c=os(s,a,o),l=os(o,n,s);if(r===0){let w=ns(l,c,i);return{d:`M ${Z(c)} L ${Z(w)}`,start:c,end:w,label:{x:(c.x+w.x)/2,y:(c.y+w.y)/2},angle:Math.atan2(w.y-c.y,w.x-c.x)}}let d=s.x<o.x||s.x===o.x&&s.y<o.y?1:-1,h=(o.x-s.x)*d,p=(o.y-s.y)*d,u=Math.sqrt(h*h+p*p)||1,g={x:(c.x+l.x)/2+-p/u*r*2,y:(c.y+l.y)/2+h/u*r*2},m=ns(l,g,i);return{d:`M ${Z(c)} Q ${Z(g)}, ${Z(m)}`,start:c,end:m,label:{x:0.25*c.x+0.5*g.x+0.25*m.x,y:0.25*c.y+0.5*g.y+0.25*m.y},angle:Math.atan2(m.y-g.y,m.x-g.x)}}function ls(e,t=14){let s=new Map;for(let o of e){let n=o.source<o.target?`${o.source}\x00${o.target}`:`${o.target}\x00${o.source}`,r=s.get(n);if(r)r.push(o);else s.set(n,[o])}let a=new Map;for(let o of s.values()){if(o.length<2)continue;o.forEach((n,r)=>{let i=(r-(o.length-1)/2)*t;a.set(n.id,n.source===n.target?r*t:i)})}return a}var nt={charWidth:7,paddingX:12,minWidth:48,maxWidth:220,height:32,detailHeight:14};function oe(e){return e.label==null||e.label===""?e.id:String(e.label)}function cs(e){return e.id!=null&&e.id!==""?String(e.id):`${e.source}->${e.target}${e.label?`:${e.label}`:""}`}function ds(e,t=nt){let s=Math.max(oe(e).length,e.detail?e.detail.length*0.85:0),a=e.expandable===!0?t.charWidth+4:0;return{width:Math.min(t.maxWidth,Math.max(t.minWidth,Math.ceil(s*t.charWidth)+t.paddingX*2+a)),height:t.height+(e.detail?t.detailHeight:0)}}function ps(e=nt){return Math.floor((e.maxWidth-e.paddingX*2)/e.charWidth)}function Oe(e,t){return e.length<=t?e:`${e.slice(0,Math.max(1,t-1))}\u2026`}class ze{metrics;nodeMap=new Map;edgeMap=new Map;incident=new Map;sizes=new Map;constructor(e=[],t=[],s=nt){this.metrics=s;this.merge(e,t)}get nodes(){return[...this.nodeMap.values()]}get edges(){return[...this.edgeMap.values()]}get nodeCount(){return this.nodeMap.size}get edgeCount(){return this.edgeMap.size}has(e){return this.nodeMap.has(e)}node(e){return this.nodeMap.get(e)}edge(e){return this.edgeMap.get(e)}addNode(e){if(!e||e.id==null||e.id==="")return!1;let t=String(e.id);if(this.nodeMap.has(t))return!1;let s={...e,id:t};return this.nodeMap.set(t,s),this.incident.set(t,new Set),this.sizes.set(t,ds(s,this.metrics)),!0}addEdge(e){if(!e)return!1;let t=String(e.source),s=String(e.target);if(!this.nodeMap.has(t)||!this.nodeMap.has(s))return!1;let a=cs({...e,source:t,target:s});if(this.edgeMap.has(a))return!1;return this.edgeMap.set(a,{...e,id:a,source:t,target:s}),this.incident.get(t).add(a),this.incident.get(s).add(a),!0}updateNode(e,t){let s=this.nodeMap.get(e);if(!s)return!1;let a={...s,...t,id:e};return this.nodeMap.set(e,a),this.sizes.set(e,ds(a,this.metrics)),!0}removeNode(e){if(!this.nodeMap.has(e))return!1;for(let t of[...this.incident.get(e)])this.removeEdge(t);return this.nodeMap.delete(e),this.incident.delete(e),this.sizes.delete(e),!0}removeEdge(e){let t=this.edgeMap.get(e);if(!t)return!1;return this.edgeMap.delete(e),this.incident.get(t.source)?.delete(e),this.incident.get(t.target)?.delete(e),!0}merge(e=[],t=[]){let s={nodes:[],edges:[]};for(let a of e)if(this.addNode(a))s.nodes.push(String(a.id));for(let a of t)if(this.addEdge(a))s.edges.push(cs({...a,source:String(a.source),target:String(a.target)}));return s}edgesOf(e){let t=this.incident.get(e);return t?[...t].map((s)=>this.edgeMap.get(s)):[]}neighbours(e){let t=new Set;for(let s of this.edgesOf(e)){let a=s.source===e?s.target:s.source;if(a!==e)t.add(a)}return[...t]}degree(e){return this.neighbours(e).length}size(e){return this.sizes.get(e)??{width:this.metrics.minWidth,height:this.metrics.height}}bounds(e){let{POSITIVE_INFINITY:t,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:a,NEGATIVE_INFINITY:o}=Number;for(let[n,r]of e){if(!this.nodeMap.has(n))continue;let i=this.size(n);t=Math.min(t,r.x-i.width/2),a=Math.max(a,r.x+i.width/2),s=Math.min(s,r.y-i.height/2),o=Math.max(o,r.y+i.height/2)}return Number.isFinite(t)?{x:t,y:s,width:a-t,height:o-s}:null}}function hs(e){let t=e>>>0||1;return()=>{t=t+1831565813>>>0;let s=t;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}var sr=0.15,us=0.06;function fs(e,t={}){let s=e.nodes,a=s.length,o=new Map;if(a===0)return o;let n=t.linkDistance??90,r=t.padding??16,i=hs(t.seed??1),c=t.positions??null,l=new Set(t.pinned??[]),d=new Map(s.map((R,N)=>[R.id,N])),h=new Float64Array(a),p=new Float64Array(a),u=new Float64Array(a),g=new Float64Array(a),m=new Uint8Array(a),w=new Uint8Array(a),y=new Float64Array(a).fill(1),v=0;s.forEach((R,N)=>{let E=e.size(R.id);u[N]=E.width/2,g[N]=E.height/2;let M=c?.get(R.id);if(M&&Number.isFinite(M.x)&&Number.isFinite(M.y))h[N]=M.x,p[N]=M.y,w[N]=1,m[N]=l.has(R.id)?1:0,y[N]=0,v++});let b=n*Math.sqrt(a)*0.6;s.forEach((R,N)=>{if(w[N])return;let E=e.neighbours(R.id).map((k)=>d.get(k)).find((k)=>w[k]),M=i()*Math.PI*2;if(E!==void 0)h[N]=h[E]+Math.cos(M)*n*0.5,p[N]=p[E]+Math.sin(M)*n*0.5;else{let k=Math.sqrt(i())*b;h[N]=Math.cos(M)*k,p[N]=Math.sin(M)*k}});let C=Uint8Array.from(w),P=v>0,T=Math.max(0,t.iterations??(P?80:300)),j=[],V=new Set;for(let R of e.edges){let N=d.get(R.source),E=d.get(R.target);if(N===E)continue;let M=N<E?N*a+E:E*a+N;if(!V.has(M))V.add(M),j.push(N,E)}let F=new Float64Array(a),x=new Float64Array(a),S=n,L=P?S*0.5:S*1.5;for(let R=0;R<T;R++){let N=L*(1-R/T);F.fill(0),x.fill(0);for(let E=0;E<a;E++)for(let M=E+1;M<a;M++){if(C[E]&&C[M])continue;let k=h[E]-h[M],z=p[E]-p[M],O=Math.sqrt(k*k+z*z);if(O<0.01){let K=(E*31+M*17)%360*Math.PI/180;k=Math.cos(K)*0.01,z=Math.sin(K)*0.01,O=0.01}let J=Math.max(1,O-(u[E]+u[M])*0.5),H=S*S*sr/J/O;F[E]+=k*H,x[E]+=z*H,F[M]-=k*H,x[M]-=z*H}for(let E=0;E<j.length;E+=2){let M=j[E],k=j[E+1];if(C[M]&&C[k])continue;let z=h[M]-h[k],O=p[M]-p[k],J=Math.sqrt(z*z+O*O)||0.01,H=(u[M]+u[k])*0.5,K=Math.max(0,J-H),Q=K*K/S/J;F[M]-=z*Q,x[M]-=O*Q,F[k]+=z*Q,x[k]+=O*Q}for(let E=0;E<a;E++){if(m[E])continue;if(!C[E])F[E]-=h[E]*us,x[E]-=p[E]*us;let M=Math.sqrt(F[E]*F[E]+x[E]*x[E]);if(M>0){let k=Math.min(M,N)/M*y[E];h[E]+=F[E]*k,p[E]+=x[E]*k}}}return ar(h,p,u,g,m,r),s.forEach((R,N)=>{o.set(R.id,{x:Math.round(h[N]*100)/100,y:Math.round(p[N]*100)/100})}),o}function ar(e,t,s,a,o,n){let r=e.length;for(let i=0;i<40;i++){let c=!1;for(let l=0;l<r;l++)for(let d=l+1;d<r;d++){let h=s[l]+s[d]+n-Math.abs(e[l]-e[d]);if(h<=0)continue;let p=a[l]+a[d]+n-Math.abs(t[l]-t[d]);if(p<=0)continue;if(o[l]&&o[d])continue;c=!0;let u=o[l]?0:o[d]?1:0.5,g=1-u;if(h<p){let m=e[l]<e[d]||e[l]===e[d]&&l<d?-1:1;e[l]+=m*h*u,e[d]-=m*h*g}else{let m=t[l]<t[d]||t[l]===t[d]&&l<d?-1:1;t[l]+=m*p*u,t[d]-=m*p*g}}if(!c)break}}function or(e){let t=new Set,s=[];for(let o of e.nodes){if(t.has(o.id))continue;let n=[],r=[o.id];t.add(o.id);while(r.length){let i=r.shift();n.push(i);for(let c of e.neighbours(i))if(!t.has(c))t.add(c),r.push(c)}s.push(n)}let a=new Map(e.nodes.map((o,n)=>[o.id,n]));for(let o of s)o.sort((n,r)=>a.get(n)-a.get(r));return s}function nr(e){let t=new Map;for(let o of e.nodes)t.set(o.id,[]);for(let o of e.edges)if(o.source!==o.target)t.get(o.source).push({id:o.id,to:o.target});let s=new Set,a=new Map;for(let o of e.nodes){if(a.has(o.id))continue;let n=[{id:o.id,next:0}];a.set(o.id,1);while(n.length){let r=n[n.length-1],i=t.get(r.id);if(r.next>=i.length){a.set(r.id,2),n.pop();continue}let c=i[r.next++],l=a.get(c.to);if(l===1)s.add(c.id);else if(l===void 0)a.set(c.to,1),n.push({id:c.to,next:0})}}return s}function ms(e,t){let s=e.map((o)=>[t.get(o.from),t.get(o.to)]).sort((o,n)=>o[0]-n[0]||o[1]-n[1]),a=0;for(let o=0;o<s.length;o++)for(let n=o+1;n<s.length;n++)if(s[o][0]<s[n][0]&&s[o][1]>s[n][1])a++;return a}function gs(e,t={}){let s=t.direction==="TB"?"TB":"LR",a=t.nodeGap??24,o=t.layerGap??80,n=t.componentGap??48,r=t.sweeps??4,i=s==="LR",c=nr(e),l=[],d=new Set;for(let b of e.edges){if(b.source===b.target)continue;let C=c.has(b.id)?b.target:b.source,P=c.has(b.id)?b.source:b.target,T=`${C}\x00${P}`;if(!d.has(T))d.add(T),l.push({from:C,to:P})}let h=new Map,p=new Map;for(let b of e.nodes)h.set(b.id,[]),p.set(b.id,[]);for(let b of l)h.get(b.from).push(b.to),p.get(b.to).push(b.from);let u=new Map,g=new Map,m=[];for(let b of e.nodes)if(g.set(b.id,p.get(b.id).length),p.get(b.id).length===0)m.push(b.id),u.set(b.id,0);for(let b=0;b<m.length;b++){let C=m[b];for(let P of h.get(C)){u.set(P,Math.max(u.get(P)??0,u.get(C)+1));let T=g.get(P)-1;if(g.set(P,T),T===0)m.push(P)}}let w=new Map,y=[],v=0;for(let b of or(e)){let C=[];for(let k of b){let z=u.get(k)??0;while(C.length<=z)C.push([]);C[z].push(k)}let P=new Set(b),T=l.filter((k)=>P.has(k.from)&&u.get(k.to)-u.get(k.from)===1),j=new Map,V=()=>{for(let k of C)k.forEach((z,O)=>j.set(z,k.length>1?O/(k.length-1):0.5))},F=(k,z)=>{let O=new Map;k.forEach((H,K)=>{let Q=z.get(H),Ee=k.length>1?K/(k.length-1):0.5;O.set(H,Q.length?Q.reduce((Ye,Ie)=>Ye+j.get(Ie),0)/Q.length:Ee)});let J=new Map(k.map((H,K)=>[H,K]));k.sort((H,K)=>O.get(H)-O.get(K)||J.get(H)-J.get(K)),k.forEach((H,K)=>j.set(H,k.length>1?K/(k.length-1):0.5))};V();let x=C.map((k)=>[...k]),S=ms(T,j);for(let k=0;k<r&&S>0;k++){for(let O=1;O<C.length;O++)F(C[O],p);for(let O=C.length-2;O>=0;O--)F(C[O],h);let z=ms(T,j);if(z<S)S=z,x=C.map((O)=>[...O])}let L=(k)=>i?e.size(k).width:e.size(k).height,R=(k)=>i?e.size(k).height:e.size(k).width,N=x.map((k)=>k.reduce((z,O)=>z+R(O),0)+a*Math.max(0,k.length-1)),E=Math.max(0,...N),M=0;x.forEach((k,z)=>{let O=Math.max(0,...k.map(L)),J=v+(E-N[z])/2;for(let H of k){let K=J+R(H)/2;w.set(H,i?{x:M+O/2,y:K}:{x:K,y:M+O/2}),J+=R(H)+a}M+=O+o}),y.push(x),v+=E+n}return{positions:w,layerOf:u,reversed:c,components:y,bounds:e.bounds(w)}}var rr={x:0,y:0,k:1};function xs(e,t,s){return Math.min(Math.max(e,t),s)}function am(e,t){return{x:t.x*e.k+e.x,y:t.y*e.k+e.y}}function rt(e,t){return{x:(t.x-e.x)/e.k,y:(t.y-e.y)/e.k}}function De(e,t,s){return{x:e.x+t,y:e.y+s,k:e.k}}function bs(e,t,s,a=0.1,o=4){let n=xs(e.k*s,a,o),r=n/e.k;return{x:t.x-(t.x-e.x)*r,y:t.y-(t.y-e.y)*r,k:n}}function vs(e,t,s=24,a=0.1,o=1){if(!e||t.width<=0||t.height<=0)return{...rr};let n=Math.max(1,t.width-s*2),r=Math.max(1,t.height-s*2),i=xs(Math.min(n/Math.max(1,e.width),r/Math.max(1,e.height)),a,o);return{x:t.width/2-(e.x+e.width/2)*i,y:t.height/2-(e.y+e.height/2)*i,k:i}}function ws(e,t,s){return{x:s.width/2-t.x*e.k,y:s.height/2-t.y*e.k,k:e.k}}function ys(e,t,s,a=16){let o=t.x*e.k+e.x,n=t.y*e.k+e.y,r=o+t.width*e.k,i=n+t.height*e.k,c=0,l=0;if(o<a)c=a-o;else if(r>s.width-a)c=s.width-a-r;if(n<a)l=a-n;else if(i>s.height-a)l=s.height-a-i;return c===0&&l===0?e:De(e,c,l)}function ks(e,t,s){let a=e.get(t);if(!a)return null;let o=s==="left"?-1:s==="right"?1:0,n=s==="up"?-1:s==="down"?1:0,r=null,i=Number.POSITIVE_INFINITY;for(let[c,l]of e){if(c===t)continue;let d=l.x-a.x,h=l.y-a.y,p=d*o+h*n;if(p<=0.5)continue;let u=Math.abs(d*n)+Math.abs(h*o);if(u>p*2)continue;let g=p+u*2;if(g<i)i=g,r=c}return r}function Ss(e,t){let s=null,a=Number.POSITIVE_INFINITY;for(let[o,n]of e){let r=(n.x-t.x)**2+(n.y-t.y)**2;if(r<a)a=r,s=o}return s}function om(e,t,s){let a=null;for(let[o,n]of t){let r=e.size(o);if(Math.abs(s.x-n.x)<=r.width/2&&Math.abs(s.y-n.y)<=r.height/2)a=o}return a}var lr="./GraphView-0t3t9mec.stx";var cr="http://www.w3.org/2000/svg",Cs=3,$s=350,dr=240,pr=6.2;function _(e,t={}){let s=document.createElementNS(cr,e);for(let a in t)s.setAttribute(a,String(t[a]));return s}var hr=0;class ur{root;callbacks;timings={layout:0,render:0};model=new ze;positions=new Map;shown=new Map;pinned=new Set;view={x:0,y:0,k:1};size={width:0,height:0};layoutName;direction;selected=null;autoFit=!0;animate;minZoom;maxZoom;contextMenu;prefix;surface;status;svg;stage;edgeLayer;nodeLayer;labelLayer;nodeEls=new Map;edgeEls=new Map;idOf=new WeakMap;offsets=new Map;serial=0;gesture=null;pinch=null;lastClick={id:"",at:0};lastExpand=0;frame=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.prefix=`${e.id||"graph"}-${++hr}`,this.layoutName=t.layout==="force"?"force":"layered",this.direction=t.direction==="TB"?"TB":"LR",this.minZoom=t.minZoom??0.1,this.maxZoom=t.maxZoom??4,this.contextMenu=Boolean(t.contextMenu),this.animate=t.animate!==!1,this.surface=e.querySelector('[data-gv="surface"]')??e,this.status=e.querySelector('[data-gv="status"]'),t.label)this.surface.setAttribute("aria-label",t.label);this.svg=_("svg",{class:"stx-gv-svg","aria-hidden":"false",focusable:"false"}),this.svg.__stx_inert_content=!0;let a=_("defs");for(let o of["arrow","arrow-active"]){let n=_("marker",{id:`${this.prefix}-${o}`,viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:7,markerHeight:7,orient:"auto-start-reverse",class:`stx-gv-${o}`});n.append(_("path",{d:"M 0 0 L 10 5 L 0 10 z"})),a.append(n)}if(this.stage=_("g",{class:"stx-gv-stage"}),this.edgeLayer=_("g",{class:"stx-gv-edges"}),this.nodeLayer=_("g",{class:"stx-gv-nodes"}),this.labelLayer=_("g",{class:"stx-gv-edge-labels"}),this.stage.append(this.edgeLayer,this.nodeLayer,this.labelLayer),this.svg.append(a,this.stage),this.surface.append(this.svg),this.listen(),this.measure(),this.setGraph(t.nodes??[],t.edges??[]),t.selected)this.select(t.selected,{silent:!0});if(typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{if(this.measure(),this.autoFit)this.fit()}),this.observer.observe(this.surface);e.setAttribute("data-gv-ready","")}graph(){return this.model}getViewport(){return{...this.view}}getLayout(){return this.layoutName}getSelected(){return this.selected}getPositions(){return Object.fromEntries([...this.positions].map(([e,t])=>[e,{...t}]))}setGraph(e,t){if(this.stop(),this.model=new ze(e??[],t??[]),this.positions=new Map,this.pinned.clear(),this.selected&&!this.model.has(this.selected))this.selected=null;this.layout(!1),this.shown=new Map(this.positions),this.render(),this.autoFit=!0,this.fit(),this.mark()}addNeighbours(e,t,s){let a=this.model.merge(t??[],s??[]);if(a.nodes.length===0&&a.edges.length===0)return a;let o=this.shown.get(e)??this.positions.get(e)??rt(this.view,{x:this.size.width/2,y:this.size.height/2});for(let n of a.nodes)this.shown.set(n,{...o});if(this.layout(!0),this.sync(),this.moveToPlace(),this.mark(),a.nodes.length)this.announce(`${a.nodes.length} ${a.nodes.length===1?"node":"nodes"} added${this.model.has(e)?` to ${oe(this.model.node(e))}`:""}`);return a}updateNode(e,t){if(!this.model.updateNode(e,t))return;let s=this.nodeEls.get(e);if(s)s.remove(),this.nodeEls.delete(e);this.sync(),this.draw(),this.mark()}setLayout(e){let t=e==="force"?"force":"layered";if(t===this.layoutName)return;this.layoutName=t,this.relayout(),this.callbacks.onLayout?.({layout:t})}setDirection(e){let t=e==="TB"?"TB":"LR";if(t===this.direction)return;if(this.direction=t,this.layoutName==="layered")this.relayout()}select(e,t={}){let s=e!=null&&this.model.has(e)?e:null;if(s===this.selected)return;if(this.selected=s,this.mark(),s)this.describe(s);if(!t.silent)this.callbacks.onSelect?.(this.selection())}focusNode(e){if(!this.model.has(e))return;this.select(e);let t=this.positions.get(e);if(t)this.autoFit=!1,this.setView(ws(this.view,t,this.size))}fit(){this.measure(),this.setView(vs(this.model.bounds(this.positions),this.size,32,this.minZoom,Math.min(1,this.maxZoom))),this.autoFit=!0}zoomIn(){this.zoomBy(1.25)}zoomOut(){this.zoomBy(0.8)}zoomBy(e,t){this.autoFit=!1,this.setView(bs(this.view,t??{x:this.size.width/2,y:this.size.height/2},e,this.minZoom,this.maxZoom))}panBy(e,t){this.autoFit=!1,this.setView(De(this.view,e,t))}setZoomLimits(e,t){this.minZoom=e,this.maxZoom=t}destroy(){this.stop(),this.observer?.disconnect();for(let e of this.disposers)e();this.svg.remove(),this.root.removeAttribute("data-gv-ready")}selection(){let e=this.selected?this.model.node(this.selected)??null:null;return{node:e,neighbours:e?this.model.neighbours(e.id).map((t)=>this.model.node(t)):[]}}measure(){let e=this.surface.getBoundingClientRect();this.size={width:e.width,height:e.height}}layout(e){let t=performance.now();if(this.layoutName==="layered")this.positions=gs(this.model,{direction:this.direction}).positions;else this.positions=fs(this.model,{positions:e&&this.positions.size?this.positions:null,pinned:e?this.pinned:null});this.timings.layout=performance.now()-t}relayout(){if(this.pinned.clear(),this.layout(!1),this.sync(),this.moveToPlace(),this.autoFit)this.fit()}render(){let e=performance.now();this.sync(),this.draw(),this.timings.render=performance.now()-e}sync(){let e=ps(this.model.metrics);for(let[t,s]of this.nodeEls)if(!this.model.has(t))s.remove(),this.nodeEls.delete(t);for(let t of this.model.nodes){let s=this.nodeEls.get(t.id);if(!s)s=this.buildNode(t,e),this.nodeEls.set(t.id,s),this.idOf.set(s,t.id),this.nodeLayer.append(s);let a=this.model.degree(t.id);s.setAttribute("aria-label",`${oe(t)}, ${a} ${a===1?"connection":"connections"}`)}for(let[t,s]of this.edgeEls)if(!this.model.edge(t))s.group.remove(),s.label?.remove(),this.edgeEls.delete(t);for(let t of this.model.edges)if(!this.edgeEls.has(t.id))this.edgeEls.set(t.id,this.buildEdge(t));this.offsets=ls(this.model.edges)}buildNode(e,t){let s=this.model.size(e.id),a=_("g",{class:"stx-gv-node",id:`${this.prefix}-node-${this.serial++}`,role:"group","data-node":e.id});if(e.kind)a.setAttribute("data-kind",e.kind);if(e.expandable===!0)a.setAttribute("data-expandable","");let o=_("title");o.textContent=e.detail?`${oe(e)}: ${e.detail}`:oe(e);let n=_("rect",{x:-s.width/2,y:-s.height/2,width:s.width,height:s.height,rx:6,ry:6}),r=e.expandable===!0?(this.model.metrics.charWidth+4)/2:0,i=_("text",{class:"stx-gv-node-label",x:-r,y:e.detail?-6:0,"text-anchor":"middle","dominant-baseline":"central"});if(i.textContent=Oe(oe(e),t),a.append(o,n,i),e.detail){let c=_("text",{class:"stx-gv-node-detail",x:-r,y:9,"text-anchor":"middle","dominant-baseline":"central"});c.textContent=Oe(e.detail,Math.floor(t/0.85)),a.append(c)}if(e.expandable===!0){let c=_("text",{class:"stx-gv-node-mark",x:s.width/2-10,y:0,"text-anchor":"middle","dominant-baseline":"central","aria-hidden":"true"});c.textContent="+",a.append(c)}return a}buildEdge(e){let t=_("g",{class:"stx-gv-edge","data-edge":e.id}),s=_("path",{fill:"none"});if(e.directed!==!1)s.setAttribute("marker-end",`url(#${this.prefix}-arrow)`);t.append(s),this.edgeLayer.append(t);let a=null;if(e.label){let o=Oe(String(e.label),32),n=Math.ceil(o.length*pr)+8;a=_("g",{class:"stx-gv-edge-label","data-edge":e.id});let r=_("rect",{x:-n/2,y:-8,width:n,height:16,rx:3,ry:3}),i=_("text",{"text-anchor":"middle","dominant-baseline":"central"});i.textContent=o,a.append(r,i),this.labelLayer.append(a)}return{group:t,path:s,label:a}}draw(){for(let[e,t]of this.nodeEls){let s=this.shown.get(e)??this.positions.get(e);if(s)t.setAttribute("transform",`translate(${s.x} ${s.y})`)}for(let e of this.model.edges)this.drawEdge(e)}shape(e){let t=this.shown.get(e.source)??this.positions.get(e.source),s=this.shown.get(e.target)??this.positions.get(e.target);if(!t||!s)return null;return is({source:t,sourceSize:this.model.size(e.source),target:s,targetSize:this.model.size(e.target)},{curve:this.layoutName==="layered"?"bezier":"straight",direction:this.direction,offset:this.offsets.get(e.id)??0,inset:e.directed!==!1?1:0})}drawEdge(e){let t=this.edgeEls.get(e.id),s=t&&this.shape(e);if(!t||!s)return;t.path.setAttribute("d",s.d),t.label?.setAttribute("transform",`translate(${Math.round(s.label.x*10)/10} ${Math.round(s.label.y*10)/10})`)}moveToPlace(){this.stop();let e=typeof matchMedia==="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!this.animate||e||typeof requestAnimationFrame!=="function"){this.shown=new Map(this.positions),this.draw();return}let t=new Map;for(let[o,n]of this.positions)t.set(o,this.shown.get(o)??n);let s=performance.now(),a=(o)=>{let n=Math.min(1,(o-s)/dr),r=1-(1-n)**3;for(let[i,c]of this.positions){let l=t.get(i);this.shown.set(i,{x:l.x+(c.x-l.x)*r,y:l.y+(c.y-l.y)*r})}if(this.draw(),this.frame=n<1?requestAnimationFrame(a):0,n>=1)this.shown=new Map(this.positions)};this.frame=requestAnimationFrame(a)}stop(){if(this.frame)cancelAnimationFrame(this.frame);this.frame=0}setView(e){this.view=e,this.stage.setAttribute("transform",`translate(${e.x} ${e.y}) scale(${e.k})`),this.callbacks.onViewport?.({...e})}mark(){let e=this.selected,t=new Set(e?this.model.neighbours(e):[]);this.root.toggleAttribute("data-has-selection",Boolean(e));for(let[a,o]of this.nodeEls)if(o.toggleAttribute("data-selected",a===e),o.toggleAttribute("data-neighbour",t.has(a)),a===e)o.setAttribute("aria-current","true");else o.removeAttribute("aria-current");for(let a of this.model.edges){let o=this.edgeEls.get(a.id);if(!o)continue;let n=e!=null&&(a.source===e||a.target===e);if(o.group.toggleAttribute("data-active",n),o.label?.toggleAttribute("data-active",n),a.directed!==!1)o.path.setAttribute("marker-end",`url(#${this.prefix}-${n?"arrow-active":"arrow"})`)}let s=e?this.nodeEls.get(e):null;if(s)this.surface.setAttribute("aria-activedescendant",s.id);else this.surface.removeAttribute("aria-activedescendant")}describe(e){let t=this.model.node(e);if(!t)return;let s=this.model.neighbours(e).map((n)=>oe(this.model.node(n))),a=s.slice(0,5).join(", "),o=s.length>5?` and ${s.length-5} more`:"";this.announce(s.length===0?`${oe(t)}, no connections`:`${oe(t)}, ${s.length} ${s.length===1?"connection":"connections"}: ${a}${o}`)}announce(e){if(this.status)this.status.textContent=e}expand(e,t=!1){let s=this.model.node(e);if(!s)return;if(this.lastExpand=performance.now(),t||s.expandable===!1)this.callbacks.onOpen?.({node:s});else this.callbacks.onExpand?.({node:s})}nodeUnder(e){let t=e instanceof Element?e.closest(".stx-gv-node"):null;return t?this.idOf.get(t)??null:null}local(e){let t=this.surface.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}listen(){let e=(s,a,o)=>{this.surface.addEventListener(s,a,o),this.disposers.push(()=>this.surface.removeEventListener(s,a,o))};e("pointerdown",(s)=>this.onPointerDown(s)),e("pointermove",(s)=>this.onPointerMove(s)),e("pointerup",(s)=>this.onPointerUp(s)),e("pointercancel",()=>this.endGesture()),e("dblclick",(s)=>{let a=this.nodeUnder(s.target);if(a&&performance.now()-this.lastExpand>$s)this.expand(a,s.metaKey||s.ctrlKey)}),e("wheel",(s)=>this.onWheel(s),{passive:!1}),e("keydown",(s)=>this.onKeyDown(s)),e("contextmenu",(s)=>{if(this.contextMenu)s.preventDefault();let a=this.nodeUnder(s.target);if(a)this.select(a);this.callbacks.onContext?.({node:a?this.model.node(a):null,x:s.clientX,y:s.clientY})});let t=(s,a)=>{this.surface.addEventListener(s,a),this.disposers.push(()=>this.surface.removeEventListener(s,a))};t("gesturestart",(s)=>{s.preventDefault();let a=this.local(s);this.pinch={k:this.view.k,x:a.x,y:a.y}}),t("gesturechange",(s)=>{if(!this.pinch)return;s.preventDefault(),this.zoomBy(this.pinch.k*s.scale/this.view.k,{x:this.pinch.x,y:this.pinch.y})}),t("gestureend",()=>{this.pinch=null})}onPointerDown(e){if(e.button!==0)return;let t=this.nodeUnder(e.target);this.surface.focus({preventScroll:!0});try{this.surface.setPointerCapture(e.pointerId)}catch{}this.gesture={pointer:e.pointerId,node:t,startX:e.clientX,startY:e.clientY,origin:t?{...this.positions.get(t)??{x:0,y:0}}:{x:0,y:0},view:{...this.view},moved:!1}}onPointerMove(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;let s=e.clientX-t.startX,a=e.clientY-t.startY;if(!t.moved){if(Math.abs(s)<Cs&&Math.abs(a)<Cs)return;t.moved=!0,this.stop(),this.shown=new Map(this.positions),this.root.setAttribute("data-dragging",t.node?"node":"pan")}if(t.node){let o={x:t.origin.x+s/this.view.k,y:t.origin.y+a/this.view.k};this.positions.set(t.node,o),this.shown.set(t.node,o),this.nodeEls.get(t.node)?.setAttribute("transform",`translate(${o.x} ${o.y})`);for(let n of this.model.edgesOf(t.node))this.drawEdge(n)}else this.autoFit=!1,this.setView(De(t.view,s,a))}onPointerUp(e){let t=this.gesture;if(!t||e.pointerId!==t.pointer)return;if(this.endGesture(),t.moved){if(t.node){this.pinned.add(t.node),this.autoFit=!1;let o=this.positions.get(t.node);this.callbacks.onMove?.({node:this.model.node(t.node),x:o.x,y:o.y})}return}if(!t.node){this.select(null);return}let s=performance.now(),a=this.lastClick.id===t.node&&s-this.lastClick.at<$s;if(this.lastClick=a?{id:"",at:0}:{id:t.node,at:s},this.select(t.node),a)this.expand(t.node,e.metaKey||e.ctrlKey)}endGesture(){let e=this.gesture;if(this.gesture=null,this.root.removeAttribute("data-dragging"),e)try{this.surface.releasePointerCapture(e.pointer)}catch{}}onWheel(e){if(e.preventDefault(),e.ctrlKey||e.metaKey){this.zoomBy(Math.exp(-e.deltaY*(e.deltaMode===1?0.05:0.01)),this.local(e));return}let t=e.deltaMode===1?16:1;this.panBy(-e.deltaX*t,-e.deltaY*t)}onKeyDown(e){let s={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"}[e.key];if(s){e.preventDefault();let o=this.selected?ks(this.positions,this.selected,s):Ss(this.positions,rt(this.view,{x:this.size.width/2,y:this.size.height/2}));if(o)this.select(o),this.bringIntoView(o);return}let a=e.metaKey||e.ctrlKey;if(e.key==="Enter"||e.key===" "){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,a)}else if(a||e.altKey);else if(e.key==="+"||e.key==="=")e.preventDefault(),this.zoomIn();else if(e.key==="-"||e.key==="_")e.preventDefault(),this.zoomOut();else if(e.key==="0")e.preventDefault(),this.fit();else if(e.key==="f"||e.key==="F"){if(!this.selected)return;e.preventDefault(),this.focusNode(this.selected)}else if(e.key==="o"||e.key==="O"){if(!this.selected)return;e.preventDefault(),this.expand(this.selected,!0)}else if(e.key==="Escape"&&this.selected)e.preventDefault(),this.select(null)}bringIntoView(e){let t=this.positions.get(e);if(!t)return;let s=this.model.size(e),a=ys(this.view,{x:t.x-s.width/2,y:t.y-s.height/2,width:s.width,height:s.height},this.size);if(a!==this.view)this.autoFit=!1,this.setView(a)}}var mr="./GroupedList-j3sxv5pb.stx";var xr="./GroupedListRow-v52zmzpk.stx";var vr="./Image-6x38ddd7.stx";var yr="./EmailInput-sf9jfrgz.stx";var Sr="./NumberInput-e2afxyh3.stx";var $r="./PasswordInput-z2g5ha65.stx";var Er="./SearchInput-w15r5t95.stx";var Ar="./TextInput-m4a4kpfy.stx";var Pr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string},Mr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,leftIcon:f.string,rightIcon:f.string,clearable:f.boolean,maxLength:f.number,showCount:f.boolean,type:f.oneOf(["text","date","time","datetime-local","month","week","url","tel","color","search","email","number","password"]),pattern:f.string,list:f.string,minLength:f.number,htmlSize:f.number,autofocus:f.boolean},Rr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,min:f.number,max:f.number,step:f.number,showControls:f.boolean},Nr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,showStrength:f.boolean},Lr={value:f.string,onChange:f.func,placeholder:f.string,disabled:f.boolean,readonly:f.boolean,size:f.oneOf(["sm","md","lg"]),error:f.boolean,label:f.string,helperText:f.string,required:f.boolean,className:f.string,inputClassName:f.string,onSearch:f.func,loading:f.boolean},Em=se("TextInput",Mr),Im=se("EmailInput",Pr),Am=se("PasswordInput",Nr),Pm=se("NumberInput",Rr),Mm=se("SearchInput",Lr);var Or=new Set(["array","set"]),zr=/^[A-Z_$][\w$]*$/i;function ct(e){return Or.has(e.kind)}function it(e){return e.ref===void 0&&(e.children!==void 0&&e.children.length>0||(e.more??0)>0)}function dt(e,t="$"){let s=t;for(let a of e)if(typeof a==="number")s+=`[${a}]`;else if(zr.test(a))s+=`.${a}`;else s+=`[${JSON.stringify(a)}]`;return s}function lt(e){if(e.ref!==void 0)return"[Circular]";if(e.children){if(ct(e))return e.children.map((s)=>lt(s));let t={};return e.children.forEach((s,a)=>{t[s.key!==void 0?String(s.key):s.label??String(a)]=lt(s)}),t}if("value"in e){let t=e.value;if(typeof t==="bigint")return t.toString();if(typeof t==="number"&&!Number.isFinite(t))return String(t);if(typeof t==="function"||typeof t==="symbol")return e.preview??String(t);return t}return e.preview??null}function Es(e,t=2){let s=lt(e);return s===void 0?"undefined":JSON.stringify(s,null,t)}var Ts=80;function pt(e){if(e.preview!==void 0)return e.preview;if(e.ref!==void 0)return"[Circular]";if(e.children||e.more){let t=(e.children?.length??0)+(e.more??0);if(ct(e))return`${e.kind==="set"?"Set":"Array"}(${t})`;return t===0?"{}":`{${t}}`}if("value"in e){let t=e.value;if(typeof t==="string")return JSON.stringify(t.length>Ts?`${t.slice(0,Ts)}\u2026`:t);if(typeof t==="bigint")return`${t}n`;return String(t)}return e.kind}function Hm(e,t,s={}){let a=s.maxItems??1000,o=s.maxDepth??32,n=new Map,r=1,i=(l,d)=>{if(d!==void 0)l.label=d;return l},c=(l,d,h)=>{if(l===null)return i({kind:"null",value:null,preview:"null"},d);switch(typeof l){case"undefined":return i({kind:"undefined",value:void 0,preview:"undefined"},d);case"string":case"number":case"boolean":case"bigint":return i({kind:typeof l,value:l},d);case"symbol":return i({kind:"symbol",preview:l.toString()},d);case"function":return i({kind:"function",preview:`\u0192 ${l.name||"(anonymous)"}()`},d)}let p=l,u=n.get(p);if(u!==void 0)return i({kind:"ref",ref:u},d);if(p instanceof Date)return i({kind:"date",value:Number.isNaN(p.getTime())?null:p.toISOString(),preview:Number.isNaN(p.getTime())?"Invalid Date":p.toISOString()},d);if(p instanceof RegExp)return i({kind:"regexp",value:p.toString(),preview:p.toString()},d);let g=`v${r++}`;n.set(p,g);let m=Array.isArray(p),w=p instanceof Set,y=p instanceof Map,v=i({id:g,kind:m?"array":w?"set":y?"map":"object",children:[]},d);if(h>=o)return v.preview=m?"Array":"Object",delete v.children,v;let b=v.children,C=0;if(m||w)for(let P of p){if(C<a)b.push(c(P,String(C),h+1));C++}else if(y)for(let[P,T]of p){if(C<a)b.push(c(T,typeof P==="string"?P:pt(c(P,void 0,o)),h+1));C++}else{for(let T of Object.keys(p)){if(C<a)b.push(c(p[T],T,h+1));C++}let P=p.constructor?.name;if(P&&P!=="Object")v.preview=`${P} {${C}}`}if(C>b.length)v.more=C-b.length;if(y)v.preview=`Map(${C})`;return v};return c(e,t,0)}class ht{rows=[];version=0;roots=[];depth;opened=new Set;closed=new Set;index=null;constructor(e,t={}){this.depth=t.depth??1,this.setValue(e)}setValue(e){this.roots=e==null?[]:Array.isArray(e)?e:[e],this.opened.clear(),this.closed.clear(),this.flatten()}setDepth(e){this.depth=e,this.opened.clear(),this.closed.clear(),this.flatten()}getRoots(){return this.roots}indexOf(e){if(!this.index){this.index=new Map;for(let t=0;t<this.rows.length;t++)this.index.set(this.rows[t].id,t)}return this.index.get(e)??-1}pathOf(e){let t=[];for(let s=e;s>=0;s=this.rows[s].parent){let a=this.rows[s];if(a.isMore)continue;if(a.parent!==-1||this.roots.length>1)t.push(a.key)}return t.reverse()}isExpanded(e,t){return this.opened.has(e)||t<this.depth&&!this.closed.has(e)}expand(e){return this.set(e,!0)}collapse(e){return this.set(e,!1)}toggle(e){let t=this.indexOf(e);if(t===-1)return!1;return this.set(e,!this.rows[t].expanded)}expandAll(e){let t=(s,a,o)=>{if(!it(s))return;if(o>=this.depth)this.opened.add(a);this.closed.delete(a),s.children?.forEach((n,r)=>t(n,n.id??`${a}.${r}`,o+1))};if(e===void 0)this.roots.forEach((s,a)=>t(s,s.id??String(a),0));else{let s=this.find(e);if(!s)return;t(s.node,e,s.ancestors.length)}this.flatten()}collapseAll(){this.opened.clear(),this.closed.clear();let e=(t,s,a)=>{if(a>=this.depth||!it(t))return;this.closed.add(s),t.children?.forEach((o,n)=>e(o,o.id??`${s}.${n}`,a+1))};this.roots.forEach((t,s)=>e(t,t.id??String(s),0)),this.flatten()}reveal(e){let t=this.find(e);if(!t)return-1;return t.ancestors.forEach((s,a)=>{if(this.closed.delete(s),a>=this.depth)this.opened.add(s)}),this.flatten(),this.indexOf(e)}appendChildren(e,t,s=0){let a=this.find(e);if(!a)return!1;let o=a.node;if(o.children=[...o.children??[],...t],s>0)o.more=s;else delete o.more;return this.flatten(),!0}move(e,t,s=10){let a=this.rows.length-1;if(a<0)return{index:-1,changed:!1};let o=Math.min(Math.max(e,0),a),n=this.rows[o],r=(i)=>({index:Math.min(Math.max(i,0),a),changed:!1});switch(t){case"ArrowDown":return r(e<0?0:o+1);case"ArrowUp":return r(o-1);case"Home":return r(0);case"End":return r(a);case"PageDown":return r(o+s);case"PageUp":return r(o-s);case"ArrowRight":if(!n.expandable||n.isMore)return r(o);if(!n.expanded)return{index:o,changed:this.expand(n.id)};return r(o+1);case"ArrowLeft":if(n.expanded&&!n.isMore)return{index:o,changed:this.collapse(n.id)};return r(n.parent===-1?o:n.parent);case"*":{let i=!1,c=n.parent,l=this.rows.filter((d)=>d.parent===c&&d.depth===n.depth&&d.expandable&&!d.expanded&&!d.isMore);for(let d of l)this.mark(d.id,d.depth,!0),i=!0;if(i)this.flatten();return{index:this.indexOf(n.id),changed:i}}}return r(o)}typeahead(e,t){let s=t.toLowerCase(),a=this.rows.length;if(s===""||a===0)return-1;let o=s.length===1?e+1:Math.max(e,0);for(let n=0;n<a;n++){let r=(o+n+a)%a,i=this.rows[r];if(!i.isMore&&(i.node.label??"").toLowerCase().startsWith(s))return r}return-1}set(e,t){let s=this.indexOf(e);if(s===-1)return!1;let a=this.rows[s];if(!a.expandable||a.isMore||a.expanded===t)return!1;return this.mark(e,a.depth,t),this.flatten(),!0}mark(e,t,s){if(s){if(this.closed.delete(e),t>=this.depth)this.opened.add(e)}else if(this.opened.delete(e),t<this.depth)this.closed.add(e)}find(e){let t=[];for(let s=this.roots.length-1;s>=0;s--)t.push({node:this.roots[s],id:this.roots[s].id??String(s),ancestors:[]});while(t.length>0){let s=t.pop();if(s.id===e)return{node:s.node,ancestors:s.ancestors};let a=s.node.children;if(!a||s.node.ref!==void 0)continue;let o=[...s.ancestors,s.id];for(let n=a.length-1;n>=0;n--)t.push({node:a[n],id:a[n].id??`${s.id}.${n}`,ancestors:o})}return null}flatten(){let e=[],t=(s,a,o,n,r,i,c)=>{let l=it(s),d=l&&this.isExpanded(a,o),h=e.length;if(e.push({id:a,node:s,depth:o,key:r,parent:n,expandable:l,expanded:d,posInSet:i,setSize:c,isMore:!1}),!d)return;let p=s.children??[],u=s.more??0,g=ct(s),m=p.length+(u>0?1:0);for(let w=0;w<p.length;w++){let y=p[w];t(y,y.id??`${a}.${w}`,o+1,h,y.key??(g?w:y.label??w),w+1,m)}if(u>0)e.push({id:`${a}.+`,node:s,depth:o+1,key:"",parent:h,expandable:!1,expanded:!1,posInSet:m,setSize:m,isMore:!0})};this.roots.forEach((s,a)=>t(s,s.id??String(a),0,-1,s.key??a,a+1,this.roots.length)),this.rows=e,this.index=null,this.version++}}var Hr="./JsonTree-satc4010.stx";var Ps=new Set(["array","object","map","set","model","error"]);function jr(e){return e.t==="object"||e.t==="model"}function Is(e){return e.length>0&&e.slice(0,20).every(jr)}function As(e){return e.some((t)=>Ps.has(t.t))}function ut(e,t){let s=e.length>120?`${e.slice(0,120)}\u2026`:e;return t?`${JSON.stringify(s)} (${t} more characters)`:JSON.stringify(s)}function Vr(e){if(!e.file)return"";return[e.file,e.line,e.column].filter((t)=>t!==void 0).join(":")}function Fm(e,t,s={}){let a=s.idPrefix??"t",o=(l)=>`${a}${l}`,n=(l,d)=>{if(d!==void 0)l.label=d;return l},r=(l)=>c(l,void 0).preview??l.t,i=(l,d)=>{if(d.length>0)l.openable=d.length===1?d[0]:d;return l};function c(l,d){switch(l.t){case"undefined":return n({kind:"undefined",value:void 0,preview:"undefined"},d);case"null":return n({kind:"null",value:null,preview:"null"},d);case"boolean":return n({kind:"boolean",value:l.v,preview:String(l.v)},d);case"number":{let h=typeof l.v==="number"?l.v:l.v==="-0"?-0:Number(l.v);return n({kind:"number",value:h,preview:String(l.v)},d)}case"bigint":return n({kind:"bigint",value:l.v,preview:`${l.v}n`},d);case"string":return n({kind:"string",value:l.v,preview:ut(l.v,l.truncated)},d);case"symbol":return n({kind:"symbol",preview:`Symbol(${l.v})`},d);case"function":{let h=l.kind==="class"?`class ${l.name}`:`${l.kind==="async"?"async ":""}\u0192${l.kind==="generator"?"*":""} ${l.name}()`;return n({kind:"function",preview:h},d)}case"date":return n({kind:"date",value:l.v,preview:l.v??"Invalid Date"},d);case"regexp":return n({kind:"regexp",value:l.v,preview:l.v},d);case"url":return n({kind:"url",value:l.v,preview:l.v},d);case"promise":return n({kind:"promise",preview:"Promise"},d);case"bytes":{let h=l.length*2>l.hex.length;return n({kind:"bytes",value:l.hex,preview:`${l.ctor}(${l.length}) <${l.hex}${h?"\u2026":""}>`},d)}case"ref":return n({kind:"ref",ref:o(l.id),preview:"[Circular]"},d);case"cut":return n({kind:"cut",preview:`${l.ctor??"Object"} \u2026 (${l.reason==="depth"?"too deep to show":"result too large to show"})`},d);case"array":{let h={id:o(l.id),kind:"array",preview:`${l.ctor??"Array"}(${l.length})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(i(h,Is(l.items)?["table"]:[]),d)}case"set":{let h={id:o(l.id),kind:"set",preview:`Set(${l.size})`,children:l.items.map((p,u)=>c(p,String(u)))};if(l.more)h.more=l.more;return n(i(h,Is(l.items)?["table"]:[]),d)}case"object":{let h=l.entries.slice(0,5).map(([m])=>m).join(", "),p=l.entries.length+(l.more??0),u=p===0?"{}":`{${h}${p>5?", \u2026":""}}`,g={id:o(l.id),kind:"object",preview:l.ctor&&l.ctor!=="Object"?`${l.ctor} ${u}`:u,children:l.entries.map(([m,w])=>c(w,m))};if(l.more)g.more=l.more;return n(i(g,As(l.entries.map((m)=>m[1]))?["graph"]:[]),d)}case"map":{let h={id:o(l.id),kind:"map",preview:`Map(${l.size})`,children:l.entries.map(([p,u],g)=>{if(!Ps.has(p.t)){let m=c(u,r(p));return m.key=p.t==="string"?p.v:r(p),m}return{kind:"entry",label:String(g),key:g,preview:`${r(p)} => ${r(u)}`,children:[c(p,"key"),c(u,"value")]}})};if(l.more)h.more=l.more;return n(i(h,As(l.entries.map((p)=>p[1]))?["graph"]:[]),d)}case"model":{let h=l.attributes.map(([g,m])=>c(m,g));for(let[g,m]of l.loaded??[]){let w=c(m,g);w.meta=w.meta??{relation:!0},h.push(w)}if(l.hidden?.length)h.push({kind:"hidden",label:"[hidden]",key:"[hidden]",preview:l.hidden.join(", "),children:l.hidden.map((g,m)=>({kind:"hidden",label:String(m),value:g,preview:g}))});if(l.relations?.length)h.push({kind:"relations",label:"[relations]",key:"[relations]",preview:`${l.relations.length} declared`,children:l.relations.map((g)=>({kind:"relation",label:g.name??g.model,value:g,preview:`${g.kind} ${g.model}`}))});let p={model:l.model,hidden:l.hidden??[],relations:l.relations??[]};if(l.table)p.table=l.table;if(l.primaryKey)p.primaryKey=l.primaryKey;let u={id:o(l.id),kind:"model",preview:l.key?`${l.model} #${r(l.key).replace(/^"|"$/g,"")}`:l.model,children:h,meta:p};if(l.more)u.more=l.more;return n(i(u,["graph"]),d)}case"html":{let h={kind:l.kind};if(l.title)h.title=l.title;if(l.text)h.text=l.text;if(l.truncated)h.truncated=l.truncated;let p=l.truncated?`, ${l.truncated} more cut`:"",u=l.title?`: ${l.title}`:"";return n(i({kind:"html",value:l.html,preview:`${l.kind}${u} (${l.html.length} characters${p})`,meta:h},["preview"]),d)}case"error":{let h=[{kind:"string",label:"message",value:l.message,preview:ut(l.message)}];if(l.frames?.length)h.push({kind:"stack",label:"stack",preview:`${l.frames.length} frames`,value:l.stack,children:l.frames.map((p,u)=>({kind:"frame",label:String(u),value:p,preview:[p.function,Vr(p)].filter(Boolean).join(" at ")||"(unknown)",meta:p}))});else if(l.stack)h.push({kind:"string",label:"stack",value:l.stack,preview:ut(l.stack)});if(l.cause)h.push(c(l.cause,"cause"));for(let[p,u]of l.entries??[])h.push(c(u,p));return n({kind:"error",preview:l.message?`${l.name}: ${l.message}`:l.name,children:h},d)}}return n({kind:"unknown",preview:String(l.t??"unknown")},d)}return c(e,t)}var Fr=600,Ms=400,Rs={table:"Table",graph:"Graph",preview:"Preview"};function Ns(e){return e.length>Ms?`${e.slice(0,Ms)}\u2026`:e}function Ls(e){if(e==null||e==="")return[];return Array.isArray(e)?e:[e]}class Br{root;callbacks;model;scroller;content;rowsEl;status;prefix;rowHeight;overscan;openable;contextMenu;pool=[];parts=new WeakMap;active=-1;activeId="";typed="";typedAt=0;observer=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;let a=(n)=>e.querySelector(`[data-jt="${n}"]`);this.scroller=a("scroller")??e,this.content=a("content")??this.scroller,this.rowsEl=a("rows")??this.content,this.status=a("status"),this.prefix=`${e.id||`json-tree-${Math.random().toString(36).slice(2,8)}`}-row-`,this.rowHeight=t.rowHeight&&t.rowHeight>0?t.rowHeight:22,this.overscan=t.overscan??6,this.openable=t.openable??null,this.contextMenu=Boolean(t.contextMenu),this.model=new ht(t.value,{depth:t.depth??1}),this.rowsEl.__stx_inert_content=!0,e.style.setProperty("--stx-tree-row-height",`${this.rowHeight}px`);let o=(n,r,i,c)=>{n.addEventListener(r,i,c),this.disposers.push(()=>n.removeEventListener(r,i,c))};if(o(this.scroller,"scroll",()=>this.render(),{passive:!0}),o(this.scroller,"keydown",(n)=>this.onKeyDown(n)),o(this.scroller,"focus",()=>{if(this.active===-1&&this.model.rows.length>0)this.setActive(0,!1)}),o(this.rowsEl,"mousedown",(n)=>{if(n.target.closest("[data-jt-action]"))n.preventDefault()}),o(this.rowsEl,"click",(n)=>this.onClick(n)),o(this.rowsEl,"dblclick",(n)=>this.onDoubleClick(n)),o(this.rowsEl,"contextmenu",(n)=>this.onContextMenu(n)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.render()),this.observer.observe(this.scroller);this.render(),e.setAttribute("data-jt-ready","")}setValue(e){this.model.setValue(e),this.active=-1,this.activeId="",this.scroller.scrollTop=0,this.render()}setDepth(e){this.model.setDepth(e),this.afterChange()}setOpenable(e){this.openable=e??null,this.model.version++,this.render()}setContextMenu(e){this.contextMenu=e}expandAll(e){this.model.expandAll(e),this.afterChange()}collapseAll(){this.model.collapseAll(),this.afterChange()}expand(e){let t=this.model.expand(e);if(t)this.afterChange();return t}collapse(e){let t=this.model.collapse(e);if(t)this.afterChange();return t}reveal(e){let t=this.model.reveal(e);if(t===-1)return this.afterChange(),!1;return this.active=t,this.activeId=e,this.scrollToRow(t),this.render(),this.emitSelect(),!0}appendChildren(e,t,s=0){let a=this.model.appendChildren(e,t,s);if(a)this.afterChange();return a}getSelected(){return this.active===-1?null:this.detail(this.active)}select(e){let t=this.model.indexOf(e);if(t===-1)return!1;return this.setActive(t,!0),!0}focus(){this.scroller.focus()}get drawn(){return this.pool.filter((e)=>e.style.display!=="none").length}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();this.rowsEl.textContent="",this.pool=[],this.root.removeAttribute("data-jt-ready")}afterChange(){if(this.activeId){let e=this.model.indexOf(this.activeId);if(this.active=e,e===-1)this.activeId=""}this.render()}detail(e){let t=this.model.rows[e],s=this.model.pathOf(e);return{id:t.id,node:t.node,path:s,pathText:dt(s)}}emitSelect(){if(this.active!==-1)this.callbacks.onSelect?.(this.detail(this.active))}setActive(e,t){if(e<0||e>=this.model.rows.length)return;let s=e!==this.active;if(this.active=e,this.activeId=this.model.rows[e].id,t)this.scrollToRow(e);if(this.render(),s)this.emitSelect()}scrollToRow(e){let t=e*this.rowHeight,s=this.scroller.clientHeight;if(t<this.scroller.scrollTop)this.scroller.scrollTop=t;else if(t+this.rowHeight>this.scroller.scrollTop+s)this.scroller.scrollTop=t+this.rowHeight-s}pageSize(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.rowHeight)-1)}createRow(){let e=document.createElement("div");e.setAttribute("role","treeitem"),e.className="stx-jt-row";let t=(a,o)=>{let n=document.createElement("span");if(n.className=a,o)n.setAttribute("aria-hidden","true");return e.appendChild(n),n},s={twisty:t("stx-jt-twisty",!0),label:t("stx-jt-label",!1),separator:t("stx-jt-separator",!0),preview:t("stx-jt-preview",!1),actions:t("stx-jt-actions",!1)};return s.separator.textContent=": ",this.parts.set(e,s),this.rowsEl.appendChild(e),e}button(e,t,s,a){let o=document.createElement("button");if(o.type="button",o.tabIndex=-1,o.className="stx-jt-action",o.setAttribute("data-jt-action",e),a)o.setAttribute("data-jt-as",a);return o.setAttribute("aria-label",s),o.textContent=t,o}opensOf(e,t){if(e.isMore)return[];if(this.openable){let s=this.openable(e.node,this.model.pathOf(t));if(s!==void 0)return Ls(s)}return Ls(e.node.openable)}render(){let e=this.model.rows,t=e.length,s=this.scroller.clientHeight;this.content.style.height=`${t*this.rowHeight}px`;let a=Math.max(0,Math.min(this.scroller.scrollTop,t*this.rowHeight-s)),o=Math.max(0,Math.floor(a/this.rowHeight)-this.overscan),n=Math.min(t,Math.ceil((a+s)/this.rowHeight)+this.overscan),r=Math.max(0,n-o);while(this.pool.length<r)this.pool.push(this.createRow());let i=this.pool.length,c=new Uint8Array(i);for(let d=o;d<n;d++){let h=d%i;c[h]=1,this.paint(this.pool[h],e[d],d)}for(let d=0;d<i;d++)if(!c[d]&&this.pool[d].style.display!=="none")this.pool[d].style.display="none",this.pool[d].__jt=void 0,this.pool[d].removeAttribute("id");if(this.active>=o&&this.active<n)this.scroller.setAttribute("aria-activedescendant",this.prefix+this.active);else this.scroller.removeAttribute("aria-activedescendant")}paint(e,t,s){let a=this.model.version,o=s===this.active,n=e.__jt;if(!n||n.index!==s||n.version!==a){let r=this.parts.get(e),i=t.node;if(e.style.display="",e.style.transform=`translateY(${s*this.rowHeight}px)`,e.style.setProperty("--stx-tree-depth",String(t.depth)),e.id=this.prefix+s,e.setAttribute("data-jt-index",String(s)),e.setAttribute("aria-level",String(t.depth+1)),e.setAttribute("aria-posinset",String(t.posInSet)),e.setAttribute("aria-setsize",String(t.setSize)),t.expandable)e.setAttribute("aria-expanded",t.expanded?"true":"false");else e.removeAttribute("aria-expanded");if(t.isMore)e.setAttribute("data-kind","more"),r.twisty.textContent="",r.label.textContent="",r.separator.style.display="none",r.preview.textContent=`\u2026 ${i.more} more`,r.preview.setAttribute("data-kind","more");else{e.setAttribute("data-kind",i.kind),r.twisty.textContent=t.expandable?t.expanded?"\u25BE":"\u25B8":"";let d=i.label??(typeof t.key==="number"&&t.parent!==-1?String(t.key):"");r.label.textContent=Ns(d),r.separator.style.display=d===""?"none":"",r.preview.textContent=Ns(pt(i)),r.preview.setAttribute("data-kind",i.kind)}let c=this.opensOf(t,s),l=t.isMore?"+":c.join("|");if(!n||n.opens!==l)if(r.actions.textContent="",t.isMore)r.actions.appendChild(this.button("more","Load","Load more"));else{for(let d of c)r.actions.appendChild(this.button("open",Rs[d]??d,`Open as ${Rs[d]?.toLowerCase()??d}`,d));r.actions.appendChild(this.button("copy-value","Copy","Copy value")),r.actions.appendChild(this.button("copy-path","Path","Copy path"))}e.__jt={index:s,version:a,opens:l}}if(o)e.setAttribute("aria-selected","true"),e.setAttribute("data-active","");else e.setAttribute("aria-selected","false"),e.removeAttribute("data-active")}rowIndexOf(e){let t=e instanceof Element?e.closest("[data-jt-index]"):null;if(!t||t.style.display==="none")return-1;return Number(t.getAttribute("data-jt-index"))}say(e){if(this.status)this.status.textContent=e}toggleRow(e){let t=this.model.rows[e];if(!t)return;if(t.isMore){this.loadMore(e);return}if(t.node.ref!==void 0){this.follow(e);return}if(!t.expandable)return;let s=t.id;this.model.toggle(s),this.afterChange();let a=this.model.indexOf(s);if(a!==-1)this.callbacks.onToggle?.({...this.detail(a),expanded:this.model.rows[a].expanded})}follow(e){let t=this.model.rows[e].node.ref;if(t===void 0)return;if(!this.reveal(t))this.say("The value this points back to is not part of what was sent.")}loadMore(e){let s=this.model.rows[e].parent;if(s===-1)return;this.callbacks.onLoadMore?.(this.detail(s))}copy(e,t){let s=this.model.rows[e];if(!s)return;let a=s.isMore?s.parent:e,o=this.model.pathOf(a),n=this.model.rows[a].node,r=t==="path"?dt(o):Es(n);try{navigator.clipboard?.writeText(r)?.catch(()=>{})}catch{}this.say(t==="path"?`Copied path ${r}`:"Copied value"),this.callbacks.onCopy?.({what:t,text:r,path:o,node:n})}open(e,t){let s=this.model.rows[e];if(!s||s.isMore)return;let a=t??this.opensOf(s,e)[0];if(a===void 0)return;this.callbacks.onOpen?.({...this.detail(e),as:a})}onClick(e){let t=this.rowIndexOf(e.target);if(t===-1)return;let s=e.target instanceof Element?e.target.closest("[data-jt-action]"):null;if(this.setActive(t,!1),s){let o=s.getAttribute("data-jt-action");if(o==="copy-value")this.copy(t,"value");else if(o==="copy-path")this.copy(t,"path");else if(o==="open")this.open(t,s.getAttribute("data-jt-as")??void 0);else if(o==="more")this.loadMore(t);return}let a=this.model.rows[t];if(a.expandable||a.isMore||a.node.ref!==void 0)this.toggleRow(t)}onDoubleClick(e){let t=this.rowIndexOf(e.target);if(t===-1||e.target instanceof Element&&e.target.closest("[data-jt-action]"))return;let s=this.model.rows[t];if(!s.expandable&&!s.isMore&&s.node.ref===void 0)this.open(t)}onContextMenu(e){let t=this.rowIndexOf(e.target);if(t===-1)return;if(this.setActive(t,!1),this.contextMenu)e.preventDefault();this.callbacks.onContext?.({...this.detail(t),x:e.clientX,y:e.clientY})}onKeyDown(e){let t=this.model.rows;if(t.length===0)return;let s=e.metaKey||e.ctrlKey,a=e.key;if(s&&(a==="c"||a==="C")){if(this.active===-1)return;e.preventDefault(),this.copy(this.active,e.shiftKey?"path":"value");return}if(s||e.altKey)return;if(a==="Enter"&&e.shiftKey){if(e.preventDefault(),this.active!==-1)this.open(this.active);return}let o=this.typed!==""&&Date.now()-this.typedAt<=Fr;if(a==="Enter"||a===" "&&!o){if(e.preventDefault(),this.active!==-1)this.toggleRow(this.active);return}if(a==="ArrowDown"||a==="ArrowUp"||a==="ArrowLeft"||a==="ArrowRight"||a==="Home"||a==="End"||a==="PageDown"||a==="PageUp"||a==="*"){e.preventDefault(),this.typed="";let n=this.active===-1?null:t[this.active],r=n?.expanded,i=this.model.move(this.active,a,this.pageSize());if(i.changed){if(this.active=i.index,this.activeId=this.model.rows[i.index]?.id??"",this.scrollToRow(i.index),this.render(),n&&a!=="*"){let c=this.model.indexOf(n.id);if(c!==-1&&this.model.rows[c].expanded!==r)this.callbacks.onToggle?.({...this.detail(c),expanded:this.model.rows[c].expanded})}}else this.setActive(i.index,!0);return}if(a.length===1){let n=Date.now();if(!o)this.typed="";this.typedAt=n,this.typed+=a;let r=this.model.typeahead(this.active,this.typed);if(r!==-1)e.preventDefault(),this.setActive(r,!0)}}}var Kr="./List-q8ff8gdr.stx";var Wr="./Listbox-83j2q4x6.stx";var Ur="./ListboxButton-gan8e3nw.stx";var Yr="./ListboxLabel-ka0hfm7b.stx";var Zr="./ListboxOption-gpaqvk3s.stx";var ei="./ListboxOptions-2928864k.stx";var si="./FilterChip-bynt5maa.stx";var oi="./FilterChips-xg7pgkk2.stx";var ri="./ListRow-nvyg2fwb.stx";var li="./NavBar-ky8tedjb.stx";var di="./SectionCard-8b5fyrjd.stx";var hi="./TabBar-6m1ajm1d.stx";var fi="./TabBarItem-kddfnhk3.stx";var gi="./Navigator-1yk1c3pp.stx";var bi="./Notification-b3cz24f0.stx";var wi="./Pager-7gn8jygq.stx";var ki="./PagerDots-076w890y.stx";var Ci="./Pagination-8bhbkpcp.stx";var Ti="./Checkout-crbegxyv.stx";var Ii="./DefaultPaymentMethod-ss3x61tr.stx";var Pi="./PaymentMethods-z4hhr0kv.stx";var Ri="./SubscriptionCheckout-rdcv32n1.stx";var Li="./Popover-jjt7p7sn.stx";var zi="./PopoverButton-ks3cttd9.stx";var Hi="./PopoverPanel-ddgj4gz3.stx";var Vi="./Portal-m73vz879.stx";var zs=[{name:"phone",label:"Phone",width:390,height:844},{name:"tablet",label:"Tablet",width:820,height:1180},{name:"desktop",label:"Desktop",width:1280,height:800}];function Os(e){let t=typeof e==="string"?Number.parseFloat(e):e;return typeof t==="number"&&Number.isFinite(t)&&t>0?Math.round(t):null}function ft(e,t={}){let s=Os(t.width),a=Os(t.height),o=Boolean(t.landscape);if(s&&a)return{name:"custom",size:{width:s,height:a},landscape:!1};let n=zs.find((i)=>i.name===e);if(!n)return{name:"fill",size:null,landscape:!1};let r=o&&n.height>n.width;return{name:n.name,size:r?{width:n.height,height:n.width}:{width:n.width,height:n.height},landscape:r}}function Ds(e,t,s=0){let a=t.width-s*2,o=t.height-s*2;if(a<=0||o<=0||e.width<=0||e.height<=0)return 1;return Math.min(1,a/e.width,o/e.height)}function Hs(e,t=1){if(!e.size)return"Fills the frame";let s=`${e.size.width} \xD7 ${e.size.height}`;return t<0.995?`${s} at ${Math.round(t*100)}%`:s}function mt(e){return e==="light"||e==="dark"?e:"auto"}var Fi=["allow-same-origin","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols","allow-popups","allow-popups-to-escape-sandbox","allow-modals","allow-downloads","allow-pointer-lock","allow-presentation","allow-storage-access-by-user-activation"];function js(e={}){let t=[];if(e.scripts)t.push("allow-scripts");if(e.forms)t.push("allow-forms");return t.join(" ")}function ox(e){return!e.toLowerCase().split(/\s+/).filter(Boolean).some((s)=>Fi.includes(s))}var Bi=/<!doctype\s|<html[\s>]/i,He=/<head(?:\s[^>]*)?>/i,je=/<html(?:\s[^>]*)?>/i,qi=/<base[\s>]/i,Ki=/<meta[^>]+name\s*=\s*["']?color-scheme/i,_i=/\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)/gi,Wi=/(<(style|script)\b[^>]*>)([\s\S]*?)(<\/\2\s*>)/gi,Gi=/(\smedia\s*=\s*)("[^"]*"|'[^']*')/gi,Ui="(min-width: 0px)",Ji="(max-width: 0px)";function Yi(e,t){let s=(n)=>n.replace(_i,(r,i)=>i.toLowerCase()===t?Ui:Ji),a=e.replace(Wi,(n,r,i,c,l)=>r+s(c)+l).replace(Gi,(n,r,i)=>r+s(i)),o=`<style data-stx-preview-scheme>:root{color-scheme:${t} !important}</style>`;if(He.test(a))return a.replace(He,(n)=>n+o);if(je.test(a))return a.replace(je,(n)=>`${n}<head>${o}</head>`);return o+a}function Xi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Vs(e,t={}){let s=Zi(e,t);return t.forceScheme?Yi(s,t.forceScheme):s}function Zi(e,t){let s=e==null?"":String(e),a='<base target="_blank">';if(!Bi.test(s))return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="color-scheme" content="light dark"><base target="_blank">${t.title?`<title>${Xi(t.title)}</title>`:""}</head><body>${s}</body></html>`;if(qi.test(s))return s;if(He.test(s))return s.replace(He,(o)=>o+'<base target="_blank">');if(je.test(s))return s.replace(je,(o)=>`${o}<head><base target="_blank"></head>`);return'<base target="_blank">'+s}function nx(e){return Ki.test(e)}function Fs(e,t){let s=["fill",...zs.map((o)=>o.name)],a=s.indexOf(e);return s[((a<0?0:a)+t+s.length)%s.length]}var el="./PreviewFrame-erbgvzj8.stx";var tl=16,Bs="(prefers-color-scheme: dark)",ke;function sl(){if(ke!==void 0)return ke;try{if(typeof matchMedia!=="function"||!document.body)return!0;let e=matchMedia(Bs).matches,t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.tabIndex=-1,t.style.cssText=`position:absolute;width:1px;height:1px;border:0;opacity:0;pointer-events:none;color-scheme:${e?"light":"dark"}`,document.body.appendChild(t),t.offsetWidth;let s=t.contentWindow?.matchMedia?.(Bs).matches;t.remove(),ke=typeof s==="boolean"?s!==e:!0}catch{ke=!0}return ke}class al{root;callbacks;html;viewportName;frameWidth;frameHeight;landscape;scheme;scripts;forms;title;viewport;scale=1;frame=null;written;stage;device;observer=null;pending=0;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;this.html=t.html??"",this.viewportName=t.viewport||"fill",this.frameWidth=t.frameWidth??null,this.frameHeight=t.frameHeight??null,this.landscape=Boolean(t.landscape),this.scheme=mt(t.scheme),this.scripts=Boolean(t.scripts),this.forms=Boolean(t.forms),this.title=t.title||"Preview",this.viewport=this.resolve(),this.stage=this.part("stage"),this.device=this.part("device");let a=(n)=>this.onToolbarClick(n),o=(n)=>this.onToolbarKey(n);if(this.root.addEventListener("click",a),this.root.addEventListener("keydown",o),this.disposers.push(()=>this.root.removeEventListener("click",a),()=>this.root.removeEventListener("keydown",o)),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>{cancelAnimationFrame(this.pending),this.pending=requestAnimationFrame(()=>this.layout())}),this.observer.observe(this.stage);this.load(),this.reflect(),this.root.setAttribute("data-preview-ready","")}getState(){return{viewport:this.viewport.name,width:this.viewport.size?.width??null,height:this.viewport.size?.height??null,landscape:this.viewport.landscape,scale:this.scale,scheme:this.scheme,effectiveScheme:this.effectiveScheme()}}setHtml(e){let t=e==null?"":String(e);if(t===this.html)return;this.html=t,this.load()}setViewport(e,t={}){if(this.viewportName=e||"fill","landscape"in t)this.landscape=Boolean(t.landscape);if("width"in t)this.frameWidth=t.width??null;if("height"in t)this.frameHeight=t.height??null;let s=JSON.stringify(this.viewport);if(this.viewport=this.resolve(),this.layout(),this.reflect(),JSON.stringify(this.viewport)!==s)this.callbacks.onViewport?.(this.getState())}setScheme(e){let t=mt(e);if(t===this.scheme)return;if(this.scheme=t,this.schemeToWrite()!==this.written)this.load();else this.applyScheme();this.reflect(),this.callbacks.onScheme?.(this.getState())}setPermissions(e){let t=e.scripts??this.scripts,s=e.forms??this.forms;if(t===this.scripts&&s===this.forms)return;this.scripts=t,this.forms=s,this.load()}reload(){this.load(),this.callbacks.onReload?.(this.getState())}destroy(){this.observer?.disconnect(),cancelAnimationFrame(this.pending);for(let e of this.disposers)e();this.frame?.remove(),this.frame=null,this.root.removeAttribute("data-preview-ready")}part(e){let t=this.root.querySelector(`[data-pf="${e}"]`);if(!t)throw Error(`PreviewFrame: the template has no ${e} part`);return t}resolve(){return ft(this.viewportName,{width:this.frameWidth,height:this.frameHeight,landscape:this.landscape})}effectiveScheme(){if(this.scheme!=="auto")return this.scheme;if(this.root.closest(".dark"))return"dark";if(this.root.closest(".light"))return"light";return typeof matchMedia==="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}schemeToWrite(){if(sl())return;if(this.scheme==="auto"&&!this.root.closest(".dark, .light"))return;return this.effectiveScheme()}load(){let e=document.createElement("iframe");e.setAttribute("sandbox",js({scripts:this.scripts,forms:this.forms})),e.setAttribute("referrerpolicy","no-referrer"),e.setAttribute("title",this.title),e.setAttribute("data-pf","frame"),e.className="stx-preview-frame",e.addEventListener("load",()=>{if(e===this.frame)this.callbacks.onLoad?.(this.getState())}),this.written=this.schemeToWrite(),e.srcdoc=Vs(this.html,{title:this.title,forceScheme:this.written}),this.frame?.remove(),this.frame=e,this.applyScheme(),this.device.appendChild(e),this.layout()}applyScheme(){let e=this.effectiveScheme();if(this.root.setAttribute("data-scheme",e),this.frame)this.frame.style.colorScheme=e}layout(){let e=this.frame;if(!e)return;let t=this.viewport.size;if(this.root.setAttribute("data-viewport",this.viewport.name),!t)this.scale=1,this.device.style.width="",this.device.style.height="",e.style.width="",e.style.height="",e.style.transform="";else{let a=this.stage.getBoundingClientRect();this.scale=Ds(t,{width:a.width,height:a.height},tl),this.device.style.width=`${t.width*this.scale}px`,this.device.style.height=`${t.height*this.scale}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.style.transform=this.scale===1?"":`scale(${this.scale})`}let s=this.root.querySelector('[data-pf="size"]');if(s)s.textContent=Hs(this.viewport,this.scale)}reflect(){for(let a of this.root.querySelectorAll("[data-pf-viewport]")){let o=a.getAttribute("data-pf-viewport")===this.viewport.name;a.setAttribute("aria-checked",String(o)),a.tabIndex=o?0:-1}if(!this.root.querySelector('[data-pf-viewport][tabindex="0"]'))this.root.querySelector("[data-pf-viewport]")?.setAttribute("tabindex","0");let e=this.effectiveScheme()==="dark",t=this.root.querySelector('[data-pf-action="scheme"]');if(t){t.setAttribute("aria-pressed",String(e));let a=t.querySelector('[data-pf="scheme-text"]');if(a)a.textContent=e?"Dark":"Light"}let s=this.root.querySelector('[data-pf-action="rotate"]');if(s){let a=ft(this.viewportName,{width:this.frameWidth,height:this.frameHeight}).size;s.disabled=!a||this.viewport.name==="custom"||a.height<=a.width,s.setAttribute("aria-pressed",String(this.viewport.landscape))}}onToolbarClick(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport], [data-pf-action]"):null;if(!t||!this.root.contains(t))return;let s=t.getAttribute("data-pf-viewport");if(s){this.setViewport(s,{width:null,height:null});return}switch(t.getAttribute("data-pf-action")){case"scheme":this.setScheme(this.effectiveScheme()==="dark"?"light":"dark");break;case"rotate":this.setViewport(this.viewportName,{landscape:!this.landscape});break;case"reload":this.reload();break}}onToolbarKey(e){let t=e.target instanceof Element?e.target.closest("[data-pf-viewport]"):null;if(!t)return;let s=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(s===0)return;e.preventDefault();let a=t.getAttribute("data-pf-viewport")||"fill",o=Fs(a,s);this.setViewport(o,{width:null,height:null}),this.root.querySelector(`[data-pf-viewport="${o}"]`)?.focus()}}var nl="./Progress-2qzb77kc.stx";var il="./Radio-8153x74w.stx";var cl="./RadioGroup-ps9kn22f.stx";var pl="./RadioGroupDescription-z34r9avr.stx";var ul="./RadioGroupLabel-ka0hfm7b.stx";var ml="./RadioGroupOption-6hyy1bvb.stx";var xl="./SegmentedControl-7q0t8c9s.stx";var vl="./Select-ygzchedx.stx";var X={NONE:0,KEYWORD:1,SUBSTRING:2,WORD_PREFIX:3,PREFIX:4},Ox=700,Ws=1600;function gt(e){return`stx:settings:${e}`}function te(e,t){if(!t)return null;return e.find((s)=>s.id===t)??null}function wl(e){return(e.find((s)=>!s.parent)??e[0])?.id??""}function Gs(e,...t){for(let s of t)if(te(e,s))return s;return wl(e)}function Us(e,t){let s=new Set,a=te(e,t);while(a&&a.parent&&!s.has(a.id)){s.add(a.id);let o=te(e,a.parent);if(!o)break;a=o}return a?.id??""}function Se(e,t){let s=te(e,t);if(!s?.parent||s.parent===t)return"";return te(e,s.parent)?s.parent:""}function Js(){return{trail:[],cursor:-1}}function Ce(e){return e.trail[e.cursor]??""}function Ys(e,t){if(!t||Ce(e)===t)return e;let s=[...e.trail.slice(0,e.cursor+1),t];return{trail:s,cursor:s.length-1}}function xt(e){return e.cursor<e.trail.length-1}function Xs(e,t=[]){if(e.cursor>0)return!0;return e.cursor===0&&Se(t,Ce(e))!==""}function Zs(e,t=[]){if(e.cursor>0)return{trail:e.trail,cursor:e.cursor-1};if(e.cursor===0){let s=Se(t,Ce(e));if(s)return{trail:[s,...e.trail],cursor:0}}return e}function Qs(e){return xt(e)?{trail:e.trail,cursor:e.cursor+1}:e}function ce(e){return String(e??"").normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/\s+/g," ").trim()}function qs(e,t){let s=e.indexOf(t);while(s!==-1){if(s===0||!/[\p{L}\p{N}]/u.test(e.charAt(s-1)))return!0;s=e.indexOf(t,s+1)}return!1}function Ks(e,t,s){if(t.startsWith(e))return X.PREFIX;if(qs(t,e))return X.WORD_PREFIX;if(t.includes(e))return X.SUBSTRING;if(qs(s,e))return X.KEYWORD;return X.NONE}function _s(e,t,s=""){let a=ce(e);if(a==="")return X.NONE;let o=ce(t),n=ce(s),r=Ks(a,o,n),i=a.split(" ");if(r!==X.NONE||i.length===1)return r;let c=X.PREFIX;for(let l of i){let d=Ks(l,o,n);if(d===X.NONE)return X.NONE;c=Math.min(c,d===X.PREFIX&&l!==i[0]?X.WORD_PREFIX:d)}return c}function ea(e,t){let s=ce(e);if(s==="")return{query:"",panes:[],settings:[]};let a=[];for(let n of t.items){let r=te(t.panes,n.id),i=`${n.keywords??""} ${r?.keywords??""} ${r&&r.title!==n.label?r.title:""}`;if(_s(s,n.label,i)!==X.NONE)a.push(n.id)}let o=[];return t.rows.forEach((n,r)=>{if(!n.label)return;let c=te(t.panes,n.pane)?.title??"",l=_s(s,n.label,`${n.keywords??""} ${c}`);if(l!==X.NONE)o.push({id:n.id,label:n.label,pane:n.pane,paneTitle:c,row:r,rank:l})}),o.sort((n,r)=>r.rank-n.rank||n.row-r.row),{query:s,panes:a,settings:o}}function ta(e){if(e<=0)return"No results";return e===1?"1 result":`${e} results`}function bt(e,t,s){if(s<=0)return-1;if(e==="ArrowDown")return Math.min(s-1,t+1);if(e==="ArrowUp")return t<0?s-1:Math.max(0,t-1);if(e==="Home")return 0;if(e==="End")return s-1;return-1}function sa(e,t,s,a=700){return{buffer:(!e||s-e.at>a?"":e.buffer)+ce(t),at:s}}function aa(e,t,s){let a=e.length,o=ce(t);if(a===0||o==="")return-1;let n=o.split("").every((c)=>c===o.charAt(0)),r=n?o.charAt(0):o,i=n?s+1:Math.max(0,s);for(let c=0;c<a;c++){let l=((i+c)%a+a)%a;if(ce(e[l]).startsWith(r))return l}return-1}var kl="./SettingsGroup-dkae46k5.stx";var Cl="./SettingsPane-jbd1gbdt.stx";var Tl="./SettingsPaneHeader-f0cvkqs7.stx";var Il="./SettingsRow-4cxbsf1q.stx";var Pl="./SettingsSidebarGroup-p2ygv5yy.stx";var Rl="./SettingsSidebarItem-x8fsn3w5.stx";var Ll="./SettingsWindow-mm490ymt.stx";var vt="[data-stx-settings]",Ve="[data-settings-item]",oa="[data-settings-pane]",Ol="[data-settings-row]",wt="[data-settings-result]",zl='button, a[href], input, select, textarea, label, [role="switch"], [role="checkbox"], [role="radio"], [role="slider"], [role="button"], [contenteditable]';function na(e){return e.replace(/[^\w-]+/g,"-")}class Dl{root;callbacks;history=Js();current="";query="";storageKey;typed=null;hits=[];highlighted=null;highlightTimer=null;disposers=[];list;account;input;field;results;empty;live;backButton;forwardButton;title;body;constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.storageKey=t.storageKey||"",!e.id)e.id=`settings-${Math.random().toString(36).slice(2,8)}`;this.list=this.own("[data-settings-list]"),this.account=this.own("[data-settings-account]"),this.input=this.own("[data-settings-search-input]"),this.field=this.own("[data-settings-search]"),this.results=this.own("[data-settings-results]"),this.empty=this.own("[data-settings-empty]"),this.live=this.own("[data-settings-live]"),this.backButton=this.own("[data-settings-back]"),this.forwardButton=this.own("[data-settings-forward]"),this.title=this.own("[data-settings-title]"),this.body=this.own("[data-settings-body]");for(let n of[this.results,this.live,this.title])if(n)n.__stx_inert_content=!0;if(this.listen(e,"click",(n)=>this.onClick(n)),this.listen(t.globalKeys?document:e,"keydown",(n)=>this.onKeyDown(n)),this.input)this.listen(this.input,"input",()=>this.search(this.input.value));if(this.body)this.listen(this.body,"scroll",()=>this.syncScrolled(),{passive:!0});this.listen(window,"focus",()=>e.setAttribute("data-stx-window-active","true")),this.listen(window,"blur",()=>e.setAttribute("data-stx-window-active","false")),this.describe();let a=this.panes(),o=this.paneElements().find((n)=>!n.hidden)?.getAttribute("data-settings-pane");this.open(Gs(a,this.stored(),t.pane,o)),e.setAttribute("data-settings-ready","")}getPane(){return this.current}showPane(e){if(!te(this.panes(),e))return!1;return this.open(e),!0}revealSetting(e){if(!e)return!1;let t=this.rowElements().find((a)=>a.getAttribute("data-setting")===e),s=t?this.paneOf(t):"";if(!t||!s)return!1;return this.open(s),this.reveal(t),!0}back(){this.travel(Zs(this.history,this.panes()))}forward(){this.travel(Qs(this.history))}focusSearch(){if(!this.input)return;this.input.focus(),this.input.select()}search(e){if(this.query=e,this.input&&this.input.value!==e)this.input.value=e;this.applySearch(!0)}destroy(){for(let e of this.disposers)e();this.disposers.length=0,this.clearHighlight(),this.root.removeAttribute("data-settings-ready")}own(e){return this.all(e)[0]??null}all(e,t=this.root){return Array.from(t.querySelectorAll(e)).filter((s)=>s.closest(vt)===this.root)}listen(e,t,s,a){e.addEventListener(t,s,a),this.disposers.push(()=>e.removeEventListener(t,s,a))}paneElements(){return this.all(oa)}paneElement(e){return this.paneElements().find((t)=>t.getAttribute("data-settings-pane")===e)??null}panes(){return this.paneElements().map((e)=>({id:e.getAttribute("data-settings-pane")||"",title:e.getAttribute("data-title")||e.getAttribute("data-settings-pane")||"",keywords:e.getAttribute("data-keywords")||"",parent:e.getAttribute("data-parent")||""})).filter((e)=>e.id!=="")}itemElements(){return this.list?this.all(Ve,this.list):[]}visibleItems(){return this.itemElements().filter((e)=>!e.hidden&&!e.disabled)}labelOf(e){return(e.querySelector(".stx-settings-item-label")?.textContent||e.getAttribute("aria-label")||e.textContent||"").trim()}items(){return this.itemElements().map((e)=>({id:e.getAttribute("data-settings-item")||"",label:this.labelOf(e),keywords:e.getAttribute("data-keywords")||""}))}rowElements(){return this.all(Ol).filter((e)=>this.paneOf(e)!=="")}paneOf(e){return e.closest(oa)?.getAttribute("data-settings-pane")||""}stored(){if(!this.storageKey)return"";try{return localStorage.getItem(gt(this.storageKey))||""}catch{return""}}store(){if(!this.storageKey||!this.current)return;try{localStorage.setItem(gt(this.storageKey),this.current)}catch{}}describe(){let e=this.root.id,t=new Map;for(let s of this.itemElements()){let a=s.getAttribute("data-settings-item")||"";if(!s.id)s.id=`${e}-item-${na(a)}`;s.setAttribute("role","tab"),t.set(a,s);for(let o=s.parentElement;o&&o!==this.list;o=o.parentElement)if(!o.hasAttribute("role"))o.setAttribute("role","presentation")}for(let s of this.paneElements()){let a=s.getAttribute("data-settings-pane")||"";if(!s.id)s.id=`${e}-pane-${na(a)}`;let o=t.get(a);if(o)o.setAttribute("aria-controls",s.id),s.setAttribute("role","tabpanel"),s.setAttribute("aria-labelledby",o.id),s.removeAttribute("aria-label");else if(this.title?.id){if(s.setAttribute("role","region"),!s.hasAttribute("aria-label"))s.setAttribute("aria-label",s.getAttribute("data-title")||a)}}}open(e){if(!e)return;this.history=Ys(this.history,e),this.show()}travel(e){if(e===this.history)return;this.history=e,this.show()}show(){this.describe();let e=this.panes(),t=Ce(this.history),s=te(e,t),a=this.paneElement(t);if(!s||!a)return;let o=document.activeElement,n=o instanceof HTMLElement&&this.paneElements().some((c)=>c!==a&&c.contains(o));for(let c of this.paneElements())c.hidden=c!==a,c.toggleAttribute("data-active",c===a);let r=Us(e,t);for(let c of this.itemElements()){let l=c.getAttribute("data-settings-item")===r;c.setAttribute("aria-selected",l?"true":"false"),c.toggleAttribute("data-active",l)}if(this.syncTabStops(),this.title)this.title.textContent=s.title;this.root.setAttribute("data-pane",t),this.root.toggleAttribute("data-subpane",Se(e,t)!==""),this.syncHistoryButtons(e);let i=t!==this.current;if(this.current=t,i){if(this.clearHighlight(),this.body)this.body.scrollTop=0;if(this.syncScrolled(),n){if(!a.hasAttribute("tabindex"))a.setAttribute("tabindex","-1");a.focus({preventScroll:!0})}this.store(),this.callbacks.onPane?.({id:t,title:s.title,parent:Se(e,t)})}}syncTabStops(){let e=this.visibleItems(),t=e.find((s)=>s.getAttribute("aria-selected")==="true")??e[0];for(let s of this.itemElements())s.setAttribute("tabindex",s===t?"0":"-1")}syncHistoryButtons(e){let t=(o,n,r)=>{if(!o)return;let i=document.activeElement===o;if(o.disabled=!n,i&&!n&&r&&!r.disabled)r.focus()},s=Xs(this.history,e),a=xt(this.history);if(s)t(this.backButton,!0,null),t(this.forwardButton,a,this.backButton);else t(this.forwardButton,a,null),t(this.backButton,!1,this.forwardButton)}syncScrolled(){this.root.toggleAttribute("data-scrolled",Boolean(this.body&&this.body.scrollTop>0))}applySearch(e){let t=this.rowElements(),s=t.map((r)=>({id:r.getAttribute("data-setting")||"",label:(r.getAttribute("data-label")||"").trim(),keywords:r.getAttribute("data-keywords")||"",pane:this.paneOf(r)})),a=ea(this.query,{panes:this.panes(),items:this.items(),rows:s}),o=a.query!=="";this.root.toggleAttribute("data-searching",o),this.field?.toggleAttribute("data-filled",this.query!=="");for(let r of this.itemElements())r.hidden=o&&!a.panes.includes(r.getAttribute("data-settings-item")||"");if(this.list){for(let r of this.all("[data-settings-group]",this.list))r.hidden=o&&this.all(Ve,r).every((i)=>i.hidden);this.list.hidden=o&&a.panes.length===0}if(this.account)this.account.hidden=o;this.hits=a.settings.map((r)=>({hit:r,row:t[r.row]})),this.drawResults();let n=a.panes.length+a.settings.length;if(this.empty)this.empty.hidden=!o||n>0;if(this.live)this.live.textContent=o?ta(n):"";if(this.syncTabStops(),e)this.callbacks.onSearch?.({query:this.query.trim(),panes:a.panes,settings:a.settings.map((r)=>({id:r.id,label:r.label,pane:r.pane}))})}drawResults(){let e=this.results;if(!e)return;e.replaceChildren(),e.hidden=this.hits.length===0,this.hits.forEach(({hit:t},s)=>{let a=document.createElement("button");a.type="button",a.className="stx-settings-result",a.setAttribute("data-settings-result",String(s)),a.setAttribute("tabindex","-1");let o=document.createElement("span");o.className="stx-settings-result-label",o.textContent=t.label;let n=document.createElement("span");n.className="stx-settings-result-pane",n.textContent=t.paneTitle,a.append(o,n),e.append(a)})}chooseResult(e){let t=this.hits[e];if(!t||!t.row.isConnected)return;this.open(t.hit.pane),this.reveal(t.row)}clearSearch(){if(this.query===""&&(!this.input||this.input.value===""))return;this.search("")}reveal(e){if(this.body){let t=this.body.getBoundingClientRect(),s=e.getBoundingClientRect();this.body.scrollTop+=s.top-t.top-(t.height-s.height)/2,this.syncScrolled()}this.clearHighlight(),e.setAttribute("data-highlight",""),this.highlighted=e,this.highlightTimer=setTimeout(()=>this.clearHighlight(),Ws)}clearHighlight(){if(this.highlightTimer)clearTimeout(this.highlightTimer);this.highlightTimer=null,this.highlighted?.removeAttribute("data-highlight"),this.highlighted=null}inside(e){return e instanceof Element&&e.closest(vt)===this.root}navigationRow(e){let t=e.closest("[data-navigate]");if(!t||t.closest(vt)!==this.root||t.getAttribute("aria-disabled")==="true")return null;let s=e.closest(zl);if(s&&s!==t&&t.contains(s))return null;return t}navigate(e){let t=e.getAttribute("data-navigate")||"";if(!te(this.panes(),t))return;let s=this.current;this.open(t),this.callbacks.onNavigate?.({id:t,from:s,setting:e.getAttribute("data-setting")||""})}onClick(e){let t=e.target;if(!this.inside(t))return;let s=t.closest(Ve);if(s&&this.list?.contains(s)){this.open(s.getAttribute("data-settings-item")||"");return}let a=t.closest(wt);if(a){this.chooseResult(Number(a.getAttribute("data-settings-result")));return}if(t.closest("[data-settings-back]")){this.back();return}if(t.closest("[data-settings-forward]")){this.forward();return}if(t.closest("[data-settings-search-clear]")){this.clearSearch(),this.input?.focus();return}let o=this.navigationRow(t);if(o)this.navigate(o)}onKeyDown(e){if(e.defaultPrevented)return;let t=(e.metaKey||e.ctrlKey)&&!e.altKey;if(t&&!e.shiftKey){let n=e.key.toLowerCase();if(n==="f"&&this.input){e.preventDefault(),this.focusSearch();return}if(n==="["){e.preventDefault(),this.back();return}if(n==="]"){e.preventDefault(),this.forward();return}}let s=e.target;if(!this.inside(s))return;if(e.key==="Escape"&&this.query!==""){e.preventDefault(),this.clearSearch(),this.visibleItems().find((n)=>n.getAttribute("tabindex")==="0")?.focus();return}if(s===this.input){this.onSearchKey(e);return}let a=s.closest(wt);if(a){this.onResultKey(e,a);return}let o=s.closest(Ve);if(o&&this.list?.contains(o)){this.onItemKey(e,o);return}if((e.key==="Enter"||e.key===" ")&&!t&&!e.altKey){let n=s.closest("[data-navigate]");if(n&&n===s&&this.navigationRow(s))e.preventDefault(),this.navigate(n)}}resultButtons(){return this.results?Array.from(this.results.querySelectorAll(wt)):[]}onSearchKey(e){if(e.key==="ArrowDown"){let t=this.visibleItems()[0]??this.resultButtons()[0];if(t)e.preventDefault(),t.focus()}else if(e.key==="Enter"&&this.query.trim()!==""){e.preventDefault();let t=this.visibleItems()[0];if(t)this.open(t.getAttribute("data-settings-item")||"");else this.chooseResult(0)}}onResultKey(e,t){let s=this.resultButtons(),a=s.indexOf(t);if(e.key==="ArrowUp"&&a===0){let n=this.visibleItems(),r=n[n.length-1]??this.input;if(r)e.preventDefault(),r.focus();return}let o=bt(e.key,a,s.length);if(o===-1)return;e.preventDefault(),s[o].focus()}onItemKey(e,t){if(e.metaKey||e.ctrlKey||e.altKey)return;let s=this.visibleItems(),a=s.indexOf(t);if(e.key==="ArrowDown"&&a===s.length-1){let n=this.resultButtons()[0];if(n){e.preventDefault(),n.focus();return}}let o=bt(e.key,a,s.length);if(o===-1&&e.key.length===1&&(e.key!==" "||this.typed!==null)){let n=sa(this.typed,e.key,Date.now());if(e.key===" "&&n.buffer.trim()===""){this.typed=null;return}if(this.typed=n,o=aa(s.map((r)=>this.labelOf(r)),n.buffer,a),o===-1){e.preventDefault();return}}if(o===-1)return;e.preventDefault(),s[o].focus(),this.open(s[o].getAttribute("data-settings-item")||"")}}var jl="./Sidebar-8dygywjv.stx";var Fl="./SidebarFooter-s7skj92y.stx";var ql="./SidebarHeader-x7jdhmyr.stx";var _l="./SidebarItem-64sjb2fe.stx";var Gl="./SidebarPinned-48kyk193.stx";var Jl="./SidebarSection-vx5bahsk.stx";var Xl="./SidebarSpace-bwv98azf.stx";var Ql="./SidebarSpaces-mdtrynr2.stx";var tc="./SidebarSpaceSwitcher-1mycft2g.stx";var Fe={blue:"#0088ff",red:"#ff383c",pink:"#ff2d55",orange:"#ff8d28",yellow:"#ffcc00",green:"#34c759",teal:"#00c3d0",cyan:"#00c0e8",indigo:"#6155f5",purple:"#cb30e0",brown:"#ac7f5e",gray:"#8e8e93"},de={pane:["bg-[#f2f2f4]/90 dark:bg-[#1c1c1e]/88","backdrop-blur-[50px] backdrop-saturate-[180%]","text-black dark:text-white","select-none"].join(" "),selection:"accent",layers:{shimmerRim:!0},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[10px] pb-[10px]",sectionHeader:["group/section flex w-full items-center","pl-[8px] pr-[6px] pt-[16px] pb-[5px]","text-[11px] font-semibold leading-[13px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),sectionChevron:["i-f7-chevron-down h-[11px] w-[11px] ml-auto","text-[#3c3c43]/60 dark:text-[#ebebf5]/45","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col",item:{base:["flex w-full items-center","h-[32px] rounded-[8px] pl-[4px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-black dark:text-white","transition-colors duration-150 ease-out"].join(" "),hover:"hover:bg-black/4 dark:hover:bg-white/6",active:"",pressed:"active:bg-black/10 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[18px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[11px] w-[11px]","text-[#3c3c43]/60 dark:text-[#ebebf5]/55","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[20px] w-[22px] shrink-0 items-center justify-center mr-[7px]",icon:"h-[17px] w-[17px]",image:"h-[20px] w-[20px] rounded-[4px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[13px] leading-[16px]","text-[#3c3c43]/75 dark:text-[#ebebf5]/60"].join(" "),indentPerLevel:16}},sc={selection:"classes",pane:"bg-[#f4f4f3] dark:bg-neutral-950 text-zinc-950 dark:text-white select-none",layers:{},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-5",sectionHeader:"group/section flex w-full items-center gap-2.5 px-4 pb-2 pt-5 text-[13px] font-semibold uppercase tracking-[0.12em] text-zinc-400 dark:text-zinc-500",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[16px] px-3.5 py-2 text-[14px] leading-tight transition-colors duration-150",hover:"hover:bg-[#ececea] hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e7e7e5] text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-[#e2e2e0] dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-500 dark:text-zinc-500",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/70 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},ac={selection:"classes",pane:"bg-[#f3f3f1]/48 dark:bg-neutral-950/32 backdrop-blur-3xl backdrop-saturate-150 text-zinc-950 dark:text-white select-none",layers:{tint:"bg-[linear-gradient(112deg,rgba(255,255,255,0.20)_0%,rgba(255,255,255,0.04)_45%,rgba(226,226,222,0.16)_100%)] dark:bg-[linear-gradient(112deg,rgba(255,255,255,0.08)_0%,rgba(255,255,255,0.02)_46%,rgba(255,255,255,0.06)_100%)]"},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-5 py-2",sectionHeader:"group/section flex w-full items-center gap-2.5 px-3 pb-1.5 pt-3 rounded-[14px] text-[12px] font-semibold uppercase tracking-[0.10em] text-zinc-500/80 dark:text-zinc-400/80",sectionChevron:"i-f7-chevron-down h-3 w-3 ml-auto opacity-0 group-hover/section:opacity-100 transition-opacity duration-150 transition-transform duration-200",sectionGroup:"flex flex-col space-y-1",item:{base:"flex w-full items-center gap-3 rounded-[14px] px-3 py-1.5 text-[13.5px] leading-tight transition-colors duration-150",hover:"hover:bg-white/38 hover:text-zinc-950 dark:hover:bg-white/10",active:"bg-[#e8e8e6]/90 text-zinc-950 dark:bg-white/12 dark:text-white",pressed:"active:bg-white/50 dark:active:bg-white/15",disabled:"opacity-50 pointer-events-none",disclosure:"flex h-4 w-4 shrink-0 items-center justify-center",chevron:"i-f7-chevron-right h-3 w-3 opacity-50 transition-transform duration-200",iconSlot:"flex h-5 w-5 shrink-0 items-center justify-center",icon:"h-[18px] w-[18px] text-zinc-600 dark:text-zinc-400",image:"h-5 w-5 rounded object-cover",label:"flex-1 truncate text-left text-zinc-700 dark:text-zinc-300",count:"ml-auto grid h-5 min-w-5 place-items-center rounded-full bg-white/72 px-1.5 text-[11px] font-medium text-zinc-500 shadow-sm dark:bg-white/10 dark:text-zinc-400",indentPerLevel:12}},oc={selection:"classes",pane:["bg-[#f7f5f1]/92 dark:bg-[#1a1a1c]/92","backdrop-blur-[40px] backdrop-saturate-[160%]","text-[#2c2a28] dark:text-[#ededf0]","select-none"].join(" "),layers:{tint:["bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,251,242,0.55))_0%,rgba(255,255,255,0)_38%)]","dark:bg-[linear-gradient(180deg,var(--stx-sidebar-tint,rgba(255,255,255,0.05))_0%,rgba(255,255,255,0)_42%)]"].join(" ")},scrollArea:"flex-1 overflow-y-auto overflow-x-hidden px-[16px] pb-[8px]",sectionHeader:["group/section flex w-full items-center","px-[8px] pt-[14px] pb-[4px]","text-[11px] font-medium leading-[13px]","opacity-55"].join(" "),sectionChevron:["i-f7-chevron-down h-[10px] w-[10px] ml-auto","opacity-0 group-hover/section:opacity-100 transition-opacity duration-150","transition-transform duration-200"].join(" "),sectionGroup:"flex flex-col space-y-[2px]",item:{base:["flex w-full items-center","h-[30px] rounded-[8px] pl-[6px] pr-[8px]","text-[13px] leading-[16px] font-normal","text-current","transition-[background-color,box-shadow,color] duration-150 ease-out"].join(" "),hover:"hover:bg-white/55 dark:hover:bg-white/8",active:["bg-white dark:bg-white/14","font-medium","shadow-[0_1px_2px_rgba(0,0,0,0.08)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]","ring-1 ring-black/5 dark:ring-white/8"].join(" "),pressed:"active:bg-white/80 dark:active:bg-white/18",disabled:"opacity-40 pointer-events-none",disclosure:"flex h-[16px] w-[16px] shrink-0 items-center justify-center",chevron:["i-f7-chevron-right h-[10px] w-[10px] opacity-45","transition-transform duration-200 ease-out"].join(" "),iconSlot:"flex h-[18px] w-[18px] shrink-0 items-center justify-center mr-[8px]",icon:"h-[16px] w-[16px]",image:"h-[18px] w-[18px] rounded-[5px] object-cover shadow-sm",label:"flex-1 truncate text-left",count:["ml-[8px] shrink-0 tabular-nums","text-[12px] leading-[16px] opacity-45"].join(" "),indentPerLevel:14}},nc={...de,pane:"bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",layers:{}},rc={...de,pane:"bg-transparent text-black dark:text-white select-none",layers:{}},ic={...de,pane:"bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",layers:{}},ra={macos:de,tahoe:de,"macos-tahoe":de,"macos-latest":de,arc:oc,workspace:sc,desktop:ac,solid:nc,transparent:rc,vibrancy:ic};function pb(e){return ra[e||"macos"]||ra.macos}function hb(e){if(!e)return;return Fe[e]||e}var lc=Fe.gray;function ie(e,t,s){return`color-mix(in oklab, ${e} ${t}%, ${s})`}function ia(e){return{light:{from:ie(e,35,"#ffffff"),to:ie(e,12.5,"#ffffff"),ink:ie(e,22,"#17171b"),accent:ie(e,88,"#2a2a30")},dark:{from:ie(e,27,"#101014"),to:ie(e,10,"#08080b"),ink:ie(e,12,"#f4f4f7"),accent:ie(e,74,"#ffffff")}}}function mb(e,t){return`linear-gradient(180deg, ${e} 0%, ${t} 100%)`}function cc(e){if(!e)return ia(lc);if(typeof e!=="string")return e;return ia(Fe[e]||e)}function dc(e){return[`--stx-space-light-from: ${e.light.from}`,`--stx-space-light-to: ${e.light.to}`,`--stx-space-light-ink: ${e.light.ink}`,`--stx-space-light-accent: ${e.light.accent}`,`--stx-space-dark-from: ${e.dark.from}`,`--stx-space-dark-to: ${e.dark.to}`,`--stx-space-dark-ink: ${e.dark.ink}`,`--stx-space-dark-accent: ${e.dark.accent}`].join("; ")}function la(e,t,s,a){if(!e||!e.label)return null;return{id:e.id||`${t}-${s}`,label:e.label,icon:e.icon||a}}function pc(e){let t=cc(e.tint);return{id:e.id,label:e.label||"",icon:e.icon||"",pinned:e.pinned||[],sections:e.sections||[],action:la(e.action,e.id,"action","i-f7-plus"),clear:la(e.clear,e.id,"clear","i-f7-arrow-down"),tint:t,style:dc(t),deferred:e.deferred===!0,showTitle:e.showTitle??!0}}function gb(e){return(e||[]).map(pc)}function xb(e,t){if(!t)return 0;let s=e.findIndex((a)=>a.id===t);return s===-1?0:s}function bb(e){return e.map((t)=>t.tint)}var uc="./Skeleton-m4p66zcs.stx";var zb=101;function me(e,t){let s=typeof e==="number"?e:Number.parseFloat(String(e));return Number.isFinite(s)?s:t}function Db(e,t,s){let a=me(e,0),o=me(t,100),n=me(s,1);return{min:Math.min(a,o),max:Math.max(a,o),step:n>0?n:0}}function ca(e){if(!Number.isFinite(e))return 0;let t=String(e).toLowerCase(),s=t.indexOf("e-");if(s!==-1)return Number.parseInt(t.slice(s+2),10)+Math.max(0,t.slice(0,s).split(".")[1]?.length??0);return t.split(".")[1]?.length??0}function pe(e,t){let{min:s,max:a,step:o}=t,n=Math.min(a,Math.max(s,me(e,s)));if(o<=0)return n;let r=Math.round((n-s)/o),i=Math.floor((a-s)/o+0.0000001);if(r>i)r=i;let c=Math.max(ca(o),ca(s));return Number((s+r*o).toFixed(Math.min(c,20)))}function Hb(e,t){let s=t.max-t.min;if(s<=0)return 0;return(Math.min(t.max,Math.max(t.min,me(e,t.min)))-t.min)/s}function jb(e,t){let s=Math.min(1,Math.max(0,Number.isFinite(e)?e:0));return pe(t.min+s*(t.max-t.min),t)}function Vb(e,t){let s=t.max-t.min;if(s<=0||e===!1||e==null||e===""||e==="false")return[];if(e===!0||e==="true"){if(t.step<=0)return[];let o=Math.floor(s/t.step+0.0000001)+1;if(o<2||o>101)return[];return Array.from({length:o},(n,r)=>Math.min(1,r*t.step/s))}let a=Math.floor(me(e,0));if(a<2||a>101)return[];return Array.from({length:a},(o,n)=>n/(a-1))}function Fb(e,t,s,a=10){let o=s.step>0?s.step:(s.max-s.min)/100;if(e==="ArrowRight"||e==="ArrowUp")return pe(t+o,s);if(e==="ArrowLeft"||e==="ArrowDown")return pe(t-o,s);if(e==="PageUp")return pe(t+o*a,s);if(e==="PageDown")return pe(t-o*a,s);if(e==="Home")return pe(s.min,s);if(e==="End")return pe(s.max,s);return null}var mc="./Slider-j59dgw1c.stx";var xc="./Spinner-vhnc3y03.stx";function bc(e){return Array.from({length:e},()=>1/e)}function Be(e,t){if(t<=0)return[];if(!e||e.length!==t||e.some((a)=>typeof a!=="number"||!Number.isFinite(a)||a<=0))return bc(t);let s=e.reduce((a,o)=>a+o,0);return e.map((a)=>a/s)}function da(e){let t=e;if(typeof e==="string"){let a=e.trim();if(a==="")return null;if(a.charAt(0)==="[")try{t=JSON.parse(a)}catch{return null}else t=a.split(/[\s,]+/).map((o)=>Number.parseFloat(o))}if(!Array.isArray(t)||t.length===0)return null;let s=t.map((a)=>typeof a==="string"?Number.parseFloat(a):a);return s.every((a)=>typeof a==="number"&&Number.isFinite(a)&&a>0)?s:null}function yt(e,t){if(typeof e==="number")return Number.isFinite(e)&&e>=0?e:t;if(typeof e!=="string"||e.trim()==="")return t;let s=Number.parseFloat(e);return Number.isFinite(s)&&s>=0?s:t}function pa(e,t,s){let a=e.length;if(a===0||t<=0)return[...e];let o=s.map((c)=>Math.max(0,c.min)),n=o.reduce((c,l)=>c+l,0);if(n>=t)return n===0?[...e]:o.map((c)=>c/n);let r=e.map((c)=>c*t);for(let c=0;c<=a;c++){let l=0;for(let p=0;p<a;p++){let u=Math.min(Math.max(r[p],o[p]),s[p].max);l+=r[p]-u,r[p]=u}if(Math.abs(l)<0.000000001)break;let d=r.map((p,u)=>l>0?s[u].max-p:p-o[u]),h=d.reduce((p,u)=>p+(Number.isFinite(u)?u:t),0);if(h<0.000000001)break;for(let p=0;p<a;p++){let u=(Number.isFinite(d[p])?d[p]:t)/h;r[p]+=l*u}}let i=r.reduce((c,l)=>c+l,0);return r.map((c)=>c/i)}function kt(e,t,s,a,o){let n=e.length;if(t<0||t>=n-1||a<=0||s===0)return[...e];let r=e.map((p)=>p*a),i=s>0,c=i?t:t+1,l=i?1:-1,d=Math.min(Math.abs(s),o[c].max-r[c]);if(d<=0)return[...e];let h=0;for(let p=i?t+1:t;p>=0&&p<n&&d>0.000000001;p+=l){let u=Math.min(d,Math.max(0,r[p]-Math.max(0,o[p].min)));r[p]-=u,h+=u,d-=u}return r[c]+=h,r.map((p)=>p/a)}function qe(e,t,s,a){let o=e.map((r)=>r*s),n=(r,i)=>{let c=0;for(let l=r;l<=i;l++)c+=Math.max(0,o[l]-Math.max(0,a[l].min));return c};return{back:Math.min(n(0,t),a[t+1].max-o[t+1]),forward:Math.min(n(t+1,e.length-1),a[t].max-o[t])}}function ha(e,t,s,a){let o=qe(e,t,s,a),n=e[t]*100,r=s>0?100/s:0;return{now:Math.round(n),min:Math.round(n-o.back*r),max:Math.round(n+o.forward*r)}}function St(e){return`stx:split-pane:${e}`}function ua(e){return JSON.stringify(e.map((t)=>Math.round(t*1e4)/1e4))}var wc="./SplitPane-7sqfdwqa.stx";var fa="data-split-separator";class yc{root;callbacks;direction;panes=[];separators=[];sizes=[];initial=[];limits=[];minSize;step;label;storageKey;observer=null;drag=null;disposers=[];constructor(e,t={},s={}){this.root=e;this.callbacks=s;if(this.direction=t.direction==="vertical"?"vertical":"horizontal",this.minSize=t.minSize??48,this.step=t.step??16,this.label=t.label||"Resize panes",this.storageKey=t.storageKey||"",this.collect(),this.initial=this.startingSizes(t.sizes),this.sizes=Be(this.stored()??this.initial,this.panes.length),this.build(),this.apply(!1),typeof ResizeObserver<"u")this.observer=new ResizeObserver(()=>this.apply(!1)),this.observer.observe(this.root);this.root.setAttribute("data-split-ready","")}getSizes(){return[...this.sizes]}setSizes(e){if(!e||e.length!==this.panes.length)return;this.sizes=Be(e,this.panes.length),this.apply(!0),this.report(-1,"api",!0)}reset(e=-1){this.sizes=[...this.initial],this.apply(!0),this.report(e,"reset",!0)}setDirection(e){let t=e==="vertical"?"vertical":"horizontal";if(t===this.direction)return;this.direction=t,this.root.setAttribute("data-direction",t);for(let s of this.separators)s.setAttribute("aria-orientation",t==="horizontal"?"vertical":"horizontal");this.apply(!1)}destroy(){this.observer?.disconnect();for(let e of this.disposers)e();for(let e of this.separators)e.remove();for(let e of this.panes)e.style.removeProperty("flex"),e.removeAttribute("data-split-pane");this.root.removeAttribute("data-split-ready")}available(){let e=this.root.getBoundingClientRect(),t=this.direction==="horizontal"?e.width:e.height,s=0;for(let a of this.separators){let o=a.getBoundingClientRect();s+=this.direction==="horizontal"?o.width:o.height}return Math.max(0,t-s)}collect(){this.panes=Array.from(this.root.children).filter((e)=>e instanceof HTMLElement&&!e.hasAttribute(fa)),this.limits=this.panes.map((e)=>({min:yt(e.getAttribute("data-min-size"),this.minSize),max:yt(e.getAttribute("data-max-size"),Number.POSITIVE_INFINITY)}))}startingSizes(e){let t=this.panes.map((a)=>Number.parseFloat(a.getAttribute("data-size")||"")),s=t.every((a)=>Number.isFinite(a)&&a>0)?t:null;return Be(e&&e.length===this.panes.length?e:s,this.panes.length)}stored(){if(!this.storageKey)return null;try{let e=da(localStorage.getItem(St(this.storageKey)));return e&&e.length===this.panes.length?e:null}catch{return null}}store(){if(!this.storageKey)return;try{localStorage.setItem(St(this.storageKey),ua(this.sizes))}catch{}}build(){let e=this.root.id||`split-${Math.random().toString(36).slice(2,8)}`;this.panes.forEach((t,s)=>{if(t.setAttribute("data-split-pane",""),!t.id)t.id=`${e}-pane-${s}`;if(s===this.panes.length-1)return;let a=document.createElement("div");a.setAttribute(fa,""),a.setAttribute("role","separator"),a.setAttribute("tabindex","0"),a.setAttribute("aria-orientation",this.direction==="horizontal"?"vertical":"horizontal"),a.setAttribute("aria-controls",t.id),a.setAttribute("aria-label",this.panes.length>2?`${this.label} ${s+1} and ${s+2}`:this.label),a.className="stx-split-separator",t.after(a),this.separators.push(a);let o=(n,r)=>{a.addEventListener(n,r),this.disposers.push(()=>a.removeEventListener(n,r))};o("pointerdown",(n)=>this.onPointerDown(n,s)),o("pointermove",(n)=>this.onPointerMove(n)),o("pointerup",(n)=>this.onPointerEnd(n)),o("pointercancel",(n)=>this.onPointerEnd(n)),o("dblclick",()=>this.reset(s)),o("keydown",(n)=>this.onKeyDown(n,s))})}apply(e){let t=this.available();if(t>0)this.sizes=pa(this.sizes,t,this.limits);if(this.panes.forEach((s,a)=>{s.style.flex=`${(this.sizes[a]*1000).toFixed(3)} 1 0px`}),this.separators.forEach((s,a)=>{let o=ha(this.sizes,a,t,this.limits);s.setAttribute("aria-valuenow",String(o.now)),s.setAttribute("aria-valuemin",String(o.min)),s.setAttribute("aria-valuemax",String(o.max))}),e)this.store()}report(e,t,s){let a=this.available(),o={sizes:[...this.sizes],pixels:this.sizes.map((n)=>Math.round(n*a)),index:e,source:t};if(this.callbacks.onResize?.(o),s)this.callbacks.onResizeEnd?.(o)}position(e){return this.direction==="horizontal"?e.clientX:e.clientY}onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();let s=this.separators[t];try{s.setPointerCapture(e.pointerId)}catch{}this.drag={index:t,start:this.position(e),sizes:[...this.sizes],pointer:e.pointerId},this.root.setAttribute("data-dragging",""),s.setAttribute("data-active","")}onPointerMove(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.sizes=kt(t.sizes,t.index,this.position(e)-t.start,this.available(),this.limits),this.apply(!1),this.report(t.index,"pointer",!1)}onPointerEnd(e){let t=this.drag;if(!t||e.pointerId!==t.pointer)return;this.drag=null,this.root.removeAttribute("data-dragging"),this.separators[t.index].removeAttribute("data-active");try{this.separators[t.index].releasePointerCapture(e.pointerId)}catch{}this.store(),this.report(t.index,"pointer",!0)}onKeyDown(e,t){let s=this.direction==="horizontal",a=this.available(),o=this.step*(e.shiftKey?5:1),n=0;if(e.key===(s?"ArrowLeft":"ArrowUp"))n=-o;else if(e.key===(s?"ArrowRight":"ArrowDown"))n=o;else if(e.key==="Home")n=-qe(this.sizes,t,a,this.limits).back;else if(e.key==="End")n=qe(this.sizes,t,a,this.limits).forward;else if(e.key==="Enter"){e.preventDefault(),this.reset(t);return}else return;e.preventDefault(),this.sizes=kt(this.sizes,t,n,a,this.limits),this.apply(!0),this.report(t,"keyboard",!0)}}var Sc="./Stepper-68gxcmej.stx";var $c="./StepperStep-zf4pq1s0.stx";class Ke{storage;namespace;watchers=new Map;encryptionKey="stx-storage-key";constructor(e="local",t=""){if(this.storage=e==="local"?globalThis.localStorage:globalThis.sessionStorage,this.namespace=t,typeof window<"u")window.addEventListener("storage",this.handleStorageEvent.bind(this))}handleStorageEvent(e){if(!e.key)return;let t=this.namespace&&e.key.startsWith(`${this.namespace}:`)?e.key.slice(this.namespace.length+1):e.key,s=this.watchers.get(t);if(s){let a=e.oldValue?JSON.parse(e.oldValue).value:null,o=e.newValue?JSON.parse(e.newValue).value:null;s.forEach((n)=>n(o,a,t))}}encrypt(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCharCode(e.charCodeAt(s)^this.encryptionKey.charCodeAt(s%this.encryptionKey.length));return btoa(t)}decrypt(e){try{let t=atob(e),s="";for(let a=0;a<t.length;a++)s+=String.fromCharCode(t.charCodeAt(a)^this.encryptionKey.charCodeAt(a%this.encryptionKey.length));return s}catch{return e}}compress(e){if(e.length<100)return e;let t={},s=256,a=[],o="";for(let n=0;n<e.length;n++){let r=e.charAt(n),i=o+r;if(t[i]!==void 0)o=i;else a.push(o.length>1?t[o]:o.charCodeAt(0)),t[i]=s++,o=r}if(o!=="")a.push(o.length>1?t[o]:o.charCodeAt(0));return JSON.stringify(a)}decompress(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return e;let s={},a=256,o=String.fromCharCode(t[0]),n=o;for(let r=1;r<t.length;r++){let i=t[r],c;if(s[i]!==void 0)c=s[i];else if(i===a)c=o+o.charAt(0);else return e;n+=c,s[a++]=o+c.charAt(0),o=c}return n}catch{return e}}getKey(e){return this.namespace?`${this.namespace}:${e}`:e}set(e,t,s){let a=this.getKey(e),o=this.get(e),n={value:t,timestamp:Date.now(),expire:s?.expire,encrypted:s?.encrypt||!1,compressed:s?.compress||!1};try{let r=JSON.stringify(n);if(s?.compress)r=this.compress(r);if(s?.encrypt)r=this.encrypt(r);this.storage.setItem(a,r),this.notifyWatchers(e,t,o)}catch(r){console.error("Storage set error:",r)}}get(e){let t=this.getKey(e);try{let s=this.storage.getItem(t);if(!s)return null;if(s.match(/^[A-Z0-9+/]+=*$/i))try{s=this.decrypt(s)}catch{}if(s.startsWith("["))try{s=this.decompress(s)}catch{}let a=JSON.parse(s);if(a.expire&&Date.now()-a.timestamp>a.expire)return this.remove(e),null;return a.value}catch(s){return console.error("Storage get error:",s),null}}watch(e,t){if(!this.watchers.has(e))this.watchers.set(e,new Set);return this.watchers.get(e).add(t),()=>{let s=this.watchers.get(e);if(s){if(s.delete(t),s.size===0)this.watchers.delete(e)}}}notifyWatchers(e,t,s){let a=this.watchers.get(e);if(a)a.forEach((o)=>o(t,s,e))}remove(e){let t=this.getKey(e),s=this.get(e);this.storage.removeItem(t),this.notifyWatchers(e,null,s)}clear(){if(this.namespace)this.keys().forEach((t)=>this.remove(t));else this.storage.clear()}has(e){return this.get(e)!==null}keys(){let e=Object.keys(this.storage);if(this.namespace){let t=`${this.namespace}:`;return e.filter((s)=>s.startsWith(t)).map((s)=>s.slice(t.length))}return e}size(){return this.keys().length}getQuota(){if("storage"in navigator&&"estimate"in navigator.storage)return null;try{let e=0;for(let s=0;s<this.storage.length;s++){let a=this.storage.key(s);if(a){let o=this.storage.getItem(a)||"";e+=a.length+o.length}}let t=5242880;return{usage:e*2,quota:t,percentage:e*2/t*100}}catch{return null}}setMany(e,t){Object.entries(e).forEach(([s,a])=>{this.set(s,a,t)})}getMany(e){let t={};return e.forEach((s)=>{t[s]=this.get(s)}),t}removeMany(e){e.forEach((t)=>this.remove(t))}}var cv={local:new Ke("local"),session:new Ke("session")};function dv(e="local",t){return new Ke(e,t)}var Ec="./Switch-ga9ap8n8.stx";var Ac="./Table-0a4y46vd.stx";var Mc="./TableBody-y49bqb1p.stx";var Nc="./TableCell-jhvsxw8b.stx";var Oc="./TableHead-e9xvjx2j.stx";var Dc="./TableHeader-krzcx4sv.stx";var jc="./TableRow-dt8e11aj.stx";var Fc="./Tab-j9f4t166.stx";var qc="./TabList-r1pc87xs.stx";var _c="./TabPanel-5htevsq6.stx";var Gc="./Tabs-psm5wj7c.stx";var Jc="./Teleport-vqs75x36.stx";var Xc="./Textarea-bb63fsz0.stx";var Qc="./AiTextarea-bg6xq5wc.stx";var td="./Tooltip-wy1nrv9a.stx";var ad="./Transition-7m0mk45s.stx";var nd="./Video-bqsx3wr8.stx";var id="./VirtualList-fa7v5a3h.stx";var cd="./VirtualTable-kp7b3wyv.stx";var dd=0;function ma(e="a11y"){return`${e}-${++dd}-${Date.now()}`}function rw(e,t,s={}){let{visible:a=!1,id:o=ma("label")}=s,n=document.createElement(a?"label":"span");if(n.id=o,n.textContent=e,!a)Object.assign(n.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"});if(t)if(t.setAttribute("aria-labelledby",o),t.parentElement)t.parentElement.insertBefore(n,t);else document.body.appendChild(n);return o}function iw(e,t){let s=ma("desc"),a=document.createElement("span");if(a.id=s,a.textContent=e,Object.assign(a.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t)if(t.setAttribute("aria-describedby",s),t.parentElement)t.parentElement.insertBefore(a,t);else document.body.appendChild(a);return s}function lw(e,t="polite"){let s=document.createElement("div");s.setAttribute("role","status"),s.setAttribute("aria-live",t),s.setAttribute("aria-atomic","true"),Object.assign(s.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(s),setTimeout(()=>{s.textContent=e},100),setTimeout(()=>{s.parentNode?.removeChild(s)},1000)}function Ct(e){let t=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(t)).filter((s)=>s.offsetParent!==null)}function cw(e,t={}){let{initialFocus:s,returnFocus:a,escapeDeactivates:o=!0,clickOutsideDeactivates:n=!0,allowOutsideClick:r=!1,onActivate:i,onDeactivate:c}=t,l=!1,d=!1,h=null,p=(v)=>{if(d)return;if(o&&v.key==="Escape"){v.preventDefault(),m();return}if(v.key==="Tab"){let b=Ct(e);if(b.length===0){v.preventDefault();return}let C=b[0],P=b[b.length-1];if(v.shiftKey){if(document.activeElement===C)v.preventDefault(),P.focus()}else if(document.activeElement===P)v.preventDefault(),C.focus()}},u=(v)=>{if(d)return;if(!e.contains(v.target)){if(typeof r==="function"){if(!r(v)&&n)m()}else if(!r&&n)m()}};function g(){if(l)return;l=!0,h=document.activeElement;let v=s||Ct(e)[0];if(v&&typeof v.focus==="function")v.focus();document.addEventListener("keydown",p),document.addEventListener("click",u),i?.()}function m(){if(!l)return;l=!1;let v=a||h;if(v&&typeof v.focus==="function")v.focus();document.removeEventListener("keydown",p),document.removeEventListener("click",u),c?.()}function w(){d=!0}function y(){d=!1}return{activate:g,deactivate:m,pause:w,unpause:y}}function dw(e,t={}){let{selector:s='[role="option"], [role="menuitem"], [role="tab"], button',initialIndex:a=0,orientation:o="both",loop:n=!0,onFocusChange:r}=t,i=a,c=()=>Array.from(e.querySelectorAll(s)),l=(h)=>{let p=c();if(h<0||h>=p.length)return;p.forEach((u,g)=>{if(g===h){if(u.setAttribute("tabindex","0"),typeof u.focus==="function")u.focus()}else u.setAttribute("tabindex","-1")}),i=h,r?.(h,p[h])},d=(h)=>{let u=c().length-1,g=!1,m=i;switch(h.key){case"ArrowRight":if(o==="horizontal"||o==="both"){if(m=i+1,m>u)m=n?0:u;g=!0}break;case"ArrowLeft":if(o==="horizontal"||o==="both"){if(m=i-1,m<0)m=n?u:0;g=!0}break;case"ArrowDown":if(o==="vertical"||o==="both"){if(m=i+1,m>u)m=n?0:u;g=!0}break;case"ArrowUp":if(o==="vertical"||o==="both"){if(m=i-1,m<0)m=n?u:0;g=!0}break;case"Home":m=0,g=!0;break;case"End":m=u,g=!0;break}if(g)h.preventDefault(),l(m)};return l(a),e.addEventListener("keydown",d),()=>{e.removeEventListener("keydown",d)}}var pw={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Tab:"Tab",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown"};function hw(e){return document.activeElement===e}function uw(e,t){let s=t||document.activeElement,a=Ct(document.body),o=a.indexOf(s);if(o===-1)return;let n=e==="next"?o+1:o-1,r=a[n];if(r)r.focus()}function fw(e){if(e.getAttribute("aria-hidden")==="true")return!1;let t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1;return!0}var mw={setExpanded(e,t){e.setAttribute("aria-expanded",String(t))},setSelected(e,t){e.setAttribute("aria-selected",String(t))},setChecked(e,t){e.setAttribute("aria-checked",String(t))},setDisabled(e,t){if(e.setAttribute("aria-disabled",String(t)),t)e.setAttribute("tabindex","-1");else e.removeAttribute("tabindex")},setHidden(e,t){if(t)e.setAttribute("aria-hidden","true");else e.removeAttribute("aria-hidden")},setPressed(e,t){e.setAttribute("aria-pressed",String(t))},setInvalid(e,t){e.setAttribute("aria-invalid",String(t))},setRequired(e,t){e.setAttribute("aria-required",String(t))},setLive(e,t){e.setAttribute("aria-live",t)},setBusy(e,t){e.setAttribute("aria-busy",String(t))}};function gw(e){let t=document.createElement("span");return t.textContent=e,t.className="sr-only",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),t}function xw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return!1}function bw(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-contrast: high)").matches;return!1}function vw(){if(typeof window.matchMedia==="function"){if(window.matchMedia("(prefers-color-scheme: dark)").matches)return"dark";if(window.matchMedia("(prefers-color-scheme: light)").matches)return"light"}return null}function ww(e,t="Skip to main content"){let s=document.createElement("a");return s.href=`#${e}`,s.textContent=t,s.className="skip-link",Object.assign(s.style,{position:"absolute",top:"-40px",left:"0",background:"#000",color:"#fff",padding:"8px",textDecoration:"none",zIndex:"100"}),s.addEventListener("focus",()=>{s.style.top="0"}),s.addEventListener("blur",()=>{s.style.top="-40px"}),s}function yw(e){let t=[],s=(a)=>{let o=e.getAttribute(a);if(o){let n=o.split(" ");for(let r of n)if(!document.getElementById(r))t.push(`${a} references non-existent ID: ${r}`)}};return s("aria-labelledby"),s("aria-describedby"),s("aria-controls"),s("aria-owns"),s("aria-activedescendant"),t}var pd=(e,t,s,a)=>s*e/a+t,hd=(e,t,s,a)=>(e/=a,s*e*e+t),ud=(e,t,s,a)=>(e/=a,-s*e*(e-2)+t),fd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e+t;return e--,-s/2*(e*(e-2)-1)+t},md=(e,t,s,a)=>(e/=a,s*e*e*e+t),gd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e+1)+t),xd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e+t;return e-=2,s/2*(e*e*e+2)+t},bd=(e,t,s,a)=>(e/=a,s*e*e*e*e+t),vd=(e,t,s,a)=>(e/=a,e--,-s*(e*e*e*e-1)+t),wd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e+t;return e-=2,-s/2*(e*e*e*e-2)+t},yd=(e,t,s,a)=>(e/=a,s*e*e*e*e*e+t),kd=(e,t,s,a)=>(e/=a,e--,s*(e*e*e*e*e+1)+t),Sd=(e,t,s,a)=>{if(e/=a/2,e<1)return s/2*e*e*e*e*e+t;return e-=2,s/2*(e*e*e*e*e+2)+t},Cd=(e,t,s,a)=>-s*Math.cos(e/a*(Math.PI/2))+s+t,$d=(e,t,s,a)=>s*Math.sin(e/a*(Math.PI/2))+t,Td=(e,t,s,a)=>-s/2*(Math.cos(Math.PI*e/a)-1)+t,Ed=(e,t,s,a)=>e===0?t:s*2**(10*(e/a-1))+t,Id=(e,t,s,a)=>e===a?t+s:s*(-(2**(-10*e/a))+1)+t,Ad=(e,t,s,a)=>{if(e===0)return t;if(e===a)return t+s;if(e/=a/2,e<1)return s/2*2**(10*(e-1))+t;return e--,s/2*(-(2**(-10*e))+2)+t},Pd=(e,t,s,a)=>(e/=a,-s*(Math.sqrt(1-e*e)-1)+t),Md=(e,t,s,a)=>(e/=a,e--,s*Math.sqrt(1-e*e)+t),Rd=(e,t,s,a)=>{if(e/=a/2,e<1)return-s/2*(Math.sqrt(1-e*e)-1)+t;return e-=2,s/2*(Math.sqrt(1-e*e)+1)+t},Nd=(e,t,s,a)=>{let o=1.70158,n=0,r=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(r<Math.abs(s))r=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/r);return e-=1,-(r*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t},Ld=(e,t,s,a)=>{let o=1.70158,n=0,r=s;if(e===0)return t;if(e/=a,e===1)return t+s;if(!n)n=a*0.3;if(r<Math.abs(s))r=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/r);return r*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)+s+t},Od=(e,t,s,a)=>{let o=1.70158,n=0,r=s;if(e===0)return t;if(e/=a/2,e===2)return t+s;if(!n)n=a*0.44999999999999996;if(r<Math.abs(s))r=s,o=n/4;else o=n/(2*Math.PI)*Math.asin(s/r);if(e<1)return e-=1,-0.5*(r*2**(10*e)*Math.sin((e*a-o)*(2*Math.PI)/n))+t;return e-=1,r*2**(-10*e)*Math.sin((e*a-o)*(2*Math.PI)/n)*0.5+s+t},zd=(e,t,s,a)=>(e/=a,s*e*e*(2.70158*e-1.70158)+t),Dd=(e,t,s,a)=>(e/=a,e--,s*(e*e*(2.70158*e+1.70158)+1)+t),Hd=(e,t,s,a)=>{let o=1.70158;if(e/=a/2,e<1)return o*=1.525,s/2*(e*e*((o+1)*e-o))+t;return e-=2,o*=1.525,s/2*(e*e*((o+1)*e+o)+2)+t},$t=(e,t,s,a)=>{if(e/=a,e<0.36363636363636365)return s*(7.5625*e*e)+t;else if(e<0.7272727272727273)return e-=0.5454545454545454,s*(7.5625*e*e+0.75)+t;else if(e<0.9090909090909091)return e-=0.8181818181818182,s*(7.5625*e*e+0.9375)+t;else return e-=0.9545454545454546,s*(7.5625*e*e+0.984375)+t},ga=(e,t,s,a)=>s-$t(a-e,0,s,a)+t,jd=(e,t,s,a)=>{if(e<a/2)return ga(e*2,0,s,a)*0.5+t;return $t(e*2-a,0,s,a)*0.5+s*0.5+t},Sw={linear:pd,easeInQuad:hd,easeOutQuad:ud,easeInOutQuad:fd,easeInCubic:md,easeOutCubic:gd,easeInOutCubic:xd,easeInQuart:bd,easeOutQuart:vd,easeInOutQuart:wd,easeInQuint:yd,easeOutQuint:kd,easeInOutQuint:Sd,easeInSine:Cd,easeOutSine:$d,easeInOutSine:Td,easeInExpo:Ed,easeOutExpo:Id,easeInOutExpo:Ad,easeInCirc:Pd,easeOutCirc:Md,easeInOutCirc:Rd,easeInElastic:Nd,easeOutElastic:Ld,easeInOutElastic:Od,easeInBack:zd,easeOutBack:Dd,easeInOutBack:Hd,easeInBounce:ga,easeOutBounce:$t,easeInOutBounce:jd};function Vd(e,t={}){let{duration:s="1s",timing:a="ease",delay:o="0s",iteration:n="1",direction:r="normal",fill:i="both",playState:c="running"}=t;return`${e} ${s} ${a} ${o} ${n} ${r} ${i} ${c}`}function xa(e,t,s={}){e.style.animation=Vd(t,s)}function $w(e){e.style.animation=""}function Fd(e){return new Promise((t)=>{let s=()=>{e.removeEventListener("animationend",s),t()};e.addEventListener("animationend",s)})}function Tw(e,t,s={}){let{stagger:a=100,...o}=s;e.forEach((n,r)=>{let i=`${r*a}ms`;xa(n,t,{...o,delay:i})})}async function Ew(e,t){for(let s of t)xa(e,s.name,s.options),await Fd(e)}var Iw={fadeIn:"animate-fade-in",fadeOut:"animate-fade-out",slideInUp:"animate-slide-in-up",slideInDown:"animate-slide-in-down",slideInLeft:"animate-slide-in-left",slideInRight:"animate-slide-in-right",zoomIn:"animate-zoom-in",zoomOut:"animate-zoom-out",bounce:"animate-bounce",spin:"animate-spin",ping:"animate-ping",pulse:"animate-pulse"};function Aw(e,t,s=1000){return new Promise((a)=>{e.classList.add(t),setTimeout(()=>{e.classList.remove(t),a()},s)})}function Pw(e,t){let s=`
|
|
14
14
|
@keyframes ${e} {
|
|
15
15
|
${Object.entries(t).map(([o,n])=>{let r=Object.entries(n).map(([i,c])=>`${i}: ${c};`).join(" ");return`${o} { ${r} }`}).join(`
|
|
16
16
|
`)}
|