@domphy/ui 0.21.1 → 0.21.3

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.
@@ -1,7 +1,7 @@
1
- "use strict";var Domphy=(()=>{var ct=Object.defineProperty,kn=Object.defineProperties,Cn=Object.getOwnPropertyDescriptor,En=Object.getOwnPropertyDescriptors,_n=Object.getOwnPropertyNames,No=Object.getOwnPropertySymbols;var Vo=Object.prototype.hasOwnProperty,Tn=Object.prototype.propertyIsEnumerable;var Bo=(e,t,r)=>t in e?ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V=(e,t)=>{for(var r in t||(t={}))Vo.call(t,r)&&Bo(e,r,t[r]);if(No)for(var r of No(t))Tn.call(t,r)&&Bo(e,r,t[r]);return e},ie=(e,t)=>kn(e,En(t));var mt=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0})},Dn=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of _n(t))!Vo.call(e,a)&&a!==r&&ct(e,a,{get:()=>t[a],enumerable:!(o=Cn(t,a))||o.enumerable});return e};var Mn=e=>Dn(ct({},"__esModule",{value:!0}),e);var Rs={};mt(Rs,{core:()=>ft,theme:()=>wt,ui:()=>At});var ft={};mt(ft,{AttributeList:()=>mr,BooleanAttributes:()=>Jt,CamelAttributes:()=>Uo,ElementList:()=>dr,ElementNode:()=>U,HtmlAttributeNames:()=>Ft,HtmlTags:()=>Go,Notifier:()=>Qe,PrefixCSS:()=>Ce,RawHTML:()=>hr,RecordState:()=>ii,State:()=>qt,SvgTags:()=>Yo,VoidTags:()=>ut,_deliveringNotifier:()=>Ye,_microtask:()=>Qt,_resetKeylessWarnings:()=>Yn,batch:()=>ti,behavior:()=>_e,computed:()=>ei,configure:()=>$n,effect:()=>gr,effectScope:()=>Qn,flushPendingNotifiers:()=>er,flushSync:()=>Zn,getConfig:()=>Xo,hasPendingNotifiers:()=>Qo,hashString:()=>Ne,isRawHTML:()=>Je,isState:()=>zn,merge:()=>j,nextTick:()=>ni,peek:()=>Nn,rawHtml:()=>Te,readonly:()=>An,runBatched:()=>Jo,sanitizeHTMLString:()=>dt,toState:()=>v,untrack:()=>oi,watch:()=>ri});var On=Object.defineProperty,Ho=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable,jo=(e,t,r)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Pn.call(t,r)&&jo(e,r,t[r]);if(Ho)for(var r of Ho(t))Ln.call(t,r)&&jo(e,r,t[r]);return e},Jt=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","inert","download","noModule","paused","autoPictureInPicture"],Uo=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits","baseFrequency","numOctaves","xChannelSelector","yChannelSelector","stdDeviation","colorInterpolationFilters","pathLength"],Ft={htmlFor:"for",allowFullScreen:"allowfullscreen",autoFocus:"autofocus",autoPlay:"autoplay",formNoValidate:"formnovalidate",isMap:"ismap",itemScope:"itemscope",noHref:"nohref",noShade:"noshade",noValidate:"novalidate",playsInline:"playsinline",trueSpeed:"truespeed",typeMustMatch:"typemustmatch",noModule:"nomodule",autoPictureInPicture:"autopictureinpicture",autoCapitalize:"autocapitalize",contentEditable:"contenteditable",spellCheck:"spellcheck",ariaActiveDescendant:"aria-activedescendant",ariaColCount:"aria-colcount",ariaPosinSet:"aria-posinset",ariaSetSize:"aria-setsize",accessKey:"accesskey",enterKeyHint:"enterkeyhint",inputMode:"inputmode",itemId:"itemid",itemProp:"itemprop",itemRef:"itemref",itemType:"itemtype",tabIndex:"tabindex",writingSuggestions:"writingsuggestions",charSet:"charset",hrefLang:"hreflang",crossOrigin:"crossorigin",aLink:"alink",bgColor:"bgcolor",vLink:"vlink",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formTarget:"formtarget",popoverTarget:"popovertarget",popoverTargetAction:"popovertargetaction",allowPaymentRequest:"allowpaymentrequest",allowUserMedia:"allowusermedia",frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",referrerPolicy:"referrerpolicy",srcDoc:"srcdoc",hSpace:"hspace",fetchPriority:"fetchpriority",srcSet:"srcset",srcLang:"srclang",useMap:"usemap",vSpace:"vspace",dirName:"dirname",imageSizes:"imagesizes",imageSrcSet:"imagesrcset",classId:"classid",codeBase:"codebase",codeType:"codetype",valueType:"valuetype",shadowRootClonable:"shadowrootclonable",shadowRootDelegatesFocus:"shadowrootdelegatesfocus",shadowRootMode:"shadowrootmode",colSpan:"colspan",rowSpan:"rowspan",noWrap:"nowrap",vAlign:"valign",charOff:"charoff",maxLength:"maxlength",minLength:"minlength",autoComplete:"autocomplete",encType:"enctype",dateTime:"datetime"},Go=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],Ce={transform:["webkit","ms"],transition:["webkit","ms"],animation:["webkit"],userSelect:["webkit","ms"],flexDirection:["webkit","ms"],flexWrap:["webkit","ms"],justifyContent:["webkit","ms"],alignItems:["webkit","ms"],alignSelf:["webkit","ms"],order:["webkit","ms"],flexGrow:["webkit","ms"],flexShrink:["webkit","ms"],flexBasis:["webkit","ms"],columns:["webkit"],columnCount:["webkit"],columnGap:["webkit"],columnRule:["webkit"],columnWidth:["webkit"],boxSizing:["webkit"],appearance:["webkit","moz"],filter:["webkit"],backdropFilter:["webkit"],clipPath:["webkit"],mask:["webkit"],maskImage:["webkit"],textSizeAdjust:["webkit","ms"],hyphens:["webkit","ms"],writingMode:["webkit","ms"],gridTemplateColumns:["ms"],gridTemplateRows:["ms"],gridAutoColumns:["ms"],gridAutoRows:["ms"],gridColumn:["ms"],gridRow:["ms"],marginInlineStart:["webkit"],marginInlineEnd:["webkit"],paddingInlineStart:["webkit"],paddingInlineEnd:["webkit"],minInlineSize:["webkit"],maxInlineSize:["webkit"],minBlockSize:["webkit"],maxBlockSize:["webkit"],inlineSize:["webkit"],blockSize:["webkit"],tabSize:["moz"],overscrollBehavior:["webkit","ms"],touchAction:["ms"],resize:["webkit"],printColorAdjust:["webkit"],backgroundClip:["webkit"],boxDecorationBreak:["webkit"],overflowScrolling:["webkit"]},Yo=["svg","circle","path","rect","ellipse","line","polyline","polygon","g","defs","use","symbol","linearGradient","radialGradient","stop","clipPath","mask","filter","text","tspan","textPath","image","pattern","marker","animate","animateTransform","animateMotion","feGaussianBlur","feComposite","feColorMatrix","feMerge","feMergeNode","feOffset","feFlood","feBlend","feTurbulence","feDisplacementMap","feComponentTransfer","feFuncR","feFuncG","feFuncB","feFuncA","foreignObject"],ut=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Zo={};function $n(e){Object.assign(Zo,e)}function Xo(){return jt({},Zo)}var Rn=["onAbort","onAuxClick","onBeforeMatch","onBeforeToggle","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLoad","onLoadedData","onLoadedMetadata","onLoadStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPaste","onPause","onPlay","onPlaying","onProgress","onRateChange","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onSubmit","onSuspend","onTimeUpdate","onToggle","onVolumeChange","onWaiting","onWheel","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onCompositionStart","onCompositionUpdate","onCompositionEnd","onTransitionEnd","onTransitionStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onFullscreenChange","onFullscreenError","onFocusIn","onFocusOut"],In=Rn.reduce((e,t)=>{let r=t.slice(2).toLowerCase();return e[r]=t,e},{}),me=[],Qt=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},Fo=100,ht=0,Wt=new Set,Ae=new Set,Ye=null;function Jo(e){ht++;try{return e()}finally{if(ht--,ht===0){let t=Wt;Wt=new Set;for(let r of t)r._scheduleFlush()}}}var Qe=class{constructor(){this._listeners=Object.create(null),this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let r=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(r)),r}removeListener(e,t){var r;if(!this._listeners)return;let o=this._listeners[e];o&&o.has(t)&&(o.delete(t),o.size===0&&(delete this._listeners[e],(r=this._onEmpty)==null||r.call(this,e)))}listenerCount(e){var t,r,o;return(o=(r=(t=this._listeners)==null?void 0:t[e])==null?void 0:r.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let r=me.length?me[me.length-1]:null;if(r&&r[0]===this&&r[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=Fo){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${Fo} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...me]})}ht>0?Wt.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,Ae.add(this),Qt(()=>this._flushAll()))}_isCircular(e){let t=me.findIndex(([o,a])=>o===this&&a===e);if(t===-1)return!1;let r=[...me.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
- ${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,Ae.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)me=o,this._flush(t,r);me=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(!r)return;me.push([this,e]),this._flushing.set(e,t);let o=Ye;Ye=this;try{for(let a of[...r])if(r.has(a))try{a(...t)}catch(n){console.error(n)}}finally{Ye=o}this._flushing.delete(e),me.pop()}};function Qo(){return Ae.size>0}function er(){let e=0;for(;Ae.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...Ae];Ae.clear();for(let r of t)r._flushAll()}}var tr=class{constructor(e){this._releases=new Set,this._consumedVersions=new Map;let t=(()=>{let r=Ye;r&&r._version!==void 0&&this._consumedVersions.get(r)===r._version||e()});t.onSubscribe=r=>{this._releases.add(r)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear(),this._consumedVersions.clear()}get dependencyCount(){return this._releases.size}},Ze=[],Kt=0;function eo(){return Kt>0?null:Ze.length?Ze[Ze.length-1]:null}function or(e,t){Ze.push(e);try{return t()}finally{Ze.pop()}}function rr(e){Kt++;try{return e()}finally{Kt--}}var oe=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",qt=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Qe,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=eo();t&&this.addListener(t.handler)}return this._value}set(e){if(!this._notifier){oe&&console.warn(`[Domphy] State.set() called on a disposed state ("${this.name}") \u2014 the write is ignored. The state outlived its owner; keep a live reference or re-create it.`);return}this._value=e,this._notifier.notify(this.name,e)}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function j(e={},t={}){let r=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],a=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=ve(t));for(let n in t){let i=t[n];if(i!=null)if(typeof i=="object"&&!Array.isArray(i))typeof e[n]=="object"?e[n]=j(e[n],i):e[n]=i;else if(r.includes(n))if(typeof e[n]=="function"||typeof i=="function"){let l=e[n];e[n]=u=>{let d=typeof l=="function"?l(u):l,c=typeof i=="function"?i(u):i;return[d,c].filter(h=>h).join(", ")}}else e[n]=[e[n],i].filter(l=>l).join(", ");else if(a.includes(n))if(typeof e[n]=="function"||typeof i=="function"){let l=e[n];e[n]=u=>{let d=typeof l=="function"?l(u):l,c=typeof i=="function"?i(u):i;return[d,c].filter(h=>h).join("")}}else e[n]=[e[n],i].filter(l=>l).join("");else if(o.includes(n))if(typeof e[n]=="function"||typeof i=="function"){let l=e[n];e[n]=u=>{let d=typeof l=="function"?l(u):l,c=typeof i=="function"?i(u):i;return[d,c].filter(h=>h).join(" ")}}else e[n]=[e[n],i].filter(l=>l).join(" ");else if(n.startsWith("on")){let l=n.replace("on","").toLowerCase();Vn(e,l,i)}else if(n.startsWith("_on")){let l=n.replace("_on","");Bn(e,l,i)}else e[n]=i}return e}function Ne(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function v(e,t){return e instanceof qt||e!=null&&e._isState?e:new qt(e,t)}function zn(e){return typeof e=="object"&&e!==null&&e._isState===!0}function An(e){return{_isState:!0,get(t){return e.get(t)}}}function Nn(e){return rr(()=>e(void 0))}function _e(e,t,r){return{_behaviors:{[e]:{attach:t,props:r}}}}function Bn(e,t,r){let o=`_on${t}`,a=e[o];typeof a=="function"?e[o]=(...n)=>{a(...n),r(...n)}:e[o]=r}function Vn(e,t,r){let o=In[t];if(!o)throw Error(`invalid event name "${t}"`);let a=e[o];typeof a=="function"?e[o]=(n,i)=>{a(n,i),r(n,i)}:e[o]=r}function ve(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r;if(Array.isArray(e)){r=[],t.set(e,r);for(let a of e)r.push(ve(a,t));return r}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){r=new Map,t.set(e,r);for(let[a,n]of e)r.set(ve(a,t),ve(n,t));return r}if(e instanceof Set){r=new Set,t.set(e,r);for(let a of e)r.add(ve(a,t));return r}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);let o=Object.getPrototypeOf(e);if(o!==Object.prototype)return e;r=Object.create(o),t.set(e,r);for(let a of Reflect.ownKeys(e))r[a]=ve(e[a],t);return r}function nr(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);if(r.length===0&&!t)throw Error("element object has no tag key");for(let o=0;o<r.length;o++){let a=r[o],n=e[a];if(o===0&&!ar.has(a)&&!t)throw Error(`key ${a} is not valid HTML tag name`);if(a==="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(a==="$"){if(!Array.isArray(n))throw Error(`"$" must be an array of patch objects, received ${n===null?"null":typeof n} on element { ${r.join(", ")} } \u2014 wrap patches in an array, e.g. $: [patch()]`);n.forEach(i=>nr(i,!0))}else{if(a.startsWith("_on")&&typeof n!="function")throw Error(`hook ${a} value "${n}" must be a function `);if(a.startsWith("on")&&typeof n!="function")throw Error(`event ${a} value "${n}" must be a function `);if(a==="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(a==="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(a==="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(a==="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function Hn(e){return e.replace(/&#(x?[0-9a-fA-F]+);/gi,(t,r)=>{let o=r[0]==="x"||r[0]==="X"?Number.parseInt(r.slice(1),16):Number.parseInt(r,10);return o>=0&&o<=1114111?String.fromCodePoint(o):""}).replace(/&colon;/gi,":").replace(/&Tab;/gi," ").replace(/&NewLine;/gi,`
3
- `)}function jn(e){let t=Hn(e).replace(/[\x00-\x20]+/g,"").toLowerCase();return t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:text/html")||t.startsWith("data:application/xhtml+xml")}function Fn(e){let t=e.toLowerCase(),r="",o=0;for(;o<e.length;){let a=t.indexOf("<",o);if(a===-1){r+=e.slice(o);break}r+=e.slice(o,a);let n=null,i=-1;for(let u=a+1;u<e.length;u++){let d=e[u];if(n)d===n&&(n=null);else if(d==='"'||d==="'")n=d;else if(d===">"){i=u;break}}if(i===-1){r+=e.slice(a);break}let l=e.slice(a,i+1);if(/^<script[\s/>]/i.test(l)){if(/\/\s*>$/.test(l)){o=i+1;continue}let u=t.indexOf("</script",i+1);if(u===-1){o=e.length;break}let d=e.indexOf(">",u);o=d===-1?e.length:d+1;continue}r+=l,o=i+1}return r}function dt(e){let t=Fn(e);return t=t.replace(/\s+on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/((?:href|src|action|formaction|data)\s*=\s*)("([^"]*)"|'([^']*)'|([^\s>]*))/gi,(r,o,a,n,i,l)=>{var u,d;let c=(d=(u=n!=null?n:i)!=null?u:l)!=null?d:"";if(!jn(c))return r;let h=n!==void 0?'"':i!==void 0?"'":"";return`${o}${h}#${h}`}),t}function ir(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var ar=new Set(Go);function lr(e){return Object.keys(e).find(t=>ar.has(t))}function Wo(e,t){if(Object.getPrototypeOf(e)!==Object.prototype)return ve(e);let r=new WeakMap,o={};for(let a of Reflect.ownKeys(e))o[a]=a===t?e[a]:ve(e[a],r);return o}function sr(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Wn(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,a="",n=0,i=e.length;n<i;n++){var l=e[n];if(l==="(")r+=1;else if(l===")")r-=1;else if(l==="[")o+=1;else if(l==="]")o-=1;else if(l===","&&!r&&!o){t.push(a.trim()),a="";continue}a+=l}return t.push(a.trim()),t}function Ut(e){let t=e.trim();return t.startsWith("@")?t.replace(/\s+/g,""):t.replace(/\s*([>+~,])\s*/g,"$1").replace(/\s+/g," ").replace(/\(\s*odd\s*\)/g,"(2n+1)").replace(/\(\s*even\s*\)/g,"(2n)").trim()}function Kn(e,t){for(let r=0;r<e.length;r++){let o=e[r],a=null;typeof o.selectorText=="string"?a=Ut(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(a=Ut(o.cssText.split("{")[0])),a&&!t.has(a)&&t.set(a,o)}return t}function cr(e,t){var r;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let a=t!=null?t:Xo().cspNonce;a&&(o.nonce=a),e.appendChild(o)}return o.dataset.domphyBase!=="true"&&((r=o.sheet)==null||r.insertRule("[hidden] { display: none !important; }",0),o.dataset.domphyBase="true"),o}var Gt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>j(t,Gt(r))),delete e.$,j(t,e),t}else return e},qn={translate:["yes","no"],autoCapitalize:["on","off"],contentEditable:["true","false"],spellCheck:["true","false"]},Un=class{constructor(e,t,r){this.declaredValue=void 0,this._notifier=new Qe,this._releases=[],this._removeHooked=!1,this._listenerReleases=[],this._listenerRemoveHooked=!1,this.parent=r,this.isBoolean=Jt.includes(e),this.enumeratedBoolean=qn[e],Uo.includes(e)?this.name=e:Object.hasOwn(Ft,e)?this.name=Ft[e]:this.name=sr(e),this.value=void 0,this.set(t)}normalize(e){return this.enumeratedBoolean&&typeof e=="boolean"?e?this.enumeratedBoolean[0]:this.enumeratedBoolean[1]:e}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,r;let o=this.value;if(this.declaredValue=e,this._releases.length){for(let a of this._releases)a();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let a=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e(a):this.normalize(e(a)),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};a.elementNode=this.parent,a.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,a.onSubscribe=n=>{this._releases.push(n),this.parent&&!this._removeHooked&&(this._removeHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let i of this._releases)i();this._releases=[],a=null}))},this.value=this.isBoolean?!!e(a):this.normalize(e(a))}else this.value=this.isBoolean?!!e:this.normalize(e);this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=r=>{this._listenerReleases.push(r),this.parent&&!this._listenerRemoveHooked&&(this._listenerRemoveHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let o of this._listenerReleases)o();this._listenerReleases=[]}))},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){for(let e of this._releases)e();this._releases=[];for(let e of this._listenerReleases)e();this._listenerReleases=[],this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";if(t==null)return"";let r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${ir(String(r))}"`}},mr=class{constructor(e){this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).filter(Boolean).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?this.items[e].set(t):this.items[e]=new Un(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.hasOwn(this.items,e):!1}remove(e){var t,r;if(!this.items)return;let o=(r=(t=this.items[e])==null?void 0:t.name)!=null?r:e;this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(o)}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this.items=null,this.parent=null}toggle(e,t){if(!Jt.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){var t,r;if(!e||typeof e!="string"&&typeof e!="function")return;let o=(u,d)=>{let c=(u||"").split(" ").filter(h=>h);return!c.includes(d)&&c.push(d),c.join(" ")},a=(r=(t=this.items)==null?void 0:t.class)==null?void 0:r.declaredValue,n=typeof a=="function",i=n?a:this.get("class"),l=typeof e=="function";if(!n&&!l){this.set("class",o(i,e));return}this.set("class",u=>o(n?i(u):i,l?e(u):e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(r=>r).filter(r=>r!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},Gn=class{constructor(e,t,r){this.value="",this._releases=[],this.name=e,this.cssName=e.startsWith("--")?e:sr(e),this.parentRule=r,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),Ce[this.name]&&Ce[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){if(this._releases.length){for(let e of this._releases)e();this._releases=[]}this.value="",this.parentRule=null}set(e){var t,r,o,a;if(this._releases.length){for(let n of this._releases)n();this._releases=[]}if(typeof e=="function"){let n=(()=>{var i;!this.parentRule||(i=this.parentRule.parentNode)!=null&&i._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=i=>{this._releases.push(i)},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(a=(o=this.parentRule)==null?void 0:o.root)==null?void 0:a.nodeId} style:${this.name}`,this.value=e(n)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),Ce[this.name]&&Ce[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=`${this.cssName}: ${this.value}`;return Ce[this.name]&&Ce[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},be=class Yt{constructor(t,r){this.domRule=null,this._domIndex=-1,this.styleBlock={},this.selectorText=t,this.styleList=new ur(this),this.parent=r}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof Yt;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Yt;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new Gn(t,r,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){let t=this.domRule,r=t==null?void 0:t.parentStyleSheet;if(t&&r){let o=r.cssRules,a=this._domIndex;if(a<0||a>=o.length||o[a]!==t){a=-1;for(let n=0;n<o.length;n++)if(o[n]===t){a=n;break}}a>=0&&r.deleteRule(a)}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length);this._domIndex=o;let a=t.cssRules[o];"cssRules"in a&&(this.mount(a),this.styleList.render(a))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let n=t.cssRules[a];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let n=t.cssRules[a];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},ur=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof be;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={},o=[];function a(n,i){return n.startsWith("&")?`${i}${n.slice(1)}`:`${i} ${n}`}for(let n in e){let i=e[n],l=Wn(n);for(let u of l){let d=a(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof i=="object"&&i!=null){let c=new be(u,this.parent);c.styleList.addCSS(i,t),o.push(c)}}else if(u.startsWith("@keyframes")){let c=new be(u,this.parent);c.styleList.addCSS(i,""),this.items.push(c)}else if(u.startsWith("@font-face")){let c=new be(u,this.parent);for(let h in i)c.insertStyle(h,i[h]);this.items.push(c)}else if(typeof i=="object"&&i!=null){let c=new be(d,this.parent);this.items.push(c);for(let[h,f]of Object.entries(i))if(typeof f=="object"&&f!=null){let g=a(h,d);this.addCSS(f,g)}else c.insertStyle(h,f)}else r[u]=i}}if(Object.keys(r).length){let n=new be(t,this.parent);for(let i in r)n.insertStyle(i,r[i]);this.items.push(n)}for(let n of o)this.items.push(n)}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}patchCSS(e,t=""){var r;if(!this.items||!this.parent)return;let o={};for(let l in e){let u=e[l];typeof u=="object"&&u!=null||(o[l]=u)}let a=this.items.find(l=>l.selectorText===t);if(!a){if(Object.keys(o).length===0)return;a=new be(t,this.parent),this.items.push(a)}let n=new Set(Object.keys(o));for(let l in o)a.insertStyle(l,o[l]);if(a.styleBlock)for(let l of Object.keys(a.styleBlock))n.has(l)||a.removeStyle(l);let i=(r=this.domStyle)==null?void 0:r.sheet;!a.domRule&&i&&a.render(i)}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(r=>r.selectorText===e);return t||(t=new be(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let r=e.get(Ut(t.selectorText));r&&t.mount(r)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,a)=>{let n=a-t,i=e[n];i&&(o.selectorText.startsWith("@")&&i instanceof CSSKeyframesRule||"keyText"in i?o.mount(i):"selectorText"in i?i.selectorText!==r(o.selectorText)?t+=1:o.mount(i):"cssRules"in i&&o.mount(i))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}};function Ko(e){console.warn(`[Domphy] <${e}> is a void element and cannot have children \u2014 SSR output omits the declared content while the client renders it, so hydration drifts. Remove the content or use a non-void tag.`)}var U=class ze{constructor(t,r=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this._imperative=!1,this.type="ElementNode",this.parent=null,this._childrenReleaseHooked=!1,this._behaviorInstances=new Map,this._pendingBehaviors=new Map,this._behaviorMountHooked=!1,this._behaviorTeardownHooked=!1,this.children=new dr(this),this.styles=new ur(this),this.attributes=new mr(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null,this._descriptor=null;var a,n;nr(t),this._descriptor=t,this.parent=r,this.tagName=lr(t);let i=Wo(t,this.tagName);i.style=i.style||{},i=Gt(i),this.key=(a=i._key)!=null?a:null,this._context=i._context||{},this._metadata=i._metadata||{};let l=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,u=Object.keys(i.style).length?JSON.stringify(i.style,(c,h)=>typeof h=="function"?l:h):"";this.nodeId=Ne(l+u),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),i._onSchedule&&i._onSchedule(this,i),this.merge(i);let d=i[this.tagName];oe&&d!=null&&d!==""&&ut.includes(this.tagName)&&Ko(this.tagName),d!=null&&(typeof d=="function"?this._setupFunctionChildren(d):this.children.update(Array.isArray(d)?d:[d])),this._hooks.Init&&this._hooks.Init(this)}_setupFunctionChildren(t){let r=()=>{if(!this._disposed)try{let a=t(r);this.children.update(Array.isArray(a)?a:[a])}catch(a){this._handleError(a)}};r.elementNode=this,r.debug=`class:${this.tagName}_${this.nodeId} children`;let o=[];r.onSubscribe=a=>{o.push(a),this._childrenRelease=()=>{for(let n of o)n();o.length=0,r=null},this._childrenReleaseHooked||(this._childrenReleaseHooked=!0,this.addHook("BeforeRemove",()=>{var n;(n=this._childrenRelease)==null||n.call(this),this._childrenRelease=void 0}))},r()}_createDOMNode(){let t=Yo.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let r in this._events)this._bindEvent(r);return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let r=o=>{var a,n;return(n=(a=this._events)==null?void 0:a[t])==null?void 0:n.call(a,o,this)};this.domElement.addEventListener(t,r),this.addHook("BeforeRemove",o=>{var a;(a=o.domElement)==null||a.removeEventListener(t,r),r=null})}_dispose(){var t,r,o,a;if(!this._disposed){if(this._disposed=!0,!this._beforeRemoveFired){this._beforeRemoveFired=!0;try{(r=(t=this._hooks).BeforeRemove)==null||r.call(t,this,()=>{})}catch(n){this._handleError(n)}}this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(n=>n.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(a=(o=this._hooks).Remove)==null||a.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this._descriptor=null,this.parent=null}}merge(t){j(this._context,t._context),j(this._metadata,t._metadata),this._processBehaviors(t._behaviors);let r=Object.keys(t);for(let o=0;o<r.length;o++){let a=r[o],n=t[a];["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName].includes(a)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(a)?this.addHook(a.substring(3),n):a.startsWith("on")?this.addEvent(a.substring(2).toLowerCase(),n):a==="_portal"?this._portal=n:a==="class"?(typeof n=="string"||typeof n=="function")&&this.attributes.addClass(n):this.attributes.set(a,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var r;if(t===this._descriptor)return;this._descriptor=t;let o=Wo(t,this.tagName);o.style=o.style||{},o=Gt(o);let a=o[this.tagName];if(oe&&a!=null&&a!==""&&ut.includes(this.tagName)&&Ko(this.tagName),typeof a=="function")(r=this._childrenRelease)==null||r.call(this),this._childrenRelease=void 0,this._setupFunctionChildren(a);else if(a!=null){let c=Array.isArray(a)?a:[a];this.children.update(c,!!this.domElement,!0)}o._context&&j(this._context,o._context),o._metadata&&j(this._metadata,o._metadata),this._processBehaviors(o._behaviors),this.styles.patchCSS(o.style||{},`.${this.tagName}_${this.nodeId}`);let n=`${this.tagName}_${this.nodeId}`,i=["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName],l=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],u=new Set(["class"]),d=null;this._events={};for(let c of Object.keys(o)){if(i.includes(c)||l.includes(c)||c==="_portal")continue;let h=o[c];c.startsWith("on")&&typeof h=="function"?this.addEvent(c.substring(2).toLowerCase(),h):c==="class"&&(typeof h=="string"||typeof h=="function")?d=h:(this.attributes.set(c,h),u.add(c))}if(typeof d=="function"){let c=d;this.attributes.set("class",h=>`${n} ${c(h)}`)}else this.attributes.set("class",d?`${n} ${d}`:n);if(this.attributes.items)for(let c of Object.keys(this.attributes.items))u.has(c)||this.attributes.remove(c);if(this._events)for(let c in this._events)this._bindEvent(c)}_handleError(t){let r=this;for(;r;){if(r._hooks.Error){let o=r;r._hooks.Error(o,t,()=>{o.children.update([])});return}r=r.parent}console.error("[Domphy] Unhandled error in reactive child:",t)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(a,n)=>{o(a,n),r(a,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];if(typeof o=="function"){let a=((...n)=>{o(...n),r(...n)});try{Object.defineProperty(a,"length",{value:Math.max(o.length,r.length),configurable:!0})}catch(n){}this._hooks[t]=a}else this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof ze&&t.parent;)t=t.parent;return t}_processBehaviors(t){var r;if(t)for(let o of Object.keys(t)){let a=t[o],n=this._behaviorInstances.get(o);n?(r=n.update)==null||r.call(n,a.props):this.domElement?this._attachBehaviorNow(o,a):(this._pendingBehaviors.set(o,a),this._ensureBehaviorMountHook())}}_attachBehaviorNow(t,r){try{let o=r.attach(this,r.props)||{};this._behaviorInstances.set(t,o),this._ensureBehaviorTeardownHook()}catch(o){this._handleError(o)}}_ensureBehaviorMountHook(){this._behaviorMountHooked||(this._behaviorMountHooked=!0,this.addHook("Mount",()=>{if(this._pendingBehaviors.size===0)return;let t=this._pendingBehaviors;this._pendingBehaviors=new Map,t.forEach((r,o)=>this._attachBehaviorNow(o,r))}))}_ensureBehaviorTeardownHook(){this._behaviorTeardownHooked||(this._behaviorTeardownHooked=!0,this.addHook("BeforeRemove",()=>{this._behaviorInstances.forEach(t=>{var r;return(r=t.destroy)==null?void 0:r.call(t)}),this._behaviorInstances.clear()}))}getBehavior(t){let r=this;for(;r;){let o=r._behaviorInstances.get(t);if(o)return o;r=r.parent}}getContext(t){let r=this;for(;r&&(!r._context||!Object.hasOwn(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof ze?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(ut.includes(this.tagName))return`<${this.tagName}${t}>`;let r=this.children.generateHTML();return`<${this.tagName}${t}>${r}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(oe&&this.parent===null&&t.tagName&&t.tagName.toLowerCase()!==this.tagName&&console.warn(`[Domphy] Hydration mismatch at mount root: expected <${this.tagName}> but found <${t.tagName.toLowerCase()}>. The server-rendered DOM does not match the client tree \u2014 check that mount() receives the element generated for THIS component.`),oe&&!r&&this.parent===null&&t.childNodes.length>0&&console.warn("[Domphy] mount() was called without a style element on already-rendered DOM. Reactive style updates after hydration will be dropped \u2014 pass the server-rendered <style> element as the second argument to mount()."),this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children){let o=0;this.children.items.forEach((a,n)=>{let i=t.childNodes[o];if(a instanceof ze){if(o++,!i)return;oe&&this._devCheckHydrationMatch(a,i,n),a.mount(i)}else if(a.html){let l=a._domSpan();if(i){a.domText=i,a._domExtras=[];for(let u=1;u<l;u++){let d=t.childNodes[o+u];d&&a._domExtras.push(d)}}o+=l}else i?(oe&&i.nodeType!==3&&console.warn(`[Domphy] Hydration mismatch at <${this.tagName}> child ${n}: expected a text node ("${a.text.slice(0,40)}") but found ${i.nodeType===1?`<${i.tagName.toLowerCase()}>`:`node type ${i.nodeType}`}. The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.`),a.domText=i,o++):this.tagName==="textarea"?a.render(t):o++})}if(r){let o=r.sheet;o&&this._hydrateStyles(Kn(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_devCheckHydrationMatch(t,r,o){var a,n,i,l;let u=`<${this.tagName}> child ${o}`,d="The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.";if(r.nodeType!==1){console.warn(`[Domphy] Hydration mismatch at ${u}: expected <${t.tagName}> but found ${r.nodeType===3?`a text node ("${((a=r.textContent)!=null?a:"").slice(0,40)}")`:`node type ${r.nodeType}`}. ${d}`);return}let c=r,h=c.tagName.toLowerCase();if(h!==t.tagName){console.warn(`[Domphy] Hydration mismatch at ${u}: expected <${t.tagName}> but found <${h}>. ${d}`);return}for(let f of["id","class"]){let g=(i=(n=t.attributes)==null?void 0:n.items)==null?void 0:i[f];if(!g||g.value==null)continue;let b=String(g.value),y=(l=c.getAttribute(f))!=null?l:"";b!==y&&console.warn(`[Domphy] Hydration mismatch at ${u} <${t.tagName}>: expected ${f}="${b}" but found ${f}="${y}". ${d}`)}}_hydrateStyles(t){var r;if((r=this.styles)==null||r.hydrate(t),this.children)for(let o of this.children.items)o instanceof ze&&o._hydrateStyles(t)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,a=t.getRootNode(),n=a instanceof ShadowRoot?a:document.head;return o||(o=cr(n)),this.styles.render(o),this.children.items.forEach(i=>{if(i instanceof ze&&i._portal){let l=i._portal(this.getRoot());l&&i.render(l)}else i.render(r)}),r}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var r;(r=this.domElement)==null||r.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let r=!1,o=()=>{r||(r=!0,t())},a=this._hooks.BeforeRemove;this._beforeRemoveFired=!0;try{a(this,o)}catch(n){this._handleError(n),o()}a.length<2&&!r?o():oe&&!r&&setTimeout(()=>{r||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else t()}}},hr=class{constructor(e){this.__domphyRawHTML=!0,this.html=e}};function Te(e){return new hr(e)}function Je(e){return typeof e=="object"&&e!==null&&e.__domphyRawHTML===!0}var qo="\u200B",Ht=class{constructor(e,t){this.type="TextNode",this._imperative=!1,this._domExtras=[],this.parent=t,this.html=Je(e);let r=this.html?e.html:e;this.text=r===""?this.emptyText():String(r)}emptyText(){var e;return((e=this.parent)==null?void 0:e.tagName)==="textarea"?"":qo}_createDOMNode(){let e;if(this._domExtras=[],this.html){let t=document.createElement("template");t.innerHTML=dt(this.text.trim());let r=Array.from(t.content.childNodes);r.length===0?e=document.createTextNode(""):(e=r[0],this._domExtras=r.slice(1))}else e=document.createTextNode(this.text);return this.domText=e,e}_allDomNodes(){let e=[];this.domText&&e.push(this.domText);for(let t of this._domExtras)e.push(t);return e}_domSpan(){if(!this.html)return 1;let e=document.createElement("template");return e.innerHTML=dt(this.text.trim()),Math.max(e.content.childNodes.length,1)}setText(e){let t=Je(e),r=t?e.html:e,o=r===""?this.emptyText():String(r);if(o===this.text&&t===this.html&&this.domText)return;let a=this.html;if(this.text=o,this.html=t,!this.domText)return;if(!a&&!t&&this.domText.nodeType===3){this.domText.nodeValue=o;return}let n=this.domText,i=this._domExtras,l=this._createDOMNode(),u=n.parentNode;if(u){u.insertBefore(l,n);for(let d of this._domExtras)u.insertBefore(d,n);u.removeChild(n);for(let d of i)d.remove()}}_dispose(){this.domText=void 0,this._domExtras=[],this.text=""}generateHTML(){return this.text===qo?"&#8203;":this.html?dt(this.text.trim()):ir(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t);for(let r of this._domExtras)e.appendChild(r)}},Zt=new Set;function Yn(){Zt.clear()}var dr=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return Je(e)?new Ht(e,this.owner):typeof e=="object"&&e!==null?new U(e,this.owner,this._nextKey++):new Ht(e==null?"":String(e),this.owner)}_domReferenceAfter(e){let t=this.owner.domElement;if(!t)return null;for(let r=e;r<this.items.length;r++){let o=this.items[r],a=o instanceof U?o.domElement:o.domText;if(a&&a.parentNode===t)return a}return null}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof U?e.domElement?[e.domElement]:[]:e._allDomNodes();if(o.length===0)return;let a=this._domReferenceAfter(t+1);for(let n of o)n!==a&&r.insertBefore(n,a)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof U?e.domElement?[e.domElement]:[]:e._allDomNodes(),a=t instanceof U?t.domElement?[t.domElement]:[]:t._allDomNodes();if(o.length===0||a.length===0)return;let n=document.createComment("");r.insertBefore(n,o[0]);let i=a[a.length-1].nextSibling;for(let l of o)r.insertBefore(l,i);for(let l of a)r.insertBefore(l,n);n.remove()}update(e,t=!0,r=!1){var o,a,n,i;if(this.items.some(y=>y._imperative)){let y=this.items.filter(w=>!w._imperative),p=this.items.filter(w=>w._imperative);this.items=y.concat(p)}let l=this.items.slice(),u=new Map;for(let y of l)y instanceof U&&y.key!==null&&y.key!==void 0&&!y._imperative&&!y._beforeRemoveFired&&u.set(y.key,y);!r&&this.owner.domElement&&((a=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||a.call(o,this.owner,e));let d=new Set(l),c=new Set,h=!1,f=0,g=oe&&l.length>0?e.length!==l.length:!1;for(let y=0;y<e.length;y++){let p=e[y],w=typeof p=="object"&&p!==null&&!Je(p),E=w?p._key:void 0,k=w?lr(p):void 0;if(oe&&w&&E===void 0&&f++,E!==void 0){let _=u.get(E);if(_ instanceof U&&_.tagName===k){u.delete(E),h=!0;let M=this.items.indexOf(_);M!==y&&M>=0&&this.move(M,y,!1,!0),_.parent=this.owner,_.patch(p),c.add(_);continue}}else if(w){let _=this.items[y];if(_ instanceof U&&_.key==null&&_.tagName===k&&d.has(_)&&!c.has(_)&&!_._imperative&&!_._beforeRemoveFired){_.parent=this.owner,_.patch(p),c.add(_);continue}}else{let _=this.items[y];if(_ instanceof Ht&&d.has(_)&&!c.has(_)&&!_._imperative){_.setText(p==null?"":p),c.add(_);continue}}c.add(this.insert(p,y,t,!0,!0))}let b=this.items.slice(e.length);for(let y of b)y._imperative||this.remove(y,t,!0);if(u.forEach(y=>this.remove(y,t,!0)),h&&t&&this.owner.domElement){let y=new Map;for(let p=0;p<l.length;p++)y.set(l[p],p);this._placeKeyedDom(y)}if(oe&&l.length>0&&f>0&&g){let y=this.owner.nodeId;if(!Zt.has(y)){Zt.add(y);let p=`[domphy] unkeyed list length changed \u2014 DOM nodes reused by position may not match their data slot (focus/scroll/input-value drift). Add _key to each item. (parent <${this.owner.tagName}>, ${f} unkeyed item${f===1?"":"s"})`;console.warn(p)}}r||(i=(n=this.owner._hooks)==null?void 0:n.Update)==null||i.call(n,this.owner)}_placeKeyedDom(e){var t;let r=this.owner.domElement;if(!r)return;let o=[],a=this.items;for(let d=0;d<a.length;d++){let c=a[d];if(c._imperative||c instanceof U&&c._beforeRemoveFired){o.push(-2);continue}if(c instanceof U&&c._portal){o.push(-2);continue}o.push((t=e.get(c))!=null?t:-1)}let n=new Set,i=[],l=[];for(let d=0;d<o.length;d++)o[d]>=0&&(i.push(d),l.push(o[d]));if(l.length>0){let d=[],c=[],h=new Array(l.length).fill(-1);for(let g=0;g<l.length;g++){let b=0,y=d.length;for(;b<y;){let p=b+y>>1;d[p]<l[g]?b=p+1:y=p}d[b]=l[g],c[b]=g,b>0&&(h[g]=c[b-1])}let f=c[d.length-1];for(;f!==void 0&&f>=0;)n.add(i[f]),f=h[f]}let u=null;for(let d=o.length-1;d>=0;d--){if(o[d]===-2)continue;let c=a[d],h=c instanceof U?c.domElement?[c.domElement]:[]:c._allDomNodes();if(h.length!==0){if(!n.has(d)){let f=u;for(let g=h.length-1;g>=0;g--){let b=h[g];b.nextSibling!==f&&r.insertBefore(b,f),f=b}}u=h[0]}}}insert(e,t,r=!0,o=!1,a=!1){let n=this.items.length,i=typeof t!="number"||Number.isNaN(t)||t<0||t>n?n:t,l=this._createNode(e);if(l._imperative=!a,this.items.splice(i,0,l),l instanceof U){l._hooks.Insert&&l._hooks.Insert(l);let u=this.owner.domElement;if(r&&u)if(l._portal){let d=l._portal(this.owner.getRoot());d&&l.render(d)}else{let d=l._createDOMNode(),c=this._domReferenceAfter(i+1);u.insertBefore(d,c);let h=u.getRootNode(),f=h instanceof ShadowRoot?h:document.head,g=cr(f);l.styles.render(g),l._hooks.Mount&&l._hooks.Mount(l),l.children.items.forEach(b=>{if(b instanceof U&&b._portal){let y=b._portal(b.getRoot());y&&b.render(y)}else b.render(d)})}}else{let u=this.owner.domElement;if(r&&u){let d=l._createDOMNode(),c=this._domReferenceAfter(i+1);u.insertBefore(d,c);for(let h of l._domExtras)u.insertBefore(h,c)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),l}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof U){if(e._beforeRemoveFired)return;let a=()=>{let n=e.domElement,i=this.items.indexOf(e);i>=0&&this.items.splice(i,1),t&&n&&n.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,i=()=>{n||(n=!0,a())},l=e._hooks.BeforeRemove;e._beforeRemoveFired=!0;try{l(e,i)}catch(u){e._handleError(u),i()}l.length<2&&!n?i():oe&&!n&&setTimeout(()=>{n||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter (e.g. an exit animation) but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else a()}else{if(this.items.splice(o,1),t)for(let a of e._allDomNodes())a.remove();e._dispose()}!r&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let r=this.items.slice();for(let o of r)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let a=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=a,r&&this._swapDomElement(a,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let a=this.items[e];this.items.splice(e,1),this.items.splice(t,0,a),r&&this._moveDomElement(a,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},Ee=new Set,Xt=!1;function fr(e){Ee.add(e),!Xt&&(Xt=!0,Qt(pr))}function pr(){for(Xt=!1;Ee.size>0;){let e=[...Ee];Ee.clear();for(let t of e)try{t()}catch(r){console.error("[Domphy] Uncaught error in effect:",r)}}}function Zn(){let e=0;for(;Qo()||Ee.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}er(),pr()}}var Xe=[];function Xn(){return Xe.length?Xe[Xe.length-1]:null}function to(e){let t=Xn();t&&t._add(e)}var Jn=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){if(this._stopped)return oe&&console.warn("[Domphy] effectScope.run() called after stop() \u2014 resources created inside are registered to the enclosing scope instead of this stopped one."),e();Xe.push(this);try{return e()}finally{Xe.pop()}}stop(){if(this._stopped)return;this._stopped=!0;let e,t=!1;for(let r of this._disposers)try{r()}catch(o){t?console.error("[Domphy] Additional error during effectScope.stop():",o):(e=o,t=!0)}if(this._disposers.clear(),t)throw e}};function Qn(){let e=new Jn;return to(()=>e.stop()),e}function gr(e){let t=!1,r=!1,o=()=>{t||n()},a=new tr(()=>{t||fr(o)}),n=()=>{if(!(t||r)){r=!0,a.reset();try{or(a,e)}finally{r=!1}}},i=()=>{t||(t=!0,a.reset(),Ee.delete(o))};to(i);try{n()}catch(l){throw i(),l}return i}function ei(e){let t="computed",r=new Qe,o,a=!0,n=!1,i=0,l=()=>{a&&r.listenerCount(t)>0&&c()},u=new tr(()=>{a||(a=!0,fr(l))});r._onEmpty=()=>{u.reset(),a=!0};let d=()=>{u.reset(),o=or(u,e),i++,r._version=i,a=!1,n=!0},c=()=>{let f=o,g=n;d(),!(g&&o===f)&&r.notify(t,o)},h=f=>{let g=null;return f?r.addListener(t,f):(g=eo(),g&&r.addListener(t,g.handler)),a&&(n&&r.listenerCount(t)>0?c():d()),g==null||g._consumedVersions.set(r,i),o};return to(()=>{u.reset(),Ee.delete(l),r._dispose()}),{_isState:!0,_notifier:r,get:h}}function ti(e){return Jo(e)}function oi(e){return rr(e)}function ri(e,t,r){let o,a=!0;return gr(()=>{let n=typeof e=="function"?e():e.get();(!a||r!=null&&r.immediate)&&t(n,o),o=n,a=!1})}function ni(e){return e?Promise.resolve().then(e):Promise.resolve()}var ii=class{constructor(e){this._notifier=new Qe,this.initialRecord=jt({},e),this._record=jt({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let r=eo();r&&this._notifier.addListener(e,r.handler)}return this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e,t)}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var wt={};mt(wt,{COLOR_ROLES:()=>fi,ElementTones:()=>et,Palette:()=>_i,Ramp:()=>Er,Swatch:()=>ao,TONE_STEPS:()=>G,ToneAliases:()=>vt,applySystemTheme:()=>di,calcDeltaE2000:()=>fo,calcScore:()=>po,calcStatistics:()=>wi,contrastRatio:()=>ki,createMonotone:()=>bt,cssRgbToRgb:()=>xi,fromLightnessEAL:()=>vi,generateRamp:()=>Tr,generateTheme:()=>Ri,getTheme:()=>se,hexToRgb:()=>ae,isValidHex:()=>xr,labToLch:()=>Cr,labToRgb:()=>kr,lchToLab:()=>Si,mix:()=>Ci,normalizeHex:()=>ho,oklabToRgb:()=>xt,resolveThemeColor:()=>Ai,rgbToHex:()=>Se,rgbToLab:()=>je,rgbToOklab:()=>ot,rootMeanSquare:()=>Be,scale:()=>Ei,setTheme:()=>ci,themeApply:()=>ui,themeCSS:()=>no,themeColor:()=>s,themeColorToken:()=>go,themeDensity:()=>S,themeFluidSpacing:()=>hi,themeName:()=>St,themeSize:()=>x,themeSpacing:()=>m,themeTokens:()=>uo,themeVars:()=>yt,toLightnessEAL:()=>wr});var yr=Math.pow,ai={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#ffe5e5","#ffcaca","#ffaeae","#ff9191","#ff7474","#ff5757","#f93a3a","#e82222","#d40f0f","#b80000","#9c0000","#800000","#640000","#480000","#2c0000","#140000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,attention:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},tt=ai,co=e=>JSON.parse(JSON.stringify(e)),vr=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),He={light:co(tt),dark:mi(tt)},G=tt.colors.neutral.length,Ve=8,pt=5,gt=null,ro=new Map;function mo(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function oo(e,t){if(/}/.test(e)||/<\/style/i.test(e))throw new Error(`${t} contains unsafe CSS characters ("}" or "</style>") \u2014 theme values are interpolated into a <style> block`)}function li(e){for(let t in e)if(!Object.keys(tt).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes!==void 0){if(!(Array.isArray(e.fontSizes)&&e.fontSizes.length===Ve&&e.fontSizes.every(t=>typeof t=="string"&&t.length>0)))throw new Error(`fontSize must be array of ${Ve} non-empty string (the size scale has ${Ve} steps: 0\u2013${Ve-1})`);e.fontSizes.forEach((t,r)=>oo(t,`fontSizes[${r}]`))}if(e.densities){if(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number"))throw new Error("densities must be array of number");if(e.densities.length!==pt)throw new Error(`densities must have exactly ${pt} entries (the density scale has ${pt} steps: 0\u2013${pt-1}), got ${e.densities.length}`);if(e.densities.some(t=>!Number.isFinite(t)||t<=0))throw new Error("densities entries must be positive finite numbers")}if(e.darkBias!==void 0){let t=e.darkBias;if(typeof t!="number"||!Number.isInteger(t)||t<0||t>G-1)throw new Error(`darkBias must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object");for(let r in t){let o=t[r];typeof o=="string"&&oo(o,`custom.${r}`)}}if("colors"in e){let t=e.colors;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(r=>Array.isArray(r)&&r.every(o=>typeof o=="string"))))throw new Error("colors must be an object of string[]");for(let r in t){let o=t[r];if(o.length!==G)throw new Error(`colors.${r} must have exactly ${G} tone steps (got ${o.length}) \u2014 the tone model is fixed at shift-0\u2026shift-${G-1}`);if(o.some(a=>a.length===0))throw new Error(`colors.${r} must contain only non-empty strings`);o.forEach((a,n)=>oo(a,`colors.${r}[${n}]`))}}if("baseTones"in e){let t=e.baseTones;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(r=>typeof r=="number")))throw new Error("baseTones must be an object of number");for(let r in t){let o=t[r];if(!Number.isInteger(o)||o<0||o>G-1)throw new Error(`baseTones.${r} must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}}if("direction"in e&&e.direction!=="lighten"&&e.direction!=="darken")throw new Error('direction must be "lighten" or "darken"')}function Sr(e,t){var r;for(let o of Object.keys(t))o==="__proto__"||o==="constructor"||o==="prototype"||(t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),Sr(e[o],t[o])):e[o]=t[o])}function si(e,t){let r={},o=mo(t);for(let n in t){let i=t[n];if(n==="colors")for(let l in t.colors)[...Array(o).keys()].forEach(u=>r[`--${l}-${u}`]=t.colors[l][u]);else if(n==="fontSizes")[...Array(Ve).keys()].forEach(l=>r[`--fontSize-${l}`]=t.fontSizes[l]);else if(n==="custom"&&i&&typeof i=="object")for(let l in i)r[`--custom-${vr(l)}`]=i[l]}let a="";for(let n in r)a+=` ${n}: ${r[n]};
4
- `;return`[data-theme="${e}"] {
5
- ${a}}`}function se(e){if(!He[e])throw Error(`Theme "${e}" not found`);return He[e]}function ci(e,t){li(t),He[e]||(He[e]=co(tt)),Sr(He[e],t),gt=null,ro.clear()}function mi(e){let t=co(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function uo(e){let t=ro.get(e);if(t)return t;let r=se(e),o=mo(r),a={};for(let n in r){let i=r[n];if(n==="colors")for(let l in r.colors){let u={};[...Array(o).keys()].forEach(d=>u[d]=r.colors[l][d]),a[l]=u}else if(n==="fontSizes")a.fontSizes=r.fontSizes;else if(n==="densities")a.densities=r.densities;else if(n==="custom"&&(a.custom={},i&&typeof i=="object"))for(let l in i)a.custom[l]=i[l]}return ro.set(e,a),a}function yt(){if(gt)return gt;let e=se("light"),t=mo(e),r={};for(let o in e){let a=e[o];if(o==="colors")for(let n in e.colors){let i={};[...Array(t).keys()].forEach(l=>i[l]=`var(--${n}-${l})`),r[n]=i}else if(o==="fontSizes")r.fontSizes=[...Array(Ve).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(r.custom={},a&&typeof a=="object"))for(let n in a)r.custom[n]=`var(--custom-${vr(n)})`}return gt=r,r}function no(){return Object.entries(He).map(([e,t])=>si(e,t)).join(`
6
- `)}function ui(e){var t;if(typeof document!="undefined")if(e){e.textContent=no();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=no(),document.head.appendChild(e)}function m(e){return`calc(${e/4}em)`}function hi(e,t,r=320,o=1280){let a=e/4,n=t/4,i=(n-a)/(o-r)*100,l=a-i*r/100,u=parseFloat(l.toFixed(4))===0?`${i.toFixed(4)}vw`:`${l.toFixed(4)}em + ${i.toFixed(4)}vw`;return`clamp(${a}em, ${u}, ${n}em)`}function di(e,t={}){if(typeof document=="undefined")throw new Error('applySystemTheme() requires a browser DOM \u2014 "document" is not defined. For SSR, call it only on the client (e.g. inside an _onMount lifecycle hook, or behind a typeof window !== "undefined" guard).');let r=e!=null?e:document.documentElement,{persist:o=!0,storageKey:a="dp-theme"}=t,n=()=>{if(o){let u=localStorage.getItem(a);if(u==="light"||u==="dark")return u}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};r.setAttribute("data-theme",n());let i=window.matchMedia("(prefers-color-scheme: dark)"),l=u=>{(!o||!localStorage.getItem(a))&&r.setAttribute("data-theme",u.matches?"dark":"light")};return i.addEventListener("change",l),()=>i.removeEventListener("change",l)}function St(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var fi=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],io=["inherit"];[...Array(5).keys()].forEach(e=>{io.push(`decrease-${e}`),io.push(`increase-${e}`)});function pi(e,t="inherit"){if(!io.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t==="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function gi(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=pi(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function S(e){let t=gi(e);return se(e?St(e):"light").densities[t]}var yi=e=>{let t=r=>{let o=Math.max(0,Math.min(1,r)),a=o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(a*255)))};return e.map(t)},bi=e=>{let t=r=>r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;return e.map(t)},Se=e=>{let[t,r,o]=yi(e);return t=t.toString(16).padStart(2,"0"),r=r.toString(16).padStart(2,"0"),o=o.toString(16).padStart(2,"0"),`#${t}${r}${o}`},xr=e=>typeof e=="string"&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e),ho=e=>{if(!xr(e))throw new Error(`Invalid hex color "${e}": expected "#rgb", "#rgba", "#rrggbb", or "#rrggbbaa" (hex digits 0-9, a-f, case-insensitive).`);let t=e.slice(1).toLowerCase();return t.length<=4&&(t=t.split("").map(r=>r+r).join("")),`#${t}`},ae=e=>{let t=ho(e),r=parseInt(t.slice(1,3),16)/255,o=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255;return bi([r,o,a])},ot=e=>{let t=.4122214708*e[0]+.5363325363*e[1]+.0514459929*e[2],r=.2119034982*e[0]+.6806995451*e[1]+.1073969566*e[2],o=.0883024619*e[0]+.2817188376*e[1]+.6299787005*e[2],a=Math.cbrt(t),n=Math.cbrt(r),i=Math.cbrt(o);return[.2104542553*a+.793617785*n-.0040720468*i,1.9779984951*a-2.428592205*n+.4505937099*i,.0259040371*a+.7827717662*n-.808675766*i]},xt=e=>{let[t,r,o]=e,a=t+.3963377774*r+.2158037573*o,n=t-.1055613458*r-.0638541728*o,i=t-.0894841775*r-1.291485548*o,l=a*a*a,u=n*n*n,d=i*i*i;return[4.0767416621*l-3.3077115913*u+.2309699292*d,-1.2684380046*l+2.6097574011*u-.3413193965*d,-.0041960863*l-.7034186147*u+1.707614701*d]},wr=e=>{let[t,r,o]=e,a=Math.sqrt(r*r+o*o),n=(Math.atan2(o,r)*180/Math.PI+360)%360,i=.1644,l=.0603,u=.1307,d=.006,c=i*Math.abs(Math.sin((n-90)/2*(Math.PI/180)))+l,h=0;return(n<=90||n>=270)&&(h=u*Math.abs(Math.cos(n*(Math.PI/180)))+d),t+(c+h)*a},vi=(e,t)=>{let[,r,o]=t,a=Math.sqrt(r*r+o*o),n=(Math.atan2(o,r)*180/Math.PI+360)%360,i=.1644,l=.0603,u=.1307,d=.006,c=i*Math.abs(Math.sin((n-90)/2*(Math.PI/180)))+l,h=0;return(n<=90||n>=270)&&(h=u*Math.abs(Math.cos(n*(Math.PI/180)))+d),Math.max(0,e-(c+h)*a)},Si=e=>{let[t,r,o]=e,a=o*Math.PI/180;return[t,r*Math.cos(a),r*Math.sin(a)]},je=e=>{let[t,r,o]=e,a=.4124564*t+.3575761*r+.1804375*o,n=.2126729*t+.7151522*r+.072175*o,i=.0193339*t+.119192*r+.9503041*o,l=.95047,u=1,d=1.08883,c=b=>b>.008856?Math.cbrt(b):7.787*b+16/116,h=c(a/l),f=c(n/u),g=c(i/d);return[116*f-16,500*(h-f),200*(f-g)]},kr=e=>{let[t,r,o]=e,a=(t+16)/116,n=r/500+a,i=a-o/200,l=b=>yr(b,3)>.008856?yr(b,3):(b-16/116)/7.787,u=.95047,d=1,c=1.08883,h=l(n)*u,f=l(a)*d,g=l(i)*c;return[3.2404542*h-1.5371385*f-.4985314*g,-.969266*h+1.8760108*f+.041556*g,.0556434*h-.2040259*f+1.0572252*g]},Cr=e=>{let[t,r,o]=e,a=Math.sqrt(r*r+o*o);if(a<1e-4)return[t,0,0];let n=(Math.atan2(o,r)*180/Math.PI+360)%360;return n>=359.9999&&(n=0),[t,a,n]},fo=(e,t)=>{let[r,o,a]=e,[n,i,l]=t,u=(r+n)/2,d=Math.sqrt(o*o+a*a),c=Math.sqrt(i*i+l*l),h=(d+c)/2,f=.5*(1-Math.sqrt(Math.pow(h,7)/(Math.pow(h,7)+Math.pow(25,7)))),g=o*(1+f),b=i*(1+f),y=Math.sqrt(g*g+a*a),p=Math.sqrt(b*b+l*l),w=(y+p)/2,E=Math.atan2(a,g)*180/Math.PI+(Math.atan2(a,g)<0?360:0),k=Math.atan2(l,b)*180/Math.PI+(Math.atan2(l,b)<0?360:0),_=k-E;Math.abs(_)>180&&(_+=k<=E?360:-360);let M=Math.abs(E-k)>180?(E+k+360)/2:(E+k)/2,P=1-.17*Math.cos((M-30)*Math.PI/180)+.24*Math.cos(2*M*Math.PI/180)+.32*Math.cos((3*M+6)*Math.PI/180)-.2*Math.cos((4*M-63)*Math.PI/180),L=n-r,B=p-y,z=2*Math.sqrt(y*p)*Math.sin(_/2*Math.PI/180),K=1+.015*Math.pow(u-50,2)/Math.sqrt(20+Math.pow(u-50,2)),Z=1+.045*w,H=1+.015*w*P,te=30*Math.exp(-Math.pow((M-275)/25,2)),X=-(2*Math.sqrt(Math.pow(w,7)/(Math.pow(w,7)+Math.pow(25,7))))*Math.sin(2*te*Math.PI/180);return Math.sqrt(Math.pow(L/K,2)+Math.pow(B/Z,2)+Math.pow(z/H,2)+X*(B/Z)*(z/H))},xi=e=>{let t=()=>new Error(`Invalid CSS rgb() "${e}": expected "rgb(r, g, b)" with channels 0-255 or 0%-100% (comma or space separated, optional alpha after "," or "/").`),r=/^\s*rgba?\(\s*(.+?)\s*\)\s*$/i.exec(e);if(!r)throw t();let o=r[1].split("/")[0],a=o.includes(",")?o.split(",").map(l=>l.trim()).slice(0,3):o.trim().split(/\s+/);if(a.length!==3)throw t();let n=a.map(l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l));if(n.some(l=>!Number.isFinite(l)))throw t();let i=l=>{let u=l/255;return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)};return n.map(i)},bt=e=>{if(e.length<1)return d=>0;let t=[...e].sort((d,c)=>d[0]-c[0]),r=[];for(let d=0;d<t.length;d++)(d===0||t[d][0]!==t[d-1][0])&&r.push(t[d]);let o=r.length;if(o===1)return d=>r[0][1];let a=r.map(d=>d[0]),n=r.map(d=>d[1]),i=[],l=[];for(let d=0;d<o-1;d++)i[d]=a[d+1]-a[d],l[d]=(n[d+1]-n[d])/i[d];let u=new Array(o);u[0]=l[0],u[o-1]=l[o-2];for(let d=1;d<o-1;d++){let c=l[d-1],h=l[d];if(c*h<=0)u[d]=0;else{let f=(1+i[d]/(i[d-1]+i[d]))/3;u[d]=c*h/((1-f)*c+f*h)}}return d=>{if(d<=a[0])return n[0];if(d>=a[o-1])return n[o-1];let c=0,h=o-2,f=0;for(;c<=h;){let k=Math.floor((c+h)/2);if(d>=a[k]&&d<=a[k+1]){f=k;break}d<a[k]?h=k-1:c=k+1}let g=i[f],b=(d-a[f])/g,y=b*b,p=y*b,w=u[f]*g,E=u[f+1]*g;return(2*p-3*y+1)*n[f]+(p-2*y+b)*w+(-2*p+3*y)*n[f+1]+(p-y)*E}};function Be(e){let t=e.length;if(t===0)return 0;let r=0;for(let o=0;o<t;o++)r+=e[o]*e[o];return Math.sqrt(r/t)}var wi=e=>{let t=e.length;if(t===0)return{min:0,max:0,avg:0};let r=e[0],o=e[0],a=0;for(let n=0;n<t;n++){let i=e[n];i<r&&(r=i),i>o&&(o=i),a+=i}return{min:r,max:o,avg:a/t}},po=e=>{let t=e.length;if(t===0)return 0;let r=1e-6,o=e.reduce((i,l)=>i*(l+r),1),a=Math.pow(o,1/t),n=Math.max(0,Math.min(1,a));return parseFloat((n*100).toFixed(2))},ki=(e,t)=>{let[r,o,a]=ae(e),[n,i,l]=ae(t),u=.2126*r+.7152*o+.0722*a,d=.2126*n+.7152*i+.0722*l,c=Math.max(u,d),h=Math.min(u,d);return(c+.05)/(h+.05)},Ci=(e,t,r=.5,o="oklab")=>{let a=Math.max(0,Math.min(1,r)),n=ae(e),i=ae(t);if(o==="rgb")return Se(n.map((d,c)=>d+a*(i[c]-d)));if(o==="lab"){let d=je(n),c=je(i);return Se(kr(d.map((h,f)=>h+a*(c[f]-h))))}let l=ot(n),u=ot(i);return Se(xt(l.map((d,c)=>d+a*(u[c]-d))))},Ei=(e,t)=>{if(e.length<2)throw new Error("scale() requires at least 2 colors");if(t<1)return[];if(t===1)return[Se(ae(e[0]))];let r=e.map(n=>ot(ae(n))),o=r.length-1,a=[];for(let n=0;n<t;n++){let i=n/(t-1)*o,l=Math.min(Math.floor(i),o-1),u=i-l,d=r[l],c=r[l+1];a.push(Se(xt(d.map((h,f)=>h+u*(c[f]-h)))))}return a},ao=class{constructor(e){this.hex=e}get rgb(){return ae(this.hex)}get lab(){return je(this.rgb)}get lch(){return Cr(this.lab)}get lightness(){return wr(this.lab)}get chroma(){return this.lch[1]}get hue(){return this.lch[2]}get luminance(){let[e,t,r]=this.rgb;return .2126*e+.7152*t+.0722*r}},Er=class{constructor(e=[],t="brand"){this.swatches=e.map(r=>new ao(r)),this.name=t}get colors(){return this.swatches.map(e=>e.hex)}get peakChroma(){let e=this.colors.slice(2,-2),t="",r=-1/0;for(let o of e){let a=new ao(o);a.chroma>r&&(r=a.chroma,t=o)}return r<6?this.colors[Math.ceil(this.steps/2)]:t}get steps(){return this.colors.length}get baseColor(){return this.colors.length===0?"":this.peakChroma||this.colors[Math.floor(this.colors.length/2)]}get baseIndex(){return this.colors.length===0?-1:this.colors.findIndex(e=>e.toLowerCase()===this.baseColor.toLowerCase())}get wcag(){let e=this.swatches,t=e.length,r=t-1,o={};if(t<=1){for(let a of[30,45,70])o[a]={efficiency:1,target:a/10,span:0,value:0};return o}for(let a of[30,45,70]){let n=a/10,i=r,l=0;for(let u=1;u<t;u++){let d=1/0;for(let c=0;c<t-u;c++){let h=e[c].luminance,f=e[c+u].luminance,g=(Math.max(h,f)+.05)/(Math.min(h,f)+.05);g<d&&(d=g)}if(d>=n){i=u,l=d;break}u===r&&(l=d)}o[a]={efficiency:i/r,target:n,span:i,value:l}}return o}get apca(){let e=this.swatches,t=e.length,r=t-1,o={};if(t<=1){for(let n of[45,60,75])o[n]={efficiency:1,target:n,span:0,value:0};return o}let a=(n,i)=>{let l=n<.022?n+Math.pow(.022-n,1.414):n,u=i<.022?i+Math.pow(.022-i,1.414):i,d=u>=l?(Math.pow(u,.56)-Math.pow(l,.57))*114:(Math.pow(u,.65)-Math.pow(l,.62))*114;return Math.abs(d)<10?0:(d=d>0?d-2.7:d+2.7,Math.round(d))};for(let n of[45,60,75]){let i=n,l=r,u=0;for(let d=1;d<t;d++){let c=1/0;for(let h=0;h<t-d;h++){let f=e[h].luminance>e[h+d].luminance?e[h].luminance:e[h+d].luminance,g=e[h].luminance>e[h+d].luminance?e[h+d].luminance:e[h].luminance,b=Math.abs(a(g,f));b<c&&(c=b)}if(c>=i){l=d,u=c;break}d===r&&(u=c)}o[n]={efficiency:l/r,target:i,span:l,value:u}}return o}get deltaECurve(){let e=[0];for(let t=1;t<this.swatches.length;t++){let r=fo(this.swatches[t-1].lab,this.swatches[t].lab);e.push(e[t-1]+r)}return e}get unwrapHues(){let e=this.swatches.map(r=>r.hue).slice(1,-1);if(e.length===0)return[];let t=[e[0]];for(let r=1;r<e.length;r++){let o=e[r]-e[r-1];o>180?o-=360:o<-180&&(o+=360),t.push(t[r-1]+o)}return t}get lightnessLinearity(){let e=this.swatches.map(h=>h.lightness),t=e.length;if(t<2)return 1;let r=0,o=0,a=0,n=0;for(let h=0;h<t;h++)r+=h,o+=e[h],a+=h*e[h],n+=h*h;let i=t*n-r*r;if(Math.abs(i)<1e-10)return 1;let l=(t*a-r*o)/i,u=(o-l*r)/t;if(Math.abs(l*(t-1))<.001)return 1;let d=0,c=0;for(let h=0;h<t;h++){let f=l*h+u,g=e[h]-f;d+=g*g;let b=Math.max(f-Math.min(u,l*(t-1)+u),Math.max(u,l*(t-1)+u)-f);c+=b*b}return Math.max(0,Math.min(1,1-Math.sqrt(d/t)/Math.sqrt(c/t)))}get chromaSmoothness(){let e=this.swatches.map(h=>h.chroma),t=e.length;if(t<3)return 1;let r=133.8,o=Math.max(...e);if(o<=.01)return 1;let a=e.map(h=>h/o*r),n=Math.min(...a),i=Math.max(...a),l=a.findIndex(h=>h===i),u=bt([[0,a[0]],[l,i],[t-1,a[t-1]]]),d=0,c=0;for(let h=0;h<t;h++){let f=u(h),g=a[h]-f;d+=g*g,c+=Math.pow(Math.max(f-n,i-f),2)}return Math.max(0,Math.min(1,1-Math.sqrt(d/t)/Math.sqrt(c/t)))}get spacingUniformity(){let e=this.deltaECurve,t=e.length;if(t<2)return 1;let r=[];for(let i=1;i<t;i++){let l=e[i]-e[i-1];if(l<0)return 0;r.push(l)}let o=r.reduce((i,l)=>i+l,0)/r.length;if(o<=1e-6)return 0;let a=0;for(let i of r)a+=Math.pow(i-o,2);let n=Math.sqrt(a/r.length)/o;return Math.max(0,Math.min(1,1/(1+n)))}get hueStability(){var e,t,r;let o=this.unwrapHues,a=o.length;if(a<2)return 1;let n=(r=(t=o[this.baseIndex-1])!=null?t:(e=this.swatches[this.baseIndex])==null?void 0:e.hue)!=null?r:0,i=0,l=0;for(let u=0;u<a;u++){let d=Math.abs(o[u]-n)%360;d>180&&(d=360-d),i+=d*d;let c=u/(a-1)*180;l+=c*c}return Math.max(0,Math.min(1,1-Math.sqrt(i/a)/(Math.sqrt(l/a)||1)))}get contrastEfficiency(){let e=this.wcag[45].span,t=this.steps;if(t<=1)return 1;let r=.501,o=e/(t-1);return o<=r?1:o>=1?0:1-(o-r)/(1-r)}get metrics(){return{lightnessLinearity:this.lightnessLinearity,chromaSmoothness:this.chromaSmoothness,spacingUniformity:this.spacingUniformity,hueStability:this.hueStability,contrastEfficiency:this.contrastEfficiency}}get score(){return po(Object.values(this.metrics))}},_i=class{constructor(e={},t="Collection 1"){this.ramps=Object.entries(e).map(([r,o])=>new Er(o,r)),this.name=t}get colors(){return Object.fromEntries(this.ramps.map(e=>[e.name,e.colors]))}get steps(){var e;return((e=this.ramps[0])==null?void 0:e.steps)||0}get wcag(){let e={},t=this.steps;for(let r of[30,45,70]){let o=this.ramps.map(i=>i.wcag[r]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),n=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[r]={target:r/10,span:a,value:n/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get apca(){let e={},t=this.steps;for(let r of[45,60,75]){let o=this.ramps.map(i=>i.apca[r]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),n=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[r]={target:r,span:a,value:n/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get contrastEfficiency(){return Be(this.ramps.map(e=>e.contrastEfficiency))}get lightnessLinearity(){return Be(this.ramps.map(e=>e.lightnessLinearity))}get chromaSmoothness(){return Be(this.ramps.map(e=>e.chromaSmoothness))}get hueStability(){return Be(this.ramps.map(e=>e.hueStability))}get spacingUniformity(){return Be(this.ramps.map(e=>e.spacingUniformity))}get score(){return po([this.contrastEfficiency,this.lightnessLinearity,this.chromaSmoothness,this.hueStability,this.spacingUniformity])}},_r=.605,lo=.685;function Ti(e){let t=Math.pow(e,_r);return t/(1+lo*(1-t))}function Di(e){let t=e*(1+lo)/(1+e*lo);return Math.pow(t,1/_r)}function Mi(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function Oi(e){let t=[[0,0,0],...e,[1,1,1]].map(f=>ot(f)).sort((f,g)=>f[0]-g[0]),r=t.map(f=>f[0]),o=t.map(f=>f[1]),a=t.map(f=>f[2]),n=[0],i=0;for(let f=1;f<t.length;f++)i+=Mi(t[f],t[f-1]),n.push(i);let l=n.map(f=>Di(i>0?f/i:0)),u=e.length===1?0:l[1],d=e.length===1?1:l[l.length-2],c=bt(l.map((f,g)=>[f,o[g]])),h=bt(l.map((f,g)=>[f,a[g]]));return{colorAtParam:f=>{let g=Ti(f),b=u+g*(d-u),y=0;for(let P=0;P<l.length-1;P++)if(b<=l[P+1]){y=P;break}let p=l[y],w=l[y+1],E=(b-p)/(w-p||1),k=r[y]+E*(r[y+1]-r[y]),_=c(b),M=h(b);return xt([k,_,M])},parameters:l.slice(1,-1).map(f=>(f-u)/(d-u))}}function Tr(e,t){let r=Array.isArray(e)?e:[e];if(r.length===0)throw new Error("generateRamp requires at least one anchor color");if(t<=0)return[];if(t===1)return[Se(ae(r[0]))];let{colorAtParam:o,parameters:a}=Oi(r.map(ae)),n=[],i=[0,...a,1],l=i.map(d=>Math.round(d*(t-1))),u=0;for(let d=0;d<t;d++){for(;u<l.length-2&&d>l[u+1];)u++;let c=l[u],h=l[u+1],f=i[u],g=i[u+1],b;if(h<=c)b=f;else{let y=(d-c)/(h-c);b=f+y*(g-f)}n.push(Se(o(b)))}return n.reverse()}var Pi=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],Li=[.75,1,1.5,2,2.5];function $i(e,t){let r=je(ae(t)),o=0,a=1/0;for(let n=0;n<e.length;n++){let i=fo(r,je(ae(e[n])));i<a&&(a=i,o=n)}return o}function Ri(e,t={}){var r,o,a,n,i,l;let u=(r=t.steps)!=null?r:18,d={},c={};for(let[h,f]of Object.entries(e)){let g;try{g=ho(f)}catch(y){throw new Error(`baseColors.${h}: ${y instanceof Error?y.message:String(y)}`)}let b=Tr(g,u);d[h]=b,c[h]=$i(b,g)}return{direction:(o=t.direction)!=null?o:"darken",colors:d,baseTones:c,fontSizes:(a=t.fontSizes)!=null?a:Pi,densities:(n=t.densities)!=null?n:Li,darkBias:(i=t.darkBias)!=null?i:1,custom:(l=t.custom)!=null?l:{}}}var so=["inherit"];[...Array(8).keys()].forEach(e=>{so.push(`decrease-${e}`),so.push(`increase-${e}`)});function Dr(e,t="inherit"){if(!so.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t==="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(7,r))}function Ii(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Dr(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function x(e,t="inherit"){let r=Dr(Ii(e),t);return yt().fontSizes[r]}var vt={surface:"shift-1",hover:"shift-2",border:"shift-3","border-strong":"shift-4",muted:"shift-8",text:"shift-9"},et=["inherit","base",...Object.keys(vt)];[...Array(G).keys()].forEach(e=>{et.push(`decrease-${e}`),et.push(`increase-${e}`),et.push(`shift-${e}`)});function br(e,t){if(e<0||e>G-1)return e;let r=e+t;return r=Math.max(0,Math.min(G-1,r)),r}function zi(e,t){if(e<0||e>G-1)return e;let r=Math.floor((G-1)/2),o=e<=r?e+t:e-t;return o=Math.max(0,Math.min(G-1,o)),o}function Fe(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!et.includes(t))throw Error(`tone name "${t}" invalid`);if(t in vt&&(t=vt[t]),t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return br(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return br(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return zi(e,r)}else return e}function Mr(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=Fe(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Or(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===G-1?G-1-r:e}function s(e,t="inherit",r="inherit"){let o=r==="inherit"?"neutral":r;if(!e){let l=yt()[o];if(!l)throw Error(`color "${o}" not found on theme "light"`);return t==="base"?l[se("light").baseTones[o]]:l[Fe(0,t)]}let a=St(e),n;if(t==="base")n=se(a).baseTones[o];else{let l=se(a),u=Or(Mr(e),l.direction,l.darkBias);n=Fe(u,t)}let i=yt()[o];if(!i)throw Error(a==="light"?`color "${o}" not found on theme "light"`:`color "${o}" not found on the "light" theme (required by node theme "${a}") \u2014 themeColor() var references are keyed on the "light" theme structure; register the role on "light" as well (e.g. setTheme("light", { colors: { ${o}: \u2026 } })) so the shared CSS-var baseline includes it`);return i[n]}function go(e,t="inherit",r="inherit"){let o=r==="inherit"?"neutral":r,a=e?St(e):"light",n=uo(a)[o];if(!n)throw Error(`color "${o}" not found on theme "${a}"`);if(!e)return t==="base"?n[se("light").baseTones[o]]:n[Fe(0,t)];let i;if(t==="base")i=se(a).baseTones[o];else{let l=se(a),u=Or(Mr(e),l.direction,l.darkBias);i=Fe(u,t)}return n[i]}function Ai(e={}){let{theme:t="light",tone:r="inherit",color:o="inherit"}=e,a=o==="inherit"?"neutral":o,n=uo(t)[a];if(!n)throw Error(`color "${a}" not found on theme "${t}"`);return r==="base"?n[se(t).baseTones[a]]:n[Fe(0,r)]}var At={};mt(At,{abbreviation:()=>Ni,accordion:()=>Bi,alert:()=>Vi,avatar:()=>Hi,badge:()=>ji,blockquote:()=>Fi,breadcrumb:()=>Wi,breadcrumbEllipsis:()=>Ki,button:()=>Gi,buttonGhost:()=>yo,buttonSwitch:()=>Yi,card:()=>Xi,code:()=>Ji,combobox:()=>Fa,command:()=>Wa,commandItem:()=>qa,commandSearch:()=>Ka,datePicker:()=>Ya,descriptionList:()=>Ja,details:()=>Qa,dialog:()=>tl,divider:()=>ol,drawer:()=>rl,elevation:()=>N,emphasis:()=>nl,empty:()=>il,errorBoundary:()=>al,fab:()=>sl,figure:()=>cl,focusRing:()=>T,formGroup:()=>ml,grid:()=>ul,heading:()=>dl,horizontalRule:()=>fl,icon:()=>pl,image:()=>gl,inputCheckbox:()=>yl,inputColor:()=>bl,inputDateTime:()=>vl,inputFile:()=>Sl,inputNumber:()=>xl,inputOTP:()=>wl,inputPassword:()=>El,inputRadio:()=>_l,inputRange:()=>Tl,inputSearch:()=>Dl,inputSwitch:()=>Ml,inputText:()=>Ol,keyboard:()=>Pl,label:()=>Ll,link:()=>$l,linkButton:()=>zl,list:()=>Al,listItem:()=>Nl,listItemButton:()=>Bl,mark:()=>Vl,menu:()=>Hl,motion:()=>jl,orderedList:()=>Fl,pagination:()=>Kl,panelSection:()=>ql,paragraph:()=>Ul,popover:()=>Gl,popoverArrow:()=>Oo,preformated:()=>Yl,progress:()=>Zl,rating:()=>Ql,ringProgress:()=>es,row:()=>Po,scrollArea:()=>ts,segmented:()=>os,select:()=>rs,selectBox:()=>ls,selectItem:()=>ss,selectList:()=>cs,skeleton:()=>ms,small:()=>us,spinner:()=>hs,splitter:()=>ds,splitterHandle:()=>ps,splitterPanel:()=>fs,stack:()=>gs,steps:()=>ys,strong:()=>bs,subscript:()=>vs,superscript:()=>Ss,table:()=>xs,tabs:()=>ws,tag:()=>it,textarea:()=>ks,timeline:()=>Cs,timelineItem:()=>Es,toast:()=>_s,toggleGroup:()=>Ts,toolbar:()=>Ds,toolbarSpacer:()=>Ms,tooltip:()=>Os,transitionGroup:()=>Ps,unorderedList:()=>Ls,visuallyHidden:()=>$s});function Ni(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>x(n),backgroundColor:n=>s(n),color:n=>s(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>s(n,"shift-7",t.get(n)),textUnderlineOffset:m(.72),cursor:"help","&:hover":{color:n=>s(n,"shift-11",r.get(n)),textDecorationColor:n=>s(n,"shift-9",r.get(n))}}}}function T(e,t="primary"){let r=s(e,"surface"),o=s(e,"shift-9",t);return`0 0 0 2px ${r}, 0 0 0 4px ${o}`}function Bi(e={}){var a,n;let{type:t="single"}=e,r=v((a=e.color)!=null?a:"neutral","color"),o=v((n=e.accentColor)!=null?n:"primary","accentColor");return{_onMount:i=>{if(t!=="single")return;let l=i.domElement;if(!l)return;let u=d=>{let c=d.target.closest("summary");if(!c)return;let h=c.closest("details");!h||h.parentElement!==l||h.open||Array.from(l.querySelectorAll(":scope > details")).forEach(f=>{f!==h&&(f.open=!1)})};l.addEventListener("click",u),i.addHook("Remove",()=>l.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:i=>m(S(i)*1.5),outline:i=>`1px solid ${s(i,"border-strong",r.get(i))}`,outlineOffset:"-1px",color:i=>s(i,"text",r.get(i)),overflow:"hidden","& > details":{borderBottom:i=>`1px solid ${s(i,"border-strong",r.get(i))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{boxShadow:i=>T(i,o.get(i))}}}}function Vi(e={}){var r;let t=v((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:m(3),paddingBlock:o=>m(S(o)*2),paddingInline:o=>m(S(o)*4),borderRadius:o=>m(S(o)*1.5),boxShadow:o=>`inset ${m(1)} 0 0 0 ${s(o,"shift-8",t.get(o))}`,backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),fontSize:o=>x(o,"inherit")}}}function Hi(e={}){var r;let t=v((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",_doctorDisable:"inline-typography",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:m(9),height:m(9),fontSize:o=>x(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-11",t.get(o)),boxShadow:o=>`0 0 0 1px ${s(o,"border",t.get(o))}`,"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function ji(e={}){var a;let{label:t=999}=e,r=v(t),o=v((a=e.color)!=null?a:"danger","color");return{_doctorDisable:"inline-typography",style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:m(1.5),minWidth:m(5),height:m(5),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>x(n,"decrease-2"),fontWeight:"600",lineHeight:1,borderRadius:m(999),backgroundColor:n=>s(n,"shift-9",o.get(n)),color:n=>s(n,"shift-0",o.get(n)),boxShadow:n=>`0 0 0 1px ${s(n,"shift-0",o.get(n))}`}}}}function Fi(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>x(o,"inherit"),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"text",t.get(o)),boxShadow:o=>`inset ${m(1)} 0 0 0 ${s(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>m(S(o)*2),paddingInline:o=>m(S(o)*4),margin:0}}}function Wi(e={}){var o;let{separator:t="/"}=e,r=v((o=e.color)!=null?o:"neutral","color");return{_onInsert:a=>{a.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:a=>x(a,"inherit"),gap:m(1),color:a=>s(a,"text",r.get(a)),backgroundColor:a=>s(a,"inherit",r.get(a)),"& > *":{display:"inline-flex",alignItems:"center",color:a=>s(a,"muted",r.get(a))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:a=>s(a,"shift-4",r.get(a)),paddingInlineStart:m(1)},"& > [aria-current=page]":{color:a=>s(a,"shift-10",r.get(a)),pointerEvents:"none"}}}}function Ki(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>x(o,"inherit"),paddingInline:m(1),border:"none",background:"none",cursor:"pointer",color:o=>s(o,"muted",t.get(o)),borderRadius:m(1),transition:"color 140ms ease, background-color 140ms ease, box-shadow 140ms ease","&:hover":{color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"hover",t.get(o))},"&:focus-visible":{boxShadow:o=>T(o,t.get(o))}}}}var We={small:"decrease-1",medium:"inherit",large:"increase-1"};var qi={small:.5,medium:1,large:1.5};function yo(e={}){var a,n,i;let t=v((a=e.color)!=null?a:"neutral","color"),r=qi[(n=e.size)!=null?n:"medium"],o=We[(i=e.size)!=null?i:"medium"];return{_onInsert:l=>{l.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:l=>x(l,o),paddingBlock:l=>m(S(l)*r),paddingInline:l=>m(S(l)*r),borderRadius:l=>m(S(l)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:l=>m(S(l)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:l=>s(l,"text",t.get(l)),"&:hover:not([disabled]):not([aria-busy=true])":{color:l=>s(l,"text",t.get(l)),backgroundColor:l=>s(l,"hover",t.get(l))},"&:active:not([disabled]):not([aria-busy=true])":{color:l=>s(l,"text",t.get(l)),backgroundColor:l=>s(l,"increase-2",t.get(l))},"&:focus-visible":{boxShadow:l=>T(l,t.get(l))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>s(l,"border-strong","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var Ui={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}};function Gi(e={}){var i,l,u,d;let t=(i=e.variant)!=null?i:"outline";if(t==="ghost")return yo({color:e.color,size:e.size});let r=v((l=e.color)!=null?l:"primary","color"),o=t==="solid",a=Ui[(u=e.size)!=null?u:"medium"],n=We[(d=e.size)!=null?d:"medium"];return ie(V({_onInsert:c=>{c.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')}},o?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{appearance:"none",fontSize:c=>x(c,n),paddingBlock:c=>m(S(c)*a.block),paddingInline:c=>m(S(c)*a.inline),borderRadius:c=>m(S(c)*1.5),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:c=>m(S(c)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o?"none":c=>`1px solid ${s(c,"border-strong",r.get(c))}`,color:c=>o?s(c,"shift-0","neutral"):s(c,"shift-13",r.get(c)),backgroundColor:c=>o?s(c,"shift-13",r.get(c)):s(c,"inherit",r.get(c)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{color:c=>o?s(c,"shift-0","neutral"):s(c,"shift-14",r.get(c)),backgroundColor:c=>o?s(c,"shift-14",r.get(c)):s(c,"hover",r.get(c))},"&:active:not([disabled]):not([aria-busy=true])":{backgroundColor:c=>o?s(c,"shift-15",r.get(c)):s(c,"increase-2",r.get(c))},"&:focus-visible":{boxShadow:c=>T(c,r.get(c))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:c=>s(c,"shift-2","neutral"),outline:c=>`1px solid ${s(c,"border-strong","neutral")}`,color:c=>s(c,"muted","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}})}function Yi(e={}){var n,i;let{checked:t=!1}=e,r=v(t),o=v((n=e.color)!=null?n:"neutral","color"),a=v((i=e.accentColor)!=null?i:"primary","accentColor");return{_onSchedule:l=>{l.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:l=>r.get(l),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:l=>x(l),border:"none",outlineWidth:"1px",outline:l=>`1px solid ${s(l,"border",o.get(l))}`,minWidth:m(12),minHeight:m(6),borderRadius:m(999),paddingLeft:m(7),paddingRight:m(2),cursor:"pointer",transition:"padding-left 0.3s, padding-right 0.3s, background-color 140ms ease, box-shadow 140ms ease",backgroundColor:l=>s(l,"inherit",o.get(l)),color:l=>s(l,"text",o.get(l)),"&:focus-visible":{boxShadow:l=>T(l,a.get(l))},"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:m(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:m(5),height:m(5),borderRadius:m(999),color:l=>s(l,"text"),backgroundColor:l=>s(l,"decrease-2",o.get(l))},"&[aria-checked=true]":{backgroundColor:l=>s(l,"increase-3",a.get(l)),outline:"none",color:l=>s(l,"decrease-2"),paddingLeft:m(2),paddingRight:m(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${m(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var Zi={low:"0 1px 2px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.10)",medium:"0 2px 4px rgba(0,0,0,0.10), 0 10px 24px rgba(0,0,0,0.14)",high:"0 6px 12px rgba(0,0,0,0.14), 0 24px 48px rgba(0,0,0,0.20)"};function N(e){return Zi[e]}function Xi(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>m(S(o)*2),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"shift-10",t.get(o)),outline:o=>`1px solid ${s(o,"border-strong",t.get(o))}`,outlineOffset:"-1px",boxShadow:N("low"),overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>m(S(o)*2),paddingInline:o=>m(S(o)*4),fontWeight:"600",color:o=>s(o,"shift-11",t.get(o)),margin:0},"& > p":{gridArea:"desc",paddingInline:o=>m(S(o)*4),paddingBottom:o=>m(S(o)*2),color:o=>s(o,"text",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>m(S(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>m(S(o)*4),color:o=>s(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:m(2),paddingBlock:o=>m(S(o)*2),paddingInline:o=>m(S(o)*4),borderTop:o=>`1px solid ${s(o,"border",t.get(o))}`}}}}function Ji(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:m(6),paddingInline:m(1.5),borderRadius:m(1)}}}var Qi=Object.defineProperty,ea=Object.defineProperties,ta=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,Br=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable,Pr=(e,t,r)=>t in e?Qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ue=(e,t)=>{for(var r in t||(t={}))Br.call(t,r)&&Pr(e,r,t[r]);if(Ct)for(var r of Ct(t))Vr.call(t,r)&&Pr(e,r,t[r]);return e},Oe=(e,t)=>ea(e,ta(t)),Hr=(e,t)=>{var r={};for(var o in e)Br.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Ct)for(var o of Ct(e))t.indexOf(o)<0&&Vr.call(e,o)&&(r[o]=e[o]);return r},$e=(e,t,r)=>new Promise((o,a)=>{var n=u=>{try{l(r.next(u))}catch(d){a(d)}},i=u=>{try{l(r.throw(u))}catch(d){a(d)}},l=u=>u.done?o(u.value):Promise.resolve(u.value).then(n,i);l((r=r.apply(e,t)).next())}),oa=["top","right","bottom","left"],Lr=["start","end"],Zc=oa.reduce((e,t)=>e.concat(t,`${t}-${Lr[0]}`,`${t}-${Lr[1]}`),[]),Et=Math.min,Me=Math.max,_t=Math.round,kt=Math.floor,ge=e=>({x:e,y:e}),ra={left:"right",right:"left",bottom:"top",top:"bottom"};function na(e,t,r){return Me(e,Et(t,r))}function Mt(e,t){return typeof e=="function"?e(t):e}function qe(e){return e.split("-")[0]}function Ot(e){return e.split("-")[1]}function jr(e){return e==="x"?"y":"x"}function Fr(e){return e==="y"?"height":"width"}function xe(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Wr(e){return jr(xe(e))}function ia(e,t,r=!1){let o=Ot(e),a=Wr(e),n=Fr(a),i=a==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(i=Tt(i)),[i,Tt(i)]}function aa(e){let t=Tt(e);return[So(e),t,So(t)]}function So(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var $r=["left","right"],Rr=["right","left"],la=["top","bottom"],sa=["bottom","top"];function ca(e,t,r){switch(e){case"top":case"bottom":return r?t?Rr:$r:t?$r:Rr;case"left":case"right":return t?la:sa;default:return[]}}function ma(e,t,r,o){let a=Ot(e),n=ca(qe(e),r==="start",o);return a&&(n=n.map(i=>`${i}-${a}`),t&&(n=n.concat(n.map(So)))),n}function Tt(e){let t=qe(e);return ra[t]+e.slice(t.length)}function ua(e){var t,r,o,a;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function ha(e){return typeof e!="number"?ua(e):{top:e,right:e,bottom:e,left:e}}function Dt(e){let{x:t,y:r,width:o,height:a}=e;return{width:o,height:a,top:r,left:t,right:t+o,bottom:r+a,x:t,y:r}}function Ir({reference:e,floating:t},r,o){let a=xe(r),n=Wr(r),i=Fr(n),l=qe(r),u=a==="y",d=e.x+e.width/2-t.width/2,c=e.y+e.height/2-t.height/2,h=e[i]/2-t[i]/2,f;switch(l){case"top":f={x:d,y:e.y-t.height};break;case"bottom":f={x:d,y:e.y+e.height};break;case"right":f={x:e.x+e.width,y:c};break;case"left":f={x:e.x-t.width,y:c};break;default:f={x:e.x,y:e.y}}let g=Ot(r);return g&&(f[n]+=h*(g==="end"?1:-1)*(o&&u?-1:1)),f}function da(e){return $e(this,arguments,function*(t,r={}){var o,a,n,i,l,u;let{x:d,y:c,platform:h,rects:f,elements:g,strategy:b}=t,{boundary:y="clippingAncestors",rootBoundary:p="viewport",elementContext:w="floating",altBoundary:E=!1,padding:k=0}=Mt(r,t),_=ha(k),M=g[E?w==="floating"?"reference":"floating":w],P=Dt(yield h.getClippingRect({element:(a=yield(o=h.isElement)==null?void 0:o.call(h,M))==null||a?M:M.contextElement||(yield(n=h.getDocumentElement)==null?void 0:n.call(h,g.floating)),boundary:y,rootBoundary:p,strategy:b})),L=w==="floating"?{x:d,y:c,width:f.floating.width,height:f.floating.height}:f.reference,B=yield(i=h.getOffsetParent)==null?void 0:i.call(h,g.floating),z=(yield(l=h.isElement)==null?void 0:l.call(h,B))&&(yield(u=h.getScale)==null?void 0:u.call(h,B))||{x:1,y:1},K=Dt(h.convertOffsetParentRelativeRectToViewportRelativeRect?yield h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:L,offsetParent:B,strategy:b}):L);return{top:(P.top-K.top+_.top)/z.y,bottom:(K.bottom-P.bottom+_.bottom)/z.y,left:(P.left-K.left+_.left)/z.x,right:(K.right-P.right+_.right)/z.x}})}var fa=50,pa=(e,t,r)=>$e(null,null,function*(){var o;let{placement:a="bottom",strategy:n="absolute",middleware:i=[],platform:l}=r,u=l.detectOverflow?l:Oe(ue({},l),{detectOverflow:da}),d=yield(o=l.isRTL)==null?void 0:o.call(l,t),c=yield l.getElementRects({reference:e,floating:t,strategy:n}),{x:h,y:f}=Ir(c,a,d),g=a,b=0,y={};for(let p=0;p<i.length;p++){let w=i[p];if(!w)continue;let{name:E,fn:k}=w,{x:_,y:M,data:P,reset:L}=yield k({x:h,y:f,initialPlacement:a,placement:g,strategy:n,middlewareData:y,rects:c,platform:u,elements:{reference:e,floating:t}});h=_!=null?_:h,f=M!=null?M:f,y[E]=ue(ue({},y[E]),P),L&&b<fa&&(b++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(c=L.rects===!0?yield l.getElementRects({reference:e,floating:t,strategy:n}):L.rects),{x:h,y:f}=Ir(c,g,d)),p=-1)}return{x:h,y:f,placement:g,strategy:n,middlewareData:y}});var ga=(e={})=>({name:"flip",options:e,fn(t){return $e(this,null,function*(){var r,o,a,n,i,l;let{placement:u,middlewareData:d,rects:c,initialPlacement:h,platform:f,elements:g}=t,b=Mt(e,t),{mainAxis:y=!0,crossAxis:p=!0,fallbackPlacements:w,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:_=!0}=b,M=Hr(b,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=d.arrow)!=null&&r.alignmentOffset)return{};let P=qe(u),L=xe(h),B=qe(h)===h,z=yield(o=f.isRTL)==null?void 0:o.call(f,g.floating),K=w||(B||!_?[Tt(h)]:aa(h)),Z=k!=="none";!w&&Z&&K.push(...ma(h,_,k,z));let H=[h,...K],te=yield f.detectOverflow(t,M),X=[],I=((a=d.flip)==null?void 0:a.overflows)||[];if(y&&X.push(te[P]),p){let F=ia(u,c,z);X.push(te[F[0]],te[F[1]])}if(I=[...I,{placement:u,overflows:X}],!X.every(F=>F<=0)){let F=(((n=d.flip)==null?void 0:n.index)||0)+1,q=H[F];if(q&&(!(p==="alignment"&&L!==xe(q))||I.every(J=>xe(J.placement)===L?J.overflows[0]>0:!0)))return{data:{index:F,overflows:I},reset:{placement:q}};let le=(i=I.filter(J=>J.overflows[0]<=0).sort((J,re)=>J.overflows[1]-re.overflows[1])[0])==null?void 0:i.placement;if(!le)switch(E){case"bestFit":{let J=(l=I.filter(re=>{if(Z){let ce=xe(re.placement);return ce===L||ce==="y"}return!0}).map(re=>[re.placement,re.overflows.filter(ce=>ce>0).reduce((ce,Nt)=>ce+Nt,0)]).sort((re,ce)=>re[1]-ce[1])[0])==null?void 0:l[0];J&&(le=J);break}case"initialPlacement":le=h;break;default:}if(u!==le)return{reset:{placement:le}}}return{}})}});var ya=new Set(["left","top"]);function ba(e,t){return $e(this,null,function*(){var r;let{placement:o,platform:a,elements:n}=e,i=yield(r=a.isRTL)==null?void 0:r.call(a,n.floating),l=qe(o),u=Ot(o),d=xe(o)==="y",c=ya.has(l)?-1:1,h=i&&d?-1:1,f=Mt(t,e),{mainAxis:g,crossAxis:b,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&typeof y=="number"&&(b=u==="end"?y*-1:y),d?{x:b*h,y:g*c}:{x:g*c,y:b*h}})}var va=(e=0)=>({name:"offset",options:e,fn(t){return $e(this,null,function*(){var r,o;let{x:a,y:n,placement:i,middlewareData:l}=t,u=yield ba(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+u.x,y:n+u.y,data:Oe(ue({},u),{placement:i})}})}}),Sa=(e={})=>({name:"shift",options:e,fn(t){return $e(this,null,function*(){let{x:r,y:o,placement:a,platform:n}=t,i=Mt(e,t),{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:({x:k,y:_})=>({x:k,y:_})}}=i,c=Hr(i,["mainAxis","crossAxis","limiter"]),h={x:r,y:o},f=yield n.detectOverflow(t,c),g=xe(a),b=jr(g),y=h[b],p=h[g],w=(k,_)=>na(_+f[k==="y"?"top":"left"],_,_-f[k==="y"?"bottom":"right"]);l&&(y=w(b,y)),u&&(p=w(g,p));let E=d.fn(Oe(ue({},t),{[b]:y,[g]:p}));return Oe(ue({},E),{data:{x:E.x-r,y:E.y-o,enabled:{[b]:l,[g]:u}}})})}});function Pt(){return typeof window!="undefined"}function Ue(e){return Kr(e)?(e.nodeName||"").toLowerCase():"#document"}function ee(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function ye(e){var t;return(t=(Kr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kr(e){return Pt()?e instanceof Node||e instanceof ee(e).Node:!1}function he(e){return Pt()?e instanceof Element||e instanceof ee(e).Element:!1}function we(e){return Pt()?e instanceof HTMLElement||e instanceof ee(e).HTMLElement:!1}function zr(e){return!Pt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof ee(e).ShadowRoot}function Lt(e){let{overflow:t,overflowX:r,overflowY:o,display:a}=de(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&a!=="inline"&&a!=="contents"}function xa(e){return/^(table|td|th)$/.test(Ue(e))}function $t(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var wa=/transform|translate|scale|rotate|perspective|filter/,ka=/paint|layout|strict|content/,De=e=>!!e&&e!=="none",bo;function wo(e){let t=he(e)?de(e):e;return De(t.transform)||De(t.translate)||De(t.scale)||De(t.rotate)||De(t.perspective)||!ko()&&(De(t.backdropFilter)||De(t.filter))||wa.test(t.willChange||"")||ka.test(t.contain||"")}function Ca(e){let t=Pe(e);for(;we(t)&&!rt(t);){if(wo(t))return t;if($t(t))return null;t=Pe(t)}return null}function ko(){return bo==null&&(bo=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),bo}function rt(e){return/^(html|body|#document)$/.test(Ue(e))}function de(e){return ee(e).getComputedStyle(e)}function Rt(e){return he(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pe(e){if(Ue(e)==="html")return e;let t=e.assignedSlot||e.parentNode||zr(e)&&e.host||ye(e);return zr(t)?t.host:t}function qr(e){let t=Pe(e);return rt(t)?(e.ownerDocument||e).body:we(t)&&Lt(t)?t:qr(t)}function nt(e,t=[],r=!0){var o;let a=qr(e),n=a===((o=e.ownerDocument)==null?void 0:o.body),i=ee(a);if(n){let l=xo(i);return t.concat(i,i.visualViewport||[],Lt(a)?a:[],l&&r?nt(l):[])}else return t.concat(a,nt(a,[],r))}function xo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ur(e){let t=de(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=we(e),n=a?e.offsetWidth:r,i=a?e.offsetHeight:o,l=_t(r)!==n||_t(o)!==i;return l&&(r=n,o=i),{width:r,height:o,$:l}}function Co(e){return he(e)?e:e.contextElement}function Ke(e){let t=Co(e);if(!we(t))return ge(1);let r=t.getBoundingClientRect(),{width:o,height:a,$:n}=Ur(t),i=(n?_t(r.width):r.width)/o,l=(n?_t(r.height):r.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var Ea=ge(0);function Gr(e){let t=ee(e);return!ko()||!t.visualViewport?Ea:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _a(e,t=!1,r){return!!r&&t&&r===ee(e)}function Le(e,t=!1,r=!1,o){let a=e.getBoundingClientRect(),n=Co(e),i=ge(1);t&&(o?he(o)&&(i=Ke(o)):i=Ke(e));let l=_a(n,r,o)?Gr(n):ge(0),u=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,c=a.width/i.x,h=a.height/i.y;if(n&&o){let f=ee(n),g=he(o)?ee(o):o,b=f,y=xo(b);for(;y&&g!==b;){let p=Ke(y),w=y.getBoundingClientRect(),E=de(y),k=w.left+(y.clientLeft+parseFloat(E.paddingLeft))*p.x,_=w.top+(y.clientTop+parseFloat(E.paddingTop))*p.y;u*=p.x,d*=p.y,c*=p.x,h*=p.y,u+=k,d+=_,b=ee(y),y=xo(b)}}return Dt({width:c,height:h,x:u,y:d})}function It(e,t){let r=Rt(e).scrollLeft;return t?t.left+r:Le(ye(e)).left+r}function Yr(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-It(e,r),a=r.top+t.scrollTop;return{x:o,y:a}}function Ta({elements:e,rect:t,offsetParent:r,strategy:o}){let a=o==="fixed",n=ye(r),i=e?$t(e.floating):!1;if(r===n||i&&a)return t;let l={scrollLeft:0,scrollTop:0},u=ge(1),d=ge(0),c=we(r);if((c||!a)&&((Ue(r)!=="body"||Lt(n))&&(l=Rt(r)),c)){let f=Le(r);u=Ke(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}let h=n&&!c&&!a?Yr(n,l):ge(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:t.y*u.y-l.scrollTop*u.y+d.y+h.y}}function Da(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ma(e){let t=Rt(e),r=e.ownerDocument.body,o=Me(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=Me(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),n=-t.scrollLeft+It(e),i=-t.scrollTop;return de(r).direction==="rtl"&&(n+=Me(e.clientWidth,r.clientWidth)-o),{width:o,height:a,x:n,y:i}}var Oa=25;function Pa(e,t,r="viewport"){let o=r==="layoutViewport",a=ee(e),n=ye(e),i=a.visualViewport,l=n.clientWidth,u=n.clientHeight,d=0,c=0;if(i){let h=!ko()||t==="fixed";o?h||(d=-i.offsetLeft,c=-i.offsetTop):(l=i.width,u=i.height,h&&(d=i.offsetLeft,c=i.offsetTop))}if(It(n)<=0){let h=n.ownerDocument,f=h.body,g=getComputedStyle(f),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,y=Math.abs(n.clientWidth-f.clientWidth-b),p=getComputedStyle(n).scrollbarGutter==="stable both-edges"?y/2:y;p<=Oa&&(l-=p)}return{width:l,height:u,x:d,y:c}}function La(e,t){let r=Le(e,!0,t==="fixed"),o=r.top+e.clientTop,a=r.left+e.clientLeft,n=Ke(e),i=e.clientWidth*n.x,l=e.clientHeight*n.y,u=a*n.x,d=o*n.y;return{width:i,height:l,x:u,y:d}}function Ar(e,t,r){let o;if(t==="viewport"||t==="layoutViewport")o=Pa(e,r,t);else if(t==="document")o=Ma(ye(e));else if(he(t))o=La(t,r);else{let a=Gr(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Dt(o)}function $a(e,t){let r=t.get(e);if(r)return r;let o=nt(e,[],!1).filter(l=>he(l)&&Ue(l)!=="body"),a=null,n=de(e).position==="fixed",i=n?Pe(e):e;for(;he(i)&&!rt(i);){let l=de(i),u=wo(i),d=a?a.position:n?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?o=o.filter(c=>c!==i):a=l,i=Pe(i)}return t.set(e,o),o}function Ra({element:e,boundary:t,rootBoundary:r,strategy:o}){let a=[...t==="clippingAncestors"?$t(e)?[]:$a(e,this._c):[].concat(t),r],n=Ar(e,a[0],o),i=n.top,l=n.right,u=n.bottom,d=n.left;for(let c=1;c<a.length;c++){let h=Ar(e,a[c],o);i=Me(h.top,i),l=Et(h.right,l),u=Et(h.bottom,u),d=Me(h.left,d)}return{width:l-d,height:u-i,x:d,y:i}}function Ia(e){let{width:t,height:r}=Ur(e);return{width:t,height:r}}function za(e,t,r){let o=we(t),a=ye(t),n=r==="fixed",i=Le(e,!0,n,t),l={scrollLeft:0,scrollTop:0},u=ge(0);if((o||!n)&&((Ue(t)!=="body"||Lt(a))&&(l=Rt(t)),o)){let f=Le(t,!0,n,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}!o&&a&&(u.x=It(a));let d=a&&!o&&!n?Yr(a,l):ge(0),c=i.left+l.scrollLeft-u.x-d.x,h=i.top+l.scrollTop-u.y-d.y;return{x:c,y:h,width:i.width,height:i.height}}function vo(e){return de(e).position==="static"}function Nr(e,t){if(!we(e)||de(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ye(e)===r&&(r=r.ownerDocument.body),r}function Zr(e,t){let r=ee(e);if($t(e))return r;if(!we(e)){let a=Pe(e);for(;a&&!rt(a);){if(he(a)&&!vo(a))return a;a=Pe(a)}return r}let o=Nr(e,t);for(;o&&xa(o)&&vo(o);)o=Nr(o,t);return o&&rt(o)&&vo(o)&&!wo(o)?r:o||Ca(e)||r}var Aa=function(e){return $e(this,null,function*(){let t=this.getOffsetParent||Zr,r=this.getDimensions,o=yield r(e.floating);return{reference:za(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Na(e){return de(e).direction==="rtl"}var Ba={convertOffsetParentRelativeRectToViewportRelativeRect:Ta,getDocumentElement:ye,getClippingRect:Ra,getOffsetParent:Zr,getElementRects:Aa,getClientRects:Da,getDimensions:Ia,getScale:Ke,isElement:he,isRTL:Na};function Xr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Va(e,t,r){let o=null,a,n=ye(e);function i(){clearTimeout(a),o==null||o.disconnect(),o=null}function l(c=!1,h=1){i();let f=e.getBoundingClientRect(),{left:g,top:b,width:y,height:p}=f;if(c||t(),!y||!p)return;let w=kt(b),E=kt(n.clientWidth-(g+y)),k=kt(n.clientHeight-(b+p)),_=kt(g),M={rootMargin:`${-w}px ${-E}px ${-k}px ${-_}px`,threshold:Me(0,Et(1,h))||1},P=!0;function L(B){let z=B[0].intersectionRatio;if(!Xr(f,e.getBoundingClientRect()))return l();if(z!==h){if(!P)return l();z?l(!1,z):a=setTimeout(()=>{l(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(L,Oe(ue({},M),{root:n.ownerDocument}))}catch(B){o=new IntersectionObserver(L,M)}o.observe(e)}let u=ee(e),d=()=>l(r);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),i()}}function Jr(e,t,r,o={}){let{ancestorScroll:a=!0,ancestorResize:n=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=Co(e),c=a||n?[...d?nt(d):[],...t?nt(t):[]]:[];c.forEach(w=>{a&&w.addEventListener("scroll",r),n&&w.addEventListener("resize",r)});let h=d&&l?Va(d,r,n):null,f=-1,g=null;i&&(g=new ResizeObserver(([w])=>{w&&w.target===d&&g&&t&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{g==null||g.observe(t)})),r()}),d&&!u&&g.observe(d),t&&g.observe(t));let b,y=u?Le(e):null;u&&p();function p(){let w=Le(e);y&&!Xr(y,w)&&r(),y=w,b=requestAnimationFrame(p)}return r(),()=>{c.forEach(w=>{a&&w.removeEventListener("scroll",r),n&&w.removeEventListener("resize",r)}),h==null||h(),g==null||g.disconnect(),g=null,u&&cancelAnimationFrame(b)}}var Qr=va;var en=Sa,tn=ga;var on=(e,t,r)=>{let o=new Map,a=r!=null?r:{},n=Oe(ue(ue({},Ba),a.platform),{_c:o});return pa(e,t,Oe(ue({},a),{platform:n}))};function ke(e,t){return`domphy-${e}-${t.nodeId}`}function Ha(e,t){var Z,H,te,X;let{openState:r,placement:o,content:a,keepOpenOnContentHover:n}=t,{kind:i}=t,l=`floating:${i}`,u=null,d=null,c=null,h=null,f=!1,g=e.domElement,b=e.getRoot(),y=ke(i,e),p={style:{position:"fixed",pointerEvents:"auto",visibility:I=>r.get(I)?"visible":"hidden"},onKeyDown:I=>{I.key==="Escape"&&P()},onMouseEnter:()=>n&&M(),onMouseLeave:()=>n&&P(),_onMount:I=>{var F;if(c=I.domElement,c.id||(c.id=y),g&&c&&!c.hasAttribute("data-theme")){let q=(F=g.closest("[data-theme]"))==null?void 0:F.getAttribute("data-theme");q&&c.setAttribute("data-theme",q)}},_portal:I=>{let F=I.domElement.querySelector("#domphy-floating");if(!F){let q={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};F=I.children.insert(q).domElement}return F}},w=I=>j(I,p);w(a);let E=()=>{f||(f=!0,h=b.children.insert(a),h._behaviorInstances.set(l,K))},k=()=>{E(),g&&c&&(d==null||d(),d=Jr(g,c,()=>{on(g,c,{placement:o.get(),middleware:[Qr(12),tn(),en()],strategy:"fixed"}).then(({x:I,y:F,placement:q})=>{c&&(Object.assign(c.style,{left:`${I}px`,top:`${F}px`}),o.set(q))})}),r.set(!0))},_=()=>{d==null||d(),d=null,h&&(h.remove(),h=null),c=null,f=!1,r.set(!1)},M=()=>{u&&clearTimeout(u),u=setTimeout(k,100)},P=()=>{u&&clearTimeout(u),u=setTimeout(_,100)},L=I=>{if(!r.get()||!g||!c)return;let F=I.target;!g.contains(F)&&!c.contains(F)&&P()};(Z=b.domElement)==null||Z.addEventListener("click",L);let B=I=>{I.key==="Escape"&&r.get()&&P()},z=(X=(te=(H=b.domElement)==null?void 0:H.ownerDocument)!=null?te:b.domElement)!=null?X:null;z==null||z.addEventListener("keydown",B);let K={show:M,hide:P,update(I){r=I.openState,o=I.placement,a=I.content,n=I.keepOpenOnContentHover,w(a),h&&h.patch(a)},destroy(){var I;u&&clearTimeout(u),d==null||d(),h==null||h.remove(),(I=b.domElement)==null||I.removeEventListener("click",L),z==null||z.removeEventListener("keydown",B)}};return K}function fe(e){let{kind:t,open:r=!1,placement:o}=e,a=v(r),n=`floating:${t}`,i=d=>{var c;return(c=d==null?void 0:d.getBehavior(n))==null?void 0:c.show()},l=d=>{var c;return(c=d==null?void 0:d.getBehavior(n))==null?void 0:c.hide()},u=V({onKeyDown:(d,c)=>d.key==="Escape"&&l(c)},_e(n,Ha,{kind:t,openState:a,placement:o,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover}));return{show:i,hide:l,anchorPartial:u}}var ja='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function it(e={}){var o;let{removable:t=!1}=e,r=v((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:a=>{let n={span:Te(ja),onClick:i=>{i.stopPropagation(),a.remove()},tabindex:0,role:"button",ariaLabel:"Remove",style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:m(1),width:m(4),height:m(4),flexShrink:0,transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover":{backgroundColor:i=>s(i,"shift-4",r.get(i))},"&:focus-visible":{boxShadow:i=>T(i,r.get(i))}}};t&&a.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:m(6),paddingBlock:0,borderRadius:m(999),paddingInlineStart:m(2.5),paddingInlineEnd:t?m(1):m(2.5),gap:m(1.5),fontSize:a=>x(a,"decrease-1"),backgroundColor:a=>s(a,"inherit",r.get(a)),color:a=>s(a,"text",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${s(a,"border-strong",r.get(a))}`}}}function Fa(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:a=!1,multiple:n=!1}=e,i=v(e.value),l=v(a),{show:u,hide:d,anchorPartial:c}=fe({kind:"combobox",open:l,placement:v(r),content:e.content}),h={onClick:(p,w)=>!n&&d(w),dataTone:"shift-14",style:{backgroundColor:p=>s(p,"inherit"),color:p=>s(p,"text"),borderRadius:p=>m(S(p)*2),outline:p=>`1px solid ${s(p,"border-strong")}`,outlineOffset:"-1px",boxShadow:N("medium")}};j(e.content,h);let f={border:"none",outline:"none",padding:0,margin:0,flex:1,height:m(6),marginInlineStart:m(2),fontSize:p=>x(p,"inherit"),color:p=>s(p,"text",o),backgroundColor:p=>s(p,"inherit",o)},g;if(e.input){let p={onFocus:(w,E)=>u(E),style:f,_key:"combobox-input"};j(e.input,p),g=e.input}else g={input:null,ariaLabel:"Filter options",onFocus:(p,w)=>u(w),value:p=>(i.get(p),""),style:f,_key:"combobox-input"};let b={div:p=>{let w=i.get(p),E=Array.isArray(w)?w:[w],_=t.filter(M=>E.includes(M.value)).map(M=>({span:M.label,$:[it({color:o,removable:!0})],_key:M.value,_onRemove:P=>{let L=i.get(),z=(Array.isArray(L)?L:[L]).filter(K=>K!==M.value);n?i.set(z):i.set(z[0])}}));return _.push(g),_},style:{display:"flex",flexWrap:"wrap",gap:m(1)}},y={_onInsert:p=>{p.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:p=>p.children.insert(b),style:{minWidth:m(32),outlineOffset:"-1px",outline:p=>`1px solid ${s(p,"border-strong","neutral")}`,paddingBlock:p=>m(S(p)*1),paddingInline:p=>m(S(p)*1),borderRadius:p=>m(S(p)*1.5),fontSize:p=>x(p,"inherit"),color:p=>s(p,"text",o),backgroundColor:p=>s(p,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-within":{boxShadow:p=>T(p,o)}}};return j(c,y),c}function Wa(){return{role:"group",ariaLabel:"Commands",_onSchedule:(e,t)=>{j(t,{_context:{command:{query:v("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Ka(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandSearch" patch must be used inside a "command"');return}let n=o.domElement,i=()=>a.query.set(n.value);n.addEventListener("input",i),o.addHook("Remove",()=>n.removeEventListener("input",i))},style:{fontFamily:"inherit",fontSize:o=>x(o,"inherit"),paddingInline:o=>m(S(o)*3),paddingBlock:o=>m(S(o)*2),border:"none",borderBottom:o=>`1px solid ${s(o,"border",t)}`,outline:"none",color:o=>s(o,"shift-10",t),backgroundColor:o=>s(o,"inherit",t),"&::placeholder":{color:o=>s(o,"shift-7")},transition:"border-bottom-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{borderBottomColor:o=>s(o,"shift-6",r),boxShadow:o=>T(o,r)}}}}function qa(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onMount:o=>{var d,c;let a=o.getContext("command");if(!a){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,i=(c=(d=n.textContent)==null?void 0:d.toLowerCase())!=null?c:"",l=h=>{n.hidden=h.length>0&&!i.includes(h.toLowerCase())};l(a.query.get());let u=a.query.addListener(l);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>x(o,"inherit"),height:o=>m(6+S(o)*2),paddingInline:o=>m(S(o)*3),border:"none",outline:"none",color:o=>s(o,"shift-13",t),backgroundColor:o=>s(o,"inherit",t),transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:o=>s(o,"shift-13",t),backgroundColor:o=>s(o,"hover",t)},"&:focus-visible":{boxShadow:o=>T(o,r)}}}}var Y=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Re=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Eo=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),at=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),_o=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,To=(e,t)=>Re(e,-((e.getDay()-t+7)%7));function Ua(e){var t,r;try{let o=new Intl.Locale(e),a=(r=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?r:o.weekInfo;if(a!=null&&a.firstDay)return a.firstDay%7}catch(o){}return 0}function Ga(e,t){let r=t,o=null,a=i=>{o==null||o(),o=i.onChange?i.selection.addListener(l=>i.onChange(l)):null},n=(i,l)=>{i!==l&&i.set(l.get())};return a(r),{update(i){n(i.selection,r.selection),n(i.viewYear,r.viewYear),n(i.viewMonth,r.viewMonth),n(i.focused,r.focused),n(i.hovered,r.hovered),n(i.hour,r.hour),n(i.minute,r.minute),(i.selection!==r.selection||i.onChange!==r.onChange)&&a(i),r=i},destroy(){o==null||o(),o=null}}}function Ya(e={}){var Ro,Io,zo,Ao;let{mode:t="single",time:r=!1,min:o,max:a,disabledDate:n,locale:i=typeof navigator!="undefined"?navigator.language:"en-US",format:l,onChange:u}=e,d=(Ro=e.weekStartsOn)!=null?Ro:Ua(i),c=v((Io=e.accentColor)!=null?Io:"primary","accentColor"),h=v((zo=e.placement)!=null?zo:"bottom-start"),f=v((Ao=e.value)!=null?Ao:t==="range"?[null,null]:null),g=(()=>{let C=f.get(),D=t==="range"?C==null?void 0:C[0]:C;return D instanceof Date?D:new Date})(),b=v(g.getFullYear(),"viewYear"),y=v(g.getMonth(),"viewMonth"),p=v(Y(g),"focused"),w=v(null,"hovered"),E=v(g.getHours(),"hour"),k=v(g.getMinutes(),"minute"),_=new Intl.DateTimeFormat(i,V({dateStyle:"medium"},r?{timeStyle:"short"}:{})),M=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),P=new Intl.DateTimeFormat(i,{weekday:"short"}),L=new Intl.DateTimeFormat(i,{dateStyle:"full"}),B=C=>C?_.format(C):"",z=C=>{if(l)return l(C);if(t==="range"){let[D,O]=C!=null?C:[null,null];return D?`${B(D)} \u2013 ${B(O)}`:""}return B(C)},K=Array.from({length:7},(C,D)=>P.format(new Date(2023,0,1+(D+d)%7))),Z=C=>!!o&&Y(C)<Y(o)||!!a&&Y(C)>Y(a)||!!n&&n(C),H=C=>{if(!r)return Y(C);let D=Y(C);return D.setHours(E.get(),k.get(),0,0),D},te=(C,D)=>{var $;if(Z(C))return;if(t==="single"){f.set(H(C)),r||Bt(D);return}let[O,R]=($=f.get())!=null?$:[null,null];!O||O&&R?f.set([H(C),null]):Y(C)<Y(O)?(f.set([H(C),H(O)]),r||Bt(D)):(f.set([O,H(C)]),r||Bt(D))},X=()=>{var C;if(r)if(t==="single"){let D=f.get();D&&f.set(H(D))}else{let[D,O]=(C=f.get())!=null?C:[null,null];f.set([D&&H(D),O&&H(O)])}},I=(C,D)=>{var Ie;if(t!=="range")return!1;let[O,R]=(Ie=f.get(D))!=null?Ie:[null,null],$=R!=null?R:w.get(D);if(!O||!$)return!1;let A=Y(O)<=Y($)?O:$,ne=Y(O)<=Y($)?$:O,Q=Y(C);return Q>=Y(A)&&Q<=Y(ne)},F=(C,D)=>{let O=f.get(D);if(t==="range"){let[R,$]=O!=null?O:[null,null];return at(C,R)||at(C,$)}return at(C,O)},q=C=>{b.set(C.getFullYear()),y.set(C.getMonth())},le=C=>{let D=Eo(new Date(b.get(),y.get(),1),C);q(D)},J=C=>b.set(b.get()+C),re=C=>{var O;let D=(O=C==null?void 0:C.getRoot())==null?void 0:O.domElement;setTimeout(()=>{var R;(R=D==null?void 0:D.querySelector(`[data-date="${_o(p.get())}"]`))==null||R.focus()},0)},ce=gn(),{show:Nt,hide:Bt,anchorPartial:$o}=fe({kind:"datePicker",open:!1,placement:h,content:ce}),fn=V({type:"text",readonly:!0,value:C=>z(f.get(C)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(C,D)=>{Vt(D)},onFocus:(C,D)=>{Vt(D)},onKeyDown:(C,D)=>{let O=C.key;(O==="ArrowDown"||O==="Enter")&&(C.preventDefault(),Vt(D))}},_e("datePicker",Ga,{selection:f,viewYear:b,viewMonth:y,focused:p,hovered:w,hour:E,minute:k,onChange:u}));function Vt(C){var O;let D=(O=pn())!=null?O:new Date;p.set(Y(D)),q(D),Nt(C),re(C)}function pn(){var D;let C=f.get();return t==="range"?(D=C==null?void 0:C[0])!=null?D:null:C!=null?C:null}return j($o,fn),$o;function gn(){let C=(A,ne,Q)=>({button:A,type:"button",ariaLabel:ne,onClick:Q,style:Za()}),D={div:[C("\xAB","Previous year",()=>J(-1)),C("\u2039","Previous month",()=>le(-1)),{div:A=>M.format(new Date(b.get(A),y.get(A),1)),ariaLive:"polite",_doctorDisable:"inline-typography",style:{flex:"1",textAlign:"center",fontWeight:"bold",fontSize:A=>x(A)}},C("\u203A","Next month",()=>le(1)),C("\xBB","Next year",()=>J(1))],style:{display:"flex",alignItems:"center",gap:m(1),marginBottom:m(2)}},O={div:K.map((A,ne)=>({div:A,_doctorDisable:"inline-typography",style:{textAlign:"center",fontSize:Q=>x(Q,"decrease-1"),fontWeight:"bold",color:Q=>s(Q,"shift-7"),paddingBlock:m(1)},_key:ne})),role:"row",style:rn()},R={div:A=>yn(A),role:"grid",ariaLabel:"Calendar",onKeyDown:xn,onMouseLeave:()=>t==="range"&&w.set(null),style:{display:"flex",flexDirection:"column",gap:m(.5)}},$=[D,O,R];return r&&$.push(vn()),$.push(Sn()),{div:$,role:"dialog",ariaModal:"false",dataTone:"shift-14",style:{minWidth:m(70),padding:m(3),borderRadius:A=>m(S(A)*2),backgroundColor:A=>s(A,"inherit"),color:A=>s(A,"text"),outline:A=>`1px solid ${s(A,"border-strong")}`,outlineOffset:"-1px",boxShadow:N("medium")}}}function yn(C){let D=new Date(b.get(C),y.get(C),1),O=y.get(C),R=To(D,d),$=[];for(let A=0;A<6;A++){let ne=[];for(let Q=0;Q<7;Q++){let Ie=Re(R,A*7+Q);ne.push(bn(Ie,O,C))}$.push({div:ne,role:"row",style:rn(),_key:A})}return $}function bn(C,D,O){let R=Z(C),$=F(C,O),A=I(C,O),ne=C.getMonth()!==D,Q=at(C,p.get(O)),Ie=at(C,new Date);return{button:String(C.getDate()),type:"button",role:"gridcell",tabIndex:Q?0:-1,ariaSelected:$,ariaDisabled:R,disabled:R,ariaLabel:L.format(C),dataDate:_o(C),onClick:(W,wn)=>te(C,wn),onMouseEnter:()=>t==="range"&&w.set(C),style:{appearance:"none",border:"none",cursor:R?"not-allowed":"pointer",aspectRatio:"1",borderRadius:m(1),fontSize:W=>x(W),fontFamily:"inherit",opacity:R?.35:ne?.5:1,backgroundColor:W=>$?s(W,"shift-7",c.get(W)):A?s(W,"hover",c.get(W)):"transparent",color:W=>$?s(W,"shift-0",c.get(W)):s(W,"text"),outline:Ie?W=>`1px solid ${s(W,"shift-6",c.get(W))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:W=>$?s(W,"shift-7",c.get(W)):s(W,"shift-3",c.get(W))},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:W=>T(W,c.get(W))}},_key:_o(C)}}function vn(){let C=(D,O,R)=>({select:Array.from({length:D},($,A)=>({option:String(A).padStart(2,"0"),value:String(A),selected:ne=>O.get(ne)===A,_key:A})),ariaLabel:R,onChange:$=>{O.set(Number($.target.value)),X()},style:Xa()});return{div:[C(24,E,"Hour"),{span:":",_doctorDisable:"inline-typography",style:{fontWeight:"bold"}},C(60,k,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:m(1),marginTop:m(3)}}}function Sn(){let C=(D,O)=>({button:D,type:"button",onClick:(R,$)=>O($),style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:R=>x(R,"decrease-1"),color:R=>s(R,"muted",c.get(R)),padding:m(1)}});return{div:[C("Today",D=>{let O=new Date;p.set(Y(O)),q(O),re(D)}),C("Clear",()=>{f.set(t==="range"?[null,null]:null),w.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:m(2),paddingTop:m(2),borderTop:D=>`1px solid ${s(D,"border")}`}}}function xn(C,D){let O=C,R=p.get(),$=null;switch(O.key){case"ArrowLeft":$=Re(R,-1);break;case"ArrowRight":$=Re(R,1);break;case"ArrowUp":$=Re(R,-7);break;case"ArrowDown":$=Re(R,7);break;case"Home":$=To(R,d);break;case"End":$=Re(To(R,d),6);break;case"PageUp":$=Eo(R,O.shiftKey?-12:-1);break;case"PageDown":$=Eo(R,O.shiftKey?12:1);break;case"Enter":case" ":O.preventDefault(),te(R,D);return;default:return}O.preventDefault(),p.set($),q($),re(D)}}function rn(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:m(.5)}}function Za(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>x(e),color:e=>s(e,"muted"),width:m(7),height:m(7),borderRadius:m(1),"&:hover":{backgroundColor:e=>s(e,"shift-3")}}}function Xa(){return{fontFamily:"inherit",fontSize:e=>x(e),padding:m(1),borderRadius:m(1),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${s(e,"border-strong")}`,backgroundColor:e=>s(e,"inherit"),color:e=>s(e,"text")}}function Ja(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:`minmax(${m(24)}, max-content) 1fr`,columnGap:m(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>x(o,"inherit"),color:o=>s(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o))}}}}function Qa(e={}){var a,n;let{duration:t=240}=e,r=v((a=e.color)!=null?a:"neutral","color"),o=v((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:i=>{i.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},_doctorDisable:"inline-typography",style:{fontSize:i=>x(i,"inherit"),color:i=>s(i,"text",r.get(i)),backgroundColor:i=>s(i,"inherit",r.get(i)),overflow:"hidden","& > summary":{backgroundColor:i=>s(i,"shift-2",r.get(i)),color:i=>s(i,"shift-10",r.get(i)),fontSize:i=>x(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:m(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:i=>m(S(i)*4),height:m(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:m(2),height:m(2),flexShrink:0,marginTop:m(-.5),borderInlineEnd:i=>`${m(.5)} solid ${s(i,"shift-9",r.get(i))}`,borderBottom:i=>`${m(.5)} solid ${s(i,"shift-9",r.get(i))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>s(i,"shift-3",r.get(i))},"& > summary:focus-visible":{borderRadius:i=>m(S(i)*2),boxShadow:i=>T(i,o.get(i))},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:i=>m(S(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:"none",opacity:1,paddingTop:i=>m(S(i)*1),paddingBottom:i=>m(S(i)*3)}}}}var lt=0;function zt(){lt++,lt===1&&(document.body.style.overflow="hidden")}function Ge(){lt=Math.max(0,lt-1),lt===0&&(document.body.style.overflow="")}var nn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function el(e,t){let{state:r}=t,o=null,a=!1,n=!1,i=null,l=e.domElement;l.setAttribute("aria-modal","true");let u=()=>{a=!1,typeof l.close=="function"&&l.close(),l.style.visibility="hidden",l.style.pointerEvents="none",n&&(Ge(),n=!1),o==null||o.focus(),o=null},d=g=>{if(g.key!=="Tab")return;let b=Array.from(l.querySelectorAll(nn)).filter(w=>!w.closest("[aria-hidden='true']")&&w.offsetParent!==null);if(!b.length){g.preventDefault();return}let y=b[0],p=b[b.length-1];g.shiftKey?(document.activeElement===y||document.activeElement===l)&&(g.preventDefault(),p.focus()):document.activeElement===p&&(g.preventDefault(),y.focus())},c=g=>{g.preventDefault(),r.set(!1)};l.addEventListener("cancel",c);let h=g=>{g?(a=!1,i&&(clearTimeout(i),i=null),o=document.activeElement,l.style.visibility="visible",l.style.pointerEvents="auto",typeof l.showModal=="function"&&!l.open&&l.showModal(),n||(zt(),n=!0),l.addEventListener("keydown",d),requestAnimationFrame(()=>{l.style.opacity="1";let b=l.querySelector(nn);b==null||b.focus()})):(a=!0,l.style.opacity="0",l.removeEventListener("keydown",d),i=setTimeout(()=>{i=null,a&&u()},350))};h(r.get());let f=r.addListener(h);return{requestClose:()=>r.set(!1),onTransitionEnd:g=>{a&&g.target===l&&g.propertyName==="opacity"&&u()},update(g){g.state!==r&&(f(),r=g.state,f=r.addListener(h))},destroy(){i&&(clearTimeout(i),i=null),f(),l.removeEventListener("cancel",c),n&&(Ge(),n=!1),l.removeEventListener("keydown",d),o==null||o.focus(),o=null}}}function tl(e={}){let{color:t="neutral",open:r=!1,labelledBy:o,describedBy:a}=e,n=v(r);return ie(V({_onInsert:i=>{i.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')}},_e("dialog",el,{state:n})),{ariaLabelledby:o,ariaDescribedby:a,onClick:(i,l)=>{var c;if(i.target!==l.domElement)return;let u=l.domElement.getBoundingClientRect();i.clientX>=u.left&&i.clientX<=u.right&&i.clientY>=u.top&&i.clientY<=u.bottom||(c=l.getBehavior("dialog"))==null||c.requestClose()},onTransitionEnd:(i,l)=>{var u;return(u=l.getBehavior("dialog"))==null?void 0:u.onTransitionEnd(i)},style:{opacity:"0",visibility:"hidden",pointerEvents:"none",transition:"opacity 200ms ease",fontSize:i=>x(i,"inherit"),color:i=>s(i,"shift-10",t),backgroundColor:i=>s(i,"inherit",t),border:"none",borderRadius:i=>m(S(i)*2),padding:i=>m(S(i)*3),boxShadow:N("high"),"&::backdrop":{backgroundColor:i=>s(i,"shift-2","neutral"),opacity:.75}}})}function ol(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:m(2),fontSize:o=>x(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"text",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>s(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>s(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Do={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},an={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},st=e=>e==="left"||e==="right";function ln(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function rl(e={}){let{color:t="neutral",open:r=!1,placement:o="end",size:a}=e,n=v(r),i=o==="start"||o==="end",l=ln(o,!1),u=st(l)?m(80):m(64),d=a!=null?a:u;return{_onInsert:c=>{c.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(c,h)=>{c.target===h.domElement&&n.set(!1)},_onMount:c=>{let h=c.domElement;h.setAttribute("aria-modal","true");let f=P=>{P.preventDefault(),n.set(!1)};h.addEventListener("cancel",f);let g=i&&(h.ownerDocument.documentElement.dir==="rtl"||h.ownerDocument.dir==="rtl"),b=ln(o,g);i&&(h.style.transform=Do[b],h.style.margin=an[b],h.style.width=st(b)?d:"100dvw",h.style.height=st(b)?"100dvh":d);let y=!1,p=!1,w=null,E=()=>{w=null,y&&(y=!1,typeof h.close=="function"&&h.close(),h.style.visibility="hidden",h.style.pointerEvents="none",p&&(Ge(),p=!1))},k=P=>{P.target===h&&P.propertyName==="transform"&&E()};h.addEventListener("transitionend",k);let _=P=>{P?(y=!1,h.style.visibility="visible",h.style.pointerEvents="auto",typeof h.showModal=="function"&&h.showModal(),p||(zt(),p=!0),requestAnimationFrame(()=>{h.style.transform="translate(0, 0)"})):(y=!0,h.style.transform=Do[b],w=setTimeout(E,350))};_(n.get());let M=n.addListener(_);c.addHook("Remove",()=>{w&&(clearTimeout(w),w=null),M(),h.removeEventListener("cancel",f),h.removeEventListener("transitionend",k),p&&(Ge(),p=!1)})},style:{transform:Do[l],visibility:"hidden",pointerEvents:"none",transition:"transform 0.25s ease",fontSize:c=>x(c,"inherit"),color:c=>s(c,"shift-10",t),backgroundColor:c=>s(c,"inherit",t),border:"none",padding:c=>m(S(c)*3),margin:an[l],width:st(l)?d:"100dvw",height:st(l)?"100dvh":d,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:N("high"),"&::backdrop":{backgroundColor:c=>s(c,"shift-2","neutral"),opacity:.75}}}}function nl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>x(o,"inherit"),fontStyle:"italic",color:o=>s(o,"shift-10",t.get(o))}}}function il(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:m(3),paddingBlock:m(12),paddingInline:m(6),textAlign:"center",color:o=>s(o,"muted",t.get(o)),"& > :first-child":{color:o=>s(o,"shift-5",t.get(o)),opacity:.9},"& > :nth-child(2)":{color:o=>s(o,"text",t.get(o))}}}}function al(e={}){return{_onError:(t,r,o)=>{var n,i;(n=e.onError)==null||n.call(e,r);let a=typeof e.fallback=="function"?e.fallback(r,o):(i=e.fallback)!=null?i:{div:"An error occurred."};t.children.update([a])}}}var ll={small:8,medium:10,large:14};function sl(e={}){var o,a;let t=v((o=e.color)!=null?o:"primary","color"),r=m(ll[(a=e.size)!=null?a:"medium"]);return{_onInsert:n=>{n.tagName!=="button"&&console.warn('"fab" patch must use button tag')},_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"],style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:r,height:r,borderRadius:"50%",fontSize:n=>x(n,"inherit"),backgroundColor:n=>s(n,"shift-13",t.get(n)),color:n=>s(n,"shift-0","neutral"),boxShadow:N("low"),transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:n=>s(n,"shift-14",t.get(n)),boxShadow:N("medium")},"&:active:not([disabled])":{backgroundColor:n=>s(n,"shift-15",t.get(n)),boxShadow:N("low")},"&:focus-visible":{boxShadow:n=>`${N("medium")}, ${T(n,t.get(n))}`},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function cl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:m(2),marginInline:0,marginTop:m(3),marginBottom:m(3),color:o=>s(o,"text",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:m(2)},"& figcaption":{fontSize:o=>x(o,"decrease-1"),color:o=>s(o,"muted",t.get(o)),lineHeight:1.45}}}}function ml(e={}){var a;let{layout:t="horizontal"}=e,r=v((a=e.color)!=null?a:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},_doctorDisable:"inline-typography",style:{margin:0,paddingInline:n=>m(S(n)*3),paddingBlock:n=>m(S(n)*3),border:"none",borderRadius:n=>m(S(n)*2),fontSize:n=>x(n,"inherit"),backgroundColor:n=>s(n,"inherit",r.get(n)),color:n=>s(n,"text",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:m(4),rowGap:m(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>x(n,"inherit"),fontWeight:600,paddingBlock:n=>m(S(n)*1),borderRadius:n=>m(S(n)*2),color:n=>s(n,"text",r.get(n)),backgroundColor:n=>s(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?0:m(S(n)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${m(2)} * -1)`,fontSize:n=>x(n,"decrease-1"),color:n=>s(n,"text",r.get(n))}}}}function ul(e={}){let{columns:t=1,gap:r=4,align:o}=e;return{style:V({display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, minmax(0, 1fr))`:t,gap:a=>m(S(a)*r)},o?{alignItems:o}:{})}}var hl={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function dl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>s(o,"shift-11",t.get(o)),marginTop:0,marginBottom:m(2),fontSize:o=>{let a=hl[o.elementNode.tagName]||"inherit";return x(o,a)}}}}function fl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},dataTone:"shift-3",style:{border:0,height:"1px",marginInline:0,marginTop:m(3),marginBottom:m(3),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"text",t.get(o))}}}function pl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:m(4),height:m(4),flexShrink:"0",fontSize:o=>x(o),backgroundColor:"transparent",color:o=>s(o,"text",t.get(o))}}}function gl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:m(2),backgroundColor:o=>s(o,"inherit",t.get(o)),color:o=>s(o,"text",t.get(o))}}}function yl(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>x(n,"inherit"),color:n=>s(n,"text",t.get(n)),display:"inline-flex",position:"relative",width:m(6),height:m(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:m(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"border-strong",t.get(n))}`,color:n=>s(n,"text",t.get(n)),width:m(4),height:m(4)},"&:hover::before":{backgroundColor:n=>s(n,"hover",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`,backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${m(.5)} solid ${s(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`,backgroundColor:n=>s(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:m(1.5),boxShadow:n=>T(n,r.get(n))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>s(n,"shift-4","neutral"),pointerEvents:"none"}}}}function bl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{type:"color",_onSchedule:(o,a)=>{o.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o)),paddingBlock:o=>m(S(o)*1),paddingInline:o=>m(S(o)*1),blockSize:o=>m(6+S(o)*2),inlineSize:o=>m(6+S(o)*2),backgroundColor:"transparent",transition:"box-shadow 140ms ease",borderRadius:o=>m(S(o)*1.5),"&:focus-visible":{boxShadow:o=>T(o,t.get(o))},"&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>m(S(o)*1.5)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"border-strong","neutral")}`}}}}function vl(e={}){var a,n;let{mode:t="datetime-local"}=e,r=v((a=e.color)!=null?a:"neutral","color"),o=v((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onSchedule:(i,l)=>{i.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),l.type=t},style:{fontFamily:"inherit",fontSize:i=>x(i,"inherit"),lineHeight:"inherit",color:i=>s(i,"text",r.get(i)),backgroundColor:i=>s(i,"inherit",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"border-strong",r.get(i))}`,borderRadius:i=>m(S(i)*1.5),paddingInline:i=>m(S(i)*3),height:i=>m(6+S(i)*2),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${s(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>s(i,"muted","neutral"),backgroundColor:i=>s(i,"shift-2","neutral"),outline:i=>`1px solid ${s(i,"border-strong","neutral")}`},"&:invalid":{outline:i=>`${m(.5)} solid ${s(i,"shift-6","error")}`}}}}function Sl(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"file",_onSchedule:(n,i)=>{n.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),i.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>x(n,"inherit"),lineHeight:"inherit",color:n=>s(n,"text",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"border-strong",t.get(n))}`,borderRadius:n=>m(S(n)*1.5),height:n=>m(6+S(n)*2),paddingInline:n=>m(S(n)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-file-upload-button":{marginTop:n=>m(S(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:m(1),height:m(6),paddingInline:m(2),cursor:"pointer",color:n=>s(n,"shift-11",t.get(n)),backgroundColor:n=>s(n,"surface",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true])":{outline:n=>`1px solid ${s(n,"shift-5",r.get(n))}`},"&:focus-visible":{boxShadow:n=>T(n,r.get(n))},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>s(n,"muted","neutral"),outline:n=>`1px solid ${s(n,"border-strong","neutral")}`,backgroundColor:n=>s(n,"surface","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>s(n,"muted","neutral"),backgroundColor:n=>s(n,"shift-3","neutral")}}}}function xl(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"number",_onSchedule:(n,i)=>{n.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),i.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:m(10),paddingInlineStart:n=>m(S(n)*3),paddingInlineEnd:n=>m(S(n)*1.5),paddingBlock:n=>m(S(n)*1),borderRadius:n=>m(S(n)*1.5),fontSize:n=>x(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"border-strong",t.get(n))}`,color:n=>s(n,"text",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true])":{outline:n=>`1px solid ${s(n,"shift-5",r.get(n))}`},"&:focus-visible":{boxShadow:n=>T(n,r.get(n))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"border-strong","neutral")}`,color:n=>s(n,"muted","neutral")}}}}function wl(){return{role:"group",ariaLabel:"One-time password",style:{display:"flex",alignItems:"center",gap:m(2),"& > *":{minWidth:`${m(9)}!important`}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=i=>{let l=r(),u=i.target,d=l.indexOf(u);u.value&&d<l.length-1&&l[d+1].focus()},a=i=>{let l=r(),u=i.target,d=l.indexOf(u);i.key==="Backspace"&&!u.value&&d>0&&l[d-1].focus(),i.key==="ArrowLeft"&&d>0&&l[d-1].focus(),i.key==="ArrowRight"&&d<l.length-1&&l[d+1].focus()},n=i=>{var f,g,b;i.preventDefault();let l=(g=(f=i.clipboardData)==null?void 0:f.getData("text"))!=null?g:"",u=r(),d=u.indexOf(i.target),c=d===-1?0:d;[...l].forEach((y,p)=>{u[c+p]&&(u[c+p].value=y)});let h=Math.min(c+l.length-1,u.length-1);(b=u[h])==null||b.focus()};t.addEventListener("input",o),t.addEventListener("keydown",a),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",a),t.removeEventListener("paste",n)})}}}var kl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>',Cl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>';function El(e={}){var a,n;let t=v((a=e.color)!=null?a:"neutral","color"),r=v((n=e.accentColor)!=null?n:"primary","accentColor"),o=v(!1);return{_onInsert:i=>{i.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onInit:i=>{let l={input:null,type:d=>o.get(d)?"text":"password",ariaLabel:"Password",autocomplete:"current-password",style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}},u={button:d=>Te(o.get(d)?Cl:kl),type:"button",ariaLabel:d=>o.get(d)?"Hide password":"Show password",onClick:()=>o.set(!o.get()),style:{background:"none",border:"none",padding:0,margin:0,cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",flexShrink:0,opacity:.6}};i.children.insert(l),i.children.insert(u)},style:{display:"flex",alignItems:"center",gap:i=>m(S(i)*1),paddingBlock:i=>m(S(i)*1),paddingInline:i=>m(S(i)*3),borderRadius:i=>m(S(i)*1.5),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"border-strong",t.get(i))}`,color:i=>s(i,"text",t.get(i)),backgroundColor:i=>s(i,"inherit",t.get(i)),fontSize:i=>x(i,"inherit"),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not(:has([disabled])):not(:focus-within)":{outline:i=>`1px solid ${s(i,"shift-5",r.get(i))}`},"&:focus-within":{boxShadow:i=>T(i,r.get(i))}}}}function _l(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>x(n,"inherit"),color:n=>s(n,"text",t.get(n)),appearance:"none",display:"inline-flex",position:"relative",width:m(6),height:m(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"border-strong",t.get(n))}`,color:n=>s(n,"text",t.get(n)),width:m(4),height:m(4)},"&:hover::before":{backgroundColor:n=>s(n,"hover",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${s(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>s(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>s(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",boxShadow:n=>T(n,r.get(n))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>s(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Tl(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:m(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:m(1.5),borderRadius:m(999),backgroundColor:n=>s(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:m(4),height:m(4),borderRadius:m(999),border:"none",marginTop:`calc((${m(1.5)} - ${m(4)}) / 2)`,backgroundColor:n=>s(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>s(n,"shift-10",r.get(n))},borderRadius:m(2),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:n=>T(n,r.get(n))},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Dl(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"search",_onSchedule:(n,i)=>{n.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),i.type="search"},style:{fontFamily:"inherit",fontSize:n=>x(n,"inherit"),lineHeight:"inherit",color:n=>s(n,"text",t.get(n)),backgroundColor:n=>s(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${s(n,"border-strong",t.get(n))}`,borderRadius:n=>m(S(n)*1.5),minWidth:m(32),paddingInline:n=>m(S(n)*3),paddingBlock:n=>m(S(n)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:n=>s(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true])":{outline:n=>`1px solid ${s(n,"shift-5",r.get(n))}`},"&:focus-visible":{boxShadow:n=>T(n,r.get(n))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"muted","neutral"),backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"border-strong","neutral")}`}}}}function Ml(e={}){var r;let t=v((r=e.accentColor)!=null?r:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>x(o,"inherit"),backgroundColor:o=>s(o,"inherit"),color:o=>s(o,"text"),appearance:"none",position:"relative",display:"inline-flex",width:m(9),height:m(6),cursor:"pointer",margin:"0",paddingBlock:m(1),transition:"box-shadow 140ms ease",borderRadius:m(999),"&:focus-visible":{boxShadow:o=>T(o,t.get(o))},"&:checked":{"&::before":{backgroundColor:o=>s(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${m(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:m(3),height:m(3),borderRadius:m(999),left:m(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>s(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:m(999),display:"inline-block",fontSize:o=>x(o,"inherit"),lineHeight:1,backgroundColor:o=>s(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ol(e={}){var a,n;let{type:t="text"}=e,r=v((a=e.color)!=null?a:"neutral","color"),o=v((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type')},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:m(10),paddingInline:i=>m(S(i)*3),paddingBlock:i=>m(S(i)*1),borderRadius:i=>m(S(i)*1.5),fontSize:i=>x(i,"inherit"),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"border-strong",r.get(i))}`,color:i=>s(i,"text",r.get(i)),backgroundColor:i=>s(i,"inherit",r.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>s(i,"shift-7")},"&:not(:placeholder-shown)":{color:i=>s(i,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${s(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:i=>s(i,"shift-2","neutral"),outline:i=>`1px solid ${s(i,"border-strong","neutral")}`,color:i=>s(i,"muted","neutral")},"&:invalid:not(:placeholder-shown)":{outline:i=>`${m(.5)} solid ${s(i,"shift-6","error")}`},"&[data-status=error]":{outline:i=>`${m(.5)} solid ${s(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${m(.5)} solid ${s(i,"shift-6","warning")}`}}}}function Pl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),paddingBlock:m(.5),paddingInline:m(1.5),borderRadius:m(1),outline:o=>`1px solid ${s(o,"border-strong",t.get(o))}`}}}function Ll(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:m(2),fontSize:n=>x(n,"inherit"),color:n=>s(n,"text",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>s(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"muted","neutral")}}}}function $l(e={}){var o,a;let t=v((o=e.color)!=null?o:"primary","color"),r=v((a=e.accentColor)!=null?a:"secondary","accentColor");return{_onInsert:n=>{n.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>x(n,"inherit"),backgroundColor:n=>s(n),color:n=>s(n,"shift-13",t.get(n)),textDecoration:"none","&:visited":{color:n=>s(n,"shift-13",r.get(n))},"&:hover:not([disabled])":{color:n=>s(n,"shift-14",t.get(n)),textDecoration:"underline"},borderRadius:m(1),outline:"none",transition:"color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:n=>T(n,r.get(n))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>s(n,"muted","neutral")}}}}var Rl={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}},Il={small:.5,medium:1,large:1.5};function zl(e={}){var l,u,d;let t=(l=e.variant)!=null?l:"outline",r=v((u=e.color)!=null?u:t==="ghost"?"neutral":"primary","color"),o=(d=e.size)!=null?d:"medium",a=We[o];if(t==="ghost"){let c=Il[o];return{_onInsert:h=>{h.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:h=>x(h,a),textDecoration:"none",paddingBlock:h=>m(S(h)*c),paddingInline:h=>m(S(h)*c),borderRadius:h=>m(S(h)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:h=>m(S(h)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:h=>s(h,"text",r.get(h)),"&:hover:not([aria-disabled=true])":{color:h=>s(h,"text",r.get(h)),backgroundColor:h=>s(h,"hover",r.get(h)),textDecoration:"none"},"&:active:not([aria-disabled=true])":{color:h=>s(h,"text",r.get(h)),backgroundColor:h=>s(h,"increase-2",r.get(h))},"&:focus-visible":{boxShadow:h=>T(h,r.get(h))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:h=>s(h,"border-strong","neutral")}}}}let n=t==="solid",i=Rl[o];return ie(V({_onInsert:c=>{c.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')}},n?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{fontSize:c=>x(c,a),textDecoration:"none",paddingBlock:c=>m(S(c)*i.block),paddingInline:c=>m(S(c)*i.inline),borderRadius:c=>m(S(c)*1.5),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:c=>m(S(c)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:n?"none":c=>`1px solid ${s(c,"border-strong",r.get(c))}`,color:c=>n?s(c,"shift-0","neutral"):s(c,"shift-13",r.get(c)),backgroundColor:c=>n?s(c,"shift-13",r.get(c)):s(c,"inherit",r.get(c)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([aria-disabled=true])":{textDecoration:"none",color:c=>n?s(c,"shift-0","neutral"):s(c,"shift-14",r.get(c)),backgroundColor:c=>n?s(c,"shift-14",r.get(c)):s(c,"hover",r.get(c))},"&:active:not([aria-disabled=true])":{backgroundColor:c=>n?s(c,"shift-15",r.get(c)):s(c,"increase-2",r.get(c))},"&:focus-visible":{boxShadow:c=>T(c,r.get(c))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:c=>s(c,"shift-2","neutral"),outline:c=>`1px solid ${s(c,"border-strong","neutral")}`,color:c=>s(c,"muted","neutral")}}})}function Al(e={}){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Nl(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:r=>m(S(r)*2),paddingBlock:r=>m(t?1:S(r)*2),paddingInline:r=>m(S(r)*3),fontSize:r=>x(r,"inherit"),color:r=>s(r,"text")}}}function Bl(e={}){var a,n;let t=v((a=e.color)!=null?a:"neutral","color"),r=(n=e.accentColor)!=null?n:"primary",{dense:o=!1}=e;return{style:{cursor:"pointer",appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:i=>m(S(i)*2),paddingBlock:i=>m(o?1:S(i)*2),paddingInline:i=>m(S(i)*3),fontSize:i=>x(i,"inherit"),color:i=>s(i,"text",t.get(i)),borderRadius:i=>m(S(i)*1.5),transition:"background-color 150ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{backgroundColor:i=>s(i,"hover",t.get(i))},"&:active:not([disabled])":{backgroundColor:i=>s(i,"increase-2",t.get(i))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:i=>s(i,"shift-3",r),color:i=>s(i,"shift-12",r)},"&:focus-visible":{boxShadow:i=>T(i,r)},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Vl(e={}){var r;let t=v((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),height:m(6),borderRadius:m(1),paddingInline:m(1.5)}}}function Hl(e={items:[]}){var i;let{items:t=[],selectable:r=!0,color:o="neutral",accentColor:a="primary"}=e,n=v((i=e.activeKey)!=null?i:null);return{role:"menu",dataTone:"shift-0",_onSchedule:(l,u)=>{if(t.length===0)return;let d=l.nodeId,c=t.map((h,f)=>{var b;let g=(b=h.key)!=null?b:f;return ie(V({button:typeof h.label=="string"?[{span:h.label}]:[h.label],_key:g,type:"button",id:`menuitem${d}${g}`,role:"menuitem"},r?{ariaCurrent:y=>n.get(y)===g||void 0}:{}),{onClick:()=>{var y;r&&n.set(g),(y=h.onClick)==null||y.call(h)},onKeyDown:y=>{var _;let p=y.key;if(p==="Enter"||p===" "){y.preventDefault(),y.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(p))return;y.preventDefault();let w=t.map((M,P)=>{var L;return(L=M.key)!=null?L:P}),E=w.indexOf(g),k=E;p==="ArrowDown"?k=(E+1)%w.length:p==="ArrowUp"?k=(E-1+w.length)%w.length:p==="Home"?k=0:p==="End"&&(k=w.length-1),(_=document.getElementById(`menuitem${d}${w[k]}`))==null||_.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:m(2),width:"100%",fontSize:y=>x(y,"inherit"),height:y=>m(6+S(y)*2),paddingInline:y=>m(S(y)*3),border:"none",outline:"none",color:y=>s(y,"text",o),backgroundColor:y=>s(y,"inherit",o),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:y=>s(y,"hover",o)},"&[aria-current=true]":{backgroundColor:y=>s(y,"shift-3",a),color:y=>s(y,"shift-13",a)},"&:focus-visible":{boxShadow:y=>T(y,a)}}})});u[l.tagName]=c},style:{display:"flex",flexDirection:"column",paddingBlock:l=>m(S(l)*2),paddingInline:l=>m(S(l)*2),fontSize:l=>x(l,"inherit"),backgroundColor:l=>s(l,"inherit",o),color:l=>s(l,"text",o),borderRadius:l=>m(S(l)*2),outline:l=>`1px solid ${s(l,"border-strong",o)}`,outlineOffset:"-1px",boxShadow:N("medium")}}}var Mo=e=>!!e&&typeof e.get=="function"&&e._isState===!0,pe=e=>{let t={},r=[];for(let o in e){let a=e[o];o==="x"?r.push(`translateX(${typeof a=="number"?`${a}px`:a})`):o==="y"?r.push(`translateY(${typeof a=="number"?`${a}px`:a})`):o==="scale"?r.push(`scale(${a})`):o==="rotate"?r.push(`rotate(${typeof a=="number"?`${a}deg`:a})`):t[o]=a}return r.length&&(t.transform=r.join(" ")),t};function sn(){if(typeof matchMedia!="function")return!1;try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch(e){return!1}}function jl(e={}){var i,l,u,d;let{initial:t,animate:r,exit:o,transition:a={}}=e,n={duration:(i=a.duration)!=null?i:300,delay:(l=a.delay)!=null?l:0,easing:(u=a.easing)!=null?u:"ease",iterations:(d=a.iterations)!=null?d:1,fill:"both"};return{_onMount:c=>{let h=c.domElement;if(!h||typeof h.animate!="function")return;let f=Mo(r)?r.get():r;if(sn()){if(f?Object.assign(h.style,pe(f)):t&&Object.assign(h.style,pe(t)),Mo(r)){let g=r.addListener(b=>{Object.assign(h.style,pe(b))});c.setMetadata("motionRelease",g)}return}if(f?h.animate(t?[pe(t),pe(f)]:[pe(f)],n):t&&Object.assign(h.style,pe(t)),Mo(r)){let g=r.addListener(b=>{h.animate([pe(b)],n)});c.setMetadata("motionRelease",g)}},_onBeforeRemove:(c,h)=>{let f=c.domElement;if(!f||!o||typeof f.animate!="function")return h();if(sn())return Object.assign(f.style,pe(o)),h();f.animate([pe(o)],n).finished.then(h,h)},_onRemove:c=>{let h=c.getMetadata("motionRelease");h==null||h()}}}function Fl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>x(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:m(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Wl(e,t){if(t<=7)return Array.from({length:t},(n,i)=>i+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),a=Math.min(t-1,e+1);for(let n=o;n<=a;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function Kl(e){var l;let{total:t,color:r="neutral",accentColor:o="primary"}=e,a=v((l=e.value)!=null?l:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>m(6+S(u)*2),height:u=>m(6+S(u)*2),paddingInline:u=>m(S(u)*2),borderRadius:u=>m(S(u)*1.5),border:"none",cursor:"pointer",fontSize:u=>x(u,"inherit"),backgroundColor:"transparent",color:u=>s(u,"shift-13",r),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled])":{color:u=>s(u,"shift-13",r),backgroundColor:u=>s(u,"hover",r)},"&:focus-visible":{boxShadow:u=>T(u,o)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},i=ie(V({},n),{backgroundColor:u=>s(u,"shift-13",o),color:u=>s(u,"shift-0","neutral"),fontWeight:"bold",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>s(u,"shift-13",o)}});return{role:"navigation",ariaLabel:"Pagination",_doctorDisable:"inline-typography",_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let d={div:c=>{let h=a.get(c),f=[];f.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:h<=1,onClick:()=>h>1&&a.set(h-1),style:n});let g=0;for(let b of Wl(h,t))if(b==="...")f.push({span:"\u2026",_key:`ellipsis-${g++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:y=>m(S(y)*2),color:y=>s(y,"shift-7",r)}});else{let y=b===h;f.push({button:String(b),_key:`page-${b}`,type:"button",ariaLabel:`Page ${b}`,ariaCurrent:y?"page":void 0,disabled:y,onClick:()=>a.set(b),style:y?i:n})}return f.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:h>=t,onClick:()=>h<t&&a.set(h+1),style:n}),f},style:{display:"flex",alignItems:"center",gap:m(1)}};u.children.insert(d)},style:{display:"inline-flex"}}}function ql(e={}){var a;let{padding:t=4,divider:r=!1}=e,o=v((a=e.color)!=null?a:"neutral","color");return{style:V({padding:n=>m(S(n)*t)},r?{borderBottom:n=>`1px solid ${s(n,"border",o.get(n))}`}:{})}}function Ul(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Gl(e){var h;let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,a=v(t),n=v(r),{show:i,hide:l,anchorPartial:u}=fe({kind:"popover",open:a,placement:n,content:e.content,keepOpenOnContentHover:o==="hover"}),d={role:"dialog",dataTone:"shift-14",style:{backgroundColor:f=>s(f,"inherit"),color:f=>s(f,"text"),borderRadius:f=>m(S(f)*2),outline:f=>`1px solid ${s(f,"border-strong")}`,outlineOffset:"-1px",boxShadow:N("medium")}};return(h=e.content).$||(h.$=[]),e.content.$.push(d),j(u,{ariaHaspopup:"dialog",ariaExpanded:f=>a.get(f),ariaControls:f=>f!=null&&f.elementNode?ke("popover",f.elementNode):void 0,onMouseEnter:(f,g)=>o==="hover"&&i(g),onMouseLeave:(f,g)=>o==="hover"&&l(g),onClick:(f,g)=>{o==="click"&&(a.get()?l(g):i(g))},onKeyDown:(f,g)=>{f.key==="Escape"&&a.get()&&l(g)},onFocus:(f,g)=>o==="hover"&&i(g),onBlur:(f,g)=>{let b=f.relatedTarget,p=g.getRoot().domElement.querySelector(`#${ke("popover",g)}`);b&&(p!=null&&p.contains(b))||l(g)}}),u}function Oo(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=m(6),bordered:a=!0}=e,n=v(t),i={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},l=c=>{var h;return(h=i[n.get(c)])!=null?h:i["bottom-end"]},u=c=>c.includes("start")?o:c.includes("end")?"auto":"50%",d=c=>c.includes("end")?o:c.includes("start")?"auto":"50%";return{style:{fontSize:c=>x(c),backgroundColor:c=>s(c),color:c=>s(c,"text",r),position:"relative","&::after":{content:'""',position:"absolute",width:m(1.5),height:m(1.5),backgroundColor:c=>s(c,"inherit",r),borderWidth:a?"1px":0,borderColor:c=>s(c,"border-strong",r),borderTopStyle:c=>{let h=l(c);return h.includes("top")||h.includes("right")?"solid":"none"},borderBottomStyle:c=>{let h=l(c);return h.includes("bottom")||h.includes("left")?"solid":"none"},borderLeftStyle:c=>{let h=l(c);return h.includes("top")||h.includes("left")?"solid":"none"},borderRightStyle:c=>{let h=l(c);return h.includes("bottom")||h.includes("right")?"solid":"none"},top:c=>{let h=l(c);return h.includes("top")?0:h.includes("bottom")?"auto":u(h)},right:c=>{let h=l(c);return h.includes("right")?0:h.includes("left")?"auto":d(h)},bottom:c=>{let h=l(c);return h.includes("bottom")?0:h.includes("top")?"auto":d(h)},left:c=>{let h=l(c);return h.includes("left")?0:h.includes("right")?"auto":u(h)},transform:c=>{let h=l(c),f=h.includes("right")||h.includes("end")&&!h.includes("left")?"50%":"-50%",g=h.includes("bottom")||h.includes("end")&&!h.includes("top")?"50%":"-50%";return`translate(${f},${g}) rotate(45deg)`}}}}}function Yl(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o)),backgroundColor:o=>s(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>m(S(o)*2),paddingInline:o=>m(S(o)*3),borderRadius:o=>m(S(o)*2)}}}function Zl(e={}){var o,a;let t=v((o=e.color)!=null?o:"neutral","color"),r=v((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},dataTone:"shift-3",style:{appearance:"none",width:"100%",height:m(2),border:0,borderRadius:m(999),overflow:"hidden",backgroundColor:n=>s(n,"inherit",t.get(n)),color:n=>s(n,"text",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>s(n,"inherit",t.get(n)),borderRadius:m(999)},"&::-webkit-progress-value":{backgroundColor:n=>s(n,"shift-9",r.get(n)),borderRadius:m(999),transition:"width 220ms ease"}}}}var Xl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',Jl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function Ql(e={}){var u,d;let{max:t=5,readOnly:r=!1,onChange:o}=e,a=(u=e.color)!=null?u:"warning",n=v((d=e.value)!=null?d:0),i=v(0),l=c=>{let h=i.get(c);return h>0?h:n.get(c)};return{role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:m(.5),fontSize:c=>x(c,"increase-1"),cursor:r?"default":"pointer",color:c=>s(c,"muted",a)},_onInit:c=>{for(let h=1;h<=t;h++){let f=h,g=r?{}:{onClick:()=>{let y=f===n.get()?0:f;n.set(y),o==null||o(y),i.set(0)},onMouseEnter:()=>i.set(f),onMouseLeave:()=>i.set(0),onKeyDown:y=>{var k,_;let p=n.get(),w=p;if(y.key==="ArrowRight"||y.key==="ArrowUp")w=Math.min(t,p+1),y.preventDefault();else if(y.key==="ArrowLeft"||y.key==="ArrowDown")w=Math.max(0,p-1),y.preventDefault();else return;n.set(w),o==null||o(w);let E=w>0?w-1:0;(_=(k=c.domElement)==null?void 0:k.children[E])==null||_.focus()}},b=ie(V({button:y=>Te(f<=l(y)?Xl:Jl),_key:f,type:"button",ariaLabel:`${f} star${f>1?"s":""}`},g),{style:{background:"none",border:"none",outline:"none",borderRadius:m(1),padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center",transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:y=>T(y,a)}}});c.children.insert(b)}}}}function es(e={}){var u,d,c;let{size:t=16,thickness:r=.25}=e,o=v((u=e.value)!=null?u:0,"value"),a=v((d=e.color)!=null?d:"primary","color"),n=v((c=e.trackColor)!=null?c:"neutral","trackColor"),i=Math.round((1-r)*100),l=`radial-gradient(circle closest-side, transparent ${i}%, black ${i}%)`;return{role:"progressbar",ariaValuenow:h=>String(Math.round(o.get(h))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:h=>{h.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:m(t),height:m(t),borderRadius:"50%",color:h=>s(h,"shift-9",a.get(h)),background:h=>`conic-gradient(from -90deg, ${s(h,"shift-9",a.get(h))} ${o.get(h)}%, ${s(h,"shift-3",n.get(h))} 0%)`,WebkitMask:l,mask:l}}}function Po(e={}){let{gap:t=4,align:r="center",justify:o,wrap:a=!1}=e;return{style:V(V({display:"flex",alignItems:r,gap:n=>m(S(n)*t)},o?{justifyContent:o}:{}),a?{flexWrap:"wrap"}:{})}}function ts(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{style:{overflow:"auto",color:o=>s(o,"text",t.get(o)),"&::-webkit-scrollbar":{width:m(2),height:m(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>s(o,"shift-5",t.get(o)),borderRadius:m(999),border:`${m(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>s(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${s(o,"shift-5",t.get(o))} transparent`}}}function os(e={items:[]}){var n,i,l;let{items:t=[],color:r="neutral",accentColor:o="primary"}=e,a=v((l=(i=e.value)!=null?i:(n=t[0])==null?void 0:n.key)!=null?l:"");return{role:"radiogroup",_context:{segmented:{value:a}},_onSchedule:(u,d)=>{let c=t.map((h,f)=>{var y;let g=(y=h.key)!=null?y:String(f);return{button:[typeof h.label=="string"?{span:h.label}:h.label],_key:g,type:"button",role:"radio",ariaChecked:p=>a.get(p)===g,onClick:()=>a.set(g),style:{cursor:"pointer",fontSize:p=>x(p,"inherit"),height:m(6),paddingBlock:m(1),paddingInline:m(3),border:"none",borderRadius:m(10),color:p=>s(p,"text",r),backgroundColor:"transparent",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:p=>s(p,"shift-3",r)},"&:active:not([disabled]):not([aria-checked=true])":{backgroundColor:p=>s(p,"increase-2",r)},"&[aria-checked=true]":{backgroundColor:p=>s(p,"shift-0",o),color:p=>s(p,"shift-10",o),boxShadow:N("low")},"&:focus-visible":{boxShadow:p=>T(p,o)},"&[aria-checked=true]:focus-visible":{boxShadow:p=>`${N("low")}, ${T(p,o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}});d[u.tagName]=c},dataTone:"shift-2",style:{display:"inline-flex",paddingBlock:m(1),paddingInline:m(1),gap:m(.5),borderRadius:m(10),backgroundColor:u=>s(u,"inherit",r),color:u=>s(u,"text",r)}}}function rs(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>x(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"text",t),backgroundColor:o=>s(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"border-strong",t)}`,borderRadius:o=>m(S(o)*1.5),paddingBlock:o=>m(S(o)*1),paddingLeft:o=>m(S(o)*3),paddingRight:o=>m(S(o)*5),backgroundImage:o=>{let a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${go(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${m(2)} center`,backgroundSize:`${m(2.5)} ${m(1.5)}`,transition:"outline-color 140ms ease, box-shadow 140ms ease","&:not([multiple])":{height:o=>m(6+S(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`1px solid ${s(o,"shift-5",r)}`},"&:focus-visible":{boxShadow:o=>T(o,r)},"& optgroup":{color:o=>s(o,"shift-11",t)},"& option[disabled]":{color:o=>s(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"muted","neutral"),outline:o=>`1px solid ${s(o,"border-strong","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")}}}}var ns=1e3;function is(e){let t=e.getMetadata("selectBoxTypeahead");return t||(t={buffer:"",timer:null},e.setMetadata("selectBoxTypeahead",t)),t}var cn=(e,t)=>e.trim().toLowerCase().startsWith(t);function as(e){return e?Array.from(e.querySelectorAll("[role=option]")).filter(t=>t.getAttribute("aria-disabled")!=="true"&&!t.hasAttribute("disabled")):[]}function ls(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:a=!1,multiple:n=!1}=e,i=v(e.value),l=v(a),{show:u,hide:d,anchorPartial:c}=fe({kind:"selectBox",open:l,placement:v(r),content:e.content}),h={onClick:(p,w)=>!n&&d(w),dataTone:"shift-14",style:{backgroundColor:p=>s(p,"inherit"),color:p=>s(p,"text"),borderRadius:p=>m(S(p)*2),outline:p=>`1px solid ${s(p,"border-strong")}`,outlineOffset:"-1px",boxShadow:N("medium")}};j(e.content,h);let f={div:p=>{let w=i.get(p),E=Array.isArray(w)?w:[w];return t.filter(_=>E.includes(_.value)).map(_=>({span:_.label,$:[it({color:o,removable:n})],_key:_.value,_onRemove:M=>{let P=i.get(),B=(Array.isArray(P)?P:[P]).filter(z=>z!==_.value);n?i.set(B):i.set(B[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:m(1),flex:1}},g=p=>l.get()?d(p):u(p),b=(p,w)=>{var B,z,K,Z;let E=is(w);E.timer&&clearTimeout(E.timer),E.buffer+=p.toLowerCase(),E.timer=setTimeout(()=>{E.buffer=""},ns);let k=E.buffer.length>1&&new Set(E.buffer).size===1,_=k?E.buffer[0]:E.buffer;if(l.get()){let H=w.getRoot().domElement,te=(B=H==null?void 0:H.querySelector(`#${ke("selectBox",w)}`))!=null?B:null,X=as(te).filter(le=>{var J;return cn((J=le.textContent)!=null?J:"",_)});if(!X.length)return;let I=(K=(z=w.domElement)==null?void 0:z.ownerDocument)==null?void 0:K.activeElement,F=k&&I?X.indexOf(I):-1,q=X[(F+1)%X.length];q.focus(),(Z=q.scrollIntoView)==null||Z.call(q,{block:"nearest"});return}if(n)return;let M=t.filter(H=>cn(H.label,_));if(!M.length)return;let P=k?M.findIndex(H=>H.value===i.get()):-1,L=M[(P+1)%M.length];i.set(L.value)},y={_onInsert:p=>{p.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:p=>p.children.insert(f),onClick:(p,w)=>g(w),tabindex:0,role:"button",ariaExpanded:p=>l.get(p),ariaHaspopup:"listbox",onKeyDown:(p,w)=>{let E=p.key;if(E==="Escape"){d(w);return}if(E==="Enter"||E===" "){p.preventDefault(),g(w);return}if(E==="ArrowDown"&&!l.get()){p.preventDefault(),u(w);return}let k=p;E.length===1&&!k.ctrlKey&&!k.metaKey&&!k.altKey&&b(E,w)},style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:p=>m(6+S(p)*2),minWidth:m(32),outlineOffset:"-1px",outline:p=>`1px solid ${s(p,"border-strong","neutral")}`,paddingInline:p=>m(S(p)*2),borderRadius:p=>m(S(p)*1.5),fontSize:p=>x(p,"inherit"),color:p=>s(p,"text",o),backgroundColor:p=>s(p,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:p=>T(p,o)}}};return j(c,y),c}function ss(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",tabindex:-1,ariaSelected:n=>{var u;let i=(u=n==null?void 0:n.elementNode)==null?void 0:u.getContext("select");if(!i)return;let l=i.value.get(n);return i.multiple?l.includes(o):l===o},onClick:(n,i)=>{let l=i.getContext("select");if(!l)return;let u=l.value,d=u.get();l.multiple?d.includes(o)?u.set(d.filter(c=>c!==o)):u.set(d.concat([o])):d!==o&&u.set(o)},_onInit:n=>{n.tagName!=="div"&&console.warn('"selectItem" patch must use div tag')},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>x(n,"inherit"),height:n=>m(6+S(n)*2),paddingInline:n=>m(S(n)*3),border:"none",outline:"none",color:n=>s(n,"text",r),backgroundColor:n=>s(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>s(n,"hover",r)},"&[aria-selected=true]":{backgroundColor:n=>s(n,"shift-6",t),color:n=>s(n,"shift-11")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:n=>T(n,t)}}}}function cs(e={}){var i;let{color:t="neutral",multiple:r=!1}=e,o=v((i=e.value)!=null?i:r?[]:null),a={div:l=>{let u=o.get(l);return(Array.isArray(u)?u:[u]).map(c=>({input:null,type:"hidden",name:e.name,value:c==null?"":String(c)}))},ariaHidden:"true",hidden:!0};return{dataTone:"shift-0",role:"listbox",ariaLabel:"Options",ariaMultiselectable:r?"true":void 0,_context:{select:{value:o,multiple:r}},_onInit:l=>{l.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),l.children.insert(a)},style:{display:"flex",flexDirection:"column",paddingBlock:l=>m(S(l)*2),paddingInline:l=>m(S(l)*2),fontSize:l=>x(l,"inherit"),backgroundColor:l=>s(l,"inherit",t),color:l=>s(l,"text",t)}}}function ms(e={}){var a;let t=v((a=e.color)!=null?a:"neutral","color"),r={"0%":{backgroundPosition:"200% 0"},"100%":{backgroundPosition:"-200% 0"}},o=Ne(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-1",style:{fontSize:n=>x(n),color:n=>s(n,"text",t.get(n)),height:m(6),display:"block",borderRadius:m(1),backgroundColor:n=>s(n,"inherit",t.get(n)),backgroundImage:n=>`linear-gradient(90deg, ${s(n,"inherit",t.get(n))} 0%, ${s(n,"shift-2",t.get(n))} 50%, ${s(n,"inherit",t.get(n))} 100%)`,backgroundSize:"200% 100%",animation:`${o} 1.6s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}function us(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="small"&&console.warn('"small" patch must use small tag')},dataSize:"decrease-1",style:{fontSize:o=>x(o,"inherit"),color:o=>s(o,"shift-10",t.get(o))}}}var un={to:{transform:"rotate(360deg)"}},mn=Ne(JSON.stringify(un));function hs(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>x(o),backgroundColor:o=>s(o),color:o=>s(o,"text",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:m(6),height:m(6),borderRadius:"50%",border:o=>`${m(.5)} solid ${s(o,"border-strong",t.get(o))}`,borderTopColor:o=>s(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${mn} 0.7s linear infinite`,[`@keyframes ${mn}`]:un}}}function ds(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:a=90}=e;return{_onSchedule:(n,i)=>{j(i,{_context:{splitter:{direction:t,size:v(r),min:o,max:a,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function fs(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal"?"width":"height",a=t.panelCount++===0,n=l=>{r.style[o]=`${a?l:100-l}%`};n(t.size.get()),r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n);e.addHook("Remove",i)}}}function ps(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize",r.setAttribute("aria-orientation",o?"vertical":"horizontal"),r.setAttribute("aria-valuemin",String(t.min)),r.setAttribute("aria-valuemax",String(t.max)),r.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let a=t.size.addListener(u=>{r.setAttribute("aria-valuenow",String(Math.round(u)))}),n=u=>{let d=u.shiftKey?10:1,c=null;o?u.key==="ArrowRight"?c=Math.min(t.size.get()+d,t.max):u.key==="ArrowLeft"&&(c=Math.max(t.size.get()-d,t.min)):u.key==="ArrowDown"?c=Math.min(t.size.get()+d,t.max):u.key==="ArrowUp"&&(c=Math.max(t.size.get()-d,t.min)),u.key==="Home"?c=t.min:u.key==="End"&&(c=t.max),c!==null&&(u.preventDefault(),t.size.set(c))},i=null,l=u=>{u.preventDefault();let d=r.parentElement,c=f=>{let g=d.getBoundingClientRect(),b=o?(f.clientX-g.left)/g.width*100:(f.clientY-g.top)/g.height*100;t.size.set(Math.min(Math.max(b,t.min),t.max))},h=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",h),i=null};i=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",h),i=null},document.addEventListener("mousemove",c),document.addEventListener("mouseup",h)};r.addEventListener("keydown",n),r.addEventListener("mousedown",l),e.addHook("Remove",()=>{i==null||i(),a(),r.removeEventListener("keydown",n),r.removeEventListener("mousedown",l)})},dataTone:"shift-2",style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>s(e,"inherit"),color:e=>s(e,"text"),"&:hover":{backgroundColor:e=>s(e,"increase-1")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:e=>T(e,"primary")},"&::after":{content:'""',width:m(1),height:m(1),borderRadius:m(999),backgroundColor:e=>s(e,"shift-4")}}}}function gs(e={}){let{gap:t=3,align:r}=e;return{style:V({display:"flex",flexDirection:"column",gap:o=>m(S(o)*t)},r?{alignItems:r}:{})}}function ys(e={items:[]}){var i;let{items:t=[],direction:r="horizontal",color:o="neutral",accentColor:a="primary"}=e,n=v((i=e.current)!=null?i:0);return{_doctorDisable:"inline-typography",_context:{steps:{current:n,direction:r,color:o,accentColor:a}},_onSchedule:(l,u)=>{let d=t.map((c,h)=>{var g;return{li:[typeof c.label=="string"?{span:c.label}:c.label],_key:(g=c.key)!=null?g:h,dataStep:String(h+1),dataStatus:b=>{let y=n.get(b);return h<y?"done":h===y?"active":"pending"},ariaCurrent:b=>n.get(b)===h?"step":void 0,style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:m(1),flex:"1",fontSize:b=>x(b,"decrease-1"),textAlign:"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:m(6),height:m(6),borderRadius:m(999),fontSize:b=>x(b,"decrease-1"),fontWeight:"bold",flexShrink:"0",border:b=>`2px solid ${s(b,"border-strong",o)}`,backgroundColor:b=>s(b,"inherit"),color:b=>s(b,"muted"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"},"&:not(:first-child)::after":{content:'""',position:"absolute",top:m(3),right:`calc(50% + ${m(3)})`,left:`calc(-50% + ${m(3)})`,height:"2px",backgroundColor:b=>s(b,"shift-3",o),zIndex:"0"},"&[data-status=active]::before":{backgroundColor:b=>s(b,"shift-9",a),borderColor:b=>s(b,"shift-9",a),color:b=>s(b,"shift-0",a),boxShadow:b=>`0 0 0 3px ${s(b,"shift-3",a)}`},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:b=>s(b,"shift-9",a),borderColor:b=>s(b,"shift-9",a),color:b=>s(b,"shift-0",a)},"&[data-status=done]:not(:first-child)::after":{backgroundColor:b=>s(b,"shift-9",a)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:b=>s(b,"shift-9",a)},"&[data-status=pending]":{color:b=>s(b,"muted")},"&[data-status=active]":{color:b=>s(b,"shift-11",a),fontWeight:"bold"},"&[data-status=done]":{color:b=>s(b,"text",o)}}}});u[l.tagName]=d},style:{display:"flex",flexDirection:r==="vertical"?"column":"row",alignItems:r==="vertical"?"flex-start":"center",gap:m(2),listStyle:"none",margin:"0",padding:"0"}}}function bs(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>x(o,"inherit"),fontWeight:"bold",color:o=>s(o,"shift-11",t.get(o)),backgroundColor:o=>s(o)}}}function vs(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>x(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>s(o,"text",t.get(o))}}}function Ss(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>x(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>s(o,"text",t.get(o))}}}function xs(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},_doctorDisable:"inline-typography",style:{fontSize:o=>x(o,"inherit"),color:o=>s(o,"text",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>m(S(o)*3),paddingBlock:o=>m(S(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>m(S(o)*3),paddingBlock:o=>m(S(o)*1),color:o=>s(o,"text",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${s(o,"shift-3",t.get(o))}`,fontSize:o=>x(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>m(S(o)*3),paddingBlock:o=>m(S(o)*1),color:o=>s(o,"shift-10",t.get(o)),backgroundColor:o=>s(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${s(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>s(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>s(o,"hover")}}}}function ws(e={items:[]}){var n,i,l;let{items:t=[],accentColor:r="primary",color:o="neutral"}=e,a=v((l=(i=e.activeKey)!=null?i:(n=t[0])==null?void 0:n.key)!=null?l:0);return{_onSchedule:(u,d)=>{let c=u.nodeId,f={div:t.map((b,y)=>{var E;let p=(E=b.key)!=null?E:y;return{button:[typeof b.label=="string"?{span:b.label}:b.label],_key:p,type:"button",role:"tab",id:`tab${c}${p}`,ariaControls:`panel${c}${p}`,ariaSelected:k=>a.get(k)===p,tabIndex:k=>a.get(k)===p?0:-1,onClick:()=>a.set(p),onKeyDown:k=>{var z;let _=k.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(_))return;k.preventDefault();let M=t.map((K,Z)=>{var H;return(H=K.key)!=null?H:Z}),P=M.indexOf(p),L=P;_==="ArrowRight"?L=(P+1)%M.length:_==="ArrowLeft"?L=(P-1+M.length)%M.length:_==="Home"?L=0:_==="End"&&(L=M.length-1),a.set(M[L]);let B=k.target.closest("[role=tablist]");(z=B==null?void 0:B.querySelectorAll("[role=tab]")[L])==null||z.focus()},style:{cursor:"pointer",fontSize:k=>x(k,"inherit"),height:k=>m(6+S(k)*2),paddingInline:k=>m(S(k)*4),border:"none",outline:"none",color:k=>s(k,"shift-13"),backgroundColor:k=>s(k,"inherit"),boxShadow:k=>`inset 0 ${m(-.5)} 0 0 ${s(k,"shift-1",o)}`,transition:"box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-selected=true])":{color:k=>s(k,"shift-13"),boxShadow:k=>`inset 0 ${m(-.5)} 0 0 ${s(k,"shift-2",o)}`},"&[aria-selected=true]:not([disabled])":{color:k=>s(k,"shift-13",r),boxShadow:k=>`inset 0 ${m(-.5)} 0 0 ${s(k,"shift-8",r)}`},"&:focus-visible":{boxShadow:k=>T(k,r)},"&[aria-selected=true]:focus-visible":{boxShadow:k=>`${T(k,r)}, inset 0 ${m(-.5)} 0 0 ${s(k,"shift-6",r)}`}}}}),role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},g=t.map((b,y)=>{var w;let p=(w=b.key)!=null?w:y;return{div:[b.content],_key:p,role:"tabpanel",id:`panel${c}${p}`,ariaLabelledby:`tab${c}${p}`,hidden:E=>a.get(E)!==p,style:{paddingBlock:E=>m(S(E)*2),paddingInline:E=>m(S(E)*2)}}});d[u.tagName]=[f,...g]}}}function ks(e={}){var a,n;let t=v((a=e.color)!=null?a:"neutral","color"),r=v((n=e.accentColor)!=null?n:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:i=>{i.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:i=>{if(o){let l=i.domElement;l.style.overflow="hidden";let u=()=>{l.style.height="auto",l.style.height=`${l.scrollHeight}px`};l.addEventListener("input",u),u(),i.addHook("Remove",()=>l.removeEventListener("input",u))}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:i=>m(S(i)*2),paddingBlock:i=>m(S(i)*1.5),border:"none",borderRadius:i=>m(S(i)*1.5),fontSize:i=>x(i,"inherit"),color:i=>s(i,"text",t.get(i)),outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"border-strong",t.get(i))}`,backgroundColor:i=>s(i,"inherit",t.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>s(i,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${s(i,"shift-5",r.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,r.get(i))},"&:invalid":{outline:i=>`${m(.5)} solid ${s(i,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>s(i,"muted","neutral"),outline:i=>`1px solid ${s(i,"border-strong","neutral")}`,backgroundColor:i=>s(i,"shift-2","neutral")}}}}function Cs(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Es(e={}){var n,i,l;let{last:t=!1}=e,r=(n=e.color)!=null?n:"neutral",o=(i=e.accentColor)!=null?i:"primary",a=v((l=e.active)!=null?l:!1);return{style:V({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>m(S(u)*2),paddingBottom:u=>t?"0":m(S(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:m(1),transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>s(u,"shift-8",a.get(u)?o:r),opacity:u=>a.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>m(S(u)*-4),width:"2px",backgroundColor:u=>s(u,"shift-3",r)}})}}function Lo(e){let t=e.getMetadata("toastOpen");return t||(t=v(!1),e.setMetadata("toastOpen",t)),t}var hn=e=>{let t=e==null?void 0:e.elementNode;return t?Lo(t).get(e):!1};function _s(e={}){let{position:t="top-center",color:r="neutral"}=e,o=t.startsWith("top"),a=t.endsWith("center"),n=t.endsWith("right"),i={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:o?"column":"column-reverse",alignItems:a?"center":n?"end":"start",inset:0,gap:m(4),zIndex:30,padding:m(6),pointerEvents:"none"}};return{_portal:l=>{let u=l.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=l.children.insert(i).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:m(32),pointerEvents:"auto",paddingBlock:l=>m(S(l)*2),paddingInline:l=>m(S(l)*4),borderRadius:l=>m(S(l)*2),fontSize:l=>x(l,"inherit"),color:l=>s(l,"text",r),backgroundColor:l=>s(l,"inherit",r),boxShadow:N("medium"),opacity:l=>Number(hn(l)),transform:l=>hn(l)?"translateY(0)":o?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:l=>requestAnimationFrame(()=>Lo(l).set(!0)),_onBeforeRemove:(l,u)=>{var w,E;let d=!1,c=null,h=!1,f=l.getRoot(),g=(E=(w=l.domElement)==null?void 0:w.parentElement)!=null?E:null,b=()=>{var _;if(h||!g||g.id!==`domphy-toast-${t}`||g.childElementCount>0)return;h=!0;let k=(_=f.children)==null?void 0:_.items.find(M=>M.domElement===g);k?f.children.remove(k):g.remove()},y=()=>{d||(d=!0,c&&(clearTimeout(c),c=null),l.domElement.removeEventListener("transitionend",p),u(),b())},p=k=>{k.propertyName==="transform"&&y()};l.domElement.addEventListener("transitionend",p),c=setTimeout(y,350),l.addHook("Remove",()=>{var k;c&&(clearTimeout(c),c=null),(k=l.domElement)==null||k.removeEventListener("transitionend",p),b()}),Lo(l).set(!1)}}}function Ts(e={items:[]}){var i;let{items:t=[],multiple:r=!1,color:o="neutral",accentColor:a="primary"}=e,n=v((i=e.value)!=null?i:r?[]:"");return{role:"group",_context:{toggleGroup:{value:n,multiple:r}},_onSchedule:(l,u)=>{let d=t.map((c,h)=>{var b;let f=(b=c.key)!=null?b:String(h);return{button:[typeof c.label=="string"?{span:c.label}:c.label],_key:f,type:"button",role:"button",ariaPressed:y=>{let p=n.get(y);return Array.isArray(p)?p.includes(f):p===f},onClick:()=>{let y=n.get();if(r){let p=Array.isArray(y)?[...y]:[];n.set(p.includes(f)?p.filter(w=>w!==f):[...p,f])}else n.set(y===f?"":f)},style:{cursor:"pointer",fontSize:y=>x(y,"inherit"),height:m(6),paddingBlock:m(1),paddingInline:m(2),border:"none",borderRadius:m(1.5),color:y=>s(y,"shift-13",o),backgroundColor:y=>s(y,"inherit",o),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-pressed=true])":{color:y=>s(y,"shift-13",o),backgroundColor:y=>s(y,"hover",o)},"&:active:not([disabled])":{backgroundColor:y=>s(y,"increase-2",o)},"&[aria-pressed=true]":{backgroundColor:y=>s(y,"shift-3",a),color:y=>s(y,"shift-13",a)},"&:focus-visible":{boxShadow:y=>T(y,a)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}});u[l.tagName]=d},style:{display:"flex",paddingBlock:m(1),paddingInline:m(1),gap:m(1),borderRadius:m(2),fontSize:l=>x(l,"inherit"),backgroundColor:l=>s(l,"inherit",o),color:l=>s(l,"text",o),outline:l=>`1px solid ${s(l,"border",o)}`,outlineOffset:"-1px"}}}function Ds(e={}){return Po({gap:e.gap})}function Ms(){return{div:null,style:{flex:"1 1 0"}}}function Os(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,a=v(r),n=v(o),i={span:f=>n.get(f)},{show:l,hide:u,anchorPartial:d}=fe({kind:"tooltip",open:t,placement:a,content:i}),c={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:f=>m(S(f)*1),paddingInline:f=>m(S(f)*3),borderRadius:f=>m(S(f)*1.5),color:f=>s(f,"text"),backgroundColor:f=>s(f),fontSize:f=>x(f,"inherit"),boxShadow:N("low")},$:[Oo({placement:a,bordered:!1})]};return i.$||(i.$=[]),i.$.push(c),j(d,{ariaDescribedby:f=>f!=null&&f.elementNode?ke("tooltip",f.elementNode):void 0,onMouseEnter:(f,g)=>l(g),onMouseLeave:(f,g)=>u(g),onFocus:(f,g)=>l(g),onBlur:(f,g)=>u(g),onKeyDown:(f,g)=>f.key==="Escape"&&u(g)}),d}function dn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Ps(e={}){let{duration:t=300,delay:r=0}=e,o=new Map,a=new Map,n=new Set,i=new Set;return{_onMount:l=>{l.addHook("Remove",()=>{for(let u of Array.from(a.values()))u();a.clear();for(let u of n)clearTimeout(u);n.clear();for(let u of i)cancelAnimationFrame(u);i.clear()})},_onBeforeUpdate:l=>{o=new Map,l.children.items.forEach((u,d)=>{if(!(u instanceof U))return;let c=u.domElement;c&&o.set(dn(u,d),c.getBoundingClientRect())})},_onUpdate:l=>{l.children.items.forEach((u,d)=>{var M;if(!(u instanceof U))return;let c=u.domElement;if(!c)return;let h=dn(u,d),f=o.get(h);if(!f)return;let g=c.getBoundingClientRect(),b=f.left-g.left,y=f.top-g.top;if(Math.abs(b)<.5&&Math.abs(y)<.5)return;(M=a.get(c))==null||M(),c.style.transition="none",c.style.transform=`translate(${b}px, ${y}px)`,c.getBoundingClientRect();let p=requestAnimationFrame(()=>{i.delete(p),c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});i.add(p);let w=!1,E=null,k=()=>{w||(w=!0,E&&(n.delete(E),E=null),a.delete(c),c.removeEventListener("transitionend",_),c.style.transition="",c.style.transform="")},_=P=>{P.propertyName==="transform"&&k()};a.set(c,()=>{w=!0,E&&(clearTimeout(E),n.delete(E),E=null),a.delete(c),c.removeEventListener("transitionend",_)}),c.addEventListener("transitionend",_),E=setTimeout(k,t+r+34),n.add(E)}),o.clear()}}}function Ls(e={}){var r;let t=v((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>x(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:m(3),listStyleType:"disc",listStylePosition:"outside"}}}function $s(){return{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}}return Mn(Rs);})();
1
+ "use strict";var Domphy=(()=>{var yt=Object.defineProperty,Hr=Object.defineProperties,jr=Object.getOwnPropertyDescriptor,Fr=Object.getOwnPropertyDescriptors,Wr=Object.getOwnPropertyNames,Go=Object.getOwnPropertySymbols;var Xo=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable;var Yo=(e,t,n)=>t in e?yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))Xo.call(t,n)&&Yo(e,n,t[n]);if(Go)for(var n of Go(t))Kr.call(t,n)&&Yo(e,n,t[n]);return e},A=(e,t)=>Hr(e,Fr(t));var bt=(e,t)=>{for(var n in t)yt(e,n,{get:t[n],enumerable:!0})},qr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Wr(t))!Xo.call(e,a)&&a!==n&&yt(e,a,{get:()=>t[a],enumerable:!(o=jr(t,a))||o.enumerable});return e};var Ur=e=>qr(yt({},"__esModule",{value:!0}),e);var sc={};bt(sc,{core:()=>Ct,theme:()=>Mt,ui:()=>Ut});var Ct={};bt(Ct,{AttributeList:()=>vn,BooleanAttributes:()=>ao,CamelAttributes:()=>nn,ElementList:()=>wn,ElementNode:()=>Z,HtmlAttributeNames:()=>Zt,HtmlTags:()=>rn,Notifier:()=>it,PrefixCSS:()=>De,RawHTML:()=>xn,RecordState:()=>wi,State:()=>eo,SvgTags:()=>an,VoidTags:()=>vt,_deliveringNotifier:()=>tt,_microtask:()=>Et,_resetKeylessWarnings:()=>hi,batch:()=>bi,behavior:()=>B,computed:()=>yi,configure:()=>Zr,effect:()=>_n,effectScope:()=>gi,flushPendingNotifiers:()=>mn,flushSync:()=>kn,getConfig:()=>sn,hasPendingNotifiers:()=>un,hashString:()=>je,isRawHTML:()=>rt,isState:()=>le,merge:()=>q,nextTick:()=>xi,peek:()=>ti,rawHtml:()=>Pe,readonly:()=>ei,runBatched:()=>cn,sanitizeHTMLString:()=>xt,toState:()=>y,untrack:()=>vi,watch:()=>Si});var Gr=Object.defineProperty,Zo=Object.getOwnPropertySymbols,Yr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable,Jo=(e,t,n)=>t in e?Gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xt=(e,t)=>{for(var n in t||(t={}))Yr.call(t,n)&&Jo(e,n,t[n]);if(Zo)for(var n of Zo(t))Xr.call(t,n)&&Jo(e,n,t[n]);return e},ao=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","inert","download","noModule","paused","autoPictureInPicture"],nn=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits","baseFrequency","numOctaves","xChannelSelector","yChannelSelector","stdDeviation","colorInterpolationFilters","pathLength"],Zt={htmlFor:"for",allowFullScreen:"allowfullscreen",autoFocus:"autofocus",autoPlay:"autoplay",formNoValidate:"formnovalidate",isMap:"ismap",itemScope:"itemscope",noHref:"nohref",noShade:"noshade",noValidate:"novalidate",playsInline:"playsinline",trueSpeed:"truespeed",typeMustMatch:"typemustmatch",noModule:"nomodule",autoPictureInPicture:"autopictureinpicture",autoCapitalize:"autocapitalize",contentEditable:"contenteditable",spellCheck:"spellcheck",ariaActiveDescendant:"aria-activedescendant",ariaColCount:"aria-colcount",ariaPosinSet:"aria-posinset",ariaSetSize:"aria-setsize",accessKey:"accesskey",enterKeyHint:"enterkeyhint",inputMode:"inputmode",itemId:"itemid",itemProp:"itemprop",itemRef:"itemref",itemType:"itemtype",tabIndex:"tabindex",writingSuggestions:"writingsuggestions",charSet:"charset",hrefLang:"hreflang",crossOrigin:"crossorigin",aLink:"alink",bgColor:"bgcolor",vLink:"vlink",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formTarget:"formtarget",popoverTarget:"popovertarget",popoverTargetAction:"popovertargetaction",allowPaymentRequest:"allowpaymentrequest",allowUserMedia:"allowusermedia",frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",referrerPolicy:"referrerpolicy",srcDoc:"srcdoc",hSpace:"hspace",fetchPriority:"fetchpriority",srcSet:"srcset",srcLang:"srclang",useMap:"usemap",vSpace:"vspace",dirName:"dirname",imageSizes:"imagesizes",imageSrcSet:"imagesrcset",classId:"classid",codeBase:"codebase",codeType:"codetype",valueType:"valuetype",shadowRootClonable:"shadowrootclonable",shadowRootDelegatesFocus:"shadowrootdelegatesfocus",shadowRootMode:"shadowrootmode",colSpan:"colspan",rowSpan:"rowspan",noWrap:"nowrap",vAlign:"valign",charOff:"charoff",maxLength:"maxlength",minLength:"minlength",autoComplete:"autocomplete",encType:"enctype",dateTime:"datetime"},rn=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],De={transform:["webkit","ms"],transition:["webkit","ms"],animation:["webkit"],userSelect:["webkit","ms"],flexDirection:["webkit","ms"],flexWrap:["webkit","ms"],justifyContent:["webkit","ms"],alignItems:["webkit","ms"],alignSelf:["webkit","ms"],order:["webkit","ms"],flexGrow:["webkit","ms"],flexShrink:["webkit","ms"],flexBasis:["webkit","ms"],columns:["webkit"],columnCount:["webkit"],columnGap:["webkit"],columnRule:["webkit"],columnWidth:["webkit"],boxSizing:["webkit"],appearance:["webkit","moz"],filter:["webkit"],backdropFilter:["webkit"],clipPath:["webkit"],mask:["webkit"],maskImage:["webkit"],textSizeAdjust:["webkit","ms"],hyphens:["webkit","ms"],writingMode:["webkit","ms"],gridTemplateColumns:["ms"],gridTemplateRows:["ms"],gridAutoColumns:["ms"],gridAutoRows:["ms"],gridColumn:["ms"],gridRow:["ms"],marginInlineStart:["webkit"],marginInlineEnd:["webkit"],paddingInlineStart:["webkit"],paddingInlineEnd:["webkit"],minInlineSize:["webkit"],maxInlineSize:["webkit"],minBlockSize:["webkit"],maxBlockSize:["webkit"],inlineSize:["webkit"],blockSize:["webkit"],tabSize:["moz"],overscrollBehavior:["webkit","ms"],touchAction:["ms"],resize:["webkit"],printColorAdjust:["webkit"],backgroundClip:["webkit"],boxDecorationBreak:["webkit"],overflowScrolling:["webkit"]},an=["svg","circle","path","rect","ellipse","line","polyline","polygon","g","defs","use","symbol","linearGradient","radialGradient","stop","clipPath","mask","filter","text","tspan","textPath","image","pattern","marker","animate","animateTransform","animateMotion","feGaussianBlur","feComposite","feColorMatrix","feMerge","feMergeNode","feOffset","feFlood","feBlend","feTurbulence","feDisplacementMap","feComponentTransfer","feFuncR","feFuncG","feFuncB","feFuncA","foreignObject"],vt=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],ln={};function Zr(e){Object.assign(ln,e)}function sn(){return Xt({},ln)}var Jr=["onAbort","onAuxClick","onBeforeMatch","onBeforeToggle","onBlur","onCancel","onCanPlay","onCanPlayThrough","onChange","onClick","onClose","onContextLost","onContextMenu","onContextRestored","onCopy","onCueChange","onCut","onDblClick","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDragStart","onDrop","onDurationChange","onEmptied","onEnded","onError","onFocus","onFormData","onInput","onInvalid","onKeyDown","onKeyPress","onKeyUp","onLoad","onLoadedData","onLoadedMetadata","onLoadStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPaste","onPause","onPlay","onPlaying","onProgress","onRateChange","onReset","onResize","onScroll","onScrollEnd","onSecurityPolicyViolation","onSeeked","onSeeking","onSelect","onSlotChange","onStalled","onSubmit","onSuspend","onTimeUpdate","onToggle","onVolumeChange","onWaiting","onWheel","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onCompositionStart","onCompositionUpdate","onCompositionEnd","onTransitionEnd","onTransitionStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onFullscreenChange","onFullscreenError","onFocusIn","onFocusOut"],Qr=Jr.reduce((e,t)=>{let n=t.slice(2).toLowerCase();return e[n]=t,e},{}),pe=[],Et=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},Qo=100,St=0,Jt=new Set,He=new Set,tt=null;function cn(e){St++;try{return e()}finally{if(St--,St===0){let t=Jt;Jt=new Set;for(let n of t)n._scheduleFlush()}}}var it=class{constructor(){this._listeners=Object.create(null),this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let n=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(n)),n}removeListener(e,t){var n;if(!this._listeners)return;let o=this._listeners[e];o&&o.has(t)&&(o.delete(t),o.size===0&&(delete this._listeners[e],(n=this._onEmpty)==null||n.call(this,e)))}listenerCount(e){var t,n,o;return(o=(n=(t=this._listeners)==null?void 0:t[e])==null?void 0:n.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let n=pe.length?pe[pe.length-1]:null;if(n&&n[0]===this&&n[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=Qo){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${Qo} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...pe]})}St>0?Jt.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,He.add(this),Et(()=>this._flushAll()))}_isCircular(e){let t=pe.findIndex(([o,a])=>o===this&&a===e);if(t===-1)return!1;let n=[...pe.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
+ ${n.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,He.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:n,chain:o}]of e)pe=o,this._flush(t,n);pe=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let n=this._listeners[e];if(!n)return;pe.push([this,e]),this._flushing.set(e,t);let o=tt;tt=this;try{for(let a of[...n])if(n.has(a))try{a(...t)}catch(r){console.error(r)}}finally{tt=o}this._flushing.delete(e),pe.pop()}};function un(){return He.size>0}function mn(){let e=0;for(;He.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...He];He.clear();for(let n of t)n._flushAll()}}var dn=class{constructor(e){this._releases=new Set,this._consumedVersions=new Map;let t=(()=>{let n=tt;n&&n._version!==void 0&&this._consumedVersions.get(n)===n._version||e()});t.onSubscribe=n=>{this._releases.add(n)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear(),this._consumedVersions.clear()}get dependencyCount(){return this._releases.size}},ot=[],Qt=0;function lo(){return Qt>0?null:ot.length?ot[ot.length-1]:null}function hn(e,t){ot.push(e);try{return t()}finally{ot.pop()}}function so(e){Qt++;try{return e()}finally{Qt--}}var ue=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",eo=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new it,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=lo();t&&this.addListener(t.handler)}return this._value}set(e){if(!this._notifier){ue&&console.warn(`[Domphy] State.set() called on a disposed state ("${this.name}") \u2014 the write is ignored. The state outlived its owner; keep a live reference or re-create it.`);return}Object.is(this._value,e)||(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function q(e={},t={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],a=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=ke(t));for(let r in t){let i=t[r];if(i!=null)if(typeof i=="object"&&!Array.isArray(i))typeof e[r]=="object"?e[r]=q(e[r],i):e[r]=i;else if(n.includes(r))if(typeof e[r]=="function"||typeof i=="function"){let l=e[r];e[r]=m=>{let u=typeof l=="function"?l(m):l,s=typeof i=="function"?i(m):i;return[u,s].filter(d=>d).join(", ")}}else e[r]=[e[r],i].filter(l=>l).join(", ");else if(a.includes(r))if(typeof e[r]=="function"||typeof i=="function"){let l=e[r];e[r]=m=>{let u=typeof l=="function"?l(m):l,s=typeof i=="function"?i(m):i;return[u,s].filter(d=>d).join("")}}else e[r]=[e[r],i].filter(l=>l).join("");else if(o.includes(r))if(typeof e[r]=="function"||typeof i=="function"){let l=e[r];e[r]=m=>{let u=typeof l=="function"?l(m):l,s=typeof i=="function"?i(m):i;return[u,s].filter(d=>d).join(" ")}}else e[r]=[e[r],i].filter(l=>l).join(" ");else if(r.startsWith("on")){let l=r.replace("on","").toLowerCase();ni(e,l,i)}else if(r.startsWith("_on")){let l=r.replace("_on","");oi(e,l,i)}else e[r]=i}return e}function je(e=""){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function y(e,t){return e instanceof eo||e!=null&&e._isState?e:new eo(e,t)}function le(e){return typeof e=="object"&&e!==null&&e._isState===!0}function ei(e){return{_isState:!0,get(t){return e.get(t)}}}function ti(e){return so(()=>e(void 0))}function B(e,t,n){return{_behaviors:{[e]:{attach:t,props:n}}}}function oi(e,t,n){let o=`_on${t}`,a=e[o];if(typeof a=="function"){let r=(...i)=>{a(...i),n(...i)};try{Object.defineProperty(r,"length",{value:Math.max(a.length,n.length),configurable:!0})}catch(i){}e[o]=r}else e[o]=n}function ni(e,t,n){let o=Qr[t];if(!o)throw Error(`invalid event name "${t}"`);let a=e[o];typeof a=="function"?e[o]=(r,i)=>{a(r,i),n(r,i)}:e[o]=n}function ke(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let n;if(Array.isArray(e)){n=[],t.set(e,n);for(let a of e)n.push(ke(a,t));return n}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){n=new Map,t.set(e,n);for(let[a,r]of e)n.set(ke(a,t),ke(r,t));return n}if(e instanceof Set){n=new Set,t.set(e,n);for(let a of e)n.add(ke(a,t));return n}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);let o=Object.getPrototypeOf(e);if(o!==Object.prototype)return e;n=Object.create(o),t.set(e,n);for(let a of Reflect.ownKeys(e))n[a]=ke(e[a],t);return n}function fn(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let n=Object.keys(e);if(n.length===0&&!t)throw Error("element object has no tag key");for(let o=0;o<n.length;o++){let a=n[o],r=e[a];if(o===0&&!pn.has(a)&&!t)throw Error(`key ${a} is not valid HTML tag name`);if(a==="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(a==="$"){if(!Array.isArray(r))throw Error(`"$" must be an array of patch objects, received ${r===null?"null":typeof r} on element { ${n.join(", ")} } \u2014 wrap patches in an array, e.g. $: [patch()]`);r.forEach(i=>fn(i,!0))}else{if(a.startsWith("_on")&&typeof r!="function")throw Error(`hook ${a} value "${r}" must be a function `);if(a.startsWith("on")&&typeof r!="function")throw Error(`event ${a} value "${r}" must be a function `);if(a==="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(a==="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(a==="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(a==="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function ri(e){return e.replace(/&#(x?[0-9a-fA-F]+);/gi,(t,n)=>{let o=n[0]==="x"||n[0]==="X"?Number.parseInt(n.slice(1),16):Number.parseInt(n,10);return o>=0&&o<=1114111?String.fromCodePoint(o):""}).replace(/&colon;/gi,":").replace(/&Tab;/gi," ").replace(/&NewLine;/gi,`
3
+ `)}function ii(e){let t=ri(e).replace(/[\x00-\x20]+/g,"").toLowerCase();return t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:text/html")||t.startsWith("data:application/xhtml+xml")}function ai(e){let t=e.toLowerCase(),n="",o=0;for(;o<e.length;){let a=t.indexOf("<",o);if(a===-1){n+=e.slice(o);break}n+=e.slice(o,a);let r=null,i=-1;for(let m=a+1;m<e.length;m++){let u=e[m];if(r)u===r&&(r=null);else if(u==='"'||u==="'")r=u;else if(u===">"){i=m;break}}if(i===-1){n+=e.slice(a);break}let l=e.slice(a,i+1);if(/^<script[\s/>]/i.test(l)){if(/\/\s*>$/.test(l)){o=i+1;continue}let m=t.indexOf("</script",i+1);if(m===-1){o=e.length;break}let u=e.indexOf(">",m);o=u===-1?e.length:u+1;continue}n+=l,o=i+1}return n}function xt(e){let t=ai(e);return t=t.replace(/\s+on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/((?:xlink:href|formaction|imagesrcset|srcset|poster|cite|background|ping|longdesc|codebase|classid|archive|icon|manifest|href|src|action|data)\s*=\s*)("([^"]*)"|'([^']*)'|([^\s>]*))/gi,(n,o,a,r,i,l)=>{var m,u;let s=(u=(m=r!=null?r:i)!=null?m:l)!=null?u:"";if(!ii(s))return n;let d=r!==void 0?'"':i!==void 0?"'":"";return`${o}${d}#${d}`}),t}function to(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var pn=new Set(rn);function gn(e){return Object.keys(e).find(t=>pn.has(t))}function en(e,t){if(Object.getPrototypeOf(e)!==Object.prototype)return ke(e);let n=new WeakMap,o={};for(let a of Reflect.ownKeys(e))o[a]=a===t?e[a]:ke(e[a],n);return o}function yn(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function li(e){if(e.indexOf("@")===0)return[e];for(var t=[],n=0,o=0,a="",r=0,i=e.length;r<i;r++){var l=e[r];if(l==="(")n+=1;else if(l===")")n-=1;else if(l==="[")o+=1;else if(l==="]")o-=1;else if(l===","&&!n&&!o){t.push(a.trim()),a="";continue}a+=l}return t.push(a.trim()),t}function wt(e){let t=e.trim();return t.startsWith("@")?t.replace(/\s+/g,""):t.replace(/\s*([>+~,])\s*/g,"$1").replace(/\s+/g," ").replace(/\(\s*odd\s*\)/g,"(2n+1)").replace(/\(\s*even\s*\)/g,"(2n)").trim()}function si(e,t){for(let n=0;n<e.length;n++){let o=e[n],a=null;if(typeof o.selectorText=="string"?a=wt(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(a=wt(o.cssText.split("{")[0])),!a)continue;let r=t.get(a);r?r.push(o):t.set(a,[o])}return t}function bn(e,t){var n;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let a=t!=null?t:sn().cspNonce;a&&(o.nonce=a),e.appendChild(o)}return o.dataset.domphyBase!=="true"&&((n=o.sheet)==null||n.insertRule("[hidden] { display: none !important; }",0),o.dataset.domphyBase="true"),o}var oo=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(n=>q(t,oo(n))),delete e.$,q(t,e),t}else return e},ci={translate:["yes","no"],autoCapitalize:["on","off"],contentEditable:["true","false"],spellCheck:["true","false"]},ui=class{constructor(e,t,n){this.declaredValue=void 0,this._notifier=new it,this._releases=[],this._removeHooked=!1,this._listenerReleases=[],this._listenerRemoveHooked=!1,this.parent=n,this.isBoolean=ao.includes(e),this.enumeratedBoolean=ci[e],nn.includes(e)?this.name=e:Object.hasOwn(Zt,e)?this.name=Zt[e]:this.name=yn(e),this.value=void 0,this.set(t)}normalize(e){return this.enumeratedBoolean&&typeof e=="boolean"?e?this.enumeratedBoolean[0]:this.enumeratedBoolean[1]:e}resolve(e){return this.isBoolean&&typeof e!="string"?!!e:this.normalize(e)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value","checked","selected"];this.isBoolean?(this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value),t.includes(this.name)&&(e[this.name]=!!this.value)):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,n,o;let a=this.value;if(this.declaredValue=e,this._releases.length){for(let r of this._releases)r();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let r=()=>{var i;if(!(!this.parent||this.parent._disposed))try{let l=this.value;this.value=this.resolve(e(r)),this.render(),l!==this.value&&this._notifier.notify(this.name,this.value)}catch(l){(i=this.parent)==null||i._handleError(l)}};r.elementNode=this.parent,r.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(n=this.parent)==null?void 0:n.nodeId} attribute:${this.name}`,r.onSubscribe=i=>{this._releases.push(i),this.parent&&!this._removeHooked&&(this._removeHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let l of this._releases)l();this._releases=[],r=null}))};try{this.value=this.resolve(e(r))}catch(i){(o=this.parent)==null||o._handleError(i)}}else this.value=this.resolve(e);this.render(),a!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=n=>{this._listenerReleases.push(n),this.parent&&!this._listenerRemoveHooked&&(this._listenerRemoveHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let o of this._listenerReleases)o();this._listenerReleases=[]}))},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){for(let e of this._releases)e();this._releases=[];for(let e of this._listenerReleases)e();this._listenerReleases=[],this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t===!1||t==null?"":t===!0?e:`${e}="${to(String(t))}"`;if(t==null)return"";let n=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${to(String(n))}"`}},vn=class{constructor(e){this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).filter(Boolean).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?this.items[e].set(t):this.items[e]=new ui(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.hasOwn(this.items,e):!1}remove(e){var t,n;if(!this.items)return;let o=(n=(t=this.items[e])==null?void 0:t.name)!=null?n:e;this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(o)}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this.items=null,this.parent=null}toggle(e,t){if(!ao.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){var t,n;if(!e||typeof e!="string"&&typeof e!="function")return;let o=(m,u)=>{let s=(m||"").split(" ").filter(d=>d);return!s.includes(u)&&s.push(u),s.join(" ")},a=(n=(t=this.items)==null?void 0:t.class)==null?void 0:n.declaredValue,r=typeof a=="function",i=r?a:this.get("class"),l=typeof e=="function";if(!r&&!l){this.set("class",o(i,e));return}this.set("class",m=>o(r?i(m):i,l?e(m):e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}};function mi(e){let t=String(e);return/[;}]|<\/style/i.test(t)?t.replace(/<\/style/gi,"\\3C /style").replace(/;/g,"\\3B ").replace(/}/g,"\\7D "):t}var di=class{constructor(e,t,n){this.value="",this._releases=[],this._fn=null,this._bound=!1,this.name=e,this.cssName=e.startsWith("--")?e:yn(e),this.parentRule=n,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),De[this.name]&&De[this.name].forEach(n=>{t.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){if(this._releases.length){for(let e of this._releases)e();this._releases=[]}this._fn=null,this._bound=!1,this.value="",this.parentRule=null}_bind(e){var t,n,o,a;let r=(()=>{var i;!this.parentRule||(i=this.parentRule.parentNode)!=null&&i._disposed||(this.value=e(r),this._domUpdate())});r.onSubscribe=i=>{this._releases.push(i)},r.elementNode=this.parentRule.root,r.debug=`class:${(n=(t=this.parentRule)==null?void 0:t.root)==null?void 0:n.tagName}_${(a=(o=this.parentRule)==null?void 0:o.root)==null?void 0:a.nodeId} style:${this.name}`,this.value=e(r),this._bound=!0}activate(){!this._fn||this._bound||(this._bind(this._fn),this._domUpdate())}set(e){var t,n;if(this._releases.length){for(let o of this._releases)o();this._releases=[]}if(this._bound=!1,this._fn=null,typeof e=="function")if(this._fn=e,(n=(t=this.parentRule)==null?void 0:t.parentNode)!=null&&n.domElement)this._bind(e);else{let o=(()=>{});o.elementNode=this.parentRule.root;let a=[];o.onSubscribe=r=>{a.push(r)},this.value=so(()=>e(o));for(let r of a)r()}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),De[this.name]&&De[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=mi(this.value),t=`${this.cssName}: ${e}`;return De[this.name]&&De[this.name].forEach(n=>{t+=`; -${n}-${this.cssName}: ${e}`}),t}},Ce=class no{constructor(t,n){this.domRule=null,this._domIndex=-1,this.styleBlock={},this.selectorText=t,this.styleList=new Sn(this),this.parent=n}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof no;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof no;)t=t.parent;return t}insertStyle(t,n){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(n):this.styleBlock[t]=new di(t,n,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${t} ${n} } `}mount(t){if(!(!t||!this.styleList)){if(this.domRule=t,this.styleBlock)for(let n of Object.values(this.styleBlock))n.activate();"cssRules"in t&&this.styleList.mount(t.cssRules)}}remove(){let t=this.domRule,n=t==null?void 0:t.parentStyleSheet;if(t&&n){let o=n.cssRules,a=this._domIndex;if(a<0||a>=o.length||o[a]!==t){a=-1;for(let r=0;r<o.length;r++)if(o[r]===t){a=r;break}}a>=0&&n.deleteRule(a)}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let n=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length);this._domIndex=o;let a=t.cssRules[o];"cssRules"in a&&(this.mount(a),this.styleList.render(a))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let r=t.cssRules[a];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let r=t.cssRules[a];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Sn=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof Ce;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let n={},o=[];function a(r,i){return r.startsWith("&")?`${i}${r.slice(1)}`:`${i} ${r}`}for(let r in e){let i=e[r],l=li(r);for(let m of l){let u=a(m,t);if(/^@(container|layer|supports|media)\b/.test(m)){if(typeof i=="object"&&i!=null){let s=new Ce(m,this.parent);s.styleList.addCSS(i,t),o.push(s)}}else if(m.startsWith("@keyframes")){let s=new Ce(m,this.parent);s.styleList.addCSS(i,""),this.items.push(s)}else if(m.startsWith("@font-face")){let s=new Ce(m,this.parent);for(let d in i)s.insertStyle(d,i[d]);this.items.push(s)}else if(typeof i=="object"&&i!=null){let s=new Ce(u,this.parent);this.items.push(s);for(let[d,f]of Object.entries(i))if(typeof f=="object"&&f!=null){let p=a(d,u);this.addCSS(f,p)}else s.insertStyle(d,f)}else n[m]=i}}if(Object.keys(n).length){let r=new Ce(t,this.parent);for(let i in n)r.insertStyle(i,n[i]);this.items.push(r)}for(let r of o)this.items.push(r)}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}patchCSS(e,t=""){var n;if(!this.items||!this.parent)return;let o={};for(let l in e){let m=e[l];typeof m=="object"&&m!=null||(o[l]=m)}let a=this.items.find(l=>l.selectorText===t);if(!a){if(Object.keys(o).length===0)return;a=new Ce(t,this.parent),this.items.push(a)}let r=new Set(Object.keys(o));for(let l in o)a.insertStyle(l,o[l]);if(a.styleBlock)for(let l of Object.keys(a.styleBlock))r.has(l)||a.removeStyle(l);let i=(n=this.domStyle)==null?void 0:n.sheet;!a.domRule&&i&&a.render(i)}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(n=>n.selectorText===e);return t||(t=new Ce(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let n=e.get(wt(t.selectorText));n&&t.mount(n)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,n=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,a)=>{let r=a-t,i=e[r];i&&(o.selectorText.startsWith("@")&&i instanceof CSSKeyframesRule||"keyText"in i?o.mount(i):"selectorText"in i?i.selectorText!==n(o.selectorText)?t+=1:o.mount(i):"cssRules"in i&&o.mount(i))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}};function tn(e){console.warn(`[Domphy] <${e}> is a void element and cannot have children \u2014 SSR output omits the declared content while the client renders it, so hydration drifts. Remove the content or use a non-void tag.`)}var Z=class Ve{constructor(t,n=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this._imperative=!1,this.type="ElementNode",this.parent=null,this._childrenReleaseHooked=!1,this._behaviorInstances=new Map,this._pendingBehaviors=new Map,this._behaviorMountHooked=!1,this._behaviorTeardownHooked=!1,this.children=new wn(this),this.styles=new Sn(this),this.attributes=new vn(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null,this._descriptor=null;var a,r;fn(t),this._descriptor=t,this.parent=n,this.tagName=gn(t);let i=en(t,this.tagName);i.style=i.style||{},i=oo(i),this.key=(a=i._key)!=null?a:null,this._context=i._context||{},this._metadata=i._metadata||{};let l=`${(r=this.parent)==null?void 0:r.nodeId}.${o}`,m=Object.keys(i.style).length?JSON.stringify(i.style,(s,d)=>typeof d=="function"?l:d):"";this.nodeId=je(l+m),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),i._onSchedule&&i._onSchedule(this,i),this.merge(i);let u=i[this.tagName];ue&&u!=null&&u!==""&&vt.includes(this.tagName)&&tn(this.tagName),u!=null&&(typeof u=="function"?this._setupFunctionChildren(u):this.children.update(Array.isArray(u)?u:[u])),this._hooks.Init&&this._hooks.Init(this)}_setupFunctionChildren(t){let n=()=>{if(!this._disposed)try{let a=t(n);this.children.update(Array.isArray(a)?a:[a])}catch(a){this._handleError(a)}};n.elementNode=this,n.debug=`class:${this.tagName}_${this.nodeId} children`;let o=[];n.onSubscribe=a=>{o.push(a),this._childrenRelease=()=>{for(let r of o)r();o.length=0,n=null},this._childrenReleaseHooked||(this._childrenReleaseHooked=!0,this.addHook("BeforeRemove",()=>{var r;(r=this._childrenRelease)==null||r.call(this),this._childrenRelease=void 0}))},n()}_createDOMNode(){let t=an.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let n in this._events)this._bindEvent(n);return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let n=o=>{var a,r;return(r=(a=this._events)==null?void 0:a[t])==null?void 0:r.call(a,o,this)};this.domElement.addEventListener(t,n),this.addHook("BeforeRemove",o=>{var a;(a=o.domElement)==null||a.removeEventListener(t,n),n=null})}_dispose(){var t,n,o,a,r,i;if(!this._disposed){if(this._disposed=!0,!this._beforeRemoveFired){this._beforeRemoveFired=!0;try{(n=(t=this._hooks).BeforeRemove)==null||n.call(t,this,()=>{})}catch(l){this._handleError(l)}}try{(o=this._childrenRelease)==null||o.call(this)}catch(l){this._handleError(l)}this._childrenRelease=void 0;for(let l of this._behaviorInstances.values())try{(a=l.destroy)==null||a.call(l)}catch(m){this._handleError(m)}this._behaviorInstances.clear(),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(l=>l.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(r=this._hooks).Remove)==null||i.call(r,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this._descriptor=null,this.parent=null}}merge(t){q(this._context,t._context),q(this._metadata,t._metadata),this._processBehaviors(t._behaviors);let n=Object.keys(t);for(let o=0;o<n.length;o++){let a=n[o],r=t[a];["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName].includes(a)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(a)?this.addHook(a.substring(3),r):a.startsWith("on")?this.addEvent(a.substring(2).toLowerCase(),r):a==="_portal"?this._portal=r:a==="class"?(typeof r=="string"||typeof r=="function")&&this.attributes.addClass(r):this.attributes.set(a,r))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var n;if(t===this._descriptor)return;this._descriptor=t;let o=en(t,this.tagName);o.style=o.style||{},o=oo(o);let a=o[this.tagName];if(ue&&a!=null&&a!==""&&vt.includes(this.tagName)&&tn(this.tagName),(n=this._childrenRelease)==null||n.call(this),this._childrenRelease=void 0,typeof a=="function")this._setupFunctionChildren(a);else if(a!=null){let s=Array.isArray(a)?a:[a];this.children.update(s,!!this.domElement,!0)}o._context&&q(this._context,o._context),o._metadata&&q(this._metadata,o._metadata),this._processBehaviors(o._behaviors,!0),this.styles.patchCSS(o.style||{},`.${this.tagName}_${this.nodeId}`);let r=`${this.tagName}_${this.nodeId}`,i=["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName],l=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],m=new Set(["class"]),u=null;this._events={};for(let s of Object.keys(o)){if(i.includes(s)||l.includes(s)||s==="_portal")continue;let d=o[s];s.startsWith("on")&&typeof d=="function"?this.addEvent(s.substring(2).toLowerCase(),d):s==="class"&&(typeof d=="string"||typeof d=="function")?u=d:(this.attributes.set(s,d),m.add(s))}if(typeof u=="function"){let s=u;this.attributes.set("class",d=>`${r} ${s(d)}`)}else this.attributes.set("class",u?`${r} ${u}`:r);if(this.attributes.items)for(let s of Object.keys(this.attributes.items))m.has(s)||this.attributes.remove(s);if(this._events)for(let s in this._events)this._bindEvent(s)}_handleError(t){let n=this;for(;n;){if(n._hooks.Error){let o=n;n._hooks.Error(o,t,()=>{o.children.update([])});return}n=n.parent}console.error("[Domphy] Unhandled error in reactive child:",t)}addEvent(t,n){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(a,r)=>{o(a,r),n(a,r)}:this._events[t]=n}addHook(t,n){let o=this._hooks[t];if(typeof o=="function"){let a=((...r)=>{let i;try{o(...r)}catch(l){i=l}try{n(...r)}catch(l){i===void 0?i=l:this._handleError(l)}if(i!==void 0)throw i});try{Object.defineProperty(a,"length",{value:Math.max(o.length,n.length),configurable:!0})}catch(r){}this._hooks[t]=a}else this._hooks[t]=n}getRoot(){let t=this;for(;t&&t instanceof Ve&&t.parent;)t=t.parent;return t}_processBehaviors(t,n=!1){var o,a;if(!t&&!n)return;let r=t!=null?t:{};for(let i of Object.keys(r)){let l=r[i],m=this._behaviorInstances.get(i);m?(o=m.update)==null||o.call(m,l.props):this.domElement?this._attachBehaviorNow(i,l):(this._pendingBehaviors.set(i,l),this._ensureBehaviorMountHook())}if(n){for(let i of[...this._behaviorInstances.keys()]){if(Object.hasOwn(r,i))continue;let l=this._behaviorInstances.get(i);this._behaviorInstances.delete(i);try{(a=l==null?void 0:l.destroy)==null||a.call(l)}catch(m){this._handleError(m)}}for(let i of[...this._pendingBehaviors.keys()])Object.hasOwn(r,i)||this._pendingBehaviors.delete(i)}}_attachBehaviorNow(t,n){try{let o=n.attach(this,n.props)||{};this._behaviorInstances.set(t,o),this._ensureBehaviorTeardownHook()}catch(o){this._handleError(o)}}_ensureBehaviorMountHook(){this._behaviorMountHooked||(this._behaviorMountHooked=!0,this.addHook("Mount",()=>{if(this._pendingBehaviors.size===0)return;let t=this._pendingBehaviors;this._pendingBehaviors=new Map,t.forEach((n,o)=>this._attachBehaviorNow(o,n))}))}_ensureBehaviorTeardownHook(){this._behaviorTeardownHooked||(this._behaviorTeardownHooked=!0,this.addHook("BeforeRemove",()=>{var t;for(let n of this._behaviorInstances.values())try{(t=n.destroy)==null||t.call(n)}catch(o){this._handleError(o)}this._behaviorInstances.clear()}))}getBehavior(t){let n=this;for(;n;){let o=n._behaviorInstances.get(t);if(o)return o;n=n.parent}}getContext(t){let n=this;for(;n&&(!n._context||!Object.hasOwn(n._context,t));)n=n.parent;return n&&n._context?n._context[t]:void 0}setContext(t,n){this._context=this._context||{},this._context[t]=n}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,n){this._metadata=this._metadata||{},this._metadata[t]=n}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(n=>n instanceof Ve?n.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(vt.includes(this.tagName))return`<${this.tagName}${t}>`;let n=this.children.generateHTML();return`<${this.tagName}${t}>${n}</${this.tagName}>`}mount(t,n){if(!t)throw new Error("Missing dom node on bind");if(ue&&this.parent===null&&t.tagName&&t.tagName.toLowerCase()!==this.tagName&&console.warn(`[Domphy] Hydration mismatch at mount root: expected <${this.tagName}> but found <${t.tagName.toLowerCase()}>. The server-rendered DOM does not match the client tree \u2014 check that mount() receives the element generated for THIS component.`),ue&&!n&&this.parent===null&&t.childNodes.length>0&&console.warn("[Domphy] mount() was called without a style element on already-rendered DOM. Reactive style updates after hydration will be dropped \u2014 pass the server-rendered <style> element as the second argument to mount()."),this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children){let o=0;this.children.items.forEach((a,r)=>{let i=t.childNodes[o];if(a instanceof Ve){if(o++,!i)return;ue&&this._devCheckHydrationMatch(a,i,r),a.mount(i)}else if(a.html){let l=a._domSpan();if(i){a.domText=i,a._domExtras=[];for(let m=1;m<l;m++){let u=t.childNodes[o+m];u&&a._domExtras.push(u)}}o+=l}else i?(ue&&i.nodeType!==3&&console.warn(`[Domphy] Hydration mismatch at <${this.tagName}> child ${r}: expected a text node ("${a.text.slice(0,40)}") but found ${i.nodeType===1?`<${i.tagName.toLowerCase()}>`:`node type ${i.nodeType}`}. The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.`),a.domText=i,o++):this.tagName==="textarea"?a.render(t):o++})}if(n){let o=n.sheet;o&&this._hydrateStyles(si(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_devCheckHydrationMatch(t,n,o){var a,r,i,l;let m=`<${this.tagName}> child ${o}`,u="The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.";if(n.nodeType!==1){console.warn(`[Domphy] Hydration mismatch at ${m}: expected <${t.tagName}> but found ${n.nodeType===3?`a text node ("${((a=n.textContent)!=null?a:"").slice(0,40)}")`:`node type ${n.nodeType}`}. ${u}`);return}let s=n,d=s.tagName.toLowerCase();if(d!==t.tagName){console.warn(`[Domphy] Hydration mismatch at ${m}: expected <${t.tagName}> but found <${d}>. ${u}`);return}for(let f of["id","class"]){let p=(i=(r=t.attributes)==null?void 0:r.items)==null?void 0:i[f];if(!p||p.value==null)continue;let b=String(p.value),x=(l=s.getAttribute(f))!=null?l:"";b!==x&&console.warn(`[Domphy] Hydration mismatch at ${m} <${t.tagName}>: expected ${f}="${b}" but found ${f}="${x}". ${u}`)}}_hydrateStyles(t){var n;if((n=this.styles)!=null&&n.items)for(let o of this.styles.items){let a=t.get(wt(o.selectorText)),r=a==null?void 0:a.shift();r&&o.mount(r)}if(this.children)for(let o of this.children.items)o instanceof Ve&&o._hydrateStyles(t)}render(t){let n=this._createDOMNode();t.appendChild(n),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,a=t.getRootNode(),r=a instanceof ShadowRoot?a:document.head;return o||(o=bn(r)),this.styles.render(o),this.children.items.forEach(i=>{if(i instanceof Ve&&i._portal){let l=i._portal(this.getRoot());l&&i.render(l)}else i.render(n)}),n}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var n;(n=this.domElement)==null||n.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let n=!1,o=()=>{n||(n=!0,t())},a=this._hooks.BeforeRemove;this._beforeRemoveFired=!0;try{a(this,o)}catch(r){this._handleError(r),o()}a.length<2&&!n?o():ue&&!n&&setTimeout(()=>{n||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else t()}}},xn=class{constructor(e){this.__domphyRawHTML=!0,this.html=e}};function Pe(e){return new xn(e)}function rt(e){return typeof e=="object"&&e!==null&&e.__domphyRawHTML===!0}var on="\u200B",Yt=class{constructor(e,t){this.type="TextNode",this._imperative=!1,this._domExtras=[],this.parent=t,this.html=rt(e);let n=this.html?e.html:e;this.text=n===""?this.emptyText():String(n)}emptyText(){var e;return((e=this.parent)==null?void 0:e.tagName)==="textarea"?"":on}_createDOMNode(){let e;if(this._domExtras=[],this.html){let t=document.createElement("template");t.innerHTML=xt(this.text.trim());let n=Array.from(t.content.childNodes);n.length===0?e=document.createTextNode(""):(e=n[0],this._domExtras=n.slice(1))}else e=document.createTextNode(this.text);return this.domText=e,e}_allDomNodes(){let e=[];this.domText&&e.push(this.domText);for(let t of this._domExtras)e.push(t);return e}_domSpan(){if(!this.html)return 1;let e=document.createElement("template");return e.innerHTML=xt(this.text.trim()),Math.max(e.content.childNodes.length,1)}setText(e){let t=rt(e),n=t?e.html:e,o=n===""?this.emptyText():String(n);if(o===this.text&&t===this.html&&this.domText)return;let a=this.html;if(this.text=o,this.html=t,!this.domText)return;if(!a&&!t&&this.domText.nodeType===3){this.domText.nodeValue=o;return}let r=this.domText,i=this._domExtras,l=this._createDOMNode(),m=r.parentNode;if(m){m.insertBefore(l,r);for(let u of this._domExtras)m.insertBefore(u,r);m.removeChild(r);for(let u of i)u.remove()}}_dispose(){this.domText=void 0,this._domExtras=[],this.text=""}generateHTML(){return this.text===on?"&#8203;":this.html?xt(this.text.trim()):to(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t);for(let n of this._domExtras)e.appendChild(n)}},ro=new Set;function hi(){ro.clear()}var wn=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return rt(e)?new Yt(e,this.owner):typeof e=="object"&&e!==null?new Z(e,this.owner,this._nextKey++):new Yt(e==null?"":String(e),this.owner)}_domReferenceAfter(e){let t=this.owner.domElement;if(!t)return null;for(let n=e;n<this.items.length;n++){let o=this.items[n],a=o instanceof Z?o.domElement:o.domText;if(a&&a.parentNode===t)return a}return null}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof Z?e.domElement?[e.domElement]:[]:e._allDomNodes();if(o.length===0)return;let a=this._domReferenceAfter(t+1);for(let r of o)r!==a&&n.insertBefore(r,a)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof Z?e.domElement?[e.domElement]:[]:e._allDomNodes(),a=t instanceof Z?t.domElement?[t.domElement]:[]:t._allDomNodes();if(o.length===0||a.length===0)return;let r=document.createComment("");n.insertBefore(r,o[0]);let i=a[a.length-1].nextSibling;for(let l of o)n.insertBefore(l,i);for(let l of a)n.insertBefore(l,r);r.remove()}update(e,t=!0,n=!1){var o,a,r,i;if(this.items.some(x=>x._imperative)){let x=this.items.filter(w=>!w._imperative),E=this.items.filter(w=>w._imperative);this.items=x.concat(E)}let l=this.items.slice(),m=new Map;for(let x of l)x instanceof Z&&x.key!==null&&x.key!==void 0&&!x._imperative&&!x._beforeRemoveFired&&m.set(x.key,x);!n&&this.owner.domElement&&((a=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||a.call(o,this.owner,e));let u=new Set(l),s=new Set,d=!1,f=0,p=ue&&l.length>0?e.length!==l.length:!1;for(let x=0;x<e.length;x++){let E=e[x],w=typeof E=="object"&&E!==null&&!rt(E),C=w?E._key:void 0,_=w?gn(E):void 0;if(ue&&w&&C===void 0&&f++,C!==void 0){let v=m.get(C);if(v instanceof Z&&v.tagName===_){m.delete(C),d=!0;let O=this.items.indexOf(v);O!==x&&O>=0&&this.move(O,x,!1,!0),v.parent=this.owner,v.patch(E),s.add(v);continue}}else if(w){let v=this.items[x];if(v instanceof Z&&v.key==null&&v.tagName===_&&u.has(v)&&!s.has(v)&&!v._imperative&&!v._beforeRemoveFired){v.parent=this.owner,v.patch(E),s.add(v);continue}}else{let v=this.items[x];if(v instanceof Yt&&u.has(v)&&!s.has(v)&&!v._imperative){v.setText(E==null?"":E),s.add(v);continue}}s.add(this.insert(E,x,t,!0,!0))}let b=this.items.slice(e.length);for(let x of b)x._imperative||this.remove(x,t,!0);if(m.forEach(x=>this.remove(x,t,!0)),d&&t&&this.owner.domElement){let x=new Map;for(let E=0;E<l.length;E++)x.set(l[E],E);this._placeKeyedDom(x)}if(ue&&l.length>0&&f>0&&p){let x=this.owner.nodeId;if(!ro.has(x)){ro.add(x);let E=`[domphy] unkeyed list length changed \u2014 DOM nodes reused by position may not match their data slot (focus/scroll/input-value drift). Add _key to each item. (parent <${this.owner.tagName}>, ${f} unkeyed item${f===1?"":"s"})`;console.warn(E)}}n||(i=(r=this.owner._hooks)==null?void 0:r.Update)==null||i.call(r,this.owner)}_placeKeyedDom(e){var t;let n=this.owner.domElement;if(!n)return;let o=[],a=this.items;for(let u=0;u<a.length;u++){let s=a[u];if(s._imperative||s instanceof Z&&s._beforeRemoveFired){o.push(-2);continue}if(s instanceof Z&&s._portal){o.push(-2);continue}o.push((t=e.get(s))!=null?t:-1)}let r=new Set,i=[],l=[];for(let u=0;u<o.length;u++)o[u]>=0&&(i.push(u),l.push(o[u]));if(l.length>0){let u=[],s=[],d=new Array(l.length).fill(-1);for(let p=0;p<l.length;p++){let b=0,x=u.length;for(;b<x;){let E=b+x>>1;u[E]<l[p]?b=E+1:x=E}u[b]=l[p],s[b]=p,b>0&&(d[p]=s[b-1])}let f=s[u.length-1];for(;f!==void 0&&f>=0;)r.add(i[f]),f=d[f]}let m=null;for(let u=o.length-1;u>=0;u--){if(o[u]===-2)continue;let s=a[u],d=s instanceof Z?s.domElement?[s.domElement]:[]:s._allDomNodes();if(d.length!==0){if(!r.has(u)){let f=m;for(let p=d.length-1;p>=0;p--){let b=d[p];b.nextSibling!==f&&n.insertBefore(b,f),f=b}}m=d[0]}}}insert(e,t,n=!0,o=!1,a=!1){let r=this.items.length,i=typeof t!="number"||Number.isNaN(t)||t<0||t>r?r:t,l=this._createNode(e);if(l._imperative=!a,this.items.splice(i,0,l),l instanceof Z){l._hooks.Insert&&l._hooks.Insert(l);let m=this.owner.domElement;if(n&&m)if(l._portal){let u=l._portal(this.owner.getRoot());u&&l.render(u)}else{let u=l._createDOMNode(),s=this._domReferenceAfter(i+1);m.insertBefore(u,s);let d=m.getRootNode(),f=d instanceof ShadowRoot?d:document.head,p=bn(f);l.styles.render(p),l._hooks.Mount&&l._hooks.Mount(l),l.children.items.forEach(b=>{if(b instanceof Z&&b._portal){let x=b._portal(b.getRoot());x&&b.render(x)}else b.render(u)})}}else{let m=this.owner.domElement;if(n&&m){let u=l._createDOMNode(),s=this._domReferenceAfter(i+1);m.insertBefore(u,s);for(let d of l._domExtras)m.insertBefore(d,s)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),l}remove(e,t=!0,n=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof Z){if(e._beforeRemoveFired)return;let a=()=>{let r=e.domElement,i=this.items.indexOf(e);i>=0&&this.items.splice(i,1),t&&r&&r.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let r=!1,i=()=>{r||(r=!0,a())},l=e._hooks.BeforeRemove;e._beforeRemoveFired=!0;try{l(e,i)}catch(m){e._handleError(m),i()}l.length<2&&!r?i():ue&&!r&&setTimeout(()=>{r||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter (e.g. an exit animation) but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else a()}else{if(this.items.splice(o,1),t)for(let a of e._allDomNodes())a.remove();e._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,n=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let a=this.items[e],r=this.items[t];this.items[e]=r,this.items[t]=a,n&&this._swapDomElement(a,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,n=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let a=this.items[e];this.items.splice(e,1),this.items.splice(t,0,a),n&&this._moveDomElement(a,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},Oe=new Set,io=!1;function En(e){Oe.add(e),!io&&(io=!0,Et(Cn))}function Cn(){for(io=!1;Oe.size>0;){let e=[...Oe];Oe.clear();for(let t of e)try{t()}catch(n){console.error("[Domphy] Uncaught error in effect:",n)}}}function kn(){let e=0;for(;un()||Oe.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}mn(),Cn()}}var nt=[];function fi(){return nt.length?nt[nt.length-1]:null}function co(e){let t=fi();t&&t._add(e)}var pi=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){if(this._stopped)return ue&&console.warn("[Domphy] effectScope.run() called after stop() \u2014 resources created inside are registered to the enclosing scope instead of this stopped one."),e();nt.push(this);try{return e()}finally{nt.pop()}}stop(){if(this._stopped)return;this._stopped=!0;let e,t=!1;for(let n of this._disposers)try{n()}catch(o){t?console.error("[Domphy] Additional error during effectScope.stop():",o):(e=o,t=!0)}if(this._disposers.clear(),t)throw e}};function gi(){let e=new pi;return co(()=>e.stop()),e}function _n(e){let t=!1,n=!1,o=()=>{t||r()},a=new dn(()=>{t||En(o)}),r=()=>{if(!(t||n)){n=!0,a.reset();try{hn(a,e)}finally{n=!1}}},i=()=>{t||(t=!0,a.reset(),Oe.delete(o))};co(i);try{r()}catch(l){throw i(),l}return i}function yi(e){let t="computed",n=new it,o,a=!0,r=!1,i=0,l=!1,m=()=>{l||!a||n.listenerCount(t)>0&&d()},u=new dn(()=>{l||(a=!0,En(m))});n._onEmpty=()=>{u.reset(),a=!0};let s=()=>{u.reset();try{o=hn(u,e)}catch(p){throw a=!0,p}i++,n._version=i,a=!1,r=!0},d=()=>{let p=o,b=r;s(),!(b&&o===p)&&n.notify(t,o)},f=p=>{if(l)return o;let b=null;return p?n.addListener(t,p):(b=lo(),b&&n.addListener(t,b.handler)),a&&(r&&n.listenerCount(t)>0?d():s()),b==null||b._consumedVersions.set(n,i),o};return co(()=>{l||(l=!0,u.reset(),Oe.delete(m),n._dispose())}),{_isState:!0,_notifier:n,get:f}}function bi(e){return cn(e)}function vi(e){return so(e)}function Si(e,t,n){let o,a=!0;return _n(()=>{let r=typeof e=="function"?e():e.get();(!a||n!=null&&n.immediate)&&t(r,o),o=r,a=!1})}function xi(e){let t=new Promise(n=>{Et(()=>{kn(),n()})});return e?t.then(e):t}var wi=class{constructor(e){this._notifier=new it,this.initialRecord=Xt({},e),this._record=Xt({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let n=lo();n&&this._notifier.addListener(e,n.handler)}return this._record[e]}set(e,t){Object.is(this._record[e],t)||(this._record[e]=t,this._notifier.notify(e,t))}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var Mt={};bt(Mt,{COLOR_ROLES:()=>Li,ElementTones:()=>lt,Palette:()=>Ui,Ramp:()=>$n,Swatch:()=>po,TONE_STEPS:()=>G,ToneAliases:()=>Ot,applySystemTheme:()=>Pi,calcDeltaE2000:()=>xo,calcScore:()=>wo,calcStatistics:()=>Bi,contrastRatio:()=>Vi,createMonotone:()=>Dt,cssRgbToRgb:()=>Ai,fromLightnessEAL:()=>zi,generateRamp:()=>Rn,generateTheme:()=>Zi,getTheme:()=>Le,hexToRgb:()=>me,isValidHex:()=>On,labToLch:()=>Mn,labToRgb:()=>Ln,lchToLab:()=>Ni,mix:()=>Hi,normalizeHex:()=>So,oklabToRgb:()=>Lt,resolveThemeColor:()=>ea,rgbToHex:()=>xe,rgbToLab:()=>Ue,rgbToOklab:()=>ct,rootMeanSquare:()=>Fe,scale:()=>ji,setTheme:()=>_i,themeApply:()=>Di,themeCSS:()=>mo,themeColor:()=>c,themeColorToken:()=>Eo,themeDensity:()=>g,themeFluidSpacing:()=>Oi,themeName:()=>Pt,themeSize:()=>S,themeSpacing:()=>h,themeTokens:()=>vo,themeVars:()=>Tt,toLightnessEAL:()=>Pn});var H=Math.pow,Ei={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#ffe5e5","#ffcaca","#ffaeae","#ff9191","#ff7474","#ff5757","#f93a3a","#e82222","#d40f0f","#b80000","#9c0000","#800000","#640000","#480000","#2c0000","#140000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,attention:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},st=Ei,yo=e=>JSON.parse(JSON.stringify(e)),at=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),qe={light:yo(st),dark:Ti(st)},G=st.colors.neutral.length,We=8,kt=5,_t=null,uo=new Map;function bo(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Ke(e,t){if(/[;}]/.test(e)||/<\/\s*style/i.test(e))throw new Error(`${t} contains unsafe CSS characters (";", "}", or "</style") \u2014 theme values are interpolated into a <style> block`)}function Ci(e){for(let t in e)if(!Object.keys(st).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes!==void 0){if(!(Array.isArray(e.fontSizes)&&e.fontSizes.length===We&&e.fontSizes.every(t=>typeof t=="string"&&t.length>0)))throw new Error(`fontSize must be array of ${We} non-empty string (the size scale has ${We} steps: 0\u2013${We-1})`);e.fontSizes.forEach((t,n)=>Ke(t,`fontSizes[${n}]`))}if(e.densities){if(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number"))throw new Error("densities must be array of number");if(e.densities.length!==kt)throw new Error(`densities must have exactly ${kt} entries (the density scale has ${kt} steps: 0\u2013${kt-1}), got ${e.densities.length}`);if(e.densities.some(t=>!Number.isFinite(t)||t<=0))throw new Error("densities entries must be positive finite numbers")}if(e.darkBias!==void 0){let t=e.darkBias;if(typeof t!="number"||!Number.isInteger(t)||t<0||t>G-1)throw new Error(`darkBias must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object");for(let n in t){let o=t[n];typeof o=="string"&&Ke(o,`custom.${n}`)}}if("colors"in e){let t=e.colors;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(n=>Array.isArray(n)&&n.every(o=>typeof o=="string"))))throw new Error("colors must be an object of string[]");for(let n in t){Ke(n,`colors role "${n}"`);let o=t[n];if(o.length!==G)throw new Error(`colors.${n} must have exactly ${G} tone steps (got ${o.length}) \u2014 the tone model is fixed at shift-0\u2026shift-${G-1}`);if(o.some(a=>a.length===0))throw new Error(`colors.${n} must contain only non-empty strings`);o.forEach((a,r)=>Ke(a,`colors.${n}[${r}]`))}}if("baseTones"in e){let t=e.baseTones;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(n=>typeof n=="number")))throw new Error("baseTones must be an object of number");for(let n in t){let o=t[n];if(!Number.isInteger(o)||o<0||o>G-1)throw new Error(`baseTones.${n} must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}}if("direction"in e&&e.direction!=="lighten"&&e.direction!=="darken")throw new Error('direction must be "lighten" or "darken"')}function Dn(e,t){var n;for(let o of Object.keys(t))o==="__proto__"||o==="constructor"||o==="prototype"||(t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((n=e[o])!=null||(e[o]={}),Dn(e[o],t[o])):e[o]=t[o])}function ki(e,t){Ke(e,"theme name");let n={},o=bo(t),a=at(e);for(let i in t){let l=t[i];if(i==="colors")for(let m in t.colors){let u=at(m);[...Array(o).keys()].forEach(s=>n[`--${u}-${s}`]=t.colors[m][s])}else if(i==="fontSizes")[...Array(We).keys()].forEach(m=>n[`--fontSize-${m}`]=t.fontSizes[m]);else if(i==="custom"&&l&&typeof l=="object")for(let m in l)n[`--custom-${at(m)}`]=l[m]}let r="";for(let i in n)r+=` ${i}: ${n[i]};
4
+ `;return`[data-theme="${a}"] {
5
+ ${r}}`}function Le(e){if(!qe[e])throw Error(`Theme "${e}" not found`);return qe[e]}function _i(e,t){Ke(e,"theme name"),Ci(t),qe[e]||(qe[e]=yo(st)),Dn(qe[e],t),_t=null,uo.clear()}function Ti(e){let t=yo(e);t.direction="lighten";for(let n in t.colors)t.colors[n].reverse(),t.baseTones[n]=t.colors[n].length-1-t.baseTones[n];return t}function vo(e){let t=uo.get(e);if(t)return t;let n=Le(e),o=bo(n),a={};for(let r in n){let i=n[r];if(r==="colors")for(let l in n.colors){let m={};[...Array(o).keys()].forEach(u=>m[u]=n.colors[l][u]),a[l]=m}else if(r==="fontSizes")a.fontSizes=n.fontSizes;else if(r==="densities")a.densities=n.densities;else if(r==="custom"&&(a.custom={},i&&typeof i=="object"))for(let l in i)a.custom[l]=i[l]}return uo.set(e,a),a}function Tt(){if(_t)return _t;let e=Le("light"),t=bo(e),n={};for(let o in e){let a=e[o];if(o==="colors")for(let r in e.colors){let i=at(r),l={};[...Array(t).keys()].forEach(m=>l[m]=`var(--${i}-${m})`),n[r]=l}else if(o==="fontSizes")n.fontSizes=[...Array(We).keys()].map(r=>`var(--fontSize-${r})`);else if(o==="custom"&&(n.custom={},a&&typeof a=="object"))for(let r in a)n.custom[r]=`var(--custom-${at(r)})`}return _t=n,n}function mo(){return Object.entries(qe).map(([e,t])=>ki(e,t)).join(`
6
+ `)}function Di(e){var t;if(typeof document!="undefined")if(e){e.textContent=mo();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=mo(),document.head.appendChild(e)}function h(e){return`calc(${e/4}em)`}function Oi(e,t,n=320,o=1280){let a=e/4,r=t/4,i=(r-a)/(o-n)*100,l=a-i*n/100,m=parseFloat(l.toFixed(4))===0?`${i.toFixed(4)}vw`:`${l.toFixed(4)}em + ${i.toFixed(4)}vw`;return`clamp(${a}em, ${m}, ${r}em)`}function Pi(e,t={}){if(typeof document=="undefined")throw new Error('applySystemTheme() requires a browser DOM \u2014 "document" is not defined. For SSR, call it only on the client (e.g. inside an _onMount lifecycle hook, or behind a typeof window !== "undefined" guard).');let n=e!=null?e:document.documentElement,{persist:o=!0,storageKey:a="dp-theme"}=t,r=()=>{if(o){let m=localStorage.getItem(a);if(m==="light"||m==="dark")return m}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};n.setAttribute("data-theme",r());let i=window.matchMedia("(prefers-color-scheme: dark)"),l=m=>{(!o||!localStorage.getItem(a))&&n.setAttribute("data-theme",m.matches?"dark":"light")};return i.addEventListener("change",l),()=>i.removeEventListener("change",l)}function Pt(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let n="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(n=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),n}var Li=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],ho=["inherit"];[...Array(5).keys()].forEach(e=>{ho.push(`decrease-${e}`),ho.push(`increase-${e}`)});function Mi(e,t="inherit"){if(!ho.includes(t))throw Error(`density name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(4,n))}function Ii(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(n=Mi(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function g(e){let t=Ii(e);return Le(e?Pt(e):"light").densities[t]}var Ri=e=>{let t=n=>{let o=Math.max(0,Math.min(1,n)),a=o<=.0031308?12.92*o:1.055*H(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(a*255)))};return e.map(t)},$i=e=>{let t=n=>n>.04045?H((n+.055)/1.055,2.4):n/12.92;return e.map(t)},xe=e=>{let[t,n,o]=Ri(e);return t=t.toString(16).padStart(2,"0"),n=n.toString(16).padStart(2,"0"),o=o.toString(16).padStart(2,"0"),`#${t}${n}${o}`},On=e=>typeof e=="string"&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e),So=e=>{if(!On(e))throw new Error(`Invalid hex color "${e}": expected "#rgb", "#rgba", "#rrggbb", or "#rrggbbaa" (hex digits 0-9, a-f, case-insensitive).`);let t=e.slice(1).toLowerCase();return t.length<=4&&(t=t.split("").map(n=>n+n).join("")),`#${t}`},me=e=>{let t=So(e),n=parseInt(t.slice(1,3),16)/255,o=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255;return $i([n,o,a])},ct=e=>{let t=.4122214708*e[0]+.5363325363*e[1]+.0514459929*e[2],n=.2119034982*e[0]+.6806995451*e[1]+.1073969566*e[2],o=.0883024619*e[0]+.2817188376*e[1]+.6299787005*e[2],a=Math.cbrt(t),r=Math.cbrt(n),i=Math.cbrt(o);return[.2104542553*a+.793617785*r-.0040720468*i,1.9779984951*a-2.428592205*r+.4505937099*i,.0259040371*a+.7827717662*r-.808675766*i]},Lt=e=>{let[t,n,o]=e,a=t+.3963377774*n+.2158037573*o,r=t-.1055613458*n-.0638541728*o,i=t-.0894841775*n-1.291485548*o,l=a*a*a,m=r*r*r,u=i*i*i;return[4.0767416621*l-3.3077115913*m+.2309699292*u,-1.2684380046*l+2.6097574011*m-.3413193965*u,-.0041960863*l-.7034186147*m+1.707614701*u]},Pn=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,m=.1307,u=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,d=0;return(r<=90||r>=270)&&(d=m*Math.abs(Math.cos(r*(Math.PI/180)))+u),t+(s+d)*a},zi=(e,t)=>{let[,n,o]=t,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,m=.1307,u=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,d=0;return(r<=90||r>=270)&&(d=m*Math.abs(Math.cos(r*(Math.PI/180)))+u),Math.max(0,e-(s+d)*a)},Ni=e=>{let[t,n,o]=e,a=o*Math.PI/180;return[t,n*Math.cos(a),n*Math.sin(a)]},Ue=e=>{let[t,n,o]=e,a=.4124564*t+.3575761*n+.1804375*o,r=.2126729*t+.7151522*n+.072175*o,i=.0193339*t+.119192*n+.9503041*o,l=.95047,m=1,u=1.08883,s=b=>b>.008856?Math.cbrt(b):7.787*b+16/116,d=s(a/l),f=s(r/m),p=s(i/u);return[116*f-16,500*(d-f),200*(f-p)]},Ln=e=>{let[t,n,o]=e,a=(t+16)/116,r=n/500+a,i=a-o/200,l=b=>H(b,3)>.008856?H(b,3):(b-16/116)/7.787,m=.95047,u=1,s=1.08883,d=l(r)*m,f=l(a)*u,p=l(i)*s;return[3.2404542*d-1.5371385*f-.4985314*p,-.969266*d+1.8760108*f+.041556*p,.0556434*d-.2040259*f+1.0572252*p]},Mn=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o);if(a<1e-4)return[t,0,0];let r=(Math.atan2(o,n)*180/Math.PI+360)%360;return r>=359.9999&&(r=0),[t,a,r]},xo=(e,t)=>{let[n,o,a]=e,[r,i,l]=t,m=Math.hypot(o,a),u=Math.hypot(i,l),s=(m+u)/2,d=.5*(1-Math.sqrt(H(s,7)/(H(s,7)+H(25,7)))),f=o*(1+d),p=i*(1+d),b=Math.hypot(f,a),x=Math.hypot(p,l),E=(b+x)/2,w=(I,K)=>{if(I===0&&K===0)return 0;let re=Math.atan2(K,I)*180/Math.PI;return re>=0?re:re+360},C=w(f,a),_=w(p,l),v=_-C,O=Math.abs(v),D=C+_,R=b*x===0,j;R?j=0:O<=180?j=v:v>180?j=v-360:j=v+360;let $;R?$=D:O<=180?$=D/2:D<360?$=(D+360)/2:$=(D-360)/2;let F=1-.17*Math.cos(($-30)*Math.PI/180)+.24*Math.cos(2*$*Math.PI/180)+.32*Math.cos((3*$+6)*Math.PI/180)-.2*Math.cos((4*$-63)*Math.PI/180),te=r-n,U=x-b,Y=2*Math.sqrt(b*x)*Math.sin(j/2*Math.PI/180),Q=(n+r)/2,J=1+.015*H(Q-50,2)/Math.sqrt(20+H(Q-50,2)),oe=1+.045*E,ae=1+.015*E*F,ne=30*Math.exp(-H(($-275)/25,2)),ee=-(2*Math.sqrt(H(E,7)/(H(E,7)+H(25,7))))*Math.sin(2*ne*Math.PI/180);return Math.sqrt(H(te/J,2)+H(U/oe,2)+H(Y/ae,2)+ee*(U/oe)*(Y/ae))},Ai=e=>{let t=()=>new Error(`Invalid CSS rgb() "${e}": expected "rgb(r, g, b)" with channels 0-255 or 0%-100% (comma or space separated, optional alpha after "," or "/").`),n=/^\s*rgba?\(\s*(.+?)\s*\)\s*$/i.exec(e);if(!n)throw t();let o=n[1].split("/")[0],a=o.includes(",")?o.split(",").map(l=>l.trim()).slice(0,3):o.trim().split(/\s+/);if(a.length!==3)throw t();let r=a.map(l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l));if(r.some(l=>!Number.isFinite(l)))throw t();let i=l=>{let m=l/255;return m<=.04045?m/12.92:H((m+.055)/1.055,2.4)};return r.map(i)},Dt=e=>{if(e.length<1)return u=>0;let t=[...e].sort((u,s)=>u[0]-s[0]),n=[];for(let u=0;u<t.length;u++)(u===0||t[u][0]!==t[u-1][0])&&n.push(t[u]);let o=n.length;if(o===1)return u=>n[0][1];let a=n.map(u=>u[0]),r=n.map(u=>u[1]),i=[],l=[];for(let u=0;u<o-1;u++)i[u]=a[u+1]-a[u],l[u]=(r[u+1]-r[u])/i[u];let m=new Array(o);m[0]=l[0],m[o-1]=l[o-2];for(let u=1;u<o-1;u++){let s=l[u-1],d=l[u];if(s*d<=0)m[u]=0;else{let f=(1+i[u]/(i[u-1]+i[u]))/3;m[u]=s*d/((1-f)*s+f*d)}}return u=>{if(u<=a[0])return r[0];if(u>=a[o-1])return r[o-1];let s=0,d=o-2,f=0;for(;s<=d;){let _=Math.floor((s+d)/2);if(u>=a[_]&&u<=a[_+1]){f=_;break}u<a[_]?d=_-1:s=_+1}let p=i[f],b=(u-a[f])/p,x=b*b,E=x*b,w=m[f]*p,C=m[f+1]*p;return(2*E-3*x+1)*r[f]+(E-2*x+b)*w+(-2*E+3*x)*r[f+1]+(E-x)*C}};function Fe(e){let t=e.length;if(t===0)return 0;let n=0;for(let o=0;o<t;o++)n+=e[o]*e[o];return Math.sqrt(n/t)}var Bi=e=>{let t=e.length;if(t===0)return{min:0,max:0,avg:0};let n=e[0],o=e[0],a=0;for(let r=0;r<t;r++){let i=e[r];i<n&&(n=i),i>o&&(o=i),a+=i}return{min:n,max:o,avg:a/t}},wo=e=>{let t=e.length;if(t===0)return 0;let n=1e-6,o=e.reduce((i,l)=>i*(l+n),1),a=H(o,1/t),r=Math.max(0,Math.min(1,a));return parseFloat((r*100).toFixed(2))},Vi=(e,t)=>{let[n,o,a]=me(e),[r,i,l]=me(t),m=.2126*n+.7152*o+.0722*a,u=.2126*r+.7152*i+.0722*l,s=Math.max(m,u),d=Math.min(m,u);return(s+.05)/(d+.05)},Hi=(e,t,n=.5,o="oklab")=>{let a=Math.max(0,Math.min(1,n)),r=me(e),i=me(t);if(o==="rgb")return xe(r.map((u,s)=>u+a*(i[s]-u)));if(o==="lab"){let u=Ue(r),s=Ue(i);return xe(Ln(u.map((d,f)=>d+a*(s[f]-d))))}let l=ct(r),m=ct(i);return xe(Lt(l.map((u,s)=>u+a*(m[s]-u))))},ji=(e,t)=>{if(e.length<2)throw new Error("scale() requires at least 2 colors");if(t<1)return[];if(t===1)return[xe(me(e[0]))];let n=e.map(r=>ct(me(r))),o=n.length-1,a=[];for(let r=0;r<t;r++){let i=r/(t-1)*o,l=Math.min(Math.floor(i),o-1),m=i-l,u=n[l],s=n[l+1];a.push(xe(Lt(u.map((d,f)=>d+m*(s[f]-d)))))}return a},In=.605,fo=.685;function Fi(e){let t=H(e,In);return t/(1+fo*(1-t))}function Wi(e){let t=e*(1+fo)/(1+e*fo);return H(t,1/In)}function Ki(e,t){return Math.sqrt(H(e[0]-t[0],2)+H(e[1]-t[1],2)+H(e[2]-t[2],2))}function qi(e){let t=[[0,0,0],...e,[1,1,1]].map(s=>ct(s)),n=t.map(s=>s[0]),o=t.map(s=>s[1]),a=t.map(s=>s[2]),r=[0],i=0;for(let s=1;s<t.length;s++)i+=Ki(t[s],t[s-1]),r.push(i);let l=r.map(s=>Wi(i>0?s/i:0)),m=Dt(l.map((s,d)=>[s,o[d]])),u=Dt(l.map((s,d)=>[s,a[d]]));return{colorAtParam:s=>{let d=Fi(s),f=0;for(let _=0;_<l.length-1;_++)if(d<=l[_+1]){f=_;break}let p=l[f],b=l[f+1],x=(d-p)/(b-p||1),E=n[f]+x*(n[f+1]-n[f]),w=m(d),C=u(d);return Lt([E,w,C])},parameters:l.slice(1,-1)}}function Rn(e,t){let n=Array.isArray(e)?e:[e];if(n.length===0)throw new Error("generateRamp requires at least one anchor color");if(t<=0)return[];if(t===1)return[xe(me(n[0]))];let o=n.map(s=>xe(me(s))).reverse(),{colorAtParam:a,parameters:r}=qi([...n.map(me)].reverse()),i=[],l=[0,...r,1],m=l.map(s=>Math.round(s*(t-1))),u=0;for(let s=0;s<t;s++){for(;u<m.length-2&&s>m[u+1];)u++;let d=m[u],f=m[u+1],p=l[u],b=l[u+1],x;if(f<=d)x=p;else{let E=(s-d)/(f-d);x=p+E*(b-p)}i.push(xe(a(x)))}if(o.length>1)for(let s=0;s<o.length;s++){let d=m[s+1];d>=0&&d<i.length&&(i[d]=o[s])}return i.reverse()}var po=class{constructor(e){this.hex=e}get rgb(){return me(this.hex)}get lab(){return Ue(this.rgb)}get lch(){return Mn(this.lab)}get lightness(){return Pn(this.lab)}get chroma(){return this.lch[1]}get hue(){return this.lch[2]}get luminance(){let[e,t,n]=this.rgb;return .2126*e+.7152*t+.0722*n}},$n=class{constructor(e=[],t="brand"){this.swatches=e.map(n=>new po(n)),this.name=t}get colors(){return this.swatches.map(e=>e.hex)}get peakChroma(){let e=this.colors.slice(2,-2),t="",n=-1/0;for(let o of e){let a=new po(o);a.chroma>n&&(n=a.chroma,t=o)}return n<6?this.colors[Math.ceil(this.steps/2)]:t}get steps(){return this.colors.length}get baseColor(){return this.colors.length===0?"":this.peakChroma||this.colors[Math.floor(this.colors.length/2)]}get baseIndex(){return this.colors.length===0?-1:this.colors.findIndex(e=>e.toLowerCase()===this.baseColor.toLowerCase())}get wcag(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let a of[30,45,70])o[a]={efficiency:1,target:a/10,span:0,value:0};return o}for(let a of[30,45,70]){let r=a/10,i=n,l=0;for(let m=1;m<t;m++){let u=1/0;for(let s=0;s<t-m;s++){let d=e[s].luminance,f=e[s+m].luminance,p=(Math.max(d,f)+.05)/(Math.min(d,f)+.05);p<u&&(u=p)}if(u>=r){i=m,l=u;break}m===n&&(l=u)}o[a]={efficiency:i/n,target:r,span:i,value:l}}return o}get apca(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let r of[45,60,75])o[r]={efficiency:1,target:r,span:0,value:0};return o}let a=(r,i)=>{let l=Math.SQRT2,m=r<.022?r+H(.022-r,l):r,u=i<.022?i+H(.022-i,l):i,s=u>=m?(H(u,.56)-H(m,.57))*114:(H(u,.65)-H(m,.62))*114;return Math.abs(s)<10?0:(s=s>0?s-2.7:s+2.7,Math.round(s))};for(let r of[45,60,75]){let i=r,l=n,m=0;for(let u=1;u<t;u++){let s=1/0;for(let d=0;d<t-u;d++){let f=e[d].luminance>e[d+u].luminance?e[d].luminance:e[d+u].luminance,p=e[d].luminance>e[d+u].luminance?e[d+u].luminance:e[d].luminance,b=Math.abs(a(p,f));b<s&&(s=b)}if(s>=i){l=u,m=s;break}u===n&&(m=s)}o[r]={efficiency:l/n,target:i,span:l,value:m}}return o}get deltaECurve(){let e=[0];for(let t=1;t<this.swatches.length;t++){let n=xo(this.swatches[t-1].lab,this.swatches[t].lab);e.push(e[t-1]+n)}return e}get unwrapHues(){let e=this.swatches.map(n=>n.hue).slice(1,-1);if(e.length===0)return[];let t=[e[0]];for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];o>180?o-=360:o<-180&&(o+=360),t.push(t[n-1]+o)}return t}get lightnessLinearity(){let e=this.swatches.map(d=>d.lightness),t=e.length;if(t<2)return 1;let n=0,o=0,a=0,r=0;for(let d=0;d<t;d++)n+=d,o+=e[d],a+=d*e[d],r+=d*d;let i=t*r-n*n;if(Math.abs(i)<1e-10)return 1;let l=(t*a-n*o)/i,m=(o-l*n)/t;if(Math.abs(l*(t-1))<.001)return 1;let u=0,s=0;for(let d=0;d<t;d++){let f=l*d+m,p=e[d]-f;u+=p*p;let b=Math.max(f-Math.min(m,l*(t-1)+m),Math.max(m,l*(t-1)+m)-f);s+=b*b}return Math.max(0,Math.min(1,1-Math.sqrt(u/t)/Math.sqrt(s/t)))}get chromaSmoothness(){let e=this.swatches.map(d=>d.chroma),t=e.length;if(t<3)return 1;let n=133.8,o=Math.max(...e);if(o<=.01)return 1;let a=e.map(d=>d/o*n),r=Math.min(...a),i=Math.max(...a),l=a.indexOf(i),m=Dt([[0,a[0]],[l,i],[t-1,a[t-1]]]),u=0,s=0;for(let d=0;d<t;d++){let f=m(d),p=a[d]-f;u+=p*p,s+=H(Math.max(f-r,i-f),2)}return Math.max(0,Math.min(1,1-Math.sqrt(u/t)/Math.sqrt(s/t)))}get spacingUniformity(){let e=this.deltaECurve,t=e.length;if(t<2)return 1;let n=[];for(let i=1;i<t;i++){let l=e[i]-e[i-1];if(l<0)return 0;n.push(l)}let o=n.reduce((i,l)=>i+l,0)/n.length;if(o<=1e-6)return 0;let a=0;for(let i of n)a+=H(i-o,2);let r=Math.sqrt(a/n.length)/o;return Math.max(0,Math.min(1,1/(1+r)))}get hueStability(){var e,t,n;let o=this.unwrapHues,a=o.length;if(a<2)return 1;let r=(n=(t=o[this.baseIndex-1])!=null?t:(e=this.swatches[this.baseIndex])==null?void 0:e.hue)!=null?n:0,i=0,l=0;for(let m=0;m<a;m++){let u=Math.abs(o[m]-r)%360;u>180&&(u=360-u),i+=u*u;let s=m/(a-1)*180;l+=s*s}return Math.max(0,Math.min(1,1-Math.sqrt(i/a)/(Math.sqrt(l/a)||1)))}get contrastEfficiency(){let e=this.wcag[45].span,t=this.steps;if(t<=1)return 1;let n=.501,o=e/(t-1);return o<=n?1:o>=1?0:1-(o-n)/(1-n)}get metrics(){return{lightnessLinearity:this.lightnessLinearity,chromaSmoothness:this.chromaSmoothness,spacingUniformity:this.spacingUniformity,hueStability:this.hueStability,contrastEfficiency:this.contrastEfficiency}}get score(){return wo(Object.values(this.metrics))}},Ui=class{constructor(e={},t="Collection 1"){this.ramps=Object.entries(e).map(([n,o])=>new $n(o,n)),this.name=t}get colors(){return Object.fromEntries(this.ramps.map(e=>[e.name,e.colors]))}get steps(){var e;return((e=this.ramps[0])==null?void 0:e.steps)||0}get wcag(){let e={},t=this.steps;for(let n of[30,45,70]){let o=this.ramps.map(i=>i.wcag[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n/10,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get apca(){let e={},t=this.steps;for(let n of[45,60,75]){let o=this.ramps.map(i=>i.apca[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get contrastEfficiency(){return Fe(this.ramps.map(e=>e.contrastEfficiency))}get lightnessLinearity(){return Fe(this.ramps.map(e=>e.lightnessLinearity))}get chromaSmoothness(){return Fe(this.ramps.map(e=>e.chromaSmoothness))}get hueStability(){return Fe(this.ramps.map(e=>e.hueStability))}get spacingUniformity(){return Fe(this.ramps.map(e=>e.spacingUniformity))}get score(){return wo([this.contrastEfficiency,this.lightnessLinearity,this.chromaSmoothness,this.hueStability,this.spacingUniformity])}},Gi=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],Yi=[.75,1,1.5,2,2.5];function Xi(e,t){let n=Ue(me(t)),o=0,a=1/0;for(let r=0;r<e.length;r++){let i=xo(n,Ue(me(e[r])));i<a&&(a=i,o=r)}return o}function Zi(e,t={}){var n,o,a,r,i;if(t.steps!==void 0&&t.steps!==G)throw new Error(`generateTheme() steps must be ${G} (the tone model is fixed at shift-0\u2026shift-${G-1}), got ${t.steps}`);let l=G,m={},u={};for(let[s,d]of Object.entries(e)){let f;try{f=So(d)}catch(b){throw new Error(`baseColors.${s}: ${b instanceof Error?b.message:String(b)}`)}let p=Rn(f,l);m[s]=p,u[s]=Xi(p,f)}return{direction:(n=t.direction)!=null?n:"darken",colors:m,baseTones:u,fontSizes:(o=t.fontSizes)!=null?o:Gi,densities:(a=t.densities)!=null?a:Yi,darkBias:(r=t.darkBias)!=null?r:1,custom:(i=t.custom)!=null?i:{}}}var go=["inherit"];[...Array(8).keys()].forEach(e=>{go.push(`decrease-${e}`),go.push(`increase-${e}`)});function zn(e,t="inherit"){if(!go.includes(t))throw Error(`size name "${t}" invalid`);let n;if(t==="inherit")n=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);n=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);n=e-o}else n=e;return Math.max(0,Math.min(7,n))}function Ji(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let n=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(n=zn(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function S(e,t="inherit"){let n=zn(Ji(e),t);return Tt().fontSizes[n]}var Ot={surface:"shift-1",hover:"shift-2",border:"shift-3","border-strong":"shift-4",muted:"shift-8",text:"shift-9"},lt=["inherit","base",...Object.keys(Ot)];[...Array(G).keys()].forEach(e=>{lt.push(`decrease-${e}`),lt.push(`increase-${e}`),lt.push(`shift-${e}`)});function Tn(e,t){if(e<0||e>G-1)return e;let n=e+t;return n=Math.max(0,Math.min(G-1,n)),n}function Qi(e,t){if(e<0||e>G-1)return e;let n=Math.floor((G-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(G-1,o)),o}function Ge(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!lt.includes(t))throw Error(`tone name "${t}" invalid`);if(t in Ot&&(t=Ot[t]),t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return Tn(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return Tn(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return Qi(e,n)}else return e}function Nn(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let n=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(n=Ge(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function An(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===G-1?G-1-n:e}function ut(e,t){let n=Le(e).baseTones[t];if(n===void 0)throw new Error(`baseTones.${t} is not defined on theme "${e}" \u2014 set a base tone index (0\u2013${G-1}) via setTheme("${e}", { baseTones: { ${t}: <index> } }) so themeColor(..., "base", "${t}") can resolve`);return n}function c(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e){let l=Tt()[o];if(!l)throw Error(`color "${o}" not found on theme "light"`);return t==="base"?l[ut("light",o)]:l[Ge(0,t)]}let a=Pt(e),r=Tt()[o];if(!r)throw Error(a==="light"?`color "${o}" not found on theme "light"`:`color "${o}" not found on the "light" theme (required by node theme "${a}") \u2014 themeColor() var references are keyed on the "light" theme structure; register the role on "light" as well (e.g. setTheme("light", { colors: { ${o}: \u2026 } })) so the shared CSS-var baseline includes it`);let i;if(t==="base")i=ut(a,o);else{let l=Le(a),m=An(Nn(e),l.direction,l.darkBias);i=Ge(m,t)}return r[i]}function Eo(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,a=e?Pt(e):"light",r=vo(a)[o];if(!r)throw Error(`color "${o}" not found on theme "${a}"`);if(!e)return t==="base"?r[ut("light",o)]:r[Ge(0,t)];let i;if(t==="base")i=ut(a,o);else{let l=Le(a),m=An(Nn(e),l.direction,l.darkBias);i=Ge(m,t)}return r[i]}function ea(e={}){let{theme:t="light",tone:n="inherit",color:o="inherit"}=e,a=o==="inherit"?"neutral":o,r=vo(t)[a];if(!r)throw Error(`color "${a}" not found on theme "${t}"`);return n==="base"?r[ut(t,a)]:r[Ge(0,n)]}var Ut={};bt(Ut,{abbreviation:()=>ta,accordion:()=>oa,alert:()=>na,avatar:()=>ra,badge:()=>ia,blockquote:()=>aa,breadcrumb:()=>la,breadcrumbEllipsis:()=>sa,button:()=>ma,buttonGhost:()=>Co,buttonSwitch:()=>da,card:()=>fa,code:()=>pa,combobox:()=>al,command:()=>ll,commandItem:()=>cl,commandSearch:()=>sl,datePicker:()=>dl,descriptionList:()=>pl,details:()=>gl,dialog:()=>bl,divider:()=>vl,drawer:()=>xl,elevation:()=>W,emphasis:()=>wl,empty:()=>El,errorBoundary:()=>kl,fab:()=>Tl,figure:()=>Dl,focusRing:()=>T,formGroup:()=>Ol,grid:()=>Pl,heading:()=>Ml,horizontalRule:()=>Il,icon:()=>Rl,image:()=>$l,inputCheckbox:()=>zl,inputColor:()=>Nl,inputDateTime:()=>Al,inputFile:()=>Bl,inputNumber:()=>Vl,inputOTP:()=>Hl,inputPassword:()=>Kl,inputRadio:()=>ql,inputRange:()=>Ul,inputSearch:()=>Gl,inputSwitch:()=>Yl,inputText:()=>Xl,keyboard:()=>Zl,label:()=>Jl,link:()=>Ql,linkButton:()=>os,list:()=>ns,listItem:()=>rs,listItemButton:()=>is,mark:()=>as,menu:()=>ls,motion:()=>cs,orderedList:()=>us,pagination:()=>hs,panelSection:()=>fs,paragraph:()=>ps,popover:()=>gs,popoverArrow:()=>Bo,preformated:()=>ys,progress:()=>bs,rating:()=>ws,ringProgress:()=>Es,row:()=>Ho,scrollArea:()=>Cs,segmented:()=>_s,select:()=>Ts,selectBox:()=>Ls,selectItem:()=>Ms,selectList:()=>Is,skeleton:()=>Rs,small:()=>$s,spinner:()=>zs,splitter:()=>Ns,splitterHandle:()=>Vs,splitterPanel:()=>Bs,stack:()=>Hs,steps:()=>Fs,strong:()=>Ws,subscript:()=>Ks,superscript:()=>qs,table:()=>Us,tabs:()=>Gs,tag:()=>ht,textarea:()=>Ys,timeline:()=>Xs,timelineItem:()=>Zs,toast:()=>Js,toggleGroup:()=>tc,toolbar:()=>oc,toolbarSpacer:()=>nc,tooltip:()=>rc,transitionGroup:()=>ic,unorderedList:()=>ac,visuallyHidden:()=>lc});function ta(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>S(r),backgroundColor:r=>c(r),color:r=>c(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>c(r,"shift-7",t.get(r)),textUnderlineOffset:h(.72),cursor:"help","&:hover":{color:r=>c(r,"shift-11",n.get(r)),textDecorationColor:r=>c(r,"shift-9",n.get(r))}}}}function T(e,t="primary"){let n=c(e,"surface"),o=c(e,"shift-9",t);return`0 0 0 2px ${n}, 0 0 0 4px ${o}`}function oa(e={}){var a,r;let{type:t="single"}=e,n=y((a=e.color)!=null?a:"neutral","color"),o=y((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:i=>{if(t!=="single")return;let l=i.domElement;if(!l)return;let m=u=>{let s=u.target.closest("summary");if(!s)return;let d=s.closest("details");!d||d.parentElement!==l||d.open||Array.from(l.querySelectorAll(":scope > details")).forEach(f=>{f!==d&&(f.open=!1)})};l.addEventListener("click",m),i.addHook("Remove",()=>l.removeEventListener("click",m))},style:{display:"flex",flexDirection:"column",borderRadius:i=>h(g(i)*1.5),outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,outlineOffset:"-1px",color:i=>c(i,"text",n.get(i)),overflow:"hidden","& > details":{borderBottom:i=>`1px solid ${c(i,"border-strong",n.get(i))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{boxShadow:i=>T(i,o.get(i))}}}}function na(e={}){var n;let t=y((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:h(3),paddingBlock:o=>h(g(o)*2),paddingInline:o=>h(g(o)*4),borderRadius:o=>h(g(o)*1.5),boxShadow:o=>`inset ${h(1)} 0 0 0 ${c(o,"shift-8",t.get(o))}`,backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-10",t.get(o)),fontSize:o=>S(o,"inherit")}}}function ra(e={}){var n;let t=y((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",_doctorDisable:"inline-typography",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:h(9),height:h(9),fontSize:o=>S(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-11",t.get(o)),boxShadow:o=>`0 0 0 1px ${c(o,"border",t.get(o))}`,"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function ia(e={}){var a;let{label:t=999}=e,n=y(t),o=y((a=e.color)!=null?a:"danger","color");return{_doctorDisable:"inline-typography",style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:r=>h(g(r)*1.5),minWidth:h(5),height:r=>h(g(r)*5),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>S(r,"decrease-2"),fontWeight:"600",lineHeight:1,borderRadius:r=>h(g(r)*999),backgroundColor:r=>c(r,"shift-9",o.get(r)),color:r=>c(r,"shift-0",o.get(r)),boxShadow:r=>`0 0 0 1px ${c(r,"shift-0",o.get(r))}`}}}}function aa(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>S(o,"inherit"),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o)),boxShadow:o=>`inset ${h(1)} 0 0 0 ${c(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>h(g(o)*2),paddingInline:o=>h(g(o)*4),margin:0}}}function la(e={}){var o;let{separator:t="/"}=e,n=y((o=e.color)!=null?o:"neutral","color");return{_onInsert:a=>{a.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:a=>S(a,"inherit"),gap:h(1),color:a=>c(a,"text",n.get(a)),backgroundColor:a=>c(a,"inherit",n.get(a)),"& > *":{display:"inline-flex",alignItems:"center",color:a=>c(a,"text",n.get(a))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:a=>c(a,"shift-4",n.get(a)),paddingInlineStart:h(1)},"& > [aria-current=page]":{color:a=>c(a,"shift-10",n.get(a)),pointerEvents:"none"}}}}function sa(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>S(o,"inherit"),paddingInline:h(1),border:"none",background:"none",cursor:"pointer",color:o=>c(o,"text",t.get(o)),borderRadius:h(1),transition:"color 140ms ease, background-color 140ms ease, box-shadow 140ms ease","&:hover":{color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"hover",t.get(o))},"&:focus-visible":{boxShadow:o=>T(o,t.get(o))}}}}var Ye={small:"decrease-1",medium:"inherit",large:"increase-1"};var ca={small:.5,medium:1,large:1.5};function Co(e={}){var a,r,i;let t=y((a=e.color)!=null?a:"neutral","color"),n=ca[(r=e.size)!=null?r:"medium"],o=Ye[(i=e.size)!=null?i:"medium"];return{type:"button",_onInsert:l=>{l.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:l=>S(l,o),paddingBlock:l=>h(g(l)*n),paddingInline:l=>h(g(l)*n),borderRadius:l=>h(g(l)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:l=>h(g(l)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:l=>c(l,"text",t.get(l)),"&:hover:not([disabled]):not([aria-busy=true])":{color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"hover",t.get(l))},"&:active:not([disabled]):not([aria-busy=true])":{color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"increase-2",t.get(l))},"&:focus-visible":{boxShadow:l=>T(l,t.get(l))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>c(l,"border-strong","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var ua={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}};function ma(e={}){var i,l,m,u;let t=(i=e.variant)!=null?i:"outline";if(t==="ghost")return Co({color:e.color,size:e.size});let n=y((l=e.color)!=null?l:"primary","color"),o=t==="solid",a=ua[(m=e.size)!=null?m:"medium"],r=Ye[(u=e.size)!=null?u:"medium"];return A(L({type:"button",_onInsert:s=>{s.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')}},o?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{appearance:"none",fontSize:s=>S(s,r),paddingBlock:s=>h(g(s)*a.block),paddingInline:s=>h(g(s)*a.inline),borderRadius:s=>h(g(s)*1.5),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:s=>h(g(s)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o?"none":s=>`1px solid ${c(s,"border-strong",n.get(s))}`,color:s=>o?c(s,"shift-0","neutral"):c(s,"shift-13",n.get(s)),backgroundColor:s=>o?c(s,"shift-13",n.get(s)):c(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{color:s=>o?c(s,"shift-0","neutral"):c(s,"shift-14",n.get(s)),backgroundColor:s=>o?c(s,"shift-14",n.get(s)):c(s,"hover",n.get(s))},"&:active:not([disabled]):not([aria-busy=true])":{backgroundColor:s=>o?c(s,"shift-15",n.get(s)):c(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>T(s,n.get(s))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:s=>c(s,"shift-2","neutral"),outline:s=>`1px solid ${c(s,"border-strong","neutral")}`,color:s=>c(s,"muted","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}})}function da(e={}){var r,i;let{checked:t=!1}=e,n=y(t),o=y((r=e.color)!=null?r:"neutral","color"),a=y((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"button",_onSchedule:l=>{l.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:l=>n.get(l),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:l=>S(l),border:"none",outlineWidth:"1px",outline:l=>`1px solid ${c(l,"border",o.get(l))}`,minWidth:h(12),minHeight:h(6),borderRadius:h(999),paddingLeft:h(7),paddingRight:h(2),cursor:"pointer",transition:"padding-left 0.3s, padding-right 0.3s, background-color 140ms ease, box-shadow 140ms ease",backgroundColor:l=>c(l,"inherit",o.get(l)),color:l=>c(l,"text",o.get(l)),"&:focus-visible":{boxShadow:l=>T(l,a.get(l))},"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:h(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:h(5),height:h(5),borderRadius:h(999),color:l=>c(l,"text"),backgroundColor:l=>c(l,"decrease-2",o.get(l))},"&[aria-checked=true]":{backgroundColor:l=>c(l,"increase-3",a.get(l)),outline:"none",color:l=>c(l,"decrease-2"),paddingLeft:h(2),paddingRight:h(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${h(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var ha={low:"0 1px 2px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.10)",medium:"0 2px 4px rgba(0,0,0,0.10), 0 10px 24px rgba(0,0,0,0.14)",high:"0 6px 12px rgba(0,0,0,0.14), 0 24px 48px rgba(0,0,0,0.20)"};function W(e){return ha[e]}function fa(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>h(g(o)*2),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-10",t.get(o)),outline:o=>`1px solid ${c(o,"border-strong",t.get(o))}`,outlineOffset:"-1px",boxShadow:W("low"),overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>h(g(o)*2),paddingInline:o=>h(g(o)*4),fontWeight:"600",color:o=>c(o,"shift-11",t.get(o)),margin:0},"& > p":{gridArea:"desc",paddingInline:o=>h(g(o)*4),paddingBottom:o=>h(g(o)*2),color:o=>c(o,"text",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>h(g(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>h(g(o)*4),color:o=>c(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:h(2),paddingBlock:o=>h(g(o)*2),paddingInline:o=>h(g(o)*4),borderTop:o=>`1px solid ${c(o,"border",t.get(o))}`}}}}function pa(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),height:o=>h(g(o)*6),paddingInline:o=>h(g(o)*1.5),borderRadius:o=>h(g(o)*1)}}}var ga=Object.defineProperty,ya=Object.defineProperties,ba=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertySymbols,Un=Object.prototype.hasOwnProperty,Gn=Object.prototype.propertyIsEnumerable,Bn=(e,t,n)=>t in e?ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ge=(e,t)=>{for(var n in t||(t={}))Un.call(t,n)&&Bn(e,n,t[n]);if(Rt)for(var n of Rt(t))Gn.call(t,n)&&Bn(e,n,t[n]);return e},Re=(e,t)=>ya(e,ba(t)),Yn=(e,t)=>{var n={};for(var o in e)Un.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Rt)for(var o of Rt(e))t.indexOf(o)<0&&Gn.call(e,o)&&(n[o]=e[o]);return n},Ne=(e,t,n)=>new Promise((o,a)=>{var r=m=>{try{l(n.next(m))}catch(u){a(u)}},i=m=>{try{l(n.throw(m))}catch(u){a(u)}},l=m=>m.done?o(m.value):Promise.resolve(m.value).then(r,i);l((n=n.apply(e,t)).next())}),va=["top","right","bottom","left"],Vn=["start","end"],Cu=va.reduce((e,t)=>e.concat(t,`${t}-${Vn[0]}`,`${t}-${Vn[1]}`),[]),$t=Math.min,Ie=Math.max,zt=Math.round,It=Math.floor,we=e=>({x:e,y:e}),Sa={left:"right",right:"left",bottom:"top",top:"bottom"};function xa(e,t,n){return Ie(e,$t(t,n))}function Bt(e,t){return typeof e=="function"?e(t):e}function Ze(e){return e.split("-")[0]}function Vt(e){return e.split("-")[1]}function Xn(e){return e==="x"?"y":"x"}function Zn(e){return e==="y"?"height":"width"}function _e(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Jn(e){return Xn(_e(e))}function wa(e,t,n=!1){let o=Vt(e),a=Jn(e),r=Zn(a),i=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Nt(i)),[i,Nt(i)]}function Ea(e){let t=Nt(e);return[To(e),t,To(t)]}function To(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Hn=["left","right"],jn=["right","left"],Ca=["top","bottom"],ka=["bottom","top"];function _a(e,t,n){switch(e){case"top":case"bottom":return n?t?jn:Hn:t?Hn:jn;case"left":case"right":return t?Ca:ka;default:return[]}}function Ta(e,t,n,o){let a=Vt(e),r=_a(Ze(e),n==="start",o);return a&&(r=r.map(i=>`${i}-${a}`),t&&(r=r.concat(r.map(To)))),r}function Nt(e){let t=Ze(e);return Sa[t]+e.slice(t.length)}function Da(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function Oa(e){return typeof e!="number"?Da(e):{top:e,right:e,bottom:e,left:e}}function At(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Fn({reference:e,floating:t},n,o){let a=_e(n),r=Jn(n),i=Zn(r),l=Ze(n),m=a==="y",u=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,d=e[i]/2-t[i]/2,f;switch(l){case"top":f={x:u,y:e.y-t.height};break;case"bottom":f={x:u,y:e.y+e.height};break;case"right":f={x:e.x+e.width,y:s};break;case"left":f={x:e.x-t.width,y:s};break;default:f={x:e.x,y:e.y}}let p=Vt(n);return p&&(f[r]+=d*(p==="end"?1:-1)*(o&&m?-1:1)),f}function Pa(e){return Ne(this,arguments,function*(t,n={}){var o,a,r,i,l,m;let{x:u,y:s,platform:d,rects:f,elements:p,strategy:b}=t,{boundary:x="clippingAncestors",rootBoundary:E="viewport",elementContext:w="floating",altBoundary:C=!1,padding:_=0}=Bt(n,t),v=Oa(_),O=p[C?w==="floating"?"reference":"floating":w],D=At(yield d.getClippingRect({element:(a=yield(o=d.isElement)==null?void 0:o.call(d,O))==null||a?O:O.contextElement||(yield(r=d.getDocumentElement)==null?void 0:r.call(d,p.floating)),boundary:x,rootBoundary:E,strategy:b})),R=w==="floating"?{x:u,y:s,width:f.floating.width,height:f.floating.height}:f.reference,j=yield(i=d.getOffsetParent)==null?void 0:i.call(d,p.floating),$=(yield(l=d.isElement)==null?void 0:l.call(d,j))&&(yield(m=d.getScale)==null?void 0:m.call(d,j))||{x:1,y:1},F=At(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:R,offsetParent:j,strategy:b}):R);return{top:(D.top-F.top+v.top)/$.y,bottom:(F.bottom-D.bottom+v.bottom)/$.y,left:(D.left-F.left+v.left)/$.x,right:(F.right-D.right+v.right)/$.x}})}var La=50,Ma=(e,t,n)=>Ne(null,null,function*(){var o;let{placement:a="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,m=l.detectOverflow?l:Re(ge({},l),{detectOverflow:Pa}),u=yield(o=l.isRTL)==null?void 0:o.call(l,t),s=yield l.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=Fn(s,a,u),p=a,b=0,x={};for(let E=0;E<i.length;E++){let w=i[E];if(!w)continue;let{name:C,fn:_}=w,{x:v,y:O,data:D,reset:R}=yield _({x:d,y:f,initialPlacement:a,placement:p,strategy:r,middlewareData:x,rects:s,platform:m,elements:{reference:e,floating:t}});d=v!=null?v:d,f=O!=null?O:f,x[C]=ge(ge({},x[C]),D),R&&b<La&&(b++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(s=R.rects===!0?yield l.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:d,y:f}=Fn(s,p,u)),E=-1)}return{x:d,y:f,placement:p,strategy:r,middlewareData:x}});var Ia=(e={})=>({name:"flip",options:e,fn(t){return Ne(this,null,function*(){var n,o,a,r,i,l;let{placement:m,middlewareData:u,rects:s,initialPlacement:d,platform:f,elements:p}=t,b=Bt(e,t),{mainAxis:x=!0,crossAxis:E=!0,fallbackPlacements:w,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:v=!0}=b,O=Yn(b,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=u.arrow)!=null&&n.alignmentOffset)return{};let D=Ze(m),R=_e(d),j=Ze(d)===d,$=yield(o=f.isRTL)==null?void 0:o.call(f,p.floating),F=w||(j||!v?[Nt(d)]:Ea(d)),te=_!=="none";!w&&te&&F.push(...Ta(d,v,_,$));let U=[d,...F],Y=yield f.detectOverflow(t,O),Q=[],J=((a=u.flip)==null?void 0:a.overflows)||[];if(x&&Q.push(Y[D]),E){let oe=wa(m,s,$);Q.push(Y[oe[0]],Y[oe[1]])}if(J=[...J,{placement:m,overflows:Q}],!Q.every(oe=>oe<=0)){let oe=(((r=u.flip)==null?void 0:r.index)||0)+1,ae=U[oe];if(ae&&(!(E==="alignment"&&R!==_e(ae))||J.every(ee=>_e(ee.placement)===R?ee.overflows[0]>0:!0)))return{data:{index:oe,overflows:J},reset:{placement:ae}};let ne=(i=J.filter(ee=>ee.overflows[0]<=0).sort((ee,I)=>ee.overflows[1]-I.overflows[1])[0])==null?void 0:i.placement;if(!ne)switch(C){case"bestFit":{let ee=(l=J.filter(I=>{if(te){let K=_e(I.placement);return K===R||K==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(K=>K>0).reduce((K,re)=>K+re,0)]).sort((I,K)=>I[1]-K[1])[0])==null?void 0:l[0];ee&&(ne=ee);break}case"initialPlacement":ne=d;break;default:}if(m!==ne)return{reset:{placement:ne}}}return{}})}});var Ra=new Set(["left","top"]);function $a(e,t){return Ne(this,null,function*(){var n;let{placement:o,platform:a,elements:r}=e,i=yield(n=a.isRTL)==null?void 0:n.call(a,r.floating),l=Ze(o),m=Vt(o),u=_e(o)==="y",s=Ra.has(l)?-1:1,d=i&&u?-1:1,f=Bt(t,e),{mainAxis:p,crossAxis:b,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return m&&typeof x=="number"&&(b=m==="end"?x*-1:x),u?{x:b*d,y:p*s}:{x:p*s,y:b*d}})}var za=(e=0)=>({name:"offset",options:e,fn(t){return Ne(this,null,function*(){var n,o;let{x:a,y:r,placement:i,middlewareData:l}=t,m=yield $a(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+m.x,y:r+m.y,data:Re(ge({},m),{placement:i})}})}}),Na=(e={})=>({name:"shift",options:e,fn(t){return Ne(this,null,function*(){let{x:n,y:o,placement:a,platform:r}=t,i=Bt(e,t),{mainAxis:l=!0,crossAxis:m=!1,limiter:u={fn:({x:_,y:v})=>({x:_,y:v})}}=i,s=Yn(i,["mainAxis","crossAxis","limiter"]),d={x:n,y:o},f=yield r.detectOverflow(t,s),p=_e(a),b=Xn(p),x=d[b],E=d[p],w=(_,v)=>xa(v+f[_==="y"?"top":"left"],v,v-f[_==="y"?"bottom":"right"]);l&&(x=w(b,x)),m&&(E=w(p,E));let C=u.fn(Re(ge({},t),{[b]:x,[p]:E}));return Re(ge({},C),{data:{x:C.x-n,y:C.y-o,enabled:{[b]:l,[p]:m}}})})}});function Ht(){return typeof window!="undefined"}function Je(e){return Qn(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function Ee(e){var t;return(t=(Qn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qn(e){return Ht()?e instanceof Node||e instanceof ce(e).Node:!1}function ye(e){return Ht()?e instanceof Element||e instanceof ce(e).Element:!1}function Te(e){return Ht()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function Wn(e){return!Ht()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function jt(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=be(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function Aa(e){return/^(table|td|th)$/.test(Je(e))}function Ft(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Ba=/transform|translate|scale|rotate|perspective|filter/,Va=/paint|layout|strict|content/,Me=e=>!!e&&e!=="none",ko;function Oo(e){let t=ye(e)?be(e):e;return Me(t.transform)||Me(t.translate)||Me(t.scale)||Me(t.rotate)||Me(t.perspective)||!Po()&&(Me(t.backdropFilter)||Me(t.filter))||Ba.test(t.willChange||"")||Va.test(t.contain||"")}function Ha(e){let t=$e(e);for(;Te(t)&&!mt(t);){if(Oo(t))return t;if(Ft(t))return null;t=$e(t)}return null}function Po(){return ko==null&&(ko=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ko}function mt(e){return/^(html|body|#document)$/.test(Je(e))}function be(e){return ce(e).getComputedStyle(e)}function Wt(e){return ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $e(e){if(Je(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Wn(e)&&e.host||Ee(e);return Wn(t)?t.host:t}function er(e){let t=$e(e);return mt(t)?(e.ownerDocument||e).body:Te(t)&&jt(t)?t:er(t)}function dt(e,t=[],n=!0){var o;let a=er(e),r=a===((o=e.ownerDocument)==null?void 0:o.body),i=ce(a);if(r){let l=Do(i);return t.concat(i,i.visualViewport||[],jt(a)?a:[],l&&n?dt(l):[])}else return t.concat(a,dt(a,[],n))}function Do(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tr(e){let t=be(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Te(e),r=a?e.offsetWidth:n,i=a?e.offsetHeight:o,l=zt(n)!==r||zt(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function Lo(e){return ye(e)?e:e.contextElement}function Xe(e){let t=Lo(e);if(!Te(t))return we(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:r}=tr(t),i=(r?zt(n.width):n.width)/o,l=(r?zt(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var ja=we(0);function or(e){let t=ce(e);return!Po()||!t.visualViewport?ja:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fa(e,t=!1,n){return!!n&&t&&n===ce(e)}function ze(e,t=!1,n=!1,o){let a=e.getBoundingClientRect(),r=Lo(e),i=we(1);t&&(o?ye(o)&&(i=Xe(o)):i=Xe(e));let l=Fa(r,n,o)?or(r):we(0),m=(a.left+l.x)/i.x,u=(a.top+l.y)/i.y,s=a.width/i.x,d=a.height/i.y;if(r&&o){let f=ce(r),p=ye(o)?ce(o):o,b=f,x=Do(b);for(;x&&p!==b;){let E=Xe(x),w=x.getBoundingClientRect(),C=be(x),_=w.left+(x.clientLeft+parseFloat(C.paddingLeft))*E.x,v=w.top+(x.clientTop+parseFloat(C.paddingTop))*E.y;m*=E.x,u*=E.y,s*=E.x,d*=E.y,m+=_,u+=v,b=ce(x),x=Do(b)}}return At({width:s,height:d,x:m,y:u})}function Kt(e,t){let n=Wt(e).scrollLeft;return t?t.left+n:ze(Ee(e)).left+n}function nr(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Kt(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function Wa({elements:e,rect:t,offsetParent:n,strategy:o}){let a=o==="fixed",r=Ee(n),i=e?Ft(e.floating):!1;if(n===r||i&&a)return t;let l={scrollLeft:0,scrollTop:0},m=we(1),u=we(0),s=Te(n);if((s||!a)&&((Je(n)!=="body"||jt(r))&&(l=Wt(n)),s)){let f=ze(n);m=Xe(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}let d=r&&!s&&!a?nr(r,l):we(0);return{width:t.width*m.x,height:t.height*m.y,x:t.x*m.x-l.scrollLeft*m.x+u.x+d.x,y:t.y*m.y-l.scrollTop*m.y+u.y+d.y}}function Ka(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function qa(e){let t=Wt(e),n=e.ownerDocument.body,o=Ie(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Ie(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),r=-t.scrollLeft+Kt(e),i=-t.scrollTop;return be(n).direction==="rtl"&&(r+=Ie(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:r,y:i}}var Ua=25;function Ga(e,t,n="viewport"){let o=n==="layoutViewport",a=ce(e),r=Ee(e),i=a.visualViewport,l=r.clientWidth,m=r.clientHeight,u=0,s=0;if(i){let d=!Po()||t==="fixed";o?d||(u=-i.offsetLeft,s=-i.offsetTop):(l=i.width,m=i.height,d&&(u=i.offsetLeft,s=i.offsetTop))}if(Kt(r)<=0){let d=r.ownerDocument,f=d.body,p=getComputedStyle(f),b=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-f.clientWidth-b),E=getComputedStyle(r).scrollbarGutter==="stable both-edges"?x/2:x;E<=Ua&&(l-=E)}return{width:l,height:m,x:u,y:s}}function Ya(e,t){let n=ze(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,r=Xe(e),i=e.clientWidth*r.x,l=e.clientHeight*r.y,m=a*r.x,u=o*r.y;return{width:i,height:l,x:m,y:u}}function Kn(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Ga(e,n,t);else if(t==="document")o=qa(Ee(e));else if(ye(t))o=Ya(t,n);else{let a=or(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return At(o)}function Xa(e,t){let n=t.get(e);if(n)return n;let o=dt(e,[],!1).filter(l=>ye(l)&&Je(l)!=="body"),a=null,r=be(e).position==="fixed",i=r?$e(e):e;for(;ye(i)&&!mt(i);){let l=be(i),m=Oo(i),u=a?a.position:r?"fixed":"";!m&&(u==="fixed"||u==="absolute"&&l.position==="static")?o=o.filter(s=>s!==i):a=l,i=$e(i)}return t.set(e,o),o}function Za({element:e,boundary:t,rootBoundary:n,strategy:o}){let a=[...t==="clippingAncestors"?Ft(e)?[]:Xa(e,this._c):[].concat(t),n],r=Kn(e,a[0],o),i=r.top,l=r.right,m=r.bottom,u=r.left;for(let s=1;s<a.length;s++){let d=Kn(e,a[s],o);i=Ie(d.top,i),l=$t(d.right,l),m=$t(d.bottom,m),u=Ie(d.left,u)}return{width:l-u,height:m-i,x:u,y:i}}function Ja(e){let{width:t,height:n}=tr(e);return{width:t,height:n}}function Qa(e,t,n){let o=Te(t),a=Ee(t),r=n==="fixed",i=ze(e,!0,r,t),l={scrollLeft:0,scrollTop:0},m=we(0);if((o||!r)&&((Je(t)!=="body"||jt(a))&&(l=Wt(t)),o)){let f=ze(t,!0,r,t);m.x=f.x+t.clientLeft,m.y=f.y+t.clientTop}!o&&a&&(m.x=Kt(a));let u=a&&!o&&!r?nr(a,l):we(0),s=i.left+l.scrollLeft-m.x-u.x,d=i.top+l.scrollTop-m.y-u.y;return{x:s,y:d,width:i.width,height:i.height}}function _o(e){return be(e).position==="static"}function qn(e,t){if(!Te(e)||be(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ee(e)===n&&(n=n.ownerDocument.body),n}function rr(e,t){let n=ce(e);if(Ft(e))return n;if(!Te(e)){let a=$e(e);for(;a&&!mt(a);){if(ye(a)&&!_o(a))return a;a=$e(a)}return n}let o=qn(e,t);for(;o&&Aa(o)&&_o(o);)o=qn(o,t);return o&&mt(o)&&_o(o)&&!Oo(o)?n:o||Ha(e)||n}var el=function(e){return Ne(this,null,function*(){let t=this.getOffsetParent||rr,n=this.getDimensions,o=yield n(e.floating);return{reference:Qa(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function tl(e){return be(e).direction==="rtl"}var ol={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:Ee,getClippingRect:Za,getOffsetParent:rr,getElementRects:el,getClientRects:Ka,getDimensions:Ja,getScale:Xe,isElement:ye,isRTL:tl};function ir(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nl(e,t,n){let o=null,a,r=Ee(e);function i(){clearTimeout(a),o==null||o.disconnect(),o=null}function l(s=!1,d=1){i();let f=e.getBoundingClientRect(),{left:p,top:b,width:x,height:E}=f;if(s||t(),!x||!E)return;let w=It(b),C=It(r.clientWidth-(p+x)),_=It(r.clientHeight-(b+E)),v=It(p),O={rootMargin:`${-w}px ${-C}px ${-_}px ${-v}px`,threshold:Ie(0,$t(1,d))||1},D=!0;function R(j){let $=j[0].intersectionRatio;if(!ir(f,e.getBoundingClientRect()))return l();if($!==d){if(!D)return l();$?l(!1,$):a=setTimeout(()=>{l(!1,1e-7)},1e3)}D=!1}try{o=new IntersectionObserver(R,Re(ge({},O),{root:r.ownerDocument}))}catch(j){o=new IntersectionObserver(R,O)}o.observe(e)}let m=ce(e),u=()=>l(n);return m.addEventListener("resize",u),l(!0),()=>{m.removeEventListener("resize",u),i()}}function ar(e,t,n,o={}){let{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=Lo(e),s=a||r?[...u?dt(u):[],...t?dt(t):[]]:[];s.forEach(w=>{a&&w.addEventListener("scroll",n),r&&w.addEventListener("resize",n)});let d=u&&l?nl(u,n,r):null,f=-1,p=null;i&&(p=new ResizeObserver(([w])=>{w&&w.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p==null||p.observe(t)})),n()}),u&&!m&&p.observe(u),t&&p.observe(t));let b,x=m?ze(e):null;m&&E();function E(){let w=ze(e);x&&!ir(x,w)&&n(),x=w,b=requestAnimationFrame(E)}return n(),()=>{s.forEach(w=>{a&&w.removeEventListener("scroll",n),r&&w.removeEventListener("resize",n)}),d==null||d(),p==null||p.disconnect(),p=null,m&&cancelAnimationFrame(b)}}var lr=za;var sr=Na,cr=Ia;var ur=(e,t,n)=>{let o=new Map,a=n!=null?n:{},r=Re(ge(ge({},ol),a.platform),{_c:o});return Ma(e,t,Re(ge({},a),{platform:r}))};function de(e,t){return`domphy-${e}-${t.nodeId}`}function rl(e,t){var oe,ae,ne,ee;let{openState:n,placement:o,content:a,keepOpenOnContentHover:r}=t,{kind:i}=t,l=`floating:${i}`,m=null,u=null,s=null,d=null,f=!1,p=e.domElement,b=e.getRoot(),x=de(i,e),E={style:{position:"fixed",pointerEvents:"auto",visibility:I=>n.get(I)?"visible":"hidden"},onKeyDown:I=>{I.key==="Escape"&&D()},onMouseEnter:()=>r&&O(),onMouseLeave:()=>r&&D(),_onMount:I=>{var K;if(s=I.domElement,s.id||(s.id=x),p&&s&&!s.hasAttribute("data-theme")){let re=(K=p.closest("[data-theme]"))==null?void 0:K.getAttribute("data-theme");re&&s.setAttribute("data-theme",re)}},_portal:I=>{let K=p.closest("dialog");if(K){let fe=K.querySelector(":scope > #domphy-floating");return fe||(fe=K.ownerDocument.createElement("div"),fe.id="domphy-floating",Object.assign(fe.style,{position:"fixed",inset:"0",zIndex:"20",pointerEvents:"none"}),K.appendChild(fe)),fe}let re=I.domElement.querySelector("#domphy-floating");if(!re){let fe={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};re=I.children.insert(fe).domElement}return re}},w=I=>q(I,E);w(a);let C=()=>{f||(f=!0,d=b.children.insert(a),d._behaviorInstances.set(l,Q))},_=()=>{f&&(!s||!s.isConnected)&&(u==null||u(),u=null,d=null,s=null,f=!1),C(),p&&s&&(u==null||u(),u=ar(p,s,()=>{ur(p,s,{placement:o.get(),middleware:[lr(12),cr(),sr()],strategy:"fixed"}).then(({x:I,y:K,placement:re})=>{s&&(Object.assign(s.style,{left:`${I}px`,top:`${K}px`}),o.set(re))})}),n.set(!0))},v=()=>{u==null||u(),u=null,d&&(d.remove(),d=null),s=null,f=!1,n.set(!1)},O=()=>{m&&clearTimeout(m),m=setTimeout(_,100)},D=()=>{m&&clearTimeout(m),m=setTimeout(v,100)},R=I=>{if(!n.get()||!p||!s)return;let K=I.target;!p.contains(K)&&!s.contains(K)&&D()};(oe=b.domElement)==null||oe.addEventListener("click",R);let j=I=>{I.key==="Escape"&&n.get()&&D()},$=(ee=(ne=(ae=b.domElement)==null?void 0:ae.ownerDocument)!=null?ne:b.domElement)!=null?ee:null;$==null||$.addEventListener("keydown",j);let F=I=>{I?f||_():f&&v()},te=n.addListener(F),U=!1,Y=!1,Q,J=I=>{var K;I._behaviors=A(L({},(K=I._behaviors)!=null?K:{}),{[l]:{attach:()=>Q,props:{}}})};return Q={show:O,hide:D,panelId:x,update(I){if(!Y&&(I.openState!==n&&(te(),n=I.openState,te=n.addListener(F),n.get()&&_()),o=I.placement,a=I.content,r=I.keepOpenOnContentHover,w(a),J(a),d)){Y=!0;try{d.patch(a)}finally{Y=!1}}},destroy(){var I;U||(U=!0,m&&clearTimeout(m),m=null,u==null||u(),u=null,d==null||d.remove(),d=null,s=null,f=!1,te(),te=()=>{},(I=b.domElement)==null||I.removeEventListener("click",R),$==null||$.removeEventListener("keydown",j))}},J(a),F(n.get()),Q}function ve(e){let{kind:t,open:n=!1,placement:o}=e,a=y(n),r=`floating:${t}`,i=u=>{var s;return(s=u==null?void 0:u.getBehavior(r))==null?void 0:s.show()},l=u=>{var s;return(s=u==null?void 0:u.getBehavior(r))==null?void 0:s.hide()},m=L({onKeyDown:(u,s)=>u.key==="Escape"&&l(s)},B(r,rl,{kind:t,openState:a,placement:o,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover}));return{show:i,hide:l,anchorPartial:m}}var il='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function ht(e={}){var o;let{removable:t=!1}=e,n=y((o=e.color)!=null?o:"neutral","color");return A(L({dataTone:"shift-2"},B("tag-remove",(a,r)=>{let i=()=>a.remove(),l=()=>({span:Pe(il),_key:"tag-remove",onClick:s=>{s.stopPropagation(),i()},onKeyDown:s=>{let d=s;d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),d.stopPropagation(),i())},tabindex:0,role:"button",ariaLabel:"Remove",style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s=>h(g(s)*1),width:s=>h(g(s)*4),height:s=>h(g(s)*4),flexShrink:0,transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover":{backgroundColor:s=>c(s,"shift-4",n.get(s))},"&:focus-visible":{boxShadow:s=>T(s,n.get(s))}}}),m=()=>{var s;return(s=a.children.items.find(d=>d instanceof Z&&d.key==="tag-remove"))!=null?s:null},u=(s,d)=>{let f=m();s.removable&&!f?a.children.insert(l(),void 0,d):!s.removable&&f&&a.children.remove(f)};return u(r,!1),{update:s=>u(s,!0)}},{removable:t})),{style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:a=>h(g(a)*6),paddingBlock:0,borderRadius:a=>h(g(a)*999),paddingInlineStart:a=>h(g(a)*2.5),paddingInlineEnd:a=>h(g(a)*(t?1:2.5)),gap:h(1.5),fontSize:a=>S(a,"decrease-1"),backgroundColor:a=>c(a,"inherit",n.get(a)),color:a=>c(a,"text",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${c(a,"border-strong",n.get(a))}`}})}function al(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=y(e.value),l=y(a),{show:m,hide:u,anchorPartial:s}=ve({kind:"combobox",open:l,placement:y(n),content:e.content}),d={onClick:(v,O)=>!r&&u(O),dataTone:"shift-14",style:{backgroundColor:v=>c(v,"inherit"),color:v=>c(v,"text"),borderRadius:v=>h(g(v)*2),outline:v=>`1px solid ${c(v,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};q(e.content,d);let f={border:"none",outline:"none",padding:0,margin:0,flex:1,height:h(6),marginInlineStart:h(2),fontSize:v=>S(v,"inherit"),color:v=>c(v,"text",o),backgroundColor:v=>c(v,"inherit",o)},p=v=>{var O,D;return(D=(O=v==null?void 0:v.elementNode)==null?void 0:O.getBehavior("comboboxInner"))==null?void 0:D.query},b=v=>{let O=v;for(;O;){if(O._behaviorInstances.has("floating:combobox"))return O;O=O.parent}return v},x={role:"combobox",ariaHaspopup:"listbox",ariaExpanded:v=>l.get(v),ariaControls:v=>v!=null&&v.elementNode?de("combobox",b(v.elementNode)):void 0},E=v=>v?(q(v,L({onFocus:(O,D)=>m(D),style:f,_key:"combobox-input"},x)),v):L({input:null,ariaLabel:"Filter options",onFocus:(O,D)=>m(D),value:O=>{var D,R;return(R=(D=p(O))==null?void 0:D.get(O))!=null?R:""},onInput:(O,D)=>{var R;(R=D.getBehavior("comboboxInner"))==null||R.query.set(O.target.value)},style:f,_key:"combobox-input"},x),w=v=>({div:O=>{l.get(O);let D=v.state.get(O),R=Array.isArray(D)?D:[D],$=v.options.filter(F=>R.includes(F.value)).map(F=>({span:F.label,$:[ht({color:v.color,removable:!0})],_key:F.value,_onRemove:te=>{let U=v.state.get(),Q=(Array.isArray(U)?U:[U]).filter(J=>J!==F.value);v.multiple?v.state.set(Q):v.state.set(Q[0])}}));return $.push(E(v.input)),$},_key:"comboboxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1)}}),_=A(L({_onInsert:v=>{v.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onSchedule:(v,O)=>{O[v.tagName]=[w({options:t,multiple:r,color:o,state:i,input:e.input})]}},B("comboboxInner",(v,O)=>{let D=v.getMetadata("comboboxQuery");return D||(D=y(""),v.setMetadata("comboboxQuery",D)),{query:D,update(R){v.children.update([w(R)])}}},{options:t,multiple:r,color:o,state:i,input:e.input})),{style:{minWidth:h(32),outlineOffset:"-1px",outline:v=>`1px solid ${c(v,"border-strong","neutral")}`,paddingBlock:v=>h(g(v)*1),paddingInline:v=>h(g(v)*1),borderRadius:v=>h(g(v)*1.5),fontSize:v=>S(v,"inherit"),color:v=>c(v,"text",o),backgroundColor:v=>c(v,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-within":{boxShadow:v=>T(v,o)}}});return q(s,_),s}function ll(){return{role:"group",ariaLabel:"Commands",_onSchedule:(e,t)=>{q(t,{_context:{command:{query:y("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function sl(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,i=()=>a.query.set(r.value);r.addEventListener("input",i),o.addHook("Remove",()=>r.removeEventListener("input",i))},style:{fontFamily:"inherit",fontSize:o=>S(o,"inherit"),paddingInline:o=>h(g(o)*3),paddingBlock:o=>h(g(o)*2),border:"none",borderBottom:o=>`1px solid ${c(o,"border",t)}`,outline:"none",color:o=>c(o,"shift-10",t),backgroundColor:o=>c(o,"inherit",t),"&::placeholder":{color:o=>c(o,"shift-7")},transition:"border-bottom-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{borderBottomColor:o=>c(o,"shift-6",n),boxShadow:o=>T(o,n)}}}}function cl(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onMount:o=>{var u,s;let a=o.getContext("command");if(!a){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,i=(s=(u=r.textContent)==null?void 0:u.toLowerCase())!=null?s:"",l=d=>{r.hidden=d.length>0&&!i.includes(d.toLowerCase())};l(a.query.get());let m=a.query.addListener(l);o.addHook("Remove",m)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>S(o,"inherit"),height:o=>h(6+g(o)*2),paddingInline:o=>h(g(o)*3),border:"none",outline:"none",color:o=>c(o,"shift-13",t),backgroundColor:o=>c(o,"inherit",t),transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:o=>c(o,"shift-13",t),backgroundColor:o=>c(o,"hover",t)},"&:focus-visible":{boxShadow:o=>T(o,n)}}}}var ie=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Ae=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Mo=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),ft=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Io=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Ro=(e,t)=>Ae(e,-((e.getDay()-t+7)%7));function ul(e){var t,n;try{let o=new Intl.Locale(e),a=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(a!=null&&a.firstDay)return a.firstDay%7}catch(o){}return 0}function ml(e,t){let n=t,o=null,a=i=>{o==null||o(),o=i.onChange?i.selection.addListener(l=>i.onChange(l)):null},r=(i,l)=>{i!==l&&i.set(l.get())};return a(n),{update(i){i.selectionIsCallerOwned||r(i.selection,n.selection),r(i.viewYear,n.viewYear),r(i.viewMonth,n.viewMonth),r(i.focused,n.focused),r(i.hovered,n.hovered),r(i.hour,n.hour),r(i.minute,n.minute),r(i.open,n.open),(i.selection!==n.selection||i.onChange!==n.onChange)&&a(i),n=i},destroy(){o==null||o(),o=null}}}function dl(e={}){var Wo,Ko,qo,Uo;let{mode:t="single",time:n=!1,min:o,max:a,disabledDate:r,locale:i=typeof navigator!="undefined"?navigator.language:"en-US",format:l,onChange:m}=e,u=(Wo=e.weekStartsOn)!=null?Wo:ul(i),s=y((Ko=e.accentColor)!=null?Ko:"primary","accentColor"),d=y((qo=e.placement)!=null?qo:"bottom-start"),f=y((Uo=e.value)!=null?Uo:t==="range"?[null,null]:null),p=(()=>{let k=f.get(),P=t==="range"?k==null?void 0:k[0]:k;return P instanceof Date?P:new Date})(),b=y(p.getFullYear(),"viewYear"),x=y(p.getMonth(),"viewMonth"),E=y(ie(p),"focused"),w=y(null,"hovered"),C=y(p.getHours(),"hour"),_=y(p.getMinutes(),"minute"),v=new Intl.DateTimeFormat(i,L({dateStyle:"medium"},n?{timeStyle:"short"}:{})),O=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),D=new Intl.DateTimeFormat(i,{weekday:"short"}),R=new Intl.DateTimeFormat(i,{dateStyle:"full"}),j=k=>k?v.format(k):"",$=k=>{if(l)return l(k);if(t==="range"){let[P,M]=k!=null?k:[null,null];return P?`${j(P)} \u2013 ${j(M)}`:""}return j(k)},F=Array.from({length:7},(k,P)=>D.format(new Date(2023,0,1+(P+u)%7))),te=k=>!!o&&ie(k)<ie(o)||!!a&&ie(k)>ie(a)||!!r&&r(k),U=k=>{if(!n)return ie(k);let P=ie(k);return P.setHours(C.get(),_.get(),0,0),P},Y=(k,P)=>{var z;if(te(k))return;if(t==="single"){f.set(U(k)),n||gt(P);return}let[M,N]=(z=f.get())!=null?z:[null,null];!M||M&&N?f.set([U(k),null]):ie(k)<ie(M)?(f.set([U(k),U(M)]),n||gt(P)):(f.set([M,U(k)]),n||gt(P))},Q=()=>{var k;if(n)if(t==="single"){let P=f.get();P&&f.set(U(P))}else{let[P,M]=(k=f.get())!=null?k:[null,null];f.set([P&&U(P),M&&U(M)])}},J=(k,P)=>{var Be;if(t!=="range")return!1;let[M,N]=(Be=f.get(P))!=null?Be:[null,null],z=N!=null?N:w.get(P);if(!M||!z)return!1;let V=ie(M)<=ie(z)?M:z,he=ie(M)<=ie(z)?z:M,se=ie(k);return se>=ie(V)&&se<=ie(he)},oe=(k,P)=>{let M=f.get(P);if(t==="range"){let[N,z]=M!=null?M:[null,null];return ft(k,N)||ft(k,z)}return ft(k,M)},ae=k=>{b.set(k.getFullYear()),x.set(k.getMonth())},ne=k=>{let P=Mo(new Date(b.get(),x.get(),1),k);ae(P)},ee=k=>b.set(b.get()+k),I=k=>{var M;let P=(M=k==null?void 0:k.getRoot())==null?void 0:M.domElement;setTimeout(()=>{var N;(N=P==null?void 0:P.querySelector(`[data-date="${Io(E.get())}"]`))==null||N.focus()},0)},K=Rr(),re=y(!1),{show:fe,hide:gt,anchorPartial:Fo}=ve({kind:"datePicker",open:re,placement:d,content:K}),Mr=L({type:"text",readonly:!0,value:k=>$(f.get(k)),role:"combobox",ariaHaspopup:"dialog",ariaExpanded:k=>re.get(k),ariaControls:k=>k!=null&&k.elementNode?de("datePicker",k.elementNode):void 0,ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(k,P)=>{Gt(P)},onFocus:(k,P)=>{Gt(P)},onKeyDown:(k,P)=>{let M=k.key;(M==="ArrowDown"||M==="Enter")&&(k.preventDefault(),Gt(P))}},B("datePicker",ml,{selection:f,selectionIsCallerOwned:e.value!==void 0,viewYear:b,viewMonth:x,focused:E,hovered:w,hour:C,minute:_,open:re,onChange:m}));function Gt(k){var M;let P=(M=Ir())!=null?M:new Date;E.set(ie(P)),ae(P),fe(k),I(k)}function Ir(){var P;let k=f.get();return t==="range"?(P=k==null?void 0:k[0])!=null?P:null:k!=null?k:null}return q(Fo,Mr),Fo;function Rr(){let k=(V,he,se)=>({button:V,type:"button",ariaLabel:he,onClick:se,style:hl()}),P={div:[k("\xAB","Previous year",()=>ee(-1)),k("\u2039","Previous month",()=>ne(-1)),{div:V=>O.format(new Date(b.get(V),x.get(V),1)),ariaLive:"polite",_doctorDisable:"inline-typography",style:{flex:"1",textAlign:"center",fontWeight:"bold",fontSize:V=>S(V)}},k("\u203A","Next month",()=>ne(1)),k("\xBB","Next year",()=>ee(1))],style:{display:"flex",alignItems:"center",gap:h(1),marginBottom:h(2)}},M={div:F.map((V,he)=>({div:V,_doctorDisable:"inline-typography",style:{textAlign:"center",fontSize:se=>S(se,"decrease-1"),fontWeight:"bold",color:se=>c(se,"shift-7"),paddingBlock:h(1)},_key:he})),role:"row",style:mr()},N={div:V=>$r(V),role:"grid",ariaLabel:"Calendar",onKeyDown:Br,onMouseLeave:()=>t==="range"&&w.set(null),style:{display:"flex",flexDirection:"column",gap:h(.5)}},z=[P,M,N];return n&&z.push(Nr()),z.push(Ar()),{div:z,role:"dialog",ariaModal:"false",dataTone:"shift-14",style:{minWidth:h(70),padding:h(3),borderRadius:V=>h(g(V)*2),backgroundColor:V=>c(V,"inherit"),color:V=>c(V,"text"),outline:V=>`1px solid ${c(V,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}}}function $r(k){let P=new Date(b.get(k),x.get(k),1),M=x.get(k),N=Ro(P,u),z=[];for(let V=0;V<6;V++){let he=[];for(let se=0;se<7;se++){let Be=Ae(N,V*7+se);he.push(zr(Be,M,k))}z.push({div:he,role:"row",style:mr(),_key:V})}return z}function zr(k,P,M){let N=te(k),z=oe(k,M),V=J(k,M),he=k.getMonth()!==P,se=ft(k,E.get(M)),Be=ft(k,new Date);return{button:String(k.getDate()),type:"button",role:"gridcell",tabIndex:se?0:-1,ariaSelected:z,ariaDisabled:N,disabled:N,ariaLabel:R.format(k),dataDate:Io(k),onClick:(X,Vr)=>Y(k,Vr),onMouseEnter:()=>t==="range"&&w.set(k),style:{appearance:"none",border:"none",cursor:N?"not-allowed":"pointer",aspectRatio:"1",borderRadius:h(1),fontSize:X=>S(X),fontFamily:"inherit",opacity:N?.35:he?.5:1,backgroundColor:X=>z?c(X,"shift-7",s.get(X)):V?c(X,"hover",s.get(X)):"transparent",color:X=>z?c(X,"shift-0",s.get(X)):c(X,"text"),outline:Be?X=>`1px solid ${c(X,"shift-6",s.get(X))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:X=>z?c(X,"shift-7",s.get(X)):c(X,"shift-3",s.get(X))},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:X=>T(X,s.get(X))}},_key:Io(k)}}function Nr(){let k=(P,M,N)=>({select:Array.from({length:P},(z,V)=>({option:String(V).padStart(2,"0"),value:String(V),selected:he=>M.get(he)===V,_key:V})),ariaLabel:N,onChange:z=>{M.set(Number(z.target.value)),Q()},style:fl()});return{div:[k(24,C,"Hour"),{span:":",_doctorDisable:"inline-typography",style:{fontWeight:"bold"}},k(60,_,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:h(1),marginTop:h(3)}}}function Ar(){let k=(P,M)=>({button:P,type:"button",onClick:(N,z)=>M(z),style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:N=>S(N,"decrease-1"),color:N=>c(N,"muted",s.get(N)),padding:h(1)}});return{div:[k("Today",P=>{let M=new Date;E.set(ie(M)),ae(M),I(P)}),k("Clear",()=>{f.set(t==="range"?[null,null]:null),w.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:h(2),paddingTop:h(2),borderTop:P=>`1px solid ${c(P,"border")}`}}}function Br(k,P){let M=k,N=E.get(),z=null;switch(M.key){case"ArrowLeft":z=Ae(N,-1);break;case"ArrowRight":z=Ae(N,1);break;case"ArrowUp":z=Ae(N,-7);break;case"ArrowDown":z=Ae(N,7);break;case"Home":z=Ro(N,u);break;case"End":z=Ae(Ro(N,u),6);break;case"PageUp":z=Mo(N,M.shiftKey?-12:-1);break;case"PageDown":z=Mo(N,M.shiftKey?12:1);break;case"Enter":case" ":M.preventDefault(),Y(N,P);return;default:return}M.preventDefault(),E.set(z),ae(z),I(P)}}function mr(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:h(.5)}}function hl(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>S(e),color:e=>c(e,"muted"),width:h(7),height:h(7),borderRadius:h(1),"&:hover":{backgroundColor:e=>c(e,"shift-3")}}}function fl(){return{fontFamily:"inherit",fontSize:e=>S(e),padding:h(1),borderRadius:h(1),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${c(e,"border-strong")}`,backgroundColor:e=>c(e,"inherit"),color:e=>c(e,"text")}}function pl(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:`minmax(${h(24)}, max-content) 1fr`,columnGap:h(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>S(o,"inherit"),color:o=>c(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o))}}}}function gl(e={}){var a,r;let{duration:t=240}=e,n=y((a=e.color)!=null?a:"neutral","color"),o=y((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:i=>{i.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},_doctorDisable:"inline-typography",style:{fontSize:i=>S(i,"inherit"),color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),overflow:"hidden","& > summary":{backgroundColor:i=>c(i,"shift-2",n.get(i)),color:i=>c(i,"shift-10",n.get(i)),fontSize:i=>S(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:h(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:i=>h(g(i)*4),height:h(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:h(2),height:h(2),flexShrink:0,marginTop:h(-.5),borderInlineEnd:i=>`${h(.5)} solid ${c(i,"shift-9",n.get(i))}`,borderBottom:i=>`${h(.5)} solid ${c(i,"shift-9",n.get(i))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>c(i,"shift-3",n.get(i))},"& > summary:focus-visible":{borderRadius:i=>h(g(i)*2),boxShadow:i=>T(i,o.get(i))},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:i=>h(g(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:"none",opacity:1,paddingTop:i=>h(g(i)*1),paddingBottom:i=>h(g(i)*3)}}}}var pt=0;function qt(){pt++,pt===1&&(document.body.style.overflow="hidden")}function Qe(){pt=Math.max(0,pt-1),pt===0&&(document.body.style.overflow="")}var dr='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function yl(e,t){let{state:n}=t,o=null,a=!1,r=!1,i=null,l=e.domElement;l.setAttribute("aria-modal","true");let m=()=>{a=!1,typeof l.close=="function"&&l.close(),l.style.visibility="hidden",l.style.pointerEvents="none",l.style.display="none",r&&(Qe(),r=!1),o==null||o.focus(),o=null},u=p=>{if(p.key!=="Tab")return;let b=Array.from(l.querySelectorAll(dr)).filter(w=>!w.closest("[aria-hidden='true']")&&w.offsetParent!==null);if(!b.length){p.preventDefault();return}let x=b[0],E=b[b.length-1];p.shiftKey?(document.activeElement===x||document.activeElement===l)&&(p.preventDefault(),E.focus()):document.activeElement===E&&(p.preventDefault(),x.focus())},s=p=>{p.preventDefault(),n.set(!1)};l.addEventListener("cancel",s);let d=p=>{if(p)a=!1,i&&(clearTimeout(i),i=null),o=document.activeElement,l.style.visibility="visible",l.style.pointerEvents="auto",l.style.display="",typeof l.showModal=="function"&&!l.open&&l.showModal(),r||(qt(),r=!0),l.addEventListener("keydown",u),requestAnimationFrame(()=>{l.style.opacity="1";let b=l.querySelector(dr);b==null||b.focus()});else{if(a=!0,l.style.opacity="0",l.removeEventListener("keydown",u),!l.open){m();return}i=setTimeout(()=>{i=null,a&&m()},350)}};d(n.get());let f=n.addListener(d);return{requestClose:()=>n.set(!1),onTransitionEnd:p=>{a&&p.target===l&&p.propertyName==="opacity"&&m()},update(p){p.state!==n&&(f(),n=p.state,f=n.addListener(d))},destroy(){i&&(clearTimeout(i),i=null),f(),l.removeEventListener("cancel",s),r&&(Qe(),r=!1),l.removeEventListener("keydown",u),o==null||o.focus(),o=null}}}function bl(e={}){let{color:t="neutral",open:n=!1,labelledBy:o,describedBy:a}=e,r=y(n);return A(L({_onInsert:i=>{i.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')}},B("dialog",yl,{state:r})),{ariaLabelledby:o,ariaDescribedby:a,onClick:(i,l)=>{var s;if(i.target!==l.domElement)return;let m=l.domElement.getBoundingClientRect();i.clientX>=m.left&&i.clientX<=m.right&&i.clientY>=m.top&&i.clientY<=m.bottom||(s=l.getBehavior("dialog"))==null||s.requestClose()},onTransitionEnd:(i,l)=>{var m;return(m=l.getBehavior("dialog"))==null?void 0:m.onTransitionEnd(i)},style:{opacity:"0",visibility:"hidden",pointerEvents:"none",transition:"opacity 200ms ease",fontSize:i=>S(i,"inherit"),color:i=>c(i,"shift-10",t),backgroundColor:i=>c(i,"inherit",t),border:"none",borderRadius:i=>h(g(i)*2),padding:i=>h(g(i)*3),boxShadow:W("high"),"&::backdrop":{backgroundColor:i=>c(i,"shift-2","neutral"),opacity:.75}}})}function vl(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:h(2),fontSize:o=>S(o,"inherit"),backgroundColor:o=>c(o),color:o=>c(o,"text",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>c(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>c(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var $o={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},hr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},et=e=>e==="left"||e==="right";function fr(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function Sl(e,t){let{state:n,placement:o,size:a}=t,r=e.domElement;r.setAttribute("aria-modal","true");let i=E=>{E.preventDefault(),n.set(!1)};r.addEventListener("cancel",i);let l=(E,w)=>{let _=(E==="start"||E==="end")&&(r.ownerDocument.documentElement.dir==="rtl"||r.ownerDocument.dir==="rtl"),v=fr(E,_),O=w!=null?w:et(v)?h(80):h(64);return r.style.margin=hr[v],r.style.width=et(v)?O:"100dvw",r.style.height=et(v)?"100dvh":O,v},m=l(o,a),u=!1,s=!1,d=null,f=()=>{d=null,u&&(u=!1,typeof r.close=="function"&&r.close(),r.style.visibility="hidden",r.style.pointerEvents="none",r.style.display="none",s&&(Qe(),s=!1))},p=E=>{E.target===r&&E.propertyName==="transform"&&f()};r.addEventListener("transitionend",p);let b=E=>{if(E)u=!1,d&&(clearTimeout(d),d=null),r.style.visibility="visible",r.style.pointerEvents="auto",r.style.display="",typeof r.showModal=="function"&&!r.open&&r.showModal(),s||(qt(),s=!0),requestAnimationFrame(()=>{r.style.transform="translate(0, 0)"});else{if(u=!0,r.style.transform=$o[m],!r.open){f();return}d=setTimeout(f,350)}};b(n.get());let x=n.addListener(b);return{requestClose:()=>n.set(!1),update(E){E.state!==n&&(x(),n=E.state,x=n.addListener(b)),(E.placement!==o||E.size!==a)&&(o=E.placement,a=E.size,m=l(o,a),n.get()||(r.style.transform=$o[m]))},destroy(){d&&(clearTimeout(d),d=null),x(),r.removeEventListener("cancel",i),r.removeEventListener("transitionend",p),s&&(Qe(),s=!1)}}}function xl(e={}){let{color:t="neutral",open:n=!1,placement:o="end",size:a}=e,r=y(n),i=fr(o,!1),l=et(i)?h(80):h(64),m=a!=null?a:l;return A(L({_onInsert:u=>{u.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')}},B("drawer",Sl,{state:r,placement:o,size:a})),{onClick:(u,s)=>{var p;if(u.target!==s.domElement)return;let d=s.domElement.getBoundingClientRect();u.clientX>=d.left&&u.clientX<=d.right&&u.clientY>=d.top&&u.clientY<=d.bottom||(p=s.getBehavior("drawer"))==null||p.requestClose()},style:{transform:$o[i],visibility:"hidden",pointerEvents:"none",transition:"transform 0.25s ease",fontSize:u=>S(u,"inherit"),color:u=>c(u,"shift-10",t),backgroundColor:u=>c(u,"inherit",t),border:"none",padding:u=>h(g(u)*3),margin:hr[i],width:et(i)?m:"100dvw",height:et(i)?"100dvh":m,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:W("high"),"&::backdrop":{backgroundColor:u=>c(u,"shift-2","neutral"),opacity:.75}}})}function wl(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>S(o,"inherit"),fontStyle:"italic",color:o=>c(o,"shift-10",t.get(o))}}}function El(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:h(3),paddingBlock:h(12),paddingInline:h(6),textAlign:"center",color:o=>c(o,"muted",t.get(o)),"& > :first-child":{color:o=>c(o,"shift-5",t.get(o)),opacity:.9},"& > :nth-child(2)":{color:o=>c(o,"text",t.get(o))}}}}var zo="errorBoundaryOriginal";function Cl(e){var n;let t=e.getMetadata(zo);if(typeof t=="function"){(n=e._childrenRelease)==null||n.call(e),e._setupFunctionChildren(t);return}if(t!=null){e.children.update(Array.isArray(t)?t:[t]);return}e.children.update([])}function kl(e={}){return{_onSchedule:(t,n)=>{t.getMetadata(zo)===void 0&&t.setMetadata(zo,n[t.tagName])},_onError:(t,n)=>{var r,i;(r=e.onError)==null||r.call(e,n);let o=()=>Cl(t),a=typeof e.fallback=="function"?e.fallback(n,o):(i=e.fallback)!=null?i:{div:"An error occurred."};t.children.update([a])}}}var _l={small:8,medium:10,large:14};function Tl(e={}){var o,a;let t=y((o=e.color)!=null?o:"primary","color"),n=h(_l[(a=e.size)!=null?a:"medium"]);return{type:"button",_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"],style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>S(r,"inherit"),backgroundColor:r=>c(r,"shift-13",t.get(r)),color:r=>c(r,"shift-0","neutral"),boxShadow:W("low"),transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>c(r,"shift-14",t.get(r)),boxShadow:W("medium")},"&:active:not([disabled])":{backgroundColor:r=>c(r,"shift-15",t.get(r)),boxShadow:W("low")},"&:focus-visible":{boxShadow:r=>`${W("medium")}, ${T(r,t.get(r))}`},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Dl(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:h(2),marginInline:0,marginTop:h(3),marginBottom:h(3),color:o=>c(o,"text",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:h(2)},"& figcaption":{fontSize:o=>S(o,"decrease-1"),color:o=>c(o,"muted",t.get(o)),lineHeight:1.45}}}}function Ol(e={}){var a;let{layout:t="horizontal"}=e,n=y((a=e.color)!=null?a:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},_doctorDisable:"inline-typography",style:{margin:0,paddingInline:r=>h(g(r)*3),paddingBlock:r=>h(g(r)*3),border:"none",borderRadius:r=>h(g(r)*2),fontSize:r=>S(r,"inherit"),backgroundColor:r=>c(r,"inherit",n.get(r)),color:r=>c(r,"text",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:h(4),rowGap:h(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>S(r,"inherit"),fontWeight:600,paddingBlock:r=>h(g(r)*1),borderRadius:r=>h(g(r)*2),color:r=>c(r,"text",n.get(r)),backgroundColor:r=>c(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?0:h(g(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${h(2)} * -1)`,fontSize:r=>S(r,"decrease-1"),color:r=>c(r,"text",n.get(r))}}}}function Pl(e={}){let{columns:t=1,gap:n=4,align:o}=e;return{style:L({display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, minmax(0, 1fr))`:t,gap:a=>h(g(a)*n)},o?{alignItems:o}:{})}}var Ll={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Ml(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>c(o,"shift-11",t.get(o)),marginTop:0,marginBottom:h(2),fontSize:o=>{let a=Ll[o.elementNode.tagName]||"inherit";return S(o,a)}}}}function Il(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},dataTone:"shift-3",style:{border:0,height:"1px",marginInline:0,marginTop:h(3),marginBottom:h(3),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o))}}}function Rl(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:h(4),height:h(4),flexShrink:"0",fontSize:o=>S(o),backgroundColor:"transparent",color:o=>c(o,"text",t.get(o))}}}function $l(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:h(2),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o))}}}function zl(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>S(r,"inherit"),color:r=>c(r,"text",t.get(r)),display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:h(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>c(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`,backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${h(.5)} solid ${c(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`,backgroundColor:r=>c(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:h(1.5),boxShadow:r=>T(r,n.get(r))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>c(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Nl(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{type:"color",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag')},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o)),paddingBlock:o=>h(g(o)*1),paddingInline:o=>h(g(o)*1),blockSize:o=>h(6+g(o)*2),inlineSize:o=>h(6+g(o)*2),backgroundColor:"transparent",transition:"box-shadow 140ms ease",borderRadius:o=>h(g(o)*1.5),"&:focus-visible":{boxShadow:o=>T(o,t.get(o))},"&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>h(g(o)*1.5)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>c(o,"shift-2","neutral"),outline:o=>`1px solid ${c(o,"border-strong","neutral")}`}}}}function Al(e={}){var a,r;let{mode:t="datetime-local"}=e,n=y((a=e.color)!=null?a:"neutral","color"),o=y((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag')},style:{fontFamily:"inherit",fontSize:i=>S(i,"inherit"),lineHeight:"inherit",color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,borderRadius:i=>h(g(i)*1.5),paddingInline:i=>h(g(i)*3),height:i=>h(6+g(i)*2),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>c(i,"muted","neutral"),backgroundColor:i=>c(i,"shift-2","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`},"&:invalid":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`}}}}function Bl(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"file",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag')},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:r=>S(r,"inherit"),lineHeight:"inherit",color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,borderRadius:r=>h(g(r)*1.5),height:r=>h(6+g(r)*2),paddingInline:r=>h(g(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-file-upload-button":{marginTop:r=>h(g(r)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:h(1),height:h(6),paddingInline:h(2),cursor:"pointer",color:r=>c(r,"shift-11",t.get(r)),backgroundColor:r=>c(r,"surface",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>c(r,"muted","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`,backgroundColor:r=>c(r,"surface","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>c(r,"muted","neutral"),backgroundColor:r=>c(r,"shift-3","neutral")}}}}function Vl(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"number",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag')},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:h(10),paddingInlineStart:r=>h(g(r)*3),paddingInlineEnd:r=>h(g(r)*1.5),paddingBlock:r=>h(g(r)*1),borderRadius:r=>h(g(r)*1.5),fontSize:r=>S(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>c(r,"shift-2","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`,color:r=>c(r,"muted","neutral")}}}}function Hl(){return{role:"group",ariaLabel:"One-time password",style:{display:"flex",alignItems:"center",gap:h(2),"& > *":{minWidth:`${h(9)}!important`}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=i=>{let l=n(),m=i.target,u=l.indexOf(m);m.value&&u<l.length-1&&l[u+1].focus()},a=i=>{let l=n(),m=i.target,u=l.indexOf(m);i.key==="Backspace"&&!m.value&&u>0&&l[u-1].focus(),i.key==="ArrowLeft"&&u>0&&l[u-1].focus(),i.key==="ArrowRight"&&u<l.length-1&&l[u+1].focus()},r=i=>{var f,p,b;i.preventDefault();let l=(p=(f=i.clipboardData)==null?void 0:f.getData("text"))!=null?p:"",m=n(),u=m.indexOf(i.target),s=u===-1?0:u;[...l].forEach((x,E)=>{let w=m[s+E];w&&(w.value=x,w.dispatchEvent(new Event("input",{bubbles:!0})),w.dispatchEvent(new Event("change",{bubbles:!0})))});let d=Math.min(s+l.length-1,m.length-1);(b=m[d])==null||b.focus()};t.addEventListener("input",o),t.addEventListener("keydown",a),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",a),t.removeEventListener("paste",r)})}}}var jl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>',Fl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>',Wl=["name","value","onInput","disabled","required"];function pr(e){if(e!=null)return typeof e=="function"?e:le(e)?t=>e.get(t):e}function Kl(e={}){var r,i;let t=y((r=e.color)!=null?r:"neutral","color"),n=y((i=e.accentColor)!=null?i:"primary","accentColor"),o=y(!1),a={};return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onSchedule:(l,m)=>{let u=m;for(let s of Wl)u[s]!==void 0&&(a[s]=u[s],delete u[s])},_onInit:l=>{var x,E,w,C,_,v,O;let m=(x=e.name)!=null?x:a.name,u=pr((E=e.value)!=null?E:a.value),s=(w=e.onInput)!=null?w:a.onInput,d=pr((C=e.disabled)!=null?C:a.disabled),f=(_=e.required)!=null?_:a.required,p=A(L(L(L(L(L({input:null,type:D=>o.get(D)?"text":"password",ariaLabel:(v=e.ariaLabel)!=null?v:"Password",autocomplete:(O=e.autocomplete)!=null?O:"current-password"},m!=null?{name:m}:{}),u!=null?{value:u}:{}),s!=null?{onInput:s}:{}),d!=null?{disabled:d}:{}),f!=null?{required:f}:{}),{style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}}),b={button:D=>Pe(o.get(D)?Fl:jl),type:"button",ariaLabel:D=>o.get(D)?"Hide password":"Show password",onClick:()=>o.set(!o.get()),style:{background:"none",border:"none",padding:0,margin:0,cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",flexShrink:0,opacity:.6}};l.children.insert(p),l.children.insert(b)},style:{display:"flex",alignItems:"center",gap:l=>h(g(l)*1),paddingBlock:l=>h(g(l)*1),paddingInline:l=>h(g(l)*3),borderRadius:l=>h(g(l)*1.5),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${c(l,"border-strong",t.get(l))}`,color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"inherit",t.get(l)),fontSize:l=>S(l,"inherit"),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not(:has([disabled])):not(:focus-within)":{outline:l=>`1px solid ${c(l,"shift-5",n.get(l))}`},"&:focus-within":{boxShadow:l=>T(l,n.get(l))}}}}function ql(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"radio",_onInsert:r=>{if(r.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:r=>S(r,"inherit"),color:r=>c(r,"text",t.get(r)),appearance:"none",display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>c(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",boxShadow:r=>T(r,n.get(r))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>c(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Ul(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"range",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:h(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:h(1.5),borderRadius:h(999),backgroundColor:r=>c(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:h(4),height:h(4),borderRadius:h(999),border:"none",marginTop:`calc((${h(1.5)} - ${h(4)}) / 2)`,backgroundColor:r=>c(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>c(r,"shift-10",n.get(r))},borderRadius:h(2),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Gl(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"search",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag')},style:{fontFamily:"inherit",fontSize:r=>S(r,"inherit"),lineHeight:"inherit",color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,borderRadius:r=>h(g(r)*1.5),minWidth:h(32),paddingInline:r=>h(g(r)*3),paddingBlock:r=>h(g(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:r=>c(r,"shift-7",t.get(r))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>c(r,"muted","neutral"),backgroundColor:r=>c(r,"shift-2","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`}}}}function Yl(e={}){var n;let t=y((n=e.accentColor)!=null?n:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>S(o,"inherit"),backgroundColor:o=>c(o,"inherit"),color:o=>c(o,"text"),appearance:"none",position:"relative",display:"inline-flex",width:h(9),height:h(6),cursor:"pointer",margin:"0",paddingBlock:h(1),transition:"box-shadow 140ms ease",borderRadius:h(999),"&:focus-visible":{boxShadow:o=>T(o,t.get(o))},"&:checked":{"&::before":{backgroundColor:o=>c(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${h(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:h(3),height:h(3),borderRadius:h(999),left:h(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>c(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:h(999),display:"inline-block",fontSize:o=>S(o,"inherit"),lineHeight:1,backgroundColor:o=>c(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Xl(e={}){var a,r;let{type:t="text"}=e,n=y((a=e.color)!=null?a:"neutral","color"),o=y((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type')},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:h(10),paddingInline:i=>h(g(i)*3),paddingBlock:i=>h(g(i)*1),borderRadius:i=>h(g(i)*1.5),fontSize:i=>S(i,"inherit"),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>c(i,"shift-7")},"&:not(:placeholder-shown)":{color:i=>c(i,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:i=>c(i,"shift-2","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`,color:i=>c(i,"muted","neutral")},"&:invalid:not(:placeholder-shown)":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`},"&[data-status=error]":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","warning")}`}}}}function Zl(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),paddingBlock:o=>h(g(o)*.5),paddingInline:o=>h(g(o)*1.5),borderRadius:o=>h(g(o)*1),outline:o=>`1px solid ${c(o,"border-strong",t.get(o))}`}}}function Jl(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:h(2),fontSize:r=>S(r,"inherit"),color:r=>c(r,"text",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>c(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>c(r,"muted","neutral")}}}}function Ql(e={}){var o,a;let t=y((o=e.color)!=null?o:"primary","color"),n=y((a=e.accentColor)!=null?a:"secondary","accentColor");return{_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},onClick:(r,i)=>{let l=i.domElement;(l!=null&&l.hasAttribute("disabled")||(l==null?void 0:l.getAttribute("aria-disabled"))==="true")&&r.preventDefault()},style:{fontSize:r=>S(r,"inherit"),backgroundColor:r=>c(r),color:r=>c(r,"shift-13",t.get(r)),textDecoration:"none","&:visited":{color:r=>c(r,"shift-13",n.get(r))},"&:hover:not([disabled])":{color:r=>c(r,"shift-14",t.get(r)),textDecoration:"underline"},borderRadius:h(1),outline:"none",transition:"color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:r=>c(r,"muted","neutral")}}}}var es={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}},ts={small:.5,medium:1,large:1.5};function os(e={}){var l,m,u;let t=(l=e.variant)!=null?l:"outline",n=y((m=e.color)!=null?m:t==="ghost"?"neutral":"primary","color"),o=(u=e.size)!=null?u:"medium",a=Ye[o];if(t==="ghost"){let s=ts[o];return{_onInsert:d=>{d.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:d=>S(d,a),textDecoration:"none",paddingBlock:d=>h(g(d)*s),paddingInline:d=>h(g(d)*s),borderRadius:d=>h(g(d)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:d=>h(g(d)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:d=>c(d,"text",n.get(d)),"&:hover:not([aria-disabled=true])":{color:d=>c(d,"text",n.get(d)),backgroundColor:d=>c(d,"hover",n.get(d)),textDecoration:"none"},"&:active:not([aria-disabled=true])":{color:d=>c(d,"text",n.get(d)),backgroundColor:d=>c(d,"increase-2",n.get(d))},"&:focus-visible":{boxShadow:d=>T(d,n.get(d))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:d=>c(d,"border-strong","neutral")}}}}let r=t==="solid",i=es[o];return A(L({_onInsert:s=>{s.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')}},r?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{fontSize:s=>S(s,a),textDecoration:"none",paddingBlock:s=>h(g(s)*i.block),paddingInline:s=>h(g(s)*i.inline),borderRadius:s=>h(g(s)*1.5),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:s=>h(g(s)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:r?"none":s=>`1px solid ${c(s,"border-strong",n.get(s))}`,color:s=>r?c(s,"shift-0","neutral"):c(s,"shift-13",n.get(s)),backgroundColor:s=>r?c(s,"shift-13",n.get(s)):c(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([aria-disabled=true])":{textDecoration:"none",color:s=>r?c(s,"shift-0","neutral"):c(s,"shift-14",n.get(s)),backgroundColor:s=>r?c(s,"shift-14",n.get(s)):c(s,"hover",n.get(s))},"&:active:not([aria-disabled=true])":{backgroundColor:s=>r?c(s,"shift-15",n.get(s)):c(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>T(s,n.get(s))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:s=>c(s,"shift-2","neutral"),outline:s=>`1px solid ${c(s,"border-strong","neutral")}`,color:s=>c(s,"muted","neutral")}}})}function ns(e={}){var n;let t=(n=e.color)!=null?n:"neutral";return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",backgroundColor:o=>c(o,"inherit",t),color:o=>c(o,"text",t)}}}function rs(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>h(g(n)*2),paddingBlock:n=>h(t?1:g(n)*2),paddingInline:n=>h(g(n)*3),fontSize:n=>S(n,"inherit"),color:n=>c(n,"text")}}}function is(e={}){var a,r;let t=y((a=e.color)!=null?a:"neutral","color"),n=(r=e.accentColor)!=null?r:"primary",{dense:o=!1}=e;return{style:{cursor:"pointer",appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:i=>h(g(i)*2),paddingBlock:i=>h(o?1:g(i)*2),paddingInline:i=>h(g(i)*3),fontSize:i=>S(i,"inherit"),color:i=>c(i,"text",t.get(i)),borderRadius:i=>h(g(i)*1.5),transition:"background-color 150ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{backgroundColor:i=>c(i,"hover",t.get(i))},"&:active:not([disabled])":{backgroundColor:i=>c(i,"increase-2",t.get(i))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:i=>c(i,"shift-3",n),color:i=>c(i,"shift-12",n)},"&:focus-visible":{boxShadow:i=>T(i,n)},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function as(e={}){var n;let t=y((n=e.accentColor)!=null?n:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),height:o=>h(g(o)*6),borderRadius:o=>h(g(o)*1),paddingInline:o=>h(g(o)*1.5)}}}function ls(e={items:[]}){var s;let{items:t=[],selectable:n=!0,color:o="neutral",accentColor:a="primary"}=e,r=y((s=e.activeKey)!=null?s:null),i=e.activeKey!==void 0,l=(d,f)=>{let p=d.nodeId;return f.items.map((b,x)=>{var w;let E=(w=b.key)!=null?w:x;return A(L({button:typeof b.label=="string"?[{span:b.label}]:[b.label],_key:E,type:"button",id:`menuitem${p}${E}`,role:"menuitem"},f.selectable?{ariaCurrent:C=>f.activeKey.get(C)===E||void 0}:{}),{onClick:()=>{var C;f.selectable&&f.activeKey.set(E),(C=b.onClick)==null||C.call(b)},onKeyDown:C=>{var R;let _=C.key;if(_==="Enter"||_===" "){C.preventDefault(),C.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(_))return;C.preventDefault();let v=f.items.map((j,$)=>{var F;return(F=j.key)!=null?F:$}),O=v.indexOf(E),D=O;_==="ArrowDown"?D=(O+1)%v.length:_==="ArrowUp"?D=(O-1+v.length)%v.length:_==="Home"?D=0:_==="End"&&(D=v.length-1),(R=document.getElementById(`menuitem${p}${v[D]}`))==null||R.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:h(2),width:"100%",fontSize:C=>S(C,"inherit"),height:C=>h(6+g(C)*2),paddingInline:C=>h(g(C)*3),border:"none",outline:"none",color:C=>c(C,"text",f.color),backgroundColor:C=>c(C,"inherit",f.color),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:C=>c(C,"hover",f.color)},"&[aria-current=true]":{backgroundColor:C=>c(C,"shift-3",f.accentColor),color:C=>c(C,"shift-13",f.accentColor)},"&:focus-visible":{boxShadow:C=>T(C,f.accentColor)}}})})},m=(d,f)=>{let p=f;return{update(b){b.activeKey!==p.activeKey&&!b.activeKeyIsCallerOwned&&b.activeKey.set(p.activeKey.get()),p=b,p.items.length!==0&&d.children.update(l(d,p))}}},u={items:t,activeKey:r,activeKeyIsCallerOwned:i,selectable:n,color:o,accentColor:a};return A(L({role:"menu",dataTone:"shift-0",_onSchedule:(d,f)=>{t.length!==0&&(f[d.tagName]=l(d,u))}},B("menu",m,u)),{style:{display:"flex",flexDirection:"column",paddingBlock:d=>h(g(d)*2),paddingInline:d=>h(g(d)*2),fontSize:d=>S(d,"inherit"),backgroundColor:d=>c(d,"inherit",o),color:d=>c(d,"text",o),borderRadius:d=>h(g(d)*2),outline:d=>`1px solid ${c(d,"border-strong",o)}`,outlineOffset:"-1px",boxShadow:W("medium")}})}var gr=e=>!!e&&typeof e.get=="function"&&e._isState===!0,Se=e=>{let t={},n=[];for(let o in e){let a=e[o];o==="x"?n.push(`translateX(${typeof a=="number"?`${a}px`:a})`):o==="y"?n.push(`translateY(${typeof a=="number"?`${a}px`:a})`):o==="scale"?n.push(`scale(${a})`):o==="rotate"?n.push(`rotate(${typeof a=="number"?`${a}deg`:a})`):t[o]=a}return n.length&&(t.transform=n.join(" ")),t};function No(e={}){var t,n,o,a;return{duration:(t=e.duration)!=null?t:300,delay:(n=e.delay)!=null?n:0,easing:(o=e.easing)!=null?o:"ease",iterations:(a=e.iterations)!=null?a:1,fill:"both"}}function Ao(){if(typeof matchMedia!="function")return!1;try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch(e){return!1}}function ss(e,t){let n=e.domElement,o=t,a,r=l=>{a==null||a(),a=void 0,!(!n||!gr(l))&&(a=l.addListener(m=>{Ao()?Object.assign(n.style,Se(m)):typeof n.animate=="function"&&n.animate([Se(m)],No(o.transition))}))},i=(l,m)=>{if(!n)return;let u=gr(l.animate)?l.animate.get():l.animate;if(Ao()){u?Object.assign(n.style,Se(u)):m==="enter"&&l.initial&&Object.assign(n.style,Se(l.initial));return}if(typeof n.animate=="function")if(u){let s=m==="enter"&&l.initial?[Se(l.initial),Se(u)]:[Se(u)];n.animate(s,No(l.transition))}else m==="enter"&&l.initial&&Object.assign(n.style,Se(l.initial))};return i(t,"enter"),r(t.animate),{play:i,getExit:()=>o.exit,getTransition:()=>o.transition,update(l){o=l,i(l,"update"),r(l.animate)},destroy(){a==null||a()}}}function cs(e={}){return A(L({},B("motion",(t,n)=>ss(t,n),e)),{_onBeforeRemove:(t,n)=>{var i,l;let o=t.domElement,a=t.getBehavior("motion"),r=(i=a==null?void 0:a.getExit())!=null?i:e.exit;if(!o||!r||typeof o.animate!="function")return n();if(Ao())return Object.assign(o.style,Se(r)),n();o.animate([Se(r)],No((l=a==null?void 0:a.getTransition())!=null?l:e.transition)).finished.then(n,n)}})}function us(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>S(o,"inherit"),backgroundColor:o=>c(o),color:o=>c(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:h(3),listStyleType:"decimal",listStylePosition:"outside"}}}function ms(e,t){if(t<=7)return Array.from({length:t},(r,i)=>i+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),a=Math.min(t-1,e+1);for(let r=o;r<=a;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function ds(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=y(n!=null?n:o),e.setMetadata(t,a)),a}function yr(e,t){let n=e.getMetadata("paginationTotal");return n||(n=y(t),e.setMetadata("paginationTotal",n)),n}function hs(e){let{total:t,color:n="neutral",accentColor:o="primary"}=e,a={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:i=>h(6+g(i)*2),height:i=>h(6+g(i)*2),paddingInline:i=>h(g(i)*2),borderRadius:i=>h(g(i)*1.5),border:"none",cursor:"pointer",fontSize:i=>S(i,"inherit"),backgroundColor:"transparent",color:i=>c(i,"shift-13",n),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled])":{color:i=>c(i,"shift-13",n),backgroundColor:i=>c(i,"hover",n)},"&:focus-visible":{boxShadow:i=>T(i,o)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},r=A(L({},a),{backgroundColor:i=>c(i,"shift-13",o),color:i=>c(i,"shift-0","neutral"),fontWeight:"bold",cursor:"default","&:hover:not([disabled])":{backgroundColor:i=>c(i,"shift-13",o)}});return A(L({role:"navigation",ariaLabel:"Pagination",_doctorDisable:"inline-typography",_onInsert:i=>{i.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:i=>{let l=ds(i,"paginationPage",e.value,1),m=yr(i,t),u={div:s=>{let d=l.get(s),f=m.get(s),p=[];p.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&l.set(d-1),style:a});let b=0;for(let x of ms(d,f))if(x==="...")p.push({span:"\u2026",_key:`ellipsis-${b++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:E=>h(g(E)*2),color:E=>c(E,"shift-7",n)}});else{let E=x===d;p.push({button:String(x),_key:`page-${x}`,type:"button",ariaLabel:`Page ${x}`,ariaCurrent:E?"page":void 0,disabled:E,onClick:()=>l.set(x),style:E?r:a})}return p.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:d>=f,onClick:()=>d<f&&l.set(d+1),style:a}),p},style:{display:"flex",alignItems:"center",gap:h(1)}};i.children.insert(u)}},B("pagination-total",i=>({update(l){yr(i,l.total).set(l.total)}}),{total:t})),{style:{display:"inline-flex"}})}function fs(e={}){var a;let{padding:t=4,divider:n=!1}=e,o=y((a=e.color)!=null?a:"neutral","color");return{style:L({padding:r=>h(g(r)*t)},n?{borderBottom:r=>`1px solid ${c(r,"border",o.get(r))}`}:{})}}function ps(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function gs(e){var d;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,a=y(t),r=y(n),{show:i,hide:l,anchorPartial:m}=ve({kind:"popover",open:a,placement:r,content:e.content,keepOpenOnContentHover:o==="hover"}),u={role:"dialog",dataTone:"shift-14",style:{backgroundColor:f=>c(f,"inherit"),color:f=>c(f,"text"),borderRadius:f=>h(g(f)*2),outline:f=>`1px solid ${c(f,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};return(d=e.content).$||(d.$=[]),e.content.$.push(u),q(m,{ariaHaspopup:"dialog",ariaExpanded:f=>a.get(f),ariaControls:f=>f!=null&&f.elementNode?de("popover",f.elementNode):void 0,onMouseEnter:(f,p)=>o==="hover"&&i(p),onMouseLeave:(f,p)=>o==="hover"&&l(p),onClick:(f,p)=>{o==="click"&&(a.get()?l(p):i(p))},onKeyDown:(f,p)=>{f.key==="Escape"&&a.get()&&l(p)},onFocus:(f,p)=>o==="hover"&&i(p),onBlur:(f,p)=>{if(o!=="hover")return;let b=f.relatedTarget,E=p.getRoot().domElement.querySelector(`#${de("popover",p)}`);b&&(E!=null&&E.contains(b))||l(p)}}),m}function Bo(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=h(6),bordered:a=!0}=e,r=y(t),i={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},l=s=>{var d;return(d=i[r.get(s)])!=null?d:i["bottom-end"]},m=s=>s.includes("start")?o:s.includes("end")?"auto":"50%",u=s=>s.includes("end")?o:s.includes("start")?"auto":"50%";return{style:{fontSize:s=>S(s),backgroundColor:s=>c(s),color:s=>c(s,"text",n),position:"relative","&::after":{content:'""',position:"absolute",width:h(1.5),height:h(1.5),backgroundColor:s=>c(s,"inherit",n),borderWidth:a?"1px":0,borderColor:s=>c(s,"border-strong",n),borderTopStyle:s=>{let d=l(s);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:s=>{let d=l(s);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:s=>{let d=l(s);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:s=>{let d=l(s);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:s=>{let d=l(s);return d.includes("top")?0:d.includes("bottom")?"auto":m(d)},right:s=>{let d=l(s);return d.includes("right")?0:d.includes("left")?"auto":u(d)},bottom:s=>{let d=l(s);return d.includes("bottom")?0:d.includes("top")?"auto":u(d)},left:s=>{let d=l(s);return d.includes("left")?0:d.includes("right")?"auto":m(d)},transform:s=>{let d=l(s),f=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",p=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${f},${p}) rotate(45deg)`}}}}}function ys(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>h(g(o)*2),paddingInline:o=>h(g(o)*3),borderRadius:o=>h(g(o)*2)}}}function bs(e={}){var o,a;let t=y((o=e.color)!=null?o:"neutral","color"),n=y((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},dataTone:"shift-3",style:{appearance:"none",width:"100%",height:h(2),border:0,borderRadius:h(999),overflow:"hidden",backgroundColor:r=>c(r,"inherit",t.get(r)),color:r=>c(r,"text",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>c(r,"inherit",t.get(r)),borderRadius:h(999)},"&::-webkit-progress-value":{backgroundColor:r=>c(r,"shift-9",n.get(r)),borderRadius:h(999),transition:"width 220ms ease"}}}}var vs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',Ss='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function br(e,t){var n,o,a;e.onChange=t.onChange,e.readOnly=(n=t.readOnly)!=null?n:!1,e.max=(o=t.max)!=null?o:5,e.color=(a=t.color)!=null?a:"warning",le(t.value)?t.value!==e.valueState&&e.valueState.set(t.value.get()):t.value!==void 0&&e.valueState.set(t.value)}function xs(e,t,n,o){let a=i=>{let l=o.get(i);return l>0?l:n.valueState.get(i)},r={button:i=>Pe(t<=a(i)?vs:Ss),_key:t,type:"button",ariaLabel:`${t} star${t>1?"s":""}`,onClick:()=>{var l;if(n.readOnly)return;let i=t===n.valueState.get()?0:t;n.valueState.set(i),(l=n.onChange)==null||l.call(n,i),o.set(0)},onMouseEnter:()=>{n.readOnly||o.set(t)},onMouseLeave:()=>o.set(0),onKeyDown:i=>{var s,d,f;if(n.readOnly)return;let l=n.valueState.get(),m=l;if(i.key==="ArrowRight"||i.key==="ArrowUp")m=Math.min(n.max,l+1),i.preventDefault();else if(i.key==="ArrowLeft"||i.key==="ArrowDown")m=Math.max(0,l-1),i.preventDefault();else return;n.valueState.set(m),(s=n.onChange)==null||s.call(n,m);let u=m>0?m-1:0;(f=(d=e.domElement)==null?void 0:d.children[u])==null||f.focus()},style:{background:"none",border:"none",outline:"none",borderRadius:h(1),padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center",transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:i=>T(i,n.color)}}};e.children.insert(r)}function Vo(e,t,n){let o=e.children.items;for(;o.length>t.max;)e.children.remove(o[o.length-1]);for(let a=o.length+1;a<=t.max;a++)xs(e,a,t,n)}function ws(e={}){var o,a,r,i,l,m,u;let t={valueState:y((o=e.value)!=null?o:0),onChange:e.onChange,readOnly:(a=e.readOnly)!=null?a:!1,max:(r=e.max)!=null?r:5,color:(i=e.color)!=null?i:"warning"},n=y(0);return A(L({role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:h(.5),fontSize:s=>S(s,"increase-1"),cursor:t.readOnly?"default":"pointer",color:s=>c(s,"muted",t.color)}},B("rating",(s,d)=>(br(t,d),Vo(s,t,n),{update(f){br(t,f),Vo(s,t,n)}}),{value:e.value,max:(l=e.max)!=null?l:5,onChange:e.onChange,readOnly:(m=e.readOnly)!=null?m:!1,color:(u=e.color)!=null?u:"warning"})),{_onInit:s=>{Vo(s,t,n)}})}function Es(e={}){var m,u,s;let{size:t=16,thickness:n=.25}=e,o=y((m=e.value)!=null?m:0,"value"),a=y((u=e.color)!=null?u:"primary","color"),r=y((s=e.trackColor)!=null?s:"neutral","trackColor"),i=Math.round((1-n)*100),l=`radial-gradient(circle closest-side, transparent ${i}%, black ${i}%)`;return{role:"progressbar",ariaValuenow:d=>String(Math.round(o.get(d))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:d=>{d.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:h(t),height:h(t),borderRadius:"50%",color:d=>c(d,"shift-9",a.get(d)),background:d=>`conic-gradient(from -90deg, ${c(d,"shift-9",a.get(d))} ${o.get(d)}%, ${c(d,"shift-3",r.get(d))} 0%)`,WebkitMask:l,mask:l}}}function Ho(e={}){let{gap:t=4,align:n="center",justify:o,wrap:a=!1}=e;return{style:L(L({display:"flex",alignItems:n,gap:r=>h(g(r)*t)},o?{justifyContent:o}:{}),a?{flexWrap:"wrap"}:{})}}function Cs(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{style:{overflow:"auto",color:o=>c(o,"text",t.get(o)),"&::-webkit-scrollbar":{width:h(2),height:h(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>c(o,"shift-5",t.get(o)),borderRadius:h(999),border:`${h(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>c(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${c(o,"shift-5",t.get(o))} transparent`}}}function vr(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=y(n!=null?n:o),e.setMetadata(t,a)),a}function ks(e,t,n,o){var u;let a=e.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(a))return;e.preventDefault();let r=t.map((s,d)=>{var f;return(f=s.key)!=null?f:String(d)}),i=r.indexOf(n),l=i;a==="ArrowRight"?l=(i+1)%r.length:a==="ArrowLeft"?l=(i-1+r.length)%r.length:a==="Home"?l=0:a==="End"&&(l=r.length-1),o.set(r[l]);let m=e.target.closest("[role=radiogroup]");(u=m==null?void 0:m.querySelectorAll("[role=radio]")[l])==null||u.focus()}function Sr(e,t,n,o){return e.map((a,r)=>{var m;let i=(m=a.key)!=null?m:String(r);return{button:[typeof a.label=="string"?{span:a.label}:a.label],_key:i,type:"button",role:"radio",ariaChecked:u=>t.get(u)===i,tabIndex:u=>{var d,f;let s=t.get(u);return s===i||s===""&&i===((f=(d=e[0])==null?void 0:d.key)!=null?f:"")?0:-1},onClick:()=>t.set(i),onKeyDown:u=>ks(u,e,i,t),style:{cursor:"pointer",fontSize:u=>S(u,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(3),border:"none",borderRadius:h(10),color:u=>c(u,"text",n),backgroundColor:"transparent",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:u=>c(u,"shift-3",n)},"&:active:not([disabled]):not([aria-checked=true])":{backgroundColor:u=>c(u,"increase-2",n)},"&[aria-checked=true]":{backgroundColor:u=>c(u,"shift-0",o),color:u=>c(u,"shift-10",o),boxShadow:W("low")},"&:focus-visible":{boxShadow:u=>T(u,o)},"&[aria-checked=true]:focus-visible":{boxShadow:u=>`${W("low")}, ${T(u,o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function _s(e={items:[]}){var r,i,l;let{items:t=[],color:n="neutral",accentColor:o="primary"}=e,a={items:t,color:n,accentColor:o};return A(L({role:"radiogroup",_context:{segmented:{value:y((l=(i=e.value)!=null?i:(r=t[0])==null?void 0:r.key)!=null?l:"")}},_onSchedule:(m,u)=>{var d,f;let s=vr(m,"segmentedValue",e.value,(f=(d=t[0])==null?void 0:d.key)!=null?f:"");u[m.tagName]=Sr(t,s,n,o)}},B("segmented-items",m=>({update(u){var d,f;let s=vr(m,"segmentedValue",e.value,(f=(d=u.items[0])==null?void 0:d.key)!=null?f:"");m.children.update(Sr(u.items,s,u.color,u.accentColor),!!m.domElement,!0)}}),a)),{dataTone:"shift-2",style:{display:"inline-flex",paddingBlock:h(1),paddingInline:h(1),gap:h(.5),borderRadius:h(10),backgroundColor:m=>c(m,"inherit",n),color:m=>c(m,"text",n)}})}function Ts(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>S(o,"inherit"),lineHeight:"inherit",color:o=>c(o,"text",t),backgroundColor:o=>c(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${c(o,"border-strong",t)}`,borderRadius:o=>h(g(o)*1.5),paddingBlock:o=>h(g(o)*1),paddingLeft:o=>h(g(o)*3),paddingRight:o=>h(g(o)*5),backgroundImage:o=>{let a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Eo(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${h(2)} center`,backgroundSize:`${h(2.5)} ${h(1.5)}`,transition:"outline-color 140ms ease, box-shadow 140ms ease","&:not([multiple])":{height:o=>h(6+g(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`1px solid ${c(o,"shift-5",n)}`},"&:focus-visible":{boxShadow:o=>T(o,n)},"& optgroup":{color:o=>c(o,"shift-11",t)},"& option[disabled]":{color:o=>c(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>c(o,"muted","neutral"),outline:o=>`1px solid ${c(o,"border-strong","neutral")}`,backgroundColor:o=>c(o,"shift-2","neutral")}}}}var Ds=1e3;function Os(e){let t=e.getMetadata("selectBoxTypeahead");return t||(t={buffer:"",timer:null},e.setMetadata("selectBoxTypeahead",t)),t}var xr=(e,t)=>e.trim().toLowerCase().startsWith(t);function Ps(e){return e?Array.from(e.querySelectorAll("[role=option]")).filter(t=>t.getAttribute("aria-disabled")!=="true"&&!t.hasAttribute("disabled")):[]}function Ls(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=y(e.value),l=y(a),{show:m,hide:u,anchorPartial:s}=ve({kind:"selectBox",open:l,placement:y(n),content:e.content}),d={onClick:(w,C)=>!r&&u(C),dataTone:"shift-14",style:{backgroundColor:w=>c(w,"inherit"),color:w=>c(w,"text"),borderRadius:w=>h(g(w)*2),outline:w=>`1px solid ${c(w,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};q(e.content,d);let f=w=>({div:C=>{let _=w.state.get(C),v=Array.isArray(_)?_:[_];return w.options.filter(D=>v.includes(D.value)).map(D=>({span:D.label,$:[ht({color:w.color,removable:w.multiple})],_key:D.value,_onRemove:R=>{let j=w.state.get(),F=(Array.isArray(j)?j:[j]).filter(te=>te!==D.value);w.multiple?w.state.set(F):w.state.set(F[0])}}))},_key:"selectBoxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1),flex:1}}),p=(w,C)=>({update(_){w.children.update([f(_)])}}),b=w=>l.get()?u(w):m(w),x=(w,C)=>{var $,F,te,U;let _=Os(C);_.timer&&clearTimeout(_.timer),_.buffer+=w.toLowerCase(),_.timer=setTimeout(()=>{_.buffer=""},Ds);let v=_.buffer.length>1&&new Set(_.buffer).size===1,O=v?_.buffer[0]:_.buffer;if(l.get()){let Y=C.getRoot().domElement,Q=($=Y==null?void 0:Y.querySelector(`#${de("selectBox",C)}`))!=null?$:null,J=Ps(Q).filter(ee=>{var I;return xr((I=ee.textContent)!=null?I:"",O)});if(!J.length)return;let oe=(te=(F=C.domElement)==null?void 0:F.ownerDocument)==null?void 0:te.activeElement,ae=v&&oe?J.indexOf(oe):-1,ne=J[(ae+1)%J.length];ne.focus(),(U=ne.scrollIntoView)==null||U.call(ne,{block:"nearest"});return}if(r)return;let D=t.filter(Y=>xr(Y.label,O));if(!D.length)return;let R=v?D.findIndex(Y=>Y.value===i.get()):-1,j=D[(R+1)%D.length];i.set(j.value)},E=A(L({_onInsert:w=>{w.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onSchedule:(w,C)=>{C[w.tagName]=[f({options:t,multiple:r,color:o,state:i})]}},B("selectBoxInner",p,{options:t,multiple:r,color:o,state:i})),{onClick:(w,C)=>b(C),tabindex:0,role:"button",ariaExpanded:w=>l.get(w),ariaHaspopup:"listbox",ariaControls:w=>w!=null&&w.elementNode?de("selectBox",w.elementNode):void 0,onKeyDown:(w,C)=>{let _=w.key;if(_==="Escape"){u(C);return}if(_==="Enter"||_===" "){w.preventDefault(),b(C);return}if(_==="ArrowDown"&&!l.get()){w.preventDefault(),m(C);return}let v=w;_.length===1&&!v.ctrlKey&&!v.metaKey&&!v.altKey&&x(_,C)},style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:w=>h(6+g(w)*2),minWidth:h(32),outlineOffset:"-1px",outline:w=>`1px solid ${c(w,"border-strong","neutral")}`,paddingInline:w=>h(g(w)*2),borderRadius:w=>h(g(w)*1.5),fontSize:w=>S(w,"inherit"),color:w=>c(w,"text",o),backgroundColor:w=>c(w,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:w=>T(w,o)}}});return q(s,E),s}function Ms(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",tabindex:-1,ariaSelected:r=>{var m;let i=(m=r==null?void 0:r.elementNode)==null?void 0:m.getContext("select");if(!i)return;let l=i.value.get(r);return i.multiple?l.includes(o):l===o},onClick:(r,i)=>{let l=i.getContext("select");if(!l)return;let m=l.value,u=m.get();l.multiple?u.includes(o)?m.set(u.filter(s=>s!==o)):m.set(u.concat([o])):u!==o&&m.set(o)},_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag')},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>S(r,"inherit"),height:r=>h(6+g(r)*2),paddingInline:r=>h(g(r)*3),border:"none",outline:"none",color:r=>c(r,"text",n),backgroundColor:r=>c(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>c(r,"hover",n)},"&[aria-selected=true]":{backgroundColor:r=>c(r,"shift-6",t),color:r=>c(r,"shift-11")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>T(r,t)}}}}function Is(e={}){var i;let{color:t="neutral",multiple:n=!1}=e,o=y((i=e.value)!=null?i:n?[]:null),a={div:l=>{let m=o.get(l);return(Array.isArray(m)?m:[m]).map(s=>({input:null,type:"hidden",name:e.name,value:s==null?"":String(s)}))},ariaHidden:"true",hidden:!0};return{dataTone:"shift-0",role:"listbox",ariaLabel:"Options",ariaMultiselectable:n?"true":void 0,_context:{select:{value:o,multiple:n}},_onInit:l=>{l.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),l.children.insert(a)},style:{display:"flex",flexDirection:"column",paddingBlock:l=>h(g(l)*2),paddingInline:l=>h(g(l)*2),fontSize:l=>S(l,"inherit"),backgroundColor:l=>c(l,"inherit",t),color:l=>c(l,"text",t)}}}function Rs(e={}){var a;let t=y((a=e.color)!=null?a:"neutral","color"),n={"0%":{backgroundPosition:"200% 0"},"100%":{backgroundPosition:"-200% 0"}},o=je(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-1",style:{fontSize:r=>S(r),color:r=>c(r,"text",t.get(r)),height:h(6),display:"block",borderRadius:h(1),backgroundColor:r=>c(r,"inherit",t.get(r)),backgroundImage:r=>`linear-gradient(90deg, ${c(r,"inherit",t.get(r))} 0%, ${c(r,"shift-2",t.get(r))} 50%, ${c(r,"inherit",t.get(r))} 100%)`,backgroundSize:"200% 100%",animation:`${o} 1.6s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function $s(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="small"&&console.warn('"small" patch must use small tag')},dataSize:"decrease-1",style:{fontSize:o=>S(o,"inherit"),color:o=>c(o,"shift-10",t.get(o))}}}var Er={to:{transform:"rotate(360deg)"}},wr=je(JSON.stringify(Er));function zs(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>S(o),backgroundColor:o=>c(o),color:o=>c(o,"text",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:h(6),height:h(6),borderRadius:"50%",border:o=>`${h(.5)} solid ${c(o,"border-strong",t.get(o))}`,borderTopColor:o=>c(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${wr} 0.7s linear infinite`,[`@keyframes ${wr}`]:Er}}}function Ns(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:a=90}=e;return{_onSchedule:(r,i)=>{q(i,{_context:{splitter:{direction:t,size:y(n),min:o,max:a,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function As(e){let t=e.parent;if(!t)return!0;for(let n of t.children.items)if(n instanceof Z&&n.getMetadata("splitterPanel"))return n===e;return!0}function Bs(){return{_metadata:{splitterPanel:!0},_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal"?"width":"height",a=i=>{n.style[o]=`${As(e)?i:100-i}%`};a(t.size.get()),n.style.flexShrink="0",n.style.overflow="auto";let r=t.size.addListener(a);e.addHook("Remove",()=>{var i;t.panelCount=Math.max(0,((i=t.panelCount)!=null?i:1)-1),r()})}}}function Vs(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize",n.setAttribute("aria-orientation",o?"vertical":"horizontal"),n.setAttribute("aria-valuemin",String(t.min)),n.setAttribute("aria-valuemax",String(t.max)),n.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let a=t.size.addListener(m=>{n.setAttribute("aria-valuenow",String(Math.round(m)))}),r=m=>{let u=m.shiftKey?10:1,s=null;o?m.key==="ArrowRight"?s=Math.min(t.size.get()+u,t.max):m.key==="ArrowLeft"&&(s=Math.max(t.size.get()-u,t.min)):m.key==="ArrowDown"?s=Math.min(t.size.get()+u,t.max):m.key==="ArrowUp"&&(s=Math.max(t.size.get()-u,t.min)),m.key==="Home"?s=t.min:m.key==="End"&&(s=t.max),s!==null&&(m.preventDefault(),t.size.set(s))},i=null,l=m=>{m.preventDefault();let u=n.parentElement,s=f=>{let p=u.getBoundingClientRect(),b=o?(f.clientX-p.left)/p.width*100:(f.clientY-p.top)/p.height*100;t.size.set(Math.min(Math.max(b,t.min),t.max))},d=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),i=null};i=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d),i=null},document.addEventListener("mousemove",s),document.addEventListener("mouseup",d)};n.addEventListener("keydown",r),n.addEventListener("mousedown",l),e.addHook("Remove",()=>{i==null||i(),a(),n.removeEventListener("keydown",r),n.removeEventListener("mousedown",l)})},dataTone:"shift-2",style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>c(e,"inherit"),color:e=>c(e,"text"),"&:hover":{backgroundColor:e=>c(e,"increase-1")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:e=>T(e,"primary")},"&::after":{content:'""',width:h(1),height:h(1),borderRadius:h(999),backgroundColor:e=>c(e,"shift-4")}}}}function Hs(e={}){let{gap:t=3,align:n}=e;return{style:L({display:"flex",flexDirection:"column",gap:o=>h(g(o)*t)},n?{alignItems:n}:{})}}function Cr(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=y(n!=null?n:o),e.setMetadata(t,a)),a}function js(e,t,n){return e==="vertical"?{"&:not(:last-child)::after":{content:'""',position:"absolute",left:h(3),top:h(6),bottom:`-${h(2)}`,width:"2px",height:"auto",right:"auto",backgroundColor:o=>c(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:last-child)::after":{backgroundColor:o=>c(o,"shift-9",n)}}:{"&:not(:first-child)::after":{content:'""',position:"absolute",top:h(3),right:`calc(50% + ${h(3)})`,left:`calc(-50% + ${h(3)})`,height:"2px",backgroundColor:o=>c(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:first-child)::after":{backgroundColor:o=>c(o,"shift-9",n)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:o=>c(o,"shift-9",n)}}}function kr(e,t,n,o,a){let r=n==="vertical",i=js(n,o,a);return e.map((l,m)=>{var s;return{li:[typeof l.label=="string"?{span:l.label}:l.label],_key:(s=l.key)!=null?s:m,dataStep:String(m+1),dataStatus:d=>{let f=t.get(d);return m<f?"done":m===f?"active":"pending"},ariaCurrent:d=>t.get(d)===m?"step":void 0,style:A(L({position:"relative",display:"flex",flexDirection:r?"row":"column",alignItems:r?"flex-start":"center",gap:h(1),flex:r?"none":"1",fontSize:d=>S(d,"decrease-1"),textAlign:r?"left":"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:h(6),height:h(6),borderRadius:h(999),fontSize:d=>S(d,"decrease-1"),fontWeight:"bold",flexShrink:"0",border:d=>`2px solid ${c(d,"border-strong",o)}`,backgroundColor:d=>c(d,"inherit"),color:d=>c(d,"muted"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"}},i),{"&[data-status=active]::before":{backgroundColor:d=>c(d,"shift-9",a),borderColor:d=>c(d,"shift-9",a),color:d=>c(d,"shift-0",a),boxShadow:d=>`0 0 0 3px ${c(d,"shift-3",a)}`},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:d=>c(d,"shift-9",a),borderColor:d=>c(d,"shift-9",a),color:d=>c(d,"shift-0",a)},"&[data-status=pending]":{color:d=>c(d,"muted")},"&[data-status=active]":{color:d=>c(d,"shift-11",a),fontWeight:"bold"},"&[data-status=done]":{color:d=>c(d,"text",o)}})}})}function Fs(e={items:[]}){var i;let{items:t=[],direction:n="horizontal",color:o="neutral",accentColor:a="primary"}=e,r={items:t,direction:n,color:o,accentColor:a};return A(L({_doctorDisable:"inline-typography",_context:{steps:{current:y((i=e.current)!=null?i:0),direction:n,color:o,accentColor:a}},_onSchedule:(l,m)=>{let u=Cr(l,"stepsCurrent",e.current,0);m[l.tagName]=kr(t,u,n,o,a)}},B("steps-items",l=>({update(m){let u=Cr(l,"stepsCurrent",e.current,0);l.children.update(kr(m.items,u,m.direction,m.color,m.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",flexDirection:n==="vertical"?"column":"row",alignItems:n==="vertical"?"flex-start":"center",gap:h(2),listStyle:"none",margin:"0",padding:"0"}})}function Ws(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>S(o,"inherit"),fontWeight:"bold",color:o=>c(o,"shift-11",t.get(o)),backgroundColor:o=>c(o)}}}function Ks(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>S(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>c(o,"text",t.get(o))}}}function qs(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>S(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>c(o,"text",t.get(o))}}}function Us(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},_doctorDisable:"inline-typography",style:{fontSize:o=>S(o,"inherit"),color:o=>c(o,"text",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>h(g(o)*3),paddingBlock:o=>h(g(o)*1),color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>h(g(o)*3),paddingBlock:o=>h(g(o)*1),color:o=>c(o,"text",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${c(o,"shift-3",t.get(o))}`,fontSize:o=>S(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>h(g(o)*3),paddingBlock:o=>h(g(o)*1),color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${c(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>c(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>c(o,"hover")}}}}function _r(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=y(n!=null?n:o),e.setMetadata(t,a)),a}function Tr(e,t,n,o,a){let r=e.nodeId,l={div:t.map((u,s)=>{var p;let d=(p=u.key)!=null?p:s;return{button:[typeof u.label=="string"?{span:u.label}:u.label],_key:d,type:"button",role:"tab",id:`tab${r}${d}`,ariaControls:`panel${r}${d}`,ariaSelected:b=>n.get(b)===d,tabIndex:b=>n.get(b)===d?0:-1,onClick:()=>n.set(d),onKeyDown:b=>{var v;let x=b.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(x))return;b.preventDefault();let E=t.map((O,D)=>{var R;return(R=O.key)!=null?R:D}),w=E.indexOf(d),C=w;x==="ArrowRight"?C=(w+1)%E.length:x==="ArrowLeft"?C=(w-1+E.length)%E.length:x==="Home"?C=0:x==="End"&&(C=E.length-1),n.set(E[C]);let _=b.target.closest("[role=tablist]");(v=_==null?void 0:_.querySelectorAll("[role=tab]")[C])==null||v.focus()},style:{cursor:"pointer",fontSize:b=>S(b,"inherit"),height:b=>h(6+g(b)*2),paddingInline:b=>h(g(b)*4),border:"none",outline:"none",color:b=>c(b,"shift-13"),backgroundColor:b=>c(b,"inherit"),boxShadow:b=>`inset 0 ${h(-.5)} 0 0 ${c(b,"shift-1",a)}`,transition:"box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-selected=true])":{color:b=>c(b,"shift-13"),boxShadow:b=>`inset 0 ${h(-.5)} 0 0 ${c(b,"shift-2",a)}`},"&[aria-selected=true]:not([disabled])":{color:b=>c(b,"shift-13",o),boxShadow:b=>`inset 0 ${h(-.5)} 0 0 ${c(b,"shift-8",o)}`},"&:focus-visible":{boxShadow:b=>T(b,o)},"&[aria-selected=true]:focus-visible":{boxShadow:b=>`${T(b,o)}, inset 0 ${h(-.5)} 0 0 ${c(b,"shift-6",o)}`}}}}),_key:"tablist",role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},m=t.map((u,s)=>{var f;let d=(f=u.key)!=null?f:s;return{div:[u.content],_key:d,role:"tabpanel",id:`panel${r}${d}`,ariaLabelledby:`tab${r}${d}`,hidden:p=>n.get(p)!==d,style:{paddingBlock:p=>h(g(p)*2),paddingInline:p=>h(g(p)*2)}}});return[l,...m]}function Gs(e={items:[]}){let{items:t=[],accentColor:n="primary",color:o="neutral"}=e;return L({_onSchedule:(r,i)=>{var m,u;let l=_r(r,"tabsActiveKey",e.activeKey,(u=(m=t[0])==null?void 0:m.key)!=null?u:0);i[r.tagName]=Tr(r,t,l,n,o)}},B("tabs-items",r=>({update(i){var m,u;let l=_r(r,"tabsActiveKey",e.activeKey,(u=(m=i.items[0])==null?void 0:m.key)!=null?u:0);r.children.update(Tr(r,i.items,l,i.accentColor,i.color),!!r.domElement,!0)}}),{items:t,accentColor:n,color:o}))}function Ys(e={}){var a,r;let t=y((a=e.color)!=null?a:"neutral","color"),n=y((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return A(L({_onInsert:i=>{i.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')}},B("textarea-auto-resize",(i,l)=>{let m=i.domElement,u=l.autoResize,s=()=>{u&&(m.style.overflow="hidden",m.style.height="auto",m.style.height=`${m.scrollHeight}px`)};return m.addEventListener("input",s),i.attributes.addListener("value",s),u&&s(),{resize:s,update(d){u=d.autoResize,i.attributes.addListener("value",s),u&&s()},destroy(){m.removeEventListener("input",s)}}},{autoResize:o})),{_onUpdate:i=>{var l;(l=i.getBehavior("textarea-auto-resize"))==null||l.resize()},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:i=>h(g(i)*2),paddingBlock:i=>h(g(i)*1.5),border:"none",borderRadius:i=>h(g(i)*1.5),fontSize:i=>S(i,"inherit"),color:i=>c(i,"text",t.get(i)),outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",t.get(i))}`,backgroundColor:i=>c(i,"inherit",t.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>c(i,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",n.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,n.get(i))},"&:invalid":{outline:i=>`${h(.5)} solid ${c(i,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>c(i,"muted","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`,backgroundColor:i=>c(i,"shift-2","neutral")}}})}function Xs(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Zs(e={}){var r,i,l;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(i=e.accentColor)!=null?i:"primary",a=y((l=e.active)!=null?l:!1);return{style:L({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:m=>h(g(m)*2),paddingBottom:m=>t?"0":h(g(m)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:h(1),transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:m=>c(m,"shift-8",a.get(m)?o:n),opacity:m=>a.get(m)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:m=>h(g(m)*-4),width:"2px",backgroundColor:m=>c(m,"shift-3",n)}})}}function jo(e){let t=e.getMetadata("toastOpen");return t||(t=y(!1),e.setMetadata("toastOpen",t)),t}var Dr=e=>{let t=e==null?void 0:e.elementNode;return t?jo(t).get(e):!1};function Js(e={}){let{position:t="top-center",color:n="neutral"}=e,o=t.startsWith("top"),a=t.endsWith("center"),r=t.endsWith("right"),i={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:o?"column":"column-reverse",alignItems:a?"center":r?"end":"start",inset:0,gap:h(4),zIndex:30,padding:h(6),pointerEvents:"none"}};return{_portal:l=>{let m=l.domElement.querySelector(`#domphy-toast-${t}`);return m||(m=l.children.insert(i).domElement),m},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:h(32),pointerEvents:"auto",paddingBlock:l=>h(g(l)*2),paddingInline:l=>h(g(l)*4),borderRadius:l=>h(g(l)*2),fontSize:l=>S(l,"inherit"),color:l=>c(l,"text",n),backgroundColor:l=>c(l,"inherit",n),boxShadow:W("medium"),opacity:l=>Number(Dr(l)),transform:l=>Dr(l)?"translateY(0)":o?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:l=>requestAnimationFrame(()=>jo(l).set(!0)),_onBeforeRemove:(l,m)=>{var w,C;let u=!1,s=null,d=!1,f=l.getRoot(),p=(C=(w=l.domElement)==null?void 0:w.parentElement)!=null?C:null,b=()=>{var v;if(d||!p||p.id!==`domphy-toast-${t}`||p.childElementCount>0)return;d=!0;let _=(v=f.children)==null?void 0:v.items.find(O=>O.domElement===p);_?f.children.remove(_):p.remove()},x=()=>{u||(u=!0,s&&(clearTimeout(s),s=null),l.domElement.removeEventListener("transitionend",E),m(),b())},E=_=>{_.propertyName==="transform"&&x()};l.domElement.addEventListener("transitionend",E),s=setTimeout(x,350),l.addHook("Remove",()=>{var _;s&&(clearTimeout(s),s=null),(_=l.domElement)==null||_.removeEventListener("transitionend",E),b()}),jo(l).set(!1)}}}function Or(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=y(n!=null?n:o),e.setMetadata(t,a)),a}function Qs(e,t){return Array.isArray(e)?e.includes(t):e===t}function ec(e,t,n,o,a){var s;let r=e.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(r))return;e.preventDefault();let i=t.map((d,f)=>{var p;return(p=d.key)!=null?p:String(f)}),l=i.indexOf(n),m=l;r==="ArrowRight"?m=(l+1)%i.length:r==="ArrowLeft"?m=(l-1+i.length)%i.length:r==="Home"?m=0:r==="End"&&(m=i.length-1),a||o.set(i[m]);let u=e.target.closest("[role=group]");(s=u==null?void 0:u.querySelectorAll("button")[m])==null||s.focus()}function Pr(e,t,n,o,a){return e.map((r,i)=>{var u;let l=(u=r.key)!=null?u:String(i);return{button:[typeof r.label=="string"?{span:r.label}:r.label],_key:l,type:"button",role:"button",ariaPressed:s=>Qs(t.get(s),l),tabIndex:s=>{var f,p,b,x,E;let d=t.get(s);if(n){let C=(b=(p=(Array.isArray(d)?d:[])[0])!=null?p:(f=e[0])==null?void 0:f.key)!=null?b:"0";return l===C?0:-1}return d===l||d===""&&l===((E=(x=e[0])==null?void 0:x.key)!=null?E:"0")?0:-1},onClick:()=>{let s=t.get();if(n){let d=Array.isArray(s)?[...s]:[];t.set(d.includes(l)?d.filter(f=>f!==l):[...d,l])}else t.set(s===l?"":l)},onKeyDown:s=>ec(s,e,l,t,n),style:{cursor:"pointer",fontSize:s=>S(s,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(2),border:"none",borderRadius:h(1.5),color:s=>c(s,"shift-13",o),backgroundColor:s=>c(s,"inherit",o),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-pressed=true])":{color:s=>c(s,"shift-13",o),backgroundColor:s=>c(s,"hover",o)},"&:active:not([disabled])":{backgroundColor:s=>c(s,"increase-2",o)},"&[aria-pressed=true]":{backgroundColor:s=>c(s,"shift-3",a),color:s=>c(s,"shift-13",a)},"&:focus-visible":{boxShadow:s=>T(s,a)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function tc(e={items:[]}){var i;let{items:t=[],multiple:n=!1,color:o="neutral",accentColor:a="primary"}=e,r={items:t,multiple:n,color:o,accentColor:a};return A(L({role:"group",_context:{toggleGroup:{value:y((i=e.value)!=null?i:n?[]:""),multiple:n}},_onSchedule:(l,m)=>{let u=Or(l,"toggleGroupValue",e.value,n?[]:"");m[l.tagName]=Pr(t,u,n,o,a)}},B("toggle-items",l=>({update(m){let u=Or(l,"toggleGroupValue",e.value,m.multiple?[]:"");l.children.update(Pr(m.items,u,m.multiple,m.color,m.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",paddingBlock:h(1),paddingInline:h(1),gap:h(1),borderRadius:h(2),fontSize:l=>S(l,"inherit"),backgroundColor:l=>c(l,"inherit",o),color:l=>c(l,"text",o),outline:l=>`1px solid ${c(l,"border",o)}`,outlineOffset:"-1px"}})}function oc(e={}){return Ho({gap:e.gap})}function nc(){return{div:null,style:{flex:"1 1 0"}}}function rc(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content"}=e,a=y(n),r=y(o),i={span:f=>r.get(f)},{show:l,hide:m,anchorPartial:u}=ve({kind:"tooltip",open:t,placement:a,content:i}),s={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:f=>h(g(f)*1),paddingInline:f=>h(g(f)*3),borderRadius:f=>h(g(f)*1.5),color:f=>c(f,"text"),backgroundColor:f=>c(f),fontSize:f=>S(f,"inherit"),boxShadow:W("low")},$:[Bo({placement:a,bordered:!1})]};return i.$||(i.$=[]),i.$.push(s),q(u,{ariaDescribedby:f=>f!=null&&f.elementNode?de("tooltip",f.elementNode):void 0,onMouseEnter:(f,p)=>l(p),onMouseLeave:(f,p)=>m(p),onFocus:(f,p)=>l(p),onBlur:(f,p)=>m(p),onKeyDown:(f,p)=>f.key==="Escape"&&m(p)}),u}function Lr(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function ic(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,a=new Map,r=new Set,i=new Set;return{_onMount:l=>{l.addHook("Remove",()=>{for(let m of Array.from(a.values()))m();a.clear();for(let m of r)clearTimeout(m);r.clear();for(let m of i)cancelAnimationFrame(m);i.clear()})},_onBeforeUpdate:l=>{o=new Map,l.children.items.forEach((m,u)=>{if(!(m instanceof Z))return;let s=m.domElement;s&&o.set(Lr(m,u),s.getBoundingClientRect())})},_onUpdate:l=>{l.children.items.forEach((m,u)=>{var O;if(!(m instanceof Z))return;let s=m.domElement;if(!s)return;let d=Lr(m,u),f=o.get(d);if(!f)return;let p=s.getBoundingClientRect(),b=f.left-p.left,x=f.top-p.top;if(Math.abs(b)<.5&&Math.abs(x)<.5)return;(O=a.get(s))==null||O(),s.style.transition="none",s.style.transform=`translate(${b}px, ${x}px)`,s.getBoundingClientRect();let E=requestAnimationFrame(()=>{i.delete(E),s.style.transition=`transform ${t}ms ease ${n}ms`,s.style.transform="translate(0px, 0px)"});i.add(E);let w=!1,C=null,_=()=>{w||(w=!0,C&&(r.delete(C),C=null),a.delete(s),s.removeEventListener("transitionend",v),s.style.transition="",s.style.transform="")},v=D=>{D.propertyName==="transform"&&_()};a.set(s,()=>{w=!0,C&&(clearTimeout(C),r.delete(C),C=null),a.delete(s),s.removeEventListener("transitionend",v)}),s.addEventListener("transitionend",v),C=setTimeout(_,t+n+34),r.add(C)}),o.clear()}}}function ac(e={}){var n;let t=y((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>S(o,"inherit"),backgroundColor:o=>c(o),color:o=>c(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:h(3),listStyleType:"disc",listStylePosition:"outside"}}}function lc(){return{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}}return Ur(sc);})();
7
7
  //# sourceMappingURL=core-theme-ui.global.js.map