@stacksjs/components 0.2.584 → 0.2.586
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/SegmentedControl-z2p70zps.stx +124 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -7
- package/dist/ui/segmented-control/SegmentedControl.d.ts +70 -0
- package/dist/ui/segmented-control/index.d.ts +23 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/ui/segmented-control/SegmentedControl.stx +124 -0
- package/src/ui/segmented-control/index.ts +29 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
/*
|
|
3
|
+
* A segmented control: a few mutually exclusive choices in one track, the
|
|
4
|
+
* chosen one raised. The control iOS draws as UISegmentedControl and a phone
|
|
5
|
+
* app reaches for whenever a list has two to five ways to be shown.
|
|
6
|
+
*
|
|
7
|
+
* It is what applications kept drawing for themselves. One app copied the
|
|
8
|
+
* same track-and-segment markup into ten native screens and a stylesheet; the
|
|
9
|
+
* other drew seven by hand on the web, each with its own roles, and on native
|
|
10
|
+
* had none at all - a "Change the filter" button that cycled through the
|
|
11
|
+
* choices one tap at a time, so nobody could see what the others were.
|
|
12
|
+
*
|
|
13
|
+
* The same source renders on both targets. Each segment is a button with
|
|
14
|
+
* `aria-pressed`, inside a labelled group, which is what a toggle set is
|
|
15
|
+
* (a radio group would promise arrow-key roving the segments do not need,
|
|
16
|
+
* and tabs would promise panels). On a phone the host announces the chosen
|
|
17
|
+
* segment as selected, from the same attribute.
|
|
18
|
+
*
|
|
19
|
+
* <SegmentedControl v-model:value="period" label="Period" stretch
|
|
20
|
+
* :options="[{ value: 'week', label: 'This week' }, { value: 'all', label: 'All time' }]" />
|
|
21
|
+
*
|
|
22
|
+
* `options` takes strings or `{ value, label, disabled? }`; it is reactive,
|
|
23
|
+
* so a label carrying a count can change in place. The selection is a
|
|
24
|
+
* `v-model:value`, or `:value` with `@change`, which receives the new value.
|
|
25
|
+
* `testID` names the group, and each segment is `<testID>-<value>`.
|
|
26
|
+
*
|
|
27
|
+
* Colour and shape come from roles, so an app restyles it without touching
|
|
28
|
+
* it: the track is `surface-sunken`, the chosen segment `panel` (one step
|
|
29
|
+
* lighter than the track in dark mode, as iOS draws it), the words `fg` and
|
|
30
|
+
* `fg-muted`, and both corners `rounded-control` - a pill-shaped app gets a
|
|
31
|
+
* pill track by setting that one role.
|
|
32
|
+
*/
|
|
33
|
+
export const value = $props.value ?? ''
|
|
34
|
+
export const options = $props.options || []
|
|
35
|
+
export const label = $props.label || ''
|
|
36
|
+
export const stretch = $bool($props.stretch)
|
|
37
|
+
export const disabled = $bool($props.disabled)
|
|
38
|
+
export const size = $props.size === 'sm' ? 'sm' : 'md'
|
|
39
|
+
export const testID = $props.testID || ''
|
|
40
|
+
export const className = $props.className || ''
|
|
41
|
+
|
|
42
|
+
const sizeClasses = {
|
|
43
|
+
sm: { segment: 'min-h-[28px] px-2.5 py-1', text: 'text-[13px]' },
|
|
44
|
+
md: { segment: 'min-h-[32px] px-3 py-1.5', text: 'text-[13px]' },
|
|
45
|
+
}
|
|
46
|
+
export const sizing = sizeClasses[size]
|
|
47
|
+
|
|
48
|
+
export const trackClasses = `${stretch ? 'flex w-full' : 'inline-flex'} flex-row gap-0.5 p-0.5 rounded-control bg-surface-sunken ${className}`.replace(/\s+/g, ' ').trim()
|
|
49
|
+
export const segmentBase = `${stretch ? 'flex-1' : ''} items-center justify-center rounded-control transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${sizing.segment}`.replace(/\s+/g, ' ').trim()
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<script client>
|
|
53
|
+
const emit = defineEmits(['change'])
|
|
54
|
+
const selected = useModel('value', { default: {{ value }}, parse: v => v == null ? '' : String(v) })
|
|
55
|
+
const choices = useReactiveProp('options', {{ options }})
|
|
56
|
+
const isDisabled = useReactiveProp('disabled', {{ disabled }})
|
|
57
|
+
const segmentBase = {{ segmentBase }}
|
|
58
|
+
const textSize = {{ sizing.text }}
|
|
59
|
+
const groupID = {{ testID }}
|
|
60
|
+
|
|
61
|
+
/** A choice as `{ value, label, disabled }`, whichever way it was written. */
|
|
62
|
+
function normalise(choice) {
|
|
63
|
+
if (choice !== null && typeof choice === 'object') {
|
|
64
|
+
const value = choice.value == null ? '' : String(choice.value)
|
|
65
|
+
return { value, label: choice.label == null ? value : String(choice.label), disabled: choice.disabled === true }
|
|
66
|
+
}
|
|
67
|
+
const value = choice == null ? '' : String(choice)
|
|
68
|
+
return { value, label: value, disabled: false }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function segments() {
|
|
72
|
+
const list = choices()
|
|
73
|
+
return Array.isArray(list) ? list.map(normalise) : []
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isOn(segment) {
|
|
77
|
+
return segment.value === selected()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function isOff(segment) {
|
|
81
|
+
return isDisabled() || segment.disabled
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function choose(segment) {
|
|
85
|
+
if (isOff(segment) || isOn(segment)) return
|
|
86
|
+
selected.set(segment.value)
|
|
87
|
+
emit('change', segment.value)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function segmentClasses(segment) {
|
|
91
|
+
const state = isOn(segment) ? 'bg-panel dark:bg-neutral-600 shadow-sm' : 'bg-transparent'
|
|
92
|
+
return `${segmentBase} ${state} ${isOff(segment) ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function labelClasses(segment) {
|
|
96
|
+
return `${textSize} ${isOn(segment) ? 'font-semibold text-fg' : 'font-medium text-fg-muted'}`
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function segmentID(segment) {
|
|
100
|
+
return groupID ? `${groupID}-${segment.value}` : ''
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
defineExpose({ selected })
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<div
|
|
107
|
+
role="group"
|
|
108
|
+
@if(label)aria-label="{{ label }}"@endif
|
|
109
|
+
@if(testID)testID="{{ testID }}"@endif
|
|
110
|
+
class="{{ trackClasses }}"
|
|
111
|
+
data-stx-segmented-control
|
|
112
|
+
>
|
|
113
|
+
<button
|
|
114
|
+
:for="segment in segments()"
|
|
115
|
+
:key="segment.value"
|
|
116
|
+
type="button"
|
|
117
|
+
:testID="segmentID(segment)"
|
|
118
|
+
:aria-pressed="isOn(segment) ? 'true' : 'false'"
|
|
119
|
+
:aria-disabled="isOff(segment) ? 'true' : 'false'"
|
|
120
|
+
:disabled="isOff(segment)"
|
|
121
|
+
:class="segmentClasses(segment)"
|
|
122
|
+
@click="choose(segment)"
|
|
123
|
+
><span :class="labelClasses(segment)" :text="segment.label"></span></button>
|
|
124
|
+
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export * from './ui/portal/index';
|
|
|
73
73
|
export * from './ui/progress/index';
|
|
74
74
|
export * from './ui/radio/index';
|
|
75
75
|
export * from './ui/radio-group/index';
|
|
76
|
+
export * from './ui/segmented-control/index';
|
|
76
77
|
export * from './ui/select/index';
|
|
77
78
|
export * from './ui/sidebar/index';
|
|
78
79
|
export * from './ui/skeleton/index';
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Xe={__stx:!0,src:"./components/CodeBlock.stx"};var Qe={__stx:!0,src:"./components/Footer.stx"};var Ze={__stx:!0,src:"./components/Hero.stx"};var et={__stx:!0,src:"./components/Installation.stx"};function
|
|
3
|
-
`)}function N(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function
|
|
2
|
+
var Xe={__stx:!0,src:"./components/CodeBlock.stx"};var Qe={__stx:!0,src:"./components/Footer.stx"};var Ze={__stx:!0,src:"./components/Hero.stx"};var et={__stx:!0,src:"./components/Installation.stx"};function Sr(e){let{code:t,onSuccess:s,onError:o,timeout:n=2000}=e,a=!1,r=null;return{copied:a,copy:async()=>{try{if(!navigator.clipboard)throw Error("Clipboard API not available");await navigator.clipboard.writeText(t),a=!0,s?.(),r=setTimeout(()=>{a=!1,r=null},n)}catch(p){let u=p instanceof Error?p:Error("Failed to copy code");o?.(u),console.error("Failed to copy code:",u)}},reset:()=>{if(a=!1,r)clearTimeout(r),r=null}}}async function Tr(e){try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.error("Failed to copy to clipboard:",t),!1}}function tt(){if(typeof window>"u")return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function xe(e){return e==="system"?tt():e}function Ir(e={}){let{storageKey:t="theme",defaultTheme:s="system"}=e,o=s;if(typeof window<"u"&&typeof localStorage<"u"){let c=localStorage.getItem(t);if(c)o=c}let n=xe(o)==="dark",a=(c)=>{let p=xe(c);if(typeof document<"u")if(p==="dark")document.documentElement.classList.add("dark");else document.documentElement.classList.remove("dark");if(typeof localStorage<"u")localStorage.setItem(t,c)},r=(c)=>{o=c,a(c)},i=()=>{let p=xe(o)==="dark"?"light":"dark";r(p)};if(a(o),typeof window<"u"&&o==="system")window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(c)=>{if(o==="system")a("system")});return{isDark:n,theme:o,toggle:i,setTheme:r}}function st(e,t){if(typeof document>"u")return;document.title=t?t.replace("%s",e):e}function L(e,t,s=!1){if(typeof document>"u")return;let o=s?"property":"name",n=document.querySelector(`meta[${o}="${e}"]`);if(!n)n=document.createElement("meta"),n.setAttribute(o,e),document.head.appendChild(n);n.setAttribute("content",t)}function ot(e,t){if(typeof document>"u")return;let s=document.querySelector(`link[rel="${e}"]`);if(!s)s=document.createElement("link"),s.setAttribute("rel",e),document.head.appendChild(s);s.setAttribute("href",t)}function Pr(e){let{title:t,description:s,author:o,keywords:n,ogImage:a,ogImageWidth:r,ogImageHeight:i,twitterCard:c="summary_large_image",twitterSite:p,twitterCreator:u,canonical:d}=e;if(t)st(t),L("og:title",t,!0),L("twitter:title",t);if(s)L("description",s),L("og:description",s,!0),L("twitter:description",s);if(o)L("author",o);if(n&&n.length>0)L("keywords",n.join(", "));if(a)L("og:image",a,!0),L("twitter:image",a);if(r)L("og:image:width",r,!0);if(i)L("og:image:height",i,!0);if(L("twitter:card",c),p)L("twitter:site",p);if(u)L("twitter:creator",u);if(d)ot("canonical",d);if(L("og:type","website",!0),typeof window<"u")L("og:url",window.location.href,!0)}function Or(e){let t=[],{title:s,description:o,author:n,keywords:a,ogImage:r,ogImageWidth:i,ogImageHeight:c,twitterCard:p="summary_large_image",twitterSite:u,twitterCreator:d,canonical:g}=e;if(s)t.push(`<title>${N(s)}</title>`),t.push(`<meta property="og:title" content="${N(s)}" />`),t.push(`<meta name="twitter:title" content="${N(s)}" />`);if(o)t.push(`<meta name="description" content="${N(o)}" />`),t.push(`<meta property="og:description" content="${N(o)}" />`),t.push(`<meta name="twitter:description" content="${N(o)}" />`);if(n)t.push(`<meta name="author" content="${N(n)}" />`);if(a&&a.length>0)t.push(`<meta name="keywords" content="${N(a.join(", "))}" />`);if(r)t.push(`<meta property="og:image" content="${N(r)}" />`),t.push(`<meta name="twitter:image" content="${N(r)}" />`);if(i)t.push(`<meta property="og:image:width" content="${N(i)}" />`);if(c)t.push(`<meta property="og:image:height" content="${N(c)}" />`);if(t.push(`<meta name="twitter:card" content="${N(p)}" />`),u)t.push(`<meta name="twitter:site" content="${N(u)}" />`);if(d)t.push(`<meta name="twitter:creator" content="${N(d)}" />`);if(g)t.push(`<link rel="canonical" href="${N(g)}" />`);return t.push('<meta property="og:type" content="website" />'),t.join(`
|
|
3
|
+
`)}function N(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Nr(e,t,s={}){let{enabled:o=!0,ignore:n=[]}=s,a=(r)=>{if(!o||!e)return;let i=r.target;if(!e.contains(i)){if(!n.some((p)=>{let u=document.querySelectorAll(p);return Array.from(u).some((d)=>d.contains(i))}))t(r)}};if(typeof document<"u")document.addEventListener("mousedown",a),document.addEventListener("touchstart",a);return()=>{if(typeof document<"u")document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}}function Mr(e,t={}){let{enabled:s=!0,initialFocus:o=null,returnFocus:n=!0,fallbackFocus:a=null}=t,r=null,i=!1;function c(){if(!e)return[];let m=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");return Array.from(e.querySelectorAll(m))}function p(m){if(!s||!i||!e)return;let k=c();if(k.length===0){m.preventDefault();return}let C=k[0],y=k[k.length-1];if(m.shiftKey){if(document.activeElement===C||document.activeElement===e)m.preventDefault(),y.focus()}else if(document.activeElement===y)m.preventDefault(),C.focus()}function u(m){if(m.key==="Escape"&&s&&i)g()}function d(){if(!s||!e||i)return;if(r=document.activeElement,o)o.focus();else{let m=c();if(m.length>0)m[0].focus();else if(a)a.focus();else e.focus()}document.addEventListener("keydown",p),document.addEventListener("keydown",u),i=!0}function g(){if(!i)return;if(document.removeEventListener("keydown",p),document.removeEventListener("keydown",u),n&&r)r.focus();i=!1}return{activate:d,deactivate:g}}function zr(e,t={}){let{enabled:s=!0,preventDefault:o=!0,stopPropagation:n=!1,target:a=typeof document<"u"?document:null}=t,r=Array.isArray(e)?e:[e],i=(c)=>{if(!s)return;r.forEach((p)=>{if(!(Array.isArray(p.key)?p.key:[p.key]).some((g)=>g.toLowerCase()===c.key.toLowerCase()))return;if(p.ctrl!==void 0&&p.ctrl!==c.ctrlKey)return;if(p.shift!==void 0&&p.shift!==c.shiftKey)return;if(p.alt!==void 0&&p.alt!==c.altKey)return;if(p.meta!==void 0&&p.meta!==c.metaKey)return;if(o)c.preventDefault();if(n)c.stopPropagation();p.handler(c)})};if(a)a.addEventListener("keydown",i);return()=>{if(a)a.removeEventListener("keydown",i)}}var jr={ESCAPE:"Escape",ENTER:"Enter",SPACE:" ",TAB:"Tab",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",HOME:"Home",END:"End",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"};function Fr(e,t,s={}){let{serializer:o=JSON.stringify,deserializer:n=JSON.parse,onError:a=console.error}=s,r=t;try{if(typeof window<"u"){let d=window.localStorage.getItem(e);if(d!==null)r=n(d)}}catch(d){a(d)}let i=r,c=new Set;function p(d){try{let g=typeof d==="function"?d(i):d;if(i=g,typeof window<"u")window.localStorage.setItem(e,o(g));c.forEach((m)=>m(g))}catch(g){a(g)}}function u(){try{if(i=t,typeof window<"u")window.localStorage.removeItem(e);c.forEach((d)=>d(t))}catch(d){a(d)}}if(typeof window<"u"){let d=(g)=>{if(g.key===e&&g.newValue!==null)try{let m=n(g.newValue);i=m,c.forEach((k)=>k(m))}catch(m){a(m)}else if(g.key===e&&g.newValue===null)i=t,c.forEach((m)=>m(t))};window.addEventListener("storage",d)}return{value:i,setValue:p,removeValue:u}}function X(e,t={}){let{defaultValue:s=!1}=t,o=s,n=null;if(typeof window<"u"&&"matchMedia"in window){n=window.matchMedia(e),o=n.matches;let r=(i)=>{o=i.matches};if(n.addEventListener)n.addEventListener("change",r);else n.addListener(r)}function a(){if(n)o=n.matches}return{matches:o,updateMatches:a}}var Q={xs:"(min-width: 320px)",sm:"(min-width: 640px)",md:"(min-width: 768px)",lg:"(min-width: 1024px)",xl:"(min-width: 1280px)","2xl":"(min-width: 1536px)",mobile:"(max-width: 767px)",tablet:"(min-width: 768px) and (max-width: 1023px)",desktop:"(min-width: 1024px)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)",reducedMotion:"(prefers-reduced-motion: reduce)",portrait:"(orientation: portrait)",landscape:"(orientation: landscape)"};function Br(e){return X(Q[e])}function qr(){return X(Q.mobile)}function Wr(){return X(Q.desktop)}function Kr(){return X(Q.dark)}function _r(){return X(Q.reducedMotion)}function se(){return globalThis.stx?.overlays}function Jr(e,t){se()?.open(e,t)}function Gr(e){se()?.close(e)}function Yr(e){return se()?.isTop(e)??!1}function Xr(){return se()?.list()??[]}var Oe=["gray","neutral","slate","zinc","red","green","yellow","blue","indigo"],Zr="--stx-color";function nt(e,t){return t===void 0?`var(${e})`:`var(${e}, ${t})`}function ei(e={}){let t={};for(let s of Oe){let o=e[s];if(!o||typeof o==="string")continue;let n={};for(let[a,r]of Object.entries(o))n[a]=nt(`--stx-color-${s}-${a}`,r);t[s]=n}return t}function ti(e={}){let t=[];for(let s of Oe){let o=e[s];if(!o||typeof o==="string")continue;for(let n of Object.keys(o))t.push(`--stx-color-${s}-${n}`)}return t}var rt="./Accordion-ehpymjam.stx";var lt="./AccordionItem-fc4ekdqf.stx";var dt="./Audio-ay34sh1f.stx";var ut="./Login-4666t7j4.stx";var ft="./Signup-pm2r0f2m.stx";var gt="./TwoFactorChallenge-3tsbfdsd.stx";var xt="./Avatar-6gexb2xv.stx";var wt="./Badge-33phrqza.stx";var kt="./Breadcrumb-cgw1bb6s.stx";class R extends Error{component;context;constructor(e,t,s={}){let o=R.formatMessage(e,t,s);super(o);if(this.name="ComponentError",this.component=e,this.context={component:e,...s},Error.captureStackTrace)Error.captureStackTrace(this,R)}static formatMessage(e,t,s){let o=`[${e}] ${t}`;if(s.prop)o+=`
|
|
4
4
|
Prop: "${s.prop}"`;if(s.received!==void 0)o+=`
|
|
5
5
|
Received: ${JSON.stringify(s.received)}`;if(s.expected!==void 0){let n=Array.isArray(s.expected)?s.expected.map((a)=>JSON.stringify(a)).join(", "):JSON.stringify(s.expected);o+=`
|
|
6
6
|
Expected: ${n}`}if(s.details)o+=`
|
|
7
7
|
Details: ${s.details}`;if(s.docsUrl)o+=`
|
|
8
8
|
Documentation: ${s.docsUrl}`;else if(e)o+=`
|
|
9
|
-
Documentation: https://stacksjs.com/components/${e.toLowerCase()}`;return o}toJSON(){return{name:this.name,message:this.message,component:this.component,context:this.context,stack:this.stack}}}var G={invalidProp(e,t,s,o){return new R(e,`Invalid prop value for "${t}"`,{prop:t,received:s,expected:o,details:Array.isArray(o)?`The "${t}" prop must be one of the allowed values`:`The "${t}" prop does not match the expected type`})},requiredProp(e,t){return new R(e,`Required prop "${t}" is missing`,{prop:t,details:`The "${t}" prop is required for ${e} to function correctly`})},invalidType(e,t,s,o){return new R(e,`Invalid type for prop "${t}"`,{prop:t,received:typeof s,expected:o,details:`Expected "${t}" to be of type ${o}, but received ${typeof s}`})},componentNotFound(e){return new R("ComponentLoader",`Component "${e}" not found`,{component:e,details:"Make sure the component is properly imported and registered"})},invalidChildren(e,t,s){return new R(e,"Invalid children",{received:typeof t,expected:s,details:`${e} expects ${s} as children`})},stateUpdate(e,t,s){return new R(e,`Failed to update state "${t}"`,{details:s.message})},eventHandler(e,t,s){return new R(e,`Error in "${t}" event handler`,{details:s.message})},render(e,t){return new R(e,"Failed to render component",{details:t.message})}},oe=null;function
|
|
9
|
+
Documentation: https://stacksjs.com/components/${e.toLowerCase()}`;return o}toJSON(){return{name:this.name,message:this.message,component:this.component,context:this.context,stack:this.stack}}}var G={invalidProp(e,t,s,o){return new R(e,`Invalid prop value for "${t}"`,{prop:t,received:s,expected:o,details:Array.isArray(o)?`The "${t}" prop must be one of the allowed values`:`The "${t}" prop does not match the expected type`})},requiredProp(e,t){return new R(e,`Required prop "${t}" is missing`,{prop:t,details:`The "${t}" prop is required for ${e} to function correctly`})},invalidType(e,t,s,o){return new R(e,`Invalid type for prop "${t}"`,{prop:t,received:typeof s,expected:o,details:`Expected "${t}" to be of type ${o}, but received ${typeof s}`})},componentNotFound(e){return new R("ComponentLoader",`Component "${e}" not found`,{component:e,details:"Make sure the component is properly imported and registered"})},invalidChildren(e,t,s){return new R(e,"Invalid children",{received:typeof t,expected:s,details:`${e} expects ${s} as children`})},stateUpdate(e,t,s){return new R(e,`Failed to update state "${t}"`,{details:s.message})},eventHandler(e,t,s){return new R(e,`Error in "${t}" event handler`,{details:s.message})},render(e,t){return new R(e,"Failed to render component",{details:t.message})}},oe=null;function Ei(e){oe=e}function Ii(){oe=null}function ne(e,t={}){let{throwError:s=!0,logError:o=!0}=t;if(o){if(console.error("Component Error:",e),e instanceof R)console.group("Error Details"),console.log("Component:",e.component),console.log("Context:",e.context),console.groupEnd()}if(oe)try{oe(e)}catch(n){console.error("Error in error handler:",n)}if(s)throw e}function Le(e,t,s){return(...o)=>{try{let n=e(...o);if(n instanceof Promise)return n.catch((a)=>{let r=G.eventHandler(t,s,a);throw ne(r,{throwError:!1}),r});return n}catch(n){let a=G.eventHandler(t,s,n);throw ne(a,{throwError:!1}),a}}}function Ct(e,t){if(!e)throw t}function $t(e,t,s={}){let o=R.formatMessage(e,t,s);console.warn(`\u26A0\uFE0F ${o}`)}function Ai(e,t){Ct(e,t)}function Pi(e){let t=typeof process<"u"&&process.env.DEBUG==="true";return{log(...s){if(t)console.log(`[${e}]`,...s)},warn(s,o){$t(e,s,o)},error(s,o){let n=new R(e,s,o);ne(n,{throwError:!1})}}}function Oi(e,t,s){try{return t()}catch(o){let n=G.render(e,o);return ne(n,{throwError:!1}),s}}class O{validate;message;isRequired;constructor(e,t,s=!1){this.validate=e;this.message=t;this.isRequired=s}get required(){return new O(this.validate,this.message,!0)}}var l={string:new O((e)=>typeof e==="string",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`string\`.`),number:new O((e)=>typeof e==="number"&&!Number.isNaN(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`number\`.`),boolean:new O((e)=>typeof e==="boolean",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`boolean\`.`),func:new O((e)=>typeof e==="function",(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`function\`.`),object:new O((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 O((e)=>Array.isArray(e),(e,t,s)=>`Invalid prop \`${t}\` of type \`${typeof e}\` supplied to \`${s}\`, expected \`array\`.`),any:new O(()=>!0,()=>""),oneOf(e){return new O((t)=>e.includes(t),(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected one of [${e.map((n)=>JSON.stringify(n)).join(", ")}].`)},oneOfType(e){return new O((t,s,o)=>e.some((n)=>n.validate(t,s,o)),(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected one of the specified types.`)},arrayOf(e){return new O((t,s,o)=>{if(!Array.isArray(t))return!1;return t.every((n,a)=>e.validate(n,`${s}[${a}]`,o))},(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected array of specified type.`)},shape(e){return new O((t,s,o)=>{if(typeof t!=="object"||t===null||Array.isArray(t))return!1;for(let[n,a]of Object.entries(e)){if(a.isRequired&&!(n in t))return!1;if(n in t&&!a.validate(t[n],`${s}.${n}`,o))return!1}return!0},(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected object matching specified shape.`)},instanceOf(e){return new O((t)=>t instanceof e,(t,s,o)=>`Invalid prop \`${s}\` supplied to \`${o}\`, expected instance of \`${e.name}\`.`)},custom(e,t){return new O(e,typeof t==="string"?()=>t:t)},min(e){return new O((t)=>typeof t==="number"&&t>=e,(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected value >= ${e}.`)},max(e){return new O((t)=>typeof t==="number"&&t<=e,(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected value <= ${e}.`)},range(e,t){return new O((s)=>typeof s==="number"&&s>=e&&s<=t,(s,o,n)=>`Invalid prop \`${o}\` of value \`${s}\` supplied to \`${n}\`, expected value between ${e} and ${t}.`)},pattern(e){return new O((t)=>typeof t==="string"&&e.test(t),(t,s,o)=>`Invalid prop \`${s}\` of value \`${t}\` supplied to \`${o}\`, expected value matching pattern ${e}.`)},email:new O((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 O((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 St(e,t,s,o={}){let{throwOnError:n=!1,logWarnings:a=!0}=o,r=[];for(let[i,c]of Object.entries(s)){let p=t[i],u=p===void 0;if(c.isRequired&&u){let d=`Required prop \`${i}\` was not specified in \`${e}\`.`;r.push(d);continue}if(u)continue;if(!c.validate(p,i,e)){let d=c.message(p,i,e);r.push(d)}}if(r.length>0){if(a)console.group(`\u26A0\uFE0F Prop validation failed for \`${e}\``),r.forEach((i)=>console.warn(i)),console.groupEnd();if(n)throw Error(`Prop validation failed for \`${e}\`:
|
|
10
10
|
${r.join(`
|
|
11
|
-
`)}`)}return{valid:r.length===0,errors:r}}function H(e,t,s){return(o)=>St(e,o,t,s)}function Li(e,t,s="value"){if(!t.validate(e,s,"assertion"))throw Error(t.message(e,s,"assertion"))}function Oi(e,t,s="value"){if(!t.validate(e,s,"warning"))console.warn(t.message(e,s,"warning"))}var Et="./Button-55ahz0j6.stx";var It={variant:l.oneOf(["primary","secondary","outline","ghost","danger"]),size:l.oneOf(["xs","sm","md","lg","xl"]),disabled:l.boolean,loading:l.boolean,type:l.oneOf(["button","submit","reset"]),fullWidth:l.boolean,label:l.string,text:l.string,leftIcon:l.string,rightIcon:l.string,className:l.string,onClick:l.func},zi=H("Button",It);function ji(e){return Oe(e,"Button","onClick")}function Hi(e){if(e&&!["primary","secondary","outline","ghost","danger"].includes(e))throw G.invalidProp("Button","variant",e,["primary","secondary","outline","ghost","danger"])}function Fi(e){if(e&&!["xs","sm","md","lg","xl"].includes(e))throw G.invalidProp("Button","size",e,["xs","sm","md","lg","xl"])}var Pt="./Calendar-5vs6x7gj.stx";var Ot="./DateRangePicker-4zmf34e4.stx";var Dt="./EmptyState-s790dbym.stx";var Rt="./ThemeToggle-4wm9zare.stx";var jt="./Card-r55zpjqh.stx";var Ft="./Checkbox-etjvbbxq.stx";var Bt="./Combobox-9n04ec5w.stx";var Wt="./ComboboxButton-4r6a45s1.stx";var _t="./ComboboxInput-1gyfpnca.stx";var Jt="./ComboboxOption-wkw70js7.stx";var Yt="./ComboboxOptions-zhr9b6rx.stx";var Qt="./CommandPalette-qqjdbcyg.stx";var es="./CommandPaletteItem-7290ce1z.stx";var ss="./Dialog-v79kqbbz.stx";var ns="./DialogBackdrop-de5m5m4w.stx";var rs="./DialogDescription-gth4c2kx.stx";var ls="./DialogPanel-vhdqymc2.stx";var ds="./DialogTitle-ke58hh68.stx";var us="./Drawer-4rqfcg4f.stx";var fs="./Dropdown-hb8ks69x.stx";var gs="./DropdownButton-wxc25hsy.stx";var xs="./DropdownItem-af0vzc8a.stx";var ws="./DropdownItems-bkz7jkyz.stx";var ks="./Form-cybgg9ym.stx";var Cs={action:l.string,method:l.oneOf(["GET","POST","PUT","DELETE","PATCH"]),validationSchema:l.object,initialValues:l.object,validateOnChange:l.boolean,validateOnBlur:l.boolean,onSubmit:l.func,onError:l.func,className:l.string},Jl=H("Form",Cs);var Ss="./Image-16s7e6m2.stx";var Es="./EmailInput-57626391.stx";var As="./NumberInput-pq4k2k4k.stx";var Ls="./PasswordInput-dg41ktgd.stx";var Ns="./SearchInput-w15r5t95.stx";var Ms="./TextInput-nknmz9md.stx";var Rs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string},zs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,leftIcon:l.string,rightIcon:l.string,clearable:l.boolean,maxLength:l.number,showCount:l.boolean,type:l.oneOf(["text","date","time","datetime-local","month","week","url","tel","color","search","email","number","password"]),pattern:l.string,list:l.string,minLength:l.number,htmlSize:l.number,autofocus:l.boolean},js={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,min:l.number,max:l.number,step:l.number,showControls:l.boolean},Hs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,showStrength:l.boolean},Fs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,onSearch:l.func,loading:l.boolean},rc=H("TextInput",zs),ic=H("EmailInput",Rs),lc=H("PasswordInput",Hs),cc=H("NumberInput",js),dc=H("SearchInput",Fs);var Bs="./Listbox-83j2q4x6.stx";var Ws="./ListboxButton-gan8e3nw.stx";var _s="./ListboxLabel-ka0hfm7b.stx";var Js="./ListboxOption-gpaqvk3s.stx";var Ys="./ListboxOptions-2928864k.stx";var Qs="./FilterChip-00ja5jhz.stx";var eo="./FilterChips-7pnzycfd.stx";var so="./ListRow-8d3e1yxh.stx";var no="./NavBar-qqrrhdnk.stx";var ro="./SectionCard-8ctdacjr.stx";var lo="./TabBar-8143650x.stx";var po="./TabBarItem-kddfnhk3.stx";var ho="./Navigator-1yk1c3pp.stx";var mo="./Notification-b3cz24f0.stx";var bo="./Pager-kh6s65t2.stx";var vo="./PagerDots-076w890y.stx";var yo="./Pagination-8bhbkpcp.stx";var Co="./Checkout-crbegxyv.stx";var So="./DefaultPaymentMethod-ss3x61tr.stx";var Eo="./PaymentMethods-z4hhr0kv.stx";var Ao="./SubscriptionCheckout-rdcv32n1.stx";var Lo="./Popover-khtvagcs.stx";var No="./PopoverButton-3w6550hv.stx";var Mo="./PopoverPanel-d84gk1w1.stx";var zo="./Portal-m73vz879.stx";var Ho="./Progress-2qzb77kc.stx";var Vo="./Radio-8153x74w.stx";var qo="./RadioGroup-smqcqgds.stx";var Ko="./RadioGroupDescription-z34r9avr.stx";var Uo="./RadioGroupLabel-ka0hfm7b.stx";var Go="./RadioGroupOption-twcw1b2a.stx";var Xo="./Select-61zv5tr7.stx";var Zo="./Sidebar-8dygywjv.stx";var tn="./SidebarFooter-s7skj92y.stx";var on="./SidebarHeader-x7jdhmyr.stx";var an="./SidebarItem-r4f2pref.stx";var ln="./SidebarPinned-48kyk193.stx";var dn="./SidebarSection-5sqza2j6.stx";var un="./SidebarSpace-bwv98azf.stx";var fn="./SidebarSpaces-mdtrynr2.stx";var gn="./SidebarSpaceSwitcher-1mycft2g.stx";var ae={blue:"#0088ff",red:"#ff383c",pink:"#ff2d55",orange:"#ff8d28",yellow:"#ffcc00",green:"#34c759",teal:"#00c3d0",cyan:"#00c0e8",indigo:"#6155f5",purple:"#cb30e0",brown:"#ac7f5e",gray:"#8e8e93"},_={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]/60 dark:text-[#ebebf5]/60"].join(" "),sectionChevron:["i-f7-chevron-down h-[11px] w-[11px] ml-auto","text-[#3c3c43]/45 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","cursor-default"].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]/55 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]/60 dark:text-[#ebebf5]/60"].join(" "),indentPerLevel:16}},bn={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}},xn={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}},vn={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","cursor-default"].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}},wn={..._,pane:"bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",layers:{}},yn={..._,pane:"bg-transparent text-black dark:text-white select-none",layers:{}},kn={..._,pane:"bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",layers:{}},Ne={macos:_,tahoe:_,"macos-tahoe":_,"macos-latest":_,arc:vn,workspace:bn,desktop:xn,solid:wn,transparent:yn,vibrancy:kn};function Gd(e){return Ne[e||"macos"]||Ne.macos}function Yd(e){if(!e)return;return ae[e]||e}var Cn=ae.gray;function q(e,t,s){return`color-mix(in oklab, ${e} ${t}%, ${s})`}function De(e){return{light:{from:q(e,35,"#ffffff"),to:q(e,12.5,"#ffffff"),ink:q(e,22,"#17171b"),accent:q(e,88,"#2a2a30")},dark:{from:q(e,27,"#101014"),to:q(e,10,"#08080b"),ink:q(e,12,"#f4f4f7"),accent:q(e,74,"#ffffff")}}}function Zd(e,t){return`linear-gradient(180deg, ${e} 0%, ${t} 100%)`}function $n(e){if(!e)return De(Cn);if(typeof e!=="string")return e;return De(ae[e]||e)}function Sn(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 Me(e,t,s,o){if(!e||!e.label)return null;return{id:e.id||`${t}-${s}`,label:e.label,icon:e.icon||o}}function Tn(e){let t=$n(e.tint);return{id:e.id,label:e.label||"",icon:e.icon||"",pinned:e.pinned||[],sections:e.sections||[],action:Me(e.action,e.id,"action","i-f7-plus"),clear:Me(e.clear,e.id,"clear","i-f7-arrow-down"),tint:t,style:Sn(t),deferred:e.deferred===!0,showTitle:e.showTitle??!0}}function ep(e){return(e||[]).map(Tn)}function tp(e,t){if(!t)return 0;let s=e.findIndex((o)=>o.id===t);return s===-1?0:s}function sp(e){return e.map((t)=>t.tint)}var In="./Skeleton-m4p66zcs.stx";var Pn="./Spinner-vhnc3y03.stx";var On="./Stepper-68gxcmej.stx";var Dn="./StepperStep-zf4pq1s0.stx";class re{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 o=e.oldValue?JSON.parse(e.oldValue).value:null,n=e.newValue?JSON.parse(e.newValue).value:null;s.forEach((a)=>a(n,o,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 o=0;o<t.length;o++)s+=String.fromCharCode(t.charCodeAt(o)^this.encryptionKey.charCodeAt(o%this.encryptionKey.length));return s}catch{return e}}compress(e){if(e.length<100)return e;let t={},s=256,o=[],n="";for(let a=0;a<e.length;a++){let r=e.charAt(a),i=n+r;if(t[i]!==void 0)n=i;else o.push(n.length>1?t[n]:n.charCodeAt(0)),t[i]=s++,n=r}if(n!=="")o.push(n.length>1?t[n]:n.charCodeAt(0));return JSON.stringify(o)}decompress(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return e;let s={},o=256,n=String.fromCharCode(t[0]),a=n;for(let r=1;r<t.length;r++){let i=t[r],c;if(s[i]!==void 0)c=s[i];else if(i===o)c=n+n.charAt(0);else return e;a+=c,s[o++]=n+c.charAt(0),n=c}return a}catch{return e}}getKey(e){return this.namespace?`${this.namespace}:${e}`:e}set(e,t,s){let o=this.getKey(e),n=this.get(e),a={value:t,timestamp:Date.now(),expire:s?.expire,encrypted:s?.encrypt||!1,compressed:s?.compress||!1};try{let r=JSON.stringify(a);if(s?.compress)r=this.compress(r);if(s?.encrypt)r=this.encrypt(r);this.storage.setItem(o,r),this.notifyWatchers(e,t,n)}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 o=JSON.parse(s);if(o.expire&&Date.now()-o.timestamp>o.expire)return this.remove(e),null;return o.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 o=this.watchers.get(e);if(o)o.forEach((n)=>n(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 o=this.storage.key(s);if(o){let n=this.storage.getItem(o)||"";e+=o.length+n.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,o])=>{this.set(s,o,t)})}getMany(e){let t={};return e.forEach((s)=>{t[s]=this.get(s)}),t}removeMany(e){e.forEach((t)=>this.remove(t))}}var Ip={local:new re("local"),session:new re("session")};function Ap(e="local",t){return new re(e,t)}var Rn="./Switch-j1jf0mtn.stx";var jn="./Table-0a4y46vd.stx";var Fn="./TableBody-y49bqb1p.stx";var Bn="./TableCell-jhvsxw8b.stx";var Wn="./TableHead-e9xvjx2j.stx";var _n="./TableHeader-krzcx4sv.stx";var Jn="./TableRow-dt8e11aj.stx";var Yn="./Tab-46mxm7f8.stx";var Qn="./TabList-5xwk2zmz.stx";var ea="./TabPanel-5htevsq6.stx";var sa="./Tabs-bp03efe6.stx";var na="./Teleport-vqs75x36.stx";var ra="./Textarea-9xmhjqp8.stx";var la="./Tooltip-4fv809dm.stx";var da="./Transition-7m0mk45s.stx";var ua="./Video-sc26cz9v.stx";var fa="./VirtualList-fa7v5a3h.stx";var ga="./VirtualTable-kp7b3wyv.stx";var ba=0;function Re(e="a11y"){return`${e}-${++ba}-${Date.now()}`}function Cu(e,t,s={}){let{visible:o=!1,id:n=Re("label")}=s,a=document.createElement(o?"label":"span");if(a.id=n,a.textContent=e,!o)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"});if(t)if(t.setAttribute("aria-labelledby",n),t.parentElement)t.parentElement.insertBefore(a,t);else document.body.appendChild(a);return n}function $u(e,t){let s=Re("desc"),o=document.createElement("span");if(o.id=s,o.textContent=e,Object.assign(o.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(o,t);else document.body.appendChild(o);return s}function Su(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 ve(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 Tu(e,t={}){let{initialFocus:s,returnFocus:o,escapeDeactivates:n=!0,clickOutsideDeactivates:a=!0,allowOutsideClick:r=!1,onActivate:i,onDeactivate:c}=t,p=!1,u=!1,d=null,g=(v)=>{if(u)return;if(n&&v.key==="Escape"){v.preventDefault(),C();return}if(v.key==="Tab"){let E=ve(e);if(E.length===0){v.preventDefault();return}let A=E[0],S=E[E.length-1];if(v.shiftKey){if(document.activeElement===A)v.preventDefault(),S.focus()}else if(document.activeElement===S)v.preventDefault(),A.focus()}},m=(v)=>{if(u)return;if(!e.contains(v.target)){if(typeof r==="function"){if(!r(v)&&a)C()}else if(!r&&a)C()}};function k(){if(p)return;p=!0,d=document.activeElement;let v=s||ve(e)[0];if(v&&typeof v.focus==="function")v.focus();document.addEventListener("keydown",g),document.addEventListener("click",m),i?.()}function C(){if(!p)return;p=!1;let v=o||d;if(v&&typeof v.focus==="function")v.focus();document.removeEventListener("keydown",g),document.removeEventListener("click",m),c?.()}function y(){u=!0}function b(){u=!1}return{activate:k,deactivate:C,pause:y,unpause:b}}function Eu(e,t={}){let{selector:s='[role="option"], [role="menuitem"], [role="tab"], button',initialIndex:o=0,orientation:n="both",loop:a=!0,onFocusChange:r}=t,i=o,c=()=>Array.from(e.querySelectorAll(s)),p=(d)=>{let g=c();if(d<0||d>=g.length)return;g.forEach((m,k)=>{if(k===d){if(m.setAttribute("tabindex","0"),typeof m.focus==="function")m.focus()}else m.setAttribute("tabindex","-1")}),i=d,r?.(d,g[d])},u=(d)=>{let m=c().length-1,k=!1,C=i;switch(d.key){case"ArrowRight":if(n==="horizontal"||n==="both"){if(C=i+1,C>m)C=a?0:m;k=!0}break;case"ArrowLeft":if(n==="horizontal"||n==="both"){if(C=i-1,C<0)C=a?m:0;k=!0}break;case"ArrowDown":if(n==="vertical"||n==="both"){if(C=i+1,C>m)C=a?0:m;k=!0}break;case"ArrowUp":if(n==="vertical"||n==="both"){if(C=i-1,C<0)C=a?m:0;k=!0}break;case"Home":C=0,k=!0;break;case"End":C=m,k=!0;break}if(k)d.preventDefault(),p(C)};return p(o),e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}}var Iu={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Tab:"Tab",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown"};function Au(e){return document.activeElement===e}function Pu(e,t){let s=t||document.activeElement,o=ve(document.body),n=o.indexOf(s);if(n===-1)return;let a=e==="next"?n+1:n-1,r=o[a];if(r)r.focus()}function Lu(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 Ou={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 Nu(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 Du(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return!1}function Mu(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-contrast: high)").matches;return!1}function Ru(){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 zu(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 ju(e){let t=[],s=(o)=>{let n=e.getAttribute(o);if(n){let a=n.split(" ");for(let r of a)if(!document.getElementById(r))t.push(`${o} references non-existent ID: ${r}`)}};return s("aria-labelledby"),s("aria-describedby"),s("aria-controls"),s("aria-owns"),s("aria-activedescendant"),t}var xa=(e,t,s,o)=>s*e/o+t,va=(e,t,s,o)=>(e/=o,s*e*e+t),wa=(e,t,s,o)=>(e/=o,-s*e*(e-2)+t),ya=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e+t;return e--,-s/2*(e*(e-2)-1)+t},ka=(e,t,s,o)=>(e/=o,s*e*e*e+t),Ca=(e,t,s,o)=>(e/=o,e--,s*(e*e*e+1)+t),$a=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e+t;return e-=2,s/2*(e*e*e+2)+t},Sa=(e,t,s,o)=>(e/=o,s*e*e*e*e+t),Ta=(e,t,s,o)=>(e/=o,e--,-s*(e*e*e*e-1)+t),Ea=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e*e+t;return e-=2,-s/2*(e*e*e*e-2)+t},Ia=(e,t,s,o)=>(e/=o,s*e*e*e*e*e+t),Aa=(e,t,s,o)=>(e/=o,e--,s*(e*e*e*e*e+1)+t),Pa=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e*e*e+t;return e-=2,s/2*(e*e*e*e*e+2)+t},La=(e,t,s,o)=>-s*Math.cos(e/o*(Math.PI/2))+s+t,Oa=(e,t,s,o)=>s*Math.sin(e/o*(Math.PI/2))+t,Na=(e,t,s,o)=>-s/2*(Math.cos(Math.PI*e/o)-1)+t,Da=(e,t,s,o)=>e===0?t:s*2**(10*(e/o-1))+t,Ma=(e,t,s,o)=>e===o?t+s:s*(-(2**(-10*e/o))+1)+t,Ra=(e,t,s,o)=>{if(e===0)return t;if(e===o)return t+s;if(e/=o/2,e<1)return s/2*2**(10*(e-1))+t;return e--,s/2*(-(2**(-10*e))+2)+t},za=(e,t,s,o)=>(e/=o,-s*(Math.sqrt(1-e*e)-1)+t),ja=(e,t,s,o)=>(e/=o,e--,s*Math.sqrt(1-e*e)+t),Ha=(e,t,s,o)=>{if(e/=o/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},Fa=(e,t,s,o)=>{let n=1.70158,a=0,r=s;if(e===0)return t;if(e/=o,e===1)return t+s;if(!a)a=o*0.3;if(r<Math.abs(s))r=s,n=a/4;else n=a/(2*Math.PI)*Math.asin(s/r);return e-=1,-(r*2**(10*e)*Math.sin((e*o-n)*(2*Math.PI)/a))+t},Va=(e,t,s,o)=>{let n=1.70158,a=0,r=s;if(e===0)return t;if(e/=o,e===1)return t+s;if(!a)a=o*0.3;if(r<Math.abs(s))r=s,n=a/4;else n=a/(2*Math.PI)*Math.asin(s/r);return r*2**(-10*e)*Math.sin((e*o-n)*(2*Math.PI)/a)+s+t},Ba=(e,t,s,o)=>{let n=1.70158,a=0,r=s;if(e===0)return t;if(e/=o/2,e===2)return t+s;if(!a)a=o*0.44999999999999996;if(r<Math.abs(s))r=s,n=a/4;else n=a/(2*Math.PI)*Math.asin(s/r);if(e<1)return e-=1,-0.5*(r*2**(10*e)*Math.sin((e*o-n)*(2*Math.PI)/a))+t;return e-=1,r*2**(-10*e)*Math.sin((e*o-n)*(2*Math.PI)/a)*0.5+s+t},qa=(e,t,s,o)=>(e/=o,s*e*e*(2.70158*e-1.70158)+t),Wa=(e,t,s,o)=>(e/=o,e--,s*(e*e*(2.70158*e+1.70158)+1)+t),Ka=(e,t,s,o)=>{let n=1.70158;if(e/=o/2,e<1)return n*=1.525,s/2*(e*e*((n+1)*e-n))+t;return e-=2,n*=1.525,s/2*(e*e*((n+1)*e+n)+2)+t},we=(e,t,s,o)=>{if(e/=o,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},ze=(e,t,s,o)=>s-we(o-e,0,s,o)+t,_a=(e,t,s,o)=>{if(e<o/2)return ze(e*2,0,s,o)*0.5+t;return we(e*2-o,0,s,o)*0.5+s*0.5+t},Fu={linear:xa,easeInQuad:va,easeOutQuad:wa,easeInOutQuad:ya,easeInCubic:ka,easeOutCubic:Ca,easeInOutCubic:$a,easeInQuart:Sa,easeOutQuart:Ta,easeInOutQuart:Ea,easeInQuint:Ia,easeOutQuint:Aa,easeInOutQuint:Pa,easeInSine:La,easeOutSine:Oa,easeInOutSine:Na,easeInExpo:Da,easeOutExpo:Ma,easeInOutExpo:Ra,easeInCirc:za,easeOutCirc:ja,easeInOutCirc:Ha,easeInElastic:Fa,easeOutElastic:Va,easeInOutElastic:Ba,easeInBack:qa,easeOutBack:Wa,easeInOutBack:Ka,easeInBounce:ze,easeOutBounce:we,easeInOutBounce:_a};function Ua(e,t={}){let{duration:s="1s",timing:o="ease",delay:n="0s",iteration:a="1",direction:r="normal",fill:i="both",playState:c="running"}=t;return`${e} ${s} ${o} ${n} ${a} ${r} ${i} ${c}`}function je(e,t,s={}){e.style.animation=Ua(t,s)}function Bu(e){e.style.animation=""}function Ja(e){return new Promise((t)=>{let s=()=>{e.removeEventListener("animationend",s),t()};e.addEventListener("animationend",s)})}function qu(e,t,s={}){let{stagger:o=100,...n}=s;e.forEach((a,r)=>{let i=`${r*o}ms`;je(a,t,{...n,delay:i})})}async function Wu(e,t){for(let s of t)je(e,s.name,s.options),await Ja(e)}var Ku={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 _u(e,t,s=1000){return new Promise((o)=>{e.classList.add(t),setTimeout(()=>{e.classList.remove(t),o()},s)})}function Uu(e,t){let s=`
|
|
11
|
+
`)}`)}return{valid:r.length===0,errors:r}}function H(e,t,s){return(o)=>St(e,o,t,s)}function Ni(e,t,s="value"){if(!t.validate(e,s,"assertion"))throw Error(t.message(e,s,"assertion"))}function Di(e,t,s="value"){if(!t.validate(e,s,"warning"))console.warn(t.message(e,s,"warning"))}var Et="./Button-55ahz0j6.stx";var It={variant:l.oneOf(["primary","secondary","outline","ghost","danger"]),size:l.oneOf(["xs","sm","md","lg","xl"]),disabled:l.boolean,loading:l.boolean,type:l.oneOf(["button","submit","reset"]),fullWidth:l.boolean,label:l.string,text:l.string,leftIcon:l.string,rightIcon:l.string,className:l.string,onClick:l.func},Hi=H("Button",It);function Fi(e){return Le(e,"Button","onClick")}function Vi(e){if(e&&!["primary","secondary","outline","ghost","danger"].includes(e))throw G.invalidProp("Button","variant",e,["primary","secondary","outline","ghost","danger"])}function Bi(e){if(e&&!["xs","sm","md","lg","xl"].includes(e))throw G.invalidProp("Button","size",e,["xs","sm","md","lg","xl"])}var Pt="./Calendar-5vs6x7gj.stx";var Lt="./DateRangePicker-4zmf34e4.stx";var Dt="./EmptyState-s790dbym.stx";var Rt="./ThemeToggle-4wm9zare.stx";var jt="./Card-r55zpjqh.stx";var Ft="./Checkbox-etjvbbxq.stx";var Bt="./Combobox-9n04ec5w.stx";var Wt="./ComboboxButton-4r6a45s1.stx";var _t="./ComboboxInput-1gyfpnca.stx";var Jt="./ComboboxOption-wkw70js7.stx";var Yt="./ComboboxOptions-zhr9b6rx.stx";var Qt="./CommandPalette-qqjdbcyg.stx";var es="./CommandPaletteItem-7290ce1z.stx";var ss="./Dialog-v79kqbbz.stx";var ns="./DialogBackdrop-de5m5m4w.stx";var rs="./DialogDescription-gth4c2kx.stx";var ls="./DialogPanel-vhdqymc2.stx";var ds="./DialogTitle-ke58hh68.stx";var us="./Drawer-4rqfcg4f.stx";var fs="./Dropdown-hb8ks69x.stx";var gs="./DropdownButton-wxc25hsy.stx";var xs="./DropdownItem-af0vzc8a.stx";var ws="./DropdownItems-bkz7jkyz.stx";var ks="./Form-cybgg9ym.stx";var Cs={action:l.string,method:l.oneOf(["GET","POST","PUT","DELETE","PATCH"]),validationSchema:l.object,initialValues:l.object,validateOnChange:l.boolean,validateOnBlur:l.boolean,onSubmit:l.func,onError:l.func,className:l.string},Yl=H("Form",Cs);var Ss="./Image-16s7e6m2.stx";var Es="./EmailInput-57626391.stx";var As="./NumberInput-pq4k2k4k.stx";var Os="./PasswordInput-dg41ktgd.stx";var Ns="./SearchInput-w15r5t95.stx";var Ms="./TextInput-nknmz9md.stx";var Rs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string},zs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,leftIcon:l.string,rightIcon:l.string,clearable:l.boolean,maxLength:l.number,showCount:l.boolean,type:l.oneOf(["text","date","time","datetime-local","month","week","url","tel","color","search","email","number","password"]),pattern:l.string,list:l.string,minLength:l.number,htmlSize:l.number,autofocus:l.boolean},js={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,min:l.number,max:l.number,step:l.number,showControls:l.boolean},Hs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,showStrength:l.boolean},Fs={value:l.string,onChange:l.func,placeholder:l.string,disabled:l.boolean,readonly:l.boolean,size:l.oneOf(["sm","md","lg"]),error:l.boolean,label:l.string,helperText:l.string,required:l.boolean,className:l.string,inputClassName:l.string,onSearch:l.func,loading:l.boolean},lc=H("TextInput",zs),cc=H("EmailInput",Rs),dc=H("PasswordInput",Hs),pc=H("NumberInput",js),uc=H("SearchInput",Fs);var Bs="./Listbox-83j2q4x6.stx";var Ws="./ListboxButton-gan8e3nw.stx";var _s="./ListboxLabel-ka0hfm7b.stx";var Js="./ListboxOption-gpaqvk3s.stx";var Ys="./ListboxOptions-2928864k.stx";var Qs="./FilterChip-00ja5jhz.stx";var eo="./FilterChips-7pnzycfd.stx";var so="./ListRow-8d3e1yxh.stx";var no="./NavBar-qqrrhdnk.stx";var ro="./SectionCard-8ctdacjr.stx";var lo="./TabBar-8143650x.stx";var po="./TabBarItem-kddfnhk3.stx";var ho="./Navigator-1yk1c3pp.stx";var mo="./Notification-b3cz24f0.stx";var bo="./Pager-kh6s65t2.stx";var vo="./PagerDots-076w890y.stx";var yo="./Pagination-8bhbkpcp.stx";var Co="./Checkout-crbegxyv.stx";var So="./DefaultPaymentMethod-ss3x61tr.stx";var Eo="./PaymentMethods-z4hhr0kv.stx";var Ao="./SubscriptionCheckout-rdcv32n1.stx";var Oo="./Popover-khtvagcs.stx";var No="./PopoverButton-3w6550hv.stx";var Mo="./PopoverPanel-d84gk1w1.stx";var zo="./Portal-m73vz879.stx";var Ho="./Progress-2qzb77kc.stx";var Vo="./Radio-8153x74w.stx";var qo="./RadioGroup-smqcqgds.stx";var Ko="./RadioGroupDescription-z34r9avr.stx";var Uo="./RadioGroupLabel-ka0hfm7b.stx";var Go="./RadioGroupOption-twcw1b2a.stx";var Xo="./SegmentedControl-z2p70zps.stx";var Zo="./Select-61zv5tr7.stx";var tn="./Sidebar-8dygywjv.stx";var on="./SidebarFooter-s7skj92y.stx";var an="./SidebarHeader-x7jdhmyr.stx";var ln="./SidebarItem-r4f2pref.stx";var dn="./SidebarPinned-48kyk193.stx";var un="./SidebarSection-5sqza2j6.stx";var fn="./SidebarSpace-bwv98azf.stx";var gn="./SidebarSpaces-mdtrynr2.stx";var xn="./SidebarSpaceSwitcher-1mycft2g.stx";var ae={blue:"#0088ff",red:"#ff383c",pink:"#ff2d55",orange:"#ff8d28",yellow:"#ffcc00",green:"#34c759",teal:"#00c3d0",cyan:"#00c0e8",indigo:"#6155f5",purple:"#cb30e0",brown:"#ac7f5e",gray:"#8e8e93"},_={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]/60 dark:text-[#ebebf5]/60"].join(" "),sectionChevron:["i-f7-chevron-down h-[11px] w-[11px] ml-auto","text-[#3c3c43]/45 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","cursor-default"].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]/55 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]/60 dark:text-[#ebebf5]/60"].join(" "),indentPerLevel:16}},vn={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}},wn={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}},yn={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","cursor-default"].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}},kn={..._,pane:"bg-stone-100 dark:bg-neutral-900 text-black dark:text-white select-none",layers:{}},Cn={..._,pane:"bg-transparent text-black dark:text-white select-none",layers:{}},$n={..._,pane:"bg-white/50 dark:bg-black/40 backdrop-blur-3xl backdrop-saturate-200 text-black dark:text-white select-none",layers:{}},Ne={macos:_,tahoe:_,"macos-tahoe":_,"macos-latest":_,arc:yn,workspace:vn,desktop:wn,solid:kn,transparent:Cn,vibrancy:$n};function ep(e){return Ne[e||"macos"]||Ne.macos}function tp(e){if(!e)return;return ae[e]||e}var Sn=ae.gray;function q(e,t,s){return`color-mix(in oklab, ${e} ${t}%, ${s})`}function De(e){return{light:{from:q(e,35,"#ffffff"),to:q(e,12.5,"#ffffff"),ink:q(e,22,"#17171b"),accent:q(e,88,"#2a2a30")},dark:{from:q(e,27,"#101014"),to:q(e,10,"#08080b"),ink:q(e,12,"#f4f4f7"),accent:q(e,74,"#ffffff")}}}function np(e,t){return`linear-gradient(180deg, ${e} 0%, ${t} 100%)`}function Tn(e){if(!e)return De(Sn);if(typeof e!=="string")return e;return De(ae[e]||e)}function En(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 Me(e,t,s,o){if(!e||!e.label)return null;return{id:e.id||`${t}-${s}`,label:e.label,icon:e.icon||o}}function In(e){let t=Tn(e.tint);return{id:e.id,label:e.label||"",icon:e.icon||"",pinned:e.pinned||[],sections:e.sections||[],action:Me(e.action,e.id,"action","i-f7-plus"),clear:Me(e.clear,e.id,"clear","i-f7-arrow-down"),tint:t,style:En(t),deferred:e.deferred===!0,showTitle:e.showTitle??!0}}function ap(e){return(e||[]).map(In)}function rp(e,t){if(!t)return 0;let s=e.findIndex((o)=>o.id===t);return s===-1?0:s}function ip(e){return e.map((t)=>t.tint)}var Pn="./Skeleton-m4p66zcs.stx";var Ln="./Spinner-vhnc3y03.stx";var Dn="./Stepper-68gxcmej.stx";var Rn="./StepperStep-zf4pq1s0.stx";class re{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 o=e.oldValue?JSON.parse(e.oldValue).value:null,n=e.newValue?JSON.parse(e.newValue).value:null;s.forEach((a)=>a(n,o,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 o=0;o<t.length;o++)s+=String.fromCharCode(t.charCodeAt(o)^this.encryptionKey.charCodeAt(o%this.encryptionKey.length));return s}catch{return e}}compress(e){if(e.length<100)return e;let t={},s=256,o=[],n="";for(let a=0;a<e.length;a++){let r=e.charAt(a),i=n+r;if(t[i]!==void 0)n=i;else o.push(n.length>1?t[n]:n.charCodeAt(0)),t[i]=s++,n=r}if(n!=="")o.push(n.length>1?t[n]:n.charCodeAt(0));return JSON.stringify(o)}decompress(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return e;let s={},o=256,n=String.fromCharCode(t[0]),a=n;for(let r=1;r<t.length;r++){let i=t[r],c;if(s[i]!==void 0)c=s[i];else if(i===o)c=n+n.charAt(0);else return e;a+=c,s[o++]=n+c.charAt(0),n=c}return a}catch{return e}}getKey(e){return this.namespace?`${this.namespace}:${e}`:e}set(e,t,s){let o=this.getKey(e),n=this.get(e),a={value:t,timestamp:Date.now(),expire:s?.expire,encrypted:s?.encrypt||!1,compressed:s?.compress||!1};try{let r=JSON.stringify(a);if(s?.compress)r=this.compress(r);if(s?.encrypt)r=this.encrypt(r);this.storage.setItem(o,r),this.notifyWatchers(e,t,n)}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 o=JSON.parse(s);if(o.expire&&Date.now()-o.timestamp>o.expire)return this.remove(e),null;return o.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 o=this.watchers.get(e);if(o)o.forEach((n)=>n(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 o=this.storage.key(s);if(o){let n=this.storage.getItem(o)||"";e+=o.length+n.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,o])=>{this.set(s,o,t)})}getMany(e){let t={};return e.forEach((s)=>{t[s]=this.get(s)}),t}removeMany(e){e.forEach((t)=>this.remove(t))}}var Np={local:new re("local"),session:new re("session")};function Dp(e="local",t){return new re(e,t)}var jn="./Switch-j1jf0mtn.stx";var Fn="./Table-0a4y46vd.stx";var Bn="./TableBody-y49bqb1p.stx";var Wn="./TableCell-jhvsxw8b.stx";var _n="./TableHead-e9xvjx2j.stx";var Jn="./TableHeader-krzcx4sv.stx";var Yn="./TableRow-dt8e11aj.stx";var Qn="./Tab-46mxm7f8.stx";var ea="./TabList-5xwk2zmz.stx";var sa="./TabPanel-5htevsq6.stx";var na="./Tabs-bp03efe6.stx";var ra="./Teleport-vqs75x36.stx";var la="./Textarea-9xmhjqp8.stx";var da="./Tooltip-4fv809dm.stx";var ua="./Transition-7m0mk45s.stx";var fa="./Video-sc26cz9v.stx";var ga="./VirtualList-fa7v5a3h.stx";var xa="./VirtualTable-kp7b3wyv.stx";var va=0;function Re(e="a11y"){return`${e}-${++va}-${Date.now()}`}function Iu(e,t,s={}){let{visible:o=!1,id:n=Re("label")}=s,a=document.createElement(o?"label":"span");if(a.id=n,a.textContent=e,!o)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"});if(t)if(t.setAttribute("aria-labelledby",n),t.parentElement)t.parentElement.insertBefore(a,t);else document.body.appendChild(a);return n}function Au(e,t){let s=Re("desc"),o=document.createElement("span");if(o.id=s,o.textContent=e,Object.assign(o.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(o,t);else document.body.appendChild(o);return s}function Pu(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 ve(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 Ou(e,t={}){let{initialFocus:s,returnFocus:o,escapeDeactivates:n=!0,clickOutsideDeactivates:a=!0,allowOutsideClick:r=!1,onActivate:i,onDeactivate:c}=t,p=!1,u=!1,d=null,g=(v)=>{if(u)return;if(n&&v.key==="Escape"){v.preventDefault(),C();return}if(v.key==="Tab"){let E=ve(e);if(E.length===0){v.preventDefault();return}let A=E[0],S=E[E.length-1];if(v.shiftKey){if(document.activeElement===A)v.preventDefault(),S.focus()}else if(document.activeElement===S)v.preventDefault(),A.focus()}},m=(v)=>{if(u)return;if(!e.contains(v.target)){if(typeof r==="function"){if(!r(v)&&a)C()}else if(!r&&a)C()}};function k(){if(p)return;p=!0,d=document.activeElement;let v=s||ve(e)[0];if(v&&typeof v.focus==="function")v.focus();document.addEventListener("keydown",g),document.addEventListener("click",m),i?.()}function C(){if(!p)return;p=!1;let v=o||d;if(v&&typeof v.focus==="function")v.focus();document.removeEventListener("keydown",g),document.removeEventListener("click",m),c?.()}function y(){u=!0}function b(){u=!1}return{activate:k,deactivate:C,pause:y,unpause:b}}function Lu(e,t={}){let{selector:s='[role="option"], [role="menuitem"], [role="tab"], button',initialIndex:o=0,orientation:n="both",loop:a=!0,onFocusChange:r}=t,i=o,c=()=>Array.from(e.querySelectorAll(s)),p=(d)=>{let g=c();if(d<0||d>=g.length)return;g.forEach((m,k)=>{if(k===d){if(m.setAttribute("tabindex","0"),typeof m.focus==="function")m.focus()}else m.setAttribute("tabindex","-1")}),i=d,r?.(d,g[d])},u=(d)=>{let m=c().length-1,k=!1,C=i;switch(d.key){case"ArrowRight":if(n==="horizontal"||n==="both"){if(C=i+1,C>m)C=a?0:m;k=!0}break;case"ArrowLeft":if(n==="horizontal"||n==="both"){if(C=i-1,C<0)C=a?m:0;k=!0}break;case"ArrowDown":if(n==="vertical"||n==="both"){if(C=i+1,C>m)C=a?0:m;k=!0}break;case"ArrowUp":if(n==="vertical"||n==="both"){if(C=i-1,C<0)C=a?m:0;k=!0}break;case"Home":C=0,k=!0;break;case"End":C=m,k=!0;break}if(k)d.preventDefault(),p(C)};return p(o),e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}}var Nu={Enter:"Enter",Space:" ",Escape:"Escape",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",Tab:"Tab",Home:"Home",End:"End",PageUp:"PageUp",PageDown:"PageDown"};function Du(e){return document.activeElement===e}function Mu(e,t){let s=t||document.activeElement,o=ve(document.body),n=o.indexOf(s);if(n===-1)return;let a=e==="next"?n+1:n-1,r=o[a];if(r)r.focus()}function Ru(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 zu={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 ju(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 Hu(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-reduced-motion: reduce)").matches;return!1}function Fu(){if(typeof window.matchMedia==="function")return window.matchMedia("(prefers-contrast: high)").matches;return!1}function Vu(){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 Bu(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 qu(e){let t=[],s=(o)=>{let n=e.getAttribute(o);if(n){let a=n.split(" ");for(let r of a)if(!document.getElementById(r))t.push(`${o} references non-existent ID: ${r}`)}};return s("aria-labelledby"),s("aria-describedby"),s("aria-controls"),s("aria-owns"),s("aria-activedescendant"),t}var wa=(e,t,s,o)=>s*e/o+t,ya=(e,t,s,o)=>(e/=o,s*e*e+t),ka=(e,t,s,o)=>(e/=o,-s*e*(e-2)+t),Ca=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e+t;return e--,-s/2*(e*(e-2)-1)+t},$a=(e,t,s,o)=>(e/=o,s*e*e*e+t),Sa=(e,t,s,o)=>(e/=o,e--,s*(e*e*e+1)+t),Ta=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e+t;return e-=2,s/2*(e*e*e+2)+t},Ea=(e,t,s,o)=>(e/=o,s*e*e*e*e+t),Ia=(e,t,s,o)=>(e/=o,e--,-s*(e*e*e*e-1)+t),Aa=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e*e+t;return e-=2,-s/2*(e*e*e*e-2)+t},Pa=(e,t,s,o)=>(e/=o,s*e*e*e*e*e+t),Oa=(e,t,s,o)=>(e/=o,e--,s*(e*e*e*e*e+1)+t),La=(e,t,s,o)=>{if(e/=o/2,e<1)return s/2*e*e*e*e*e+t;return e-=2,s/2*(e*e*e*e*e+2)+t},Na=(e,t,s,o)=>-s*Math.cos(e/o*(Math.PI/2))+s+t,Da=(e,t,s,o)=>s*Math.sin(e/o*(Math.PI/2))+t,Ma=(e,t,s,o)=>-s/2*(Math.cos(Math.PI*e/o)-1)+t,Ra=(e,t,s,o)=>e===0?t:s*2**(10*(e/o-1))+t,za=(e,t,s,o)=>e===o?t+s:s*(-(2**(-10*e/o))+1)+t,ja=(e,t,s,o)=>{if(e===0)return t;if(e===o)return t+s;if(e/=o/2,e<1)return s/2*2**(10*(e-1))+t;return e--,s/2*(-(2**(-10*e))+2)+t},Ha=(e,t,s,o)=>(e/=o,-s*(Math.sqrt(1-e*e)-1)+t),Fa=(e,t,s,o)=>(e/=o,e--,s*Math.sqrt(1-e*e)+t),Va=(e,t,s,o)=>{if(e/=o/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},Ba=(e,t,s,o)=>{let n=1.70158,a=0,r=s;if(e===0)return t;if(e/=o,e===1)return t+s;if(!a)a=o*0.3;if(r<Math.abs(s))r=s,n=a/4;else n=a/(2*Math.PI)*Math.asin(s/r);return e-=1,-(r*2**(10*e)*Math.sin((e*o-n)*(2*Math.PI)/a))+t},qa=(e,t,s,o)=>{let n=1.70158,a=0,r=s;if(e===0)return t;if(e/=o,e===1)return t+s;if(!a)a=o*0.3;if(r<Math.abs(s))r=s,n=a/4;else n=a/(2*Math.PI)*Math.asin(s/r);return r*2**(-10*e)*Math.sin((e*o-n)*(2*Math.PI)/a)+s+t},Wa=(e,t,s,o)=>{let n=1.70158,a=0,r=s;if(e===0)return t;if(e/=o/2,e===2)return t+s;if(!a)a=o*0.44999999999999996;if(r<Math.abs(s))r=s,n=a/4;else n=a/(2*Math.PI)*Math.asin(s/r);if(e<1)return e-=1,-0.5*(r*2**(10*e)*Math.sin((e*o-n)*(2*Math.PI)/a))+t;return e-=1,r*2**(-10*e)*Math.sin((e*o-n)*(2*Math.PI)/a)*0.5+s+t},Ka=(e,t,s,o)=>(e/=o,s*e*e*(2.70158*e-1.70158)+t),_a=(e,t,s,o)=>(e/=o,e--,s*(e*e*(2.70158*e+1.70158)+1)+t),Ua=(e,t,s,o)=>{let n=1.70158;if(e/=o/2,e<1)return n*=1.525,s/2*(e*e*((n+1)*e-n))+t;return e-=2,n*=1.525,s/2*(e*e*((n+1)*e+n)+2)+t},we=(e,t,s,o)=>{if(e/=o,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},ze=(e,t,s,o)=>s-we(o-e,0,s,o)+t,Ja=(e,t,s,o)=>{if(e<o/2)return ze(e*2,0,s,o)*0.5+t;return we(e*2-o,0,s,o)*0.5+s*0.5+t},Ku={linear:wa,easeInQuad:ya,easeOutQuad:ka,easeInOutQuad:Ca,easeInCubic:$a,easeOutCubic:Sa,easeInOutCubic:Ta,easeInQuart:Ea,easeOutQuart:Ia,easeInOutQuart:Aa,easeInQuint:Pa,easeOutQuint:Oa,easeInOutQuint:La,easeInSine:Na,easeOutSine:Da,easeInOutSine:Ma,easeInExpo:Ra,easeOutExpo:za,easeInOutExpo:ja,easeInCirc:Ha,easeOutCirc:Fa,easeInOutCirc:Va,easeInElastic:Ba,easeOutElastic:qa,easeInOutElastic:Wa,easeInBack:Ka,easeOutBack:_a,easeInOutBack:Ua,easeInBounce:ze,easeOutBounce:we,easeInOutBounce:Ja};function Ga(e,t={}){let{duration:s="1s",timing:o="ease",delay:n="0s",iteration:a="1",direction:r="normal",fill:i="both",playState:c="running"}=t;return`${e} ${s} ${o} ${n} ${a} ${r} ${i} ${c}`}function je(e,t,s={}){e.style.animation=Ga(t,s)}function Uu(e){e.style.animation=""}function Ya(e){return new Promise((t)=>{let s=()=>{e.removeEventListener("animationend",s),t()};e.addEventListener("animationend",s)})}function Ju(e,t,s={}){let{stagger:o=100,...n}=s;e.forEach((a,r)=>{let i=`${r*o}ms`;je(a,t,{...n,delay:i})})}async function Gu(e,t){for(let s of t)je(e,s.name,s.options),await Ya(e)}var Yu={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 Xu(e,t,s=1000){return new Promise((o)=>{e.classList.add(t),setTimeout(()=>{e.classList.remove(t),o()},s)})}function Qu(e,t){let s=`
|
|
12
12
|
@keyframes ${e} {
|
|
13
13
|
${Object.entries(t).map(([n,a])=>{let r=Object.entries(a).map(([i,c])=>`${i}: ${c};`).join(" ");return`${n} { ${r} }`}).join(`
|
|
14
14
|
`)}
|
|
15
15
|
}
|
|
16
|
-
`,o=document.createElement("style");o.textContent=s,document.head.appendChild(o)}function
|
|
16
|
+
`,o=document.createElement("style");o.textContent=s,document.head.appendChild(o)}function Xa(e,t,s={}){if(typeof e.animate!=="function")return console.warn("Web Animations API not supported"),null;let{duration:o=1000,easing:n="ease",delay:a=0,iterations:r=1,direction:i="normal",fill:c="both"}=s;return e.animate([...t],{duration:o,easing:n,delay:a,iterations:r,direction:i,fill:c})}var Qa={fadeIn:[{offset:0,opacity:0},{offset:1,opacity:1}],fadeOut:[{offset:0,opacity:1},{offset:1,opacity:0}],slideInUp:[{offset:0,transform:"translateY(100%)",opacity:0},{offset:1,transform:"translateY(0)",opacity:1}],slideInDown:[{offset:0,transform:"translateY(-100%)",opacity:0},{offset:1,transform:"translateY(0)",opacity:1}],slideInLeft:[{offset:0,transform:"translateX(-100%)",opacity:0},{offset:1,transform:"translateX(0)",opacity:1}],slideInRight:[{offset:0,transform:"translateX(100%)",opacity:0},{offset:1,transform:"translateX(0)",opacity:1}],slideOutUp:[{offset:0,transform:"translateY(0)",opacity:1},{offset:1,transform:"translateY(-100%)",opacity:0}],slideOutDown:[{offset:0,transform:"translateY(0)",opacity:1},{offset:1,transform:"translateY(100%)",opacity:0}],slideOutLeft:[{offset:0,transform:"translateX(0)",opacity:1},{offset:1,transform:"translateX(-100%)",opacity:0}],slideOutRight:[{offset:0,transform:"translateX(0)",opacity:1},{offset:1,transform:"translateX(100%)",opacity:0}],zoomIn:[{offset:0,transform:"scale(0)",opacity:0},{offset:0.5,opacity:1},{offset:1,transform:"scale(1)"}],zoomOut:[{offset:0,transform:"scale(1)",opacity:1},{offset:0.5,opacity:1},{offset:1,transform:"scale(0)",opacity:0}],rotate:[{offset:0,transform:"rotate(0deg)"},{offset:1,transform:"rotate(360deg)"}],bounce:[{offset:0,transform:"translateY(0)"},{offset:0.2,transform:"translateY(0)"},{offset:0.4,transform:"translateY(-30px)"},{offset:0.43,transform:"translateY(-30px)"},{offset:0.53,transform:"translateY(0)"},{offset:0.7,transform:"translateY(-15px)"},{offset:0.8,transform:"translateY(0)"},{offset:0.9,transform:"translateY(-4px)"},{offset:1,transform:"translateY(0)"}],pulse:[{offset:0,transform:"scale(1)"},{offset:0.5,transform:"scale(1.05)"},{offset:1,transform:"scale(1)"}],shake:[{offset:0,transform:"translateX(0)"},{offset:0.1,transform:"translateX(-10px)"},{offset:0.2,transform:"translateX(10px)"},{offset:0.3,transform:"translateX(-10px)"},{offset:0.4,transform:"translateX(10px)"},{offset:0.5,transform:"translateX(-10px)"},{offset:0.6,transform:"translateX(10px)"},{offset:0.7,transform:"translateX(-10px)"},{offset:0.8,transform:"translateX(10px)"},{offset:0.9,transform:"translateX(-10px)"},{offset:1,transform:"translateX(0)"}],swing:[{offset:0,transform:"rotate(0deg)"},{offset:0.2,transform:"rotate(15deg)"},{offset:0.4,transform:"rotate(-10deg)"},{offset:0.6,transform:"rotate(5deg)"},{offset:0.8,transform:"rotate(-5deg)"},{offset:1,transform:"rotate(0deg)"}],flip:[{offset:0,transform:"perspective(400px) rotateY(0)",animationTimingFunction:"ease-out"},{offset:0.4,transform:"perspective(400px) translateZ(150px) rotateY(170deg)",animationTimingFunction:"ease-out"},{offset:0.5,transform:"perspective(400px) translateZ(150px) rotateY(190deg)",animationTimingFunction:"ease-in"},{offset:0.8,transform:"perspective(400px) rotateY(360deg)",animationTimingFunction:"ease-in"},{offset:1,transform:"perspective(400px)",animationTimingFunction:"ease-in"}],rubberBand:[{offset:0,transform:"scale(1)"},{offset:0.3,transform:"scaleX(1.25) scaleY(0.75)"},{offset:0.4,transform:"scaleX(0.75) scaleY(1.25)"},{offset:0.5,transform:"scaleX(1.15) scaleY(0.85)"},{offset:0.65,transform:"scaleX(0.95) scaleY(1.05)"},{offset:0.75,transform:"scaleX(1.05) scaleY(0.95)"},{offset:1,transform:"scale(1)"}],heartbeat:[{offset:0,transform:"scale(1)"},{offset:0.14,transform:"scale(1.3)"},{offset:0.28,transform:"scale(1)"},{offset:0.42,transform:"scale(1.3)"},{offset:0.7,transform:"scale(1)"}]};function eh(e,t,s={}){return Xa(e,Qa[t],s)}async function Za(){try{let e=await import("ts-syntax-highlighter");return e.createHighlighter}catch{return null}}var ye=null,Fe="github-light",Ve="github-dark";function ke(e){return`<pre class="syntax"><code>${e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</code></pre>`}async function er(){if(!ye){let e=await Za();if(!e)throw Error("ts-syntax-highlighter could not be loaded");ye=await e({theme:"github-light"})}return ye}var tr=/<span class="([^"]*)"[^>]*style="([^"]*)"/g,Be=/^token\s+(\S.*)$/;function He(e){let t=[];for(let s of e.matchAll(tr)){let o=Be.exec(s[1]??"");if(o)t.push([o[1].trim(),s[2]??""])}return t}function sr(e){return/^[\w-]+$/.test(e)}async function or(e,t,s){let o,n;try{o=await e.highlight(t,s,{theme:Fe}),n=await e.highlight(t,s,{theme:Ve})}catch{return null}let a=o?.html,r=n?.html;if(!a||!r)return null;let i=He(a),c=He(r);if(i.length===0||i.length!==c.length)return null;let p=new Map;for(let y=0;y<i.length;y++){let[b,v]=i[y],E=c[y][1];if(!b||!v||!E||p.has(b)||!sr(b))continue;p.set(b,{light:v,dark:E})}if(p.size===0)return null;let u=[],d=[];for(let[y,{light:b,dark:v}]of p)u.push(`.syntax .token.${y} { ${b} }`),d.push(`.syntax .token.${y} { ${v} }`);let g=/\.syntax\s*\{([^}]*)\}/.exec(n.css??"")?.[1],m=g?g.split(";").map((y)=>y.trim()).filter((y)=>/^(?:background-color|color)\s*:/.test(y)).join("; "):"";if(m)d.unshift(`.syntax { ${m} }`);let k=[o.css??"",u.join(`
|
|
17
17
|
`),`@media (prefers-color-scheme: dark) {
|
|
18
18
|
:root:not(.light) ${d.join(`
|
|
19
19
|
:root:not(.light) `)}
|
|
20
20
|
}`,d.map((y)=>`.dark ${y}`).join(`
|
|
21
21
|
`)].filter(Boolean).join(`
|
|
22
|
-
`);return{html:a.replace(/(<span class="[^"]*")[^>]*?\s+style="[^"]*"/g,(y,b)=>Be.test(/class="([^"]*)"/.exec(b)?.[1]??"")?b:y),css:k}}async function Xu(e,t={}){let{theme:s="auto",language:o="typescript",lineNumbers:n=!1,wrapLines:a=!0}=t,r=s==="auto"?globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches?"github-dark":"github-light":s==="dark"?Ve:Fe,i;try{i=await Qa()}catch{return{html:ke(e),css:"",language:o,theme:r}}if(s==="auto"){let d=await tr(i,e,o);if(d)return{html:d.html,css:d.css,language:o,theme:"auto"}}let c;try{c=await i.highlight(e,o,{theme:r})}catch{return{html:ke(e),css:"",language:o,theme:r}}let p=c,u=typeof p==="string"?{html:p,css:""}:{html:p?.html??ke(e),css:p?.css??""};return{html:u.html,css:u.css,language:o,theme:r}}function Qu(e){if(e.includes("<!DOCTYPE")||e.includes("<html"))return"html";if(e.includes("<?php"))return"php";if(e.includes("import")&&e.includes("from"))return"typescript";if(e.includes("function")||e.includes("const"))return"javascript";if(e.includes("{")&&e.includes("}"))return"json";if(e.includes("$")&&e.includes("|"))return"bash";if(e.includes("#")&&e.includes("##"))return"markdown";return"typescript"}function Zu(e,t){return`<div class="${t?`rounded-md overflow-auto text-sm leading-relaxed font-mono ${t}`:"rounded-md overflow-auto text-sm leading-relaxed font-mono"}">${e}</div>`}var F=null,sr=(e)=>e===1?0:1;function ie(e,t){return t.split(".").reduce((s,o)=>s?.[o],e)}function Ce(e,t={}){return e.replace(/\{(\w+)\}/g,(s,o)=>t[o]!==void 0?String(t[o]):s)}function th(e){let{locale:t,fallbackLocale:s="en",messages:o,pluralRules:n={},dateTimeFormats:a={},numberFormats:r={},missing:i,warnMissing:c=!0}=e;function p(b,v={}){let E=ie(o[t],b);if(E===void 0&&s)E=ie(o[s],b);if(E===void 0){if(i){let A=i(t,b);if(A)return Ce(A,v)}if(c&&typeof console<"u")console.warn(`[i18n] Missing translation for key "${b}" in locale "${t}"`);return b}if(typeof E==="string")return Ce(E,v);return String(E)}function u(b,v,E={}){let A=p(b,{...E,count:v});if(A.includes("|")){let S=A.split("|").map((K)=>K.trim()),z=(n[t]||sr)(v,t),B=S[z]||S[S.length-1];return Ce(B,{...E,count:v})}return A}function d(b,v="default"){let E=typeof b==="number"?new Date(b):b,A=a[v]||a.default||{};return new Intl.DateTimeFormat(t,A).format(E)}function g(b,v="default"){let E=r[v]||r.default||{};return new Intl.NumberFormat(t,E).format(b)}function m(b){if(ie(o[t],b)!==void 0)return!0;if(s)return ie(o[s],b)!==void 0;return!1}function k(b){if(!o[b]){console.warn(`[i18n] Locale "${b}" not found. Available locales: ${Object.keys(o).join(", ")}`);return}t=b}function C(b,v){if(!o[b])o[b]={};o[b]={...o[b],...v}}function y(b){delete o[b]}return{get locale(){return t},get availableLocales(){return Object.keys(o)},setLocale:k,t:p,tc:u,d,n:g,te:m,addMessages:C,removeLocale:y}}function sh(e){F=e}function oh(){return F}function nh(e,t){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),e;return F.t(e,t)}function ah(e,t,s){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),e;return F.tc(e,t,s)}function rh(e,t){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),String(e);return F.d(e,t)}function ih(e,t){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),String(e);return F.n(e,t)}var lh={en:(e)=>e===1?0:1,de:(e)=>e===1?0:1,nl:(e)=>e===1?0:1,sv:(e)=>e===1?0:1,fr:(e)=>e===0||e===1?0:1,pt_BR:(e)=>e===0||e===1?0:1,ru:(e)=>{if(e%10===1&&e%100!==11)return 0;if(e%10>=2&&e%10<=4&&(e%100<10||e%100>=20))return 1;return 2},pl:(e)=>{if(e===1)return 0;if(e%10>=2&&e%10<=4&&(e%100<10||e%100>=20))return 1;return 2},cs:(e)=>{if(e===1)return 0;if(e>=2&&e<=4)return 1;return 2},ar:(e)=>{if(e===0)return 0;if(e===1)return 1;if(e===2)return 2;if(e%100>=3&&e%100<=10)return 3;if(e%100>=11)return 4;return 5},ja:()=>0,ko:()=>0,zh:()=>0,th:()=>0,vi:()=>0},ch={short:{year:"numeric",month:"numeric",day:"numeric"},long:{year:"numeric",month:"long",day:"numeric"},full:{weekday:"long",year:"numeric",month:"long",day:"numeric"},time:{hour:"numeric",minute:"numeric"},datetime:{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}},dh={decimal:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2},currency:{style:"currency",currency:"USD"},percent:{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2},compact:{notation:"compact"}};function ph(e){let t=["ar","he","fa","ur","yi"],s=e.split("-")[0].toLowerCase();return t.includes(s)}async function uh(e,t){try{return await t()}catch(s){return console.error(`[i18n] Failed to load messages for locale "${e}":`,s),{}}}var hh={en:{common:{loading:"Loading...",error:"Error",retry:"Retry",cancel:"Cancel",confirm:"Confirm",close:"Close",save:"Save",delete:"Delete",edit:"Edit",search:"Search",clear:"Clear",submit:"Submit",reset:"Reset"},form:{required:"This field is required",invalid:"Invalid value",tooShort:"Value is too short (minimum {min} characters)",tooLong:"Value is too long (maximum {max} characters)",invalidEmail:"Invalid email address",invalidUrl:"Invalid URL"},pagination:{previous:"Previous",next:"Next",page:"Page {page}",of:"of {total}"}},es:{common:{loading:"Cargando...",error:"Error",retry:"Reintentar",cancel:"Cancelar",confirm:"Confirmar",close:"Cerrar",save:"Guardar",delete:"Eliminar",edit:"Editar",search:"Buscar",clear:"Limpiar",submit:"Enviar",reset:"Restablecer"},form:{required:"Este campo es obligatorio",invalid:"Valor inv\xE1lido",tooShort:"El valor es demasiado corto (m\xEDnimo {min} caracteres)",tooLong:"El valor es demasiado largo (m\xE1ximo {max} caracteres)",invalidEmail:"Direcci\xF3n de correo electr\xF3nico inv\xE1lida",invalidUrl:"URL inv\xE1lida"},pagination:{previous:"Anterior",next:"Siguiente",page:"P\xE1gina {page}",of:"de {total}"}},fr:{common:{loading:"Chargement...",error:"Erreur",retry:"R\xE9essayer",cancel:"Annuler",confirm:"Confirmer",close:"Fermer",save:"Enregistrer",delete:"Supprimer",edit:"Modifier",search:"Rechercher",clear:"Effacer",submit:"Soumettre",reset:"R\xE9initialiser"},form:{required:"Ce champ est obligatoire",invalid:"Valeur invalide",tooShort:"La valeur est trop courte (minimum {min} caract\xE8res)",tooLong:"La valeur est trop longue (maximum {max} caract\xE8res)",invalidEmail:"Adresse e-mail invalide",invalidUrl:"URL invalide"},pagination:{previous:"Pr\xE9c\xE9dent",next:"Suivant",page:"Page {page}",of:"sur {total}"}}};function mh(e={}){let{max:t=10,ttl:s=0,include:o,exclude:n,hooks:a,debug:r=!1}=e,i=new Map,c=0,p=0;function u(...h){if(r)console.log("[KeepAlive]",...h)}function d(h){if(n){if(n instanceof RegExp&&n.test(h))return!1;if(Array.isArray(n)&&n.includes(h))return!1}if(o){if(o instanceof RegExp&&!o.test(h))return!1;if(Array.isArray(o)&&!o.includes(h))return!1}return!0}function g(h){if(!s||!h.expiresAt)return!1;return Date.now()>h.expiresAt}function m(h){let f=i.get(h);if(f)f.lastAccessedAt=Date.now(),f.accessCount++,f.instance.lastAccessedAt=f.lastAccessedAt,i.delete(h),i.set(h,f),u(`Touched: ${h} (access count: ${f.accessCount})`)}function k(){if(i.size===0)return!1;let h=i.keys().next().value;if(!h)return!1;let f=i.get(h);if(f){u(`Evicting LRU: ${h}`);let T=f.instance.hooks;if(T?.onDeactivate)T.onDeactivate(f.instance);if(a?.onDeactivate)a.onDeactivate(f.instance);return i.delete(h),!0}return!1}function C(h,f,T){if(!d(f.type))return u(`Type not cacheable: ${f.type}`),f;if(i.size>=t)k();let M=Date.now(),U={instance:{...f,hooks:T||f.hooks,createdAt:f.createdAt||M,lastAccessedAt:M},accessCount:0,createdAt:M,lastAccessedAt:M,expiresAt:s?M+s:void 0};if(i.set(h,U),u(`Cached: ${h} (size: ${i.size}/${t})`),T?.onMount)T.onMount(U.instance);if(a?.onMount)a.onMount(U.instance);return U.instance}function y(h){let f=i.get(h);if(!f)return p++,u(`Miss: ${h}`),null;if(g(f))return u(`Expired: ${h}`),i.delete(h),p++,null;return c++,m(h),u(`Hit: ${h}`),f.instance}function b(h){let f=i.get(h);if(!f)return!1;if(g(f))return i.delete(h),!1;return!0}function v(h){let f=i.get(h);if(!f)return!1;u(`Removing: ${h}`);let T=f.instance.hooks;if(T?.onUnmount)T.onUnmount(f.instance);if(a?.onUnmount)a.onUnmount(f.instance);return i.delete(h)}function E(){u("Clearing cache"),i.forEach((h)=>{let f=h.instance.hooks;if(f?.onUnmount)f.onUnmount(h.instance);if(a?.onUnmount)a.onUnmount(h.instance)}),i.clear(),c=0,p=0}function A(){let h=0,f=Date.now();for(let[T,M]of i.entries())if(g(M))u(`Pruning expired: ${T}`),v(T),h++;while(i.size>t)if(k())h++;else break;if(h>0)u(`Pruned ${h} entries`);return h}function S(h){let f=y(h);if(!f)return null;u(`Activating: ${h}`);let T=f.hooks;if(T?.onActivate)T.onActivate(f);if(a?.onActivate)a.onActivate(f);if(f.state&&T?.onRestore)T.onRestore(f,f.state);return f}function V(h){let f=i.get(h);if(!f)return!1;u(`Deactivating: ${h}`);let T=f.instance,M=T.hooks;if(M?.onSave)T.state=M.onSave(T);if(M?.onDeactivate)M.onDeactivate(T);if(a?.onDeactivate)a.onDeactivate(T);return!0}function z(){let h=c+p;return{hits:c,misses:p,size:i.size,max:t,hitRate:h>0?c/h:0,keys:Array.from(i.keys())}}function B(){return Array.from(i.keys())}function K(){return i.size}return{cache:C,get:y,has:b,remove:v,clear:E,prune:A,activate:S,deactivate:V,getStats:z,keys:B,size:K}}function gh(e){let t=new Map;return{set(s,o){if(t.has(s))t.delete(s);if(t.set(s,o),t.size>e){let n=t.keys().next().value;if(n)t.delete(n)}},get(s){if(!t.has(s))return;let o=t.get(s);return t.delete(s),t.set(s,o),o},has(s){return t.has(s)},delete(s){return t.delete(s)},clear(){t.clear()},get size(){return t.size},keys(){return Array.from(t.keys())},values(){return Array.from(t.values())},forEach(s){t.forEach(s)}}}function bh(){let e=new Map;return{save(t,s){e.set(t,JSON.parse(JSON.stringify(s)))},restore(t){let s=e.get(t);return s?JSON.parse(JSON.stringify(s)):null},has(t){return e.has(t)},remove(t){return e.delete(t)},clear(){e.clear()},keys(){return Array.from(e.keys())},get size(){return e.size}}}function xh(e,t={}){let{maxSize:s=100,reset:o}=t,n=[];return{acquire(){if(n.length>0)return n.pop();return e()},release(a){if(n.length<s){if(o)o(a);n.push(a)}},clear(){n.length=0},get size(){return n.length},get maxSize(){return s}}}var W=new Map;async function le(e,t){let s=t||e.toString();if(W.has(s))return W.get(s);let o=e();W.set(s,o);try{return await o}catch(n){throw W.delete(s),n}}function wh(e,t={}){let{retryAttempts:s=3,retryDelay:o=1000,onLoading:n,onLoaded:a,onError:r}=t,i="idle",c,p,u=async(d=0)=>{try{if(i==="loading"||i==="loaded"){if(c)return c}i="loading",n?.();let g=await le(e);return c=g,i="loaded",a?.(g),g}catch(g){let m=g;if(d<s)return await new Promise((k)=>setTimeout(k,o*(d+1))),u(d+1);throw i="error",p=m,r?.(m),m}};return{get state(){return i},get module(){return c},get error(){return p},load:()=>u(),preload:()=>u()}}function or(e,t,s={}){if(!e)return console.warn("lazyLoad: element is null"),()=>{};let{root:o=null,rootMargin:n="0px",threshold:a=0.01,placeholder:r,errorContent:i,onLoading:c,onLoaded:p,onError:u}=s,d=!1,g=null;if(r)if(typeof r==="string")e.innerHTML=r;else e.innerHTML="",e.appendChild(r);return g=new IntersectionObserver(async(k)=>{for(let C of k)if(C.isIntersecting&&!d){d=!0,g?.disconnect();try{c?.();let y=await le(t);if(p?.(y),y&&typeof y.default?.render==="function"){let b=await y.default.render();e.innerHTML=b}}catch(y){let b=y;if(u?.(b),i)if(typeof i==="string")e.innerHTML=i;else e.innerHTML="",e.appendChild(i);else e.innerHTML=`<div style="color: red;">Failed to load component: ${b.message}</div>`}}},{root:o,rootMargin:n,threshold:a}),g.observe(e),()=>{g?.disconnect(),g=null}}function yh(e,t,s={}){let o=[],n=Array.from(e);for(let a of n){let r=typeof t==="function"&&t.length>0?()=>t(a):t,i=or(a,r,s);o.push(i)}return()=>{o.forEach((a)=>a())}}function nr(e){return le(e)}function kh(e){return Promise.all(e.map((t)=>nr(t)))}function Ch(e){if(e)W.delete(e);else W.clear()}function $h(){return{size:W.size,keys:Array.from(W.keys())}}function Sh(e){return{async load(t){let s=e[t];if(!s)throw Error(`No route found for path: ${t}`);return le(s,`route:${t}`)},async preload(t){return this.load(t)},async preloadRoutes(t){return Promise.all(t.map((s)=>this.preload(s)))}}}function ar(e,t,s={}){if(!e)return()=>{};let{root:o=null,rootMargin:n="50px",threshold:a=0.01,placeholder:r,onLoading:i,onLoaded:c,onError:p}=s;if(r&&typeof r==="string")e.src=r;let u=!1,d=null;return d=new IntersectionObserver((m)=>{for(let k of m)if(k.isIntersecting&&!u)u=!0,d?.disconnect(),i?.(),e.src=t,e.addEventListener("load",()=>{c?.(e),e.classList.add("loaded")},{once:!0}),e.addEventListener("error",(C)=>{let y=Error(`Failed to load image: ${t}`);p?.(y),e.classList.add("error")},{once:!0})},{root:o,rootMargin:n,threshold:a}),d.observe(e),()=>{d?.disconnect(),d=null}}function Th(e=document,t={}){let s=e.querySelectorAll("img[data-lazy-src]"),o=[];return s.forEach((n)=>{let a=n.getAttribute("data-lazy-src");if(a){let r=ar(n,a,t);o.push(r)}}),()=>{o.forEach((n)=>n())}}var $e={colors:{primary:"#3b82f6",secondary:"#8b5cf6",success:"#10b981",warning:"#f59e0b",danger:"#ef4444",info:"#06b6d4",gray:"#6b7280",white:"#ffffff",black:"#000000"},typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{light:"300",normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.75"}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem","4xl":"6rem"},borderRadius:{none:"0",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",none:"none"},components:{button:{borderRadius:"0.375rem",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:"500"},input:{borderRadius:"0.375rem",padding:"0.5rem 0.75rem",fontSize:"0.875rem",borderWidth:"1px"},card:{borderRadius:"0.5rem",padding:"1.5rem",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"}}};function qe(e,t){let s={...e};for(let o in t)if(t[o]instanceof Object&&o in e)s[o]=qe(e[o],t[o]);else s[o]=t[o];return s}function Z(e){return qe($e,e)}var ce=$e;function Ih(){return ce}function rr(e){let t=[];if(e.colors)Object.entries(e.colors).forEach(([s,o])=>{if(o)t.push(`--color-${s}: ${o};`)});if(e.typography?.fontFamily)Object.entries(e.typography.fontFamily).forEach(([s,o])=>{if(o)t.push(`--font-${s}: ${o};`)});if(e.typography?.fontSize)Object.entries(e.typography.fontSize).forEach(([s,o])=>{if(o)t.push(`--text-${s}: ${o};`)});if(e.typography?.fontWeight)Object.entries(e.typography.fontWeight).forEach(([s,o])=>{if(o)t.push(`--font-weight-${s}: ${o};`)});if(e.typography?.lineHeight)Object.entries(e.typography.lineHeight).forEach(([s,o])=>{if(o)t.push(`--leading-${s}: ${o};`)});if(e.spacing)Object.entries(e.spacing).forEach(([s,o])=>{if(o)t.push(`--spacing-${s}: ${o};`)});if(e.borderRadius)Object.entries(e.borderRadius).forEach(([s,o])=>{if(o)t.push(`--radius-${s}: ${o};`)});if(e.shadows)Object.entries(e.shadows).forEach(([s,o])=>{if(o)t.push(`--shadow-${s}: ${o};`)});if(e.components?.button)Object.entries(e.components.button).forEach(([s,o])=>{if(o)t.push(`--button-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});if(e.components?.input)Object.entries(e.components.input).forEach(([s,o])=>{if(o)t.push(`--input-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});if(e.components?.card)Object.entries(e.components.card).forEach(([s,o])=>{if(o)t.push(`--card-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});return`:root {
|
|
22
|
+
`);return{html:a.replace(/(<span class="[^"]*")[^>]*?\s+style="[^"]*"/g,(y,b)=>Be.test(/class="([^"]*)"/.exec(b)?.[1]??"")?b:y),css:k}}async function sh(e,t={}){let{theme:s="auto",language:o="typescript",lineNumbers:n=!1,wrapLines:a=!0}=t,r=s==="auto"?globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches?"github-dark":"github-light":s==="dark"?Ve:Fe,i;try{i=await er()}catch{return{html:ke(e),css:"",language:o,theme:r}}if(s==="auto"){let d=await or(i,e,o);if(d)return{html:d.html,css:d.css,language:o,theme:"auto"}}let c;try{c=await i.highlight(e,o,{theme:r})}catch{return{html:ke(e),css:"",language:o,theme:r}}let p=c,u=typeof p==="string"?{html:p,css:""}:{html:p?.html??ke(e),css:p?.css??""};return{html:u.html,css:u.css,language:o,theme:r}}function oh(e){if(e.includes("<!DOCTYPE")||e.includes("<html"))return"html";if(e.includes("<?php"))return"php";if(e.includes("import")&&e.includes("from"))return"typescript";if(e.includes("function")||e.includes("const"))return"javascript";if(e.includes("{")&&e.includes("}"))return"json";if(e.includes("$")&&e.includes("|"))return"bash";if(e.includes("#")&&e.includes("##"))return"markdown";return"typescript"}function nh(e,t){return`<div class="${t?`rounded-md overflow-auto text-sm leading-relaxed font-mono ${t}`:"rounded-md overflow-auto text-sm leading-relaxed font-mono"}">${e}</div>`}var F=null,nr=(e)=>e===1?0:1;function ie(e,t){return t.split(".").reduce((s,o)=>s?.[o],e)}function Ce(e,t={}){return e.replace(/\{(\w+)\}/g,(s,o)=>t[o]!==void 0?String(t[o]):s)}function rh(e){let{locale:t,fallbackLocale:s="en",messages:o,pluralRules:n={},dateTimeFormats:a={},numberFormats:r={},missing:i,warnMissing:c=!0}=e;function p(b,v={}){let E=ie(o[t],b);if(E===void 0&&s)E=ie(o[s],b);if(E===void 0){if(i){let A=i(t,b);if(A)return Ce(A,v)}if(c&&typeof console<"u")console.warn(`[i18n] Missing translation for key "${b}" in locale "${t}"`);return b}if(typeof E==="string")return Ce(E,v);return String(E)}function u(b,v,E={}){let A=p(b,{...E,count:v});if(A.includes("|")){let S=A.split("|").map((K)=>K.trim()),z=(n[t]||nr)(v,t),B=S[z]||S[S.length-1];return Ce(B,{...E,count:v})}return A}function d(b,v="default"){let E=typeof b==="number"?new Date(b):b,A=a[v]||a.default||{};return new Intl.DateTimeFormat(t,A).format(E)}function g(b,v="default"){let E=r[v]||r.default||{};return new Intl.NumberFormat(t,E).format(b)}function m(b){if(ie(o[t],b)!==void 0)return!0;if(s)return ie(o[s],b)!==void 0;return!1}function k(b){if(!o[b]){console.warn(`[i18n] Locale "${b}" not found. Available locales: ${Object.keys(o).join(", ")}`);return}t=b}function C(b,v){if(!o[b])o[b]={};o[b]={...o[b],...v}}function y(b){delete o[b]}return{get locale(){return t},get availableLocales(){return Object.keys(o)},setLocale:k,t:p,tc:u,d,n:g,te:m,addMessages:C,removeLocale:y}}function ih(e){F=e}function lh(){return F}function ch(e,t){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),e;return F.t(e,t)}function dh(e,t,s){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),e;return F.tc(e,t,s)}function ph(e,t){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),String(e);return F.d(e,t)}function uh(e,t){if(!F)return console.warn("[i18n] No global i18n instance set. Call setI18n() first."),String(e);return F.n(e,t)}var hh={en:(e)=>e===1?0:1,de:(e)=>e===1?0:1,nl:(e)=>e===1?0:1,sv:(e)=>e===1?0:1,fr:(e)=>e===0||e===1?0:1,pt_BR:(e)=>e===0||e===1?0:1,ru:(e)=>{if(e%10===1&&e%100!==11)return 0;if(e%10>=2&&e%10<=4&&(e%100<10||e%100>=20))return 1;return 2},pl:(e)=>{if(e===1)return 0;if(e%10>=2&&e%10<=4&&(e%100<10||e%100>=20))return 1;return 2},cs:(e)=>{if(e===1)return 0;if(e>=2&&e<=4)return 1;return 2},ar:(e)=>{if(e===0)return 0;if(e===1)return 1;if(e===2)return 2;if(e%100>=3&&e%100<=10)return 3;if(e%100>=11)return 4;return 5},ja:()=>0,ko:()=>0,zh:()=>0,th:()=>0,vi:()=>0},fh={short:{year:"numeric",month:"numeric",day:"numeric"},long:{year:"numeric",month:"long",day:"numeric"},full:{weekday:"long",year:"numeric",month:"long",day:"numeric"},time:{hour:"numeric",minute:"numeric"},datetime:{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}},mh={decimal:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2},currency:{style:"currency",currency:"USD"},percent:{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2},compact:{notation:"compact"}};function gh(e){let t=["ar","he","fa","ur","yi"],s=e.split("-")[0].toLowerCase();return t.includes(s)}async function bh(e,t){try{return await t()}catch(s){return console.error(`[i18n] Failed to load messages for locale "${e}":`,s),{}}}var xh={en:{common:{loading:"Loading...",error:"Error",retry:"Retry",cancel:"Cancel",confirm:"Confirm",close:"Close",save:"Save",delete:"Delete",edit:"Edit",search:"Search",clear:"Clear",submit:"Submit",reset:"Reset"},form:{required:"This field is required",invalid:"Invalid value",tooShort:"Value is too short (minimum {min} characters)",tooLong:"Value is too long (maximum {max} characters)",invalidEmail:"Invalid email address",invalidUrl:"Invalid URL"},pagination:{previous:"Previous",next:"Next",page:"Page {page}",of:"of {total}"}},es:{common:{loading:"Cargando...",error:"Error",retry:"Reintentar",cancel:"Cancelar",confirm:"Confirmar",close:"Cerrar",save:"Guardar",delete:"Eliminar",edit:"Editar",search:"Buscar",clear:"Limpiar",submit:"Enviar",reset:"Restablecer"},form:{required:"Este campo es obligatorio",invalid:"Valor inv\xE1lido",tooShort:"El valor es demasiado corto (m\xEDnimo {min} caracteres)",tooLong:"El valor es demasiado largo (m\xE1ximo {max} caracteres)",invalidEmail:"Direcci\xF3n de correo electr\xF3nico inv\xE1lida",invalidUrl:"URL inv\xE1lida"},pagination:{previous:"Anterior",next:"Siguiente",page:"P\xE1gina {page}",of:"de {total}"}},fr:{common:{loading:"Chargement...",error:"Erreur",retry:"R\xE9essayer",cancel:"Annuler",confirm:"Confirmer",close:"Fermer",save:"Enregistrer",delete:"Supprimer",edit:"Modifier",search:"Rechercher",clear:"Effacer",submit:"Soumettre",reset:"R\xE9initialiser"},form:{required:"Ce champ est obligatoire",invalid:"Valeur invalide",tooShort:"La valeur est trop courte (minimum {min} caract\xE8res)",tooLong:"La valeur est trop longue (maximum {max} caract\xE8res)",invalidEmail:"Adresse e-mail invalide",invalidUrl:"URL invalide"},pagination:{previous:"Pr\xE9c\xE9dent",next:"Suivant",page:"Page {page}",of:"sur {total}"}}};function wh(e={}){let{max:t=10,ttl:s=0,include:o,exclude:n,hooks:a,debug:r=!1}=e,i=new Map,c=0,p=0;function u(...h){if(r)console.log("[KeepAlive]",...h)}function d(h){if(n){if(n instanceof RegExp&&n.test(h))return!1;if(Array.isArray(n)&&n.includes(h))return!1}if(o){if(o instanceof RegExp&&!o.test(h))return!1;if(Array.isArray(o)&&!o.includes(h))return!1}return!0}function g(h){if(!s||!h.expiresAt)return!1;return Date.now()>h.expiresAt}function m(h){let f=i.get(h);if(f)f.lastAccessedAt=Date.now(),f.accessCount++,f.instance.lastAccessedAt=f.lastAccessedAt,i.delete(h),i.set(h,f),u(`Touched: ${h} (access count: ${f.accessCount})`)}function k(){if(i.size===0)return!1;let h=i.keys().next().value;if(!h)return!1;let f=i.get(h);if(f){u(`Evicting LRU: ${h}`);let T=f.instance.hooks;if(T?.onDeactivate)T.onDeactivate(f.instance);if(a?.onDeactivate)a.onDeactivate(f.instance);return i.delete(h),!0}return!1}function C(h,f,T){if(!d(f.type))return u(`Type not cacheable: ${f.type}`),f;if(i.size>=t)k();let M=Date.now(),U={instance:{...f,hooks:T||f.hooks,createdAt:f.createdAt||M,lastAccessedAt:M},accessCount:0,createdAt:M,lastAccessedAt:M,expiresAt:s?M+s:void 0};if(i.set(h,U),u(`Cached: ${h} (size: ${i.size}/${t})`),T?.onMount)T.onMount(U.instance);if(a?.onMount)a.onMount(U.instance);return U.instance}function y(h){let f=i.get(h);if(!f)return p++,u(`Miss: ${h}`),null;if(g(f))return u(`Expired: ${h}`),i.delete(h),p++,null;return c++,m(h),u(`Hit: ${h}`),f.instance}function b(h){let f=i.get(h);if(!f)return!1;if(g(f))return i.delete(h),!1;return!0}function v(h){let f=i.get(h);if(!f)return!1;u(`Removing: ${h}`);let T=f.instance.hooks;if(T?.onUnmount)T.onUnmount(f.instance);if(a?.onUnmount)a.onUnmount(f.instance);return i.delete(h)}function E(){u("Clearing cache"),i.forEach((h)=>{let f=h.instance.hooks;if(f?.onUnmount)f.onUnmount(h.instance);if(a?.onUnmount)a.onUnmount(h.instance)}),i.clear(),c=0,p=0}function A(){let h=0,f=Date.now();for(let[T,M]of i.entries())if(g(M))u(`Pruning expired: ${T}`),v(T),h++;while(i.size>t)if(k())h++;else break;if(h>0)u(`Pruned ${h} entries`);return h}function S(h){let f=y(h);if(!f)return null;u(`Activating: ${h}`);let T=f.hooks;if(T?.onActivate)T.onActivate(f);if(a?.onActivate)a.onActivate(f);if(f.state&&T?.onRestore)T.onRestore(f,f.state);return f}function V(h){let f=i.get(h);if(!f)return!1;u(`Deactivating: ${h}`);let T=f.instance,M=T.hooks;if(M?.onSave)T.state=M.onSave(T);if(M?.onDeactivate)M.onDeactivate(T);if(a?.onDeactivate)a.onDeactivate(T);return!0}function z(){let h=c+p;return{hits:c,misses:p,size:i.size,max:t,hitRate:h>0?c/h:0,keys:Array.from(i.keys())}}function B(){return Array.from(i.keys())}function K(){return i.size}return{cache:C,get:y,has:b,remove:v,clear:E,prune:A,activate:S,deactivate:V,getStats:z,keys:B,size:K}}function yh(e){let t=new Map;return{set(s,o){if(t.has(s))t.delete(s);if(t.set(s,o),t.size>e){let n=t.keys().next().value;if(n)t.delete(n)}},get(s){if(!t.has(s))return;let o=t.get(s);return t.delete(s),t.set(s,o),o},has(s){return t.has(s)},delete(s){return t.delete(s)},clear(){t.clear()},get size(){return t.size},keys(){return Array.from(t.keys())},values(){return Array.from(t.values())},forEach(s){t.forEach(s)}}}function kh(){let e=new Map;return{save(t,s){e.set(t,JSON.parse(JSON.stringify(s)))},restore(t){let s=e.get(t);return s?JSON.parse(JSON.stringify(s)):null},has(t){return e.has(t)},remove(t){return e.delete(t)},clear(){e.clear()},keys(){return Array.from(e.keys())},get size(){return e.size}}}function Ch(e,t={}){let{maxSize:s=100,reset:o}=t,n=[];return{acquire(){if(n.length>0)return n.pop();return e()},release(a){if(n.length<s){if(o)o(a);n.push(a)}},clear(){n.length=0},get size(){return n.length},get maxSize(){return s}}}var W=new Map;async function le(e,t){let s=t||e.toString();if(W.has(s))return W.get(s);let o=e();W.set(s,o);try{return await o}catch(n){throw W.delete(s),n}}function Sh(e,t={}){let{retryAttempts:s=3,retryDelay:o=1000,onLoading:n,onLoaded:a,onError:r}=t,i="idle",c,p,u=async(d=0)=>{try{if(i==="loading"||i==="loaded"){if(c)return c}i="loading",n?.();let g=await le(e);return c=g,i="loaded",a?.(g),g}catch(g){let m=g;if(d<s)return await new Promise((k)=>setTimeout(k,o*(d+1))),u(d+1);throw i="error",p=m,r?.(m),m}};return{get state(){return i},get module(){return c},get error(){return p},load:()=>u(),preload:()=>u()}}function ar(e,t,s={}){if(!e)return console.warn("lazyLoad: element is null"),()=>{};let{root:o=null,rootMargin:n="0px",threshold:a=0.01,placeholder:r,errorContent:i,onLoading:c,onLoaded:p,onError:u}=s,d=!1,g=null;if(r)if(typeof r==="string")e.innerHTML=r;else e.innerHTML="",e.appendChild(r);return g=new IntersectionObserver(async(k)=>{for(let C of k)if(C.isIntersecting&&!d){d=!0,g?.disconnect();try{c?.();let y=await le(t);if(p?.(y),y&&typeof y.default?.render==="function"){let b=await y.default.render();e.innerHTML=b}}catch(y){let b=y;if(u?.(b),i)if(typeof i==="string")e.innerHTML=i;else e.innerHTML="",e.appendChild(i);else e.innerHTML=`<div style="color: red;">Failed to load component: ${b.message}</div>`}}},{root:o,rootMargin:n,threshold:a}),g.observe(e),()=>{g?.disconnect(),g=null}}function Th(e,t,s={}){let o=[],n=Array.from(e);for(let a of n){let r=typeof t==="function"&&t.length>0?()=>t(a):t,i=ar(a,r,s);o.push(i)}return()=>{o.forEach((a)=>a())}}function rr(e){return le(e)}function Eh(e){return Promise.all(e.map((t)=>rr(t)))}function Ih(e){if(e)W.delete(e);else W.clear()}function Ah(){return{size:W.size,keys:Array.from(W.keys())}}function Ph(e){return{async load(t){let s=e[t];if(!s)throw Error(`No route found for path: ${t}`);return le(s,`route:${t}`)},async preload(t){return this.load(t)},async preloadRoutes(t){return Promise.all(t.map((s)=>this.preload(s)))}}}function ir(e,t,s={}){if(!e)return()=>{};let{root:o=null,rootMargin:n="50px",threshold:a=0.01,placeholder:r,onLoading:i,onLoaded:c,onError:p}=s;if(r&&typeof r==="string")e.src=r;let u=!1,d=null;return d=new IntersectionObserver((m)=>{for(let k of m)if(k.isIntersecting&&!u)u=!0,d?.disconnect(),i?.(),e.src=t,e.addEventListener("load",()=>{c?.(e),e.classList.add("loaded")},{once:!0}),e.addEventListener("error",(C)=>{let y=Error(`Failed to load image: ${t}`);p?.(y),e.classList.add("error")},{once:!0})},{root:o,rootMargin:n,threshold:a}),d.observe(e),()=>{d?.disconnect(),d=null}}function Oh(e=document,t={}){let s=e.querySelectorAll("img[data-lazy-src]"),o=[];return s.forEach((n)=>{let a=n.getAttribute("data-lazy-src");if(a){let r=ir(n,a,t);o.push(r)}}),()=>{o.forEach((n)=>n())}}var $e={colors:{primary:"#3b82f6",secondary:"#8b5cf6",success:"#10b981",warning:"#f59e0b",danger:"#ef4444",info:"#06b6d4",gray:"#6b7280",white:"#ffffff",black:"#000000"},typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{light:"300",normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.75"}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem","4xl":"6rem"},borderRadius:{none:"0",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",full:"9999px"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",none:"none"},components:{button:{borderRadius:"0.375rem",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:"500"},input:{borderRadius:"0.375rem",padding:"0.5rem 0.75rem",fontSize:"0.875rem",borderWidth:"1px"},card:{borderRadius:"0.5rem",padding:"1.5rem",shadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"}}};function qe(e,t){let s={...e};for(let o in t)if(t[o]instanceof Object&&o in e)s[o]=qe(e[o],t[o]);else s[o]=t[o];return s}function Z(e){return qe($e,e)}var ce=$e;function Nh(){return ce}function lr(e){let t=[];if(e.colors)Object.entries(e.colors).forEach(([s,o])=>{if(o)t.push(`--color-${s}: ${o};`)});if(e.typography?.fontFamily)Object.entries(e.typography.fontFamily).forEach(([s,o])=>{if(o)t.push(`--font-${s}: ${o};`)});if(e.typography?.fontSize)Object.entries(e.typography.fontSize).forEach(([s,o])=>{if(o)t.push(`--text-${s}: ${o};`)});if(e.typography?.fontWeight)Object.entries(e.typography.fontWeight).forEach(([s,o])=>{if(o)t.push(`--font-weight-${s}: ${o};`)});if(e.typography?.lineHeight)Object.entries(e.typography.lineHeight).forEach(([s,o])=>{if(o)t.push(`--leading-${s}: ${o};`)});if(e.spacing)Object.entries(e.spacing).forEach(([s,o])=>{if(o)t.push(`--spacing-${s}: ${o};`)});if(e.borderRadius)Object.entries(e.borderRadius).forEach(([s,o])=>{if(o)t.push(`--radius-${s}: ${o};`)});if(e.shadows)Object.entries(e.shadows).forEach(([s,o])=>{if(o)t.push(`--shadow-${s}: ${o};`)});if(e.components?.button)Object.entries(e.components.button).forEach(([s,o])=>{if(o)t.push(`--button-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});if(e.components?.input)Object.entries(e.components.input).forEach(([s,o])=>{if(o)t.push(`--input-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});if(e.components?.card)Object.entries(e.components.card).forEach(([s,o])=>{if(o)t.push(`--card-${s.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`)});return`:root {
|
|
23
23
|
${t.join(`
|
|
24
24
|
`)}
|
|
25
|
-
}`}function Ah(e,t){if(ce=e,typeof document>"u")return;let s=t||document.documentElement;if(e.colors)Object.entries(e.colors).forEach(([o,n])=>{if(n)s.style.setProperty(`--color-${o}`,n)});if(e.typography?.fontFamily)Object.entries(e.typography.fontFamily).forEach(([o,n])=>{if(n)s.style.setProperty(`--font-${o}`,n)});if(e.typography?.fontSize)Object.entries(e.typography.fontSize).forEach(([o,n])=>{if(n)s.style.setProperty(`--text-${o}`,n)});if(e.typography?.fontWeight)Object.entries(e.typography.fontWeight).forEach(([o,n])=>{if(n)s.style.setProperty(`--font-weight-${o}`,n)});if(e.typography?.lineHeight)Object.entries(e.typography.lineHeight).forEach(([o,n])=>{if(n)s.style.setProperty(`--leading-${o}`,n)});if(e.spacing)Object.entries(e.spacing).forEach(([o,n])=>{if(n)s.style.setProperty(`--spacing-${o}`,n)});if(e.borderRadius)Object.entries(e.borderRadius).forEach(([o,n])=>{if(n)s.style.setProperty(`--radius-${o}`,n)});if(e.shadows)Object.entries(e.shadows).forEach(([o,n])=>{if(n)s.style.setProperty(`--shadow-${o}`,n)});if(e.components?.button)Object.entries(e.components.button).forEach(([o,n])=>{if(n)s.style.setProperty(`--button-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,n)});if(e.components?.input)Object.entries(e.components.input).forEach(([o,n])=>{if(n)s.style.setProperty(`--input-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,n)});if(e.components?.card)Object.entries(e.components.card).forEach(([o,n])=>{if(n)s.style.setProperty(`--card-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,n)})}function Ph(){return ce}function Lh(e){let t=e.split("."),s=ce;for(let o of t)if(s&&typeof s==="object"&&o in s)s=s[o];else return;return s}var Oh={default:$e,purple:Z({colors:{primary:"#8b5cf6",secondary:"#a78bfa"}}),green:Z({colors:{primary:"#10b981",secondary:"#34d399"}}),orange:Z({colors:{primary:"#f97316",secondary:"#fb923c"}}),dark:Z({colors:{primary:"#60a5fa",secondary:"#a78bfa",gray:"#9ca3af",white:"#1f2937",black:"#f9fafb"}}),minimal:Z({borderRadius:{none:"0",sm:"0",md:"0.125rem",lg:"0.25rem",full:"0.25rem"},shadows:{sm:"none",md:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",lg:"0 1px 3px 0 rgba(0, 0, 0, 0.1)",xl:"0 4px 6px -1px rgba(0, 0, 0, 0.1)","2xl":"0 10px 15px -3px rgba(0, 0, 0, 0.1)",none:"none"}})};function Nh(e){return rr(e)}var lr="./ChatInbox-cbbb5x1n.stx";var dr="./ChatMessage-rj37tdgn.stx";function zh(e,t=""){if(!e)return"";let s=e;if(typeof s.href==="string"&&s.href)return s.href;if(!t)return"";let o=!1,n=t.replace(/\{(\w+)\}/g,(a,r)=>{let i=s[r];if(i==null||i==="")return o=!0,"";return encodeURIComponent(String(i))});return o?"":n}import{derived as de,effect as pr,sharedRequest as ur,state as D}from"@stacksjs/stx";import{useBroadcastStream as hr}from"@stacksjs/stx/composables/use-broadcast-stream";var fr=1500;function Vh(e){let t=e.endpoint??"/messages",s=D([]),o=D([]),n=D(null),a=D(""),r=D([]),i=D(!1),c=D(!1),p=D(!1),u=D(""),d=D(""),g=D(""),m=D(!1),k=D(!1),C=D(4000),y=D(!1),b=new Set,v=null,E=null,A="",S=0,V=new Map,z=null,B=!1,K=0;function h(){S++,s.set([]),o.set([]),n.set(null),a.set(""),r.set([]),d.set(""),u.set(""),i.set(!1),c.set(!1),p.set(!1),V=new Map,z=null,K=0,k.set(!1),v?.close(),v=null}function f(){let w=e.scopeKey();if(w!==A)h(),A=w;return Ge(),S}async function T(w,x){let I=await e.request(`${t}${w}`,{...x,cache:"no-store"}),P=await I.json().catch(()=>({}));if(!I.ok)throw Error(P.error||"Could not load messages. Try again.");return P}let M=de(()=>{let w=g().toLowerCase().trim();return s().map((x)=>({...x,conversation:o().find((I)=>I.recipient_id===x.id)})).filter((x)=>(!w||`${x.name} ${x.role}`.toLowerCase().includes(w))&&(!m()||(x.conversation?.unread??0)>0)).sort((x,I)=>(I.conversation?.last_message?.id??0)-(x.conversation?.last_message?.id??0)||x.name.localeCompare(I.name))}),U=de(()=>o().reduce((w,x)=>w+x.unread,0)),Se=de(()=>!!a()&&!!d().trim()&&d().trim().length<=C()&&!p()&&!c()),We=de(e.selfId);function Y(w){u.set(w instanceof Error?w.message:"Could not load messages. Try again.")}async function pe(w,x,I=!0){let P=await T(`/conversations/${x}`);if(w!==S||x!==a()||e.scopeKey()!==A)return;let j=P.messages[0]?.id;if(r.set([...r().filter((ge)=>j&&ge.id<j),...P.messages]),r().length===P.messages.length)k.set(P.has_more);let te=P.messages.at(-1);if(I&&te){if(await T(`/conversations/${x}/read`,{method:"POST",body:JSON.stringify({through_id:te.id})}),w===S&&x===a())o.update((ge)=>ge.map((be)=>be.id===x?{...be,unread:0}:be))}}let ue=ur(),ee=new Set;function Ke(){if(!e.broadcastEndpoint||!e.selfId()||y())return Promise.resolve();return new Promise((w)=>{let x=()=>{clearTimeout(I),ee.delete(x),w()},I=setTimeout(x,fr);ee.add(x)})}function Te(){if(!ee.size)return!1;for(let w of[...ee])w();return!0}function Ee(){return f(),ue.run(S,()=>Ke().then(Ie)).finally(J)}async function _e(){f(),await ue.fresh(S,()=>Ie()).finally(J)}async function Ie(){let w=f();i.set(!0),u.set("");try{let x=await T("");if(w!==S||e.scopeKey()!==A)return;s.set(x.contacts),o.set(x.conversations),C.set(x.max_length),i.set(!1);let I=n()?x.contacts.find((j)=>j.id===n().id):null;if(n()&&!I){let j=n().id;Ae(),V.delete(j),d.set(""),z=null}else if(I)n.set(I);let P=e.initialRecipient?.()??0;if(P>0&&P!==K){let j=x.contacts.find((te)=>te.id===P);if(j)K=P,await he(j)}}catch(x){if(w===S)Y(x)}finally{if(w===S)i.set(!1)}}async function he(w){if(f(),n())V.set(n().id,d());let x=++S;p.set(!1),n.set(w),d.set(V.get(w.id)??""),a.set(""),r.set([]),k.set(!1),u.set(""),c.set(!0);try{let I=await T("/conversations",{method:"POST",body:JSON.stringify({recipient_id:w.id})});if(x!==S||e.scopeKey()!==A)return;a.set(I.id),await pe(x,I.id)}catch(I){if(x===S)Y(I)}finally{if(x===S)c.set(!1);J()}}function Ae(){if(n())V.set(n().id,d());S++,p.set(!1),c.set(!1),n.set(null),a.set(""),r.set([]),u.set("")}async function Ue(){if(f(),!Se())return;let w=a(),x=d().trim(),I=S,P=z?.body===x&&z.thread===w?z.key:crypto.randomUUID();z={body:x,key:P,thread:w},p.set(!0),u.set("");try{if(await T(`/conversations/${w}/messages`,{method:"POST",body:JSON.stringify({body:x,client_key:P})}),I!==S||e.scopeKey()!==A)return;if(d().trim()===x)d.set("");V.delete(n().id),z=null,await pe(I,w),await _e()}catch(j){if(I===S)Y(j)}finally{if(I===S)p.set(!1);J()}}async function Je(){let w=a(),x=r()[0]?.id,I=S;if(!w||!x||c())return;c.set(!0);try{let P=await T(`/conversations/${w}?before=${x}`);if(I===S&&w===a())r.set([...P.messages,...r()]),k.set(P.has_more)}catch(P){if(I===S)Y(P)}finally{if(I===S)c.set(!1);J()}}async function Pe(w=!1){if(B||p()||c())return;B=!0;try{if(await Ee(),w&&n()&&!a())await he(n());else if(w&&a())await pe(S,a())}catch(x){Y(x)}finally{B=!1,J()}}let fe=!1;async function me(){if(B||ue.busy||p()||c()){fe=!0;return}await Pe([...b].some((w)=>w()))}function Ge(){if(v||!b.size||!e.selfId()||!e.broadcastEndpoint)return;let w=A;v=hr({endpoint:e.broadcastEndpoint,request:e.request,onStatus:(x)=>{if(y.set(x),!x)Te()},onConnected:()=>{if(!Te()&&w===e.scopeKey())me()},onMessage:(x)=>{if(w===e.scopeKey()&&x.event.startsWith("messaging."))me()}})}function Ye(w=()=>!1){if(b.add(w),f(),!E)E=pr(()=>{f()});return()=>{if(b.delete(w),!b.size)v?.close(),v=null,E?.(),E=null}}function J(){if(fe)fe=!1,me()}return{contacts:s,conversations:o,selected:n,threadId:a,messages:r,loading:i,threadLoading:c,sending:p,error:u,draft:d,search:g,unreadOnly:m,hasMore:k,maxLength:C,rows:M,unread:U,canSend:Se,selfId:We,load:Ee,open:he,back:Ae,send:Ue,older:Je,refresh:Pe,reset:h,observe:Ye,connected:y}}var gr="./ChatUnreadBadge-3vq0t8d2.stx";var xr="./ChatLauncher-3zph4trh.stx";export{rt as Accordion,lt as AccordionItem,Ku as AnimationClasses,dt as Audio,xt as Avatar,wt as Badge,kt as Breadcrumb,Q as Breakpoints,Et as Button,Pt as Calendar,jt as Card,lr as ChatInbox,xr as ChatLauncher,dr as ChatMessage,gr as ChatUnreadBadge,Ft as Checkbox,Co as Checkout,Xe as CodeBlock,Bt as Combobox,Wt as ComboboxButton,_t as ComboboxInput,Jt as ComboboxOption,Yt as ComboboxOptions,Qt as CommandPalette,es as CommandPaletteItem,R as ComponentError,Ot as DateRangePicker,So as DefaultPaymentMethod,ss as Dialog,ns as DialogBackdrop,rs as DialogDescription,ls as DialogPanel,ds as DialogTitle,us as Drawer,fs as Dropdown,gs as DropdownButton,xs as DropdownItem,ws as DropdownItems,Fu as Easing,Es as EmailInput,Dt as EmptyState,G as ErrorTypes,Qs as FilterChip,eo as FilterChips,Qe as Footer,ks as Form,Ze as Hero,Ss as Image,et as Installation,Iu as KeyboardKeys,Rr as KeyboardShortcuts,Ya as KeyframeAnimations,so as ListRow,Bs as Listbox,Ws as ListboxButton,_s as ListboxLabel,Js as ListboxOption,Ys as ListboxOptions,ut as Login,no as NavBar,ho as Navigator,mo as Notification,As as NumberInput,bo as Pager,vo as PagerDots,yo as Pagination,Ls as PasswordInput,Eo as PaymentMethods,Lo as Popover,No as PopoverButton,Mo as PopoverPanel,zo as Portal,Ho as Progress,l as PropTypes,Vo as Radio,qo as RadioGroup,Ko as RadioGroupDescription,Uo as RadioGroupLabel,Go as RadioGroupOption,Xr as SHADE_VAR_PREFIX,Ns as SearchInput,ro as SectionCard,Xo as Select,Zo as Sidebar,tn as SidebarFooter,on as SidebarHeader,an as SidebarItem,ln as SidebarPinned,dn as SidebarSection,un as SidebarSpace,gn as SidebarSpaceSwitcher,fn as SidebarSpaces,ft as Signup,In as Skeleton,Pn as Spinner,On as Stepper,Dn as StepperStep,re as StorageManager,Ao as SubscriptionCheckout,Rn as Switch,Le as THEMED_FAMILIES,Yn as Tab,lo as TabBar,po as TabBarItem,Qn as TabList,ea as TabPanel,jn as Table,Fn as TableBody,Bn as TableCell,Wn as TableHead,_n as TableHeader,Jn as TableRow,sa as Tabs,na as Teleport,Ms as TextInput,ra as Textarea,Rt as ThemeToggle,la as Tooltip,da as Transition,gt as TwoFactorChallenge,ua as Video,fa as VirtualList,ga as VirtualTable,Gu as animate,_u as animateWithClass,Su as announceToScreenReader,je as applyAnimation,Zu as applyHeadwindClasses,Ah as applyTheme,Ou as aria,Ct as assert,Li as assertProp,It as buttonPropSchema,Ti as clearErrorHandler,Ch as clearModuleCache,Ur as closeOverlay,hh as componentMessages,zh as contactLink,$r as copyToClipboard,$u as createAriaDescription,Cu as createAriaLabel,Vh as createChat,xh as createComponentPool,Ii as createDebugger,Tu as createFocusTrap,th as createI18n,mh as createKeepAlive,Ga as createKeyframeAnimation,Uu as createKeyframes,gh as createLRUCache,H as createPropValidator,Sh as createRouteLoader,Eu as createRovingTabindex,ji as createSafeClickHandler,Nu as createScreenReaderText,zu as createSkipLink,bh as createStateManager,Ap as createStorage,Z as createTheme,Ua as cssAnimation,rh as d,ch as dateTimeFormats,$e as defaultTheme,De as deriveSpaceTint,Qu as detectLanguage,Ei as devAssert,qa as easeInBack,ze as easeInBounce,za as easeInCirc,ka as easeInCubic,Fa as easeInElastic,Da as easeInExpo,Ka as easeInOutBack,_a as easeInOutBounce,Ha as easeInOutCirc,$a as easeInOutCubic,Ba as easeInOutElastic,Ra as easeInOutExpo,ya as easeInOutQuad,Ea as easeInOutQuart,Pa as easeInOutQuint,Na as easeInOutSine,va as easeInQuad,Sa as easeInQuart,Ia as easeInQuint,La as easeInSine,Wa as easeOutBack,we as easeOutBounce,ja as easeOutCirc,Ca as easeOutCubic,Va as easeOutElastic,Ma as easeOutExpo,wa as easeOutQuad,Ta as easeOutQuart,Aa as easeOutQuint,Oa as easeOutSine,Ai as errorBoundary,Cs as formPropSchema,Re as generateId,Ar as generateSEOTags,Nh as generateThemeCSS,$h as getCacheStats,Ru as getColorSchemePreference,xe as getEffectiveTheme,ve as getFocusableElements,Qa as getHighlighter,oh as getI18n,tt as getSystemTheme,Ih as getTheme,Lh as getThemeValue,ne as handleError,Au as hasFocus,Xu as highlight,ph as isRTL,Jr as isTopOverlay,Lu as isVisibleToScreenReader,or as lazyLoad,yh as lazyLoadAll,wh as lazyLoadComponent,ar as lazyLoadImage,Th as lazyLoadImages,le as lazyLoadModule,xa as linear,uh as loadLocaleMessages,ae as macosColors,Pu as moveFocus,ih as n,Tn as normalizeSpace,ep as normalizeSpaces,dh as numberFormats,js as numberInputPropSchema,_r as openOverlay,Gr as openOverlays,lh as pluralRules,Mu as prefersHighContrast,Du as prefersReducedMotion,nr as preloadModule,kh as preloadModules,Bu as removeAnimation,Yd as resolveIconColor,Gd as resolveSidebarTheme,$n as resolveSpaceTint,Wu as sequenceAnimations,Si as setErrorHandler,sh as setI18n,ot as setLink,O as setMeta,st as setTitle,Ne as sidebarThemes,tp as spaceIndexOf,sp as spaceTintPayload,Sn as spaceTintVars,Zd as spaceWashGradient,qu as staggerAnimation,Ip as storage,Qr as stxThemePreset,nh as t,ah as tc,zs as textInputPropSchema,Oh as themePresets,rr as themeToCSSProperties,Zr as themeVariableNames,Fr as useBreakpoint,Lr as useClickOutside,Cr as useCopyCode,Tr as useDarkMode,Nr as useFocusTrap,qr as useIsDarkMode,Br as useIsDesktop,Vr as useIsMobile,Mr as useKeyboard,jr as useLocalStorage,X as useMediaQuery,Wr as usePrefersReducedMotion,Ir as useSEO,Ph as useTheme,ju as validateAriaRelationships,zi as validateButtonProps,ic as validateEmailInputProps,Jl as validateFormProps,cc as validateNumberInputProps,lc as validatePasswordInputProps,St as validateProps,dc as validateSearchInputProps,Fi as validateSize,rc as validateTextInputProps,Hi as validateVariant,Ja as waitForAnimation,$t as warn,Oi as warnProp,Oe as wrapErrorHandler};
|
|
25
|
+
}`}function Dh(e,t){if(ce=e,typeof document>"u")return;let s=t||document.documentElement;if(e.colors)Object.entries(e.colors).forEach(([o,n])=>{if(n)s.style.setProperty(`--color-${o}`,n)});if(e.typography?.fontFamily)Object.entries(e.typography.fontFamily).forEach(([o,n])=>{if(n)s.style.setProperty(`--font-${o}`,n)});if(e.typography?.fontSize)Object.entries(e.typography.fontSize).forEach(([o,n])=>{if(n)s.style.setProperty(`--text-${o}`,n)});if(e.typography?.fontWeight)Object.entries(e.typography.fontWeight).forEach(([o,n])=>{if(n)s.style.setProperty(`--font-weight-${o}`,n)});if(e.typography?.lineHeight)Object.entries(e.typography.lineHeight).forEach(([o,n])=>{if(n)s.style.setProperty(`--leading-${o}`,n)});if(e.spacing)Object.entries(e.spacing).forEach(([o,n])=>{if(n)s.style.setProperty(`--spacing-${o}`,n)});if(e.borderRadius)Object.entries(e.borderRadius).forEach(([o,n])=>{if(n)s.style.setProperty(`--radius-${o}`,n)});if(e.shadows)Object.entries(e.shadows).forEach(([o,n])=>{if(n)s.style.setProperty(`--shadow-${o}`,n)});if(e.components?.button)Object.entries(e.components.button).forEach(([o,n])=>{if(n)s.style.setProperty(`--button-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,n)});if(e.components?.input)Object.entries(e.components.input).forEach(([o,n])=>{if(n)s.style.setProperty(`--input-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,n)});if(e.components?.card)Object.entries(e.components.card).forEach(([o,n])=>{if(n)s.style.setProperty(`--card-${o.replace(/([A-Z])/g,"-$1").toLowerCase()}`,n)})}function Mh(){return ce}function Rh(e){let t=e.split("."),s=ce;for(let o of t)if(s&&typeof s==="object"&&o in s)s=s[o];else return;return s}var zh={default:$e,purple:Z({colors:{primary:"#8b5cf6",secondary:"#a78bfa"}}),green:Z({colors:{primary:"#10b981",secondary:"#34d399"}}),orange:Z({colors:{primary:"#f97316",secondary:"#fb923c"}}),dark:Z({colors:{primary:"#60a5fa",secondary:"#a78bfa",gray:"#9ca3af",white:"#1f2937",black:"#f9fafb"}}),minimal:Z({borderRadius:{none:"0",sm:"0",md:"0.125rem",lg:"0.25rem",full:"0.25rem"},shadows:{sm:"none",md:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",lg:"0 1px 3px 0 rgba(0, 0, 0, 0.1)",xl:"0 4px 6px -1px rgba(0, 0, 0, 0.1)","2xl":"0 10px 15px -3px rgba(0, 0, 0, 0.1)",none:"none"}})};function jh(e){return lr(e)}var dr="./ChatInbox-cbbb5x1n.stx";var ur="./ChatMessage-rj37tdgn.stx";function Bh(e,t=""){if(!e)return"";let s=e;if(typeof s.href==="string"&&s.href)return s.href;if(!t)return"";let o=!1,n=t.replace(/\{(\w+)\}/g,(a,r)=>{let i=s[r];if(i==null||i==="")return o=!0,"";return encodeURIComponent(String(i))});return o?"":n}import{derived as de,effect as hr,sharedRequest as fr,state as D}from"@stacksjs/stx";import{useBroadcastStream as mr}from"@stacksjs/stx/composables/use-broadcast-stream";var gr=1500;function _h(e){let t=e.endpoint??"/messages",s=D([]),o=D([]),n=D(null),a=D(""),r=D([]),i=D(!1),c=D(!1),p=D(!1),u=D(""),d=D(""),g=D(""),m=D(!1),k=D(!1),C=D(4000),y=D(!1),b=new Set,v=null,E=null,A="",S=0,V=new Map,z=null,B=!1,K=0;function h(){S++,s.set([]),o.set([]),n.set(null),a.set(""),r.set([]),d.set(""),u.set(""),i.set(!1),c.set(!1),p.set(!1),V=new Map,z=null,K=0,k.set(!1),v?.close(),v=null}function f(){let w=e.scopeKey();if(w!==A)h(),A=w;return Ge(),S}async function T(w,x){let I=await e.request(`${t}${w}`,{...x,cache:"no-store"}),P=await I.json().catch(()=>({}));if(!I.ok)throw Error(P.error||"Could not load messages. Try again.");return P}let M=de(()=>{let w=g().toLowerCase().trim();return s().map((x)=>({...x,conversation:o().find((I)=>I.recipient_id===x.id)})).filter((x)=>(!w||`${x.name} ${x.role}`.toLowerCase().includes(w))&&(!m()||(x.conversation?.unread??0)>0)).sort((x,I)=>(I.conversation?.last_message?.id??0)-(x.conversation?.last_message?.id??0)||x.name.localeCompare(I.name))}),U=de(()=>o().reduce((w,x)=>w+x.unread,0)),Se=de(()=>!!a()&&!!d().trim()&&d().trim().length<=C()&&!p()&&!c()),We=de(e.selfId);function Y(w){u.set(w instanceof Error?w.message:"Could not load messages. Try again.")}async function pe(w,x,I=!0){let P=await T(`/conversations/${x}`);if(w!==S||x!==a()||e.scopeKey()!==A)return;let j=P.messages[0]?.id;if(r.set([...r().filter((ge)=>j&&ge.id<j),...P.messages]),r().length===P.messages.length)k.set(P.has_more);let te=P.messages.at(-1);if(I&&te){if(await T(`/conversations/${x}/read`,{method:"POST",body:JSON.stringify({through_id:te.id})}),w===S&&x===a())o.update((ge)=>ge.map((be)=>be.id===x?{...be,unread:0}:be))}}let ue=fr(),ee=new Set;function Ke(){if(!e.broadcastEndpoint||!e.selfId()||y())return Promise.resolve();return new Promise((w)=>{let x=()=>{clearTimeout(I),ee.delete(x),w()},I=setTimeout(x,gr);ee.add(x)})}function Te(){if(!ee.size)return!1;for(let w of[...ee])w();return!0}function Ee(){return f(),ue.run(S,()=>Ke().then(Ie)).finally(J)}async function _e(){f(),await ue.fresh(S,()=>Ie()).finally(J)}async function Ie(){let w=f();i.set(!0),u.set("");try{let x=await T("");if(w!==S||e.scopeKey()!==A)return;s.set(x.contacts),o.set(x.conversations),C.set(x.max_length),i.set(!1);let I=n()?x.contacts.find((j)=>j.id===n().id):null;if(n()&&!I){let j=n().id;Ae(),V.delete(j),d.set(""),z=null}else if(I)n.set(I);let P=e.initialRecipient?.()??0;if(P>0&&P!==K){let j=x.contacts.find((te)=>te.id===P);if(j)K=P,await he(j)}}catch(x){if(w===S)Y(x)}finally{if(w===S)i.set(!1)}}async function he(w){if(f(),n())V.set(n().id,d());let x=++S;p.set(!1),n.set(w),d.set(V.get(w.id)??""),a.set(""),r.set([]),k.set(!1),u.set(""),c.set(!0);try{let I=await T("/conversations",{method:"POST",body:JSON.stringify({recipient_id:w.id})});if(x!==S||e.scopeKey()!==A)return;a.set(I.id),await pe(x,I.id)}catch(I){if(x===S)Y(I)}finally{if(x===S)c.set(!1);J()}}function Ae(){if(n())V.set(n().id,d());S++,p.set(!1),c.set(!1),n.set(null),a.set(""),r.set([]),u.set("")}async function Ue(){if(f(),!Se())return;let w=a(),x=d().trim(),I=S,P=z?.body===x&&z.thread===w?z.key:crypto.randomUUID();z={body:x,key:P,thread:w},p.set(!0),u.set("");try{if(await T(`/conversations/${w}/messages`,{method:"POST",body:JSON.stringify({body:x,client_key:P})}),I!==S||e.scopeKey()!==A)return;if(d().trim()===x)d.set("");V.delete(n().id),z=null,await pe(I,w),await _e()}catch(j){if(I===S)Y(j)}finally{if(I===S)p.set(!1);J()}}async function Je(){let w=a(),x=r()[0]?.id,I=S;if(!w||!x||c())return;c.set(!0);try{let P=await T(`/conversations/${w}?before=${x}`);if(I===S&&w===a())r.set([...P.messages,...r()]),k.set(P.has_more)}catch(P){if(I===S)Y(P)}finally{if(I===S)c.set(!1);J()}}async function Pe(w=!1){if(B||p()||c())return;B=!0;try{if(await Ee(),w&&n()&&!a())await he(n());else if(w&&a())await pe(S,a())}catch(x){Y(x)}finally{B=!1,J()}}let fe=!1;async function me(){if(B||ue.busy||p()||c()){fe=!0;return}await Pe([...b].some((w)=>w()))}function Ge(){if(v||!b.size||!e.selfId()||!e.broadcastEndpoint)return;let w=A;v=mr({endpoint:e.broadcastEndpoint,request:e.request,onStatus:(x)=>{if(y.set(x),!x)Te()},onConnected:()=>{if(!Te()&&w===e.scopeKey())me()},onMessage:(x)=>{if(w===e.scopeKey()&&x.event.startsWith("messaging."))me()}})}function Ye(w=()=>!1){if(b.add(w),f(),!E)E=hr(()=>{f()});return()=>{if(b.delete(w),!b.size)v?.close(),v=null,E?.(),E=null}}function J(){if(fe)fe=!1,me()}return{contacts:s,conversations:o,selected:n,threadId:a,messages:r,loading:i,threadLoading:c,sending:p,error:u,draft:d,search:g,unreadOnly:m,hasMore:k,maxLength:C,rows:M,unread:U,canSend:Se,selfId:We,load:Ee,open:he,back:Ae,send:Ue,older:Je,refresh:Pe,reset:h,observe:Ye,connected:y}}var xr="./ChatUnreadBadge-3vq0t8d2.stx";var wr="./ChatLauncher-3zph4trh.stx";export{rt as Accordion,lt as AccordionItem,Yu as AnimationClasses,dt as Audio,xt as Avatar,wt as Badge,kt as Breadcrumb,Q as Breakpoints,Et as Button,Pt as Calendar,jt as Card,dr as ChatInbox,wr as ChatLauncher,ur as ChatMessage,xr as ChatUnreadBadge,Ft as Checkbox,Co as Checkout,Xe as CodeBlock,Bt as Combobox,Wt as ComboboxButton,_t as ComboboxInput,Jt as ComboboxOption,Yt as ComboboxOptions,Qt as CommandPalette,es as CommandPaletteItem,R as ComponentError,Lt as DateRangePicker,So as DefaultPaymentMethod,ss as Dialog,ns as DialogBackdrop,rs as DialogDescription,ls as DialogPanel,ds as DialogTitle,us as Drawer,fs as Dropdown,gs as DropdownButton,xs as DropdownItem,ws as DropdownItems,Ku as Easing,Es as EmailInput,Dt as EmptyState,G as ErrorTypes,Qs as FilterChip,eo as FilterChips,Qe as Footer,ks as Form,Ze as Hero,Ss as Image,et as Installation,Nu as KeyboardKeys,jr as KeyboardShortcuts,Qa as KeyframeAnimations,so as ListRow,Bs as Listbox,Ws as ListboxButton,_s as ListboxLabel,Js as ListboxOption,Ys as ListboxOptions,ut as Login,no as NavBar,ho as Navigator,mo as Notification,As as NumberInput,bo as Pager,vo as PagerDots,yo as Pagination,Os as PasswordInput,Eo as PaymentMethods,Oo as Popover,No as PopoverButton,Mo as PopoverPanel,zo as Portal,Ho as Progress,l as PropTypes,Vo as Radio,qo as RadioGroup,Ko as RadioGroupDescription,Uo as RadioGroupLabel,Go as RadioGroupOption,Zr as SHADE_VAR_PREFIX,Ns as SearchInput,ro as SectionCard,Xo as SegmentedControl,Zo as Select,tn as Sidebar,on as SidebarFooter,an as SidebarHeader,ln as SidebarItem,dn as SidebarPinned,un as SidebarSection,fn as SidebarSpace,xn as SidebarSpaceSwitcher,gn as SidebarSpaces,ft as Signup,Pn as Skeleton,Ln as Spinner,Dn as Stepper,Rn as StepperStep,re as StorageManager,Ao as SubscriptionCheckout,jn as Switch,Oe as THEMED_FAMILIES,Qn as Tab,lo as TabBar,po as TabBarItem,ea as TabList,sa as TabPanel,Fn as Table,Bn as TableBody,Wn as TableCell,_n as TableHead,Jn as TableHeader,Yn as TableRow,na as Tabs,ra as Teleport,Ms as TextInput,la as Textarea,Rt as ThemeToggle,da as Tooltip,ua as Transition,gt as TwoFactorChallenge,fa as Video,ga as VirtualList,xa as VirtualTable,eh as animate,Xu as animateWithClass,Pu as announceToScreenReader,je as applyAnimation,nh as applyHeadwindClasses,Dh as applyTheme,zu as aria,Ct as assert,Ni as assertProp,It as buttonPropSchema,Ii as clearErrorHandler,Ih as clearModuleCache,Gr as closeOverlay,xh as componentMessages,Bh as contactLink,Tr as copyToClipboard,Au as createAriaDescription,Iu as createAriaLabel,_h as createChat,Ch as createComponentPool,Pi as createDebugger,Ou as createFocusTrap,rh as createI18n,wh as createKeepAlive,Xa as createKeyframeAnimation,Qu as createKeyframes,yh as createLRUCache,H as createPropValidator,Ph as createRouteLoader,Lu as createRovingTabindex,Fi as createSafeClickHandler,ju as createScreenReaderText,Bu as createSkipLink,kh as createStateManager,Dp as createStorage,Z as createTheme,Ga as cssAnimation,ph as d,fh as dateTimeFormats,$e as defaultTheme,De as deriveSpaceTint,oh as detectLanguage,Ai as devAssert,Ka as easeInBack,ze as easeInBounce,Ha as easeInCirc,$a as easeInCubic,Ba as easeInElastic,Ra as easeInExpo,Ua as easeInOutBack,Ja as easeInOutBounce,Va as easeInOutCirc,Ta as easeInOutCubic,Wa as easeInOutElastic,ja as easeInOutExpo,Ca as easeInOutQuad,Aa as easeInOutQuart,La as easeInOutQuint,Ma as easeInOutSine,ya as easeInQuad,Ea as easeInQuart,Pa as easeInQuint,Na as easeInSine,_a as easeOutBack,we as easeOutBounce,Fa as easeOutCirc,Sa as easeOutCubic,qa as easeOutElastic,za as easeOutExpo,ka as easeOutQuad,Ia as easeOutQuart,Oa as easeOutQuint,Da as easeOutSine,Oi as errorBoundary,Cs as formPropSchema,Re as generateId,Or as generateSEOTags,jh as generateThemeCSS,Ah as getCacheStats,Vu as getColorSchemePreference,xe as getEffectiveTheme,ve as getFocusableElements,er as getHighlighter,lh as getI18n,tt as getSystemTheme,Nh as getTheme,Rh as getThemeValue,ne as handleError,Du as hasFocus,sh as highlight,gh as isRTL,Yr as isTopOverlay,Ru as isVisibleToScreenReader,ar as lazyLoad,Th as lazyLoadAll,Sh as lazyLoadComponent,ir as lazyLoadImage,Oh as lazyLoadImages,le as lazyLoadModule,wa as linear,bh as loadLocaleMessages,ae as macosColors,Mu as moveFocus,uh as n,In as normalizeSpace,ap as normalizeSpaces,mh as numberFormats,js as numberInputPropSchema,Jr as openOverlay,Xr as openOverlays,hh as pluralRules,Fu as prefersHighContrast,Hu as prefersReducedMotion,rr as preloadModule,Eh as preloadModules,Uu as removeAnimation,tp as resolveIconColor,ep as resolveSidebarTheme,Tn as resolveSpaceTint,Gu as sequenceAnimations,Ei as setErrorHandler,ih as setI18n,ot as setLink,L as setMeta,st as setTitle,Ne as sidebarThemes,rp as spaceIndexOf,ip as spaceTintPayload,En as spaceTintVars,np as spaceWashGradient,Ju as staggerAnimation,Np as storage,ei as stxThemePreset,ch as t,dh as tc,zs as textInputPropSchema,zh as themePresets,lr as themeToCSSProperties,ti as themeVariableNames,Br as useBreakpoint,Nr as useClickOutside,Sr as useCopyCode,Ir as useDarkMode,Mr as useFocusTrap,Kr as useIsDarkMode,Wr as useIsDesktop,qr as useIsMobile,zr as useKeyboard,Fr as useLocalStorage,X as useMediaQuery,_r as usePrefersReducedMotion,Pr as useSEO,Mh as useTheme,qu as validateAriaRelationships,Hi as validateButtonProps,cc as validateEmailInputProps,Yl as validateFormProps,pc as validateNumberInputProps,dc as validatePasswordInputProps,St as validateProps,uc as validateSearchInputProps,Bi as validateSize,lc as validateTextInputProps,Vi as validateVariant,Ya as waitForAnimation,$t as warn,Di as warnProp,Le as wrapErrorHandler};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { DefineComponent } from '@stacksjs/stx';
|
|
2
|
+
declare const __dtsx_component__: __DtsxStxComponentType;
|
|
3
|
+
/*
|
|
4
|
+
* A segmented control: a few mutually exclusive choices in one track, the
|
|
5
|
+
* chosen one raised. The control iOS draws as UISegmentedControl and a phone
|
|
6
|
+
* app reaches for whenever a list has two to five ways to be shown.
|
|
7
|
+
*
|
|
8
|
+
* It is what applications kept drawing for themselves. One app copied the
|
|
9
|
+
* same track-and-segment markup into ten native screens and a stylesheet; the
|
|
10
|
+
* other drew seven by hand on the web, each with its own roles, and on native
|
|
11
|
+
* had none at all - a "Change the filter" button that cycled through the
|
|
12
|
+
* choices one tap at a time, so nobody could see what the others were.
|
|
13
|
+
*
|
|
14
|
+
* The same source renders on both targets. Each segment is a button with
|
|
15
|
+
* `aria-pressed`, inside a labelled group, which is what a toggle set is
|
|
16
|
+
* (a radio group would promise arrow-key roving the segments do not need,
|
|
17
|
+
* and tabs would promise panels). On a phone the host announces the chosen
|
|
18
|
+
* segment as selected, from the same attribute.
|
|
19
|
+
*
|
|
20
|
+
* <SegmentedControl v-model:value="period" label="Period" stretch
|
|
21
|
+
* :options="[{ value: 'week', label: 'This week' }, { value: 'all', label: 'All time' }]" />
|
|
22
|
+
*
|
|
23
|
+
* `options` takes strings or `{ value, label, disabled? }`; it is reactive,
|
|
24
|
+
* so a label carrying a count can change in place. The selection is a
|
|
25
|
+
* `v-model:value`, or `:value` with `@change`, which receives the new value.
|
|
26
|
+
* `testID` names the group, and each segment is `<testID>-<value>`.
|
|
27
|
+
*
|
|
28
|
+
* Colour and shape come from roles, so an app restyles it without touching
|
|
29
|
+
* it: the track is `surface-sunken`, the chosen segment `panel` (one step
|
|
30
|
+
* lighter than the track in dark mode, as iOS draws it), the words `fg` and
|
|
31
|
+
* `fg-muted`, and both corners `rounded-control` - a pill-shaped app gets a
|
|
32
|
+
* pill track by setting that one role.
|
|
33
|
+
*/
|
|
34
|
+
export declare const value: unknown;
|
|
35
|
+
export declare const options: unknown;
|
|
36
|
+
export declare const label: unknown;
|
|
37
|
+
export declare const stretch: ReturnType<typeof $bool>;
|
|
38
|
+
export declare const disabled: ReturnType<typeof $bool>;
|
|
39
|
+
export declare const size: boolean;
|
|
40
|
+
export declare const testID: unknown;
|
|
41
|
+
export declare const className: unknown;
|
|
42
|
+
/**
|
|
43
|
+
* @defaultValue
|
|
44
|
+
* ```ts
|
|
45
|
+
* {
|
|
46
|
+
* sm: { segment: 'min-h-[28px] px-2.5 py-1', text: 'text-[13px]' },
|
|
47
|
+
* md: { segment: 'min-h-[32px] px-3 py-1.5', text: 'text-[13px]' }
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
declare const sizeClasses: {
|
|
52
|
+
sm: {
|
|
53
|
+
/** @defaultValue 'min-h-[28px] px-2.5 py-1' */
|
|
54
|
+
segment: string;
|
|
55
|
+
/** @defaultValue 'text-[13px]' */
|
|
56
|
+
text: string
|
|
57
|
+
};
|
|
58
|
+
md: {
|
|
59
|
+
/** @defaultValue 'min-h-[32px] px-3 py-1.5' */
|
|
60
|
+
segment: string;
|
|
61
|
+
/** @defaultValue 'text-[13px]' */
|
|
62
|
+
text: string
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
export declare const sizing: unknown;
|
|
66
|
+
export declare const trackClasses: unknown;
|
|
67
|
+
export declare const segmentBase: unknown;
|
|
68
|
+
declare const selected: ReturnType<typeof useModel>;
|
|
69
|
+
declare type __DtsxStxComponentType = DefineComponent<{ value?: string, options?: unknown[], label?: string, stretch?: unknown, disabled?: unknown, size?: unknown, testID?: string, className?: string }> & { readonly __stxEmits?: ["change"], readonly __stxExposed?: { selected: typeof selected } }
|
|
70
|
+
export default __dtsx_component__;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** One choice. A bare string is its own value and label. */
|
|
2
|
+
export declare interface SegmentedControlOption {
|
|
3
|
+
value: string
|
|
4
|
+
label?: string
|
|
5
|
+
disabled?: boolean
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A few mutually exclusive choices in one track, the chosen one raised. The
|
|
9
|
+
* same source renders on the web and on a native host; on a phone the chosen
|
|
10
|
+
* segment is announced as selected.
|
|
11
|
+
*/
|
|
12
|
+
export declare interface SegmentedControlProps {
|
|
13
|
+
value?: string
|
|
14
|
+
options: Array<string | SegmentedControlOption>
|
|
15
|
+
label?: string
|
|
16
|
+
stretch?: boolean
|
|
17
|
+
disabled?: boolean
|
|
18
|
+
size?: 'sm' | 'md'
|
|
19
|
+
testID?: string
|
|
20
|
+
className?: string
|
|
21
|
+
onChange?: (value: string) => void
|
|
22
|
+
}
|
|
23
|
+
export { default as SegmentedControl } from './SegmentedControl';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.586",
|
|
5
5
|
"description": "A modern component library built with STX, featuring headwind utility classes and TypeScript syntax highlighting.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@iconify-json/f7": "^1.2.2",
|
|
79
79
|
"@stacksjs/ts-css": "^0.3.11",
|
|
80
|
-
"@stacksjs/stx": "0.2.
|
|
81
|
-
"bun-plugin-stx": "0.2.
|
|
80
|
+
"@stacksjs/stx": "0.2.586",
|
|
81
|
+
"bun-plugin-stx": "0.2.586",
|
|
82
82
|
"ts-syntax-highlighter": "^0.2.17",
|
|
83
83
|
"ts-video-player": "^0.1.9"
|
|
84
84
|
},
|
package/src/index.ts
CHANGED
|
@@ -47,6 +47,7 @@ export * from './ui/portal'
|
|
|
47
47
|
export * from './ui/progress'
|
|
48
48
|
export * from './ui/radio'
|
|
49
49
|
export * from './ui/radio-group'
|
|
50
|
+
export * from './ui/segmented-control'
|
|
50
51
|
export * from './ui/select'
|
|
51
52
|
export * from './ui/sidebar'
|
|
52
53
|
export * from './ui/skeleton'
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script server>
|
|
2
|
+
/*
|
|
3
|
+
* A segmented control: a few mutually exclusive choices in one track, the
|
|
4
|
+
* chosen one raised. The control iOS draws as UISegmentedControl and a phone
|
|
5
|
+
* app reaches for whenever a list has two to five ways to be shown.
|
|
6
|
+
*
|
|
7
|
+
* It is what applications kept drawing for themselves. One app copied the
|
|
8
|
+
* same track-and-segment markup into ten native screens and a stylesheet; the
|
|
9
|
+
* other drew seven by hand on the web, each with its own roles, and on native
|
|
10
|
+
* had none at all - a "Change the filter" button that cycled through the
|
|
11
|
+
* choices one tap at a time, so nobody could see what the others were.
|
|
12
|
+
*
|
|
13
|
+
* The same source renders on both targets. Each segment is a button with
|
|
14
|
+
* `aria-pressed`, inside a labelled group, which is what a toggle set is
|
|
15
|
+
* (a radio group would promise arrow-key roving the segments do not need,
|
|
16
|
+
* and tabs would promise panels). On a phone the host announces the chosen
|
|
17
|
+
* segment as selected, from the same attribute.
|
|
18
|
+
*
|
|
19
|
+
* <SegmentedControl v-model:value="period" label="Period" stretch
|
|
20
|
+
* :options="[{ value: 'week', label: 'This week' }, { value: 'all', label: 'All time' }]" />
|
|
21
|
+
*
|
|
22
|
+
* `options` takes strings or `{ value, label, disabled? }`; it is reactive,
|
|
23
|
+
* so a label carrying a count can change in place. The selection is a
|
|
24
|
+
* `v-model:value`, or `:value` with `@change`, which receives the new value.
|
|
25
|
+
* `testID` names the group, and each segment is `<testID>-<value>`.
|
|
26
|
+
*
|
|
27
|
+
* Colour and shape come from roles, so an app restyles it without touching
|
|
28
|
+
* it: the track is `surface-sunken`, the chosen segment `panel` (one step
|
|
29
|
+
* lighter than the track in dark mode, as iOS draws it), the words `fg` and
|
|
30
|
+
* `fg-muted`, and both corners `rounded-control` - a pill-shaped app gets a
|
|
31
|
+
* pill track by setting that one role.
|
|
32
|
+
*/
|
|
33
|
+
export const value = $props.value ?? ''
|
|
34
|
+
export const options = $props.options || []
|
|
35
|
+
export const label = $props.label || ''
|
|
36
|
+
export const stretch = $bool($props.stretch)
|
|
37
|
+
export const disabled = $bool($props.disabled)
|
|
38
|
+
export const size = $props.size === 'sm' ? 'sm' : 'md'
|
|
39
|
+
export const testID = $props.testID || ''
|
|
40
|
+
export const className = $props.className || ''
|
|
41
|
+
|
|
42
|
+
const sizeClasses = {
|
|
43
|
+
sm: { segment: 'min-h-[28px] px-2.5 py-1', text: 'text-[13px]' },
|
|
44
|
+
md: { segment: 'min-h-[32px] px-3 py-1.5', text: 'text-[13px]' },
|
|
45
|
+
}
|
|
46
|
+
export const sizing = sizeClasses[size]
|
|
47
|
+
|
|
48
|
+
export const trackClasses = `${stretch ? 'flex w-full' : 'inline-flex'} flex-row gap-0.5 p-0.5 rounded-control bg-surface-sunken ${className}`.replace(/\s+/g, ' ').trim()
|
|
49
|
+
export const segmentBase = `${stretch ? 'flex-1' : ''} items-center justify-center rounded-control transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${sizing.segment}`.replace(/\s+/g, ' ').trim()
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<script client>
|
|
53
|
+
const emit = defineEmits(['change'])
|
|
54
|
+
const selected = useModel('value', { default: {{ value }}, parse: v => v == null ? '' : String(v) })
|
|
55
|
+
const choices = useReactiveProp('options', {{ options }})
|
|
56
|
+
const isDisabled = useReactiveProp('disabled', {{ disabled }})
|
|
57
|
+
const segmentBase = {{ segmentBase }}
|
|
58
|
+
const textSize = {{ sizing.text }}
|
|
59
|
+
const groupID = {{ testID }}
|
|
60
|
+
|
|
61
|
+
/** A choice as `{ value, label, disabled }`, whichever way it was written. */
|
|
62
|
+
function normalise(choice) {
|
|
63
|
+
if (choice !== null && typeof choice === 'object') {
|
|
64
|
+
const value = choice.value == null ? '' : String(choice.value)
|
|
65
|
+
return { value, label: choice.label == null ? value : String(choice.label), disabled: choice.disabled === true }
|
|
66
|
+
}
|
|
67
|
+
const value = choice == null ? '' : String(choice)
|
|
68
|
+
return { value, label: value, disabled: false }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function segments() {
|
|
72
|
+
const list = choices()
|
|
73
|
+
return Array.isArray(list) ? list.map(normalise) : []
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isOn(segment) {
|
|
77
|
+
return segment.value === selected()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function isOff(segment) {
|
|
81
|
+
return isDisabled() || segment.disabled
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function choose(segment) {
|
|
85
|
+
if (isOff(segment) || isOn(segment)) return
|
|
86
|
+
selected.set(segment.value)
|
|
87
|
+
emit('change', segment.value)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function segmentClasses(segment) {
|
|
91
|
+
const state = isOn(segment) ? 'bg-panel dark:bg-neutral-600 shadow-sm' : 'bg-transparent'
|
|
92
|
+
return `${segmentBase} ${state} ${isOff(segment) ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function labelClasses(segment) {
|
|
96
|
+
return `${textSize} ${isOn(segment) ? 'font-semibold text-fg' : 'font-medium text-fg-muted'}`
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function segmentID(segment) {
|
|
100
|
+
return groupID ? `${groupID}-${segment.value}` : ''
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
defineExpose({ selected })
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<div
|
|
107
|
+
role="group"
|
|
108
|
+
@if(label)aria-label="{{ label }}"@endif
|
|
109
|
+
@if(testID)testID="{{ testID }}"@endif
|
|
110
|
+
class="{{ trackClasses }}"
|
|
111
|
+
data-stx-segmented-control
|
|
112
|
+
>
|
|
113
|
+
<button
|
|
114
|
+
:for="segment in segments()"
|
|
115
|
+
:key="segment.value"
|
|
116
|
+
type="button"
|
|
117
|
+
:testID="segmentID(segment)"
|
|
118
|
+
:aria-pressed="isOn(segment) ? 'true' : 'false'"
|
|
119
|
+
:aria-disabled="isOff(segment) ? 'true' : 'false'"
|
|
120
|
+
:disabled="isOff(segment)"
|
|
121
|
+
:class="segmentClasses(segment)"
|
|
122
|
+
@click="choose(segment)"
|
|
123
|
+
><span :class="labelClasses(segment)" :text="segment.label"></span></button>
|
|
124
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { default as SegmentedControl } from './SegmentedControl.stx'
|
|
2
|
+
|
|
3
|
+
/** One choice. A bare string is its own value and label. */
|
|
4
|
+
export interface SegmentedControlOption {
|
|
5
|
+
value: string
|
|
6
|
+
label?: string
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A few mutually exclusive choices in one track, the chosen one raised. The
|
|
12
|
+
* same source renders on the web and on a native host; on a phone the chosen
|
|
13
|
+
* segment is announced as selected.
|
|
14
|
+
*/
|
|
15
|
+
export interface SegmentedControlProps {
|
|
16
|
+
/** The chosen value. Use `v-model:value`, or `:value` with `@change`. */
|
|
17
|
+
value?: string
|
|
18
|
+
options: Array<string | SegmentedControlOption>
|
|
19
|
+
/** What the choices are of ("Period", "Show"), read before them. */
|
|
20
|
+
label?: string
|
|
21
|
+
/** Fill the width, segments sharing it equally. */
|
|
22
|
+
stretch?: boolean
|
|
23
|
+
disabled?: boolean
|
|
24
|
+
size?: 'sm' | 'md'
|
|
25
|
+
/** Names the group; each segment is `<testID>-<value>`. */
|
|
26
|
+
testID?: string
|
|
27
|
+
className?: string
|
|
28
|
+
onChange?: (value: string) => void
|
|
29
|
+
}
|