@domphy/ui 0.18.22 → 0.20.0

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,6 +1,6 @@
1
- "use strict";var Domphy=(()=>{var Je=Object.defineProperty,qn=Object.defineProperties,Un=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyDescriptors,Yn=Object.getOwnPropertyNames,uo=Object.getOwnPropertySymbols;var mo=Object.prototype.hasOwnProperty,Gn=Object.prototype.propertyIsEnumerable;var ho=(e,t,n)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t)=>{for(var n in t||(t={}))mo.call(t,n)&&ho(e,n,t[n]);if(uo)for(var n of uo(t))Gn.call(t,n)&&ho(e,n,t[n]);return e},Te=(e,t)=>qn(e,Kn(t));var Ze=(e,t)=>{for(var n in t)Je(e,n,{get:t[n],enumerable:!0})},Xn=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Yn(t))!mo.call(e,i)&&i!==n&&Je(e,i,{get:()=>t[i],enumerable:!(o=Un(t,i))||o.enumerable});return e};var Jn=e=>Xn(Je({},"__esModule",{value:!0}),e);var Il={};Ze(Il,{core:()=>tt,theme:()=>at,ui:()=>St});var tt={};Ze(tt,{AttributeList:()=>$o,BooleanAttributes:()=>$t,CamelAttributes:()=>vo,ElementList:()=>Ro,ElementNode:()=>j,HtmlAttributeNames:()=>kt,HtmlTags:()=>It,Notifier:()=>He,PrefixCSS:()=>pe,RecordState:()=>_r,State:()=>Tt,SvgTags:()=>So,VoidTags:()=>wo,_microtask:()=>zt,_resetKeylessWarnings:()=>gr,batch:()=>xr,behavior:()=>At,computed:()=>wr,configure:()=>tr,effect:()=>Vo,effectScope:()=>Sr,flushPendingNotifiers:()=>To,flushSync:()=>yr,hasPendingNotifiers:()=>_o,hashString:()=>Pe,isState:()=>ar,merge:()=>I,nextTick:()=>Er,readonly:()=>lr,runBatched:()=>Eo,toState:()=>g,untrack:()=>Cr,watch:()=>kr});var Zn=Object.defineProperty,fo=Object.getOwnPropertySymbols,Qn=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable,po=(e,t,n)=>t in e?Zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,go=(e,t)=>{for(var n in t||(t={}))Qn.call(t,n)&&po(e,n,t[n]);if(fo)for(var n of fo(t))er.call(t,n)&&po(e,n,t[n]);return e},$t=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","contentEditable","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","spellCheck","inert","download","noModule","paused","autoPictureInPicture"],vo=["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"],kt={htmlFor:"for",allowFullScreen:"allowfullscreen",autoFocus:"autofocus",autoPlay:"autoplay",contentEditable:"contenteditable",formNoValidate:"formnovalidate",isMap:"ismap",itemScope:"itemscope",noHref:"nohref",noShade:"noshade",noValidate:"novalidate",playsInline:"playsinline",trueSpeed:"truespeed",typeMustMatch:"typemustmatch",spellCheck:"spellcheck",noModule:"nomodule",autoPictureInPicture:"autopictureinpicture",autoCapitalize:"autocapitalize",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"},It=["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"],pe={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"]},So=["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"],wo=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],xo={};function tr(e){Object.assign(xo,e)}function or(){return xo}var nr=["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"],rr=nr.reduce((e,t)=>{let n=t.slice(2).toLowerCase();return e[n]=t,e},{}),Co=class{constructor(e){this._releases=new Set;let t=(()=>e());t.onSubscribe=n=>{this._releases.add(n)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear()}get dependencyCount(){return this._releases.size}},Be=[],Et=0;function Rt(){return Et>0?null:Be.length?Be[Be.length-1]:null}function ko(e,t){Be.push(e);try{return t()}finally{Be.pop()}}function ir(e){Et++;try{return e()}finally{Et--}}var Q=[],zt=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},yo=100,et=0,_t=new Set,Oe=new Set;function Eo(e){et++;try{return e()}finally{if(et--,et===0){let t=_t;_t=new Set;for(let n of t)n._scheduleFlush()}}}var He=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){if(!this._listeners)return;let n=this._listeners[e];n&&n.has(t)&&(n.delete(t),n.size===0&&delete this._listeners[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=Q.length?Q[Q.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>=yo){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${yo} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...Q]})}et>0?_t.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,Oe.add(this),zt(()=>this._flushAll()))}_isCircular(e){let t=Q.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let n=[...Q.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
- ${n.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,Oe.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:n,chain:o}]of e)Q=o,this._flush(t,n);Q=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let n=this._listeners[e];if(n){Q.push([this,e]),this._flushing.set(e,t);for(let o of[...n])if(n.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),Q.pop()}}};function _o(){return Oe.size>0}function To(){let e=0;for(;Oe.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...Oe];Oe.clear();for(let n of t)n._flushAll()}}var Tt=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new He,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=Rt();t&&this.addListener(t.handler)}return this._value}set(e){this._notifier&&(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 I(e={},t={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=ce(t));for(let r in t){let a=t[r];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof e[r]=="object"?e[r]=I(e[r],a):e[r]=a;else if(n.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let c=e[r];e[r]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join(", ")}}else e[r]=[e[r],a].filter(c=>c).join(", ");else if(i.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let c=e[r];e[r]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join("")}}else e[r]=[e[r],a].filter(c=>c).join("");else if(o.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let c=e[r];e[r]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join(" ")}}else e[r]=[e[r],a].filter(c=>c).join(" ");else if(r.startsWith("on")){let c=r.replace("on","").toLowerCase();cr(e,c,a)}else if(r.startsWith("_on")){let c=r.replace("_on","");sr(e,c,a)}else e[r]=a}return e}function Pe(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 g(e,t){return e instanceof Tt||e!=null&&e._isState?e:new Tt(e,t)}function ar(e){return typeof e=="object"&&e!==null&&e._isState===!0}function lr(e){return{_isState:!0,get(t){return e.get(t)}}}function At(e,t,n){return{_behaviors:{[e]:{attach:t,props:n}}}}function sr(e,t,n){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...r)=>{i(...r),n(...r)}:e[o]=n}function cr(e,t,n){let o=rr[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(r,a)=>{i(r,a),n(r,a)}:e[o]=n}function ce(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 i of e)n.push(ce(i,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[i,r]of e)n.set(ce(i,t),ce(r,t));return n}if(e instanceof Set){n=new Set,t.set(e,n);for(let i of e)n.add(ce(i,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 i of Reflect.ownKeys(e))n[i]=ce(e[i],t);return n}function Mo(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 i=n[o],r=e[i];if(o===0&&!It.includes(i)&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i==="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(i==="$")e.$.forEach(a=>Mo(a,!0));else{if(i.startsWith("_on")&&typeof r!="function")throw Error(`hook ${i} value "${r}" must be a function `);if(i.startsWith("on")&&typeof r!="function")throw Error(`event ${i} value "${r}" must be a function `);if(i==="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(i==="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(i==="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(i==="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function Qe(e){return new RegExp("<([a-z][\\w-]*)(\\s[^>]*)?>.*<\\/\\1>|<([a-z][\\w-]*)(\\s[^>]*)?\\/>","is").test(e.trim())}function ur(e){let t=e.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi,"");return t=t.replace(/<script\b[^>]*\/>/gi,""),t=t.replace(/<script\b[^>]*>[\s\S]*$/gi,""),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(/((?:href|src|action|formaction)\s*=\s*)(["']?)[\s]*javascript:[^"'\s>]*/gi,"$1$2#"),t}function Oo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Po(e){return Object.keys(e).find(t=>It.includes(t))}function Do(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function hr(e){if(e.indexOf("@")===0)return[e];for(var t=[],n=0,o=0,i="",r=0,a=e.length;r<a;r++){var c=e[r];if(c==="(")n+=1;else if(c===")")n-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!n&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function Mt(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 mr(e,t){for(let n=0;n<e.length;n++){let o=e[n],i=null;typeof o.selectorText=="string"?i=Mt(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=Mt(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function Lo(e,t){var n;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let i=t!=null?t:or().cspNonce;i&&(o.nonce=i),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 Ot=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(n=>I(t,Ot(n))),delete e.$,I(t,e),t}else return e},dr={translate:["yes","no"],autoCapitalize:["on","off"]},fr=class{constructor(e,t,n){this.declaredValue=void 0,this._notifier=new He,this._releases=[],this._removeHooked=!1,this.parent=n,this.isBoolean=$t.includes(e),this.enumeratedBoolean=dr[e],vo.includes(e)?this.name=e:Object.hasOwn(kt,e)?this.name=kt[e]:this.name=Do(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,n;let o=this.value;if(this.declaredValue=e,this._releases.length){for(let i of this._releases)i();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let r=this.value;this.value=this.isBoolean?!!e(i):this.normalize(e(i)),this.render(),r!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(n=this.parent)==null?void 0:n.nodeId} attribute:${this.name}`,i.onSubscribe=r=>{this._releases.push(r),this.parent&&!this._removeHooked&&(this._removeHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let a of this._releases)a();this._releases=[],i=null}))},this.value=this.isBoolean?!!e(i):this.normalize(e(i))}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=n=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",n)},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=[],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 n=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${Oo(String(n))}"`}},$o=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 fr(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(!$t.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=(u,m)=>{let h=(u||"").split(" ").filter(d=>d);return!h.includes(m)&&h.push(m),h.join(" ")},i=(n=(t=this.items)==null?void 0:t.class)==null?void 0:n.declaredValue,r=typeof i=="function",a=r?i:this.get("class"),c=typeof e=="function";if(!r&&!c){this.set("class",o(a,e));return}this.set("class",u=>o(r?a(u):a,c?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(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))}},ge=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",pr=class{constructor(e,t,n){this.value="",this._releases=[],this.name=e,this.cssName=e.startsWith("--")?e:Do(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)),pe[this.name]&&pe[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.value="",this.parentRule=null}set(e){var t,n,o,i;if(this._releases.length){for(let r of this._releases)r();this._releases=[]}if(typeof e=="function"){let r=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(r),this._domUpdate())});r.onSubscribe=a=>{this._releases.push(a)},r.elementNode=this.parentRule.root,r.debug=`class:${(n=(t=this.parentRule)==null?void 0:t.root)==null?void 0:n.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(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),pe[this.name]&&pe[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 pe[this.name]&&pe[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},se=class Pt{constructor(t,n){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new Io(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 Pt;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Pt;)t=t.parent;return t}insertStyle(t,n){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(n):this.styleBlock[t]=new pr(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){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,n=t.cssRules;for(let o=0;o<n.length;o++)if(n[o]===this.domRule){t.deleteRule(o);break}}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),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Io=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof se;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let n={},o=[];function i(r,a){return r.startsWith("&")?`${a}${r.slice(1)}`:`${a} ${r}`}for(let r in e){let a=e[r],c=hr(r);for(let u of c){let m=i(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof a=="object"&&a!=null){let h=new se(u,this.parent);h.styleList.addCSS(a,t),o.push(h)}}else if(u.startsWith("@keyframes")){let h=new se(u,this.parent);h.styleList.addCSS(a,""),this.items.push(h)}else if(u.startsWith("@font-face")){let h=new se(u,this.parent);for(let d in a)h.insertStyle(d,a[d]);this.items.push(h)}else if(typeof a=="object"&&a!=null){let h=new se(m,this.parent);this.items.push(h);for(let[d,p]of Object.entries(a))if(typeof p=="object"&&p!=null){let b=i(d,m);this.addCSS(p,b)}else h.insertStyle(d,p)}else n[u]=a}}if(Object.keys(n).length){let r=new se(t,this.parent);for(let a in n)r.insertStyle(a,n[a]);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 c in e){let u=e[c];typeof u=="object"&&u!=null||(o[c]=u)}let i=this.items.find(c=>c.selectorText===t);i||(i=new se(t,this.parent),this.items.push(i));let r=new Set(Object.keys(o));for(let c in o)i.insertStyle(c,o[c]);if(i.styleBlock)for(let c of Object.keys(i.styleBlock))r.has(c)||i.removeStyle(c);let a=(n=this.domStyle)==null?void 0:n.sheet;!i.domRule&&a&&i.render(a)}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(n=>n.selectorText===e);return t||(t=new se(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let n=e.get(Mt(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,i)=>{let r=i-t,a=e[r];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==n(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}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}},j=class Me{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 Ro(this),this.styles=new Io(this),this.attributes=new $o(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,r;t=ce(t),Mo(t),t.style=t.style||{},this.parent=n,this.tagName=Po(t),t=Ot(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(r=this.parent)==null?void 0:r.nodeId}.${o}`,c=JSON.stringify(t.style||{},(m,h)=>typeof h=="function"?a:h);this.nodeId=Pe(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let u=t[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 i=t(n);this.children.update(Array.isArray(i)?i:[i])}catch(i){this._handleError(i)}};n.elementNode=this,n.debug=`class:${this.tagName}_${this.nodeId} children`;let o=[];n.onSubscribe=i=>{o.push(i),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=So.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 i,r;return(r=(i=this._events)==null?void 0:i[t])==null?void 0:r.call(i,o,this)};this.domElement.addEventListener(t,n),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,n),n=null})}_dispose(){var t,n,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(n=(t=this._hooks).BeforeRemove)==null||n.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(r=>r.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(o=this._hooks).Remove)==null||i.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){I(this._context,t._context),I(this._metadata,t._metadata),this._processBehaviors(t._behaviors);let n=Object.keys(t);for(let o=0;o<n.length;o++){let i=n[o],r=t[i];["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(i)?this.addHook(i.substring(3),r):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),r):i==="_portal"?this._portal=r:i==="class"?(typeof r=="string"||typeof r=="function")&&this.attributes.addClass(r):this.attributes.set(i,r))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var n;let o=ce(t);o.style=o.style||{},o=Ot(o);let i=o[this.tagName];if(typeof i=="function")(n=this._childrenRelease)==null||n.call(this),this._childrenRelease=void 0,this._setupFunctionChildren(i);else if(i!=null){let h=Array.isArray(i)?i:[i];this.children.update(h,!!this.domElement,!0)}o._context&&I(this._context,o._context),o._metadata&&I(this._metadata,o._metadata),this._processBehaviors(o._behaviors),this.styles.patchCSS(o.style||{},`.${this.tagName}_${this.nodeId}`);let r=`${this.tagName}_${this.nodeId}`,a=["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName],c=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],u=new Set(["class"]),m=null;this._events={};for(let h of Object.keys(o)){if(a.includes(h)||c.includes(h)||h==="_portal")continue;let d=o[h];h.startsWith("on")&&typeof d=="function"?this.addEvent(h.substring(2).toLowerCase(),d):h==="class"&&(typeof d=="string"||typeof d=="function")?m=d:(this.attributes.set(h,d),u.add(h))}if(typeof m=="function"){let h=m;this.attributes.set("class",d=>`${r} ${h(d)}`)}else this.attributes.set("class",m?`${r} ${m}`:r);if(this.attributes.items)for(let h of Object.keys(this.attributes.items))u.has(h)||this.attributes.remove(h);if(this._events)for(let h in this._events)this._bindEvent(h)}_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]=(i,r)=>{o(i,r),n(i,r)}:this._events[t]=n}addHook(t,n){let o=this._hooks[t];if(typeof o=="function"){let i=((...r)=>{o(...r),n(...r)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,n.length),configurable:!0})}catch(r){}this._hooks[t]=i}else this._hooks[t]=n}getRoot(){let t=this;for(;t&&t instanceof Me&&t.parent;)t=t.parent;return t}_processBehaviors(t){var n;if(t)for(let o of Object.keys(t)){let i=t[o],r=this._behaviorInstances.get(o);r?(n=r.update)==null||n.call(r,i.props):this.domElement?this._attachBehaviorNow(o,i):(this._pendingBehaviors.set(o,i),this._ensureBehaviorMountHook())}}_attachBehaviorNow(t,n){let o=n.attach(this,n.props)||{};this._behaviorInstances.set(t,o),this._ensureBehaviorTeardownHook()}_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",()=>{this._behaviorInstances.forEach(t=>{var n;return(n=t.destroy)==null?void 0:n.call(t)}),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 Me?n.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(wo.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(ge&&!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&&this.children.items.forEach((o,i)=>{let r=t.childNodes[i];r&&(o instanceof Me?o.mount(r):o.domText=r)}),n){let o=n.sheet;o&&this._hydrateStyles(mr(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var n;if((n=this.styles)==null||n.hydrate(t),this.children)for(let o of this.children.items)o instanceof Me&&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,i=t.getRootNode(),r=i instanceof ShadowRoot?i:document.head;return o||(o=Lo(r)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof Me&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.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())},i=this._hooks.BeforeRemove;this._beforeRemoveFired=!0,i(this,o),i.length<2&&!n?o():ge&&!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()}}},bo=class{constructor(e,t){this.type="TextNode",this._imperative=!1,this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Qe(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),t.content.querySelectorAll("*").forEach(n=>{for(let o of Array.from(n.attributes))/^on/i.test(o.name)?n.removeAttribute(o.name):/^(?:href|src|action|formaction)$/i.test(o.name)&&/^\s*javascript:/i.test(o.value)&&n.setAttribute(o.name,"#")}),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}setText(e){var t;let n=e===""?"\u200B":String(e);if(n===this.text&&this.domText)return;let o=Qe(this.text);if(this.text=n,!this.domText)return;if(!o&&!Qe(n)&&this.domText.nodeType===3){this.domText.nodeValue=n;return}let i=this.domText,r=this._createDOMNode();(t=i.parentNode)==null||t.replaceChild(r,i)}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":Qe(this.text)?ur(this.text):Oo(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},Dt=new Set;function gr(){Dt.clear()}var Ro=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new j(e,this.owner,this._nextKey++):new bo(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],i=o instanceof j?o.domElement:o.domText;if(i&&i.parentNode===t)return i}return null}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof j?e.domElement:e.domText;if(!o)return;let i=this._domReferenceAfter(t+1);o!==i&&n.insertBefore(o,i)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof j?e.domElement:e.domText,i=t instanceof j?t.domElement:t.domText;if(!o||!i)return;let r=o.nextSibling,a=i.nextSibling;n.insertBefore(o,a),n.insertBefore(i,r)}update(e,t=!0,n=!1){var o,i,r,a;if(this.items.some(f=>f._imperative)){let f=this.items.filter(S=>!S._imperative),y=this.items.filter(S=>S._imperative);this.items=f.concat(y)}let c=this.items.slice(),u=new Map;for(let f of c)f instanceof j&&f.key!==null&&f.key!==void 0&&!f._imperative&&!f._beforeRemoveFired&&u.set(f.key,f);!n&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let m=new Set(c),h=new Set,d=0,p=ge&&c.length>0?e.length!==c.length:!1;for(let f=0;f<e.length;f++){let y=e[f],S=typeof y=="object"&&y!==null,C=S?y._key:void 0,E=S?Po(y):void 0;if(ge&&S&&C===void 0&&d++,C!==void 0){let x=u.get(C);if(x instanceof j&&x.tagName===E){u.delete(C);let M=this.items.indexOf(x);if(M!==f&&M>=0){let O=!!x._portal;this.move(M,f,O?!1:t,!0)}x.parent=this.owner,x.patch(y),h.add(x);continue}}else if(S){let x=this.items[f];if(x instanceof j&&x.key==null&&x.tagName===E&&m.has(x)&&!h.has(x)&&!x._imperative&&!x._beforeRemoveFired){x.parent=this.owner,x.patch(y),h.add(x);continue}}else{let x=this.items[f];if(x instanceof bo&&m.has(x)&&!h.has(x)&&!x._imperative){x.setText(y==null?"":y),h.add(x);continue}}h.add(this.insert(y,f,t,!0,!0))}let b=this.items.slice(e.length);for(let f of b)f._imperative||this.remove(f,t,!0);if(u.forEach(f=>this.remove(f,t,!0)),ge&&c.length>0&&d>0&&p){let f=this.owner.nodeId;if(!Dt.has(f)){Dt.add(f);let y=`[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}>, ${d} unkeyed item${d===1?"":"s"})`;console.warn(y)}}n||(a=(r=this.owner._hooks)==null?void 0:r.Update)==null||a.call(r,this.owner)}insert(e,t,n=!0,o=!1,i=!1){let r=this.items.length,a=typeof t!="number"||Number.isNaN(t)||t<0||t>r?r:t,c=this._createNode(e);if(c._imperative=!i,this.items.splice(a,0,c),c instanceof j){c._hooks.Insert&&c._hooks.Insert(c);let u=this.owner.domElement;if(n&&u)if(c._portal){let m=c._portal(this.owner.getRoot());m&&c.render(m)}else{let m=c._createDOMNode(),h=this._domReferenceAfter(a+1);u.insertBefore(m,h);let d=u.getRootNode(),p=d instanceof ShadowRoot?d:document.head,b=Lo(p);c.styles.render(b),c._hooks.Mount&&c._hooks.Mount(c),c.children.items.forEach(f=>{if(f instanceof j&&f._portal){let y=f._portal(f.getRoot());y&&f.render(y)}else f.render(m)})}}else{let u=this.owner.domElement;if(n&&u){let m=c._createDOMNode(),h=this._domReferenceAfter(a+1);u.insertBefore(m,h)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),c}remove(e,t=!0,n=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof j){if(e._beforeRemoveFired)return;let i=()=>{let r=e.domElement,a=this.items.indexOf(e);a>=0&&this.items.splice(a,1),t&&r&&r.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let r=!1,a=()=>{r||(r=!0,i())},c=e._hooks.BeforeRemove;e._beforeRemoveFired=!0,c(e,a),c.length<2&&!r?a():ge&&!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 i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.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 i=this.items[e],r=this.items[t];this.items[e]=r,this.items[t]=i,n&&this._swapDomElement(i,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 i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),n&&this._moveDomElement(i,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}},ye=new Set,Lt=!1;function zo(e){ye.add(e),!Lt&&(Lt=!0,zt(Ao))}function Ao(){for(Lt=!1;ye.size>0;){let e=[...ye];ye.clear();for(let t of e)try{t()}catch(n){console.error("[Domphy] Uncaught error in effect:",n)}}}function yr(){let e=0;for(;_o()||ye.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}To(),Ao()}}var Ne=[];function br(){return Ne.length?Ne[Ne.length-1]:null}function Vt(e){let t=br();t&&t._add(e)}var vr=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 ge&&console.warn("[Domphy] effectScope.run() called after stop() \u2014 resources created inside are registered to the enclosing scope instead of this stopped one."),e();Ne.push(this);try{return e()}finally{Ne.pop()}}stop(){if(!this._stopped){this._stopped=!0;for(let e of this._disposers)e();this._disposers.clear()}}};function Sr(){let e=new vr;return Vt(()=>e.stop()),e}function Vo(e){let t=!1,n=!1,o=()=>{t||r()},i=new Co(()=>{t||zo(o)}),r=()=>{if(!(t||n)){n=!0,i.reset();try{ko(i,e)}finally{n=!1}}},a=()=>{t||(t=!0,i.reset(),ye.delete(o))};return Vt(a),r(),a}function wr(e){let t="computed",n=new He,o,i=!0,r=!1,a=()=>{i&&n.listenerCount(t)>0&&m()},c=new Co(()=>{i||(i=!0,zo(a))}),u=()=>{c.reset(),o=ko(c,e),i=!1,r=!0},m=()=>{let d=o,p=r;u(),!(p&&o===d)&&n.notify(t,o)},h=d=>{if(d)n.addListener(t,d);else{let p=Rt();p&&n.addListener(t,p.handler)}return i&&(r&&n.listenerCount(t)>0?m():u()),o};return Vt(()=>{c.reset(),ye.delete(a),n._dispose()}),{_isState:!0,_notifier:n,get:h}}function xr(e){return Eo(e)}function Cr(e){return ir(e)}function kr(e,t,n){let o,i=!0;return Vo(()=>{let r=typeof e=="function"?e():e.get();(!i||n!=null&&n.immediate)&&t(r,o),o=r,i=!1})}function Er(e){return e?Promise.resolve().then(e):Promise.resolve()}var _r=class{constructor(e){this._notifier=new He,this.initialRecord=go({},e),this._record=go({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let n=Rt();n&&this._notifier.addListener(e,n.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 at={};Ze(at,{COLOR_ROLES:()=>Wr,ElementTones:()=>je,applySystemTheme:()=>Fr,generateTheme:()=>Xr,getTheme:()=>ee,setTheme:()=>Br,themeApply:()=>Hr,themeCSS:()=>jt,themeColor:()=>l,themeColorToken:()=>Kt,themeDensity:()=>v,themeFluidSpacing:()=>jr,themeName:()=>it,themeSize:()=>w,themeSpacing:()=>s,themeTokens:()=>Uo,themeVars:()=>rt});var Tr=e=>{let t=n=>{let o=Math.max(0,Math.min(1,n)),i=o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(i*255)))};return e.map(t)},Mr=e=>{let t=n=>n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;return e.map(t)},Or=e=>{let[t,n,o]=Tr(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}`},ot=e=>{let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255;return Mr([t,n,o])},Pr=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],i=Math.cbrt(t),r=Math.cbrt(n),a=Math.cbrt(o);return[.2104542553*i+.793617785*r-.0040720468*a,1.9779984951*i-2.428592205*r+.4505937099*a,.0259040371*i+.7827717662*r-.808675766*a]},Dr=e=>{let[t,n,o]=e,i=t+.3963377774*n+.2158037573*o,r=t-.1055613458*n-.0638541728*o,a=t-.0894841775*n-1.291485548*o,c=i*i*i,u=r*r*r,m=a*a*a;return[4.0767416621*c-3.3077115913*u+.2309699292*m,-1.2684380046*c+2.6097574011*u-.3413193965*m,-.0041960863*c-.7034186147*u+1.707614701*m]};var Nt=e=>{let[t,n,o]=e,i=.4124564*t+.3575761*n+.1804375*o,r=.2126729*t+.7151522*n+.072175*o,a=.0193339*t+.119192*n+.9503041*o,c=.95047,u=1,m=1.08883,h=f=>f>.008856?Math.cbrt(f):7.787*f+16/116,d=h(i/c),p=h(r/u),b=h(a/m);return[116*p-16,500*(d-p),200*(p-b)]};var No=(e,t)=>{let[n,o,i]=e,[r,a,c]=t,u=(n+r)/2,m=Math.sqrt(o*o+i*i),h=Math.sqrt(a*a+c*c),d=(m+h)/2,p=.5*(1-Math.sqrt(Math.pow(d,7)/(Math.pow(d,7)+Math.pow(25,7)))),b=o*(1+p),f=a*(1+p),y=Math.sqrt(b*b+i*i),S=Math.sqrt(f*f+c*c),C=(y+S)/2,E=Math.atan2(i,b)*180/Math.PI+(Math.atan2(i,b)<0?360:0),x=Math.atan2(c,f)*180/Math.PI+(Math.atan2(c,f)<0?360:0),M=x-E;Math.abs(M)>180&&(M+=x<=E?360:-360);let O=Math.abs(E-x)>180?(E+x+360)/2:(E+x)/2,_=1-.17*Math.cos((O-30)*Math.PI/180)+.24*Math.cos(2*O*Math.PI/180)+.32*Math.cos((3*O+6)*Math.PI/180)-.2*Math.cos((4*O-63)*Math.PI/180),D=r-n,A=S-y,V=2*Math.sqrt(y*S)*Math.sin(M/2*Math.PI/180),B=1+.015*Math.pow(u-50,2)/Math.sqrt(20+Math.pow(u-50,2)),de=1+.045*C,Ee=1+.015*C*_,le=30*Math.exp(-Math.pow((O-275)/25,2)),H=-(2*Math.sqrt(Math.pow(C,7)/(Math.pow(C,7)+Math.pow(25,7))))*Math.sin(2*le*Math.PI/180);return Math.sqrt(Math.pow(D/B,2)+Math.pow(A/de,2)+Math.pow(V/Ee,2)+H*(A/de)*(V/Ee))};var Bo=e=>{if(e.length<1)return m=>0;let t=[...e].sort((m,h)=>m[0]-h[0]),n=[];for(let m=0;m<t.length;m++)(m===0||t[m][0]!==t[m-1][0])&&n.push(t[m]);let o=n.length;if(o===1)return m=>n[0][1];let i=n.map(m=>m[0]),r=n.map(m=>m[1]),a=[],c=[];for(let m=0;m<o-1;m++)a[m]=i[m+1]-i[m],c[m]=(r[m+1]-r[m])/a[m];let u=new Array(o);u[0]=c[0],u[o-1]=c[o-2];for(let m=1;m<o-1;m++){let h=c[m-1],d=c[m];if(h*d<=0)u[m]=0;else{let p=(1+a[m]/(a[m-1]+a[m]))/3;u[m]=h*d/((1-p)*h+p*d)}}return m=>{if(m<=i[0])return r[0];if(m>=i[o-1])return r[o-1];let h=0,d=o-2,p=0;for(;h<=d;){let x=Math.floor((h+d)/2);if(m>=i[x]&&m<=i[x+1]){p=x;break}m<i[x]?d=x-1:h=x+1}let b=a[p],f=(m-i[p])/b,y=f*f,S=y*f,C=u[p]*b,E=u[p+1]*b;return(2*S-3*y+1)*r[p]+(S-2*y+f)*C+(-2*S+3*y)*r[p+1]+(S-y)*E}};var Ho=.605,Bt=.685;function Lr(e){let t=Math.pow(e,Ho);return t/(1+Bt*(1-t))}function $r(e){let t=e*(1+Bt)/(1+e*Bt);return Math.pow(t,1/Ho)}function Ir(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 Rr(e){let t=[[0,0,0],...e,[1,1,1]].map(p=>Pr(p)).sort((p,b)=>p[0]-b[0]),n=t.map(p=>p[0]),o=t.map(p=>p[1]),i=t.map(p=>p[2]),r=[0],a=0;for(let p=1;p<t.length;p++)a+=Ir(t[p],t[p-1]),r.push(a);let c=r.map(p=>$r(a>0?p/a:0)),u=e.length===1?0:c[1],m=e.length===1?1:c[c.length-2],h=Bo(c.map((p,b)=>[p,o[b]])),d=Bo(c.map((p,b)=>[p,i[b]]));return{colorAtParam:p=>{let b=Lr(p),f=u+b*(m-u),y=0;for(let _=0;_<c.length-1;_++)if(f<=c[_+1]){y=_;break}let S=c[y],C=c[y+1],E=(f-S)/(C-S||1),x=n[y]+E*(n[y+1]-n[y]),M=h(f),O=d(f);return Dr([x,M,O])},parameters:c.slice(1,-1).map(p=>(p-u)/(m-u))}}function jo(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[n[0]];let{colorAtParam:o,parameters:i}=Rr(n.map(ot)),r=[],a=[0,...i,1],c=a.map(m=>Math.round(m*(t-1))),u=0;for(let m=0;m<t;m++){for(;u<c.length-2&&m>c[u+1];)u++;let h=c[u],d=c[u+1],p=a[u],b=a[u+1],f;if(d<=h)f=p;else{let y=(m-h)/(d-h);f=p+y*(b-p)}r.push(Or(o(f)))}return r.reverse()}var zr={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","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#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:{}},Fe=zr,qt=e=>JSON.parse(JSON.stringify(e)),Wo=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),De={light:qt(Fe),dark:Nr(Fe)},nt=null,Ht=new Map;function Ut(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Ar(e){for(let t in e)if(!Object.keys(Fe).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}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[]")}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")}if("direction"in e&&e.direction!=="lighten"&&e.direction!=="darken")throw new Error('direction must be "lighten" or "darken"')}function qo(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]={}),qo(e[o],t[o])):e[o]=t[o])}function Vr(e,t){let n={},o=Ut(t);for(let r in t){let a=t[r];if(r==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(u=>n[`--${c}-${u}`]=t.colors[c][u]);else if(r==="fontSizes")[...Array(8).keys()].forEach(c=>n[`--fontSize-${c}`]=t.fontSizes[c]);else if(r==="custom"&&a&&typeof a=="object")for(let c in a)n[`--custom-${Wo(c)}`]=a[c]}let i="";for(let r in n)i+=` ${r}: ${n[r]};
1
+ "use strict";var Domphy=(()=>{var Qe=Object.defineProperty,Zn=Object.defineProperties,Jn=Object.getOwnPropertyDescriptor,Qn=Object.getOwnPropertyDescriptors,er=Object.getOwnPropertyNames,yo=Object.getOwnPropertySymbols;var vo=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable;var bo=(e,t,n)=>t in e?Qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N=(e,t)=>{for(var n in t||(t={}))vo.call(t,n)&&bo(e,n,t[n]);if(yo)for(var n of yo(t))tr.call(t,n)&&bo(e,n,t[n]);return e},Me=(e,t)=>Zn(e,Qn(t));var et=(e,t)=>{for(var n in t)Qe(e,n,{get:t[n],enumerable:!0})},or=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of er(t))!vo.call(e,i)&&i!==n&&Qe(e,i,{get:()=>t[i],enumerable:!(o=Jn(t,i))||o.enumerable});return e};var nr=e=>or(Qe({},"__esModule",{value:!0}),e);var Wl={};et(Wl,{core:()=>nt,theme:()=>st,ui:()=>Ct});var nt={};et(nt,{AttributeList:()=>Bo,BooleanAttributes:()=>zt,CamelAttributes:()=>Eo,ElementList:()=>Ho,ElementNode:()=>U,HtmlAttributeNames:()=>Tt,HtmlTags:()=>At,Notifier:()=>Fe,PrefixCSS:()=>ye,RecordState:()=>Lr,State:()=>Pt,SvgTags:()=>_o,VoidTags:()=>To,_microtask:()=>Bt,_resetKeylessWarnings:()=>wr,batch:()=>Or,behavior:()=>Nt,computed:()=>Tr,configure:()=>lr,effect:()=>Wo,effectScope:()=>_r,flushPendingNotifiers:()=>Ro,flushSync:()=>Cr,hasPendingNotifiers:()=>Lo,hashString:()=>Le,isState:()=>hr,merge:()=>I,nextTick:()=>Dr,readonly:()=>dr,runBatched:()=>Do,toState:()=>g,untrack:()=>Mr,watch:()=>Pr});var rr=Object.defineProperty,So=Object.getOwnPropertySymbols,ir=Object.prototype.hasOwnProperty,ar=Object.prototype.propertyIsEnumerable,xo=(e,t,n)=>t in e?rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wo=(e,t)=>{for(var n in t||(t={}))ir.call(t,n)&&xo(e,n,t[n]);if(So)for(var n of So(t))ar.call(t,n)&&xo(e,n,t[n]);return e},zt=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","contentEditable","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","spellCheck","inert","download","noModule","paused","autoPictureInPicture"],Eo=["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"],Tt={htmlFor:"for",allowFullScreen:"allowfullscreen",autoFocus:"autofocus",autoPlay:"autoplay",contentEditable:"contenteditable",formNoValidate:"formnovalidate",isMap:"ismap",itemScope:"itemscope",noHref:"nohref",noShade:"noshade",noValidate:"novalidate",playsInline:"playsinline",trueSpeed:"truespeed",typeMustMatch:"typemustmatch",spellCheck:"spellcheck",noModule:"nomodule",autoPictureInPicture:"autopictureinpicture",autoCapitalize:"autocapitalize",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"},At=["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"],ye={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"]},_o=["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"],To=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Oo={};function lr(e){Object.assign(Oo,e)}function sr(){return Oo}var cr=["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"],ur=cr.reduce((e,t)=>{let n=t.slice(2).toLowerCase();return e[n]=t,e},{}),Mo=class{constructor(e){this._releases=new Set;let t=(()=>e());t.onSubscribe=n=>{this._releases.add(n)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear()}get dependencyCount(){return this._releases.size}},He=[],Ot=0;function Vt(){return Ot>0?null:He.length?He[He.length-1]:null}function Po(e,t){He.push(e);try{return t()}finally{He.pop()}}function mr(e){Ot++;try{return e()}finally{Ot--}}var te=[],Bt=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},Co=100,ot=0,Mt=new Set,De=new Set;function Do(e){ot++;try{return e()}finally{if(ot--,ot===0){let t=Mt;Mt=new Set;for(let n of t)n._scheduleFlush()}}}var Fe=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){if(!this._listeners)return;let n=this._listeners[e];n&&n.has(t)&&(n.delete(t),n.size===0&&delete this._listeners[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=te.length?te[te.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>=Co){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${Co} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...te]})}ot>0?Mt.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,De.add(this),Bt(()=>this._flushAll()))}_isCircular(e){let t=te.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let n=[...te.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
+ ${n.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,De.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:n,chain:o}]of e)te=o,this._flush(t,n);te=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let n=this._listeners[e];if(n){te.push([this,e]),this._flushing.set(e,t);for(let o of[...n])if(n.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),te.pop()}}};function Lo(){return De.size>0}function Ro(){let e=0;for(;De.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...De];De.clear();for(let n of t)n._flushAll()}}var Pt=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Fe,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=Vt();t&&this.addListener(t.handler)}return this._value}set(e){this._notifier&&(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 I(e={},t={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=me(t));for(let r in t){let a=t[r];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof e[r]=="object"?e[r]=I(e[r],a):e[r]=a;else if(n.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let s=e[r];e[r]=u=>{let h=typeof s=="function"?s(u):s,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join(", ")}}else e[r]=[e[r],a].filter(s=>s).join(", ");else if(i.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let s=e[r];e[r]=u=>{let h=typeof s=="function"?s(u):s,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join("")}}else e[r]=[e[r],a].filter(s=>s).join("");else if(o.includes(r))if(typeof e[r]=="function"||typeof a=="function"){let s=e[r];e[r]=u=>{let h=typeof s=="function"?s(u):s,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join(" ")}}else e[r]=[e[r],a].filter(s=>s).join(" ");else if(r.startsWith("on")){let s=r.replace("on","").toLowerCase();pr(e,s,a)}else if(r.startsWith("_on")){let s=r.replace("_on","");fr(e,s,a)}else e[r]=a}return e}function Le(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 g(e,t){return e instanceof Pt||e!=null&&e._isState?e:new Pt(e,t)}function hr(e){return typeof e=="object"&&e!==null&&e._isState===!0}function dr(e){return{_isState:!0,get(t){return e.get(t)}}}function Nt(e,t,n){return{_behaviors:{[e]:{attach:t,props:n}}}}function fr(e,t,n){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...r)=>{i(...r),n(...r)}:e[o]=n}function pr(e,t,n){let o=ur[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(r,a)=>{i(r,a),n(r,a)}:e[o]=n}function me(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 i of e)n.push(me(i,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[i,r]of e)n.set(me(i,t),me(r,t));return n}if(e instanceof Set){n=new Set,t.set(e,n);for(let i of e)n.add(me(i,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 i of Reflect.ownKeys(e))n[i]=me(e[i],t);return n}function $o(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 i=n[o],r=e[i];if(o===0&&!At.includes(i)&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i==="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(i==="$")e.$.forEach(a=>$o(a,!0));else{if(i.startsWith("_on")&&typeof r!="function")throw Error(`hook ${i} value "${r}" must be a function `);if(i.startsWith("on")&&typeof r!="function")throw Error(`event ${i} value "${r}" must be a function `);if(i==="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(i==="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(i==="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(i==="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function tt(e){return new RegExp("<([a-z][\\w-]*)(\\s[^>]*)?>.*<\\/\\1>|<([a-z][\\w-]*)(\\s[^>]*)?\\/>","is").test(e.trim())}function gr(e){let t=e.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi,"");return t=t.replace(/<script\b[^>]*\/>/gi,""),t=t.replace(/<script\b[^>]*>[\s\S]*$/gi,""),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(/((?:href|src|action|formaction)\s*=\s*)(["']?)[\s]*javascript:[^"'\s>]*/gi,"$1$2#"),t}function Io(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function zo(e){return Object.keys(e).find(t=>At.includes(t))}function Ao(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function yr(e){if(e.indexOf("@")===0)return[e];for(var t=[],n=0,o=0,i="",r=0,a=e.length;r<a;r++){var s=e[r];if(s==="(")n+=1;else if(s===")")n-=1;else if(s==="[")o+=1;else if(s==="]")o-=1;else if(s===","&&!n&&!o){t.push(i.trim()),i="";continue}i+=s}return t.push(i.trim()),t}function Dt(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 br(e,t){for(let n=0;n<e.length;n++){let o=e[n],i=null;typeof o.selectorText=="string"?i=Dt(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=Dt(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function Vo(e,t){var n;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let i=t!=null?t:sr().cspNonce;i&&(o.nonce=i),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 Lt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(n=>I(t,Lt(n))),delete e.$,I(t,e),t}else return e},vr={translate:["yes","no"],autoCapitalize:["on","off"]},Sr=class{constructor(e,t,n){this.declaredValue=void 0,this._notifier=new Fe,this._releases=[],this._removeHooked=!1,this.parent=n,this.isBoolean=zt.includes(e),this.enumeratedBoolean=vr[e],Eo.includes(e)?this.name=e:Object.hasOwn(Tt,e)?this.name=Tt[e]:this.name=Ao(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,n;let o=this.value;if(this.declaredValue=e,this._releases.length){for(let i of this._releases)i();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let r=this.value;this.value=this.isBoolean?!!e(i):this.normalize(e(i)),this.render(),r!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(n=this.parent)==null?void 0:n.nodeId} attribute:${this.name}`,i.onSubscribe=r=>{this._releases.push(r),this.parent&&!this._removeHooked&&(this._removeHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let a of this._releases)a();this._releases=[],i=null}))},this.value=this.isBoolean?!!e(i):this.normalize(e(i))}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=n=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",n)},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=[],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 n=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${Io(String(n))}"`}},Bo=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 Sr(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(!zt.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=(u,h)=>{let m=(u||"").split(" ").filter(d=>d);return!m.includes(h)&&m.push(h),m.join(" ")},i=(n=(t=this.items)==null?void 0:t.class)==null?void 0:n.declaredValue,r=typeof i=="function",a=r?i:this.get("class"),s=typeof e=="function";if(!r&&!s){this.set("class",o(a,e));return}this.set("class",u=>o(r?a(u):a,s?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(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))}},be=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",xr=class{constructor(e,t,n){this.value="",this._releases=[],this.name=e,this.cssName=e.startsWith("--")?e:Ao(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)),ye[this.name]&&ye[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.value="",this.parentRule=null}set(e){var t,n,o,i;if(this._releases.length){for(let r of this._releases)r();this._releases=[]}if(typeof e=="function"){let r=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(r),this._domUpdate())});r.onSubscribe=a=>{this._releases.push(a)},r.elementNode=this.parentRule.root,r.debug=`class:${(n=(t=this.parentRule)==null?void 0:t.root)==null?void 0:n.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(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),ye[this.name]&&ye[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 ye[this.name]&&ye[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},ue=class Rt{constructor(t,n){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new No(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 Rt;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Rt;)t=t.parent;return t}insertStyle(t,n){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(n):this.styleBlock[t]=new xr(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){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,n=t.cssRules;for(let o=0;o<n.length;o++)if(n[o]===this.domRule){t.deleteRule(o);break}}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),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,i=t.insertRule(o,t.cssRules.length),r=t.cssRules[i];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},No=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof ue;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let n={},o=[];function i(r,a){return r.startsWith("&")?`${a}${r.slice(1)}`:`${a} ${r}`}for(let r in e){let a=e[r],s=yr(r);for(let u of s){let h=i(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof a=="object"&&a!=null){let m=new ue(u,this.parent);m.styleList.addCSS(a,t),o.push(m)}}else if(u.startsWith("@keyframes")){let m=new ue(u,this.parent);m.styleList.addCSS(a,""),this.items.push(m)}else if(u.startsWith("@font-face")){let m=new ue(u,this.parent);for(let d in a)m.insertStyle(d,a[d]);this.items.push(m)}else if(typeof a=="object"&&a!=null){let m=new ue(h,this.parent);this.items.push(m);for(let[d,p]of Object.entries(a))if(typeof p=="object"&&p!=null){let v=i(d,h);this.addCSS(p,v)}else m.insertStyle(d,p)}else n[u]=a}}if(Object.keys(n).length){let r=new ue(t,this.parent);for(let a in n)r.insertStyle(a,n[a]);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 s in e){let u=e[s];typeof u=="object"&&u!=null||(o[s]=u)}let i=this.items.find(s=>s.selectorText===t);i||(i=new ue(t,this.parent),this.items.push(i));let r=new Set(Object.keys(o));for(let s in o)i.insertStyle(s,o[s]);if(i.styleBlock)for(let s of Object.keys(i.styleBlock))r.has(s)||i.removeStyle(s);let a=(n=this.domStyle)==null?void 0:n.sheet;!i.domRule&&a&&i.render(a)}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(n=>n.selectorText===e);return t||(t=new ue(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let n=e.get(Dt(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,i)=>{let r=i-t,a=e[r];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==n(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}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}},U=class Pe{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 Ho(this),this.styles=new No(this),this.attributes=new Bo(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,r;t=me(t),$o(t),t.style=t.style||{},this.parent=n,this.tagName=zo(t),t=Lt(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(r=this.parent)==null?void 0:r.nodeId}.${o}`,s=JSON.stringify(t.style||{},(h,m)=>typeof m=="function"?a:m);this.nodeId=Le(a+s),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let u=t[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 i=t(n);this.children.update(Array.isArray(i)?i:[i])}catch(i){this._handleError(i)}};n.elementNode=this,n.debug=`class:${this.tagName}_${this.nodeId} children`;let o=[];n.onSubscribe=i=>{o.push(i),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=_o.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 i,r;return(r=(i=this._events)==null?void 0:i[t])==null?void 0:r.call(i,o,this)};this.domElement.addEventListener(t,n),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,n),n=null})}_dispose(){var t,n,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(n=(t=this._hooks).BeforeRemove)==null||n.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(r=>r.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(o=this._hooks).Remove)==null||i.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){I(this._context,t._context),I(this._metadata,t._metadata),this._processBehaviors(t._behaviors);let n=Object.keys(t);for(let o=0;o<n.length;o++){let i=n[o],r=t[i];["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(i)?this.addHook(i.substring(3),r):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),r):i==="_portal"?this._portal=r:i==="class"?(typeof r=="string"||typeof r=="function")&&this.attributes.addClass(r):this.attributes.set(i,r))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var n;let o=me(t);o.style=o.style||{},o=Lt(o);let i=o[this.tagName];if(typeof i=="function")(n=this._childrenRelease)==null||n.call(this),this._childrenRelease=void 0,this._setupFunctionChildren(i);else if(i!=null){let m=Array.isArray(i)?i:[i];this.children.update(m,!!this.domElement,!0)}o._context&&I(this._context,o._context),o._metadata&&I(this._metadata,o._metadata),this._processBehaviors(o._behaviors),this.styles.patchCSS(o.style||{},`.${this.tagName}_${this.nodeId}`);let r=`${this.tagName}_${this.nodeId}`,a=["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName],s=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],u=new Set(["class"]),h=null;this._events={};for(let m of Object.keys(o)){if(a.includes(m)||s.includes(m)||m==="_portal")continue;let d=o[m];m.startsWith("on")&&typeof d=="function"?this.addEvent(m.substring(2).toLowerCase(),d):m==="class"&&(typeof d=="string"||typeof d=="function")?h=d:(this.attributes.set(m,d),u.add(m))}if(typeof h=="function"){let m=h;this.attributes.set("class",d=>`${r} ${m(d)}`)}else this.attributes.set("class",h?`${r} ${h}`:r);if(this.attributes.items)for(let m of Object.keys(this.attributes.items))u.has(m)||this.attributes.remove(m);if(this._events)for(let m in this._events)this._bindEvent(m)}_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]=(i,r)=>{o(i,r),n(i,r)}:this._events[t]=n}addHook(t,n){let o=this._hooks[t];if(typeof o=="function"){let i=((...r)=>{o(...r),n(...r)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,n.length),configurable:!0})}catch(r){}this._hooks[t]=i}else this._hooks[t]=n}getRoot(){let t=this;for(;t&&t instanceof Pe&&t.parent;)t=t.parent;return t}_processBehaviors(t){var n;if(t)for(let o of Object.keys(t)){let i=t[o],r=this._behaviorInstances.get(o);r?(n=r.update)==null||n.call(r,i.props):this.domElement?this._attachBehaviorNow(o,i):(this._pendingBehaviors.set(o,i),this._ensureBehaviorMountHook())}}_attachBehaviorNow(t,n){let o=n.attach(this,n.props)||{};this._behaviorInstances.set(t,o),this._ensureBehaviorTeardownHook()}_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",()=>{this._behaviorInstances.forEach(t=>{var n;return(n=t.destroy)==null?void 0:n.call(t)}),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 Pe?n.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(To.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(be&&!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&&this.children.items.forEach((o,i)=>{let r=t.childNodes[i];r&&(o instanceof Pe?o.mount(r):o.domText=r)}),n){let o=n.sheet;o&&this._hydrateStyles(br(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var n;if((n=this.styles)==null||n.hydrate(t),this.children)for(let o of this.children.items)o instanceof Pe&&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,i=t.getRootNode(),r=i instanceof ShadowRoot?i:document.head;return o||(o=Vo(r)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof Pe&&a._portal){let s=a._portal(this.getRoot());s&&a.render(s)}else a.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())},i=this._hooks.BeforeRemove;this._beforeRemoveFired=!0,i(this,o),i.length<2&&!n?o():be&&!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()}}},ko=class{constructor(e,t){this.type="TextNode",this._imperative=!1,this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(tt(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),t.content.querySelectorAll("*").forEach(n=>{for(let o of Array.from(n.attributes))/^on/i.test(o.name)?n.removeAttribute(o.name):/^(?:href|src|action|formaction)$/i.test(o.name)&&/^\s*javascript:/i.test(o.value)&&n.setAttribute(o.name,"#")}),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}setText(e){var t;let n=e===""?"\u200B":String(e);if(n===this.text&&this.domText)return;let o=tt(this.text);if(this.text=n,!this.domText)return;if(!o&&!tt(n)&&this.domText.nodeType===3){this.domText.nodeValue=n;return}let i=this.domText,r=this._createDOMNode();(t=i.parentNode)==null||t.replaceChild(r,i)}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":tt(this.text)?gr(this.text):Io(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},$t=new Set;function wr(){$t.clear()}var Ho=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new U(e,this.owner,this._nextKey++):new ko(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],i=o instanceof U?o.domElement:o.domText;if(i&&i.parentNode===t)return i}return null}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof U?e.domElement:e.domText;if(!o)return;let i=this._domReferenceAfter(t+1);o!==i&&n.insertBefore(o,i)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof U?e.domElement:e.domText,i=t instanceof U?t.domElement:t.domText;if(!o||!i)return;let r=o.nextSibling,a=i.nextSibling;n.insertBefore(o,a),n.insertBefore(i,r)}update(e,t=!0,n=!1){var o,i,r,a;if(this.items.some(f=>f._imperative)){let f=this.items.filter(S=>!S._imperative),y=this.items.filter(S=>S._imperative);this.items=f.concat(y)}let s=this.items.slice(),u=new Map;for(let f of s)f instanceof U&&f.key!==null&&f.key!==void 0&&!f._imperative&&!f._beforeRemoveFired&&u.set(f.key,f);!n&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let h=new Set(s),m=new Set,d=0,p=be&&s.length>0?e.length!==s.length:!1;for(let f=0;f<e.length;f++){let y=e[f],S=typeof y=="object"&&y!==null,C=S?y._key:void 0,E=S?zo(y):void 0;if(be&&S&&C===void 0&&d++,C!==void 0){let w=u.get(C);if(w instanceof U&&w.tagName===E){u.delete(C);let O=this.items.indexOf(w);if(O!==f&&O>=0){let M=!!w._portal;this.move(O,f,M?!1:t,!0)}w.parent=this.owner,w.patch(y),m.add(w);continue}}else if(S){let w=this.items[f];if(w instanceof U&&w.key==null&&w.tagName===E&&h.has(w)&&!m.has(w)&&!w._imperative&&!w._beforeRemoveFired){w.parent=this.owner,w.patch(y),m.add(w);continue}}else{let w=this.items[f];if(w instanceof ko&&h.has(w)&&!m.has(w)&&!w._imperative){w.setText(y==null?"":y),m.add(w);continue}}m.add(this.insert(y,f,t,!0,!0))}let v=this.items.slice(e.length);for(let f of v)f._imperative||this.remove(f,t,!0);if(u.forEach(f=>this.remove(f,t,!0)),be&&s.length>0&&d>0&&p){let f=this.owner.nodeId;if(!$t.has(f)){$t.add(f);let y=`[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}>, ${d} unkeyed item${d===1?"":"s"})`;console.warn(y)}}n||(a=(r=this.owner._hooks)==null?void 0:r.Update)==null||a.call(r,this.owner)}insert(e,t,n=!0,o=!1,i=!1){let r=this.items.length,a=typeof t!="number"||Number.isNaN(t)||t<0||t>r?r:t,s=this._createNode(e);if(s._imperative=!i,this.items.splice(a,0,s),s instanceof U){s._hooks.Insert&&s._hooks.Insert(s);let u=this.owner.domElement;if(n&&u)if(s._portal){let h=s._portal(this.owner.getRoot());h&&s.render(h)}else{let h=s._createDOMNode(),m=this._domReferenceAfter(a+1);u.insertBefore(h,m);let d=u.getRootNode(),p=d instanceof ShadowRoot?d:document.head,v=Vo(p);s.styles.render(v),s._hooks.Mount&&s._hooks.Mount(s),s.children.items.forEach(f=>{if(f instanceof U&&f._portal){let y=f._portal(f.getRoot());y&&f.render(y)}else f.render(h)})}}else{let u=this.owner.domElement;if(n&&u){let h=s._createDOMNode(),m=this._domReferenceAfter(a+1);u.insertBefore(h,m)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),s}remove(e,t=!0,n=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof U){if(e._beforeRemoveFired)return;let i=()=>{let r=e.domElement,a=this.items.indexOf(e);a>=0&&this.items.splice(a,1),t&&r&&r.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let r=!1,a=()=>{r||(r=!0,i())},s=e._hooks.BeforeRemove;e._beforeRemoveFired=!0,s(e,a),s.length<2&&!r?a():be&&!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 i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.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 i=this.items[e],r=this.items[t];this.items[e]=r,this.items[t]=i,n&&this._swapDomElement(i,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 i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),n&&this._moveDomElement(i,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}},ve=new Set,It=!1;function jo(e){ve.add(e),!It&&(It=!0,Bt(Fo))}function Fo(){for(It=!1;ve.size>0;){let e=[...ve];ve.clear();for(let t of e)try{t()}catch(n){console.error("[Domphy] Uncaught error in effect:",n)}}}function Cr(){let e=0;for(;Lo()||ve.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}Ro(),Fo()}}var je=[];function kr(){return je.length?je[je.length-1]:null}function Ht(e){let t=kr();t&&t._add(e)}var Er=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 be&&console.warn("[Domphy] effectScope.run() called after stop() \u2014 resources created inside are registered to the enclosing scope instead of this stopped one."),e();je.push(this);try{return e()}finally{je.pop()}}stop(){if(!this._stopped){this._stopped=!0;for(let e of this._disposers)e();this._disposers.clear()}}};function _r(){let e=new Er;return Ht(()=>e.stop()),e}function Wo(e){let t=!1,n=!1,o=()=>{t||r()},i=new Mo(()=>{t||jo(o)}),r=()=>{if(!(t||n)){n=!0,i.reset();try{Po(i,e)}finally{n=!1}}},a=()=>{t||(t=!0,i.reset(),ve.delete(o))};return Ht(a),r(),a}function Tr(e){let t="computed",n=new Fe,o,i=!0,r=!1,a=()=>{i&&n.listenerCount(t)>0&&h()},s=new Mo(()=>{i||(i=!0,jo(a))}),u=()=>{s.reset(),o=Po(s,e),i=!1,r=!0},h=()=>{let d=o,p=r;u(),!(p&&o===d)&&n.notify(t,o)},m=d=>{if(d)n.addListener(t,d);else{let p=Vt();p&&n.addListener(t,p.handler)}return i&&(r&&n.listenerCount(t)>0?h():u()),o};return Ht(()=>{s.reset(),ve.delete(a),n._dispose()}),{_isState:!0,_notifier:n,get:m}}function Or(e){return Do(e)}function Mr(e){return mr(e)}function Pr(e,t,n){let o,i=!0;return Wo(()=>{let r=typeof e=="function"?e():e.get();(!i||n!=null&&n.immediate)&&t(r,o),o=r,i=!1})}function Dr(e){return e?Promise.resolve().then(e):Promise.resolve()}var Lr=class{constructor(e){this._notifier=new Fe,this.initialRecord=wo({},e),this._record=wo({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let n=Vt();n&&this._notifier.addListener(e,n.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 st={};et(st,{COLOR_ROLES:()=>Xr,ElementTones:()=>We,applySystemTheme:()=>Gr,generateTheme:()=>oi,getTheme:()=>oe,setTheme:()=>Ur,themeApply:()=>Kr,themeCSS:()=>Ut,themeColor:()=>l,themeColorToken:()=>Zt,themeDensity:()=>b,themeFluidSpacing:()=>Yr,themeName:()=>lt,themeSize:()=>x,themeSpacing:()=>c,themeTokens:()=>Jo,themeVars:()=>at});var Rr=e=>{let t=n=>{let o=Math.max(0,Math.min(1,n)),i=o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(i*255)))};return e.map(t)},$r=e=>{let t=n=>n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;return e.map(t)},Ir=e=>{let[t,n,o]=Rr(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}`},rt=e=>{let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,o=parseInt(e.slice(5,7),16)/255;return $r([t,n,o])},zr=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],i=Math.cbrt(t),r=Math.cbrt(n),a=Math.cbrt(o);return[.2104542553*i+.793617785*r-.0040720468*a,1.9779984951*i-2.428592205*r+.4505937099*a,.0259040371*i+.7827717662*r-.808675766*a]},Ar=e=>{let[t,n,o]=e,i=t+.3963377774*n+.2158037573*o,r=t-.1055613458*n-.0638541728*o,a=t-.0894841775*n-1.291485548*o,s=i*i*i,u=r*r*r,h=a*a*a;return[4.0767416621*s-3.3077115913*u+.2309699292*h,-1.2684380046*s+2.6097574011*u-.3413193965*h,-.0041960863*s-.7034186147*u+1.707614701*h]};var Ft=e=>{let[t,n,o]=e,i=.4124564*t+.3575761*n+.1804375*o,r=.2126729*t+.7151522*n+.072175*o,a=.0193339*t+.119192*n+.9503041*o,s=.95047,u=1,h=1.08883,m=f=>f>.008856?Math.cbrt(f):7.787*f+16/116,d=m(i/s),p=m(r/u),v=m(a/h);return[116*p-16,500*(d-p),200*(p-v)]};var qo=(e,t)=>{let[n,o,i]=e,[r,a,s]=t,u=(n+r)/2,h=Math.sqrt(o*o+i*i),m=Math.sqrt(a*a+s*s),d=(h+m)/2,p=.5*(1-Math.sqrt(Math.pow(d,7)/(Math.pow(d,7)+Math.pow(25,7)))),v=o*(1+p),f=a*(1+p),y=Math.sqrt(v*v+i*i),S=Math.sqrt(f*f+s*s),C=(y+S)/2,E=Math.atan2(i,v)*180/Math.PI+(Math.atan2(i,v)<0?360:0),w=Math.atan2(s,f)*180/Math.PI+(Math.atan2(s,f)<0?360:0),O=w-E;Math.abs(O)>180&&(O+=w<=E?360:-360);let M=Math.abs(E-w)>180?(E+w+360)/2:(E+w)/2,_=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),D=r-n,B=S-y,H=2*Math.sqrt(y*S)*Math.sin(O/2*Math.PI/180),j=1+.015*Math.pow(u-50,2)/Math.sqrt(20+Math.pow(u-50,2)),pe=1+.045*C,Te=1+.015*C*_,ce=30*Math.exp(-Math.pow((M-275)/25,2)),W=-(2*Math.sqrt(Math.pow(C,7)/(Math.pow(C,7)+Math.pow(25,7))))*Math.sin(2*ce*Math.PI/180);return Math.sqrt(Math.pow(D/j,2)+Math.pow(B/pe,2)+Math.pow(H/Te,2)+W*(B/pe)*(H/Te))};var Uo=e=>{if(e.length<1)return h=>0;let t=[...e].sort((h,m)=>h[0]-m[0]),n=[];for(let h=0;h<t.length;h++)(h===0||t[h][0]!==t[h-1][0])&&n.push(t[h]);let o=n.length;if(o===1)return h=>n[0][1];let i=n.map(h=>h[0]),r=n.map(h=>h[1]),a=[],s=[];for(let h=0;h<o-1;h++)a[h]=i[h+1]-i[h],s[h]=(r[h+1]-r[h])/a[h];let u=new Array(o);u[0]=s[0],u[o-1]=s[o-2];for(let h=1;h<o-1;h++){let m=s[h-1],d=s[h];if(m*d<=0)u[h]=0;else{let p=(1+a[h]/(a[h-1]+a[h]))/3;u[h]=m*d/((1-p)*m+p*d)}}return h=>{if(h<=i[0])return r[0];if(h>=i[o-1])return r[o-1];let m=0,d=o-2,p=0;for(;m<=d;){let w=Math.floor((m+d)/2);if(h>=i[w]&&h<=i[w+1]){p=w;break}h<i[w]?d=w-1:m=w+1}let v=a[p],f=(h-i[p])/v,y=f*f,S=y*f,C=u[p]*v,E=u[p+1]*v;return(2*S-3*y+1)*r[p]+(S-2*y+f)*C+(-2*S+3*y)*r[p+1]+(S-y)*E}};var Ko=.605,jt=.685;function Vr(e){let t=Math.pow(e,Ko);return t/(1+jt*(1-t))}function Br(e){let t=e*(1+jt)/(1+e*jt);return Math.pow(t,1/Ko)}function Nr(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 Hr(e){let t=[[0,0,0],...e,[1,1,1]].map(p=>zr(p)).sort((p,v)=>p[0]-v[0]),n=t.map(p=>p[0]),o=t.map(p=>p[1]),i=t.map(p=>p[2]),r=[0],a=0;for(let p=1;p<t.length;p++)a+=Nr(t[p],t[p-1]),r.push(a);let s=r.map(p=>Br(a>0?p/a:0)),u=e.length===1?0:s[1],h=e.length===1?1:s[s.length-2],m=Uo(s.map((p,v)=>[p,o[v]])),d=Uo(s.map((p,v)=>[p,i[v]]));return{colorAtParam:p=>{let v=Vr(p),f=u+v*(h-u),y=0;for(let _=0;_<s.length-1;_++)if(f<=s[_+1]){y=_;break}let S=s[y],C=s[y+1],E=(f-S)/(C-S||1),w=n[y]+E*(n[y+1]-n[y]),O=m(f),M=d(f);return Ar([w,O,M])},parameters:s.slice(1,-1).map(p=>(p-u)/(h-u))}}function Yo(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[n[0]];let{colorAtParam:o,parameters:i}=Hr(n.map(rt)),r=[],a=[0,...i,1],s=a.map(h=>Math.round(h*(t-1))),u=0;for(let h=0;h<t;h++){for(;u<s.length-2&&h>s[u+1];)u++;let m=s[u],d=s[u+1],p=a[u],v=a[u+1],f;if(d<=m)f=p;else{let y=(h-m)/(d-m);f=p+y*(v-p)}r.push(Ir(o(f)))}return r.reverse()}var jr={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","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#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:{}},Ue=jr,Gt=e=>JSON.parse(JSON.stringify(e)),Xo=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),Re={light:Gt(Ue),dark:qr(Ue)},it=null,Wt=new Map;function Xt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Fr(e){for(let t in e)if(!Object.keys(Ue).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}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[]")}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")}if("direction"in e&&e.direction!=="lighten"&&e.direction!=="darken")throw new Error('direction must be "lighten" or "darken"')}function Zo(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]={}),Zo(e[o],t[o])):e[o]=t[o])}function Wr(e,t){let n={},o=Xt(t);for(let r in t){let a=t[r];if(r==="colors")for(let s in t.colors)[...Array(o).keys()].forEach(u=>n[`--${s}-${u}`]=t.colors[s][u]);else if(r==="fontSizes")[...Array(8).keys()].forEach(s=>n[`--fontSize-${s}`]=t.fontSizes[s]);else if(r==="custom"&&a&&typeof a=="object")for(let s in a)n[`--custom-${Xo(s)}`]=a[s]}let i="";for(let r in n)i+=` ${r}: ${n[r]};
3
3
  `;return`[data-theme="${e}"] {
4
- ${i}}`}function ee(e){if(!De[e])throw Error(`Theme "${e}" not found`);return De[e]}function Br(e,t){Ar(t),De[e]||(De[e]=qt(Fe)),qo(De[e],t),nt=null,Ht.clear()}function Nr(e){let t=qt(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 Uo(e){let t=Ht.get(e);if(t)return t;let n=ee(e),o=Ut(n),i={};for(let r in n){let a=n[r];if(r==="colors")for(let c in n.colors){let u={};[...Array(o).keys()].forEach(m=>u[m]=n.colors[c][m]),i[c]=u}else if(r==="fontSizes")i.fontSizes=n.fontSizes;else if(r==="densities")i.densities=n.densities;else if(r==="custom"&&(i.custom={},a&&typeof a=="object"))for(let c in a)i.custom[c]=a[c]}return Ht.set(e,i),i}function rt(){if(nt)return nt;let e=ee("light"),t=Ut(e),n={};for(let o in e){let i=e[o];if(o==="colors")for(let r in e.colors){let a={};[...Array(t).keys()].forEach(c=>a[c]=`var(--${r}-${c})`),n[r]=a}else if(o==="fontSizes")n.fontSizes=[...Array(8).keys()].map(r=>`var(--fontSize-${r})`);else if(o==="custom"&&(n.custom={},i&&typeof i=="object"))for(let r in i)n.custom[r]=`var(--custom-${Wo(r)})`}return nt=n,n}function jt(){return Object.entries(De).map(([e,t])=>Vr(e,t)).join(`
5
- `)}function Hr(e){var t;if(typeof document!="undefined")if(e){e.textContent=jt();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=jt(),document.head.appendChild(e)}function s(e){return`calc(${e/4}em)`}function jr(e,t,n=320,o=1280){let i=e/4,r=t/4,a=(r-i)/(o-n)*100,c=i-a*n/100,u=parseFloat(c.toFixed(4))===0?`${a.toFixed(4)}vw`:`${c.toFixed(4)}em + ${a.toFixed(4)}vw`;return`clamp(${i}em, ${u}, ${r}em)`}function Fr(e=document.documentElement,t={}){let{persist:n=!0,storageKey:o="dp-theme"}=t,i=()=>{if(n){let c=localStorage.getItem(o);if(c==="light"||c==="dark")return c}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};e.setAttribute("data-theme",i());let r=window.matchMedia("(prefers-color-scheme: dark)"),a=c=>{(!n||!localStorage.getItem(o))&&e.setAttribute("data-theme",c.matches?"dark":"light")};return r.addEventListener("change",a),()=>r.removeEventListener("change",a)}function it(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 Wr=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],Ft=["inherit"];[...Array(5).keys()].forEach(e=>{Ft.push(`decrease-${e}`),Ft.push(`increase-${e}`)});function qr(e,t="inherit"){if(!Ft.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 Ur(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=qr(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function v(e){let t=Ur(e);return ee(e?it(e):"light").densities[t]}var Kr=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],Yr=[.75,1,1.5,2,2.5];function Gr(e,t){let n=Nt(ot(t)),o=0,i=1/0;for(let r=0;r<e.length;r++){let a=No(n,Nt(ot(e[r])));a<i&&(i=a,o=r)}return o}function Xr(e,t={}){var n,o,i,r,a,c;let u=(n=t.steps)!=null?n:18,m={},h={};for(let[d,p]of Object.entries(e)){let b=jo(p,u);m[d]=b,h[d]=Gr(b,p)}return{direction:(o=t.direction)!=null?o:"darken",colors:m,baseTones:h,fontSizes:(i=t.fontSizes)!=null?i:Kr,densities:(r=t.densities)!=null?r:Yr,darkBias:(a=t.darkBias)!=null?a:1,custom:(c=t.custom)!=null?c:{}}}var Wt=["inherit"];[...Array(8).keys()].forEach(e=>{Wt.push(`decrease-${e}`),Wt.push(`increase-${e}`)});function Ko(e,t="inherit"){if(!Wt.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 Jr(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=Ko(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function w(e,t="inherit"){let n=Ko(Jr(e),t);return rt().fontSizes[n]}var ue=Fe.colors.neutral.length,je=["inherit","base"];[...Array(ue).keys()].forEach(e=>{je.push(`decrease-${e}`),je.push(`increase-${e}`),je.push(`shift-${e}`)});function Fo(e,t){if(e<0||e>ue-1)return e;let n=e+t;return n=Math.max(0,Math.min(ue-1,n)),n}function Zr(e,t){if(e<0||e>ue-1)return e;let n=Math.floor((ue-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(ue-1,o)),o}function We(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!je.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return Fo(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return Fo(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return Zr(e,n)}else return e}function Yo(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=We(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function Go(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===ue-1?ue-1-n:e}function l(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e){let c=rt()[o];if(!c)throw Error(`color "${o}" not found on theme "light"`);return t==="base"?c[ee("light").baseTones[o]]:c[We(0,t)]}let i=it(e),r;if(t==="base")r=ee(i).baseTones[o];else{let c=ee(i),u=Go(Yo(e),c.direction,c.darkBias);r=We(u,t)}let a=rt()[o];if(!a)throw Error(`color "${o}" not found on theme "${i}"`);return a[r]}function Kt(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,i=e?it(e):"light",r=Uo(i)[o];if(!r)throw Error(`color "${o}" not found on theme "${i}"`);if(!e)return t==="base"?r[ee("light").baseTones[o]]:r[We(0,t)];let a;if(t==="base")a=ee(i).baseTones[o];else{let c=ee(i),u=Go(Yo(e),c.direction,c.darkBias);a=We(u,t)}return r[a]}var St={};Ze(St,{abbreviation:()=>Qr,accordion:()=>ei,alert:()=>ti,avatar:()=>oi,badge:()=>ni,blockquote:()=>ri,breadcrumb:()=>ii,breadcrumbEllipsis:()=>ai,button:()=>li,buttonGhost:()=>si,buttonSwitch:()=>ci,card:()=>ui,code:()=>hi,combobox:()=>ea,command:()=>ta,commandItem:()=>na,commandSearch:()=>oa,datePicker:()=>ia,descriptionList:()=>sa,details:()=>ca,dialog:()=>ua,divider:()=>ha,drawer:()=>ma,emphasis:()=>da,empty:()=>fa,errorBoundary:()=>pa,fab:()=>ya,figure:()=>ba,formGroup:()=>va,heading:()=>wa,horizontalRule:()=>xa,icon:()=>Ca,image:()=>ka,inputCheckbox:()=>Ea,inputColor:()=>_a,inputDateTime:()=>Ta,inputFile:()=>Ma,inputNumber:()=>Oa,inputOTP:()=>$a,inputPassword:()=>La,inputRadio:()=>Ia,inputRange:()=>Ra,inputSearch:()=>za,inputSwitch:()=>Aa,inputText:()=>Va,keyboard:()=>Ba,label:()=>Na,link:()=>Ha,linkButton:()=>ja,list:()=>Fa,listItem:()=>Wa,listItemButton:()=>qa,mark:()=>Ua,menu:()=>Ka,motion:()=>Ya,orderedList:()=>Ga,pagination:()=>Ja,paragraph:()=>Za,popover:()=>Qa,popoverArrow:()=>io,preformated:()=>el,progress:()=>tl,rating:()=>rl,ringProgress:()=>il,scrollArea:()=>al,segmented:()=>ll,select:()=>sl,selectBox:()=>cl,selectItem:()=>ul,selectList:()=>hl,skeleton:()=>ml,small:()=>dl,spinner:()=>fl,splitter:()=>pl,splitterHandle:()=>yl,splitterPanel:()=>gl,steps:()=>bl,strong:()=>vl,subscript:()=>Sl,superscript:()=>wl,table:()=>xl,tabs:()=>Cl,tag:()=>Ke,textarea:()=>kl,timeline:()=>El,timelineItem:()=>_l,toast:()=>Tl,toggleGroup:()=>Ml,toolbar:()=>Ol,toolbarSpacer:()=>Pl,tooltip:()=>Dl,transitionGroup:()=>Ll,unorderedList:()=>$l});function Qr(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>w(r),backgroundColor:r=>l(r),color:r=>l(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>l(r,"shift-7",t.get(r)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:r=>l(r,"shift-11",n.get(r)),textDecorationColor:r=>l(r,"shift-9",n.get(r))}}}}function ei(e={}){var i,r;let{type:t="single"}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=g((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:a=>{if(t!=="single")return;let c=a.domElement;if(!c)return;let u=m=>{let h=m.target.closest("summary");if(!h)return;let d=h.closest("details");!d||d.parentElement!==c||d.open||Array.from(c.querySelectorAll(":scope > details")).forEach(p=>{p!==d&&(p.open=!1)})};c.addEventListener("click",u),a.addHook("Remove",()=>c.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:a=>s(v(a)*1),outline:a=>`1px solid ${l(a,"shift-4",n.get(a))}`,outlineOffset:"-1px",overflow:"hidden","& > details":{borderBottom:a=>`1px solid ${l(a,"shift-4",n.get(a))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`}}}}function ti(e={}){var n;let t=g((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(v(o)*2),paddingInline:o=>s(v(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>w(o,"inherit")}}}function oi(e={}){var n;let t=g((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>w(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function ni(e={}){var i;let{label:t=999}=e,n=g(t),o=g((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>w(r,"decrease-1"),borderRadius:s(999),backgroundColor:r=>l(r,"shift-9",o.get(r)),color:r=>l(r,"shift-0",o.get(r))}}}}function ri(e={}){var n;let t=g((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=>w(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(v(o)*2),paddingInline:o=>s(v(o)*4),margin:0}}}function ii(e={}){var o;let{separator:t="/"}=e,n=g((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>w(i,"inherit"),gap:s(1),color:i=>l(i,"shift-9",n.get(i)),backgroundColor:i=>l(i,"inherit",n.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"shift-8",n.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",n.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",n.get(i)),pointerEvents:"none"}}}}function ai(e={}){var n;let t=g((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=>w(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}function li(e={}){var n;let t=g((n=e.color)!=null?n:"primary","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>w(o,"inherit"),paddingBlock:o=>s(v(o)*1),paddingInline:o=>s(v(o)*3),borderRadius:o=>s(v(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(v(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function si(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>w(o,"inherit"),paddingBlock:o=>s(v(o)*1),paddingInline:o=>s(v(o)*1),borderRadius:o=>s(v(o)*1),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>s(v(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",color:o=>l(o,"shift-6",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-4","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function ci(e={}){var r,a;let{checked:t=!1}=e,n=g(t),o=g((r=e.color)!=null?r:"neutral","color"),i=g((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:c=>{c.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>n.get(c),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>w(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${l(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>l(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>l(c,"shift-9"),backgroundColor:c=>l(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>l(c,"increase-3",i.get(c)),outline:"none",color:c=>l(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ui(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(v(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>s(v(o)*2),paddingInline:o=>s(v(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(v(o)*4),color:o=>l(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(v(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(v(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(v(o)*2),paddingInline:o=>s(v(o)*4),borderTop:o=>`1px solid ${l(o,"shift-3",t.get(o))}`}}}}function hi(e={}){var n;let t=g((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=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}var mi=Object.defineProperty,di=Object.defineProperties,fi=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,ln=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,Xo=(e,t,n)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X=(e,t)=>{for(var n in t||(t={}))ln.call(t,n)&&Xo(e,n,t[n]);if(st)for(var n of st(t))sn.call(t,n)&&Xo(e,n,t[n]);return e},Se=(e,t)=>di(e,fi(t)),cn=(e,t)=>{var n={};for(var o in e)ln.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&st)for(var o of st(e))t.indexOf(o)<0&&sn.call(e,o)&&(n[o]=e[o]);return n},Ce=(e,t,n)=>new Promise((o,i)=>{var r=u=>{try{c(n.next(u))}catch(m){i(m)}},a=u=>{try{c(n.throw(u))}catch(m){i(m)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(r,a);c((n=n.apply(e,t)).next())}),pi=["top","right","bottom","left"],Jo=["start","end"],Is=pi.reduce((e,t)=>e.concat(t,`${t}-${Jo[0]}`,`${t}-${Jo[1]}`),[]),ct=Math.min,ve=Math.max,ut=Math.round,lt=Math.floor,te=e=>({x:e,y:e}),gi={left:"right",right:"left",bottom:"top",top:"bottom"};function Zo(e,t,n){return ve(e,ct(t,n))}function dt(e,t){return typeof e=="function"?e(t):e}function we(e){return e.split("-")[0]}function ft(e){return e.split("-")[1]}function un(e){return e==="x"?"y":"x"}function hn(e){return e==="y"?"height":"width"}function he(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function mn(e){return un(he(e))}function yi(e,t,n=!1){let o=ft(e),i=mn(e),r=hn(i),a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=ht(a)),[a,ht(a)]}function bi(e){let t=ht(e);return[Xt(e),t,Xt(t)]}function Xt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Qo=["left","right"],en=["right","left"],vi=["top","bottom"],Si=["bottom","top"];function wi(e,t,n){switch(e){case"top":case"bottom":return n?t?en:Qo:t?Qo:en;case"left":case"right":return t?vi:Si;default:return[]}}function xi(e,t,n,o){let i=ft(e),r=wi(we(e),n==="start",o);return i&&(r=r.map(a=>`${a}-${i}`),t&&(r=r.concat(r.map(Xt)))),r}function ht(e){let t=we(e);return gi[t]+e.slice(t.length)}function Ci(e){return X({top:0,right:0,bottom:0,left:0},e)}function ki(e){return typeof e!="number"?Ci(e):{top:e,right:e,bottom:e,left:e}}function mt(e){let{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function tn({reference:e,floating:t},n,o){let i=he(n),r=mn(n),a=hn(r),c=we(n),u=i==="y",m=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,d=e[a]/2-t[a]/2,p;switch(c){case"top":p={x:m,y:e.y-t.height};break;case"bottom":p={x:m,y:e.y+e.height};break;case"right":p={x:e.x+e.width,y:h};break;case"left":p={x:e.x-t.width,y:h};break;default:p={x:e.x,y:e.y}}switch(ft(n)){case"start":p[r]-=d*(o&&u?-1:1);break;case"end":p[r]+=d*(o&&u?-1:1);break;default:}return p}function Ei(e){return Ce(this,arguments,function*(t,n={}){var o,i,r,a,c,u;let{x:m,y:h,platform:d,rects:p,elements:b,strategy:f}=t,{boundary:y="clippingAncestors",rootBoundary:S="viewport",elementContext:C="floating",altBoundary:E=!1,padding:x=0}=dt(n,t),M=ki(x),O=b[E?C==="floating"?"reference":"floating":C],_=mt(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,O))==null||i?O:O.contextElement||(yield(r=d.getDocumentElement)==null?void 0:r.call(d,b.floating)),boundary:y,rootBoundary:S,strategy:f})),D=C==="floating"?{x:m,y:h,width:p.floating.width,height:p.floating.height}:p.reference,A=yield(a=d.getOffsetParent)==null?void 0:a.call(d,b.floating),V=(yield(c=d.isElement)==null?void 0:c.call(d,A))?(yield(u=d.getScale)==null?void 0:u.call(d,A))||{x:1,y:1}:{x:1,y:1},B=mt(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:b,rect:D,offsetParent:A,strategy:f}):D);return{top:(_.top-B.top+M.top)/V.y,bottom:(B.bottom-_.bottom+M.bottom)/V.y,left:(_.left-B.left+M.left)/V.x,right:(B.right-_.right+M.right)/V.x}})}var _i=50,Ti=(e,t,n)=>Ce(null,null,function*(){var o;let{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:c}=n,u=c.detectOverflow?c:Se(X({},c),{detectOverflow:Ei}),m=yield(o=c.isRTL)==null?void 0:o.call(c,t),h=yield c.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:p}=tn(h,i,m),b=i,f=0,y={};for(let S=0;S<a.length;S++){let C=a[S];if(!C)continue;let{name:E,fn:x}=C,{x:M,y:O,data:_,reset:D}=yield x({x:d,y:p,initialPlacement:i,placement:b,strategy:r,middlewareData:y,rects:h,platform:u,elements:{reference:e,floating:t}});d=M!=null?M:d,p=O!=null?O:p,y[E]=X(X({},y[E]),_),D&&f<_i&&(f++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(h=D.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:r}):D.rects),{x:d,y:p}=tn(h,b,m)),S=-1)}return{x:d,y:p,placement:b,strategy:r,middlewareData:y}});var Mi=(e={})=>({name:"flip",options:e,fn(t){return Ce(this,null,function*(){var n,o,i,r,a,c;let{placement:u,middlewareData:m,rects:h,initialPlacement:d,platform:p,elements:b}=t,f=dt(e,t),{mainAxis:y=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:M=!0}=f,O=cn(f,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=m.arrow)!=null&&n.alignmentOffset)return{};let _=we(u),D=he(d),A=we(d)===d,V=yield(o=p.isRTL)==null?void 0:o.call(p,b.floating),B=C||(A||!M?[ht(d)]:bi(d)),de=x!=="none";!C&&de&&B.push(...xi(d,M,x,V));let Ee=[d,...B],le=yield p.detectOverflow(t,O),H=[],re=((i=m.flip)==null?void 0:i.overflows)||[];if(y&&H.push(le[_]),S){let ie=yi(u,h,V);H.push(le[ie[0]],le[ie[1]])}if(re=[...re,{placement:u,overflows:H}],!H.every(ie=>ie<=0)){let ie=(((r=m.flip)==null?void 0:r.index)||0)+1,Ae=Ee[ie];if(Ae&&(!(S==="alignment"&&D!==he(Ae))||re.every(F=>he(F.placement)===D?F.overflows[0]>0:!0)))return{data:{index:ie,overflows:re},reset:{placement:Ae}};let fe=(a=re.filter(F=>F.overflows[0]<=0).sort((F,Y)=>F.overflows[1]-Y.overflows[1])[0])==null?void 0:a.placement;if(!fe)switch(E){case"bestFit":{let F=(c=re.filter(Y=>{if(de){let G=he(Y.placement);return G===D||G==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(G=>G>0).reduce((G,Ve)=>G+Ve,0)]).sort((Y,G)=>Y[1]-G[1])[0])==null?void 0:c[0];F&&(fe=F);break}case"initialPlacement":fe=d;break;default:}if(u!==fe)return{reset:{placement:fe}}}return{}})}});var Oi=new Set(["left","top"]);function Pi(e,t){return Ce(this,null,function*(){var n;let{placement:o,platform:i,elements:r}=e,a=yield(n=i.isRTL)==null?void 0:n.call(i,r.floating),c=we(o),u=ft(o),m=he(o)==="y",h=Oi.has(c)?-1:1,d=a&&m?-1:1,p=dt(t,e),{mainAxis:b,crossAxis:f,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof y=="number"&&(f=u==="end"?y*-1:y),m?{x:f*d,y:b*h}:{x:b*h,y:f*d}})}var Di=(e=0)=>({name:"offset",options:e,fn(t){return Ce(this,null,function*(){var n,o;let{x:i,y:r,placement:a,middlewareData:c}=t,u=yield Pi(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:r+u.y,data:Se(X({},u),{placement:a})}})}}),Li=(e={})=>({name:"shift",options:e,fn(t){return Ce(this,null,function*(){let{x:n,y:o,placement:i,platform:r}=t,a=dt(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:m={fn:({x:E,y:x})=>({x:E,y:x})}}=a,h=cn(a,["mainAxis","crossAxis","limiter"]),d={x:n,y:o},p=yield r.detectOverflow(t,h),b=he(we(i)),f=un(b),y=d[f],S=d[b];if(c){let E=f==="y"?"top":"left",x=f==="y"?"bottom":"right",M=y+p[E],O=y-p[x];y=Zo(M,y,O)}if(u){let E=b==="y"?"top":"left",x=b==="y"?"bottom":"right",M=S+p[E],O=S-p[x];S=Zo(M,S,O)}let C=m.fn(Se(X({},t),{[f]:y,[b]:S}));return Se(X({},C),{data:{x:C.x-n,y:C.y-o,enabled:{[f]:c,[b]:u}}})})}});function pt(){return typeof window!="undefined"}function Ie(e){return dn(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function oe(e){var t;return(t=(dn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dn(e){return pt()?e instanceof Node||e instanceof q(e).Node:!1}function J(e){return pt()?e instanceof Element||e instanceof q(e).Element:!1}function ae(e){return pt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function on(e){return!pt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}function Ue(e){let{overflow:t,overflowX:n,overflowY:o,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&i!=="inline"&&i!=="contents"}function $i(e){return/^(table|td|th)$/.test(Ie(e))}function gt(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Ii=/transform|translate|scale|rotate|perspective|filter/,Ri=/paint|layout|strict|content/,be=e=>!!e&&e!=="none",Yt;function Zt(e){let t=J(e)?Z(e):e;return be(t.transform)||be(t.translate)||be(t.scale)||be(t.rotate)||be(t.perspective)||!Qt()&&(be(t.backdropFilter)||be(t.filter))||Ii.test(t.willChange||"")||Ri.test(t.contain||"")}function zi(e){let t=me(e);for(;ae(t)&&!$e(t);){if(Zt(t))return t;if(gt(t))return null;t=me(t)}return null}function Qt(){return Yt==null&&(Yt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Yt}function $e(e){return/^(html|body|#document)$/.test(Ie(e))}function Z(e){return q(e).getComputedStyle(e)}function yt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function me(e){if(Ie(e)==="html")return e;let t=e.assignedSlot||e.parentNode||on(e)&&e.host||oe(e);return on(t)?t.host:t}function fn(e){let t=me(e);return $e(t)?e.ownerDocument?e.ownerDocument.body:e.body:ae(t)&&Ue(t)?t:fn(t)}function qe(e,t=[],n=!0){var o;let i=fn(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),a=q(i);if(r){let c=Jt(a);return t.concat(a,a.visualViewport||[],Ue(i)?i:[],c&&n?qe(c):[])}else return t.concat(i,qe(i,[],n))}function Jt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pn(e){let t=Z(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=ae(e),r=i?e.offsetWidth:n,a=i?e.offsetHeight:o,c=ut(n)!==r||ut(o)!==a;return c&&(n=r,o=a),{width:n,height:o,$:c}}function eo(e){return J(e)?e:e.contextElement}function Le(e){let t=eo(e);if(!ae(t))return te(1);let n=t.getBoundingClientRect(),{width:o,height:i,$:r}=pn(t),a=(r?ut(n.width):n.width)/o,c=(r?ut(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var Ai=te(0);function gn(e){let t=q(e);return!Qt()||!t.visualViewport?Ai:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vi(e,t=!1,n){return!n||t&&n!==q(e)?!1:t}function xe(e,t=!1,n=!1,o){let i=e.getBoundingClientRect(),r=eo(e),a=te(1);t&&(o?J(o)&&(a=Le(o)):a=Le(e));let c=Vi(r,n,o)?gn(r):te(0),u=(i.left+c.x)/a.x,m=(i.top+c.y)/a.y,h=i.width/a.x,d=i.height/a.y;if(r){let p=q(r),b=o&&J(o)?q(o):o,f=p,y=Jt(f);for(;y&&o&&b!==f;){let S=Le(y),C=y.getBoundingClientRect(),E=Z(y),x=C.left+(y.clientLeft+parseFloat(E.paddingLeft))*S.x,M=C.top+(y.clientTop+parseFloat(E.paddingTop))*S.y;u*=S.x,m*=S.y,h*=S.x,d*=S.y,u+=x,m+=M,f=q(y),y=Jt(f)}}return mt({width:h,height:d,x:u,y:m})}function bt(e,t){let n=yt(e).scrollLeft;return t?t.left+n:xe(oe(e)).left+n}function yn(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-bt(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Bi({elements:e,rect:t,offsetParent:n,strategy:o}){let i=o==="fixed",r=oe(n),a=e?gt(e.floating):!1;if(n===r||a&&i)return t;let c={scrollLeft:0,scrollTop:0},u=te(1),m=te(0),h=ae(n);if((h||!h&&!i)&&((Ie(n)!=="body"||Ue(r))&&(c=yt(n)),h)){let p=xe(n);u=Le(n),m.x=p.x+n.clientLeft,m.y=p.y+n.clientTop}let d=r&&!h&&!i?yn(r,c):te(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+m.x+d.x,y:t.y*u.y-c.scrollTop*u.y+m.y+d.y}}function Ni(e){return Array.from(e.getClientRects())}function Hi(e){let t=oe(e),n=yt(e),o=e.ownerDocument.body,i=ve(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=ve(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+bt(e),c=-n.scrollTop;return Z(o).direction==="rtl"&&(a+=ve(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:c}}var nn=25;function ji(e,t){let n=q(e),o=oe(e),i=n.visualViewport,r=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){r=i.width,a=i.height;let h=Qt();(!h||h&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let m=bt(o);if(m<=0){let h=o.ownerDocument,d=h.body,p=getComputedStyle(d),b=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,f=Math.abs(o.clientWidth-d.clientWidth-b);f<=nn&&(r-=f)}else m<=nn&&(r+=m);return{width:r,height:a,x:c,y:u}}function Fi(e,t){let n=xe(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=ae(e)?Le(e):te(1),a=e.clientWidth*r.x,c=e.clientHeight*r.y,u=i*r.x,m=o*r.y;return{width:a,height:c,x:u,y:m}}function rn(e,t,n){let o;if(t==="viewport")o=ji(e,n);else if(t==="document")o=Hi(oe(e));else if(J(t))o=Fi(t,n);else{let i=gn(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return mt(o)}function bn(e,t){let n=me(e);return n===t||!J(n)||$e(n)?!1:Z(n).position==="fixed"||bn(n,t)}function Wi(e,t){let n=t.get(e);if(n)return n;let o=qe(e,[],!1).filter(c=>J(c)&&Ie(c)!=="body"),i=null,r=Z(e).position==="fixed",a=r?me(e):e;for(;J(a)&&!$e(a);){let c=Z(a),u=Zt(a);!u&&c.position==="fixed"&&(i=null),(r?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Ue(a)&&!u&&bn(e,a))?o=o.filter(m=>m!==a):i=c,a=me(a)}return t.set(e,o),o}function qi({element:e,boundary:t,rootBoundary:n,strategy:o}){let i=[...t==="clippingAncestors"?gt(e)?[]:Wi(e,this._c):[].concat(t),n],r=rn(e,i[0],o),a=r.top,c=r.right,u=r.bottom,m=r.left;for(let h=1;h<i.length;h++){let d=rn(e,i[h],o);a=ve(d.top,a),c=ct(d.right,c),u=ct(d.bottom,u),m=ve(d.left,m)}return{width:c-m,height:u-a,x:m,y:a}}function Ui(e){let{width:t,height:n}=pn(e);return{width:t,height:n}}function Ki(e,t,n){let o=ae(t),i=oe(t),r=n==="fixed",a=xe(e,!0,r,t),c={scrollLeft:0,scrollTop:0},u=te(0);function m(){u.x=bt(i)}if(o||!o&&!r)if((Ie(t)!=="body"||Ue(i))&&(c=yt(t)),o){let b=xe(t,!0,r,t);u.x=b.x+t.clientLeft,u.y=b.y+t.clientTop}else i&&m();r&&!o&&i&&m();let h=i&&!o&&!r?yn(i,c):te(0),d=a.left+c.scrollLeft-u.x-h.x,p=a.top+c.scrollTop-u.y-h.y;return{x:d,y:p,width:a.width,height:a.height}}function Gt(e){return Z(e).position==="static"}function an(e,t){if(!ae(e)||Z(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return oe(e)===n&&(n=n.ownerDocument.body),n}function vn(e,t){let n=q(e);if(gt(e))return n;if(!ae(e)){let i=me(e);for(;i&&!$e(i);){if(J(i)&&!Gt(i))return i;i=me(i)}return n}let o=an(e,t);for(;o&&$i(o)&&Gt(o);)o=an(o,t);return o&&$e(o)&&Gt(o)&&!Zt(o)?n:o||zi(e)||n}var Yi=function(e){return Ce(this,null,function*(){let t=this.getOffsetParent||vn,n=this.getDimensions,o=yield n(e.floating);return{reference:Ki(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Gi(e){return Z(e).direction==="rtl"}var Xi={convertOffsetParentRelativeRectToViewportRelativeRect:Bi,getDocumentElement:oe,getClippingRect:qi,getOffsetParent:vn,getElementRects:Yi,getClientRects:Ni,getDimensions:Ui,getScale:Le,isElement:J,isRTL:Gi};function Sn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ji(e,t){let n=null,o,i=oe(e);function r(){clearTimeout(o),n==null||n.disconnect(),n=null}function a(c=!1,u=1){r();let m=e.getBoundingClientRect(),{left:h,top:d,width:p,height:b}=m;if(c||t(),!p||!b)return;let f=lt(d),y=lt(i.clientWidth-(h+p)),S=lt(i.clientHeight-(d+b)),C=lt(h),E={rootMargin:`${-f}px ${-y}px ${-S}px ${-C}px`,threshold:ve(0,ct(1,u))||1},x=!0;function M(O){let _=O[0].intersectionRatio;if(_!==u){if(!x)return a();_?a(!1,_):o=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!Sn(m,e.getBoundingClientRect())&&a(),x=!1}try{n=new IntersectionObserver(M,Se(X({},E),{root:i.ownerDocument}))}catch(O){n=new IntersectionObserver(M,E)}n.observe(e)}return a(!0),r}function wn(e,t,n,o={}){let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,m=eo(e),h=i||r?[...m?qe(m):[],...t?qe(t):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),r&&C.addEventListener("resize",n)});let d=m&&c?Ji(m,n):null,p=-1,b=null;a&&(b=new ResizeObserver(([C])=>{C&&C.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{b==null||b.observe(t)})),n()}),m&&!u&&b.observe(m),t&&b.observe(t));let f,y=u?xe(e):null;u&&S();function S(){let C=xe(e);y&&!Sn(y,C)&&n(),y=C,f=requestAnimationFrame(S)}return n(),()=>{h.forEach(C=>{i&&C.removeEventListener("scroll",n),r&&C.removeEventListener("resize",n)}),d==null||d(),b==null||b.disconnect(),b=null,u&&cancelAnimationFrame(f)}}var xn=Di;var Cn=Li,kn=Mi;var En=(e,t,n)=>{let o=new Map,i=X({platform:Xi},n),r=Se(X({},i.platform),{_c:o});return Ti(e,t,Se(X({},i),{platform:r}))};function Zi(e,t){var O;let{openState:n,placement:o,content:i,keepOpenOnContentHover:r}=t,a=null,c=null,u=null,m=null,h=!1,d=e.domElement,p=e.getRoot(),b={style:{position:"fixed",pointerEvents:"auto",visibility:_=>n.get(_)?"visible":"hidden"},onKeyDown:_=>{_.key==="Escape"&&x()},onMouseEnter:()=>r&&E(),onMouseLeave:()=>r&&x(),_onMount:_=>{var D;if(u=_.domElement,d&&u&&!u.hasAttribute("data-theme")){let A=(D=d.closest("[data-theme]"))==null?void 0:D.getAttribute("data-theme");A&&u.setAttribute("data-theme",A)}},_portal:_=>{let D=_.domElement.querySelector("#domphy-floating");if(!D){let A={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};D=_.children.insert(A).domElement}return D}},f=_=>I(_,b);f(i);let y=()=>{h||(h=!0,m=p.children.insert(i))},S=()=>{y(),d&&u&&(c==null||c(),c=wn(d,u,()=>{En(d,u,{placement:o.get(),middleware:[xn(12),kn(),Cn()],strategy:"fixed"}).then(({x:_,y:D,placement:A})=>{u&&(Object.assign(u.style,{left:`${_}px`,top:`${D}px`}),o.set(A))})}),n.set(!0))},C=()=>{c==null||c(),c=null,m&&(m.remove(),m=null),u=null,h=!1,n.set(!1)},E=()=>{a&&clearTimeout(a),a=setTimeout(S,100)},x=()=>{a&&clearTimeout(a),a=setTimeout(C,100)},M=_=>{if(!n.get()||!d||!u)return;let D=_.target;!d.contains(D)&&!u.contains(D)&&x()};return(O=p.domElement)==null||O.addEventListener("click",M),{show:E,hide:x,update(_){n=_.openState,o=_.placement,i=_.content,r=_.keepOpenOnContentHover,f(i),m&&m.patch(i)},destroy(){var _;a&&clearTimeout(a),c==null||c(),m==null||m.remove(),(_=p.domElement)==null||_.removeEventListener("click",M)}}}function ne(e){let{kind:t,open:n=!1,placement:o}=e,i=g(n),r=`floating:${t}`,a=m=>{var h;return(h=m==null?void 0:m.getBehavior(r))==null?void 0:h.show()},c=m=>{var h;return(h=m==null?void 0:m.getBehavior(r))==null?void 0:h.hide()},u=K({onKeyDown:(m,h)=>m.key==="Escape"&&c(h)},At(r,Zi,{openState:i,placement:o,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover}));return{show:a,hide:c,anchorPartial:u}}var Qi='<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 Ke(e={}){var o;let{removable:t=!1}=e,n=g((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let r={span:Qi,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",n.get(a))}}};t&&i.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:0,borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>w(i,"inherit"),backgroundColor:i=>l(i,"inherit",n.get(i)),color:i=>l(i,"shift-9",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-4",n.get(i))}`}}}function ea(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,a=g(e.value),c=g(i),{show:u,hide:m,anchorPartial:h}=ne({kind:"combobox",open:c,placement:g(n),content:e.content}),d={onClick:(S,C)=>!r&&m(C)};I(e.content,d);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:S=>w(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)},b;if(e.input){let S={onFocus:(C,E)=>u(E),style:p,_key:"combobox-input"};I(e.input,S),b=e.input}else b={input:null,onFocus:(S,C)=>u(C),value:S=>(a.get(S),""),style:p,_key:"combobox-input"};let f={div:S=>{let C=a.get(S),E=Array.isArray(C)?C:[C],M=t.filter(O=>E.includes(O.value)).map(O=>({span:O.label,$:[Ke({color:o,removable:!0})],_key:O.value,_onRemove:_=>{let D=a.get(),V=(Array.isArray(D)?D:[D]).filter(B=>B!==O.value);r?a.set(V):a.set(V[0])}}));return M.push(b),M},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},y={_onInsert:S=>{S.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(f),style:{minWidth:s(32),outlineOffset:"-1px",outline:S=>`1px solid ${l(S,"shift-4","neutral")}`,paddingBlock:S=>s(v(S)*1),paddingInline:S=>s(v(S)*1),borderRadius:S=>s(v(S)*1),fontSize:S=>w(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)}};return I(h,y),h}function ta(){return{_onSchedule:(e,t)=>{I(t,{_context:{command:{query:g("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function oa(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 i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,a=()=>i.query.set(r.value);r.addEventListener("input",a),o.addHook("Remove",()=>r.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>w(o,"inherit"),paddingInline:o=>s(v(o)*3),paddingBlock:o=>s(v(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-3",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",n)}}}}function na(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{role:"option",_onMount:o=>{var m,h;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,a=(h=(m=r.textContent)==null?void 0:m.toLowerCase())!=null?h:"",c=d=>{r.hidden=d.length>0&&!a.includes(d.toLowerCase())};c(i.query.get());let u=i.query.addListener(c);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>w(o,"inherit"),height:o=>s(6+v(o)*2),paddingInline:o=>s(v(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",n)}`,outlineOffset:`-${s(.5)}`}}}}var N=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),ke=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),to=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Ye=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),oo=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,no=(e,t)=>ke(e,-((e.getDay()-t+7)%7));function ra(e){var t,n;try{let o=new Intl.Locale(e),i=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function ia(e={}){var ao,lo,so,co;let{mode:t="single",time:n=!1,min:o,max:i,disabledDate:r,locale:a=typeof navigator!="undefined"?navigator.language:"en-US",format:c,onChange:u}=e,m=(ao=e.weekStartsOn)!=null?ao:ra(a),h=g((lo=e.accentColor)!=null?lo:"primary","accentColor"),d=g((so=e.placement)!=null?so:"bottom-start"),p=g((co=e.value)!=null?co:t==="range"?[null,null]:null),b=u?p.addListener(k=>u(k)):null,f=(()=>{let k=p.get(),T=t==="range"?k==null?void 0:k[0]:k;return T instanceof Date?T:new Date})(),y=g(f.getFullYear(),"viewYear"),S=g(f.getMonth(),"viewMonth"),C=g(N(f),"focused"),E=g(null,"hovered"),x=g(f.getHours(),"hour"),M=g(f.getMinutes(),"minute"),O=null,_=new Intl.DateTimeFormat(a,K({dateStyle:"medium"},n?{timeStyle:"short"}:{})),D=new Intl.DateTimeFormat(a,{month:"long",year:"numeric"}),A=new Intl.DateTimeFormat(a,{weekday:"short"}),V=new Intl.DateTimeFormat(a,{dateStyle:"full"}),B=k=>k?_.format(k):"",de=k=>{if(c)return c(k);if(t==="range"){let[T,P]=k!=null?k:[null,null];return T?`${B(T)} \u2013 ${B(P)}`:""}return B(k)},Ee=Array.from({length:7},(k,T)=>A.format(new Date(2023,0,1+(T+m)%7))),le=k=>!!o&&N(k)<N(o)||!!i&&N(k)>N(i)||!!r&&r(k),H=k=>{if(!n)return N(k);let T=N(k);return T.setHours(x.get(),M.get(),0,0),T},re=k=>{var L;if(le(k))return;if(t==="single"){p.set(H(k)),n||xt();return}let[T,P]=(L=p.get())!=null?L:[null,null];!T||T&&P?p.set([H(k),null]):N(k)<N(T)?(p.set([H(k),H(T)]),n||xt()):(p.set([T,H(k)]),n||xt())},ie=()=>{var k;if(n)if(t==="single"){let T=p.get();T&&p.set(H(T))}else{let[T,P]=(k=p.get())!=null?k:[null,null];p.set([T&&H(T),P&&H(P)])}},Ae=(k,T)=>{var _e;if(t!=="range")return!1;let[P,L]=(_e=p.get(T))!=null?_e:[null,null],R=L!=null?L:E.get(T);if(!P||!R)return!1;let $=N(P)<=N(R)?P:R,U=N(P)<=N(R)?R:P,W=N(k);return W>=N($)&&W<=N(U)},fe=(k,T)=>{let P=p.get(T);if(t==="range"){let[L,R]=P!=null?P:[null,null];return Ye(k,L)||Ye(k,R)}return Ye(k,P)},F=k=>{y.set(k.getFullYear()),S.set(k.getMonth())},Y=k=>{let T=to(new Date(y.get(),S.get(),1),k);F(T)},G=k=>y.set(y.get()+k),Ve=()=>{setTimeout(()=>{var k;(k=O==null?void 0:O.querySelector(`[data-date="${oo(C.get())}"]`))==null||k.focus()},0)},In=Bn(),{show:Rn,hide:zn,anchorPartial:wt}=ne({kind:"datePicker",open:!1,placement:d,content:In});function xt(){zn()}wt.onClick=()=>{};let An={type:"text",readonly:!0,value:k=>de(p.get(k)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(k,T)=>{Ct(T)},onFocus:(k,T)=>{Ct(T)},onKeyDown:(k,T)=>{let P=k.key;(P==="ArrowDown"||P==="Enter")&&(k.preventDefault(),Ct(T))},_onMount:k=>b&&k.addHook("Remove",()=>{b()})};function Ct(k){var P;let T=(P=Vn())!=null?P:new Date;C.set(N(T)),F(T),Rn(k),Ve()}function Vn(){var T;let k=p.get();return t==="range"?(T=k==null?void 0:k[0])!=null?T:null:k!=null?k:null}return I(wt,An),wt;function Bn(){let k=($,U,W)=>({button:$,type:"button",ariaLabel:U,onClick:W,style:aa()}),T={div:[k("\xAB","Previous year",()=>G(-1)),k("\u2039","Previous month",()=>Y(-1)),{div:$=>D.format(new Date(y.get($),S.get($),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:$=>w($)}},k("\u203A","Next month",()=>Y(1)),k("\xBB","Next year",()=>G(1))],style:{display:"flex",alignItems:"center",gap:s(1),marginBottom:s(2)}},P={div:Ee.map(($,U)=>({div:$,style:{textAlign:"center",fontSize:W=>w(W,"decrease-1"),fontWeight:"600",color:W=>l(W,"shift-7"),paddingBlock:s(1)},_key:U})),role:"row",style:_n()},L={div:$=>Nn($),role:"grid",ariaLabel:"Calendar",onKeyDown:Wn,onMouseLeave:()=>t==="range"&&E.set(null),style:{display:"flex",flexDirection:"column",gap:s(.5)}},R=[T,P,L];return n&&R.push(jn()),R.push(Fn()),{div:R,role:"dialog",ariaModal:"false",_onMount:$=>{O=$.domElement},style:{minWidth:s(70),padding:s(3),borderRadius:s(2),backgroundColor:$=>l($,"base"),color:$=>l($,"shift-10"),border:$=>`1px solid ${l($,"shift-4")}`,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"}}}function Nn(k){let T=new Date(y.get(k),S.get(k),1),P=S.get(k),L=no(T,m),R=[];for(let $=0;$<6;$++){let U=[];for(let W=0;W<7;W++){let _e=ke(L,$*7+W);U.push(Hn(_e,P,k))}R.push({div:U,role:"row",style:_n(),_key:$})}return R}function Hn(k,T,P){let L=le(k),R=fe(k,P),$=Ae(k,P),U=k.getMonth()!==T,W=Ye(k,C.get(P)),_e=Ye(k,new Date);return{button:String(k.getDate()),type:"button",role:"gridcell",tabIndex:W?0:-1,ariaSelected:R,ariaDisabled:L,disabled:L,ariaLabel:V.format(k),dataDate:oo(k),onClick:()=>re(k),onMouseEnter:()=>t==="range"&&E.set(k),style:{appearance:"none",border:"none",cursor:L?"not-allowed":"pointer",aspectRatio:"1",borderRadius:s(1),fontSize:z=>w(z),fontFamily:"inherit",opacity:L?.35:U?.5:1,backgroundColor:z=>R?l(z,"shift-7",h.get(z)):$?l(z,"shift-2",h.get(z)):"transparent",color:z=>R?l(z,"shift-0",h.get(z)):l(z,"shift-9"),outline:_e?z=>`1px solid ${l(z,"shift-6",h.get(z))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:z=>R?l(z,"shift-7",h.get(z)):l(z,"shift-3",h.get(z))},"&:focus-visible":{outline:z=>`2px solid ${l(z,"shift-6",h.get(z))}`}},_key:oo(k)}}function jn(){let k=(T,P,L)=>({select:Array.from({length:T},(R,$)=>({option:String($).padStart(2,"0"),value:String($),selected:U=>P.get(U)===$,_key:$})),ariaLabel:L,onChange:R=>{P.set(Number(R.target.value)),ie()},style:la()});return{div:[k(24,x,"Hour"),{span:":",style:{fontWeight:"600"}},k(60,M,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:s(1),marginTop:s(3)}}}function Fn(){let k=(T,P)=>({button:T,type:"button",onClick:P,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:L=>w(L,"decrease-1"),color:L=>l(L,"shift-8",h.get(L)),padding:s(1)}});return{div:[k("Today",()=>{let T=new Date;C.set(N(T)),F(T),Ve()}),k("Clear",()=>{p.set(t==="range"?[null,null]:null),E.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:s(2),paddingTop:s(2),borderTop:T=>`1px solid ${l(T,"shift-3")}`}}}function Wn(k){let T=k,P=C.get(),L=null;switch(T.key){case"ArrowLeft":L=ke(P,-1);break;case"ArrowRight":L=ke(P,1);break;case"ArrowUp":L=ke(P,-7);break;case"ArrowDown":L=ke(P,7);break;case"Home":L=no(P,m);break;case"End":L=ke(no(P,m),6);break;case"PageUp":L=to(P,T.shiftKey?-12:-1);break;case"PageDown":L=to(P,T.shiftKey?12:1);break;case"Enter":case" ":T.preventDefault(),re(P);return;default:return}T.preventDefault(),C.set(L),F(L),Ve()}}function _n(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:s(.5)}}function aa(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>w(e),color:e=>l(e,"shift-8"),width:s(7),height:s(7),borderRadius:s(1),"&:hover":{backgroundColor:e=>l(e,"shift-3")}}}function la(){return{fontFamily:"inherit",fontSize:e=>w(e),padding:s(1),borderRadius:s(1),border:e=>`1px solid ${l(e,"shift-4")}`,backgroundColor:e=>l(e,"base"),color:e=>l(e,"shift-9")}}function sa(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>w(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function ca(e={}){var i,r;let{duration:t=240}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=g((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:a=>{a.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>w(a,"inherit"),color:a=>l(a,"shift-9",n.get(a)),backgroundColor:a=>l(a,"inherit",n.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",n.get(a)),color:a=>l(a,"shift-10",n.get(a)),fontSize:a=>w(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(v(a)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:a=>`${s(.5)} solid ${l(a,"shift-9",n.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",n.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",n.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(v(a)*2),outlineOffset:`-${s(.5)}`,outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:a=>s(v(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:a=>s(v(a)*1),paddingBottom:a=>s(v(a)*3)}}}}var Ge=0;function vt(){Ge++,Ge===1&&(document.body.style.overflow="hidden")}function Re(){Ge=Math.max(0,Ge-1),Ge===0&&(document.body.style.overflow="")}var Tn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function ua(e={}){let{color:t="neutral",open:n=!1}=e,o=g(n),i=null,r=!1,a=!1,c=u=>{r=!1,u.close(),a&&(Re(),a=!1),i==null||i.focus(),i=null};return{_onInsert:u=>{u.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(u,m)=>{if(u.target!==m.domElement)return;let h=m.domElement.getBoundingClientRect();u.clientX>=h.left&&u.clientX<=h.right&&u.clientY>=h.top&&u.clientY<=h.bottom||o.set(!1)},onTransitionEnd:(u,m)=>{r&&u.target===m.domElement&&u.propertyName==="opacity"&&c(m.domElement)},_onMount:u=>{let m=u.domElement;m.setAttribute("aria-modal","true");let h=null,d=y=>{if(y.key!=="Tab")return;let S=Array.from(m.querySelectorAll(Tn)).filter(x=>!x.closest("[aria-hidden='true']")&&x.offsetParent!==null);if(!S.length){y.preventDefault();return}let C=S[0],E=S[S.length-1];y.shiftKey?(document.activeElement===C||document.activeElement===m)&&(y.preventDefault(),E.focus()):document.activeElement===E&&(y.preventDefault(),C.focus())},p=y=>{y.preventDefault(),o.set(!1)};m.addEventListener("cancel",p);let b=y=>{y?(i=document.activeElement,m.showModal(),a||(vt(),a=!0),m.addEventListener("keydown",d),requestAnimationFrame(()=>{m.style.opacity="1";let S=m.querySelector(Tn);S==null||S.focus()})):(r=!0,m.style.opacity="0",m.removeEventListener("keydown",d),h=setTimeout(()=>{h=null,r&&c(m)},350))};b(o.get());let f=o.addListener(b);u.addHook("Remove",()=>{h&&(clearTimeout(h),h=null),f(),m.removeEventListener("cancel",p),a&&(Re(),a=!1),m.removeEventListener("keydown",d),i==null||i.focus(),i=null})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:u=>w(u,"inherit"),color:u=>l(u,"shift-10",t),backgroundColor:u=>l(u,"inherit",t),border:"none",padding:u=>s(v(u)*3),boxShadow:u=>`0 ${s(9)} ${s(16)} ${l(u,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:u=>l(u,"shift-2","neutral"),opacity:.75}}}}function ha(e={}){var n;let t=g((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:s(2),fontSize:o=>w(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var ro={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Mn={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},Xe=e=>e==="left"||e==="right";function On(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function ma(e={}){let{color:t="neutral",open:n=!1,placement:o="end",size:i}=e,r=g(n),a=o==="start"||o==="end",c=On(o,!1),u=Xe(c)?s(80):s(64),m=i!=null?i:u;return{_onInsert:h=>{h.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(h,d)=>{h.target===d.domElement&&r.set(!1)},_onMount:h=>{let d=h.domElement;d.setAttribute("aria-modal","true");let p=_=>{_.preventDefault(),r.set(!1)};d.addEventListener("cancel",p);let b=a&&(d.ownerDocument.documentElement.dir==="rtl"||d.ownerDocument.dir==="rtl"),f=On(o,b);a&&(d.style.transform=ro[f],d.style.margin=Mn[f],d.style.width=Xe(f)?m:"100dvw",d.style.height=Xe(f)?"100dvh":m);let y=!1,S=!1,C=null,E=()=>{C=null,y&&(y=!1,d.close(),S&&(Re(),S=!1))},x=_=>{_.target===d&&_.propertyName==="transform"&&E()};d.addEventListener("transitionend",x);let M=_=>{_?(y=!1,d.showModal(),S||(vt(),S=!0),requestAnimationFrame(()=>{d.style.transform="translate(0, 0)"})):(y=!0,d.style.transform=ro[f],C=setTimeout(E,350))};M(r.get());let O=r.addListener(M);h.addHook("Remove",()=>{C&&(clearTimeout(C),C=null),O(),d.removeEventListener("cancel",p),d.removeEventListener("transitionend",x),S&&(Re(),S=!1)})},style:{transform:ro[c],transition:"transform 0.25s ease",fontSize:h=>w(h,"inherit"),color:h=>l(h,"shift-10",t),backgroundColor:h=>l(h,"inherit",t),border:"none",padding:h=>s(v(h)*3),margin:Mn[c],width:Xe(c)?m:"100dvw",height:Xe(c)?"100dvh":m,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:h=>`0 ${s(4)} ${s(12)} ${l(h,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:h=>l(h,"shift-2","neutral"),opacity:.75}}}}function da(e={}){var n;let t=g((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=>w(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function fa(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:s(3),paddingBlock:s(12),paddingInline:s(6),textAlign:"center",color:o=>l(o,"shift-6",t.get(o)),"& > :first-child":{color:o=>l(o,"shift-5",t.get(o))}}}}function pa(e={}){return{_onError:(t,n,o)=>{var r,a;(r=e.onError)==null||r.call(e,n);let i=typeof e.fallback=="function"?e.fallback(n,o):(a=e.fallback)!=null?a:{div:"An error occurred."};t.children.update([i])}}}var ga={small:8,medium:10,large:14};function ya(e={}){var o,i;let t=g((o=e.color)!=null?o:"primary","color"),n=s(ga[(i=e.size)!=null?i:"medium"]);return{_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>w(r,"inherit"),backgroundColor:r=>l(r,"shift-9",t.get(r)),color:r=>l(r,"shift-0",t.get(r)),boxShadow:r=>`0 ${s(1)} ${s(4)} ${l(r,"shift-4","neutral")}`,transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>l(r,"shift-10",t.get(r)),boxShadow:r=>`0 ${s(2)} ${s(6)} ${l(r,"shift-5","neutral")}`},"&:focus-visible":{outline:r=>`2px solid ${l(r,"shift-6",t.get(r))}`,outlineOffset:"2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function ba(e={}){var n;let t=g((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:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>l(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>w(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function va(e={}){var i;let{layout:t="horizontal"}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>s(v(r)*3),paddingBlock:r=>s(v(r)*3),border:"none",borderRadius:r=>s(v(r)*2),fontSize:r=>w(r,"inherit"),backgroundColor:r=>l(r,"inherit",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>w(r,"inherit"),fontWeight:600,paddingBlock:r=>s(v(r)*1),borderRadius:r=>s(v(r)*2),color:r=>l(r,"shift-9",n.get(r)),backgroundColor:r=>l(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?0:s(v(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(${s(2)} * -1)`,fontSize:r=>w(r,"decrease-1"),color:r=>l(r,"shift-9",n.get(r))}}}}var Sa={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function wa(e={}){var n;let t=g((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=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=Sa[o.elementNode.tagName]||"inherit";return w(o,i)}}}}function xa(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function Ca(e={}){var n;let t=g((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:s(4),height:s(4),flexShrink:"0",fontSize:o=>w(o),backgroundColor:"transparent",color:o=>l(o,"shift-9",t.get(o))}}}function ka(e={}){var n;let t=g((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:s(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function Ea(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>w(r,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"shift-4",t.get(r))}`,color:r=>l(r,"shift-9",t.get(r)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:r=>l(r,"shift-2",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${l(r,"shift-6",n.get(r))}`,backgroundColor:r=>l(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>l(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${s(.5)} solid ${l(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${l(r,"shift-6",n.get(r))}`,backgroundColor:r=>l(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>l(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>l(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:s(1.5),outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>l(r,"shift-4","neutral"),pointerEvents:"none"}}}}function _a(e={}){return{type:"color",_onSchedule:(t,n)=>{t.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),n.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:t=>w(t,"inherit"),paddingBlock:t=>s(v(t)*1),paddingInline:t=>s(v(t)*1),blockSize:t=>s(6+v(t)*2),inlineSize:t=>s(6+v(t)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:t=>s(v(t)*1)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>l(t,"shift-2","neutral"),outline:t=>`1px solid ${l(t,"shift-4","neutral")}`}}}}function Ta(e={}){var i,r;let{mode:t="datetime-local"}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=g((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onSchedule:(a,c)=>{a.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:a=>w(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",n.get(a)),backgroundColor:a=>l(a,"inherit",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",n.get(a))}`,borderRadius:a=>s(v(a)*1),paddingInline:a=>s(v(a)*3),height:a=>s(6+v(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-6","error")}`}}}}function Ma(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:r=>w(r,"inherit"),lineHeight:"inherit",color:r=>l(r,"shift-9",t.get(r)),backgroundColor:r=>l(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"shift-4",t.get(r))}`,borderRadius:r=>s(v(r)*1),height:r=>s(6+v(r)*2),paddingInline:r=>s(v(r)*1),"&::-webkit-file-upload-button":{marginTop:r=>s(v(r)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:r=>l(r,"shift-11",t.get(r)),backgroundColor:r=>l(r,"shift-1",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>l(r,"shift-8","neutral"),outline:r=>`1px solid ${l(r,"shift-4","neutral")}`,backgroundColor:r=>l(r,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>l(r,"shift-8","neutral"),backgroundColor:r=>l(r,"shift-3","neutral")}}}}function Oa(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:r=>s(v(r)*3),paddingInlineEnd:r=>s(v(r)*1.5),paddingBlock:r=>s(v(r)*1),borderRadius:r=>s(v(r)*1),fontSize:r=>w(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"shift-4",t.get(r))}`,color:r=>l(r,"shift-9",t.get(r)),backgroundColor:r=>l(r,"inherit",t.get(r)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>l(r,"shift-2","neutral"),outline:r=>`1px solid ${l(r,"shift-4","neutral")}`,color:r=>l(r,"shift-8","neutral")}}}}var Pa='<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>',Da='<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 La(e={}){var i,r;let t=g((i=e.color)!=null?i:"neutral","color"),n=g((r=e.accentColor)!=null?r:"primary","accentColor"),o=g(!1);return{_onInsert:a=>{a.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onInit:a=>{let c={input:null,type:m=>o.get(m)?"text":"password",style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}},u={button:m=>o.get(m)?Da:Pa,type:"button",ariaLabel:m=>o.get(m)?"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}};a.children.insert(c),a.children.insert(u)},style:{display:"flex",alignItems:"center",gap:a=>s(v(a)*1),paddingBlock:a=>s(v(a)*1),paddingInline:a=>s(v(a)*3),borderRadius:a=>s(v(a)*1),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",t.get(a))}`,color:a=>l(a,"shift-9",t.get(a)),backgroundColor:a=>l(a,"inherit",t.get(a)),fontSize:a=>w(a,"inherit"),"&:focus-within":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",n.get(a))}`}}}}function $a(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:`${s(9)}!important`}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=n(),u=a.target,m=c.indexOf(u);u.value&&m<c.length-1&&c[m+1].focus()},i=a=>{let c=n(),u=a.target,m=c.indexOf(u);a.key==="Backspace"&&!u.value&&m>0&&c[m-1].focus(),a.key==="ArrowLeft"&&m>0&&c[m-1].focus(),a.key==="ArrowRight"&&m<c.length-1&&c[m+1].focus()},r=a=>{var p,b,f;a.preventDefault();let c=(b=(p=a.clipboardData)==null?void 0:p.getData("text"))!=null?b:"",u=n(),m=u.indexOf(a.target),h=m===-1?0:m;[...c].forEach((y,S)=>{u[h+S]&&(u[h+S].value=y)});let d=Math.min(h+c.length-1,u.length-1);(f=u[d])==null||f.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",r)})}}}function Ia(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"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=>w(r,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(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 ${l(r,"shift-4",t.get(r))}`,color:r=>l(r,"shift-9",t.get(r)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:r=>l(r,"shift-2",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${l(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>l(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>l(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>l(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Ra(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"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:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:r=>l(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:r=>l(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>l(r,"shift-10",n.get(r))},"&:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function za(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:r=>w(r,"inherit"),lineHeight:"inherit",color:r=>l(r,"shift-9",t.get(r)),backgroundColor:r=>l(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"shift-4",t.get(r))}`,borderRadius:r=>s(v(r)*1),minWidth:s(32),paddingInline:r=>s(v(r)*3),paddingBlock:r=>s(v(r)*1),"&::placeholder":{color:r=>l(r,"shift-7",t.get(r))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>l(r,"shift-8","neutral"),backgroundColor:r=>l(r,"shift-2","neutral"),outline:r=>`1px solid ${l(r,"shift-4","neutral")}`}}}}function Aa(e={}){var n;let t=g((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=>w(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>w(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Va(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:r=>s(v(r)*3),paddingBlock:r=>s(v(r)*1),borderRadius:r=>s(v(r)*1),fontSize:r=>w(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"shift-4",t.get(r))}`,color:r=>l(r,"shift-9",t.get(r)),backgroundColor:r=>l(r,"inherit",t.get(r)),"&::placeholder":{color:r=>l(r,"shift-7")},"&:not(:placeholder-shown)":{color:r=>l(r,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>l(r,"shift-2","neutral"),outline:r=>`1px solid ${l(r,"shift-4","neutral")}`,color:r=>l(r,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:r=>`${s(.5)} solid ${l(r,"shift-6","error")}`},"&[data-status=error]":{outline:r=>`${s(.5)} solid ${l(r,"shift-6","error")}`},"&[data-status=warning]":{outline:r=>`${s(.5)} solid ${l(r,"shift-6","warning")}`}}}}function Ba(e={}){var n;let t=g((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=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`}}}function Na(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:r=>w(r,"inherit"),color:r=>l(r,"shift-9",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>l(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>l(r,"shift-8","neutral")}}}}function Ha(e={}){var o,i;let t=g((o=e.color)!=null?o:"primary","color"),n=g((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:r=>w(r,"inherit"),backgroundColor:r=>l(r),color:r=>l(r,"shift-9",t.get(r)),textDecoration:"none","&:visited":{color:r=>l(r,"shift-9",n.get(r))},"&:hover:not([disabled])":{color:r=>l(r,"shift-10",t.get(r)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:r=>`${s(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>l(r,"shift-8","neutral")}}}}function ja(e={}){var n;let t=g((n=e.color)!=null?n:"primary","color");return{_onInsert:o=>{o.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:o=>w(o,"inherit"),textDecoration:"none",paddingBlock:o=>s(v(o)*1),paddingInline:o=>s(v(o)*3),borderRadius:o=>s(v(o)*1),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>s(v(o)*1),userSelect:"none",cursor:"pointer",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")}}}}function Fa(e={}){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Wa(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>s(v(n)*2),paddingBlock:n=>s(t?1:v(n)*2),paddingInline:n=>s(v(n)*3),fontSize:n=>w(n,"inherit")}}}function qa(e={}){var i,r;let t=g((i=e.color)!=null?i:"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:a=>s(v(a)*2),paddingBlock:a=>s(o?1:v(a)*2),paddingInline:a=>s(v(a)*3),fontSize:a=>w(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),borderRadius:a=>s(v(a)*1),transition:"background-color 150ms ease","&:hover:not([disabled])":{backgroundColor:a=>l(a,"shift-2",t.get(a))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:a=>l(a,"shift-3",n),color:a=>l(a,"shift-12",n)},"&:focus-visible":{outline:a=>`2px solid ${l(a,"shift-6",n)}`,outlineOffset:"-2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Ua(e={}){var n;let t=g((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=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function Ka(e={items:[]}){var a;let{items:t=[],selectable:n=!0,color:o="neutral",accentColor:i="primary"}=e,r=g((a=e.activeKey)!=null?a:null);return{role:"menu",dataTone:"shift-17",_onSchedule:(c,u)=>{if(t.length===0)return;let m=c.nodeId,h=t.map((d,p)=>{var f;let b=(f=d.key)!=null?f:p;return Te(K({button:typeof d.label=="string"?[{span:d.label}]:[d.label],_key:b,type:"button",id:`menuitem${m}${b}`,role:"menuitem"},n?{ariaCurrent:y=>r.get(y)===b||void 0}:{}),{onClick:()=>{var y;n&&r.set(b),(y=d.onClick)==null||y.call(d)},onKeyDown:y=>{var M;let S=y.key;if(S==="Enter"||S===" "){y.preventDefault(),y.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(S))return;y.preventDefault();let C=t.map((O,_)=>{var D;return(D=O.key)!=null?D:_}),E=C.indexOf(b),x=E;S==="ArrowDown"?x=(E+1)%C.length:S==="ArrowUp"?x=(E-1+C.length)%C.length:S==="Home"?x=0:S==="End"&&(x=C.length-1),(M=document.getElementById(`menuitem${m}${C[x]}`))==null||M.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:s(2),width:"100%",fontSize:y=>w(y,"inherit"),height:y=>s(6+v(y)*2),paddingInline:y=>s(v(y)*3),border:"none",outline:"none",color:y=>l(y,"shift-9",o),backgroundColor:y=>l(y,"inherit",o),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:y=>l(y,"shift-2",o)},"&[aria-current=true]":{backgroundColor:y=>l(y,"shift-3",i),color:y=>l(y,"shift-10")},"&:focus-visible":{outline:y=>`${s(.5)} solid ${l(y,"shift-6",i)}`,outlineOffset:`-${s(.5)}`}}})});u[c.tagName]=h},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(v(c)*2),paddingInline:c=>s(v(c)*2),fontSize:c=>w(c,"inherit"),backgroundColor:c=>l(c,"inherit",o)}}}var Pn=e=>!!e&&typeof e.get=="function"&&e._isState===!0,ze=e=>{let t={},n=[];for(let o in e){let i=e[o];o==="x"?n.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?n.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?n.push(`scale(${i})`):o==="rotate"?n.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return n.length&&(t.transform=n.join(" ")),t};function Ya(e={}){var a,c,u,m;let{initial:t,animate:n,exit:o,transition:i={}}=e,r={duration:(a=i.duration)!=null?a:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(m=i.iterations)!=null?m:1,fill:"both"};return{_onMount:h=>{let d=h.domElement;if(!d||typeof d.animate!="function")return;let p=Pn(n)?n.get():n;if(p?d.animate(t?[ze(t),ze(p)]:[ze(p)],r):t&&Object.assign(d.style,ze(t)),Pn(n)){let b=n.addListener(f=>{d.animate([ze(f)],r)});h.setMetadata("motionRelease",b)}},_onBeforeRemove:(h,d)=>{let p=h.domElement;if(!p||!o||typeof p.animate!="function")return d();p.animate([ze(o)],r).finished.then(d,d)},_onRemove:h=>{let d=h.getMetadata("motionRelease");d==null||d()}}}function Ga(e={}){var n;let t=g((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=>w(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Xa(e,t){if(t<=7)return Array.from({length:t},(r,a)=>a+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let r=o;r<=i;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function Ja(e){var c;let{total:t,color:n="neutral",accentColor:o="primary"}=e,i=g((c=e.value)!=null?c:1),r={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>s(6+v(u)*2),height:u=>s(6+v(u)*2),paddingInline:u=>s(v(u)*2),borderRadius:u=>s(v(u)*1),border:"none",cursor:"pointer",fontSize:u=>w(u,"inherit"),backgroundColor:"transparent",color:u=>l(u,"shift-9",n),"&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-2",n)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=Te(K({},r),{backgroundColor:u=>l(u,"shift-6",o),color:u=>l(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-6",o)}});return{role:"navigation",ariaLabel:"Pagination",_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let m={div:h=>{let d=i.get(h),p=[];p.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:r});let b=0;for(let f of Xa(d,t))if(f==="...")p.push({span:"\u2026",_key:`ellipsis-${b++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:y=>s(v(y)*2),color:y=>l(y,"shift-7",n)}});else{let y=f===d;p.push({button:String(f),_key:`page-${f}`,type:"button",ariaLabel:`Page ${f}`,ariaCurrent:y?"page":void 0,disabled:y,onClick:()=>i.set(f),style:y?a:r})}return p.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:r}),p},style:{display:"flex",alignItems:"center",gap:s(1)}};u.children.insert(m)},style:{display:"inline-flex"}}}function Za(e={}){var n;let t=g((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=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Qa(e){var p;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,i=null,r=g(t),a=g(n),{show:c,hide:u,anchorPartial:m}=ne({kind:"popover",open:r,placement:a,content:e.content,keepOpenOnContentHover:o==="hover"}),h={role:"dialog",dataTone:"shift-14",style:{backgroundColor:b=>l(b,"inherit")},_onInsert:b=>{let f=b.attributes.get("id");i=f||b.nodeId,!f&&b.attributes.set("id",i)}};return(p=e.content).$||(p.$=[]),e.content.$.push(h),I(m,{ariaHaspopup:"dialog",ariaExpanded:b=>r.get(b),onMouseEnter:(b,f)=>o==="hover"&&c(f),onMouseLeave:(b,f)=>o==="hover"&&u(f),onClick:(b,f)=>{o==="click"&&(r.get()?u(f):c(f))},onKeyDown:(b,f)=>{b.key==="Escape"&&r.get()&&u(f)},onFocus:(b,f)=>o==="hover"&&c(f),onBlur:(b,f)=>{let y=b.relatedTarget,S=f.getRoot().domElement,C=i?S.querySelector(`#${CSS.escape(i)}`):null;y&&(C!=null&&C.contains(y))||u(f)},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),m}function io(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=s(6),bordered:i=!0}=e,r=g(t),a={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"},c=h=>{var d;return(d=a[r.get(h)])!=null?d:a["bottom-end"]},u=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",m=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>w(h),backgroundColor:h=>l(h),color:h=>l(h,"shift-9",n),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:h=>l(h,"inherit",n),borderWidth:i?"1px":0,borderColor:h=>l(h,"inherit",n),borderTopStyle:h=>{let d=c(h);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:h=>{let d=c(h);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:h=>{let d=c(h);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:h=>{let d=c(h);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:h=>{let d=c(h);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:h=>{let d=c(h);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:h=>{let d=c(h),p=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${p},${b}) rotate(45deg)`}}}}}function el(e={}){var n;let t=g((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=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(v(o)*2),paddingInline:o=>s(v(o)*3),borderRadius:o=>s(v(o)*2)}}}function tl(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:r=>l(r,"shift-3",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>l(r,"shift-3",t.get(r)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:r=>l(r,"shift-9",n.get(r)),borderRadius:s(999),transition:"width 220ms ease"}}}}var ol='<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>',nl='<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 rl(e={}){var u,m;let{max:t=5,readOnly:n=!1,onChange:o}=e,i=(u=e.color)!=null?u:"warning",r=g((m=e.value)!=null?m:0),a=g(0),c=h=>{let d=a.get(h);return d>0?d:r.get(h)};return{role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:s(.5),fontSize:"1.5rem",cursor:n?"default":"pointer",color:h=>l(h,"shift-8",i)},_onInit:h=>{for(let d=1;d<=t;d++){let p=d,b=n?{}:{onClick:()=>{let y=p===r.get()?0:p;r.set(y),o==null||o(y),a.set(0)},onMouseEnter:()=>a.set(p),onMouseLeave:()=>a.set(0),onKeyDown:y=>{var x,M;let S=r.get(),C=S;if(y.key==="ArrowRight"||y.key==="ArrowUp")C=Math.min(t,S+1),y.preventDefault();else if(y.key==="ArrowLeft"||y.key==="ArrowDown")C=Math.max(0,S-1),y.preventDefault();else return;r.set(C),o==null||o(C);let E=C>0?C-1:0;(M=(x=h.domElement)==null?void 0:x.children[E])==null||M.focus()}},f=Te(K({button:y=>p<=c(y)?ol:nl,_key:p,type:"button",ariaLabel:`${p} star${p>1?"s":""}`},b),{style:{background:"none",border:"none",padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center"}});h.children.insert(f)}}}}function il(e={}){var u,m,h;let{size:t=16,thickness:n=.25}=e,o=g((u=e.value)!=null?u:0,"value"),i=g((m=e.color)!=null?m:"primary","color"),r=g((h=e.trackColor)!=null?h:"neutral","trackColor"),a=Math.round((1-n)*100),c=`radial-gradient(circle closest-side, transparent ${a}%, black ${a}%)`;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:s(t),height:s(t),borderRadius:"50%",background:d=>`conic-gradient(from -90deg, ${l(d,"shift-9",i.get(d))} ${o.get(d)}%, ${l(d,"shift-3",r.get(d))} 0%)`,WebkitMask:c,mask:c}}}function al(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{style:{overflow:"auto","&::-webkit-scrollbar":{width:s(2),height:s(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>l(o,"shift-5",t.get(o)),borderRadius:s(999),border:`${s(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>l(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${l(o,"shift-5",t.get(o))} transparent`}}}function ll(e={items:[]}){var r,a,c;let{items:t=[],color:n="neutral",accentColor:o="primary"}=e,i=g((c=(a=e.value)!=null?a:(r=t[0])==null?void 0:r.key)!=null?c:"");return{role:"radiogroup",_context:{segmented:{value:i}},_onSchedule:(u,m)=>{let h=t.map((d,p)=>{var y;let b=(y=d.key)!=null?y:String(p);return{button:[typeof d.label=="string"?{span:d.label}:d.label],_key:b,type:"button",role:"radio",ariaChecked:S=>i.get(S)===b,onClick:()=>i.set(b),style:{cursor:"pointer",fontSize:S=>w(S,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(3),border:"none",borderRadius:s(10),color:S=>l(S,"shift-9",n),backgroundColor:"transparent",transition:"background-color 300ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:S=>l(S,"shift-3",n)},"&[aria-checked=true]":{backgroundColor:S=>l(S,"shift-0",o),color:S=>l(S,"shift-10",o)},"&:focus-visible":{outline:S=>`${s(.5)} solid ${l(S,"shift-6",o)}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}});m[u.tagName]=h},style:{display:"inline-flex",paddingBlock:s(1),paddingInline:s(1),gap:s(.5),borderRadius:s(10),backgroundColor:u=>l(u,"shift-2",n)}}}function sl(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=>w(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",t)}`,borderRadius:o=>s(v(o)*1),paddingBlock:o=>s(v(o)*1),paddingLeft:o=>s(v(o)*3),paddingRight:o=>s(v(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Kt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${s(2)} center`,backgroundSize:`${s(2.5)} ${s(1.5)}`,"&:not([multiple])":{height:o=>s(6+v(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",n)}`},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-8","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function cl(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,a=g(e.value),c=g(i),{show:u,hide:m,anchorPartial:h}=ne({kind:"selectBox",open:c,placement:g(n),content:e.content}),d={onClick:(f,y)=>!r&&m(y)};I(e.content,d);let p={div:f=>{let y=a.get(f),S=Array.isArray(y)?y:[y];return t.filter(E=>S.includes(E.value)).map(E=>({span:E.label,$:[Ke({color:o,removable:r})],_key:E.value,_onRemove:x=>{let M=a.get(),_=(Array.isArray(M)?M:[M]).filter(D=>D!==E.value);r?a.set(_):a.set(_[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},b={_onInsert:f=>{f.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:f=>f.children.insert(p),onClick:(f,y)=>c.get()?m(y):u(y),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:f=>s(6+v(f)*2),minWidth:s(32),outlineOffset:"-1px",outline:f=>`1px solid ${l(f,"shift-4","neutral")}`,paddingInline:f=>s(v(f)*2),borderRadius:f=>s(v(f)*1),fontSize:f=>w(f,"inherit"),color:f=>l(f,"shift-9",o),backgroundColor:f=>l(f,"inherit",o)}};return I(h,b),h}function ul(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag');let a=r.getContext("select");if(a){let c=a.value;r.attributes.set("ariaSelected",u=>{let m=c.get(u);return a.multiple?m.includes(o):m===o}),r.addEvent("click",()=>{let u=c.get();a.multiple?u.includes(o)?c.set(u.filter(m=>m!==o)):c.set(u.concat([o])):u!==o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>w(r,"inherit"),height:r=>s(6+v(r)*2),paddingInline:r=>s(v(r)*3),border:"none",outline:"none",color:r=>l(r,"shift-9",n),backgroundColor:r=>l(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>l(r,"shift-2",n)},"&[aria-selected=true]":{backgroundColor:r=>l(r,"shift-6",t),color:r=>l(r,"shift-11")},"&:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function hl(e={}){var a;let{color:t="neutral",multiple:n=!1}=e,o=g((a=e.value)!=null?a:n?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(h=>({input:null,name:e.name,value:h==null?"":String(h)}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:n}},_onInit:c=>{c.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(v(c)*2),paddingInline:c=>s(v(c)*2),fontSize:c=>w(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function ml(e={}){var i;let t=g((i=e.color)!=null?i:"neutral","color"),n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=Pe(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:r=>w(r),color:r=>l(r,"shift-9",t.get(r)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:r=>l(r,"inherit",t.get(r)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function dl(e={}){var n;let t=g((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=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}var Ln={to:{transform:"rotate(360deg)"}},Dn=Pe(JSON.stringify(Ln));function fl(e={}){var n;let t=g((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=>w(o),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${l(o,"shift-4",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${Dn} 0.7s linear infinite`,[`@keyframes ${Dn}`]:Ln}}}function pl(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:i=90}=e;return{_onSchedule:(r,a)=>{I(a,{_context:{splitter:{direction:t,size:g(n),min:o,max:i,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function gl(){return{_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",i=t.panelCount++===0,r=c=>{n.style[o]=`${i?c:100-c}%`};r(t.size.get()),n.style.flexShrink="0",n.style.overflow="auto";let a=t.size.addListener(r);e.addHook("Remove",a)}}}function yl(){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 i=t.size.addListener(u=>{n.setAttribute("aria-valuenow",String(Math.round(u)))}),r=u=>{let m=u.shiftKey?10:1,h=null;o?u.key==="ArrowRight"?h=Math.min(t.size.get()+m,t.max):u.key==="ArrowLeft"&&(h=Math.max(t.size.get()-m,t.min)):u.key==="ArrowDown"?h=Math.min(t.size.get()+m,t.max):u.key==="ArrowUp"&&(h=Math.max(t.size.get()-m,t.min)),u.key==="Home"?h=t.min:u.key==="End"&&(h=t.max),h!==null&&(u.preventDefault(),t.size.set(h))},a=null,c=u=>{u.preventDefault();let m=n.parentElement,h=p=>{let b=m.getBoundingClientRect(),f=o?(p.clientX-b.left)/b.width*100:(p.clientY-b.top)/b.height*100;t.size.set(Math.min(Math.max(f,t.min),t.max))},d=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",d),a=null};a=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",d),a=null},document.addEventListener("mousemove",h),document.addEventListener("mouseup",d)};n.addEventListener("keydown",r),n.addEventListener("mousedown",c),e.addHook("Remove",()=>{a==null||a(),i(),n.removeEventListener("keydown",r),n.removeEventListener("mousedown",c)})},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&:focus-visible":{outline:e=>`2px solid ${l(e,"shift-6")}`,outlineOffset:"2px"},"&::after":{content:'""',width:s(1),height:s(1),borderRadius:s(999),backgroundColor:e=>l(e,"shift-4")}}}}function bl(e={items:[]}){var a;let{items:t=[],direction:n="horizontal",color:o="neutral",accentColor:i="primary"}=e,r=g((a=e.current)!=null?a:0);return{_context:{steps:{current:r,direction:n,color:o,accentColor:i}},_onSchedule:(c,u)=>{let m=t.map((h,d)=>{var b;return{li:[typeof h.label=="string"?{span:h.label}:h.label],_key:(b=h.key)!=null?b:d,dataStep:String(d+1),dataStatus:f=>{let y=r.get(f);return d<y?"done":d===y?"active":"pending"},ariaCurrent:f=>r.get(f)===d?"step":void 0,style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:s(1),flex:"1",fontSize:f=>w(f,"decrease-1"),textAlign:"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:s(6),height:s(6),borderRadius:s(999),fontSize:f=>w(f,"decrease-1"),fontWeight:"600",flexShrink:"0",border:f=>`2px solid ${l(f,"shift-4",o)}`,backgroundColor:f=>l(f,"inherit"),color:f=>l(f,"shift-8"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"},"&:not(:first-child)::after":{content:'""',position:"absolute",top:s(3),right:`calc(50% + ${s(3)})`,left:`calc(-50% + ${s(3)})`,height:"2px",backgroundColor:f=>l(f,"shift-3",o),zIndex:"0"},"&[data-status=active]::before":{backgroundColor:f=>l(f,"shift-6",i),borderColor:f=>l(f,"shift-6",i),color:f=>l(f,"shift-15",i)},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:f=>l(f,"shift-3",o),borderColor:f=>l(f,"shift-3",o),color:f=>l(f,"shift-9",o)},"&[data-status=done]:not(:first-child)::after":{backgroundColor:f=>l(f,"shift-3",o)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:f=>l(f,"shift-6",i)},"&[data-status=pending]":{color:f=>l(f,"shift-7")},"&[data-status=active]":{color:f=>l(f,"shift-10"),fontWeight:"600"},"&[data-status=done]":{color:f=>l(f,"shift-8")}}}});u[c.tagName]=m},style:{display:"flex",flexDirection:n==="vertical"?"column":"row",alignItems:n==="vertical"?"flex-start":"center",gap:s(2),listStyle:"none",margin:"0",padding:"0"}}}function vl(e={}){var n;let t=g((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=>w(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Sl(e={}){var n;let t=g((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=>w(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function wl(e={}){var n;let t=g((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=>w(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function xl(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>w(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(v(o)*3),paddingBlock:o=>s(v(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(v(o)*3),paddingBlock:o=>s(v(o)*1),color:o=>l(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-3",t.get(o))}`,fontSize:o=>w(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(v(o)*3),paddingBlock:o=>s(v(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>l(o,"shift-2")}}}}function Cl(e={items:[]}){var r,a,c;let{items:t=[],accentColor:n="primary",color:o="neutral"}=e,i=g((c=(a=e.activeKey)!=null?a:(r=t[0])==null?void 0:r.key)!=null?c:0);return{_onSchedule:(u,m)=>{let h=u.nodeId,p={div:t.map((f,y)=>{var E;let S=(E=f.key)!=null?E:y;return{button:[typeof f.label=="string"?{span:f.label}:f.label],_key:S,type:"button",role:"tab",id:`tab${h}${S}`,ariaControls:`panel${h}${S}`,ariaSelected:x=>i.get(x)===S,onClick:()=>i.set(S),onKeyDown:x=>{let M=x.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(M))return;x.preventDefault();let O=t.map((A,V)=>{var B;return(B=A.key)!=null?B:V}),_=O.indexOf(S),D=_;M==="ArrowRight"?D=(_+1)%O.length:M==="ArrowLeft"?D=(_-1+O.length)%O.length:M==="Home"?D=0:M==="End"&&(D=O.length-1),i.set(O[D])},style:{cursor:"pointer",fontSize:x=>w(x,"inherit"),height:x=>s(6+v(x)*2),paddingInline:x=>s(v(x)*4),border:"none",outline:"none",color:x=>l(x,"shift-9"),backgroundColor:x=>l(x,"inherit"),boxShadow:x=>`inset 0 -${s(.5)} 0 0 ${l(x,"shift-1",o)}`,"&:hover:not([disabled])":{boxShadow:x=>`inset 0 -${s(.5)} 0 0 ${l(x,"shift-2",o)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:x=>`inset 0 -${s(.5)} 0 0 ${l(x,"shift-6",n)}`},"&:focus-visible":{boxShadow:x=>`inset 0 -${s(.5)} 0 0 ${l(x,"shift-6",n)}`}}}}),role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},b=t.map((f,y)=>{var C;let S=(C=f.key)!=null?C:y;return{div:[f.content],_key:S,role:"tabpanel",id:`panel${h}${S}`,ariaLabelledby:`tab${h}${S}`,hidden:E=>i.get(E)!==S,style:{paddingBlock:E=>s(v(E)*2),paddingInline:E=>s(v(E)*2)}}});m[u.tagName]=[p,...b]}}}function kl(e={}){var i,r;let t=g((i=e.color)!=null?i:"neutral","color"),n=g((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:a=>{a.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:a=>{if(o){let c=a.domElement;c.style.overflow="hidden";let u=()=>{c.style.height="auto",c.style.height=`${c.scrollHeight}px`};c.addEventListener("input",u),u(),a.addHook("Remove",()=>c.removeEventListener("input",u))}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>s(v(a)*2),paddingBlock:a=>s(v(a)*1.5),border:"none",borderRadius:a=>s(v(a)*1.5),fontSize:a=>w(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",t.get(a))}`,backgroundColor:a=>l(a,"inherit",t.get(a)),"&::placeholder":{color:a=>l(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${s(.5)} solid ${l(a,"shift-5",n.get(a))}`},"&:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",n.get(a))}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`,backgroundColor:a=>l(a,"shift-2","neutral")}}}}function El(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function _l(e={}){var r,a,c;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(a=e.accentColor)!=null?a:"primary",i=g((c=e.active)!=null?c:!1);return{style:K({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>s(v(u)*2),paddingBottom:u=>t?"0":s(v(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:"0.25em",transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>l(u,"shift-8",i.get(u)?o:n),opacity:u=>i.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>`-${s(v(u)*4)}`,width:"2px",backgroundColor:u=>l(u,"shift-3",n)}})}}function Tl(e={}){let{position:t="top-center",color:n="neutral"}=e,o=g(!1),i=t.startsWith("top"),r=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:r?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:u=>{let m=u.domElement.querySelector(`#domphy-toast-${t}`);return m||(m=u.children.insert(c).domElement),m},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:u=>s(v(u)*2),paddingInline:u=>s(v(u)*4),borderRadius:u=>s(v(u)*2),fontSize:u=>w(u,"inherit"),color:u=>l(u,"shift-9",n),backgroundColor:u=>l(u,"inherit",n),boxShadow:u=>`0 ${s(2)} ${s(9)} ${l(u,"shift-4","neutral")}`,opacity:u=>Number(o.get(u)),transform:u=>o.get(u)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(u,m)=>{let h=!1,d=null,p=()=>{h||(h=!0,d&&(clearTimeout(d),d=null),u.domElement.removeEventListener("transitionend",b),m())},b=f=>{f.propertyName==="transform"&&p()};u.domElement.addEventListener("transitionend",b),d=setTimeout(p,350),u.addHook("Remove",()=>{var f;d&&(clearTimeout(d),d=null),(f=u.domElement)==null||f.removeEventListener("transitionend",b)}),o.set(!1)}}}function Ml(e={items:[]}){var a;let{items:t=[],multiple:n=!1,color:o="neutral",accentColor:i="primary"}=e,r=g((a=e.value)!=null?a:n?[]:"");return{role:"group",_context:{toggleGroup:{value:r,multiple:n}},_onSchedule:(c,u)=>{let m=t.map((h,d)=>{var f;let p=(f=h.key)!=null?f:String(d);return{button:[typeof h.label=="string"?{span:h.label}:h.label],_key:p,type:"button",role:"button",ariaPressed:y=>{let S=r.get(y);return Array.isArray(S)?S.includes(p):S===p},onClick:()=>{let y=r.get();if(n){let S=Array.isArray(y)?[...y]:[];r.set(S.includes(p)?S.filter(C=>C!==p):[...S,p])}else r.set(y===p?"":p)},style:{cursor:"pointer",fontSize:y=>w(y,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:y=>l(y,"shift-9",o),backgroundColor:y=>l(y,"inherit",o),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:y=>l(y,"shift-2",o)},"&[aria-pressed=true]":{backgroundColor:y=>l(y,"shift-3",i),color:y=>l(y,"shift-12",i)},"&:focus-visible":{outline:y=>`${s(.5)} solid ${l(y,"shift-6",i)}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}});u[c.tagName]=m},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:c=>w(c,"inherit"),backgroundColor:c=>l(c,"inherit",o),outline:c=>`1px solid ${l(c,"shift-3",o)}`,outlineOffset:"-1px"}}}function Ol(e={}){var n;let t=(n=e.gap)!=null?n:4;return{style:{display:"flex",alignItems:"center",gap:o=>s(v(o)*t)}}}function Pl(){return{div:null,style:{flex:"1 1 0"}}}function Dl(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content"}=e,i=g(n),r=g(o),a=`domphy-tt-${Math.random().toString(36).slice(2,9)}`,c={span:b=>r.get(b),id:a},{show:u,hide:m,anchorPartial:h}=ne({kind:"tooltip",open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:b=>s(v(b)*1),paddingInline:b=>s(v(b)*3),borderRadius:b=>s(v(b)*1),color:b=>l(b,"shift-9"),backgroundColor:b=>l(b),fontSize:b=>w(b,"inherit")},$:[io({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),I(h,{ariaDescribedby:a,onMouseEnter:(b,f)=>u(f),onMouseLeave:(b,f)=>m(f),onFocus:(b,f)=>u(f),onBlur:(b,f)=>m(f),onKeyDown:(b,f)=>b.key==="Escape"&&m(f)}),h}function $n(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Ll(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,i=new Map,r=new Set,a=new Set;return{_onMount:c=>{c.addHook("Remove",()=>{for(let u of Array.from(i.values()))u();i.clear();for(let u of r)clearTimeout(u);r.clear();for(let u of a)cancelAnimationFrame(u);a.clear()})},_onBeforeUpdate:c=>{o=new Map,c.children.items.forEach((u,m)=>{if(!(u instanceof j))return;let h=u.domElement;h&&o.set($n(u,m),h.getBoundingClientRect())})},_onUpdate:c=>{c.children.items.forEach((u,m)=>{var O;if(!(u instanceof j))return;let h=u.domElement;if(!h)return;let d=$n(u,m),p=o.get(d);if(!p)return;let b=h.getBoundingClientRect(),f=p.left-b.left,y=p.top-b.top;if(Math.abs(f)<.5&&Math.abs(y)<.5)return;(O=i.get(h))==null||O(),h.style.transition="none",h.style.transform=`translate(${f}px, ${y}px)`,h.getBoundingClientRect();let S=requestAnimationFrame(()=>{a.delete(S),h.style.transition=`transform ${t}ms ease ${n}ms`,h.style.transform="translate(0px, 0px)"});a.add(S);let C=!1,E=null,x=()=>{C||(C=!0,E&&(r.delete(E),E=null),i.delete(h),h.removeEventListener("transitionend",M),h.style.transition="",h.style.transform="")},M=_=>{_.propertyName==="transform"&&x()};i.set(h,()=>{C=!0,E&&(clearTimeout(E),r.delete(E),E=null),i.delete(h),h.removeEventListener("transitionend",M)}),h.addEventListener("transitionend",M),E=setTimeout(x,t+n+34),r.add(E)}),o.clear()}}}function $l(e={}){var n;let t=g((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=>w(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}return Jn(Il);})();
4
+ ${i}}`}function oe(e){if(!Re[e])throw Error(`Theme "${e}" not found`);return Re[e]}function Ur(e,t){Fr(t),Re[e]||(Re[e]=Gt(Ue)),Zo(Re[e],t),it=null,Wt.clear()}function qr(e){let t=Gt(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 Jo(e){let t=Wt.get(e);if(t)return t;let n=oe(e),o=Xt(n),i={};for(let r in n){let a=n[r];if(r==="colors")for(let s in n.colors){let u={};[...Array(o).keys()].forEach(h=>u[h]=n.colors[s][h]),i[s]=u}else if(r==="fontSizes")i.fontSizes=n.fontSizes;else if(r==="densities")i.densities=n.densities;else if(r==="custom"&&(i.custom={},a&&typeof a=="object"))for(let s in a)i.custom[s]=a[s]}return Wt.set(e,i),i}function at(){if(it)return it;let e=oe("light"),t=Xt(e),n={};for(let o in e){let i=e[o];if(o==="colors")for(let r in e.colors){let a={};[...Array(t).keys()].forEach(s=>a[s]=`var(--${r}-${s})`),n[r]=a}else if(o==="fontSizes")n.fontSizes=[...Array(8).keys()].map(r=>`var(--fontSize-${r})`);else if(o==="custom"&&(n.custom={},i&&typeof i=="object"))for(let r in i)n.custom[r]=`var(--custom-${Xo(r)})`}return it=n,n}function Ut(){return Object.entries(Re).map(([e,t])=>Wr(e,t)).join(`
5
+ `)}function Kr(e){var t;if(typeof document!="undefined")if(e){e.textContent=Ut();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Ut(),document.head.appendChild(e)}function c(e){return`calc(${e/4}em)`}function Yr(e,t,n=320,o=1280){let i=e/4,r=t/4,a=(r-i)/(o-n)*100,s=i-a*n/100,u=parseFloat(s.toFixed(4))===0?`${a.toFixed(4)}vw`:`${s.toFixed(4)}em + ${a.toFixed(4)}vw`;return`clamp(${i}em, ${u}, ${r}em)`}function Gr(e=document.documentElement,t={}){let{persist:n=!0,storageKey:o="dp-theme"}=t,i=()=>{if(n){let s=localStorage.getItem(o);if(s==="light"||s==="dark")return s}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};e.setAttribute("data-theme",i());let r=window.matchMedia("(prefers-color-scheme: dark)"),a=s=>{(!n||!localStorage.getItem(o))&&e.setAttribute("data-theme",s.matches?"dark":"light")};return r.addEventListener("change",a),()=>r.removeEventListener("change",a)}function lt(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 Xr=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],qt=["inherit"];[...Array(5).keys()].forEach(e=>{qt.push(`decrease-${e}`),qt.push(`increase-${e}`)});function Zr(e,t="inherit"){if(!qt.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 Jr(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=Zr(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function b(e){let t=Jr(e);return oe(e?lt(e):"light").densities[t]}var Qr=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],ei=[.75,1,1.5,2,2.5];function ti(e,t){let n=Ft(rt(t)),o=0,i=1/0;for(let r=0;r<e.length;r++){let a=qo(n,Ft(rt(e[r])));a<i&&(i=a,o=r)}return o}function oi(e,t={}){var n,o,i,r,a,s;let u=(n=t.steps)!=null?n:18,h={},m={};for(let[d,p]of Object.entries(e)){let v=Yo(p,u);h[d]=v,m[d]=ti(v,p)}return{direction:(o=t.direction)!=null?o:"darken",colors:h,baseTones:m,fontSizes:(i=t.fontSizes)!=null?i:Qr,densities:(r=t.densities)!=null?r:ei,darkBias:(a=t.darkBias)!=null?a:1,custom:(s=t.custom)!=null?s:{}}}var Kt=["inherit"];[...Array(8).keys()].forEach(e=>{Kt.push(`decrease-${e}`),Kt.push(`increase-${e}`)});function Qo(e,t="inherit"){if(!Kt.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 ni(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=Qo(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function x(e,t="inherit"){let n=Qo(ni(e),t);return at().fontSizes[n]}var he=Ue.colors.neutral.length,Yt={surface:"shift-1",hover:"shift-2",border:"shift-3","border-strong":"shift-4",muted:"shift-8",text:"shift-9"},We=["inherit","base",...Object.keys(Yt)];[...Array(he).keys()].forEach(e=>{We.push(`decrease-${e}`),We.push(`increase-${e}`),We.push(`shift-${e}`)});function Go(e,t){if(e<0||e>he-1)return e;let n=e+t;return n=Math.max(0,Math.min(he-1,n)),n}function ri(e,t){if(e<0||e>he-1)return e;let n=Math.floor((he-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(he-1,o)),o}function qe(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!We.includes(t))throw Error(`tone name "${t}" invalid`);if(t in Yt&&(t=Yt[t]),t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return Go(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return Go(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return ri(e,n)}else return e}function en(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=qe(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function tn(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===he-1?he-1-n:e}function l(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e){let s=at()[o];if(!s)throw Error(`color "${o}" not found on theme "light"`);return t==="base"?s[oe("light").baseTones[o]]:s[qe(0,t)]}let i=lt(e),r;if(t==="base")r=oe(i).baseTones[o];else{let s=oe(i),u=tn(en(e),s.direction,s.darkBias);r=qe(u,t)}let a=at()[o];if(!a)throw Error(`color "${o}" not found on theme "${i}"`);return a[r]}function Zt(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,i=e?lt(e):"light",r=Jo(i)[o];if(!r)throw Error(`color "${o}" not found on theme "${i}"`);if(!e)return t==="base"?r[oe("light").baseTones[o]]:r[qe(0,t)];let a;if(t==="base")a=oe(i).baseTones[o];else{let s=oe(i),u=tn(en(e),s.direction,s.darkBias);a=qe(u,t)}return r[a]}var Ct={};et(Ct,{abbreviation:()=>ii,accordion:()=>ai,alert:()=>li,avatar:()=>si,badge:()=>ci,blockquote:()=>ui,breadcrumb:()=>mi,breadcrumbEllipsis:()=>hi,button:()=>pi,buttonGhost:()=>Jt,buttonSwitch:()=>gi,card:()=>yi,code:()=>bi,combobox:()=>sa,command:()=>ca,commandItem:()=>ma,commandSearch:()=>ua,datePicker:()=>da,descriptionList:()=>ga,details:()=>ya,dialog:()=>ba,divider:()=>va,drawer:()=>Sa,emphasis:()=>xa,empty:()=>wa,errorBoundary:()=>Ca,fab:()=>Ea,figure:()=>_a,formGroup:()=>Ta,heading:()=>Ma,horizontalRule:()=>Pa,icon:()=>Da,image:()=>La,inputCheckbox:()=>Ra,inputColor:()=>$a,inputDateTime:()=>Ia,inputFile:()=>za,inputNumber:()=>Aa,inputOTP:()=>Ha,inputPassword:()=>Na,inputRadio:()=>ja,inputRange:()=>Fa,inputSearch:()=>Wa,inputSwitch:()=>Ua,inputText:()=>qa,keyboard:()=>Ka,label:()=>Ya,link:()=>Ga,linkButton:()=>Xa,list:()=>Za,listItem:()=>Ja,listItemButton:()=>Qa,mark:()=>el,menu:()=>tl,motion:()=>ol,orderedList:()=>nl,pagination:()=>il,panelSection:()=>al,paragraph:()=>ll,popover:()=>sl,popoverArrow:()=>uo,preformated:()=>cl,progress:()=>ul,rating:()=>dl,ringProgress:()=>fl,row:()=>mo,scrollArea:()=>pl,segmented:()=>gl,select:()=>yl,selectBox:()=>bl,selectItem:()=>vl,selectList:()=>Sl,skeleton:()=>xl,small:()=>wl,spinner:()=>Cl,splitter:()=>kl,splitterHandle:()=>_l,splitterPanel:()=>El,stack:()=>Tl,steps:()=>Ol,strong:()=>Ml,subscript:()=>Pl,superscript:()=>Dl,table:()=>Ll,tabs:()=>Rl,tag:()=>Ge,textarea:()=>$l,timeline:()=>Il,timelineItem:()=>zl,toast:()=>Al,toggleGroup:()=>Vl,toolbar:()=>Bl,toolbarSpacer:()=>Nl,tooltip:()=>Hl,transitionGroup:()=>jl,unorderedList:()=>Fl});function ii(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>x(r),backgroundColor:r=>l(r),color:r=>l(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>l(r,"shift-7",t.get(r)),textUnderlineOffset:c(.72),cursor:"help","&:hover":{color:r=>l(r,"shift-11",n.get(r)),textDecorationColor:r=>l(r,"shift-9",n.get(r))}}}}function ai(e={}){var i,r;let{type:t="single"}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=g((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:a=>{if(t!=="single")return;let s=a.domElement;if(!s)return;let u=h=>{let m=h.target.closest("summary");if(!m)return;let d=m.closest("details");!d||d.parentElement!==s||d.open||Array.from(s.querySelectorAll(":scope > details")).forEach(p=>{p!==d&&(p.open=!1)})};s.addEventListener("click",u),a.addHook("Remove",()=>s.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:a=>c(b(a)*1.5),outline:a=>`1px solid ${l(a,"border-strong",n.get(a))}`,outlineOffset:"-1px",overflow:"hidden","& > details":{borderBottom:a=>`1px solid ${l(a,"border-strong",n.get(a))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{outline:a=>`${c(.5)} solid ${l(a,"shift-6",o.get(a))}`}}}}function li(e={}){var n;let t=g((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:c(3),paddingBlock:o=>c(b(o)*2),paddingInline:o=>c(b(o)*4),boxShadow:o=>`inset ${c(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>x(o,"inherit")}}}function si(e={}){var n;let t=g((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:c(9),height:c(9),fontSize:o=>x(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function ci(e={}){var i;let{label:t=999}=e,n=g(t),o=g((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:c(1),minWidth:c(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>x(r,"decrease-1"),borderRadius:c(999),backgroundColor:r=>l(r,"shift-9",o.get(r)),color:r=>l(r,"shift-0",o.get(r))}}}}function ui(e={}){var n;let t=g((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=>x(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${c(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>c(b(o)*2),paddingInline:o=>c(b(o)*4),margin:0}}}function mi(e={}){var o;let{separator:t="/"}=e,n=g((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>x(i,"inherit"),gap:c(1),color:i=>l(i,"text",n.get(i)),backgroundColor:i=>l(i,"inherit",n.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"muted",n.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",n.get(i)),paddingInlineStart:c(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",n.get(i)),pointerEvents:"none"}}}}function hi(e={}){var n;let t=g((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=>x(o,"inherit"),paddingInline:c(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"muted",t.get(o)),borderRadius:c(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"hover",t.get(o))},"&:focus-visible":{outline:o=>`${c(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:c(.5)}}}}var ct={small:"decrease-1",medium:"inherit",large:"increase-1"};function $(e,t="primary"){return`0 0 0 2px ${l(e,"shift-6",t)}`}var di={small:.5,medium:1,large:1.5};function Jt(e={}){var i,r,a;let t=g((i=e.color)!=null?i:"neutral","color"),n=di[(r=e.size)!=null?r:"medium"],o=ct[(a=e.size)!=null?a:"medium"];return{_onInsert:s=>{s.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:s=>x(s,o),paddingBlock:s=>c(b(s)*n),paddingInline:s=>c(b(s)*n),borderRadius:s=>c(b(s)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:s=>c(b(s)*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:s=>l(s,"shift-6",t.get(s)),"&:hover:not([disabled]):not([aria-busy=true])":{color:s=>l(s,"text",t.get(s)),backgroundColor:s=>l(s,"hover",t.get(s))},"&:focus-visible":{boxShadow:s=>$(s,t.get(s))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:s=>l(s,"border-strong","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var fi={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}};function pi(e={}){var a,s,u,h;let t=(a=e.variant)!=null?a:"outline";if(t==="ghost")return Jt({color:e.color,size:e.size});let n=g((s=e.color)!=null?s:"primary","color"),o=t==="solid",i=fi[(u=e.size)!=null?u:"medium"],r=ct[(h=e.size)!=null?h:"medium"];return{_onInsert:m=>{m.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:m=>x(m,r),paddingBlock:m=>c(b(m)*i.block),paddingInline:m=>c(b(m)*i.inline),borderRadius:m=>c(b(m)*1.5),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:m=>c(b(m)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o?"none":m=>`1px solid ${l(m,"border-strong",n.get(m))}`,color:m=>o?l(m,"shift-0",n.get(m)):l(m,"text",n.get(m)),backgroundColor:m=>o?l(m,"shift-9",n.get(m)):l(m,"inherit",n.get(m)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{color:m=>o?l(m,"shift-0",n.get(m)):l(m,"shift-10",n.get(m)),backgroundColor:m=>o?l(m,"shift-10",n.get(m)):l(m,"hover",n.get(m))},"&:focus-visible":{boxShadow:m=>$(m,n.get(m))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:m=>l(m,"shift-2","neutral"),outline:m=>`1px solid ${l(m,"border-strong","neutral")}`,color:m=>l(m,"muted","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function gi(e={}){var r,a;let{checked:t=!1}=e,n=g(t),o=g((r=e.color)!=null?r:"neutral","color"),i=g((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:s=>{s.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:s=>n.get(s),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:s=>x(s),border:"none",outlineWidth:"1px",outline:s=>`1px solid ${l(s,"border",o.get(s))}`,minWidth:c(12),minHeight:c(6),borderRadius:c(999),paddingLeft:c(7),paddingRight:c(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:s=>l(s,"inherit",o.get(s)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:c(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:c(5),height:c(5),borderRadius:c(999),color:s=>l(s,"text"),backgroundColor:s=>l(s,"decrease-2",o.get(s))},"&[aria-checked=true]":{backgroundColor:s=>l(s,"increase-3",i.get(s)),outline:"none",color:s=>l(s,"decrease-2"),paddingLeft:c(2),paddingRight:c(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${c(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function yi(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>c(b(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(o,"border-strong",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>c(b(o)*2),paddingInline:o=>c(b(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>c(b(o)*4),color:o=>l(o,"text",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>c(b(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>c(b(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:c(2),paddingBlock:o=>c(b(o)*2),paddingInline:o=>c(b(o)*4),borderTop:o=>`1px solid ${l(o,"border",t.get(o))}`}}}}function bi(e={}){var n;let t=g((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=>x(o,"inherit"),color:o=>l(o,"text",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:c(6),paddingInline:c(1.5),borderRadius:c(1)}}}var vi={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 A(e){return vi[e]}var Si=Object.defineProperty,xi=Object.defineProperties,wi=Object.getOwnPropertyDescriptors,mt=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,fn=Object.prototype.propertyIsEnumerable,on=(e,t,n)=>t in e?Si(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t)=>{for(var n in t||(t={}))dn.call(t,n)&&on(e,n,t[n]);if(mt)for(var n of mt(t))fn.call(t,n)&&on(e,n,t[n]);return e},we=(e,t)=>xi(e,wi(t)),pn=(e,t)=>{var n={};for(var o in e)dn.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&mt)for(var o of mt(e))t.indexOf(o)<0&&fn.call(e,o)&&(n[o]=e[o]);return n},Ee=(e,t,n)=>new Promise((o,i)=>{var r=u=>{try{s(n.next(u))}catch(h){i(h)}},a=u=>{try{s(n.throw(u))}catch(h){i(h)}},s=u=>u.done?o(u.value):Promise.resolve(u.value).then(r,a);s((n=n.apply(e,t)).next())}),Ci=["top","right","bottom","left"],nn=["start","end"],Qs=Ci.reduce((e,t)=>e.concat(t,`${t}-${nn[0]}`,`${t}-${nn[1]}`),[]),ht=Math.min,xe=Math.max,dt=Math.round,ut=Math.floor,ne=e=>({x:e,y:e}),ki={left:"right",right:"left",bottom:"top",top:"bottom"};function rn(e,t,n){return xe(e,ht(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function yt(e){return e.split("-")[1]}function gn(e){return e==="x"?"y":"x"}function yn(e){return e==="y"?"height":"width"}function de(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function bn(e){return gn(de(e))}function Ei(e,t,n=!1){let o=yt(e),i=bn(e),r=yn(i),a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=ft(a)),[a,ft(a)]}function _i(e){let t=ft(e);return[to(e),t,to(t)]}function to(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var an=["left","right"],ln=["right","left"],Ti=["top","bottom"],Oi=["bottom","top"];function Mi(e,t,n){switch(e){case"top":case"bottom":return n?t?ln:an:t?an:ln;case"left":case"right":return t?Ti:Oi;default:return[]}}function Pi(e,t,n,o){let i=yt(e),r=Mi(Ce(e),n==="start",o);return i&&(r=r.map(a=>`${a}-${i}`),t&&(r=r.concat(r.map(to)))),r}function ft(e){let t=Ce(e);return ki[t]+e.slice(t.length)}function Di(e){return J({top:0,right:0,bottom:0,left:0},e)}function Li(e){return typeof e!="number"?Di(e):{top:e,right:e,bottom:e,left:e}}function pt(e){let{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function sn({reference:e,floating:t},n,o){let i=de(n),r=bn(n),a=yn(r),s=Ce(n),u=i==="y",h=e.x+e.width/2-t.width/2,m=e.y+e.height/2-t.height/2,d=e[a]/2-t[a]/2,p;switch(s){case"top":p={x:h,y:e.y-t.height};break;case"bottom":p={x:h,y:e.y+e.height};break;case"right":p={x:e.x+e.width,y:m};break;case"left":p={x:e.x-t.width,y:m};break;default:p={x:e.x,y:e.y}}switch(yt(n)){case"start":p[r]-=d*(o&&u?-1:1);break;case"end":p[r]+=d*(o&&u?-1:1);break;default:}return p}function Ri(e){return Ee(this,arguments,function*(t,n={}){var o,i,r,a,s,u;let{x:h,y:m,platform:d,rects:p,elements:v,strategy:f}=t,{boundary:y="clippingAncestors",rootBoundary:S="viewport",elementContext:C="floating",altBoundary:E=!1,padding:w=0}=gt(n,t),O=Li(w),M=v[E?C==="floating"?"reference":"floating":C],_=pt(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,M))==null||i?M:M.contextElement||(yield(r=d.getDocumentElement)==null?void 0:r.call(d,v.floating)),boundary:y,rootBoundary:S,strategy:f})),D=C==="floating"?{x:h,y:m,width:p.floating.width,height:p.floating.height}:p.reference,B=yield(a=d.getOffsetParent)==null?void 0:a.call(d,v.floating),H=(yield(s=d.isElement)==null?void 0:s.call(d,B))?(yield(u=d.getScale)==null?void 0:u.call(d,B))||{x:1,y:1}:{x:1,y:1},j=pt(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:D,offsetParent:B,strategy:f}):D);return{top:(_.top-j.top+O.top)/H.y,bottom:(j.bottom-_.bottom+O.bottom)/H.y,left:(_.left-j.left+O.left)/H.x,right:(j.right-_.right+O.right)/H.x}})}var $i=50,Ii=(e,t,n)=>Ee(null,null,function*(){var o;let{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:s}=n,u=s.detectOverflow?s:we(J({},s),{detectOverflow:Ri}),h=yield(o=s.isRTL)==null?void 0:o.call(s,t),m=yield s.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:p}=sn(m,i,h),v=i,f=0,y={};for(let S=0;S<a.length;S++){let C=a[S];if(!C)continue;let{name:E,fn:w}=C,{x:O,y:M,data:_,reset:D}=yield w({x:d,y:p,initialPlacement:i,placement:v,strategy:r,middlewareData:y,rects:m,platform:u,elements:{reference:e,floating:t}});d=O!=null?O:d,p=M!=null?M:p,y[E]=J(J({},y[E]),_),D&&f<$i&&(f++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(m=D.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:r}):D.rects),{x:d,y:p}=sn(m,v,h)),S=-1)}return{x:d,y:p,placement:v,strategy:r,middlewareData:y}});var zi=(e={})=>({name:"flip",options:e,fn(t){return Ee(this,null,function*(){var n,o,i,r,a,s;let{placement:u,middlewareData:h,rects:m,initialPlacement:d,platform:p,elements:v}=t,f=gt(e,t),{mainAxis:y=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:O=!0}=f,M=pn(f,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=h.arrow)!=null&&n.alignmentOffset)return{};let _=Ce(u),D=de(d),B=Ce(d)===d,H=yield(o=p.isRTL)==null?void 0:o.call(p,v.floating),j=C||(B||!O?[ft(d)]:_i(d)),pe=w!=="none";!C&&pe&&j.push(...Pi(d,O,w,H));let Te=[d,...j],ce=yield p.detectOverflow(t,M),W=[],ae=((i=h.flip)==null?void 0:i.overflows)||[];if(y&&W.push(ce[_]),S){let le=Ei(u,m,H);W.push(ce[le[0]],ce[le[1]])}if(ae=[...ae,{placement:u,overflows:W}],!W.every(le=>le<=0)){let le=(((r=h.flip)==null?void 0:r.index)||0)+1,Be=Te[le];if(Be&&(!(S==="alignment"&&D!==de(Be))||ae.every(q=>de(q.placement)===D?q.overflows[0]>0:!0)))return{data:{index:le,overflows:ae},reset:{placement:Be}};let ge=(a=ae.filter(q=>q.overflows[0]<=0).sort((q,X)=>q.overflows[1]-X.overflows[1])[0])==null?void 0:a.placement;if(!ge)switch(E){case"bestFit":{let q=(s=ae.filter(X=>{if(pe){let Z=de(X.placement);return Z===D||Z==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(Z=>Z>0).reduce((Z,Ne)=>Z+Ne,0)]).sort((X,Z)=>X[1]-Z[1])[0])==null?void 0:s[0];q&&(ge=q);break}case"initialPlacement":ge=d;break;default:}if(u!==ge)return{reset:{placement:ge}}}return{}})}});var Ai=new Set(["left","top"]);function Vi(e,t){return Ee(this,null,function*(){var n;let{placement:o,platform:i,elements:r}=e,a=yield(n=i.isRTL)==null?void 0:n.call(i,r.floating),s=Ce(o),u=yt(o),h=de(o)==="y",m=Ai.has(s)?-1:1,d=a&&h?-1:1,p=gt(t,e),{mainAxis:v,crossAxis:f,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof y=="number"&&(f=u==="end"?y*-1:y),h?{x:f*d,y:v*m}:{x:v*m,y:f*d}})}var Bi=(e=0)=>({name:"offset",options:e,fn(t){return Ee(this,null,function*(){var n,o;let{x:i,y:r,placement:a,middlewareData:s}=t,u=yield Vi(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:r+u.y,data:we(J({},u),{placement:a})}})}}),Ni=(e={})=>({name:"shift",options:e,fn(t){return Ee(this,null,function*(){let{x:n,y:o,placement:i,platform:r}=t,a=gt(e,t),{mainAxis:s=!0,crossAxis:u=!1,limiter:h={fn:({x:E,y:w})=>({x:E,y:w})}}=a,m=pn(a,["mainAxis","crossAxis","limiter"]),d={x:n,y:o},p=yield r.detectOverflow(t,m),v=de(Ce(i)),f=gn(v),y=d[f],S=d[v];if(s){let E=f==="y"?"top":"left",w=f==="y"?"bottom":"right",O=y+p[E],M=y-p[w];y=rn(O,y,M)}if(u){let E=v==="y"?"top":"left",w=v==="y"?"bottom":"right",O=S+p[E],M=S-p[w];S=rn(O,S,M)}let C=h.fn(we(J({},t),{[f]:y,[v]:S}));return we(J({},C),{data:{x:C.x-n,y:C.y-o,enabled:{[f]:s,[v]:u}}})})}});function bt(){return typeof window!="undefined"}function ze(e){return vn(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(vn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vn(e){return bt()?e instanceof Node||e instanceof Y(e).Node:!1}function Q(e){return bt()?e instanceof Element||e instanceof Y(e).Element:!1}function se(e){return bt()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function cn(e){return!bt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function Ye(e){let{overflow:t,overflowX:n,overflowY:o,display:i}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&i!=="inline"&&i!=="contents"}function Hi(e){return/^(table|td|th)$/.test(ze(e))}function vt(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var ji=/transform|translate|scale|rotate|perspective|filter/,Fi=/paint|layout|strict|content/,Se=e=>!!e&&e!=="none",Qt;function no(e){let t=Q(e)?ee(e):e;return Se(t.transform)||Se(t.translate)||Se(t.scale)||Se(t.rotate)||Se(t.perspective)||!ro()&&(Se(t.backdropFilter)||Se(t.filter))||ji.test(t.willChange||"")||Fi.test(t.contain||"")}function Wi(e){let t=fe(e);for(;se(t)&&!Ie(t);){if(no(t))return t;if(vt(t))return null;t=fe(t)}return null}function ro(){return Qt==null&&(Qt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Qt}function Ie(e){return/^(html|body|#document)$/.test(ze(e))}function ee(e){return Y(e).getComputedStyle(e)}function St(e){return Q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fe(e){if(ze(e)==="html")return e;let t=e.assignedSlot||e.parentNode||cn(e)&&e.host||re(e);return cn(t)?t.host:t}function Sn(e){let t=fe(e);return Ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:se(t)&&Ye(t)?t:Sn(t)}function Ke(e,t=[],n=!0){var o;let i=Sn(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),a=Y(i);if(r){let s=oo(a);return t.concat(a,a.visualViewport||[],Ye(i)?i:[],s&&n?Ke(s):[])}else return t.concat(i,Ke(i,[],n))}function oo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xn(e){let t=ee(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=se(e),r=i?e.offsetWidth:n,a=i?e.offsetHeight:o,s=dt(n)!==r||dt(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function io(e){return Q(e)?e:e.contextElement}function $e(e){let t=io(e);if(!se(t))return ne(1);let n=t.getBoundingClientRect(),{width:o,height:i,$:r}=xn(t),a=(r?dt(n.width):n.width)/o,s=(r?dt(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}var Ui=ne(0);function wn(e){let t=Y(e);return!ro()||!t.visualViewport?Ui:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qi(e,t=!1,n){return!n||t&&n!==Y(e)?!1:t}function ke(e,t=!1,n=!1,o){let i=e.getBoundingClientRect(),r=io(e),a=ne(1);t&&(o?Q(o)&&(a=$e(o)):a=$e(e));let s=qi(r,n,o)?wn(r):ne(0),u=(i.left+s.x)/a.x,h=(i.top+s.y)/a.y,m=i.width/a.x,d=i.height/a.y;if(r){let p=Y(r),v=o&&Q(o)?Y(o):o,f=p,y=oo(f);for(;y&&o&&v!==f;){let S=$e(y),C=y.getBoundingClientRect(),E=ee(y),w=C.left+(y.clientLeft+parseFloat(E.paddingLeft))*S.x,O=C.top+(y.clientTop+parseFloat(E.paddingTop))*S.y;u*=S.x,h*=S.y,m*=S.x,d*=S.y,u+=w,h+=O,f=Y(y),y=oo(f)}}return pt({width:m,height:d,x:u,y:h})}function xt(e,t){let n=St(e).scrollLeft;return t?t.left+n:ke(re(e)).left+n}function Cn(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-xt(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Ki({elements:e,rect:t,offsetParent:n,strategy:o}){let i=o==="fixed",r=re(n),a=e?vt(e.floating):!1;if(n===r||a&&i)return t;let s={scrollLeft:0,scrollTop:0},u=ne(1),h=ne(0),m=se(n);if((m||!m&&!i)&&((ze(n)!=="body"||Ye(r))&&(s=St(n)),m)){let p=ke(n);u=$e(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}let d=r&&!m&&!i?Cn(r,s):ne(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-s.scrollLeft*u.x+h.x+d.x,y:t.y*u.y-s.scrollTop*u.y+h.y+d.y}}function Yi(e){return Array.from(e.getClientRects())}function Gi(e){let t=re(e),n=St(e),o=e.ownerDocument.body,i=xe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=xe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+xt(e),s=-n.scrollTop;return ee(o).direction==="rtl"&&(a+=xe(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}var un=25;function Xi(e,t){let n=Y(e),o=re(e),i=n.visualViewport,r=o.clientWidth,a=o.clientHeight,s=0,u=0;if(i){r=i.width,a=i.height;let m=ro();(!m||m&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}let h=xt(o);if(h<=0){let m=o.ownerDocument,d=m.body,p=getComputedStyle(d),v=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,f=Math.abs(o.clientWidth-d.clientWidth-v);f<=un&&(r-=f)}else h<=un&&(r+=h);return{width:r,height:a,x:s,y:u}}function Zi(e,t){let n=ke(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=se(e)?$e(e):ne(1),a=e.clientWidth*r.x,s=e.clientHeight*r.y,u=i*r.x,h=o*r.y;return{width:a,height:s,x:u,y:h}}function mn(e,t,n){let o;if(t==="viewport")o=Xi(e,n);else if(t==="document")o=Gi(re(e));else if(Q(t))o=Zi(t,n);else{let i=wn(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return pt(o)}function kn(e,t){let n=fe(e);return n===t||!Q(n)||Ie(n)?!1:ee(n).position==="fixed"||kn(n,t)}function Ji(e,t){let n=t.get(e);if(n)return n;let o=Ke(e,[],!1).filter(s=>Q(s)&&ze(s)!=="body"),i=null,r=ee(e).position==="fixed",a=r?fe(e):e;for(;Q(a)&&!Ie(a);){let s=ee(a),u=no(a);!u&&s.position==="fixed"&&(i=null),(r?!u&&!i:!u&&s.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Ye(a)&&!u&&kn(e,a))?o=o.filter(h=>h!==a):i=s,a=fe(a)}return t.set(e,o),o}function Qi({element:e,boundary:t,rootBoundary:n,strategy:o}){let i=[...t==="clippingAncestors"?vt(e)?[]:Ji(e,this._c):[].concat(t),n],r=mn(e,i[0],o),a=r.top,s=r.right,u=r.bottom,h=r.left;for(let m=1;m<i.length;m++){let d=mn(e,i[m],o);a=xe(d.top,a),s=ht(d.right,s),u=ht(d.bottom,u),h=xe(d.left,h)}return{width:s-h,height:u-a,x:h,y:a}}function ea(e){let{width:t,height:n}=xn(e);return{width:t,height:n}}function ta(e,t,n){let o=se(t),i=re(t),r=n==="fixed",a=ke(e,!0,r,t),s={scrollLeft:0,scrollTop:0},u=ne(0);function h(){u.x=xt(i)}if(o||!o&&!r)if((ze(t)!=="body"||Ye(i))&&(s=St(t)),o){let v=ke(t,!0,r,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else i&&h();r&&!o&&i&&h();let m=i&&!o&&!r?Cn(i,s):ne(0),d=a.left+s.scrollLeft-u.x-m.x,p=a.top+s.scrollTop-u.y-m.y;return{x:d,y:p,width:a.width,height:a.height}}function eo(e){return ee(e).position==="static"}function hn(e,t){if(!se(e)||ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function En(e,t){let n=Y(e);if(vt(e))return n;if(!se(e)){let i=fe(e);for(;i&&!Ie(i);){if(Q(i)&&!eo(i))return i;i=fe(i)}return n}let o=hn(e,t);for(;o&&Hi(o)&&eo(o);)o=hn(o,t);return o&&Ie(o)&&eo(o)&&!no(o)?n:o||Wi(e)||n}var oa=function(e){return Ee(this,null,function*(){let t=this.getOffsetParent||En,n=this.getDimensions,o=yield n(e.floating);return{reference:ta(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function na(e){return ee(e).direction==="rtl"}var ra={convertOffsetParentRelativeRectToViewportRelativeRect:Ki,getDocumentElement:re,getClippingRect:Qi,getOffsetParent:En,getElementRects:oa,getClientRects:Yi,getDimensions:ea,getScale:$e,isElement:Q,isRTL:na};function _n(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ia(e,t){let n=null,o,i=re(e);function r(){clearTimeout(o),n==null||n.disconnect(),n=null}function a(s=!1,u=1){r();let h=e.getBoundingClientRect(),{left:m,top:d,width:p,height:v}=h;if(s||t(),!p||!v)return;let f=ut(d),y=ut(i.clientWidth-(m+p)),S=ut(i.clientHeight-(d+v)),C=ut(m),E={rootMargin:`${-f}px ${-y}px ${-S}px ${-C}px`,threshold:xe(0,ht(1,u))||1},w=!0;function O(M){let _=M[0].intersectionRatio;if(_!==u){if(!w)return a();_?a(!1,_):o=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!_n(h,e.getBoundingClientRect())&&a(),w=!1}try{n=new IntersectionObserver(O,we(J({},E),{root:i.ownerDocument}))}catch(M){n=new IntersectionObserver(O,E)}n.observe(e)}return a(!0),r}function Tn(e,t,n,o={}){let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,h=io(e),m=i||r?[...h?Ke(h):[],...t?Ke(t):[]]:[];m.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),r&&C.addEventListener("resize",n)});let d=h&&s?ia(h,n):null,p=-1,v=null;a&&(v=new ResizeObserver(([C])=>{C&&C.target===h&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{v==null||v.observe(t)})),n()}),h&&!u&&v.observe(h),t&&v.observe(t));let f,y=u?ke(e):null;u&&S();function S(){let C=ke(e);y&&!_n(y,C)&&n(),y=C,f=requestAnimationFrame(S)}return n(),()=>{m.forEach(C=>{i&&C.removeEventListener("scroll",n),r&&C.removeEventListener("resize",n)}),d==null||d(),v==null||v.disconnect(),v=null,u&&cancelAnimationFrame(f)}}var On=Bi;var Mn=Ni,Pn=zi;var Dn=(e,t,n)=>{let o=new Map,i=J({platform:ra},n),r=we(J({},i.platform),{_c:o});return Ii(e,t,we(J({},i),{platform:r}))};function aa(e,t){var M;let{openState:n,placement:o,content:i,keepOpenOnContentHover:r}=t,a=null,s=null,u=null,h=null,m=!1,d=e.domElement,p=e.getRoot(),v={style:{position:"fixed",pointerEvents:"auto",visibility:_=>n.get(_)?"visible":"hidden"},onKeyDown:_=>{_.key==="Escape"&&w()},onMouseEnter:()=>r&&E(),onMouseLeave:()=>r&&w(),_onMount:_=>{var D;if(u=_.domElement,d&&u&&!u.hasAttribute("data-theme")){let B=(D=d.closest("[data-theme]"))==null?void 0:D.getAttribute("data-theme");B&&u.setAttribute("data-theme",B)}},_portal:_=>{let D=_.domElement.querySelector("#domphy-floating");if(!D){let B={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};D=_.children.insert(B).domElement}return D}},f=_=>I(_,v);f(i);let y=()=>{m||(m=!0,h=p.children.insert(i))},S=()=>{y(),d&&u&&(s==null||s(),s=Tn(d,u,()=>{Dn(d,u,{placement:o.get(),middleware:[On(12),Pn(),Mn()],strategy:"fixed"}).then(({x:_,y:D,placement:B})=>{u&&(Object.assign(u.style,{left:`${_}px`,top:`${D}px`}),o.set(B))})}),n.set(!0))},C=()=>{s==null||s(),s=null,h&&(h.remove(),h=null),u=null,m=!1,n.set(!1)},E=()=>{a&&clearTimeout(a),a=setTimeout(S,100)},w=()=>{a&&clearTimeout(a),a=setTimeout(C,100)},O=_=>{if(!n.get()||!d||!u)return;let D=_.target;!d.contains(D)&&!u.contains(D)&&w()};return(M=p.domElement)==null||M.addEventListener("click",O),{show:E,hide:w,update(_){n=_.openState,o=_.placement,i=_.content,r=_.keepOpenOnContentHover,f(i),h&&h.patch(i)},destroy(){var _;a&&clearTimeout(a),s==null||s(),h==null||h.remove(),(_=p.domElement)==null||_.removeEventListener("click",O)}}}function ie(e){let{kind:t,open:n=!1,placement:o}=e,i=g(n),r=`floating:${t}`,a=h=>{var m;return(m=h==null?void 0:h.getBehavior(r))==null?void 0:m.show()},s=h=>{var m;return(m=h==null?void 0:h.getBehavior(r))==null?void 0:m.hide()},u=N({onKeyDown:(h,m)=>h.key==="Escape"&&s(m)},Nt(r,aa,{openState:i,placement:o,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover}));return{show:a,hide:s,anchorPartial:u}}var la='<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 Ge(e={}){var o;let{removable:t=!1}=e,n=g((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let r={span:la,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:c(1),width:c(4),height:c(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",n.get(a))}}};t&&i.children.insert(r)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:c(6),paddingBlock:0,borderRadius:c(1),paddingInlineStart:c(2),paddingInlineEnd:t?c(1):c(2),gap:c(2),fontSize:i=>x(i,"inherit"),backgroundColor:i=>l(i,"inherit",n.get(i)),color:i=>l(i,"text",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"border-strong",n.get(i))}`}}}function sa(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,a=g(e.value),s=g(i),{show:u,hide:h,anchorPartial:m}=ie({kind:"combobox",open:s,placement:g(n),content:e.content}),d={onClick:(S,C)=>!r&&h(C),dataTone:"shift-14",style:{backgroundColor:S=>l(S,"inherit"),borderRadius:S=>c(b(S)*2),outline:S=>`1px solid ${l(S,"border-strong")}`,outlineOffset:"-1px",boxShadow:A("medium")}};I(e.content,d);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:c(6),marginInlineStart:c(2),fontSize:S=>x(S,"inherit"),color:S=>l(S,"text",o),backgroundColor:S=>l(S,"inherit",o)},v;if(e.input){let S={onFocus:(C,E)=>u(E),style:p,_key:"combobox-input"};I(e.input,S),v=e.input}else v={input:null,onFocus:(S,C)=>u(C),value:S=>(a.get(S),""),style:p,_key:"combobox-input"};let f={div:S=>{let C=a.get(S),E=Array.isArray(C)?C:[C],O=t.filter(M=>E.includes(M.value)).map(M=>({span:M.label,$:[Ge({color:o,removable:!0})],_key:M.value,_onRemove:_=>{let D=a.get(),H=(Array.isArray(D)?D:[D]).filter(j=>j!==M.value);r?a.set(H):a.set(H[0])}}));return O.push(v),O},style:{display:"flex",flexWrap:"wrap",gap:c(1)}},y={_onInsert:S=>{S.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(f),style:{minWidth:c(32),outlineOffset:"-1px",outline:S=>`1px solid ${l(S,"border-strong","neutral")}`,paddingBlock:S=>c(b(S)*1),paddingInline:S=>c(b(S)*1),borderRadius:S=>c(b(S)*1.5),fontSize:S=>x(S,"inherit"),color:S=>l(S,"text",o),backgroundColor:S=>l(S,"inherit",o)}};return I(m,y),m}function ca(){return{_onSchedule:(e,t)=>{I(t,{_context:{command:{query:g("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function ua(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 i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,a=()=>i.query.set(r.value);r.addEventListener("input",a),o.addHook("Remove",()=>r.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>x(o,"inherit"),paddingInline:o=>c(b(o)*3),paddingBlock:o=>c(b(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"border",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",n)}}}}function ma(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{role:"option",_onMount:o=>{var h,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,a=(m=(h=r.textContent)==null?void 0:h.toLowerCase())!=null?m:"",s=d=>{r.hidden=d.length>0&&!a.includes(d.toLowerCase())};s(i.query.get());let u=i.query.addListener(s);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>x(o,"inherit"),height:o=>c(6+b(o)*2),paddingInline:o=>c(b(o)*3),border:"none",outline:"none",color:o=>l(o,"text",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"hover",t)},"&:focus-visible":{outline:o=>`${c(.5)} solid ${l(o,"shift-6",n)}`,outlineOffset:`-${c(.5)}`}}}}var F=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),_e=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),ao=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Xe=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),lo=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,so=(e,t)=>_e(e,-((e.getDay()-t+7)%7));function ha(e){var t,n;try{let o=new Intl.Locale(e),i=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function da(e={}){var ho,fo,po,go;let{mode:t="single",time:n=!1,min:o,max:i,disabledDate:r,locale:a=typeof navigator!="undefined"?navigator.language:"en-US",format:s,onChange:u}=e,h=(ho=e.weekStartsOn)!=null?ho:ha(a),m=g((fo=e.accentColor)!=null?fo:"primary","accentColor"),d=g((po=e.placement)!=null?po:"bottom-start"),p=g((go=e.value)!=null?go:t==="range"?[null,null]:null),v=u?p.addListener(k=>u(k)):null,f=(()=>{let k=p.get(),T=t==="range"?k==null?void 0:k[0]:k;return T instanceof Date?T:new Date})(),y=g(f.getFullYear(),"viewYear"),S=g(f.getMonth(),"viewMonth"),C=g(F(f),"focused"),E=g(null,"hovered"),w=g(f.getHours(),"hour"),O=g(f.getMinutes(),"minute"),M=null,_=new Intl.DateTimeFormat(a,N({dateStyle:"medium"},n?{timeStyle:"short"}:{})),D=new Intl.DateTimeFormat(a,{month:"long",year:"numeric"}),B=new Intl.DateTimeFormat(a,{weekday:"short"}),H=new Intl.DateTimeFormat(a,{dateStyle:"full"}),j=k=>k?_.format(k):"",pe=k=>{if(s)return s(k);if(t==="range"){let[T,P]=k!=null?k:[null,null];return T?`${j(T)} \u2013 ${j(P)}`:""}return j(k)},Te=Array.from({length:7},(k,T)=>B.format(new Date(2023,0,1+(T+h)%7))),ce=k=>!!o&&F(k)<F(o)||!!i&&F(k)>F(i)||!!r&&r(k),W=k=>{if(!n)return F(k);let T=F(k);return T.setHours(w.get(),O.get(),0,0),T},ae=k=>{var L;if(ce(k))return;if(t==="single"){p.set(W(k)),n||Et();return}let[T,P]=(L=p.get())!=null?L:[null,null];!T||T&&P?p.set([W(k),null]):F(k)<F(T)?(p.set([W(k),W(T)]),n||Et()):(p.set([T,W(k)]),n||Et())},le=()=>{var k;if(n)if(t==="single"){let T=p.get();T&&p.set(W(T))}else{let[T,P]=(k=p.get())!=null?k:[null,null];p.set([T&&W(T),P&&W(P)])}},Be=(k,T)=>{var Oe;if(t!=="range")return!1;let[P,L]=(Oe=p.get(T))!=null?Oe:[null,null],z=L!=null?L:E.get(T);if(!P||!z)return!1;let R=F(P)<=F(z)?P:z,G=F(P)<=F(z)?z:P,K=F(k);return K>=F(R)&&K<=F(G)},ge=(k,T)=>{let P=p.get(T);if(t==="range"){let[L,z]=P!=null?P:[null,null];return Xe(k,L)||Xe(k,z)}return Xe(k,P)},q=k=>{y.set(k.getFullYear()),S.set(k.getMonth())},X=k=>{let T=ao(new Date(y.get(),S.get(),1),k);q(T)},Z=k=>y.set(y.get()+k),Ne=()=>{setTimeout(()=>{var k;(k=M==null?void 0:M.querySelector(`[data-date="${lo(C.get())}"]`))==null||k.focus()},0)},Nn=Un(),{show:Hn,hide:jn,anchorPartial:kt}=ie({kind:"datePicker",open:!1,placement:d,content:Nn});function Et(){jn()}kt.onClick=()=>{};let Fn={type:"text",readonly:!0,value:k=>pe(p.get(k)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(k,T)=>{_t(T)},onFocus:(k,T)=>{_t(T)},onKeyDown:(k,T)=>{let P=k.key;(P==="ArrowDown"||P==="Enter")&&(k.preventDefault(),_t(T))},_onMount:k=>v&&k.addHook("Remove",()=>{v()})};function _t(k){var P;let T=(P=Wn())!=null?P:new Date;C.set(F(T)),q(T),Hn(k),Ne()}function Wn(){var T;let k=p.get();return t==="range"?(T=k==null?void 0:k[0])!=null?T:null:k!=null?k:null}return I(kt,Fn),kt;function Un(){let k=(R,G,K)=>({button:R,type:"button",ariaLabel:G,onClick:K,style:fa()}),T={div:[k("\xAB","Previous year",()=>Z(-1)),k("\u2039","Previous month",()=>X(-1)),{div:R=>D.format(new Date(y.get(R),S.get(R),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:R=>x(R)}},k("\u203A","Next month",()=>X(1)),k("\xBB","Next year",()=>Z(1))],style:{display:"flex",alignItems:"center",gap:c(1),marginBottom:c(2)}},P={div:Te.map((R,G)=>({div:R,style:{textAlign:"center",fontSize:K=>x(K,"decrease-1"),fontWeight:"600",color:K=>l(K,"shift-7"),paddingBlock:c(1)},_key:G})),role:"row",style:Ln()},L={div:R=>qn(R),role:"grid",ariaLabel:"Calendar",onKeyDown:Xn,onMouseLeave:()=>t==="range"&&E.set(null),style:{display:"flex",flexDirection:"column",gap:c(.5)}},z=[T,P,L];return n&&z.push(Yn()),z.push(Gn()),{div:z,role:"dialog",ariaModal:"false",_onMount:R=>{M=R.domElement},style:{minWidth:c(70),padding:c(3),borderRadius:R=>c(b(R)*2),backgroundColor:R=>l(R,"base"),color:R=>l(R,"shift-10"),border:R=>`1px solid ${l(R,"border-strong")}`,boxShadow:A("medium")}}}function qn(k){let T=new Date(y.get(k),S.get(k),1),P=S.get(k),L=so(T,h),z=[];for(let R=0;R<6;R++){let G=[];for(let K=0;K<7;K++){let Oe=_e(L,R*7+K);G.push(Kn(Oe,P,k))}z.push({div:G,role:"row",style:Ln(),_key:R})}return z}function Kn(k,T,P){let L=ce(k),z=ge(k,P),R=Be(k,P),G=k.getMonth()!==T,K=Xe(k,C.get(P)),Oe=Xe(k,new Date);return{button:String(k.getDate()),type:"button",role:"gridcell",tabIndex:K?0:-1,ariaSelected:z,ariaDisabled:L,disabled:L,ariaLabel:H.format(k),dataDate:lo(k),onClick:()=>ae(k),onMouseEnter:()=>t==="range"&&E.set(k),style:{appearance:"none",border:"none",cursor:L?"not-allowed":"pointer",aspectRatio:"1",borderRadius:c(1),fontSize:V=>x(V),fontFamily:"inherit",opacity:L?.35:G?.5:1,backgroundColor:V=>z?l(V,"shift-7",m.get(V)):R?l(V,"hover",m.get(V)):"transparent",color:V=>z?l(V,"shift-0",m.get(V)):l(V,"text"),outline:Oe?V=>`1px solid ${l(V,"shift-6",m.get(V))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:V=>z?l(V,"shift-7",m.get(V)):l(V,"shift-3",m.get(V))},"&:focus-visible":{outline:V=>`2px solid ${l(V,"shift-6",m.get(V))}`}},_key:lo(k)}}function Yn(){let k=(T,P,L)=>({select:Array.from({length:T},(z,R)=>({option:String(R).padStart(2,"0"),value:String(R),selected:G=>P.get(G)===R,_key:R})),ariaLabel:L,onChange:z=>{P.set(Number(z.target.value)),le()},style:pa()});return{div:[k(24,w,"Hour"),{span:":",style:{fontWeight:"600"}},k(60,O,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:c(1),marginTop:c(3)}}}function Gn(){let k=(T,P)=>({button:T,type:"button",onClick:P,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:L=>x(L,"decrease-1"),color:L=>l(L,"muted",m.get(L)),padding:c(1)}});return{div:[k("Today",()=>{let T=new Date;C.set(F(T)),q(T),Ne()}),k("Clear",()=>{p.set(t==="range"?[null,null]:null),E.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:c(2),paddingTop:c(2),borderTop:T=>`1px solid ${l(T,"border")}`}}}function Xn(k){let T=k,P=C.get(),L=null;switch(T.key){case"ArrowLeft":L=_e(P,-1);break;case"ArrowRight":L=_e(P,1);break;case"ArrowUp":L=_e(P,-7);break;case"ArrowDown":L=_e(P,7);break;case"Home":L=so(P,h);break;case"End":L=_e(so(P,h),6);break;case"PageUp":L=ao(P,T.shiftKey?-12:-1);break;case"PageDown":L=ao(P,T.shiftKey?12:1);break;case"Enter":case" ":T.preventDefault(),ae(P);return;default:return}T.preventDefault(),C.set(L),q(L),Ne()}}function Ln(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:c(.5)}}function fa(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>x(e),color:e=>l(e,"muted"),width:c(7),height:c(7),borderRadius:c(1),"&:hover":{backgroundColor:e=>l(e,"shift-3")}}}function pa(){return{fontFamily:"inherit",fontSize:e=>x(e),padding:c(1),borderRadius:c(1),border:e=>`1px solid ${l(e,"border-strong")}`,backgroundColor:e=>l(e,"base"),color:e=>l(e,"text")}}function ga(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${c(24)}, max-content) 1fr`,columnGap:c(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>x(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>x(o,"inherit"),color:o=>l(o,"text",t.get(o))}}}}function ya(e={}){var i,r;let{duration:t=240}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=g((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:a=>{a.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>x(a,"inherit"),color:a=>l(a,"text",n.get(a)),backgroundColor:a=>l(a,"inherit",n.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",n.get(a)),color:a=>l(a,"shift-10",n.get(a)),fontSize:a=>x(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:c(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>c(b(a)*4),height:c(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:c(2),height:c(2),flexShrink:0,marginTop:`-${c(.5)}`,borderInlineEnd:a=>`${c(.5)} solid ${l(a,"shift-9",n.get(a))}`,borderBottom:a=>`${c(.5)} solid ${l(a,"shift-9",n.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",n.get(a))},"& > summary:focus-visible":{borderRadius:a=>c(b(a)*2),outlineOffset:`-${c(.5)}`,outline:a=>`${c(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:a=>c(b(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:c(250),opacity:1,paddingTop:a=>c(b(a)*1),paddingBottom:a=>c(b(a)*3)}}}}var Ze=0;function wt(){Ze++,Ze===1&&(document.body.style.overflow="hidden")}function Ae(){Ze=Math.max(0,Ze-1),Ze===0&&(document.body.style.overflow="")}var Rn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function ba(e={}){let{color:t="neutral",open:n=!1}=e,o=g(n),i=null,r=!1,a=!1,s=u=>{r=!1,u.close(),a&&(Ae(),a=!1),i==null||i.focus(),i=null};return{_onInsert:u=>{u.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(u,h)=>{if(u.target!==h.domElement)return;let m=h.domElement.getBoundingClientRect();u.clientX>=m.left&&u.clientX<=m.right&&u.clientY>=m.top&&u.clientY<=m.bottom||o.set(!1)},onTransitionEnd:(u,h)=>{r&&u.target===h.domElement&&u.propertyName==="opacity"&&s(h.domElement)},_onMount:u=>{let h=u.domElement;h.setAttribute("aria-modal","true");let m=null,d=y=>{if(y.key!=="Tab")return;let S=Array.from(h.querySelectorAll(Rn)).filter(w=>!w.closest("[aria-hidden='true']")&&w.offsetParent!==null);if(!S.length){y.preventDefault();return}let C=S[0],E=S[S.length-1];y.shiftKey?(document.activeElement===C||document.activeElement===h)&&(y.preventDefault(),E.focus()):document.activeElement===E&&(y.preventDefault(),C.focus())},p=y=>{y.preventDefault(),o.set(!1)};h.addEventListener("cancel",p);let v=y=>{y?(i=document.activeElement,h.showModal(),a||(wt(),a=!0),h.addEventListener("keydown",d),requestAnimationFrame(()=>{h.style.opacity="1";let S=h.querySelector(Rn);S==null||S.focus()})):(r=!0,h.style.opacity="0",h.removeEventListener("keydown",d),m=setTimeout(()=>{m=null,r&&s(h)},350))};v(o.get());let f=o.addListener(v);u.addHook("Remove",()=>{m&&(clearTimeout(m),m=null),f(),h.removeEventListener("cancel",p),a&&(Ae(),a=!1),h.removeEventListener("keydown",d),i==null||i.focus(),i=null})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:u=>x(u,"inherit"),color:u=>l(u,"shift-10",t),backgroundColor:u=>l(u,"inherit",t),border:"none",borderRadius:u=>c(b(u)*2),padding:u=>c(b(u)*3),boxShadow:A("high"),"&::backdrop":{backgroundColor:u=>l(u,"shift-2","neutral"),opacity:.75}}}}function va(e={}){var n;let t=g((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:c(2),fontSize:o=>x(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"text",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var co={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},$n={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},Je=e=>e==="left"||e==="right";function In(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function Sa(e={}){let{color:t="neutral",open:n=!1,placement:o="end",size:i}=e,r=g(n),a=o==="start"||o==="end",s=In(o,!1),u=Je(s)?c(80):c(64),h=i!=null?i:u;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,d)=>{m.target===d.domElement&&r.set(!1)},_onMount:m=>{let d=m.domElement;d.setAttribute("aria-modal","true");let p=_=>{_.preventDefault(),r.set(!1)};d.addEventListener("cancel",p);let v=a&&(d.ownerDocument.documentElement.dir==="rtl"||d.ownerDocument.dir==="rtl"),f=In(o,v);a&&(d.style.transform=co[f],d.style.margin=$n[f],d.style.width=Je(f)?h:"100dvw",d.style.height=Je(f)?"100dvh":h);let y=!1,S=!1,C=null,E=()=>{C=null,y&&(y=!1,d.close(),S&&(Ae(),S=!1))},w=_=>{_.target===d&&_.propertyName==="transform"&&E()};d.addEventListener("transitionend",w);let O=_=>{_?(y=!1,d.showModal(),S||(wt(),S=!0),requestAnimationFrame(()=>{d.style.transform="translate(0, 0)"})):(y=!0,d.style.transform=co[f],C=setTimeout(E,350))};O(r.get());let M=r.addListener(O);m.addHook("Remove",()=>{C&&(clearTimeout(C),C=null),M(),d.removeEventListener("cancel",p),d.removeEventListener("transitionend",w),S&&(Ae(),S=!1)})},style:{transform:co[s],transition:"transform 0.25s ease",fontSize:m=>x(m,"inherit"),color:m=>l(m,"shift-10",t),backgroundColor:m=>l(m,"inherit",t),border:"none",padding:m=>c(b(m)*3),margin:$n[s],width:Je(s)?h:"100dvw",height:Je(s)?"100dvh":h,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:A("high"),"&::backdrop":{backgroundColor:m=>l(m,"shift-2","neutral"),opacity:.75}}}}function xa(e={}){var n;let t=g((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=>x(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function wa(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:c(3),paddingBlock:c(12),paddingInline:c(6),textAlign:"center",color:o=>l(o,"shift-6",t.get(o)),"& > :first-child":{color:o=>l(o,"shift-5",t.get(o))}}}}function Ca(e={}){return{_onError:(t,n,o)=>{var r,a;(r=e.onError)==null||r.call(e,n);let i=typeof e.fallback=="function"?e.fallback(n,o):(a=e.fallback)!=null?a:{div:"An error occurred."};t.children.update([i])}}}var ka={small:8,medium:10,large:14};function Ea(e={}){var o,i;let t=g((o=e.color)!=null?o:"primary","color"),n=c(ka[(i=e.size)!=null?i:"medium"]);return{_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>x(r,"inherit"),backgroundColor:r=>l(r,"shift-9",t.get(r)),color:r=>l(r,"shift-0",t.get(r)),boxShadow:A("low"),transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>l(r,"shift-10",t.get(r)),boxShadow:A("medium")},"&:focus-visible":{boxShadow:r=>`${A("medium")}, ${$(r,t.get(r))}`},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function _a(e={}){var n;let t=g((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:c(2),marginInline:0,marginTop:c(3),marginBottom:c(3),color:o=>l(o,"text",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:c(2)},"& figcaption":{fontSize:o=>x(o,"decrease-1"),color:o=>l(o,"muted",t.get(o)),lineHeight:1.45}}}}function Ta(e={}){var i;let{layout:t="horizontal"}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:r=>c(b(r)*3),paddingBlock:r=>c(b(r)*3),border:"none",borderRadius:r=>c(b(r)*2),fontSize:r=>x(r,"inherit"),backgroundColor:r=>l(r,"inherit",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:c(4),rowGap:c(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>x(r,"inherit"),fontWeight:600,paddingBlock:r=>c(b(r)*1),borderRadius:r=>c(b(r)*2),color:r=>l(r,"text",n.get(r)),backgroundColor:r=>l(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?0:c(b(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(${c(2)} * -1)`,fontSize:r=>x(r,"decrease-1"),color:r=>l(r,"text",n.get(r))}}}}var Oa={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Ma(e={}){var n;let t=g((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=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:c(2),fontSize:o=>{let i=Oa[o.elementNode.tagName]||"inherit";return x(o,i)}}}}function Pa(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:c(3),marginBottom:c(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function Da(e={}){var n;let t=g((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:c(4),height:c(4),flexShrink:"0",fontSize:o=>x(o),backgroundColor:"transparent",color:o=>l(o,"text",t.get(o))}}}function La(e={}){var n;let t=g((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:c(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function Ra(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>x(r,"inherit"),display:"inline-flex",position:"relative",width:c(6),height:c(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:c(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"border-strong",t.get(r))}`,color:r=>l(r,"text",t.get(r)),width:c(4),height:c(4)},"&:hover::before":{backgroundColor:r=>l(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${l(r,"shift-6",n.get(r))}`,backgroundColor:r=>l(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>l(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${c(.5)} solid ${l(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${l(r,"shift-6",n.get(r))}`,backgroundColor:r=>l(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>l(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>l(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:c(1.5),outline:r=>`${c(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>l(r,"shift-4","neutral"),pointerEvents:"none"}}}}function $a(e={}){return{type:"color",_onSchedule:(t,n)=>{t.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),n.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:t=>x(t,"inherit"),paddingBlock:t=>c(b(t)*1),paddingInline:t=>c(b(t)*1),blockSize:t=>c(6+b(t)*2),inlineSize:t=>c(6+b(t)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:t=>c(b(t)*1.5)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>l(t,"shift-2","neutral"),outline:t=>`1px solid ${l(t,"border-strong","neutral")}`}}}}function Ia(e={}){var i,r;let{mode:t="datetime-local"}=e,n=g((i=e.color)!=null?i:"neutral","color"),o=g((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onSchedule:(a,s)=>{a.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),s.type=t},style:{fontFamily:"inherit",fontSize:a=>x(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"text",n.get(a)),backgroundColor:a=>l(a,"inherit",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"border-strong",n.get(a))}`,borderRadius:a=>c(b(a)*1.5),paddingInline:a=>c(b(a)*3),height:a=>c(6+b(a)*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:a=>`1px solid ${l(a,"shift-5",o.get(a))}`},"&:focus-visible":{boxShadow:a=>$(a,o.get(a))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"muted","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"border-strong","neutral")}`},"&:invalid":{outline:a=>`${c(.5)} solid ${l(a,"shift-6","error")}`}}}}function za(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:r=>x(r,"inherit"),lineHeight:"inherit",color:r=>l(r,"text",t.get(r)),backgroundColor:r=>l(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"border-strong",t.get(r))}`,borderRadius:r=>c(b(r)*1.5),height:r=>c(6+b(r)*2),paddingInline:r=>c(b(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-file-upload-button":{marginTop:r=>c(b(r)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:c(1),height:c(6),paddingInline:c(2),cursor:"pointer",color:r=>l(r,"shift-11",t.get(r)),backgroundColor:r=>l(r,"surface",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${l(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>$(r,n.get(r))},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>l(r,"muted","neutral"),outline:r=>`1px solid ${l(r,"border-strong","neutral")}`,backgroundColor:r=>l(r,"surface","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>l(r,"muted","neutral"),backgroundColor:r=>l(r,"shift-3","neutral")}}}}function Aa(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:c(10),paddingInlineStart:r=>c(b(r)*3),paddingInlineEnd:r=>c(b(r)*1.5),paddingBlock:r=>c(b(r)*1),borderRadius:r=>c(b(r)*1.5),fontSize:r=>x(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"border-strong",t.get(r))}`,color:r=>l(r,"text",t.get(r)),backgroundColor:r=>l(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 ${l(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>$(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>l(r,"shift-2","neutral"),outline:r=>`1px solid ${l(r,"border-strong","neutral")}`,color:r=>l(r,"muted","neutral")}}}}var Va='<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>',Ba='<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 Na(e={}){var i,r;let t=g((i=e.color)!=null?i:"neutral","color"),n=g((r=e.accentColor)!=null?r:"primary","accentColor"),o=g(!1);return{_onInsert:a=>{a.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onInit:a=>{let s={input:null,type:h=>o.get(h)?"text":"password",style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}},u={button:h=>o.get(h)?Ba:Va,type:"button",ariaLabel:h=>o.get(h)?"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}};a.children.insert(s),a.children.insert(u)},style:{display:"flex",alignItems:"center",gap:a=>c(b(a)*1),paddingBlock:a=>c(b(a)*1),paddingInline:a=>c(b(a)*3),borderRadius:a=>c(b(a)*1.5),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"border-strong",t.get(a))}`,color:a=>l(a,"text",t.get(a)),backgroundColor:a=>l(a,"inherit",t.get(a)),fontSize:a=>x(a,"inherit"),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not(:has([disabled])):not(:focus-within)":{outline:a=>`1px solid ${l(a,"shift-5",n.get(a))}`},"&:focus-within":{boxShadow:a=>$(a,n.get(a))}}}}function Ha(){return{style:{display:"flex",alignItems:"center",gap:c(2),"& > *":{minWidth:`${c(9)}!important`}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=a=>{let s=n(),u=a.target,h=s.indexOf(u);u.value&&h<s.length-1&&s[h+1].focus()},i=a=>{let s=n(),u=a.target,h=s.indexOf(u);a.key==="Backspace"&&!u.value&&h>0&&s[h-1].focus(),a.key==="ArrowLeft"&&h>0&&s[h-1].focus(),a.key==="ArrowRight"&&h<s.length-1&&s[h+1].focus()},r=a=>{var p,v,f;a.preventDefault();let s=(v=(p=a.clipboardData)==null?void 0:p.getData("text"))!=null?v:"",u=n(),h=u.indexOf(a.target),m=h===-1?0:h;[...s].forEach((y,S)=>{u[m+S]&&(u[m+S].value=y)});let d=Math.min(m+s.length-1,u.length-1);(f=u[d])==null||f.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",r)})}}}function ja(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"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=>x(r,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:c(6),height:c(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 ${l(r,"border-strong",t.get(r))}`,color:r=>l(r,"text",t.get(r)),width:c(4),height:c(4)},"&:hover::before":{backgroundColor:r=>l(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${l(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>l(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>l(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",outline:r=>`${c(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>l(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Fa(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"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:c(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:c(1.5),borderRadius:c(999),backgroundColor:r=>l(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:c(4),height:c(4),borderRadius:c(999),border:"none",marginTop:`calc((${c(1.5)} - ${c(4)}) / 2)`,backgroundColor:r=>l(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>l(r,"shift-10",n.get(r))},"&:focus-visible":{outline:r=>`${c(.5)} solid ${l(r,"shift-6",n.get(r))}`,outlineOffset:c(1),borderRadius:c(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Wa(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:r=>x(r,"inherit"),lineHeight:"inherit",color:r=>l(r,"text",t.get(r)),backgroundColor:r=>l(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"border-strong",t.get(r))}`,borderRadius:r=>c(b(r)*1.5),minWidth:c(32),paddingInline:r=>c(b(r)*3),paddingBlock:r=>c(b(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:r=>l(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 ${l(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>$(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>l(r,"muted","neutral"),backgroundColor:r=>l(r,"shift-2","neutral"),outline:r=>`1px solid ${l(r,"border-strong","neutral")}`}}}}function Ua(e={}){var n;let t=g((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=>x(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:c(9),height:c(6),cursor:"pointer",margin:"0",paddingBlock:c(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${c(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:c(3),height:c(3),borderRadius:c(999),left:c(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:c(999),display:"inline-block",fontSize:o=>x(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function qa(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(r,a)=>{r.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:c(10),paddingInline:r=>c(b(r)*3),paddingBlock:r=>c(b(r)*1),borderRadius:r=>c(b(r)*1.5),fontSize:r=>x(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${l(r,"border-strong",t.get(r))}`,color:r=>l(r,"text",t.get(r)),backgroundColor:r=>l(r,"inherit",t.get(r)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:r=>l(r,"shift-7")},"&:not(:placeholder-shown)":{color:r=>l(r,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${l(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>$(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>l(r,"shift-2","neutral"),outline:r=>`1px solid ${l(r,"border-strong","neutral")}`,color:r=>l(r,"muted","neutral")},"&:invalid:not(:placeholder-shown)":{outline:r=>`${c(.5)} solid ${l(r,"shift-6","error")}`},"&[data-status=error]":{outline:r=>`${c(.5)} solid ${l(r,"shift-6","error")}`},"&[data-status=warning]":{outline:r=>`${c(.5)} solid ${l(r,"shift-6","warning")}`}}}}function Ka(e={}){var n;let t=g((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=>x(o,"inherit"),color:o=>l(o,"text",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:c(.5),paddingInline:c(1.5),borderRadius:c(1),outline:o=>`1px solid ${l(o,"border-strong",t.get(o))}`}}}function Ya(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:c(2),fontSize:r=>x(r,"inherit"),color:r=>l(r,"text",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>l(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>l(r,"muted","neutral")}}}}function Ga(e={}){var o,i;let t=g((o=e.color)!=null?o:"primary","color"),n=g((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:r=>x(r,"inherit"),backgroundColor:r=>l(r),color:r=>l(r,"text",t.get(r)),textDecoration:"none","&:visited":{color:r=>l(r,"text",n.get(r))},"&:hover:not([disabled])":{color:r=>l(r,"shift-10",t.get(r)),textDecoration:"underline"},"&:focus-visible":{borderRadius:c(1),outlineOffset:c(1),outline:r=>`${c(.5)} solid ${l(r,"shift-6",n.get(r))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>l(r,"muted","neutral")}}}}function Xa(e={}){var n;let t=g((n=e.color)!=null?n:"primary","color");return{_onInsert:o=>{o.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:o=>x(o,"inherit"),textDecoration:"none",paddingBlock:o=>c(b(o)*1),paddingInline:o=>c(b(o)*3),borderRadius:o=>c(b(o)*1.5),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>c(b(o)*1),userSelect:"none",cursor:"pointer",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"border-strong",t.get(o))}`,color:o=>l(o,"text",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"hover",t.get(o))},"&:focus-visible":{boxShadow:o=>$(o,t.get(o))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"border-strong","neutral")}`,color:o=>l(o,"muted","neutral")}}}}function Za(e={}){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function Ja(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>c(b(n)*2),paddingBlock:n=>c(t?1:b(n)*2),paddingInline:n=>c(b(n)*3),fontSize:n=>x(n,"inherit")}}}function Qa(e={}){var i,r;let t=g((i=e.color)!=null?i:"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:a=>c(b(a)*2),paddingBlock:a=>c(o?1:b(a)*2),paddingInline:a=>c(b(a)*3),fontSize:a=>x(a,"inherit"),color:a=>l(a,"text",t.get(a)),borderRadius:a=>c(b(a)*1.5),transition:"background-color 150ms ease","&:hover:not([disabled])":{backgroundColor:a=>l(a,"hover",t.get(a))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:a=>l(a,"shift-3",n),color:a=>l(a,"shift-12",n)},"&:focus-visible":{outline:a=>`2px solid ${l(a,"shift-6",n)}`,outlineOffset:"-2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function el(e={}){var n;let t=g((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=>x(o,"inherit"),color:o=>l(o,"text",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:c(6),borderRadius:c(1),paddingInline:c(1.5)}}}function tl(e={items:[]}){var a;let{items:t=[],selectable:n=!0,color:o="neutral",accentColor:i="primary"}=e,r=g((a=e.activeKey)!=null?a:null);return{role:"menu",dataTone:"shift-17",_onSchedule:(s,u)=>{if(t.length===0)return;let h=s.nodeId,m=t.map((d,p)=>{var f;let v=(f=d.key)!=null?f:p;return Me(N({button:typeof d.label=="string"?[{span:d.label}]:[d.label],_key:v,type:"button",id:`menuitem${h}${v}`,role:"menuitem"},n?{ariaCurrent:y=>r.get(y)===v||void 0}:{}),{onClick:()=>{var y;n&&r.set(v),(y=d.onClick)==null||y.call(d)},onKeyDown:y=>{var O;let S=y.key;if(S==="Enter"||S===" "){y.preventDefault(),y.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(S))return;y.preventDefault();let C=t.map((M,_)=>{var D;return(D=M.key)!=null?D:_}),E=C.indexOf(v),w=E;S==="ArrowDown"?w=(E+1)%C.length:S==="ArrowUp"?w=(E-1+C.length)%C.length:S==="Home"?w=0:S==="End"&&(w=C.length-1),(O=document.getElementById(`menuitem${h}${C[w]}`))==null||O.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:c(2),width:"100%",fontSize:y=>x(y,"inherit"),height:y=>c(6+b(y)*2),paddingInline:y=>c(b(y)*3),border:"none",outline:"none",color:y=>l(y,"text",o),backgroundColor:y=>l(y,"inherit",o),transition:"background-color 140ms ease","&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:y=>l(y,"hover",o)},"&[aria-current=true]":{backgroundColor:y=>l(y,"shift-3",i),color:y=>l(y,"shift-10")},"&:focus-visible":{outline:y=>`${c(.5)} solid ${l(y,"shift-6",i)}`,outlineOffset:`-${c(.5)}`}}})});u[s.tagName]=m},style:{display:"flex",flexDirection:"column",paddingBlock:s=>c(b(s)*2),paddingInline:s=>c(b(s)*2),fontSize:s=>x(s,"inherit"),backgroundColor:s=>l(s,"inherit",o),borderRadius:s=>c(b(s)*2),outline:s=>`1px solid ${l(s,"border-strong",o)}`,outlineOffset:"-1px",boxShadow:A("medium")}}}var zn=e=>!!e&&typeof e.get=="function"&&e._isState===!0,Ve=e=>{let t={},n=[];for(let o in e){let i=e[o];o==="x"?n.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?n.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?n.push(`scale(${i})`):o==="rotate"?n.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return n.length&&(t.transform=n.join(" ")),t};function ol(e={}){var a,s,u,h;let{initial:t,animate:n,exit:o,transition:i={}}=e,r={duration:(a=i.duration)!=null?a:300,delay:(s=i.delay)!=null?s:0,easing:(u=i.easing)!=null?u:"ease",iterations:(h=i.iterations)!=null?h:1,fill:"both"};return{_onMount:m=>{let d=m.domElement;if(!d||typeof d.animate!="function")return;let p=zn(n)?n.get():n;if(p?d.animate(t?[Ve(t),Ve(p)]:[Ve(p)],r):t&&Object.assign(d.style,Ve(t)),zn(n)){let v=n.addListener(f=>{d.animate([Ve(f)],r)});m.setMetadata("motionRelease",v)}},_onBeforeRemove:(m,d)=>{let p=m.domElement;if(!p||!o||typeof p.animate!="function")return d();p.animate([Ve(o)],r).finished.then(d,d)},_onRemove:m=>{let d=m.getMetadata("motionRelease");d==null||d()}}}function nl(e={}){var n;let t=g((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=>x(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:c(3),listStyleType:"decimal",listStylePosition:"outside"}}}function rl(e,t){if(t<=7)return Array.from({length:t},(r,a)=>a+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let r=o;r<=i;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function il(e){var s;let{total:t,color:n="neutral",accentColor:o="primary"}=e,i=g((s=e.value)!=null?s:1),r={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>c(6+b(u)*2),height:u=>c(6+b(u)*2),paddingInline:u=>c(b(u)*2),borderRadius:u=>c(b(u)*1.5),border:"none",cursor:"pointer",fontSize:u=>x(u,"inherit"),backgroundColor:"transparent",color:u=>l(u,"text",n),transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{backgroundColor:u=>l(u,"hover",n)},"&:focus-visible":{boxShadow:u=>$(u,o)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=Me(N({},r),{backgroundColor:u=>l(u,"shift-6",o),color:u=>l(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-6",o)}});return{role:"navigation",ariaLabel:"Pagination",_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let h={div:m=>{let d=i.get(m),p=[];p.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:r});let v=0;for(let f of rl(d,t))if(f==="...")p.push({span:"\u2026",_key:`ellipsis-${v++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:y=>c(b(y)*2),color:y=>l(y,"shift-7",n)}});else{let y=f===d;p.push({button:String(f),_key:`page-${f}`,type:"button",ariaLabel:`Page ${f}`,ariaCurrent:y?"page":void 0,disabled:y,onClick:()=>i.set(f),style:y?a:r})}return p.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:r}),p},style:{display:"flex",alignItems:"center",gap:c(1)}};u.children.insert(h)},style:{display:"inline-flex"}}}function al(e={}){var i;let{padding:t=4,divider:n=!1}=e,o=g((i=e.color)!=null?i:"neutral","color");return{style:N({padding:r=>c(b(r)*t)},n?{borderBottom:r=>`1px solid ${l(r,"border",o.get(r))}`}:{})}}function ll(e={}){var n;let t=g((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=>x(o,"inherit"),color:o=>l(o,"text",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function sl(e){var p;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,i=null,r=g(t),a=g(n),{show:s,hide:u,anchorPartial:h}=ie({kind:"popover",open:r,placement:a,content:e.content,keepOpenOnContentHover:o==="hover"}),m={role:"dialog",dataTone:"shift-14",style:{backgroundColor:v=>l(v,"inherit"),borderRadius:v=>c(b(v)*2),outline:v=>`1px solid ${l(v,"border-strong")}`,outlineOffset:"-1px",boxShadow:A("medium")},_onInsert:v=>{let f=v.attributes.get("id");i=f||v.nodeId,!f&&v.attributes.set("id",i)}};return(p=e.content).$||(p.$=[]),e.content.$.push(m),I(h,{ariaHaspopup:"dialog",ariaExpanded:v=>r.get(v),onMouseEnter:(v,f)=>o==="hover"&&s(f),onMouseLeave:(v,f)=>o==="hover"&&u(f),onClick:(v,f)=>{o==="click"&&(r.get()?u(f):s(f))},onKeyDown:(v,f)=>{v.key==="Escape"&&r.get()&&u(f)},onFocus:(v,f)=>o==="hover"&&s(f),onBlur:(v,f)=>{let y=v.relatedTarget,S=f.getRoot().domElement,C=i?S.querySelector(`#${CSS.escape(i)}`):null;y&&(C!=null&&C.contains(y))||u(f)},_onMount:v=>i&&v.attributes.set("ariaControls",i)}),h}function uo(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=c(6),bordered:i=!0}=e,r=g(t),a={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"},s=m=>{var d;return(d=a[r.get(m)])!=null?d:a["bottom-end"]},u=m=>m.includes("start")?o:m.includes("end")?"auto":"50%",h=m=>m.includes("end")?o:m.includes("start")?"auto":"50%";return{style:{fontSize:m=>x(m),backgroundColor:m=>l(m),color:m=>l(m,"text",n),position:"relative","&::after":{content:'""',position:"absolute",width:c(1.5),height:c(1.5),backgroundColor:m=>l(m,"inherit",n),borderWidth:i?"1px":0,borderColor:m=>l(m,"inherit",n),borderTopStyle:m=>{let d=s(m);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:m=>{let d=s(m);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:m=>{let d=s(m);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:m=>{let d=s(m);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:m=>{let d=s(m);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:m=>{let d=s(m);return d.includes("right")?0:d.includes("left")?"auto":h(d)},bottom:m=>{let d=s(m);return d.includes("bottom")?0:d.includes("top")?"auto":h(d)},left:m=>{let d=s(m);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:m=>{let d=s(m),p=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",v=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${p},${v}) rotate(45deg)`}}}}}function cl(e={}){var n;let t=g((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=>x(o,"inherit"),color:o=>l(o,"text",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>c(b(o)*2),paddingInline:o=>c(b(o)*3),borderRadius:o=>c(b(o)*2)}}}function ul(e={}){var o,i;let t=g((o=e.color)!=null?o:"neutral","color"),n=g((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:c(2),border:0,borderRadius:c(999),overflow:"hidden",backgroundColor:r=>l(r,"shift-3",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>l(r,"shift-3",t.get(r)),borderRadius:c(999)},"&::-webkit-progress-value":{backgroundColor:r=>l(r,"shift-9",n.get(r)),borderRadius:c(999),transition:"width 220ms ease"}}}}var ml='<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>',hl='<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 dl(e={}){var u,h;let{max:t=5,readOnly:n=!1,onChange:o}=e,i=(u=e.color)!=null?u:"warning",r=g((h=e.value)!=null?h:0),a=g(0),s=m=>{let d=a.get(m);return d>0?d:r.get(m)};return{role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:c(.5),fontSize:"1.5rem",cursor:n?"default":"pointer",color:m=>l(m,"muted",i)},_onInit:m=>{for(let d=1;d<=t;d++){let p=d,v=n?{}:{onClick:()=>{let y=p===r.get()?0:p;r.set(y),o==null||o(y),a.set(0)},onMouseEnter:()=>a.set(p),onMouseLeave:()=>a.set(0),onKeyDown:y=>{var w,O;let S=r.get(),C=S;if(y.key==="ArrowRight"||y.key==="ArrowUp")C=Math.min(t,S+1),y.preventDefault();else if(y.key==="ArrowLeft"||y.key==="ArrowDown")C=Math.max(0,S-1),y.preventDefault();else return;r.set(C),o==null||o(C);let E=C>0?C-1:0;(O=(w=m.domElement)==null?void 0:w.children[E])==null||O.focus()}},f=Me(N({button:y=>p<=s(y)?ml:hl,_key:p,type:"button",ariaLabel:`${p} star${p>1?"s":""}`},v),{style:{background:"none",border:"none",outline:"none",borderRadius:c(1),padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center",transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:y=>$(y,i)}}});m.children.insert(f)}}}}function fl(e={}){var u,h,m;let{size:t=16,thickness:n=.25}=e,o=g((u=e.value)!=null?u:0,"value"),i=g((h=e.color)!=null?h:"primary","color"),r=g((m=e.trackColor)!=null?m:"neutral","trackColor"),a=Math.round((1-n)*100),s=`radial-gradient(circle closest-side, transparent ${a}%, black ${a}%)`;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:c(t),height:c(t),borderRadius:"50%",background:d=>`conic-gradient(from -90deg, ${l(d,"shift-9",i.get(d))} ${o.get(d)}%, ${l(d,"shift-3",r.get(d))} 0%)`,WebkitMask:s,mask:s}}}function mo(e={}){let{gap:t=4,align:n="center",justify:o,wrap:i=!1}=e;return{style:N(N({display:"flex",alignItems:n,gap:r=>c(b(r)*t)},o?{justifyContent:o}:{}),i?{flexWrap:"wrap"}:{})}}function pl(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{style:{overflow:"auto","&::-webkit-scrollbar":{width:c(2),height:c(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>l(o,"shift-5",t.get(o)),borderRadius:c(999),border:`${c(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>l(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${l(o,"shift-5",t.get(o))} transparent`}}}function gl(e={items:[]}){var r,a,s;let{items:t=[],color:n="neutral",accentColor:o="primary"}=e,i=g((s=(a=e.value)!=null?a:(r=t[0])==null?void 0:r.key)!=null?s:"");return{role:"radiogroup",_context:{segmented:{value:i}},_onSchedule:(u,h)=>{let m=t.map((d,p)=>{var y;let v=(y=d.key)!=null?y:String(p);return{button:[typeof d.label=="string"?{span:d.label}:d.label],_key:v,type:"button",role:"radio",ariaChecked:S=>i.get(S)===v,onClick:()=>i.set(v),style:{cursor:"pointer",fontSize:S=>x(S,"inherit"),height:c(6),paddingBlock:c(1),paddingInline:c(3),border:"none",borderRadius:c(10),color:S=>l(S,"text",n),backgroundColor:"transparent",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:S=>l(S,"shift-3",n)},"&[aria-checked=true]":{backgroundColor:S=>l(S,"shift-0",o),color:S=>l(S,"shift-10",o)},"&:focus-visible":{boxShadow:S=>$(S,o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}});h[u.tagName]=m},style:{display:"inline-flex",paddingBlock:c(1),paddingInline:c(1),gap:c(.5),borderRadius:c(10),backgroundColor:u=>l(u,"shift-2",n)}}}function yl(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=>x(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"text",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"border-strong",t)}`,borderRadius:o=>c(b(o)*1.5),paddingBlock:o=>c(b(o)*1),paddingLeft:o=>c(b(o)*3),paddingRight:o=>c(b(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Zt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${c(2)} center`,backgroundSize:`${c(2.5)} ${c(1.5)}`,transition:"outline-color 140ms ease, box-shadow 140ms ease","&:not([multiple])":{height:o=>c(6+b(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`1px solid ${l(o,"shift-5",n)}`},"&:focus-visible":{boxShadow:o=>$(o,n)},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"muted","neutral"),outline:o=>`1px solid ${l(o,"border-strong","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function bl(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=e,a=g(e.value),s=g(i),{show:u,hide:h,anchorPartial:m}=ie({kind:"selectBox",open:s,placement:g(n),content:e.content}),d={onClick:(f,y)=>!r&&h(y),dataTone:"shift-14",style:{backgroundColor:f=>l(f,"inherit"),borderRadius:f=>c(b(f)*2),outline:f=>`1px solid ${l(f,"border-strong")}`,outlineOffset:"-1px",boxShadow:A("medium")}};I(e.content,d);let p={div:f=>{let y=a.get(f),S=Array.isArray(y)?y:[y];return t.filter(E=>S.includes(E.value)).map(E=>({span:E.label,$:[Ge({color:o,removable:r})],_key:E.value,_onRemove:w=>{let O=a.get(),_=(Array.isArray(O)?O:[O]).filter(D=>D!==E.value);r?a.set(_):a.set(_[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:c(1),flex:1}},v={_onInsert:f=>{f.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:f=>f.children.insert(p),onClick:(f,y)=>s.get()?h(y):u(y),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:f=>c(6+b(f)*2),minWidth:c(32),outlineOffset:"-1px",outline:f=>`1px solid ${l(f,"border-strong","neutral")}`,paddingInline:f=>c(b(f)*2),borderRadius:f=>c(b(f)*1.5),fontSize:f=>x(f,"inherit"),color:f=>l(f,"text",o),backgroundColor:f=>l(f,"inherit",o)}};return I(m,v),m}function vl(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag');let a=r.getContext("select");if(a){let s=a.value;r.attributes.set("ariaSelected",u=>{let h=s.get(u);return a.multiple?h.includes(o):h===o}),r.addEvent("click",()=>{let u=s.get();a.multiple?u.includes(o)?s.set(u.filter(h=>h!==o)):s.set(u.concat([o])):u!==o&&s.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>x(r,"inherit"),height:r=>c(6+b(r)*2),paddingInline:r=>c(b(r)*3),border:"none",outline:"none",color:r=>l(r,"text",n),backgroundColor:r=>l(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>l(r,"hover",n)},"&[aria-selected=true]":{backgroundColor:r=>l(r,"shift-6",t),color:r=>l(r,"shift-11")},"&:focus-visible":{outline:r=>`${c(.5)} solid ${l(r,"shift-6",t)}`,outlineOffset:`-${c(.5)}`}}}}function Sl(e={}){var a;let{color:t="neutral",multiple:n=!1}=e,o=g((a=e.value)!=null?a:n?[]:null),i={div:s=>{let u=o.get(s);return(Array.isArray(u)?u:[u]).map(m=>({input:null,name:e.name,value:m==null?"":String(m)}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:n}},_onInit:s=>{s.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),s.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:s=>c(b(s)*2),paddingInline:s=>c(b(s)*2),fontSize:s=>x(s,"inherit"),backgroundColor:s=>l(s,"inherit",t)}}}function xl(e={}){var i;let t=g((i=e.color)!=null?i:"neutral","color"),n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=Le(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:r=>x(r),color:r=>l(r,"text",t.get(r)),height:c(6),display:"block",borderRadius:c(1),backgroundColor:r=>l(r,"inherit",t.get(r)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function wl(e={}){var n;let t=g((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=>x(o,"inherit"),color:o=>l(o,"text",t.get(o))}}}var Vn={to:{transform:"rotate(360deg)"}},An=Le(JSON.stringify(Vn));function Cl(e={}){var n;let t=g((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=>x(o),backgroundColor:o=>l(o),color:o=>l(o,"text",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:c(6),height:c(6),borderRadius:"50%",border:o=>`${c(.5)} solid ${l(o,"border-strong",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${An} 0.7s linear infinite`,[`@keyframes ${An}`]:Vn}}}function kl(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:i=90}=e;return{_onSchedule:(r,a)=>{I(a,{_context:{splitter:{direction:t,size:g(n),min:o,max:i,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function El(){return{_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",i=t.panelCount++===0,r=s=>{n.style[o]=`${i?s:100-s}%`};r(t.size.get()),n.style.flexShrink="0",n.style.overflow="auto";let a=t.size.addListener(r);e.addHook("Remove",a)}}}function _l(){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 i=t.size.addListener(u=>{n.setAttribute("aria-valuenow",String(Math.round(u)))}),r=u=>{let h=u.shiftKey?10:1,m=null;o?u.key==="ArrowRight"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowLeft"&&(m=Math.max(t.size.get()-h,t.min)):u.key==="ArrowDown"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowUp"&&(m=Math.max(t.size.get()-h,t.min)),u.key==="Home"?m=t.min:u.key==="End"&&(m=t.max),m!==null&&(u.preventDefault(),t.size.set(m))},a=null,s=u=>{u.preventDefault();let h=n.parentElement,m=p=>{let v=h.getBoundingClientRect(),f=o?(p.clientX-v.left)/v.width*100:(p.clientY-v.top)/v.height*100;t.size.set(Math.min(Math.max(f,t.min),t.max))},d=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null};a=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null},document.addEventListener("mousemove",m),document.addEventListener("mouseup",d)};n.addEventListener("keydown",r),n.addEventListener("mousedown",s),e.addHook("Remove",()=>{a==null||a(),i(),n.removeEventListener("keydown",r),n.removeEventListener("mousedown",s)})},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&:focus-visible":{outline:e=>`2px solid ${l(e,"shift-6")}`,outlineOffset:"2px"},"&::after":{content:'""',width:c(1),height:c(1),borderRadius:c(999),backgroundColor:e=>l(e,"shift-4")}}}}function Tl(e={}){let{gap:t=3,align:n}=e;return{style:N({display:"flex",flexDirection:"column",gap:o=>c(b(o)*t)},n?{alignItems:n}:{})}}function Ol(e={items:[]}){var a;let{items:t=[],direction:n="horizontal",color:o="neutral",accentColor:i="primary"}=e,r=g((a=e.current)!=null?a:0);return{_context:{steps:{current:r,direction:n,color:o,accentColor:i}},_onSchedule:(s,u)=>{let h=t.map((m,d)=>{var v;return{li:[typeof m.label=="string"?{span:m.label}:m.label],_key:(v=m.key)!=null?v:d,dataStep:String(d+1),dataStatus:f=>{let y=r.get(f);return d<y?"done":d===y?"active":"pending"},ariaCurrent:f=>r.get(f)===d?"step":void 0,style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:c(1),flex:"1",fontSize:f=>x(f,"decrease-1"),textAlign:"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:c(6),height:c(6),borderRadius:c(999),fontSize:f=>x(f,"decrease-1"),fontWeight:"600",flexShrink:"0",border:f=>`2px solid ${l(f,"border-strong",o)}`,backgroundColor:f=>l(f,"inherit"),color:f=>l(f,"muted"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"},"&:not(:first-child)::after":{content:'""',position:"absolute",top:c(3),right:`calc(50% + ${c(3)})`,left:`calc(-50% + ${c(3)})`,height:"2px",backgroundColor:f=>l(f,"shift-3",o),zIndex:"0"},"&[data-status=active]::before":{backgroundColor:f=>l(f,"shift-6",i),borderColor:f=>l(f,"shift-6",i),color:f=>l(f,"shift-15",i)},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:f=>l(f,"shift-3",o),borderColor:f=>l(f,"border",o),color:f=>l(f,"text",o)},"&[data-status=done]:not(:first-child)::after":{backgroundColor:f=>l(f,"shift-3",o)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:f=>l(f,"shift-6",i)},"&[data-status=pending]":{color:f=>l(f,"shift-7")},"&[data-status=active]":{color:f=>l(f,"shift-10"),fontWeight:"600"},"&[data-status=done]":{color:f=>l(f,"muted")}}}});u[s.tagName]=h},style:{display:"flex",flexDirection:n==="vertical"?"column":"row",alignItems:n==="vertical"?"flex-start":"center",gap:c(2),listStyle:"none",margin:"0",padding:"0"}}}function Ml(e={}){var n;let t=g((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=>x(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Pl(e={}){var n;let t=g((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=>x(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"text",t.get(o))}}}function Dl(e={}){var n;let t=g((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=>x(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"text",t.get(o))}}}function Ll(e={}){var n;let t=g((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>x(o,"inherit"),color:o=>l(o,"text",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>c(b(o)*3),paddingBlock:o=>c(b(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>c(b(o)*3),paddingBlock:o=>c(b(o)*1),color:o=>l(o,"text",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-3",t.get(o))}`,fontSize:o=>x(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>c(b(o)*3),paddingBlock:o=>c(b(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>l(o,"hover")}}}}function Rl(e={items:[]}){var r,a,s;let{items:t=[],accentColor:n="primary",color:o="neutral"}=e,i=g((s=(a=e.activeKey)!=null?a:(r=t[0])==null?void 0:r.key)!=null?s:0);return{_onSchedule:(u,h)=>{let m=u.nodeId,p={div:t.map((f,y)=>{var E;let S=(E=f.key)!=null?E:y;return{button:[typeof f.label=="string"?{span:f.label}:f.label],_key:S,type:"button",role:"tab",id:`tab${m}${S}`,ariaControls:`panel${m}${S}`,ariaSelected:w=>i.get(w)===S,onClick:()=>i.set(S),onKeyDown:w=>{let O=w.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(O))return;w.preventDefault();let M=t.map((B,H)=>{var j;return(j=B.key)!=null?j:H}),_=M.indexOf(S),D=_;O==="ArrowRight"?D=(_+1)%M.length:O==="ArrowLeft"?D=(_-1+M.length)%M.length:O==="Home"?D=0:O==="End"&&(D=M.length-1),i.set(M[D])},style:{cursor:"pointer",fontSize:w=>x(w,"inherit"),height:w=>c(6+b(w)*2),paddingInline:w=>c(b(w)*4),border:"none",outline:"none",color:w=>l(w,"text"),backgroundColor:w=>l(w,"inherit"),boxShadow:w=>`inset 0 -${c(.5)} 0 0 ${l(w,"shift-1",o)}`,transition:"box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled])":{boxShadow:w=>`inset 0 -${c(.5)} 0 0 ${l(w,"shift-2",o)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:w=>`inset 0 -${c(.5)} 0 0 ${l(w,"shift-6",n)}`},"&:focus-visible":{boxShadow:w=>$(w,n)}}}}),role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},v=t.map((f,y)=>{var C;let S=(C=f.key)!=null?C:y;return{div:[f.content],_key:S,role:"tabpanel",id:`panel${m}${S}`,ariaLabelledby:`tab${m}${S}`,hidden:E=>i.get(E)!==S,style:{paddingBlock:E=>c(b(E)*2),paddingInline:E=>c(b(E)*2)}}});h[u.tagName]=[p,...v]}}}function $l(e={}){var i,r;let t=g((i=e.color)!=null?i:"neutral","color"),n=g((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:a=>{a.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:a=>{if(o){let s=a.domElement;s.style.overflow="hidden";let u=()=>{s.style.height="auto",s.style.height=`${s.scrollHeight}px`};s.addEventListener("input",u),u(),a.addHook("Remove",()=>s.removeEventListener("input",u))}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>c(b(a)*2),paddingBlock:a=>c(b(a)*1.5),border:"none",borderRadius:a=>c(b(a)*1.5),fontSize:a=>x(a,"inherit"),color:a=>l(a,"text",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"border-strong",t.get(a))}`,backgroundColor:a=>l(a,"inherit",t.get(a)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:a=>l(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`1px solid ${l(a,"shift-5",n.get(a))}`},"&:focus-visible":{boxShadow:a=>$(a,n.get(a))},"&:invalid":{outline:a=>`${c(.5)} solid ${l(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"muted","neutral"),outline:a=>`1px solid ${l(a,"border-strong","neutral")}`,backgroundColor:a=>l(a,"shift-2","neutral")}}}}function Il(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function zl(e={}){var r,a,s;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(a=e.accentColor)!=null?a:"primary",i=g((s=e.active)!=null?s:!1);return{style:N({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>c(b(u)*2),paddingBottom:u=>t?"0":c(b(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:"0.25em",transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>l(u,"shift-8",i.get(u)?o:n),opacity:u=>i.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>`-${c(b(u)*4)}`,width:"2px",backgroundColor:u=>l(u,"shift-3",n)}})}}function Al(e={}){let{position:t="top-center",color:n="neutral"}=e,o=g(!1),i=t.startsWith("top"),r=t.endsWith("center"),a=t.endsWith("right"),s={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:r?"center":a?"end":"start",inset:0,gap:c(4),zIndex:30,padding:c(6),pointerEvents:"none"}};return{_portal:u=>{let h=u.domElement.querySelector(`#domphy-toast-${t}`);return h||(h=u.children.insert(s).domElement),h},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:c(32),pointerEvents:"auto",paddingBlock:u=>c(b(u)*2),paddingInline:u=>c(b(u)*4),borderRadius:u=>c(b(u)*2),fontSize:u=>x(u,"inherit"),color:u=>l(u,"text",n),backgroundColor:u=>l(u,"inherit",n),boxShadow:A("medium"),opacity:u=>Number(o.get(u)),transform:u=>o.get(u)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(u,h)=>{let m=!1,d=null,p=()=>{m||(m=!0,d&&(clearTimeout(d),d=null),u.domElement.removeEventListener("transitionend",v),h())},v=f=>{f.propertyName==="transform"&&p()};u.domElement.addEventListener("transitionend",v),d=setTimeout(p,350),u.addHook("Remove",()=>{var f;d&&(clearTimeout(d),d=null),(f=u.domElement)==null||f.removeEventListener("transitionend",v)}),o.set(!1)}}}function Vl(e={items:[]}){var a;let{items:t=[],multiple:n=!1,color:o="neutral",accentColor:i="primary"}=e,r=g((a=e.value)!=null?a:n?[]:"");return{role:"group",_context:{toggleGroup:{value:r,multiple:n}},_onSchedule:(s,u)=>{let h=t.map((m,d)=>{var f;let p=(f=m.key)!=null?f:String(d);return{button:[typeof m.label=="string"?{span:m.label}:m.label],_key:p,type:"button",role:"button",ariaPressed:y=>{let S=r.get(y);return Array.isArray(S)?S.includes(p):S===p},onClick:()=>{let y=r.get();if(n){let S=Array.isArray(y)?[...y]:[];r.set(S.includes(p)?S.filter(C=>C!==p):[...S,p])}else r.set(y===p?"":p)},style:{cursor:"pointer",fontSize:y=>x(y,"inherit"),height:c(6),paddingBlock:c(1),paddingInline:c(2),border:"none",borderRadius:c(1.5),color:y=>l(y,"text",o),backgroundColor:y=>l(y,"inherit",o),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{backgroundColor:y=>l(y,"hover",o)},"&[aria-pressed=true]":{backgroundColor:y=>l(y,"shift-3",i),color:y=>l(y,"shift-12",i)},"&:focus-visible":{boxShadow:y=>$(y,i)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}});u[s.tagName]=h},style:{display:"flex",paddingBlock:c(1),paddingInline:c(1),gap:c(1),borderRadius:c(2),fontSize:s=>x(s,"inherit"),backgroundColor:s=>l(s,"inherit",o),outline:s=>`1px solid ${l(s,"border",o)}`,outlineOffset:"-1px"}}}function Bl(e={}){return mo({gap:e.gap})}function Nl(){return{div:null,style:{flex:"1 1 0"}}}function Hl(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content"}=e,i=g(n),r=g(o),a=`domphy-tt-${Math.random().toString(36).slice(2,9)}`,s={span:v=>r.get(v),id:a},{show:u,hide:h,anchorPartial:m}=ie({kind:"tooltip",open:t,placement:i,content:s}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:v=>c(b(v)*1),paddingInline:v=>c(b(v)*3),borderRadius:v=>c(b(v)*1.5),color:v=>l(v,"text"),backgroundColor:v=>l(v),fontSize:v=>x(v,"inherit"),boxShadow:A("low")},$:[uo({placement:i,bordered:!1})]};return s.$||(s.$=[]),s.$.push(d),I(m,{ariaDescribedby:a,onMouseEnter:(v,f)=>u(f),onMouseLeave:(v,f)=>h(f),onFocus:(v,f)=>u(f),onBlur:(v,f)=>h(f),onKeyDown:(v,f)=>v.key==="Escape"&&h(f)}),m}function Bn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function jl(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,i=new Map,r=new Set,a=new Set;return{_onMount:s=>{s.addHook("Remove",()=>{for(let u of Array.from(i.values()))u();i.clear();for(let u of r)clearTimeout(u);r.clear();for(let u of a)cancelAnimationFrame(u);a.clear()})},_onBeforeUpdate:s=>{o=new Map,s.children.items.forEach((u,h)=>{if(!(u instanceof U))return;let m=u.domElement;m&&o.set(Bn(u,h),m.getBoundingClientRect())})},_onUpdate:s=>{s.children.items.forEach((u,h)=>{var M;if(!(u instanceof U))return;let m=u.domElement;if(!m)return;let d=Bn(u,h),p=o.get(d);if(!p)return;let v=m.getBoundingClientRect(),f=p.left-v.left,y=p.top-v.top;if(Math.abs(f)<.5&&Math.abs(y)<.5)return;(M=i.get(m))==null||M(),m.style.transition="none",m.style.transform=`translate(${f}px, ${y}px)`,m.getBoundingClientRect();let S=requestAnimationFrame(()=>{a.delete(S),m.style.transition=`transform ${t}ms ease ${n}ms`,m.style.transform="translate(0px, 0px)"});a.add(S);let C=!1,E=null,w=()=>{C||(C=!0,E&&(r.delete(E),E=null),i.delete(m),m.removeEventListener("transitionend",O),m.style.transition="",m.style.transform="")},O=_=>{_.propertyName==="transform"&&w()};i.set(m,()=>{C=!0,E&&(clearTimeout(E),r.delete(E),E=null),i.delete(m),m.removeEventListener("transitionend",O)}),m.addEventListener("transitionend",O),E=setTimeout(w,t+n+34),r.add(E)}),o.clear()}}}function Fl(e={}){var n;let t=g((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=>x(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:c(3),listStyleType:"disc",listStylePosition:"outside"}}}return nr(Wl);})();
6
6
  //# sourceMappingURL=core-theme-ui.global.js.map