@domphy/ui 0.21.5 → 0.21.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/core-theme-ui.global.js +5 -5
- package/dist/core-theme-ui.global.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var Domphy=(()=>{var wt=Object.defineProperty,Yr=Object.defineProperties,Xr=Object.getOwnPropertyDescriptor,Jr=Object.getOwnPropertyDescriptors,Zr=Object.getOwnPropertyNames,tn=Object.getOwnPropertySymbols;var nn=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable;var on=(e,t,n)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))nn.call(t,n)&&on(e,n,t[n]);if(tn)for(var n of tn(t))Qr.call(t,n)&&on(e,n,t[n]);return e},N=(e,t)=>Yr(e,Jr(t));var Et=(e,t)=>{for(var n in t)wt(e,n,{get:t[n],enumerable:!0})},ei=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Zr(t))!nn.call(e,a)&&a!==n&&wt(e,a,{get:()=>t[a],enumerable:!(o=Xr(t,a))||o.enumerable});return e};var ti=e=>ei(wt({},"__esModule",{value:!0}),e);var Sc={};Et(Sc,{core:()=>Pt,theme:()=>At,ui:()=>Qt});var Pt={};Et(Pt,{AttributeList:()=>_n,BooleanAttributes:()=>ho,CamelAttributes:()=>mn,ElementList:()=>On,ElementNode:()=>J,HtmlAttributeNames:()=>no,HtmlTags:()=>dn,Notifier:()=>ct,PrefixCSS:()=>Le,RawHTML:()=>Dn,RecordState:()=>Pi,State:()=>ao,SvgTags:()=>hn,TextNode:()=>Tt,VoidTags:()=>Ct,_deliveringNotifier:()=>it,_microtask:()=>Ot,_resetKeylessWarnings:()=>xi,batch:()=>_i,behavior:()=>V,computed:()=>ki,configure:()=>ii,effect:()=>ut,effectScope:()=>Ci,flushPendingNotifiers:()=>bn,flushSync:()=>Mn,getConfig:()=>pn,hasPendingNotifiers:()=>yn,hashString:()=>Ke,isRawHTML:()=>st,isState:()=>le,merge:()=>K,nextTick:()=>Oi,peek:()=>ci,rawHtml:()=>Ie,readonly:()=>si,runBatched:()=>gn,sanitizeHTMLString:()=>_t,toState:()=>b,untrack:()=>Ti,watch:()=>Di});var oi=Object.defineProperty,rn=Object.getOwnPropertySymbols,ni=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable,an=(e,t,n)=>t in e?oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oo=(e,t)=>{for(var n in t||(t={}))ni.call(t,n)&&an(e,n,t[n]);if(rn)for(var n of rn(t))ri.call(t,n)&&an(e,n,t[n]);return e},ho=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","inert","download","noModule","paused","autoPictureInPicture"],mn=["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"],no={htmlFor:"for",allowFullScreen:"allowfullscreen",autoFocus:"autofocus",autoPlay:"autoplay",formNoValidate:"formnovalidate",isMap:"ismap",itemScope:"itemscope",noHref:"nohref",noShade:"noshade",noValidate:"novalidate",playsInline:"playsinline",trueSpeed:"truespeed",typeMustMatch:"typemustmatch",noModule:"nomodule",autoPictureInPicture:"autopictureinpicture",autoCapitalize:"autocapitalize",contentEditable:"contenteditable",spellCheck:"spellcheck",ariaActiveDescendant:"aria-activedescendant",ariaColCount:"aria-colcount",ariaPosinSet:"aria-posinset",ariaSetSize:"aria-setsize",accessKey:"accesskey",enterKeyHint:"enterkeyhint",inputMode:"inputmode",itemId:"itemid",itemProp:"itemprop",itemRef:"itemref",itemType:"itemtype",tabIndex:"tabindex",writingSuggestions:"writingsuggestions",charSet:"charset",hrefLang:"hreflang",crossOrigin:"crossorigin",aLink:"alink",bgColor:"bgcolor",vLink:"vlink",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formTarget:"formtarget",popoverTarget:"popovertarget",popoverTargetAction:"popovertargetaction",allowPaymentRequest:"allowpaymentrequest",allowUserMedia:"allowusermedia",frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",referrerPolicy:"referrerpolicy",srcDoc:"srcdoc",hSpace:"hspace",fetchPriority:"fetchpriority",srcSet:"srcset",srcLang:"srclang",useMap:"usemap",vSpace:"vspace",dirName:"dirname",imageSizes:"imagesizes",imageSrcSet:"imagesrcset",classId:"classid",codeBase:"codebase",codeType:"codetype",valueType:"valuetype",shadowRootClonable:"shadowrootclonable",shadowRootDelegatesFocus:"shadowrootdelegatesfocus",shadowRootMode:"shadowrootmode",colSpan:"colspan",rowSpan:"rowspan",noWrap:"nowrap",vAlign:"valign",charOff:"charoff",maxLength:"maxlength",minLength:"minlength",autoComplete:"autocomplete",encType:"enctype",dateTime:"datetime"},dn=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],Le={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"]},hn=["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"],Ct=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],fn={};function ii(e){Object.assign(fn,e)}function pn(){return oo({},fn)}var ai=["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"],li=ai.reduce((e,t)=>{let n=t.slice(2).toLowerCase();return e[n]=t,e},{}),ge=[],Ot=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},ln=100,kt=0,ro=new Set,We=new Set,it=null;function gn(e){kt++;try{return e()}finally{if(kt--,kt===0){let t=ro;ro=new Set;for(let n of t)n._scheduleFlush()}}}var ct=class{constructor(){this._listeners=Object.create(null),this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let n=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(n)),n}removeListener(e,t){var n;if(!this._listeners)return;let o=this._listeners[e];o&&o.has(t)&&(o.delete(t),o.size===0&&(delete this._listeners[e],(n=this._onEmpty)==null||n.call(this,e)))}listenerCount(e){var t,n,o;return(o=(n=(t=this._listeners)==null?void 0:t[e])==null?void 0:n.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let n=ge.length?ge[ge.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>=ln){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${ln} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...ge]})}kt>0?ro.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,We.add(this),Ot(()=>this._flushAll()))}_isCircular(e){let t=ge.findIndex(([o,a])=>o===this&&a===e);if(t===-1)return!1;let n=[...ge.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
|
|
2
|
-
${n.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,We.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:n,chain:o}]of e)ge=o,this._flush(t,n);ge=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let n=this._listeners[e];if(!n)return;ge.push([this,e]),this._flushing.set(e,t);let o=it;it=this;try{for(let a of[...n])if(n.has(a))try{a(...t)}catch(r){console.error(r)}}finally{it=o}this._flushing.delete(e),ge.pop()}};function
|
|
3
|
-
`)}function hi(e){let t=di(e).replace(/[\x00-\x20]+/g,"").toLowerCase();return t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:text/html")||t.startsWith("data:application/xhtml+xml")}function fi(e){let t=e.toLowerCase(),n="",o=0;for(;o<e.length;){let a=t.indexOf("<",o);if(a===-1){n+=e.slice(o);break}n+=e.slice(o,a);let r=null,i=-1;for(let u=a+1;u<e.length;u++){let d=e[u];if(r)d===r&&(r=null);else if(d==='"'||d==="'")r=d;else if(d===">"){i=u;break}}if(i===-1){n+=e.slice(a);break}let l=e.slice(a,i+1);if(/^<script[\s/>]/i.test(l)){if(/\/\s*>$/.test(l)){o=i+1;continue}let u=t.indexOf("</script",i+1);if(u===-1){o=e.length;break}let d=e.indexOf(">",u);o=d===-1?e.length:d+1;continue}n+=l,o=i+1}return n}function _t(e){let t=fi(e);return t=t.replace(/\s+on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/((?:xlink:href|formaction|imagesrcset|srcset|poster|cite|background|ping|longdesc|codebase|classid|archive|icon|manifest|href|src|action|data)\s*=\s*)("([^"]*)"|'([^']*)'|([^\s>]*))/gi,(n,o,a,r,i,l)=>{var u,d;let s=(d=(u=r!=null?r:i)!=null?u:l)!=null?d:"";if(!hi(s))return n;let m=r!==void 0?'"':i!==void 0?"'":"";return`${o}${m}#${m}`}),t}function lo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var wn=new Set(dn);function En(e){return Object.keys(e).find(t=>wn.has(t))}function sn(e,t){if(Object.getPrototypeOf(e)!==Object.prototype)return Te(e);let n=new WeakMap,o={};for(let a of Reflect.ownKeys(e))o[a]=a===t?e[a]:Te(e[a],n);return o}function Cn(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function pi(e){if(e.indexOf("@")===0)return[e];for(var t=[],n=0,o=0,a="",r=0,i=e.length;r<i;r++){var l=e[r];if(l==="(")n+=1;else if(l===")")n-=1;else if(l==="[")o+=1;else if(l==="]")o-=1;else if(l===","&&!n&&!o){t.push(a.trim()),a="";continue}a+=l}return t.push(a.trim()),t}function 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 gi(e,t){for(let n=0;n<e.length;n++){let o=e[n],a=null;if(typeof o.selectorText=="string"?a=Dt(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(a=Dt(o.cssText.split("{")[0])),!a)continue;let r=t.get(a);r?r.push(o):t.set(a,[o])}return t}function kn(e,t){var n;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let a=t!=null?t:pn().cspNonce;a&&(o.nonce=a),e.appendChild(o)}return o.dataset.domphyBase!=="true"&&((n=o.sheet)==null||n.insertRule("[hidden] { display: none !important; }",0),o.dataset.domphyBase="true"),o}var so=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(n=>K(t,so(n))),delete e.$,K(t,e),t}else return e},yi={translate:["yes","no"],autoCapitalize:["on","off"],contentEditable:["true","false"],spellCheck:["true","false"]},bi=class{constructor(e,t,n){this.declaredValue=void 0,this._notifier=new ct,this._releases=[],this._removeHooked=!1,this._listenerReleases=[],this._listenerRemoveHooked=!1,this.parent=n,this.isBoolean=ho.includes(e),this.enumeratedBoolean=yi[e],mn.includes(e)?this.name=e:Object.hasOwn(no,e)?this.name=no[e]:this.name=Cn(e),this.value=void 0,this.set(t)}normalize(e){return this.enumeratedBoolean&&typeof e=="boolean"?e?this.enumeratedBoolean[0]:this.enumeratedBoolean[1]:e}resolve(e){return this.isBoolean&&typeof e!="string"?!!e:this.normalize(e)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value","checked","selected"];this.isBoolean?(this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value),t.includes(this.name)&&(e[this.name]=!!this.value)):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,n,o;let a=this.value;if(this.declaredValue=e,this._releases.length){for(let r of this._releases)r();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let r=()=>{var i;if(!(!this.parent||this.parent._disposed))try{let l=this.value;this.value=this.resolve(e(r)),this.render(),l!==this.value&&this._notifier.notify(this.name,this.value)}catch(l){(i=this.parent)==null||i._handleError(l)}};r.elementNode=this.parent,r.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(n=this.parent)==null?void 0:n.nodeId} attribute:${this.name}`,r.onSubscribe=i=>{this._releases.push(i),this.parent&&!this._removeHooked&&(this._removeHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let l of this._releases)l();this._releases=[],r=null}))};try{this.value=this.resolve(e(r))}catch(i){(o=this.parent)==null||o._handleError(i)}}else this.value=this.resolve(e);this.render(),a!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=n=>{this._listenerReleases.push(n),this.parent&&!this._listenerRemoveHooked&&(this._listenerRemoveHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let o of this._listenerReleases)o();this._listenerReleases=[]}))},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){for(let e of this._releases)e();this._releases=[];for(let e of this._listenerReleases)e();this._listenerReleases=[],this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t===!1||t==null?"":t===!0?e:`${e}="${lo(String(t))}"`;if(t==null)return"";let n=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${lo(String(n))}"`}},_n=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 bi(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(!ho.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,d)=>{let s=(u||"").split(" ").filter(m=>m);return!s.includes(d)&&s.push(d),s.join(" ")},a=(n=(t=this.items)==null?void 0:t.class)==null?void 0:n.declaredValue,r=typeof a=="function",i=r?a:this.get("class"),l=typeof e=="function";if(!r&&!l){this.set("class",o(i,e));return}this.set("class",u=>o(r?i(u):i,l?e(u):e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}};function vi(e){let t=String(e);return/[;}]|<\/style/i.test(t)?t.replace(/<\/style/gi,"\\3C /style").replace(/;/g,"\\3B ").replace(/}/g,"\\7D "):t}var Si=class{constructor(e,t,n){this.value="",this._releases=[],this._fn=null,this._bound=!1,this.name=e,this.cssName=e.startsWith("--")?e:Cn(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)),Le[this.name]&&Le[this.name].forEach(n=>{t.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){if(this._releases.length){for(let e of this._releases)e();this._releases=[]}this._fn=null,this._bound=!1,this.value="",this.parentRule=null}_bind(e){var t,n,o,a;let r=(()=>{var i;!this.parentRule||(i=this.parentRule.parentNode)!=null&&i._disposed||(this.value=e(r),this._domUpdate())});r.onSubscribe=i=>{this._releases.push(i)},r.elementNode=this.parentRule.root,r.debug=`class:${(n=(t=this.parentRule)==null?void 0:t.root)==null?void 0:n.tagName}_${(a=(o=this.parentRule)==null?void 0:o.root)==null?void 0:a.nodeId} style:${this.name}`,this.value=e(r),this._bound=!0}activate(){!this._fn||this._bound||(this._bind(this._fn),this._domUpdate())}set(e){var t,n;if(this._releases.length){for(let o of this._releases)o();this._releases=[]}if(this._bound=!1,this._fn=null,typeof e=="function")if(this._fn=e,(n=(t=this.parentRule)==null?void 0:t.parentNode)!=null&&n.domElement)this._bind(e);else{let o=(()=>{});o.elementNode=this.parentRule.root;let a=[];o.onSubscribe=r=>{a.push(r)},this.value=po(()=>e(o));for(let r of a)r()}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),Le[this.name]&&Le[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=vi(this.value),t=`${this.cssName}: ${e}`;return Le[this.name]&&Le[this.name].forEach(n=>{t+=`; -${n}-${this.cssName}: ${e}`}),t}},_e=class co{constructor(t,n){this.domRule=null,this._domIndex=-1,this.styleBlock={},this.selectorText=t,this.styleList=new Tn(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 co;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof co;)t=t.parent;return t}insertStyle(t,n){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(n):this.styleBlock[t]=new Si(t,n,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${t} ${n} } `}mount(t){if(!(!t||!this.styleList)){if(this.domRule=t,this.styleBlock)for(let n of Object.values(this.styleBlock))n.activate();"cssRules"in t&&this.styleList.mount(t.cssRules)}}remove(){let t=this.domRule,n=t==null?void 0:t.parentStyleSheet;if(t&&n){let o=n.cssRules,a=this._domIndex;if(a<0||a>=o.length||o[a]!==t){a=-1;for(let r=0;r<o.length;r++)if(o[r]===t){a=r;break}}a>=0&&n.deleteRule(a)}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let n=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length);this._domIndex=o;let a=t.cssRules[o];"cssRules"in a&&(this.mount(a),this.styleList.render(a))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let r=t.cssRules[a];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let r=t.cssRules[a];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Tn=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof _e;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let n={},o=[];function a(r,i){return r.startsWith("&")?`${i}${r.slice(1)}`:`${i} ${r}`}for(let r in e){let i=e[r],l=pi(r);for(let u of l){let d=a(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof i=="object"&&i!=null){let s=new _e(u,this.parent);s.styleList.addCSS(i,t),o.push(s)}}else if(u.startsWith("@keyframes")){let s=new _e(u,this.parent);s.styleList.addCSS(i,""),this.items.push(s)}else if(u.startsWith("@font-face")){let s=new _e(u,this.parent);for(let m in i)s.insertStyle(m,i[m]);this.items.push(s)}else if(typeof i=="object"&&i!=null){let s=new _e(d,this.parent);this.items.push(s);for(let[m,f]of Object.entries(i))if(typeof f=="object"&&f!=null){let p=a(m,d);this.addCSS(f,p)}else s.insertStyle(m,f)}else n[u]=i}}if(Object.keys(n).length){let r=new _e(t,this.parent);for(let i in n)r.insertStyle(i,n[i]);this.items.push(r)}for(let r of o)this.items.push(r)}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}patchCSS(e,t=""){var n;if(!this.items||!this.parent)return;let o={};for(let l in e){let u=e[l];typeof u=="object"&&u!=null||(o[l]=u)}let a=this.items.find(l=>l.selectorText===t);if(!a){if(Object.keys(o).length===0)return;a=new _e(t,this.parent),this.items.push(a)}let r=new Set(Object.keys(o));for(let l in o)a.insertStyle(l,o[l]);if(a.styleBlock)for(let l of Object.keys(a.styleBlock))r.has(l)||a.removeStyle(l);let i=(n=this.domStyle)==null?void 0:n.sheet;!a.domRule&&i&&a.render(i)}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(n=>n.selectorText===e);return t||(t=new _e(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,a)=>{let r=a-t,i=e[r];i&&(o.selectorText.startsWith("@")&&i instanceof CSSKeyframesRule||"keyText"in i?o.mount(i):"selectorText"in i?i.selectorText!==n(o.selectorText)?t+=1:o.mount(i):"cssRules"in i&&o.mount(i))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}};function cn(e){console.warn(`[Domphy] <${e}> is a void element and cannot have children \u2014 SSR output omits the declared content while the client renders it, so hydration drifts. Remove the content or use a non-void tag.`)}var J=class Fe{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 On(this),this.styles=new Tn(this),this.attributes=new _n(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null,this._descriptor=null;var a,r;xn(t),this._descriptor=t,this.parent=n,this.tagName=En(t);let i=sn(t,this.tagName);i.style=i.style||{},i=so(i),this.key=(a=i._key)!=null?a:null,this._context=i._context||{},this._metadata=i._metadata||{};let l=`${(r=this.parent)==null?void 0:r.nodeId}.${o}`,u=Object.keys(i.style).length?JSON.stringify(i.style,(s,m)=>typeof m=="function"?l:m):"";this.nodeId=Ke(l+u),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),i._onSchedule&&i._onSchedule(this,i),this.merge(i);let d=i[this.tagName];ue&&d!=null&&d!==""&&Ct.includes(this.tagName)&&cn(this.tagName),d!=null&&(typeof d=="function"?this._setupFunctionChildren(d):this.children.update(Array.isArray(d)?d:[d])),this._hooks.Init&&this._hooks.Init(this)}_setupFunctionChildren(t){let n=()=>{if(!this._disposed)try{let a=t(n);this.children.update(Array.isArray(a)?a:[a])}catch(a){this._handleError(a)}};n.elementNode=this,n.debug=`class:${this.tagName}_${this.nodeId} children`;let o=[];n.onSubscribe=a=>{o.push(a),this._childrenRelease=()=>{for(let r of o)r();o.length=0,n=null},this._childrenReleaseHooked||(this._childrenReleaseHooked=!0,this.addHook("BeforeRemove",()=>{var r;(r=this._childrenRelease)==null||r.call(this),this._childrenRelease=void 0}))},n()}_createDOMNode(){let t=hn.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let n in this._events)this._bindEvent(n);return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let n=o=>{var a,r;return(r=(a=this._events)==null?void 0:a[t])==null?void 0:r.call(a,o,this)};this.domElement.addEventListener(t,n),this.addHook("BeforeRemove",o=>{var a;(a=o.domElement)==null||a.removeEventListener(t,n),n=null})}_dispose(){var t,n,o,a,r,i;if(!this._disposed){if(this._disposed=!0,!this._beforeRemoveFired){this._beforeRemoveFired=!0;try{(n=(t=this._hooks).BeforeRemove)==null||n.call(t,this,()=>{})}catch(l){this._handleError(l)}}try{(o=this._childrenRelease)==null||o.call(this)}catch(l){this._handleError(l)}this._childrenRelease=void 0;for(let l of this._behaviorInstances.values())try{(a=l.destroy)==null||a.call(l)}catch(u){this._handleError(u)}this._behaviorInstances.clear(),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(l=>l.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(r=this._hooks).Remove)==null||i.call(r,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this._descriptor=null,this.parent=null}}merge(t){K(this._context,t._context),K(this._metadata,t._metadata),this._processBehaviors(t._behaviors);let n=Object.keys(t);for(let o=0;o<n.length;o++){let a=n[o],r=t[a];["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName].includes(a)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(a)?this.addHook(a.substring(3),r):a.startsWith("on")?this.addEvent(a.substring(2).toLowerCase(),r):a==="_portal"?this._portal=r:a==="class"?(typeof r=="string"||typeof r=="function")&&this.attributes.addClass(r):this.attributes.set(a,r))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var n;if(t===this._descriptor)return;this._descriptor=t;let o=sn(t,this.tagName);o.style=o.style||{},o=so(o);let a=o[this.tagName];if(ue&&a!=null&&a!==""&&Ct.includes(this.tagName)&&cn(this.tagName),(n=this._childrenRelease)==null||n.call(this),this._childrenRelease=void 0,typeof a=="function")this._setupFunctionChildren(a);else if(a!=null){let s=Array.isArray(a)?a:[a];this.children.update(s,!!this.domElement,!0)}o._context&&K(this._context,o._context),o._metadata&&K(this._metadata,o._metadata),this._processBehaviors(o._behaviors,!0),this.styles.patchCSS(o.style||{},`.${this.tagName}_${this.nodeId}`);let r=`${this.tagName}_${this.nodeId}`,i=["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName],l=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],u=new Set(["class"]),d=null;this._events={};for(let s of Object.keys(o)){if(i.includes(s)||l.includes(s)||s==="_portal")continue;let m=o[s];s.startsWith("on")&&typeof m=="function"?this.addEvent(s.substring(2).toLowerCase(),m):s==="class"&&(typeof m=="string"||typeof m=="function")?d=m:(this.attributes.set(s,m),u.add(s))}if(typeof d=="function"){let s=d;this.attributes.set("class",m=>`${r} ${s(m)}`)}else this.attributes.set("class",d?`${r} ${d}`:r);if(this.attributes.items)for(let s of Object.keys(this.attributes.items))u.has(s)||this.attributes.remove(s);if(this._events)for(let s in this._events)this._bindEvent(s)}_handleError(t){let n=this;for(;n;){if(n._hooks.Error){let o=n;n._hooks.Error(o,t,()=>{o.children.update([])});return}n=n.parent}console.error("[Domphy] Unhandled error in reactive child:",t)}addEvent(t,n){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(a,r)=>{o(a,r),n(a,r)}:this._events[t]=n}addHook(t,n){let o=this._hooks[t];if(typeof o=="function"){let a=((...r)=>{let i;try{o(...r)}catch(l){i=l}try{n(...r)}catch(l){i===void 0?i=l:this._handleError(l)}if(i!==void 0)throw i});try{Object.defineProperty(a,"length",{value:Math.max(o.length,n.length),configurable:!0})}catch(r){}this._hooks[t]=a}else this._hooks[t]=n}getRoot(){let t=this;for(;t&&t instanceof Fe&&t.parent;)t=t.parent;return t}_processBehaviors(t,n=!1){var o,a;if(!t&&!n)return;let r=t!=null?t:{};for(let i of Object.keys(r)){let l=r[i],u=this._behaviorInstances.get(i);u?(o=u.update)==null||o.call(u,l.props):this.domElement?this._attachBehaviorNow(i,l):(this._pendingBehaviors.set(i,l),this._ensureBehaviorMountHook())}if(n){for(let i of[...this._behaviorInstances.keys()]){if(Object.hasOwn(r,i))continue;let l=this._behaviorInstances.get(i);this._behaviorInstances.delete(i);try{(a=l==null?void 0:l.destroy)==null||a.call(l)}catch(u){this._handleError(u)}}for(let i of[...this._pendingBehaviors.keys()])Object.hasOwn(r,i)||this._pendingBehaviors.delete(i)}}_attachBehaviorNow(t,n){try{let o=n.attach(this,n.props)||{};this._behaviorInstances.set(t,o),this._ensureBehaviorTeardownHook()}catch(o){this._handleError(o)}}_ensureBehaviorMountHook(){this._behaviorMountHooked||(this._behaviorMountHooked=!0,this.addHook("Mount",()=>{if(this._pendingBehaviors.size===0)return;let t=this._pendingBehaviors;this._pendingBehaviors=new Map,t.forEach((n,o)=>this._attachBehaviorNow(o,n))}))}_ensureBehaviorTeardownHook(){this._behaviorTeardownHooked||(this._behaviorTeardownHooked=!0,this.addHook("BeforeRemove",()=>{var t;for(let n of this._behaviorInstances.values())try{(t=n.destroy)==null||t.call(n)}catch(o){this._handleError(o)}this._behaviorInstances.clear()}))}getBehavior(t){let n=this;for(;n;){let o=n._behaviorInstances.get(t);if(o)return o;n=n.parent}}getContext(t){let n=this;for(;n&&(!n._context||!Object.hasOwn(n._context,t));)n=n.parent;return n&&n._context?n._context[t]:void 0}setContext(t,n){this._context=this._context||{},this._context[t]=n}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,n){this._metadata=this._metadata||{},this._metadata[t]=n}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(n=>n instanceof Fe?n.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(Ct.includes(this.tagName))return`<${this.tagName}${t}>`;let n=this.children.generateHTML();return`<${this.tagName}${t}>${n}</${this.tagName}>`}mount(t,n){if(!t)throw new Error("Missing dom node on bind");if(ue&&this.parent===null&&t.tagName&&t.tagName.toLowerCase()!==this.tagName&&console.warn(`[Domphy] Hydration mismatch at mount root: expected <${this.tagName}> but found <${t.tagName.toLowerCase()}>. The server-rendered DOM does not match the client tree \u2014 check that mount() receives the element generated for THIS component.`),ue&&!n&&this.parent===null&&t.childNodes.length>0&&console.warn("[Domphy] mount() was called without a style element on already-rendered DOM. Reactive style updates after hydration will be dropped \u2014 pass the server-rendered <style> element as the second argument to mount()."),this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children){let o=0;this.children.items.forEach((a,r)=>{let i=t.childNodes[o];if(a instanceof Fe){if(o++,!i)return;ue&&this._devCheckHydrationMatch(a,i,r),a.mount(i)}else if(a.html){let l=a._domSpan();if(i){a.domText=i,a._domExtras=[];for(let u=1;u<l;u++){let d=t.childNodes[o+u];d&&a._domExtras.push(d)}}o+=l}else i?(ue&&i.nodeType!==3&&console.warn(`[Domphy] Hydration mismatch at <${this.tagName}> child ${r}: expected a text node ("${a.text.slice(0,40)}") but found ${i.nodeType===1?`<${i.tagName.toLowerCase()}>`:`node type ${i.nodeType}`}. The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.`),a.domText=i,o++):this.tagName==="textarea"?a.render(t):o++})}if(n){let o=n.sheet;o&&this._hydrateStyles(gi(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_devCheckHydrationMatch(t,n,o){var a,r,i,l;let u=`<${this.tagName}> child ${o}`,d="The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.";if(n.nodeType!==1){console.warn(`[Domphy] Hydration mismatch at ${u}: expected <${t.tagName}> but found ${n.nodeType===3?`a text node ("${((a=n.textContent)!=null?a:"").slice(0,40)}")`:`node type ${n.nodeType}`}. ${d}`);return}let s=n,m=s.tagName.toLowerCase();if(m!==t.tagName){console.warn(`[Domphy] Hydration mismatch at ${u}: expected <${t.tagName}> but found <${m}>. ${d}`);return}for(let f of["id","class"]){let p=(i=(r=t.attributes)==null?void 0:r.items)==null?void 0:i[f];if(!p||p.value==null)continue;let g=String(p.value),S=(l=s.getAttribute(f))!=null?l:"";g!==S&&console.warn(`[Domphy] Hydration mismatch at ${u} <${t.tagName}>: expected ${f}="${g}" but found ${f}="${S}". ${d}`)}}_hydrateStyles(t){var n;if((n=this.styles)!=null&&n.items)for(let o of this.styles.items){let a=t.get(Dt(o.selectorText)),r=a==null?void 0:a.shift();r&&o.mount(r)}if(this.children)for(let o of this.children.items)o instanceof Fe&&o._hydrateStyles(t)}render(t){let n=this._createDOMNode();t.appendChild(n),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,a=t.getRootNode(),r=a instanceof ShadowRoot?a:document.head;return o||(o=kn(r)),this.styles.render(o),this.children.items.forEach(i=>{if(i instanceof Fe&&i._portal){let l=i._portal(this.getRoot());l&&i.render(l)}else i.render(n)}),n}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var n;(n=this.domElement)==null||n.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let n=!1,o=()=>{n||(n=!0,t())},a=this._hooks.BeforeRemove;this._beforeRemoveFired=!0;try{a(this,o)}catch(r){this._handleError(r),o()}a.length<2&&!n?o():ue&&!n&&setTimeout(()=>{n||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else t()}}},Dn=class{constructor(e){this.__domphyRawHTML=!0,this.html=e}};function Ie(e){return new Dn(e)}function st(e){return typeof e=="object"&&e!==null&&e.__domphyRawHTML===!0}var un="\u200B",Tt=class{constructor(e,t){this.type="TextNode",this._imperative=!1,this._domExtras=[],this.parent=t,this.html=st(e);let n=this.html?e.html:e;this.text=n===""?this.emptyText():String(n)}emptyText(){var e;return((e=this.parent)==null?void 0:e.tagName)==="textarea"?"":un}_createDOMNode(){let e;if(this._domExtras=[],this.html){let t=document.createElement("template");t.innerHTML=_t(this.text.trim());let n=Array.from(t.content.childNodes);n.length===0?e=document.createTextNode(""):(e=n[0],this._domExtras=n.slice(1))}else e=document.createTextNode(this.text);return this.domText=e,e}_allDomNodes(){let e=[];this.domText&&e.push(this.domText);for(let t of this._domExtras)e.push(t);return e}_domSpan(){if(!this.html)return 1;let e=document.createElement("template");return e.innerHTML=_t(this.text.trim()),Math.max(e.content.childNodes.length,1)}setText(e){let t=st(e),n=t?e.html:e,o=n===""?this.emptyText():String(n);if(o===this.text&&t===this.html&&this.domText)return;let a=this.html;if(this.text=o,this.html=t,!this.domText)return;if(!a&&!t&&this.domText.nodeType===3){this.domText.nodeValue=o;return}let r=this.domText,i=this._domExtras,l=this._createDOMNode(),u=r.parentNode;if(u){u.insertBefore(l,r);for(let d of this._domExtras)u.insertBefore(d,r);u.removeChild(r);for(let d of i)d.remove()}}_dispose(){this.domText=void 0,this._domExtras=[],this.text=""}generateHTML(){return this.text===un?"​":this.html?_t(this.text.trim()):lo(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t);for(let n of this._domExtras)e.appendChild(n)}},uo=new Set;function xi(){uo.clear()}var On=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return st(e)?new Tt(e,this.owner):typeof e=="object"&&e!==null?new J(e,this.owner,this._nextKey++):new Tt(e==null?"":String(e),this.owner)}_domReferenceAfter(e){let t=this.owner.domElement;if(!t)return null;for(let n=e;n<this.items.length;n++){let o=this.items[n],a=o instanceof J?o.domElement:o.domText;if(a&&a.parentNode===t)return a}return null}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof J?e.domElement?[e.domElement]:[]:e._allDomNodes();if(o.length===0)return;let a=this._domReferenceAfter(t+1);for(let r of o)r!==a&&n.insertBefore(r,a)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof J?e.domElement?[e.domElement]:[]:e._allDomNodes(),a=t instanceof J?t.domElement?[t.domElement]:[]:t._allDomNodes();if(o.length===0||a.length===0)return;let r=document.createComment("");n.insertBefore(r,o[0]);let i=a[a.length-1].nextSibling;for(let l of o)n.insertBefore(l,i);for(let l of a)n.insertBefore(l,r);r.remove()}update(e,t=!0,n=!1){var o,a,r,i;if(this.items.some(S=>S._imperative)){let S=this.items.filter(v=>!v._imperative),E=this.items.filter(v=>v._imperative);this.items=S.concat(E)}let l=this.items.slice(),u=new Map;for(let S of l)S instanceof J&&S.key!==null&&S.key!==void 0&&!S._imperative&&!S._beforeRemoveFired&&u.set(S.key,S);!n&&this.owner.domElement&&((a=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||a.call(o,this.owner,e));let d=new Set(l),s=new Set,m=!1,f=0,p=ue&&l.length>0?e.length!==l.length:!1;for(let S=0;S<e.length;S++){let E=e[S],v=typeof E=="object"&&E!==null&&!st(E),C=v?E._key:void 0,_=v?En(E):void 0;if(ue&&v&&C===void 0&&f++,C!==void 0){let w=u.get(C);if(w instanceof J&&w.tagName===_){u.delete(C),m=!0;let O=this.items.indexOf(w);O!==S&&O>=0&&this.move(O,S,!1,!0),w.parent=this.owner,w.patch(E),s.add(w);continue}}else if(v){let w=this.items[S];if(w instanceof J&&w.key==null&&w.tagName===_&&d.has(w)&&!s.has(w)&&!w._imperative&&!w._beforeRemoveFired){w.parent=this.owner,w.patch(E),s.add(w);continue}}else{let w=this.items[S];if(w instanceof Tt&&d.has(w)&&!s.has(w)&&!w._imperative){w.setText(E==null?"":E),s.add(w);continue}}s.add(this.insert(E,S,t,!0,!0))}let g=this.items.slice(e.length);for(let S of g)S._imperative||this.remove(S,t,!0);if(u.forEach(S=>this.remove(S,t,!0)),m&&t&&this.owner.domElement){let S=new Map;for(let E=0;E<l.length;E++)S.set(l[E],E);this._placeKeyedDom(S)}if(ue&&l.length>0&&f>0&&p){let S=this.owner.nodeId;if(!uo.has(S)){uo.add(S);let E=`[domphy] unkeyed list length changed \u2014 DOM nodes reused by position may not match their data slot (focus/scroll/input-value drift). Add _key to each item. (parent <${this.owner.tagName}>, ${f} unkeyed item${f===1?"":"s"})`;console.warn(E)}}n||(i=(r=this.owner._hooks)==null?void 0:r.Update)==null||i.call(r,this.owner)}_placeKeyedDom(e){var t;let n=this.owner.domElement;if(!n)return;let o=[],a=this.items;for(let d=0;d<a.length;d++){let s=a[d];if(s._imperative||s instanceof J&&s._beforeRemoveFired){o.push(-2);continue}if(s instanceof J&&s._portal){o.push(-2);continue}o.push((t=e.get(s))!=null?t:-1)}let r=new Set,i=[],l=[];for(let d=0;d<o.length;d++)o[d]>=0&&(i.push(d),l.push(o[d]));if(l.length>0){let d=[],s=[],m=new Array(l.length).fill(-1);for(let p=0;p<l.length;p++){let g=0,S=d.length;for(;g<S;){let E=g+S>>1;d[E]<l[p]?g=E+1:S=E}d[g]=l[p],s[g]=p,g>0&&(m[p]=s[g-1])}let f=s[d.length-1];for(;f!==void 0&&f>=0;)r.add(i[f]),f=m[f]}let u=null;for(let d=o.length-1;d>=0;d--){if(o[d]===-2)continue;let s=a[d],m=s instanceof J?s.domElement?[s.domElement]:[]:s._allDomNodes();if(m.length!==0){if(!r.has(d)){let f=u;for(let p=m.length-1;p>=0;p--){let g=m[p];g.nextSibling!==f&&n.insertBefore(g,f),f=g}}u=m[0]}}}insert(e,t,n=!0,o=!1,a=!1){let r=this.items.length,i=typeof t!="number"||Number.isNaN(t)||t<0||t>r?r:t,l=this._createNode(e);if(l._imperative=!a,this.items.splice(i,0,l),l instanceof J){l._hooks.Insert&&l._hooks.Insert(l);let u=this.owner.domElement;if(n&&u)if(l._portal){let d=l._portal(this.owner.getRoot());d&&l.render(d)}else{let d=l._createDOMNode(),s=this._domReferenceAfter(i+1);u.insertBefore(d,s);let m=u.getRootNode(),f=m instanceof ShadowRoot?m:document.head,p=kn(f);l.styles.render(p),l._hooks.Mount&&l._hooks.Mount(l),l.children.items.forEach(g=>{if(g instanceof J&&g._portal){let S=g._portal(g.getRoot());S&&g.render(S)}else g.render(d)})}}else{let u=this.owner.domElement;if(n&&u){let d=l._createDOMNode(),s=this._domReferenceAfter(i+1);u.insertBefore(d,s);for(let m of l._domExtras)u.insertBefore(m,s)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),l}remove(e,t=!0,n=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof J){if(e._beforeRemoveFired)return;let a=()=>{let r=e.domElement,i=this.items.indexOf(e);i>=0&&this.items.splice(i,1),t&&r&&r.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let r=!1,i=()=>{r||(r=!0,a())},l=e._hooks.BeforeRemove;e._beforeRemoveFired=!0;try{l(e,i)}catch(u){e._handleError(u),i()}l.length<2&&!r?i():ue&&!r&&setTimeout(()=>{r||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter (e.g. an exit animation) but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else a()}else{if(this.items.splice(o,1),t)for(let a of e._allDomNodes())a.remove();e._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,n=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let a=this.items[e],r=this.items[t];this.items[e]=r,this.items[t]=a,n&&this._swapDomElement(a,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,n=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let a=this.items[e];this.items.splice(e,1),this.items.splice(t,0,a),n&&this._moveDomElement(a,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},Me=new Set,mo=!1;function Pn(e){Me.add(e),!mo&&(mo=!0,Ot(Ln))}function Ln(){for(mo=!1;Me.size>0;){let e=[...Me];Me.clear();for(let t of e)try{t()}catch(n){console.error("[Domphy] Uncaught error in effect:",n)}}}function Mn(){let e=0;for(;yn()||Me.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}bn(),Ln()}}var lt=[];function wi(){return lt.length?lt[lt.length-1]:null}function go(e){let t=wi();t&&t._add(e)}var Ei=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){if(this._stopped)return ue&&console.warn("[Domphy] effectScope.run() called after stop() \u2014 resources created inside are registered to the enclosing scope instead of this stopped one."),e();lt.push(this);try{return e()}finally{lt.pop()}}stop(){if(this._stopped)return;this._stopped=!0;let e,t=!1;for(let n of this._disposers)try{n()}catch(o){t?console.error("[Domphy] Additional error during effectScope.stop():",o):(e=o,t=!0)}if(this._disposers.clear(),t)throw e}};function Ci(){let e=new Ei;return go(()=>e.stop()),e}function ut(e){let t=!1,n=!1,o=()=>{t||r()},a=new vn(()=>{t||Pn(o)}),r=()=>{if(!(t||n)){n=!0,a.reset();try{Sn(a,e)}finally{n=!1}}},i=()=>{t||(t=!0,a.reset(),Me.delete(o))};go(i);try{r()}catch(l){throw i(),l}return i}function ki(e){let t="computed",n=new ct,o,a=!0,r=!1,i=0,l=!1,u=()=>{l||!a||n.listenerCount(t)>0&&m()},d=new vn(()=>{l||(a=!0,Pn(u))});n._onEmpty=()=>{d.reset(),a=!0};let s=()=>{d.reset();try{o=Sn(d,e)}catch(p){throw a=!0,p}i++,n._version=i,a=!1,r=!0},m=()=>{let p=o,g=r;s(),!(g&&o===p)&&n.notify(t,o)},f=p=>{if(l)return o;let g=null;return p?n.addListener(t,p):(g=fo(),g&&n.addListener(t,g.handler)),a&&(r&&n.listenerCount(t)>0?m():s()),g==null||g._consumedVersions.set(n,i),o};return go(()=>{l||(l=!0,d.reset(),Me.delete(u),n._dispose())}),{_isState:!0,_notifier:n,get:f}}function _i(e){return gn(e)}function Ti(e){return po(e)}function Di(e,t,n){let o,a=!0;return ut(()=>{let r=typeof e=="function"?e():e.get();(!a||n!=null&&n.immediate)&&t(r,o),o=r,a=!1})}function Oi(e){let t=new Promise(n=>{Ot(()=>{Mn(),n()})});return e?t.then(e):t}var Pi=class{constructor(e){this._notifier=new ct,this.initialRecord=oo({},e),this._record=oo({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let n=fo();n&&this._notifier.addListener(e,n.handler)}return this._record[e]}set(e,t){Object.is(this._record[e],t)||(this._record[e]=t,this._notifier.notify(e,t))}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var At={};Et(At,{COLOR_ROLES:()=>Bi,ElementTones:()=>dt,Palette:()=>ta,Ramp:()=>Hn,Swatch:()=>wo,TONE_STEPS:()=>G,ToneAliases:()=>$t,applySystemTheme:()=>Ai,calcDeltaE2000:()=>Do,calcScore:()=>Oo,calcStatistics:()=>Ui,contrastRatio:()=>Gi,createMonotone:()=>Rt,cssRgbToRgb:()=>qi,fromLightnessEAL:()=>Wi,generateRamp:()=>Vn,generateTheme:()=>ia,getTheme:()=>Re,hexToRgb:()=>me,isValidHex:()=>$n,labToLch:()=>An,labToRgb:()=>Nn,lchToLab:()=>Ki,mix:()=>Yi,normalizeHex:()=>To,oklabToRgb:()=>Nt,resolveThemeColor:()=>sa,rgbToHex:()=>we,rgbToLab:()=>Xe,rgbToOklab:()=>ft,rootMeanSquare:()=>qe,scale:()=>Xi,setTheme:()=>Ri,themeApply:()=>zi,themeCSS:()=>vo,themeColor:()=>c,themeColorToken:()=>Po,themeDensity:()=>y,themeFluidSpacing:()=>Ni,themeName:()=>zt,themeSize:()=>x,themeSpacing:()=>h,themeTokens:()=>_o,themeVars:()=>It,toLightnessEAL:()=>zn});var j=Math.pow,Li={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#ffe5e5","#ffcaca","#ffaeae","#ff9191","#ff7474","#ff5757","#f93a3a","#e82222","#d40f0f","#b80000","#9c0000","#800000","#640000","#480000","#2c0000","#140000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,attention:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},ht=Li,Co=e=>JSON.parse(JSON.stringify(e)),mt=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),Ye={light:Co(ht),dark:$i(ht)},G=ht.colors.neutral.length,Ue=8,Lt=5,Mt=null,bo=new Map;function ko(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Ge(e,t){if(/[;}]/.test(e)||/<\/\s*style/i.test(e))throw new Error(`${t} contains unsafe CSS characters (";", "}", or "</style") \u2014 theme values are interpolated into a <style> block`)}function Mi(e){for(let t in e)if(!Object.keys(ht).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes!==void 0){if(!(Array.isArray(e.fontSizes)&&e.fontSizes.length===Ue&&e.fontSizes.every(t=>typeof t=="string"&&t.length>0)))throw new Error(`fontSize must be array of ${Ue} non-empty string (the size scale has ${Ue} steps: 0\u2013${Ue-1})`);e.fontSizes.forEach((t,n)=>Ge(t,`fontSizes[${n}]`))}if(e.densities){if(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number"))throw new Error("densities must be array of number");if(e.densities.length!==Lt)throw new Error(`densities must have exactly ${Lt} entries (the density scale has ${Lt} steps: 0\u2013${Lt-1}), got ${e.densities.length}`);if(e.densities.some(t=>!Number.isFinite(t)||t<=0))throw new Error("densities entries must be positive finite numbers")}if(e.darkBias!==void 0){let t=e.darkBias;if(typeof t!="number"||!Number.isInteger(t)||t<0||t>G-1)throw new Error(`darkBias must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object");for(let n in t){let o=t[n];typeof o=="string"&&Ge(o,`custom.${n}`)}}if("colors"in e){let t=e.colors;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(n=>Array.isArray(n)&&n.every(o=>typeof o=="string"))))throw new Error("colors must be an object of string[]");for(let n in t){Ge(n,`colors role "${n}"`);let o=t[n];if(o.length!==G)throw new Error(`colors.${n} must have exactly ${G} tone steps (got ${o.length}) \u2014 the tone model is fixed at shift-0\u2026shift-${G-1}`);if(o.some(a=>a.length===0))throw new Error(`colors.${n} must contain only non-empty strings`);o.forEach((a,r)=>Ge(a,`colors.${n}[${r}]`))}}if("baseTones"in e){let t=e.baseTones;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(n=>typeof n=="number")))throw new Error("baseTones must be an object of number");for(let n in t){let o=t[n];if(!Number.isInteger(o)||o<0||o>G-1)throw new Error(`baseTones.${n} must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}}if("direction"in e&&e.direction!=="lighten"&&e.direction!=="darken")throw new Error('direction must be "lighten" or "darken"')}function Rn(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]={}),Rn(e[o],t[o])):e[o]=t[o])}function Ii(e,t){Ge(e,"theme name");let n={},o=ko(t),a=mt(e);for(let i in t){let l=t[i];if(i==="colors")for(let u in t.colors){let d=mt(u);[...Array(o).keys()].forEach(s=>n[`--${d}-${s}`]=t.colors[u][s])}else if(i==="fontSizes")[...Array(Ue).keys()].forEach(u=>n[`--fontSize-${u}`]=t.fontSizes[u]);else if(i==="custom"&&l&&typeof l=="object")for(let u in l)n[`--custom-${mt(u)}`]=l[u]}let r="";for(let i in n)r+=` ${i}: ${n[i]};
|
|
1
|
+
"use strict";var Domphy=(()=>{var Et=Object.defineProperty,Xr=Object.defineProperties,Jr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertyNames,on=Object.getOwnPropertySymbols;var rn=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable;var nn=(e,t,n)=>t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))rn.call(t,n)&&nn(e,n,t[n]);if(on)for(var n of on(t))ei.call(t,n)&&nn(e,n,t[n]);return e},N=(e,t)=>Xr(e,Zr(t));var kt=(e,t)=>{for(var n in t)Et(e,n,{get:t[n],enumerable:!0})},ti=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Qr(t))!rn.call(e,a)&&a!==n&&Et(e,a,{get:()=>t[a],enumerable:!(o=Jr(t,a))||o.enumerable});return e};var oi=e=>ti(Et({},"__esModule",{value:!0}),e);var wc={};kt(wc,{core:()=>Lt,theme:()=>Bt,ui:()=>eo});var Lt={};kt(Lt,{AttributeList:()=>_n,BooleanAttributes:()=>fo,CamelAttributes:()=>dn,ElementList:()=>Pn,ElementNode:()=>J,HtmlAttributeNames:()=>ro,HtmlTags:()=>hn,Notifier:()=>ut,PrefixCSS:()=>Le,RawHTML:()=>On,RecordState:()=>Li,State:()=>lo,SvgTags:()=>fn,TextNode:()=>Dt,VoidTags:()=>Ct,_deliveringNotifier:()=>it,_microtask:()=>Pt,_resetKeylessWarnings:()=>wi,batch:()=>_i,behavior:()=>V,computed:()=>Ti,configure:()=>ai,effect:()=>mt,effectScope:()=>Ci,flushPendingNotifiers:()=>vn,flushSync:()=>In,getConfig:()=>gn,hasPendingNotifiers:()=>bn,hashString:()=>Ke,isRawHTML:()=>ct,isState:()=>le,merge:()=>K,nextTick:()=>Pi,peek:()=>ui,rawHtml:()=>Ie,readonly:()=>ci,runBatched:()=>yn,sanitizeHTMLString:()=>_t,toState:()=>b,untrack:()=>Di,watch:()=>Oi});var ni=Object.defineProperty,an=Object.getOwnPropertySymbols,ri=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable,ln=(e,t,n)=>t in e?ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,no=(e,t)=>{for(var n in t||(t={}))ri.call(t,n)&&ln(e,n,t[n]);if(an)for(var n of an(t))ii.call(t,n)&&ln(e,n,t[n]);return e},fo=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","inert","download","noModule","paused","autoPictureInPicture"],dn=["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"],ro={htmlFor:"for",allowFullScreen:"allowfullscreen",autoFocus:"autofocus",autoPlay:"autoplay",formNoValidate:"formnovalidate",isMap:"ismap",itemScope:"itemscope",noHref:"nohref",noShade:"noshade",noValidate:"novalidate",playsInline:"playsinline",trueSpeed:"truespeed",typeMustMatch:"typemustmatch",noModule:"nomodule",autoPictureInPicture:"autopictureinpicture",autoCapitalize:"autocapitalize",contentEditable:"contenteditable",spellCheck:"spellcheck",ariaActiveDescendant:"aria-activedescendant",ariaColCount:"aria-colcount",ariaPosinSet:"aria-posinset",ariaSetSize:"aria-setsize",accessKey:"accesskey",enterKeyHint:"enterkeyhint",inputMode:"inputmode",itemId:"itemid",itemProp:"itemprop",itemRef:"itemref",itemType:"itemtype",tabIndex:"tabindex",writingSuggestions:"writingsuggestions",charSet:"charset",hrefLang:"hreflang",crossOrigin:"crossorigin",aLink:"alink",bgColor:"bgcolor",vLink:"vlink",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formTarget:"formtarget",popoverTarget:"popovertarget",popoverTargetAction:"popovertargetaction",allowPaymentRequest:"allowpaymentrequest",allowUserMedia:"allowusermedia",frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",referrerPolicy:"referrerpolicy",srcDoc:"srcdoc",hSpace:"hspace",fetchPriority:"fetchpriority",srcSet:"srcset",srcLang:"srclang",useMap:"usemap",vSpace:"vspace",dirName:"dirname",imageSizes:"imagesizes",imageSrcSet:"imagesrcset",classId:"classid",codeBase:"codebase",codeType:"codetype",valueType:"valuetype",shadowRootClonable:"shadowrootclonable",shadowRootDelegatesFocus:"shadowrootdelegatesfocus",shadowRootMode:"shadowrootmode",colSpan:"colspan",rowSpan:"rowspan",noWrap:"nowrap",vAlign:"valign",charOff:"charoff",maxLength:"maxlength",minLength:"minlength",autoComplete:"autocomplete",encType:"enctype",dateTime:"datetime"},hn=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],Le={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"]},fn=["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"],Ct=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],pn={};function ai(e){Object.assign(pn,e)}function gn(){return no({},pn)}var li=["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"],si=li.reduce((e,t)=>{let n=t.slice(2).toLowerCase();return e[n]=t,e},{}),ge=[],Pt=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},sn=100,Tt=0,io=new Set,We=new Set,it=null;function yn(e){Tt++;try{return e()}finally{if(Tt--,Tt===0){let t=io;io=new Set;for(let n of t)n._scheduleFlush()}}}var ut=class{constructor(){this._listeners=Object.create(null),this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let n=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(n)),n}removeListener(e,t){var n;if(!this._listeners)return;let o=this._listeners[e];o&&o.has(t)&&(o.delete(t),o.size===0&&(delete this._listeners[e],(n=this._onEmpty)==null||n.call(this,e)))}listenerCount(e){var t,n,o;return(o=(n=(t=this._listeners)==null?void 0:t[e])==null?void 0:n.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let n=ge.length?ge[ge.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>=sn){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${sn} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...ge]})}Tt>0?io.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,We.add(this),Pt(()=>this._flushAll()))}_isCircular(e){let t=ge.findIndex(([o,a])=>o===this&&a===e);if(t===-1)return!1;let n=[...ge.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
|
|
2
|
+
${n.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,We.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:n,chain:o}]of e)ge=o,this._flush(t,n);ge=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let n=this._listeners[e];if(!n)return;ge.push([this,e]),this._flushing.set(e,t);let o=it;it=this;try{for(let a of[...n])if(n.has(a))try{a(...t)}catch(r){console.error(r)}}finally{it=o}this._flushing.delete(e),ge.pop()}};function bn(){return We.size>0}function vn(){let e=0;for(;We.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...We];We.clear();for(let n of t)n._flushAll()}}var Sn=class{constructor(e){this._releases=new Set,this._consumedVersions=new Map;let t=(()=>{let n=it;n&&n._version!==void 0&&this._consumedVersions.get(n)===n._version||e()});t.onSubscribe=n=>{this._releases.add(n)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear(),this._consumedVersions.clear()}get dependencyCount(){return this._releases.size}},at=[],ao=0;function po(){return ao>0?null:at.length?at[at.length-1]:null}function xn(e,t){at.push(e);try{return t()}finally{at.pop()}}function go(e){ao++;try{return e()}finally{ao--}}var ue=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",lo=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new ut,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=po();t&&this.addListener(t.handler)}return this._value}set(e){if(!this._notifier){ue&&console.warn(`[Domphy] State.set() called on a disposed state ("${this.name}") \u2014 the write is ignored. The state outlived its owner; keep a live reference or re-create it.`);return}Object.is(this._value,e)||(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function K(e={},t={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],a=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=_e(t));for(let r in t){let i=t[r];if(i!=null)if(typeof i=="object"&&!Array.isArray(i))typeof e[r]=="object"?e[r]=K(e[r],i):e[r]=i;else if(n.includes(r))if(typeof e[r]=="function"||typeof i=="function"){let l=e[r];e[r]=u=>{let d=typeof l=="function"?l(u):l,s=typeof i=="function"?i(u):i;return[d,s].filter(m=>m).join(", ")}}else e[r]=[e[r],i].filter(l=>l).join(", ");else if(a.includes(r))if(typeof e[r]=="function"||typeof i=="function"){let l=e[r];e[r]=u=>{let d=typeof l=="function"?l(u):l,s=typeof i=="function"?i(u):i;return[d,s].filter(m=>m).join("")}}else e[r]=[e[r],i].filter(l=>l).join("");else if(o.includes(r))if(typeof e[r]=="function"||typeof i=="function"){let l=e[r];e[r]=u=>{let d=typeof l=="function"?l(u):l,s=typeof i=="function"?i(u):i;return[d,s].filter(m=>m).join(" ")}}else e[r]=[e[r],i].filter(l=>l).join(" ");else if(r.startsWith("on")){let l=r.replace("on","").toLowerCase();di(e,l,i)}else if(r.startsWith("_on")){let l=r.replace("_on","");mi(e,l,i)}else e[r]=i}return e}function Ke(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 b(e,t){return e instanceof lo||e!=null&&e._isState?e:new lo(e,t)}function le(e){return typeof e=="object"&&e!==null&&e._isState===!0}function ci(e){return{_isState:!0,get(t){return e.get(t)}}}function ui(e){return go(()=>e(void 0))}function V(e,t,n){return{_behaviors:{[e]:{attach:t,props:n}}}}function lt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function mi(e,t,n){let o=`_on${t}`,a=e[o];if(typeof a=="function"){let r=(...i)=>{a(...i),n(...i)};try{Object.defineProperty(r,"length",{value:Math.max(a.length,n.length),configurable:!0})}catch(i){}e[o]=r}else e[o]=n}function di(e,t,n){let o=si[t];if(!o)throw Error(`invalid event name "${t}"`);let a=e[o];typeof a=="function"?e[o]=(r,i)=>{a(r,i),n(r,i)}:e[o]=n}function _e(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let n;if(Array.isArray(e)){n=[],t.set(e,n);for(let a of e)n.push(_e(a,t));return n}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){n=new Map,t.set(e,n);for(let[a,r]of e)n.set(_e(a,t),_e(r,t));return n}if(e instanceof Set){n=new Set,t.set(e,n);for(let a of e)n.add(_e(a,t));return n}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);let o=Object.getPrototypeOf(e);if(o!==Object.prototype)return e;n=Object.create(o),t.set(e,n);for(let a of Reflect.ownKeys(e))n[a]=_e(e[a],t);return n}function wn(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let n=Object.keys(e);if(n.length===0&&!t)throw Error("element object has no tag key");for(let o=0;o<n.length;o++){let a=n[o],r=e[a];if(o===0&&!En.has(a)&&!t)throw Error(`key ${a} is not valid HTML tag name`);if(a==="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(a==="$"){if(!Array.isArray(r))throw Error(`"$" must be an array of patch objects, received ${r===null?"null":typeof r} on element { ${n.join(", ")} } \u2014 wrap patches in an array, e.g. $: [patch()]`);r.forEach(i=>wn(i,!0))}else{if(a.startsWith("_on")&&typeof r!="function")throw Error(`hook ${a} value "${r}" must be a function `);if(a.startsWith("on")&&typeof r!="function")throw Error(`event ${a} value "${r}" must be a function `);if(a==="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(a==="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(a==="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(a==="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function hi(e){return e.replace(/&#(x?[0-9a-fA-F]+);/gi,(t,n)=>{let o=n[0]==="x"||n[0]==="X"?Number.parseInt(n.slice(1),16):Number.parseInt(n,10);return o>=0&&o<=1114111?String.fromCodePoint(o):""}).replace(/:/gi,":").replace(/	/gi," ").replace(/
/gi,`
|
|
3
|
+
`)}function fi(e){let t=hi(e).replace(/[\x00-\x20]+/g,"").toLowerCase();return t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:text/html")||t.startsWith("data:application/xhtml+xml")}function pi(e){let t=e.toLowerCase(),n="",o=0;for(;o<e.length;){let a=t.indexOf("<",o);if(a===-1){n+=e.slice(o);break}n+=e.slice(o,a);let r=null,i=-1;for(let u=a+1;u<e.length;u++){let d=e[u];if(r)d===r&&(r=null);else if(d==='"'||d==="'")r=d;else if(d===">"){i=u;break}}if(i===-1){n+=e.slice(a);break}let l=e.slice(a,i+1);if(/^<script[\s/>]/i.test(l)){if(/\/\s*>$/.test(l)){o=i+1;continue}let u=t.indexOf("</script",i+1);if(u===-1){o=e.length;break}let d=e.indexOf(">",u);o=d===-1?e.length:d+1;continue}n+=l,o=i+1}return n}function _t(e){let t=pi(e);return t=t.replace(/\s+on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),t=t.replace(/\/srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"/"),t=t.replace(/(["'])srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,"$1"),t=t.replace(/((?:xlink:href|formaction|imagesrcset|srcset|poster|cite|background|ping|longdesc|codebase|classid|archive|icon|manifest|href|src|action|data)\s*=\s*)("([^"]*)"|'([^']*)'|([^\s>]*))/gi,(n,o,a,r,i,l)=>{var u,d;let s=(d=(u=r!=null?r:i)!=null?u:l)!=null?d:"";if(!fi(s))return n;let m=r!==void 0?'"':i!==void 0?"'":"";return`${o}${m}#${m}`}),t}function so(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var En=new Set(hn);function kn(e){return Object.keys(e).find(t=>En.has(t))}function cn(e,t){if(Object.getPrototypeOf(e)!==Object.prototype)return _e(e);let n=new WeakMap,o={};for(let a of Reflect.ownKeys(e))o[a]=a===t?e[a]:_e(e[a],n);return o}function Cn(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function gi(e){if(e.indexOf("@")===0)return[e];for(var t=[],n=0,o=0,a="",r=0,i=e.length;r<i;r++){var l=e[r];if(l==="(")n+=1;else if(l===")")n-=1;else if(l==="[")o+=1;else if(l==="]")o-=1;else if(l===","&&!n&&!o){t.push(a.trim()),a="";continue}a+=l}return t.push(a.trim()),t}function Ot(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 yi(e,t){for(let n=0;n<e.length;n++){let o=e[n],a=null;if(typeof o.selectorText=="string"?a=Ot(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(a=Ot(o.cssText.split("{")[0])),!a)continue;let r=t.get(a);r?r.push(o):t.set(a,[o])}return t}function Tn(e,t){var n;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let a=t!=null?t:gn().cspNonce;a&&(o.nonce=a),e.appendChild(o)}return o.dataset.domphyBase!=="true"&&((n=o.sheet)==null||n.insertRule("[hidden] { display: none !important; }",0),o.dataset.domphyBase="true"),o}var co=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(n=>K(t,co(n))),delete e.$,K(t,e),t}else return e},bi={translate:["yes","no"],autoCapitalize:["on","off"],contentEditable:["true","false"],spellCheck:["true","false"]},vi=class{constructor(e,t,n){this.declaredValue=void 0,this._notifier=new ut,this._releases=[],this._removeHooked=!1,this._listenerReleases=[],this._listenerRemoveHooked=!1,this.parent=n,this.isBoolean=fo.includes(e),this.enumeratedBoolean=bi[e],dn.includes(e)?this.name=e:lt(ro,e)?this.name=ro[e]:this.name=Cn(e),this.value=void 0,this.set(t)}normalize(e){return this.enumeratedBoolean&&typeof e=="boolean"?e?this.enumeratedBoolean[0]:this.enumeratedBoolean[1]:e}resolve(e){return this.isBoolean&&typeof e!="string"?!!e:this.normalize(e)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value","checked","selected"];this.isBoolean?(this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value),t.includes(this.name)&&(e[this.name]=!!this.value)):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,n,o;let a=this.value;if(this.declaredValue=e,this._releases.length){for(let r of this._releases)r();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let r=()=>{var i;if(!(!this.parent||this.parent._disposed))try{let l=this.value;this.value=this.resolve(e(r)),this.render(),l!==this.value&&this._notifier.notify(this.name,this.value)}catch(l){(i=this.parent)==null||i._handleError(l)}};r.elementNode=this.parent,r.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(n=this.parent)==null?void 0:n.nodeId} attribute:${this.name}`,r.onSubscribe=i=>{this._releases.push(i),this.parent&&!this._removeHooked&&(this._removeHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let l of this._releases)l();this._releases=[],r=null}))};try{this.value=this.resolve(e(r))}catch(i){(o=this.parent)==null||o._handleError(i)}}else this.value=this.resolve(e);this.render(),a!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=n=>{this._listenerReleases.push(n),this.parent&&!this._listenerRemoveHooked&&(this._listenerRemoveHooked=!0,this.parent.addHook("BeforeRemove",()=>{for(let o of this._listenerReleases)o();this._listenerReleases=[]}))},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){for(let e of this._releases)e();this._releases=[];for(let e of this._listenerReleases)e();this._listenerReleases=[],this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t===!1||t==null?"":t===!0?e:`${e}="${so(String(t))}"`;if(t==null)return"";let n=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${so(String(n))}"`}},_n=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 vi(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?lt(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(!fo.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,d)=>{let s=(u||"").split(" ").filter(m=>m);return!s.includes(d)&&s.push(d),s.join(" ")},a=(n=(t=this.items)==null?void 0:t.class)==null?void 0:n.declaredValue,r=typeof a=="function",i=r?a:this.get("class"),l=typeof e=="function";if(!r&&!l){this.set("class",o(i,e));return}this.set("class",u=>o(r?i(u):i,l?e(u):e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}};function Si(e){let t=String(e);return/[;}]|<\/style/i.test(t)?t.replace(/<\/style/gi,"\\3C /style").replace(/;/g,"\\3B ").replace(/}/g,"\\7D "):t}var xi=class{constructor(e,t,n){this.value="",this._releases=[],this._fn=null,this._bound=!1,this.name=e,this.cssName=e.startsWith("--")?e:Cn(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)),Le[this.name]&&Le[this.name].forEach(n=>{t.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){if(this._releases.length){for(let e of this._releases)e();this._releases=[]}this._fn=null,this._bound=!1,this.value="",this.parentRule=null}_bind(e){var t,n,o,a;let r=(()=>{var i;!this.parentRule||(i=this.parentRule.parentNode)!=null&&i._disposed||(this.value=e(r),this._domUpdate())});r.onSubscribe=i=>{this._releases.push(i)},r.elementNode=this.parentRule.root,r.debug=`class:${(n=(t=this.parentRule)==null?void 0:t.root)==null?void 0:n.tagName}_${(a=(o=this.parentRule)==null?void 0:o.root)==null?void 0:a.nodeId} style:${this.name}`,this.value=e(r),this._bound=!0}activate(){!this._fn||this._bound||(this._bind(this._fn),this._domUpdate())}set(e){var t,n;if(this._releases.length){for(let o of this._releases)o();this._releases=[]}if(this._bound=!1,this._fn=null,typeof e=="function")if(this._fn=e,(n=(t=this.parentRule)==null?void 0:t.parentNode)!=null&&n.domElement)this._bind(e);else{let o=(()=>{});o.elementNode=this.parentRule.root;let a=[];o.onSubscribe=r=>{a.push(r)},this.value=go(()=>e(o));for(let r of a)r()}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),Le[this.name]&&Le[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=Si(this.value),t=`${this.cssName}: ${e}`;return Le[this.name]&&Le[this.name].forEach(n=>{t+=`; -${n}-${this.cssName}: ${e}`}),t}},Te=class uo{constructor(t,n){this.domRule=null,this._domIndex=-1,this.styleBlock={},this.selectorText=t,this.styleList=new Dn(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 uo;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof uo;)t=t.parent;return t}insertStyle(t,n){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(n):this.styleBlock[t]=new xi(t,n,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${t} ${n} } `}mount(t){if(!(!t||!this.styleList)){if(this.domRule=t,this.styleBlock)for(let n of Object.values(this.styleBlock))n.activate();"cssRules"in t&&this.styleList.mount(t.cssRules)}}remove(){let t=this.domRule,n=t==null?void 0:t.parentStyleSheet;if(t&&n){let o=n.cssRules,a=this._domIndex;if(a<0||a>=o.length||o[a]!==t){a=-1;for(let r=0;r<o.length;r++)if(o[r]===t){a=r;break}}a>=0&&n.deleteRule(a)}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let n=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length);this._domIndex=o;let a=t.cssRules[o];"cssRules"in a&&(this.mount(a),this.styleList.render(a))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let r=t.cssRules[a];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,a=t.insertRule(o,t.cssRules.length);this._domIndex=a;let r=t.cssRules[a];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Dn=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof Te;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let n={},o=[];function a(r,i){return r.startsWith("&")?`${i}${r.slice(1)}`:`${i} ${r}`}for(let r in e){let i=e[r],l=gi(r);for(let u of l){let d=a(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof i=="object"&&i!=null){let s=new Te(u,this.parent);s.styleList.addCSS(i,t),o.push(s)}}else if(u.startsWith("@keyframes")){let s=new Te(u,this.parent);s.styleList.addCSS(i,""),this.items.push(s)}else if(u.startsWith("@font-face")){let s=new Te(u,this.parent);for(let m in i)s.insertStyle(m,i[m]);this.items.push(s)}else if(typeof i=="object"&&i!=null){let s=new Te(d,this.parent);this.items.push(s);for(let[m,f]of Object.entries(i))if(typeof f=="object"&&f!=null){let p=a(m,d);this.addCSS(f,p)}else s.insertStyle(m,f)}else n[u]=i}}if(Object.keys(n).length){let r=new Te(t,this.parent);for(let i in n)r.insertStyle(i,n[i]);this.items.push(r)}for(let r of o)this.items.push(r)}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}patchCSS(e,t=""){var n;if(!this.items||!this.parent)return;let o={};for(let l in e){let u=e[l];typeof u=="object"&&u!=null||(o[l]=u)}let a=this.items.find(l=>l.selectorText===t);if(!a){if(Object.keys(o).length===0)return;a=new Te(t,this.parent),this.items.push(a)}let r=new Set(Object.keys(o));for(let l in o)a.insertStyle(l,o[l]);if(a.styleBlock)for(let l of Object.keys(a.styleBlock))r.has(l)||a.removeStyle(l);let i=(n=this.domStyle)==null?void 0:n.sheet;!a.domRule&&i&&a.render(i)}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(n=>n.selectorText===e);return t||(t=new Te(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let n=e.get(Ot(t.selectorText));n&&t.mount(n)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,n=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,a)=>{let r=a-t,i=e[r];i&&(o.selectorText.startsWith("@")&&i instanceof CSSKeyframesRule||"keyText"in i?o.mount(i):"selectorText"in i?i.selectorText!==n(o.selectorText)?t+=1:o.mount(i):"cssRules"in i&&o.mount(i))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}};function un(e){console.warn(`[Domphy] <${e}> is a void element and cannot have children \u2014 SSR output omits the declared content while the client renders it, so hydration drifts. Remove the content or use a non-void tag.`)}var J=class Fe{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 Pn(this),this.styles=new Dn(this),this.attributes=new _n(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null,this._descriptor=null;var a,r;wn(t),this._descriptor=t,this.parent=n,this.tagName=kn(t);let i=cn(t,this.tagName);i.style=i.style||{},i=co(i),this.key=(a=i._key)!=null?a:null,this._context=i._context||{},this._metadata=i._metadata||{};let l=`${(r=this.parent)==null?void 0:r.nodeId}.${o}`,u=Object.keys(i.style).length?JSON.stringify(i.style,(s,m)=>typeof m=="function"?l:m):"";this.nodeId=Ke(l+u),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),i._onSchedule&&i._onSchedule(this,i),this.merge(i);let d=i[this.tagName];ue&&d!=null&&d!==""&&Ct.includes(this.tagName)&&un(this.tagName),d!=null&&(typeof d=="function"?this._setupFunctionChildren(d):this.children.update(Array.isArray(d)?d:[d])),this._hooks.Init&&this._hooks.Init(this)}_setupFunctionChildren(t){let n=()=>{if(!this._disposed)try{let a=t(n);this.children.update(Array.isArray(a)?a:[a])}catch(a){this._handleError(a)}};n.elementNode=this,n.debug=`class:${this.tagName}_${this.nodeId} children`;let o=[];n.onSubscribe=a=>{o.push(a),this._childrenRelease=()=>{for(let r of o)r();o.length=0,n=null},this._childrenReleaseHooked||(this._childrenReleaseHooked=!0,this.addHook("BeforeRemove",()=>{var r;(r=this._childrenRelease)==null||r.call(this),this._childrenRelease=void 0}))},n()}_createDOMNode(){let t=fn.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let n in this._events)this._bindEvent(n);return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let n=o=>{var a,r;return(r=(a=this._events)==null?void 0:a[t])==null?void 0:r.call(a,o,this)};this.domElement.addEventListener(t,n),this.addHook("BeforeRemove",o=>{var a;(a=o.domElement)==null||a.removeEventListener(t,n),n=null})}_dispose(){var t,n,o,a,r,i;if(!this._disposed){if(this._disposed=!0,!this._beforeRemoveFired){this._beforeRemoveFired=!0;try{(n=(t=this._hooks).BeforeRemove)==null||n.call(t,this,()=>{})}catch(l){this._handleError(l)}}try{(o=this._childrenRelease)==null||o.call(this)}catch(l){this._handleError(l)}this._childrenRelease=void 0;for(let l of this._behaviorInstances.values())try{(a=l.destroy)==null||a.call(l)}catch(u){this._handleError(u)}this._behaviorInstances.clear(),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(l=>l.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(r=this._hooks).Remove)==null||i.call(r,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this._descriptor=null,this.parent=null}}merge(t){K(this._context,t._context),K(this._metadata,t._metadata),this._processBehaviors(t._behaviors);let n=Object.keys(t);for(let o=0;o<n.length;o++){let a=n[o],r=t[a];["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName].includes(a)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(a)?this.addHook(a.substring(3),r):a.startsWith("on")?this.addEvent(a.substring(2).toLowerCase(),r):a==="_portal"?this._portal=r:a==="class"?(typeof r=="string"||typeof r=="function")&&this.attributes.addClass(r):this.attributes.set(a,r))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var n;if(t===this._descriptor)return;this._descriptor=t;let o=cn(t,this.tagName);o.style=o.style||{},o=co(o);let a=o[this.tagName];if(ue&&a!=null&&a!==""&&Ct.includes(this.tagName)&&un(this.tagName),(n=this._childrenRelease)==null||n.call(this),this._childrenRelease=void 0,typeof a=="function")this._setupFunctionChildren(a);else if(a!=null){let s=Array.isArray(a)?a:[a];this.children.update(s,!!this.domElement,!0)}o._context&&K(this._context,o._context),o._metadata&&K(this._metadata,o._metadata),this._processBehaviors(o._behaviors,!0),this.styles.patchCSS(o.style||{},`.${this.tagName}_${this.nodeId}`);let r=`${this.tagName}_${this.nodeId}`,i=["$","_onSchedule","_key","_context","_metadata","_behaviors","style",this.tagName],l=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],u=new Set(["class"]),d=null;this._events={};for(let s of Object.keys(o)){if(i.includes(s)||l.includes(s)||s==="_portal")continue;let m=o[s];s.startsWith("on")&&typeof m=="function"?this.addEvent(s.substring(2).toLowerCase(),m):s==="class"&&(typeof m=="string"||typeof m=="function")?d=m:(this.attributes.set(s,m),u.add(s))}if(typeof d=="function"){let s=d;this.attributes.set("class",m=>`${r} ${s(m)}`)}else this.attributes.set("class",d?`${r} ${d}`:r);if(this.attributes.items)for(let s of Object.keys(this.attributes.items))u.has(s)||this.attributes.remove(s);if(this._events)for(let s in this._events)this._bindEvent(s)}_handleError(t){let n=this;for(;n;){if(n._hooks.Error){let o=n;n._hooks.Error(o,t,()=>{o.children.update([])});return}n=n.parent}console.error("[Domphy] Unhandled error in reactive child:",t)}addEvent(t,n){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(a,r)=>{o(a,r),n(a,r)}:this._events[t]=n}addHook(t,n){let o=this._hooks[t];if(typeof o=="function"){let a=((...r)=>{let i;try{o(...r)}catch(l){i=l}try{n(...r)}catch(l){i===void 0?i=l:this._handleError(l)}if(i!==void 0)throw i});try{Object.defineProperty(a,"length",{value:Math.max(o.length,n.length),configurable:!0})}catch(r){}this._hooks[t]=a}else this._hooks[t]=n}getRoot(){let t=this;for(;t&&t instanceof Fe&&t.parent;)t=t.parent;return t}_processBehaviors(t,n=!1){var o,a;if(!t&&!n)return;let r=t!=null?t:{};for(let i of Object.keys(r)){let l=r[i],u=this._behaviorInstances.get(i);u?(o=u.update)==null||o.call(u,l.props):this.domElement?this._attachBehaviorNow(i,l):(this._pendingBehaviors.set(i,l),this._ensureBehaviorMountHook())}if(n){for(let i of[...this._behaviorInstances.keys()]){if(lt(r,i))continue;let l=this._behaviorInstances.get(i);this._behaviorInstances.delete(i);try{(a=l==null?void 0:l.destroy)==null||a.call(l)}catch(u){this._handleError(u)}}for(let i of[...this._pendingBehaviors.keys()])lt(r,i)||this._pendingBehaviors.delete(i)}}_attachBehaviorNow(t,n){try{let o=n.attach(this,n.props)||{};this._behaviorInstances.set(t,o),this._ensureBehaviorTeardownHook()}catch(o){this._handleError(o)}}_ensureBehaviorMountHook(){this._behaviorMountHooked||(this._behaviorMountHooked=!0,this.addHook("Mount",()=>{if(this._pendingBehaviors.size===0)return;let t=this._pendingBehaviors;this._pendingBehaviors=new Map,t.forEach((n,o)=>this._attachBehaviorNow(o,n))}))}_ensureBehaviorTeardownHook(){this._behaviorTeardownHooked||(this._behaviorTeardownHooked=!0,this.addHook("BeforeRemove",()=>{var t;for(let n of this._behaviorInstances.values())try{(t=n.destroy)==null||t.call(n)}catch(o){this._handleError(o)}this._behaviorInstances.clear()}))}getBehavior(t){let n=this;for(;n;){let o=n._behaviorInstances.get(t);if(o)return o;n=n.parent}}getContext(t){let n=this;for(;n&&(!n._context||!lt(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 Fe?n.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(Ct.includes(this.tagName))return`<${this.tagName}${t}>`;let n=this.children.generateHTML();return`<${this.tagName}${t}>${n}</${this.tagName}>`}mount(t,n){if(!t)throw new Error("Missing dom node on bind");if(ue&&this.parent===null&&t.tagName&&t.tagName.toLowerCase()!==this.tagName&&console.warn(`[Domphy] Hydration mismatch at mount root: expected <${this.tagName}> but found <${t.tagName.toLowerCase()}>. The server-rendered DOM does not match the client tree \u2014 check that mount() receives the element generated for THIS component.`),ue&&!n&&this.parent===null&&t.childNodes.length>0&&console.warn("[Domphy] mount() was called without a style element on already-rendered DOM. Reactive style updates after hydration will be dropped \u2014 pass the server-rendered <style> element as the second argument to mount()."),this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children){let o=0;this.children.items.forEach((a,r)=>{let i=t.childNodes[o];if(a instanceof Fe){if(o++,!i)return;ue&&this._devCheckHydrationMatch(a,i,r),a.mount(i)}else if(a.html){let l=a._domSpan();if(i){a.domText=i,a._domExtras=[];for(let u=1;u<l;u++){let d=t.childNodes[o+u];d&&a._domExtras.push(d)}}o+=l}else i?(ue&&i.nodeType!==3&&console.warn(`[Domphy] Hydration mismatch at <${this.tagName}> child ${r}: expected a text node ("${a.text.slice(0,40)}") but found ${i.nodeType===1?`<${i.tagName.toLowerCase()}>`:`node type ${i.nodeType}`}. The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.`),a.domText=i,o++):this.tagName==="textarea"?a.render(t):o++})}if(n){let o=n.sheet;o&&this._hydrateStyles(yi(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_devCheckHydrationMatch(t,n,o){var a,r,i,l;let u=`<${this.tagName}> child ${o}`,d="The server-rendered DOM does not match the client tree \u2014 check the component producing this subtree.";if(n.nodeType!==1){console.warn(`[Domphy] Hydration mismatch at ${u}: expected <${t.tagName}> but found ${n.nodeType===3?`a text node ("${((a=n.textContent)!=null?a:"").slice(0,40)}")`:`node type ${n.nodeType}`}. ${d}`);return}let s=n,m=s.tagName.toLowerCase();if(m!==t.tagName){console.warn(`[Domphy] Hydration mismatch at ${u}: expected <${t.tagName}> but found <${m}>. ${d}`);return}for(let f of["id","class"]){let p=(i=(r=t.attributes)==null?void 0:r.items)==null?void 0:i[f];if(!p||p.value==null)continue;let g=String(p.value),S=(l=s.getAttribute(f))!=null?l:"";g!==S&&console.warn(`[Domphy] Hydration mismatch at ${u} <${t.tagName}>: expected ${f}="${g}" but found ${f}="${S}". ${d}`)}}_hydrateStyles(t){var n;if((n=this.styles)!=null&&n.items)for(let o of this.styles.items){let a=t.get(Ot(o.selectorText)),r=a==null?void 0:a.shift();r&&o.mount(r)}if(this.children)for(let o of this.children.items)o instanceof Fe&&o._hydrateStyles(t)}render(t){let n=this._createDOMNode();t.appendChild(n),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,a=t.getRootNode(),r=a instanceof ShadowRoot?a:document.head;return o||(o=Tn(r)),this.styles.render(o),this.children.items.forEach(i=>{if(i instanceof Fe&&i._portal){let l=i._portal(this.getRoot());l&&i.render(l)}else i.render(n)}),n}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var n;(n=this.domElement)==null||n.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let n=!1,o=()=>{n||(n=!0,t())},a=this._hooks.BeforeRemove;this._beforeRemoveFired=!0;try{a(this,o)}catch(r){this._handleError(r),o()}a.length<2&&!n?o():ue&&!n&&setTimeout(()=>{n||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else t()}}},On=class{constructor(e){this.__domphyRawHTML=!0,this.html=e}};function Ie(e){return new On(e)}function ct(e){return typeof e=="object"&&e!==null&&e.__domphyRawHTML===!0}var mn="\u200B",Dt=class{constructor(e,t){this.type="TextNode",this._imperative=!1,this._domExtras=[],this.parent=t,this.html=ct(e);let n=this.html?e.html:e;this.text=n===""?this.emptyText():String(n)}emptyText(){var e;return((e=this.parent)==null?void 0:e.tagName)==="textarea"?"":mn}_createDOMNode(){let e;if(this._domExtras=[],this.html){let t=document.createElement("template");t.innerHTML=_t(this.text.trim());let n=Array.from(t.content.childNodes);n.length===0?e=document.createTextNode(""):(e=n[0],this._domExtras=n.slice(1))}else e=document.createTextNode(this.text);return this.domText=e,e}_allDomNodes(){let e=[];this.domText&&e.push(this.domText);for(let t of this._domExtras)e.push(t);return e}_domSpan(){if(!this.html)return 1;let e=document.createElement("template");return e.innerHTML=_t(this.text.trim()),Math.max(e.content.childNodes.length,1)}setText(e){let t=ct(e),n=t?e.html:e,o=n===""?this.emptyText():String(n);if(o===this.text&&t===this.html&&this.domText)return;let a=this.html;if(this.text=o,this.html=t,!this.domText)return;if(!a&&!t&&this.domText.nodeType===3){this.domText.nodeValue=o;return}let r=this.domText,i=this._domExtras,l=this._createDOMNode(),u=r.parentNode;if(u){u.insertBefore(l,r);for(let d of this._domExtras)u.insertBefore(d,r);u.removeChild(r);for(let d of i)d.remove()}}_dispose(){this.domText=void 0,this._domExtras=[],this.text=""}generateHTML(){return this.text===mn?"​":this.html?_t(this.text.trim()):so(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t);for(let n of this._domExtras)e.appendChild(n)}},mo=new Set;function wi(){mo.clear()}var Pn=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return ct(e)?new Dt(e,this.owner):typeof e=="object"&&e!==null?new J(e,this.owner,this._nextKey++):new Dt(e==null?"":String(e),this.owner)}_domReferenceAfter(e){let t=this.owner.domElement;if(!t)return null;for(let n=e;n<this.items.length;n++){let o=this.items[n],a=o instanceof J?o.domElement:o.domText;if(a&&a.parentNode===t)return a}return null}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof J?e.domElement?[e.domElement]:[]:e._allDomNodes();if(o.length===0)return;let a=this._domReferenceAfter(t+1);for(let r of o)r!==a&&n.insertBefore(r,a)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=e instanceof J?e.domElement?[e.domElement]:[]:e._allDomNodes(),a=t instanceof J?t.domElement?[t.domElement]:[]:t._allDomNodes();if(o.length===0||a.length===0)return;let r=document.createComment("");n.insertBefore(r,o[0]);let i=a[a.length-1].nextSibling;for(let l of o)n.insertBefore(l,i);for(let l of a)n.insertBefore(l,r);r.remove()}update(e,t=!0,n=!1){var o,a,r,i;if(this.items.some(S=>S._imperative)){let S=this.items.filter(v=>!v._imperative),E=this.items.filter(v=>v._imperative);this.items=S.concat(E)}let l=this.items.slice(),u=new Map;for(let S of l)S instanceof J&&S.key!==null&&S.key!==void 0&&!S._imperative&&!S._beforeRemoveFired&&u.set(S.key,S);!n&&this.owner.domElement&&((a=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||a.call(o,this.owner,e));let d=new Set(l),s=new Set,m=!1,f=0,p=ue&&l.length>0?e.length!==l.length:!1;for(let S=0;S<e.length;S++){let E=e[S],v=typeof E=="object"&&E!==null&&!ct(E),k=v?E._key:void 0,T=v?kn(E):void 0;if(ue&&v&&k===void 0&&f++,k!==void 0){let w=u.get(k);if(w instanceof J&&w.tagName===T){u.delete(k),m=!0;let O=this.items.indexOf(w);O!==S&&O>=0&&this.move(O,S,!1,!0),w.parent=this.owner,w.patch(E),s.add(w);continue}}else if(v){let w=this.items[S];if(w instanceof J&&w.key==null&&w.tagName===T&&d.has(w)&&!s.has(w)&&!w._imperative&&!w._beforeRemoveFired){w.parent=this.owner,w.patch(E),s.add(w);continue}}else{let w=this.items[S];if(w instanceof Dt&&d.has(w)&&!s.has(w)&&!w._imperative){w.setText(E==null?"":E),s.add(w);continue}}s.add(this.insert(E,S,t,!0,!0))}let g=this.items.slice(e.length);for(let S of g)S._imperative||this.remove(S,t,!0);if(u.forEach(S=>this.remove(S,t,!0)),m&&t&&this.owner.domElement){let S=new Map;for(let E=0;E<l.length;E++)S.set(l[E],E);this._placeKeyedDom(S)}if(ue&&l.length>0&&f>0&&p){let S=this.owner.nodeId;if(!mo.has(S)){mo.add(S);let E=`[domphy] unkeyed list length changed \u2014 DOM nodes reused by position may not match their data slot (focus/scroll/input-value drift). Add _key to each item. (parent <${this.owner.tagName}>, ${f} unkeyed item${f===1?"":"s"})`;console.warn(E)}}n||(i=(r=this.owner._hooks)==null?void 0:r.Update)==null||i.call(r,this.owner)}_placeKeyedDom(e){var t;let n=this.owner.domElement;if(!n)return;let o=[],a=this.items;for(let d=0;d<a.length;d++){let s=a[d];if(s._imperative||s instanceof J&&s._beforeRemoveFired){o.push(-2);continue}if(s instanceof J&&s._portal){o.push(-2);continue}o.push((t=e.get(s))!=null?t:-1)}let r=new Set,i=[],l=[];for(let d=0;d<o.length;d++)o[d]>=0&&(i.push(d),l.push(o[d]));if(l.length>0){let d=[],s=[],m=new Array(l.length).fill(-1);for(let p=0;p<l.length;p++){let g=0,S=d.length;for(;g<S;){let E=g+S>>1;d[E]<l[p]?g=E+1:S=E}d[g]=l[p],s[g]=p,g>0&&(m[p]=s[g-1])}let f=s[d.length-1];for(;f!==void 0&&f>=0;)r.add(i[f]),f=m[f]}let u=null;for(let d=o.length-1;d>=0;d--){if(o[d]===-2)continue;let s=a[d],m=s instanceof J?s.domElement?[s.domElement]:[]:s._allDomNodes();if(m.length!==0){if(!r.has(d)){let f=u;for(let p=m.length-1;p>=0;p--){let g=m[p];g.nextSibling!==f&&n.insertBefore(g,f),f=g}}u=m[0]}}}insert(e,t,n=!0,o=!1,a=!1){let r=this.items.length,i=typeof t!="number"||Number.isNaN(t)||t<0||t>r?r:t,l=this._createNode(e);if(l._imperative=!a,this.items.splice(i,0,l),l instanceof J){l._hooks.Insert&&l._hooks.Insert(l);let u=this.owner.domElement;if(n&&u)if(l._portal){let d=l._portal(this.owner.getRoot());d&&l.render(d)}else{let d=l._createDOMNode(),s=this._domReferenceAfter(i+1);u.insertBefore(d,s);let m=u.getRootNode(),f=m instanceof ShadowRoot?m:document.head,p=Tn(f);l.styles.render(p),l._hooks.Mount&&l._hooks.Mount(l),l.children.items.forEach(g=>{if(g instanceof J&&g._portal){let S=g._portal(g.getRoot());S&&g.render(S)}else g.render(d)})}}else{let u=this.owner.domElement;if(n&&u){let d=l._createDOMNode(),s=this._domReferenceAfter(i+1);u.insertBefore(d,s);for(let m of l._domExtras)u.insertBefore(m,s)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),l}remove(e,t=!0,n=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof J){if(e._beforeRemoveFired)return;let a=()=>{let r=e.domElement,i=this.items.indexOf(e);i>=0&&this.items.splice(i,1),t&&r&&r.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let r=!1,i=()=>{r||(r=!0,a())},l=e._hooks.BeforeRemove;e._beforeRemoveFired=!0;try{l(e,i)}catch(u){e._handleError(u),i()}l.length<2&&!r?i():ue&&!r&&setTimeout(()=>{r||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter (e.g. an exit animation) but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else a()}else{if(this.items.splice(o,1),t)for(let a of e._allDomNodes())a.remove();e._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,n=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let a=this.items[e],r=this.items[t];this.items[e]=r,this.items[t]=a,n&&this._swapDomElement(a,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,n=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let a=this.items[e];this.items.splice(e,1),this.items.splice(t,0,a),n&&this._moveDomElement(a,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},Me=new Set,ho=!1;function Ln(e){Me.add(e),!ho&&(ho=!0,Pt(Mn))}function Mn(){for(ho=!1;Me.size>0;){let e=[...Me];Me.clear();for(let t of e)try{t()}catch(n){console.error("[Domphy] Uncaught error in effect:",n)}}}function In(){let e=0;for(;bn()||Me.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}vn(),Mn()}}var st=[];function Ei(){return st.length?st[st.length-1]:null}function yo(e){let t=Ei();t&&t._add(e)}var ki=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){if(this._stopped)return ue&&console.warn("[Domphy] effectScope.run() called after stop() \u2014 resources created inside are registered to the enclosing scope instead of this stopped one."),e();st.push(this);try{return e()}finally{st.pop()}}stop(){if(this._stopped)return;this._stopped=!0;let e,t=!1;for(let n of this._disposers)try{n()}catch(o){t?console.error("[Domphy] Additional error during effectScope.stop():",o):(e=o,t=!0)}if(this._disposers.clear(),t)throw e}};function Ci(){let e=new ki;return yo(()=>e.stop()),e}function mt(e){let t=!1,n=!1,o=()=>{t||r()},a=new Sn(()=>{t||Ln(o)}),r=()=>{if(!(t||n)){n=!0,a.reset();try{xn(a,e)}finally{n=!1}}},i=()=>{t||(t=!0,a.reset(),Me.delete(o))};yo(i);try{r()}catch(l){throw i(),l}return i}function Ti(e){let t="computed",n=new ut,o,a=!0,r=!1,i=0,l=!1,u=()=>{l||!a||n.listenerCount(t)>0&&m()},d=new Sn(()=>{l||(a=!0,Ln(u))});n._onEmpty=()=>{d.reset(),a=!0};let s=()=>{d.reset();try{o=xn(d,e)}catch(p){throw a=!0,p}i++,n._version=i,a=!1,r=!0},m=()=>{let p=o,g=r;s(),!(g&&o===p)&&n.notify(t,o)},f=p=>{if(l)return o;let g=null;return p?n.addListener(t,p):(g=po(),g&&n.addListener(t,g.handler)),a&&(r&&n.listenerCount(t)>0?m():s()),g==null||g._consumedVersions.set(n,i),o};return yo(()=>{l||(l=!0,d.reset(),Me.delete(u),n._dispose())}),{_isState:!0,_notifier:n,get:f}}function _i(e){return yn(e)}function Di(e){return go(e)}function Oi(e,t,n){let o,a=!0;return mt(()=>{let r=typeof e=="function"?e():e.get();(!a||n!=null&&n.immediate)&&t(r,o),o=r,a=!1})}function Pi(e){let t=new Promise(n=>{Pt(()=>{In(),n()})});return e?t.then(e):t}var Li=class{constructor(e){this._notifier=new ut,this.initialRecord=no({},e),this._record=no({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let n=po();n&&this._notifier.addListener(e,n.handler)}return this._record[e]}set(e,t){Object.is(this._record[e],t)||(this._record[e]=t,this._notifier.notify(e,t))}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var Bt={};kt(Bt,{COLOR_ROLES:()=>Vi,ElementTones:()=>ht,Palette:()=>oa,Ramp:()=>jn,Swatch:()=>Eo,TONE_STEPS:()=>G,ToneAliases:()=>zt,applySystemTheme:()=>Bi,calcDeltaE2000:()=>Oo,calcScore:()=>Po,calcStatistics:()=>Gi,contrastRatio:()=>Yi,createMonotone:()=>$t,cssRgbToRgb:()=>Ui,fromLightnessEAL:()=>Ki,generateRamp:()=>Hn,generateTheme:()=>aa,getTheme:()=>Re,hexToRgb:()=>me,isValidHex:()=>zn,labToLch:()=>Bn,labToRgb:()=>An,lchToLab:()=>qi,mix:()=>Xi,normalizeHex:()=>Do,oklabToRgb:()=>At,resolveThemeColor:()=>ca,rgbToHex:()=>we,rgbToLab:()=>Xe,rgbToOklab:()=>pt,rootMeanSquare:()=>qe,scale:()=>Ji,setTheme:()=>$i,themeApply:()=>Ni,themeCSS:()=>So,themeColor:()=>c,themeColorToken:()=>Lo,themeDensity:()=>y,themeFluidSpacing:()=>Ai,themeName:()=>Nt,themeSize:()=>x,themeSpacing:()=>h,themeTokens:()=>_o,themeVars:()=>Rt,toLightnessEAL:()=>Nn});var j=Math.pow,Mi={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#ffe5e5","#ffcaca","#ffaeae","#ff9191","#ff7474","#ff5757","#f93a3a","#e82222","#d40f0f","#b80000","#9c0000","#800000","#640000","#480000","#2c0000","#140000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,attention:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},ft=Mi,Co=e=>JSON.parse(JSON.stringify(e)),dt=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),Ye={light:Co(ft),dark:zi(ft)},G=ft.colors.neutral.length,Ue=8,Mt=5,It=null,vo=new Map;function To(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Ge(e,t){if(/[;}]/.test(e)||/<\/\s*style/i.test(e))throw new Error(`${t} contains unsafe CSS characters (";", "}", or "</style") \u2014 theme values are interpolated into a <style> block`)}function Ii(e){for(let t in e)if(!Object.keys(ft).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes!==void 0){if(!(Array.isArray(e.fontSizes)&&e.fontSizes.length===Ue&&e.fontSizes.every(t=>typeof t=="string"&&t.length>0)))throw new Error(`fontSize must be array of ${Ue} non-empty string (the size scale has ${Ue} steps: 0\u2013${Ue-1})`);e.fontSizes.forEach((t,n)=>Ge(t,`fontSizes[${n}]`))}if(e.densities){if(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number"))throw new Error("densities must be array of number");if(e.densities.length!==Mt)throw new Error(`densities must have exactly ${Mt} entries (the density scale has ${Mt} steps: 0\u2013${Mt-1}), got ${e.densities.length}`);if(e.densities.some(t=>!Number.isFinite(t)||t<=0))throw new Error("densities entries must be positive finite numbers")}if(e.darkBias!==void 0){let t=e.darkBias;if(typeof t!="number"||!Number.isInteger(t)||t<0||t>G-1)throw new Error(`darkBias must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object");for(let n in t){let o=t[n];typeof o=="string"&&Ge(o,`custom.${n}`)}}if("colors"in e){let t=e.colors;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(n=>Array.isArray(n)&&n.every(o=>typeof o=="string"))))throw new Error("colors must be an object of string[]");for(let n in t){Ge(n,`colors role "${n}"`);let o=t[n];if(o.length!==G)throw new Error(`colors.${n} must have exactly ${G} tone steps (got ${o.length}) \u2014 the tone model is fixed at shift-0\u2026shift-${G-1}`);if(o.some(a=>a.length===0))throw new Error(`colors.${n} must contain only non-empty strings`);o.forEach((a,r)=>Ge(a,`colors.${n}[${r}]`))}}if("baseTones"in e){let t=e.baseTones;if(!(typeof t=="object"&&t!==null&&Object.values(t).every(n=>typeof n=="number")))throw new Error("baseTones must be an object of number");for(let n in t){let o=t[n];if(!Number.isInteger(o)||o<0||o>G-1)throw new Error(`baseTones.${n} must be an integer between 0 and ${G-1} (the tone ramp has ${G} steps)`)}}if("direction"in e&&e.direction!=="lighten"&&e.direction!=="darken")throw new Error('direction must be "lighten" or "darken"')}function $n(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]={}),$n(e[o],t[o])):e[o]=t[o])}function Ri(e,t){Ge(e,"theme name");let n={},o=To(t),a=dt(e);for(let i in t){let l=t[i];if(i==="colors")for(let u in t.colors){let d=dt(u);[...Array(o).keys()].forEach(s=>n[`--${d}-${s}`]=t.colors[u][s])}else if(i==="fontSizes")[...Array(Ue).keys()].forEach(u=>n[`--fontSize-${u}`]=t.fontSizes[u]);else if(i==="custom"&&l&&typeof l=="object")for(let u in l)n[`--custom-${dt(u)}`]=l[u]}let r="";for(let i in n)r+=` ${i}: ${n[i]};
|
|
4
4
|
`;return`[data-theme="${a}"] {
|
|
5
|
-
${r}}`}function Re(e){if(!Ye[e])throw Error(`Theme "${e}" not found`);return Ye[e]}function
|
|
6
|
-
`)}function zi(e){var t;if(typeof document!="undefined")if(e){e.textContent=vo();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=vo(),document.head.appendChild(e)}function h(e){return`calc(${e/4}em)`}var yo=16;function Ni(e,t,n=320,o=1280){let a=e/4,r=t/4,i=a*yo,l=(r*yo-i)/(o-n)*100,u=(i-l*n/100)/yo,d=parseFloat(l.toFixed(4)),s=parseFloat(u.toFixed(4)),m=s===0?`${d}vw`:`${s}em + ${d}vw`;return`clamp(${a}em, ${m}, ${r}em)`}function Ai(e,t={}){if(typeof document=="undefined")throw new Error('applySystemTheme() requires a browser DOM \u2014 "document" is not defined. For SSR, call it only on the client (e.g. inside an _onMount lifecycle hook, or behind a typeof window !== "undefined" guard).');let n=e!=null?e:document.documentElement,{persist:o=!0,storageKey:a="dp-theme"}=t,r=()=>{if(o){let u=localStorage.getItem(a);if(u==="light"||u==="dark")return u}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};n.setAttribute("data-theme",r());let i=window.matchMedia("(prefers-color-scheme: dark)"),l=u=>{(!o||!localStorage.getItem(a))&&n.setAttribute("data-theme",u.matches?"dark":"light")};return i.addEventListener("change",l),()=>i.removeEventListener("change",l)}function zt(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 Bi=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],So=["inherit"];[...Array(5).keys()].forEach(e=>{So.push(`decrease-${e}`),So.push(`increase-${e}`)});function Vi(e,t="inherit"){if(!So.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 Hi(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=Vi(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function y(e){let t=Hi(e);return Re(e?zt(e):"light").densities[t]}var ji=e=>{let t=n=>{let o=Math.max(0,Math.min(1,n)),a=o<=.0031308?12.92*o:1.055*j(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(a*255)))};return e.map(t)},Fi=e=>{let t=n=>n>.04045?j((n+.055)/1.055,2.4):n/12.92;return e.map(t)},we=e=>{let[t,n,o]=ji(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}`},$n=e=>typeof e=="string"&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e),To=e=>{if(!$n(e))throw new Error(`Invalid hex color "${e}": expected "#rgb", "#rgba", "#rrggbb", or "#rrggbbaa" (hex digits 0-9, a-f, case-insensitive).`);let t=e.slice(1).toLowerCase();return t.length<=4&&(t=t.split("").map(n=>n+n).join("")),`#${t}`},me=e=>{let t=To(e),n=parseInt(t.slice(1,3),16)/255,o=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255;return Fi([n,o,a])},ft=e=>{let t=.4122214708*e[0]+.5363325363*e[1]+.0514459929*e[2],n=.2119034982*e[0]+.6806995451*e[1]+.1073969566*e[2],o=.0883024619*e[0]+.2817188376*e[1]+.6299787005*e[2],a=Math.cbrt(t),r=Math.cbrt(n),i=Math.cbrt(o);return[.2104542553*a+.793617785*r-.0040720468*i,1.9779984951*a-2.428592205*r+.4505937099*i,.0259040371*a+.7827717662*r-.808675766*i]},Nt=e=>{let[t,n,o]=e,a=t+.3963377774*n+.2158037573*o,r=t-.1055613458*n-.0638541728*o,i=t-.0894841775*n-1.291485548*o,l=a*a*a,u=r*r*r,d=i*i*i;return[4.0767416621*l-3.3077115913*u+.2309699292*d,-1.2684380046*l+2.6097574011*u-.3413193965*d,-.0041960863*l-.7034186147*u+1.707614701*d]},zn=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,u=.1307,d=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,m=0;return(r<=90||r>=270)&&(m=u*Math.abs(Math.cos(r*(Math.PI/180)))+d),t+(s+m)*a},Wi=(e,t)=>{let[,n,o]=t,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,u=.1307,d=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,m=0;return(r<=90||r>=270)&&(m=u*Math.abs(Math.cos(r*(Math.PI/180)))+d),Math.max(0,e-(s+m)*a)},Ki=e=>{let[t,n,o]=e,a=o*Math.PI/180;return[t,n*Math.cos(a),n*Math.sin(a)]},Xe=e=>{let[t,n,o]=e,a=.4124564*t+.3575761*n+.1804375*o,r=.2126729*t+.7151522*n+.072175*o,i=.0193339*t+.119192*n+.9503041*o,l=.95047,u=1,d=1.08883,s=g=>g>.008856?Math.cbrt(g):7.787*g+16/116,m=s(a/l),f=s(r/u),p=s(i/d);return[116*f-16,500*(m-f),200*(f-p)]},Nn=e=>{let[t,n,o]=e,a=(t+16)/116,r=n/500+a,i=a-o/200,l=g=>j(g,3)>.008856?j(g,3):(g-16/116)/7.787,u=.95047,d=1,s=1.08883,m=l(r)*u,f=l(a)*d,p=l(i)*s;return[3.2404542*m-1.5371385*f-.4985314*p,-.969266*m+1.8760108*f+.041556*p,.0556434*m-.2040259*f+1.0572252*p]},An=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o);if(a<1e-4)return[t,0,0];let r=(Math.atan2(o,n)*180/Math.PI+360)%360;return r>=359.9999&&(r=0),[t,a,r]},Do=(e,t)=>{let[n,o,a]=e,[r,i,l]=t,u=Math.hypot(o,a),d=Math.hypot(i,l),s=(u+d)/2,m=.5*(1-Math.sqrt(j(s,7)/(j(s,7)+j(25,7)))),f=o*(1+m),p=i*(1+m),g=Math.hypot(f,a),S=Math.hypot(p,l),E=(g+S)/2,v=(Q,R)=>{if(Q===0&&R===0)return 0;let U=Math.atan2(R,Q)*180/Math.PI;return U>=0?U:U+360},C=v(f,a),_=v(p,l),w=_-C,O=Math.abs(w),D=C+_,I=g*S===0,F;I?F=0:O<=180?F=w:w>180?F=w-360:F=w+360;let A;I?A=D:O<=180?A=D/2:D<360?A=(D+360)/2:A=(D-360)/2;let B=1-.17*Math.cos((A-30)*Math.PI/180)+.24*Math.cos(2*A*Math.PI/180)+.32*Math.cos((3*A+6)*Math.PI/180)-.2*Math.cos((4*A-63)*Math.PI/180),ie=r-n,q=S-g,Z=2*Math.sqrt(g*S)*Math.sin(F/2*Math.PI/180),te=(n+r)/2,Y=1+.015*j(te-50,2)/Math.sqrt(20+j(te-50,2)),oe=1+.045*E,ae=1+.015*E*B,ne=30*Math.exp(-j((A-275)/25,2)),ee=-(2*Math.sqrt(j(E,7)/(j(E,7)+j(25,7))))*Math.sin(2*ne*Math.PI/180);return Math.sqrt(j(ie/Y,2)+j(q/oe,2)+j(Z/ae,2)+ee*(q/oe)*(Z/ae))},qi=e=>{let t=()=>new Error(`Invalid CSS rgb() "${e}": expected "rgb(r, g, b)" with channels 0-255 or 0%-100% (comma or space separated, optional alpha after "," or "/").`),n=/^\s*rgba?\(\s*(.+?)\s*\)\s*$/i.exec(e);if(!n)throw t();let o=n[1].split("/")[0],a=o.includes(",")?o.split(",").map(l=>l.trim()).slice(0,3):o.trim().split(/\s+/);if(a.length!==3)throw t();let r=a.map(l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l));if(r.some(l=>!Number.isFinite(l)))throw t();let i=l=>{let u=l/255;return u<=.04045?u/12.92:j((u+.055)/1.055,2.4)};return r.map(i)},Rt=e=>{if(e.length<1)return d=>0;let t=[...e].sort((d,s)=>d[0]-s[0]),n=[];for(let d=0;d<t.length;d++)(d===0||t[d][0]!==t[d-1][0])&&n.push(t[d]);let o=n.length;if(o===1)return d=>n[0][1];let a=n.map(d=>d[0]),r=n.map(d=>d[1]),i=[],l=[];for(let d=0;d<o-1;d++)i[d]=a[d+1]-a[d],l[d]=(r[d+1]-r[d])/i[d];let u=new Array(o);u[0]=l[0],u[o-1]=l[o-2];for(let d=1;d<o-1;d++){let s=l[d-1],m=l[d];if(s*m<=0)u[d]=0;else{let f=(1+i[d]/(i[d-1]+i[d]))/3;u[d]=s*m/((1-f)*s+f*m)}}return d=>{if(d<=a[0])return r[0];if(d>=a[o-1])return r[o-1];let s=0,m=o-2,f=0;for(;s<=m;){let _=Math.floor((s+m)/2);if(d>=a[_]&&d<=a[_+1]){f=_;break}d<a[_]?m=_-1:s=_+1}let p=i[f],g=(d-a[f])/p,S=g*g,E=S*g,v=u[f]*p,C=u[f+1]*p;return(2*E-3*S+1)*r[f]+(E-2*S+g)*v+(-2*E+3*S)*r[f+1]+(E-S)*C}};function qe(e){let t=e.length;if(t===0)return 0;let n=0;for(let o=0;o<t;o++)n+=e[o]*e[o];return Math.sqrt(n/t)}var Ui=e=>{let t=e.length;if(t===0)return{min:0,max:0,avg:0};let n=e[0],o=e[0],a=0;for(let r=0;r<t;r++){let i=e[r];i<n&&(n=i),i>o&&(o=i),a+=i}return{min:n,max:o,avg:a/t}},Oo=e=>{let t=e.length;if(t===0)return 0;let n=1e-6,o=e.reduce((i,l)=>i*(l+n),1),a=j(o,1/t),r=Math.max(0,Math.min(1,a));return parseFloat((r*100).toFixed(2))},Gi=(e,t)=>{let[n,o,a]=me(e),[r,i,l]=me(t),u=.2126*n+.7152*o+.0722*a,d=.2126*r+.7152*i+.0722*l,s=Math.max(u,d),m=Math.min(u,d);return(s+.05)/(m+.05)},Yi=(e,t,n=.5,o="oklab")=>{let a=Math.max(0,Math.min(1,n)),r=me(e),i=me(t);if(o==="rgb")return we(r.map((d,s)=>d+a*(i[s]-d)));if(o==="lab"){let d=Xe(r),s=Xe(i);return we(Nn(d.map((m,f)=>m+a*(s[f]-m))))}let l=ft(r),u=ft(i);return we(Nt(l.map((d,s)=>d+a*(u[s]-d))))},Xi=(e,t)=>{if(e.length<2)throw new Error("scale() requires at least 2 colors");if(t<1)return[];if(t===1)return[we(me(e[0]))];let n=e.map(r=>ft(me(r))),o=n.length-1,a=[];for(let r=0;r<t;r++){let i=r/(t-1)*o,l=Math.min(Math.floor(i),o-1),u=i-l,d=n[l],s=n[l+1];a.push(we(Nt(d.map((m,f)=>m+u*(s[f]-m)))))}return a},Bn=.605,xo=.685;function Ji(e){let t=j(e,Bn);return t/(1+xo*(1-t))}function Zi(e){let t=e*(1+xo)/(1+e*xo);return j(t,1/Bn)}function Qi(e,t){return Math.sqrt(j(e[0]-t[0],2)+j(e[1]-t[1],2)+j(e[2]-t[2],2))}function ea(e){let t=[[0,0,0],...e,[1,1,1]].map(s=>ft(s)),n=t.map(s=>s[0]),o=t.map(s=>s[1]),a=t.map(s=>s[2]),r=[0],i=0;for(let s=1;s<t.length;s++)i+=Qi(t[s],t[s-1]),r.push(i);let l=r.map(s=>Zi(i>0?s/i:0)),u=Rt(l.map((s,m)=>[s,o[m]])),d=Rt(l.map((s,m)=>[s,a[m]]));return{colorAtParam:s=>{let m=Ji(s),f=0;for(let _=0;_<l.length-1;_++)if(m<=l[_+1]){f=_;break}let p=l[f],g=l[f+1],S=(m-p)/(g-p||1),E=n[f]+S*(n[f+1]-n[f]),v=u(m),C=d(m);return Nt([E,v,C])},parameters:l.slice(1,-1)}}function Vn(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[we(me(n[0]))];let o=n.map(s=>we(me(s))).reverse(),{colorAtParam:a,parameters:r}=ea([...n.map(me)].reverse()),i=[],l=[0,...r,1],u=l.map(s=>Math.round(s*(t-1))),d=0;for(let s=0;s<t;s++){for(;d<u.length-2&&s>u[d+1];)d++;let m=u[d],f=u[d+1],p=l[d],g=l[d+1],S;if(f<=m)S=p;else{let E=(s-m)/(f-m);S=p+E*(g-p)}i.push(we(a(S)))}if(o.length>1)for(let s=0;s<o.length;s++){let m=u[s+1];m>=0&&m<i.length&&(i[m]=o[s])}return i.reverse()}var wo=class{constructor(e){this.hex=e}get rgb(){return me(this.hex)}get lab(){return Xe(this.rgb)}get lch(){return An(this.lab)}get lightness(){return zn(this.lab)}get chroma(){return this.lch[1]}get hue(){return this.lch[2]}get luminance(){let[e,t,n]=this.rgb;return .2126*e+.7152*t+.0722*n}},Hn=class{constructor(e=[],t="brand"){this.swatches=e.map(n=>new wo(n)),this.name=t}get colors(){return this.swatches.map(e=>e.hex)}get peakChroma(){let e=this.colors.slice(2,-2),t="",n=-1/0;for(let o of e){let a=new wo(o);a.chroma>n&&(n=a.chroma,t=o)}return n<6?this.colors[Math.ceil(this.steps/2)]:t}get steps(){return this.colors.length}get baseColor(){return this.colors.length===0?"":this.peakChroma||this.colors[Math.floor(this.colors.length/2)]}get baseIndex(){return this.colors.length===0?-1:this.colors.findIndex(e=>e.toLowerCase()===this.baseColor.toLowerCase())}get wcag(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let a of[30,45,70])o[a]={efficiency:1,target:a/10,span:0,value:0};return o}for(let a of[30,45,70]){let r=a/10,i=n,l=0;for(let u=1;u<t;u++){let d=1/0;for(let s=0;s<t-u;s++){let m=e[s].luminance,f=e[s+u].luminance,p=(Math.max(m,f)+.05)/(Math.min(m,f)+.05);p<d&&(d=p)}if(d>=r){i=u,l=d;break}u===n&&(l=d)}o[a]={efficiency:i/n,target:r,span:i,value:l}}return o}get apca(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let r of[45,60,75])o[r]={efficiency:1,target:r,span:0,value:0};return o}let a=(r,i)=>{let l=Math.SQRT2,u=r<.022?r+j(.022-r,l):r,d=i<.022?i+j(.022-i,l):i,s=d>=u?(j(d,.56)-j(u,.57))*114:(j(d,.65)-j(u,.62))*114;return Math.abs(s)<10?0:(s=s>0?s-2.7:s+2.7,Math.round(s))};for(let r of[45,60,75]){let i=r,l=n,u=0;for(let d=1;d<t;d++){let s=1/0;for(let m=0;m<t-d;m++){let f=e[m].luminance>e[m+d].luminance?e[m].luminance:e[m+d].luminance,p=e[m].luminance>e[m+d].luminance?e[m+d].luminance:e[m].luminance,g=Math.abs(a(p,f));g<s&&(s=g)}if(s>=i){l=d,u=s;break}d===n&&(u=s)}o[r]={efficiency:l/n,target:i,span:l,value:u}}return o}get deltaECurve(){let e=[0];for(let t=1;t<this.swatches.length;t++){let n=Do(this.swatches[t-1].lab,this.swatches[t].lab);e.push(e[t-1]+n)}return e}get unwrapHues(){let e=this.swatches.map(n=>n.hue).slice(1,-1);if(e.length===0)return[];let t=[e[0]];for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];o>180?o-=360:o<-180&&(o+=360),t.push(t[n-1]+o)}return t}get lightnessLinearity(){let e=this.swatches.map(m=>m.lightness),t=e.length;if(t<2)return 1;let n=0,o=0,a=0,r=0;for(let m=0;m<t;m++)n+=m,o+=e[m],a+=m*e[m],r+=m*m;let i=t*r-n*n;if(Math.abs(i)<1e-10)return 1;let l=(t*a-n*o)/i,u=(o-l*n)/t;if(Math.abs(l*(t-1))<.001)return 1;let d=0,s=0;for(let m=0;m<t;m++){let f=l*m+u,p=e[m]-f;d+=p*p;let g=Math.max(f-Math.min(u,l*(t-1)+u),Math.max(u,l*(t-1)+u)-f);s+=g*g}return Math.max(0,Math.min(1,1-Math.sqrt(d/t)/Math.sqrt(s/t)))}get chromaSmoothness(){let e=this.swatches.map(m=>m.chroma),t=e.length;if(t<3)return 1;let n=133.8,o=Math.max(...e);if(o<=.01)return 1;let a=e.map(m=>m/o*n),r=Math.min(...a),i=Math.max(...a),l=a.indexOf(i),u=Rt([[0,a[0]],[l,i],[t-1,a[t-1]]]),d=0,s=0;for(let m=0;m<t;m++){let f=u(m),p=a[m]-f;d+=p*p,s+=j(Math.max(f-r,i-f),2)}return Math.max(0,Math.min(1,1-Math.sqrt(d/t)/Math.sqrt(s/t)))}get spacingUniformity(){let e=this.deltaECurve,t=e.length;if(t<2)return 1;let n=[];for(let i=1;i<t;i++){let l=e[i]-e[i-1];if(l<0)return 0;n.push(l)}let o=n.reduce((i,l)=>i+l,0)/n.length;if(o<=1e-6)return 0;let a=0;for(let i of n)a+=j(i-o,2);let r=Math.sqrt(a/n.length)/o;return Math.max(0,Math.min(1,1/(1+r)))}get hueStability(){var e,t,n;let o=this.unwrapHues,a=o.length;if(a<2)return 1;let r=(n=(t=o[this.baseIndex-1])!=null?t:(e=this.swatches[this.baseIndex])==null?void 0:e.hue)!=null?n:0,i=0,l=0;for(let u=0;u<a;u++){let d=Math.abs(o[u]-r)%360;d>180&&(d=360-d),i+=d*d;let s=u/(a-1)*180;l+=s*s}return Math.max(0,Math.min(1,1-Math.sqrt(i/a)/(Math.sqrt(l/a)||1)))}get contrastEfficiency(){let e=this.wcag[45].span,t=this.steps;if(t<=1)return 1;let n=.501,o=e/(t-1);return o<=n?1:o>=1?0:1-(o-n)/(1-n)}get metrics(){return{lightnessLinearity:this.lightnessLinearity,chromaSmoothness:this.chromaSmoothness,spacingUniformity:this.spacingUniformity,hueStability:this.hueStability,contrastEfficiency:this.contrastEfficiency}}get score(){return Oo(Object.values(this.metrics))}},ta=class{constructor(e={},t="Collection 1"){this.ramps=Object.entries(e).map(([n,o])=>new Hn(o,n)),this.name=t}get colors(){return Object.fromEntries(this.ramps.map(e=>[e.name,e.colors]))}get steps(){var e;return((e=this.ramps[0])==null?void 0:e.steps)||0}get wcag(){let e={},t=this.steps;for(let n of[30,45,70]){let o=this.ramps.map(i=>i.wcag[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n/10,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get apca(){let e={},t=this.steps;for(let n of[45,60,75]){let o=this.ramps.map(i=>i.apca[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get contrastEfficiency(){return qe(this.ramps.map(e=>e.contrastEfficiency))}get lightnessLinearity(){return qe(this.ramps.map(e=>e.lightnessLinearity))}get chromaSmoothness(){return qe(this.ramps.map(e=>e.chromaSmoothness))}get hueStability(){return qe(this.ramps.map(e=>e.hueStability))}get spacingUniformity(){return qe(this.ramps.map(e=>e.spacingUniformity))}get score(){return Oo([this.contrastEfficiency,this.lightnessLinearity,this.chromaSmoothness,this.hueStability,this.spacingUniformity])}},oa=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],na=[.75,1,1.5,2,2.5];function ra(e,t){let n=Xe(me(t)),o=0,a=1/0;for(let r=0;r<e.length;r++){let i=Do(n,Xe(me(e[r])));i<a&&(a=i,o=r)}return o}function ia(e,t={}){var n,o,a,r,i;if(t.steps!==void 0&&t.steps!==G)throw new Error(`generateTheme() steps must be ${G} (the tone model is fixed at shift-0\u2026shift-${G-1}), got ${t.steps}`);let l=G,u={},d={};for(let[s,m]of Object.entries(e)){let f;try{f=To(m)}catch(g){throw new Error(`baseColors.${s}: ${g instanceof Error?g.message:String(g)}`)}let p=Vn(f,l);u[s]=p,d[s]=ra(p,f)}return{direction:(n=t.direction)!=null?n:"darken",colors:u,baseTones:d,fontSizes:(o=t.fontSizes)!=null?o:oa,densities:(a=t.densities)!=null?a:na,darkBias:(r=t.darkBias)!=null?r:1,custom:(i=t.custom)!=null?i:{}}}var Eo=["inherit"];[...Array(8).keys()].forEach(e=>{Eo.push(`decrease-${e}`),Eo.push(`increase-${e}`)});function jn(e,t="inherit"){if(!Eo.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 aa(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=jn(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function x(e,t="inherit"){let n=jn(aa(e),t);return It().fontSizes[n]}var $t={surface:"shift-1",hover:"shift-2",border:"shift-3","border-strong":"shift-4",muted:"shift-8",text:"shift-9"},dt=["inherit","base",...Object.keys($t)];[...Array(G).keys()].forEach(e=>{dt.push(`decrease-${e}`),dt.push(`increase-${e}`),dt.push(`shift-${e}`)});function In(e,t){if(e<0||e>G-1)return e;let n=e+t;return n=Math.max(0,Math.min(G-1,n)),n}function la(e,t){if(e<0||e>G-1)return e;let n=Math.floor((G-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(G-1,o)),o}function Je(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!dt.includes(t))throw Error(`tone name "${t}" invalid`);if(t in $t&&(t=$t[t]),t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return In(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return In(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return la(e,n)}else return e}function Fn(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=Je(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function Wn(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===G-1?G-1-n:e}function pt(e,t){let n=Re(e).baseTones[t];if(n===void 0)throw new Error(`baseTones.${t} is not defined on theme "${e}" \u2014 set a base tone index (0\u2013${G-1}) via setTheme("${e}", { baseTones: { ${t}: <index> } }) so themeColor(..., "base", "${t}") can resolve`);return n}function c(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e){let l=It()[o];if(!l)throw Error(`color "${o}" not found on theme "light"`);return t==="base"?l[pt("light",o)]:l[Je(0,t)]}let a=zt(e),r=It()[o];if(!r)throw Error(a==="light"?`color "${o}" not found on theme "light"`:`color "${o}" not found on the "light" theme (required by node theme "${a}") \u2014 themeColor() var references are keyed on the "light" theme structure; register the role on "light" as well (e.g. setTheme("light", { colors: { ${o}: \u2026 } })) so the shared CSS-var baseline includes it`);let i;if(t==="base")i=pt(a,o);else{let l=Re(a),u=Wn(Fn(e),l.direction,l.darkBias);i=Je(u,t)}return r[i]}function Po(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,a=e?zt(e):"light",r=_o(a)[o];if(!r)throw Error(`color "${o}" not found on theme "${a}"`);if(!e)return t==="base"?r[pt("light",o)]:r[Je(0,t)];let i;if(t==="base")i=pt(a,o);else{let l=Re(a),u=Wn(Fn(e),l.direction,l.darkBias);i=Je(u,t)}return r[i]}function sa(e={}){let{theme:t="light",tone:n="inherit",color:o="inherit"}=e,a=o==="inherit"?"neutral":o,r=_o(t)[a];if(!r)throw Error(`color "${a}" not found on theme "${t}"`);return n==="base"?r[pt(t,a)]:r[Je(0,n)]}var Qt={};Et(Qt,{abbreviation:()=>ca,accordion:()=>ua,alert:()=>ma,avatar:()=>da,badge:()=>ha,blockquote:()=>fa,breadcrumb:()=>pa,breadcrumbEllipsis:()=>ga,button:()=>va,buttonGhost:()=>Lo,buttonSwitch:()=>Sa,card:()=>wa,code:()=>Ea,combobox:()=>bl,command:()=>vl,commandItem:()=>xl,commandSearch:()=>Sl,datePicker:()=>Cl,descriptionList:()=>Tl,details:()=>Dl,dialog:()=>Pl,divider:()=>Ll,drawer:()=>Il,elevation:()=>W,emphasis:()=>Rl,empty:()=>$l,errorBoundary:()=>Nl,fab:()=>Bl,figure:()=>Vl,focusRing:()=>T,formGroup:()=>Hl,grid:()=>jl,heading:()=>Wl,horizontalRule:()=>Kl,icon:()=>ql,image:()=>Ul,inputCheckbox:()=>Gl,inputColor:()=>Yl,inputDateTime:()=>Xl,inputFile:()=>Jl,inputNumber:()=>Zl,inputOTP:()=>Ql,inputPassword:()=>ns,inputRadio:()=>rs,inputRange:()=>is,inputSearch:()=>as,inputSwitch:()=>ls,inputText:()=>ss,keyboard:()=>cs,label:()=>us,link:()=>ms,linkButton:()=>fs,list:()=>ps,listItem:()=>gs,listItemButton:()=>ys,mark:()=>bs,menu:()=>vs,motion:()=>xs,orderedList:()=>ws,pagination:()=>ks,panelSection:()=>_s,paragraph:()=>Ts,popover:()=>Ds,popoverArrow:()=>Uo,preformated:()=>Os,progress:()=>Ps,rating:()=>Rs,ringProgress:()=>$s,row:()=>Yo,scrollArea:()=>zs,segmented:()=>As,select:()=>Bs,selectBox:()=>Fs,selectItem:()=>Ws,selectList:()=>Ks,skeleton:()=>qs,small:()=>Us,spinner:()=>Gs,splitter:()=>Ys,splitterHandle:()=>Zs,splitterPanel:()=>Js,stack:()=>Qs,steps:()=>tc,strong:()=>oc,subscript:()=>nc,superscript:()=>rc,table:()=>ic,tabs:()=>ac,tag:()=>vt,textarea:()=>lc,timeline:()=>sc,timelineItem:()=>cc,toast:()=>uc,toggleGroup:()=>hc,toolbar:()=>fc,toolbarSpacer:()=>pc,tooltip:()=>gc,transitionGroup:()=>yc,unorderedList:()=>bc,visuallyHidden:()=>vc});function ca(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>x(r),backgroundColor:r=>c(r),color:r=>c(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>c(r,"shift-7",t.get(r)),textUnderlineOffset:h(.72),cursor:"help","&:hover":{color:r=>c(r,"shift-11",n.get(r)),textDecorationColor:r=>c(r,"shift-9",n.get(r))}}}}function T(e,t="primary"){let n=c(e,"surface"),o=c(e,"shift-9",t);return`0 0 0 2px ${n}, 0 0 0 4px ${o}`}function ua(e={}){var a,r;let{type:t="single"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:i=>{if(t!=="single")return;let l=i.domElement;if(!l)return;let u=d=>{let s=d.target.closest("summary");if(!s)return;let m=s.closest("details");!m||m.parentElement!==l||m.open||Array.from(l.querySelectorAll(":scope > details")).forEach(f=>{f!==m&&(f.open=!1)})};l.addEventListener("click",u),i.addHook("Remove",()=>l.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:i=>h(y(i)*1.5),outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,outlineOffset:"-1px",color:i=>c(i,"text",n.get(i)),overflow:"hidden","& > details":{borderBottom:i=>`1px solid ${c(i,"border-strong",n.get(i))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{boxShadow:i=>T(i,o.get(i))}}}}function ma(e={}){var n;let t=b((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:h(3),paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),borderRadius:o=>h(y(o)*1.5),boxShadow:o=>`inset ${h(1)} 0 0 0 ${c(o,"shift-8",t.get(o))}`,backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-10",t.get(o)),fontSize:o=>x(o,"inherit")}}}function da(e={}){var n;let t=b((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",_doctorDisable:"inline-typography",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:h(9),height:h(9),fontSize:o=>x(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-11",t.get(o)),boxShadow:o=>`0 0 0 1px ${c(o,"border",t.get(o))}`,"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function ha(e={}){var a;let{label:t=999}=e,n=b(t),o=b((a=e.color)!=null?a:"danger","color");return{_doctorDisable:"inline-typography",style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:r=>h(y(r)*(1.5/1.5)),minWidth:h(5),height:r=>h(y(r)*(5/1.5)),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>x(r,"decrease-2"),fontWeight:"600",lineHeight:1,borderRadius:r=>h(y(r)*999),backgroundColor:r=>c(r,"shift-9",o.get(r)),color:r=>c(r,"shift-0",o.get(r)),boxShadow:r=>`0 0 0 1px ${c(r,"shift-0",o.get(r))}`}}}}function fa(e={}){var n;let t=b((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=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o)),boxShadow:o=>`inset ${h(1)} 0 0 0 ${c(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),margin:0}}}function pa(e={}){var o;let{separator:t="/"}=e,n=b((o=e.color)!=null?o:"neutral","color");return{_onInsert:a=>{a.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:a=>x(a,"inherit"),gap:h(1),color:a=>c(a,"text",n.get(a)),backgroundColor:a=>c(a,"inherit",n.get(a)),"& > *":{display:"inline-flex",alignItems:"center",color:a=>c(a,"text",n.get(a))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:a=>c(a,"shift-4",n.get(a)),paddingInlineStart:h(1)},"& > [aria-current=page]":{color:a=>c(a,"shift-10",n.get(a)),pointerEvents:"none"}}}}function ga(e={}){var n;let t=b((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:h(1),border:"none",background:"none",cursor:"pointer",color:o=>c(o,"text",t.get(o)),borderRadius:h(1),transition:"color 140ms ease, background-color 140ms ease, box-shadow 140ms ease","&:hover":{color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"hover",t.get(o))},"&:focus-visible":{boxShadow:o=>T(o,t.get(o))}}}}var Ze={small:"decrease-1",medium:"inherit",large:"increase-1"};var ya={small:.5,medium:1,large:1.5};function Lo(e={}){var a,r,i;let t=b((a=e.color)!=null?a:"neutral","color"),n=ya[(r=e.size)!=null?r:"medium"],o=Ze[(i=e.size)!=null?i:"medium"];return{type:"button",_onInsert:l=>{l.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:l=>x(l,o),paddingBlock:l=>h(y(l)*n),paddingInline:l=>h(y(l)*n),borderRadius:l=>h(y(l)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:l=>h(y(l)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:l=>c(l,"text",t.get(l)),"&:hover:not([disabled]):not([aria-busy=true])":{color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"hover",t.get(l))},"&:active:not([disabled]):not([aria-busy=true])":{color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"increase-2",t.get(l))},"&:focus-visible":{boxShadow:l=>T(l,t.get(l))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>c(l,"border-strong","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var ba={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}};function va(e={}){var i,l,u,d;let t=(i=e.variant)!=null?i:"outline";if(t==="ghost")return Lo({color:e.color,size:e.size});let n=b((l=e.color)!=null?l:"primary","color"),o=t==="solid",a=ba[(u=e.size)!=null?u:"medium"],r=Ze[(d=e.size)!=null?d:"medium"];return N(L({type:"button",_onInsert:s=>{s.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')}},o?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{appearance:"none",fontSize:s=>x(s,r),paddingBlock:s=>h(y(s)*a.block),paddingInline:s=>h(y(s)*a.inline),borderRadius:s=>h(y(s)*1.5),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:s=>h(y(s)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o?"none":s=>`1px solid ${c(s,"border-strong",n.get(s))}`,color:s=>o?c(s,"shift-0","neutral"):c(s,"shift-13",n.get(s)),backgroundColor:s=>o?c(s,"shift-13",n.get(s)):c(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{color:s=>o?c(s,"shift-0","neutral"):c(s,"shift-14",n.get(s)),backgroundColor:s=>o?c(s,"shift-14",n.get(s)):c(s,"hover",n.get(s))},"&:active:not([disabled]):not([aria-busy=true])":{backgroundColor:s=>o?c(s,"shift-15",n.get(s)):c(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>T(s,n.get(s))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:s=>c(s,"shift-2","neutral"),outline:s=>`1px solid ${c(s,"border-strong","neutral")}`,color:s=>c(s,"muted","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}})}function Sa(e={}){var r,i;let{checked:t=!1}=e,n=b(t),o=b((r=e.color)!=null?r:"neutral","color"),a=b((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"button",_onSchedule:l=>{l.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:l=>n.get(l),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:l=>x(l),border:"none",outlineWidth:"1px",outline:l=>`1px solid ${c(l,"border",o.get(l))}`,minWidth:h(12),minHeight:h(6),borderRadius:h(999),paddingLeft:h(7),paddingRight:h(2),cursor:"pointer",transition:"padding-left 0.3s, padding-right 0.3s, background-color 140ms ease, box-shadow 140ms ease",backgroundColor:l=>c(l,"inherit",o.get(l)),color:l=>c(l,"text",o.get(l)),"&:focus-visible":{boxShadow:l=>T(l,a.get(l))},"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:h(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:h(5),height:h(5),borderRadius:h(999),color:l=>c(l,"text"),backgroundColor:l=>c(l,"decrease-2",o.get(l))},"&[aria-checked=true]":{backgroundColor:l=>c(l,"increase-3",a.get(l)),outline:"none",color:l=>c(l,"decrease-2"),paddingLeft:h(2),paddingRight:h(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${h(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var xa={low:"0 1px 2px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.10)",medium:"0 2px 4px rgba(0,0,0,0.10), 0 10px 24px rgba(0,0,0,0.14)",high:"0 6px 12px rgba(0,0,0,0.14), 0 24px 48px rgba(0,0,0,0.20)"};function W(e){return xa[e]}function wa(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>h(y(o)*2),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-10",t.get(o)),outline:o=>`1px solid ${c(o,"border-strong",t.get(o))}`,outlineOffset:"-1px",boxShadow:W("low"),overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),fontWeight:"600",color:o=>c(o,"shift-11",t.get(o)),margin:0},"& > p":{gridArea:"desc",paddingInline:o=>h(y(o)*4),paddingBottom:o=>h(y(o)*2),color:o=>c(o,"text",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>h(y(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>h(y(o)*4),color:o=>c(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:h(2),paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),borderTop:o=>`1px solid ${c(o,"border",t.get(o))}`}}}}function Ea(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),height:o=>h(y(o)*(6/1.5)),paddingInline:o=>h(y(o)*(1.5/1.5)),borderRadius:o=>h(y(o)*(1/1.5))}}}var Ca=Object.defineProperty,ka=Object.defineProperties,_a=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertySymbols,Qn=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable,Kn=(e,t,n)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ye=(e,t)=>{for(var n in t||(t={}))Qn.call(t,n)&&Kn(e,n,t[n]);if(Vt)for(var n of Vt(t))er.call(t,n)&&Kn(e,n,t[n]);return e},Ne=(e,t)=>ka(e,_a(t)),tr=(e,t)=>{var n={};for(var o in e)Qn.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Vt)for(var o of Vt(e))t.indexOf(o)<0&&er.call(e,o)&&(n[o]=e[o]);return n},Ve=(e,t,n)=>new Promise((o,a)=>{var r=u=>{try{l(n.next(u))}catch(d){a(d)}},i=u=>{try{l(n.throw(u))}catch(d){a(d)}},l=u=>u.done?o(u.value):Promise.resolve(u.value).then(r,i);l((n=n.apply(e,t)).next())}),Ta=["top","right","bottom","left"],qn=["start","end"],zu=Ta.reduce((e,t)=>e.concat(t,`${t}-${qn[0]}`,`${t}-${qn[1]}`),[]),Ht=Math.min,ze=Math.max,jt=Math.round,Bt=Math.floor,Ee=e=>({x:e,y:e}),Da={left:"right",right:"left",bottom:"top",top:"bottom"};function Oa(e,t,n){return ze(e,Ht(t,n))}function Kt(e,t){return typeof e=="function"?e(t):e}function et(e){return e.split("-")[0]}function qt(e){return e.split("-")[1]}function or(e){return e==="x"?"y":"x"}function nr(e){return e==="y"?"height":"width"}function De(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function rr(e){return or(De(e))}function Pa(e,t,n=!1){let o=qt(e),a=rr(e),r=nr(a),i=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Ft(i)),[i,Ft(i)]}function La(e){let t=Ft(e);return[Ro(e),t,Ro(t)]}function Ro(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Un=["left","right"],Gn=["right","left"],Ma=["top","bottom"],Ia=["bottom","top"];function Ra(e,t,n){switch(e){case"top":case"bottom":return n?t?Gn:Un:t?Un:Gn;case"left":case"right":return t?Ma:Ia;default:return[]}}function $a(e,t,n,o){let a=qt(e),r=Ra(et(e),n==="start",o);return a&&(r=r.map(i=>`${i}-${a}`),t&&(r=r.concat(r.map(Ro)))),r}function Ft(e){let t=et(e);return Da[t]+e.slice(t.length)}function za(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function Na(e){return typeof e!="number"?za(e):{top:e,right:e,bottom:e,left:e}}function Wt(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Yn({reference:e,floating:t},n,o){let a=De(n),r=rr(n),i=nr(r),l=et(n),u=a==="y",d=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,m=e[i]/2-t[i]/2,f;switch(l){case"top":f={x:d,y:e.y-t.height};break;case"bottom":f={x:d,y:e.y+e.height};break;case"right":f={x:e.x+e.width,y:s};break;case"left":f={x:e.x-t.width,y:s};break;default:f={x:e.x,y:e.y}}let p=qt(n);return p&&(f[r]+=m*(p==="end"?1:-1)*(o&&u?-1:1)),f}function Aa(e){return Ve(this,arguments,function*(t,n={}){var o,a,r,i,l,u;let{x:d,y:s,platform:m,rects:f,elements:p,strategy:g}=t,{boundary:S="clippingAncestors",rootBoundary:E="viewport",elementContext:v="floating",altBoundary:C=!1,padding:_=0}=Kt(n,t),w=Na(_),O=p[C?v==="floating"?"reference":"floating":v],D=Wt(yield m.getClippingRect({element:(a=yield(o=m.isElement)==null?void 0:o.call(m,O))==null||a?O:O.contextElement||(yield(r=m.getDocumentElement)==null?void 0:r.call(m,p.floating)),boundary:S,rootBoundary:E,strategy:g})),I=v==="floating"?{x:d,y:s,width:f.floating.width,height:f.floating.height}:f.reference,F=yield(i=m.getOffsetParent)==null?void 0:i.call(m,p.floating),A=(yield(l=m.isElement)==null?void 0:l.call(m,F))&&(yield(u=m.getScale)==null?void 0:u.call(m,F))||{x:1,y:1},B=Wt(m.convertOffsetParentRelativeRectToViewportRelativeRect?yield m.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:I,offsetParent:F,strategy:g}):I);return{top:(D.top-B.top+w.top)/A.y,bottom:(B.bottom-D.bottom+w.bottom)/A.y,left:(D.left-B.left+w.left)/A.x,right:(B.right-D.right+w.right)/A.x}})}var Ba=50,Va=(e,t,n)=>Ve(null,null,function*(){var o;let{placement:a="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,u=l.detectOverflow?l:Ne(ye({},l),{detectOverflow:Aa}),d=yield(o=l.isRTL)==null?void 0:o.call(l,t),s=yield l.getElementRects({reference:e,floating:t,strategy:r}),{x:m,y:f}=Yn(s,a,d),p=a,g=0,S={};for(let E=0;E<i.length;E++){let v=i[E];if(!v)continue;let{name:C,fn:_}=v,{x:w,y:O,data:D,reset:I}=yield _({x:m,y:f,initialPlacement:a,placement:p,strategy:r,middlewareData:S,rects:s,platform:u,elements:{reference:e,floating:t}});m=w!=null?w:m,f=O!=null?O:f,S[C]=ye(ye({},S[C]),D),I&&g<Ba&&(g++,typeof I=="object"&&(I.placement&&(p=I.placement),I.rects&&(s=I.rects===!0?yield l.getElementRects({reference:e,floating:t,strategy:r}):I.rects),{x:m,y:f}=Yn(s,p,d)),E=-1)}return{x:m,y:f,placement:p,strategy:r,middlewareData:S}});var Ha=(e={})=>({name:"flip",options:e,fn(t){return Ve(this,null,function*(){var n,o,a,r,i,l;let{placement:u,middlewareData:d,rects:s,initialPlacement:m,platform:f,elements:p}=t,g=Kt(e,t),{mainAxis:S=!0,crossAxis:E=!0,fallbackPlacements:v,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:w=!0}=g,O=tr(g,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=d.arrow)!=null&&n.alignmentOffset)return{};let D=et(u),I=De(m),F=et(m)===m,A=yield(o=f.isRTL)==null?void 0:o.call(f,p.floating),B=v||(F||!w?[Ft(m)]:La(m)),ie=_!=="none";!v&&ie&&B.push(...$a(m,w,_,A));let q=[m,...B],Z=yield f.detectOverflow(t,O),te=[],Y=((a=d.flip)==null?void 0:a.overflows)||[];if(S&&te.push(Z[D]),E){let oe=Pa(u,s,A);te.push(Z[oe[0]],Z[oe[1]])}if(Y=[...Y,{placement:u,overflows:te}],!te.every(oe=>oe<=0)){let oe=(((r=d.flip)==null?void 0:r.index)||0)+1,ae=q[oe];if(ae&&(!(E==="alignment"&&I!==De(ae))||Y.every(ee=>De(ee.placement)===I?ee.overflows[0]>0:!0)))return{data:{index:oe,overflows:Y},reset:{placement:ae}};let ne=(i=Y.filter(ee=>ee.overflows[0]<=0).sort((ee,Q)=>ee.overflows[1]-Q.overflows[1])[0])==null?void 0:i.placement;if(!ne)switch(C){case"bestFit":{let ee=(l=Y.filter(Q=>{if(ie){let R=De(Q.placement);return R===I||R==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(R=>R>0).reduce((R,U)=>R+U,0)]).sort((Q,R)=>Q[1]-R[1])[0])==null?void 0:l[0];ee&&(ne=ee);break}case"initialPlacement":ne=m;break;default:}if(u!==ne)return{reset:{placement:ne}}}return{}})}});var ja=new Set(["left","top"]);function Fa(e,t){return Ve(this,null,function*(){var n;let{placement:o,platform:a,elements:r}=e,i=yield(n=a.isRTL)==null?void 0:n.call(a,r.floating),l=et(o),u=qt(o),d=De(o)==="y",s=ja.has(l)?-1:1,m=i&&d?-1:1,f=Kt(t,e),{mainAxis:p,crossAxis:g,alignmentAxis:S}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&typeof S=="number"&&(g=u==="end"?S*-1:S),d?{x:g*m,y:p*s}:{x:p*s,y:g*m}})}var Wa=(e=0)=>({name:"offset",options:e,fn(t){return Ve(this,null,function*(){var n,o;let{x:a,y:r,placement:i,middlewareData:l}=t,u=yield Fa(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+u.x,y:r+u.y,data:Ne(ye({},u),{placement:i})}})}}),Ka=(e={})=>({name:"shift",options:e,fn(t){return Ve(this,null,function*(){let{x:n,y:o,placement:a,platform:r}=t,i=Kt(e,t),{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:({x:_,y:w})=>({x:_,y:w})}}=i,s=tr(i,["mainAxis","crossAxis","limiter"]),m={x:n,y:o},f=yield r.detectOverflow(t,s),p=De(a),g=or(p),S=m[g],E=m[p],v=(_,w)=>Oa(w+f[_==="y"?"top":"left"],w,w-f[_==="y"?"bottom":"right"]);l&&(S=v(g,S)),u&&(E=v(p,E));let C=d.fn(Ne(ye({},t),{[g]:S,[p]:E}));return Ne(ye({},C),{data:{x:C.x-n,y:C.y-o,enabled:{[g]:l,[p]:u}}})})}});function Ut(){return typeof window!="undefined"}function tt(e){return ir(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(ir(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ir(e){return Ut()?e instanceof Node||e instanceof ce(e).Node:!1}function be(e){return Ut()?e instanceof Element||e instanceof ce(e).Element:!1}function Oe(e){return Ut()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function Xn(e){return!Ut()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function Gt(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function qa(e){return/^(table|td|th)$/.test(tt(e))}function Yt(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Ua=/transform|translate|scale|rotate|perspective|filter/,Ga=/paint|layout|strict|content/,$e=e=>!!e&&e!=="none",Mo;function zo(e){let t=be(e)?ve(e):e;return $e(t.transform)||$e(t.translate)||$e(t.scale)||$e(t.rotate)||$e(t.perspective)||!No()&&($e(t.backdropFilter)||$e(t.filter))||Ua.test(t.willChange||"")||Ga.test(t.contain||"")}function Ya(e){let t=Ae(e);for(;Oe(t)&&!gt(t);){if(zo(t))return t;if(Yt(t))return null;t=Ae(t)}return null}function No(){return Mo==null&&(Mo=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mo}function gt(e){return/^(html|body|#document)$/.test(tt(e))}function ve(e){return ce(e).getComputedStyle(e)}function Xt(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if(tt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Xn(e)&&e.host||Ce(e);return Xn(t)?t.host:t}function ar(e){let t=Ae(e);return gt(t)?(e.ownerDocument||e).body:Oe(t)&&Gt(t)?t:ar(t)}function yt(e,t=[],n=!0){var o;let a=ar(e),r=a===((o=e.ownerDocument)==null?void 0:o.body),i=ce(a);if(r){let l=$o(i);return t.concat(i,i.visualViewport||[],Gt(a)?a:[],l&&n?yt(l):[])}else return t.concat(a,yt(a,[],n))}function $o(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lr(e){let t=ve(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Oe(e),r=a?e.offsetWidth:n,i=a?e.offsetHeight:o,l=jt(n)!==r||jt(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function Ao(e){return be(e)?e:e.contextElement}function Qe(e){let t=Ao(e);if(!Oe(t))return Ee(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:r}=lr(t),i=(r?jt(n.width):n.width)/o,l=(r?jt(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var Xa=Ee(0);function sr(e){let t=ce(e);return!No()||!t.visualViewport?Xa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ja(e,t=!1,n){return!!n&&t&&n===ce(e)}function Be(e,t=!1,n=!1,o){let a=e.getBoundingClientRect(),r=Ao(e),i=Ee(1);t&&(o?be(o)&&(i=Qe(o)):i=Qe(e));let l=Ja(r,n,o)?sr(r):Ee(0),u=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,s=a.width/i.x,m=a.height/i.y;if(r&&o){let f=ce(r),p=be(o)?ce(o):o,g=f,S=$o(g);for(;S&&p!==g;){let E=Qe(S),v=S.getBoundingClientRect(),C=ve(S),_=v.left+(S.clientLeft+parseFloat(C.paddingLeft))*E.x,w=v.top+(S.clientTop+parseFloat(C.paddingTop))*E.y;u*=E.x,d*=E.y,s*=E.x,m*=E.y,u+=_,d+=w,g=ce(S),S=$o(g)}}return Wt({width:s,height:m,x:u,y:d})}function Jt(e,t){let n=Xt(e).scrollLeft;return t?t.left+n:Be(Ce(e)).left+n}function cr(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jt(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function Za({elements:e,rect:t,offsetParent:n,strategy:o}){let a=o==="fixed",r=Ce(n),i=e?Yt(e.floating):!1;if(n===r||i&&a)return t;let l={scrollLeft:0,scrollTop:0},u=Ee(1),d=Ee(0),s=Oe(n);if((s||!a)&&((tt(n)!=="body"||Gt(r))&&(l=Xt(n)),s)){let f=Be(n);u=Qe(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}let m=r&&!s&&!a?cr(r,l):Ee(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+d.x+m.x,y:t.y*u.y-l.scrollTop*u.y+d.y+m.y}}function Qa(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function el(e){let t=Xt(e),n=e.ownerDocument.body,o=ze(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=ze(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),r=-t.scrollLeft+Jt(e),i=-t.scrollTop;return ve(n).direction==="rtl"&&(r+=ze(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:r,y:i}}var tl=25;function ol(e,t,n="viewport"){let o=n==="layoutViewport",a=ce(e),r=Ce(e),i=a.visualViewport,l=r.clientWidth,u=r.clientHeight,d=0,s=0;if(i){let m=!No()||t==="fixed";o?m||(d=-i.offsetLeft,s=-i.offsetTop):(l=i.width,u=i.height,m&&(d=i.offsetLeft,s=i.offsetTop))}if(Jt(r)<=0){let m=r.ownerDocument,f=m.body,p=getComputedStyle(f),g=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,S=Math.abs(r.clientWidth-f.clientWidth-g),E=getComputedStyle(r).scrollbarGutter==="stable both-edges"?S/2:S;E<=tl&&(l-=E)}return{width:l,height:u,x:d,y:s}}function nl(e,t){let n=Be(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,r=Qe(e),i=e.clientWidth*r.x,l=e.clientHeight*r.y,u=a*r.x,d=o*r.y;return{width:i,height:l,x:u,y:d}}function Jn(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=ol(e,n,t);else if(t==="document")o=el(Ce(e));else if(be(t))o=nl(t,n);else{let a=sr(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Wt(o)}function rl(e,t){let n=t.get(e);if(n)return n;let o=yt(e,[],!1).filter(l=>be(l)&&tt(l)!=="body"),a=null,r=ve(e).position==="fixed",i=r?Ae(e):e;for(;be(i)&&!gt(i);){let l=ve(i),u=zo(i),d=a?a.position:r?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?o=o.filter(s=>s!==i):a=l,i=Ae(i)}return t.set(e,o),o}function il({element:e,boundary:t,rootBoundary:n,strategy:o}){let a=[...t==="clippingAncestors"?Yt(e)?[]:rl(e,this._c):[].concat(t),n],r=Jn(e,a[0],o),i=r.top,l=r.right,u=r.bottom,d=r.left;for(let s=1;s<a.length;s++){let m=Jn(e,a[s],o);i=ze(m.top,i),l=Ht(m.right,l),u=Ht(m.bottom,u),d=ze(m.left,d)}return{width:l-d,height:u-i,x:d,y:i}}function al(e){let{width:t,height:n}=lr(e);return{width:t,height:n}}function ll(e,t,n){let o=Oe(t),a=Ce(t),r=n==="fixed",i=Be(e,!0,r,t),l={scrollLeft:0,scrollTop:0},u=Ee(0);if((o||!r)&&((tt(t)!=="body"||Gt(a))&&(l=Xt(t)),o)){let f=Be(t,!0,r,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}!o&&a&&(u.x=Jt(a));let d=a&&!o&&!r?cr(a,l):Ee(0),s=i.left+l.scrollLeft-u.x-d.x,m=i.top+l.scrollTop-u.y-d.y;return{x:s,y:m,width:i.width,height:i.height}}function Io(e){return ve(e).position==="static"}function Zn(e,t){if(!Oe(e)||ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ce(e)===n&&(n=n.ownerDocument.body),n}function ur(e,t){let n=ce(e);if(Yt(e))return n;if(!Oe(e)){let a=Ae(e);for(;a&&!gt(a);){if(be(a)&&!Io(a))return a;a=Ae(a)}return n}let o=Zn(e,t);for(;o&&qa(o)&&Io(o);)o=Zn(o,t);return o&>(o)&&Io(o)&&!zo(o)?n:o||Ya(e)||n}var sl=function(e){return Ve(this,null,function*(){let t=this.getOffsetParent||ur,n=this.getDimensions,o=yield n(e.floating);return{reference:ll(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function cl(e){return ve(e).direction==="rtl"}var ul={convertOffsetParentRelativeRectToViewportRelativeRect:Za,getDocumentElement:Ce,getClippingRect:il,getOffsetParent:ur,getElementRects:sl,getClientRects:Qa,getDimensions:al,getScale:Qe,isElement:be,isRTL:cl};function mr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ml(e,t,n){let o=null,a,r=Ce(e);function i(){clearTimeout(a),o==null||o.disconnect(),o=null}function l(s=!1,m=1){i();let f=e.getBoundingClientRect(),{left:p,top:g,width:S,height:E}=f;if(s||t(),!S||!E)return;let v=Bt(g),C=Bt(r.clientWidth-(p+S)),_=Bt(r.clientHeight-(g+E)),w=Bt(p),O={rootMargin:`${-v}px ${-C}px ${-_}px ${-w}px`,threshold:ze(0,Ht(1,m))||1},D=!0;function I(F){let A=F[0].intersectionRatio;if(!mr(f,e.getBoundingClientRect()))return l();if(A!==m){if(!D)return l();A?l(!1,A):a=setTimeout(()=>{l(!1,1e-7)},1e3)}D=!1}try{o=new IntersectionObserver(I,Ne(ye({},O),{root:r.ownerDocument}))}catch(F){o=new IntersectionObserver(I,O)}o.observe(e)}let u=ce(e),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),i()}}function dr(e,t,n,o={}){let{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=Ao(e),s=a||r?[...d?yt(d):[],...t?yt(t):[]]:[];s.forEach(v=>{a&&v.addEventListener("scroll",n),r&&v.addEventListener("resize",n)});let m=d&&l?ml(d,n,r):null,f=-1,p=null;i&&(p=new ResizeObserver(([v])=>{v&&v.target===d&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p==null||p.observe(t)})),n()}),d&&!u&&p.observe(d),t&&p.observe(t));let g,S=u?Be(e):null;u&&E();function E(){let v=Be(e);S&&!mr(S,v)&&n(),S=v,g=requestAnimationFrame(E)}return n(),()=>{s.forEach(v=>{a&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),m==null||m(),p==null||p.disconnect(),p=null,u&&cancelAnimationFrame(g)}}var hr=Wa;var fr=Ka,pr=Ha;var gr=(e,t,n)=>{let o=new Map,a=n!=null?n:{},r=Ne(ye(ye({},ul),a.platform),{_c:o});return Va(e,t,Ne(ye({},a),{platform:r}))};function dl(e){return typeof e.set=="function"}function ke(e,t,n=!0){if(typeof e.addListener=="function")return n&&t(e.get()),e.addListener(t);if(n)return ut(()=>{t(e.get())});let o=!0,a=ut(()=>{let r=e.get();o||t(r)});return o=!1,a}function Bo(e,t){dl(e)&&e.set(t)}function Pe(e,t){t==null||t(),Bo(e,!1)}function ot(e){return b(e!=null?e:!1)}function de(e,t){return`domphy-${e}-${t.nodeId}`}function hl(e,t){var ae,ne,ee,Q;let{openState:n,onDismiss:o,placement:a,content:r,keepOpenOnContentHover:i}=t,{kind:l}=t,u=`floating:${l}`,d=null,s=null,m=null,f=null,p=!1,g=e.domElement,S=e.getRoot(),E=de(l,e),v={style:{position:"fixed",pointerEvents:"auto",visibility:R=>n.get(R)?"visible":"hidden"},onKeyDown:R=>{R.key==="Escape"&&I()},onMouseEnter:()=>i&&D(),onMouseLeave:()=>i&&I(),_onMount:R=>{var U;if(m=R.domElement,m.id||(m.id=E),g&&m&&!m.hasAttribute("data-theme")){let pe=(U=g.closest("[data-theme]"))==null?void 0:U.getAttribute("data-theme");pe&&m.setAttribute("data-theme",pe)}},_portal:R=>{let U=g.closest("dialog");if(U){let he=U.querySelector(":scope > #domphy-floating");return he||(he=U.ownerDocument.createElement("div"),he.id="domphy-floating",Object.assign(he.style,{position:"fixed",inset:"0",zIndex:"20",pointerEvents:"none"}),U.appendChild(he)),he}let pe=R.domElement.querySelector("#domphy-floating");if(!pe){let he={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};pe=R.children.insert(he).domElement}return pe}},C=R=>K(R,v);C(r);let _=()=>{p||(p=!0,f=S.children.insert(r),f._behaviorInstances.set(u,Y))},w=()=>{p&&(!m||!m.isConnected)&&(s==null||s(),s=null,f=null,m=null,p=!1),_(),g&&m&&(s==null||s(),s=dr(g,m,()=>{gr(g,m,{placement:a.get(),middleware:[hr(12),pr(),fr()],strategy:"fixed"}).then(({x:R,y:U,placement:pe})=>{m&&(Object.assign(m.style,{left:`${R}px`,top:`${U}px`}),a.set(pe))})}),Bo(n,!0))},O=()=>{s==null||s(),s=null,f&&(f.remove(),f=null),m=null,p=!1,Pe(n,o)},D=()=>{d&&clearTimeout(d),d=setTimeout(w,100)},I=()=>{d&&clearTimeout(d),d=setTimeout(O,100)},F=R=>{if(!n.get()||!g||!m)return;let U=R.target;!g.contains(U)&&!m.contains(U)&&I()};(ae=S.domElement)==null||ae.addEventListener("click",F);let A=R=>{R.key==="Escape"&&n.get()&&I()},B=(Q=(ee=(ne=S.domElement)==null?void 0:ne.ownerDocument)!=null?ee:S.domElement)!=null?Q:null;B==null||B.addEventListener("keydown",A);let ie=R=>{R?p||w():p&&O()},q=()=>{},Z=!1,te=!1,Y,oe=R=>{var U;R._behaviors=N(L({},(U=R._behaviors)!=null?U:{}),{[u]:{attach:()=>Y,props:{}}})};return Y={show:D,hide:I,panelId:E,update(R){if(!te&&(o=R.onDismiss,R.openState!==n&&(q(),n=R.openState,q=ke(n,ie,!1),n.get()&&w()),a=R.placement,r=R.content,i=R.keepOpenOnContentHover,C(r),oe(r),f)){te=!0;try{f.patch(r)}finally{te=!1}}},destroy(){var R;Z||(Z=!0,d&&clearTimeout(d),d=null,s==null||s(),s=null,f==null||f.remove(),f=null,m=null,p=!1,q(),q=()=>{},(R=S.domElement)==null||R.removeEventListener("click",F),B==null||B.removeEventListener("keydown",A))}},oe(r),q=ke(n,ie),Y}function Se(e){let{kind:t,placement:n,onDismiss:o}=e,a=ot(e.open),r=`floating:${t}`,i=d=>{var s;return(s=d==null?void 0:d.getBehavior(r))==null?void 0:s.show()},l=d=>{var s;return(s=d==null?void 0:d.getBehavior(r))==null?void 0:s.hide()},u=L({onKeyDown:(d,s)=>d.key==="Escape"&&l(s)},V(r,hl,{kind:t,openState:a,onDismiss:o,placement:n,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover}));return{show:i,hide:l,anchorPartial:u}}var fl='<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>',bt=1.5,pl=6/bt,yr=2.5/bt,gl=1/bt,br=4/bt,yl=1/bt;function vt(e={}){var o;let{removable:t=!1}=e,n=b((o=e.color)!=null?o:"neutral","color");return N(L({dataTone:"shift-2"},V("tag-remove",(a,r)=>{let i=()=>a.remove(),l=()=>({span:Ie(fl),_key:"tag-remove",onClick:s=>{s.stopPropagation(),i()},onKeyDown:s=>{let m=s;m.key!=="Enter"&&m.key!==" "||(m.preventDefault(),m.stopPropagation(),i())},tabindex:0,role:"button",ariaLabel:"Remove",style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s=>h(y(s)*yl),width:s=>h(y(s)*br),height:s=>h(y(s)*br),flexShrink:0,transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover":{backgroundColor:s=>c(s,"shift-4",n.get(s))},"&:focus-visible":{boxShadow:s=>T(s,n.get(s))}}}),u=()=>{var s;return(s=a.children.items.find(m=>m instanceof J&&m.key==="tag-remove"))!=null?s:null},d=(s,m)=>{let f=u();s.removable&&!f?a.children.insert(l(),void 0,m):!s.removable&&f&&a.children.remove(f)};return d(r,!1),{update:s=>d(s,!0)}},{removable:t})),{style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:a=>h(y(a)*pl),paddingBlock:0,borderRadius:a=>h(y(a)*999),paddingInlineStart:a=>h(y(a)*yr),paddingInlineEnd:a=>h(y(a)*(t?gl:yr)),gap:h(1.5),fontSize:a=>x(a,"decrease-1"),backgroundColor:a=>c(a,"inherit",n.get(a)),color:a=>c(a,"text",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${c(a,"border-strong",n.get(a))}`}})}function bl(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=b(e.value),l=b(a),{show:u,hide:d,anchorPartial:s}=Se({kind:"combobox",open:l,onDismiss:e.onDismiss,placement:b(n),content:e.content}),m={onClick:(w,O)=>!r&&d(O),dataTone:"shift-14",style:{backgroundColor:w=>c(w,"inherit"),color:w=>c(w,"text"),borderRadius:w=>h(y(w)*2),outline:w=>`1px solid ${c(w,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};K(e.content,m);let f={border:"none",outline:"none",padding:0,margin:0,flex:1,height:h(6),marginInlineStart:h(2),fontSize:w=>x(w,"inherit"),color:w=>c(w,"text",o),backgroundColor:w=>c(w,"inherit",o)},p=w=>{var O,D;return(D=(O=w==null?void 0:w.elementNode)==null?void 0:O.getBehavior("comboboxInner"))==null?void 0:D.query},g=w=>{let O=w;for(;O;){if(O._behaviorInstances.has("floating:combobox"))return O;O=O.parent}return w},S={role:"combobox",ariaHaspopup:"listbox",ariaExpanded:w=>l.get(w),ariaControls:w=>w!=null&&w.elementNode?de("combobox",g(w.elementNode)):void 0},E=w=>w?(K(w,L({onFocus:(O,D)=>u(D),style:f,_key:"combobox-input"},S)),w):L({input:null,ariaLabel:"Filter options",onFocus:(O,D)=>u(D),value:O=>{var D,I;return(I=(D=p(O))==null?void 0:D.get(O))!=null?I:""},onInput:(O,D)=>{var I;(I=D.getBehavior("comboboxInner"))==null||I.query.set(O.target.value)},style:f,_key:"combobox-input"},S),v=w=>({div:O=>{l.get(O);let D=w.state.get(O),I=Array.isArray(D)?D:[D],A=w.options.filter(B=>I.includes(B.value)).map(B=>({span:B.label,$:[vt({color:w.color,removable:!0})],_key:B.value,_onRemove:ie=>{let q=w.state.get(),te=(Array.isArray(q)?q:[q]).filter(Y=>Y!==B.value);w.multiple?w.state.set(te):w.state.set(te[0])}}));return A.push(E(w.input)),A},_key:"comboboxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1)}}),_=N(L({_onInsert:w=>{w.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onSchedule:(w,O)=>{O[w.tagName]=[v({options:t,multiple:r,color:o,state:i,input:e.input})]}},V("comboboxInner",(w,O)=>{let D=w.getMetadata("comboboxQuery");return D||(D=b(""),w.setMetadata("comboboxQuery",D)),{query:D,update(I){w.children.update([v(I)])}}},{options:t,multiple:r,color:o,state:i,input:e.input})),{style:{minWidth:h(32),outlineOffset:"-1px",outline:w=>`1px solid ${c(w,"border-strong","neutral")}`,paddingBlock:w=>h(y(w)*1),paddingInline:w=>h(y(w)*1),borderRadius:w=>h(y(w)*1.5),fontSize:w=>x(w,"inherit"),color:w=>c(w,"text",o),backgroundColor:w=>c(w,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-within":{boxShadow:w=>T(w,o)}}});return K(s,_),s}function vl(){return{role:"group",ariaLabel:"Commands",_onSchedule:(e,t)=>{K(t,{_context:{command:{query:b("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Sl(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,i=()=>a.query.set(r.value);r.addEventListener("input",i),o.addHook("Remove",()=>r.removeEventListener("input",i))},style:{fontFamily:"inherit",fontSize:o=>x(o,"inherit"),paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*2),border:"none",borderBottom:o=>`1px solid ${c(o,"border",t)}`,outline:"none",color:o=>c(o,"shift-10",t),backgroundColor:o=>c(o,"inherit",t),"&::placeholder":{color:o=>c(o,"shift-7")},transition:"border-bottom-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{borderBottomColor:o=>c(o,"shift-6",n),boxShadow:o=>T(o,n)}}}}function xl(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onMount:o=>{var d,s;let a=o.getContext("command");if(!a){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,i=(s=(d=r.textContent)==null?void 0:d.toLowerCase())!=null?s:"",l=m=>{r.hidden=m.length>0&&!i.includes(m.toLowerCase())};l(a.query.get());let u=a.query.addListener(l);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>x(o,"inherit"),height:o=>h(6+y(o)*2),paddingInline:o=>h(y(o)*3),border:"none",outline:"none",color:o=>c(o,"shift-13",t),backgroundColor:o=>c(o,"inherit",t),transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:o=>c(o,"shift-13",t),backgroundColor:o=>c(o,"hover",t)},"&:focus-visible":{boxShadow:o=>T(o,n)}}}}var re=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),He=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Vo=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),St=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Ho=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,jo=(e,t)=>He(e,-((e.getDay()-t+7)%7));function wl(e){var t,n;try{let o=new Intl.Locale(e),a=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(a!=null&&a.firstDay)return a.firstDay%7}catch(o){}return 0}function El(e,t){let n=t,o=null,a=i=>{o==null||o(),o=i.onChange?i.selection.addListener(l=>i.onChange(l)):null},r=(i,l)=>{i!==l&&i.set(l.get())};return a(n),{update(i){i.selectionIsCallerOwned||r(i.selection,n.selection),r(i.viewYear,n.viewYear),r(i.viewMonth,n.viewMonth),r(i.focused,n.focused),r(i.hovered,n.hovered),r(i.hour,n.hour),r(i.minute,n.minute),r(i.open,n.open),(i.selection!==n.selection||i.onChange!==n.onChange)&&a(i),n=i},destroy(){o==null||o(),o=null}}}function Cl(e={}){var Jo,Zo,Qo,en;let{mode:t="single",time:n=!1,min:o,max:a,disabledDate:r,locale:i=typeof navigator!="undefined"?navigator.language:"en-US",format:l,onChange:u}=e,d=(Jo=e.weekStartsOn)!=null?Jo:wl(i),s=b((Zo=e.accentColor)!=null?Zo:"primary","accentColor"),m=b((Qo=e.placement)!=null?Qo:"bottom-start"),f=b((en=e.value)!=null?en:t==="range"?[null,null]:null),p=(()=>{let k=f.get(),P=t==="range"?k==null?void 0:k[0]:k;return P instanceof Date?P:new Date})(),g=b(p.getFullYear(),"viewYear"),S=b(p.getMonth(),"viewMonth"),E=b(re(p),"focused"),v=b(null,"hovered"),C=b(p.getHours(),"hour"),_=b(p.getMinutes(),"minute"),w=new Intl.DateTimeFormat(i,L({dateStyle:"medium"},n?{timeStyle:"short"}:{})),O=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),D=new Intl.DateTimeFormat(i,{weekday:"short"}),I=new Intl.DateTimeFormat(i,{dateStyle:"full"}),F=k=>k?w.format(k):"",A=k=>{if(l)return l(k);if(t==="range"){let[P,M]=k!=null?k:[null,null];return P?`${F(P)} \u2013 ${F(M)}`:""}return F(k)},B=Array.from({length:7},(k,P)=>D.format(new Date(2023,0,1+(P+d)%7))),ie=k=>!!o&&re(k)<re(o)||!!a&&re(k)>re(a)||!!r&&r(k),q=k=>{if(!n)return re(k);let P=re(k);return P.setHours(C.get(),_.get(),0,0),P},Z=(k,P)=>{var $;if(ie(k))return;if(t==="single"){f.set(q(k)),n||he(P);return}let[M,z]=($=f.get())!=null?$:[null,null];!M||M&&z?f.set([q(k),null]):re(k)<re(M)?(f.set([q(k),q(M)]),n||he(P)):(f.set([M,q(k)]),n||he(P))},te=()=>{var k;if(n)if(t==="single"){let P=f.get();P&&f.set(q(P))}else{let[P,M]=(k=f.get())!=null?k:[null,null];f.set([P&&q(P),M&&q(M)])}},Y=(k,P)=>{var je;if(t!=="range")return!1;let[M,z]=(je=f.get(P))!=null?je:[null,null],$=z!=null?z:v.get(P);if(!M||!$)return!1;let H=re(M)<=re($)?M:$,fe=re(M)<=re($)?$:M,se=re(k);return se>=re(H)&&se<=re(fe)},oe=(k,P)=>{let M=f.get(P);if(t==="range"){let[z,$]=M!=null?M:[null,null];return St(k,z)||St(k,$)}return St(k,M)},ae=k=>{g.set(k.getFullYear()),S.set(k.getMonth())},ne=k=>{let P=Vo(new Date(g.get(),S.get(),1),k);ae(P)},ee=k=>g.set(g.get()+k),Q=k=>{var M;let P=(M=k==null?void 0:k.getRoot())==null?void 0:M.domElement;setTimeout(()=>{var z;(z=P==null?void 0:P.querySelector(`[data-date="${Ho(E.get())}"]`))==null||z.focus()},0)},R=jr(),U=b(!1),{show:pe,hide:he,anchorPartial:eo}=Se({kind:"datePicker",open:U,placement:m,content:R}),Vr=L({type:"text",readonly:!0,value:k=>A(f.get(k)),role:"combobox",ariaHaspopup:"dialog",ariaExpanded:k=>U.get(k),ariaControls:k=>k!=null&&k.elementNode?de("datePicker",k.elementNode):void 0,ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(k,P)=>{to(P)},onFocus:(k,P)=>{to(P)},onKeyDown:(k,P)=>{let M=k.key;(M==="ArrowDown"||M==="Enter")&&(k.preventDefault(),to(P))}},V("datePicker",El,{selection:f,selectionIsCallerOwned:e.value!==void 0,viewYear:g,viewMonth:S,focused:E,hovered:v,hour:C,minute:_,open:U,onChange:u}));function to(k){var M;let P=(M=Hr())!=null?M:new Date;E.set(re(P)),ae(P),pe(k),Q(k)}function Hr(){var P;let k=f.get();return t==="range"?(P=k==null?void 0:k[0])!=null?P:null:k!=null?k:null}return K(eo,Vr),eo;function jr(){let k=(H,fe,se)=>({button:H,type:"button",ariaLabel:fe,onClick:se,style:kl()}),P={div:[k("\xAB","Previous year",()=>ee(-1)),k("\u2039","Previous month",()=>ne(-1)),{div:H=>O.format(new Date(g.get(H),S.get(H),1)),ariaLive:"polite",_doctorDisable:"inline-typography",style:{flex:"1",textAlign:"center",fontWeight:"bold",fontSize:H=>x(H)}},k("\u203A","Next month",()=>ne(1)),k("\xBB","Next year",()=>ee(1))],style:{display:"flex",alignItems:"center",gap:h(1),marginBottom:h(2)}},M={div:B.map((H,fe)=>({div:H,_doctorDisable:"inline-typography",style:{textAlign:"center",fontSize:se=>x(se,"decrease-1"),fontWeight:"bold",color:se=>c(se,"shift-7"),paddingBlock:h(1)},_key:fe})),role:"row",style:vr()},z={div:H=>Fr(H),role:"grid",ariaLabel:"Calendar",onKeyDown:Ur,onMouseLeave:()=>t==="range"&&v.set(null),style:{display:"flex",flexDirection:"column",gap:h(.5)}},$=[P,M,z];return n&&$.push(Kr()),$.push(qr()),{div:$,role:"dialog",ariaModal:"false",dataTone:"shift-14",style:{minWidth:h(70),padding:h(3),borderRadius:H=>h(y(H)*2),backgroundColor:H=>c(H,"inherit"),color:H=>c(H,"text"),outline:H=>`1px solid ${c(H,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}}}function Fr(k){let P=new Date(g.get(k),S.get(k),1),M=S.get(k),z=jo(P,d),$=[];for(let H=0;H<6;H++){let fe=[];for(let se=0;se<7;se++){let je=He(z,H*7+se);fe.push(Wr(je,M,k))}$.push({div:fe,role:"row",style:vr(),_key:H})}return $}function Wr(k,P,M){let z=ie(k),$=oe(k,M),H=Y(k,M),fe=k.getMonth()!==P,se=St(k,E.get(M)),je=St(k,new Date);return{button:String(k.getDate()),type:"button",role:"gridcell",tabIndex:se?0:-1,ariaSelected:$,ariaDisabled:z,disabled:z,ariaLabel:I.format(k),dataDate:Ho(k),onClick:(X,Gr)=>Z(k,Gr),onMouseEnter:()=>t==="range"&&v.set(k),style:{appearance:"none",border:"none",cursor:z?"not-allowed":"pointer",aspectRatio:"1",borderRadius:h(1),fontSize:X=>x(X),fontFamily:"inherit",opacity:z?.35:fe?.5:1,backgroundColor:X=>$?c(X,"shift-7",s.get(X)):H?c(X,"hover",s.get(X)):"transparent",color:X=>$?c(X,"shift-0",s.get(X)):c(X,"text"),outline:je?X=>`1px solid ${c(X,"shift-6",s.get(X))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:X=>$?c(X,"shift-7",s.get(X)):c(X,"shift-3",s.get(X))},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:X=>T(X,s.get(X))}},_key:Ho(k)}}function Kr(){let k=(P,M,z)=>({select:Array.from({length:P},($,H)=>({option:String(H).padStart(2,"0"),value:String(H),selected:fe=>M.get(fe)===H,_key:H})),ariaLabel:z,onChange:$=>{M.set(Number($.target.value)),te()},style:_l()});return{div:[k(24,C,"Hour"),{span:":",_doctorDisable:"inline-typography",style:{fontWeight:"bold"}},k(60,_,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:h(1),marginTop:h(3)}}}function qr(){let k=(P,M)=>({button:P,type:"button",onClick:(z,$)=>M($),style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:z=>x(z,"decrease-1"),color:z=>c(z,"muted",s.get(z)),padding:h(1)}});return{div:[k("Today",P=>{let M=new Date;E.set(re(M)),ae(M),Q(P)}),k("Clear",()=>{f.set(t==="range"?[null,null]:null),v.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:h(2),paddingTop:h(2),borderTop:P=>`1px solid ${c(P,"border")}`}}}function Ur(k,P){let M=k,z=E.get(),$=null;switch(M.key){case"ArrowLeft":$=He(z,-1);break;case"ArrowRight":$=He(z,1);break;case"ArrowUp":$=He(z,-7);break;case"ArrowDown":$=He(z,7);break;case"Home":$=jo(z,d);break;case"End":$=He(jo(z,d),6);break;case"PageUp":$=Vo(z,M.shiftKey?-12:-1);break;case"PageDown":$=Vo(z,M.shiftKey?12:1);break;case"Enter":case" ":M.preventDefault(),Z(z,P);return;default:return}M.preventDefault(),E.set($),ae($),Q(P)}}function vr(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:h(.5)}}function kl(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>x(e),color:e=>c(e,"muted"),width:h(7),height:h(7),borderRadius:h(1),"&:hover":{backgroundColor:e=>c(e,"shift-3")}}}function _l(){return{fontFamily:"inherit",fontSize:e=>x(e),padding:h(1),borderRadius:h(1),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${c(e,"border-strong")}`,backgroundColor:e=>c(e,"inherit"),color:e=>c(e,"text")}}function Tl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:`minmax(${h(24)}, max-content) 1fr`,columnGap:h(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>x(o,"inherit"),color:o=>c(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>x(o,"inherit"),color:o=>c(o,"text",t.get(o))}}}}function Dl(e={}){var a,r;let{duration:t=240}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:i=>{i.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},_doctorDisable:"inline-typography",style:{fontSize:i=>x(i,"inherit"),color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),overflow:"hidden","& > summary":{backgroundColor:i=>c(i,"shift-2",n.get(i)),color:i=>c(i,"shift-10",n.get(i)),fontSize:i=>x(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:h(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:i=>h(y(i)*4),height:h(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:h(2),height:h(2),flexShrink:0,marginTop:h(-.5),borderInlineEnd:i=>`${h(.5)} solid ${c(i,"shift-9",n.get(i))}`,borderBottom:i=>`${h(.5)} solid ${c(i,"shift-9",n.get(i))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>c(i,"shift-3",n.get(i))},"& > summary:focus-visible":{borderRadius:i=>h(y(i)*2),boxShadow:i=>T(i,o.get(i))},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:i=>h(y(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:"none",opacity:1,paddingTop:i=>h(y(i)*1),paddingBottom:i=>h(y(i)*3)}}}}var xt=0;function Zt(){xt++,xt===1&&(document.body.style.overflow="hidden")}function nt(){xt=Math.max(0,xt-1),xt===0&&(document.body.style.overflow="")}var Sr='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function Ol(e,t){let{state:n,onDismiss:o}=t,a=null,r=!1,i=!1,l=null,u=e.domElement;u.setAttribute("aria-modal","true");let d=()=>{r=!1,typeof u.close=="function"&&u.close(),u.style.visibility="hidden",u.style.pointerEvents="none",u.style.display="none",i&&(nt(),i=!1),a==null||a.focus(),a=null},s=g=>{if(g.key!=="Tab")return;let S=Array.from(u.querySelectorAll(Sr)).filter(C=>!C.closest("[aria-hidden='true']")&&C.offsetParent!==null);if(!S.length){g.preventDefault();return}let E=S[0],v=S[S.length-1];g.shiftKey?(document.activeElement===E||document.activeElement===u)&&(g.preventDefault(),v.focus()):document.activeElement===v&&(g.preventDefault(),E.focus())},m=g=>{g.preventDefault(),Pe(n,o)};u.addEventListener("cancel",m);let f=g=>{if(g)r=!1,l&&(clearTimeout(l),l=null),a=document.activeElement,u.style.visibility="visible",u.style.pointerEvents="auto",u.style.display="",typeof u.showModal=="function"&&!u.open&&u.showModal(),i||(Zt(),i=!0),u.addEventListener("keydown",s),requestAnimationFrame(()=>{u.style.opacity="1";let S=u.querySelector(Sr);S==null||S.focus()});else{if(r=!0,u.style.opacity="0",u.removeEventListener("keydown",s),!u.open){d();return}l=setTimeout(()=>{l=null,r&&d()},350)}},p=ke(n,f);return{requestClose:()=>Pe(n,o),onTransitionEnd:g=>{r&&g.target===u&&g.propertyName==="opacity"&&d()},update(g){o=g.onDismiss,g.state!==n&&(p(),n=g.state,p=ke(n,f,!1))},destroy(){l&&(clearTimeout(l),l=null),p(),u.removeEventListener("cancel",m),i&&(nt(),i=!1),u.removeEventListener("keydown",s),a==null||a.focus(),a=null}}}function Pl(e={}){let{color:t="neutral",open:n=!1,labelledBy:o,describedBy:a,onDismiss:r}=e,i=ot(n);return N(L({_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')}},V("dialog",Ol,{state:i,onDismiss:r})),{ariaLabelledby:o,ariaDescribedby:a,onClick:(l,u)=>{var m;if(l.target!==u.domElement)return;let d=u.domElement.getBoundingClientRect();l.clientX>=d.left&&l.clientX<=d.right&&l.clientY>=d.top&&l.clientY<=d.bottom||(m=u.getBehavior("dialog"))==null||m.requestClose()},onTransitionEnd:(l,u)=>{var d;return(d=u.getBehavior("dialog"))==null?void 0:d.onTransitionEnd(l)},style:{opacity:"0",visibility:"hidden",pointerEvents:"none",transition:"opacity 200ms ease",fontSize:l=>x(l,"inherit"),color:l=>c(l,"shift-10",t),backgroundColor:l=>c(l,"inherit",t),border:"none",borderRadius:l=>h(y(l)*2),padding:l=>h(y(l)*3),boxShadow:W("high"),"&::backdrop":{backgroundColor:l=>c(l,"shift-2","neutral"),opacity:.75}}})}function Ll(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:h(2),fontSize:o=>x(o,"inherit"),backgroundColor:o=>c(o),color:o=>c(o,"text",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>c(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>c(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Fo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},xr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},rt=e=>e==="left"||e==="right";function wr(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function Ml(e,t){let{state:n,onDismiss:o,placement:a,size:r}=t,i=e.domElement;i.setAttribute("aria-modal","true");let l=v=>{v.preventDefault(),Pe(n,o)};i.addEventListener("cancel",l);let u=(v,C)=>{let w=(v==="start"||v==="end")&&(i.ownerDocument.documentElement.dir==="rtl"||i.ownerDocument.dir==="rtl"),O=wr(v,w),D=C!=null?C:rt(O)?h(80):h(64);return i.style.margin=xr[O],i.style.width=rt(O)?D:"100dvw",i.style.height=rt(O)?"100dvh":D,O},d=u(a,r),s=!1,m=!1,f=null,p=()=>{f=null,s&&(s=!1,typeof i.close=="function"&&i.close(),i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="none",m&&(nt(),m=!1))},g=v=>{v.target===i&&v.propertyName==="transform"&&p()};i.addEventListener("transitionend",g);let S=v=>{if(v)s=!1,f&&(clearTimeout(f),f=null),i.style.visibility="visible",i.style.pointerEvents="auto",i.style.display="",typeof i.showModal=="function"&&!i.open&&i.showModal(),m||(Zt(),m=!0),requestAnimationFrame(()=>{i.style.transform="translate(0, 0)"});else{if(s=!0,i.style.transform=Fo[d],!i.open){p();return}f=setTimeout(p,350)}},E=ke(n,S);return{requestClose:()=>Pe(n,o),update(v){o=v.onDismiss,v.state!==n&&(E(),n=v.state,E=ke(n,S,!1)),(v.placement!==a||v.size!==r)&&(a=v.placement,r=v.size,d=u(a,r),n.get()||(i.style.transform=Fo[d]))},destroy(){f&&(clearTimeout(f),f=null),E(),i.removeEventListener("cancel",l),i.removeEventListener("transitionend",g),m&&(nt(),m=!1)}}}function Il(e={}){let{color:t="neutral",open:n=!1,onDismiss:o,placement:a="end",size:r}=e,i=ot(n),l=wr(a,!1),u=rt(l)?h(80):h(64),d=r!=null?r:u;return N(L({_onInsert:s=>{s.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')}},V("drawer",Ml,{state:i,onDismiss:o,placement:a,size:r})),{onClick:(s,m)=>{var g;if(s.target!==m.domElement)return;let f=m.domElement.getBoundingClientRect();s.clientX>=f.left&&s.clientX<=f.right&&s.clientY>=f.top&&s.clientY<=f.bottom||(g=m.getBehavior("drawer"))==null||g.requestClose()},style:{transform:Fo[l],visibility:"hidden",pointerEvents:"none",transition:"transform 0.25s ease",fontSize:s=>x(s,"inherit"),color:s=>c(s,"shift-10",t),backgroundColor:s=>c(s,"inherit",t),border:"none",padding:s=>h(y(s)*3),margin:xr[l],width:rt(l)?d:"100dvw",height:rt(l)?"100dvh":d,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:W("high"),"&::backdrop":{backgroundColor:s=>c(s,"shift-2","neutral"),opacity:.75}}})}function Rl(e={}){var n;let t=b((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=>c(o,"shift-10",t.get(o))}}}function $l(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:h(3),paddingBlock:h(12),paddingInline:h(6),textAlign:"center",color:o=>c(o,"muted",t.get(o)),"& > :first-child":{color:o=>c(o,"shift-5",t.get(o)),opacity:.9},"& > :nth-child(2)":{color:o=>c(o,"text",t.get(o))}}}}var Wo="errorBoundaryOriginal";function zl(e){var n;let t=e.getMetadata(Wo);if(typeof t=="function"){(n=e._childrenRelease)==null||n.call(e),e._setupFunctionChildren(t);return}if(t!=null){e.children.update(Array.isArray(t)?t:[t]);return}e.children.update([])}function Nl(e={}){return{_onSchedule:(t,n)=>{t.getMetadata(Wo)===void 0&&t.setMetadata(Wo,n[t.tagName])},_onError:(t,n)=>{var r,i;(r=e.onError)==null||r.call(e,n);let o=()=>zl(t),a=typeof e.fallback=="function"?e.fallback(n,o):(i=e.fallback)!=null?i:{div:"An error occurred."};t.children.update([a])}}}var Al={small:8,medium:10,large:14};function Bl(e={}){var o,a;let t=b((o=e.color)!=null?o:"primary","color"),n=h(Al[(a=e.size)!=null?a:"medium"]);return{type:"button",_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"],style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>x(r,"inherit"),backgroundColor:r=>c(r,"shift-13",t.get(r)),color:r=>c(r,"shift-0","neutral"),boxShadow:W("low"),transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>c(r,"shift-14",t.get(r)),boxShadow:W("medium")},"&:active:not([disabled])":{backgroundColor:r=>c(r,"shift-15",t.get(r)),boxShadow:W("low")},"&:focus-visible":{boxShadow:r=>`${W("medium")}, ${T(r,t.get(r))}`},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Vl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:h(2),marginInline:0,marginTop:h(3),marginBottom:h(3),color:o=>c(o,"text",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:h(2)},"& figcaption":{fontSize:o=>x(o,"decrease-1"),color:o=>c(o,"muted",t.get(o)),lineHeight:1.45}}}}function Hl(e={}){var a;let{layout:t="horizontal"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},_doctorDisable:"inline-typography",style:{margin:0,paddingInline:r=>h(y(r)*3),paddingBlock:r=>h(y(r)*3),border:"none",borderRadius:r=>h(y(r)*2),fontSize:r=>x(r,"inherit"),backgroundColor:r=>c(r,"inherit",n.get(r)),color:r=>c(r,"text",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:h(4),rowGap:h(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>x(r,"inherit"),fontWeight:600,paddingBlock:r=>h(y(r)*1),borderRadius:r=>h(y(r)*2),color:r=>c(r,"text",n.get(r)),backgroundColor:r=>c(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?0:h(y(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${h(2)} * -1)`,fontSize:r=>x(r,"decrease-1"),color:r=>c(r,"text",n.get(r))}}}}function jl(e={}){let{columns:t=1,gap:n=4,align:o}=e;return{style:L({display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, minmax(0, 1fr))`:t,gap:a=>h(y(a)*n)},o?{alignItems:o}:{})}}var Fl={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Wl(e={}){var o;let t=b((o=e.color)!=null?o:"neutral","color"),n=e.size;return{_onInsert:a=>{["h1","h2","h3","h4","h5","h6"].includes(a.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:a=>c(a,"shift-11",t.get(a)),marginTop:0,marginBottom:h(2),fontSize:a=>{if(n!==void 0)return x(a,n);let r=Fl[a.elementNode.tagName]||"inherit";return x(a,r)}}}}function Kl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},dataTone:"shift-3",style:{border:0,height:"1px",marginInline:0,marginTop:h(3),marginBottom:h(3),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o))}}}function ql(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:h(4),height:h(4),flexShrink:"0",fontSize:o=>x(o),backgroundColor:"transparent",color:o=>c(o,"text",t.get(o))}}}function Ul(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:h(2),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o))}}}function Gl(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>x(r,"inherit"),color:r=>c(r,"text",t.get(r)),display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:h(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>c(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`,backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${h(.5)} solid ${c(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`,backgroundColor:r=>c(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:h(1.5),boxShadow:r=>T(r,n.get(r))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>c(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Yl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{type:"color",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag')},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>x(o,"inherit"),color:o=>c(o,"text",t.get(o)),paddingBlock:o=>h(y(o)*1),paddingInline:o=>h(y(o)*1),blockSize:o=>h(6+y(o)*2),inlineSize:o=>h(6+y(o)*2),backgroundColor:"transparent",transition:"box-shadow 140ms ease",borderRadius:o=>h(y(o)*1.5),"&:focus-visible":{boxShadow:o=>T(o,t.get(o))},"&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>h(y(o)*1.5)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>c(o,"shift-2","neutral"),outline:o=>`1px solid ${c(o,"border-strong","neutral")}`}}}}function Xl(e={}){var a,r;let{mode:t="datetime-local"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag')},style:{fontFamily:"inherit",fontSize:i=>x(i,"inherit"),lineHeight:"inherit",color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,borderRadius:i=>h(y(i)*1.5),paddingInline:i=>h(y(i)*3),height:i=>h(6+y(i)*2),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>c(i,"muted","neutral"),backgroundColor:i=>c(i,"shift-2","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`},"&:invalid":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`}}}}function Jl(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"file",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag')},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:r=>x(r,"inherit"),lineHeight:"inherit",color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,borderRadius:r=>h(y(r)*1.5),height:r=>h(6+y(r)*2),paddingInline:r=>h(y(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-file-upload-button":{marginTop:r=>h(y(r)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:h(1),height:h(6),paddingInline:h(2),cursor:"pointer",color:r=>c(r,"shift-11",t.get(r)),backgroundColor:r=>c(r,"surface",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>c(r,"muted","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`,backgroundColor:r=>c(r,"surface","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>c(r,"muted","neutral"),backgroundColor:r=>c(r,"shift-3","neutral")}}}}function Zl(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"number",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag')},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:h(10),paddingInlineStart:r=>h(y(r)*3),paddingInlineEnd:r=>h(y(r)*1.5),paddingBlock:r=>h(y(r)*1),borderRadius:r=>h(y(r)*1.5),fontSize:r=>x(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>c(r,"shift-2","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`,color:r=>c(r,"muted","neutral")}}}}function Ql(){return{role:"group",ariaLabel:"One-time password",style:{display:"flex",alignItems:"center",gap:h(2),"& > *":{minWidth:`${h(9)}!important`}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=i=>{let l=n(),u=i.target,d=l.indexOf(u);u.value&&d<l.length-1&&l[d+1].focus()},a=i=>{let l=n(),u=i.target,d=l.indexOf(u);i.key==="Backspace"&&!u.value&&d>0&&l[d-1].focus(),i.key==="ArrowLeft"&&d>0&&l[d-1].focus(),i.key==="ArrowRight"&&d<l.length-1&&l[d+1].focus()},r=i=>{var f,p,g;i.preventDefault();let l=(p=(f=i.clipboardData)==null?void 0:f.getData("text"))!=null?p:"",u=n(),d=u.indexOf(i.target),s=d===-1?0:d;[...l].forEach((S,E)=>{let v=u[s+E];v&&(v.value=S,v.dispatchEvent(new Event("input",{bubbles:!0})),v.dispatchEvent(new Event("change",{bubbles:!0})))});let m=Math.min(s+l.length-1,u.length-1);(g=u[m])==null||g.focus()};t.addEventListener("input",o),t.addEventListener("keydown",a),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",a),t.removeEventListener("paste",r)})}}}var es='<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>',ts='<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>',os=["name","value","onInput","disabled","required"];function Er(e){if(e!=null)return typeof e=="function"?e:le(e)?t=>e.get(t):e}function ns(e={}){var r,i;let t=b((r=e.color)!=null?r:"neutral","color"),n=b((i=e.accentColor)!=null?i:"primary","accentColor"),o=b(!1),a={};return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onSchedule:(l,u)=>{let d=u;for(let s of os)d[s]!==void 0&&(a[s]=d[s],delete d[s])},_onInit:l=>{var S,E,v,C,_,w,O;let u=(S=e.name)!=null?S:a.name,d=Er((E=e.value)!=null?E:a.value),s=(v=e.onInput)!=null?v:a.onInput,m=Er((C=e.disabled)!=null?C:a.disabled),f=(_=e.required)!=null?_:a.required,p=N(L(L(L(L(L({input:null,type:D=>o.get(D)?"text":"password",ariaLabel:(w=e.ariaLabel)!=null?w:"Password",autocomplete:(O=e.autocomplete)!=null?O:"current-password"},u!=null?{name:u}:{}),d!=null?{value:d}:{}),s!=null?{onInput:s}:{}),m!=null?{disabled:m}:{}),f!=null?{required:f}:{}),{style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}}),g={button:D=>Ie(o.get(D)?ts:es),type:"button",ariaLabel:D=>o.get(D)?"Hide password":"Show password",onClick:()=>o.set(!o.get()),style:{background:"none",border:"none",padding:0,margin:0,cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",flexShrink:0,opacity:.6}};l.children.insert(p),l.children.insert(g)},style:{display:"flex",alignItems:"center",gap:l=>h(y(l)*1),paddingBlock:l=>h(y(l)*1),paddingInline:l=>h(y(l)*3),borderRadius:l=>h(y(l)*1.5),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${c(l,"border-strong",t.get(l))}`,color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"inherit",t.get(l)),fontSize:l=>x(l,"inherit"),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not(:has([disabled])):not(:focus-within)":{outline:l=>`1px solid ${c(l,"shift-5",n.get(l))}`},"&:focus-within":{boxShadow:l=>T(l,n.get(l))}}}}function rs(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"radio",_onInsert:r=>{if(r.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:r=>x(r,"inherit"),color:r=>c(r,"text",t.get(r)),appearance:"none",display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>c(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",boxShadow:r=>T(r,n.get(r))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>c(r,"shift-4","neutral"),pointerEvents:"none"}}}}function is(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"range",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:h(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:h(1.5),borderRadius:h(999),backgroundColor:r=>c(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:h(4),height:h(4),borderRadius:h(999),border:"none",marginTop:`calc((${h(1.5)} - ${h(4)}) / 2)`,backgroundColor:r=>c(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>c(r,"shift-10",n.get(r))},borderRadius:h(2),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function as(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"search",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag')},style:{fontFamily:"inherit",fontSize:r=>x(r,"inherit"),lineHeight:"inherit",color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,borderRadius:r=>h(y(r)*1.5),minWidth:h(32),paddingInline:r=>h(y(r)*3),paddingBlock:r=>h(y(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:r=>c(r,"shift-7",t.get(r))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>c(r,"muted","neutral"),backgroundColor:r=>c(r,"shift-2","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`}}}}function ls(e={}){var n;let t=b((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"),backgroundColor:o=>c(o,"inherit"),color:o=>c(o,"text"),appearance:"none",position:"relative",display:"inline-flex",width:h(9),height:h(6),cursor:"pointer",margin:"0",paddingBlock:h(1),transition:"box-shadow 140ms ease",borderRadius:h(999),"&:focus-visible":{boxShadow:o=>T(o,t.get(o))},"&:checked":{"&::before":{backgroundColor:o=>c(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${h(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:h(3),height:h(3),borderRadius:h(999),left:h(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>c(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:h(999),display:"inline-block",fontSize:o=>x(o,"inherit"),lineHeight:1,backgroundColor:o=>c(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ss(e={}){var a,r;let{type:t="text"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type')},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:h(10),paddingInline:i=>h(y(i)*3),paddingBlock:i=>h(y(i)*1),borderRadius:i=>h(y(i)*1.5),fontSize:i=>x(i,"inherit"),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>c(i,"shift-7")},"&:not(:placeholder-shown)":{color:i=>c(i,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:i=>c(i,"shift-2","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`,color:i=>c(i,"muted","neutral")},"&:invalid:not(:placeholder-shown)":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`},"&[data-status=error]":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","warning")}`}}}}function cs(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),paddingBlock:o=>h(y(o)*(.5/1.5)),paddingInline:o=>h(y(o)*(1.5/1.5)),borderRadius:o=>h(y(o)*(1/1.5)),outline:o=>`1px solid ${c(o,"border-strong",t.get(o))}`}}}function us(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:h(2),fontSize:r=>x(r,"inherit"),color:r=>c(r,"text",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>c(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>c(r,"muted","neutral")}}}}function ms(e={}){var o,a;let t=b((o=e.color)!=null?o:"primary","color"),n=b((a=e.accentColor)!=null?a:"secondary","accentColor");return{_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},onClick:(r,i)=>{let l=i.domElement;(l!=null&&l.hasAttribute("disabled")||(l==null?void 0:l.getAttribute("aria-disabled"))==="true")&&r.preventDefault()},style:{fontSize:r=>x(r,"inherit"),backgroundColor:r=>c(r),color:r=>c(r,"shift-13",t.get(r)),textDecoration:"none","&:visited":{color:r=>c(r,"shift-13",n.get(r))},"&:hover:not([disabled])":{color:r=>c(r,"shift-14",t.get(r)),textDecoration:"underline"},borderRadius:h(1),outline:"none",transition:"color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>T(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:r=>c(r,"muted","neutral")}}}}var ds={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}},hs={small:.5,medium:1,large:1.5};function fs(e={}){var l,u,d;let t=(l=e.variant)!=null?l:"outline",n=b((u=e.color)!=null?u:t==="ghost"?"neutral":"primary","color"),o=(d=e.size)!=null?d:"medium",a=Ze[o];if(t==="ghost"){let s=hs[o];return{_onInsert:m=>{m.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:m=>x(m,a),textDecoration:"none",paddingBlock:m=>h(y(m)*s),paddingInline:m=>h(y(m)*s),borderRadius:m=>h(y(m)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:m=>h(y(m)*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:m=>c(m,"text",n.get(m)),"&:hover:not([aria-disabled=true])":{color:m=>c(m,"text",n.get(m)),backgroundColor:m=>c(m,"hover",n.get(m)),textDecoration:"none"},"&:active:not([aria-disabled=true])":{color:m=>c(m,"text",n.get(m)),backgroundColor:m=>c(m,"increase-2",n.get(m))},"&:focus-visible":{boxShadow:m=>T(m,n.get(m))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:m=>c(m,"border-strong","neutral")}}}}let r=t==="solid",i=ds[o];return N(L({_onInsert:s=>{s.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')}},r?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{fontSize:s=>x(s,a),textDecoration:"none",paddingBlock:s=>h(y(s)*i.block),paddingInline:s=>h(y(s)*i.inline),borderRadius:s=>h(y(s)*1.5),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:s=>h(y(s)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:r?"none":s=>`1px solid ${c(s,"border-strong",n.get(s))}`,color:s=>r?c(s,"shift-0","neutral"):c(s,"shift-13",n.get(s)),backgroundColor:s=>r?c(s,"shift-13",n.get(s)):c(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([aria-disabled=true])":{textDecoration:"none",color:s=>r?c(s,"shift-0","neutral"):c(s,"shift-14",n.get(s)),backgroundColor:s=>r?c(s,"shift-14",n.get(s)):c(s,"hover",n.get(s))},"&:active:not([aria-disabled=true])":{backgroundColor:s=>r?c(s,"shift-15",n.get(s)):c(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>T(s,n.get(s))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:s=>c(s,"shift-2","neutral"),outline:s=>`1px solid ${c(s,"border-strong","neutral")}`,color:s=>c(s,"muted","neutral")}}})}function ps(e={}){var n;let t=(n=e.color)!=null?n:"neutral";return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",backgroundColor:o=>c(o,"inherit",t),color:o=>c(o,"text",t)}}}function gs(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>h(y(n)*2),paddingBlock:n=>h(t?1:y(n)*2),paddingInline:n=>h(y(n)*3),fontSize:n=>x(n,"inherit"),color:n=>c(n,"text")}}}function ys(e={}){var a,r;let t=b((a=e.color)!=null?a:"neutral","color"),n=(r=e.accentColor)!=null?r:"primary",{dense:o=!1}=e;return{style:{cursor:"pointer",appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:i=>h(y(i)*2),paddingBlock:i=>h(o?1:y(i)*2),paddingInline:i=>h(y(i)*3),fontSize:i=>x(i,"inherit"),color:i=>c(i,"text",t.get(i)),borderRadius:i=>h(y(i)*1.5),transition:"background-color 150ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{backgroundColor:i=>c(i,"hover",t.get(i))},"&:active:not([disabled])":{backgroundColor:i=>c(i,"increase-2",t.get(i))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:i=>c(i,"shift-3",n),color:i=>c(i,"shift-12",n)},"&:focus-visible":{boxShadow:i=>T(i,n)},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function bs(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),height:o=>h(y(o)*(6/1.5)),borderRadius:o=>h(y(o)*(1/1.5)),paddingInline:o=>h(y(o)*(1.5/1.5))}}}function vs(e={items:[]}){var s;let{items:t=[],selectable:n=!0,color:o="neutral",accentColor:a="primary"}=e,r=b((s=e.activeKey)!=null?s:null),i=e.activeKey!==void 0,l=(m,f)=>{let p=m.nodeId;return f.items.map((g,S)=>{var v;let E=(v=g.key)!=null?v:S;return N(L({button:typeof g.label=="string"?[{span:g.label}]:[g.label],_key:E,type:"button",id:`menuitem${p}${E}`,role:"menuitem"},f.selectable?{ariaCurrent:C=>f.activeKey.get(C)===E||void 0}:{}),{onClick:()=>{var C;f.selectable&&f.activeKey.set(E),(C=g.onClick)==null||C.call(g)},onKeyDown:C=>{var I;let _=C.key;if(_==="Enter"||_===" "){C.preventDefault(),C.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(_))return;C.preventDefault();let w=f.items.map((F,A)=>{var B;return(B=F.key)!=null?B:A}),O=w.indexOf(E),D=O;_==="ArrowDown"?D=(O+1)%w.length:_==="ArrowUp"?D=(O-1+w.length)%w.length:_==="Home"?D=0:_==="End"&&(D=w.length-1),(I=document.getElementById(`menuitem${p}${w[D]}`))==null||I.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:h(2),width:"100%",fontSize:C=>x(C,"inherit"),height:C=>h(6+y(C)*2),paddingInline:C=>h(y(C)*3),border:"none",outline:"none",color:C=>c(C,"text",f.color),backgroundColor:C=>c(C,"inherit",f.color),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:C=>c(C,"hover",f.color)},"&[aria-current=true]":{backgroundColor:C=>c(C,"shift-3",f.accentColor),color:C=>c(C,"shift-13",f.accentColor)},"&:focus-visible":{boxShadow:C=>T(C,f.accentColor)}}})})},u=(m,f)=>{let p=f;return{update(g){g.activeKey!==p.activeKey&&!g.activeKeyIsCallerOwned&&g.activeKey.set(p.activeKey.get()),p=g,p.items.length!==0&&m.children.update(l(m,p))}}},d={items:t,activeKey:r,activeKeyIsCallerOwned:i,selectable:n,color:o,accentColor:a};return N(L({role:"menu",dataTone:"shift-0",_onSchedule:(m,f)=>{t.length!==0&&(f[m.tagName]=l(m,d))}},V("menu",u,d)),{style:{display:"flex",flexDirection:"column",paddingBlock:m=>h(y(m)*2),paddingInline:m=>h(y(m)*2),fontSize:m=>x(m,"inherit"),backgroundColor:m=>c(m,"inherit",o),color:m=>c(m,"text",o),borderRadius:m=>h(y(m)*2),outline:m=>`1px solid ${c(m,"border-strong",o)}`,outlineOffset:"-1px",boxShadow:W("medium")}})}var Cr=e=>!!e&&typeof e.get=="function"&&e._isState===!0,xe=e=>{let t={},n=[];for(let o in e){let a=e[o];o==="x"?n.push(`translateX(${typeof a=="number"?`${a}px`:a})`):o==="y"?n.push(`translateY(${typeof a=="number"?`${a}px`:a})`):o==="scale"?n.push(`scale(${a})`):o==="rotate"?n.push(`rotate(${typeof a=="number"?`${a}deg`:a})`):t[o]=a}return n.length&&(t.transform=n.join(" ")),t};function Ko(e={}){var t,n,o,a;return{duration:(t=e.duration)!=null?t:300,delay:(n=e.delay)!=null?n:0,easing:(o=e.easing)!=null?o:"ease",iterations:(a=e.iterations)!=null?a:1,fill:"both"}}function qo(){if(typeof matchMedia!="function")return!1;try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch(e){return!1}}function Ss(e,t){let n=e.domElement,o=t,a,r=l=>{a==null||a(),a=void 0,!(!n||!Cr(l))&&(a=l.addListener(u=>{qo()?Object.assign(n.style,xe(u)):typeof n.animate=="function"&&n.animate([xe(u)],Ko(o.transition))}))},i=(l,u)=>{if(!n)return;let d=Cr(l.animate)?l.animate.get():l.animate;if(qo()){d?Object.assign(n.style,xe(d)):u==="enter"&&l.initial&&Object.assign(n.style,xe(l.initial));return}if(typeof n.animate=="function")if(d){let s=u==="enter"&&l.initial?[xe(l.initial),xe(d)]:[xe(d)];n.animate(s,Ko(l.transition))}else u==="enter"&&l.initial&&Object.assign(n.style,xe(l.initial))};return i(t,"enter"),r(t.animate),{play:i,getExit:()=>o.exit,getTransition:()=>o.transition,update(l){o=l,i(l,"update"),r(l.animate)},destroy(){a==null||a()}}}function xs(e={}){return N(L({},V("motion",(t,n)=>Ss(t,n),e)),{_onBeforeRemove:(t,n)=>{var i,l;let o=t.domElement,a=t.getBehavior("motion"),r=(i=a==null?void 0:a.getExit())!=null?i:e.exit;if(!o||!r||typeof o.animate!="function")return n();if(qo())return Object.assign(o.style,xe(r)),n();o.animate([xe(r)],Ko((l=a==null?void 0:a.getTransition())!=null?l:e.transition)).finished.then(n,n)}})}function ws(e={}){var n;let t=b((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=>c(o),color:o=>c(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:h(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Es(e,t){if(t<=7)return Array.from({length:t},(r,i)=>i+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),a=Math.min(t-1,e+1);for(let r=o;r<=a;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function Cs(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function kr(e,t){let n=e.getMetadata("paginationTotal");return n||(n=b(t),e.setMetadata("paginationTotal",n)),n}function ks(e){let{total:t,color:n="neutral",accentColor:o="primary"}=e,a={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:i=>h(6+y(i)*2),height:i=>h(6+y(i)*2),paddingInline:i=>h(y(i)*2),borderRadius:i=>h(y(i)*1.5),border:"none",cursor:"pointer",fontSize:i=>x(i,"inherit"),backgroundColor:"transparent",color:i=>c(i,"shift-13",n),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled])":{color:i=>c(i,"shift-13",n),backgroundColor:i=>c(i,"hover",n)},"&:focus-visible":{boxShadow:i=>T(i,o)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},r=N(L({},a),{backgroundColor:i=>c(i,"shift-13",o),color:i=>c(i,"shift-0","neutral"),fontWeight:"bold",cursor:"default","&:hover:not([disabled])":{backgroundColor:i=>c(i,"shift-13",o)}});return N(L({role:"navigation",ariaLabel:"Pagination",_doctorDisable:"inline-typography",_onInsert:i=>{i.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:i=>{let l=Cs(i,"paginationPage",e.value,1),u=kr(i,t),d={div:s=>{let m=l.get(s),f=u.get(s),p=[];p.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:m<=1,onClick:()=>m>1&&l.set(m-1),style:a});let g=0;for(let S of Es(m,f))if(S==="...")p.push({span:"\u2026",_key:`ellipsis-${g++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:E=>h(y(E)*2),color:E=>c(E,"shift-7",n)}});else{let E=S===m;p.push({button:String(S),_key:`page-${S}`,type:"button",ariaLabel:`Page ${S}`,ariaCurrent:E?"page":void 0,disabled:E,onClick:()=>l.set(S),style:E?r:a})}return p.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:m>=f,onClick:()=>m<f&&l.set(m+1),style:a}),p},style:{display:"flex",alignItems:"center",gap:h(1)}};i.children.insert(d)}},V("pagination-total",i=>({update(l){kr(i,l.total).set(l.total)}}),{total:t})),{style:{display:"inline-flex"}})}function _s(e={}){var a;let{padding:t=4,divider:n=!1}=e,o=b((a=e.color)!=null?a:"neutral","color");return{style:L({padding:r=>h(y(r)*t)},n?{borderBottom:r=>`1px solid ${c(r,"border",o.get(r))}`}:{})}}function Ts(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Ds(e){var m;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,a=b(t),r=b(n),{show:i,hide:l,anchorPartial:u}=Se({kind:"popover",open:a,onDismiss:e.onDismiss,placement:r,content:e.content,keepOpenOnContentHover:o==="hover"}),d={role:"dialog",dataTone:"shift-14",style:{backgroundColor:f=>c(f,"inherit"),color:f=>c(f,"text"),borderRadius:f=>h(y(f)*2),outline:f=>`1px solid ${c(f,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};return(m=e.content).$||(m.$=[]),e.content.$.push(d),K(u,{ariaHaspopup:"dialog",ariaExpanded:f=>a.get(f),ariaControls:f=>f!=null&&f.elementNode?de("popover",f.elementNode):void 0,onMouseEnter:(f,p)=>o==="hover"&&i(p),onMouseLeave:(f,p)=>o==="hover"&&l(p),onClick:(f,p)=>{o==="click"&&(a.get()?l(p):i(p))},onKeyDown:(f,p)=>{f.key==="Escape"&&a.get()&&l(p)},onFocus:(f,p)=>o==="hover"&&i(p),onBlur:(f,p)=>{if(o!=="hover")return;let g=f.relatedTarget,E=p.getRoot().domElement.querySelector(`#${de("popover",p)}`);g&&(E!=null&&E.contains(g))||l(p)}}),u}function Uo(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=h(6),bordered:a=!0}=e,r=b(t),i={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},l=s=>{var m;return(m=i[r.get(s)])!=null?m:i["bottom-end"]},u=s=>s.includes("start")?o:s.includes("end")?"auto":"50%",d=s=>s.includes("end")?o:s.includes("start")?"auto":"50%";return{style:{fontSize:s=>x(s),backgroundColor:s=>c(s),color:s=>c(s,"text",n),position:"relative","&::after":{content:'""',position:"absolute",width:h(1.5),height:h(1.5),backgroundColor:s=>c(s,"inherit",n),borderWidth:a?"1px":0,borderColor:s=>c(s,"border-strong",n),borderTopStyle:s=>{let m=l(s);return m.includes("top")||m.includes("right")?"solid":"none"},borderBottomStyle:s=>{let m=l(s);return m.includes("bottom")||m.includes("left")?"solid":"none"},borderLeftStyle:s=>{let m=l(s);return m.includes("top")||m.includes("left")?"solid":"none"},borderRightStyle:s=>{let m=l(s);return m.includes("bottom")||m.includes("right")?"solid":"none"},top:s=>{let m=l(s);return m.includes("top")?0:m.includes("bottom")?"auto":u(m)},right:s=>{let m=l(s);return m.includes("right")?0:m.includes("left")?"auto":d(m)},bottom:s=>{let m=l(s);return m.includes("bottom")?0:m.includes("top")?"auto":d(m)},left:s=>{let m=l(s);return m.includes("left")?0:m.includes("right")?"auto":u(m)},transform:s=>{let m=l(s),f=m.includes("right")||m.includes("end")&&!m.includes("left")?"50%":"-50%",p=m.includes("bottom")||m.includes("end")&&!m.includes("top")?"50%":"-50%";return`translate(${f},${p}) rotate(45deg)`}}}}}function Os(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*3),borderRadius:o=>h(y(o)*2)}}}function Ps(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},dataTone:"shift-3",style:{appearance:"none",width:"100%",height:h(2),border:0,borderRadius:h(999),overflow:"hidden",backgroundColor:r=>c(r,"inherit",t.get(r)),color:r=>c(r,"text",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>c(r,"inherit",t.get(r)),borderRadius:h(999)},"&::-webkit-progress-value":{backgroundColor:r=>c(r,"shift-9",n.get(r)),borderRadius:h(999),transition:"width 220ms ease"}}}}var Ls='<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>',Ms='<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 _r(e,t){var n,o,a;e.onChange=t.onChange,e.readOnly=(n=t.readOnly)!=null?n:!1,e.max=(o=t.max)!=null?o:5,e.color=(a=t.color)!=null?a:"warning",le(t.value)?t.value!==e.valueState&&e.valueState.set(t.value.get()):t.value!==void 0&&e.valueState.set(t.value)}function Is(e,t,n,o){let a=i=>{let l=o.get(i);return l>0?l:n.valueState.get(i)},r={button:i=>Ie(t<=a(i)?Ls:Ms),_key:t,type:"button",ariaLabel:`${t} star${t>1?"s":""}`,onClick:()=>{var l;if(n.readOnly)return;let i=t===n.valueState.get()?0:t;n.valueState.set(i),(l=n.onChange)==null||l.call(n,i),o.set(0)},onMouseEnter:()=>{n.readOnly||o.set(t)},onMouseLeave:()=>o.set(0),onKeyDown:i=>{var s,m,f;if(n.readOnly)return;let l=n.valueState.get(),u=l;if(i.key==="ArrowRight"||i.key==="ArrowUp")u=Math.min(n.max,l+1),i.preventDefault();else if(i.key==="ArrowLeft"||i.key==="ArrowDown")u=Math.max(0,l-1),i.preventDefault();else return;n.valueState.set(u),(s=n.onChange)==null||s.call(n,u);let d=u>0?u-1:0;(f=(m=e.domElement)==null?void 0:m.children[d])==null||f.focus()},style:{background:"none",border:"none",outline:"none",borderRadius:h(1),padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center",transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:i=>T(i,n.color)}}};e.children.insert(r)}function Go(e,t,n){let o=e.children.items;for(;o.length>t.max;)e.children.remove(o[o.length-1]);for(let a=o.length+1;a<=t.max;a++)Is(e,a,t,n)}function Rs(e={}){var o,a,r,i,l,u,d;let t={valueState:b((o=e.value)!=null?o:0),onChange:e.onChange,readOnly:(a=e.readOnly)!=null?a:!1,max:(r=e.max)!=null?r:5,color:(i=e.color)!=null?i:"warning"},n=b(0);return N(L({role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:h(.5),fontSize:s=>x(s,"increase-1"),cursor:t.readOnly?"default":"pointer",color:s=>c(s,"muted",t.color)}},V("rating",(s,m)=>(_r(t,m),Go(s,t,n),{update(f){_r(t,f),Go(s,t,n)}}),{value:e.value,max:(l=e.max)!=null?l:5,onChange:e.onChange,readOnly:(u=e.readOnly)!=null?u:!1,color:(d=e.color)!=null?d:"warning"})),{_onInit:s=>{Go(s,t,n)}})}function $s(e={}){var u,d,s;let{size:t=16,thickness:n=.25}=e,o=b((u=e.value)!=null?u:0,"value"),a=b((d=e.color)!=null?d:"primary","color"),r=b((s=e.trackColor)!=null?s:"neutral","trackColor"),i=Math.round((1-n)*100),l=`radial-gradient(circle closest-side, transparent ${i}%, black ${i}%)`;return{role:"progressbar",ariaValuenow:m=>String(Math.round(o.get(m))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:m=>{m.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:h(t),height:h(t),borderRadius:"50%",color:m=>c(m,"shift-9",a.get(m)),background:m=>`conic-gradient(from -90deg, ${c(m,"shift-9",a.get(m))} ${o.get(m)}%, ${c(m,"shift-3",r.get(m))} 0%)`,WebkitMask:l,mask:l}}}function Yo(e={}){let{gap:t=4,align:n="center",justify:o,wrap:a=!1,density:r=!0}=e;return{style:L(L({display:"flex",alignItems:n,gap:r?i=>h(y(i)*t):()=>h(t)},o?{justifyContent:o}:{}),a?{flexWrap:"wrap"}:{})}}function zs(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{style:{overflow:"auto",color:o=>c(o,"text",t.get(o)),"&::-webkit-scrollbar":{width:h(2),height:h(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>c(o,"shift-5",t.get(o)),borderRadius:h(999),border:`${h(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>c(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${c(o,"shift-5",t.get(o))} transparent`}}}function Tr(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function Ns(e,t,n,o){var d;let a=e.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(a))return;e.preventDefault();let r=t.map((s,m)=>{var f;return(f=s.key)!=null?f:String(m)}),i=r.indexOf(n),l=i;a==="ArrowRight"?l=(i+1)%r.length:a==="ArrowLeft"?l=(i-1+r.length)%r.length:a==="Home"?l=0:a==="End"&&(l=r.length-1),o.set(r[l]);let u=e.target.closest("[role=radiogroup]");(d=u==null?void 0:u.querySelectorAll("[role=radio]")[l])==null||d.focus()}function Dr(e,t,n,o){return e.map((a,r)=>{var u;let i=(u=a.key)!=null?u:String(r);return{button:[typeof a.label=="string"?{span:a.label}:a.label],_key:i,type:"button",role:"radio",ariaChecked:d=>t.get(d)===i,tabIndex:d=>{var m,f;let s=t.get(d);return s===i||s===""&&i===((f=(m=e[0])==null?void 0:m.key)!=null?f:"")?0:-1},onClick:()=>t.set(i),onKeyDown:d=>Ns(d,e,i,t),style:{cursor:"pointer",fontSize:d=>x(d,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(3),border:"none",borderRadius:h(10),color:d=>c(d,"text",n),backgroundColor:"transparent",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:d=>c(d,"shift-3",n)},"&:active:not([disabled]):not([aria-checked=true])":{backgroundColor:d=>c(d,"increase-2",n)},"&[aria-checked=true]":{backgroundColor:d=>c(d,"shift-0",o),color:d=>c(d,"shift-10",o),boxShadow:W("low")},"&:focus-visible":{boxShadow:d=>T(d,o)},"&[aria-checked=true]:focus-visible":{boxShadow:d=>`${W("low")}, ${T(d,o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function As(e={items:[]}){var r,i,l;let{items:t=[],color:n="neutral",accentColor:o="primary"}=e,a={items:t,color:n,accentColor:o};return N(L({role:"radiogroup",_context:{segmented:{value:b((l=(i=e.value)!=null?i:(r=t[0])==null?void 0:r.key)!=null?l:"")}},_onSchedule:(u,d)=>{var m,f;let s=Tr(u,"segmentedValue",e.value,(f=(m=t[0])==null?void 0:m.key)!=null?f:"");d[u.tagName]=Dr(t,s,n,o)}},V("segmented-items",u=>({update(d){var m,f;let s=Tr(u,"segmentedValue",e.value,(f=(m=d.items[0])==null?void 0:m.key)!=null?f:"");u.children.update(Dr(d.items,s,d.color,d.accentColor),!!u.domElement,!0)}}),a)),{dataTone:"shift-2",style:{display:"inline-flex",paddingBlock:h(1),paddingInline:h(1),gap:h(.5),borderRadius:h(10),backgroundColor:u=>c(u,"inherit",n),color:u=>c(u,"text",n)}})}function Bs(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=>c(o,"text",t),backgroundColor:o=>c(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${c(o,"border-strong",t)}`,borderRadius:o=>h(y(o)*1.5),paddingBlock:o=>h(y(o)*1),paddingLeft:o=>h(y(o)*3),paddingRight:o=>h(y(o)*5),backgroundImage:o=>{let a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Po(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${h(2)} center`,backgroundSize:`${h(2.5)} ${h(1.5)}`,transition:"outline-color 140ms ease, box-shadow 140ms ease","&:not([multiple])":{height:o=>h(6+y(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`1px solid ${c(o,"shift-5",n)}`},"&:focus-visible":{boxShadow:o=>T(o,n)},"& optgroup":{color:o=>c(o,"shift-11",t)},"& option[disabled]":{color:o=>c(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>c(o,"muted","neutral"),outline:o=>`1px solid ${c(o,"border-strong","neutral")}`,backgroundColor:o=>c(o,"shift-2","neutral")}}}}var Vs=1e3;function Hs(e){let t=e.getMetadata("selectBoxTypeahead");return t||(t={buffer:"",timer:null},e.setMetadata("selectBoxTypeahead",t)),t}var Or=(e,t)=>e.trim().toLowerCase().startsWith(t);function js(e){return e?Array.from(e.querySelectorAll("[role=option]")).filter(t=>t.getAttribute("aria-disabled")!=="true"&&!t.hasAttribute("disabled")):[]}function Fs(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=b(e.value),l=b(a),{show:u,hide:d,anchorPartial:s}=Se({kind:"selectBox",open:l,onDismiss:e.onDismiss,placement:b(n),content:e.content}),m={onClick:(v,C)=>!r&&d(C),dataTone:"shift-14",style:{backgroundColor:v=>c(v,"inherit"),color:v=>c(v,"text"),borderRadius:v=>h(y(v)*2),outline:v=>`1px solid ${c(v,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};K(e.content,m);let f=v=>({div:C=>{let _=v.state.get(C),w=Array.isArray(_)?_:[_];return v.options.filter(D=>w.includes(D.value)).map(D=>({span:D.label,$:[vt({color:v.color,removable:v.multiple})],_key:D.value,_onRemove:I=>{let F=v.state.get(),B=(Array.isArray(F)?F:[F]).filter(ie=>ie!==D.value);v.multiple?v.state.set(B):v.state.set(B[0])}}))},_key:"selectBoxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1),flex:1}}),p=(v,C)=>({update(_){v.children.update([f(_)])}}),g=v=>l.get()?d(v):u(v),S=(v,C)=>{var A,B,ie,q;let _=Hs(C);_.timer&&clearTimeout(_.timer),_.buffer+=v.toLowerCase(),_.timer=setTimeout(()=>{_.buffer=""},Vs);let w=_.buffer.length>1&&new Set(_.buffer).size===1,O=w?_.buffer[0]:_.buffer;if(l.get()){let Z=C.getRoot().domElement,te=(A=Z==null?void 0:Z.querySelector(`#${de("selectBox",C)}`))!=null?A:null,Y=js(te).filter(ee=>{var Q;return Or((Q=ee.textContent)!=null?Q:"",O)});if(!Y.length)return;let oe=(ie=(B=C.domElement)==null?void 0:B.ownerDocument)==null?void 0:ie.activeElement,ae=w&&oe?Y.indexOf(oe):-1,ne=Y[(ae+1)%Y.length];ne.focus(),(q=ne.scrollIntoView)==null||q.call(ne,{block:"nearest"});return}if(r)return;let D=t.filter(Z=>Or(Z.label,O));if(!D.length)return;let I=w?D.findIndex(Z=>Z.value===i.get()):-1,F=D[(I+1)%D.length];i.set(F.value)},E=N(L({_onInsert:v=>{v.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onSchedule:(v,C)=>{C[v.tagName]=[f({options:t,multiple:r,color:o,state:i})]}},V("selectBoxInner",p,{options:t,multiple:r,color:o,state:i})),{onClick:(v,C)=>g(C),tabindex:0,role:"button",ariaExpanded:v=>l.get(v),ariaHaspopup:"listbox",ariaControls:v=>v!=null&&v.elementNode?de("selectBox",v.elementNode):void 0,onKeyDown:(v,C)=>{let _=v.key;if(_==="Escape"){d(C);return}if(_==="Enter"||_===" "){v.preventDefault(),g(C);return}if(_==="ArrowDown"&&!l.get()){v.preventDefault(),u(C);return}let w=v;_.length===1&&!w.ctrlKey&&!w.metaKey&&!w.altKey&&S(_,C)},style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>h(6+y(v)*2),minWidth:h(32),outlineOffset:"-1px",outline:v=>`1px solid ${c(v,"border-strong","neutral")}`,paddingInline:v=>h(y(v)*2),borderRadius:v=>h(y(v)*1.5),fontSize:v=>x(v,"inherit"),color:v=>c(v,"text",o),backgroundColor:v=>c(v,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:v=>T(v,o)}}});return K(s,E),s}function Ws(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",tabindex:-1,ariaSelected:r=>{var u;let i=(u=r==null?void 0:r.elementNode)==null?void 0:u.getContext("select");if(!i)return;let l=i.value.get(r);return i.multiple?l.includes(o):l===o},onClick:(r,i)=>{let l=i.getContext("select");if(!l)return;let u=l.value,d=u.get();l.multiple?d.includes(o)?u.set(d.filter(s=>s!==o)):u.set(d.concat([o])):d!==o&&u.set(o)},_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag')},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>x(r,"inherit"),height:r=>h(6+y(r)*2),paddingInline:r=>h(y(r)*3),border:"none",outline:"none",color:r=>c(r,"text",n),backgroundColor:r=>c(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>c(r,"hover",n)},"&[aria-selected=true]":{backgroundColor:r=>c(r,"shift-6",t),color:r=>c(r,"shift-11")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>T(r,t)}}}}function Ks(e={}){var i;let{color:t="neutral",multiple:n=!1}=e,o=b((i=e.value)!=null?i:n?[]:null),a={div:l=>{let u=o.get(l);return(Array.isArray(u)?u:[u]).map(s=>({input:null,type:"hidden",name:e.name,value:s==null?"":String(s)}))},ariaHidden:"true",hidden:!0};return{dataTone:"shift-0",role:"listbox",ariaLabel:"Options",ariaMultiselectable:n?"true":void 0,_context:{select:{value:o,multiple:n}},_onInit:l=>{l.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),l.children.insert(a)},style:{display:"flex",flexDirection:"column",paddingBlock:l=>h(y(l)*2),paddingInline:l=>h(y(l)*2),fontSize:l=>x(l,"inherit"),backgroundColor:l=>c(l,"inherit",t),color:l=>c(l,"text",t)}}}function qs(e={}){var a;let t=b((a=e.color)!=null?a:"neutral","color"),n={"0%":{backgroundPosition:"200% 0"},"100%":{backgroundPosition:"-200% 0"}},o=Ke(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-1",style:{fontSize:r=>x(r),color:r=>c(r,"text",t.get(r)),height:h(6),display:"block",borderRadius:h(1),backgroundColor:r=>c(r,"inherit",t.get(r)),backgroundImage:r=>`linear-gradient(90deg, ${c(r,"inherit",t.get(r))} 0%, ${c(r,"shift-2",t.get(r))} 50%, ${c(r,"inherit",t.get(r))} 100%)`,backgroundSize:"200% 100%",animation:`${o} 1.6s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function Us(e={}){var n;let t=b((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=>c(o,"shift-10",t.get(o))}}}var Lr={to:{transform:"rotate(360deg)"}},Pr=Ke(JSON.stringify(Lr));function Gs(e={}){var n;let t=b((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=>c(o),color:o=>c(o,"text",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:h(6),height:h(6),borderRadius:"50%",border:o=>`${h(.5)} solid ${c(o,"border-strong",t.get(o))}`,borderTopColor:o=>c(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${Pr} 0.7s linear infinite`,[`@keyframes ${Pr}`]:Lr}}}function Ys(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:a=90}=e;return{_onSchedule:(r,i)=>{K(i,{_context:{splitter:{direction:t,size:b(n),min:o,max:a,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function Xs(e){let t=e.parent;if(!t)return!0;for(let n of t.children.items)if(n instanceof J&&n.getMetadata("splitterPanel"))return n===e;return!0}function Js(){return{_metadata:{splitterPanel:!0},_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal"?"width":"height",a=i=>{n.style[o]=`${Xs(e)?i:100-i}%`};a(t.size.get()),n.style.flexShrink="0",n.style.overflow="auto";let r=t.size.addListener(a);e.addHook("Remove",()=>{var i;t.panelCount=Math.max(0,((i=t.panelCount)!=null?i:1)-1),r()})}}}function Zs(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize",n.setAttribute("aria-orientation",o?"vertical":"horizontal"),n.setAttribute("aria-valuemin",String(t.min)),n.setAttribute("aria-valuemax",String(t.max)),n.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let a=t.size.addListener(u=>{n.setAttribute("aria-valuenow",String(Math.round(u)))}),r=u=>{let d=u.shiftKey?10:1,s=null;o?u.key==="ArrowRight"?s=Math.min(t.size.get()+d,t.max):u.key==="ArrowLeft"&&(s=Math.max(t.size.get()-d,t.min)):u.key==="ArrowDown"?s=Math.min(t.size.get()+d,t.max):u.key==="ArrowUp"&&(s=Math.max(t.size.get()-d,t.min)),u.key==="Home"?s=t.min:u.key==="End"&&(s=t.max),s!==null&&(u.preventDefault(),t.size.set(s))},i=null,l=u=>{u.preventDefault();let d=n.parentElement,s=f=>{let p=d.getBoundingClientRect(),g=o?(f.clientX-p.left)/p.width*100:(f.clientY-p.top)/p.height*100;t.size.set(Math.min(Math.max(g,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",m),i=null};i=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",m),i=null},document.addEventListener("mousemove",s),document.addEventListener("mouseup",m)};n.addEventListener("keydown",r),n.addEventListener("mousedown",l),e.addHook("Remove",()=>{i==null||i(),a(),n.removeEventListener("keydown",r),n.removeEventListener("mousedown",l)})},dataTone:"shift-2",style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>c(e,"inherit"),color:e=>c(e,"text"),"&:hover":{backgroundColor:e=>c(e,"increase-1")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:e=>T(e,"primary")},"&::after":{content:'""',width:h(1),height:h(1),borderRadius:h(999),backgroundColor:e=>c(e,"shift-4")}}}}function Qs(e={}){let{gap:t=3,align:n,justify:o,density:a=!0}=e;return{style:L(L({display:"flex",flexDirection:"column",gap:a?r=>h(y(r)*t):()=>h(t)},n?{alignItems:n}:{}),o?{justifyContent:o}:{})}}function Mr(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function ec(e,t,n){return e==="vertical"?{"&:not(:last-child)::after":{content:'""',position:"absolute",left:h(3),top:h(6),bottom:`-${h(2)}`,width:"2px",height:"auto",right:"auto",backgroundColor:o=>c(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:last-child)::after":{backgroundColor:o=>c(o,"shift-9",n)}}:{"&:not(:first-child)::after":{content:'""',position:"absolute",top:h(3),right:`calc(50% + ${h(3)})`,left:`calc(-50% + ${h(3)})`,height:"2px",backgroundColor:o=>c(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:first-child)::after":{backgroundColor:o=>c(o,"shift-9",n)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:o=>c(o,"shift-9",n)}}}function Ir(e,t,n,o,a){let r=n==="vertical",i=ec(n,o,a);return e.map((l,u)=>{var s;return{li:[typeof l.label=="string"?{span:l.label}:l.label],_key:(s=l.key)!=null?s:u,dataStep:String(u+1),dataStatus:m=>{let f=t.get(m);return u<f?"done":u===f?"active":"pending"},ariaCurrent:m=>t.get(m)===u?"step":void 0,style:N(L({position:"relative",display:"flex",flexDirection:r?"row":"column",alignItems:r?"flex-start":"center",gap:h(1),flex:r?"none":"1",fontSize:m=>x(m,"decrease-1"),textAlign:r?"left":"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:h(6),height:h(6),borderRadius:h(999),fontSize:m=>x(m,"decrease-1"),fontWeight:"bold",flexShrink:"0",border:m=>`2px solid ${c(m,"border-strong",o)}`,backgroundColor:m=>c(m,"inherit"),color:m=>c(m,"muted"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"}},i),{"&[data-status=active]::before":{backgroundColor:m=>c(m,"shift-9",a),borderColor:m=>c(m,"shift-9",a),color:m=>c(m,"shift-0",a),boxShadow:m=>`0 0 0 3px ${c(m,"shift-3",a)}`},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:m=>c(m,"shift-9",a),borderColor:m=>c(m,"shift-9",a),color:m=>c(m,"shift-0",a)},"&[data-status=pending]":{color:m=>c(m,"muted")},"&[data-status=active]":{color:m=>c(m,"shift-11",a),fontWeight:"bold"},"&[data-status=done]":{color:m=>c(m,"text",o)}})}})}function tc(e={items:[]}){var i;let{items:t=[],direction:n="horizontal",color:o="neutral",accentColor:a="primary"}=e,r={items:t,direction:n,color:o,accentColor:a};return N(L({_doctorDisable:"inline-typography",_context:{steps:{current:b((i=e.current)!=null?i:0),direction:n,color:o,accentColor:a}},_onSchedule:(l,u)=>{let d=Mr(l,"stepsCurrent",e.current,0);u[l.tagName]=Ir(t,d,n,o,a)}},V("steps-items",l=>({update(u){let d=Mr(l,"stepsCurrent",e.current,0);l.children.update(Ir(u.items,d,u.direction,u.color,u.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",flexDirection:n==="vertical"?"column":"row",alignItems:n==="vertical"?"flex-start":"center",gap:h(2),listStyle:"none",margin:"0",padding:"0"}})}function oc(e={}){var n;let t=b((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:"bold",color:o=>c(o,"shift-11",t.get(o)),backgroundColor:o=>c(o)}}}function nc(e={}){var n;let t=b((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=>c(o,"text",t.get(o))}}}function rc(e={}){var n;let t=b((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=>c(o,"text",t.get(o))}}}function ic(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},_doctorDisable:"inline-typography",style:{fontSize:o=>x(o,"inherit"),color:o=>c(o,"text",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*1),color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*1),color:o=>c(o,"text",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${c(o,"shift-3",t.get(o))}`,fontSize:o=>x(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*1),color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${c(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>c(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>c(o,"hover")}}}}function Rr(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function $r(e,t,n,o,a){let r=e.nodeId,l={div:t.map((d,s)=>{var p;let m=(p=d.key)!=null?p:s;return{button:[typeof d.label=="string"?{span:d.label}:d.label],_key:m,type:"button",role:"tab",id:`tab${r}${m}`,ariaControls:`panel${r}${m}`,ariaSelected:g=>n.get(g)===m,tabIndex:g=>n.get(g)===m?0:-1,onClick:()=>n.set(m),onKeyDown:g=>{var w;let S=g.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(S))return;g.preventDefault();let E=t.map((O,D)=>{var I;return(I=O.key)!=null?I:D}),v=E.indexOf(m),C=v;S==="ArrowRight"?C=(v+1)%E.length:S==="ArrowLeft"?C=(v-1+E.length)%E.length:S==="Home"?C=0:S==="End"&&(C=E.length-1),n.set(E[C]);let _=g.target.closest("[role=tablist]");(w=_==null?void 0:_.querySelectorAll("[role=tab]")[C])==null||w.focus()},style:{cursor:"pointer",fontSize:g=>x(g,"inherit"),height:g=>h(6+y(g)*2),paddingInline:g=>h(y(g)*4),border:"none",outline:"none",color:g=>c(g,"shift-13"),backgroundColor:g=>c(g,"inherit"),boxShadow:g=>`inset 0 ${h(-.5)} 0 0 ${c(g,"shift-1",a)}`,transition:"box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-selected=true])":{color:g=>c(g,"shift-13"),boxShadow:g=>`inset 0 ${h(-.5)} 0 0 ${c(g,"shift-2",a)}`},"&[aria-selected=true]:not([disabled])":{color:g=>c(g,"shift-13",o),boxShadow:g=>`inset 0 ${h(-.5)} 0 0 ${c(g,"shift-8",o)}`},"&:focus-visible":{boxShadow:g=>T(g,o)},"&[aria-selected=true]:focus-visible":{boxShadow:g=>`${T(g,o)}, inset 0 ${h(-.5)} 0 0 ${c(g,"shift-6",o)}`}}}}),_key:"tablist",role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},u=t.map((d,s)=>{var f;let m=(f=d.key)!=null?f:s;return{div:[d.content],_key:m,role:"tabpanel",id:`panel${r}${m}`,ariaLabelledby:`tab${r}${m}`,hidden:p=>n.get(p)!==m,style:{paddingBlock:p=>h(y(p)*2),paddingInline:p=>h(y(p)*2)}}});return[l,...u]}function ac(e={items:[]}){let{items:t=[],accentColor:n="primary",color:o="neutral"}=e;return L({_onSchedule:(r,i)=>{var u,d;let l=Rr(r,"tabsActiveKey",e.activeKey,(d=(u=t[0])==null?void 0:u.key)!=null?d:0);i[r.tagName]=$r(r,t,l,n,o)}},V("tabs-items",r=>({update(i){var u,d;let l=Rr(r,"tabsActiveKey",e.activeKey,(d=(u=i.items[0])==null?void 0:u.key)!=null?d:0);r.children.update($r(r,i.items,l,i.accentColor,i.color),!!r.domElement,!0)}}),{items:t,accentColor:n,color:o}))}function lc(e={}){var a,r;let t=b((a=e.color)!=null?a:"neutral","color"),n=b((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return N(L({_onInsert:i=>{i.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')}},V("textarea-auto-resize",(i,l)=>{let u=i.domElement,d=l.autoResize,s=!1,m,f,p=()=>{!d||s||(s=!0,f==null||f.unobserve(u),u.style.overflow="hidden",u.style.height="auto",u.style.height=`${u.scrollHeight}px`,s=!1,d&&(f==null||f.observe(u)))},g=()=>{typeof IntersectionObserver!="undefined"&&(m||(m=new IntersectionObserver(E=>{E.some(v=>v.isIntersecting)&&p()})),m.observe(u)),typeof ResizeObserver!="undefined"&&(f||(f=new ResizeObserver(()=>{s||p()})),f.observe(u))},S=()=>{m==null||m.unobserve(u),f==null||f.unobserve(u)};return u.addEventListener("input",p),i.attributes.addListener("value",p),d&&(g(),p()),{resize:p,update(E){d=E.autoResize,i.attributes.addListener("value",p),d?(g(),p()):S()},destroy(){u.removeEventListener("input",p),m==null||m.disconnect(),f==null||f.disconnect()}}},{autoResize:o})),{_onUpdate:i=>{var l;(l=i.getBehavior("textarea-auto-resize"))==null||l.resize()},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:i=>h(y(i)*2),paddingBlock:i=>h(y(i)*1.5),border:"none",borderRadius:i=>h(y(i)*1.5),fontSize:i=>x(i,"inherit"),color:i=>c(i,"text",t.get(i)),outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",t.get(i))}`,backgroundColor:i=>c(i,"inherit",t.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>c(i,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",n.get(i))}`},"&:focus-visible":{boxShadow:i=>T(i,n.get(i))},"&:invalid":{outline:i=>`${h(.5)} solid ${c(i,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>c(i,"muted","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`,backgroundColor:i=>c(i,"shift-2","neutral")}}})}function sc(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function cc(e={}){var r,i,l;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(i=e.accentColor)!=null?i:"primary",a=b((l=e.active)!=null?l:!1);return{style:L({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>h(y(u)*2),paddingBottom:u=>t?"0":h(y(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:h(1),transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>c(u,"shift-8",a.get(u)?o:n),opacity:u=>a.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>h(y(u)*-4),width:"2px",backgroundColor:u=>c(u,"shift-3",n)}})}}function Xo(e){let t=e.getMetadata("toastOpen");return t||(t=b(!1),e.setMetadata("toastOpen",t)),t}var zr=e=>{let t=e==null?void 0:e.elementNode;return t?Xo(t).get(e):!1};function uc(e={}){let{position:t="top-center",color:n="neutral"}=e,o=t.startsWith("top"),a=t.endsWith("center"),r=t.endsWith("right"),i={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:o?"column":"column-reverse",alignItems:a?"center":r?"end":"start",inset:0,gap:h(4),zIndex:30,padding:h(6),pointerEvents:"none"}};return{_portal:l=>{let u=l.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=l.children.insert(i).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:h(32),pointerEvents:"auto",paddingBlock:l=>h(y(l)*2),paddingInline:l=>h(y(l)*4),borderRadius:l=>h(y(l)*2),fontSize:l=>x(l,"inherit"),color:l=>c(l,"text",n),backgroundColor:l=>c(l,"inherit",n),boxShadow:W("medium"),opacity:l=>Number(zr(l)),transform:l=>zr(l)?"translateY(0)":o?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:l=>requestAnimationFrame(()=>Xo(l).set(!0)),_onBeforeRemove:(l,u)=>{var v,C;let d=!1,s=null,m=!1,f=l.getRoot(),p=(C=(v=l.domElement)==null?void 0:v.parentElement)!=null?C:null,g=()=>{var w;if(m||!p||p.id!==`domphy-toast-${t}`||p.childElementCount>0)return;m=!0;let _=(w=f.children)==null?void 0:w.items.find(O=>O.domElement===p);_?f.children.remove(_):p.remove()},S=()=>{d||(d=!0,s&&(clearTimeout(s),s=null),l.domElement.removeEventListener("transitionend",E),u(),g())},E=_=>{_.propertyName==="transform"&&S()};l.domElement.addEventListener("transitionend",E),s=setTimeout(S,350),l.addHook("Remove",()=>{var _;s&&(clearTimeout(s),s=null),(_=l.domElement)==null||_.removeEventListener("transitionend",E),g()}),Xo(l).set(!1)}}}function Nr(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function mc(e,t){return Array.isArray(e)?e.includes(t):e===t}function dc(e,t,n,o,a){var s;let r=e.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(r))return;e.preventDefault();let i=t.map((m,f)=>{var p;return(p=m.key)!=null?p:String(f)}),l=i.indexOf(n),u=l;r==="ArrowRight"?u=(l+1)%i.length:r==="ArrowLeft"?u=(l-1+i.length)%i.length:r==="Home"?u=0:r==="End"&&(u=i.length-1),a||o.set(i[u]);let d=e.target.closest("[role=group]");(s=d==null?void 0:d.querySelectorAll("button")[u])==null||s.focus()}function Ar(e,t,n,o,a){return e.map((r,i)=>{var d;let l=(d=r.key)!=null?d:String(i);return{button:[typeof r.label=="string"?{span:r.label}:r.label],_key:l,type:"button",role:"button",ariaPressed:s=>mc(t.get(s),l),tabIndex:s=>{var f,p,g,S,E;let m=t.get(s);if(n){let C=(g=(p=(Array.isArray(m)?m:[])[0])!=null?p:(f=e[0])==null?void 0:f.key)!=null?g:"0";return l===C?0:-1}return m===l||m===""&&l===((E=(S=e[0])==null?void 0:S.key)!=null?E:"0")?0:-1},onClick:()=>{let s=t.get();if(n){let m=Array.isArray(s)?[...s]:[];t.set(m.includes(l)?m.filter(f=>f!==l):[...m,l])}else t.set(s===l?"":l)},onKeyDown:s=>dc(s,e,l,t,n),style:{cursor:"pointer",fontSize:s=>x(s,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(2),border:"none",borderRadius:h(1.5),color:s=>c(s,"shift-13",o),backgroundColor:s=>c(s,"inherit",o),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-pressed=true])":{color:s=>c(s,"shift-13",o),backgroundColor:s=>c(s,"hover",o)},"&:active:not([disabled])":{backgroundColor:s=>c(s,"increase-2",o)},"&[aria-pressed=true]":{backgroundColor:s=>c(s,"shift-3",a),color:s=>c(s,"shift-13",a)},"&:focus-visible":{boxShadow:s=>T(s,a)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function hc(e={items:[]}){var i;let{items:t=[],multiple:n=!1,color:o="neutral",accentColor:a="primary"}=e,r={items:t,multiple:n,color:o,accentColor:a};return N(L({role:"group",_context:{toggleGroup:{value:b((i=e.value)!=null?i:n?[]:""),multiple:n}},_onSchedule:(l,u)=>{let d=Nr(l,"toggleGroupValue",e.value,n?[]:"");u[l.tagName]=Ar(t,d,n,o,a)}},V("toggle-items",l=>({update(u){let d=Nr(l,"toggleGroupValue",e.value,u.multiple?[]:"");l.children.update(Ar(u.items,d,u.multiple,u.color,u.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",paddingBlock:h(1),paddingInline:h(1),gap:h(1),borderRadius:h(2),fontSize:l=>x(l,"inherit"),backgroundColor:l=>c(l,"inherit",o),color:l=>c(l,"text",o),outline:l=>`1px solid ${c(l,"border",o)}`,outlineOffset:"-1px"}})}function fc(e={}){return Yo(e)}function pc(){return{div:null,style:{flex:"1 1 0"}}}function gc(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content"}=e,a=b(n),r=b(o),i={span:f=>r.get(f)},{show:l,hide:u,anchorPartial:d}=Se({kind:"tooltip",open:t,onDismiss:e.onDismiss,placement:a,content:i}),s={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:f=>h(y(f)*1),paddingInline:f=>h(y(f)*3),borderRadius:f=>h(y(f)*1.5),color:f=>c(f,"text"),backgroundColor:f=>c(f),fontSize:f=>x(f,"inherit"),boxShadow:W("low")},$:[Uo({placement:a,bordered:!1})]};return i.$||(i.$=[]),i.$.push(s),K(d,{ariaDescribedby:f=>f!=null&&f.elementNode?de("tooltip",f.elementNode):void 0,onMouseEnter:(f,p)=>l(p),onMouseLeave:(f,p)=>u(p),onFocus:(f,p)=>l(p),onBlur:(f,p)=>u(p),onKeyDown:(f,p)=>f.key==="Escape"&&u(p)}),d}function Br(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function yc(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,a=new Map,r=new Set,i=new Set;return{_onMount:l=>{l.addHook("Remove",()=>{for(let u of Array.from(a.values()))u();a.clear();for(let u of r)clearTimeout(u);r.clear();for(let u of i)cancelAnimationFrame(u);i.clear()})},_onBeforeUpdate:l=>{o=new Map,l.children.items.forEach((u,d)=>{if(!(u instanceof J))return;let s=u.domElement;s&&o.set(Br(u,d),s.getBoundingClientRect())})},_onUpdate:l=>{l.children.items.forEach((u,d)=>{var O;if(!(u instanceof J))return;let s=u.domElement;if(!s)return;let m=Br(u,d),f=o.get(m);if(!f)return;let p=s.getBoundingClientRect(),g=f.left-p.left,S=f.top-p.top;if(Math.abs(g)<.5&&Math.abs(S)<.5)return;(O=a.get(s))==null||O(),s.style.transition="none",s.style.transform=`translate(${g}px, ${S}px)`,s.getBoundingClientRect();let E=requestAnimationFrame(()=>{i.delete(E),s.style.transition=`transform ${t}ms ease ${n}ms`,s.style.transform="translate(0px, 0px)"});i.add(E);let v=!1,C=null,_=()=>{v||(v=!0,C&&(r.delete(C),C=null),a.delete(s),s.removeEventListener("transitionend",w),s.style.transition="",s.style.transform="")},w=D=>{D.propertyName==="transform"&&_()};a.set(s,()=>{v=!0,C&&(clearTimeout(C),r.delete(C),C=null),a.delete(s),s.removeEventListener("transitionend",w)}),s.addEventListener("transitionend",w),C=setTimeout(_,t+n+34),r.add(C)}),o.clear()}}}function bc(e={}){var n;let t=b((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=>c(o),color:o=>c(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:h(3),listStyleType:"disc",listStylePosition:"outside"}}}function vc(){return{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}}return ti(Sc);})();
|
|
5
|
+
${r}}`}function Re(e){if(!Ye[e])throw Error(`Theme "${e}" not found`);return Ye[e]}function $i(e,t){Ge(e,"theme name"),Ii(t),Ye[e]||(Ye[e]=Co(ft)),$n(Ye[e],t),It=null,vo.clear()}function zi(e){let t=Co(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 _o(e){let t=vo.get(e);if(t)return t;let n=Re(e),o=To(n),a={};for(let r in n){let i=n[r];if(r==="colors")for(let l in n.colors){let u={};[...Array(o).keys()].forEach(d=>u[d]=n.colors[l][d]),a[l]=u}else if(r==="fontSizes")a.fontSizes=n.fontSizes;else if(r==="densities")a.densities=n.densities;else if(r==="custom"&&(a.custom={},i&&typeof i=="object"))for(let l in i)a.custom[l]=i[l]}return vo.set(e,a),a}function Rt(){if(It)return It;let e=Re("light"),t=To(e),n={};for(let o in e){let a=e[o];if(o==="colors")for(let r in e.colors){let i=dt(r),l={};[...Array(t).keys()].forEach(u=>l[u]=`var(--${i}-${u})`),n[r]=l}else if(o==="fontSizes")n.fontSizes=[...Array(Ue).keys()].map(r=>`var(--fontSize-${r})`);else if(o==="custom"&&(n.custom={},a&&typeof a=="object"))for(let r in a)n.custom[r]=`var(--custom-${dt(r)})`}return It=n,n}function So(){return Object.entries(Ye).map(([e,t])=>Ri(e,t)).join(`
|
|
6
|
+
`)}function Ni(e){var t;if(typeof document!="undefined")if(e){e.textContent=So();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=So(),document.head.appendChild(e)}function h(e){return`calc(${e/4}em)`}var bo=16;function Ai(e,t,n=320,o=1280){let a=e/4,r=t/4,i=a*bo,l=(r*bo-i)/(o-n)*100,u=(i-l*n/100)/bo,d=parseFloat(l.toFixed(4)),s=parseFloat(u.toFixed(4)),m=s===0?`${d}vw`:`${s}em + ${d}vw`;return`clamp(${a}em, ${m}, ${r}em)`}function Bi(e,t={}){if(typeof document=="undefined")throw new Error('applySystemTheme() requires a browser DOM \u2014 "document" is not defined. For SSR, call it only on the client (e.g. inside an _onMount lifecycle hook, or behind a typeof window !== "undefined" guard).');let n=e!=null?e:document.documentElement,{persist:o=!0,storageKey:a="dp-theme"}=t,r=()=>{if(o){let u=localStorage.getItem(a);if(u==="light"||u==="dark")return u}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};n.setAttribute("data-theme",r());let i=window.matchMedia("(prefers-color-scheme: dark)"),l=u=>{(!o||!localStorage.getItem(a))&&n.setAttribute("data-theme",u.matches?"dark":"light")};return i.addEventListener("change",l),()=>i.removeEventListener("change",l)}function Nt(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 Vi=["neutral","primary","secondary","info","success","warning","attention","error","danger","highlight"],xo=["inherit"];[...Array(5).keys()].forEach(e=>{xo.push(`decrease-${e}`),xo.push(`increase-${e}`)});function Hi(e,t="inherit"){if(!xo.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 ji(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=Hi(n,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),n}function y(e){let t=ji(e);return Re(e?Nt(e):"light").densities[t]}var Fi=e=>{let t=n=>{let o=Math.max(0,Math.min(1,n)),a=o<=.0031308?12.92*o:1.055*j(o,1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(a*255)))};return e.map(t)},Wi=e=>{let t=n=>n>.04045?j((n+.055)/1.055,2.4):n/12.92;return e.map(t)},we=e=>{let[t,n,o]=Fi(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}`},zn=e=>typeof e=="string"&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e),Do=e=>{if(!zn(e))throw new Error(`Invalid hex color "${e}": expected "#rgb", "#rgba", "#rrggbb", or "#rrggbbaa" (hex digits 0-9, a-f, case-insensitive).`);let t=e.slice(1).toLowerCase();return t.length<=4&&(t=t.split("").map(n=>n+n).join("")),`#${t}`},me=e=>{let t=Do(e),n=parseInt(t.slice(1,3),16)/255,o=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255;return Wi([n,o,a])},pt=e=>{let t=.4122214708*e[0]+.5363325363*e[1]+.0514459929*e[2],n=.2119034982*e[0]+.6806995451*e[1]+.1073969566*e[2],o=.0883024619*e[0]+.2817188376*e[1]+.6299787005*e[2],a=Math.cbrt(t),r=Math.cbrt(n),i=Math.cbrt(o);return[.2104542553*a+.793617785*r-.0040720468*i,1.9779984951*a-2.428592205*r+.4505937099*i,.0259040371*a+.7827717662*r-.808675766*i]},At=e=>{let[t,n,o]=e,a=t+.3963377774*n+.2158037573*o,r=t-.1055613458*n-.0638541728*o,i=t-.0894841775*n-1.291485548*o,l=a*a*a,u=r*r*r,d=i*i*i;return[4.0767416621*l-3.3077115913*u+.2309699292*d,-1.2684380046*l+2.6097574011*u-.3413193965*d,-.0041960863*l-.7034186147*u+1.707614701*d]},Nn=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,u=.1307,d=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,m=0;return(r<=90||r>=270)&&(m=u*Math.abs(Math.cos(r*(Math.PI/180)))+d),t+(s+m)*a},Ki=(e,t)=>{let[,n,o]=t,a=Math.sqrt(n*n+o*o),r=(Math.atan2(o,n)*180/Math.PI+360)%360,i=.1644,l=.0603,u=.1307,d=.006,s=i*Math.abs(Math.sin((r-90)/2*(Math.PI/180)))+l,m=0;return(r<=90||r>=270)&&(m=u*Math.abs(Math.cos(r*(Math.PI/180)))+d),Math.max(0,e-(s+m)*a)},qi=e=>{let[t,n,o]=e,a=o*Math.PI/180;return[t,n*Math.cos(a),n*Math.sin(a)]},Xe=e=>{let[t,n,o]=e,a=.4124564*t+.3575761*n+.1804375*o,r=.2126729*t+.7151522*n+.072175*o,i=.0193339*t+.119192*n+.9503041*o,l=.95047,u=1,d=1.08883,s=g=>g>.008856?Math.cbrt(g):7.787*g+16/116,m=s(a/l),f=s(r/u),p=s(i/d);return[116*f-16,500*(m-f),200*(f-p)]},An=e=>{let[t,n,o]=e,a=(t+16)/116,r=n/500+a,i=a-o/200,l=g=>j(g,3)>.008856?j(g,3):(g-16/116)/7.787,u=.95047,d=1,s=1.08883,m=l(r)*u,f=l(a)*d,p=l(i)*s;return[3.2404542*m-1.5371385*f-.4985314*p,-.969266*m+1.8760108*f+.041556*p,.0556434*m-.2040259*f+1.0572252*p]},Bn=e=>{let[t,n,o]=e,a=Math.sqrt(n*n+o*o);if(a<1e-4)return[t,0,0];let r=(Math.atan2(o,n)*180/Math.PI+360)%360;return r>=359.9999&&(r=0),[t,a,r]},Oo=(e,t)=>{let[n,o,a]=e,[r,i,l]=t,u=Math.hypot(o,a),d=Math.hypot(i,l),s=(u+d)/2,m=.5*(1-Math.sqrt(j(s,7)/(j(s,7)+j(25,7)))),f=o*(1+m),p=i*(1+m),g=Math.hypot(f,a),S=Math.hypot(p,l),E=(g+S)/2,v=(Q,R)=>{if(Q===0&&R===0)return 0;let U=Math.atan2(R,Q)*180/Math.PI;return U>=0?U:U+360},k=v(f,a),T=v(p,l),w=T-k,O=Math.abs(w),D=k+T,I=g*S===0,F;I?F=0:O<=180?F=w:w>180?F=w-360:F=w+360;let A;I?A=D:O<=180?A=D/2:D<360?A=(D+360)/2:A=(D-360)/2;let B=1-.17*Math.cos((A-30)*Math.PI/180)+.24*Math.cos(2*A*Math.PI/180)+.32*Math.cos((3*A+6)*Math.PI/180)-.2*Math.cos((4*A-63)*Math.PI/180),ie=r-n,q=S-g,Z=2*Math.sqrt(g*S)*Math.sin(F/2*Math.PI/180),te=(n+r)/2,Y=1+.015*j(te-50,2)/Math.sqrt(20+j(te-50,2)),oe=1+.045*E,ae=1+.015*E*B,ne=30*Math.exp(-j((A-275)/25,2)),ee=-(2*Math.sqrt(j(E,7)/(j(E,7)+j(25,7))))*Math.sin(2*ne*Math.PI/180);return Math.sqrt(j(ie/Y,2)+j(q/oe,2)+j(Z/ae,2)+ee*(q/oe)*(Z/ae))},Ui=e=>{let t=()=>new Error(`Invalid CSS rgb() "${e}": expected "rgb(r, g, b)" with channels 0-255 or 0%-100% (comma or space separated, optional alpha after "," or "/").`),n=/^\s*rgba?\(\s*(.+?)\s*\)\s*$/i.exec(e);if(!n)throw t();let o=n[1].split("/")[0],a=o.includes(",")?o.split(",").map(l=>l.trim()).slice(0,3):o.trim().split(/\s+/);if(a.length!==3)throw t();let r=a.map(l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l));if(r.some(l=>!Number.isFinite(l)))throw t();let i=l=>{let u=l/255;return u<=.04045?u/12.92:j((u+.055)/1.055,2.4)};return r.map(i)},$t=e=>{if(e.length<1)return d=>0;let t=[...e].sort((d,s)=>d[0]-s[0]),n=[];for(let d=0;d<t.length;d++)(d===0||t[d][0]!==t[d-1][0])&&n.push(t[d]);let o=n.length;if(o===1)return d=>n[0][1];let a=n.map(d=>d[0]),r=n.map(d=>d[1]),i=[],l=[];for(let d=0;d<o-1;d++)i[d]=a[d+1]-a[d],l[d]=(r[d+1]-r[d])/i[d];let u=new Array(o);u[0]=l[0],u[o-1]=l[o-2];for(let d=1;d<o-1;d++){let s=l[d-1],m=l[d];if(s*m<=0)u[d]=0;else{let f=(1+i[d]/(i[d-1]+i[d]))/3;u[d]=s*m/((1-f)*s+f*m)}}return d=>{if(d<=a[0])return r[0];if(d>=a[o-1])return r[o-1];let s=0,m=o-2,f=0;for(;s<=m;){let T=Math.floor((s+m)/2);if(d>=a[T]&&d<=a[T+1]){f=T;break}d<a[T]?m=T-1:s=T+1}let p=i[f],g=(d-a[f])/p,S=g*g,E=S*g,v=u[f]*p,k=u[f+1]*p;return(2*E-3*S+1)*r[f]+(E-2*S+g)*v+(-2*E+3*S)*r[f+1]+(E-S)*k}};function qe(e){let t=e.length;if(t===0)return 0;let n=0;for(let o=0;o<t;o++)n+=e[o]*e[o];return Math.sqrt(n/t)}var Gi=e=>{let t=e.length;if(t===0)return{min:0,max:0,avg:0};let n=e[0],o=e[0],a=0;for(let r=0;r<t;r++){let i=e[r];i<n&&(n=i),i>o&&(o=i),a+=i}return{min:n,max:o,avg:a/t}},Po=e=>{let t=e.length;if(t===0)return 0;let n=1e-6,o=e.reduce((i,l)=>i*(l+n),1),a=j(o,1/t),r=Math.max(0,Math.min(1,a));return parseFloat((r*100).toFixed(2))},Yi=(e,t)=>{let[n,o,a]=me(e),[r,i,l]=me(t),u=.2126*n+.7152*o+.0722*a,d=.2126*r+.7152*i+.0722*l,s=Math.max(u,d),m=Math.min(u,d);return(s+.05)/(m+.05)},Xi=(e,t,n=.5,o="oklab")=>{let a=Math.max(0,Math.min(1,n)),r=me(e),i=me(t);if(o==="rgb")return we(r.map((d,s)=>d+a*(i[s]-d)));if(o==="lab"){let d=Xe(r),s=Xe(i);return we(An(d.map((m,f)=>m+a*(s[f]-m))))}let l=pt(r),u=pt(i);return we(At(l.map((d,s)=>d+a*(u[s]-d))))},Ji=(e,t)=>{if(e.length<2)throw new Error("scale() requires at least 2 colors");if(t<1)return[];if(t===1)return[we(me(e[0]))];let n=e.map(r=>pt(me(r))),o=n.length-1,a=[];for(let r=0;r<t;r++){let i=r/(t-1)*o,l=Math.min(Math.floor(i),o-1),u=i-l,d=n[l],s=n[l+1];a.push(we(At(d.map((m,f)=>m+u*(s[f]-m)))))}return a},Vn=.605,wo=.685;function Zi(e){let t=j(e,Vn);return t/(1+wo*(1-t))}function Qi(e){let t=e*(1+wo)/(1+e*wo);return j(t,1/Vn)}function ea(e,t){return Math.sqrt(j(e[0]-t[0],2)+j(e[1]-t[1],2)+j(e[2]-t[2],2))}function ta(e){let t=[[0,0,0],...e,[1,1,1]].map(s=>pt(s)),n=t.map(s=>s[0]),o=t.map(s=>s[1]),a=t.map(s=>s[2]),r=[0],i=0;for(let s=1;s<t.length;s++)i+=ea(t[s],t[s-1]),r.push(i);let l=r.map(s=>Qi(i>0?s/i:0)),u=$t(l.map((s,m)=>[s,o[m]])),d=$t(l.map((s,m)=>[s,a[m]]));return{colorAtParam:s=>{let m=Zi(s),f=0;for(let T=0;T<l.length-1;T++)if(m<=l[T+1]){f=T;break}let p=l[f],g=l[f+1],S=(m-p)/(g-p||1),E=n[f]+S*(n[f+1]-n[f]),v=u(m),k=d(m);return At([E,v,k])},parameters:l.slice(1,-1)}}function Hn(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[we(me(n[0]))];let o=n.map(s=>we(me(s))).reverse(),{colorAtParam:a,parameters:r}=ta([...n.map(me)].reverse()),i=[],l=[0,...r,1],u=l.map(s=>Math.round(s*(t-1))),d=0;for(let s=0;s<t;s++){for(;d<u.length-2&&s>u[d+1];)d++;let m=u[d],f=u[d+1],p=l[d],g=l[d+1],S;if(f<=m)S=p;else{let E=(s-m)/(f-m);S=p+E*(g-p)}i.push(we(a(S)))}if(o.length>1)for(let s=0;s<o.length;s++){let m=u[s+1];m>=0&&m<i.length&&(i[m]=o[s])}return i.reverse()}var Eo=class{constructor(e){this.hex=e}get rgb(){return me(this.hex)}get lab(){return Xe(this.rgb)}get lch(){return Bn(this.lab)}get lightness(){return Nn(this.lab)}get chroma(){return this.lch[1]}get hue(){return this.lch[2]}get luminance(){let[e,t,n]=this.rgb;return .2126*e+.7152*t+.0722*n}},jn=class{constructor(e=[],t="brand"){this.swatches=e.map(n=>new Eo(n)),this.name=t}get colors(){return this.swatches.map(e=>e.hex)}get peakChroma(){let e=this.colors.slice(2,-2),t="",n=-1/0;for(let o of e){let a=new Eo(o);a.chroma>n&&(n=a.chroma,t=o)}return n<6?this.colors[Math.ceil(this.steps/2)]:t}get steps(){return this.colors.length}get baseColor(){return this.colors.length===0?"":this.peakChroma||this.colors[Math.floor(this.colors.length/2)]}get baseIndex(){return this.colors.length===0?-1:this.colors.findIndex(e=>e.toLowerCase()===this.baseColor.toLowerCase())}get wcag(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let a of[30,45,70])o[a]={efficiency:1,target:a/10,span:0,value:0};return o}for(let a of[30,45,70]){let r=a/10,i=n,l=0;for(let u=1;u<t;u++){let d=1/0;for(let s=0;s<t-u;s++){let m=e[s].luminance,f=e[s+u].luminance,p=(Math.max(m,f)+.05)/(Math.min(m,f)+.05);p<d&&(d=p)}if(d>=r){i=u,l=d;break}u===n&&(l=d)}o[a]={efficiency:i/n,target:r,span:i,value:l}}return o}get apca(){let e=this.swatches,t=e.length,n=t-1,o={};if(t<=1){for(let r of[45,60,75])o[r]={efficiency:1,target:r,span:0,value:0};return o}let a=(r,i)=>{let l=Math.SQRT2,u=r<.022?r+j(.022-r,l):r,d=i<.022?i+j(.022-i,l):i,s=d>=u?(j(d,.56)-j(u,.57))*114:(j(d,.65)-j(u,.62))*114;return Math.abs(s)<10?0:(s=s>0?s-2.7:s+2.7,Math.round(s))};for(let r of[45,60,75]){let i=r,l=n,u=0;for(let d=1;d<t;d++){let s=1/0;for(let m=0;m<t-d;m++){let f=e[m].luminance>e[m+d].luminance?e[m].luminance:e[m+d].luminance,p=e[m].luminance>e[m+d].luminance?e[m+d].luminance:e[m].luminance,g=Math.abs(a(p,f));g<s&&(s=g)}if(s>=i){l=d,u=s;break}d===n&&(u=s)}o[r]={efficiency:l/n,target:i,span:l,value:u}}return o}get deltaECurve(){let e=[0];for(let t=1;t<this.swatches.length;t++){let n=Oo(this.swatches[t-1].lab,this.swatches[t].lab);e.push(e[t-1]+n)}return e}get unwrapHues(){let e=this.swatches.map(n=>n.hue).slice(1,-1);if(e.length===0)return[];let t=[e[0]];for(let n=1;n<e.length;n++){let o=e[n]-e[n-1];o>180?o-=360:o<-180&&(o+=360),t.push(t[n-1]+o)}return t}get lightnessLinearity(){let e=this.swatches.map(m=>m.lightness),t=e.length;if(t<2)return 1;let n=0,o=0,a=0,r=0;for(let m=0;m<t;m++)n+=m,o+=e[m],a+=m*e[m],r+=m*m;let i=t*r-n*n;if(Math.abs(i)<1e-10)return 1;let l=(t*a-n*o)/i,u=(o-l*n)/t;if(Math.abs(l*(t-1))<.001)return 1;let d=0,s=0;for(let m=0;m<t;m++){let f=l*m+u,p=e[m]-f;d+=p*p;let g=Math.max(f-Math.min(u,l*(t-1)+u),Math.max(u,l*(t-1)+u)-f);s+=g*g}return Math.max(0,Math.min(1,1-Math.sqrt(d/t)/Math.sqrt(s/t)))}get chromaSmoothness(){let e=this.swatches.map(m=>m.chroma),t=e.length;if(t<3)return 1;let n=133.8,o=Math.max(...e);if(o<=.01)return 1;let a=e.map(m=>m/o*n),r=Math.min(...a),i=Math.max(...a),l=a.indexOf(i),u=$t([[0,a[0]],[l,i],[t-1,a[t-1]]]),d=0,s=0;for(let m=0;m<t;m++){let f=u(m),p=a[m]-f;d+=p*p,s+=j(Math.max(f-r,i-f),2)}return Math.max(0,Math.min(1,1-Math.sqrt(d/t)/Math.sqrt(s/t)))}get spacingUniformity(){let e=this.deltaECurve,t=e.length;if(t<2)return 1;let n=[];for(let i=1;i<t;i++){let l=e[i]-e[i-1];if(l<0)return 0;n.push(l)}let o=n.reduce((i,l)=>i+l,0)/n.length;if(o<=1e-6)return 0;let a=0;for(let i of n)a+=j(i-o,2);let r=Math.sqrt(a/n.length)/o;return Math.max(0,Math.min(1,1/(1+r)))}get hueStability(){var e,t,n;let o=this.unwrapHues,a=o.length;if(a<2)return 1;let r=(n=(t=o[this.baseIndex-1])!=null?t:(e=this.swatches[this.baseIndex])==null?void 0:e.hue)!=null?n:0,i=0,l=0;for(let u=0;u<a;u++){let d=Math.abs(o[u]-r)%360;d>180&&(d=360-d),i+=d*d;let s=u/(a-1)*180;l+=s*s}return Math.max(0,Math.min(1,1-Math.sqrt(i/a)/(Math.sqrt(l/a)||1)))}get contrastEfficiency(){let e=this.wcag[45].span,t=this.steps;if(t<=1)return 1;let n=.501,o=e/(t-1);return o<=n?1:o>=1?0:1-(o-n)/(1-n)}get metrics(){return{lightnessLinearity:this.lightnessLinearity,chromaSmoothness:this.chromaSmoothness,spacingUniformity:this.spacingUniformity,hueStability:this.hueStability,contrastEfficiency:this.contrastEfficiency}}get score(){return Po(Object.values(this.metrics))}},oa=class{constructor(e={},t="Collection 1"){this.ramps=Object.entries(e).map(([n,o])=>new jn(o,n)),this.name=t}get colors(){return Object.fromEntries(this.ramps.map(e=>[e.name,e.colors]))}get steps(){var e;return((e=this.ramps[0])==null?void 0:e.steps)||0}get wcag(){let e={},t=this.steps;for(let n of[30,45,70]){let o=this.ramps.map(i=>i.wcag[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n/10,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get apca(){let e={},t=this.steps;for(let n of[45,60,75]){let o=this.ramps.map(i=>i.apca[n]),a=Math.max(0,...o.map(i=>(i==null?void 0:i.span)||0)),r=o.reduce((i,l)=>i+((l==null?void 0:l.value)||0),0);e[n]={target:n,span:a,value:r/(this.ramps.length||1),efficiency:t>1?a/(t-1):0}}return e}get contrastEfficiency(){return qe(this.ramps.map(e=>e.contrastEfficiency))}get lightnessLinearity(){return qe(this.ramps.map(e=>e.lightnessLinearity))}get chromaSmoothness(){return qe(this.ramps.map(e=>e.chromaSmoothness))}get hueStability(){return qe(this.ramps.map(e=>e.hueStability))}get spacingUniformity(){return qe(this.ramps.map(e=>e.spacingUniformity))}get score(){return Po([this.contrastEfficiency,this.lightnessLinearity,this.chromaSmoothness,this.hueStability,this.spacingUniformity])}},na=["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],ra=[.75,1,1.5,2,2.5];function ia(e,t){let n=Xe(me(t)),o=0,a=1/0;for(let r=0;r<e.length;r++){let i=Oo(n,Xe(me(e[r])));i<a&&(a=i,o=r)}return o}function aa(e,t={}){var n,o,a,r,i;if(t.steps!==void 0&&t.steps!==G)throw new Error(`generateTheme() steps must be ${G} (the tone model is fixed at shift-0\u2026shift-${G-1}), got ${t.steps}`);let l=G,u={},d={};for(let[s,m]of Object.entries(e)){let f;try{f=Do(m)}catch(g){throw new Error(`baseColors.${s}: ${g instanceof Error?g.message:String(g)}`)}let p=Hn(f,l);u[s]=p,d[s]=ia(p,f)}return{direction:(n=t.direction)!=null?n:"darken",colors:u,baseTones:d,fontSizes:(o=t.fontSizes)!=null?o:na,densities:(a=t.densities)!=null?a:ra,darkBias:(r=t.darkBias)!=null?r:1,custom:(i=t.custom)!=null?i:{}}}var ko=["inherit"];[...Array(8).keys()].forEach(e=>{ko.push(`decrease-${e}`),ko.push(`increase-${e}`)});function Fn(e,t="inherit"){if(!ko.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 la(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=Fn(n,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),n}function x(e,t="inherit"){let n=Fn(la(e),t);return Rt().fontSizes[n]}var zt={surface:"shift-1",hover:"shift-2",border:"shift-3","border-strong":"shift-4",muted:"shift-8",text:"shift-9"},ht=["inherit","base",...Object.keys(zt)];[...Array(G).keys()].forEach(e=>{ht.push(`decrease-${e}`),ht.push(`increase-${e}`),ht.push(`shift-${e}`)});function Rn(e,t){if(e<0||e>G-1)return e;let n=e+t;return n=Math.max(0,Math.min(G-1,n)),n}function sa(e,t){if(e<0||e>G-1)return e;let n=Math.floor((G-1)/2),o=e<=n?e+t:e-t;return o=Math.max(0,Math.min(G-1,o)),o}function Je(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!ht.includes(t))throw Error(`tone name "${t}" invalid`);if(t in zt&&(t=zt[t]),t.startsWith("increase-")){let n=parseInt(t.replace("increase-",""),10);return Rn(e,n)}else if(t.startsWith("decrease-")){let n=parseInt(t.replace("decrease-",""),10);return Rn(e,-n)}else if(t.startsWith("shift-")){let n=parseInt(t.replace("shift-",""),10);return sa(e,n)}else return e}function Wn(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=Je(n,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),n}function Kn(e,t,n){return n<=0?e:t==="lighten"&&e===0?n:t==="darken"&&e===G-1?G-1-n:e}function gt(e,t){let n=Re(e).baseTones[t];if(n===void 0)throw new Error(`baseTones.${t} is not defined on theme "${e}" \u2014 set a base tone index (0\u2013${G-1}) via setTheme("${e}", { baseTones: { ${t}: <index> } }) so themeColor(..., "base", "${t}") can resolve`);return n}function c(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n;if(!e){let l=Rt()[o];if(!l)throw Error(`color "${o}" not found on theme "light"`);return t==="base"?l[gt("light",o)]:l[Je(0,t)]}let a=Nt(e),r=Rt()[o];if(!r)throw Error(a==="light"?`color "${o}" not found on theme "light"`:`color "${o}" not found on the "light" theme (required by node theme "${a}") \u2014 themeColor() var references are keyed on the "light" theme structure; register the role on "light" as well (e.g. setTheme("light", { colors: { ${o}: \u2026 } })) so the shared CSS-var baseline includes it`);let i;if(t==="base")i=gt(a,o);else{let l=Re(a),u=Kn(Wn(e),l.direction,l.darkBias);i=Je(u,t)}return r[i]}function Lo(e,t="inherit",n="inherit"){let o=n==="inherit"?"neutral":n,a=e?Nt(e):"light",r=_o(a)[o];if(!r)throw Error(`color "${o}" not found on theme "${a}"`);if(!e)return t==="base"?r[gt("light",o)]:r[Je(0,t)];let i;if(t==="base")i=gt(a,o);else{let l=Re(a),u=Kn(Wn(e),l.direction,l.darkBias);i=Je(u,t)}return r[i]}function ca(e={}){let{theme:t="light",tone:n="inherit",color:o="inherit"}=e,a=o==="inherit"?"neutral":o,r=_o(t)[a];if(!r)throw Error(`color "${a}" not found on theme "${t}"`);return n==="base"?r[gt(t,a)]:r[Je(0,n)]}var eo={};kt(eo,{abbreviation:()=>ua,accordion:()=>ma,alert:()=>da,avatar:()=>ha,badge:()=>fa,blockquote:()=>pa,breadcrumb:()=>ga,breadcrumbEllipsis:()=>ya,button:()=>Sa,buttonGhost:()=>Mo,buttonSwitch:()=>xa,card:()=>Ea,code:()=>ka,combobox:()=>vl,command:()=>Sl,commandItem:()=>wl,commandSearch:()=>xl,datePicker:()=>Cl,descriptionList:()=>Dl,details:()=>Ol,dialog:()=>Ll,divider:()=>Ml,drawer:()=>Rl,elevation:()=>W,emphasis:()=>$l,empty:()=>zl,errorBoundary:()=>Al,fab:()=>Vl,figure:()=>Hl,focusRing:()=>_,formGroup:()=>jl,grid:()=>Fl,heading:()=>Kl,horizontalRule:()=>ql,icon:()=>Ul,image:()=>Gl,inputCheckbox:()=>Yl,inputColor:()=>Xl,inputDateTime:()=>Jl,inputFile:()=>Zl,inputNumber:()=>Ql,inputOTP:()=>es,inputPassword:()=>rs,inputRadio:()=>is,inputRange:()=>as,inputSearch:()=>ls,inputSwitch:()=>ss,inputText:()=>cs,keyboard:()=>us,label:()=>ms,link:()=>ds,linkButton:()=>ps,list:()=>gs,listItem:()=>ys,listItemButton:()=>bs,mark:()=>vs,menu:()=>Ss,motion:()=>ws,orderedList:()=>Es,pagination:()=>Ts,panelSection:()=>_s,paragraph:()=>Ds,popover:()=>Ps,popoverArrow:()=>Go,preformated:()=>Ls,progress:()=>Ms,rating:()=>zs,ringProgress:()=>Ns,row:()=>Xo,scrollArea:()=>As,segmented:()=>Vs,select:()=>Hs,selectBox:()=>Ks,selectItem:()=>qs,selectList:()=>Us,skeleton:()=>Gs,small:()=>Ys,spinner:()=>Xs,splitter:()=>Js,splitterHandle:()=>ec,splitterPanel:()=>Qs,stack:()=>tc,steps:()=>nc,strong:()=>rc,subscript:()=>ic,superscript:()=>ac,table:()=>lc,tabs:()=>sc,tag:()=>St,textarea:()=>cc,timeline:()=>uc,timelineItem:()=>mc,toast:()=>dc,toggleGroup:()=>pc,toolbar:()=>gc,toolbarSpacer:()=>yc,tooltip:()=>bc,transitionGroup:()=>vc,unorderedList:()=>Sc,visuallyHidden:()=>xc});function ua(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:r=>x(r),backgroundColor:r=>c(r),color:r=>c(r,"shift-10",t.get(r)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:r=>c(r,"shift-7",t.get(r)),textUnderlineOffset:h(.72),cursor:"help","&:hover":{color:r=>c(r,"shift-11",n.get(r)),textDecorationColor:r=>c(r,"shift-9",n.get(r))}}}}function _(e,t="primary"){let n=c(e,"surface"),o=c(e,"shift-9",t);return`0 0 0 2px ${n}, 0 0 0 4px ${o}`}function ma(e={}){var a,r;let{type:t="single"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{_onMount:i=>{if(t!=="single")return;let l=i.domElement;if(!l)return;let u=d=>{let s=d.target.closest("summary");if(!s)return;let m=s.closest("details");!m||m.parentElement!==l||m.open||Array.from(l.querySelectorAll(":scope > details")).forEach(f=>{f!==m&&(f.open=!1)})};l.addEventListener("click",u),i.addHook("Remove",()=>l.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:i=>h(y(i)*1.5),outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,outlineOffset:"-1px",color:i=>c(i,"text",n.get(i)),overflow:"hidden","& > details":{borderBottom:i=>`1px solid ${c(i,"border-strong",n.get(i))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{boxShadow:i=>_(i,o.get(i))}}}}function da(e={}){var n;let t=b((n=e.color)!=null?n:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:h(3),paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),borderRadius:o=>h(y(o)*1.5),boxShadow:o=>`inset ${h(1)} 0 0 0 ${c(o,"shift-8",t.get(o))}`,backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-10",t.get(o)),fontSize:o=>x(o,"inherit")}}}function ha(e={}){var n;let t=b((n=e.color)!=null?n:"primary","color");return{dataTone:"shift-2",_doctorDisable:"inline-typography",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:h(9),height:h(9),fontSize:o=>x(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-11",t.get(o)),boxShadow:o=>`0 0 0 1px ${c(o,"border",t.get(o))}`,"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function fa(e={}){var a;let{label:t=999}=e,n=b(t),o=b((a=e.color)!=null?a:"danger","color");return{_doctorDisable:"inline-typography",style:{position:"relative","&::after":{content:r=>`"${n.get(r)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:r=>h(y(r)*(1.5/1.5)),minWidth:h(5),height:r=>h(y(r)*(5/1.5)),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:r=>x(r,"decrease-2"),fontWeight:"600",lineHeight:1,borderRadius:r=>h(y(r)*999),backgroundColor:r=>c(r,"shift-9",o.get(r)),color:r=>c(r,"shift-0",o.get(r)),boxShadow:r=>`0 0 0 1px ${c(r,"shift-0",o.get(r))}`}}}}function pa(e={}){var n;let t=b((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=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o)),boxShadow:o=>`inset ${h(1)} 0 0 0 ${c(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),margin:0}}}function ga(e={}){var o;let{separator:t="/"}=e,n=b((o=e.color)!=null?o:"neutral","color");return{_onInsert:a=>{a.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:a=>x(a,"inherit"),gap:h(1),color:a=>c(a,"text",n.get(a)),backgroundColor:a=>c(a,"inherit",n.get(a)),"& > *":{display:"inline-flex",alignItems:"center",color:a=>c(a,"text",n.get(a))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:a=>c(a,"shift-4",n.get(a)),paddingInlineStart:h(1)},"& > [aria-current=page]":{color:a=>c(a,"shift-10",n.get(a)),pointerEvents:"none"}}}}function ya(e={}){var n;let t=b((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:h(1),border:"none",background:"none",cursor:"pointer",color:o=>c(o,"text",t.get(o)),borderRadius:h(1),transition:"color 140ms ease, background-color 140ms ease, box-shadow 140ms ease","&:hover":{color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"hover",t.get(o))},"&:focus-visible":{boxShadow:o=>_(o,t.get(o))}}}}var Ze={small:"decrease-1",medium:"inherit",large:"increase-1"};var ba={small:.5,medium:1,large:1.5};function Mo(e={}){var a,r,i;let t=b((a=e.color)!=null?a:"neutral","color"),n=ba[(r=e.size)!=null?r:"medium"],o=Ze[(i=e.size)!=null?i:"medium"];return{type:"button",_onInsert:l=>{l.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:l=>x(l,o),paddingBlock:l=>h(y(l)*n),paddingInline:l=>h(y(l)*n),borderRadius:l=>h(y(l)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:l=>h(y(l)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease",color:l=>c(l,"text",t.get(l)),"&:hover:not([disabled]):not([aria-busy=true])":{color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"hover",t.get(l))},"&:active:not([disabled]):not([aria-busy=true])":{color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"increase-2",t.get(l))},"&:focus-visible":{boxShadow:l=>_(l,t.get(l))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>c(l,"border-strong","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}var va={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}};function Sa(e={}){var i,l,u,d;let t=(i=e.variant)!=null?i:"outline";if(t==="ghost")return Mo({color:e.color,size:e.size});let n=b((l=e.color)!=null?l:"primary","color"),o=t==="solid",a=va[(u=e.size)!=null?u:"medium"],r=Ze[(d=e.size)!=null?d:"medium"];return N(L({type:"button",_onInsert:s=>{s.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')}},o?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{appearance:"none",fontSize:s=>x(s,r),paddingBlock:s=>h(y(s)*a.block),paddingInline:s=>h(y(s)*a.inline),borderRadius:s=>h(y(s)*1.5),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:s=>h(y(s)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o?"none":s=>`1px solid ${c(s,"border-strong",n.get(s))}`,color:s=>o?c(s,"shift-0","neutral"):c(s,"shift-13",n.get(s)),backgroundColor:s=>o?c(s,"shift-13",n.get(s)):c(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-busy=true])":{color:s=>o?c(s,"shift-0","neutral"):c(s,"shift-14",n.get(s)),backgroundColor:s=>o?c(s,"shift-14",n.get(s)):c(s,"hover",n.get(s))},"&:active:not([disabled]):not([aria-busy=true])":{backgroundColor:s=>o?c(s,"shift-15",n.get(s)):c(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>_(s,n.get(s))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:s=>c(s,"shift-2","neutral"),outline:s=>`1px solid ${c(s,"border-strong","neutral")}`,color:s=>c(s,"muted","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}})}function xa(e={}){var r,i;let{checked:t=!1}=e,n=b(t),o=b((r=e.color)!=null?r:"neutral","color"),a=b((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"button",_onSchedule:l=>{l.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:l=>n.get(l),dataTone:"shift-2",onClick:()=>n.set(!n.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:l=>x(l),border:"none",outlineWidth:"1px",outline:l=>`1px solid ${c(l,"border",o.get(l))}`,minWidth:h(12),minHeight:h(6),borderRadius:h(999),paddingLeft:h(7),paddingRight:h(2),cursor:"pointer",transition:"padding-left 0.3s, padding-right 0.3s, background-color 140ms ease, box-shadow 140ms ease",backgroundColor:l=>c(l,"inherit",o.get(l)),color:l=>c(l,"text",o.get(l)),"&:focus-visible":{boxShadow:l=>_(l,a.get(l))},"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:h(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:h(5),height:h(5),borderRadius:h(999),color:l=>c(l,"text"),backgroundColor:l=>c(l,"decrease-2",o.get(l))},"&[aria-checked=true]":{backgroundColor:l=>c(l,"increase-3",a.get(l)),outline:"none",color:l=>c(l,"decrease-2"),paddingLeft:h(2),paddingRight:h(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${h(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}var wa={low:"0 1px 2px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.10)",medium:"0 2px 4px rgba(0,0,0,0.10), 0 10px 24px rgba(0,0,0,0.14)",high:"0 6px 12px rgba(0,0,0,0.14), 0 24px 48px rgba(0,0,0,0.20)"};function W(e){return wa[e]}function Ea(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>h(y(o)*2),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"shift-10",t.get(o)),outline:o=>`1px solid ${c(o,"border-strong",t.get(o))}`,outlineOffset:"-1px",boxShadow:W("low"),overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),fontWeight:"600",color:o=>c(o,"shift-11",t.get(o)),margin:0},"& > p":{gridArea:"desc",paddingInline:o=>h(y(o)*4),paddingBottom:o=>h(y(o)*2),color:o=>c(o,"text",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>h(y(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>h(y(o)*4),color:o=>c(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:h(2),paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*4),borderTop:o=>`1px solid ${c(o,"border",t.get(o))}`}}}}function ka(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),height:o=>h(y(o)*(6/1.5)),paddingInline:o=>h(y(o)*(1.5/1.5)),borderRadius:o=>h(y(o)*(1/1.5))}}}var Ca=Object.defineProperty,Ta=Object.defineProperties,_a=Object.getOwnPropertyDescriptors,Ht=Object.getOwnPropertySymbols,er=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable,qn=(e,t,n)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ye=(e,t)=>{for(var n in t||(t={}))er.call(t,n)&&qn(e,n,t[n]);if(Ht)for(var n of Ht(t))tr.call(t,n)&&qn(e,n,t[n]);return e},Ne=(e,t)=>Ta(e,_a(t)),or=(e,t)=>{var n={};for(var o in e)er.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Ht)for(var o of Ht(e))t.indexOf(o)<0&&tr.call(e,o)&&(n[o]=e[o]);return n},Ve=(e,t,n)=>new Promise((o,a)=>{var r=u=>{try{l(n.next(u))}catch(d){a(d)}},i=u=>{try{l(n.throw(u))}catch(d){a(d)}},l=u=>u.done?o(u.value):Promise.resolve(u.value).then(r,i);l((n=n.apply(e,t)).next())}),Da=["top","right","bottom","left"],Un=["start","end"],Au=Da.reduce((e,t)=>e.concat(t,`${t}-${Un[0]}`,`${t}-${Un[1]}`),[]),jt=Math.min,ze=Math.max,Ft=Math.round,Vt=Math.floor,Ee=e=>({x:e,y:e}),Oa={left:"right",right:"left",bottom:"top",top:"bottom"};function Pa(e,t,n){return ze(e,jt(t,n))}function qt(e,t){return typeof e=="function"?e(t):e}function et(e){return e.split("-")[0]}function Ut(e){return e.split("-")[1]}function nr(e){return e==="x"?"y":"x"}function rr(e){return e==="y"?"height":"width"}function De(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ir(e){return nr(De(e))}function La(e,t,n=!1){let o=Ut(e),a=ir(e),r=rr(a),i=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=Wt(i)),[i,Wt(i)]}function Ma(e){let t=Wt(e);return[$o(e),t,$o(t)]}function $o(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Gn=["left","right"],Yn=["right","left"],Ia=["top","bottom"],Ra=["bottom","top"];function $a(e,t,n){switch(e){case"top":case"bottom":return n?t?Yn:Gn:t?Gn:Yn;case"left":case"right":return t?Ia:Ra;default:return[]}}function za(e,t,n,o){let a=Ut(e),r=$a(et(e),n==="start",o);return a&&(r=r.map(i=>`${i}-${a}`),t&&(r=r.concat(r.map($o)))),r}function Wt(e){let t=et(e);return Oa[t]+e.slice(t.length)}function Na(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function Aa(e){return typeof e!="number"?Na(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Xn({reference:e,floating:t},n,o){let a=De(n),r=ir(n),i=rr(r),l=et(n),u=a==="y",d=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,m=e[i]/2-t[i]/2,f;switch(l){case"top":f={x:d,y:e.y-t.height};break;case"bottom":f={x:d,y:e.y+e.height};break;case"right":f={x:e.x+e.width,y:s};break;case"left":f={x:e.x-t.width,y:s};break;default:f={x:e.x,y:e.y}}let p=Ut(n);return p&&(f[r]+=m*(p==="end"?1:-1)*(o&&u?-1:1)),f}function Ba(e){return Ve(this,arguments,function*(t,n={}){var o,a,r,i,l,u;let{x:d,y:s,platform:m,rects:f,elements:p,strategy:g}=t,{boundary:S="clippingAncestors",rootBoundary:E="viewport",elementContext:v="floating",altBoundary:k=!1,padding:T=0}=qt(n,t),w=Aa(T),O=p[k?v==="floating"?"reference":"floating":v],D=Kt(yield m.getClippingRect({element:(a=yield(o=m.isElement)==null?void 0:o.call(m,O))==null||a?O:O.contextElement||(yield(r=m.getDocumentElement)==null?void 0:r.call(m,p.floating)),boundary:S,rootBoundary:E,strategy:g})),I=v==="floating"?{x:d,y:s,width:f.floating.width,height:f.floating.height}:f.reference,F=yield(i=m.getOffsetParent)==null?void 0:i.call(m,p.floating),A=(yield(l=m.isElement)==null?void 0:l.call(m,F))&&(yield(u=m.getScale)==null?void 0:u.call(m,F))||{x:1,y:1},B=Kt(m.convertOffsetParentRelativeRectToViewportRelativeRect?yield m.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:I,offsetParent:F,strategy:g}):I);return{top:(D.top-B.top+w.top)/A.y,bottom:(B.bottom-D.bottom+w.bottom)/A.y,left:(D.left-B.left+w.left)/A.x,right:(B.right-D.right+w.right)/A.x}})}var Va=50,Ha=(e,t,n)=>Ve(null,null,function*(){var o;let{placement:a="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,u=l.detectOverflow?l:Ne(ye({},l),{detectOverflow:Ba}),d=yield(o=l.isRTL)==null?void 0:o.call(l,t),s=yield l.getElementRects({reference:e,floating:t,strategy:r}),{x:m,y:f}=Xn(s,a,d),p=a,g=0,S={};for(let E=0;E<i.length;E++){let v=i[E];if(!v)continue;let{name:k,fn:T}=v,{x:w,y:O,data:D,reset:I}=yield T({x:m,y:f,initialPlacement:a,placement:p,strategy:r,middlewareData:S,rects:s,platform:u,elements:{reference:e,floating:t}});m=w!=null?w:m,f=O!=null?O:f,S[k]=ye(ye({},S[k]),D),I&&g<Va&&(g++,typeof I=="object"&&(I.placement&&(p=I.placement),I.rects&&(s=I.rects===!0?yield l.getElementRects({reference:e,floating:t,strategy:r}):I.rects),{x:m,y:f}=Xn(s,p,d)),E=-1)}return{x:m,y:f,placement:p,strategy:r,middlewareData:S}});var ja=(e={})=>({name:"flip",options:e,fn(t){return Ve(this,null,function*(){var n,o,a,r,i,l;let{placement:u,middlewareData:d,rects:s,initialPlacement:m,platform:f,elements:p}=t,g=qt(e,t),{mainAxis:S=!0,crossAxis:E=!0,fallbackPlacements:v,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:w=!0}=g,O=or(g,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=d.arrow)!=null&&n.alignmentOffset)return{};let D=et(u),I=De(m),F=et(m)===m,A=yield(o=f.isRTL)==null?void 0:o.call(f,p.floating),B=v||(F||!w?[Wt(m)]:Ma(m)),ie=T!=="none";!v&&ie&&B.push(...za(m,w,T,A));let q=[m,...B],Z=yield f.detectOverflow(t,O),te=[],Y=((a=d.flip)==null?void 0:a.overflows)||[];if(S&&te.push(Z[D]),E){let oe=La(u,s,A);te.push(Z[oe[0]],Z[oe[1]])}if(Y=[...Y,{placement:u,overflows:te}],!te.every(oe=>oe<=0)){let oe=(((r=d.flip)==null?void 0:r.index)||0)+1,ae=q[oe];if(ae&&(!(E==="alignment"&&I!==De(ae))||Y.every(ee=>De(ee.placement)===I?ee.overflows[0]>0:!0)))return{data:{index:oe,overflows:Y},reset:{placement:ae}};let ne=(i=Y.filter(ee=>ee.overflows[0]<=0).sort((ee,Q)=>ee.overflows[1]-Q.overflows[1])[0])==null?void 0:i.placement;if(!ne)switch(k){case"bestFit":{let ee=(l=Y.filter(Q=>{if(ie){let R=De(Q.placement);return R===I||R==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(R=>R>0).reduce((R,U)=>R+U,0)]).sort((Q,R)=>Q[1]-R[1])[0])==null?void 0:l[0];ee&&(ne=ee);break}case"initialPlacement":ne=m;break;default:}if(u!==ne)return{reset:{placement:ne}}}return{}})}});var Fa=new Set(["left","top"]);function Wa(e,t){return Ve(this,null,function*(){var n;let{placement:o,platform:a,elements:r}=e,i=yield(n=a.isRTL)==null?void 0:n.call(a,r.floating),l=et(o),u=Ut(o),d=De(o)==="y",s=Fa.has(l)?-1:1,m=i&&d?-1:1,f=qt(t,e),{mainAxis:p,crossAxis:g,alignmentAxis:S}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&typeof S=="number"&&(g=u==="end"?S*-1:S),d?{x:g*m,y:p*s}:{x:p*s,y:g*m}})}var Ka=(e=0)=>({name:"offset",options:e,fn(t){return Ve(this,null,function*(){var n,o;let{x:a,y:r,placement:i,middlewareData:l}=t,u=yield Wa(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:a+u.x,y:r+u.y,data:Ne(ye({},u),{placement:i})}})}}),qa=(e={})=>({name:"shift",options:e,fn(t){return Ve(this,null,function*(){let{x:n,y:o,placement:a,platform:r}=t,i=qt(e,t),{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:({x:T,y:w})=>({x:T,y:w})}}=i,s=or(i,["mainAxis","crossAxis","limiter"]),m={x:n,y:o},f=yield r.detectOverflow(t,s),p=De(a),g=nr(p),S=m[g],E=m[p],v=(T,w)=>Pa(w+f[T==="y"?"top":"left"],w,w-f[T==="y"?"bottom":"right"]);l&&(S=v(g,S)),u&&(E=v(p,E));let k=d.fn(Ne(ye({},t),{[g]:S,[p]:E}));return Ne(ye({},k),{data:{x:k.x-n,y:k.y-o,enabled:{[g]:l,[p]:u}}})})}});function Gt(){return typeof window!="undefined"}function tt(e){return ar(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function ke(e){var t;return(t=(ar(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ar(e){return Gt()?e instanceof Node||e instanceof ce(e).Node:!1}function be(e){return Gt()?e instanceof Element||e instanceof ce(e).Element:!1}function Oe(e){return Gt()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function Jn(e){return!Gt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function Yt(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function Ua(e){return/^(table|td|th)$/.test(tt(e))}function Xt(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Ga=/transform|translate|scale|rotate|perspective|filter/,Ya=/paint|layout|strict|content/,$e=e=>!!e&&e!=="none",Io;function No(e){let t=be(e)?ve(e):e;return $e(t.transform)||$e(t.translate)||$e(t.scale)||$e(t.rotate)||$e(t.perspective)||!Ao()&&($e(t.backdropFilter)||$e(t.filter))||Ga.test(t.willChange||"")||Ya.test(t.contain||"")}function Xa(e){let t=Ae(e);for(;Oe(t)&&!yt(t);){if(No(t))return t;if(Xt(t))return null;t=Ae(t)}return null}function Ao(){return Io==null&&(Io=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Io}function yt(e){return/^(html|body|#document)$/.test(tt(e))}function ve(e){return ce(e).getComputedStyle(e)}function Jt(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if(tt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Jn(e)&&e.host||ke(e);return Jn(t)?t.host:t}function lr(e){let t=Ae(e);return yt(t)?(e.ownerDocument||e).body:Oe(t)&&Yt(t)?t:lr(t)}function bt(e,t=[],n=!0){var o;let a=lr(e),r=a===((o=e.ownerDocument)==null?void 0:o.body),i=ce(a);if(r){let l=zo(i);return t.concat(i,i.visualViewport||[],Yt(a)?a:[],l&&n?bt(l):[])}else return t.concat(a,bt(a,[],n))}function zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sr(e){let t=ve(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Oe(e),r=a?e.offsetWidth:n,i=a?e.offsetHeight:o,l=Ft(n)!==r||Ft(o)!==i;return l&&(n=r,o=i),{width:n,height:o,$:l}}function Bo(e){return be(e)?e:e.contextElement}function Qe(e){let t=Bo(e);if(!Oe(t))return Ee(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:r}=sr(t),i=(r?Ft(n.width):n.width)/o,l=(r?Ft(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var Ja=Ee(0);function cr(e){let t=ce(e);return!Ao()||!t.visualViewport?Ja:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Za(e,t=!1,n){return!!n&&t&&n===ce(e)}function Be(e,t=!1,n=!1,o){let a=e.getBoundingClientRect(),r=Bo(e),i=Ee(1);t&&(o?be(o)&&(i=Qe(o)):i=Qe(e));let l=Za(r,n,o)?cr(r):Ee(0),u=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,s=a.width/i.x,m=a.height/i.y;if(r&&o){let f=ce(r),p=be(o)?ce(o):o,g=f,S=zo(g);for(;S&&p!==g;){let E=Qe(S),v=S.getBoundingClientRect(),k=ve(S),T=v.left+(S.clientLeft+parseFloat(k.paddingLeft))*E.x,w=v.top+(S.clientTop+parseFloat(k.paddingTop))*E.y;u*=E.x,d*=E.y,s*=E.x,m*=E.y,u+=T,d+=w,g=ce(S),S=zo(g)}}return Kt({width:s,height:m,x:u,y:d})}function Zt(e,t){let n=Jt(e).scrollLeft;return t?t.left+n:Be(ke(e)).left+n}function ur(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Zt(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function Qa({elements:e,rect:t,offsetParent:n,strategy:o}){let a=o==="fixed",r=ke(n),i=e?Xt(e.floating):!1;if(n===r||i&&a)return t;let l={scrollLeft:0,scrollTop:0},u=Ee(1),d=Ee(0),s=Oe(n);if((s||!a)&&((tt(n)!=="body"||Yt(r))&&(l=Jt(n)),s)){let f=Be(n);u=Qe(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}let m=r&&!s&&!a?ur(r,l):Ee(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+d.x+m.x,y:t.y*u.y-l.scrollTop*u.y+d.y+m.y}}function el(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function tl(e){let t=Jt(e),n=e.ownerDocument.body,o=ze(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=ze(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),r=-t.scrollLeft+Zt(e),i=-t.scrollTop;return ve(n).direction==="rtl"&&(r+=ze(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:r,y:i}}var ol=25;function nl(e,t,n="viewport"){let o=n==="layoutViewport",a=ce(e),r=ke(e),i=a.visualViewport,l=r.clientWidth,u=r.clientHeight,d=0,s=0;if(i){let m=!Ao()||t==="fixed";o?m||(d=-i.offsetLeft,s=-i.offsetTop):(l=i.width,u=i.height,m&&(d=i.offsetLeft,s=i.offsetTop))}if(Zt(r)<=0){let m=r.ownerDocument,f=m.body,p=getComputedStyle(f),g=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,S=Math.abs(r.clientWidth-f.clientWidth-g),E=getComputedStyle(r).scrollbarGutter==="stable both-edges"?S/2:S;E<=ol&&(l-=E)}return{width:l,height:u,x:d,y:s}}function rl(e,t){let n=Be(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,r=Qe(e),i=e.clientWidth*r.x,l=e.clientHeight*r.y,u=a*r.x,d=o*r.y;return{width:i,height:l,x:u,y:d}}function Zn(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=nl(e,n,t);else if(t==="document")o=tl(ke(e));else if(be(t))o=rl(t,n);else{let a=cr(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Kt(o)}function il(e,t){let n=t.get(e);if(n)return n;let o=bt(e,[],!1).filter(l=>be(l)&&tt(l)!=="body"),a=null,r=ve(e).position==="fixed",i=r?Ae(e):e;for(;be(i)&&!yt(i);){let l=ve(i),u=No(i),d=a?a.position:r?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?o=o.filter(s=>s!==i):a=l,i=Ae(i)}return t.set(e,o),o}function al({element:e,boundary:t,rootBoundary:n,strategy:o}){let a=[...t==="clippingAncestors"?Xt(e)?[]:il(e,this._c):[].concat(t),n],r=Zn(e,a[0],o),i=r.top,l=r.right,u=r.bottom,d=r.left;for(let s=1;s<a.length;s++){let m=Zn(e,a[s],o);i=ze(m.top,i),l=jt(m.right,l),u=jt(m.bottom,u),d=ze(m.left,d)}return{width:l-d,height:u-i,x:d,y:i}}function ll(e){let{width:t,height:n}=sr(e);return{width:t,height:n}}function sl(e,t,n){let o=Oe(t),a=ke(t),r=n==="fixed",i=Be(e,!0,r,t),l={scrollLeft:0,scrollTop:0},u=Ee(0);if((o||!r)&&((tt(t)!=="body"||Yt(a))&&(l=Jt(t)),o)){let f=Be(t,!0,r,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}!o&&a&&(u.x=Zt(a));let d=a&&!o&&!r?ur(a,l):Ee(0),s=i.left+l.scrollLeft-u.x-d.x,m=i.top+l.scrollTop-u.y-d.y;return{x:s,y:m,width:i.width,height:i.height}}function Ro(e){return ve(e).position==="static"}function Qn(e,t){if(!Oe(e)||ve(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ke(e)===n&&(n=n.ownerDocument.body),n}function mr(e,t){let n=ce(e);if(Xt(e))return n;if(!Oe(e)){let a=Ae(e);for(;a&&!yt(a);){if(be(a)&&!Ro(a))return a;a=Ae(a)}return n}let o=Qn(e,t);for(;o&&Ua(o)&&Ro(o);)o=Qn(o,t);return o&&yt(o)&&Ro(o)&&!No(o)?n:o||Xa(e)||n}var cl=function(e){return Ve(this,null,function*(){let t=this.getOffsetParent||mr,n=this.getDimensions,o=yield n(e.floating);return{reference:sl(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function ul(e){return ve(e).direction==="rtl"}var ml={convertOffsetParentRelativeRectToViewportRelativeRect:Qa,getDocumentElement:ke,getClippingRect:al,getOffsetParent:mr,getElementRects:cl,getClientRects:el,getDimensions:ll,getScale:Qe,isElement:be,isRTL:ul};function dr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dl(e,t,n){let o=null,a,r=ke(e);function i(){clearTimeout(a),o==null||o.disconnect(),o=null}function l(s=!1,m=1){i();let f=e.getBoundingClientRect(),{left:p,top:g,width:S,height:E}=f;if(s||t(),!S||!E)return;let v=Vt(g),k=Vt(r.clientWidth-(p+S)),T=Vt(r.clientHeight-(g+E)),w=Vt(p),O={rootMargin:`${-v}px ${-k}px ${-T}px ${-w}px`,threshold:ze(0,jt(1,m))||1},D=!0;function I(F){let A=F[0].intersectionRatio;if(!dr(f,e.getBoundingClientRect()))return l();if(A!==m){if(!D)return l();A?l(!1,A):a=setTimeout(()=>{l(!1,1e-7)},1e3)}D=!1}try{o=new IntersectionObserver(I,Ne(ye({},O),{root:r.ownerDocument}))}catch(F){o=new IntersectionObserver(I,O)}o.observe(e)}let u=ce(e),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),i()}}function hr(e,t,n,o={}){let{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=Bo(e),s=a||r?[...d?bt(d):[],...t?bt(t):[]]:[];s.forEach(v=>{a&&v.addEventListener("scroll",n),r&&v.addEventListener("resize",n)});let m=d&&l?dl(d,n,r):null,f=-1,p=null;i&&(p=new ResizeObserver(([v])=>{v&&v.target===d&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p==null||p.observe(t)})),n()}),d&&!u&&p.observe(d),t&&p.observe(t));let g,S=u?Be(e):null;u&&E();function E(){let v=Be(e);S&&!dr(S,v)&&n(),S=v,g=requestAnimationFrame(E)}return n(),()=>{s.forEach(v=>{a&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),m==null||m(),p==null||p.disconnect(),p=null,u&&cancelAnimationFrame(g)}}var fr=Ka;var pr=qa,gr=ja;var yr=(e,t,n)=>{let o=new Map,a=n!=null?n:{},r=Ne(ye(ye({},ml),a.platform),{_c:o});return Ha(e,t,Ne(ye({},a),{platform:r}))};function hl(e){return typeof e.set=="function"}function Ce(e,t,n=!0){if(typeof e.addListener=="function")return n&&t(e.get()),e.addListener(t);if(n)return mt(()=>{t(e.get())});let o=!0,a=mt(()=>{let r=e.get();o||t(r)});return o=!1,a}function Vo(e,t){hl(e)&&e.set(t)}function Pe(e,t){t==null||t(),Vo(e,!1)}function ot(e){return b(e!=null?e:!1)}function de(e,t){return`domphy-${e}-${t.nodeId}`}function fl(e,t){var ae,ne,ee,Q;let{openState:n,onDismiss:o,placement:a,content:r,keepOpenOnContentHover:i}=t,{kind:l}=t,u=`floating:${l}`,d=null,s=null,m=null,f=null,p=!1,g=e.domElement,S=e.getRoot(),E=de(l,e),v={style:{position:"fixed",pointerEvents:"auto",visibility:R=>n.get(R)?"visible":"hidden"},onKeyDown:R=>{R.key==="Escape"&&I()},onMouseEnter:()=>i&&D(),onMouseLeave:()=>i&&I(),_onMount:R=>{var U;if(m=R.domElement,m.id||(m.id=E),g&&m&&!m.hasAttribute("data-theme")){let pe=(U=g.closest("[data-theme]"))==null?void 0:U.getAttribute("data-theme");pe&&m.setAttribute("data-theme",pe)}},_portal:R=>{let U=g.closest("dialog");if(U){let he=U.querySelector(":scope > #domphy-floating");return he||(he=U.ownerDocument.createElement("div"),he.id="domphy-floating",Object.assign(he.style,{position:"fixed",inset:"0",zIndex:"20",pointerEvents:"none"}),U.appendChild(he)),he}let pe=R.domElement.querySelector("#domphy-floating");if(!pe){let he={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};pe=R.children.insert(he).domElement}return pe}},k=R=>K(R,v);k(r);let T=()=>{p||(p=!0,f=S.children.insert(r),f._behaviorInstances.set(u,Y))},w=()=>{p&&(!m||!m.isConnected)&&(s==null||s(),s=null,f=null,m=null,p=!1),T(),g&&m&&(s==null||s(),s=hr(g,m,()=>{yr(g,m,{placement:a.get(),middleware:[fr(12),gr(),pr()],strategy:"fixed"}).then(({x:R,y:U,placement:pe})=>{m&&(Object.assign(m.style,{left:`${R}px`,top:`${U}px`}),a.set(pe))})}),Vo(n,!0))},O=()=>{s==null||s(),s=null,f&&(f.remove(),f=null),m=null,p=!1,Pe(n,o)},D=()=>{d&&clearTimeout(d),d=setTimeout(w,100)},I=()=>{d&&clearTimeout(d),d=setTimeout(O,100)},F=R=>{if(!n.get()||!g||!m)return;let U=R.target;!g.contains(U)&&!m.contains(U)&&I()};(ae=S.domElement)==null||ae.addEventListener("click",F);let A=R=>{R.key==="Escape"&&n.get()&&I()},B=(Q=(ee=(ne=S.domElement)==null?void 0:ne.ownerDocument)!=null?ee:S.domElement)!=null?Q:null;B==null||B.addEventListener("keydown",A);let ie=R=>{R?p||w():p&&O()},q=()=>{},Z=!1,te=!1,Y,oe=R=>{var U;R._behaviors=N(L({},(U=R._behaviors)!=null?U:{}),{[u]:{attach:()=>Y,props:{}}})};return Y={show:D,hide:I,panelId:E,update(R){if(!te&&(o=R.onDismiss,R.openState!==n&&(q(),n=R.openState,q=Ce(n,ie,!1),n.get()&&w()),a=R.placement,r=R.content,i=R.keepOpenOnContentHover,k(r),oe(r),f)){te=!0;try{f.patch(r)}finally{te=!1}}},destroy(){var R;Z||(Z=!0,d&&clearTimeout(d),d=null,s==null||s(),s=null,f==null||f.remove(),f=null,m=null,p=!1,q(),q=()=>{},(R=S.domElement)==null||R.removeEventListener("click",F),B==null||B.removeEventListener("keydown",A))}},oe(r),q=Ce(n,ie),Y}function Se(e){let{kind:t,placement:n,onDismiss:o}=e,a=ot(e.open),r=`floating:${t}`,i=d=>{var s;return(s=d==null?void 0:d.getBehavior(r))==null?void 0:s.show()},l=d=>{var s;return(s=d==null?void 0:d.getBehavior(r))==null?void 0:s.hide()},u=L({onKeyDown:(d,s)=>d.key==="Escape"&&l(s)},V(r,fl,{kind:t,openState:a,onDismiss:o,placement:n,content:e.content,keepOpenOnContentHover:!!e.keepOpenOnContentHover}));return{show:i,hide:l,anchorPartial:u}}var pl='<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>',vt=1.5,gl=6/vt,br=2.5/vt,yl=1/vt,vr=4/vt,bl=1/vt;function St(e={}){var o;let{removable:t=!1}=e,n=b((o=e.color)!=null?o:"neutral","color");return N(L({dataTone:"shift-2"},V("tag-remove",(a,r)=>{let i=()=>a.remove(),l=()=>({span:Ie(pl),_key:"tag-remove",onClick:s=>{s.stopPropagation(),i()},onKeyDown:s=>{let m=s;m.key!=="Enter"&&m.key!==" "||(m.preventDefault(),m.stopPropagation(),i())},tabindex:0,role:"button",ariaLabel:"Remove",style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s=>h(y(s)*bl),width:s=>h(y(s)*vr),height:s=>h(y(s)*vr),flexShrink:0,transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover":{backgroundColor:s=>c(s,"shift-4",n.get(s))},"&:focus-visible":{boxShadow:s=>_(s,n.get(s))}}}),u=()=>{var s;return(s=a.children.items.find(m=>m instanceof J&&m.key==="tag-remove"))!=null?s:null},d=(s,m)=>{let f=u();s.removable&&!f?a.children.insert(l(),void 0,m):!s.removable&&f&&a.children.remove(f)};return d(r,!1),{update:s=>d(s,!0)}},{removable:t})),{style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:a=>h(y(a)*gl),paddingBlock:0,borderRadius:a=>h(y(a)*999),paddingInlineStart:a=>h(y(a)*br),paddingInlineEnd:a=>h(y(a)*(t?yl:br)),gap:h(1.5),fontSize:a=>x(a,"decrease-1"),backgroundColor:a=>c(a,"inherit",n.get(a)),color:a=>c(a,"text",n.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${c(a,"border-strong",n.get(a))}`}})}function vl(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=b(e.value),l=b(a),{show:u,hide:d,anchorPartial:s}=Se({kind:"combobox",open:l,onDismiss:e.onDismiss,placement:b(n),content:e.content}),m={onClick:(w,O)=>!r&&d(O),dataTone:"shift-0",style:{backgroundColor:w=>c(w,"inherit"),color:w=>c(w,"text"),borderRadius:w=>h(y(w)*2),outline:w=>`1px solid ${c(w,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};K(e.content,m);let f={border:"none",outline:"none",padding:0,margin:0,flex:1,height:h(6),marginInlineStart:h(2),fontSize:w=>x(w,"inherit"),color:w=>c(w,"text",o),backgroundColor:w=>c(w,"inherit",o)},p=w=>{var O,D;return(D=(O=w==null?void 0:w.elementNode)==null?void 0:O.getBehavior("comboboxInner"))==null?void 0:D.query},g=w=>{let O=w;for(;O;){if(O._behaviorInstances.has("floating:combobox"))return O;O=O.parent}return w},S={role:"combobox",ariaHaspopup:"listbox",ariaExpanded:w=>l.get(w),ariaControls:w=>w!=null&&w.elementNode?de("combobox",g(w.elementNode)):void 0},E=w=>w?(K(w,L({onFocus:(O,D)=>u(D),style:f,_key:"combobox-input"},S)),w):L({input:null,ariaLabel:"Filter options",onFocus:(O,D)=>u(D),value:O=>{var D,I;return(I=(D=p(O))==null?void 0:D.get(O))!=null?I:""},onInput:(O,D)=>{var I;(I=D.getBehavior("comboboxInner"))==null||I.query.set(O.target.value)},style:f,_key:"combobox-input"},S),v=w=>({div:O=>{l.get(O);let D=w.state.get(O),I=Array.isArray(D)?D:[D],A=w.options.filter(B=>I.includes(B.value)).map(B=>({span:B.label,$:[St({color:w.color,removable:!0})],_key:B.value,_onRemove:ie=>{let q=w.state.get(),te=(Array.isArray(q)?q:[q]).filter(Y=>Y!==B.value);w.multiple?w.state.set(te):w.state.set(te[0])}}));return A.push(E(w.input)),A},_key:"comboboxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1)}}),T=N(L({_onInsert:w=>{w.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onSchedule:(w,O)=>{O[w.tagName]=[v({options:t,multiple:r,color:o,state:i,input:e.input})]}},V("comboboxInner",(w,O)=>{let D=w.getMetadata("comboboxQuery");return D||(D=b(""),w.setMetadata("comboboxQuery",D)),{query:D,update(I){w.children.update([v(I)])}}},{options:t,multiple:r,color:o,state:i,input:e.input})),{style:{minWidth:h(32),outlineOffset:"-1px",outline:w=>`1px solid ${c(w,"border-strong","neutral")}`,paddingBlock:w=>h(y(w)*1),paddingInline:w=>h(y(w)*1),borderRadius:w=>h(y(w)*1.5),fontSize:w=>x(w,"inherit"),color:w=>c(w,"text",o),backgroundColor:w=>c(w,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-within":{boxShadow:w=>_(w,o)}}});return K(s,T),s}function Sl(){return{role:"group",ariaLabel:"Commands",_onSchedule:(e,t)=>{K(t,{_context:{command:{query:b("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function xl(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let a=o.getContext("command");if(!a){console.warn('"commandSearch" patch must be used inside a "command"');return}let r=o.domElement,i=()=>a.query.set(r.value);r.addEventListener("input",i),o.addHook("Remove",()=>r.removeEventListener("input",i))},style:{fontFamily:"inherit",fontSize:o=>x(o,"inherit"),paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*2),border:"none",borderBottom:o=>`1px solid ${c(o,"border",t)}`,outline:"none",color:o=>c(o,"shift-10",t),backgroundColor:o=>c(o,"inherit",t),"&::placeholder":{color:o=>c(o,"shift-7")},transition:"border-bottom-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{borderBottomColor:o=>c(o,"shift-6",n),boxShadow:o=>_(o,n)}}}}function wl(e={}){let{color:t="neutral",accentColor:n="primary"}=e;return{_onMount:o=>{var d,s;let a=o.getContext("command");if(!a){console.warn('"commandItem" patch must be used inside a "command"');return}let r=o.domElement,i=(s=(d=r.textContent)==null?void 0:d.toLowerCase())!=null?s:"",l=m=>{r.hidden=m.length>0&&!i.includes(m.toLowerCase())};l(a.query.get());let u=a.query.addListener(l);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>x(o,"inherit"),height:o=>h(6+y(o)*2),paddingInline:o=>h(y(o)*3),border:"none",outline:"none",color:o=>c(o,"shift-13",t),backgroundColor:o=>c(o,"inherit",t),transition:"background-color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{color:o=>c(o,"shift-13",t),backgroundColor:o=>c(o,"hover",t)},"&:focus-visible":{boxShadow:o=>_(o,n)}}}}var re=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),He=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Ho=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),xt=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),jo=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Fo=(e,t)=>He(e,-((e.getDay()-t+7)%7));function El(e){var t,n;try{let o=new Intl.Locale(e),a=(n=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?n:o.weekInfo;if(a!=null&&a.firstDay)return a.firstDay%7}catch(o){}return 0}function kl(e,t){let n=t,o=null,a=i=>{o==null||o(),o=i.onChange?i.selection.addListener(l=>i.onChange(l)):null},r=(i,l)=>{i!==l&&i.set(l.get())};return a(n),{update(i){i.selectionIsCallerOwned||r(i.selection,n.selection),r(i.viewYear,n.viewYear),r(i.viewMonth,n.viewMonth),r(i.focused,n.focused),r(i.hovered,n.hovered),r(i.hour,n.hour),r(i.minute,n.minute),r(i.open,n.open),(i.selection!==n.selection||i.onChange!==n.onChange)&&a(i),n=i},destroy(){o==null||o(),o=null}}}function Cl(e={}){var Zo,Qo,en,tn;let{mode:t="single",time:n=!1,min:o,max:a,disabledDate:r,locale:i=typeof navigator!="undefined"?navigator.language:"en-US",format:l,onChange:u}=e,d=(Zo=e.weekStartsOn)!=null?Zo:El(i),s=b((Qo=e.accentColor)!=null?Qo:"primary","accentColor"),m=b((en=e.placement)!=null?en:"bottom-start"),f=b((tn=e.value)!=null?tn:t==="range"?[null,null]:null),p=(()=>{let C=f.get(),P=t==="range"?C==null?void 0:C[0]:C;return P instanceof Date?P:new Date})(),g=b(p.getFullYear(),"viewYear"),S=b(p.getMonth(),"viewMonth"),E=b(re(p),"focused"),v=b(null,"hovered"),k=b(p.getHours(),"hour"),T=b(p.getMinutes(),"minute"),w=new Intl.DateTimeFormat(i,L({dateStyle:"medium"},n?{timeStyle:"short"}:{})),O=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),D=new Intl.DateTimeFormat(i,{weekday:"short"}),I=new Intl.DateTimeFormat(i,{dateStyle:"full"}),F=C=>C?w.format(C):"",A=C=>{if(l)return l(C);if(t==="range"){let[P,M]=C!=null?C:[null,null];return P?`${F(P)} \u2013 ${F(M)}`:""}return F(C)},B=Array.from({length:7},(C,P)=>D.format(new Date(2023,0,1+(P+d)%7))),ie=C=>!!o&&re(C)<re(o)||!!a&&re(C)>re(a)||!!r&&r(C),q=C=>{if(!n)return re(C);let P=re(C);return P.setHours(k.get(),T.get(),0,0),P},Z=(C,P)=>{var $;if(ie(C))return;if(t==="single"){f.set(q(C)),n||he(P);return}let[M,z]=($=f.get())!=null?$:[null,null];!M||M&&z?f.set([q(C),null]):re(C)<re(M)?(f.set([q(C),q(M)]),n||he(P)):(f.set([M,q(C)]),n||he(P))},te=()=>{var C;if(n)if(t==="single"){let P=f.get();P&&f.set(q(P))}else{let[P,M]=(C=f.get())!=null?C:[null,null];f.set([P&&q(P),M&&q(M)])}},Y=(C,P)=>{var je;if(t!=="range")return!1;let[M,z]=(je=f.get(P))!=null?je:[null,null],$=z!=null?z:v.get(P);if(!M||!$)return!1;let H=re(M)<=re($)?M:$,fe=re(M)<=re($)?$:M,se=re(C);return se>=re(H)&&se<=re(fe)},oe=(C,P)=>{let M=f.get(P);if(t==="range"){let[z,$]=M!=null?M:[null,null];return xt(C,z)||xt(C,$)}return xt(C,M)},ae=C=>{g.set(C.getFullYear()),S.set(C.getMonth())},ne=C=>{let P=Ho(new Date(g.get(),S.get(),1),C);ae(P)},ee=C=>g.set(g.get()+C),Q=C=>{var M;let P=(M=C==null?void 0:C.getRoot())==null?void 0:M.domElement;setTimeout(()=>{var z;(z=P==null?void 0:P.querySelector(`[data-date="${jo(E.get())}"]`))==null||z.focus()},0)},R=Fr(),U=b(!1),{show:pe,hide:he,anchorPartial:to}=Se({kind:"datePicker",open:U,placement:m,content:R}),Hr=L({type:"text",readonly:!0,value:C=>A(f.get(C)),role:"combobox",ariaHaspopup:"dialog",ariaExpanded:C=>U.get(C),ariaControls:C=>C!=null&&C.elementNode?de("datePicker",C.elementNode):void 0,ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:(C,P)=>{oo(P)},onFocus:(C,P)=>{oo(P)},onKeyDown:(C,P)=>{let M=C.key;(M==="ArrowDown"||M==="Enter")&&(C.preventDefault(),oo(P))}},V("datePicker",kl,{selection:f,selectionIsCallerOwned:e.value!==void 0,viewYear:g,viewMonth:S,focused:E,hovered:v,hour:k,minute:T,open:U,onChange:u}));function oo(C){var M;let P=(M=jr())!=null?M:new Date;E.set(re(P)),ae(P),pe(C),Q(C)}function jr(){var P;let C=f.get();return t==="range"?(P=C==null?void 0:C[0])!=null?P:null:C!=null?C:null}return K(to,Hr),to;function Fr(){let C=(H,fe,se)=>({button:H,type:"button",ariaLabel:fe,onClick:se,style:Tl()}),P={div:[C("\xAB","Previous year",()=>ee(-1)),C("\u2039","Previous month",()=>ne(-1)),{div:H=>O.format(new Date(g.get(H),S.get(H),1)),ariaLive:"polite",_doctorDisable:"inline-typography",style:{flex:"1",textAlign:"center",fontWeight:"bold",fontSize:H=>x(H)}},C("\u203A","Next month",()=>ne(1)),C("\xBB","Next year",()=>ee(1))],style:{display:"flex",alignItems:"center",gap:h(1),marginBottom:h(2)}},M={div:B.map((H,fe)=>({div:H,_doctorDisable:"inline-typography",style:{textAlign:"center",fontSize:se=>x(se,"decrease-1"),fontWeight:"bold",color:se=>c(se,"shift-7"),paddingBlock:h(1)},_key:fe})),role:"row",style:Sr()},z={div:H=>Wr(H),role:"grid",ariaLabel:"Calendar",onKeyDown:Gr,onMouseLeave:()=>t==="range"&&v.set(null),style:{display:"flex",flexDirection:"column",gap:h(.5)}},$=[P,M,z];return n&&$.push(qr()),$.push(Ur()),{div:$,role:"dialog",ariaModal:"false",dataTone:"shift-0",style:{minWidth:h(70),padding:h(3),borderRadius:H=>h(y(H)*2),backgroundColor:H=>c(H,"inherit"),color:H=>c(H,"text"),outline:H=>`1px solid ${c(H,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}}}function Wr(C){let P=new Date(g.get(C),S.get(C),1),M=S.get(C),z=Fo(P,d),$=[];for(let H=0;H<6;H++){let fe=[];for(let se=0;se<7;se++){let je=He(z,H*7+se);fe.push(Kr(je,M,C))}$.push({div:fe,role:"row",style:Sr(),_key:H})}return $}function Kr(C,P,M){let z=ie(C),$=oe(C,M),H=Y(C,M),fe=C.getMonth()!==P,se=xt(C,E.get(M)),je=xt(C,new Date);return{button:String(C.getDate()),type:"button",role:"gridcell",tabIndex:se?0:-1,ariaSelected:$,ariaDisabled:z,disabled:z,ariaLabel:I.format(C),dataDate:jo(C),onClick:(X,Yr)=>Z(C,Yr),onMouseEnter:()=>t==="range"&&v.set(C),style:{appearance:"none",border:"none",cursor:z?"not-allowed":"pointer",aspectRatio:"1",borderRadius:h(1),fontSize:X=>x(X),fontFamily:"inherit",opacity:z?.35:fe?.5:1,backgroundColor:X=>$?c(X,"shift-7",s.get(X)):H?c(X,"hover",s.get(X)):"transparent",color:X=>$?c(X,"shift-0",s.get(X)):c(X,"text"),outline:je?X=>`1px solid ${c(X,"shift-6",s.get(X))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:X=>$?c(X,"shift-7",s.get(X)):c(X,"shift-3",s.get(X))},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:X=>_(X,s.get(X))}},_key:jo(C)}}function qr(){let C=(P,M,z)=>({select:Array.from({length:P},($,H)=>({option:String(H).padStart(2,"0"),value:String(H),selected:fe=>M.get(fe)===H,_key:H})),ariaLabel:z,onChange:$=>{M.set(Number($.target.value)),te()},style:_l()});return{div:[C(24,k,"Hour"),{span:":",_doctorDisable:"inline-typography",style:{fontWeight:"bold"}},C(60,T,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:h(1),marginTop:h(3)}}}function Ur(){let C=(P,M)=>({button:P,type:"button",onClick:(z,$)=>M($),style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:z=>x(z,"decrease-1"),color:z=>c(z,"muted",s.get(z)),padding:h(1)}});return{div:[C("Today",P=>{let M=new Date;E.set(re(M)),ae(M),Q(P)}),C("Clear",()=>{f.set(t==="range"?[null,null]:null),v.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:h(2),paddingTop:h(2),borderTop:P=>`1px solid ${c(P,"border")}`}}}function Gr(C,P){let M=C,z=E.get(),$=null;switch(M.key){case"ArrowLeft":$=He(z,-1);break;case"ArrowRight":$=He(z,1);break;case"ArrowUp":$=He(z,-7);break;case"ArrowDown":$=He(z,7);break;case"Home":$=Fo(z,d);break;case"End":$=He(Fo(z,d),6);break;case"PageUp":$=Ho(z,M.shiftKey?-12:-1);break;case"PageDown":$=Ho(z,M.shiftKey?12:1);break;case"Enter":case" ":M.preventDefault(),Z(z,P);return;default:return}M.preventDefault(),E.set($),ae($),Q(P)}}function Sr(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:h(.5)}}function Tl(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>x(e),color:e=>c(e,"muted"),width:h(7),height:h(7),borderRadius:h(1),"&:hover":{backgroundColor:e=>c(e,"shift-3")}}}function _l(){return{fontFamily:"inherit",fontSize:e=>x(e),padding:h(1),borderRadius:h(1),border:"none",outlineOffset:"-1px",outline:e=>`1px solid ${c(e,"border-strong")}`,backgroundColor:e=>c(e,"inherit"),color:e=>c(e,"text")}}function Dl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},_doctorDisable:"inline-typography",style:{display:"grid",gridTemplateColumns:`minmax(${h(24)}, max-content) 1fr`,columnGap:h(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>x(o,"inherit"),color:o=>c(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>x(o,"inherit"),color:o=>c(o,"text",t.get(o))}}}}function Ol(e={}){var a,r;let{duration:t=240}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{_onInsert:i=>{i.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},_doctorDisable:"inline-typography",style:{fontSize:i=>x(i,"inherit"),color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),overflow:"hidden","& > summary":{backgroundColor:i=>c(i,"shift-2",n.get(i)),color:i=>c(i,"shift-10",n.get(i)),fontSize:i=>x(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:h(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:i=>h(y(i)*4),height:h(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:h(2),height:h(2),flexShrink:0,marginTop:h(-.5),borderInlineEnd:i=>`${h(.5)} solid ${c(i,"shift-9",n.get(i))}`,borderBottom:i=>`${h(.5)} solid ${c(i,"shift-9",n.get(i))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>c(i,"shift-3",n.get(i))},"& > summary:focus-visible":{borderRadius:i=>h(y(i)*2),boxShadow:i=>_(i,o.get(i))},"& > :not(summary)":{maxHeight:0,opacity:0,overflow:"hidden",paddingInline:i=>h(y(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:"none",opacity:1,paddingTop:i=>h(y(i)*1),paddingBottom:i=>h(y(i)*3)}}}}var wt=0;function Qt(){wt++,wt===1&&(document.body.style.overflow="hidden")}function nt(){wt=Math.max(0,wt-1),wt===0&&(document.body.style.overflow="")}var xr='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function Pl(e,t){let{state:n,onDismiss:o}=t,a=null,r=!1,i=!1,l=null,u=e.domElement;u.setAttribute("aria-modal","true");let d=()=>{r=!1,typeof u.close=="function"&&u.close(),u.style.visibility="hidden",u.style.pointerEvents="none",u.style.display="none",i&&(nt(),i=!1),a==null||a.focus(),a=null},s=g=>{if(g.key!=="Tab")return;let S=Array.from(u.querySelectorAll(xr)).filter(k=>!k.closest("[aria-hidden='true']")&&k.offsetParent!==null);if(!S.length){g.preventDefault();return}let E=S[0],v=S[S.length-1];g.shiftKey?(document.activeElement===E||document.activeElement===u)&&(g.preventDefault(),v.focus()):document.activeElement===v&&(g.preventDefault(),E.focus())},m=g=>{g.preventDefault(),Pe(n,o)};u.addEventListener("cancel",m);let f=g=>{if(g)r=!1,l&&(clearTimeout(l),l=null),a=document.activeElement,u.style.visibility="visible",u.style.pointerEvents="auto",u.style.display="",typeof u.showModal=="function"&&!u.open&&u.showModal(),i||(Qt(),i=!0),u.addEventListener("keydown",s),requestAnimationFrame(()=>{u.style.opacity="1";let S=u.querySelector(xr);S==null||S.focus()});else{if(r=!0,u.style.opacity="0",u.removeEventListener("keydown",s),!u.open){d();return}l=setTimeout(()=>{l=null,r&&d()},350)}},p=Ce(n,f);return{requestClose:()=>Pe(n,o),onTransitionEnd:g=>{r&&g.target===u&&g.propertyName==="opacity"&&d()},update(g){o=g.onDismiss,g.state!==n&&(p(),n=g.state,p=Ce(n,f,!1))},destroy(){l&&(clearTimeout(l),l=null),p(),u.removeEventListener("cancel",m),i&&(nt(),i=!1),u.removeEventListener("keydown",s),a==null||a.focus(),a=null}}}function Ll(e={}){let{color:t="neutral",open:n=!1,labelledBy:o,describedBy:a,onDismiss:r}=e,i=ot(n);return N(L({_onInsert:l=>{l.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')}},V("dialog",Pl,{state:i,onDismiss:r})),{ariaLabelledby:o,ariaDescribedby:a,onClick:(l,u)=>{var m;if(l.target!==u.domElement)return;let d=u.domElement.getBoundingClientRect();l.clientX>=d.left&&l.clientX<=d.right&&l.clientY>=d.top&&l.clientY<=d.bottom||(m=u.getBehavior("dialog"))==null||m.requestClose()},onTransitionEnd:(l,u)=>{var d;return(d=u.getBehavior("dialog"))==null?void 0:d.onTransitionEnd(l)},style:{opacity:"0",visibility:"hidden",pointerEvents:"none",transition:"opacity 200ms ease",fontSize:l=>x(l,"inherit"),color:l=>c(l,"shift-10",t),backgroundColor:l=>c(l,"inherit",t),border:"none",borderRadius:l=>h(y(l)*2),padding:l=>h(y(l)*3),boxShadow:W("high"),"&::backdrop":{backgroundColor:l=>c(l,"shift-2","neutral"),opacity:.75}}})}function Ml(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:h(2),fontSize:o=>x(o,"inherit"),backgroundColor:o=>c(o),color:o=>c(o,"text",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>c(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>c(o,"border-strong",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Wo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},wr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},rt=e=>e==="left"||e==="right";function Er(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function Il(e,t){let{state:n,onDismiss:o,placement:a,size:r}=t,i=e.domElement;i.setAttribute("aria-modal","true");let l=v=>{v.preventDefault(),Pe(n,o)};i.addEventListener("cancel",l);let u=(v,k)=>{let w=(v==="start"||v==="end")&&(i.ownerDocument.documentElement.dir==="rtl"||i.ownerDocument.dir==="rtl"),O=Er(v,w),D=k!=null?k:rt(O)?h(80):h(64);return i.style.margin=wr[O],i.style.width=rt(O)?D:"100dvw",i.style.height=rt(O)?"100dvh":D,O},d=u(a,r),s=!1,m=!1,f=null,p=()=>{f=null,s&&(s=!1,typeof i.close=="function"&&i.close(),i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="none",m&&(nt(),m=!1))},g=v=>{v.target===i&&v.propertyName==="transform"&&p()};i.addEventListener("transitionend",g);let S=v=>{if(v)s=!1,f&&(clearTimeout(f),f=null),i.style.visibility="visible",i.style.pointerEvents="auto",i.style.display="",typeof i.showModal=="function"&&!i.open&&i.showModal(),m||(Qt(),m=!0),requestAnimationFrame(()=>{i.style.transform="translate(0, 0)"});else{if(s=!0,i.style.transform=Wo[d],!i.open){p();return}f=setTimeout(p,350)}},E=Ce(n,S);return{requestClose:()=>Pe(n,o),update(v){o=v.onDismiss,v.state!==n&&(E(),n=v.state,E=Ce(n,S,!1)),(v.placement!==a||v.size!==r)&&(a=v.placement,r=v.size,d=u(a,r),n.get()||(i.style.transform=Wo[d]))},destroy(){f&&(clearTimeout(f),f=null),E(),i.removeEventListener("cancel",l),i.removeEventListener("transitionend",g),m&&(nt(),m=!1)}}}function Rl(e={}){let{color:t="neutral",open:n=!1,onDismiss:o,placement:a="end",size:r}=e,i=ot(n),l=Er(a,!1),u=rt(l)?h(80):h(64),d=r!=null?r:u;return N(L({_onInsert:s=>{s.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')}},V("drawer",Il,{state:i,onDismiss:o,placement:a,size:r})),{onClick:(s,m)=>{var g;if(s.target!==m.domElement)return;let f=m.domElement.getBoundingClientRect();s.clientX>=f.left&&s.clientX<=f.right&&s.clientY>=f.top&&s.clientY<=f.bottom||(g=m.getBehavior("drawer"))==null||g.requestClose()},style:{transform:Wo[l],visibility:"hidden",pointerEvents:"none",transition:"transform 0.25s ease",fontSize:s=>x(s,"inherit"),color:s=>c(s,"shift-10",t),backgroundColor:s=>c(s,"inherit",t),border:"none",padding:s=>h(y(s)*3),margin:wr[l],width:rt(l)?d:"100dvw",height:rt(l)?"100dvh":d,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:W("high"),"&::backdrop":{backgroundColor:s=>c(s,"shift-2","neutral"),opacity:.75}}})}function $l(e={}){var n;let t=b((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=>c(o,"shift-10",t.get(o))}}}function zl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:h(3),paddingBlock:h(12),paddingInline:h(6),textAlign:"center",color:o=>c(o,"muted",t.get(o)),"& > :first-child":{color:o=>c(o,"shift-5",t.get(o)),opacity:.9},"& > :nth-child(2)":{color:o=>c(o,"text",t.get(o))}}}}var Ko="errorBoundaryOriginal";function Nl(e){var n;let t=e.getMetadata(Ko);if(typeof t=="function"){(n=e._childrenRelease)==null||n.call(e),e._setupFunctionChildren(t);return}if(t!=null){e.children.update(Array.isArray(t)?t:[t]);return}e.children.update([])}function Al(e={}){return{_onSchedule:(t,n)=>{t.getMetadata(Ko)===void 0&&t.setMetadata(Ko,n[t.tagName])},_onError:(t,n)=>{var r,i;(r=e.onError)==null||r.call(e,n);let o=()=>Nl(t),a=typeof e.fallback=="function"?e.fallback(n,o):(i=e.fallback)!=null?i:{div:"An error occurred."};t.children.update([a])}}}var Bl={small:8,medium:10,large:14};function Vl(e={}){var o,a;let t=b((o=e.color)!=null?o:"primary","color"),n=h(Bl[(a=e.size)!=null?a:"medium"]);return{type:"button",_onInsert:r=>{r.tagName!=="button"&&console.warn('"fab" patch must use button tag')},_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"],style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:n,height:n,borderRadius:"50%",fontSize:r=>x(r,"inherit"),backgroundColor:r=>c(r,"shift-13",t.get(r)),color:r=>c(r,"shift-0","neutral"),boxShadow:W("low"),transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:r=>c(r,"shift-14",t.get(r)),boxShadow:W("medium")},"&:active:not([disabled])":{backgroundColor:r=>c(r,"shift-15",t.get(r)),boxShadow:W("low")},"&:focus-visible":{boxShadow:r=>`${W("medium")}, ${_(r,t.get(r))}`},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Hl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:h(2),marginInline:0,marginTop:h(3),marginBottom:h(3),color:o=>c(o,"text",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:h(2)},"& figcaption":{fontSize:o=>x(o,"decrease-1"),color:o=>c(o,"muted",t.get(o)),lineHeight:1.45}}}}function jl(e={}){var a;let{layout:t="horizontal"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=t==="vertical";return{_onInsert:r=>{r.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},_doctorDisable:"inline-typography",style:{margin:0,paddingInline:r=>h(y(r)*3),paddingBlock:r=>h(y(r)*3),border:"none",borderRadius:r=>h(y(r)*2),fontSize:r=>x(r,"inherit"),backgroundColor:r=>c(r,"inherit",n.get(r)),color:r=>c(r,"text",n.get(r)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:h(4),rowGap:h(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:r=>x(r,"inherit"),fontWeight:600,paddingBlock:r=>h(y(r)*1),borderRadius:r=>h(y(r)*2),color:r=>c(r,"text",n.get(r)),backgroundColor:r=>c(r,"inherit",n.get(r))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:r=>o?0:h(y(r)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${h(2)} * -1)`,fontSize:r=>x(r,"decrease-1"),color:r=>c(r,"text",n.get(r))}}}}function Fl(e={}){let{columns:t=1,gap:n=4,align:o}=e;return{style:L({display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, minmax(0, 1fr))`:t,gap:a=>h(y(a)*n)},o?{alignItems:o}:{})}}var Wl={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Kl(e={}){var o;let t=b((o=e.color)!=null?o:"neutral","color"),n=e.size;return{_onInsert:a=>{["h1","h2","h3","h4","h5","h6"].includes(a.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:a=>c(a,"shift-11",t.get(a)),marginTop:0,marginBottom:h(2),fontSize:a=>{if(n!==void 0)return x(a,n);let r=Wl[a.elementNode.tagName]||"inherit";return x(a,r)}}}}function ql(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},dataTone:"shift-3",style:{border:0,height:"1px",marginInline:0,marginTop:h(3),marginBottom:h(3),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o))}}}function Ul(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:h(4),height:h(4),flexShrink:"0",fontSize:o=>x(o),backgroundColor:"transparent",color:o=>c(o,"text",t.get(o))}}}function Gl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:h(2),backgroundColor:o=>c(o,"inherit",t.get(o)),color:o=>c(o,"text",t.get(o))}}}function Yl(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"checkbox",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:r=>x(r,"inherit"),color:r=>c(r,"text",t.get(r)),display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:h(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>c(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`,backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:r=>`${h(.5)} solid ${c(r,"inherit",n.get(r))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`,backgroundColor:r=>c(r,"shift-3",n.get(r))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:h(1.5),boxShadow:r=>_(r,n.get(r))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>c(r,"shift-4","neutral"),pointerEvents:"none"}}}}function Xl(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{type:"color",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag')},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>x(o,"inherit"),color:o=>c(o,"text",t.get(o)),paddingBlock:o=>h(y(o)*1),paddingInline:o=>h(y(o)*1),blockSize:o=>h(6+y(o)*2),inlineSize:o=>h(6+y(o)*2),backgroundColor:"transparent",transition:"box-shadow 140ms ease",borderRadius:o=>h(y(o)*1.5),"&:focus-visible":{boxShadow:o=>_(o,t.get(o))},"&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>h(y(o)*1.5)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>c(o,"shift-2","neutral"),outline:o=>`1px solid ${c(o,"border-strong","neutral")}`}}}}function Jl(e={}){var a,r;let{mode:t="datetime-local"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag')},style:{fontFamily:"inherit",fontSize:i=>x(i,"inherit"),lineHeight:"inherit",color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,borderRadius:i=>h(y(i)*1.5),paddingInline:i=>h(y(i)*3),height:i=>h(6+y(i)*2),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>_(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>c(i,"muted","neutral"),backgroundColor:i=>c(i,"shift-2","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`},"&:invalid":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`}}}}function Zl(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"file",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag')},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:r=>x(r,"inherit"),lineHeight:"inherit",color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,borderRadius:r=>h(y(r)*1.5),height:r=>h(6+y(r)*2),paddingInline:r=>h(y(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-file-upload-button":{marginTop:r=>h(y(r)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:h(1),height:h(6),paddingInline:h(2),cursor:"pointer",color:r=>c(r,"shift-11",t.get(r)),backgroundColor:r=>c(r,"surface",t.get(r))},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>_(r,n.get(r))},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:r=>c(r,"muted","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`,backgroundColor:r=>c(r,"surface","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:r=>c(r,"muted","neutral"),backgroundColor:r=>c(r,"shift-3","neutral")}}}}function Ql(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"number",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag')},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:h(10),paddingInlineStart:r=>h(y(r)*3),paddingInlineEnd:r=>h(y(r)*1.5),paddingBlock:r=>h(y(r)*1),borderRadius:r=>h(y(r)*1.5),fontSize:r=>x(r,"inherit"),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>_(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:r=>c(r,"shift-2","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`,color:r=>c(r,"muted","neutral")}}}}function es(){return{role:"group",ariaLabel:"One-time password",style:{display:"flex",alignItems:"center",gap:h(2),"& > *":{minWidth:`${h(9)}!important`}},_onMount:e=>{let t=e.domElement,n=()=>Array.from(t.querySelectorAll("input")),o=i=>{let l=n(),u=i.target,d=l.indexOf(u);u.value&&d<l.length-1&&l[d+1].focus()},a=i=>{let l=n(),u=i.target,d=l.indexOf(u);i.key==="Backspace"&&!u.value&&d>0&&l[d-1].focus(),i.key==="ArrowLeft"&&d>0&&l[d-1].focus(),i.key==="ArrowRight"&&d<l.length-1&&l[d+1].focus()},r=i=>{var f,p,g;i.preventDefault();let l=(p=(f=i.clipboardData)==null?void 0:f.getData("text"))!=null?p:"",u=n(),d=u.indexOf(i.target),s=d===-1?0:d;[...l].forEach((S,E)=>{let v=u[s+E];v&&(v.value=S,v.dispatchEvent(new Event("input",{bubbles:!0})),v.dispatchEvent(new Event("change",{bubbles:!0})))});let m=Math.min(s+l.length-1,u.length-1);(g=u[m])==null||g.focus()};t.addEventListener("input",o),t.addEventListener("keydown",a),t.addEventListener("paste",r),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",a),t.removeEventListener("paste",r)})}}}var ts='<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>',os='<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>',ns=["name","value","onInput","disabled","required"];function kr(e){if(e!=null)return typeof e=="function"?e:le(e)?t=>e.get(t):e}function rs(e={}){var r,i;let t=b((r=e.color)!=null?r:"neutral","color"),n=b((i=e.accentColor)!=null?i:"primary","accentColor"),o=b(!1),a={};return{_onInsert:l=>{l.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onSchedule:(l,u)=>{let d=u;for(let s of ns)d[s]!==void 0&&(a[s]=d[s],delete d[s])},_onInit:l=>{var S,E,v,k,T,w,O;let u=(S=e.name)!=null?S:a.name,d=kr((E=e.value)!=null?E:a.value),s=(v=e.onInput)!=null?v:a.onInput,m=kr((k=e.disabled)!=null?k:a.disabled),f=(T=e.required)!=null?T:a.required,p=N(L(L(L(L(L({input:null,type:D=>o.get(D)?"text":"password",ariaLabel:(w=e.ariaLabel)!=null?w:"Password",autocomplete:(O=e.autocomplete)!=null?O:"current-password"},u!=null?{name:u}:{}),d!=null?{value:d}:{}),s!=null?{onInput:s}:{}),m!=null?{disabled:m}:{}),f!=null?{required:f}:{}),{style:{flex:1,minWidth:0,border:"none",outline:"none",backgroundColor:"transparent",padding:0,margin:0,font:"inherit",color:"inherit"}}),g={button:D=>Ie(o.get(D)?os:ts),type:"button",ariaLabel:D=>o.get(D)?"Hide password":"Show password",onClick:()=>o.set(!o.get()),style:{background:"none",border:"none",padding:0,margin:0,cursor:"pointer",color:"inherit",display:"flex",alignItems:"center",flexShrink:0,opacity:.6}};l.children.insert(p),l.children.insert(g)},style:{display:"flex",alignItems:"center",gap:l=>h(y(l)*1),paddingBlock:l=>h(y(l)*1),paddingInline:l=>h(y(l)*3),borderRadius:l=>h(y(l)*1.5),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${c(l,"border-strong",t.get(l))}`,color:l=>c(l,"text",t.get(l)),backgroundColor:l=>c(l,"inherit",t.get(l)),fontSize:l=>x(l,"inherit"),transition:"outline-color 140ms ease, box-shadow 140ms ease","&:hover:not(:has([disabled])):not(:focus-within)":{outline:l=>`1px solid ${c(l,"shift-5",n.get(l))}`},"&:focus-within":{boxShadow:l=>_(l,n.get(l))}}}}function is(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"radio",_onInsert:r=>{if(r.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:r=>x(r,"inherit"),color:r=>c(r,"text",t.get(r)),appearance:"none",display:"inline-flex",position:"relative",width:h(6),height:h(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,color:r=>c(r,"text",t.get(r)),width:h(4),height:h(4)},"&:hover::before":{backgroundColor:r=>c(r,"hover",t.get(r))},"&:checked::before":{outline:r=>`1px solid ${c(r,"shift-6",n.get(r))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:r=>c(r,"shift-8",n.get(r))},"&:checked:hover:not([disabled])::before":{backgroundColor:r=>c(r,"shift-7",n.get(r))},"&:focus-visible":{borderRadius:"50%",boxShadow:r=>_(r,n.get(r))},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:r=>c(r,"shift-4","neutral"),pointerEvents:"none"}}}}function as(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"range",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:h(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:h(1.5),borderRadius:h(999),backgroundColor:r=>c(r,"shift-3",t.get(r))},"&::-webkit-slider-thumb":{appearance:"none",width:h(4),height:h(4),borderRadius:h(999),border:"none",marginTop:`calc((${h(1.5)} - ${h(4)}) / 2)`,backgroundColor:r=>c(r,"shift-9",n.get(r))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:r=>c(r,"shift-10",n.get(r))},borderRadius:h(2),transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>_(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ls(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{type:"search",_onInsert:r=>{r.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag')},style:{fontFamily:"inherit",fontSize:r=>x(r,"inherit"),lineHeight:"inherit",color:r=>c(r,"text",t.get(r)),backgroundColor:r=>c(r,"inherit",t.get(r)),border:"none",outlineOffset:"-1px",outline:r=>`1px solid ${c(r,"border-strong",t.get(r))}`,borderRadius:r=>h(y(r)*1.5),minWidth:h(32),paddingInline:r=>h(y(r)*3),paddingBlock:r=>h(y(r)*1),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:r=>c(r,"shift-7",t.get(r))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true])":{outline:r=>`1px solid ${c(r,"shift-5",n.get(r))}`},"&:focus-visible":{boxShadow:r=>_(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:r=>c(r,"muted","neutral"),backgroundColor:r=>c(r,"shift-2","neutral"),outline:r=>`1px solid ${c(r,"border-strong","neutral")}`}}}}function ss(e={}){var n;let t=b((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"),backgroundColor:o=>c(o,"inherit"),color:o=>c(o,"text"),appearance:"none",position:"relative",display:"inline-flex",width:h(9),height:h(6),cursor:"pointer",margin:"0",paddingBlock:h(1),transition:"box-shadow 140ms ease",borderRadius:h(999),"&:focus-visible":{boxShadow:o=>_(o,t.get(o))},"&:checked":{"&::before":{backgroundColor:o=>c(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${h(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:h(3),height:h(3),borderRadius:h(999),left:h(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>c(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:h(999),display:"inline-block",fontSize:o=>x(o,"inherit"),lineHeight:1,backgroundColor:o=>c(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function cs(e={}){var a,r;let{type:t="text"}=e,n=b((a=e.color)!=null?a:"neutral","color"),o=b((r=e.accentColor)!=null?r:"primary","accentColor");return{type:t,_onInsert:i=>{i.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type')},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:h(10),paddingInline:i=>h(y(i)*3),paddingBlock:i=>h(y(i)*1),borderRadius:i=>h(y(i)*1.5),fontSize:i=>x(i,"inherit"),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",n.get(i))}`,color:i=>c(i,"text",n.get(i)),backgroundColor:i=>c(i,"inherit",n.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>c(i,"shift-7")},"&:not(:placeholder-shown)":{color:i=>c(i,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",o.get(i))}`},"&:focus-visible":{boxShadow:i=>_(i,o.get(i))},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:i=>c(i,"shift-2","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`,color:i=>c(i,"muted","neutral")},"&:invalid:not(:placeholder-shown)":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`},"&[data-status=error]":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","error")}`},"&[data-status=warning]":{outline:i=>`${h(.5)} solid ${c(i,"shift-6","warning")}`}}}}function us(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),paddingBlock:o=>h(y(o)*(.5/1.5)),paddingInline:o=>h(y(o)*(1.5/1.5)),borderRadius:o=>h(y(o)*(1/1.5)),outline:o=>`1px solid ${c(o,"border-strong",t.get(o))}`}}}function ms(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:h(2),fontSize:r=>x(r,"inherit"),color:r=>c(r,"text",t.get(r)),cursor:"pointer","&:focus-within":{color:r=>c(r,"shift-10",n.get(r))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:r=>c(r,"muted","neutral")}}}}function ds(e={}){var o,a;let t=b((o=e.color)!=null?o:"primary","color"),n=b((a=e.accentColor)!=null?a:"secondary","accentColor");return{_onInsert:r=>{r.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},onClick:(r,i)=>{let l=i.domElement;(l!=null&&l.hasAttribute("disabled")||(l==null?void 0:l.getAttribute("aria-disabled"))==="true")&&r.preventDefault()},style:{fontSize:r=>x(r,"inherit"),backgroundColor:r=>c(r),color:r=>c(r,"shift-13",t.get(r)),textDecoration:"none","&:visited":{color:r=>c(r,"shift-13",n.get(r))},"&:hover:not([disabled])":{color:r=>c(r,"shift-14",t.get(r)),textDecoration:"underline"},borderRadius:h(1),outline:"none",transition:"color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>_(r,n.get(r))},"&[disabled]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:r=>c(r,"muted","neutral")}}}}var hs={small:{block:.5,inline:2},medium:{block:1,inline:3},large:{block:1.5,inline:4}},fs={small:.5,medium:1,large:1.5};function ps(e={}){var l,u,d;let t=(l=e.variant)!=null?l:"outline",n=b((u=e.color)!=null?u:t==="ghost"?"neutral":"primary","color"),o=(d=e.size)!=null?d:"medium",a=Ze[o];if(t==="ghost"){let s=fs[o];return{_onInsert:m=>{m.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:m=>x(m,a),textDecoration:"none",paddingBlock:m=>h(y(m)*s),paddingInline:m=>h(y(m)*s),borderRadius:m=>h(y(m)*1.5),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:m=>h(y(m)*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:m=>c(m,"text",n.get(m)),"&:hover:not([aria-disabled=true])":{color:m=>c(m,"text",n.get(m)),backgroundColor:m=>c(m,"hover",n.get(m)),textDecoration:"none"},"&:active:not([aria-disabled=true])":{color:m=>c(m,"text",n.get(m)),backgroundColor:m=>c(m,"increase-2",n.get(m))},"&:focus-visible":{boxShadow:m=>_(m,n.get(m))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",color:m=>c(m,"border-strong","neutral")}}}}let r=t==="solid",i=hs[o];return N(L({_onInsert:s=>{s.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')}},r?{_doctorDisable:["low-contrast","color-shift-minimum","tone-background-inherit"]}:{}),{style:{fontSize:s=>x(s,a),textDecoration:"none",paddingBlock:s=>h(y(s)*i.block),paddingInline:s=>h(y(s)*i.inline),borderRadius:s=>h(y(s)*1.5),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:s=>h(y(s)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:r?"none":s=>`1px solid ${c(s,"border-strong",n.get(s))}`,color:s=>r?c(s,"shift-0","neutral"):c(s,"shift-13",n.get(s)),backgroundColor:s=>r?c(s,"shift-13",n.get(s)):c(s,"inherit",n.get(s)),transition:"background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease","&:hover:not([aria-disabled=true])":{textDecoration:"none",color:s=>r?c(s,"shift-0","neutral"):c(s,"shift-14",n.get(s)),backgroundColor:s=>r?c(s,"shift-14",n.get(s)):c(s,"hover",n.get(s))},"&:active:not([aria-disabled=true])":{backgroundColor:s=>r?c(s,"shift-15",n.get(s)):c(s,"increase-2",n.get(s))},"&:focus-visible":{boxShadow:s=>_(s,n.get(s))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:s=>c(s,"shift-2","neutral"),outline:s=>`1px solid ${c(s,"border-strong","neutral")}`,color:s=>c(s,"muted","neutral")}}})}function gs(e={}){var n;let t=(n=e.color)!=null?n:"neutral";return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",backgroundColor:o=>c(o,"inherit",t),color:o=>c(o,"text",t)}}}function ys(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:n=>h(y(n)*2),paddingBlock:n=>h(t?1:y(n)*2),paddingInline:n=>h(y(n)*3),fontSize:n=>x(n,"inherit"),color:n=>c(n,"text")}}}function bs(e={}){var a,r;let t=b((a=e.color)!=null?a:"neutral","color"),n=(r=e.accentColor)!=null?r:"primary",{dense:o=!1}=e;return{style:{cursor:"pointer",appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:i=>h(y(i)*2),paddingBlock:i=>h(o?1:y(i)*2),paddingInline:i=>h(y(i)*3),fontSize:i=>x(i,"inherit"),color:i=>c(i,"text",t.get(i)),borderRadius:i=>h(y(i)*1.5),transition:"background-color 150ms ease, box-shadow 140ms ease","&:hover:not([disabled])":{backgroundColor:i=>c(i,"hover",t.get(i))},"&:active:not([disabled])":{backgroundColor:i=>c(i,"increase-2",t.get(i))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:i=>c(i,"shift-3",n),color:i=>c(i,"shift-12",n)},"&:focus-visible":{boxShadow:i=>_(i,n)},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function vs(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),height:o=>h(y(o)*(6/1.5)),borderRadius:o=>h(y(o)*(1/1.5)),paddingInline:o=>h(y(o)*(1.5/1.5))}}}function Ss(e={items:[]}){var s;let{items:t=[],selectable:n=!0,color:o="neutral",accentColor:a="primary"}=e,r=b((s=e.activeKey)!=null?s:null),i=e.activeKey!==void 0,l=(m,f)=>{let p=m.nodeId;return f.items.map((g,S)=>{var v;let E=(v=g.key)!=null?v:S;return N(L({button:typeof g.label=="string"?[{span:g.label}]:[g.label],_key:E,type:"button",id:`menuitem${p}${E}`,role:"menuitem"},f.selectable?{ariaCurrent:k=>f.activeKey.get(k)===E||void 0}:{}),{onClick:()=>{var k;f.selectable&&f.activeKey.set(E),(k=g.onClick)==null||k.call(g)},onKeyDown:k=>{var I;let T=k.key;if(T==="Enter"||T===" "){k.preventDefault(),k.target.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(T))return;k.preventDefault();let w=f.items.map((F,A)=>{var B;return(B=F.key)!=null?B:A}),O=w.indexOf(E),D=O;T==="ArrowDown"?D=(O+1)%w.length:T==="ArrowUp"?D=(O-1+w.length)%w.length:T==="Home"?D=0:T==="End"&&(D=w.length-1),(I=document.getElementById(`menuitem${p}${w[D]}`))==null||I.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:h(2),width:"100%",fontSize:k=>x(k,"inherit"),height:k=>h(6+y(k)*2),paddingInline:k=>h(y(k)*3),border:"none",outline:"none",color:k=>c(k,"text",f.color),backgroundColor:k=>c(k,"inherit",f.color),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:k=>c(k,"hover",f.color)},"&[aria-current=true]":{backgroundColor:k=>c(k,"shift-3",f.accentColor),color:k=>c(k,"shift-13",f.accentColor)},"&:focus-visible":{boxShadow:k=>_(k,f.accentColor)}}})})},u=(m,f)=>{let p=f;return{update(g){g.activeKey!==p.activeKey&&!g.activeKeyIsCallerOwned&&g.activeKey.set(p.activeKey.get()),p=g,p.items.length!==0&&m.children.update(l(m,p))}}},d={items:t,activeKey:r,activeKeyIsCallerOwned:i,selectable:n,color:o,accentColor:a};return N(L({role:"menu",dataTone:"shift-0",_onSchedule:(m,f)=>{t.length!==0&&(f[m.tagName]=l(m,d))}},V("menu",u,d)),{style:{display:"flex",flexDirection:"column",paddingBlock:m=>h(y(m)*2),paddingInline:m=>h(y(m)*2),fontSize:m=>x(m,"inherit"),backgroundColor:m=>c(m,"inherit",o),color:m=>c(m,"text",o),borderRadius:m=>h(y(m)*2),outline:m=>`1px solid ${c(m,"border-strong",o)}`,outlineOffset:"-1px",boxShadow:W("medium")}})}var Cr=e=>!!e&&typeof e.get=="function"&&e._isState===!0,xe=e=>{let t={},n=[];for(let o in e){let a=e[o];o==="x"?n.push(`translateX(${typeof a=="number"?`${a}px`:a})`):o==="y"?n.push(`translateY(${typeof a=="number"?`${a}px`:a})`):o==="scale"?n.push(`scale(${a})`):o==="rotate"?n.push(`rotate(${typeof a=="number"?`${a}deg`:a})`):t[o]=a}return n.length&&(t.transform=n.join(" ")),t};function qo(e={}){var t,n,o,a;return{duration:(t=e.duration)!=null?t:300,delay:(n=e.delay)!=null?n:0,easing:(o=e.easing)!=null?o:"ease",iterations:(a=e.iterations)!=null?a:1,fill:"both"}}function Uo(){if(typeof matchMedia!="function")return!1;try{return matchMedia("(prefers-reduced-motion: reduce)").matches}catch(e){return!1}}function xs(e,t){let n=e.domElement,o=t,a,r=l=>{a==null||a(),a=void 0,!(!n||!Cr(l))&&(a=l.addListener(u=>{Uo()?Object.assign(n.style,xe(u)):typeof n.animate=="function"&&n.animate([xe(u)],qo(o.transition))}))},i=(l,u)=>{if(!n)return;let d=Cr(l.animate)?l.animate.get():l.animate;if(Uo()){d?Object.assign(n.style,xe(d)):u==="enter"&&l.initial&&Object.assign(n.style,xe(l.initial));return}if(typeof n.animate=="function")if(d){let s=u==="enter"&&l.initial?[xe(l.initial),xe(d)]:[xe(d)];n.animate(s,qo(l.transition))}else u==="enter"&&l.initial&&Object.assign(n.style,xe(l.initial))};return i(t,"enter"),r(t.animate),{play:i,getExit:()=>o.exit,getTransition:()=>o.transition,update(l){o=l,i(l,"update"),r(l.animate)},destroy(){a==null||a()}}}function ws(e={}){return N(L({},V("motion",(t,n)=>xs(t,n),e)),{_onBeforeRemove:(t,n)=>{var i,l;let o=t.domElement,a=t.getBehavior("motion"),r=(i=a==null?void 0:a.getExit())!=null?i:e.exit;if(!o||!r||typeof o.animate!="function")return n();if(Uo())return Object.assign(o.style,xe(r)),n();o.animate([xe(r)],qo((l=a==null?void 0:a.getTransition())!=null?l:e.transition)).finished.then(n,n)}})}function Es(e={}){var n;let t=b((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=>c(o),color:o=>c(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:h(3),listStyleType:"decimal",listStylePosition:"outside"}}}function ks(e,t){if(t<=7)return Array.from({length:t},(r,i)=>i+1);let n=[1];e>3&&n.push("...");let o=Math.max(2,e-1),a=Math.min(t-1,e+1);for(let r=o;r<=a;r++)n.push(r);return e<t-2&&n.push("..."),n.push(t),n}function Cs(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function Tr(e,t){let n=e.getMetadata("paginationTotal");return n||(n=b(t),e.setMetadata("paginationTotal",n)),n}function Ts(e){let{total:t,color:n="neutral",accentColor:o="primary"}=e,a={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:i=>h(6+y(i)*2),height:i=>h(6+y(i)*2),paddingInline:i=>h(y(i)*2),borderRadius:i=>h(y(i)*1.5),border:"none",cursor:"pointer",fontSize:i=>x(i,"inherit"),backgroundColor:"transparent",color:i=>c(i,"shift-13",n),transition:"background-color 140ms ease, box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled])":{color:i=>c(i,"shift-13",n),backgroundColor:i=>c(i,"hover",n)},"&:focus-visible":{boxShadow:i=>_(i,o)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},r=N(L({},a),{backgroundColor:i=>c(i,"shift-13",o),color:i=>c(i,"shift-0","neutral"),fontWeight:"bold",cursor:"default","&:hover:not([disabled])":{backgroundColor:i=>c(i,"shift-13",o)}});return N(L({role:"navigation",ariaLabel:"Pagination",_doctorDisable:"inline-typography",_onInsert:i=>{i.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:i=>{let l=Cs(i,"paginationPage",e.value,1),u=Tr(i,t),d={div:s=>{let m=l.get(s),f=u.get(s),p=[];p.push({button:"\u2039",_key:"prev",type:"button",ariaLabel:"Previous page",disabled:m<=1,onClick:()=>m>1&&l.set(m-1),style:a});let g=0;for(let S of ks(m,f))if(S==="...")p.push({span:"\u2026",_key:`ellipsis-${g++}`,ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:E=>h(y(E)*2),color:E=>c(E,"shift-7",n)}});else{let E=S===m;p.push({button:String(S),_key:`page-${S}`,type:"button",ariaLabel:`Page ${S}`,ariaCurrent:E?"page":void 0,disabled:E,onClick:()=>l.set(S),style:E?r:a})}return p.push({button:"\u203A",_key:"next",type:"button",ariaLabel:"Next page",disabled:m>=f,onClick:()=>m<f&&l.set(m+1),style:a}),p},style:{display:"flex",alignItems:"center",gap:h(1)}};i.children.insert(d)}},V("pagination-total",i=>({update(l){Tr(i,l.total).set(l.total)}}),{total:t})),{style:{display:"inline-flex"}})}function _s(e={}){var a;let{padding:t=4,divider:n=!1}=e,o=b((a=e.color)!=null?a:"neutral","color");return{style:L({padding:r=>h(y(r)*t)},n?{borderBottom:r=>`1px solid ${c(r,"border",o.get(r))}`}:{})}}function Ds(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Os(e){if(typeof e.dataTone=="string")return!0;let n=e.$;return n?n.some(o=>o!=null&&typeof o.dataTone=="string"):!1}function Ps(e){var m;let{open:t=!1,placement:n="bottom",openOn:o="click"}=e,a=b(t),r=b(n),{show:i,hide:l,anchorPartial:u}=Se({kind:"popover",open:a,onDismiss:e.onDismiss,placement:r,content:e.content,keepOpenOnContentHover:o==="hover"}),d={role:"dialog",dataTone:"shift-0",style:{backgroundColor:f=>c(f,"inherit"),color:f=>c(f,"text"),borderRadius:f=>h(y(f)*2),outline:f=>`1px solid ${c(f,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};return Os(e.content)||((m=e.content).$||(m.$=[]),e.content.$.push(d)),K(u,{ariaHaspopup:"dialog",ariaExpanded:f=>a.get(f),ariaControls:f=>f!=null&&f.elementNode?de("popover",f.elementNode):void 0,onMouseEnter:(f,p)=>o==="hover"&&i(p),onMouseLeave:(f,p)=>o==="hover"&&l(p),onClick:(f,p)=>{o==="click"&&(a.get()?l(p):i(p))},onKeyDown:(f,p)=>{f.key==="Escape"&&a.get()&&l(p)},onFocus:(f,p)=>o==="hover"&&i(p),onBlur:(f,p)=>{if(o!=="hover")return;let g=f.relatedTarget,E=p.getRoot().domElement.querySelector(`#${de("popover",p)}`);g&&(E!=null&&E.contains(g))||l(p)}}),u}function Go(e={}){let{placement:t="bottom-end",color:n="neutral",sideOffset:o=h(6),bordered:a=!0}=e,r=b(t),i={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},l=s=>{var m;return(m=i[r.get(s)])!=null?m:i["bottom-end"]},u=s=>s.includes("start")?o:s.includes("end")?"auto":"50%",d=s=>s.includes("end")?o:s.includes("start")?"auto":"50%";return{style:{fontSize:s=>x(s),backgroundColor:s=>c(s),color:s=>c(s,"text",n),position:"relative","&::after":{content:'""',position:"absolute",width:h(1.5),height:h(1.5),backgroundColor:s=>c(s,"inherit",n),borderWidth:a?"1px":0,borderColor:s=>c(s,"border-strong",n),borderTopStyle:s=>{let m=l(s);return m.includes("top")||m.includes("right")?"solid":"none"},borderBottomStyle:s=>{let m=l(s);return m.includes("bottom")||m.includes("left")?"solid":"none"},borderLeftStyle:s=>{let m=l(s);return m.includes("top")||m.includes("left")?"solid":"none"},borderRightStyle:s=>{let m=l(s);return m.includes("bottom")||m.includes("right")?"solid":"none"},top:s=>{let m=l(s);return m.includes("top")?0:m.includes("bottom")?"auto":u(m)},right:s=>{let m=l(s);return m.includes("right")?0:m.includes("left")?"auto":d(m)},bottom:s=>{let m=l(s);return m.includes("bottom")?0:m.includes("top")?"auto":d(m)},left:s=>{let m=l(s);return m.includes("left")?0:m.includes("right")?"auto":u(m)},transform:s=>{let m=l(s),f=m.includes("right")||m.includes("end")&&!m.includes("left")?"50%":"-50%",p=m.includes("bottom")||m.includes("end")&&!m.includes("top")?"50%":"-50%";return`translate(${f},${p}) rotate(45deg)`}}}}}function Ls(e={}){var n;let t=b((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=>c(o,"text",t.get(o)),backgroundColor:o=>c(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>h(y(o)*2),paddingInline:o=>h(y(o)*3),borderRadius:o=>h(y(o)*2)}}}function Ms(e={}){var o,a;let t=b((o=e.color)!=null?o:"neutral","color"),n=b((a=e.accentColor)!=null?a:"primary","accentColor");return{_onInsert:r=>{r.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},dataTone:"shift-3",style:{appearance:"none",width:"100%",height:h(2),border:0,borderRadius:h(999),overflow:"hidden",backgroundColor:r=>c(r,"inherit",t.get(r)),color:r=>c(r,"text",t.get(r)),"&::-webkit-progress-bar":{backgroundColor:r=>c(r,"inherit",t.get(r)),borderRadius:h(999)},"&::-webkit-progress-value":{backgroundColor:r=>c(r,"shift-9",n.get(r)),borderRadius:h(999),transition:"width 220ms ease"}}}}var Is='<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>',Rs='<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 _r(e,t){var n,o,a;e.onChange=t.onChange,e.readOnly=(n=t.readOnly)!=null?n:!1,e.max=(o=t.max)!=null?o:5,e.color=(a=t.color)!=null?a:"warning",le(t.value)?t.value!==e.valueState&&e.valueState.set(t.value.get()):t.value!==void 0&&e.valueState.set(t.value)}function $s(e,t,n,o){let a=i=>{let l=o.get(i);return l>0?l:n.valueState.get(i)},r={button:i=>Ie(t<=a(i)?Is:Rs),_key:t,type:"button",ariaLabel:`${t} star${t>1?"s":""}`,onClick:()=>{var l;if(n.readOnly)return;let i=t===n.valueState.get()?0:t;n.valueState.set(i),(l=n.onChange)==null||l.call(n,i),o.set(0)},onMouseEnter:()=>{n.readOnly||o.set(t)},onMouseLeave:()=>o.set(0),onKeyDown:i=>{var s,m,f;if(n.readOnly)return;let l=n.valueState.get(),u=l;if(i.key==="ArrowRight"||i.key==="ArrowUp")u=Math.min(n.max,l+1),i.preventDefault();else if(i.key==="ArrowLeft"||i.key==="ArrowDown")u=Math.max(0,l-1),i.preventDefault();else return;n.valueState.set(u),(s=n.onChange)==null||s.call(n,u);let d=u>0?u-1:0;(f=(m=e.domElement)==null?void 0:m.children[d])==null||f.focus()},style:{background:"none",border:"none",outline:"none",borderRadius:h(1),padding:0,cursor:"inherit",color:"inherit",fontSize:"inherit",display:"flex",alignItems:"center",transition:"box-shadow 140ms ease","&:focus-visible":{boxShadow:i=>_(i,n.color)}}};e.children.insert(r)}function Yo(e,t,n){let o=e.children.items;for(;o.length>t.max;)e.children.remove(o[o.length-1]);for(let a=o.length+1;a<=t.max;a++)$s(e,a,t,n)}function zs(e={}){var o,a,r,i,l,u,d;let t={valueState:b((o=e.value)!=null?o:0),onChange:e.onChange,readOnly:(a=e.readOnly)!=null?a:!1,max:(r=e.max)!=null?r:5,color:(i=e.color)!=null?i:"warning"},n=b(0);return N(L({role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:h(.5),fontSize:s=>x(s,"increase-1"),cursor:t.readOnly?"default":"pointer",color:s=>c(s,"muted",t.color)}},V("rating",(s,m)=>(_r(t,m),Yo(s,t,n),{update(f){_r(t,f),Yo(s,t,n)}}),{value:e.value,max:(l=e.max)!=null?l:5,onChange:e.onChange,readOnly:(u=e.readOnly)!=null?u:!1,color:(d=e.color)!=null?d:"warning"})),{_onInit:s=>{Yo(s,t,n)}})}function Ns(e={}){var u,d,s;let{size:t=16,thickness:n=.25}=e,o=b((u=e.value)!=null?u:0,"value"),a=b((d=e.color)!=null?d:"primary","color"),r=b((s=e.trackColor)!=null?s:"neutral","trackColor"),i=Math.round((1-n)*100),l=`radial-gradient(circle closest-side, transparent ${i}%, black ${i}%)`;return{role:"progressbar",ariaValuenow:m=>String(Math.round(o.get(m))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:m=>{m.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:h(t),height:h(t),borderRadius:"50%",color:m=>c(m,"shift-9",a.get(m)),background:m=>`conic-gradient(from -90deg, ${c(m,"shift-9",a.get(m))} ${o.get(m)}%, ${c(m,"shift-3",r.get(m))} 0%)`,WebkitMask:l,mask:l}}}function Xo(e={}){let{gap:t=4,align:n="center",justify:o,wrap:a=!1,density:r=!0}=e;return{style:L(L({display:"flex",alignItems:n,gap:r?i=>h(y(i)*t):()=>h(t)},o?{justifyContent:o}:{}),a?{flexWrap:"wrap"}:{})}}function As(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{style:{overflow:"auto",color:o=>c(o,"text",t.get(o)),"&::-webkit-scrollbar":{width:h(2),height:h(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>c(o,"shift-5",t.get(o)),borderRadius:h(999),border:`${h(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>c(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${c(o,"shift-5",t.get(o))} transparent`}}}function Dr(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function Bs(e,t,n,o){var d;let a=e.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(a))return;e.preventDefault();let r=t.map((s,m)=>{var f;return(f=s.key)!=null?f:String(m)}),i=r.indexOf(n),l=i;a==="ArrowRight"?l=(i+1)%r.length:a==="ArrowLeft"?l=(i-1+r.length)%r.length:a==="Home"?l=0:a==="End"&&(l=r.length-1),o.set(r[l]);let u=e.target.closest("[role=radiogroup]");(d=u==null?void 0:u.querySelectorAll("[role=radio]")[l])==null||d.focus()}function Or(e,t,n,o){return e.map((a,r)=>{var u;let i=(u=a.key)!=null?u:String(r);return{button:[typeof a.label=="string"?{span:a.label}:a.label],_key:i,type:"button",role:"radio",ariaChecked:d=>t.get(d)===i,tabIndex:d=>{var m,f;let s=t.get(d);return s===i||s===""&&i===((f=(m=e[0])==null?void 0:m.key)!=null?f:"")?0:-1},onClick:()=>t.set(i),onKeyDown:d=>Bs(d,e,i,t),style:{cursor:"pointer",fontSize:d=>x(d,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(3),border:"none",borderRadius:h(10),color:d=>c(d,"text",n),backgroundColor:"transparent",transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:d=>c(d,"shift-3",n)},"&:active:not([disabled]):not([aria-checked=true])":{backgroundColor:d=>c(d,"increase-2",n)},"&[aria-checked=true]":{backgroundColor:d=>c(d,"shift-0",o),color:d=>c(d,"shift-10",o),boxShadow:W("low")},"&:focus-visible":{boxShadow:d=>_(d,o)},"&[aria-checked=true]:focus-visible":{boxShadow:d=>`${W("low")}, ${_(d,o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function Vs(e={items:[]}){var r,i,l;let{items:t=[],color:n="neutral",accentColor:o="primary"}=e,a={items:t,color:n,accentColor:o};return N(L({role:"radiogroup",_context:{segmented:{value:b((l=(i=e.value)!=null?i:(r=t[0])==null?void 0:r.key)!=null?l:"")}},_onSchedule:(u,d)=>{var m,f;let s=Dr(u,"segmentedValue",e.value,(f=(m=t[0])==null?void 0:m.key)!=null?f:"");d[u.tagName]=Or(t,s,n,o)}},V("segmented-items",u=>({update(d){var m,f;let s=Dr(u,"segmentedValue",e.value,(f=(m=d.items[0])==null?void 0:m.key)!=null?f:"");u.children.update(Or(d.items,s,d.color,d.accentColor),!!u.domElement,!0)}}),a)),{dataTone:"shift-2",style:{display:"inline-flex",paddingBlock:h(1),paddingInline:h(1),gap:h(.5),borderRadius:h(10),backgroundColor:u=>c(u,"inherit",n),color:u=>c(u,"text",n)}})}function Hs(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=>c(o,"text",t),backgroundColor:o=>c(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${c(o,"border-strong",t)}`,borderRadius:o=>h(y(o)*1.5),paddingBlock:o=>h(y(o)*1),paddingLeft:o=>h(y(o)*3),paddingRight:o=>h(y(o)*5),backgroundImage:o=>{let a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Lo(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(a)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${h(2)} center`,backgroundSize:`${h(2.5)} ${h(1.5)}`,transition:"outline-color 140ms ease, box-shadow 140ms ease","&:not([multiple])":{height:o=>h(6+y(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`1px solid ${c(o,"shift-5",n)}`},"&:focus-visible":{boxShadow:o=>_(o,n)},"& optgroup":{color:o=>c(o,"shift-11",t)},"& option[disabled]":{color:o=>c(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>c(o,"muted","neutral"),outline:o=>`1px solid ${c(o,"border-strong","neutral")}`,backgroundColor:o=>c(o,"shift-2","neutral")}}}}var js=1e3;function Fs(e){let t=e.getMetadata("selectBoxTypeahead");return t||(t={buffer:"",timer:null},e.setMetadata("selectBoxTypeahead",t)),t}var Pr=(e,t)=>e.trim().toLowerCase().startsWith(t);function Ws(e){return e?Array.from(e.querySelectorAll("[role=option]")).filter(t=>t.getAttribute("aria-disabled")!=="true"&&!t.hasAttribute("disabled")):[]}function Ks(e){let{options:t=[],placement:n="bottom",color:o="neutral",open:a=!1,multiple:r=!1}=e,i=b(e.value),l=b(a),{show:u,hide:d,anchorPartial:s}=Se({kind:"selectBox",open:l,onDismiss:e.onDismiss,placement:b(n),content:e.content}),m={onClick:(v,k)=>!r&&d(k),dataTone:"shift-0",style:{backgroundColor:v=>c(v,"inherit"),color:v=>c(v,"text"),borderRadius:v=>h(y(v)*2),outline:v=>`1px solid ${c(v,"border-strong")}`,outlineOffset:"-1px",boxShadow:W("medium")}};K(e.content,m);let f=v=>({div:k=>{let T=v.state.get(k),w=Array.isArray(T)?T:[T];return v.options.filter(D=>w.includes(D.value)).map(D=>({span:D.label,$:[St({color:v.color,removable:v.multiple})],_key:D.value,_onRemove:I=>{let F=v.state.get(),B=(Array.isArray(F)?F:[F]).filter(ie=>ie!==D.value);v.multiple?v.state.set(B):v.state.set(B[0])}}))},_key:"selectBoxWrap",style:{display:"flex",flexWrap:"wrap",gap:h(1),flex:1}}),p=(v,k)=>({update(T){v.children.update([f(T)])}}),g=v=>l.get()?d(v):u(v),S=(v,k)=>{var A,B,ie,q;let T=Fs(k);T.timer&&clearTimeout(T.timer),T.buffer+=v.toLowerCase(),T.timer=setTimeout(()=>{T.buffer=""},js);let w=T.buffer.length>1&&new Set(T.buffer).size===1,O=w?T.buffer[0]:T.buffer;if(l.get()){let Z=k.getRoot().domElement,te=(A=Z==null?void 0:Z.querySelector(`#${de("selectBox",k)}`))!=null?A:null,Y=Ws(te).filter(ee=>{var Q;return Pr((Q=ee.textContent)!=null?Q:"",O)});if(!Y.length)return;let oe=(ie=(B=k.domElement)==null?void 0:B.ownerDocument)==null?void 0:ie.activeElement,ae=w&&oe?Y.indexOf(oe):-1,ne=Y[(ae+1)%Y.length];ne.focus(),(q=ne.scrollIntoView)==null||q.call(ne,{block:"nearest"});return}if(r)return;let D=t.filter(Z=>Pr(Z.label,O));if(!D.length)return;let I=w?D.findIndex(Z=>Z.value===i.get()):-1,F=D[(I+1)%D.length];i.set(F.value)},E=N(L({_onInsert:v=>{v.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onSchedule:(v,k)=>{k[v.tagName]=[f({options:t,multiple:r,color:o,state:i})]}},V("selectBoxInner",p,{options:t,multiple:r,color:o,state:i})),{onClick:(v,k)=>g(k),tabindex:0,role:"button",ariaExpanded:v=>l.get(v),ariaHaspopup:"listbox",ariaControls:v=>v!=null&&v.elementNode?de("selectBox",v.elementNode):void 0,onKeyDown:(v,k)=>{let T=v.key;if(T==="Escape"){d(k);return}if(T==="Enter"||T===" "){v.preventDefault(),g(k);return}if(T==="ArrowDown"&&!l.get()){v.preventDefault(),u(k);return}let w=v;T.length===1&&!w.ctrlKey&&!w.metaKey&&!w.altKey&&S(T,k)},style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>h(6+y(v)*2),minWidth:h(32),outlineOffset:"-1px",outline:v=>`1px solid ${c(v,"border-strong","neutral")}`,paddingInline:v=>h(y(v)*2),borderRadius:v=>h(y(v)*1.5),fontSize:v=>x(v,"inherit"),color:v=>c(v,"text",o),backgroundColor:v=>c(v,"inherit",o),transition:"background-color 140ms ease, outline-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:v=>_(v,o)}}});return K(s,E),s}function qs(e={}){let{accentColor:t="primary",color:n="neutral",value:o=null}=e;return{role:"option",tabindex:-1,ariaSelected:r=>{var u;let i=(u=r==null?void 0:r.elementNode)==null?void 0:u.getContext("select");if(!i)return;let l=i.value.get(r);return i.multiple?l.includes(o):l===o},onClick:(r,i)=>{let l=i.getContext("select");if(!l)return;let u=l.value,d=u.get();l.multiple?d.includes(o)?u.set(d.filter(s=>s!==o)):u.set(d.concat([o])):d!==o&&u.set(o)},_onInit:r=>{r.tagName!=="div"&&console.warn('"selectItem" patch must use div tag')},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>x(r,"inherit"),height:r=>h(6+y(r)*2),paddingInline:r=>h(y(r)*3),border:"none",outline:"none",color:r=>c(r,"text",n),backgroundColor:r=>c(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>c(r,"hover",n)},"&[aria-selected=true]":{backgroundColor:r=>c(r,"shift-6",t),color:r=>c(r,"shift-11")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:r=>_(r,t)}}}}function Us(e={}){var i;let{color:t="neutral",multiple:n=!1}=e,o=b((i=e.value)!=null?i:n?[]:null),a={div:l=>{let u=o.get(l);return(Array.isArray(u)?u:[u]).map(s=>({input:null,type:"hidden",name:e.name,value:s==null?"":String(s)}))},ariaHidden:"true",hidden:!0};return{dataTone:"shift-0",role:"listbox",ariaLabel:"Options",ariaMultiselectable:n?"true":void 0,_context:{select:{value:o,multiple:n}},_onInit:l=>{l.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),l.children.insert(a)},style:{display:"flex",flexDirection:"column",paddingBlock:l=>h(y(l)*2),paddingInline:l=>h(y(l)*2),fontSize:l=>x(l,"inherit"),backgroundColor:l=>c(l,"inherit",t),color:l=>c(l,"text",t)}}}function Gs(e={}){var a;let t=b((a=e.color)!=null?a:"neutral","color"),n={"0%":{backgroundPosition:"200% 0"},"100%":{backgroundPosition:"-200% 0"}},o=Ke(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-1",style:{fontSize:r=>x(r),color:r=>c(r,"text",t.get(r)),height:h(6),display:"block",borderRadius:h(1),backgroundColor:r=>c(r,"inherit",t.get(r)),backgroundImage:r=>`linear-gradient(90deg, ${c(r,"inherit",t.get(r))} 0%, ${c(r,"shift-2",t.get(r))} 50%, ${c(r,"inherit",t.get(r))} 100%)`,backgroundSize:"200% 100%",animation:`${o} 1.6s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}function Ys(e={}){var n;let t=b((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=>c(o,"shift-10",t.get(o))}}}var Mr={to:{transform:"rotate(360deg)"}},Lr=Ke(JSON.stringify(Mr));function Xs(e={}){var n;let t=b((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=>c(o),color:o=>c(o,"text",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:h(6),height:h(6),borderRadius:"50%",border:o=>`${h(.5)} solid ${c(o,"border-strong",t.get(o))}`,borderTopColor:o=>c(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${Lr} 0.7s linear infinite`,[`@keyframes ${Lr}`]:Mr}}}function Js(e={}){let{direction:t="horizontal",defaultSize:n=50,min:o=10,max:a=90}=e;return{_onSchedule:(r,i)=>{K(i,{_context:{splitter:{direction:t,size:b(n),min:o,max:a,panelCount:0}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function Zs(e){let t=e.parent;if(!t)return!0;for(let n of t.children.items)if(n instanceof J&&n.getMetadata("splitterPanel"))return n===e;return!0}function Qs(){return{_metadata:{splitterPanel:!0},_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal"?"width":"height",a=i=>{n.style[o]=`${Zs(e)?i:100-i}%`};a(t.size.get()),n.style.flexShrink="0",n.style.overflow="auto";let r=t.size.addListener(a);e.addHook("Remove",()=>{var i;t.panelCount=Math.max(0,((i=t.panelCount)!=null?i:1)-1),r()})}}}function ec(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let n=e.domElement,o=t.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize",n.setAttribute("aria-orientation",o?"vertical":"horizontal"),n.setAttribute("aria-valuemin",String(t.min)),n.setAttribute("aria-valuemax",String(t.max)),n.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let a=t.size.addListener(u=>{n.setAttribute("aria-valuenow",String(Math.round(u)))}),r=u=>{let d=u.shiftKey?10:1,s=null;o?u.key==="ArrowRight"?s=Math.min(t.size.get()+d,t.max):u.key==="ArrowLeft"&&(s=Math.max(t.size.get()-d,t.min)):u.key==="ArrowDown"?s=Math.min(t.size.get()+d,t.max):u.key==="ArrowUp"&&(s=Math.max(t.size.get()-d,t.min)),u.key==="Home"?s=t.min:u.key==="End"&&(s=t.max),s!==null&&(u.preventDefault(),t.size.set(s))},i=null,l=u=>{u.preventDefault();let d=n.parentElement,s=f=>{let p=d.getBoundingClientRect(),g=o?(f.clientX-p.left)/p.width*100:(f.clientY-p.top)/p.height*100;t.size.set(Math.min(Math.max(g,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",m),i=null};i=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",m),i=null},document.addEventListener("mousemove",s),document.addEventListener("mouseup",m)};n.addEventListener("keydown",r),n.addEventListener("mousedown",l),e.addHook("Remove",()=>{i==null||i(),a(),n.removeEventListener("keydown",r),n.removeEventListener("mousedown",l)})},dataTone:"shift-2",style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>c(e,"inherit"),color:e=>c(e,"text"),"&:hover":{backgroundColor:e=>c(e,"increase-1")},transition:"background-color 140ms ease, box-shadow 140ms ease","&:focus-visible":{boxShadow:e=>_(e,"primary")},"&::after":{content:'""',width:h(1),height:h(1),borderRadius:h(999),backgroundColor:e=>c(e,"shift-4")}}}}function tc(e={}){let{gap:t=3,align:n,justify:o,density:a=!0}=e;return{style:L(L({display:"flex",flexDirection:"column",gap:a?r=>h(y(r)*t):()=>h(t)},n?{alignItems:n}:{}),o?{justifyContent:o}:{})}}function Ir(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function oc(e,t,n){return e==="vertical"?{"&:not(:last-child)::after":{content:'""',position:"absolute",left:h(3),top:h(6),bottom:`-${h(2)}`,width:"2px",height:"auto",right:"auto",backgroundColor:o=>c(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:last-child)::after":{backgroundColor:o=>c(o,"shift-9",n)}}:{"&:not(:first-child)::after":{content:'""',position:"absolute",top:h(3),right:`calc(50% + ${h(3)})`,left:`calc(-50% + ${h(3)})`,height:"2px",backgroundColor:o=>c(o,"shift-3",t),zIndex:"0"},"&[data-status=done]:not(:first-child)::after":{backgroundColor:o=>c(o,"shift-9",n)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:o=>c(o,"shift-9",n)}}}function Rr(e,t,n,o,a){let r=n==="vertical",i=oc(n,o,a);return e.map((l,u)=>{var s;return{li:[typeof l.label=="string"?{span:l.label}:l.label],_key:(s=l.key)!=null?s:u,dataStep:String(u+1),dataStatus:m=>{let f=t.get(m);return u<f?"done":u===f?"active":"pending"},ariaCurrent:m=>t.get(m)===u?"step":void 0,style:N(L({position:"relative",display:"flex",flexDirection:r?"row":"column",alignItems:r?"flex-start":"center",gap:h(1),flex:r?"none":"1",fontSize:m=>x(m,"decrease-1"),textAlign:r?"left":"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:h(6),height:h(6),borderRadius:h(999),fontSize:m=>x(m,"decrease-1"),fontWeight:"bold",flexShrink:"0",border:m=>`2px solid ${c(m,"border-strong",o)}`,backgroundColor:m=>c(m,"inherit"),color:m=>c(m,"muted"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"}},i),{"&[data-status=active]::before":{backgroundColor:m=>c(m,"shift-9",a),borderColor:m=>c(m,"shift-9",a),color:m=>c(m,"shift-0",a),boxShadow:m=>`0 0 0 3px ${c(m,"shift-3",a)}`},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:m=>c(m,"shift-9",a),borderColor:m=>c(m,"shift-9",a),color:m=>c(m,"shift-0",a)},"&[data-status=pending]":{color:m=>c(m,"muted")},"&[data-status=active]":{color:m=>c(m,"shift-11",a),fontWeight:"bold"},"&[data-status=done]":{color:m=>c(m,"text",o)}})}})}function nc(e={items:[]}){var i;let{items:t=[],direction:n="horizontal",color:o="neutral",accentColor:a="primary"}=e,r={items:t,direction:n,color:o,accentColor:a};return N(L({_doctorDisable:"inline-typography",_context:{steps:{current:b((i=e.current)!=null?i:0),direction:n,color:o,accentColor:a}},_onSchedule:(l,u)=>{let d=Ir(l,"stepsCurrent",e.current,0);u[l.tagName]=Rr(t,d,n,o,a)}},V("steps-items",l=>({update(u){let d=Ir(l,"stepsCurrent",e.current,0);l.children.update(Rr(u.items,d,u.direction,u.color,u.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",flexDirection:n==="vertical"?"column":"row",alignItems:n==="vertical"?"flex-start":"center",gap:h(2),listStyle:"none",margin:"0",padding:"0"}})}function rc(e={}){var n;let t=b((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:"bold",color:o=>c(o,"shift-11",t.get(o)),backgroundColor:o=>c(o)}}}function ic(e={}){var n;let t=b((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=>c(o,"text",t.get(o))}}}function ac(e={}){var n;let t=b((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=>c(o,"text",t.get(o))}}}function lc(e={}){var n;let t=b((n=e.color)!=null?n:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},_doctorDisable:"inline-typography",style:{fontSize:o=>x(o,"inherit"),color:o=>c(o,"text",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*1),color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*1),color:o=>c(o,"text",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${c(o,"shift-3",t.get(o))}`,fontSize:o=>x(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>h(y(o)*3),paddingBlock:o=>h(y(o)*1),color:o=>c(o,"shift-10",t.get(o)),backgroundColor:o=>c(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${c(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>c(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>c(o,"hover")}}}}function $r(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function zr(e,t,n,o,a){let r=e.nodeId,l={div:t.map((d,s)=>{var p;let m=(p=d.key)!=null?p:s;return{button:[typeof d.label=="string"?{span:d.label}:d.label],_key:m,type:"button",role:"tab",id:`tab${r}${m}`,ariaControls:`panel${r}${m}`,ariaSelected:g=>n.get(g)===m,tabIndex:g=>n.get(g)===m?0:-1,onClick:()=>n.set(m),onKeyDown:g=>{var w;let S=g.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(S))return;g.preventDefault();let E=t.map((O,D)=>{var I;return(I=O.key)!=null?I:D}),v=E.indexOf(m),k=v;S==="ArrowRight"?k=(v+1)%E.length:S==="ArrowLeft"?k=(v-1+E.length)%E.length:S==="Home"?k=0:S==="End"&&(k=E.length-1),n.set(E[k]);let T=g.target.closest("[role=tablist]");(w=T==null?void 0:T.querySelectorAll("[role=tab]")[k])==null||w.focus()},style:{cursor:"pointer",fontSize:g=>x(g,"inherit"),height:g=>h(6+y(g)*2),paddingInline:g=>h(y(g)*4),border:"none",outline:"none",color:g=>c(g,"shift-13"),backgroundColor:g=>c(g,"inherit"),boxShadow:g=>`inset 0 ${h(-.5)} 0 0 ${c(g,"shift-1",a)}`,transition:"box-shadow 140ms ease, color 140ms ease","&:hover:not([disabled]):not([aria-selected=true])":{color:g=>c(g,"shift-13"),boxShadow:g=>`inset 0 ${h(-.5)} 0 0 ${c(g,"shift-2",a)}`},"&[aria-selected=true]:not([disabled])":{color:g=>c(g,"shift-13",o),boxShadow:g=>`inset 0 ${h(-.5)} 0 0 ${c(g,"shift-8",o)}`},"&:focus-visible":{boxShadow:g=>_(g,o)},"&[aria-selected=true]:focus-visible":{boxShadow:g=>`${_(g,o)}, inset 0 ${h(-.5)} 0 0 ${c(g,"shift-6",o)}`}}}}),_key:"tablist",role:"tablist",ariaOrientation:"horizontal",style:{display:"flex"}},u=t.map((d,s)=>{var f;let m=(f=d.key)!=null?f:s;return{div:[d.content],_key:m,role:"tabpanel",id:`panel${r}${m}`,ariaLabelledby:`tab${r}${m}`,hidden:p=>n.get(p)!==m,style:{paddingBlock:p=>h(y(p)*2),paddingInline:p=>h(y(p)*2)}}});return[l,...u]}function sc(e={items:[]}){let{items:t=[],accentColor:n="primary",color:o="neutral"}=e;return L({_onSchedule:(r,i)=>{var u,d;let l=$r(r,"tabsActiveKey",e.activeKey,(d=(u=t[0])==null?void 0:u.key)!=null?d:0);i[r.tagName]=zr(r,t,l,n,o)}},V("tabs-items",r=>({update(i){var u,d;let l=$r(r,"tabsActiveKey",e.activeKey,(d=(u=i.items[0])==null?void 0:u.key)!=null?d:0);r.children.update(zr(r,i.items,l,i.accentColor,i.color),!!r.domElement,!0)}}),{items:t,accentColor:n,color:o}))}function cc(e={}){var a,r;let t=b((a=e.color)!=null?a:"neutral","color"),n=b((r=e.accentColor)!=null?r:"primary","accentColor"),{autoResize:o=!1}=e;return N(L({_onInsert:i=>{i.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')}},V("textarea-auto-resize",(i,l)=>{let u=i.domElement,d=l.autoResize,s=!1,m,f,p=()=>{!d||s||(s=!0,f==null||f.unobserve(u),u.style.overflow="hidden",u.style.height="auto",u.style.height=`${u.scrollHeight}px`,s=!1,d&&(f==null||f.observe(u)))},g=()=>{typeof IntersectionObserver!="undefined"&&(m||(m=new IntersectionObserver(E=>{E.some(v=>v.isIntersecting)&&p()})),m.observe(u)),typeof ResizeObserver!="undefined"&&(f||(f=new ResizeObserver(()=>{s||p()})),f.observe(u))},S=()=>{m==null||m.unobserve(u),f==null||f.unobserve(u)};return u.addEventListener("input",p),i.attributes.addListener("value",p),d&&(g(),p()),{resize:p,update(E){d=E.autoResize,i.attributes.addListener("value",p),d?(g(),p()):S()},destroy(){u.removeEventListener("input",p),m==null||m.disconnect(),f==null||f.disconnect()}}},{autoResize:o})),{_onUpdate:i=>{var l;(l=i.getBehavior("textarea-auto-resize"))==null||l.resize()},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:i=>h(y(i)*2),paddingBlock:i=>h(y(i)*1.5),border:"none",borderRadius:i=>h(y(i)*1.5),fontSize:i=>x(i,"inherit"),color:i=>c(i,"text",t.get(i)),outlineOffset:"-1px",outline:i=>`1px solid ${c(i,"border-strong",t.get(i))}`,backgroundColor:i=>c(i,"inherit",t.get(i)),transition:"outline-color 140ms ease, box-shadow 140ms ease","&::placeholder":{color:i=>c(i,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:i=>`1px solid ${c(i,"shift-5",n.get(i))}`},"&:focus-visible":{boxShadow:i=>_(i,n.get(i))},"&:invalid":{outline:i=>`${h(.5)} solid ${c(i,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>c(i,"muted","neutral"),outline:i=>`1px solid ${c(i,"border-strong","neutral")}`,backgroundColor:i=>c(i,"shift-2","neutral")}}})}function uc(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function mc(e={}){var r,i,l;let{last:t=!1}=e,n=(r=e.color)!=null?r:"neutral",o=(i=e.accentColor)!=null?i:"primary",a=b((l=e.active)!=null?l:!1);return{style:L({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>h(y(u)*2),paddingBottom:u=>t?"0":h(y(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:h(1),transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>c(u,"shift-8",a.get(u)?o:n),opacity:u=>a.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>h(y(u)*-4),width:"2px",backgroundColor:u=>c(u,"shift-3",n)}})}}function Jo(e){let t=e.getMetadata("toastOpen");return t||(t=b(!1),e.setMetadata("toastOpen",t)),t}var Nr=e=>{let t=e==null?void 0:e.elementNode;return t?Jo(t).get(e):!1};function dc(e={}){let{position:t="top-center",color:n="neutral"}=e,o=t.startsWith("top"),a=t.endsWith("center"),r=t.endsWith("right"),i={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:o?"column":"column-reverse",alignItems:a?"center":r?"end":"start",inset:0,gap:h(4),zIndex:30,padding:h(6),pointerEvents:"none"}};return{_portal:l=>{let u=l.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=l.children.insert(i).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:h(32),pointerEvents:"auto",paddingBlock:l=>h(y(l)*2),paddingInline:l=>h(y(l)*4),borderRadius:l=>h(y(l)*2),fontSize:l=>x(l,"inherit"),color:l=>c(l,"text",n),backgroundColor:l=>c(l,"inherit",n),boxShadow:W("medium"),opacity:l=>Number(Nr(l)),transform:l=>Nr(l)?"translateY(0)":o?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:l=>requestAnimationFrame(()=>Jo(l).set(!0)),_onBeforeRemove:(l,u)=>{var v,k;let d=!1,s=null,m=!1,f=l.getRoot(),p=(k=(v=l.domElement)==null?void 0:v.parentElement)!=null?k:null,g=()=>{var w;if(m||!p||p.id!==`domphy-toast-${t}`||p.childElementCount>0)return;m=!0;let T=(w=f.children)==null?void 0:w.items.find(O=>O.domElement===p);T?f.children.remove(T):p.remove()},S=()=>{d||(d=!0,s&&(clearTimeout(s),s=null),l.domElement.removeEventListener("transitionend",E),u(),g())},E=T=>{T.propertyName==="transform"&&S()};l.domElement.addEventListener("transitionend",E),s=setTimeout(S,350),l.addHook("Remove",()=>{var T;s&&(clearTimeout(s),s=null),(T=l.domElement)==null||T.removeEventListener("transitionend",E),g()}),Jo(l).set(!1)}}}function Ar(e,t,n,o){if(le(n))return e.setMetadata(t,n),n;let a=e.getMetadata(t);return a||(a=b(n!=null?n:o),e.setMetadata(t,a)),a}function hc(e,t){return Array.isArray(e)?e.includes(t):e===t}function fc(e,t,n,o,a){var s;let r=e.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(r))return;e.preventDefault();let i=t.map((m,f)=>{var p;return(p=m.key)!=null?p:String(f)}),l=i.indexOf(n),u=l;r==="ArrowRight"?u=(l+1)%i.length:r==="ArrowLeft"?u=(l-1+i.length)%i.length:r==="Home"?u=0:r==="End"&&(u=i.length-1),a||o.set(i[u]);let d=e.target.closest("[role=group]");(s=d==null?void 0:d.querySelectorAll("button")[u])==null||s.focus()}function Br(e,t,n,o,a){return e.map((r,i)=>{var d;let l=(d=r.key)!=null?d:String(i);return{button:[typeof r.label=="string"?{span:r.label}:r.label],_key:l,type:"button",role:"button",ariaPressed:s=>hc(t.get(s),l),tabIndex:s=>{var f,p,g,S,E;let m=t.get(s);if(n){let k=(g=(p=(Array.isArray(m)?m:[])[0])!=null?p:(f=e[0])==null?void 0:f.key)!=null?g:"0";return l===k?0:-1}return m===l||m===""&&l===((E=(S=e[0])==null?void 0:S.key)!=null?E:"0")?0:-1},onClick:()=>{let s=t.get();if(n){let m=Array.isArray(s)?[...s]:[];t.set(m.includes(l)?m.filter(f=>f!==l):[...m,l])}else t.set(s===l?"":l)},onKeyDown:s=>fc(s,e,l,t,n),style:{cursor:"pointer",fontSize:s=>x(s,"inherit"),height:h(6),paddingBlock:h(1),paddingInline:h(2),border:"none",borderRadius:h(1.5),color:s=>c(s,"shift-13",o),backgroundColor:s=>c(s,"inherit",o),transition:"background-color 140ms ease, color 140ms ease, box-shadow 140ms ease","&:hover:not([disabled]):not([aria-pressed=true])":{color:s=>c(s,"shift-13",o),backgroundColor:s=>c(s,"hover",o)},"&:active:not([disabled])":{backgroundColor:s=>c(s,"increase-2",o)},"&[aria-pressed=true]":{backgroundColor:s=>c(s,"shift-3",a),color:s=>c(s,"shift-13",a)},"&:focus-visible":{boxShadow:s=>_(s,a)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}})}function pc(e={items:[]}){var i;let{items:t=[],multiple:n=!1,color:o="neutral",accentColor:a="primary"}=e,r={items:t,multiple:n,color:o,accentColor:a};return N(L({role:"group",_context:{toggleGroup:{value:b((i=e.value)!=null?i:n?[]:""),multiple:n}},_onSchedule:(l,u)=>{let d=Ar(l,"toggleGroupValue",e.value,n?[]:"");u[l.tagName]=Br(t,d,n,o,a)}},V("toggle-items",l=>({update(u){let d=Ar(l,"toggleGroupValue",e.value,u.multiple?[]:"");l.children.update(Br(u.items,d,u.multiple,u.color,u.accentColor),!!l.domElement,!0)}}),r)),{style:{display:"flex",paddingBlock:h(1),paddingInline:h(1),gap:h(1),borderRadius:h(2),fontSize:l=>x(l,"inherit"),backgroundColor:l=>c(l,"inherit",o),color:l=>c(l,"text",o),outline:l=>`1px solid ${c(l,"border",o)}`,outlineOffset:"-1px"}})}function gc(e={}){return Xo(e)}function yc(){return{div:null,style:{flex:"1 1 0"}}}function bc(e={}){let{open:t=!1,placement:n="top",content:o="Tooltip Content"}=e,a=b(n),r=b(o),i={span:f=>r.get(f)},{show:l,hide:u,anchorPartial:d}=Se({kind:"tooltip",open:t,onDismiss:e.onDismiss,placement:a,content:i}),s={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:f=>h(y(f)*1),paddingInline:f=>h(y(f)*3),borderRadius:f=>h(y(f)*1.5),color:f=>c(f,"text"),backgroundColor:f=>c(f),fontSize:f=>x(f,"inherit"),boxShadow:W("low")},$:[Go({placement:a,bordered:!1})]};return i.$||(i.$=[]),i.$.push(s),K(d,{ariaDescribedby:f=>f!=null&&f.elementNode?de("tooltip",f.elementNode):void 0,onMouseEnter:(f,p)=>l(p),onMouseLeave:(f,p)=>u(p),onFocus:(f,p)=>l(p),onBlur:(f,p)=>u(p),onKeyDown:(f,p)=>f.key==="Escape"&&u(p)}),d}function Vr(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function vc(e={}){let{duration:t=300,delay:n=0}=e,o=new Map,a=new Map,r=new Set,i=new Set;return{_onMount:l=>{l.addHook("Remove",()=>{for(let u of Array.from(a.values()))u();a.clear();for(let u of r)clearTimeout(u);r.clear();for(let u of i)cancelAnimationFrame(u);i.clear()})},_onBeforeUpdate:l=>{o=new Map,l.children.items.forEach((u,d)=>{if(!(u instanceof J))return;let s=u.domElement;s&&o.set(Vr(u,d),s.getBoundingClientRect())})},_onUpdate:l=>{l.children.items.forEach((u,d)=>{var O;if(!(u instanceof J))return;let s=u.domElement;if(!s)return;let m=Vr(u,d),f=o.get(m);if(!f)return;let p=s.getBoundingClientRect(),g=f.left-p.left,S=f.top-p.top;if(Math.abs(g)<.5&&Math.abs(S)<.5)return;(O=a.get(s))==null||O(),s.style.transition="none",s.style.transform=`translate(${g}px, ${S}px)`,s.getBoundingClientRect();let E=requestAnimationFrame(()=>{i.delete(E),s.style.transition=`transform ${t}ms ease ${n}ms`,s.style.transform="translate(0px, 0px)"});i.add(E);let v=!1,k=null,T=()=>{v||(v=!0,k&&(r.delete(k),k=null),a.delete(s),s.removeEventListener("transitionend",w),s.style.transition="",s.style.transform="")},w=D=>{D.propertyName==="transform"&&T()};a.set(s,()=>{v=!0,k&&(clearTimeout(k),r.delete(k),k=null),a.delete(s),s.removeEventListener("transitionend",w)}),s.addEventListener("transitionend",w),k=setTimeout(T,t+n+34),r.add(k)}),o.clear()}}}function Sc(e={}){var n;let t=b((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=>c(o),color:o=>c(o,"text",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:h(3),listStyleType:"disc",listStylePosition:"outside"}}}function xc(){return{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}}}return oi(wc);})();
|
|
7
7
|
//# sourceMappingURL=core-theme-ui.global.js.map
|