@domphy/ui 0.1.3 → 0.1.4

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 Te=Object.defineProperty,co=Object.defineProperties,mo=Object.getOwnPropertyDescriptor,fo=Object.getOwnPropertyDescriptors,uo=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols;var je=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable;var ft=(t,e,n)=>e in t?Te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,P=(t,e)=>{for(var n in e||(e={}))je.call(e,n)&&ft(t,n,e[n]);if(ke)for(var n of ke(e))ut.call(e,n)&&ft(t,n,e[n]);return t},I=(t,e)=>co(t,fo(e));var Ve=(t,e)=>{var n={};for(var o in t)je.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&ke)for(var o of ke(t))e.indexOf(o)<0&&ut.call(t,o)&&(n[o]=t[o]);return n};var _e=(t,e)=>{for(var n in e)Te(t,n,{get:e[n],enumerable:!0})},ho=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uo(e))!je.call(t,i)&&i!==n&&Te(t,i,{get:()=>e[i],enumerable:!(o=mo(e,i))||o.enumerable});return t};var po=t=>ho(Te({},"__esModule",{value:!0}),t);var D=(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 Wi={};_e(Wi,{core:()=>Pe,theme:()=>Ie,ui:()=>He});var Pe={};_e(Pe,{AttributeList:()=>vt,BooleanAttributes:()=>qe,CamelAttributes:()=>bt,ElementList:()=>xt,ElementNode:()=>O,HtmlTags:()=>Ke,Notifier:()=>he,PrefixCSS:()=>Y,State:()=>We,VoidTags:()=>So,hashString:()=>J,merge:()=>E,toState:()=>w});var go=["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"],yo=go.reduce((t,e)=>{let n=e.slice(2).toLowerCase();return t[n]=e,t},{}),Ke=["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"],he=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)}}},We=class{constructor(t){this._notifier=new he,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 E(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=X(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]=E(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();vo(t,c,a)}else if(r.startsWith("_on")){let c=r.replace("_on","");bo(t,c,a)}else t[r]=a}return t}function w(t){return t instanceof We?t:new We(t)}function J(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 bo(t,e,n){let o=`_on${e}`,i=t[o];typeof i=="function"?t[o]=(...r)=>{i(...r),n(...r)}:t[o]=n}function vo(t,e,n){let o=yo[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 X(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(X(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(X(i,e),X(r,e));return o}if(t instanceof Set){o=new Set,e.set(t,o);for(let i of t)o.add(X(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]=X(t[i],e);return o}function dt(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&&!Ke.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=>dt(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 xo(t){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(t.trim())}function ht(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function wo(t){return Object.keys(t).find(e=>Ke.includes(e))}function pt(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Co(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 gt(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 yt=t=>{if(Array.isArray(t.$)){let e={};return t.$.forEach(n=>E(e,yt(n))),delete t.$,E(e,t),e}else return t},So=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],qe=["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"],Y={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"]},bt=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Eo=class{constructor(t,e,n){this.parent=n,this.isBoolean=qe.includes(t),bt.includes(t)?this.name=t:this.name=pt(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=ht(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}="${ht(String(n))}"`}}},vt=class{constructor(t){this._notifier=new he,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 Eo(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(!qe.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))}},ko=class{constructor(t,e){this.type="TextNode",this.parent=e,this.text=t===""?"\u200B":String(t)}_createDOMNode(){let t;if(xo(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)}},xt=class{constructor(t){this.items=[],this.owner=t}_createNode(t,e=0){return typeof t=="object"&&t!==null?new O(t,this.owner,e):new ko(t==null?"":String(t),this.owner)}_moveDomElement(t,e){if(!this.owner||!this.owner.domElement)return;let n=this.owner.domElement,o=t instanceof O?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 O?t.domElement:t.domText,i=e instanceof O?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 O&&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 p=m.get(h);if(p){m.delete(h);let g=this.items.indexOf(p);if(g!==f&&g>=0){let b=p instanceof O&&!!p._portal;this.move(g,f,b?!1:e,!0)}p.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 O){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 p=f.getRootNode(),g=p instanceof ShadowRoot?p:document.head,b=gt(g);m.styles.render(b),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(v=>{if(v instanceof O&&v._portal){let y=v._portal(v.getRoot());y&&v.render(y)}else v.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 O){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}},To=class{constructor(t,e,n){this.value="",this.name=t,this.cssName=pt(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)),Y[this.name]&&Y[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),Y[this.name]&&Y[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 Y[this.name]&&Y[this.name].forEach(e=>{t+=`; -${e}-${this.cssName}: ${this.value}`}),t}},G=class Ue{constructor(e,n){this.domRule=null,this.styleBlock={},this.selectorText=e,this.styleList=new wt(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 Ue;)e=e.parent;return e}get parentNode(){let e=this.parent;for(;e&&e instanceof Ue;)e=e.parent;return e}insertStyle(e,n){this.styleBlock&&(this.styleBlock[e]?this.styleBlock[e].set(n):this.styleBlock[e]=new To(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)}}},wt=class{constructor(t){this.items=[],this.domStyle=null,this.parent=t}get parentNode(){let t=this.parent;for(;t&&t instanceof G;)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=Co(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 G(c,this.parent);f.styleList.addCSS(r,e),this.items.push(f)}}else if(c.startsWith("@keyframes")){let f=new G(c,this.parent);f.styleList.addCSS(r,""),this.items.push(f)}else if(c.startsWith("@font-face")){let f=new G(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 G(m,this.parent);this.items.push(f);for(let[u,h]of Object.entries(r))if(typeof h=="object"&&h!=null){let p=o(u,m);u.startsWith("&")?this.addCSS(h,p):f.styleList.insertRule(p).styleList.addCSS(h,p)}else f.insertStyle(u,h)}else n[c]=r}}if(Object.keys(n).length){let i=new G(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 G(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}},O=class ue{constructor(e,n=null,o=0){this.type="ElementNode",this.parent=null,this.children=new xt(this),this.styles=new wt(this),this.attributes=new vt(this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.key=null;var i,r;e=X(e),dt(e),e.style=e.style||{},this.parent=n,this.tagName=wo(e),e=yt(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=J(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 J(this.getPath())}merge(e){E(this._context,e._context),E(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 ue&&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 ue?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 ue&&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=gt(r)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof ue&&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 Ie={};_e(Ie,{contextColor:()=>Ao,createDark:()=>Et,getTheme:()=>pe,setTheme:()=>$o,themeApply:()=>Io,themeCSS:()=>Ge,themeColor:()=>s,themeName:()=>Xe,themeSize:()=>d,themeSpacing:()=>l,themeTokens:()=>Oo,themeVars:()=>de});var _o={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"],custom:{}},$e=_o,re={light:JSON.parse(JSON.stringify($e)),dark:Et($e)};function Po(t){for(let e in t)if(!Object.keys($e).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("custom"in t){let e=t.custom;if(typeof e!="object"||e===null)throw new Error("Invalid custom property: must be an object")}}function St(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]={}),St(t[o],e[o])):t[o]=e[o]}function Ro(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(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 _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]};
2
2
  `;return`[data-theme="${t}"] {
3
- ${o}}`}function pe(t){if(!re[t])throw Error(`Theme "${t}" not found`);return re[t]}function $o(t,e){Po(e),re[t]||(re[t]=structuredClone($e)),St(re[t],e)}function Et(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 Oo(t){let e=pe(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(n[o]={},typeof i=="object"&&i!==null)for(let r in i)n[o][r]=i[r]}return n}function de(){let t=pe("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(e[o]={},typeof i=="object"&&i!==null)for(let r in i)e[o][r]=`var(--${o}-${r.replace("/","_")})`}return e}function Ge(){return Object.entries(re).map(([t,e])=>Ro(t,e)).join(`
4
- `)}function Io(t){var e;if(typeof document!="undefined")if(t){t.textContent=Ge();return}else t=(e=document.getElementById("domphy-themes"))!=null?e:Object.assign(document.createElement("style"),{id:"domphy-themes"}),t.textContent=Ge(),document.head.appendChild(t)}function l(t){return t/4+"em"}function Xe(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.attributes&&e.attributes.has("dataTheme")&&(n=e.attributes.get("dataTheme"),typeof t=="function"&&e.attributes.onChange("dataTheme",t)),n}var Ye=["inherit"];[...Array(8).keys()].forEach(t=>{Ye.push(`decrease-${t}`),Ye.push(`increase-${t}`)});function kt(t,e="inherit"){if(!Ye.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 Lo(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=kt(n,e.attributes.get("dataSize")),typeof t=="function"&&e.attributes.onChange("dataSize",t)),n}function d(t,e="inherit"){let n=kt(Lo(t),e);return de().fontSizes[n]}var le=12,Re=["inherit","base"];[...Array(le).keys()].forEach(t=>{Re.push(`decrease-${t}`),Re.push(`increase-${t}`),Re.push(`shift-${t}`)});function Ct(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 zo(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 Oe(t,e="inherit"){if(typeof e=="number")return e;if(e=="inherit")return t;if(!Re.includes(e))throw Error(`tone name "${e}" invalid`);if(e.startsWith("increase-")){let n=parseInt(e.replace("increase-",""),10);return Ct(t,n)}else if(e.startsWith("decrease-")){let n=parseInt(e.replace("decrease-",""),10);return Ct(t,-n)}else if(e.startsWith("shift-")){let n=parseInt(e.replace("shift-",""),10);return zo(t,n)}else return t}function Tt(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=Oe(n,e.attributes.get("dataTone")),typeof t=="function"&&e.attributes.onChange("dataTone",t)),n}function Mo(t,e="inherit"){return Oe(Tt(t),e)}function Ao(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=pe(Xe(t)).baseTones[i]:r=Oe(Tt(t),e),de()[i][r]}function s(t,e="inherit",n="inherit"){let o=n=="inherit"?"neutral":n;if(!t)return de()[o][Oe(0,e)];let i;return e=="base"?i=pe(Xe(t)).baseTones[o]:i=Mo(t,e),de()[o][i]}var He={};_e(He,{FieldState:()=>Ee,FormState:()=>rt,abbreviation:()=>No,alert:()=>Go,avatar:()=>Yo,badge:()=>Xo,blockquote:()=>zn,breadcrumb:()=>Jo,breadcrumbEllipsis:()=>Zo,button:()=>Mn,buttonSwitch:()=>yi,card:()=>Bo,code:()=>Nn,combobox:()=>Ln,command:()=>jo,commandItem:()=>Wo,commandSearch:()=>Vo,descriptionList:()=>Dn,details:()=>Bn,dialog:()=>Hn,divider:()=>Pi,drawer:()=>$i,emphasis:()=>Fn,field:()=>Fi,figure:()=>jn,form:()=>Hi,formGroup:()=>Vn,heading:()=>Un,horizontalRule:()=>Kn,icon:()=>Gn,image:()=>qn,inputCheckbox:()=>An,inputColor:()=>Yn,inputDateTime:()=>Xn,inputFile:()=>Jn,inputNumber:()=>ti,inputOTP:()=>qo,inputRadio:()=>ci,inputRange:()=>ei,inputSearch:()=>Zn,inputSwitch:()=>gi,inputText:()=>Qn,keyboard:()=>oi,label:()=>ni,link:()=>ii,mark:()=>ri,menu:()=>Bi,menuItem:()=>Di,orderedList:()=>ki,pagination:()=>_i,paragraph:()=>li,popover:()=>Oi,popoverArrow:()=>nt,preformated:()=>si,progress:()=>ai,select:()=>mi,selectBox:()=>pi,selectItem:()=>di,selectList:()=>hi,skeleton:()=>fi,small:()=>bi,spinner:()=>ui,splitter:()=>Do,splitterHandle:()=>Fo,splitterPanel:()=>Ho,strong:()=>vi,subscript:()=>xi,superscript:()=>wi,tab:()=>Ai,tabPanel:()=>Ni,table:()=>Ci,tabs:()=>Mi,tag:()=>ge,textarea:()=>Si,toast:()=>Ii,toggle:()=>Uo,toggleGroup:()=>Ko,tooltip:()=>Li,transitionGroup:()=>zi,unorderedList:()=>Ei});function No(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=>s(o,"shift-7",e),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:o=>s(o,"shift-4",e),textUnderlineOffset:l(.72),cursor:"help","&:hover":{color:o=>s(o,"shift-8",n),textDecorationColor:o=>s(o,"shift-6",n)}}}}function Bo(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:l(2),backgroundColor:n=>s(n,"inherit",e),color:n=>s(n,"shift-7",e),outline:n=>`1px solid ${s(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:l(2),paddingInline:l(4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:l(4),color:n=>s(n,"shift-6",e),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:l(2),height:"auto"},"& > div":{gridArea:"content",padding:l(4),color:n=>s(n,"shift-7",e)},"& > footer":{gridArea:"footer",display:"flex",gap:l(2),paddingBlock:l(2),paddingInline:l(4),borderTop:n=>`1px solid ${s(n,"shift-2",e)}`}}}}function Do(t={}){let{direction:e="horizontal",defaultSize:n=50,min:o=10,max:i=90}=t;return{_onSchedule:(r,a)=>{E(a,{_context:{splitter:{direction:e,size:w(n),min:o,max:i}}})},style:{display:"flex",flexDirection:e==="horizontal"?"row":"column",overflow:"hidden"}}}function Ho(){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 Fo(){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=>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)=>{E(e,{_context:{command:{query:w("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Vo(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:l(3),paddingBlock:l(2),border:"none",borderBottom:o=>`1px solid ${s(o,"shift-2",e)}`,outline:"none",color:o=>s(o,"shift-7",e),backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-4")},"&:focus-visible":{borderBottomColor:o=>s(o,"shift-5",n)}}}}function Wo(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=>d(o,"inherit"),height:l(8),paddingInline:l(3),border:"none",outline:"none",color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),"&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-1",e)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`,outlineOffset:`-${l(.5)}`}}}}function Uo(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=>d(o,"inherit"),height:l(6),paddingBlock:l(1),paddingInline:l(2),border:"none",borderRadius:l(1),color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:o=>s(o,"shift-1",e)},"&[aria-pressed=true]":{backgroundColor:o=>s(o,"shift-1",e)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`,outlineOffset:`-${l(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ko(t={}){var o;let{multiple:e=!1,color:n="neutral"}=t;return{role:"group",dataTone:"shift-1",_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-1",n)}`,outlineOffset:"-1px"}}}function qo(){return{style:{display:"flex",alignItems:"center",gap:l(2),"& > *":{minWidth:l(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,p,g;a.preventDefault();let c=(p=(h=a.clipboardData)==null?void 0:h.getData("text"))!=null?p:"",m=n(),f=m.indexOf(a.target);[...c].forEach((b,v)=>{m[f+v]&&(m[f+v].value=b)});let u=Math.min(f+c.length-1,m.length-1);(g=m[u])==null||g.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 Go(t={}){let{color:e="primary"}=t;return{role:"alert",style:{display:"flex",alignItems:"flex-start",gap:l(3),paddingBlock:l(2),paddingInline:l(4),boxShadow:n=>`inset ${l(1)} 0 0 0 ${s(n,"shift-5",e)}`,backgroundColor:n=>s(n,"shift-1",e),color:n=>s(n,"shift-7",e),fontSize:n=>d(n,"inherit")}}}function Yo(t={}){let{color:e="primary"}=t;return{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:l(8),height:l(8),fontSize:n=>d(n,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:n=>s(n,"shift-3",e),color:n=>s(n,"shift-8",e),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function Xo(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-6",e),color:i=>s(i,"shift-0",e)}}}}function Jo(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-6",e),backgroundColor:o=>s(o,"inherit",e),"& > *":{display:"inline-flex",alignItems:"center",color:o=>s(o,"shift-5",e)},"& > *:not(:last-child)::after":{content:`"${n}"`,color:o=>s(o,"shift-3",e),paddingInlineStart:l(1)},"& > [aria-current=page]":{color:o=>s(o,"shift-7",e),pointerEvents:"none"}}}}function Zo(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-5",e),borderRadius:l(1),"&:hover":{color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"shift-1",e)},"&:focus-visible":{outline:n=>`${l(.5)} solid ${s(n,"shift-5",e)}`,outlineOffset:l(.5)}}}}var Qo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function ge(t={}){let{color:e="neutral",removable:n=!1}=t;return{dataTone:"shift-1",_onInit:o=>{let i={span:Qo,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-3",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-6",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`}}}var se=Math.min,H=Math.max,be=Math.round,ve=Math.floor,A=t=>({x:t,y:t}),en={left:"right",right:"left",bottom:"top",top:"bottom"},tn={start:"end",end:"start"};function Je(t,e,n){return H(t,se(e,n))}function xe(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function we(t){return t.split("-")[1]}function Ze(t){return t==="x"?"y":"x"}function Qe(t){return t==="y"?"height":"width"}var on=new Set(["top","bottom"]);function F(t){return on.has(W(t))?"y":"x"}function et(t){return Ze(F(t))}function Rt(t,e,n){n===void 0&&(n=!1);let o=we(t),i=et(t),r=Qe(i),a=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=ye(a)),[a,ye(a)]}function $t(t){let e=ye(t);return[Le(t),e,Le(e)]}function Le(t){return t.replace(/start|end/g,e=>tn[e])}var _t=["left","right"],Pt=["right","left"],nn=["top","bottom"],rn=["bottom","top"];function ln(t,e,n){switch(t){case"top":case"bottom":return n?e?Pt:_t:e?_t:Pt;case"left":case"right":return e?nn:rn;default:return[]}}function Ot(t,e,n,o){let i=we(t),r=ln(W(t),n==="start",o);return i&&(r=r.map(a=>a+"-"+i),e&&(r=r.concat(r.map(Le)))),r}function ye(t){return t.replace(/left|right|bottom|top/g,e=>en[e])}function sn(t){return P({top:0,right:0,bottom:0,left:0},t)}function It(t){return typeof t!="number"?sn(t):{top:t,right:t,bottom:t,left:t}}function Z(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 Lt(t,e,n){let{reference:o,floating:i}=t,r=F(e),a=et(e),c=Qe(a),m=W(e),f=r==="y",u=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,p=o[c]/2-i[c]/2,g;switch(m){case"top":g={x:u,y:o.y-i.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:h};break;case"left":g={x:o.x-i.width,y:h};break;default:g={x:o.x,y:o.y}}switch(we(e)){case"start":g[a]-=p*(n&&f?-1:1);break;case"end":g[a]+=p*(n&&f?-1:1);break}return g}function zt(t,e){return D(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:p=!1,padding:g=0}=xe(e,t),b=It(g),y=c[p?h==="floating"?"reference":"floating":h],x=Z(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(y))==null||n?y:y.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:m})),C=h==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,k=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating),S=(yield r.isElement==null?void 0:r.isElement(k))?(yield r.getScale==null?void 0:r.getScale(k))||{x:1,y:1}:{x:1,y:1},T=Z(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:k,strategy:m}):C);return{top:(x.top-T.top+b.top)/S.y,bottom:(T.bottom-x.bottom+b.bottom)/S.y,left:(x.left-T.left+b.left)/S.x,right:(T.right-x.right+b.right)/S.x}})}var Mt=(t,e,n)=>D(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}=Lt(f,o,m),p=o,g={},b=0;for(let y=0;y<c.length;y++){var v;let{name:x,fn:C}=c[y],{x:k,y:S,data:T,reset:_}=yield C({x:u,y:h,initialPlacement:o,placement:p,strategy:i,middlewareData:g,rects:f,platform:I(P({},a),{detectOverflow:(v=a.detectOverflow)!=null?v:zt}),elements:{reference:t,floating:e}});u=k!=null?k:u,h=S!=null?S:h,g=I(P({},g),{[x]:P(P({},g[x]),T)}),_&&b<=50&&(b++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(f=_.rects===!0?yield a.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:h}=Lt(f,p,m)),y=-1)}return{x:u,y:h,placement:p,strategy:i,middlewareData:g}});var At=function(t){return t===void 0&&(t={}),{name:"flip",options:t,fn(n){return D(this,null,function*(){var o,i;let{placement:r,middlewareData:a,rects:c,initialPlacement:m,platform:f,elements:u}=n,mt=xe(t,n),{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0}=mt,x=Ve(mt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let C=W(r),k=F(m),S=W(m)===m,T=yield f.isRTL==null?void 0:f.isRTL(u.floating),_=g||(S||!y?[ye(m)]:$t(m)),$=v!=="none";!g&&$&&_.push(...Ot(m,y,v,T));let lt=[m,..._],oe=yield f.detectOverflow(n,x),ne=[],ie=((i=a.flip)==null?void 0:i.overflows)||[];if(h&&ne.push(oe[C]),p){let K=Rt(r,c,T);ne.push(oe[K[0]],oe[K[1]])}if(ie=[...ie,{placement:r,overflows:ne}],!ne.every(K=>K<=0)){var st,at;let K=(((st=a.flip)==null?void 0:st.index)||0)+1,Fe=lt[K];if(Fe&&(!(p==="alignment"?k!==F(Fe):!1)||ie.every(M=>F(M.placement)===k?M.overflows[0]>0:!0)))return{data:{index:K,overflows:ie},reset:{placement:Fe}};let fe=(at=ie.filter(q=>q.overflows[0]<=0).sort((q,M)=>q.overflows[1]-M.overflows[1])[0])==null?void 0:at.placement;if(!fe)switch(b){case"bestFit":{var ct;let q=(ct=ie.filter(M=>{if($){let V=F(M.placement);return V===k||V==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(V=>V>0).reduce((V,ao)=>V+ao,0)]).sort((M,V)=>M[1]-V[1])[0])==null?void 0:ct[0];q&&(fe=q);break}case"initialPlacement":fe=m;break}if(r!==fe)return{reset:{placement:fe}}}return{}})}}};var an=new Set(["left","top"]);function cn(t,e){return D(this,null,function*(){let{placement:n,platform:o,elements:i}=t,r=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=W(n),c=we(n),m=F(n)==="y",f=an.has(a)?-1:1,u=r&&m?-1:1,h=xe(e,t),{mainAxis:p,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(g=c==="end"?b*-1:b),m?{x:g*u,y:p*f}:{x:p*f,y:g*u}})}var Nt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(n){return D(this,null,function*(){var o,i;let{x:r,y:a,placement:c,middlewareData:m}=n,f=yield cn(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:I(P({},f),{placement:c})}})}}},Bt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,fn(n){return D(this,null,function*(){let{x:o,y:i,placement:r,platform:a}=n,C=xe(t,n),{mainAxis:c=!0,crossAxis:m=!1,limiter:f={fn:k=>{let{x:S,y:T}=k;return{x:S,y:T}}}}=C,u=Ve(C,["mainAxis","crossAxis","limiter"]),h={x:o,y:i},p=yield a.detectOverflow(n,u),g=F(W(r)),b=Ze(g),v=h[b],y=h[g];if(c){let k=b==="y"?"top":"left",S=b==="y"?"bottom":"right",T=v+p[k],_=v-p[S];v=Je(T,v,_)}if(m){let k=g==="y"?"top":"left",S=g==="y"?"bottom":"right",T=y+p[k],_=y-p[S];y=Je(T,y,_)}let x=f.fn(I(P({},n),{[b]:v,[g]:y}));return I(P({},x),{data:{x:x.x-o,y:x.y-i,enabled:{[b]:c,[g]:m}}})})}}};function ze(){return typeof window!="undefined"}function Q(t){return Ht(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Ht(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ht(t){return ze()?t instanceof Node||t instanceof R(t).Node:!1}function L(t){return ze()?t instanceof Element||t instanceof R(t).Element:!1}function B(t){return ze()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Dt(t){return!ze()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}var mn=new Set(["inline","contents"]);function ce(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!mn.has(i)}var fn=new Set(["table","td","th"]);function Ft(t){return fn.has(Q(t))}var un=[":popover-open",":modal"];function Ce(t){return un.some(e=>{try{return t.matches(e)}catch(n){return!1}})}var hn=["transform","translate","scale","rotate","perspective"],dn=["transform","translate","scale","rotate","perspective","filter"],pn=["paint","layout","strict","content"];function Me(t){let e=Ae(),n=L(t)?z(t):t;return hn.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)||dn.some(o=>(n.willChange||"").includes(o))||pn.some(o=>(n.contain||"").includes(o))}function jt(t){let e=j(t);for(;B(e)&&!ee(e);){if(Me(e))return e;if(Ce(e))return null;e=j(e)}return null}function Ae(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var gn=new Set(["html","body","#document"]);function ee(t){return gn.has(Q(t))}function z(t){return R(t).getComputedStyle(t)}function Se(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function j(t){if(Q(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Dt(t)&&t.host||N(t);return Dt(e)?e.host:e}function Vt(t){let e=j(t);return ee(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&ce(e)?e:Vt(e)}function ae(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Vt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),a=R(i);if(r){let c=Ne(a);return e.concat(a,a.visualViewport||[],ce(i)?i:[],c&&n?ae(c):[])}return e.concat(i,ae(i,[],n))}function Ne(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=be(n)!==r||be(o)!==a;return c&&(n=r,o=a),{width:n,height:o,$:c}}function ot(t){return L(t)?t:t.contextElement}function me(t){let e=ot(t);if(!B(e))return A(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=qt(e),a=(r?be(n.width):n.width)/o,c=(r?be(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var yn=A(0);function Gt(t){let e=R(t);return!Ae()||!e.visualViewport?yn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bn(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==R(t)?!1:e}function te(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=ot(t),a=A(1);e&&(o?L(o)&&(a=me(o)):a=me(t));let c=bn(r,n,o)?Gt(r):A(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 p=R(r),g=o&&L(o)?R(o):o,b=p,v=Ne(b);for(;v&&o&&g!==b;){let y=me(v),x=v.getBoundingClientRect(),C=z(v),k=x.left+(v.clientLeft+parseFloat(C.paddingLeft))*y.x,S=x.top+(v.clientTop+parseFloat(C.paddingTop))*y.y;m*=y.x,f*=y.y,u*=y.x,h*=y.y,m+=k,f+=S,b=R(v),v=Ne(b)}}return Z({width:u,height:h,x:m,y:f})}function Be(t,e){let n=Se(t).scrollLeft;return e?e.left+n:te(N(t)).left+n}function Yt(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Be(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function vn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",a=N(o),c=e?Ce(e.floating):!1;if(o===a||c&&r)return n;let m={scrollLeft:0,scrollTop:0},f=A(1),u=A(0),h=B(o);if((h||!h&&!r)&&((Q(o)!=="body"||ce(a))&&(m=Se(o)),B(o))){let g=te(o);f=me(o),u.x=g.x+o.clientLeft,u.y=g.y+o.clientTop}let p=a&&!h&&!r?Yt(a,m):A(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-m.scrollLeft*f.x+u.x+p.x,y:n.y*f.y-m.scrollTop*f.y+u.y+p.y}}function xn(t){return Array.from(t.getClientRects())}function wn(t){let e=N(t),n=Se(t),o=t.ownerDocument.body,i=H(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=H(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+Be(t),c=-n.scrollTop;return z(o).direction==="rtl"&&(a+=H(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:c}}var Wt=25;function Cn(t,e){let n=R(t),o=N(t),i=n.visualViewport,r=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){r=i.width,a=i.height;let u=Ae();(!u||u&&e==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let f=Be(o);if(f<=0){let u=o.ownerDocument,h=u.body,p=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(o.clientWidth-h.clientWidth-g);b<=Wt&&(r-=b)}else f<=Wt&&(r+=f);return{width:r,height:a,x:c,y:m}}var Sn=new Set(["absolute","fixed"]);function En(t,e){let n=te(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?me(t):A(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 Ut(t,e,n){let o;if(e==="viewport")o=Cn(t,n);else if(e==="document")o=wn(N(t));else if(L(e))o=En(e,n);else{let i=Gt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Z(o)}function Xt(t,e){let n=j(t);return n===e||!L(n)||ee(n)?!1:z(n).position==="fixed"||Xt(n,e)}function kn(t,e){let n=e.get(t);if(n)return n;let o=ae(t,[],!1).filter(c=>L(c)&&Q(c)!=="body"),i=null,r=z(t).position==="fixed",a=r?j(t):t;for(;L(a)&&!ee(a);){let c=z(a),m=Me(a);!m&&c.position==="fixed"&&(i=null),(r?!m&&!i:!m&&c.position==="static"&&!!i&&Sn.has(i.position)||ce(a)&&!m&&Xt(t,a))?o=o.filter(u=>u!==a):i=c,a=j(a)}return e.set(t,o),o}function Tn(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,a=[...n==="clippingAncestors"?Ce(e)?[]:kn(e,this._c):[].concat(n),o],c=a[0],m=a.reduce((f,u)=>{let h=Ut(e,u,i);return f.top=H(h.top,f.top),f.right=se(h.right,f.right),f.bottom=se(h.bottom,f.bottom),f.left=H(h.left,f.left),f},Ut(e,c,i));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function _n(t){let{width:e,height:n}=qt(t);return{width:e,height:n}}function Pn(t,e,n){let o=B(e),i=N(e),r=n==="fixed",a=te(t,!0,r,e),c={scrollLeft:0,scrollTop:0},m=A(0);function f(){m.x=Be(i)}if(o||!o&&!r)if((Q(e)!=="body"||ce(i))&&(c=Se(e)),o){let g=te(e,!0,r,e);m.x=g.x+e.clientLeft,m.y=g.y+e.clientTop}else i&&f();r&&!o&&i&&f();let u=i&&!o&&!r?Yt(i,c):A(0),h=a.left+c.scrollLeft-m.x-u.x,p=a.top+c.scrollTop-m.y-u.y;return{x:h,y:p,width:a.width,height:a.height}}function tt(t){return z(t).position==="static"}function Kt(t,e){if(!B(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return N(t)===n&&(n=n.ownerDocument.body),n}function Jt(t,e){let n=R(t);if(Ce(t))return n;if(!B(t)){let i=j(t);for(;i&&!ee(i);){if(L(i)&&!tt(i))return i;i=j(i)}return n}let o=Kt(t,e);for(;o&&Ft(o)&&tt(o);)o=Kt(o,e);return o&&ee(o)&&tt(o)&&!Me(o)?n:o||jt(t)||n}var Rn=function(t){return D(this,null,function*(){let e=this.getOffsetParent||Jt,n=this.getDimensions,o=yield n(t.floating);return{reference:Pn(t.reference,yield e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function $n(t){return z(t).direction==="rtl"}var On={convertOffsetParentRelativeRectToViewportRelativeRect:vn,getDocumentElement:N,getClippingRect:Tn,getOffsetParent:Jt,getElementRects:Rn,getClientRects:xn,getDimensions:_n,getScale:me,isElement:L,isRTL:$n};function Zt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function In(t,e){let n=null,o,i=N(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:p,height:g}=f;if(c||e(),!p||!g)return;let b=ve(h),v=ve(i.clientWidth-(u+p)),y=ve(i.clientHeight-(h+g)),x=ve(u),k={rootMargin:-b+"px "+-v+"px "+-y+"px "+-x+"px",threshold:H(0,se(1,m))||1},S=!0;function T(_){let $=_[0].intersectionRatio;if($!==m){if(!S)return a();$?a(!1,$):o=setTimeout(()=>{a(!1,1e-7)},1e3)}$===1&&!Zt(f,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(T,I(P({},k),{root:i.ownerDocument}))}catch(_){n=new IntersectionObserver(T,k)}n.observe(t)}return a(!0),r}function Qt(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=ot(t),u=i||r?[...f?ae(f):[],...ae(e)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),r&&x.addEventListener("resize",n)});let h=f&&c?In(f,n):null,p=-1,g=null;a&&(g=new ResizeObserver(x=>{let[C]=x;C&&C.target===f&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(e)})),n()}),f&&!m&&g.observe(f),g.observe(e));let b,v=m?te(t):null;m&&y();function y(){let x=te(t);v&&!Zt(v,x)&&n(),v=x,b=requestAnimationFrame(y)}return n(),()=>{var x;u.forEach(C=>{i&&C.removeEventListener("scroll",n),r&&C.removeEventListener("resize",n)}),h==null||h(),(x=g)==null||x.disconnect(),g=null,m&&cancelAnimationFrame(b)}}var eo=Nt;var to=Bt,oo=At;var no=(t,e,n)=>{let o=new Map,i=P({platform:On},n),r=I(P({},i.platform),{_c:o});return Mt(t,e,I(P({},i),{platform:r}))};function U(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=Qt(r,a,()=>{no(r,a,{placement:m.get(),middleware:[eo(12),oo(),to()],strategy:"fixed"}).then(({x:v,y,placement:x})=>{var C;Object.assign(a.style,{left:`${v}px`,top:`${y}px`}),x!==m.get()&&m.set(x),(C=t.onPlacement)==null||C.call(t,r,a,x)})}),c.set(!0))},u=()=>{i&&i(),i=null,c.set(!1)},h=()=>{o&&clearTimeout(o),o=setTimeout(f,100)},p=()=>{o&&clearTimeout(o),o=setTimeout(u,100)},g={style:{position:"fixed",pointerEvents:"auto",visibility:v=>c.get(v)?"visible":"hidden"},_onMount:v=>a=v.domElement,_portal:v=>{let y=v.domElement.querySelector("#domphy-floating");if(!y){let x={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};y=v.children.insert(x).domElement}return y}};return E(t.content,g),{show:h,hide:p,anchorPartial:{onKeyDown:v=>v.key==="Escape"&&p(),_onSchedule:v=>{let y=null;v.getRoot().addHook("Init",x=>{y=x.children.insert(t.content)}),v.addHook("BeforeRemove",()=>{p(),o&&clearTimeout(o),y&&y.remove()})},_onMount:v=>{r=v.domElement;let y=x=>{if(!c.get()||!r||!a)return;let C=x.target;!r.contains(C)&&!a.contains(C)&&p()};v.getRoot().domElement.addEventListener("click",y),v.addHook("BeforeRemove",()=>v.getRoot().domElement.removeEventListener("click",y))}}}}function Ln(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:u}=U({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),h={onClick:()=>!r&&f()};E(t.content,h);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:l(6),marginInlineStart:l(2),fontSize:y=>d(y,"inherit"),color:y=>s(y,"shift-6",o),backgroundColor:y=>s(y,"inherit",o)},g;t.input?(E(t.input,{onFocus:()=>m(),style:p,_key:"combobox-input"}),g=t.input):g={input:null,onFocus:()=>m(),value:y=>(a.get(y),""),style:p,_key:"combobox-input"};let b={div:y=>{let x=a.get(y),C=Array.isArray(x)?x:[x],S=e.filter(T=>C.includes(T.value)).map(T=>({span:T.label,$:[ge({color:o,removable:!0})],_key:T.value,_onRemove:_=>{let $=a.get(),oe=(Array.isArray($)?$:[$]).filter(ne=>ne!==T.value);r?a.set(oe):a.set(oe[0])}}));return S.push(g),S},style:{display:"flex",flexWrap:"wrap",gap:l(1)}},v={_onInsert:y=>{y.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:y=>y.children.insert(b),style:{minWidth:l(32),outlineOffset:"-1px",outline:y=>`1px solid ${s(y,"shift-3","neutral")}`,paddingBlock:l(1),paddingInline:l(1),borderRadius:l(2),fontSize:y=>d(y,"inherit"),color:y=>s(y,"shift-6",o),backgroundColor:y=>s(y,"inherit",o)}};return E(u,v),u}function nt(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(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:l(1.5),height:l(1.5),backgroundColor:u=>s(u,"inherit",n),borderWidth:i?"0px":"1px",borderColor:u=>s(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),p=h.includes("right")||h.includes("end")&&!h.includes("left")?"50%":"-50%",g=h.includes("bottom")||h.includes("end")&&!h.includes("top")?"50%":"-50%";return`translate(${p},${g}) rotate(45deg)`}}}}}function zn(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=>d(n,"inherit"),backgroundColor:n=>s(n,"inherit",e),boxShadow:n=>`inset ${l(1)} 0 0 0 ${s(n,"shift-3",e)}`,border:"none",paddingBlock:l(2),paddingInline:l(4),margin:0}}}function Mn(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:l(1),paddingInline:l(3),borderRadius:l(2),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-3",e)}`,color:n=>s(n,"shift-6",e),backgroundColor:n=>s(n,"inherit",e),"&:hover:not([disabled]):not([aria-busy=true])":{color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"shift-1",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-1","neutral"),outline:n=>`1px solid ${s(n,"shift-3","neutral")}`,color:n=>s(n,"shift-5","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function An(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-6",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-5",n)}`,backgroundColor:o=>s(o,"shift-5",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>s(o,"shift-4",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-4",n)}`,backgroundColor:o=>s(o,"inherit",n)},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:o=>s(o,"shift-5",n)},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:o=>s(o,"shift-4",n)},"&:focus-visible":{borderRadius:l(1.5),outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>s(o,"shift-3","neutral"),pointerEvents:"none"}}}}function Nn(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-6",e),backgroundColor:n=>s(n,"inherit",e),height:l(6),paddingInline:l(1.5),borderRadius:l(1)}}}function Bn(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-6",e),backgroundColor:i=>s(i,"inherit",e),overflow:"hidden","& > summary":{backgroundColor:i=>s(i,"shift-1",e),color:i=>s(i,"shift-7",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:l(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-6",e)}`,borderBottom:i=>`${l(.5)} solid ${s(i,"shift-6",e)}`,transform:"rotate(45deg)",transition:`transform ${o}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:i=>s(i,"shift-2",e)},"& > summary:focus-visible":{borderRadius:l(2),outlineOffset:`-${l(.5)}`,outline:i=>`${l(.5)} solid ${s(i,"shift-5",n)}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:l(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:l(1),paddingBottom:l(3)}}}}function Dn(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-7",e)},"& dd":{margin:0,fontSize:n=>d(n,"inherit"),color:n=>s(n,"shift-6",e)}}}}function Hn(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-7",e),backgroundColor:i=>s(i,"inherit",e),border:"none",padding:l(3),boxShadow:i=>`0 ${l(8)} ${l(16)} ${s(i,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:i=>s(i,"shift-1","neutral"),opacity:.75}}}}function Fn(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-7",e)}}}function jn(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-6",e),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:l(2)},"& figcaption":{fontSize:n=>d(n,"decrease-1"),color:n=>s(n,"shift-5",e),lineHeight:1.45}}}}function Vn(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:l(3),paddingBlock:l(3),border:"none",borderRadius:l(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:l(1),borderRadius:l(2),color:i=>s(i,"shift-6",e),backgroundColor:i=>s(i,"inherit",e)},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:o?0:l(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-6",e)}}}}var Wn={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Un(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-8",e),marginTop:0,marginBottom:l(2),fontSize:n=>{let o=Wn[n.elementNode.tagName]||"inherit";return d(n,o)}}}}function Kn(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-3",e)}}}function qn(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:l(2),backgroundColor:n=>s(n,"shift-1",e)}}}function Gn(){return{_onInsert:t=>{t.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)}}}function Yn(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:l(1),paddingInline:l(1),blockSize:l(8),inlineSize:l(8),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:l(1)},"&::-moz-color-swatch":{borderRadius:l(1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`}}}}function Xn(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-6",n),backgroundColor:i=>s(i,"inherit",n),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${s(i,"shift-3",n)}`,borderRadius:l(2),paddingInline:l(3),height:l(8),"&::-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-5",o)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:i=>s(i,"shift-5","neutral"),backgroundColor:i=>s(i,"shift-1","neutral"),outline:i=>`1px solid ${s(i,"shift-3","neutral")}`},"&:invalid":{outline:i=>`${l(.5)} solid ${s(i,"shift-5","error")}`}}}}function Jn(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-6",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,borderRadius:l(2),height:l(8),paddingInline:l(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-7",n),backgroundColor:o=>s(o,"shift-2",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-7",e),backgroundColor:o=>s(o,"shift-2",e)},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,backgroundColor:o=>s(o,"shift-1","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),backgroundColor:o=>s(o,"shift-2","neutral")}}}}function Zn(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-6",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,borderRadius:l(2),minWidth:l(32),paddingInline:l(3),paddingBlock:l(1),"&::placeholder":{color:o=>s(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=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`}}}}function Qn(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:l(3),paddingBlock:l(1),borderRadius:l(2),fontSize:o=>d(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-4")},"&:not(:placeholder-shown)":{color:o=>s(o,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,color:o=>s(o,"shift-5","neutral")},"&:invalid:not(:placeholder-shown)":{outline:o=>`${l(.5)} solid ${s(o,"shift-5","error")}`},"&[data-status=error]":{outline:o=>`${l(.5)} solid ${s(o,"shift-5","error")}`},"&[data-status=warning]":{outline:o=>`${l(.5)} solid ${s(o,"shift-5","warning")}`}}}}function ei(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-2",e)},"&::-moz-range-track":{height:l(1.5),borderRadius:l(999),backgroundColor:o=>s(o,"shift-2",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-6",n)},"&::-moz-range-thumb":{width:l(4),height:l(4),borderRadius:l(999),border:"none",backgroundColor:o=>s(o,"shift-6",n)},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:o=>s(o,"shift-7",n)},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:o=>s(o,"shift-7",n)},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-4",n)}`,outlineOffset:l(1),borderRadius:l(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ti(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:l(3),paddingBlock:l(1),borderRadius:l(2),fontSize:o=>d(o,"inherit"),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,color:o=>s(o,"shift-6",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-5",n)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>s(o,"shift-1","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,color:o=>s(o,"shift-5","neutral")}}}}function oi(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-6",e),backgroundColor:n=>s(n,"inherit",e),paddingBlock:l(.5),paddingInline:l(1.5),borderRadius:l(1),outline:n=>`1px solid ${s(n,"shift-3",e)}`}}}function ni(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-6",e),cursor:"pointer","&:focus-within":{color:o=>s(o,"shift-7",n)},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral")}}}}function ii(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"),color:o=>s(o,"shift-6",e),textDecoration:"none","&:visited":{color:o=>s(o,"shift-6",n)},"&:hover:not([disabled])":{color:o=>s(o,"shift-7",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-5","neutral")}}}}function ri(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=>d(o,"inherit"),color:o=>s(o,"shift-6",e),backgroundColor:o=>s(o,"inherit",e),height:l(6),borderRadius:l(1),paddingInline:l(1.5)}}}function li(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-6",e),lineHeight:1.5,marginTop:0,marginBottom:0}}}function si(t={}){let{color:e="neutral"}=t;return{_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-6",e),backgroundColor:n=>s(n,"shift-1",e),border:"none",paddingBlock:l(2),paddingInline:l(3),borderRadius:l(2)}}}function ai(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-2",e),"&::-webkit-progress-bar":{backgroundColor:o=>s(o,"shift-2",e),borderRadius:l(999)},"&::-webkit-progress-value":{backgroundColor:o=>s(o,"shift-6",n),borderRadius:l(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:o=>s(o,"shift-6",n),borderRadius:l(999)}}}}function ci(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-6",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-5",n)}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:o=>s(o,"shift-5",n)},"&:checked:hover:not([disabled])::before":{backgroundColor:o=>s(o,"shift-4",n)},"&:focus-visible":{borderRadius:"50%",outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:o=>s(o,"shift-3","neutral"),pointerEvents:"none"}}}}function mi(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-6",e),backgroundColor:o=>s(o,"inherit",e),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,borderRadius:l(2),paddingBlock:l(1),paddingLeft:l(3),paddingRight:l(1),"&:not([multiple])":{height:l(8)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-4",n)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"& optgroup":{color:o=>s(o,"shift-8",e)},"& option[disabled]":{color:o=>s(o,"shift-4","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,backgroundColor:o=>s(o,"shift-1","neutral")}}}}function fi(t={}){let{color:e="neutral"}=t,n={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=J(JSON.stringify(n));return{ariaHidden:"true",style:{height:l(6),display:"block",borderRadius:l(1),backgroundColor:i=>s(i,"shift-2",e),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:n}}}var ro={to:{transform:"rotate(360deg)"}},io=J(JSON.stringify(ro));function ui(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:l(6),height:l(6),borderRadius:"50%",border:n=>`${l(.5)} solid ${s(n,"shift-3",e)}`,borderTopColor:n=>s(n,"shift-6",e),boxSizing:"border-box",padding:0,animation:`${io} 0.7s linear infinite`,[`@keyframes ${io}`]:ro}}}function hi(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(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:l(2),paddingInline:l(2),fontSize:c=>d(c,"inherit"),backgroundColor:c=>s(c,"inherit",e)}}}function di(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:l(8),paddingInline:l(3),border:"none",outline:"none",color:r=>s(r,"shift-6",n),backgroundColor:r=>s(r,"inherit",n),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:r=>s(r,"shift-1",n)},"&[aria-selected=true]":{backgroundColor:r=>s(r,"shift-2",e),color:r=>s(r,"shift-8")},"&:focus-visible":{outline:r=>`${l(.5)} solid ${s(r,"shift-5",e)}`,outlineOffset:`-${l(.5)}`}}}}function pi(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:u}=U({open:c,placement:n,content:t.content,onPlacement:t.onPlacement}),h={onClick:()=>!r&&f()};E(t.content,h);let p={div:b=>{let v=a.get(b),y=Array.isArray(v)?v:[v];return e.filter(C=>y.includes(C.value)).map(C=>({span:C.label,$:[ge({color:o,removable:r})],_key:C.value,_onRemove:k=>{let S=a.get(),_=(Array.isArray(S)?S:[S]).filter($=>$!==C.value);r?a.set(_):a.set(_[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:l(1),flex:1}},g={_onInsert:b=>{b.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:b=>b.children.insert(p),onClick:()=>c.get()?f():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:l(8),minWidth:l(32),outlineOffset:"-1px",outline:b=>`1px solid ${s(b,"shift-3","neutral")}`,paddingInline:l(2),borderRadius:l(2),fontSize:b=>d(b,"inherit"),color:b=>s(b,"shift-6",o),backgroundColor:b=>s(b,"inherit",o)}};return E(u,g),u}function gi(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=>d(n,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:l(8),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 yi(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:"increase-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-2",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-6"),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 bi(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-6",e)}}}function vi(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-8",e)}}}function xi(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-6",e)}}}function wi(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-6",e)}}}function Ci(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-6",e),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:l(3),paddingBlock:l(1),color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"inherit")},"& td":{textAlign:"left",paddingInline:l(3),paddingBlock:l(1),color:n=>s(n,"shift-6",e),boxShadow:n=>`inset 0 1px 0 ${s(n,"shift-3",e)}`,fontSize:n=>d(n,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:l(3),paddingBlock:l(1),color:n=>s(n,"shift-7",e),backgroundColor:n=>s(n,"inherit"),boxShadow:n=>`inset 0 -1px 0 ${s(n,"shift-3",e)}`},"& tr":{backgroundColor:n=>s(n,"inherit")},"& tbody tr:hover":{backgroundColor:n=>s(n,"shift-2")+"!important"}}}}function Si(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:l(4),paddingBlock:l(2),border:"none",borderRadius:l(2),fontSize:o=>d(o,"inherit"),color:o=>s(o,"shift-6",e),outlineOffset:"-1px",outline:o=>`1px solid ${s(o,"shift-3",e)}`,backgroundColor:o=>s(o,"inherit",e),"&::placeholder":{color:o=>s(o,"shift-4")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${l(.5)} solid ${s(o,"shift-4",n)}`},"&:focus-visible":{outline:o=>`${l(.5)} solid ${s(o,"shift-5",n)}`},"&:invalid":{outline:o=>`${l(.5)} solid ${s(o,"shift-4","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>s(o,"shift-5","neutral"),outline:o=>`1px solid ${s(o,"shift-3","neutral")}`,backgroundColor:o=>s(o,"shift-1","neutral")}}}}function Ei(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"),color:n=>s(n,"shift-6",e),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"disc",listStylePosition:"outside"}}}function ki(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"),color:n=>s(n,"shift-6",e),marginTop:0,marginBottom:0,paddingLeft:l(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Ti(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 _i(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:l(8),height:l(8),paddingInline:l(2),borderRadius:l(2),border:"none",cursor:"pointer",fontSize:m=>d(m,"inherit"),backgroundColor:"transparent",color:m=>s(m,"shift-6",n),"&:hover:not([disabled])":{backgroundColor:m=>s(m,"shift-1",n)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=I(P({},r),{backgroundColor:m=>s(m,"shift-2",o),color:m=>s(m,"shift-8",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>s(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),p=[];p.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:h<=1,onClick:()=>h>1&&i.set(h-1),style:r});for(let g of Ti(h,e))if(g==="...")p.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:l(2),color:b=>s(b,"shift-4",n)}});else{let b=g===h;p.push({button:String(g),type:"button",ariaLabel:`Page ${g}`,ariaCurrent:b?"page":void 0,disabled:b,onClick:()=>i.set(g),style:b?a:r})}return p.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:h>=e,onClick:()=>h<e&&i.set(h+1),style:r}),p},style:{display:"flex",alignItems:"center",gap:l(1)}};m.children.insert(f)},style:{display:"inline-flex"}}}function Pi(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"),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:n=>s(n,"shift-3",e),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:n=>s(n,"shift-3",e),borderWidth:"1px",borderBottomStyle:"solid"}}}}var lo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Ri={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},it=t=>t==="left"||t==="right";function $i(t={}){let{color:e="neutral",open:n=!1,placement:o="right",size:i}=t,r=w(n),a=it(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 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=lo[o]};u(r.get()),r.onChange(u)},style:{transform:lo[o],transition:"transform 0.25s ease",fontSize:m=>d(m,"inherit"),color:m=>s(m,"shift-7",e),backgroundColor:m=>s(m,"inherit",e),border:"none",padding:l(3),margin:Ri[o],width:it(o)?c:"100dvw",height:it(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${l(4)} ${l(12)} ${s(m,"shift-3","neutral")}`,"&::backdrop":{backgroundColor:m=>s(m,"shift-1","neutral"),opacity:.75}}}}function Oi(t){let{open:e=!1,placement:n="bottom",openOn:o="click"}=t,i=null,r=w(e),{show:a,hide:c,anchorPartial:m}=U({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 p=h.attributes.get("id");i=p||h.nodeId,!p&&h.attributes.set("id",i)}};return E(t.content,f),E(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 Ii(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",style:{minWidth:l(32),pointerEvents:"auto",paddingBlock:l(2),paddingInline:l(4),borderRadius:l(2),fontSize:m=>d(m,"inherit"),color:m=>s(m,"shift-1",n),backgroundColor:m=>s(m,"shift-9",n),boxShadow:m=>`0 ${l(2)} ${l(8)} ${s(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 Li(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}=U({open:e,placement:n,content:a}),u={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-11",_onInsert:p=>{let g=p.attributes.get("id");i=g||p.nodeId,!g&&p.attributes.set("id",i)},style:{paddingBlock:l(1),paddingInline:l(3),borderRadius:l(2),color:p=>s(p,"shift-6"),backgroundColor:p=>s(p),fontSize:p=>d(p,"inherit")},$:[nt({placement:n,bordered:!1})]};return a.$||(a.$=[]),a.$.push(u),E(f,{onMouseEnter:()=>c(),onMouseLeave:()=>m(),onFocus:()=>c(),onBlur:()=>m(),onKeyDown:p=>p.key==="Escape"&&m(),_onMount:p=>i&&p.attributes.set("ariaDescribedby",i)}),f}function so(t,e){return t.key!==void 0&&t.key!==null?String(t.key):`index-${e}`}function zi(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 O))return;let c=r.domElement;c&&o.set(so(r,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((r,a)=>{if(!(r instanceof O))return;let c=r.domElement;if(!c)return;let m=so(r,a),f=o.get(m);if(!f)return;let u=c.getBoundingClientRect(),h=f.left-u.left,p=f.top-u.top;if(Math.abs(h)<.5&&Math.abs(p)<.5)return;let g=c.style.transition,b=c.style.transform;c.style.transition="none",c.style.transform=`translate(${h}px, ${p}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${e}ms ease ${n}ms`,c.style.transform="translate(0px, 0px)"});let v=()=>{c.style.transition=g,c.style.transform=b,c.removeEventListener("transitionend",y)},y=x=>{x.propertyName==="transform"&&v()};c.addEventListener("transitionend",y),setTimeout(v,e+n+34)}),o.clear()}}}function Mi(t={}){return{role:"tablist",_onSchedule:(n,o)=>{let i={_context:{tabs:{activeKey:w(t.activeKey||0)}}};E(o,i)}}}function Ai(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 y,x,C,k;let h=u.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(h))return;u.preventDefault();let p=((x=(y=i.parent)==null?void 0:y.children.items)!=null?x:[]).filter(S=>S.type==="ElementNode"&&S.attributes.get("role")==="tab"),g=p.findIndex(S=>S===i),b=g;h==="ArrowRight"?b=(g+1)%p.length:h==="ArrowLeft"?b=(g-1+p.length)%p.length:h==="Home"?b=0:h==="End"&&(b=p.length-1);let v=p[b];r.activeKey.set((C=v.key)!=null?C:b),(k=v.domElement)==null||k.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>d(i,"inherit"),height:l(8),paddingInline:l(4),border:"none",outline:"none",color:i=>s(i,"shift-6"),backgroundColor:i=>s(i,"inherit"),boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-2",n)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-3",n)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-4",e)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${l(.5)} 0 0 ${s(i,"shift-6",e)}`}}}}function Ni(){return{role:"tabpanel",style:{paddingBlock:l(2),paddingInline:l(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 Bi(t={}){let{color:e="neutral"}=t;return{role:"menu",dataTone:"shift-11",_onSchedule:(o,i)=>{let r={_context:{menu:{activeKey:w(t.activeKey||0)}}};E(i,r)},style:{display:"flex",flexDirection:"column",paddingBlock:l(2),paddingInline:l(2),fontSize:o=>d(o,"inherit"),backgroundColor:o=>s(o,"inherit",e)}}}function Di(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,p;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(g=>g.type==="ElementNode"&&g.attributes.get("role")==="menuitem"),m=c.findIndex(g=>g===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),(p=c[f].domElement)==null||p.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>d(i,"inherit"),height:l(8),paddingInline:l(3),border:"none",outline:"none",color:i=>s(i,"shift-6"),backgroundColor:i=>s(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>s(i,"shift-1")},"&[aria-current=true]":{backgroundColor:i=>s(i,"shift-1",e),color:i=>s(i,"shift-7")},"&:focus-visible":{outline:i=>`${l(.5)} solid ${s(i,"shift-5",e)}`,outlineOffset:`-${l(.5)}`}}}}function Hi(t){return{_onSchedule:(e,n)=>{E(n,{_context:{form:t}})}}}function Fi(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 ji(t){return!!t&&typeof t.then=="function"}var Ee=class{constructor(e,n){this._notifier=new he;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),De(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]);De(n)!==De(e)&&this._notifier.notify("status",De(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);ji(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 De(t){if(t.error)return"error";if(t.warning)return"warning";if(t.success)return"success"}var rt=class{constructor(){this.fields=new Map}setField(e,n,o){let i=this.fields.get(e);return i?i.configure(n,o):(i=new Ee(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)Vi(e,n,o._value);return e}_dispose(){for(let e of this.fields.values())e._dispose();this.fields.clear()}};function Vi(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 po(Wi);})();
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);})();
5
5
  //# sourceMappingURL=core-theme-ui.global.js.map