@domphy/ui 0.1.4 → 0.1.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.
@@ -1,5 +1,5 @@
1
- "use strict";var Domphy=(()=>{var _e=Object.defineProperty,fo=Object.defineProperties,uo=Object.getOwnPropertyDescriptor,ho=Object.getOwnPropertyDescriptors,po=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols;var We=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var ht=(t,e,n)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,R=(t,e)=>{for(var n in e||(e={}))We.call(e,n)&&ht(t,n,e[n]);if(Te)for(var n of Te(e))dt.call(e,n)&&ht(t,n,e[n]);return t},L=(t,e)=>fo(t,ho(e));var Ue=(t,e)=>{var n={};for(var o in t)We.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&Te)for(var o of Te(t))e.indexOf(o)<0&&dt.call(t,o)&&(n[o]=t[o]);return n};var Pe=(t,e)=>{for(var n in e)_e(t,n,{get:e[n],enumerable:!0})},go=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of po(e))!We.call(t,i)&&i!==n&&_e(t,i,{get:()=>e[i],enumerable:!(o=uo(e,i))||o.enumerable});return t};var yo=t=>go(_e({},"__esModule",{value:!0}),t);var H=(t,e,n)=>new Promise((o,i)=>{var r=m=>{try{c(n.next(m))}catch(f){i(f)}},a=m=>{try{c(n.throw(m))}catch(f){i(f)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(r,a);c((n=n.apply(t,e)).next())});var Gi={};Pe(Gi,{core:()=>Re,theme:()=>ze,ui:()=>je});var Re={};Pe(Re,{AttributeList:()=>wt,BooleanAttributes:()=>Ye,CamelAttributes:()=>xt,ElementList:()=>Ct,ElementNode:()=>I,HtmlTags:()=>Ge,Notifier:()=>pe,PrefixCSS:()=>X,State:()=>Ke,VoidTags:()=>ko,hashString:()=>Z,merge:()=>k,toState:()=>C});var bo=["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"],vo=bo.reduce((t,e)=>{let n=e.slice(2).toLowerCase();return t[n]=e,t},{}),Ge=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],pe=class{constructor(){this._listeners={}}_dispose(){if(this._listeners)for(let t in this._listeners)this._listeners[t].clear();this._listeners=null}addListener(t,e){if(!this._listeners)return()=>{};if(typeof t!="string"||typeof e!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[t]||(this._listeners[t]=new Set);let n=()=>this.removeListener(t,e);return this._listeners[t].has(e)||(this._listeners[t].add(e),typeof e.onSubscribe=="function"&&e.onSubscribe(n)),n}removeListener(t,e){if(!this._listeners)return;let n=this._listeners[t];n&&n.has(e)&&(n.delete(e),n.size===0&&delete this._listeners[t])}notify(t,...e){if(!this._listeners)return;let n=this._listeners[t];if(n)for(let o of[...n])try{o(...e)}catch(i){console.error(i)}}},Ke=class{constructor(t){this._notifier=new pe,this.initialValue=t,this._value=t}get(t){return t&&this.onChange(t),this._value}set(t){this._notifier&&(this._value=t,this._notifier.notify("change",t))}reset(){this.set(this.initialValue)}onChange(t){return this._notifier?this._notifier.addListener("change",t):()=>{}}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function k(t={},e={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(e)==="[object Object]"&&Object.getPrototypeOf(e)===Object.prototype&&(e=J(e));for(let r in e){let a=e[r];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof t[r]=="object"?t[r]=k(t[r],a):t[r]=a;else if(n.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,u=typeof a=="function"?a(m):a;return[f,u].filter(h=>h).join(", ")}}else t[r]=[t[r],a].filter(c=>c).join(", ");else if(i.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,u=typeof a=="function"?a(m):a;return[f,u].filter(h=>h).join("")}}else t[r]=[t[r],a].filter(c=>c).join("");else if(o.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,u=typeof a=="function"?a(m):a;return[f,u].filter(h=>h).join(" ")}}else t[r]=[t[r],a].filter(c=>c).join(" ");else if(r.startsWith("on")){let c=r.replace("on","").toLowerCase();wo(t,c,a)}else if(r.startsWith("_on")){let c=r.replace("_on","");xo(t,c,a)}else t[r]=a}return t}function C(t){return t instanceof Ke?t:new Ke(t)}function Z(t=""){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=e*16777619>>>0;return String.fromCharCode(97+e%26)+e.toString(16)}function xo(t,e,n){let o=`_on${e}`,i=t[o];typeof i=="function"?t[o]=(...r)=>{i(...r),n(...r)}:t[o]=n}function wo(t,e,n){let o=vo[e];if(!o)throw Error(`invalid event name "${e}"`);let i=t[o];typeof i=="function"?t[o]=(r,a)=>{i(r,a),n(r,a)}:t[o]=n}function J(t,e=new WeakMap){if(t===null||typeof t!="object"||typeof t=="function")return t;if(e.has(t))return e.get(t);let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&!Array.isArray(t))return t;let o;if(Array.isArray(t)){o=[],e.set(t,o);for(let i of t)o.push(J(i,e));return o}if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if(t instanceof Map){o=new Map,e.set(t,o);for(let[i,r]of t)o.set(J(i,e),J(r,e));return o}if(t instanceof Set){o=new Set,e.set(t,o);for(let i of t)o.add(J(i,e));return o}if(ArrayBuffer.isView(t))return new t.constructor(t);if(t instanceof ArrayBuffer)return t.slice(0);o=Object.create(n),e.set(t,o);for(let i of Reflect.ownKeys(t))o[i]=J(t[i],e);return o}function gt(t,e=!1){if(Object.prototype.toString.call(t)!=="[object Object]")throw Error(`typeof ${t} is invalid DomphyElement`);let n=Object.keys(t);for(let o=0;o<n.length;o++){let i=n[o],r=t[i];if(o==0&&!Ge.includes(i)&&!i.includes("-")&&!e)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")t.$.forEach(a=>gt(a,!0));else{if(i.startsWith("_on")&&typeof r!="function")throw Error(`hook ${i} value "${r}" must be a function `);if(i.startsWith("on")&&typeof r!="function")throw Error(`event ${i} value "${r}" must be a function `);if(i=="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function Co(t){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(t.trim())}function pt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function So(t){return Object.keys(t).find(e=>Ge.includes(e))}function yt(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Eo(t){if(t.indexOf("@")===0)return[t];for(var e=[],n=0,o=0,i="",r=0,a=t.length;r<a;r++){var c=t[r];if(c==="(")n+=1;else if(c===")")n-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!n&&!o){e.push(i.trim()),i="";continue}i+=c}return e.push(i.trim()),e}function bt(t){var e;let n=t.querySelector("#domphy-style");return n||(n=document.createElement("style"),n.id="domphy-style",t.appendChild(n)),n.dataset.domphyBase!=="true"&&((e=n.sheet)==null||e.insertRule("[hidden] { display: none !important; }",0),n.dataset.domphyBase="true"),n}var vt=t=>{if(Array.isArray(t.$)){let e={};return t.$.forEach(n=>k(e,vt(n))),delete t.$,k(e,t),e}else return t},ko=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Ye=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","contentEditable","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","autoCapitalize","translate","spellCheck","inert","download","noModule","paused","autoPictureInPicture"],X={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"]},xt=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],To=class{constructor(t,e,n){this.parent=n,this.isBoolean=Ye.includes(t),xt.includes(t)?this.name=t:this.name=yt(t),this.value=void 0,this.set(e)}render(){if(!this.parent||!this.parent.domElement)return;let t=this.parent.domElement,e=["value"];this.isBoolean?this.value===!1||this.value==null?t.removeAttribute(this.name):t.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?t.removeAttribute(this.name):e.includes(this.name)?t[this.name]=this.value:t.setAttribute(this.name,this.value)}set(t){if(t==null){this.value=null,this.render();return}if(typeof t=="string"&&/<\/?[a-z][\s\S]*>/i.test(t))this.value=pt(t);else if(typeof t=="function"){let e=()=>{e&&(this.value=this.isBoolean?!!t():t(),this.render())};e.elementNode=this.parent,e.onSubscribe=n=>{this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),e=null})},this.value=this.isBoolean?!!t(e):t(e)}else this.value=this.isBoolean?!!t:t;this.render()}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this.value=null,this.parent=null}generateHTML(){let{name:t,value:e}=this;if(this.isBoolean)return e?`${t}`:"";{let n=Array.isArray(e)?JSON.stringify(e):e;return`${t}="${pt(String(n))}"`}}},wt=class{constructor(t){this._notifier=new pe,this.items={},this.parent=t}generateHTML(){if(!this.items)return"";let t=Object.values(this.items).map(e=>e.generateHTML()).join(" ");return t?` ${t}`:""}get(t){var e;if(this.items)return(e=this.items[t])==null?void 0:e.value}set(t,e){!this.items||!this.parent||(this.items[t]?(this.items[t].set(e),this.parent.domElement&&this._notifier.notify(t,this.items[t].value)):this.items[t]=new To(t,e,this.parent))}onChange(t,e){var n;if(this.has(t)&&(n=this.parent)!=null&&n.domElement){let o=e;o.onSubscribe=i=>{var r;return(r=this.parent)==null?void 0:r.addHook("BeforeRemove",i)},this._notifier.addListener(t,o)}}has(t){return this.items?Object.prototype.hasOwnProperty.call(this.items,t):!1}remove(t){this.items&&(this.items[t]&&(this.items[t]._dispose(),delete this.items[t]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(t))}_dispose(){if(this.items)for(let t in this.items)this.items[t]._dispose();this._notifier._dispose(),this.items=null,this.parent=null}toggle(t,e){if(!Ye.includes(t))throw Error(`${t} is not a boolean attribute`);e===!0?this.set(t,!0):e===!1?this.remove(t):this.has(t)?this.remove(t):this.set(t,!0)}addClass(t){if(!t||typeof t!="string")return;let e=(o,i)=>{let r=(o||"").split(" ").filter(a=>a);return!r.includes(i)&&r.push(t),r.join(" ")},n=this.get("class");typeof n=="function"?this.set("class",()=>e(n(),t)):this.set("class",e(n,t))}hasClass(t){return!t||typeof t!="string"?!1:(this.get("class")||"").split(" ").filter(e=>e).includes(t)}toggleClass(t){!t||typeof t!="string"||(this.hasClass(t)?this.removeClass(t):this.addClass(t))}removeClass(t){if(!t||typeof t!="string")return;let e=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==t);e.length>0?this.set("class",e.join(" ")):this.remove("class")}replaceClass(t,e){!t||!e||typeof t!="string"||typeof e!="string"||this.hasClass(t)&&(this.removeClass(t),this.addClass(e))}},_o=class{constructor(t,e){this.type="TextNode",this.parent=e,this.text=t===""?"\u200B":String(t)}_createDOMNode(){let t;if(Co(this.text)){let e=document.createElement("template");e.innerHTML=this.text.trim(),t=e.content.firstChild||document.createTextNode("")}else t=document.createTextNode(this.text);return this.domText=t,t}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":this.text}render(t){let e=this._createDOMNode();t.appendChild(e)}},Ct=class{constructor(t){this.items=[],this.owner=t}_createNode(t,e=0){return typeof t=="object"&&t!==null?new I(t,this.owner,e):new _o(t==null?"":String(t),this.owner)}_moveDomElement(t,e){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=t instanceof I?t.domElement:t.domText;if(o){let i=n.childNodes[e]||null;o!==i&&n.insertBefore(o,i)}}_swapDomElement(t,e){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=t instanceof I?t.domElement:t.domText,i=e instanceof I?e.domElement:e.domText;if(!o||!i)return;let r=o.nextSibling,a=i.nextSibling;n.insertBefore(o,a),n.insertBefore(i,r)}update(t,e=!0,n=!1){var o,i,r,a;let c=this.items.slice(),m=new Map;for(let f of c)f instanceof I&&f.key!==null&&f.key!==void 0&&m.set(f.key,f);!n&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,t));for(let f=0;f<t.length;f++){let u=t[f],h=typeof u=="object"&&u!==null?u._key:void 0;if(h!==void 0){let g=m.get(h);if(g){m.delete(h);let y=this.items.indexOf(g);if(y!==f&&y>=0){let v=g instanceof I&&!!g._portal;this.move(y,f,v?!1:e,!0)}g.parent=this.owner;continue}}this.insert(u,f,e,!0)}for(;this.items.length>t.length;)this.remove(this.items[this.items.length-1],e,!0);m.forEach(f=>this.remove(f,e,!0)),n||(a=(r=this.owner._hooks)==null?void 0:r.Update)==null||a.call(r,this.owner)}insert(t,e,n=!0,o=!1){var i,r;let a=this.items.length,c=typeof e!="number"||isNaN(e)||e<0||e>a?a:e,m=this._createNode(t,c);if(this.items.splice(c,0,m),m instanceof I){m._hooks.Insert&&m._hooks.Insert(m);let f=this.owner.domElement;if(n&&f)if(m._portal){let u=m._portal(this.owner.getRoot());u&&m.render(u)}else{let u=m._createDOMNode(),h=(i=f.childNodes[c])!=null?i:null;f.insertBefore(u,h);let g=f.getRootNode(),y=g instanceof ShadowRoot?g:document.head,v=bt(y);m.styles.render(v),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(x=>{if(x instanceof I&&x._portal){let b=x._portal(x.getRoot());b&&x.render(b)}else x.render(u)})}}else{let f=this.owner.domElement;if(n&&f){let u=m._createDOMNode(),h=(r=f.childNodes[c])!=null?r:null;f.insertBefore(u,h)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(t,e=!0,n=!1){let o=this.items.indexOf(t);if(!(o<0)){if(t instanceof I){let i=()=>{var r,a;let c=t.domElement;this.items.splice(o,1),e&&c&&c.remove(),(a=(r=t._hooks)==null?void 0:r.Remove)==null||a.call(r,t),t._dispose()};t._hooks&&t._hooks.BeforeRemove&&t.domElement?t._hooks.BeforeRemove(t,i):i()}else{let i=t.domText;this.items.splice(o,1),e&&i&&i.remove(),t._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(t=!0,e=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,t,!0);!e&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items=[]}swap(t,e,n=!0,o=!1){if(t<0||e<0||t>=this.items.length||e>=this.items.length||t===e)return;let i=this.items[t],r=this.items[e];this.items[t]=r,this.items[e]=i,n&&this._swapDomElement(i,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(t,e,n=!0,o=!1){if(t<0||t>=this.items.length||e<0||e>=this.items.length||t===e)return;let i=this.items[t];this.items.splice(t,1),this.items.splice(e,0,i),n&&this._moveDomElement(i,e),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let t="";for(let e of this.items)t+=e.generateHTML();return t}},Po=class{constructor(t,e,n){this.value="",this.name=t,this.cssName=yt(t),this.parentRule=n,this.set(e)}_domUpdate(){if(!this.parentRule)return;let t=this.parentRule.domRule;if(t&&t.style){let e=t.style;e.setProperty(this.cssName,String(this.value)),X[this.name]&&X[this.name].forEach(n=>{e.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(t){if(typeof t=="function"){let e=()=>{e&&(this.value=t(e),this._domUpdate())};e.onSubscribe=n=>{var o;(o=this.parentRule.parentNode)==null||o.addHook("BeforeRemove",()=>{n(),e=null})},e.elementNode=this.parentRule.root,this.value=t(e)}else this.value=t;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let t=this.parentRule.domRule.style;t.removeProperty(this.cssName),X[this.name]&&X[this.name].forEach(e=>{t.removeProperty(`-${e}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let t=`${this.cssName}: ${this.value}`;return X[this.name]&&X[this.name].forEach(e=>{t+=`; -${e}-${this.cssName}: ${this.value}`}),t}},Y=class qe{constructor(e,n){this.domRule=null,this.styleBlock={},this.selectorText=e,this.styleList=new St(this),this.parent=n}_dispose(){if(this.styleBlock)for(let e of Object.values(this.styleBlock))e._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let e=this.parent;for(;e instanceof qe;)e=e.parent;return e}get parentNode(){let e=this.parent;for(;e&&e instanceof qe;)e=e.parent;return e}insertStyle(e,n){this.styleBlock&&(this.styleBlock[e]?this.styleBlock[e].set(n):this.styleBlock[e]=new Po(e,n,this))}removeStyle(e){this.styleBlock&&this.styleBlock[e]&&this.styleBlock[e].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let e=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${e} ${n} } `}mount(e){!e||!this.styleList||(this.domRule=e,"cssRules"in e&&this.styleList.mount(e.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let e=this.domRule.parentStyleSheet,n=e.cssRules;for(let o=0;o<n.length;o++)if(n[o]===this.domRule){e.deleteRule(o);break}}this._dispose()}render(e){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=e.insertRule(`${this.selectorText} {}`,e.cssRules.length),i=e.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=e.insertRule(o,e.cssRules.length),r=e.cssRules[i];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,i=e.insertRule(o,e.cssRules.length),r=e.cssRules[i];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},St=class{constructor(t){this.items=[],this.domStyle=null,this.parent=t}get parentNode(){let t=this.parent;for(;t&&t instanceof Y;)t=t.parent;return t}addCSS(t,e=""){if(!this.items||!this.parent)return;let n={};function o(i,r){return i.startsWith("&")?`${r}${i.slice(1)}`:`${r} ${i}`}for(let i in t){let r=t[i],a=Eo(i);for(let c of a){let m=o(c,e);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof r=="object"&&r!=null){let f=new Y(c,this.parent);f.styleList.addCSS(r,e),this.items.push(f)}}else if(c.startsWith("@keyframes")){let f=new Y(c,this.parent);f.styleList.addCSS(r,""),this.items.push(f)}else if(c.startsWith("@font-face")){let f=new Y(c,this.parent);for(let u in r)f.insertStyle(u,r[u]);this.items.push(f)}else if(typeof r=="object"&&r!=null){let f=new Y(m,this.parent);this.items.push(f);for(let[u,h]of Object.entries(r))if(typeof h=="object"&&h!=null){let g=o(u,m);u.startsWith("&")?this.addCSS(h,g):f.styleList.insertRule(g).styleList.addCSS(h,g)}else f.insertStyle(u,h)}else n[c]=r}}if(Object.keys(n).length){let i=new Y(e,this.parent);for(let r in n)i.insertStyle(r,n[r]);this.items.push(i)}}cssText(){return this.items?this.items.map(t=>t.cssText()).join(""):""}insertRule(t){if(!this.items||!this.parent)return null;let e=this.items.find(n=>n.selectorText===t);return e||(e=new Y(t,this.parent),this.items.push(e)),e}mount(t){if(!this.items)return;if(!t)throw Error("Require domRuleList argument");let e=0,n=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let r=i-e,a=t[r];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==n(o.selectorText)?e+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(t){t instanceof HTMLStyleElement?(this.domStyle=t,this.items.forEach(e=>e.render(t.sheet))):t instanceof CSSGroupingRule&&this.items.forEach(e=>e.render(t))}_dispose(){if(this.items)for(let t=0;t<this.items.length;t++)this.items[t]._dispose();this.items=[],this.parent=null,this.domStyle=null}},I=class de{constructor(e,n=null,o=0){this.type="ElementNode",this.parent=null,this.children=new Ct(this),this.styles=new St(this),this.attributes=new wt(this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.key=null;var i,r;e=J(e),gt(e),e.style=e.style||{},this.parent=n,this.tagName=So(e),e=vt(e),this.key=(i=e._key)!=null?i:null,this._context=e._context||{},this._metadata=e._metadata||{};let a=`${(r=this.parent)==null?void 0:r.getPath()}.${o}`,c=JSON.stringify(e.style||{},(f,u)=>typeof u=="function"?a:u);this.nodeId=Z(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),e._onSchedule&&e._onSchedule(this,e),this.merge(e);let m=e[this.tagName];if(m!=null&&m!=null)if(typeof m=="function"){let f=()=>{let u=m(f);this.children.update(Array.isArray(u)?u:[u])};f.elementNode=this,f.onSubscribe=u=>this.addHook("BeforeRemove",()=>{u(),f=null}),f&&f()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let e=["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","foreignObject"].includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=e,this._events)for(let n in this._events){let o=n,i=this._events[o],r=a=>i(a,this);e.addEventListener(o,r),this.addHook("BeforeRemove",a=>{a.domElement.removeEventListener(o,r),r=null})}return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),e}_dispose(){this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(e=>e.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null}get pathId(){return Z(this.getPath())}merge(e){k(this._context,e._context),k(this._metadata,e._metadata);let n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],r=e[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),r):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),r):i=="_portal"?this._portal=r:i=="class"&&typeof r=="string"?this.attributes.addClass(r):this.attributes.set(i,r))}e.style&&this.styles.addCSS(e.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}getPath(){let e=[],n=this;for(;n&&n.parent;){let o=n.parent,i=o.children.items.indexOf(n);e.push(i),n=o}return e.reverse().join(".")}addEvent(e,n){this._events=this._events||{};let o=this._events[e];typeof o=="function"?this._events[e]=(i,r)=>{o(i,r),n(i,r)}:this._events[e]=n}addHook(e,n){let o=this._hooks[e];typeof o=="function"?this._hooks[e]=((...i)=>{o(...i),n(...i)}):this._hooks[e]=n}getRoot(){let e=this;for(;e&&e instanceof de&&e.parent;)e=e.parent;return e}getContext(e){let n=this;for(;n&&(!n._context||!Object.prototype.hasOwnProperty.call(n._context,e));)n=n.parent;return n&&n._context?n._context[e]:void 0}setContext(e,n){this._context=this._context||{},this._context[e]=n}getMetadata(e){return this._metadata?this._metadata[e]:void 0}setMetadata(e,n){this._metadata=this._metadata||{},this._metadata[e]=n}generateCSS(){if(!this.styles||!this.children)return"";let e=this.styles.cssText();return e+=this.children.items.map(n=>n instanceof de?n.generateCSS():"").join(""),e}generateHTML(){if(!this.children||!this.attributes)return"";let e=this.children.generateHTML(),n=this.attributes.generateHTML();return`<${this.tagName}${n}>${e}</${this.tagName}>`}mount(e,n){if(!e)throw new Error("Missing dom node on bind");if(this.domElement=e,this._events)for(let o in this._events){let i=o,r=this._events[i],a=c=>r(c,this);e.addEventListener(i,a),this.addHook("BeforeRemove",c=>{c.domElement.removeEventListener(i,a),a=null})}this.children&&this.children.items.forEach((o,i)=>{let r=e.childNodes[i];r instanceof Node&&o instanceof de&&o.mount(r,n)}),this._hooks.Mount&&this._hooks.Mount(this)}render(e){let n=this._createDOMNode();e.appendChild(n),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=e.getRootNode(),r=i instanceof ShadowRoot?i:document.head;return o||(o=bt(r)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof de&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(n)}),n}remove(){var e;this.parent?this.parent.children.remove(this):((e=this.domElement)==null||e.remove(),this._dispose())}};var ze={};Pe(ze,{contextColor:()=>Ho,createDark:()=>Tt,getTheme:()=>ae,setTheme:()=>Io,themeApply:()=>zo,themeCSS:()=>Xe,themeColor:()=>l,themeDensity:()=>d,themeName:()=>Ie,themeSize:()=>p,themeSpacing:()=>s,themeTokens:()=>Lo,themeVars:()=>ge});var Ro={direction:"darken",colors:{highlight:["#ffffff","#fcf4d6","#fddc69","#f1c21b","#d2a106","#b28600","#8e6a00","#684e00","#483700","#302400","#1c1500","#000000"],warning:["#ffffff","#fff2e8","#ffd9be","#ffb784","#ff832b","#eb6200","#ba4e00","#8a3800","#5e2900","#3e1a00","#231000","#000000"],error:["#ffffff","#fff1f1","#ffd7d9","#ffb3b8","#ff8389","#fa4d56","#da1e28","#a2191f","#750e13","#520408","#2d0709","#000000"],danger:["#ffffff","#fff1f1","#ffd7d9","#ffb3b8","#ff8389","#fa4d56","#da1e28","#a2191f","#750e13","#520408","#2d0709","#000000"],secondary:["#ffffff","#fff0f7","#ffd6e8","#ffafd2","#ff7eb6","#ee5396","#d02670","#9f1853","#740937","#510224","#2a0a18","#000000"],primary:["#ffffff","#edf5ff","#d0e2ff","#a6c8ff","#78a9ff","#4589ff","#0f62fe","#0043ce","#002d9c","#001d6c","#001141","#000000"],info:["#ffffff","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d","#012749","#061727","#000000"],success:["#ffffff","#defbe6","#a7f0ba","#6fdc8c","#42be65","#24a148","#198038","#0e6027","#044317","#022d0d","#071908","#000000"],neutral:["#ffffff","#f4f4f4","#e0e0e0","#c6c6c6","#a8a8a8","#8d8d8d","#6f6f6f","#525252","#393939","#262626","#161616","#000000"]},baseTones:{highlight:3,warning:4,error:5,secondary:5,primary:6,info:5,success:5,neutral:5},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],custom:{}},Oe=Ro,se={light:JSON.parse(JSON.stringify(Oe)),dark:Tt(Oe)};function $o(t){for(let e in t)if(!Object.keys(Oe).includes(e))throw new Error(`Invalid key: ${e}`);if(t.fontSizes&&!Array.isArray(t.fontSizes))throw new Error("fontSize must be array of string");if(t.densities&&(!Array.isArray(t.densities)||t.densities.some(e=>typeof e!="number")))throw new Error("densities must be array of number");if("custom"in t){let e=t.custom;if(typeof e!="object"||e===null)throw new Error("Invalid custom property: must be an object")}}function kt(t,e){var n;for(let o in e)e[o]&&typeof e[o]=="object"&&!Array.isArray(e[o])?((n=t[o])!=null||(t[o]={}),kt(t[o],e[o])):t[o]=e[o]}function Oo(t,e){let n={};for(let i in e){let r=e[i];if(i==="colors")for(let a in e.colors)[...Array(12).keys()].forEach(c=>n[`--${a}-${c}`]=e.colors[a][c]);else if(i==="fontSizes")[...Array(8).keys()].forEach(a=>n[`--fontSize-${a}`]=e.fontSizes[a]);else{if(i==="densities")continue;if(typeof r=="object"&&r!==null)for(let a in r)n[`--${i}-${a.replace("/","_")}`]=r[a]}}let o="";for(let i in n)o+=` ${i}: ${n[i]};
1
+ "use strict";var Domphy=(()=>{var Re=Object.defineProperty,go=Object.defineProperties,yo=Object.getOwnPropertyDescriptor,bo=Object.getOwnPropertyDescriptors,vo=Object.getOwnPropertyNames,Pe=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable;var yt=(t,e,n)=>e in t?Re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,R=(t,e)=>{for(var n in e||(e={}))Ke.call(e,n)&&yt(t,n,e[n]);if(Pe)for(var n of Pe(e))bt.call(e,n)&&yt(t,n,e[n]);return t},A=(t,e)=>go(t,bo(e));var qe=(t,e)=>{var n={};for(var o in t)Ke.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&Pe)for(var o of Pe(t))e.indexOf(o)<0&&bt.call(t,o)&&(n[o]=t[o]);return n};var $e=(t,e)=>{for(var n in e)Re(t,n,{get:e[n],enumerable:!0})},xo=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vo(e))!Ke.call(t,i)&&i!==n&&Re(t,i,{get:()=>e[i],enumerable:!(o=yo(e,i))||o.enumerable});return t};var Co=t=>xo(Re({},"__esModule",{value:!0}),t);var H=(t,e,n)=>new Promise((o,i)=>{var r=m=>{try{c(n.next(m))}catch(f){i(f)}},a=m=>{try{c(n.throw(m))}catch(f){i(f)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(r,a);c((n=n.apply(t,e)).next())});var Ki={};$e(Ki,{core:()=>Ie,theme:()=>Ae,ui:()=>Ve});var Ie={};$e(Ie,{AttributeList:()=>kt,BooleanAttributes:()=>Je,CamelAttributes:()=>Et,ElementList:()=>_t,ElementNode:()=>I,HtmlTags:()=>Xe,ListState:()=>Ge,Notifier:()=>ae,PrefixCSS:()=>X,State:()=>Oe,VoidTags:()=>$o,hashString:()=>Z,merge:()=>k,toListState:()=>Eo,toState:()=>w});var wo=["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"],So=wo.reduce((t,e)=>{let n=e.slice(2).toLowerCase();return t[n]=e,t},{}),Xe=["a","abbr","address","article","aside","audio","b","base","blockquote","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","slot","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","bdi","bdo","math","menu","search","area","embed","hr","animate","animateMotion","animateTransform","circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","set","solidColor","stop","svg","switch","symbol","tbreak","text","textPath","tspan","use","view"],ae=class{constructor(){this._listeners={}}_dispose(){if(this._listeners)for(let t in this._listeners)this._listeners[t].clear();this._listeners=null}addListener(t,e){if(!this._listeners)return()=>{};if(typeof t!="string"||typeof e!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[t]||(this._listeners[t]=new Set);let n=()=>this.removeListener(t,e);return this._listeners[t].has(e)||(this._listeners[t].add(e),typeof e.onSubscribe=="function"&&e.onSubscribe(n)),n}removeListener(t,e){if(!this._listeners)return;let n=this._listeners[t];n&&n.has(e)&&(n.delete(e),n.size===0&&delete this._listeners[t])}notify(t,...e){if(!this._listeners)return;let n=this._listeners[t];if(n)for(let o of[...n])try{o(...e)}catch(i){console.error(i)}}},Oe=class{constructor(t){this._notifier=new ae,this.initialValue=t,this._value=t}get(t){return t&&this.onChange(t),this._value}set(t){this._notifier&&(this._value=t,this._notifier.notify("change",t))}reset(){this.set(this.initialValue)}onChange(t){return this._notifier?this._notifier.addListener("change",t):()=>{}}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}},Ge=class{constructor(t=[]){this._notifier=new ae,this._nextKey=0,this._entries=t.map(e=>this._createEntry(e))}entries(t){return t&&this._notifier.addListener("change",t),this._entries}states(t){return t&&this._notifier.addListener("change",t),this._entries.map(e=>e.state)}keys(t){return t&&this._notifier.addListener("change",t),this._entries.map(e=>e.key)}_createEntry(t){let e=t instanceof Oe?t:w(t);return{key:this._nextKey++,state:e}}_findEntry(t){return this._entries.find(e=>e.state===t)}insert(t,e=!1){let n=this._createEntry(t);return this._entries.push(n),e||this._notifier.notify("change"),n}remove(t,e=!1){let n=this._findEntry(t);if(!n)return;let o=this._entries.indexOf(n);this._entries.splice(o,1),e||this._notifier.notify("change")}move(t,e,n=!1){if(t<0||e<0||t>=this._entries.length||e>=this._entries.length||t===e)return;let[o]=this._entries.splice(t,1);this._entries.splice(e,0,o),n||this._notifier.notify("change")}swap(t,e,n=!1){if(t<0||e<0||t>=this._entries.length||e>=this._entries.length||t===e)return;let o=this._entries[t];this._entries[t]=this._entries[e],this._entries[e]=o,n||this._notifier.notify("change")}clear(t=!1){this._entries.length!==0&&(this._entries=[],t||this._notifier.notify("change"))}reset(t=!1){this._entries.sort((e,n)=>e.key-n.key),t||this._notifier.notify("change")}onChange(t){return this._notifier.addListener("change",t)}_dispose(){this._entries.forEach(t=>t.state._dispose()),this._entries=[],this._notifier._dispose()}};function k(t={},e={}){let n=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(e)==="[object Object]"&&Object.getPrototypeOf(e)===Object.prototype&&(e=J(e));for(let r in e){let a=e[r];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof t[r]=="object"?t[r]=k(t[r],a):t[r]=a;else if(n.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[f,h].filter(u=>u).join(", ")}}else t[r]=[t[r],a].filter(c=>c).join(", ");else if(i.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[f,h].filter(u=>u).join("")}}else t[r]=[t[r],a].filter(c=>c).join("");else if(o.includes(r))if(typeof t[r]=="function"||typeof a=="function"){let c=t[r];t[r]=m=>{let f=typeof c=="function"?c(m):c,h=typeof a=="function"?a(m):a;return[f,h].filter(u=>u).join(" ")}}else t[r]=[t[r],a].filter(c=>c).join(" ");else if(r.startsWith("on")){let c=r.replace("on","").toLowerCase();_o(t,c,a)}else if(r.startsWith("_on")){let c=r.replace("_on","");ko(t,c,a)}else t[r]=a}return t}function Z(t=""){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=e*16777619>>>0;return String.fromCharCode(97+e%26)+e.toString(16)}function w(t){return t instanceof Oe?t:new Oe(t)}function Eo(t){return t instanceof Ge?t:new Ge(t)}function ko(t,e,n){let o=`_on${e}`,i=t[o];typeof i=="function"?t[o]=(...r)=>{i(...r),n(...r)}:t[o]=n}function _o(t,e,n){let o=So[e];if(!o)throw Error(`invalid event name "${e}"`);let i=t[o];typeof i=="function"?t[o]=(r,a)=>{i(r,a),n(r,a)}:t[o]=n}function J(t,e=new WeakMap){if(t===null||typeof t!="object"||typeof t=="function")return t;if(e.has(t))return e.get(t);let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&!Array.isArray(t))return t;let o;if(Array.isArray(t)){o=[],e.set(t,o);for(let i of t)o.push(J(i,e));return o}if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if(t instanceof Map){o=new Map,e.set(t,o);for(let[i,r]of t)o.set(J(i,e),J(r,e));return o}if(t instanceof Set){o=new Set,e.set(t,o);for(let i of t)o.add(J(i,e));return o}if(ArrayBuffer.isView(t))return new t.constructor(t);if(t instanceof ArrayBuffer)return t.slice(0);o=Object.create(n),e.set(t,o);for(let i of Reflect.ownKeys(t))o[i]=J(t[i],e);return o}function xt(t,e=!1){if(Object.prototype.toString.call(t)!=="[object Object]")throw Error(`typeof ${t} is invalid DomphyElement`);let n=Object.keys(t);for(let o=0;o<n.length;o++){let i=n[o],r=t[i];if(o==0&&!Xe.includes(i)&&!i.includes("-")&&!e)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&r&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")t.$.forEach(a=>xt(a,!0));else{if(i.startsWith("_on")&&typeof r!="function")throw Error(`hook ${i} value "${r}" must be a function `);if(i.startsWith("on")&&typeof r!="function")throw Error(`event ${i} value "${r}" must be a function `);if(i=="_portal"&&typeof r!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(r)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof r!="string"&&typeof r!="number")throw Error('"_key" must be a string or number')}}return!0}function To(t){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(t.trim())}function vt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Po(t){return Object.keys(t).find(e=>Xe.includes(e))}function Ct(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ro(t){if(t.indexOf("@")===0)return[t];for(var e=[],n=0,o=0,i="",r=0,a=t.length;r<a;r++){var c=t[r];if(c==="(")n+=1;else if(c===")")n-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!n&&!o){e.push(i.trim()),i="";continue}i+=c}return e.push(i.trim()),e}function wt(t){var e;let n=t.querySelector("#domphy-style");return n||(n=document.createElement("style"),n.id="domphy-style",t.appendChild(n)),n.dataset.domphyBase!=="true"&&((e=n.sheet)==null||e.insertRule("[hidden] { display: none !important; }",0),n.dataset.domphyBase="true"),n}var St=t=>{if(Array.isArray(t.$)){let e={};return t.$.forEach(n=>k(e,St(n))),delete t.$,k(e,t),e}else return t},$o=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Je=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","contentEditable","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","autoCapitalize","translate","spellCheck","inert","download","noModule","paused","autoPictureInPicture"],X={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"]},Et=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Oo=class{constructor(t,e,n){this.parent=n,this.isBoolean=Je.includes(t),Et.includes(t)?this.name=t:this.name=Ct(t),this.value=void 0,this.set(e)}render(){if(!this.parent||!this.parent.domElement)return;let t=this.parent.domElement,e=["value"];this.isBoolean?this.value===!1||this.value==null?t.removeAttribute(this.name):t.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?t.removeAttribute(this.name):e.includes(this.name)?t[this.name]=this.value:t.setAttribute(this.name,this.value)}set(t){if(t==null){this.value=null,this.render();return}if(typeof t=="string"&&/<\/?[a-z][\s\S]*>/i.test(t))this.value=vt(t);else if(typeof t=="function"){let e=()=>{e&&(this.value=this.isBoolean?!!t():t(),this.render())};e.elementNode=this.parent,e.onSubscribe=n=>{this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),e=null})},this.value=this.isBoolean?!!t(e):t(e)}else this.value=this.isBoolean?!!t:t;this.render()}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this.value=null,this.parent=null}generateHTML(){let{name:t,value:e}=this;if(this.isBoolean)return e?`${t}`:"";{let n=Array.isArray(e)?JSON.stringify(e):e;return`${t}="${vt(String(n))}"`}}},kt=class{constructor(t){this._notifier=new ae,this.items={},this.parent=t}generateHTML(){if(!this.items)return"";let t=Object.values(this.items).map(e=>e.generateHTML()).join(" ");return t?` ${t}`:""}get(t){var e;if(this.items)return(e=this.items[t])==null?void 0:e.value}set(t,e){!this.items||!this.parent||(this.items[t]?(this.items[t].set(e),this.parent.domElement&&this._notifier.notify(t,this.items[t].value)):this.items[t]=new Oo(t,e,this.parent))}onChange(t,e){var n;if(this.has(t)&&(n=this.parent)!=null&&n.domElement){let o=e;o.onSubscribe=i=>{var r;return(r=this.parent)==null?void 0:r.addHook("BeforeRemove",i)},this._notifier.addListener(t,o)}}has(t){return this.items?Object.prototype.hasOwnProperty.call(this.items,t):!1}remove(t){this.items&&(this.items[t]&&(this.items[t]._dispose(),delete this.items[t]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(t))}_dispose(){if(this.items)for(let t in this.items)this.items[t]._dispose();this._notifier._dispose(),this.items=null,this.parent=null}toggle(t,e){if(!Je.includes(t))throw Error(`${t} is not a boolean attribute`);e===!0?this.set(t,!0):e===!1?this.remove(t):this.has(t)?this.remove(t):this.set(t,!0)}addClass(t){if(!t||typeof t!="string")return;let e=(o,i)=>{let r=(o||"").split(" ").filter(a=>a);return!r.includes(i)&&r.push(t),r.join(" ")},n=this.get("class");typeof n=="function"?this.set("class",()=>e(n(),t)):this.set("class",e(n,t))}hasClass(t){return!t||typeof t!="string"?!1:(this.get("class")||"").split(" ").filter(e=>e).includes(t)}toggleClass(t){!t||typeof t!="string"||(this.hasClass(t)?this.removeClass(t):this.addClass(t))}removeClass(t){if(!t||typeof t!="string")return;let e=(this.get("class")||"").split(" ").filter(n=>n).filter(n=>n!==t);e.length>0?this.set("class",e.join(" ")):this.remove("class")}replaceClass(t,e){!t||!e||typeof t!="string"||typeof e!="string"||this.hasClass(t)&&(this.removeClass(t),this.addClass(e))}},Io=class{constructor(t,e){this.type="TextNode",this.parent=e,this.text=t===""?"\u200B":String(t)}_createDOMNode(){let t;if(To(this.text)){let e=document.createElement("template");e.innerHTML=this.text.trim(),t=e.content.firstChild||document.createTextNode("")}else t=document.createTextNode(this.text);return this.domText=t,t}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":this.text}render(t){let e=this._createDOMNode();t.appendChild(e)}},_t=class{constructor(t){this.items=[],this.owner=t}_createNode(t,e=0){return typeof t=="object"&&t!==null?new I(t,this.owner,e):new Io(t==null?"":String(t),this.owner)}_moveDomElement(t,e){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=t instanceof I?t.domElement:t.domText;if(o){let i=n.childNodes[e]||null;o!==i&&n.insertBefore(o,i)}}_swapDomElement(t,e){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=t instanceof I?t.domElement:t.domText,i=e instanceof I?e.domElement:e.domText;if(!o||!i)return;let r=o.nextSibling,a=i.nextSibling;n.insertBefore(o,a),n.insertBefore(i,r)}update(t,e=!0,n=!1){var o,i,r,a;let c=this.items.slice(),m=new Map;for(let f of c)f instanceof I&&f.key!==null&&f.key!==void 0&&m.set(f.key,f);!n&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,t));for(let f=0;f<t.length;f++){let h=t[f],u=typeof h=="object"&&h!==null?h._key:void 0;if(u!==void 0){let g=m.get(u);if(g){m.delete(u);let y=this.items.indexOf(g);if(y!==f&&y>=0){let b=g instanceof I&&!!g._portal;this.move(y,f,b?!1:e,!0)}g.parent=this.owner;continue}}this.insert(h,f,e,!0)}for(;this.items.length>t.length;)this.remove(this.items[this.items.length-1],e,!0);m.forEach(f=>this.remove(f,e,!0)),n||(a=(r=this.owner._hooks)==null?void 0:r.Update)==null||a.call(r,this.owner)}insert(t,e,n=!0,o=!1){var i,r;let a=this.items.length,c=typeof e!="number"||isNaN(e)||e<0||e>a?a:e,m=this._createNode(t,c);if(this.items.splice(c,0,m),m instanceof I){m._hooks.Insert&&m._hooks.Insert(m);let f=this.owner.domElement;if(n&&f)if(m._portal){let h=m._portal(this.owner.getRoot());h&&m.render(h)}else{let h=m._createDOMNode(),u=(i=f.childNodes[c])!=null?i:null;f.insertBefore(h,u);let g=f.getRootNode(),y=g instanceof ShadowRoot?g:document.head,b=wt(y);m.styles.render(b),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(x=>{if(x instanceof I&&x._portal){let v=x._portal(x.getRoot());v&&x.render(v)}else x.render(h)})}}else{let f=this.owner.domElement;if(n&&f){let h=m._createDOMNode(),u=(r=f.childNodes[c])!=null?r:null;f.insertBefore(h,u)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(t,e=!0,n=!1){let o=this.items.indexOf(t);if(!(o<0)){if(t instanceof I){let i=()=>{var r,a;let c=t.domElement;this.items.splice(o,1),e&&c&&c.remove(),(a=(r=t._hooks)==null?void 0:r.Remove)==null||a.call(r,t),t._dispose()};t._hooks&&t._hooks.BeforeRemove&&t.domElement?t._hooks.BeforeRemove(t,i):i()}else{let i=t.domText;this.items.splice(o,1),e&&i&&i.remove(),t._dispose()}!n&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(t=!0,e=!1){if(this.items.length===0)return;let n=this.items.slice();for(let o of n)this.remove(o,t,!0);!e&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items=[]}swap(t,e,n=!0,o=!1){if(t<0||e<0||t>=this.items.length||e>=this.items.length||t===e)return;let i=this.items[t],r=this.items[e];this.items[t]=r,this.items[e]=i,n&&this._swapDomElement(i,r),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(t,e,n=!0,o=!1){if(t<0||t>=this.items.length||e<0||e>=this.items.length||t===e)return;let i=this.items[t];this.items.splice(t,1),this.items.splice(e,0,i),n&&this._moveDomElement(i,e),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let t="";for(let e of this.items)t+=e.generateHTML();return t}},Lo=class{constructor(t,e,n){this.value="",this.name=t,this.cssName=Ct(t),this.parentRule=n,this.set(e)}_domUpdate(){if(!this.parentRule)return;let t=this.parentRule.domRule;if(t&&t.style){let e=t.style;e.setProperty(this.cssName,String(this.value)),X[this.name]&&X[this.name].forEach(n=>{e.setProperty(`-${n}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(t){if(typeof t=="function"){let e=()=>{e&&(this.value=t(e),this._domUpdate())};e.onSubscribe=n=>{var o;(o=this.parentRule.parentNode)==null||o.addHook("BeforeRemove",()=>{n(),e=null})},e.elementNode=this.parentRule.root,this.value=t(e)}else this.value=t;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let t=this.parentRule.domRule.style;t.removeProperty(this.cssName),X[this.name]&&X[this.name].forEach(e=>{t.removeProperty(`-${e}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let t=`${this.cssName}: ${this.value}`;return X[this.name]&&X[this.name].forEach(e=>{t+=`; -${e}-${this.cssName}: ${this.value}`}),t}},Y=class Ye{constructor(e,n){this.domRule=null,this.styleBlock={},this.selectorText=e,this.styleList=new Tt(this),this.parent=n}_dispose(){if(this.styleBlock)for(let e of Object.values(this.styleBlock))e._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let e=this.parent;for(;e instanceof Ye;)e=e.parent;return e}get parentNode(){let e=this.parent;for(;e&&e instanceof Ye;)e=e.parent;return e}insertStyle(e,n){this.styleBlock&&(this.styleBlock[e]?this.styleBlock[e].set(n):this.styleBlock[e]=new Lo(e,n,this))}removeStyle(e){this.styleBlock&&this.styleBlock[e]&&this.styleBlock[e].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let e=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),n=this.styleList.cssText();return`${this.selectorText} { ${e} ${n} } `}mount(e){!e||!this.styleList||(this.domRule=e,"cssRules"in e&&this.styleList.mount(e.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let e=this.domRule.parentStyleSheet,n=e.cssRules;for(let o=0;o<n.length;o++)if(n[o]===this.domRule){e.deleteRule(o);break}}this._dispose()}render(e){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=e.insertRule(`${this.selectorText} {}`,e.cssRules.length),i=e.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=e.insertRule(o,e.cssRules.length),r=e.cssRules[i];this.mount(r)}}else{let o=`${this.selectorText} { ${n} }`,i=e.insertRule(o,e.cssRules.length),r=e.cssRules[i];r&&"selectorText"in r&&this.mount(r)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},Tt=class{constructor(t){this.items=[],this.domStyle=null,this.parent=t}get parentNode(){let t=this.parent;for(;t&&t instanceof Y;)t=t.parent;return t}addCSS(t,e=""){if(!this.items||!this.parent)return;let n={};function o(i,r){return i.startsWith("&")?`${r}${i.slice(1)}`:`${r} ${i}`}for(let i in t){let r=t[i],a=Ro(i);for(let c of a){let m=o(c,e);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof r=="object"&&r!=null){let f=new Y(c,this.parent);f.styleList.addCSS(r,e),this.items.push(f)}}else if(c.startsWith("@keyframes")){let f=new Y(c,this.parent);f.styleList.addCSS(r,""),this.items.push(f)}else if(c.startsWith("@font-face")){let f=new Y(c,this.parent);for(let h in r)f.insertStyle(h,r[h]);this.items.push(f)}else if(typeof r=="object"&&r!=null){let f=new Y(m,this.parent);this.items.push(f);for(let[h,u]of Object.entries(r))if(typeof u=="object"&&u!=null){let g=o(h,m);h.startsWith("&")?this.addCSS(u,g):f.styleList.insertRule(g).styleList.addCSS(u,g)}else f.insertStyle(h,u)}else n[c]=r}}if(Object.keys(n).length){let i=new Y(e,this.parent);for(let r in n)i.insertStyle(r,n[r]);this.items.push(i)}}cssText(){return this.items?this.items.map(t=>t.cssText()).join(""):""}insertRule(t){if(!this.items||!this.parent)return null;let e=this.items.find(n=>n.selectorText===t);return e||(e=new Y(t,this.parent),this.items.push(e)),e}mount(t){if(!this.items)return;if(!t)throw Error("Require domRuleList argument");let e=0,n=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let r=i-e,a=t[r];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==n(o.selectorText)?e+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(t){t instanceof HTMLStyleElement?(this.domStyle=t,this.items.forEach(e=>e.render(t.sheet))):t instanceof CSSGroupingRule&&this.items.forEach(e=>e.render(t))}_dispose(){if(this.items)for(let t=0;t<this.items.length;t++)this.items[t]._dispose();this.items=[],this.parent=null,this.domStyle=null}},I=class ge{constructor(e,n=null,o=0){this.type="ElementNode",this.parent=null,this.children=new _t(this),this.styles=new Tt(this),this.attributes=new kt(this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.key=null;var i,r;e=J(e),xt(e),e.style=e.style||{},this.parent=n,this.tagName=Po(e),e=St(e),this.key=(i=e._key)!=null?i:null,this._context=e._context||{},this._metadata=e._metadata||{};let a=`${(r=this.parent)==null?void 0:r.getPath()}.${o}`,c=JSON.stringify(e.style||{},(f,h)=>typeof h=="function"?a:h);this.nodeId=Z(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),e._onSchedule&&e._onSchedule(this,e),this.merge(e);let m=e[this.tagName];if(m!=null&&m!=null)if(typeof m=="function"){let f=()=>{let h=m(f);this.children.update(Array.isArray(h)?h:[h])};f.elementNode=this,f.onSubscribe=h=>this.addHook("BeforeRemove",()=>{h(),f=null}),f&&f()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let e=["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","foreignObject"].includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=e,this._events)for(let n in this._events){let o=n,i=this._events[o],r=a=>i(a,this);e.addEventListener(o,r),this.addHook("BeforeRemove",a=>{a.domElement.removeEventListener(o,r),r=null})}return this.attributes&&Object.values(this.attributes.items).forEach(n=>n.render()),e}_dispose(){this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(e=>e.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null}get pathId(){return Z(this.getPath())}merge(e){k(this._context,e._context),k(this._metadata,e._metadata);let n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],r=e[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),r):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),r):i=="_portal"?this._portal=r:i=="class"&&typeof r=="string"?this.attributes.addClass(r):this.attributes.set(i,r))}e.style&&this.styles.addCSS(e.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}getPath(){let e=[],n=this;for(;n&&n.parent;){let o=n.parent,i=o.children.items.indexOf(n);e.push(i),n=o}return e.reverse().join(".")}addEvent(e,n){this._events=this._events||{};let o=this._events[e];typeof o=="function"?this._events[e]=(i,r)=>{o(i,r),n(i,r)}:this._events[e]=n}addHook(e,n){let o=this._hooks[e];typeof o=="function"?this._hooks[e]=((...i)=>{o(...i),n(...i)}):this._hooks[e]=n}getRoot(){let e=this;for(;e&&e instanceof ge&&e.parent;)e=e.parent;return e}getContext(e){let n=this;for(;n&&(!n._context||!Object.prototype.hasOwnProperty.call(n._context,e));)n=n.parent;return n&&n._context?n._context[e]:void 0}setContext(e,n){this._context=this._context||{},this._context[e]=n}getMetadata(e){return this._metadata?this._metadata[e]:void 0}setMetadata(e,n){this._metadata=this._metadata||{},this._metadata[e]=n}generateCSS(){if(!this.styles||!this.children)return"";let e=this.styles.cssText();return e+=this.children.items.map(n=>n instanceof ge?n.generateCSS():"").join(""),e}generateHTML(){if(!this.children||!this.attributes)return"";let e=this.children.generateHTML(),n=this.attributes.generateHTML();return`<${this.tagName}${n}>${e}</${this.tagName}>`}mount(e,n){if(!e)throw new Error("Missing dom node on bind");if(this.domElement=e,this._events)for(let o in this._events){let i=o,r=this._events[i],a=c=>r(c,this);e.addEventListener(i,a),this.addHook("BeforeRemove",c=>{c.domElement.removeEventListener(i,a),a=null})}this.children&&this.children.items.forEach((o,i)=>{let r=e.childNodes[i];r instanceof Node&&o instanceof ge&&o.mount(r,n)}),this._hooks.Mount&&this._hooks.Mount(this)}render(e){let n=this._createDOMNode();e.appendChild(n),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=e.getRootNode(),r=i instanceof ShadowRoot?i:document.head;return o||(o=wt(r)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof ge&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(n)}),n}remove(){var e;this.parent?this.parent.children.remove(this):((e=this.domElement)==null||e.remove(),this._dispose())}};var Ae={};$e(Ae,{contextColor:()=>Uo,createDark:()=>$t,getTheme:()=>me,setTheme:()=>No,themeApply:()=>Bo,themeCSS:()=>Ze,themeColor:()=>s,themeDensity:()=>p,themeName:()=>ze,themeSize:()=>d,themeSpacing:()=>l,themeTokens:()=>Do,themeVars:()=>be});var zo={direction:"darken",colors:{highlight:["#ffffff","#fff8cc","#fff197","#ffde2c","#f5c700","#e6af00","#d29500","#c18300","#af7400","#9e6600","#865500","#724800","#5d3b00","#4b2f00","#382300","#281900","#120b00","#000000"],warning:["#ffffff","#fff6e7","#ffeccf","#ffda9e","#ffc15e","#ffa213","#fc7d00","#e86a00","#d45b00","#c24e00","#a73e00","#903300","#762900","#5f2000","#491800","#341200","#190800","#000000"],error:["#ffffff","#fff6f5","#ffebe8","#ffd6d1","#ffbcb4","#ff9d91","#ff7665","#ff513d","#f03823","#d73220","#b72818","#9c2113","#811b0e","#68150a","#501006","#3b0b04","#1d0502","#000000"],danger:["#ffffff","#fff6f5","#ffebe8","#ffd6d1","#ffbcb4","#ff9d91","#ff7665","#ff513d","#f03823","#d73220","#b72818","#9c2113","#811b0e","#68150a","#501006","#3b0b04","#1d0502","#000000"],secondary:["#ffffff","#fff6fc","#ffe8f7","#ffd3f0","#ffb5e6","#ff94db","#ff67cc","#f24cb8","#e434a3","#ce2a92","#b01f7b","#981668","#800c55","#690344","#530035","#3e0027","#210015","#000000"],primary:["#ffffff","#f5f9ff","#e5f0fe","#cbe2fe","#accffd","#8eb9fc","#729efd","#5d89ff","#4b75ff","#3b63fb","#274dea","#1d3ecf","#1532ad","#10288c","#0c1f69","#0e1843","#070b1e","#000000"],info:["#ffffff","#eefafe","#d9f4fd","#b7e7fc","#8ad5ff","#5cc0ff","#30a7fe","#1d95e7","#1286cd","#0b78b3","#046691","#005779","#004762","#00394e","#002b3b","#001f2b","#000e14","#000000"],success:["#ffffff","#edfcf1","#d7f7e1","#adeec5","#6be3a2","#2bd17d","#12b867","#0ba45d","#079355","#05834e","#036e45","#025d3c","#014c34","#003d2c","#002e22","#002119","#000f0c","#000000"],neutral:["#ffffff","#f7f7f7","#efefef","#dfdfdf","#cccccc","#b7b7b7","#a0a0a0","#8f8f8f","#808080","#727272","#606060","#515151","#424242","#343434","#272727","#1c1c1c","#0c0c0c","#000000"]},baseTones:{highlight:5,warning: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],custom:{}},ye=zo,ce={light:JSON.parse(JSON.stringify(ye)),dark:$t(ye)};function tt(t){let e=Object.keys(t.colors)[0];return e?t.colors[e].length:0}function Mo(t){for(let e in t)if(!Object.keys(ye).includes(e))throw new Error(`Invalid key: ${e}`);if(t.fontSizes&&!Array.isArray(t.fontSizes))throw new Error("fontSize must be array of string");if(t.densities&&(!Array.isArray(t.densities)||t.densities.some(e=>typeof e!="number")))throw new Error("densities must be array of number");if("custom"in t){let e=t.custom;if(typeof e!="object"||e===null)throw new Error("Invalid custom property: must be an object")}}function Rt(t,e){var n;for(let o in e)e[o]&&typeof e[o]=="object"&&!Array.isArray(e[o])?((n=t[o])!=null||(t[o]={}),Rt(t[o],e[o])):t[o]=e[o]}function Ao(t,e){let n={},o=tt(e);for(let r in e){let a=e[r];if(r==="colors")for(let c in e.colors)[...Array(o).keys()].forEach(m=>n[`--${c}-${m}`]=e.colors[c][m]);else if(r==="fontSizes")[...Array(8).keys()].forEach(c=>n[`--fontSize-${c}`]=e.fontSizes[c]);else{if(r==="densities")continue;if(typeof a=="object"&&a!==null)for(let c in a)n[`--${r}-${c.replace("/","_")}`]=a[c]}}let i="";for(let r in n)i+=` ${r}: ${n[r]};
2
2
  `;return`[data-theme="${t}"] {
3
- ${o}}`}function ae(t){if(!se[t])throw Error(`Theme "${t}" not found`);return se[t]}function Io(t,e){$o(e),se[t]||(se[t]=structuredClone(Oe)),kt(se[t],e)}function Tt(t){let e=structuredClone(t);e.direction="lighten";for(let n in e.colors)e.colors[n].reverse(),e.baseTones[n]=11-e.baseTones[n];return e}function Lo(t){let e=ae(t),n={};for(let o in e){let i=e[o];if(o==="colors")for(let r in e.colors){let a={};[...Array(12).keys()].forEach(c=>a[c]=e.colors[r][c]),n[r]=a}else if(o==="fontSizes")n.fontSizes=e.fontSizes;else if(o==="densities")n.densities=e.densities;else if(n[o]={},typeof i=="object"&&i!==null)for(let r in i)n[o][r]=i[r]}return n}function ge(){let t=ae("light"),e={};for(let n in t){let o=n,i=t[n];if(n==="colors")for(let r in t.colors){let a={};[...Array(12).keys()].forEach(c=>a[c]=`var(--${r}-${c})`),e[r]=a}else if(n==="fontSizes")e.fontSizes=[...Array(8).keys()].map(r=>`var(--fontSize-${r})`);else{if(n==="densities")continue;if(e[o]={},typeof i=="object"&&i!==null)for(let r in i)e[o][r]=`var(--${o}-${r.replace("/","_")})`}}return e}function Xe(){return Object.entries(se).map(([t,e])=>Oo(t,e)).join(`
4
- `)}function zo(t){var e;if(typeof document!="undefined")if(t){t.textContent=Xe();return}else t=(e=document.getElementById("domphy-themes"))!=null?e:Object.assign(document.createElement("style"),{id:"domphy-themes"}),t.textContent=Xe(),document.head.appendChild(t)}function s(t){return t/4+"em"}function Ie(t){let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataTheme"));)e=e.parent;let n="light";return e&&e.attributes&&e.attributes.has("dataTheme")&&(n=e.attributes.get("dataTheme"),typeof t=="function"&&e.attributes.onChange("dataTheme",t)),n}var Je=["inherit"];[...Array(8).keys()].forEach(t=>{Je.push(`decrease-${t}`),Je.push(`increase-${t}`)});function _t(t,e="inherit"){if(!Je.includes(e))throw Error(`size name "${e}" invalid`);let n;if(e=="inherit")n=t;else if(e!=null&&e.startsWith("increase-")){let o=parseInt(e.replace("increase-",""),10);n=t+o}else if(e!=null&&e.startsWith("decrease-")){let o=parseInt(e.replace("decrease-",""),10);n=t-o}else n=t;return Math.max(0,Math.min(8,n))}function Ao(t){if(!t)return 2;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataSize"));)e=e.parent;let n=2;return e&&e.attributes&&e.attributes.has("dataSize")&&(n=_t(n,e.attributes.get("dataSize")),typeof t=="function"&&e.attributes.onChange("dataSize",t)),n}function p(t,e="inherit"){let n=_t(Ao(t),e);return ge().fontSizes[n]}var Ze=["inherit"];[...Array(5).keys()].forEach(t=>{Ze.push(`decrease-${t}`),Ze.push(`increase-${t}`)});function Mo(t,e="inherit"){if(!Ze.includes(e))throw Error(`density name "${e}" invalid`);let n;if(e=="inherit")n=t;else if(e!=null&&e.startsWith("increase-")){let o=parseInt(e.replace("increase-",""),10);n=t+o}else if(e!=null&&e.startsWith("decrease-")){let o=parseInt(e.replace("decrease-",""),10);n=t-o}else n=t;return Math.max(0,Math.min(4,n))}function No(t){if(!t)return 2;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataDensity"));)e=e.parent;let n=2;return e&&e.attributes&&e.attributes.has("dataDensity")&&(n=Mo(n,e.attributes.get("dataDensity")),typeof t=="function"&&e.attributes.onChange("dataDensity",t)),n}function d(t){let e=No(t);return ae(t?Ie(t):"light").densities[e]}var le=12,$e=["inherit","base"];[...Array(le).keys()].forEach(t=>{$e.push(`decrease-${t}`),$e.push(`increase-${t}`),$e.push(`shift-${t}`)});function Et(t,e){if(t<0||t>le-1)return t;let n=t+e;return n=Math.max(0,Math.min(le-1,n)),n}function Do(t,e){if(t<0||t>le-1)return t;let n=t<=5?t+e:t-e;return n=n<0||n>le-1?-n:n,n=Math.max(0,Math.min(le-1,n)),n}function Le(t,e="inherit"){if(typeof e=="number")return e;if(e=="inherit")return t;if(!$e.includes(e))throw Error(`tone name "${e}" invalid`);if(e.startsWith("increase-")){let n=parseInt(e.replace("increase-",""),10);return Et(t,n)}else if(e.startsWith("decrease-")){let n=parseInt(e.replace("decrease-",""),10);return Et(t,-n)}else if(e.startsWith("shift-")){let n=parseInt(e.replace("shift-",""),10);return Do(t,n)}else return t}function Pt(t){if(!t)return 0;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataTone"));)e=e.parent;let n=0;return e&&e.attributes&&e.attributes.has("dataTone")&&(n=Le(n,e.attributes.get("dataTone")),typeof t=="function"&&e.attributes.onChange("dataTone",t)),n}function Bo(t,e="inherit"){return Le(Pt(t),e)}function Ho(t,e="inherit",n="inherit"){let o=typeof t=="function"?t.elementNode:t,i=n=="inherit"?o.getContext("themeColor")||"neutral":n,r;return e=="base"?r=ae(Ie(t)).baseTones[i]:r=Le(Pt(t),e),ge()[i][r]}function l(t,e="inherit",n="inherit"){let o=n=="inherit"?"neutral":n;if(!t)return ge()[o][Le(0,e)];let i;return e=="base"?i=ae(Ie(t)).baseTones[o]:i=Bo(t,e),ge()[o][i]}var je={};Pe(je,{FieldState:()=>ke,FormState:()=>lt,abbreviation:()=>Fo,alert:()=>Zo,avatar:()=>Qo,badge:()=>en,blockquote:()=>Dn,breadcrumb:()=>tn,breadcrumbEllipsis:()=>on,button:()=>Bn,buttonSwitch:()=>wi,card:()=>jo,code:()=>Fn,combobox:()=>Nn,command:()=>Ko,commandItem:()=>Go,commandSearch:()=>qo,descriptionList:()=>Vn,details:()=>jn,dialog:()=>Wn,divider:()=>Ii,drawer:()=>zi,emphasis:()=>Un,field:()=>Ui,figure:()=>Kn,form:()=>Wi,formGroup:()=>qn,heading:()=>Yn,horizontalRule:()=>Xn,icon:()=>Zn,image:()=>Jn,inputCheckbox:()=>Hn,inputColor:()=>Qn,inputDateTime:()=>ei,inputFile:()=>ti,inputNumber:()=>ri,inputOTP:()=>Jo,inputRadio:()=>hi,inputRange:()=>ii,inputSearch:()=>oi,inputSwitch:()=>xi,inputText:()=>ni,keyboard:()=>si,label:()=>li,link:()=>ai,mark:()=>ci,menu:()=>ji,menuItem:()=>Vi,orderedList:()=>Ri,pagination:()=>Oi,paragraph:()=>mi,popover:()=>Ai,popoverArrow:()=>rt,preformated:()=>fi,progress:()=>ui,select:()=>di,selectBox:()=>vi,selectItem:()=>bi,selectList:()=>yi,skeleton:()=>pi,small:()=>Ci,spinner:()=>gi,splitter:()=>Vo,splitterHandle:()=>Uo,splitterPanel:()=>Wo,strong:()=>Si,subscript:()=>Ei,superscript:()=>ki,tab:()=>Hi,tabPanel:()=>Fi,table:()=>Ti,tabs:()=>Bi,tag:()=>ye,textarea:()=>_i,toast:()=>Mi,toggle:()=>Yo,toggleGroup:()=>Xo,tooltip:()=>Ni,transitionGroup:()=>Di,unorderedList:()=>Pi});function Fo(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{color:o=>l(o,"shift-7",e),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:o=>l(o,"shift-4",e),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:o=>l(o,"shift-8",n),textDecorationColor:o=>l(o,"shift-6",n)}}}}function jo(t={}){let{color:e="neutral"}=t;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:n=>s(d(n)*2),backgroundColor:n=>l(n,"inherit",e),color:n=>l(n,"shift-7",e),outline:n=>`1px solid ${l(n,"shift-3",e)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:n=>s(d(n)*2),paddingInline:n=>s(d(n)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:n=>s(d(n)*4),color:n=>l(n,"shift-6",e),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:n=>s(d(n)*2),height:"auto"},"& > div":{gridArea:"content",padding:n=>s(d(n)*4),color:n=>l(n,"shift-7",e)},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:n=>s(d(n)*2),paddingInline:n=>s(d(n)*4),borderTop:n=>`1px solid ${l(n,"shift-2",e)}`}}}}function Vo(t={}){let{direction:e="horizontal",defaultSize:n=50,min:o=10,max:i=90}=t;return{_onSchedule:(r,a)=>{k(a,{_context:{splitter:{direction:e,size:C(n),min:o,max:i}}})},style:{display:"flex",flexDirection:e==="horizontal"?"row":"column",overflow:"hidden"}}}function Wo(){return{_onMount:t=>{let e=t.getContext("splitter"),n=t.domElement,o=e.direction==="horizontal"?"width":"height";n.style[o]=`${e.size.get()}%`,n.style.flexShrink="0",n.style.overflow="auto";let i=e.size.onChange(r=>{n.style[o]=`${r}%`});t.addHook("Remove",i)}}}function Uo(){return{_onMount:t=>{let e=t.getContext("splitter"),n=t.domElement,o=e.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize";let i=r=>{r.preventDefault();let a=n.parentElement,c=f=>{let u=a.getBoundingClientRect(),h=o?(f.clientX-u.left)/u.width*100:(f.clientY-u.top)/u.height*100;e.size.set(Math.min(Math.max(h,e.min),e.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};n.addEventListener("mousedown",i),t.addHook("Remove",()=>n.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t=>l(t,"shift-2"),"&:hover":{backgroundColor:t=>l(t,"shift-3")},"&::after":{content:'""',borderRadius:s(999),backgroundColor:t=>l(t,"shift-4")}}}}function Ko(){return{_onSchedule:(t,e)=>{k(e,{_context:{command:{query:C("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function qo(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command"),r=o.domElement,a=()=>i.query.set(r.value);r.addEventListener("input",a),o.addHook("Remove",()=>r.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),paddingInline:o=>s(d(o)*3),paddingBlock:o=>s(d(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-2",e)}`,outline:"none",color:o=>l(o,"shift-7",e),backgroundColor:o=>l(o,"inherit",e),"&::placeholder":{color:o=>l(o,"shift-4")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-5",n)}}}}function Go(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{role:"option",_onMount:o=>{var m,f;let i=o.getContext("command"),r=o.domElement,a=(f=(m=r.textContent)==null?void 0:m.toLowerCase())!=null?f:"",c=i.query.onChange(u=>{r.hidden=u.length>0&&!a.includes(u.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>p(o,"inherit"),height:o=>s(6+d(o)*2),paddingInline:o=>s(d(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-1",e)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`,outlineOffset:`-${s(.5)}`}}}}function Yo(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{role:"button",_onInsert:o=>{var m;o.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let i=o.getContext("toggleGroup"),a=((m=o.parent)==null?void 0:m.children.items).filter(f=>f.type==="ElementNode"&&f.attributes.get("role")==="button"),c=String(a.findIndex(f=>f===o));o.attributes.set("ariaPressed",f=>{let u=i.value.get(f);return Array.isArray(u)?u.includes(c):u===c}),o.addEvent("click",()=>{let f=i.value.get();if(i.multiple){let u=Array.isArray(f)?[...f]:[];i.value.set(u.includes(c)?u.filter(h=>h!==c):[...u,c])}else i.value.set(f===c?"":c)})},style:{cursor:"pointer",fontSize:o=>p(o,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-1",e)},"&[aria-pressed=true]":{backgroundColor:o=>l(o,"shift-1",e)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Xo(t={}){var o;let{multiple:e=!1,color:n="neutral"}=t;return{role:"group",dataTone:"shift-1",_context:{toggleGroup:{value:C((o=t.value)!=null?o:e?[]:""),multiple:e}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>p(i,"inherit"),backgroundColor:i=>l(i,"inherit",n),outline:i=>`1px solid ${l(i,"shift-1",n)}`,outlineOffset:"-1px"}}}function Jo(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(8)+"!important"}},_onMount:t=>{let e=t.domElement,n=()=>Array.from(e.querySelectorAll("input")),o=a=>{let c=n(),m=a.target,f=c.indexOf(m);m.value&&f<c.length-1&&c[f+1].focus()},i=a=>{let c=n(),m=a.target,f=c.indexOf(m);a.key==="Backspace"&&!m.value&&f>0&&c[f-1].focus(),a.key==="ArrowLeft"&&f>0&&c[f-1].focus(),a.key==="ArrowRight"&&f<c.length-1&&c[f+1].focus()},r=a=>{var h,g,y;a.preventDefault();let c=(g=(h=a.clipboardData)==null?void 0:h.getData("text"))!=null?g:"",m=n(),f=m.indexOf(a.target);[...c].forEach((v,x)=>{m[f+x]&&(m[f+x].value=v)});let u=Math.min(f+c.length-1,m.length-1);(y=m[u])==null||y.focus()};e.addEventListener("input",o),e.addEventListener("keydown",i),e.addEventListener("paste",r),t.addHook("Remove",()=>{e.removeEventListener("input",o),e.removeEventListener("keydown",i),e.removeEventListener("paste",r)})}}}function Zo(t={}){let{color:e="primary"}=t;return{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:n=>s(d(n)*2),paddingInline:n=>s(d(n)*4),boxShadow:n=>`inset ${s(1)} 0 0 0 ${l(n,"shift-5",e)}`,backgroundColor:n=>l(n,"shift-1",e),color:n=>l(n,"shift-7",e),fontSize:n=>p(n,"inherit")}}}function Qo(t={}){let{color:e="primary"}=t;return{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(8),height:s(8),fontSize:n=>p(n,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:n=>l(n,"shift-3",e),color:n=>l(n,"shift-8",e),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function en(t={}){let{color:e="danger",label:n=999}=t,o=C(n);return{style:{position:"relative","&::after":{content:i=>`"${o.get(i)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:i=>p(i,"decrease-1"),borderRadius:s(999),backgroundColor:i=>l(i,"shift-6",e),color:i=>l(i,"shift-0",e)}}}}function tn(t={}){let{color:e="neutral",separator:n="/"}=t;return{_onInsert:o=>{o.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:o=>p(o,"inherit"),gap:s(1),color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),"& > *":{display:"inline-flex",alignItems:"center",color:o=>l(o,"shift-5",e)},"& > *:not(:last-child)::after":{content:`"${n}"`,color:o=>l(o,"shift-3",e),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:o=>l(o,"shift-7",e),pointerEvents:"none"}}}}function on(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>p(n,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:n=>l(n,"shift-5",e),borderRadius:s(1),"&:hover":{color:n=>l(n,"shift-7",e),backgroundColor:n=>l(n,"shift-1",e)},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-5",e)}`,outlineOffset:s(.5)}}}}var nn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function ye(t={}){let{color:e="neutral",removable:n=!1}=t;return{dataTone:"shift-1",_onInit:o=>{let i={span:nn,onClick:r=>{r.stopPropagation(),o.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:r=>l(r,"shift-3",e)}}};n&&o.children.insert(i)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:n?s(1):s(2),gap:s(2),fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o,"inherit",e),color:o=>l(o,"shift-6",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-3",e)}`}}}var ce=Math.min,F=Math.max,ve=Math.round,xe=Math.floor,N=t=>({x:t,y:t}),rn={left:"right",right:"left",bottom:"top",top:"bottom"},sn={start:"end",end:"start"};function Qe(t,e,n){return F(t,ce(e,n))}function we(t,e){return typeof t=="function"?t(e):t}function U(t){return t.split("-")[0]}function Ce(t){return t.split("-")[1]}function et(t){return t==="x"?"y":"x"}function tt(t){return t==="y"?"height":"width"}var ln=new Set(["top","bottom"]);function j(t){return ln.has(U(t))?"y":"x"}function ot(t){return et(j(t))}function Ot(t,e,n){n===void 0&&(n=!1);let o=Ce(t),i=ot(t),r=tt(i),a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=be(a)),[a,be(a)]}function It(t){let e=be(t);return[Ae(t),e,Ae(e)]}function Ae(t){return t.replace(/start|end/g,e=>sn[e])}var Rt=["left","right"],$t=["right","left"],an=["top","bottom"],cn=["bottom","top"];function mn(t,e,n){switch(t){case"top":case"bottom":return n?e?$t:Rt:e?Rt:$t;case"left":case"right":return e?an:cn;default:return[]}}function Lt(t,e,n,o){let i=Ce(t),r=mn(U(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(Ae)))),r}function be(t){return t.replace(/left|right|bottom|top/g,e=>rn[e])}function fn(t){return R({top:0,right:0,bottom:0,left:0},t)}function zt(t){return typeof t!="number"?fn(t):{top:t,right:t,bottom:t,left:t}}function Q(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function At(t,e,n){let{reference:o,floating:i}=t,r=j(e),a=ot(e),c=tt(a),m=U(e),f=r==="y",u=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,g=o[c]/2-i[c]/2,y;switch(m){case"top":y={x:u,y:o.y-i.height};break;case"bottom":y={x:u,y:o.y+o.height};break;case"right":y={x:o.x+o.width,y:h};break;case"left":y={x:o.x-i.width,y:h};break;default:y={x:o.x,y:o.y}}switch(Ce(e)){case"start":y[a]-=g*(n&&f?-1:1);break;case"end":y[a]+=g*(n&&f?-1:1);break}return y}function Mt(t,e){return H(this,null,function*(){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:a,elements:c,strategy:m}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:g=!1,padding:y=0}=we(e,t),v=zt(y),b=c[g?h==="floating"?"reference":"floating":h],w=Q(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(b))==null||n?b:b.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:m})),S=h==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,T=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),E=(yield r.isElement==null?void 0:r.isElement(T))?(yield r.getScale==null?void 0:r.getScale(T))||{x:1,y:1}:{x:1,y:1},_=Q(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:T,strategy:m}):S);return{top:(w.top-_.top+v.top)/E.y,bottom:(_.bottom-w.bottom+v.bottom)/E.y,left:(w.left-_.left+v.left)/E.x,right:(_.right-w.right+v.right)/E.x}})}var Nt=(t,e,n)=>H(null,null,function*(){let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,c=r.filter(Boolean),m=yield a.isRTL==null?void 0:a.isRTL(e),f=yield a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:h}=At(f,o,m),g=o,y={},v=0;for(let b=0;b<c.length;b++){var x;let{name:w,fn:S}=c[b],{x:T,y:E,data:_,reset:P}=yield S({x:u,y:h,initialPlacement:o,placement:g,strategy:i,middlewareData:y,rects:f,platform:L(R({},a),{detectOverflow:(x=a.detectOverflow)!=null?x:Mt}),elements:{reference:t,floating:e}});u=T!=null?T:u,h=E!=null?E:h,y=L(R({},y),{[w]:R(R({},y[w]),_)}),P&&v<=50&&(v++,typeof P=="object"&&(P.placement&&(g=P.placement),P.rects&&(f=P.rects===!0?yield a.getElementRects({reference:t,floating:e,strategy:i}):P.rects),{x:u,y:h}=At(f,g,m)),b=-1)}return{x:u,y:h,placement:g,strategy:i,middlewareData:y}});var Dt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,fn(n){return H(this,null,function*(){var o,i;let{placement:r,middlewareData:a,rects:c,initialPlacement:m,platform:f,elements:u}=n,ut=we(t,n),{mainAxis:h=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0}=ut,w=Ue(ut,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let S=U(r),T=j(m),E=U(m)===m,_=yield f.isRTL==null?void 0:f.isRTL(u.floating),P=y||(E||!b?[be(m)]:It(m)),O=x!=="none";!y&&O&&P.push(...Lt(m,b,x,_));let at=[m,...P],ne=yield f.detectOverflow(n,w),ie=[],re=((i=a.flip)==null?void 0:i.overflows)||[];if(h&&ie.push(ne[S]),g){let q=Ot(r,c,_);ie.push(ne[q[0]],ne[q[1]])}if(re=[...re,{placement:r,overflows:ie}],!ie.every(q=>q<=0)){var ct,mt;let q=(((ct=a.flip)==null?void 0:ct.index)||0)+1,Ve=at[q];if(Ve&&(!(g==="alignment"?T!==j(Ve):!1)||re.every(M=>j(M.placement)===T?M.overflows[0]>0:!0)))return{data:{index:q,overflows:re},reset:{placement:Ve}};let he=(mt=re.filter(G=>G.overflows[0]<=0).sort((G,M)=>G.overflows[1]-M.overflows[1])[0])==null?void 0:mt.placement;if(!he)switch(v){case"bestFit":{var ft;let G=(ft=re.filter(M=>{if(O){let W=j(M.placement);return W===T||W==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(W=>W>0).reduce((W,mo)=>W+mo,0)]).sort((M,W)=>M[1]-W[1])[0])==null?void 0:ft[0];G&&(he=G);break}case"initialPlacement":he=m;break}if(r!==he)return{reset:{placement:he}}}return{}})}}};var un=new Set(["left","top"]);function hn(t,e){return H(this,null,function*(){let{placement:n,platform:o,elements:i}=t,r=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=U(n),c=Ce(n),m=j(n)==="y",f=un.has(a)?-1:1,u=r&&m?-1:1,h=we(e,t),{mainAxis:g,crossAxis:y,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof v=="number"&&(y=c==="end"?v*-1:v),m?{x:y*u,y:g*f}:{x:g*f,y:y*u}})}var Bt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(n){return H(this,null,function*(){var o,i;let{x:r,y:a,placement:c,middlewareData:m}=n,f=yield hn(n,t);return c===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:r+f.x,y:a+f.y,data:L(R({},f),{placement:c})}})}}},Ht=function(t){return t===void 0&&(t={}),{name:"shift",options:t,fn(n){return H(this,null,function*(){let{x:o,y:i,placement:r,platform:a}=n,S=we(t,n),{mainAxis:c=!0,crossAxis:m=!1,limiter:f={fn:T=>{let{x:E,y:_}=T;return{x:E,y:_}}}}=S,u=Ue(S,["mainAxis","crossAxis","limiter"]),h={x:o,y:i},g=yield a.detectOverflow(n,u),y=j(U(r)),v=et(y),x=h[v],b=h[y];if(c){let T=v==="y"?"top":"left",E=v==="y"?"bottom":"right",_=x+g[T],P=x-g[E];x=Qe(_,x,P)}if(m){let T=y==="y"?"top":"left",E=y==="y"?"bottom":"right",_=b+g[T],P=b-g[E];b=Qe(_,b,P)}let w=f.fn(L(R({},n),{[v]:x,[y]:b}));return L(R({},w),{data:{x:w.x-o,y:w.y-i,enabled:{[v]:c,[y]:m}}})})}}};function Me(){return typeof window!="undefined"}function ee(t){return jt(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function D(t){var e;return(e=(jt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jt(t){return Me()?t instanceof Node||t instanceof $(t).Node:!1}function z(t){return Me()?t instanceof Element||t instanceof $(t).Element:!1}function B(t){return Me()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Ft(t){return!Me()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}var dn=new Set(["inline","contents"]);function fe(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=A(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!dn.has(i)}var pn=new Set(["table","td","th"]);function Vt(t){return pn.has(ee(t))}var gn=[":popover-open",":modal"];function Se(t){return gn.some(e=>{try{return t.matches(e)}catch(n){return!1}})}var yn=["transform","translate","scale","rotate","perspective"],bn=["transform","translate","scale","rotate","perspective","filter"],vn=["paint","layout","strict","content"];function Ne(t){let e=De(),n=z(t)?A(t):t;return yn.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||bn.some(o=>(n.willChange||"").includes(o))||vn.some(o=>(n.contain||"").includes(o))}function Wt(t){let e=V(t);for(;B(e)&&!te(e);){if(Ne(e))return e;if(Se(e))return null;e=V(e)}return null}function De(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var xn=new Set(["html","body","#document"]);function te(t){return xn.has(ee(t))}function A(t){return $(t).getComputedStyle(t)}function Ee(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function V(t){if(ee(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Ft(t)&&t.host||D(t);return Ft(e)?e.host:e}function Ut(t){let e=V(t);return te(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&fe(e)?e:Ut(e)}function me(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Ut(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=$(i);if(r){let c=Be(a);return e.concat(a,a.visualViewport||[],fe(i)?i:[],c&&n?me(c):[])}return e.concat(i,me(i,[],n))}function Be(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yt(t){let e=A(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=B(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,c=ve(n)!==r||ve(o)!==a;return c&&(n=r,o=a),{width:n,height:o,$:c}}function it(t){return z(t)?t:t.contextElement}function ue(t){let e=it(t);if(!B(e))return N(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(e),a=(r?ve(n.width):n.width)/o,c=(r?ve(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var wn=N(0);function Xt(t){let e=$(t);return!De()||!e.visualViewport?wn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Cn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==$(t)?!1:e}function oe(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=it(t),a=N(1);e&&(o?z(o)&&(a=ue(o)):a=ue(t));let c=Cn(r,n,o)?Xt(r):N(0),m=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,u=i.width/a.x,h=i.height/a.y;if(r){let g=$(r),y=o&&z(o)?$(o):o,v=g,x=Be(v);for(;x&&o&&y!==v;){let b=ue(x),w=x.getBoundingClientRect(),S=A(x),T=w.left+(x.clientLeft+parseFloat(S.paddingLeft))*b.x,E=w.top+(x.clientTop+parseFloat(S.paddingTop))*b.y;m*=b.x,f*=b.y,u*=b.x,h*=b.y,m+=T,f+=E,v=$(x),x=Be(v)}}return Q({width:u,height:h,x:m,y:f})}function He(t,e){let n=Ee(t).scrollLeft;return e?e.left+n:oe(D(t)).left+n}function Jt(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-He(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Sn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",a=D(o),c=e?Se(e.floating):!1;if(o===a||c&&r)return n;let m={scrollLeft:0,scrollTop:0},f=N(1),u=N(0),h=B(o);if((h||!h&&!r)&&((ee(o)!=="body"||fe(a))&&(m=Ee(o)),B(o))){let y=oe(o);f=ue(o),u.x=y.x+o.clientLeft,u.y=y.y+o.clientTop}let g=a&&!h&&!r?Jt(a,m):N(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-m.scrollLeft*f.x+u.x+g.x,y:n.y*f.y-m.scrollTop*f.y+u.y+g.y}}function En(t){return Array.from(t.getClientRects())}function kn(t){let e=D(t),n=Ee(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+He(t),c=-n.scrollTop;return A(o).direction==="rtl"&&(a+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:c}}var Kt=25;function Tn(t,e){let n=$(t),o=D(t),i=n.visualViewport,r=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){r=i.width,a=i.height;let u=De();(!u||u&&e==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let f=He(o);if(f<=0){let u=o.ownerDocument,h=u.body,g=getComputedStyle(h),y=u.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(o.clientWidth-h.clientWidth-y);v<=Kt&&(r-=v)}else f<=Kt&&(r+=f);return{width:r,height:a,x:c,y:m}}var _n=new Set(["absolute","fixed"]);function Pn(t,e){let n=oe(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?ue(t):N(1),a=t.clientWidth*r.x,c=t.clientHeight*r.y,m=i*r.x,f=o*r.y;return{width:a,height:c,x:m,y:f}}function qt(t,e,n){let o;if(e==="viewport")o=Tn(t,n);else if(e==="document")o=kn(D(t));else if(z(e))o=Pn(e,n);else{let i=Xt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Q(o)}function Zt(t,e){let n=V(t);return n===e||!z(n)||te(n)?!1:A(n).position==="fixed"||Zt(n,e)}function Rn(t,e){let n=e.get(t);if(n)return n;let o=me(t,[],!1).filter(c=>z(c)&&ee(c)!=="body"),i=null,r=A(t).position==="fixed",a=r?V(t):t;for(;z(a)&&!te(a);){let c=A(a),m=Ne(a);!m&&c.position==="fixed"&&(i=null),(r?!m&&!i:!m&&c.position==="static"&&!!i&&_n.has(i.position)||fe(a)&&!m&&Zt(t,a))?o=o.filter(u=>u!==a):i=c,a=V(a)}return e.set(t,o),o}function $n(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,a=[...n==="clippingAncestors"?Se(e)?[]:Rn(e,this._c):[].concat(n),o],c=a[0],m=a.reduce((f,u)=>{let h=qt(e,u,i);return f.top=F(h.top,f.top),f.right=ce(h.right,f.right),f.bottom=ce(h.bottom,f.bottom),f.left=F(h.left,f.left),f},qt(e,c,i));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function On(t){let{width:e,height:n}=Yt(t);return{width:e,height:n}}function In(t,e,n){let o=B(e),i=D(e),r=n==="fixed",a=oe(t,!0,r,e),c={scrollLeft:0,scrollTop:0},m=N(0);function f(){m.x=He(i)}if(o||!o&&!r)if((ee(e)!=="body"||fe(i))&&(c=Ee(e)),o){let y=oe(e,!0,r,e);m.x=y.x+e.clientLeft,m.y=y.y+e.clientTop}else i&&f();r&&!o&&i&&f();let u=i&&!o&&!r?Jt(i,c):N(0),h=a.left+c.scrollLeft-m.x-u.x,g=a.top+c.scrollTop-m.y-u.y;return{x:h,y:g,width:a.width,height:a.height}}function nt(t){return A(t).position==="static"}function Gt(t,e){if(!B(t)||A(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return D(t)===n&&(n=n.ownerDocument.body),n}function Qt(t,e){let n=$(t);if(Se(t))return n;if(!B(t)){let i=V(t);for(;i&&!te(i);){if(z(i)&&!nt(i))return i;i=V(i)}return n}let o=Gt(t,e);for(;o&&Vt(o)&&nt(o);)o=Gt(o,e);return o&&te(o)&&nt(o)&&!Ne(o)?n:o||Wt(t)||n}var Ln=function(t){return H(this,null,function*(){let e=this.getOffsetParent||Qt,n=this.getDimensions,o=yield n(t.floating);return{reference:In(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function zn(t){return A(t).direction==="rtl"}var An={convertOffsetParentRelativeRectToViewportRelativeRect:Sn,getDocumentElement:D,getClippingRect:$n,getOffsetParent:Qt,getElementRects:Ln,getClientRects:En,getDimensions:On,getScale:ue,isElement:z,isRTL:zn};function eo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Mn(t,e){let n=null,o,i=D(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),r();let f=t.getBoundingClientRect(),{left:u,top:h,width:g,height:y}=f;if(c||e(),!g||!y)return;let v=xe(h),x=xe(i.clientWidth-(u+g)),b=xe(i.clientHeight-(h+y)),w=xe(u),T={rootMargin:-v+"px "+-x+"px "+-b+"px "+-w+"px",threshold:F(0,ce(1,m))||1},E=!0;function _(P){let O=P[0].intersectionRatio;if(O!==m){if(!E)return a();O?a(!1,O):o=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!eo(f,t.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(_,L(R({},T),{root:i.ownerDocument}))}catch(P){n=new IntersectionObserver(_,T)}n.observe(t)}return a(!0),r}function to(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,f=it(t),u=i||r?[...f?me(f):[],...me(e)]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});let h=f&&c?Mn(f,n):null,g=-1,y=null;a&&(y=new ResizeObserver(w=>{let[S]=w;S&&S.target===f&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(e)})),n()}),f&&!m&&y.observe(f),y.observe(e));let v,x=m?oe(t):null;m&&b();function b(){let w=oe(t);x&&!eo(x,w)&&n(),x=w,v=requestAnimationFrame(b)}return n(),()=>{var w;u.forEach(S=>{i&&S.removeEventListener("scroll",n),r&&S.removeEventListener("resize",n)}),h==null||h(),(w=y)==null||w.disconnect(),y=null,m&&cancelAnimationFrame(v)}}var oo=Bt;var no=Ht,io=Dt;var ro=(t,e,n)=>{let o=new Map,i=R({platform:An},n),r=L(R({},i.platform),{_c:o});return Nt(t,e,L(R({},i),{platform:r}))};function K(t){let{open:e=!1,placement:n="bottom"}=t,o=null,i=null,r=null,a=null,c=C(e),m=C(n),f=()=>{r&&a&&(i&&i(),i=to(r,a,()=>{ro(r,a,{placement:m.get(),middleware:[oo(12),io(),no()],strategy:"fixed"}).then(({x,y:b,placement:w})=>{var S;Object.assign(a.style,{left:`${x}px`,top:`${b}px`}),w!==m.get()&&m.set(w),(S=t.onPlacement)==null||S.call(t,r,a,w)})}),c.set(!0))},u=()=>{i&&i(),i=null,c.set(!1)},h=()=>{o&&clearTimeout(o),o=setTimeout(f,100)},g=()=>{o&&clearTimeout(o),o=setTimeout(u,100)},y={style:{position:"fixed",pointerEvents:"auto",visibility:x=>c.get(x)?"visible":"hidden"},_onMount:x=>a=x.domElement,_portal:x=>{let b=x.domElement.querySelector("#domphy-floating");if(!b){let w={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};b=x.children.insert(w).domElement}return b}};return k(t.content,y),{show:h,hide:g,anchorPartial:{onKeyDown:x=>x.key==="Escape"&&g(),_onSchedule:x=>{let b=null;x.getRoot().addHook("Init",w=>{b=w.children.insert(t.content)}),x.addHook("BeforeRemove",()=>{g(),o&&clearTimeout(o),b&&b.remove()})},_onMount:x=>{r=x.domElement;let b=w=>{if(!c.get()||!r||!a)return;let S=w.target;!r.contains(S)&&!a.contains(S)&&g()};x.getRoot().domElement.addEventListener("click",b),x.addHook("BeforeRemove",()=>x.getRoot().domElement.removeEventListener("click",b))}}}}function Nn(t){let{options:e=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=t,a=C(t.value),c=C(i),{show:m,hide:f,anchorPartial:u}=K({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),h={onClick:()=>!r&&f()};k(t.content,h);let g={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:b=>p(b,"inherit"),color:b=>l(b,"shift-6",o),backgroundColor:b=>l(b,"inherit",o)},y;t.input?(k(t.input,{onFocus:()=>m(),style:g,_key:"combobox-input"}),y=t.input):y={input:null,onFocus:()=>m(),value:b=>(a.get(b),""),style:g,_key:"combobox-input"};let v={div:b=>{let w=a.get(b),S=Array.isArray(w)?w:[w],E=e.filter(_=>S.includes(_.value)).map(_=>({span:_.label,$:[ye({color:o,removable:!0})],_key:_.value,_onRemove:P=>{let O=a.get(),ne=(Array.isArray(O)?O:[O]).filter(ie=>ie!==_.value);r?a.set(ne):a.set(ne[0])}}));return E.push(y),E},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},x={_onInsert:b=>{b.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:b=>b.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:b=>`1px solid ${l(b,"shift-3","neutral")}`,paddingBlock:b=>s(d(b)*1),paddingInline:b=>s(d(b)*1),borderRadius:b=>s(d(b)*1),fontSize:b=>p(b,"inherit"),color:b=>l(b,"shift-6",o),backgroundColor:b=>l(b,"inherit",o)}};return k(u,x),u}function rt(t={}){let{placement:e="bottom-end",color:n="neutral",sideOffset:o=s(6),bordered:i=!0}=t,r=C(e),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=C(a[r.get()]);r.onChange(u=>c.set(a[u]));let m=u=>u.includes("start")?o:u.includes("end")?"auto":"50%",f=u=>u.includes("end")?o:u.includes("start")?"auto":"50%";return{style:{position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:u=>l(u,"inherit",n),borderWidth:i?"0px":"1px",borderColor:u=>l(u,"inherit",n),borderTopStyle:u=>{let h=c.get(u);return h.includes("top")||h.includes("right")?"solid":"none"},borderBottomStyle:u=>{let h=c.get(u);return h.includes("bottom")||h.includes("left")?"solid":"none"},borderLeftStyle:u=>{let h=c.get(u);return h.includes("top")||h.includes("left")?"solid":"none"},borderRightStyle:u=>{let h=c.get(u);return h.includes("bottom")||h.includes("right")?"solid":"none"},top:u=>{let h=c.get(u);return h.includes("top")?0:h.includes("bottom")?"auto":m(h)},right:u=>{let h=c.get(u);return h.includes("right")?0:h.includes("left")?"auto":f(h)},bottom:u=>{let h=c.get(u);return h.includes("bottom")?0:h.includes("top")?"auto":f(h)},left:u=>{let h=c.get(u);return h.includes("left")?0:h.includes("right")?"auto":m(h)},transform:u=>{let h=c.get(u),g=h.includes("right")||h.includes("end")&&!h.includes("left")?"50%":"-50%",y=h.includes("bottom")||h.includes("end")&&!h.includes("top")?"50%":"-50%";return`translate(${g},${y}) rotate(45deg)`}}}}}function Dn(t={}){let{color:e="inherit"}=t;return{_onInsert:n=>{n.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-1",style:{fontSize:n=>p(n,"inherit"),backgroundColor:n=>l(n,"inherit",e),boxShadow:n=>`inset ${s(1)} 0 0 0 ${l(n,"shift-3",e)}`,border:"none",paddingBlock:n=>s(d(n)*2),paddingInline:n=>s(d(n)*4),margin:0}}}function Bn(t={}){let{color:e="primary"}=t;return{_onInsert:n=>{n.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:n=>p(n,"inherit"),paddingBlock:n=>s(d(n)*1),paddingInline:n=>s(d(n)*3),borderRadius:n=>s(d(n)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:n=>`1px solid ${l(n,"shift-3",e)}`,color:n=>l(n,"shift-6",e),backgroundColor:n=>l(n,"inherit",e),"&:hover:not([disabled]):not([aria-busy=true])":{color:n=>l(n,"shift-7",e),backgroundColor:n=>l(n,"shift-1",e)},"&:focus-visible":{boxShadow:n=>`inset 0 0 0 ${s(.5)} ${l(n,"shift-6",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-1","neutral"),outline:n=>`1px solid ${l(n,"shift-3","neutral")}`,color:n=>l(n,"shift-5","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Hn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"checkbox",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:o=>p(o,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",e)}`,color:o=>l(o,"shift-6",e),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:o=>l(o,"shift-2",e)},"&:checked::before":{outline:o=>`1px solid ${l(o,"shift-5",n)}`,backgroundColor:o=>l(o,"shift-5",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>l(o,"shift-4",n)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:o=>`${s(.5)} solid ${l(o,"inherit",n)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:o=>`1px solid ${l(o,"shift-4",n)}`,backgroundColor:o=>l(o,"inherit",n)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:o=>l(o,"shift-5",n)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:o=>l(o,"shift-4",n)},"&:focus-visible":{borderRadius:s(1.5),outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>l(o,"shift-3","neutral"),pointerEvents:"none"}}}}function Fn(t={}){let{color:e="neutral"}=t;return{dataTone:"shift-2",_onInsert:n=>{n.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e),backgroundColor:n=>l(n,"inherit",e),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}function jn(t={}){let{color:e="neutral",accentColor:n="primary",duration:o=240}=t;return{_onInsert:i=>{i.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:i=>p(i,"inherit"),color:i=>l(i,"shift-6",e),backgroundColor:i=>l(i,"inherit",e),overflow:"hidden","& > summary":{backgroundColor:i=>l(i,"shift-1",e),color:i=>l(i,"shift-7",e),fontSize:i=>p(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:i=>s(d(i)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:i=>`${s(.5)} solid ${l(i,"shift-6",e)}`,borderBottom:i=>`${s(.5)} solid ${l(i,"shift-6",e)}`,transform:"rotate(45deg)",transition:`transform ${o}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>l(i,"shift-2",e)},"& > summary:focus-visible":{borderRadius:i=>s(d(i)*2),outlineOffset:`-${s(.5)}`,outline:i=>`${s(.5)} solid ${l(i,"shift-5",n)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:i=>s(d(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${o}ms ease, opacity ${o}ms ease, padding ${o}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:i=>s(d(i)*1),paddingBottom:i=>s(d(i)*3)}}}}function Vn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-7",e)},"& dd":{margin:0,fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e)}}}}function Wn(t={}){let{color:e="neutral",open:n=!1}=t,o=C(n);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,r)=>{if(i.target!==r.domElement)return;let a=r.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,r)=>{let a=r.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let r=i.domElement,a=c=>{c?(r.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{r.style.opacity="1";let m=r.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):r.style.opacity="0"};a(o.get()),o.onChange(a)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>p(i,"inherit"),color:i=>l(i,"shift-7",e),backgroundColor:i=>l(i,"inherit",e),border:"none",padding:i=>s(d(i)*3),boxShadow:i=>`0 ${s(8)} ${s(16)} ${l(i,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:i=>l(i,"shift-1","neutral"),opacity:.75}}}}function Un(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:n=>p(n,"inherit"),fontStyle:"italic",color:n=>l(n,"shift-7",e)}}}function Kn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:n=>l(n,"shift-6",e),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:n=>p(n,"decrease-1"),color:n=>l(n,"shift-5",e),lineHeight:1.45}}}}function qn(t={}){let{color:e="neutral",layout:n="horizontal"}=t,o=n==="vertical";return{_onInsert:i=>{i.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:i=>s(d(i)*3),paddingBlock:i=>s(d(i)*3),border:"none",borderRadius:i=>s(d(i)*2),fontSize:i=>p(i,"inherit"),backgroundColor:i=>l(i,"inherit",e),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:i=>p(i,"inherit"),fontWeight:600,paddingBlock:i=>s(d(i)*1),borderRadius:i=>s(d(i)*2),color:i=>l(i,"shift-6",e),backgroundColor:i=>l(i,"inherit",e)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:i=>o?"0px":s(d(i)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${s(2)} * -1)`,fontSize:i=>p(i,"decrease-1"),color:i=>l(i,"shift-6",e)}}}}var Gn={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Yn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{["h1","h2","h3","h4","h5","h6"].includes(n.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:n=>l(n,"shift-8",e),marginTop:0,marginBottom:s(2),fontSize:n=>{let o=Gn[n.elementNode.tagName]||"inherit";return p(n,o)}}}}function Xn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:n=>l(n,"shift-3",e)}}}function Jn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:s(2),backgroundColor:n=>l(n,"shift-1",e)}}}function Zn(){return{_onInsert:t=>{t.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:s(6),height:s(6)}}}function Qn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"color",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),i.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>p(o,"inherit"),paddingBlock:o=>s(d(o)*1),paddingInline:o=>s(d(o)*1),blockSize:o=>s(6+d(o)*2),inlineSize:o=>s(6+d(o)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>s(d(o)*1)},"&::-moz-color-swatch":{borderRadius:o=>s(d(o)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-1","neutral"),outline:o=>`1px solid ${l(o,"shift-3","neutral")}`}}}}function ei(t={}){let{mode:e="datetime-local",color:n="neutral",accentColor:o="primary"}=t;return{type:e,_onSchedule:(i,r)=>{i.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),r.type=e},style:{fontFamily:"inherit",fontSize:i=>p(i,"inherit"),lineHeight:"inherit",color:i=>l(i,"shift-6",n),backgroundColor:i=>l(i,"inherit",n),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-3",n)}`,borderRadius:i=>s(d(i)*1),paddingInline:i=>s(d(i)*3),height:i=>s(6+d(i)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-5",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>l(i,"shift-5","neutral"),backgroundColor:i=>l(i,"shift-1","neutral"),outline:i=>`1px solid ${l(i,"shift-3","neutral")}`},"&:invalid":{outline:i=>`${s(.5)} solid ${l(i,"shift-5","error")}`}}}}function ti(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"file",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),i.type="file"},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-3",e)}`,borderRadius:o=>s(d(o)*1),height:o=>s(6+d(o)*2),paddingInline:o=>s(d(o)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:o=>l(o,"shift-7",n),backgroundColor:o=>l(o,"shift-2",n)},"&::-webkit-file-upload-button":{marginTop:s(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:o=>l(o,"shift-7",e),backgroundColor:o=>l(o,"shift-2",e)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-5","neutral"),outline:o=>`1px solid ${l(o,"shift-3","neutral")}`,backgroundColor:o=>l(o,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:o=>l(o,"shift-5","neutral"),backgroundColor:o=>l(o,"shift-2","neutral")}}}}function oi(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"search",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),i.type="search"},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-3",e)}`,borderRadius:o=>s(d(o)*1),minWidth:s(32),paddingInline:o=>s(d(o)*3),paddingBlock:o=>s(d(o)*1),"&::placeholder":{color:o=>l(o,"shift-4",e)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-5","neutral"),backgroundColor:o=>l(o,"shift-1","neutral"),outline:o=>`1px solid ${l(o,"shift-3","neutral")}`}}}}function ni(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"text",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),i.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(32),paddingInline:o=>s(d(o)*3),paddingBlock:o=>s(d(o)*1),borderRadius:o=>s(d(o)*1),fontSize:o=>p(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-3",e)}`,color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),"&::placeholder":{color:o=>l(o,"shift-4")},"&:not(:placeholder-shown)":{color:o=>l(o,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-1","neutral"),outline:o=>`1px solid ${l(o,"shift-3","neutral")}`,color:o=>l(o,"shift-5","neutral")},"&:invalid:not(:placeholder-shown)":{outline:o=>`${s(.5)} solid ${l(o,"shift-5","error")}`},"&[data-status=error]":{outline:o=>`${s(.5)} solid ${l(o,"shift-5","error")}`},"&[data-status=warning]":{outline:o=>`${s(.5)} solid ${l(o,"shift-5","warning")}`}}}}function ii(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"range",_onInsert:o=>{o.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:o=>l(o,"shift-2",e)},"&::-moz-range-track":{height:s(1.5),borderRadius:s(999),backgroundColor:o=>l(o,"shift-2",e)},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:o=>l(o,"shift-6",n)},"&::-moz-range-thumb":{width:s(4),height:s(4),borderRadius:s(999),border:"none",backgroundColor:o=>l(o,"shift-6",n)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:o=>l(o,"shift-7",n)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:o=>l(o,"shift-7",n)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-4",n)}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ri(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"number",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),i.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(32),paddingInline:o=>s(d(o)*3),paddingBlock:o=>s(d(o)*1),borderRadius:o=>s(d(o)*1),fontSize:o=>p(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-3",e)}`,color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-1","neutral"),outline:o=>`1px solid ${l(o,"shift-3","neutral")}`,color:o=>l(o,"shift-5","neutral")}}}}function si(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e),backgroundColor:n=>l(n,"inherit",e),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:n=>`1px solid ${l(n,"shift-3",e)}`}}}function li(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-6",e),cursor:"pointer","&:focus-within":{color:o=>l(o,"shift-7",n)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-5","neutral")}}}}function ai(t={}){let{color:e="primary",accentColor:n="secondary"}=t;return{_onInsert:o=>{o.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-6",e),textDecoration:"none","&:visited":{color:o=>l(o,"shift-6",n)},"&:hover:not([disabled])":{color:o=>l(o,"shift-7",e),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:o=>`${s(.5)} solid ${l(o,"shift-6",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-5","neutral")}}}}function ci(t={}){let{accentColor:e="highlight",tone:n="shift-1"}=t;return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:n,style:{display:"inline-flex",alignItems:"center",fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function mi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e),lineHeight:1.5,marginTop:0,marginBottom:0}}}function fi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e),backgroundColor:n=>l(n,"shift-1",e),border:"none",paddingBlock:n=>s(d(n)*2),paddingInline:n=>s(d(n)*3),borderRadius:n=>s(d(n)*2)}}}function ui(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:o=>l(o,"shift-2",e),"&::-webkit-progress-bar":{backgroundColor:o=>l(o,"shift-2",e),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:o=>l(o,"shift-6",n),borderRadius:s(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:o=>l(o,"shift-6",n),borderRadius:s(999)}}}}function hi(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"radio",_onInsert:o=>{if(o.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:o=>p(o,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",e)}`,color:o=>l(o,"shift-6",e),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:o=>l(o,"shift-2",e)},"&:checked::before":{outline:o=>`1px solid ${l(o,"shift-5",n)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:o=>l(o,"shift-5",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>l(o,"shift-4",n)},"&:focus-visible":{borderRadius:"50%",outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>l(o,"shift-3","neutral"),pointerEvents:"none"}}}}function di(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-6",e),backgroundColor:o=>l(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-3",e)}`,borderRadius:o=>s(d(o)*1),paddingBlock:o=>s(d(o)*1),paddingLeft:o=>s(d(o)*3),paddingRight:o=>s(d(o)*1),"&:not([multiple])":{height:o=>s(6+d(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-4",n)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"& optgroup":{color:o=>l(o,"shift-8",e)},"& option[disabled]":{color:o=>l(o,"shift-4","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-5","neutral"),outline:o=>`1px solid ${l(o,"shift-3","neutral")}`,backgroundColor:o=>l(o,"shift-1","neutral")}}}}function pi(t={}){let{color:e="neutral"}=t,n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=Z(JSON.stringify(n));return{ariaHidden:"true",style:{height:s(6),display:"block",borderRadius:s(1),backgroundColor:i=>l(i,"shift-2",e),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}var lo={to:{transform:"rotate(360deg)"}},so=Z(JSON.stringify(lo));function gi(t={}){let{color:e="neutral"}=t;return{role:"status",ariaLabel:"loading",_onInsert:n=>{n.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:n=>`${s(.5)} solid ${l(n,"shift-3",e)}`,borderTopColor:n=>l(n,"shift-6",e),boxSizing:"border-box",padding:0,animation:`${so} 0.7s linear infinite`,[`@keyframes ${so}`]:lo}}}function yi(t={}){var a;let{color:e="neutral",multiple:n=!1}=t,o=C((a=t.value)!=null?a:n?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(u=>({input:null,name:t.name,value:u||""}))},hidden:!0};return{dataTone:"shift-11",_context:{select:{value:o,multiple:n}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(d(c)*2),paddingInline:c=>s(d(c)*2),fontSize:c=>p(c,"inherit"),backgroundColor:c=>l(c,"inherit",e)}}}function bi(t={}){let{accentColor:e="primary",color:n="neutral",value:o=null}=t;return{role:"option",_onInit:r=>{r.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=r.getContext("select");if(a){let c=a.value;r.attributes.set("ariaSelected",m=>{let f=c.get(m);return a.multiple?f.includes(o):f==o}),r.addEvent("click",()=>{let m=c.get();a.multiple?m.includes(o)?c.set(m.filter(f=>f!==o)):c.set(m.concat([o])):m!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>p(r,"inherit"),height:r=>s(6+d(r)*2),paddingInline:r=>s(d(r)*3),border:"none",outline:"none",color:r=>l(r,"shift-6",n),backgroundColor:r=>l(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>l(r,"shift-1",n)},"&[aria-selected=true]":{backgroundColor:r=>l(r,"shift-2",e),color:r=>l(r,"shift-8")},"&:focus-visible":{outline:r=>`${s(.5)} solid ${l(r,"shift-5",e)}`,outlineOffset:`-${s(.5)}`}}}}function vi(t){let{options:e=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=t,a=C(t.value),c=C(i),{show:m,hide:f,anchorPartial:u}=K({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),h={onClick:()=>!r&&f()};k(t.content,h);let g={div:v=>{let x=a.get(v),b=Array.isArray(x)?x:[x];return e.filter(S=>b.includes(S.value)).map(S=>({span:S.label,$:[ye({color:o,removable:r})],_key:S.value,_onRemove:T=>{let E=a.get(),P=(Array.isArray(E)?E:[E]).filter(O=>O!==S.value);r?a.set(P):a.set(P[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},y={_onInsert:v=>{v.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(g),onClick:()=>c.get()?f():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+d(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-3","neutral")}`,paddingInline:v=>s(d(v)*2),borderRadius:v=>s(d(v)*1),fontSize:v=>p(v,"inherit"),color:v=>l(v,"shift-6",o),backgroundColor:v=>l(v,"inherit",o)}};return k(u,y),u}function xi(t={}){let{accentColor:e="primary"}=t;return{dataTone:"increase-2",type:"checkbox",_onSchedule:n=>{if(n.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:n=>p(n,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(8),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:n=>l(n,"increase-3",e)},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:n=>l(n,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:n=>p(n,"inherit"),lineHeight:1,backgroundColor:n=>l(n)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function wi(t={}){let{checked:e=!1,accentColor:n="primary",color:o="neutral"}=t,i=C(e);return{_onSchedule:r=>{r.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:r=>i.get(r),dataTone:"increase-2",onClick:()=>i.set(!i.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:r=>p(r),border:"none",outlineWidth:"1px",outline:r=>`1px solid ${l(r,"shift-2",o)}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:r=>l(r,"inherit",o),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:r=>l(r,"shift-6"),backgroundColor:r=>l(r,"decrease-2",o)},"&[aria-checked=true]":{backgroundColor:r=>l(r,"increase-3",n),outline:"none",color:r=>l(r,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ci(t={}){let{color:e="neutral"}=t;return{dataSize:"decrease-1",_onInsert:n=>{n.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e)}}}function Si(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:n=>p(n,"inherit"),fontWeight:700,color:n=>l(n,"shift-8",e)}}}function Ei(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:n=>p(n,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:n=>l(n,"shift-6",e)}}}function ki(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:n=>p(n,"decrease-1"),verticalAlign:"super",lineHeight:0,color:n=>l(n,"shift-6",e)}}}function Ti(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:n=>s(d(n)*3),paddingBlock:n=>s(d(n)*1),color:n=>l(n,"shift-7",e),backgroundColor:n=>l(n,"inherit")},"& td":{textAlign:"left",paddingInline:n=>s(d(n)*3),paddingBlock:n=>s(d(n)*1),color:n=>l(n,"shift-6",e),boxShadow:n=>`inset 0 1px 0 ${l(n,"shift-3",e)}`,fontSize:n=>p(n,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:n=>s(d(n)*3),paddingBlock:n=>s(d(n)*1),color:n=>l(n,"shift-7",e),backgroundColor:n=>l(n,"inherit"),boxShadow:n=>`inset 0 -1px 0 ${l(n,"shift-3",e)}`},"& tr":{backgroundColor:n=>l(n,"inherit")},"& tbody tr:hover":{backgroundColor:n=>l(n,"shift-2")+"!important"}}}}function _i(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:o=>s(d(o)*4),paddingBlock:o=>s(d(o)*2),border:"none",borderRadius:o=>s(d(o)*2),fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-6",e),outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-3",e)}`,backgroundColor:o=>l(o,"inherit",e),"&::placeholder":{color:o=>l(o,"shift-4")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-4",n)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",n)}`},"&:invalid":{outline:o=>`${s(.5)} solid ${l(o,"shift-4","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-5","neutral"),outline:o=>`1px solid ${l(o,"shift-3","neutral")}`,backgroundColor:o=>l(o,"shift-1","neutral")}}}}function Pi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function Ri(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-6",e),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function $i(t,e){if(e<=7)return Array.from({length:e},(r,a)=>a+1);let n=[1];t>3&&n.push("...");let o=Math.max(2,t-1),i=Math.min(e-1,t+1);for(let r=o;r<=i;r++)n.push(r);return t<e-2&&n.push("..."),n.push(e),n}function Oi(t){var c;let{total:e,color:n="neutral",accentColor:o="primary"}=t,i=C((c=t.value)!=null?c:1),r={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>s(6+d(m)*2),height:m=>s(6+d(m)*2),paddingInline:m=>s(d(m)*2),borderRadius:m=>s(d(m)*1),border:"none",cursor:"pointer",fontSize:m=>p(m,"inherit"),backgroundColor:"transparent",color:m=>l(m,"shift-6",n),"&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-1",n)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=L(R({},r),{backgroundColor:m=>l(m,"shift-2",o),color:m=>l(m,"shift-8",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-2",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let f={div:u=>{let h=i.get(u),g=[];g.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:h<=1,onClick:()=>h>1&&i.set(h-1),style:r});for(let y of $i(h,e))if(y==="...")g.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(d(v)*2),color:v=>l(v,"shift-4",n)}});else{let v=y===h;g.push({button:String(y),type:"button",ariaLabel:`Page ${y}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(y),style:v?a:r})}return g.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:h>=e,onClick:()=>h<e&&i.set(h+1),style:r}),g},style:{display:"flex",alignItems:"center",gap:s(1)}};m.children.insert(f)},style:{display:"inline-flex"}}}function Ii(t={}){let{color:e="neutral"}=t;return{role:"separator",_onInsert:n=>{n.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:s(2),fontSize:n=>p(n,"inherit"),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:n=>l(n,"shift-3",e),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:n=>l(n,"shift-3",e),borderWidth:"1px",borderBottomStyle:"solid"}}}}var ao={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Li={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},st=t=>t==="left"||t==="right";function zi(t={}){let{color:e="neutral",open:n=!1,placement:o="right",size:i}=t,r=C(n),a=st(o)?s(80):s(64),c=i!=null?i:a;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,f)=>{m.target===f.domElement&&r.set(!1)},onTransitionEnd:(m,f)=>{let u=f.domElement;r.get()||(u.close(),document.body.style.overflow="")},_onMount:m=>{let f=m.domElement,u=h=>{h?(f.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{f.style.transform="translate(0, 0)"})):f.style.transform=ao[o]};u(r.get()),r.onChange(u)},style:{transform:ao[o],transition:"transform 0.25s ease",fontSize:m=>p(m,"inherit"),color:m=>l(m,"shift-7",e),backgroundColor:m=>l(m,"inherit",e),border:"none",padding:m=>s(d(m)*3),margin:Li[o],width:st(o)?c:"100dvw",height:st(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${l(m,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:m=>l(m,"shift-1","neutral"),opacity:.75}}}}function Ai(t){let{open:e=!1,placement:n="bottom",openOn:o="click"}=t,i=null,r=C(e),{show:a,hide:c,anchorPartial:m}=K({open:r,placement:n,content:t.content,onPlacement:t.onPlacement}),f={role:"dialog",dataTone:"shift-6",onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),_onInsert:h=>{let g=h.attributes.get("id");i=g||h.nodeId,!g&&h.attributes.set("id",i)}};return k(t.content,f),k(m,{ariaHaspopup:"dialog",ariaExpanded:h=>r.get(h),onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),onClick:()=>o==="click"&&(r.get()?c():a()),onFocus:()=>a(),onBlur:()=>c(),_onMount:h=>i&&h.attributes.set("ariaControls",i)}),m}function Mi(t={}){let{position:e="top-center",color:n="neutral"}=t,o=C(!1),i=e.startsWith("top"),r=e.endsWith("center"),a=e.endsWith("right"),c={div:[],id:`domphy-toast-${e}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:r?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:m=>{let f=m.domElement.querySelector(`#domphy-toast-${e}`);return f||(f=m.children.insert(c).domElement),f},role:"status",ariaAtomic:"true",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:m=>s(d(m)*2),paddingInline:m=>s(d(m)*4),borderRadius:m=>s(d(m)*2),fontSize:m=>p(m,"inherit"),color:m=>l(m,"shift-1",n),backgroundColor:m=>l(m,"shift-9",n),boxShadow:m=>`0 ${s(2)} ${s(8)} ${l(m,"shift-3","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,f)=>{let u=h=>{h.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",u),f())};m.domElement.addEventListener("transitionend",u),o.set(!1)}}}function Ni(t={}){let{open:e=!1,placement:n="top",content:o="Tooltip Content"}=t,i=null,r=C(n),a=typeof o=="string"?{span:o}:o,{show:c,hide:m,anchorPartial:f}=K({open:e,placement:n,content:a}),u={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-11",_onInsert:g=>{let y=g.attributes.get("id");i=y||g.nodeId,!y&&g.attributes.set("id",i)},style:{paddingBlock:g=>s(d(g)*1),paddingInline:g=>s(d(g)*3),borderRadius:g=>s(d(g)*1),color:g=>l(g,"shift-6"),backgroundColor:g=>l(g),fontSize:g=>p(g,"inherit")},$:[rt({placement:n,bordered:!1})]};return a.$||(a.$=[]),a.$.push(u),k(f,{onMouseEnter:()=>c(),onMouseLeave:()=>m(),onFocus:()=>c(),onBlur:()=>m(),onKeyDown:g=>g.key==="Escape"&&m(),_onMount:g=>i&&g.attributes.set("ariaDescribedby",i)}),f}function co(t,e){return t.key!==void 0&&t.key!==null?String(t.key):`index-${e}`}function Di(t={}){let{duration:e=300,delay:n=0}=t,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((r,a)=>{if(!(r instanceof I))return;let c=r.domElement;c&&o.set(co(r,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((r,a)=>{if(!(r instanceof I))return;let c=r.domElement;if(!c)return;let m=co(r,a),f=o.get(m);if(!f)return;let u=c.getBoundingClientRect(),h=f.left-u.left,g=f.top-u.top;if(Math.abs(h)<.5&&Math.abs(g)<.5)return;let y=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${h}px, ${g}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${e}ms ease ${n}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=y,c.style.transform=v,c.removeEventListener("transitionend",b)},b=w=>{w.propertyName==="transform"&&x()};c.addEventListener("transitionend",b),setTimeout(x,e+n+34)}),o.clear()}}}function Bi(t={}){return{role:"tablist",_onSchedule:(n,o)=>{let i={_context:{tabs:{activeKey:C(t.activeKey||0)}}};k(o,i)}}}function Hi(t={}){let{accentColor:e="primary",color:n="neutral"}=t;return{role:"tab",_onInsert:i=>{var f;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let r=i.getContext("tabs"),a=(f=i.parent)==null?void 0:f.children.items;a=a.filter(u=>u.type=="ElementNode"&&u.attributes.get("role")=="tab");let c=i.key||a.findIndex(u=>u==i),m={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:u=>r.activeKey.get(u)==c,onClick:()=>r.activeKey.set(c),onKeyDown:u=>{var b,w,S,T;let h=u.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(h))return;u.preventDefault();let g=((w=(b=i.parent)==null?void 0:b.children.items)!=null?w:[]).filter(E=>E.type==="ElementNode"&&E.attributes.get("role")==="tab"),y=g.findIndex(E=>E===i),v=y;h==="ArrowRight"?v=(y+1)%g.length:h==="ArrowLeft"?v=(y-1+g.length)%g.length:h==="Home"?v=0:h==="End"&&(v=g.length-1);let x=g[v];r.activeKey.set((S=x.key)!=null?S:v),(T=x.domElement)==null||T.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>p(i,"inherit"),height:i=>s(6+d(i)*2),paddingInline:i=>s(d(i)*4),border:"none",outline:"none",color:i=>l(i,"shift-6"),backgroundColor:i=>l(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-2",n)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-3",n)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-4",e)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",e)}`}}}}function Fi(){return{role:"tabpanel",style:{paddingBlock:e=>s(d(e)*2),paddingInline:e=>s(d(e)*2)},_onInsert:e=>{var a;let n=e.getContext("tabs"),o=(a=e.parent)==null?void 0:a.children.items;o=o.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tabpanel");let i=e.key||o.findIndex(c=>c==e),r={id:"tabpanel"+e.parent.nodeId+i,ariaLabelledby:"tab"+e.parent.nodeId+i,hidden:c=>n.activeKey.get(c)!=i};e.merge(r)}}}function ji(t={}){let{color:e="neutral"}=t;return{role:"menu",dataTone:"shift-11",_onSchedule:(o,i)=>{let r={_context:{menu:{activeKey:C(t.activeKey||0)}}};k(i,r)},style:{display:"flex",flexDirection:"column",paddingBlock:o=>s(d(o)*2),paddingInline:o=>s(d(o)*2),fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o,"inherit",e)}}}function Vi(t={}){let{accentColor:e="primary",color:n="neutral"}=t;return{role:"menuitem",_onInsert:i=>{var m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let r=i.getContext("menu"),a=(m=i.parent)==null?void 0:m.children.items;a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="menuitem");let c=i.key||a.findIndex(f=>f==i);i.attributes.set("ariaCurrent",f=>r.activeKey.get(f)==c||void 0),i.addEvent("click",()=>r.activeKey.set(c))},onKeyDown:(i,r)=>{var u,h,g;let a=i.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((h=(u=r.parent)==null?void 0:u.children.items)!=null?h:[]).filter(y=>y.type==="ElementNode"&&y.attributes.get("role")==="menuitem"),m=c.findIndex(y=>y===r),f=m;a==="ArrowDown"?f=(m+1)%c.length:a==="ArrowUp"?f=(m-1+c.length)%c.length:a==="Home"?f=0:a==="End"&&(f=c.length-1),(g=c[f].domElement)==null||g.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>p(i,"inherit"),height:i=>s(6+d(i)*2),paddingInline:i=>s(d(i)*3),border:"none",outline:"none",color:i=>l(i,"shift-6"),backgroundColor:i=>l(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>l(i,"shift-1")},"&[aria-current=true]":{backgroundColor:i=>l(i,"shift-1",e),color:i=>l(i,"shift-7")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-5",e)}`,outlineOffset:`-${s(.5)}`}}}}function Wi(t){return{_onSchedule:(e,n)=>{k(n,{_context:{form:t}})}}}function Ui(t,e){return{_onInsert:n=>{let i=n.getContext("form").setField(t,void 0,e),r=n.tagName,a=n.attributes.get("type");["input","select","textarea"].includes(r)||console.warn('"field" patch must use input, select, or textarea tag');let c={onBlur:()=>i.setTouched(),ariaInvalid:m=>!!i.message("error",m)||void 0,dataStatus:m=>i.status(m)};r==="input"&&a==="checkbox"?(c.checked=i.value(),c.onChange=m=>i.setValue(m.target.checked)):r==="input"&&a==="radio"?c.onChange=m=>i.setValue(m.target.value):r==="select"?(c.value=i.value(),c.onChange=m=>i.setValue(m.target.value)):r==="textarea"?(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)):(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)),n.merge(c)}}}function Ki(t){return!!t&&typeof t.then=="function"}var ke=class{constructor(e,n){this._notifier=new pe;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=e,this._initValue=e,this._validator=n,n&&this.validate()}value(e){return e&&this._notifier.addListener("value",e),this._value}setValue(e){this._value=e,this._notifier.notify("value",e),this._notifier.notify("dirty",e!==this._initValue),this.validate()}dirty(e){return e&&this._notifier.addListener("dirty",e),this._value!==this._initValue}touched(e){return e&&this._notifier.addListener("touched",e),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(e,n){let o=!1;e!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=e,this._initValue=e,this._notifier.notify("value",e),this._notifier.notify("dirty",!1),o=!0),n!==void 0&&n!==this._validator&&(this._validator=n,o=!0),o&&this.validate()}message(e,n){return n&&this._notifier.addListener(e,n),this._messages[e]}status(e){return e&&this._notifier.addListener("status",e),Fe(this._messages)}setMessages(e){let n=this._messages;this._messages=e;for(let o of["error","warning","success"])n[o]!==e[o]&&this._notifier.notify(o,e[o]);Fe(n)!==Fe(e)&&this._notifier.notify("status",Fe(e))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let e=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let n=this._validator(this._value);Ki(n)?(this._pending=!0,Promise.resolve(n).then(o=>{e===this._validationToken&&(this._pending=!1,this.setMessages(o!=null?o:{}))}).catch(o=>{e===this._validationToken&&(this._pending=!1,console.error(o))})):(this._pending=!1,this.setMessages(n!=null?n:{}))}catch(n){e===this._validationToken&&(this._pending=!1),console.error(n)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function Fe(t){if(t.error)return"error";if(t.warning)return"warning";if(t.success)return"success"}var lt=class{constructor(){this.fields=new Map}setField(e,n,o){let i=this.fields.get(e);return i?i.configure(n,o):(i=new ke(n,o),this.fields.set(e,i)),i}getField(e){return this.setField(e)}removeField(e){var n;(n=this.fields.get(e))==null||n._dispose(),this.fields.delete(e)}get valid(){for(let e of this.fields.values())if(e._pending||e._messages.error)return!1;return!0}reset(){for(let e of this.fields.values())e.reset()}snapshot(){let e={};for(let[n,o]of this.fields)qi(e,n,o._value);return e}_dispose(){for(let e of this.fields.values())e._dispose();this.fields.clear()}};function qi(t,e,n){let o=e.split("."),i=t;for(let r=0;r<o.length-1;r++){let a=o[r];i[a]==null&&(i[a]=isNaN(Number(o[r+1]))?{}:[]),i=i[a]}i[o[o.length-1]]=n}return yo(Gi);})();
3
+ ${i}}`}function me(t){if(!ce[t])throw Error(`Theme "${t}" not found`);return ce[t]}function No(t,e){Mo(e),ce[t]||(ce[t]=structuredClone(ye)),Rt(ce[t],e)}function $t(t){let e=structuredClone(t);e.direction="lighten";for(let n in e.colors)e.colors[n].reverse(),e.baseTones[n]=e.colors[n].length-1-e.baseTones[n];return e}function Do(t){let e=me(t),n=tt(e),o={};for(let i in e){let r=e[i];if(i==="colors")for(let a in e.colors){let c={};[...Array(n).keys()].forEach(m=>c[m]=e.colors[a][m]),o[a]=c}else if(i==="fontSizes")o.fontSizes=e.fontSizes;else if(i==="densities")o.densities=e.densities;else if(o[i]={},typeof r=="object"&&r!==null)for(let a in r)o[i][a]=r[a]}return o}function be(){let t=me("light"),e=tt(t),n={};for(let o in t){let i=o,r=t[o];if(o==="colors")for(let a in t.colors){let c={};[...Array(e).keys()].forEach(m=>c[m]=`var(--${a}-${m})`),n[a]=c}else if(o==="fontSizes")n.fontSizes=[...Array(8).keys()].map(a=>`var(--fontSize-${a})`);else{if(o==="densities")continue;if(n[i]={},typeof r=="object"&&r!==null)for(let a in r)n[i][a]=`var(--${i}-${a.replace("/","_")})`}}return n}function Ze(){return Object.entries(ce).map(([t,e])=>Ao(t,e)).join(`
4
+ `)}function Bo(t){var e;if(typeof document!="undefined")if(t){t.textContent=Ze();return}else t=(e=document.getElementById("domphy-themes"))!=null?e:Object.assign(document.createElement("style"),{id:"domphy-themes"}),t.textContent=Ze(),document.head.appendChild(t)}function l(t){return t/4+"em"}function ze(t){let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataTheme"));)e=e.parent;let n="light";return e&&e.attributes&&e.attributes.has("dataTheme")&&(n=e.attributes.get("dataTheme"),typeof t=="function"&&e.attributes.onChange("dataTheme",t)),n}var Qe=["inherit"];[...Array(8).keys()].forEach(t=>{Qe.push(`decrease-${t}`),Qe.push(`increase-${t}`)});function Ot(t,e="inherit"){if(!Qe.includes(e))throw Error(`size name "${e}" invalid`);let n;if(e=="inherit")n=t;else if(e!=null&&e.startsWith("increase-")){let o=parseInt(e.replace("increase-",""),10);n=t+o}else if(e!=null&&e.startsWith("decrease-")){let o=parseInt(e.replace("decrease-",""),10);n=t-o}else n=t;return Math.max(0,Math.min(8,n))}function Ho(t){if(!t)return 2;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataSize"));)e=e.parent;let n=2;return e&&e.attributes&&e.attributes.has("dataSize")&&(n=Ot(n,e.attributes.get("dataSize")),typeof t=="function"&&e.attributes.onChange("dataSize",t)),n}function d(t,e="inherit"){let n=Ot(Ho(t),e);return be().fontSizes[n]}var et=["inherit"];[...Array(5).keys()].forEach(t=>{et.push(`decrease-${t}`),et.push(`increase-${t}`)});function Fo(t,e="inherit"){if(!et.includes(e))throw Error(`density name "${e}" invalid`);let n;if(e=="inherit")n=t;else if(e!=null&&e.startsWith("increase-")){let o=parseInt(e.replace("increase-",""),10);n=t+o}else if(e!=null&&e.startsWith("decrease-")){let o=parseInt(e.replace("decrease-",""),10);n=t-o}else n=t;return Math.max(0,Math.min(4,n))}function jo(t){if(!t)return 2;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataDensity"));)e=e.parent;let n=2;return e&&e.attributes&&e.attributes.has("dataDensity")&&(n=Fo(n,e.attributes.get("dataDensity")),typeof t=="function"&&e.attributes.onChange("dataDensity",t)),n}function p(t){let e=jo(t);return me(t?ze(t):"light").densities[e]}var Q=ye.colors.neutral.length,Le=["inherit","base"];[...Array(Q).keys()].forEach(t=>{Le.push(`decrease-${t}`),Le.push(`increase-${t}`),Le.push(`shift-${t}`)});function Pt(t,e){if(t<0||t>Q-1)return t;let n=t+e;return n=Math.max(0,Math.min(Q-1,n)),n}function Wo(t,e){if(t<0||t>Q-1)return t;let n=Math.floor((Q-1)/2),o=t<=n?t+e:t-e;return o=o<0||o>Q-1?-o:o,o=Math.max(0,Math.min(Q-1,o)),o}function Me(t,e="inherit"){if(typeof e=="number")return e;if(e=="inherit")return t;if(!Le.includes(e))throw Error(`tone name "${e}" invalid`);if(e.startsWith("increase-")){let n=parseInt(e.replace("increase-",""),10);return Pt(t,n)}else if(e.startsWith("decrease-")){let n=parseInt(e.replace("decrease-",""),10);return Pt(t,-n)}else if(e.startsWith("shift-")){let n=parseInt(e.replace("shift-",""),10);return Wo(t,n)}else return t}function It(t){if(!t)return 0;let e=typeof t=="function"?t.elementNode:t;for(;e&&(!e.attributes||!e.attributes.get("dataTone"));)e=e.parent;let n=0;return e&&e.attributes&&e.attributes.has("dataTone")&&(n=Me(n,e.attributes.get("dataTone")),typeof t=="function"&&e.attributes.onChange("dataTone",t)),n}function Vo(t,e="inherit"){return Me(It(t),e)}function Uo(t,e="inherit",n="inherit"){let o=typeof t=="function"?t.elementNode:t,i=n=="inherit"?o.getContext("themeColor")||"neutral":n,r;return e=="base"?r=me(ze(t)).baseTones[i]:r=Me(It(t),e),be()[i][r]}function s(t,e="inherit",n="inherit"){let o=n=="inherit"?"neutral":n;if(!t)return be()[o][Me(0,e)];let i;return e=="base"?i=me(ze(t)).baseTones[o]:i=Vo(t,e),be()[o][i]}var Ve={};$e(Ve,{FieldState:()=>Te,FormState:()=>ft,abbreviation:()=>Ko,alert:()=>nn,avatar:()=>rn,badge:()=>sn,blockquote:()=>An,breadcrumb:()=>ln,breadcrumbEllipsis:()=>an,button:()=>Nn,buttonSwitch:()=>vi,card:()=>qo,code:()=>Bn,combobox:()=>Mn,command:()=>Jo,commandItem:()=>Qo,commandSearch:()=>Zo,descriptionList:()=>Fn,details:()=>Hn,dialog:()=>jn,divider:()=>$i,drawer:()=>Ii,emphasis:()=>Wn,field:()=>Wi,figure:()=>Vn,form:()=>ji,formGroup:()=>Un,heading:()=>qn,horizontalRule:()=>Gn,icon:()=>Xn,image:()=>Yn,inputCheckbox:()=>Dn,inputColor:()=>Jn,inputDateTime:()=>Zn,inputFile:()=>Qn,inputNumber:()=>ni,inputOTP:()=>on,inputRadio:()=>fi,inputRange:()=>oi,inputSearch:()=>ei,inputSwitch:()=>bi,inputText:()=>ti,keyboard:()=>ii,label:()=>ri,link:()=>si,mark:()=>li,menu:()=>Hi,menuItem:()=>Fi,orderedList:()=>Ti,pagination:()=>Ri,paragraph:()=>ai,popover:()=>Li,popoverArrow:()=>ct,preformated:()=>ci,progress:()=>mi,select:()=>hi,selectBox:()=>yi,selectItem:()=>gi,selectList:()=>pi,skeleton:()=>ui,small:()=>xi,spinner:()=>di,splitter:()=>Go,splitterHandle:()=>Xo,splitterPanel:()=>Yo,strong:()=>Ci,subscript:()=>wi,superscript:()=>Si,tab:()=>Di,tabPanel:()=>Bi,table:()=>Ei,tabs:()=>Ni,tag:()=>ve,textarea:()=>ki,toast:()=>zi,toggle:()=>en,toggleGroup:()=>tn,tooltip:()=>Mi,transitionGroup:()=>Ai,unorderedList:()=>_i});function Ko(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:o=>d(o),backgroundColor:o=>s(o),color:o=>s(o,"shift-10",e),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:o=>s(o,"shift-7",e),textUnderlineOffset:l(.72),cursor:"help","&:hover":{color:o=>s(o,"shift-11",n),textDecorationColor:o=>s(o,"shift-9",n)}}}}function qo(t={}){let{color:e="neutral"}=t;return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:n=>l(p(n)*2),backgroundColor:n=>s(n,"inherit",e),color:n=>s(n,"shift-10",e),outline:n=>`1px solid ${s(n,"shift-4",e)}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:n=>l(p(n)*2),paddingInline:n=>l(p(n)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:n=>l(p(n)*4),color:n=>s(n,"shift-9",e),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:n=>l(p(n)*2),height:"auto"},"& > div":{gridArea:"content",padding:n=>l(p(n)*4),color:n=>s(n,"shift-10",e)},"& > footer":{gridArea:"footer",display:"flex",gap:l(2),paddingBlock:n=>l(p(n)*2),paddingInline:n=>l(p(n)*4),borderTop:n=>`1px solid ${s(n,"shift-3",e)}`}}}}function Go(t={}){let{direction:e="horizontal",defaultSize:n=50,min:o=10,max:i=90}=t;return{_onSchedule:(r,a)=>{k(a,{_context:{splitter:{direction:e,size:w(n),min:o,max:i}}})},style:{display:"flex",flexDirection:e==="horizontal"?"row":"column",overflow:"hidden"}}}function Yo(){return{_onMount:t=>{let e=t.getContext("splitter"),n=t.domElement,o=e.direction==="horizontal"?"width":"height";n.style[o]=`${e.size.get()}%`,n.style.flexShrink="0",n.style.overflow="auto";let i=e.size.onChange(r=>{n.style[o]=`${r}%`});t.addHook("Remove",i)}}}function Xo(){return{_onMount:t=>{let e=t.getContext("splitter"),n=t.domElement,o=e.direction==="horizontal";n.style.cursor=o?"col-resize":"row-resize";let i=r=>{r.preventDefault();let a=n.parentElement,c=f=>{let h=a.getBoundingClientRect(),u=o?(f.clientX-h.left)/h.width*100:(f.clientY-h.top)/h.height*100;e.size.set(Math.min(Math.max(u,e.min),e.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};n.addEventListener("mousedown",i),t.addHook("Remove",()=>n.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t=>s(t,"shift-2"),"&:hover":{backgroundColor:t=>s(t,"shift-3")},"&::after":{content:'""',borderRadius:l(999),backgroundColor:t=>s(t,"shift-4")}}}}function Jo(){return{_onSchedule:(t,e)=>{k(e,{_context:{command:{query:w("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Zo(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command"),r=o.domElement,a=()=>i.query.set(r.value);r.addEventListener("input",a),o.addHook("Remove",()=>r.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*2),border:"none",borderBottom:o=>`1px solid ${s(o,"shift-3",e)}`,outline:"none",color:o=>s(o,"shift-10",e),backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>s(o,"shift-6",n)}}}}function Qo(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{role:"option",_onMount:o=>{var m,f;let i=o.getContext("command"),r=o.domElement,a=(f=(m=r.textContent)==null?void 0:m.toLowerCase())!=null?f:"",c=i.query.onChange(h=>{r.hidden=h.length>0&&!a.includes(h.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>d(o,"inherit"),height:o=>l(6+p(o)*2),paddingInline:o=>l(p(o)*3),border:"none",outline:"none",color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),"&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-2",e)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`,outlineOffset:`-${l(.5)}`}}}}function en(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{role:"button",_onInsert:o=>{var m;o.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let i=o.getContext("toggleGroup"),a=((m=o.parent)==null?void 0:m.children.items).filter(f=>f.type==="ElementNode"&&f.attributes.get("role")==="button"),c=String(a.findIndex(f=>f===o));o.attributes.set("ariaPressed",f=>{let h=i.value.get(f);return Array.isArray(h)?h.includes(c):h===c}),o.addEvent("click",()=>{let f=i.value.get();if(i.multiple){let h=Array.isArray(f)?[...f]:[];i.value.set(h.includes(c)?h.filter(u=>u!==c):[...h,c])}else i.value.set(f===c?"":c)})},style:{cursor:"pointer",fontSize:o=>d(o,"inherit"),height:l(6),paddingBlock:l(1),paddingInline:l(2),border:"none",borderRadius:l(1),color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-2",e)},"&[aria-pressed=true]":{backgroundColor:o=>s(o,"shift-6",n),color:o=>s(o,"shift-11",n)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`,outlineOffset:`-${l(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function tn(t={}){var o;let{multiple:e=!1,color:n="neutral"}=t;return{role:"group",dataTone:"shift-2",_context:{toggleGroup:{value:w((o=t.value)!=null?o:e?[]:""),multiple:e}},style:{display:"flex",paddingBlock:l(1),paddingInline:l(1),gap:l(1),borderRadius:l(2),fontSize:i=>d(i,"inherit"),backgroundColor:i=>s(i,"inherit",n),outline:i=>`1px solid ${s(i,"shift-3",n)}`,outlineOffset:"-1px"}}}function on(){return{style:{display:"flex",alignItems:"center",gap:l(2),"& > *":{minWidth:l(9)+"!important"}},_onMount:t=>{let e=t.domElement,n=()=>Array.from(e.querySelectorAll("input")),o=a=>{let c=n(),m=a.target,f=c.indexOf(m);m.value&&f<c.length-1&&c[f+1].focus()},i=a=>{let c=n(),m=a.target,f=c.indexOf(m);a.key==="Backspace"&&!m.value&&f>0&&c[f-1].focus(),a.key==="ArrowLeft"&&f>0&&c[f-1].focus(),a.key==="ArrowRight"&&f<c.length-1&&c[f+1].focus()},r=a=>{var u,g,y;a.preventDefault();let c=(g=(u=a.clipboardData)==null?void 0:u.getData("text"))!=null?g:"",m=n(),f=m.indexOf(a.target);[...c].forEach((b,x)=>{m[f+x]&&(m[f+x].value=b)});let h=Math.min(f+c.length-1,m.length-1);(y=m[h])==null||y.focus()};e.addEventListener("input",o),e.addEventListener("keydown",i),e.addEventListener("paste",r),t.addHook("Remove",()=>{e.removeEventListener("input",o),e.removeEventListener("keydown",i),e.removeEventListener("paste",r)})}}}function nn(t={}){let{color:e="primary"}=t;return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:l(3),paddingBlock:n=>l(p(n)*2),paddingInline:n=>l(p(n)*4),boxShadow:n=>`inset ${l(1)} 0 0 0 ${s(n,"shift-8",e)}`,backgroundColor:n=>s(n,"inherit",e),color:n=>s(n,"shift-10",e),fontSize:n=>d(n,"inherit")}}}function rn(t={}){let{color:e="primary"}=t;return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:l(9),height:l(9),fontSize:n=>d(n,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:n=>s(n,"inherit",e),color:n=>s(n,"shift-11",e),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function sn(t={}){let{color:e="danger",label:n=999}=t,o=w(n);return{style:{position:"relative","&::after":{content:i=>`"${o.get(i)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:l(1),minWidth:l(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:i=>d(i,"decrease-1"),borderRadius:l(999),backgroundColor:i=>s(i,"shift-9",e),color:i=>s(i,"shift-0",e)}}}}function ln(t={}){let{color:e="neutral",separator:n="/"}=t;return{_onInsert:o=>{o.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:o=>d(o,"inherit"),gap:l(1),color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),"& > *":{display:"inline-flex",alignItems:"center",color:o=>s(o,"shift-8",e)},"& > *:not(:last-child)::after":{content:`"${n}"`,color:o=>s(o,"shift-4",e),paddingInlineStart:l(1)},"& > [aria-current=page]":{color:o=>s(o,"shift-10",e),pointerEvents:"none"}}}}function an(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>d(n,"inherit"),paddingInline:l(1),border:"none",background:"none",cursor:"pointer",color:n=>s(n,"shift-8",e),borderRadius:l(1),"&:hover":{color:n=>s(n,"shift-10",e),backgroundColor:n=>s(n,"shift-2",e)},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-6",e)}`,outlineOffset:l(.5)}}}}var cn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function ve(t={}){let{color:e="neutral",removable:n=!1}=t;return{dataTone:"shift-2",_onInit:o=>{let i={span:cn,onClick:r=>{r.stopPropagation(),o.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:l(1),width:l(4),height:l(4),flexShrink:0,"&:hover":{backgroundColor:r=>s(r,"shift-4",e)}}};n&&o.children.insert(i)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:l(6),paddingBlock:"0px",borderRadius:l(1),paddingInlineStart:l(2),paddingInlineEnd:n?l(1):l(2),gap:l(2),fontSize:o=>d(o,"inherit"),backgroundColor:o=>s(o,"inherit",e),color:o=>s(o,"shift-9",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`}}}var fe=Math.min,F=Math.max,Ce=Math.round,we=Math.floor,N=t=>({x:t,y:t}),mn={left:"right",right:"left",bottom:"top",top:"bottom"};function ot(t,e,n){return F(t,fe(e,n))}function Se(t,e){return typeof t=="function"?t(e):t}function U(t){return t.split("-")[0]}function Ee(t){return t.split("-")[1]}function nt(t){return t==="x"?"y":"x"}function it(t){return t==="y"?"height":"width"}function j(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function rt(t){return nt(j(t))}function Mt(t,e,n){n===void 0&&(n=!1);let o=Ee(t),i=rt(t),r=it(i),a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=xe(a)),[a,xe(a)]}function At(t){let e=xe(t);return[Ne(t),e,Ne(e)]}function Ne(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Lt=["left","right"],zt=["right","left"],fn=["top","bottom"],hn=["bottom","top"];function un(t,e,n){switch(t){case"top":case"bottom":return n?e?zt:Lt:e?Lt:zt;case"left":case"right":return e?fn:hn;default:return[]}}function Nt(t,e,n,o){let i=Ee(t),r=un(U(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(Ne)))),r}function xe(t){let e=U(t);return mn[e]+t.slice(e.length)}function dn(t){return R({top:0,right:0,bottom:0,left:0},t)}function Dt(t){return typeof t!="number"?dn(t):{top:t,right:t,bottom:t,left:t}}function ee(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Bt(t,e,n){let{reference:o,floating:i}=t,r=j(e),a=rt(e),c=it(a),m=U(e),f=r==="y",h=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,g=o[c]/2-i[c]/2,y;switch(m){case"top":y={x:h,y:o.y-i.height};break;case"bottom":y={x:h,y:o.y+o.height};break;case"right":y={x:o.x+o.width,y:u};break;case"left":y={x:o.x-i.width,y:u};break;default:y={x:o.x,y:o.y}}switch(Ee(e)){case"start":y[a]-=g*(n&&f?-1:1);break;case"end":y[a]+=g*(n&&f?-1:1);break}return y}function Ht(t,e){return H(this,null,function*(){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:a,elements:c,strategy:m}=t,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:g=!1,padding:y=0}=Se(e,t),b=Dt(y),v=c[g?u==="floating"?"reference":"floating":u],C=ee(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(v))==null||n?v:v.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:m})),S=u==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,_=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),E=(yield r.isElement==null?void 0:r.isElement(_))?(yield r.getScale==null?void 0:r.getScale(_))||{x:1,y:1}:{x:1,y:1},T=ee(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:_,strategy:m}):S);return{top:(C.top-T.top+b.top)/E.y,bottom:(T.bottom-C.bottom+b.bottom)/E.y,left:(C.left-T.left+b.left)/E.x,right:(T.right-C.right+b.right)/E.x}})}var pn=50,Ft=(t,e,n)=>H(null,null,function*(){let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,c=a.detectOverflow?a:A(R({},a),{detectOverflow:Ht}),m=yield a.isRTL==null?void 0:a.isRTL(e),f=yield a.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:u}=Bt(f,o,m),g=o,y=0,b={};for(let x=0;x<r.length;x++){let v=r[x];if(!v)continue;let{name:C,fn:S}=v,{x:_,y:E,data:T,reset:P}=yield S({x:h,y:u,initialPlacement:o,placement:g,strategy:i,middlewareData:b,rects:f,platform:c,elements:{reference:t,floating:e}});h=_!=null?_:h,u=E!=null?E:u,b[C]=R(R({},b[C]),T),P&&y<pn&&(y++,typeof P=="object"&&(P.placement&&(g=P.placement),P.rects&&(f=P.rects===!0?yield a.getElementRects({reference:t,floating:e,strategy:i}):P.rects),{x:h,y:u}=Bt(f,g,m)),x=-1)}return{x:h,y:u,placement:g,strategy:i,middlewareData:b}});var jt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,fn(n){return H(this,null,function*(){var o,i;let{placement:r,middlewareData:a,rects:c,initialPlacement:m,platform:f,elements:h}=n,gt=Se(t,n),{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0}=gt,C=qe(gt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let S=U(r),_=j(m),E=U(m)===m,T=yield f.isRTL==null?void 0:f.isRTL(h.floating),P=y||(E||!v?[xe(m)]:At(m)),O=x!=="none";!y&&O&&P.push(...Nt(m,v,x,T));let ht=[m,...P],re=yield f.detectOverflow(n,C),se=[],le=((i=a.flip)==null?void 0:i.overflows)||[];if(u&&se.push(re[S]),g){let q=Mt(r,c,T);se.push(re[q[0]],re[q[1]])}if(le=[...le,{placement:r,overflows:se}],!se.every(q=>q<=0)){var ut,dt;let q=(((ut=a.flip)==null?void 0:ut.index)||0)+1,Ue=ht[q];if(Ue&&(!(g==="alignment"?_!==j(Ue):!1)||le.every(M=>j(M.placement)===_?M.overflows[0]>0:!0)))return{data:{index:q,overflows:le},reset:{placement:Ue}};let pe=(dt=le.filter(G=>G.overflows[0]<=0).sort((G,M)=>G.overflows[1]-M.overflows[1])[0])==null?void 0:dt.placement;if(!pe)switch(b){case"bestFit":{var pt;let G=(pt=le.filter(M=>{if(O){let V=j(M.placement);return V===_||V==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(V=>V>0).reduce((V,po)=>V+po,0)]).sort((M,V)=>M[1]-V[1])[0])==null?void 0:pt[0];G&&(pe=G);break}case"initialPlacement":pe=m;break}if(r!==pe)return{reset:{placement:pe}}}return{}})}}};var gn=new Set(["left","top"]);function yn(t,e){return H(this,null,function*(){let{placement:n,platform:o,elements:i}=t,r=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=U(n),c=Ee(n),m=j(n)==="y",f=gn.has(a)?-1:1,h=r&&m?-1:1,u=Se(e,t),{mainAxis:g,crossAxis:y,alignmentAxis:b}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),m?{x:y*h,y:g*f}:{x:g*f,y:y*h}})}var Wt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(n){return H(this,null,function*(){var o,i;let{x:r,y:a,placement:c,middlewareData:m}=n,f=yield yn(n,t);return c===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:r+f.x,y:a+f.y,data:A(R({},f),{placement:c})}})}}},Vt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,fn(n){return H(this,null,function*(){let{x:o,y:i,placement:r,platform:a}=n,S=Se(t,n),{mainAxis:c=!0,crossAxis:m=!1,limiter:f={fn:_=>{let{x:E,y:T}=_;return{x:E,y:T}}}}=S,h=qe(S,["mainAxis","crossAxis","limiter"]),u={x:o,y:i},g=yield a.detectOverflow(n,h),y=j(U(r)),b=nt(y),x=u[b],v=u[y];if(c){let _=b==="y"?"top":"left",E=b==="y"?"bottom":"right",T=x+g[_],P=x-g[E];x=ot(T,x,P)}if(m){let _=y==="y"?"top":"left",E=y==="y"?"bottom":"right",T=v+g[_],P=v-g[E];v=ot(T,v,P)}let C=f.fn(A(R({},n),{[b]:x,[y]:v}));return A(R({},C),{data:{x:C.x-o,y:C.y-i,enabled:{[b]:c,[y]:m}}})})}}};function De(){return typeof window!="undefined"}function oe(t){return Kt(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function D(t){var e;return(e=(Kt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Kt(t){return De()?t instanceof Node||t instanceof $(t).Node:!1}function L(t){return De()?t instanceof Element||t instanceof $(t).Element:!1}function B(t){return De()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Ut(t){return!De()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}function ue(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function qt(t){return/^(table|td|th)$/.test(oe(t))}function ke(t){try{if(t.matches(":popover-open"))return!0}catch(e){}try{return t.matches(":modal")}catch(e){return!1}}var bn=/transform|translate|scale|rotate|perspective|filter/,vn=/paint|layout|strict|content/,te=t=>!!t&&t!=="none",st;function Be(t){let e=L(t)?z(t):t;return te(e.transform)||te(e.translate)||te(e.scale)||te(e.rotate)||te(e.perspective)||!He()&&(te(e.backdropFilter)||te(e.filter))||bn.test(e.willChange||"")||vn.test(e.contain||"")}function Gt(t){let e=W(t);for(;B(e)&&!ne(e);){if(Be(e))return e;if(ke(e))return null;e=W(e)}return null}function He(){return st==null&&(st=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),st}function ne(t){return/^(html|body|#document)$/.test(oe(t))}function z(t){return $(t).getComputedStyle(t)}function _e(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if(oe(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Ut(t)&&t.host||D(t);return Ut(e)?e.host:e}function Yt(t){let e=W(t);return ne(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&ue(e)?e:Yt(e)}function he(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Yt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=$(i);if(r){let c=Fe(a);return e.concat(a,a.visualViewport||[],ue(i)?i:[],c&&n?he(c):[])}else return e.concat(i,he(i,[],n))}function Fe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qt(t){let e=z(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=B(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,c=Ce(n)!==r||Ce(o)!==a;return c&&(n=r,o=a),{width:n,height:o,$:c}}function at(t){return L(t)?t:t.contextElement}function de(t){let e=at(t);if(!B(e))return N(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Qt(e),a=(r?Ce(n.width):n.width)/o,c=(r?Ce(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var xn=N(0);function eo(t){let e=$(t);return!He()||!e.visualViewport?xn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Cn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==$(t)?!1:e}function ie(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=at(t),a=N(1);e&&(o?L(o)&&(a=de(o)):a=de(t));let c=Cn(r,n,o)?eo(r):N(0),m=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,h=i.width/a.x,u=i.height/a.y;if(r){let g=$(r),y=o&&L(o)?$(o):o,b=g,x=Fe(b);for(;x&&o&&y!==b;){let v=de(x),C=x.getBoundingClientRect(),S=z(x),_=C.left+(x.clientLeft+parseFloat(S.paddingLeft))*v.x,E=C.top+(x.clientTop+parseFloat(S.paddingTop))*v.y;m*=v.x,f*=v.y,h*=v.x,u*=v.y,m+=_,f+=E,b=$(x),x=Fe(b)}}return ee({width:h,height:u,x:m,y:f})}function je(t,e){let n=_e(t).scrollLeft;return e?e.left+n:ie(D(t)).left+n}function to(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-je(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function wn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",a=D(o),c=e?ke(e.floating):!1;if(o===a||c&&r)return n;let m={scrollLeft:0,scrollTop:0},f=N(1),h=N(0),u=B(o);if((u||!u&&!r)&&((oe(o)!=="body"||ue(a))&&(m=_e(o)),u)){let y=ie(o);f=de(o),h.x=y.x+o.clientLeft,h.y=y.y+o.clientTop}let g=a&&!u&&!r?to(a,m):N(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-m.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-m.scrollTop*f.y+h.y+g.y}}function Sn(t){return Array.from(t.getClientRects())}function En(t){let e=D(t),n=_e(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+je(t),c=-n.scrollTop;return z(o).direction==="rtl"&&(a+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:c}}var Xt=25;function kn(t,e){let n=$(t),o=D(t),i=n.visualViewport,r=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){r=i.width,a=i.height;let h=He();(!h||h&&e==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let f=je(o);if(f<=0){let h=o.ownerDocument,u=h.body,g=getComputedStyle(u),y=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(o.clientWidth-u.clientWidth-y);b<=Xt&&(r-=b)}else f<=Xt&&(r+=f);return{width:r,height:a,x:c,y:m}}function _n(t,e){let n=ie(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?de(t):N(1),a=t.clientWidth*r.x,c=t.clientHeight*r.y,m=i*r.x,f=o*r.y;return{width:a,height:c,x:m,y:f}}function Jt(t,e,n){let o;if(e==="viewport")o=kn(t,n);else if(e==="document")o=En(D(t));else if(L(e))o=_n(e,n);else{let i=eo(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ee(o)}function oo(t,e){let n=W(t);return n===e||!L(n)||ne(n)?!1:z(n).position==="fixed"||oo(n,e)}function Tn(t,e){let n=e.get(t);if(n)return n;let o=he(t,[],!1).filter(c=>L(c)&&oe(c)!=="body"),i=null,r=z(t).position==="fixed",a=r?W(t):t;for(;L(a)&&!ne(a);){let c=z(a),m=Be(a);!m&&c.position==="fixed"&&(i=null),(r?!m&&!i:!m&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||ue(a)&&!m&&oo(t,a))?o=o.filter(h=>h!==a):i=c,a=W(a)}return e.set(t,o),o}function Pn(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,a=[...n==="clippingAncestors"?ke(e)?[]:Tn(e,this._c):[].concat(n),o],c=Jt(e,a[0],i),m=c.top,f=c.right,h=c.bottom,u=c.left;for(let g=1;g<a.length;g++){let y=Jt(e,a[g],i);m=F(y.top,m),f=fe(y.right,f),h=fe(y.bottom,h),u=F(y.left,u)}return{width:f-u,height:h-m,x:u,y:m}}function Rn(t){let{width:e,height:n}=Qt(t);return{width:e,height:n}}function $n(t,e,n){let o=B(e),i=D(e),r=n==="fixed",a=ie(t,!0,r,e),c={scrollLeft:0,scrollTop:0},m=N(0);function f(){m.x=je(i)}if(o||!o&&!r)if((oe(e)!=="body"||ue(i))&&(c=_e(e)),o){let y=ie(e,!0,r,e);m.x=y.x+e.clientLeft,m.y=y.y+e.clientTop}else i&&f();r&&!o&&i&&f();let h=i&&!o&&!r?to(i,c):N(0),u=a.left+c.scrollLeft-m.x-h.x,g=a.top+c.scrollTop-m.y-h.y;return{x:u,y:g,width:a.width,height:a.height}}function lt(t){return z(t).position==="static"}function Zt(t,e){if(!B(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return D(t)===n&&(n=n.ownerDocument.body),n}function no(t,e){let n=$(t);if(ke(t))return n;if(!B(t)){let i=W(t);for(;i&&!ne(i);){if(L(i)&&!lt(i))return i;i=W(i)}return n}let o=Zt(t,e);for(;o&&qt(o)&&lt(o);)o=Zt(o,e);return o&&ne(o)&&lt(o)&&!Be(o)?n:o||Gt(t)||n}var On=function(t){return H(this,null,function*(){let e=this.getOffsetParent||no,n=this.getDimensions,o=yield n(t.floating);return{reference:$n(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function In(t){return z(t).direction==="rtl"}var Ln={convertOffsetParentRelativeRectToViewportRelativeRect:wn,getDocumentElement:D,getClippingRect:Pn,getOffsetParent:no,getElementRects:On,getClientRects:Sn,getDimensions:Rn,getScale:de,isElement:L,isRTL:In};function io(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function zn(t,e){let n=null,o,i=D(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),r();let f=t.getBoundingClientRect(),{left:h,top:u,width:g,height:y}=f;if(c||e(),!g||!y)return;let b=we(u),x=we(i.clientWidth-(h+g)),v=we(i.clientHeight-(u+y)),C=we(h),_={rootMargin:-b+"px "+-x+"px "+-v+"px "+-C+"px",threshold:F(0,fe(1,m))||1},E=!0;function T(P){let O=P[0].intersectionRatio;if(O!==m){if(!E)return a();O?a(!1,O):o=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!io(f,t.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(T,A(R({},_),{root:i.ownerDocument}))}catch(P){n=new IntersectionObserver(T,_)}n.observe(t)}return a(!0),r}function ro(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,f=at(t),h=i||r?[...f?he(f):[],...e?he(e):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),r&&C.addEventListener("resize",n)});let u=f&&c?zn(f,n):null,g=-1,y=null;a&&(y=new ResizeObserver(C=>{let[S]=C;S&&S.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=y)==null||_.observe(e)})),n()}),f&&!m&&y.observe(f),e&&y.observe(e));let b,x=m?ie(t):null;m&&v();function v(){let C=ie(t);x&&!io(x,C)&&n(),x=C,b=requestAnimationFrame(v)}return n(),()=>{var C;h.forEach(S=>{i&&S.removeEventListener("scroll",n),r&&S.removeEventListener("resize",n)}),u==null||u(),(C=y)==null||C.disconnect(),y=null,m&&cancelAnimationFrame(b)}}var so=Wt;var lo=Vt,ao=jt;var co=(t,e,n)=>{let o=new Map,i=R({platform:Ln},n),r=A(R({},i.platform),{_c:o});return Ft(t,e,A(R({},i),{platform:r}))};function K(t){let{open:e=!1,placement:n="bottom"}=t,o=null,i=null,r=null,a=null,c=w(e),m=w(n),f=()=>{r&&a&&(i&&i(),i=ro(r,a,()=>{co(r,a,{placement:m.get(),middleware:[so(12),ao(),lo()],strategy:"fixed"}).then(({x,y:v,placement:C})=>{var S;Object.assign(a.style,{left:`${x}px`,top:`${v}px`}),C!==m.get()&&m.set(C),(S=t.onPlacement)==null||S.call(t,r,a,C)})}),c.set(!0))},h=()=>{i&&i(),i=null,c.set(!1)},u=()=>{o&&clearTimeout(o),o=setTimeout(f,100)},g=()=>{o&&clearTimeout(o),o=setTimeout(h,100)},y={style:{position:"fixed",pointerEvents:"auto",visibility:x=>c.get(x)?"visible":"hidden"},_onMount:x=>a=x.domElement,_portal:x=>{let v=x.domElement.querySelector("#domphy-floating");if(!v){let C={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};v=x.children.insert(C).domElement}return v}};return k(t.content,y),{show:u,hide:g,anchorPartial:{onKeyDown:x=>x.key==="Escape"&&g(),_onSchedule:x=>{let v=null;x.getRoot().addHook("Init",C=>{v=C.children.insert(t.content)}),x.addHook("BeforeRemove",()=>{g(),o&&clearTimeout(o),v&&v.remove()})},_onMount:x=>{r=x.domElement;let v=C=>{if(!c.get()||!r||!a)return;let S=C.target;!r.contains(S)&&!a.contains(S)&&g()};x.getRoot().domElement.addEventListener("click",v),x.addHook("BeforeRemove",()=>x.getRoot().domElement.removeEventListener("click",v))}}}}function Mn(t){let{options:e=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=t,a=w(t.value),c=w(i),{show:m,hide:f,anchorPartial:h}=K({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),u={onClick:()=>!r&&f()};k(t.content,u);let g={border:"none",outline:"none",padding:0,margin:0,flex:1,height:l(6),marginInlineStart:l(2),fontSize:v=>d(v,"inherit"),color:v=>s(v,"shift-9",o),backgroundColor:v=>s(v,"inherit",o)},y;t.input?(k(t.input,{onFocus:()=>m(),style:g,_key:"combobox-input"}),y=t.input):y={input:null,onFocus:()=>m(),value:v=>(a.get(v),""),style:g,_key:"combobox-input"};let b={div:v=>{let C=a.get(v),S=Array.isArray(C)?C:[C],E=e.filter(T=>S.includes(T.value)).map(T=>({span:T.label,$:[ve({color:o,removable:!0})],_key:T.value,_onRemove:P=>{let O=a.get(),re=(Array.isArray(O)?O:[O]).filter(se=>se!==T.value);r?a.set(re):a.set(re[0])}}));return E.push(y),E},style:{display:"flex",flexWrap:"wrap",gap:l(1)}},x={_onInsert:v=>{v.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:v=>v.children.insert(b),style:{minWidth:l(32),outlineOffset:"-1px",outline:v=>`1px solid ${s(v,"shift-4","neutral")}`,paddingBlock:v=>l(p(v)*1),paddingInline:v=>l(p(v)*1),borderRadius:v=>l(p(v)*1),fontSize:v=>d(v,"inherit"),color:v=>s(v,"shift-9",o),backgroundColor:v=>s(v,"inherit",o)}};return k(h,x),h}function ct(t={}){let{placement:e="bottom-end",color:n="neutral",sideOffset:o=l(6),bordered:i=!0}=t,r=w(e),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=w(a[r.get()]);r.onChange(h=>c.set(a[h]));let m=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",f=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>d(h),backgroundColor:h=>s(h),color:h=>s(h,"shift-9",n),position:"relative","&::after":{content:'""',position:"absolute",width:l(1.5),height:l(1.5),backgroundColor:h=>s(h,"inherit",n),borderWidth:i?"0px":"1px",borderColor:h=>s(h,"inherit",n),borderTopStyle:h=>{let u=c.get(h);return u.includes("top")||u.includes("right")?"solid":"none"},borderBottomStyle:h=>{let u=c.get(h);return u.includes("bottom")||u.includes("left")?"solid":"none"},borderLeftStyle:h=>{let u=c.get(h);return u.includes("top")||u.includes("left")?"solid":"none"},borderRightStyle:h=>{let u=c.get(h);return u.includes("bottom")||u.includes("right")?"solid":"none"},top:h=>{let u=c.get(h);return u.includes("top")?0:u.includes("bottom")?"auto":m(u)},right:h=>{let u=c.get(h);return u.includes("right")?0:u.includes("left")?"auto":f(u)},bottom:h=>{let u=c.get(h);return u.includes("bottom")?0:u.includes("top")?"auto":f(u)},left:h=>{let u=c.get(h);return u.includes("left")?0:u.includes("right")?"auto":m(u)},transform:h=>{let u=c.get(h),g=u.includes("right")||u.includes("end")&&!u.includes("left")?"50%":"-50%",y=u.includes("bottom")||u.includes("end")&&!u.includes("top")?"50%":"-50%";return`translate(${g},${y}) rotate(45deg)`}}}}}function An(t={}){let{color:e="inherit"}=t;return{_onInsert:n=>{n.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:n=>d(n,"inherit"),backgroundColor:n=>s(n,"inherit",e),boxShadow:n=>`inset ${l(1)} 0 0 0 ${s(n,"shift-4",e)}`,border:"none",paddingBlock:n=>l(p(n)*2),paddingInline:n=>l(p(n)*4),margin:0}}}function Nn(t={}){let{color:e="primary"}=t;return{_onInsert:n=>{n.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:n=>d(n,"inherit"),paddingBlock:n=>l(p(n)*1),paddingInline:n=>l(p(n)*3),borderRadius:n=>l(p(n)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:n=>`1px solid ${s(n,"shift-4",e)}`,color:n=>s(n,"shift-9",e),backgroundColor:n=>s(n,"inherit",e),"&:hover:not([disabled]):not([aria-busy=true])":{color:n=>s(n,"shift-10",e),backgroundColor:n=>s(n,"shift-2",e)},"&:focus-visible":{boxShadow:n=>`inset 0 0 0 ${l(.5)} ${s(n,"shift-6",e)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>s(n,"shift-2","neutral"),outline:n=>`1px solid ${s(n,"shift-4","neutral")}`,color:n=>s(n,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Dn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"checkbox",_onInsert:o=>{o.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:o=>d(o,"inherit"),display:"inline-flex",position:"relative",width:l(6),height:l(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:l(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`,color:o=>s(o,"shift-9",e),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:o=>s(o,"shift-2",e)},"&:checked::before":{outline:o=>`1px solid ${s(o,"shift-6",n)}`,backgroundColor:o=>s(o,"shift-8",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>s(o,"shift-7",n)},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:o=>`${l(.5)} solid ${s(o,"inherit",n)}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:o=>`1px solid ${s(o,"shift-6",n)}`,backgroundColor:o=>s(o,"shift-3",n)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:o=>s(o,"shift-8",n)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:o=>s(o,"shift-7",n)},"&:focus-visible":{borderRadius:l(1.5),outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>s(o,"shift-4","neutral"),pointerEvents:"none"}}}}function Bn(t={}){let{color:e="neutral"}=t;return{dataTone:"shift-2",_onInsert:n=>{n.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e),backgroundColor:n=>s(n,"inherit",e),height:l(6),paddingInline:l(1.5),borderRadius:l(1)}}}function Hn(t={}){let{color:e="neutral",accentColor:n="primary",duration:o=240}=t;return{_onInsert:i=>{i.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:i=>d(i,"inherit"),color:i=>s(i,"shift-9",e),backgroundColor:i=>s(i,"inherit",e),overflow:"hidden","& > summary":{backgroundColor:i=>s(i,"shift-2",e),color:i=>s(i,"shift-10",e),fontSize:i=>d(i,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:l(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:i=>l(p(i)*4),height:l(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:l(2),height:l(2),flexShrink:0,marginTop:`-${l(.5)}`,borderInlineEnd:i=>`${l(.5)} solid ${s(i,"shift-9",e)}`,borderBottom:i=>`${l(.5)} solid ${s(i,"shift-9",e)}`,transform:"rotate(45deg)",transition:`transform ${o}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>s(i,"shift-3",e)},"& > summary:focus-visible":{borderRadius:i=>l(p(i)*2),outlineOffset:`-${l(.5)}`,outline:i=>`${l(.5)} solid ${s(i,"shift-6",n)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:i=>l(p(i)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${o}ms ease, opacity ${o}ms ease, padding ${o}ms ease`},"&[open] > :not(summary)":{maxHeight:l(250),opacity:1,paddingTop:i=>l(p(i)*1),paddingBottom:i=>l(p(i)*3)}}}}function Fn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${l(24)}, max-content) 1fr`,columnGap:l(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-10",e)},"& dd":{margin:0,fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e)}}}}function jn(t={}){let{color:e="neutral",open:n=!1}=t,o=w(n);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,r)=>{if(i.target!==r.domElement)return;let a=r.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,r)=>{let a=r.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let r=i.domElement,a=c=>{c?(r.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{r.style.opacity="1";let m=r.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):r.style.opacity="0"};a(o.get()),o.onChange(a)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>d(i,"inherit"),color:i=>s(i,"shift-10",e),backgroundColor:i=>s(i,"inherit",e),border:"none",padding:i=>l(p(i)*3),boxShadow:i=>`0 ${l(9)} ${l(16)} ${s(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>s(i,"shift-2","neutral"),opacity:.75}}}}function Wn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:n=>d(n,"inherit"),fontStyle:"italic",color:n=>s(n,"shift-10",e)}}}function Vn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:l(2),marginInline:0,marginTop:l(3),marginBottom:l(3),color:n=>s(n,"shift-9",e),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:l(2)},"& figcaption":{fontSize:n=>d(n,"decrease-1"),color:n=>s(n,"shift-8",e),lineHeight:1.45}}}}function Un(t={}){let{color:e="neutral",layout:n="horizontal"}=t,o=n==="vertical";return{_onInsert:i=>{i.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:i=>l(p(i)*3),paddingBlock:i=>l(p(i)*3),border:"none",borderRadius:i=>l(p(i)*2),fontSize:i=>d(i,"inherit"),backgroundColor:i=>s(i,"inherit",e),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:l(4),rowGap:l(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:i=>d(i,"inherit"),fontWeight:600,paddingBlock:i=>l(p(i)*1),borderRadius:i=>l(p(i)*2),color:i=>s(i,"shift-9",e),backgroundColor:i=>s(i,"inherit",e)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:i=>o?"0px":l(p(i)*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(${l(2)} * -1)`,fontSize:i=>d(i,"decrease-1"),color:i=>s(i,"shift-9",e)}}}}var Kn={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function qn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{["h1","h2","h3","h4","h5","h6"].includes(n.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:n=>s(n,"shift-11",e),marginTop:0,marginBottom:l(2),fontSize:n=>{let o=Kn[n.elementNode.tagName]||"inherit";return d(n,o)}}}}function Gn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:l(3),marginBottom:l(3),backgroundColor:n=>s(n,"shift-4",e)}}}function Yn(t={}){let{color:e="neutral"}=t;return{dataTone:"shift-2",_onInsert:n=>{n.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:l(2),backgroundColor:n=>s(n,"inherit",e)}}}function Xn(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:"middle",width:l(6),height:l(6),fontSize:n=>d(n),backgroundColor:n=>s(n),color:n=>s(n,"shift-9",e)}}}function Jn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"color",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),i.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:o=>d(o,"inherit"),paddingBlock:o=>l(p(o)*1),paddingInline:o=>l(p(o)*1),blockSize:o=>l(6+p(o)*2),inlineSize:o=>l(6+p(o)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:o=>l(p(o)*1)},"&::-moz-color-swatch":{borderRadius:o=>l(p(o)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`}}}}function Zn(t={}){let{mode:e="datetime-local",color:n="neutral",accentColor:o="primary"}=t;return{type:e,_onSchedule:(i,r)=>{i.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),r.type=e},style:{fontFamily:"inherit",fontSize:i=>d(i,"inherit"),lineHeight:"inherit",color:i=>s(i,"shift-9",n),backgroundColor:i=>s(i,"inherit",n),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"shift-4",n)}`,borderRadius:i=>l(p(i)*1),paddingInline:i=>l(p(i)*3),height:i=>l(6+p(i)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-6",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>s(i,"shift-8","neutral"),backgroundColor:i=>s(i,"shift-2","neutral"),outline:i=>`1px solid ${s(i,"shift-4","neutral")}`},"&:invalid":{outline:i=>`${l(.5)} solid ${s(i,"shift-6","error")}`}}}}function Qn(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"file",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),i.type="file"},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`,borderRadius:o=>l(p(o)*1),height:o=>l(6+p(o)*2),paddingInline:o=>l(p(o)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:o=>s(o,"shift-10",n),backgroundColor:o=>s(o,"shift-3",n)},"&::-webkit-file-upload-button":{marginTop:l(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:l(1),height:l(6),paddingInline:l(2),cursor:"pointer",color:o=>s(o,"shift-10",e),backgroundColor:o=>s(o,"shift-3",e)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),backgroundColor:o=>s(o,"shift-3","neutral")}}}}function ei(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"search",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),i.type="search"},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`,borderRadius:o=>l(p(o)*1),minWidth:l(32),paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),"&::placeholder":{color:o=>s(o,"shift-7",e)},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`}}}}function ti(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"text",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),i.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(32),paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),borderRadius:o=>l(p(o)*1),fontSize:o=>d(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`,color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-7")},"&:not(:placeholder-shown)":{color:o=>s(o,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,color:o=>s(o,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:o=>`${l(.5)} solid ${s(o,"shift-6","error")}`},"&[data-status=error]":{outline:o=>`${l(.5)} solid ${s(o,"shift-6","error")}`},"&[data-status=warning]":{outline:o=>`${l(.5)} solid ${s(o,"shift-6","warning")}`}}}}function oi(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"range",_onInsert:o=>{o.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:l(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:l(1.5),borderRadius:l(999),backgroundColor:o=>s(o,"shift-3",e)},"&::-moz-range-track":{height:l(1.5),borderRadius:l(999),backgroundColor:o=>s(o,"shift-3",e)},"&::-webkit-slider-thumb":{appearance:"none",width:l(4),height:l(4),borderRadius:l(999),border:"none",marginTop:`calc((${l(1.5)} - ${l(4)}) / 2)`,backgroundColor:o=>s(o,"shift-9",n)},"&::-moz-range-thumb":{width:l(4),height:l(4),borderRadius:l(999),border:"none",backgroundColor:o=>s(o,"shift-9",n)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:o=>s(o,"shift-10",n)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:o=>s(o,"shift-10",n)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`,outlineOffset:l(1),borderRadius:l(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ni(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"number",_onSchedule:(o,i)=>{o.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),i.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:l(32),paddingInline:o=>l(p(o)*3),paddingBlock:o=>l(p(o)*1),borderRadius:o=>l(p(o)*1),fontSize:o=>d(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`,color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-2","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,color:o=>s(o,"shift-8","neutral")}}}}function ii(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e),backgroundColor:n=>s(n,"inherit",e),paddingBlock:l(.5),paddingInline:l(1.5),borderRadius:l(1),outline:n=>`1px solid ${s(n,"shift-4",e)}`}}}function ri(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:l(2),fontSize:o=>d(o,"inherit"),color:o=>s(o,"shift-9",e),cursor:"pointer","&:focus-within":{color:o=>s(o,"shift-10",n)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral")}}}}function si(t={}){let{color:e="primary",accentColor:n="secondary"}=t;return{_onInsert:o=>{o.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:o=>d(o,"inherit"),backgroundColor:o=>s(o),color:o=>s(o,"shift-9",e),textDecoration:"none","&:visited":{color:o=>s(o,"shift-9",n)},"&:hover:not([disabled])":{color:o=>s(o,"shift-10",e),textDecoration:"underline"},"&:focus-visible":{borderRadius:l(1),outlineOffset:l(1),outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral")}}}}function li(t={}){let{accentColor:e="highlight"}=t;return{_onInsert:n=>{n.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e),backgroundColor:n=>s(n,"inherit",e),height:l(6),borderRadius:l(1),paddingInline:l(1.5)}}}function ai(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e),lineHeight:1.5,marginTop:0,marginBottom:0}}}function ci(t={}){let{color:e="neutral"}=t;return{dataTone:"shift-2",_onInsert:n=>{n.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e),backgroundColor:n=>s(n,"inherit",e),border:"none",paddingBlock:n=>l(p(n)*2),paddingInline:n=>l(p(n)*3),borderRadius:n=>l(p(n)*2)}}}function mi(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:l(2),border:0,borderRadius:l(999),overflow:"hidden",backgroundColor:o=>s(o,"shift-3",e),"&::-webkit-progress-bar":{backgroundColor:o=>s(o,"shift-3",e),borderRadius:l(999)},"&::-webkit-progress-value":{backgroundColor:o=>s(o,"shift-9",n),borderRadius:l(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:o=>s(o,"shift-9",n),borderRadius:l(999)}}}}function fi(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{type:"radio",_onInsert:o=>{if(o.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:o=>d(o,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:l(6),height:l(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:o=>`1px solid ${s(o,"shift-4",e)}`,color:o=>s(o,"shift-9",e),width:l(4),height:l(4)},"&:hover::before":{backgroundColor:o=>s(o,"shift-2",e)},"&:checked::before":{outline:o=>`1px solid ${s(o,"shift-6",n)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:o=>s(o,"shift-8",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>s(o,"shift-7",n)},"&:focus-visible":{borderRadius:"50%",outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>s(o,"shift-4","neutral"),pointerEvents:"none"}}}}function hi(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:o=>d(o,"inherit"),lineHeight:"inherit",color:o=>s(o,"shift-9",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`,borderRadius:o=>l(p(o)*1),paddingBlock:o=>l(p(o)*1),paddingLeft:o=>l(p(o)*3),paddingRight:o=>l(p(o)*1),"&:not([multiple])":{height:o=>l(6+p(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"& optgroup":{color:o=>s(o,"shift-11",e)},"& option[disabled]":{color:o=>s(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")}}}}function ui(t={}){let{color:e="neutral"}=t,n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=Z(JSON.stringify(n));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:i=>d(i),color:i=>s(i,"shift-9",e),height:l(6),display:"block",borderRadius:l(1),backgroundColor:i=>s(i,"inherit",e),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}var fo={to:{transform:"rotate(360deg)"}},mo=Z(JSON.stringify(fo));function di(t={}){let{color:e="neutral"}=t;return{role:"status",ariaLabel:"loading",_onInsert:n=>{n.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:n=>d(n),backgroundColor:n=>s(n),color:n=>s(n,"shift-9",e),display:"inline-block",margin:0,flexShrink:0,width:l(6),height:l(6),borderRadius:"50%",border:n=>`${l(.5)} solid ${s(n,"shift-4",e)}`,borderTopColor:n=>s(n,"shift-9",e),boxSizing:"border-box",padding:0,animation:`${mo} 0.7s linear infinite`,[`@keyframes ${mo}`]:fo}}}function pi(t={}){var a;let{color:e="neutral",multiple:n=!1}=t,o=w((a=t.value)!=null?a:n?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(h=>({input:null,name:t.name,value:h||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:n}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>l(p(c)*2),paddingInline:c=>l(p(c)*2),fontSize:c=>d(c,"inherit"),backgroundColor:c=>s(c,"inherit",e)}}}function gi(t={}){let{accentColor:e="primary",color:n="neutral",value:o=null}=t;return{role:"option",_onInit:r=>{r.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=r.getContext("select");if(a){let c=a.value;r.attributes.set("ariaSelected",m=>{let f=c.get(m);return a.multiple?f.includes(o):f==o}),r.addEvent("click",()=>{let m=c.get();a.multiple?m.includes(o)?c.set(m.filter(f=>f!==o)):c.set(m.concat([o])):m!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:r=>d(r,"inherit"),height:r=>l(6+p(r)*2),paddingInline:r=>l(p(r)*3),border:"none",outline:"none",color:r=>s(r,"shift-9",n),backgroundColor:r=>s(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>s(r,"shift-2",n)},"&[aria-selected=true]":{backgroundColor:r=>s(r,"shift-6",e),color:r=>s(r,"shift-11")},"&:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-6",e)}`,outlineOffset:`-${l(.5)}`}}}}function yi(t){let{options:e=[],placement:n="bottom",color:o="neutral",open:i=!1,multiple:r=!1}=t,a=w(t.value),c=w(i),{show:m,hide:f,anchorPartial:h}=K({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),u={onClick:()=>!r&&f()};k(t.content,u);let g={div:b=>{let x=a.get(b),v=Array.isArray(x)?x:[x];return e.filter(S=>v.includes(S.value)).map(S=>({span:S.label,$:[ve({color:o,removable:r})],_key:S.value,_onRemove:_=>{let E=a.get(),P=(Array.isArray(E)?E:[E]).filter(O=>O!==S.value);r?a.set(P):a.set(P[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:l(1),flex:1}},y={_onInsert:b=>{b.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:b=>b.children.insert(g),onClick:()=>c.get()?f():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:b=>l(6+p(b)*2),minWidth:l(32),outlineOffset:"-1px",outline:b=>`1px solid ${s(b,"shift-4","neutral")}`,paddingInline:b=>l(p(b)*2),borderRadius:b=>l(p(b)*1),fontSize:b=>d(b,"inherit"),color:b=>s(b,"shift-9",o),backgroundColor:b=>s(b,"inherit",o)}};return k(h,y),h}function bi(t={}){let{accentColor:e="primary"}=t;return{dataTone:"shift-2",type:"checkbox",_onSchedule:n=>{if(n.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:n=>d(n,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:l(9),height:l(6),cursor:"pointer",margin:"0",paddingBlock:l(1),"&:checked":{"&::before":{backgroundColor:n=>s(n,"increase-3",e)},"&::after":{left:`calc(100% - ${l(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:l(3),height:l(3),borderRadius:l(999),left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:n=>s(n,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:l(999),display:"inline-block",fontSize:n=>d(n,"inherit"),lineHeight:1,backgroundColor:n=>s(n)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function vi(t={}){let{checked:e=!1,accentColor:n="primary",color:o="neutral"}=t,i=w(e);return{_onSchedule:r=>{r.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:r=>i.get(r),dataTone:"shift-2",onClick:()=>i.set(!i.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:r=>d(r),border:"none",outlineWidth:"1px",outline:r=>`1px solid ${s(r,"shift-3",o)}`,minWidth:l(12),minHeight:l(6),borderRadius:l(999),paddingLeft:l(7),paddingRight:l(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:r=>s(r,"inherit",o),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:l(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:l(5),height:l(5),borderRadius:l(999),color:r=>s(r,"shift-9"),backgroundColor:r=>s(r,"decrease-2",o)},"&[aria-checked=true]":{backgroundColor:r=>s(r,"increase-3",n),outline:"none",color:r=>s(r,"decrease-2"),paddingLeft:l(2),paddingRight:l(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${l(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function xi(t={}){let{color:e="neutral"}=t;return{dataSize:"decrease-1",_onInsert:n=>{n.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e)}}}function Ci(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:n=>d(n,"inherit"),fontWeight:700,color:n=>s(n,"shift-11",e)}}}function wi(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:n=>d(n,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:n=>s(n,"shift-9",e)}}}function Si(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:n=>d(n,"decrease-1"),verticalAlign:"super",lineHeight:0,color:n=>s(n,"shift-9",e)}}}function Ei(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-9",e),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*1),color:n=>s(n,"shift-10",e),backgroundColor:n=>s(n,"inherit")},"& td":{textAlign:"left",paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*1),color:n=>s(n,"shift-9",e),boxShadow:n=>`inset 0 1px 0 ${s(n,"shift-4",e)}`,fontSize:n=>d(n,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:n=>l(p(n)*3),paddingBlock:n=>l(p(n)*1),color:n=>s(n,"shift-10",e),backgroundColor:n=>s(n,"inherit"),boxShadow:n=>`inset 0 -1px 0 ${s(n,"shift-4",e)}`},"& tr":{backgroundColor:n=>s(n,"inherit")},"& tbody tr:hover":{backgroundColor:n=>s(n,"shift-3")+"!important"}}}}function ki(t={}){let{color:e="neutral",accentColor:n="primary"}=t;return{_onInsert:o=>{o.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:o=>l(p(o)*4),paddingBlock:o=>l(p(o)*2),border:"none",borderRadius:o=>l(p(o)*2),fontSize:o=>d(o,"inherit"),color:o=>s(o,"shift-9",e),outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-4",e)}`,backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-6",n)}`},"&:invalid":{outline:o=>`${l(.5)} solid ${s(o,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-8","neutral"),outline:o=>`1px solid ${s(o,"shift-4","neutral")}`,backgroundColor:o=>s(o,"shift-2","neutral")}}}}function _i(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:n=>d(n,"inherit"),backgroundColor:n=>s(n),color:n=>s(n,"shift-9",e),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"disc",listStylePosition:"outside"}}}function Ti(t={}){let{color:e="neutral"}=t;return{_onInsert:n=>{n.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:n=>d(n,"inherit"),backgroundColor:n=>s(n),color:n=>s(n,"shift-9",e),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Pi(t,e){if(e<=7)return Array.from({length:e},(r,a)=>a+1);let n=[1];t>3&&n.push("...");let o=Math.max(2,t-1),i=Math.min(e-1,t+1);for(let r=o;r<=i;r++)n.push(r);return t<e-2&&n.push("..."),n.push(e),n}function Ri(t){var c;let{total:e,color:n="neutral",accentColor:o="primary"}=t,i=w((c=t.value)!=null?c:1),r={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>l(6+p(m)*2),height:m=>l(6+p(m)*2),paddingInline:m=>l(p(m)*2),borderRadius:m=>l(p(m)*1),border:"none",cursor:"pointer",fontSize:m=>d(m,"inherit"),backgroundColor:"transparent",color:m=>s(m,"shift-9",n),"&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-2",n)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=A(R({},r),{backgroundColor:m=>s(m,"shift-6",o),color:m=>s(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let f={div:h=>{let u=i.get(h),g=[];g.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:u<=1,onClick:()=>u>1&&i.set(u-1),style:r});for(let y of Pi(u,e))if(y==="...")g.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:b=>l(p(b)*2),color:b=>s(b,"shift-7",n)}});else{let b=y===u;g.push({button:String(y),type:"button",ariaLabel:`Page ${y}`,ariaCurrent:b?"page":void 0,disabled:b,onClick:()=>i.set(y),style:b?a:r})}return g.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:u>=e,onClick:()=>u<e&&i.set(u+1),style:r}),g},style:{display:"flex",alignItems:"center",gap:l(1)}};m.children.insert(f)},style:{display:"inline-flex"}}}function $i(t={}){let{color:e="neutral"}=t;return{role:"separator",_onInsert:n=>{n.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:l(2),fontSize:n=>d(n,"inherit"),backgroundColor:n=>s(n),color:n=>s(n,"shift-9",e),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:n=>s(n,"shift-4",e),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:n=>s(n,"shift-4",e),borderWidth:"1px",borderBottomStyle:"solid"}}}}var ho={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Oi={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},mt=t=>t==="left"||t==="right";function Ii(t={}){let{color:e="neutral",open:n=!1,placement:o="right",size:i}=t,r=w(n),a=mt(o)?l(80):l(64),c=i!=null?i:a;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,f)=>{m.target===f.domElement&&r.set(!1)},onTransitionEnd:(m,f)=>{let h=f.domElement;r.get()||(h.close(),document.body.style.overflow="")},_onMount:m=>{let f=m.domElement,h=u=>{u?(f.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{f.style.transform="translate(0, 0)"})):f.style.transform=ho[o]};h(r.get()),r.onChange(h)},style:{transform:ho[o],transition:"transform 0.25s ease",fontSize:m=>d(m,"inherit"),color:m=>s(m,"shift-10",e),backgroundColor:m=>s(m,"inherit",e),border:"none",padding:m=>l(p(m)*3),margin:Oi[o],width:mt(o)?c:"100dvw",height:mt(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${l(4)} ${l(12)} ${s(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>s(m,"shift-2","neutral"),opacity:.75}}}}function Li(t){let{open:e=!1,placement:n="bottom",openOn:o="click"}=t,i=null,r=w(e),{show:a,hide:c,anchorPartial:m}=K({open:r,placement:n,content:t.content,onPlacement:t.onPlacement}),f={role:"dialog",dataTone:"shift-17",onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),_onInsert:u=>{let g=u.attributes.get("id");i=g||u.nodeId,!g&&u.attributes.set("id",i)}};return k(t.content,f),k(m,{ariaHaspopup:"dialog",ariaExpanded:u=>r.get(u),onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),onClick:()=>o==="click"&&(r.get()?c():a()),onFocus:()=>a(),onBlur:()=>c(),_onMount:u=>i&&u.attributes.set("ariaControls",i)}),m}function zi(t={}){let{position:e="top-center",color:n="neutral"}=t,o=w(!1),i=e.startsWith("top"),r=e.endsWith("center"),a=e.endsWith("right"),c={div:[],id:`domphy-toast-${e}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:r?"center":a?"end":"start",inset:0,gap:l(4),zIndex:30,padding:l(6),pointerEvents:"none"}};return{_portal:m=>{let f=m.domElement.querySelector(`#domphy-toast-${e}`);return f||(f=m.children.insert(c).domElement),f},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:l(32),pointerEvents:"auto",paddingBlock:m=>l(p(m)*2),paddingInline:m=>l(p(m)*4),borderRadius:m=>l(p(m)*2),fontSize:m=>d(m,"inherit"),color:m=>s(m,"shift-9",n),backgroundColor:m=>s(m,"inherit",n),boxShadow:m=>`0 ${l(2)} ${l(9)} ${s(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,f)=>{let h=u=>{u.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",h),f())};m.domElement.addEventListener("transitionend",h),o.set(!1)}}}function Mi(t={}){let{open:e=!1,placement:n="top",content:o="Tooltip Content"}=t,i=null,r=w(n),a=typeof o=="string"?{span:o}:o,{show:c,hide:m,anchorPartial:f}=K({open:e,placement:n,content:a}),h={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:g=>{let y=g.attributes.get("id");i=y||g.nodeId,!y&&g.attributes.set("id",i)},style:{paddingBlock:g=>l(p(g)*1),paddingInline:g=>l(p(g)*3),borderRadius:g=>l(p(g)*1),color:g=>s(g,"shift-9"),backgroundColor:g=>s(g),fontSize:g=>d(g,"inherit")},$:[ct({placement:n,bordered:!1})]};return a.$||(a.$=[]),a.$.push(h),k(f,{onMouseEnter:()=>c(),onMouseLeave:()=>m(),onFocus:()=>c(),onBlur:()=>m(),onKeyDown:g=>g.key==="Escape"&&m(),_onMount:g=>i&&g.attributes.set("ariaDescribedby",i)}),f}function uo(t,e){return t.key!==void 0&&t.key!==null?String(t.key):`index-${e}`}function Ai(t={}){let{duration:e=300,delay:n=0}=t,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((r,a)=>{if(!(r instanceof I))return;let c=r.domElement;c&&o.set(uo(r,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((r,a)=>{if(!(r instanceof I))return;let c=r.domElement;if(!c)return;let m=uo(r,a),f=o.get(m);if(!f)return;let h=c.getBoundingClientRect(),u=f.left-h.left,g=f.top-h.top;if(Math.abs(u)<.5&&Math.abs(g)<.5)return;let y=c.style.transition,b=c.style.transform;c.style.transition="none",c.style.transform=`translate(${u}px, ${g}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${e}ms ease ${n}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=y,c.style.transform=b,c.removeEventListener("transitionend",v)},v=C=>{C.propertyName==="transform"&&x()};c.addEventListener("transitionend",v),setTimeout(x,e+n+34)}),o.clear()}}}function Ni(t={}){return{role:"tablist",_onSchedule:(n,o)=>{let i={_context:{tabs:{activeKey:w(t.activeKey||0)}}};k(o,i)}}}function Di(t={}){let{accentColor:e="primary",color:n="neutral"}=t;return{role:"tab",_onInsert:i=>{var f;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let r=i.getContext("tabs"),a=(f=i.parent)==null?void 0:f.children.items;a=a.filter(h=>h.type=="ElementNode"&&h.attributes.get("role")=="tab");let c=i.key||a.findIndex(h=>h==i),m={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:h=>r.activeKey.get(h)==c,onClick:()=>r.activeKey.set(c),onKeyDown:h=>{var v,C,S,_;let u=h.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(u))return;h.preventDefault();let g=((C=(v=i.parent)==null?void 0:v.children.items)!=null?C:[]).filter(E=>E.type==="ElementNode"&&E.attributes.get("role")==="tab"),y=g.findIndex(E=>E===i),b=y;u==="ArrowRight"?b=(y+1)%g.length:u==="ArrowLeft"?b=(y-1+g.length)%g.length:u==="Home"?b=0:u==="End"&&(b=g.length-1);let x=g[b];r.activeKey.set((S=x.key)!=null?S:b),(_=x.domElement)==null||_.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>d(i,"inherit"),height:i=>l(6+p(i)*2),paddingInline:i=>l(p(i)*4),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-1",n)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-2",n)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",e)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",e)}`}}}}function Bi(){return{role:"tabpanel",style:{paddingBlock:e=>l(p(e)*2),paddingInline:e=>l(p(e)*2)},_onInsert:e=>{var a;let n=e.getContext("tabs"),o=(a=e.parent)==null?void 0:a.children.items;o=o.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tabpanel");let i=e.key||o.findIndex(c=>c==e),r={id:"tabpanel"+e.parent.nodeId+i,ariaLabelledby:"tab"+e.parent.nodeId+i,hidden:c=>n.activeKey.get(c)!=i};e.merge(r)}}}function Hi(t={}){let{color:e="neutral"}=t;return{role:"menu",dataTone:"shift-17",_onSchedule:(o,i)=>{let r={_context:{menu:{activeKey:w(t.activeKey||0)}}};k(i,r)},style:{display:"flex",flexDirection:"column",paddingBlock:o=>l(p(o)*2),paddingInline:o=>l(p(o)*2),fontSize:o=>d(o,"inherit"),backgroundColor:o=>s(o,"inherit",e)}}}function Fi(t={}){let{accentColor:e="primary",color:n="neutral"}=t;return{role:"menuitem",_onInsert:i=>{var m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let r=i.getContext("menu"),a=(m=i.parent)==null?void 0:m.children.items;a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="menuitem");let c=i.key||a.findIndex(f=>f==i);i.attributes.set("ariaCurrent",f=>r.activeKey.get(f)==c||void 0),i.addEvent("click",()=>r.activeKey.set(c))},onKeyDown:(i,r)=>{var h,u,g;let a=i.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((u=(h=r.parent)==null?void 0:h.children.items)!=null?u:[]).filter(y=>y.type==="ElementNode"&&y.attributes.get("role")==="menuitem"),m=c.findIndex(y=>y===r),f=m;a==="ArrowDown"?f=(m+1)%c.length:a==="ArrowUp"?f=(m-1+c.length)%c.length:a==="Home"?f=0:a==="End"&&(f=c.length-1),(g=c[f].domElement)==null||g.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>d(i,"inherit"),height:i=>l(6+p(i)*2),paddingInline:i=>l(p(i)*3),border:"none",outline:"none",color:i=>s(i,"shift-9"),backgroundColor:i=>s(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>s(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>s(i,"shift-3",e),color:i=>s(i,"shift-10")},"&:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-6",e)}`,outlineOffset:`-${l(.5)}`}}}}function ji(t){return{_onSchedule:(e,n)=>{k(n,{_context:{form:t}})}}}function Wi(t,e){return{_onInsert:n=>{let i=n.getContext("form").setField(t,void 0,e),r=n.tagName,a=n.attributes.get("type");["input","select","textarea"].includes(r)||console.warn('"field" patch must use input, select, or textarea tag');let c={onBlur:()=>i.setTouched(),ariaInvalid:m=>!!i.message("error",m)||void 0,dataStatus:m=>i.status(m)};r==="input"&&a==="checkbox"?(c.checked=i.value(),c.onChange=m=>i.setValue(m.target.checked)):r==="input"&&a==="radio"?c.onChange=m=>i.setValue(m.target.value):r==="select"?(c.value=i.value(),c.onChange=m=>i.setValue(m.target.value)):r==="textarea"?(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)):(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)),n.merge(c)}}}function Vi(t){return!!t&&typeof t.then=="function"}var Te=class{constructor(e,n){this._notifier=new ae;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=e,this._initValue=e,this._validator=n,n&&this.validate()}value(e){return e&&this._notifier.addListener("value",e),this._value}setValue(e){this._value=e,this._notifier.notify("value",e),this._notifier.notify("dirty",e!==this._initValue),this.validate()}dirty(e){return e&&this._notifier.addListener("dirty",e),this._value!==this._initValue}touched(e){return e&&this._notifier.addListener("touched",e),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(e,n){let o=!1;e!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=e,this._initValue=e,this._notifier.notify("value",e),this._notifier.notify("dirty",!1),o=!0),n!==void 0&&n!==this._validator&&(this._validator=n,o=!0),o&&this.validate()}message(e,n){return n&&this._notifier.addListener(e,n),this._messages[e]}status(e){return e&&this._notifier.addListener("status",e),We(this._messages)}setMessages(e){let n=this._messages;this._messages=e;for(let o of["error","warning","success"])n[o]!==e[o]&&this._notifier.notify(o,e[o]);We(n)!==We(e)&&this._notifier.notify("status",We(e))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let e=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let n=this._validator(this._value);Vi(n)?(this._pending=!0,Promise.resolve(n).then(o=>{e===this._validationToken&&(this._pending=!1,this.setMessages(o!=null?o:{}))}).catch(o=>{e===this._validationToken&&(this._pending=!1,console.error(o))})):(this._pending=!1,this.setMessages(n!=null?n:{}))}catch(n){e===this._validationToken&&(this._pending=!1),console.error(n)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function We(t){if(t.error)return"error";if(t.warning)return"warning";if(t.success)return"success"}var ft=class{constructor(){this.fields=new Map}setField(e,n,o){let i=this.fields.get(e);return i?i.configure(n,o):(i=new Te(n,o),this.fields.set(e,i)),i}getField(e){return this.setField(e)}removeField(e){var n;(n=this.fields.get(e))==null||n._dispose(),this.fields.delete(e)}get valid(){for(let e of this.fields.values())if(e._pending||e._messages.error)return!1;return!0}reset(){for(let e of this.fields.values())e.reset()}snapshot(){let e={};for(let[n,o]of this.fields)Ui(e,n,o._value);return e}_dispose(){for(let e of this.fields.values())e._dispose();this.fields.clear()}};function Ui(t,e,n){let o=e.split("."),i=t;for(let r=0;r<o.length-1;r++){let a=o[r];i[a]==null&&(i[a]=isNaN(Number(o[r+1]))?{}:[]),i=i[a]}i[o[o.length-1]]=n}return Co(Ki);})();
5
5
  //# sourceMappingURL=core-theme-ui.global.js.map