@domphy/ui 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- "use strict";var Domphy=(()=>{var Ce=Object.defineProperty,wo=Object.defineProperties,Eo=Object.getOwnPropertyDescriptor,ko=Object.getOwnPropertyDescriptors,_o=Object.getOwnPropertyNames,ht=Object.getOwnPropertySymbols;var ft=Object.prototype.hasOwnProperty,To=Object.prototype.propertyIsEnumerable;var dt=(e,t,r)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pt=(e,t)=>{for(var r in t||(t={}))ft.call(t,r)&&dt(e,r,t[r]);if(ht)for(var r of ht(t))To.call(t,r)&&dt(e,r,t[r]);return e},gt=(e,t)=>wo(e,ko(t));var we=(e,t)=>{for(var r in t)Ce(e,r,{get:t[r],enumerable:!0})},Oo=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _o(t))!ft.call(e,i)&&i!==r&&Ce(e,i,{get:()=>t[i],enumerable:!(o=Eo(t,i))||o.enumerable});return e};var Po=e=>Oo(Ce({},"__esModule",{value:!0}),e);var di={};we(di,{core:()=>ke,theme:()=>Oe,ui:()=>je});var ke={};we(ke,{AttributeList:()=>$t,BooleanAttributes:()=>Ye,CamelAttributes:()=>Pt,ElementList:()=>Rt,ElementNode:()=>$,HtmlTags:()=>Ge,Notifier:()=>Ee,PrefixCSS:()=>Z,RecordState:()=>Fo,State:()=>Fe,SvgTags:()=>Ot,VoidTags:()=>Tt,hashString:()=>se,merge:()=>T,r:()=>No,toState:()=>f});var $o=Object.defineProperty,yt=Object.getOwnPropertySymbols,Ro=Object.prototype.hasOwnProperty,Io=Object.prototype.propertyIsEnumerable,bt=(e,t,r)=>t in e?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vt=(e,t)=>{for(var r in t||(t={}))Ro.call(t,r)&&bt(e,r,t[r]);if(yt)for(var r of yt(t))Io.call(t,r)&&bt(e,r,t[r]);return e},zo=["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"],Lo=zo.reduce((e,t)=>{let r=t.slice(2).toLowerCase();return e[r]=t,e},{}),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"],N=[],Mo=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},St=100,Ee=class{constructor(){this._listeners={},this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let r=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(r)),r}removeListener(e,t){if(!this._listeners)return;let r=this._listeners[e];r&&r.has(t)&&(r.delete(t),r.size===0&&delete this._listeners[e])}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let r=N.length?N[N.length-1]:null;if(r&&r[0]===this&&r[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=St){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${St} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...N]})}this._scheduled||(this._scheduled=!0,Mo(()=>this._flushAll()))}_isCircular(e){let t=N.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let r=[...N.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
- ${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)N=o,this._flush(t,r);N=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){N.push([this,e]),this._flushing.set(e,t);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),N.pop()}}},Fe=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Ee,this.initialValue=e,this._value=e}get(e){return e&&this.addListener(e),this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function T(e={},t={}){let r=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=U(t));for(let n in t){let l=t[n];if(!(l==null||l===""))if(typeof l=="object"&&!Array.isArray(l))typeof e[n]=="object"?e[n]=T(e[n],l):e[n]=l;else if(r.includes(n))if(typeof e[n]=="function"||typeof l=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,h=typeof l=="function"?l(m):l;return[u,h].filter(d=>d).join(", ")}}else e[n]=[e[n],l].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof l=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,h=typeof l=="function"?l(m):l;return[u,h].filter(d=>d).join("")}}else e[n]=[e[n],l].filter(c=>c).join("");else if(o.includes(n))if(typeof e[n]=="function"||typeof l=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,h=typeof l=="function"?l(m):l;return[u,h].filter(d=>d).join(" ")}}else e[n]=[e[n],l].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();Ao(e,c,l)}else if(n.startsWith("_on")){let c=n.replace("_on","");Vo(e,c,l)}else e[n]=l}return e}function se(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof Fe||e!=null&&e._isState?e:new Fe(e,t)}function No(e){return e}function Vo(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function Ao(e,t,r){let o=Lo[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,l)=>{i(n,l),r(n,l)}:e[o]=r}function U(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(U(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,n]of e)o.set(U(i,t),U(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(U(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=U(e[i],t);return o}function Ct(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o==0&&!Ge.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")e.$.forEach(l=>Ct(l,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function xt(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function wt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Et(e){return Object.keys(e).find(t=>Ge.includes(t))}function kt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Do(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,l=e.length;n<l;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function Ue(e){let t=e.trim();return t.startsWith("@")?t.replace(/\s+/g,""):t.replace(/\s*([>+~,])\s*/g,"$1").replace(/\s+/g," ").replace(/\(\s*odd\s*\)/g,"(2n+1)").replace(/\(\s*even\s*\)/g,"(2n)").trim()}function Bo(e,t){for(let r=0;r<e.length;r++){let o=e[r],i=null;typeof o.selectorText=="string"?i=Ue(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=Ue(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function _t(e){var t;let r=e.querySelector("#domphy-style");return r||(r=document.createElement("style"),r.id="domphy-style",e.appendChild(r)),r.dataset.domphyBase!=="true"&&((t=r.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),r.dataset.domphyBase="true"),r}var Ke=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>T(t,Ke(r))),delete e.$,T(t,e),t}else return e},Tt=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],Ot=["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"],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"],Z={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"]},Pt=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],jo=class{constructor(e,t,r){this._notifier=new Ee,this._releases=[],this.parent=r,this.isBoolean=Ye.includes(e),Pt.includes(e)?this.name=e:this.name=kt(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,r;let o=this.value;if(this._releases.length){for(let i of this._releases)i();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e(i):e(i),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,i.onSubscribe=n=>{this._releases.push(n),this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),i=null})},this.value=this.isBoolean?!!e(i):e(i)}else this.value=this.isBoolean?!!e:e;this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=r=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",r)},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${wt(String(r))}"`}}},$t=class{constructor(e){this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?this.items[e].set(t):this.items[e]=new jo(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.prototype.hasOwnProperty.call(this.items,e):!1}remove(e){this.items&&(this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(e))}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this.items=null,this.parent=null}toggle(e,t){if(!Ye.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){if(!e||typeof e!="string")return;let t=(o,i)=>{let n=(o||"").split(" ").filter(l=>l);return!n.includes(i)&&n.push(e),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(r=>r).filter(r=>r!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},Ho=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(xt(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":xt(this.text)?this.text:wt(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},Rt=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new $(e,this.owner,this._nextKey++):new Ho(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof $?e.domElement:e.domText;if(o){let i=r.childNodes[t]||null;o!==i&&r.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof $?e.domElement:e.domText,i=t instanceof $?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,l=i.nextSibling;r.insertBefore(o,l),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,l;let c=this.items.slice(),m=new Map;for(let y of c)y instanceof $&&y.key!==null&&y.key!==void 0&&m.set(y.key,y);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let u=new Set(c),h=new Set;for(let y=0;y<e.length;y++){let b=e[y],v=typeof b=="object"&&b!==null,x=v?b._key:void 0,S=v?Et(b):void 0;if(x!==void 0){let C=m.get(x);if(C instanceof $&&C.tagName===S){m.delete(x);let w=this.items.indexOf(C);if(w!==y&&w>=0){let k=!!C._portal;this.move(w,y,k?!1:t,!0)}C.parent=this.owner,C.patch(b),h.add(C);continue}}else if(v){let C=this.items[y];if(C instanceof $&&C.key==null&&C.tagName===S&&u.has(C)&&!h.has(C)){C.parent=this.owner,C.patch(b),h.add(C);continue}}h.add(this.insert(b,y,t,!0))}let d=this.items.slice(e.length);for(let y of d)this.remove(y,t,!0);m.forEach(y=>this.remove(y,t,!0)),r||(l=(n=this.owner._hooks)==null?void 0:n.Update)==null||l.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let l=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>l?l:t,m=this._createNode(e);if(this.items.splice(c,0,m),m instanceof $){m._hooks.Insert&&m._hooks.Insert(m);let u=this.owner.domElement;if(r&&u)if(m._portal){let h=m._portal(this.owner.getRoot());h&&m.render(h)}else{let h=m._createDOMNode(),d=(i=u.childNodes[c])!=null?i:null;u.insertBefore(h,d);let y=u.getRootNode(),b=y instanceof ShadowRoot?y:document.head,v=_t(b);m.styles.render(v),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(x=>{if(x instanceof $&&x._portal){let S=x._portal(x.getRoot());S&&x.render(S)}else x.render(h)})}}else{let u=this.owner.domElement;if(r&&u){let h=m._createDOMNode(),d=(n=u.childNodes[c])!=null?n:null;u.insertBefore(h,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof $){if(e._beforeRemoveFired)return;let i=()=>{let n=e.domElement,l=this.items.indexOf(e);l>=0&&this.items.splice(l,1),t&&n&&n.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,l=()=>{n||(n=!0,i())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,l),e._hooks.BeforeRemove.length<2&&!n&&l()}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!r&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let r=this.items.slice();for(let o of r)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),r&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},Wo=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=kt(e),this.parentRule=r,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),Z[this.name]&&Z[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=(()=>{var l;!this.parentRule||(l=this.parentRule.parentNode)!=null&&l._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=l=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{l(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),Z[this.name]&&Z[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=`${this.cssName}: ${this.value}`;return Z[this.name]&&Z[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},J=class qe{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new It(this),this.parent=r}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof qe;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof qe;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new Wo(t,r,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},It=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof J;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={};function o(i,n){return i.startsWith("&")?`${n}${i.slice(1)}`:`${n} ${i}`}for(let i in e){let n=e[i],l=Do(i);for(let c of l){let m=o(c,t);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof n=="object"&&n!=null){let u=new J(c,this.parent);u.styleList.addCSS(n,t),this.items.push(u)}}else if(c.startsWith("@keyframes")){let u=new J(c,this.parent);u.styleList.addCSS(n,""),this.items.push(u)}else if(c.startsWith("@font-face")){let u=new J(c,this.parent);for(let h in n)u.insertStyle(h,n[h]);this.items.push(u)}else if(typeof n=="object"&&n!=null){let u=new J(m,this.parent);this.items.push(u);for(let[h,d]of Object.entries(n))if(typeof d=="object"&&d!=null){let y=o(h,m);h.startsWith("&")?this.addCSS(d,y):u.styleList.insertRule(y).styleList.addCSS(d,y)}else u.insertStyle(h,d)}else r[c]=n}}if(Object.keys(r).length){let i=new J(t,this.parent);for(let n in r)i.insertStyle(n,r[n]);this.items.push(i)}}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(r=>r.selectorText===e);return t||(t=new J(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let r=e.get(Ue(t.selectorText));r&&t.mount(r)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,l=e[n];l&&(o.selectorText.startsWith("@")&&l instanceof CSSKeyframesRule||"keyText"in l?o.mount(l):"selectorText"in l?l.selectorText!==r(o.selectorText)?t+=1:o.mount(l):"cssRules"in l&&o.mount(l))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},$=class ae{constructor(t,r=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new Rt(this),this.styles=new It(this),this.attributes=new $t(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,n;t=U(t),Ct(t),t.style=t.style||{},this.parent=r,this.tagName=Et(t),t=Ke(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let l=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(u,h)=>typeof h=="function"?l:h);this.nodeId=se(l+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let m=t[this.tagName];if(m!=null&&m!=null)if(typeof m=="function"){let u=()=>{if(this._disposed)return;let h=m(u);this.children.update(Array.isArray(h)?h:[h])};u.elementNode=this,u.debug=`class:${this.tagName}_${this.nodeId} children`,u.onSubscribe=h=>this.addHook("BeforeRemove",()=>{h(),u=null}),u&&u()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=Ot.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let r in this._events)this._bindEvent(r);return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let r=o=>{var i,n;return(n=(i=this._events)==null?void 0:i[t])==null?void 0:n.call(i,o,this)};this.domElement.addEventListener(t,r),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,r),r=null})}_dispose(){var t,r,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(r=(t=this._hooks).BeforeRemove)==null||r.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(n=>n.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(o=this._hooks).Remove)==null||i.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){T(this._context,t._context),T(this._metadata,t._metadata);let r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i=="_portal"?this._portal=n:i=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){let r=U(t);r.style=r.style||{},r=Ke(r);let o=r[this.tagName];if(typeof o!="function"){let u=o==null?[]:Array.isArray(o)?o:[o];this.children.update(u,!!this.domElement,!0)}r._context&&T(this._context,r._context),r._metadata&&T(this._metadata,r._metadata);let i=`${this.tagName}_${this.nodeId}`,n=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],l=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"],c=new Set(["class"]),m=null;this._events={};for(let u of Object.keys(r)){if(n.includes(u)||l.includes(u)||u==="_portal")continue;let h=r[u];u.startsWith("on")&&typeof h=="function"?this.addEvent(u.substring(2).toLowerCase(),h):u==="class"&&typeof h=="string"?m=h:(this.attributes.set(u,h),c.add(u))}if(this.attributes.set("class",m?`${i} ${m}`:i),this.attributes.items)for(let u of Object.keys(this.attributes.items))c.has(u)||this.attributes.remove(u);if(this._events)for(let u in this._events)this._bindEvent(u)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];if(typeof o=="function"){let i=((...n)=>{o(...n),r(...n)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,r.length),configurable:!0})}catch(n){}this._hooks[t]=i}else this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof ae&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.prototype.hasOwnProperty.call(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof ae?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(Tt.includes(this.tagName))return`<${this.tagName}${t}>`;let r=this.children.generateHTML();return`<${this.tagName}${t}>${r}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children&&this.children.items.forEach((o,i)=>{let n=t.childNodes[i];n&&(o instanceof ae?o.mount(n):o.domText=n)}),r){let o=r.sheet;o&&this._hydrateStyles(Bo(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var r;if((r=this.styles)==null||r.hydrate(t),this.children)for(let o of this.children.items)o instanceof ae&&o._hydrateStyles(t)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=_t(n)),this.styles.render(o),this.children.items.forEach(l=>{if(l instanceof ae&&l._portal){let c=l._portal(this.getRoot());c&&l.render(c)}else l.render(r)}),r}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var r;(r=this.domElement)==null||r.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let r=!1,o=()=>{r||(r=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!r&&o()}else t()}}},Fo=class{constructor(e){this._notifier=new Ee,this.initialRecord=vt({},e),this._record=vt({},e)}get(e,t){return t&&this._notifier.addListener(e,t),this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e)}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var Oe={};we(Oe,{getTheme:()=>V,setTheme:()=>Go,themeApply:()=>Xo,themeCSS:()=>Xe,themeColor:()=>a,themeColorToken:()=>tt,themeDensity:()=>p,themeName:()=>Te,themeSize:()=>g,themeSpacing:()=>s,themeTokens:()=>Nt,themeVars:()=>pe});var Uo={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},ge=Uo,Qe=e=>JSON.parse(JSON.stringify(e)),Lt=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),ce={light:Qe(ge),dark:Yo(ge)};function et(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Ko(e){for(let t in e)if(!Object.keys(ge).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}}function Mt(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),Mt(e[o],t[o])):e[o]=t[o]}function qo(e,t){let r={},o=et(t);for(let n in t){let l=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(m=>r[`--${c}-${m}`]=t.colors[c][m]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else if(n==="custom"&&l&&typeof l=="object")for(let c in l)r[`--custom-${Lt(c)}`]=l[c]}let i="";for(let n in r)i+=` ${n}: ${r[n]};
1
+ "use strict";var Domphy=(()=>{var Fe=Object.defineProperty,yn=Object.defineProperties,bn=Object.getOwnPropertyDescriptor,vn=Object.getOwnPropertyDescriptors,Sn=Object.getOwnPropertyNames,qt=Object.getOwnPropertySymbols;var Gt=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Yt=(e,t,r)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,We=(e,t)=>{for(var r in t||(t={}))Gt.call(t,r)&&Yt(e,r,t[r]);if(qt)for(var r of qt(t))Cn.call(t,r)&&Yt(e,r,t[r]);return e},Xt=(e,t)=>yn(e,vn(t));var Ke=(e,t)=>{for(var r in t)Fe(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Sn(t))!Gt.call(e,i)&&i!==r&&Fe(e,i,{get:()=>t[i],enumerable:!(o=bn(t,i))||o.enumerable});return e};var wn=e=>xn(Fe({},"__esModule",{value:!0}),e);var Sa={};Ke(Sa,{core:()=>qe,theme:()=>Xe,ui:()=>ct});var qe={};Ke(qe,{AttributeList:()=>fo,BooleanAttributes:()=>wt,CamelAttributes:()=>ho,ElementList:()=>po,ElementNode:()=>B,HtmlTags:()=>Ct,Notifier:()=>Ie,PrefixCSS:()=>de,RecordState:()=>Nn,State:()=>gt,SvgTags:()=>mo,VoidTags:()=>uo,batch:()=>qn,computed:()=>Un,effect:()=>Kn,effectScope:()=>Wn,hashString:()=>ke,merge:()=>R,r:()=>Dn,runBatched:()=>oo,toState:()=>f,untrack:()=>Yn});var kn=Object.defineProperty,Jt=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,Zt=(e,t,r)=>t in e?kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qt=(e,t)=>{for(var r in t||(t={}))En.call(t,r)&&Zt(e,r,t[r]);if(Jt)for(var r of Jt(t))_n.call(t,r)&&Zt(e,r,t[r]);return e},Tn=["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"],On=Tn.reduce((e,t)=>{let r=t.slice(2).toLowerCase();return e[r]=t,e},{}),Ct=["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"],Z=[],Pn=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},eo=100,Ue=0,ft=new Set;function oo(e){Ue++;try{return e()}finally{if(Ue--,Ue===0){let t=ft;ft=new Set;for(let r of t)r._scheduleFlush()}}}var Ie=class{constructor(){this._listeners={},this._pending=new Map,this._scheduled=!1,this._flushing=new Map,this._selfDepth=0}_dispose(){if(this._listeners)for(let e in this._listeners)this._listeners[e].clear();this._listeners=null}addListener(e,t){if(!this._listeners)return()=>{};if(typeof e!="string"||typeof t!="function")throw new Error("Event name must be a string, listener must be a function");this._listeners[e]||(this._listeners[e]=new Set);let r=()=>this.removeListener(e,t);return this._listeners[e].has(t)||(this._listeners[e].add(t),typeof t.onSubscribe=="function"&&t.onSubscribe(r)),r}removeListener(e,t){if(!this._listeners)return;let r=this._listeners[e];r&&r.has(t)&&(r.delete(t),r.size===0&&delete this._listeners[e])}listenerCount(e){var t,r,o;return(o=(r=(t=this._listeners)==null?void 0:t[e])==null?void 0:r.size)!=null?o:0}notify(e,...t){if(!this._listeners||!this._listeners[e])return;let r=Z.length?Z[Z.length-1]:null;if(r&&r[0]===this&&r[1]===e){let o=this._flushing.get(e);if(o&&o[0]===t[0])return;if(this._selfDepth>=eo){console.error(`[Domphy] Runaway self-update on "${e}" \u2014 stopped after ${eo} iterations`);return}this._selfDepth++,this._pending.set(e,{args:t,chain:[]})}else{if(this._isCircular(e))return;this._pending.set(e,{args:t,chain:[...Z]})}Ue>0?ft.add(this):this._scheduleFlush()}_scheduleFlush(){this._scheduled||(this._scheduled=!0,Pn(()=>this._flushAll()))}_isCircular(e){let t=Z.findIndex(([o,i])=>o===this&&i===e);if(t===-1)return!1;let r=[...Z.slice(t).map(([,o])=>o),e];return console.error(`[Domphy] Circular dependency detected:
2
+ ${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)Z=o,this._flush(t,r);Z=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){Z.push([this,e]),this._flushing.set(e,t);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),Z.pop()}}},no=class{constructor(e){this._releases=new Set;let t=(()=>e());t.onSubscribe=r=>{this._releases.add(r)},this.handler=t}reset(){for(let e of this._releases)e();this._releases.clear()}get dependencyCount(){return this._releases.size}},De=[],pt=0;function xt(){return pt>0?null:De.length?De[De.length-1]:null}function ro(e,t){De.push(e);try{return t()}finally{De.pop()}}function $n(e){pt++;try{return e()}finally{pt--}}var gt=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Ie,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=xt();t&&this.addListener(t.handler)}return this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function R(e={},t={}){let r=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=le(t));for(let n in t){let a=t[n];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof e[n]=="object"?e[n]=R(e[n],a):e[n]=a;else if(r.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join("")}}else e[n]=[e[n],a].filter(c=>c).join("");else if(o.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let m=typeof c=="function"?c(u):c,h=typeof a=="function"?a(u):a;return[m,h].filter(d=>d).join(" ")}}else e[n]=[e[n],a].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();In(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");Rn(e,c,a)}else e[n]=a}return e}function ke(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof gt||e!=null&&e._isState?e:new gt(e,t)}function Dn(e){return e}function Rn(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function In(e,t,r){let o=On[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,a)=>{i(n,a),r(n,a)}:e[o]=r}function le(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(le(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,n]of e)o.set(le(i,t),le(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(le(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=le(e[i],t);return o}function io(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o==0&&!Ct.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")e.$.forEach(a=>io(a,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function to(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function ao(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function lo(e){return Object.keys(e).find(t=>Ct.includes(t))}function so(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function zn(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function yt(e){let t=e.trim();return t.startsWith("@")?t.replace(/\s+/g,""):t.replace(/\s*([>+~,])\s*/g,"$1").replace(/\s+/g," ").replace(/\(\s*odd\s*\)/g,"(2n+1)").replace(/\(\s*even\s*\)/g,"(2n)").trim()}function Mn(e,t){for(let r=0;r<e.length;r++){let o=e[r],i=null;typeof o.selectorText=="string"?i=yt(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=yt(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function co(e){var t;let r=e.querySelector("#domphy-style");return r||(r=document.createElement("style"),r.id="domphy-style",e.appendChild(r)),r.dataset.domphyBase!=="true"&&((t=r.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),r.dataset.domphyBase="true"),r}var bt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>R(t,bt(r))),delete e.$,R(t,e),t}else return e},uo=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],mo=["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"],wt=["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"],de={transform:["webkit","ms"],transition:["webkit","ms"],animation:["webkit"],userSelect:["webkit","ms"],flexDirection:["webkit","ms"],flexWrap:["webkit","ms"],justifyContent:["webkit","ms"],alignItems:["webkit","ms"],alignSelf:["webkit","ms"],order:["webkit","ms"],flexGrow:["webkit","ms"],flexShrink:["webkit","ms"],flexBasis:["webkit","ms"],columns:["webkit"],columnCount:["webkit"],columnGap:["webkit"],columnRule:["webkit"],columnWidth:["webkit"],boxSizing:["webkit"],appearance:["webkit","moz"],filter:["webkit"],backdropFilter:["webkit"],clipPath:["webkit"],mask:["webkit"],maskImage:["webkit"],textSizeAdjust:["webkit","ms"],hyphens:["webkit","ms"],writingMode:["webkit","ms"],gridTemplateColumns:["ms"],gridTemplateRows:["ms"],gridAutoColumns:["ms"],gridAutoRows:["ms"],gridColumn:["ms"],gridRow:["ms"],marginInlineStart:["webkit"],marginInlineEnd:["webkit"],paddingInlineStart:["webkit"],paddingInlineEnd:["webkit"],minInlineSize:["webkit"],maxInlineSize:["webkit"],minBlockSize:["webkit"],maxBlockSize:["webkit"],inlineSize:["webkit"],blockSize:["webkit"],tabSize:["moz"],overscrollBehavior:["webkit","ms"],touchAction:["ms"],resize:["webkit"],printColorAdjust:["webkit"],backgroundClip:["webkit"],boxDecorationBreak:["webkit"],overflowScrolling:["webkit"]},ho=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Ln=class{constructor(e,t,r){this._notifier=new Ie,this._releases=[],this.parent=r,this.isBoolean=wt.includes(e),ho.includes(e)?this.name=e:this.name=so(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,r;let o=this.value;if(this._releases.length){for(let i of this._releases)i();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e(i):e(i),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,i.onSubscribe=n=>{this._releases.push(n),this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),i=null})},this.value=this.isBoolean?!!e(i):e(i)}else this.value=this.isBoolean?!!e:e;this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=r=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",r)},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${ao(String(r))}"`}}},fo=class{constructor(e){this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?this.items[e].set(t):this.items[e]=new Ln(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.prototype.hasOwnProperty.call(this.items,e):!1}remove(e){this.items&&(this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(e))}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this.items=null,this.parent=null}toggle(e,t){if(!wt.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){if(!e||typeof e!="string")return;let t=(o,i)=>{let n=(o||"").split(" ").filter(a=>a);return!n.includes(i)&&n.push(e),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(r=>r).filter(r=>r!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},Vn=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(to(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":to(this.text)?this.text:ao(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},po=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new B(e,this.owner,this._nextKey++):new Vn(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof B?e.domElement:e.domText;if(o){let i=r.childNodes[t]||null;o!==i&&r.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof B?e.domElement:e.domText,i=t instanceof B?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,a=i.nextSibling;r.insertBefore(o,a),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,a;let c=this.items.slice(),u=new Map;for(let p of c)p instanceof B&&p.key!==null&&p.key!==void 0&&u.set(p.key,p);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let m=new Set(c),h=new Set;for(let p=0;p<e.length;p++){let b=e[p],v=typeof b=="object"&&b!==null,x=v?b._key:void 0,C=v?lo(b):void 0;if(x!==void 0){let w=u.get(x);if(w instanceof B&&w.tagName===C){u.delete(x);let E=this.items.indexOf(w);if(E!==p&&E>=0){let O=!!w._portal;this.move(E,p,O?!1:t,!0)}w.parent=this.owner,w.patch(b),h.add(w);continue}}else if(v){let w=this.items[p];if(w instanceof B&&w.key==null&&w.tagName===C&&m.has(w)&&!h.has(w)){w.parent=this.owner,w.patch(b),h.add(w);continue}}h.add(this.insert(b,p,t,!0))}let d=this.items.slice(e.length);for(let p of d)this.remove(p,t,!0);u.forEach(p=>this.remove(p,t,!0)),r||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let a=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>a?a:t,u=this._createNode(e);if(this.items.splice(c,0,u),u instanceof B){u._hooks.Insert&&u._hooks.Insert(u);let m=this.owner.domElement;if(r&&m)if(u._portal){let h=u._portal(this.owner.getRoot());h&&u.render(h)}else{let h=u._createDOMNode(),d=(i=m.childNodes[c])!=null?i:null;m.insertBefore(h,d);let p=m.getRootNode(),b=p instanceof ShadowRoot?p:document.head,v=co(b);u.styles.render(v),u._hooks.Mount&&u._hooks.Mount(u),u.children.items.forEach(x=>{if(x instanceof B&&x._portal){let C=x._portal(x.getRoot());C&&x.render(C)}else x.render(h)})}}else{let m=this.owner.domElement;if(r&&m){let h=u._createDOMNode(),d=(n=m.childNodes[c])!=null?n:null;m.insertBefore(h,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),u}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof B){if(e._beforeRemoveFired)return;let i=()=>{let n=e.domElement,a=this.items.indexOf(e);a>=0&&this.items.splice(a,1),t&&n&&n.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,a=()=>{n||(n=!0,i())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,a),e._hooks.BeforeRemove.length<2&&!n&&a()}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!r&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let r=this.items.slice();for(let o of r)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),r&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},An=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=so(e),this.parentRule=r,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),de[this.name]&&de[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=a=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{a(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),de[this.name]&&de[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=`${this.cssName}: ${this.value}`;return de[this.name]&&de[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},he=class vt{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new go(this),this.parent=r}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof vt;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof vt;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new An(t,r,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},go=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof he;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={};function o(i,n){return i.startsWith("&")?`${n}${i.slice(1)}`:`${n} ${i}`}for(let i in e){let n=e[i],a=zn(i);for(let c of a){let u=o(c,t);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof n=="object"&&n!=null){let m=new he(c,this.parent);m.styleList.addCSS(n,t),this.items.push(m)}}else if(c.startsWith("@keyframes")){let m=new he(c,this.parent);m.styleList.addCSS(n,""),this.items.push(m)}else if(c.startsWith("@font-face")){let m=new he(c,this.parent);for(let h in n)m.insertStyle(h,n[h]);this.items.push(m)}else if(typeof n=="object"&&n!=null){let m=new he(u,this.parent);this.items.push(m);for(let[h,d]of Object.entries(n))if(typeof d=="object"&&d!=null){let p=o(h,u);h.startsWith("&")?this.addCSS(d,p):m.styleList.insertRule(p).styleList.addCSS(d,p)}else m.insertStyle(h,d)}else r[c]=n}}if(Object.keys(r).length){let i=new he(t,this.parent);for(let n in r)i.insertStyle(n,r[n]);this.items.push(i)}}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(r=>r.selectorText===e);return t||(t=new he(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let r=e.get(yt(t.selectorText));r&&t.mount(r)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==r(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},B=class xe{constructor(t,r=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new po(this),this.styles=new go(this),this.attributes=new fo(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,n;t=le(t),io(t),t.style=t.style||{},this.parent=r,this.tagName=lo(t),t=bt(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(m,h)=>typeof h=="function"?a:h);this.nodeId=ke(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let u=t[this.tagName];if(u!=null&&u!=null)if(typeof u=="function"){let m=()=>{if(this._disposed)return;let h=u(m);this.children.update(Array.isArray(h)?h:[h])};m.elementNode=this,m.debug=`class:${this.tagName}_${this.nodeId} children`,m.onSubscribe=h=>this.addHook("BeforeRemove",()=>{h(),m=null}),m&&m()}else this.children.update(Array.isArray(u)?u:[u]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=mo.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let r in this._events)this._bindEvent(r);return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let r=o=>{var i,n;return(n=(i=this._events)==null?void 0:i[t])==null?void 0:n.call(i,o,this)};this.domElement.addEventListener(t,r),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,r),r=null})}_dispose(){var t,r,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(r=(t=this._hooks).BeforeRemove)==null||r.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(n=>n.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(o=this._hooks).Remove)==null||i.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){R(this._context,t._context),R(this._metadata,t._metadata);let r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i=="_portal"?this._portal=n:i=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){let r=le(t);r.style=r.style||{},r=bt(r);let o=r[this.tagName];if(typeof o!="function"){let m=o==null?[]:Array.isArray(o)?o:[o];this.children.update(m,!!this.domElement,!0)}r._context&&R(this._context,r._context),r._metadata&&R(this._metadata,r._metadata);let i=`${this.tagName}_${this.nodeId}`,n=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],a=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"],c=new Set(["class"]),u=null;this._events={};for(let m of Object.keys(r)){if(n.includes(m)||a.includes(m)||m==="_portal")continue;let h=r[m];m.startsWith("on")&&typeof h=="function"?this.addEvent(m.substring(2).toLowerCase(),h):m==="class"&&typeof h=="string"?u=h:(this.attributes.set(m,h),c.add(m))}if(this.attributes.set("class",u?`${i} ${u}`:i),this.attributes.items)for(let m of Object.keys(this.attributes.items))c.has(m)||this.attributes.remove(m);if(this._events)for(let m in this._events)this._bindEvent(m)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];if(typeof o=="function"){let i=((...n)=>{o(...n),r(...n)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,r.length),configurable:!0})}catch(n){}this._hooks[t]=i}else this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof xe&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.prototype.hasOwnProperty.call(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof xe?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(uo.includes(this.tagName))return`<${this.tagName}${t}>`;let r=this.children.generateHTML();return`<${this.tagName}${t}>${r}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children&&this.children.items.forEach((o,i)=>{let n=t.childNodes[i];n&&(o instanceof xe?o.mount(n):o.domText=n)}),r){let o=r.sheet;o&&this._hydrateStyles(Mn(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var r;if((r=this.styles)==null||r.hydrate(t),this.children)for(let o of this.children.items)o instanceof xe&&o._hydrateStyles(t)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=co(n)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof xe&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(r)}),r}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var r;(r=this.domElement)==null||r.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let r=!1,o=()=>{r||(r=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!r&&o()}else t()}}},Nn=class{constructor(e){this._notifier=new Ie,this.initialRecord=Qt({},e),this._record=Qt({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let r=xt();r&&this._notifier.addListener(e,r.handler)}return this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e)}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}},Bn=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e).catch(t=>{setTimeout(()=>{throw t},0)})},we=new Set,St=!1;function yo(e){we.add(e),!St&&(St=!0,Bn(Hn))}function Hn(){for(St=!1;we.size>0;){let e=[...we];we.clear();for(let t of e)t()}}var Re=[];function jn(){return Re.length?Re[Re.length-1]:null}function kt(e){let t=jn();t&&t._add(e)}var Fn=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){Re.push(this);try{return e()}finally{Re.pop()}}stop(){if(!this._stopped){this._stopped=!0;for(let e of this._disposers)e();this._disposers.clear()}}};function Wn(){let e=new Fn;return kt(()=>e.stop()),e}function Kn(e){let t=!1,r=!1,o=()=>{t||n()},i=new no(()=>{t||yo(o)}),n=()=>{if(!(t||r)){r=!0,i.reset();try{ro(i,e)}finally{r=!1}}},a=()=>{t||(t=!0,i.reset(),we.delete(o))};return kt(a),n(),a}function Un(e){let t="computed",r=new Ie,o,i=!0,n=!1,a=()=>{i&&r.listenerCount(t)>0&&m()},c=new no(()=>{i||(i=!0,yo(a))}),u=()=>{c.reset(),o=ro(c,e),i=!1,n=!0},m=()=>{let d=o,p=n;u(),!(p&&o===d)&&r.notify(t,o)},h=d=>{if(d)r.addListener(t,d);else{let p=xt();p&&r.addListener(t,p.handler)}return i&&u(),o};return kt(()=>{c.reset(),we.delete(a),r._dispose()}),{_isState:!0,_notifier:r,get:h}}function qn(e){return oo(e)}function Yn(e){return $n(e)}var Xe={};Ke(Xe,{getTheme:()=>Q,setTheme:()=>Zn,themeApply:()=>er,themeCSS:()=>Et,themeColor:()=>l,themeColorToken:()=>$t,themeDensity:()=>y,themeName:()=>Ge,themeSize:()=>g,themeSpacing:()=>s,themeTokens:()=>Co,themeVars:()=>ze});var Gn={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},Me=Gn,Ot=e=>JSON.parse(JSON.stringify(e)),vo=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),Ee={light:Ot(Me),dark:Qn(Me)};function Pt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Xn(e){for(let t in e)if(!Object.keys(Me).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}}function So(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),So(e[o],t[o])):e[o]=t[o]}function Jn(e,t){let r={},o=Pt(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(u=>r[`--${c}-${u}`]=t.colors[c][u]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else if(n==="custom"&&a&&typeof a=="object")for(let c in a)r[`--custom-${vo(c)}`]=a[c]}let i="";for(let n in r)i+=` ${n}: ${r[n]};
3
3
  `;return`[data-theme="${e}"] {
4
- ${i}}`}function V(e){if(!ce[e])throw Error(`Theme "${e}" not found`);return ce[e]}function Go(e,t){Ko(t),ce[e]||(ce[e]=Qe(ge)),Mt(ce[e],t)}function Yo(e){let t=Qe(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function Nt(e){let t=V(e),r=et(t),o={};for(let i in t){let n=t[i];if(i==="colors")for(let l in t.colors){let c={};[...Array(r).keys()].forEach(m=>c[m]=t.colors[l][m]),o[l]=c}else if(i==="fontSizes")o.fontSizes=t.fontSizes;else if(i==="densities")o.densities=t.densities;else if(i==="custom"&&(o.custom={},n&&typeof n=="object"))for(let l in n)o.custom[l]=n[l]}return o}function pe(){let e=V("light"),t=et(e),r={};for(let o in e){let i=e[o];if(o==="colors")for(let n in e.colors){let l={};[...Array(t).keys()].forEach(c=>l[c]=`var(--${n}-${c})`),r[n]=l}else if(o==="fontSizes")r.fontSizes=[...Array(8).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(r.custom={},i&&typeof i=="object"))for(let n in i)r.custom[n]=`var(--custom-${Lt(n)})`}return r}function Xe(){return Object.entries(ce).map(([e,t])=>qo(e,t)).join(`
5
- `)}function Xo(e){var t;if(typeof document!="undefined")if(e){e.textContent=Xe();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Xe(),document.head.appendChild(e)}function s(e){return e/4+"em"}function Te(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var Je=["inherit"];[...Array(8).keys()].forEach(e=>{Je.push(`decrease-${e}`),Je.push(`increase-${e}`)});function Vt(e,t="inherit"){if(!Je.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function Jo(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Vt(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function g(e,t="inherit"){let r=Vt(Jo(e),t);return pe().fontSizes[r]}var Ze=["inherit"];[...Array(5).keys()].forEach(e=>{Ze.push(`decrease-${e}`),Ze.push(`increase-${e}`)});function Zo(e,t="inherit"){if(!Ze.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function Qo(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=Zo(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function p(e){let t=Qo(e);return V(e?Te(e):"light").densities[t]}var K=ge.colors.neutral.length,_e=["inherit","base"];[...Array(K).keys()].forEach(e=>{_e.push(`decrease-${e}`),_e.push(`increase-${e}`),_e.push(`shift-${e}`)});function zt(e,t){if(e<0||e>K-1)return e;let r=e+t;return r=Math.max(0,Math.min(K-1,r)),r}function en(e,t){if(e<0||e>K-1)return e;let r=Math.floor((K-1)/2),o=e<=r?e+t:e-t;return o=Math.max(0,Math.min(K-1,o)),o}function ye(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!_e.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return zt(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return zt(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return en(e,r)}else return e}function At(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=ye(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Dt(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===K-1?K-1-r:e}function a(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return t=="base"?pe()[o][V("light").baseTones[o]]:pe()[o][ye(0,t)];let i=Te(e),n;if(t=="base")n=V(i).baseTones[o];else{let c=V(i),m=Dt(At(e),c.direction,c.darkBias);n=ye(m,t)}let l=pe()[o];if(!l)throw Error(`color "${o}" not found on theme "${i}"`);return l[n]}function tt(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r,i=e?Te(e):"light",n=Nt(i);if(!e)return t=="base"?n[o][V("light").baseTones[o]]:n[o][ye(0,t)];let l;if(t=="base")l=V(i).baseTones[o];else{let c=V(i),m=Dt(At(e),c.direction,c.darkBias);l=ye(m,t)}return n[o][l]}var je={};we(je,{abbreviation:()=>tn,alert:()=>dn,avatar:()=>fn,badge:()=>pn,blockquote:()=>lr,breadcrumb:()=>gn,breadcrumbEllipsis:()=>yn,button:()=>ar,buttonSwitch:()=>Wr,card:()=>on,code:()=>cr,combobox:()=>ir,command:()=>an,commandItem:()=>cn,commandSearch:()=>sn,descriptionList:()=>ur,details:()=>mr,dialog:()=>hr,divider:()=>ei,drawer:()=>oi,emphasis:()=>dr,figure:()=>fr,formGroup:()=>pr,heading:()=>yr,horizontalRule:()=>br,icon:()=>Sr,image:()=>vr,inputCheckbox:()=>sr,inputColor:()=>xr,inputDateTime:()=>Cr,inputFile:()=>wr,inputNumber:()=>Tr,inputOTP:()=>hn,inputRadio:()=>Mr,inputRange:()=>_r,inputSearch:()=>Er,inputSwitch:()=>Hr,inputText:()=>kr,keyboard:()=>Or,label:()=>Pr,link:()=>$r,mark:()=>Rr,menu:()=>mi,menuItem:()=>ui,motion:()=>hi,orderedList:()=>Jr,pagination:()=>Qr,paragraph:()=>Ir,popover:()=>ni,popoverArrow:()=>ct,preformated:()=>zr,progress:()=>Lr,select:()=>Nr,selectBox:()=>jr,selectItem:()=>Br,selectList:()=>Dr,skeleton:()=>Vr,small:()=>Fr,spinner:()=>Ar,splitter:()=>nn,splitterHandle:()=>ln,splitterPanel:()=>rn,strong:()=>Ur,subscript:()=>Kr,superscript:()=>qr,tab:()=>si,tabPanel:()=>ci,table:()=>Gr,tabs:()=>ai,tag:()=>be,textarea:()=>Yr,toast:()=>ri,toggle:()=>mn,toggleGroup:()=>un,tooltip:()=>ii,transitionGroup:()=>li,unorderedList:()=>Xr});function tn(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>g(n),backgroundColor:n=>a(n),color:n=>a(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>a(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>a(n,"shift-11",r.get(n)),textDecorationColor:n=>a(n,"shift-9",r.get(n))}}}}function on(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(p(o)*2),backgroundColor:o=>a(o,"inherit",t.get(o)),color:o=>a(o,"shift-10",t.get(o)),outline:o=>`1px solid ${a(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(p(o)*4),color:o=>a(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(p(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(p(o)*4),color:o=>a(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),borderTop:o=>`1px solid ${a(o,"shift-3",t.get(o))}`}}}}function nn(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,l)=>{T(l,{_context:{splitter:{direction:t,size:f(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function rn(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function ln(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let l=r.parentElement,c=u=>{let h=l.getBoundingClientRect(),d=o?(u.clientX-h.left)/h.width*100:(u.clientY-h.top)/h.height*100;t.size.set(Math.min(Math.max(d,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>a(e,"shift-2"),"&:hover":{backgroundColor:e=>a(e,"shift-3")},"&::after":{content:'""',borderRadius:s(999),backgroundColor:e=>a(e,"shift-4")}}}}function an(){return{_onSchedule:(e,t)=>{T(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function sn(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let n=o.domElement,l=()=>i.query.set(n.value);n.addEventListener("input",l),o.addHook("Remove",()=>n.removeEventListener("input",l))},style:{fontFamily:"inherit",fontSize:o=>g(o,"inherit"),paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*2),border:"none",borderBottom:o=>`1px solid ${a(o,"shift-3",t)}`,outline:"none",color:o=>a(o,"shift-10",t),backgroundColor:o=>a(o,"inherit",t),"&::placeholder":{color:o=>a(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>a(o,"shift-6",r)}}}}function cn(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var m,u;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,l=(u=(m=n.textContent)==null?void 0:m.toLowerCase())!=null?u:"",c=i.query.addListener(h=>{n.hidden=h.length>0&&!l.includes(h.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>g(o,"inherit"),height:o=>s(6+p(o)*2),paddingInline:o=>s(p(o)*3),border:"none",outline:"none",color:o=>a(o,"shift-9",t),backgroundColor:o=>a(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>a(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${a(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}function mn(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var h,d;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let l=n.getContext("toggleGroup");if(!l){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let m=((d=(h=n.parent)==null?void 0:h.children.items)!=null?d:[]).filter(y=>y.type==="ElementNode"&&y.attributes.get("role")==="button"),u=n.key!==null&&n.key!==void 0?String(n.key):String(m.findIndex(y=>y===n));n.attributes.set("ariaPressed",y=>{let b=l.value.get(y);return Array.isArray(b)?b.includes(u):b===u}),n.addEvent("click",()=>{let y=l.value.get();if(l.multiple){let b=Array.isArray(y)?[...y]:[];l.value.set(b.includes(u)?b.filter(v=>v!==u):[...b,u])}else l.value.set(y===u?"":u)})},style:{cursor:"pointer",fontSize:n=>g(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>a(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>a(n,"shift-3",r.get(n)),color:n=>a(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function un(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>a(i,"inherit",r),outline:i=>`1px solid ${a(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function hn(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=l=>{let c=r(),m=l.target,u=c.indexOf(m);m.value&&u<c.length-1&&c[u+1].focus()},i=l=>{let c=r(),m=l.target,u=c.indexOf(m);l.key==="Backspace"&&!m.value&&u>0&&c[u-1].focus(),l.key==="ArrowLeft"&&u>0&&c[u-1].focus(),l.key==="ArrowRight"&&u<c.length-1&&c[u+1].focus()},n=l=>{var d,y,b;l.preventDefault();let c=(y=(d=l.clipboardData)==null?void 0:d.getData("text"))!=null?y:"",m=r(),u=m.indexOf(l.target);[...c].forEach((v,x)=>{m[u+x]&&(m[u+x].value=v)});let h=Math.min(u+c.length-1,m.length-1);(b=m[h])==null||b.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function dn(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${a(o,"shift-8",t.get(o))}`,backgroundColor:o=>a(o,"inherit",t.get(o)),color:o=>a(o,"shift-10",t.get(o)),fontSize:o=>g(o,"inherit")}}}function fn(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>g(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>a(o,"inherit",t.get(o)),color:o=>a(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function pn(e={}){var i;let{label:t=999}=e,r=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>g(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>a(n,"shift-9",o.get(n)),color:n=>a(n,"shift-0",o.get(n))}}}}function gn(e={}){var o;let{separator:t="/"}=e,r=f((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>g(i,"inherit"),gap:s(1),color:i=>a(i,"shift-9",r.get(i)),backgroundColor:i=>a(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>a(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>a(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>a(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function yn(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>g(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>a(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${a(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}var bn='<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 be(e={}){var o;let{removable:t=!1}=e,r=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:bn,onClick:l=>{l.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:l=>a(l,"shift-4",r.get(l))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>a(i,"inherit",r.get(i)),color:i=>a(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${a(i,"shift-4",r.get(i))}`}}}var vn=Object.defineProperty,Sn=Object.defineProperties,xn=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,Bt=(e,t,r)=>t in e?vn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,I=(e,t)=>{for(var r in t||(t={}))Xt.call(t,r)&&Bt(e,r,t[r]);if($e)for(var r of $e(t))Jt.call(t,r)&&Bt(e,r,t[r]);return e},te=(e,t)=>Sn(e,xn(t)),Zt=(e,t)=>{var r={};for(var o in e)Xt.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&$e)for(var o of $e(e))t.indexOf(o)<0&&Jt.call(e,o)&&(r[o]=e[o]);return r},re=(e,t,r)=>new Promise((o,i)=>{var n=m=>{try{c(r.next(m))}catch(u){i(u)}},l=m=>{try{c(r.throw(m))}catch(u){i(u)}},c=m=>m.done?o(m.value):Promise.resolve(m.value).then(n,l);c((r=r.apply(e,t)).next())}),Cn=["top","right","bottom","left"],jt=["start","end"],bl=Cn.reduce((e,t)=>e.concat(t,`${t}-${jt[0]}`,`${t}-${jt[1]}`),[]),Re=Math.min,ee=Math.max,Ie=Math.round,Pe=Math.floor,A=e=>({x:e,y:e}),wn={left:"right",right:"left",bottom:"top",top:"bottom"};function Ht(e,t,r){return ee(e,Re(t,r))}function Me(e,t){return typeof e=="function"?e(t):e}function oe(e){return e.split("-")[0]}function Ne(e){return e.split("-")[1]}function Qt(e){return e==="x"?"y":"x"}function eo(e){return e==="y"?"height":"width"}function q(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function to(e){return Qt(q(e))}function En(e,t,r=!1){let o=Ne(e),i=to(e),n=eo(i),l=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(l=ze(l)),[l,ze(l)]}function kn(e){let t=ze(e);return[rt(e),t,rt(t)]}function rt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Wt=["left","right"],Ft=["right","left"],_n=["top","bottom"],Tn=["bottom","top"];function On(e,t,r){switch(e){case"top":case"bottom":return r?t?Ft:Wt:t?Wt:Ft;case"left":case"right":return t?_n:Tn;default:return[]}}function Pn(e,t,r,o){let i=Ne(e),n=On(oe(e),r==="start",o);return i&&(n=n.map(l=>`${l}-${i}`),t&&(n=n.concat(n.map(rt)))),n}function ze(e){let t=oe(e);return wn[t]+e.slice(t.length)}function $n(e){return I({top:0,right:0,bottom:0,left:0},e)}function Rn(e){return typeof e!="number"?$n(e):{top:e,right:e,bottom:e,left:e}}function Le(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Ut({reference:e,floating:t},r,o){let i=q(r),n=to(r),l=eo(n),c=oe(r),m=i==="y",u=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,d=e[l]/2-t[l]/2,y;switch(c){case"top":y={x:u,y:e.y-t.height};break;case"bottom":y={x:u,y:e.y+e.height};break;case"right":y={x:e.x+e.width,y:h};break;case"left":y={x:e.x-t.width,y:h};break;default:y={x:e.x,y:e.y}}switch(Ne(r)){case"start":y[n]-=d*(o&&m?-1:1);break;case"end":y[n]+=d*(o&&m?-1:1);break;default:}return y}function In(e){return re(this,arguments,function*(t,r={}){var o,i,n,l,c,m;let{x:u,y:h,platform:d,rects:y,elements:b,strategy:v}=t,{boundary:x="clippingAncestors",rootBoundary:S="viewport",elementContext:C="floating",altBoundary:w=!1,padding:k=0}=Me(r,t),E=Rn(k),_=b[w?C==="floating"?"reference":"floating":C],P=Le(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,_))==null||i?_:_.contextElement||(yield(n=d.getDocumentElement)==null?void 0:n.call(d,b.floating)),boundary:x,rootBoundary:S,strategy:v})),O=C==="floating"?{x:u,y:h,width:y.floating.width,height:y.floating.height}:y.reference,ie=yield(l=d.getOffsetParent)==null?void 0:l.call(d,b.floating),M=(yield(c=d.isElement)==null?void 0:c.call(d,ie))?(yield(m=d.getScale)==null?void 0:m.call(d,ie))||{x:1,y:1}:{x:1,y:1},B=Le(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:b,rect:O,offsetParent:ie,strategy:v}):O);return{top:(P.top-B.top+E.top)/M.y,bottom:(B.bottom-P.bottom+E.bottom)/M.y,left:(P.left-B.left+E.left)/M.x,right:(B.right-P.right+E.right)/M.x}})}var zn=50,Ln=(e,t,r)=>re(null,null,function*(){var o;let{placement:i="bottom",strategy:n="absolute",middleware:l=[],platform:c}=r,m=c.detectOverflow?c:te(I({},c),{detectOverflow:In}),u=yield(o=c.isRTL)==null?void 0:o.call(c,t),h=yield c.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y}=Ut(h,i,u),b=i,v=0,x={};for(let S=0;S<l.length;S++){let C=l[S];if(!C)continue;let{name:w,fn:k}=C,{x:E,y:_,data:P,reset:O}=yield k({x:d,y,initialPlacement:i,placement:b,strategy:n,middlewareData:x,rects:h,platform:m,elements:{reference:e,floating:t}});d=E!=null?E:d,y=_!=null?_:y,x[w]=I(I({},x[w]),P),O&&v<zn&&(v++,typeof O=="object"&&(O.placement&&(b=O.placement),O.rects&&(h=O.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:n}):O.rects),{x:d,y}=Ut(h,b,u)),S=-1)}return{x:d,y,placement:b,strategy:n,middlewareData:x}});var Mn=(e={})=>({name:"flip",options:e,fn(t){return re(this,null,function*(){var r,o,i,n,l,c;let{placement:m,middlewareData:u,rects:h,initialPlacement:d,platform:y,elements:b}=t,v=Me(e,t),{mainAxis:x=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:E=!0}=v,_=Zt(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=u.arrow)!=null&&r.alignmentOffset)return{};let P=oe(m),O=q(d),ie=oe(d)===d,M=yield(o=y.isRTL)==null?void 0:o.call(y,b.floating),B=C||(ie||!E?[ze(d)]:kn(d)),ut=k!=="none";!C&&ut&&B.push(...Pn(d,E,k,M));let xo=[d,...B],He=yield y.detectOverflow(t,_),xe=[],le=((i=u.flip)==null?void 0:i.overflows)||[];if(x&&xe.push(He[P]),S){let X=En(m,h,M);xe.push(He[X[0]],He[X[1]])}if(le=[...le,{placement:m,overflows:xe}],!xe.every(X=>X<=0)){let X=(((n=u.flip)==null?void 0:n.index)||0)+1,We=xo[X];if(We&&(!(S==="alignment"&&O!==q(We))||le.every(j=>q(j.placement)===O?j.overflows[0]>0:!0)))return{data:{index:X,overflows:le},reset:{placement:We}};let fe=(l=le.filter(j=>j.overflows[0]<=0).sort((j,W)=>j.overflows[1]-W.overflows[1])[0])==null?void 0:l.placement;if(!fe)switch(w){case"bestFit":{let j=(c=le.filter(W=>{if(ut){let F=q(W.placement);return F===O||F==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(F=>F>0).reduce((F,Co)=>F+Co,0)]).sort((W,F)=>W[1]-F[1])[0])==null?void 0:c[0];j&&(fe=j);break}case"initialPlacement":fe=d;break;default:}if(m!==fe)return{reset:{placement:fe}}}return{}})}});var Nn=new Set(["left","top"]);function Vn(e,t){return re(this,null,function*(){var r;let{placement:o,platform:i,elements:n}=e,l=yield(r=i.isRTL)==null?void 0:r.call(i,n.floating),c=oe(o),m=Ne(o),u=q(o)==="y",h=Nn.has(c)?-1:1,d=l&&u?-1:1,y=Me(t,e),{mainAxis:b,crossAxis:v,alignmentAxis:x}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return m&&typeof x=="number"&&(v=m==="end"?x*-1:x),u?{x:v*d,y:b*h}:{x:b*h,y:v*d}})}var An=(e=0)=>({name:"offset",options:e,fn(t){return re(this,null,function*(){var r,o;let{x:i,y:n,placement:l,middlewareData:c}=t,m=yield Vn(t,e);return l===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+m.x,y:n+m.y,data:te(I({},m),{placement:l})}})}}),Dn=(e={})=>({name:"shift",options:e,fn(t){return re(this,null,function*(){let{x:r,y:o,placement:i,platform:n}=t,l=Me(e,t),{mainAxis:c=!0,crossAxis:m=!1,limiter:u={fn:({x:w,y:k})=>({x:w,y:k})}}=l,h=Zt(l,["mainAxis","crossAxis","limiter"]),d={x:r,y:o},y=yield n.detectOverflow(t,h),b=q(oe(i)),v=Qt(b),x=d[v],S=d[b];if(c){let w=v==="y"?"top":"left",k=v==="y"?"bottom":"right",E=x+y[w],_=x-y[k];x=Ht(E,x,_)}if(m){let w=b==="y"?"top":"left",k=b==="y"?"bottom":"right",E=S+y[w],_=S-y[k];S=Ht(E,S,_)}let C=u.fn(te(I({},t),{[v]:x,[b]:S}));return te(I({},C),{data:{x:C.x-r,y:C.y-o,enabled:{[v]:c,[b]:m}}})})}});function Ve(){return typeof window!="undefined"}function he(e){return oo(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function D(e){var t;return(t=(oo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oo(e){return Ve()?e instanceof Node||e instanceof R(e).Node:!1}function z(e){return Ve()?e instanceof Element||e instanceof R(e).Element:!1}function H(e){return Ve()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function Kt(e){return!Ve()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function Se(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=L(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function Bn(e){return/^(table|td|th)$/.test(he(e))}function Ae(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var jn=/transform|translate|scale|rotate|perspective|filter/,Hn=/paint|layout|strict|content/,Q=e=>!!e&&e!=="none",ot;function lt(e){let t=z(e)?L(e):e;return Q(t.transform)||Q(t.translate)||Q(t.scale)||Q(t.rotate)||Q(t.perspective)||!at()&&(Q(t.backdropFilter)||Q(t.filter))||jn.test(t.willChange||"")||Hn.test(t.contain||"")}function Wn(e){let t=G(e);for(;H(t)&&!ue(t);){if(lt(t))return t;if(Ae(t))return null;t=G(t)}return null}function at(){return ot==null&&(ot=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ot}function ue(e){return/^(html|body|#document)$/.test(he(e))}function L(e){return R(e).getComputedStyle(e)}function De(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if(he(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Kt(e)&&e.host||D(e);return Kt(t)?t.host:t}function no(e){let t=G(e);return ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&Se(t)?t:no(t)}function ve(e,t=[],r=!0){var o;let i=no(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),l=R(i);if(n){let c=it(l);return t.concat(l,l.visualViewport||[],Se(i)?i:[],c&&r?ve(c):[])}else return t.concat(i,ve(i,[],r))}function it(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ro(e){let t=L(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=H(e),n=i?e.offsetWidth:r,l=i?e.offsetHeight:o,c=Ie(r)!==n||Ie(o)!==l;return c&&(r=n,o=l),{width:r,height:o,$:c}}function st(e){return z(e)?e:e.contextElement}function me(e){let t=st(e);if(!H(t))return A(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=ro(t),l=(n?Ie(r.width):r.width)/o,c=(n?Ie(r.height):r.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}var Fn=A(0);function io(e){let t=R(e);return!at()||!t.visualViewport?Fn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Un(e,t=!1,r){return!r||t&&r!==R(e)?!1:t}function ne(e,t=!1,r=!1,o){let i=e.getBoundingClientRect(),n=st(e),l=A(1);t&&(o?z(o)&&(l=me(o)):l=me(e));let c=Un(n,r,o)?io(n):A(0),m=(i.left+c.x)/l.x,u=(i.top+c.y)/l.y,h=i.width/l.x,d=i.height/l.y;if(n){let y=R(n),b=o&&z(o)?R(o):o,v=y,x=it(v);for(;x&&o&&b!==v;){let S=me(x),C=x.getBoundingClientRect(),w=L(x),k=C.left+(x.clientLeft+parseFloat(w.paddingLeft))*S.x,E=C.top+(x.clientTop+parseFloat(w.paddingTop))*S.y;m*=S.x,u*=S.y,h*=S.x,d*=S.y,m+=k,u+=E,v=R(x),x=it(v)}}return Le({width:h,height:d,x:m,y:u})}function Be(e,t){let r=De(e).scrollLeft;return t?t.left+r:ne(D(e)).left+r}function lo(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Be(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function Kn({elements:e,rect:t,offsetParent:r,strategy:o}){let i=o==="fixed",n=D(r),l=e?Ae(e.floating):!1;if(r===n||l&&i)return t;let c={scrollLeft:0,scrollTop:0},m=A(1),u=A(0),h=H(r);if((h||!h&&!i)&&((he(r)!=="body"||Se(n))&&(c=De(r)),h)){let y=ne(r);m=me(r),u.x=y.x+r.clientLeft,u.y=y.y+r.clientTop}let d=n&&!h&&!i?lo(n,c):A(0);return{width:t.width*m.x,height:t.height*m.y,x:t.x*m.x-c.scrollLeft*m.x+u.x+d.x,y:t.y*m.y-c.scrollTop*m.y+u.y+d.y}}function qn(e){return Array.from(e.getClientRects())}function Gn(e){let t=D(e),r=De(e),o=e.ownerDocument.body,i=ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),l=-r.scrollLeft+Be(e),c=-r.scrollTop;return L(o).direction==="rtl"&&(l+=ee(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:l,y:c}}var qt=25;function Yn(e,t){let r=R(e),o=D(e),i=r.visualViewport,n=o.clientWidth,l=o.clientHeight,c=0,m=0;if(i){n=i.width,l=i.height;let h=at();(!h||h&&t==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let u=Be(o);if(u<=0){let h=o.ownerDocument,d=h.body,y=getComputedStyle(d),b=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=qt&&(n-=v)}else u<=qt&&(n+=u);return{width:n,height:l,x:c,y:m}}function Xn(e,t){let r=ne(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=H(e)?me(e):A(1),l=e.clientWidth*n.x,c=e.clientHeight*n.y,m=i*n.x,u=o*n.y;return{width:l,height:c,x:m,y:u}}function Gt(e,t,r){let o;if(t==="viewport")o=Yn(e,r);else if(t==="document")o=Gn(D(e));else if(z(t))o=Xn(t,r);else{let i=io(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Le(o)}function ao(e,t){let r=G(e);return r===t||!z(r)||ue(r)?!1:L(r).position==="fixed"||ao(r,t)}function Jn(e,t){let r=t.get(e);if(r)return r;let o=ve(e,[],!1).filter(c=>z(c)&&he(c)!=="body"),i=null,n=L(e).position==="fixed",l=n?G(e):e;for(;z(l)&&!ue(l);){let c=L(l),m=lt(l);!m&&c.position==="fixed"&&(i=null),(n?!m&&!i:!m&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Se(l)&&!m&&ao(e,l))?o=o.filter(u=>u!==l):i=c,l=G(l)}return t.set(e,o),o}function Zn({element:e,boundary:t,rootBoundary:r,strategy:o}){let i=[...t==="clippingAncestors"?Ae(e)?[]:Jn(e,this._c):[].concat(t),r],n=Gt(e,i[0],o),l=n.top,c=n.right,m=n.bottom,u=n.left;for(let h=1;h<i.length;h++){let d=Gt(e,i[h],o);l=ee(d.top,l),c=Re(d.right,c),m=Re(d.bottom,m),u=ee(d.left,u)}return{width:c-u,height:m-l,x:u,y:l}}function Qn(e){let{width:t,height:r}=ro(e);return{width:t,height:r}}function er(e,t,r){let o=H(t),i=D(t),n=r==="fixed",l=ne(e,!0,n,t),c={scrollLeft:0,scrollTop:0},m=A(0);function u(){m.x=Be(i)}if(o||!o&&!n)if((he(t)!=="body"||Se(i))&&(c=De(t)),o){let b=ne(t,!0,n,t);m.x=b.x+t.clientLeft,m.y=b.y+t.clientTop}else i&&u();n&&!o&&i&&u();let h=i&&!o&&!n?lo(i,c):A(0),d=l.left+c.scrollLeft-m.x-h.x,y=l.top+c.scrollTop-m.y-h.y;return{x:d,y,width:l.width,height:l.height}}function nt(e){return L(e).position==="static"}function Yt(e,t){if(!H(e)||L(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return D(e)===r&&(r=r.ownerDocument.body),r}function so(e,t){let r=R(e);if(Ae(e))return r;if(!H(e)){let i=G(e);for(;i&&!ue(i);){if(z(i)&&!nt(i))return i;i=G(i)}return r}let o=Yt(e,t);for(;o&&Bn(o)&&nt(o);)o=Yt(o,t);return o&&ue(o)&&nt(o)&&!lt(o)?r:o||Wn(e)||r}var tr=function(e){return re(this,null,function*(){let t=this.getOffsetParent||so,r=this.getDimensions,o=yield r(e.floating);return{reference:er(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function or(e){return L(e).direction==="rtl"}var nr={convertOffsetParentRelativeRectToViewportRelativeRect:Kn,getDocumentElement:D,getClippingRect:Zn,getOffsetParent:so,getElementRects:tr,getClientRects:qn,getDimensions:Qn,getScale:me,isElement:z,isRTL:or};function co(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rr(e,t){let r=null,o,i=D(e);function n(){clearTimeout(o),r==null||r.disconnect(),r=null}function l(c=!1,m=1){n();let u=e.getBoundingClientRect(),{left:h,top:d,width:y,height:b}=u;if(c||t(),!y||!b)return;let v=Pe(d),x=Pe(i.clientWidth-(h+y)),S=Pe(i.clientHeight-(d+b)),C=Pe(h),w={rootMargin:`${-v}px ${-x}px ${-S}px ${-C}px`,threshold:ee(0,Re(1,m))||1},k=!0;function E(_){let P=_[0].intersectionRatio;if(P!==m){if(!k)return l();P?l(!1,P):o=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!co(u,e.getBoundingClientRect())&&l(),k=!1}try{r=new IntersectionObserver(E,te(I({},w),{root:i.ownerDocument}))}catch(_){r=new IntersectionObserver(E,w)}r.observe(e)}return l(!0),n}function mo(e,t,r,o={}){let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=st(e),h=i||n?[...u?ve(u):[],...t?ve(t):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),n&&C.addEventListener("resize",r)});let d=u&&c?rr(u,r):null,y=-1,b=null;l&&(b=new ResizeObserver(([C])=>{C&&C.target===u&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{b==null||b.observe(t)})),r()}),u&&!m&&b.observe(u),t&&b.observe(t));let v,x=m?ne(e):null;m&&S();function S(){let C=ne(e);x&&!co(x,C)&&r(),x=C,v=requestAnimationFrame(S)}return r(),()=>{h.forEach(C=>{i&&C.removeEventListener("scroll",r),n&&C.removeEventListener("resize",r)}),d==null||d(),b==null||b.disconnect(),b=null,m&&cancelAnimationFrame(v)}}var uo=An;var ho=Dn,fo=Mn;var po=(e,t,r)=>{let o=new Map,i=I({platform:nr},r),n=te(I({},i.platform),{_c:o});return Ln(e,t,te(I({},i),{platform:n}))};function Y(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,l=null,c=null,m=null,u=!1,h=f(t),d=()=>{u||!m||(u=!0,c=m.children.insert(e.content))},y=()=>{d(),n&&l&&(i&&i(),i=mo(n,l,()=>{po(n,l,{placement:r.get(),middleware:[uo(12),fo(),ho()],strategy:"fixed"}).then(({x:w,y:k,placement:E})=>{Object.assign(l.style,{left:`${w}px`,top:`${k}px`}),r.set(E)})}),h.set(!0))},b=()=>{i&&i(),i=null,h.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(y,100)},x=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},S={style:{position:"fixed",pointerEvents:"auto",visibility:w=>h.get(w)?"visible":"hidden"},_onMount:w=>l=w.domElement,_portal:w=>{let k=w.domElement.querySelector("#domphy-floating");if(!k){let E={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};k=w.children.insert(E).domElement}return k}};return T(e.content,S),{show:v,hide:x,anchorPartial:{onKeyDown:w=>w.key==="Escape"&&x(),_onMount:w=>{m=w.getRoot(),n=w.domElement;let k=E=>{if(!h.get()||!n||!l)return;let _=E.target;!n.contains(_)&&!l.contains(_)&&x()};w.getRoot().domElement.addEventListener("click",k),w.addHook("BeforeRemove",()=>{o&&clearTimeout(o),i&&(i(),i=null),c&&c.remove(),w.getRoot().domElement.removeEventListener("click",k)})}}}}function ir(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,l=f(e.value),c=f(i),{show:m,hide:u,anchorPartial:h}=Y({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&u()};T(e.content,d);let y={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:S=>g(S,"inherit"),color:S=>a(S,"shift-9",o),backgroundColor:S=>a(S,"inherit",o)},b;e.input?(T(e.input,{onFocus:()=>m(),style:y,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>m(),value:S=>(l.get(S),""),style:y,_key:"combobox-input"};let v={div:S=>{let C=l.get(S),w=Array.isArray(C)?C:[C],E=t.filter(_=>w.includes(_.value)).map(_=>({span:_.label,$:[be({color:o,removable:!0})],_key:_.value,_onRemove:P=>{let O=l.get(),M=(Array.isArray(O)?O:[O]).filter(B=>B!==_.value);n?l.set(M):l.set(M[0])}}));return E.push(b),E},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},x={_onInsert:S=>{S.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:S=>`1px solid ${a(S,"shift-4","neutral")}`,paddingBlock:S=>s(p(S)*1),paddingInline:S=>s(p(S)*1),borderRadius:S=>s(p(S)*1),fontSize:S=>g(S,"inherit"),color:S=>a(S,"shift-9",o),backgroundColor:S=>a(S,"inherit",o)}};return T(h,x),h}function ct(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=f(t),l={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=h=>{var d;return(d=l[n.get(h)])!=null?d:l["bottom-end"]},m=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",u=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>g(h),backgroundColor:h=>a(h),color:h=>a(h,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:h=>a(h,"inherit",r),borderWidth:i?"1px":"0px",borderColor:h=>a(h,"inherit",r),borderTopStyle:h=>{let d=c(h);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:h=>{let d=c(h);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:h=>{let d=c(h);return d.includes("top")?0:d.includes("bottom")?"auto":m(d)},right:h=>{let d=c(h);return d.includes("right")?0:d.includes("left")?"auto":u(d)},bottom:h=>{let d=c(h);return d.includes("bottom")?0:d.includes("top")?"auto":u(d)},left:h=>{let d=c(h);return d.includes("left")?0:d.includes("right")?"auto":m(d)},transform:h=>{let d=c(h),y=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${y},${b}) rotate(45deg)`}}}}}function lr(e={}){var r;let t=f((r=e.color)!=null?r:"inherit","color");return{_onInsert:o=>{o.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>a(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${a(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),margin:0}}}function ar(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>g(o,"inherit"),paddingBlock:o=>s(p(o)*1),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(p(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${a(o,"shift-4",t.get(o))}`,color:o=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${a(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>a(o,"shift-2","neutral"),outline:o=>`1px solid ${a(o,"shift-4","neutral")}`,color:o=>a(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function sr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>g(n,"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:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>a(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${a(n,"shift-6",r.get(n))}`,backgroundColor:n=>a(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>a(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${a(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${a(n,"shift-6",r.get(n))}`,backgroundColor:n=>a(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>a(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>a(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>a(n,"shift-4","neutral"),pointerEvents:"none"}}}}function cr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}function mr(e={}){var i,n;let{duration:t=240}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:l=>{l.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:l=>g(l,"inherit"),color:l=>a(l,"shift-9",r.get(l)),backgroundColor:l=>a(l,"inherit",r.get(l)),overflow:"hidden","& > summary":{backgroundColor:l=>a(l,"shift-2",r.get(l)),color:l=>a(l,"shift-10",r.get(l)),fontSize:l=>g(l,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:l=>s(p(l)*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:l=>`${s(.5)} solid ${a(l,"shift-9",r.get(l))}`,borderBottom:l=>`${s(.5)} solid ${a(l,"shift-9",r.get(l))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:l=>a(l,"shift-3",r.get(l))},"& > summary:focus-visible":{borderRadius:l=>s(p(l)*2),outlineOffset:`-${s(.5)}`,outline:l=>`${s(.5)} solid ${a(l,"shift-6",o.get(l))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:l=>s(p(l)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:l=>s(p(l)*1),paddingBottom:l=>s(p(l)*3)}}}}function ur(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o))}}}}function hr(e={}){let{color:t="neutral",open:r=!1}=e,o=f(r);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let l=n.domElement.getBoundingClientRect();i.clientX>=l.left&&i.clientX<=l.right&&i.clientY>=l.top&&i.clientY<=l.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let l=n.domElement;l.style.opacity==="0"&&(l.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,l=m=>{m?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let u=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');u==null||u.focus()})):n.style.opacity="0"};l(o.get());let c=o.addListener(l);i.addHook("Remove",()=>{c(),document.body.style.overflow=""})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>g(i,"inherit"),color:i=>a(i,"shift-10",t),backgroundColor:i=>a(i,"inherit",t),border:"none",padding:i=>s(p(i)*3),boxShadow:i=>`0 ${s(9)} ${s(16)} ${a(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>a(i,"shift-2","neutral"),opacity:.75}}}}function dr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>g(o,"inherit"),fontStyle:"italic",color:o=>a(o,"shift-10",t.get(o))}}}function fr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>a(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>g(o,"decrease-1"),color:o=>a(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function pr(e={}){var i;let{layout:t="horizontal"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*3),border:"none",borderRadius:n=>s(p(n)*2),fontSize:n=>g(n,"inherit"),backgroundColor:n=>a(n,"inherit",r.get(n)),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:n=>g(n,"inherit"),fontWeight:600,paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*2),color:n=>a(n,"shift-9",r.get(n)),backgroundColor:n=>a(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(p(n)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${s(2)} * -1)`,fontSize:n=>g(n,"decrease-1"),color:n=>a(n,"shift-9",r.get(n))}}}}var gr={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function yr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>a(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=gr[o.elementNode.tagName]||"inherit";return g(o,i)}}}}function br(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:o=>a(o,"shift-4",t.get(o))}}}function vr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:s(2),backgroundColor:o=>a(o,"inherit",t.get(o))}}}function Sr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:s(4),height:s(4),flexShrink:"0",fontSize:o=>g(o),backgroundColor:"transparent",color:o=>a(o,"shift-9",t.get(o))}}}function xr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),l.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>g(n,"inherit"),paddingBlock:n=>s(p(n)*1),paddingInline:n=>s(p(n)*1),blockSize:n=>s(6+p(n)*2),inlineSize:n=>s(6+p(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>s(p(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`}}}}function Cr(e={}){var i,n;let{mode:t="datetime-local"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onSchedule:(l,c)=>{l.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:l=>g(l,"inherit"),lineHeight:"inherit",color:l=>a(l,"shift-9",r.get(l)),backgroundColor:l=>a(l,"inherit",r.get(l)),border:"none",outlineOffset:"-1px",outline:l=>`1px solid ${a(l,"shift-4",r.get(l))}`,borderRadius:l=>s(p(l)*1),paddingInline:l=>s(p(l)*3),height:l=>s(6+p(l)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:l=>`${s(.5)} solid ${a(l,"shift-6",o.get(l))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>a(l,"shift-8","neutral"),backgroundColor:l=>a(l,"shift-2","neutral"),outline:l=>`1px solid ${a(l,"shift-4","neutral")}`},"&:invalid":{outline:l=>`${s(.5)} solid ${a(l,"shift-6","error")}`}}}}function wr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),l.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,borderRadius:n=>s(p(n)*1),height:n=>s(6+p(n)*2),paddingInline:n=>s(p(n)*1),"&::-webkit-file-upload-button":{marginTop:n=>s(p(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>a(n,"shift-11",t.get(n)),backgroundColor:n=>a(n,"shift-1",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`,backgroundColor:n=>a(n,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>a(n,"shift-8","neutral"),backgroundColor:n=>a(n,"shift-3","neutral")}}}}function Er(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),l.type="search"},style:{fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,borderRadius:n=>s(p(n)*1),minWidth:s(32),paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*1),"&::placeholder":{color:n=>a(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral"),backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`}}}}function kr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),l.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),"&::placeholder":{color:n=>a(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>a(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`,color:n=>a(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${a(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${a(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${a(n,"shift-6","warning")}`}}}}function _r(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>a(n,"shift-3",t.get(n))},"&::-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:n=>a(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>a(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Tr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,l)=>{n.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),l.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(p(n)*3),paddingInlineEnd:n=>s(p(n)*1.5),paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),backgroundColor:n=>a(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>a(n,"shift-2","neutral"),outline:n=>`1px solid ${a(n,"shift-4","neutral")}`,color:n=>a(n,"shift-8","neutral")}}}}function Or(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${a(o,"shift-4",t.get(o))}`}}}function Pr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>g(n,"inherit"),color:n=>a(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>a(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral")}}}}function $r(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>g(n,"inherit"),backgroundColor:n=>a(n),color:n=>a(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>a(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>a(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>a(n,"shift-8","neutral")}}}}function Rr(e={}){var r;let t=f((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function Ir(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function zr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o)),backgroundColor:o=>a(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*2)}}}function Lr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.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:n=>a(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>a(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>a(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}function Mr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>g(n,"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:n=>`1px solid ${a(n,"shift-4",t.get(n))}`,color:n=>a(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>a(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${a(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>a(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>a(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${a(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>a(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Nr(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>g(o,"inherit"),lineHeight:"inherit",color:o=>a(o,"shift-9",t),backgroundColor:o=>a(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${a(o,"shift-4",t)}`,borderRadius:o=>s(p(o)*1),paddingBlock:o=>s(p(o)*1),paddingLeft:o=>s(p(o)*3),paddingRight:o=>s(p(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${tt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${s(2)} center`,backgroundSize:`${s(2.5)} ${s(1.5)}`,"&:not([multiple])":{height:o=>s(6+p(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${a(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${a(o,"shift-6",r)}`},"& optgroup":{color:o=>a(o,"shift-11",t)},"& option[disabled]":{color:o=>a(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>a(o,"shift-8","neutral"),outline:o=>`1px solid ${a(o,"shift-4","neutral")}`,backgroundColor:o=>a(o,"shift-2","neutral")}}}}function Vr(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=se(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>g(n),color:n=>a(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>a(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}var yo={to:{transform:"rotate(360deg)"}},go=se(JSON.stringify(yo));function Ar(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>g(o),backgroundColor:o=>a(o),color:o=>a(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${a(o,"shift-4",t.get(o))}`,borderTopColor:o=>a(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${go} 0.7s linear infinite`,[`@keyframes ${go}`]:yo}}}function Dr(e={}){var l;let{color:t="neutral",multiple:r=!1}=e,o=f((l=e.value)!=null?l:r?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(h=>({input:null,name:e.name,value:h||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_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(p(c)*2),paddingInline:c=>s(p(c)*2),fontSize:c=>g(c,"inherit"),backgroundColor:c=>a(c,"inherit",t)}}}function Br(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let l=n.getContext("select");if(l){let c=l.value;n.attributes.set("ariaSelected",m=>{let u=c.get(m);return l.multiple?u.includes(o):u==o}),n.addEvent("click",()=>{let m=c.get();l.multiple?m.includes(o)?c.set(m.filter(u=>u!==o)):c.set(m.concat([o])):m!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>g(n,"inherit"),height:n=>s(6+p(n)*2),paddingInline:n=>s(p(n)*3),border:"none",outline:"none",color:n=>a(n,"shift-9",r),backgroundColor:n=>a(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>a(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>a(n,"shift-6",t),color:n=>a(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${a(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function jr(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,l=f(e.value),c=f(i),{show:m,hide:u,anchorPartial:h}=Y({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&u()};T(e.content,d);let y={div:v=>{let x=l.get(v),S=Array.isArray(x)?x:[x];return t.filter(w=>S.includes(w.value)).map(w=>({span:w.label,$:[be({color:o,removable:n})],_key:w.value,_onRemove:k=>{let E=l.get(),P=(Array.isArray(E)?E:[E]).filter(O=>O!==w.value);n?l.set(P):l.set(P[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},b={_onInsert:v=>{v.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(y),onClick:()=>c.get()?u():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+p(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${a(v,"shift-4","neutral")}`,paddingInline:v=>s(p(v)*2),borderRadius:v=>s(p(v)*1),fontSize:v=>g(v,"inherit"),color:v=>a(v,"shift-9",o),backgroundColor:v=>a(v,"inherit",o)}};return T(h,b),h}function Hr(e={}){var r;let t=f((r=e.accentColor)!=null?r:"primary","accentColor");return{dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>g(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>a(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>a(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>g(o,"inherit"),lineHeight:1,backgroundColor:o=>a(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Wr(e={}){var n,l;let{checked:t=!1}=e,r=f(t),o=f((n=e.color)!=null?n:"neutral","color"),i=f((l=e.accentColor)!=null?l:"primary","accentColor");return{_onSchedule:c=>{c.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>g(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${a(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>a(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>a(c,"shift-9"),backgroundColor:c=>a(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>a(c,"increase-3",i.get(c)),outline:"none",color:c=>a(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Fr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o))}}}function Ur(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>g(o,"inherit"),fontWeight:700,color:o=>a(o,"shift-11",t.get(o)),backgroundColor:o=>a(o)}}}function Kr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>a(o,"shift-9",t.get(o))}}}function qr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>a(o,"shift-9",t.get(o))}}}function Gr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>a(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>a(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${a(o,"shift-3",t.get(o))}`,fontSize:o=>g(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>a(o,"shift-10",t.get(o)),backgroundColor:o=>a(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${a(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>a(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>a(o,"shift-2")+"!important"}}}}function Yr(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=f((n=e.accentColor)!=null?n:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:l=>{l.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:l=>{if(o){let c=l.domElement;c.style.overflow="hidden";let m=()=>{c.style.height="auto",c.style.height=c.scrollHeight+"px"};c.addEventListener("input",m),m()}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:l=>s(p(l)*2),paddingBlock:l=>s(p(l)*1.5),border:"none",borderRadius:l=>s(p(l)*1.5),fontSize:l=>g(l,"inherit"),color:l=>a(l,"shift-9",t.get(l)),outlineOffset:"-1px",outline:l=>`1px solid ${a(l,"shift-4",t.get(l))}`,backgroundColor:l=>a(l,"inherit",t.get(l)),"&::placeholder":{color:l=>a(l,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:l=>`${s(.5)} solid ${a(l,"shift-5",r.get(l))}`},"&:focus-visible":{outline:l=>`${s(.5)} solid ${a(l,"shift-6",r.get(l))}`},"&:invalid":{outline:l=>`${s(.5)} solid ${a(l,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:l=>a(l,"shift-8","neutral"),outline:l=>`1px solid ${a(l,"shift-4","neutral")}`,backgroundColor:l=>a(l,"shift-2","neutral")}}}}function Xr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>a(o),color:o=>a(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function Jr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>a(o),color:o=>a(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Zr(e,t){if(t<=7)return Array.from({length:t},(n,l)=>l+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function Qr(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>s(6+p(m)*2),height:m=>s(6+p(m)*2),paddingInline:m=>s(p(m)*2),borderRadius:m=>s(p(m)*1),border:"none",cursor:"pointer",fontSize:m=>g(m,"inherit"),backgroundColor:"transparent",color:m=>a(m,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:m=>a(m,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},l=gt(pt({},n),{backgroundColor:m=>a(m,"shift-6",o),color:m=>a(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>a(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let u={div:h=>{let d=i.get(h),y=[];y.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let b of Zr(d,t))if(b==="...")y.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(p(v)*2),color:v=>a(v,"shift-7",r)}});else{let v=b===d;y.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(b),style:v?l:n})}return y.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),y},style:{display:"flex",alignItems:"center",gap:s(1)}};m.children.insert(u)},style:{display:"inline-flex"}}}function ei(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:s(2),fontSize:o=>g(o,"inherit"),backgroundColor:o=>a(o),color:o=>a(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>a(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>a(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var bo={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},ti={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},mt=e=>e==="left"||e==="right";function oi(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=f(r),l=mt(o)?s(80):s(64),c=i!=null?i:l;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,u)=>{m.target===u.domElement&&n.set(!1)},onTransitionEnd:(m,u)=>{let h=u.domElement;n.get()||(h.close(),document.body.style.overflow="")},_onMount:m=>{let u=m.domElement,h=y=>{y?(u.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{u.style.transform="translate(0, 0)"})):u.style.transform=bo[o]};h(n.get());let d=n.addListener(h);m.addHook("Remove",()=>{d(),document.body.style.overflow=""})},style:{transform:bo[o],transition:"transform 0.25s ease",fontSize:m=>g(m,"inherit"),color:m=>a(m,"shift-10",t),backgroundColor:m=>a(m,"inherit",t),border:"none",padding:m=>s(p(m)*3),margin:ti[o],width:mt(o)?c:"100dvw",height:mt(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${a(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>a(m,"shift-2","neutral"),opacity:.75}}}}function ni(e){var y;let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=f(t),l=f(r),{show:c,hide:m,anchorPartial:u}=Y({open:n,placement:l,content:e.content}),h={role:"dialog",dataTone:"shift-11",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),_onInsert:b=>{let v=b.attributes.get("id");i=v||b.nodeId,!v&&b.attributes.set("id",i)}};return(y=e.content).$||(y.$=[]),e.content.$.push(h),T(u,{ariaHaspopup:"dialog",ariaExpanded:b=>n.get(b),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&m(),onClick:()=>{o==="click"&&(n.get()?m():c())},onFocus:()=>c(),onBlur:(b,v)=>{let x=b.relatedTarget,S=v.getRoot().domElement,C=i?S.querySelector(`#${CSS.escape(i)}`):null;x&&(C!=null&&C.contains(x))||m()},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),u}function ri(e={}){let{position:t="top-center",color:r="neutral"}=e,o=f(!1),i=t.startsWith("top"),n=t.endsWith("center"),l=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":l?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:m=>{let u=m.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=m.children.insert(c).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:m=>s(p(m)*2),paddingInline:m=>s(p(m)*4),borderRadius:m=>s(p(m)*2),fontSize:m=>g(m,"inherit"),color:m=>a(m,"shift-9",r),backgroundColor:m=>a(m,"inherit",r),boxShadow:m=>`0 ${s(2)} ${s(9)} ${a(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,u)=>{let h=d=>{d.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",h),u())};m.domElement.addEventListener("transitionend",h),o.set(!1)}}}function ii(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=f(r),n=f(o),l=null,c={span:b=>n.get(b)},{show:m,hide:u,anchorPartial:h}=Y({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:b=>{let v=b.attributes.get("id");l=v||b.nodeId,!v&&b.attributes.set("id",l)},style:{paddingBlock:b=>s(p(b)*1),paddingInline:b=>s(p(b)*3),borderRadius:b=>s(p(b)*1),color:b=>a(b,"shift-9"),backgroundColor:b=>a(b),fontSize:b=>g(b,"inherit")},$:[ct({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),T(h,{onMouseEnter:()=>m(),onMouseLeave:()=>u(),onFocus:()=>m(),onBlur:()=>u(),onKeyDown:b=>b.key==="Escape"&&u(),_onMount:b=>l&&b.attributes.set("ariaDescribedby",l)}),h}function vo(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function li(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,l)=>{if(!(n instanceof $))return;let c=n.domElement;c&&o.set(vo(n,l),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,l)=>{if(!(n instanceof $))return;let c=n.domElement;if(!c)return;let m=vo(n,l),u=o.get(m);if(!u)return;let h=c.getBoundingClientRect(),d=u.left-h.left,y=u.top-h.top;if(Math.abs(d)<.5&&Math.abs(y)<.5)return;let b=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${d}px, ${y}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=b,c.style.transform=v,c.removeEventListener("transitionend",S)},S=C=>{C.propertyName==="transform"&&x()};c.addEventListener("transitionend",S),setTimeout(x,t+r+34)}),o.clear()}}}function ai(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:f(e.activeKey||0)}}};T(o,i)}}}function si(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var u,h;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let l=(h=(u=i.parent)==null?void 0:u.children.items)!=null?h:[];l=l.filter(d=>d.type=="ElementNode"&&d.attributes.get("role")=="tab");let c=i.key!==null&&i.key!==void 0?i.key:l.findIndex(d=>d==i),m={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:d=>n.activeKey.get(d)==c,onClick:()=>n.activeKey.set(c),onKeyDown:d=>{var C,w,k,E;let y=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(y))return;d.preventDefault();let b=((w=(C=i.parent)==null?void 0:C.children.items)!=null?w:[]).filter(_=>_.type==="ElementNode"&&_.attributes.get("role")==="tab"),v=b.findIndex(_=>_===i),x=v;y==="ArrowRight"?x=(v+1)%b.length:y==="ArrowLeft"?x=(v-1+b.length)%b.length:y==="Home"?x=0:y==="End"&&(x=b.length-1);let S=b[x];n.activeKey.set((k=S.key)!=null?k:x),(E=S.domElement)==null||E.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>g(i,"inherit"),height:i=>s(6+p(i)*2),paddingInline:i=>s(p(i)*4),border:"none",outline:"none",color:i=>a(i,"shift-9"),backgroundColor:i=>a(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${a(i,"shift-6",t)}`}}}}function ci(){return{role:"tabpanel",style:{paddingBlock:t=>s(p(t)*2),paddingInline:t=>s(p(t)*2)},_onInsert:t=>{var l,c;let r=t.getContext("tabs");if(!r){console.warn('"tabPanel" patch must be used inside a "tabs"');return}let o=(c=(l=t.parent)==null?void 0:l.children.items)!=null?c:[];o=o.filter(m=>m.type=="ElementNode"&&m.attributes.get("role")=="tabpanel");let i=t.key!==null&&t.key!==void 0?t.key:o.findIndex(m=>m==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:m=>r.activeKey.get(m)!=i};t.merge(n)}}}function mi(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let l={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:r}}};T(n,l)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>s(p(i)*2),paddingInline:i=>s(p(i)*2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>a(i,"inherit",t)}}}function ui(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var m,u;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu");if(!n){console.warn('"menuItem" patch must be used inside a "menu"');return}let l=(u=(m=i.parent)==null?void 0:m.children.items)!=null?u:[];l=l.filter(h=>h.type=="ElementNode"&&h.attributes.get("role")=="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:l.findIndex(h=>h==i);n.selectable&&(i.attributes.set("ariaCurrent",h=>n.activeKey.get(h)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var h,d,y,b;let l=i.key;if(l==="Enter"||l===" "){i.preventDefault(),(h=n.domElement)==null||h.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(l))return;i.preventDefault();let c=((y=(d=n.parent)==null?void 0:d.children.items)!=null?y:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem"),m=c.findIndex(v=>v===n),u=m;l==="ArrowDown"?u=(m+1)%c.length:l==="ArrowUp"?u=(m-1+c.length)%c.length:l==="Home"?u=0:l==="End"&&(u=c.length-1),(b=c[u].domElement)==null||b.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>s(2),width:"100%",fontSize:i=>g(i,"inherit"),height:i=>s(6+p(i)*2),paddingInline:i=>s(p(i)*3),border:"none",outline:"none",color:i=>a(i,"shift-9"),backgroundColor:i=>a(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>a(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>a(i,"shift-3",t),color:i=>a(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${a(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}var So=e=>!!e&&typeof e.get=="function"&&e._isState===!0,de=e=>{let t={},r=[];for(let o in e){let i=e[o];o==="x"?r.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?r.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?r.push(`scale(${i})`):o==="rotate"?r.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return r.length&&(t.transform=r.join(" ")),t};function hi(e={}){var l,c,m,u;let{initial:t,animate:r,exit:o,transition:i={}}=e,n={duration:(l=i.duration)!=null?l:300,delay:(c=i.delay)!=null?c:0,easing:(m=i.easing)!=null?m:"ease",iterations:(u=i.iterations)!=null?u:1,fill:"both"};return{_onMount:h=>{let d=h.domElement;if(!d||typeof d.animate!="function")return;let y=So(r)?r.get():r;if(y?d.animate(t?[de(t),de(y)]:[de(y)],n):t&&Object.assign(d.style,de(t)),So(r)){let b=r.addListener(v=>{d.animate([de(v)],n)});h.setMetadata("motionRelease",b)}},_onBeforeRemove:(h,d)=>{let y=h.domElement;if(!y||!o||typeof y.animate!="function")return d();y.animate([de(o)],n).finished.then(d,d)},_onRemove:h=>{let d=h.getMetadata("motionRelease");d==null||d()}}}return Po(di);})();
4
+ ${i}}`}function Q(e){if(!Ee[e])throw Error(`Theme "${e}" not found`);return Ee[e]}function Zn(e,t){Xn(t),Ee[e]||(Ee[e]=Ot(Me)),So(Ee[e],t)}function Qn(e){let t=Ot(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function Co(e){let t=Q(e),r=Pt(t),o={};for(let i in t){let n=t[i];if(i==="colors")for(let a in t.colors){let c={};[...Array(r).keys()].forEach(u=>c[u]=t.colors[a][u]),o[a]=c}else if(i==="fontSizes")o.fontSizes=t.fontSizes;else if(i==="densities")o.densities=t.densities;else if(i==="custom"&&(o.custom={},n&&typeof n=="object"))for(let a in n)o.custom[a]=n[a]}return o}function ze(){let e=Q("light"),t=Pt(e),r={};for(let o in e){let i=e[o];if(o==="colors")for(let n in e.colors){let a={};[...Array(t).keys()].forEach(c=>a[c]=`var(--${n}-${c})`),r[n]=a}else if(o==="fontSizes")r.fontSizes=[...Array(8).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(r.custom={},i&&typeof i=="object"))for(let n in i)r.custom[n]=`var(--custom-${vo(n)})`}return r}function Et(){return Object.entries(Ee).map(([e,t])=>Jn(e,t)).join(`
5
+ `)}function er(e){var t;if(typeof document!="undefined")if(e){e.textContent=Et();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Et(),document.head.appendChild(e)}function s(e){return e/4+"em"}function Ge(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var _t=["inherit"];[...Array(8).keys()].forEach(e=>{_t.push(`decrease-${e}`),_t.push(`increase-${e}`)});function xo(e,t="inherit"){if(!_t.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function tr(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=xo(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function g(e,t="inherit"){let r=xo(tr(e),t);return ze().fontSizes[r]}var Tt=["inherit"];[...Array(5).keys()].forEach(e=>{Tt.push(`decrease-${e}`),Tt.push(`increase-${e}`)});function or(e,t="inherit"){if(!Tt.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function nr(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=or(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function y(e){let t=nr(e);return Q(e?Ge(e):"light").densities[t]}var se=Me.colors.neutral.length,Ye=["inherit","base"];[...Array(se).keys()].forEach(e=>{Ye.push(`decrease-${e}`),Ye.push(`increase-${e}`),Ye.push(`shift-${e}`)});function bo(e,t){if(e<0||e>se-1)return e;let r=e+t;return r=Math.max(0,Math.min(se-1,r)),r}function rr(e,t){if(e<0||e>se-1)return e;let r=Math.floor((se-1)/2),o=e<=r?e+t:e-t;return o=Math.max(0,Math.min(se-1,o)),o}function Le(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!Ye.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return bo(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return bo(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return rr(e,r)}else return e}function wo(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=Le(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function ko(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===se-1?se-1-r:e}function l(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return t=="base"?ze()[o][Q("light").baseTones[o]]:ze()[o][Le(0,t)];let i=Ge(e),n;if(t=="base")n=Q(i).baseTones[o];else{let c=Q(i),u=ko(wo(e),c.direction,c.darkBias);n=Le(u,t)}let a=ze()[o];if(!a)throw Error(`color "${o}" not found on theme "${i}"`);return a[n]}function $t(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r,i=e?Ge(e):"light",n=Co(i);if(!e)return t=="base"?n[o][Q("light").baseTones[o]]:n[o][Le(0,t)];let a;if(t=="base")a=Q(i).baseTones[o];else{let c=Q(i),u=ko(wo(e),c.direction,c.darkBias);a=Le(u,t)}return n[o][a]}var ct={};Ke(ct,{abbreviation:()=>ir,alert:()=>gr,avatar:()=>yr,badge:()=>br,blockquote:()=>ci,breadcrumb:()=>vr,breadcrumbEllipsis:()=>Sr,button:()=>ui,buttonSwitch:()=>Xi,card:()=>ar,code:()=>hi,combobox:()=>si,command:()=>ur,commandItem:()=>hr,commandSearch:()=>mr,datePicker:()=>Ti,descriptionList:()=>fi,details:()=>di,dialog:()=>pi,divider:()=>la,drawer:()=>ca,emphasis:()=>gi,figure:()=>yi,formGroup:()=>bi,heading:()=>Si,horizontalRule:()=>Ci,icon:()=>wi,image:()=>xi,inputCheckbox:()=>mi,inputColor:()=>ki,inputDateTime:()=>Ei,inputFile:()=>$i,inputNumber:()=>zi,inputOTP:()=>pr,inputRadio:()=>ji,inputRange:()=>Ii,inputSearch:()=>Di,inputSwitch:()=>Gi,inputText:()=>Ri,keyboard:()=>Mi,label:()=>Li,link:()=>Vi,mark:()=>Ai,menu:()=>ya,menuItem:()=>ba,motion:()=>va,orderedList:()=>ra,pagination:()=>aa,paragraph:()=>Ni,popover:()=>ua,popoverArrow:()=>At,preformated:()=>Bi,progress:()=>Hi,select:()=>Fi,selectBox:()=>Yi,selectItem:()=>qi,selectList:()=>Ui,skeleton:()=>Wi,small:()=>Ji,spinner:()=>Ki,splitter:()=>lr,splitterHandle:()=>cr,splitterPanel:()=>sr,strong:()=>Zi,subscript:()=>Qi,superscript:()=>ea,tab:()=>pa,tabPanel:()=>ga,table:()=>ta,tabs:()=>fa,tag:()=>Ve,textarea:()=>oa,toast:()=>ma,toggle:()=>dr,toggleGroup:()=>fr,tooltip:()=>ha,transitionGroup:()=>da,unorderedList:()=>na});function ir(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>g(n),backgroundColor:n=>l(n),color:n=>l(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>l(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>l(n,"shift-11",r.get(n)),textDecorationColor:n=>l(n,"shift-9",r.get(n))}}}}function ar(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(y(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>s(y(o)*2),paddingInline:o=>s(y(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(y(o)*4),color:o=>l(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(y(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(y(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(y(o)*2),paddingInline:o=>s(y(o)*4),borderTop:o=>`1px solid ${l(o,"shift-3",t.get(o))}`}}}}function lr(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{R(a,{_context:{splitter:{direction:t,size:f(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function sr(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function cr(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let a=r.parentElement,c=m=>{let h=a.getBoundingClientRect(),d=o?(m.clientX-h.left)/h.width*100:(m.clientY-h.top)/h.height*100;t.size.set(Math.min(Math.max(d,t.min),t.max))},u=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&::after":{content:'""',borderRadius:s(999),backgroundColor:e=>l(e,"shift-4")}}}}function ur(){return{_onSchedule:(e,t)=>{R(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function mr(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>g(o,"inherit"),paddingInline:o=>s(y(o)*3),paddingBlock:o=>s(y(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-3",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",r)}}}}function hr(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var u,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,a=(m=(u=n.textContent)==null?void 0:u.toLowerCase())!=null?m:"",c=i.query.addListener(h=>{n.hidden=h.length>0&&!a.includes(h.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>g(o,"inherit"),height:o=>s(6+y(o)*2),paddingInline:o=>s(y(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}function dr(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var h,d;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup");if(!a){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let u=((d=(h=n.parent)==null?void 0:h.children.items)!=null?d:[]).filter(p=>p.type==="ElementNode"&&p.attributes.get("role")==="button"),m=n.key!==null&&n.key!==void 0?String(n.key):String(u.findIndex(p=>p===n));n.attributes.set("ariaPressed",p=>{let b=a.value.get(p);return Array.isArray(b)?b.includes(m):b===m}),n.addEvent("click",()=>{let p=a.value.get();if(a.multiple){let b=Array.isArray(p)?[...p]:[];a.value.set(b.includes(m)?b.filter(v=>v!==m):[...b,m])}else a.value.set(p===m?"":m)})},style:{cursor:"pointer",fontSize:n=>g(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>l(n,"shift-3",r.get(n)),color:n=>l(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function fr(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>l(i,"inherit",r),outline:i=>`1px solid ${l(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function pr(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),u=a.target,m=c.indexOf(u);u.value&&m<c.length-1&&c[m+1].focus()},i=a=>{let c=r(),u=a.target,m=c.indexOf(u);a.key==="Backspace"&&!u.value&&m>0&&c[m-1].focus(),a.key==="ArrowLeft"&&m>0&&c[m-1].focus(),a.key==="ArrowRight"&&m<c.length-1&&c[m+1].focus()},n=a=>{var d,p,b;a.preventDefault();let c=(p=(d=a.clipboardData)==null?void 0:d.getData("text"))!=null?p:"",u=r(),m=u.indexOf(a.target);[...c].forEach((v,x)=>{u[m+x]&&(u[m+x].value=v)});let h=Math.min(m+c.length-1,u.length-1);(b=u[h])==null||b.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function gr(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(y(o)*2),paddingInline:o=>s(y(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>g(o,"inherit")}}}function yr(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>g(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function br(e={}){var i;let{label:t=999}=e,r=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>g(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function vr(e={}){var o;let{separator:t="/"}=e,r=f((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>g(i,"inherit"),gap:s(1),color:i=>l(i,"shift-9",r.get(i)),backgroundColor:i=>l(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function Sr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>g(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}var Cr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function Ve(e={}){var o;let{removable:t=!1}=e,r=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:Cr,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>l(i,"inherit",r.get(i)),color:i=>l(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-4",r.get(i))}`}}}var xr=Object.defineProperty,wr=Object.defineProperties,kr=Object.getOwnPropertyDescriptors,Ze=Object.getOwnPropertySymbols,Mo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Eo=(e,t,r)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))Mo.call(t,r)&&Eo(e,r,t[r]);if(Ze)for(var r of Ze(t))Lo.call(t,r)&&Eo(e,r,t[r]);return e},ge=(e,t)=>wr(e,kr(t)),Vo=(e,t)=>{var r={};for(var o in e)Mo.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Ze)for(var o of Ze(e))t.indexOf(o)<0&&Lo.call(e,o)&&(r[o]=e[o]);return r},ve=(e,t,r)=>new Promise((o,i)=>{var n=u=>{try{c(r.next(u))}catch(m){i(m)}},a=u=>{try{c(r.throw(u))}catch(m){i(m)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(n,a);c((r=r.apply(e,t)).next())}),Er=["top","right","bottom","left"],_o=["start","end"],Tl=Er.reduce((e,t)=>e.concat(t,`${t}-${_o[0]}`,`${t}-${_o[1]}`),[]),Qe=Math.min,pe=Math.max,et=Math.round,Je=Math.floor,ee=e=>({x:e,y:e}),_r={left:"right",right:"left",bottom:"top",top:"bottom"};function To(e,t,r){return pe(e,Qe(t,r))}function nt(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function rt(e){return e.split("-")[1]}function Ao(e){return e==="x"?"y":"x"}function No(e){return e==="y"?"height":"width"}function ce(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Bo(e){return Ao(ce(e))}function Tr(e,t,r=!1){let o=rt(e),i=Bo(e),n=No(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=tt(a)),[a,tt(a)]}function Or(e){let t=tt(e);return[It(e),t,It(t)]}function It(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Oo=["left","right"],Po=["right","left"],Pr=["top","bottom"],$r=["bottom","top"];function Dr(e,t,r){switch(e){case"top":case"bottom":return r?t?Po:Oo:t?Oo:Po;case"left":case"right":return t?Pr:$r;default:return[]}}function Rr(e,t,r,o){let i=rt(e),n=Dr(ye(e),r==="start",o);return i&&(n=n.map(a=>`${a}-${i}`),t&&(n=n.concat(n.map(It)))),n}function tt(e){let t=ye(e);return _r[t]+e.slice(t.length)}function Ir(e){return Y({top:0,right:0,bottom:0,left:0},e)}function zr(e){return typeof e!="number"?Ir(e):{top:e,right:e,bottom:e,left:e}}function ot(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function $o({reference:e,floating:t},r,o){let i=ce(r),n=Bo(r),a=No(n),c=ye(r),u=i==="y",m=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,d=e[a]/2-t[a]/2,p;switch(c){case"top":p={x:m,y:e.y-t.height};break;case"bottom":p={x:m,y:e.y+e.height};break;case"right":p={x:e.x+e.width,y:h};break;case"left":p={x:e.x-t.width,y:h};break;default:p={x:e.x,y:e.y}}switch(rt(r)){case"start":p[n]-=d*(o&&u?-1:1);break;case"end":p[n]+=d*(o&&u?-1:1);break;default:}return p}function Mr(e){return ve(this,arguments,function*(t,r={}){var o,i,n,a,c,u;let{x:m,y:h,platform:d,rects:p,elements:b,strategy:v}=t,{boundary:x="clippingAncestors",rootBoundary:C="viewport",elementContext:w="floating",altBoundary:E=!1,padding:O=0}=nt(r,t),T=zr(O),$=b[E?w==="floating"?"reference":"floating":w],L=ot(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,$))==null||i?$:$.contextElement||(yield(n=d.getDocumentElement)==null?void 0:n.call(d,b.floating)),boundary:x,rootBoundary:C,strategy:v})),I=w==="floating"?{x:m,y:h,width:p.floating.width,height:p.floating.height}:p.reference,ie=yield(a=d.getOffsetParent)==null?void 0:a.call(d,b.floating),A=(yield(c=d.isElement)==null?void 0:c.call(d,ie))?(yield(u=d.getScale)==null?void 0:u.call(d,ie))||{x:1,y:1}:{x:1,y:1},U=ot(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:b,rect:I,offsetParent:ie,strategy:v}):I);return{top:(L.top-U.top+T.top)/A.y,bottom:(U.bottom-L.bottom+T.bottom)/A.y,left:(L.left-U.left+T.left)/A.x,right:(U.right-L.right+T.right)/A.x}})}var Lr=50,Vr=(e,t,r)=>ve(null,null,function*(){var o;let{placement:i="bottom",strategy:n="absolute",middleware:a=[],platform:c}=r,u=c.detectOverflow?c:ge(Y({},c),{detectOverflow:Mr}),m=yield(o=c.isRTL)==null?void 0:o.call(c,t),h=yield c.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:p}=$o(h,i,m),b=i,v=0,x={};for(let C=0;C<a.length;C++){let w=a[C];if(!w)continue;let{name:E,fn:O}=w,{x:T,y:$,data:L,reset:I}=yield O({x:d,y:p,initialPlacement:i,placement:b,strategy:n,middlewareData:x,rects:h,platform:u,elements:{reference:e,floating:t}});d=T!=null?T:d,p=$!=null?$:p,x[E]=Y(Y({},x[E]),L),I&&v<Lr&&(v++,typeof I=="object"&&(I.placement&&(b=I.placement),I.rects&&(h=I.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:n}):I.rects),{x:d,y:p}=$o(h,b,m)),C=-1)}return{x:d,y:p,placement:b,strategy:n,middlewareData:x}});var Ar=(e={})=>({name:"flip",options:e,fn(t){return ve(this,null,function*(){var r,o,i,n,a,c;let{placement:u,middlewareData:m,rects:h,initialPlacement:d,platform:p,elements:b}=t,v=nt(e,t),{mainAxis:x=!0,crossAxis:C=!0,fallbackPlacements:w,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:T=!0}=v,$=Vo(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=m.arrow)!=null&&r.alignmentOffset)return{};let L=ye(u),I=ce(d),ie=ye(d)===d,A=yield(o=p.isRTL)==null?void 0:o.call(p,b.floating),U=w||(ie||!T?[tt(d)]:Or(d)),He=O!=="none";!w&&He&&U.push(...Rr(d,T,O,A));let je=[d,...U],j=yield p.detectOverflow(t,$),me=[],ae=((i=m.flip)==null?void 0:i.overflows)||[];if(x&&me.push(j[L]),C){let ne=Tr(u,h,A);me.push(j[ne[0]],j[ne[1]])}if(ae=[...ae,{placement:u,overflows:me}],!me.every(ne=>ne<=0)){let ne=(((n=m.flip)==null?void 0:n.index)||0)+1,$e=je[ne];if($e&&(!(C==="alignment"&&I!==ce($e))||ae.every(F=>ce(F.placement)===I?F.overflows[0]>0:!0)))return{data:{index:ne,overflows:ae},reset:{placement:$e}};let J=(a=ae.filter(F=>F.overflows[0]<=0).sort((F,q)=>F.overflows[1]-q.overflows[1])[0])==null?void 0:a.placement;if(!J)switch(E){case"bestFit":{let F=(c=ae.filter(q=>{if(He){let W=ce(q.placement);return W===I||W==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(W=>W>0).reduce((W,ut)=>W+ut,0)]).sort((q,W)=>q[1]-W[1])[0])==null?void 0:c[0];F&&(J=F);break}case"initialPlacement":J=d;break;default:}if(u!==J)return{reset:{placement:J}}}return{}})}});var Nr=new Set(["left","top"]);function Br(e,t){return ve(this,null,function*(){var r;let{placement:o,platform:i,elements:n}=e,a=yield(r=i.isRTL)==null?void 0:r.call(i,n.floating),c=ye(o),u=rt(o),m=ce(o)==="y",h=Nr.has(c)?-1:1,d=a&&m?-1:1,p=nt(t,e),{mainAxis:b,crossAxis:v,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(v=u==="end"?x*-1:x),m?{x:v*d,y:b*h}:{x:b*h,y:v*d}})}var Hr=(e=0)=>({name:"offset",options:e,fn(t){return ve(this,null,function*(){var r,o;let{x:i,y:n,placement:a,middlewareData:c}=t,u=yield Br(t,e);return a===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:n+u.y,data:ge(Y({},u),{placement:a})}})}}),jr=(e={})=>({name:"shift",options:e,fn(t){return ve(this,null,function*(){let{x:r,y:o,placement:i,platform:n}=t,a=nt(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:m={fn:({x:E,y:O})=>({x:E,y:O})}}=a,h=Vo(a,["mainAxis","crossAxis","limiter"]),d={x:r,y:o},p=yield n.detectOverflow(t,h),b=ce(ye(i)),v=Ao(b),x=d[v],C=d[b];if(c){let E=v==="y"?"top":"left",O=v==="y"?"bottom":"right",T=x+p[E],$=x-p[O];x=To(T,x,$)}if(u){let E=b==="y"?"top":"left",O=b==="y"?"bottom":"right",T=C+p[E],$=C-p[O];C=To(T,C,$)}let w=m.fn(ge(Y({},t),{[v]:x,[b]:C}));return ge(Y({},w),{data:{x:w.x-r,y:w.y-o,enabled:{[v]:c,[b]:u}}})})}});function it(){return typeof window!="undefined"}function Oe(e){return Ho(e)?(e.nodeName||"").toLowerCase():"#document"}function H(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function te(e){var t;return(t=(Ho(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ho(e){return it()?e instanceof Node||e instanceof H(e).Node:!1}function G(e){return it()?e instanceof Element||e instanceof H(e).Element:!1}function re(e){return it()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Do(e){return!it()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ne(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function Fr(e){return/^(table|td|th)$/.test(Oe(e))}function at(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var Wr=/transform|translate|scale|rotate|perspective|filter/,Kr=/paint|layout|strict|content/,fe=e=>!!e&&e!=="none",Dt;function Mt(e){let t=G(e)?X(e):e;return fe(t.transform)||fe(t.translate)||fe(t.scale)||fe(t.rotate)||fe(t.perspective)||!Lt()&&(fe(t.backdropFilter)||fe(t.filter))||Wr.test(t.willChange||"")||Kr.test(t.contain||"")}function Ur(e){let t=ue(e);for(;re(t)&&!Te(t);){if(Mt(t))return t;if(at(t))return null;t=ue(t)}return null}function Lt(){return Dt==null&&(Dt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Dt}function Te(e){return/^(html|body|#document)$/.test(Oe(e))}function X(e){return H(e).getComputedStyle(e)}function lt(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ue(e){if(Oe(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Do(e)&&e.host||te(e);return Do(t)?t.host:t}function jo(e){let t=ue(e);return Te(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&Ne(t)?t:jo(t)}function Ae(e,t=[],r=!0){var o;let i=jo(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=H(i);if(n){let c=zt(a);return t.concat(a,a.visualViewport||[],Ne(i)?i:[],c&&r?Ae(c):[])}else return t.concat(i,Ae(i,[],r))}function zt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fo(e){let t=X(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=re(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=et(r)!==n||et(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function Vt(e){return G(e)?e:e.contextElement}function _e(e){let t=Vt(e);if(!re(t))return ee(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=Fo(t),a=(n?et(r.width):r.width)/o,c=(n?et(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var qr=ee(0);function Wo(e){let t=H(e);return!Lt()||!t.visualViewport?qr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yr(e,t=!1,r){return!r||t&&r!==H(e)?!1:t}function be(e,t=!1,r=!1,o){let i=e.getBoundingClientRect(),n=Vt(e),a=ee(1);t&&(o?G(o)&&(a=_e(o)):a=_e(e));let c=Yr(n,r,o)?Wo(n):ee(0),u=(i.left+c.x)/a.x,m=(i.top+c.y)/a.y,h=i.width/a.x,d=i.height/a.y;if(n){let p=H(n),b=o&&G(o)?H(o):o,v=p,x=zt(v);for(;x&&o&&b!==v;){let C=_e(x),w=x.getBoundingClientRect(),E=X(x),O=w.left+(x.clientLeft+parseFloat(E.paddingLeft))*C.x,T=w.top+(x.clientTop+parseFloat(E.paddingTop))*C.y;u*=C.x,m*=C.y,h*=C.x,d*=C.y,u+=O,m+=T,v=H(x),x=zt(v)}}return ot({width:h,height:d,x:u,y:m})}function st(e,t){let r=lt(e).scrollLeft;return t?t.left+r:be(te(e)).left+r}function Ko(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-st(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function Gr({elements:e,rect:t,offsetParent:r,strategy:o}){let i=o==="fixed",n=te(r),a=e?at(e.floating):!1;if(r===n||a&&i)return t;let c={scrollLeft:0,scrollTop:0},u=ee(1),m=ee(0),h=re(r);if((h||!h&&!i)&&((Oe(r)!=="body"||Ne(n))&&(c=lt(r)),h)){let p=be(r);u=_e(r),m.x=p.x+r.clientLeft,m.y=p.y+r.clientTop}let d=n&&!h&&!i?Ko(n,c):ee(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+m.x+d.x,y:t.y*u.y-c.scrollTop*u.y+m.y+d.y}}function Xr(e){return Array.from(e.getClientRects())}function Jr(e){let t=te(e),r=lt(e),o=e.ownerDocument.body,i=pe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=pe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+st(e),c=-r.scrollTop;return X(o).direction==="rtl"&&(a+=pe(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var Ro=25;function Zr(e,t){let r=H(e),o=te(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){n=i.width,a=i.height;let h=Lt();(!h||h&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let m=st(o);if(m<=0){let h=o.ownerDocument,d=h.body,p=getComputedStyle(d),b=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=Ro&&(n-=v)}else m<=Ro&&(n+=m);return{width:n,height:a,x:c,y:u}}function Qr(e,t){let r=be(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=re(e)?_e(e):ee(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,u=i*n.x,m=o*n.y;return{width:a,height:c,x:u,y:m}}function Io(e,t,r){let o;if(t==="viewport")o=Zr(e,r);else if(t==="document")o=Jr(te(e));else if(G(t))o=Qr(t,r);else{let i=Wo(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ot(o)}function Uo(e,t){let r=ue(e);return r===t||!G(r)||Te(r)?!1:X(r).position==="fixed"||Uo(r,t)}function ei(e,t){let r=t.get(e);if(r)return r;let o=Ae(e,[],!1).filter(c=>G(c)&&Oe(c)!=="body"),i=null,n=X(e).position==="fixed",a=n?ue(e):e;for(;G(a)&&!Te(a);){let c=X(a),u=Mt(a);!u&&c.position==="fixed"&&(i=null),(n?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Ne(a)&&!u&&Uo(e,a))?o=o.filter(m=>m!==a):i=c,a=ue(a)}return t.set(e,o),o}function ti({element:e,boundary:t,rootBoundary:r,strategy:o}){let i=[...t==="clippingAncestors"?at(e)?[]:ei(e,this._c):[].concat(t),r],n=Io(e,i[0],o),a=n.top,c=n.right,u=n.bottom,m=n.left;for(let h=1;h<i.length;h++){let d=Io(e,i[h],o);a=pe(d.top,a),c=Qe(d.right,c),u=Qe(d.bottom,u),m=pe(d.left,m)}return{width:c-m,height:u-a,x:m,y:a}}function oi(e){let{width:t,height:r}=Fo(e);return{width:t,height:r}}function ni(e,t,r){let o=re(t),i=te(t),n=r==="fixed",a=be(e,!0,n,t),c={scrollLeft:0,scrollTop:0},u=ee(0);function m(){u.x=st(i)}if(o||!o&&!n)if((Oe(t)!=="body"||Ne(i))&&(c=lt(t)),o){let b=be(t,!0,n,t);u.x=b.x+t.clientLeft,u.y=b.y+t.clientTop}else i&&m();n&&!o&&i&&m();let h=i&&!o&&!n?Ko(i,c):ee(0),d=a.left+c.scrollLeft-u.x-h.x,p=a.top+c.scrollTop-u.y-h.y;return{x:d,y:p,width:a.width,height:a.height}}function Rt(e){return X(e).position==="static"}function zo(e,t){if(!re(e)||X(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return te(e)===r&&(r=r.ownerDocument.body),r}function qo(e,t){let r=H(e);if(at(e))return r;if(!re(e)){let i=ue(e);for(;i&&!Te(i);){if(G(i)&&!Rt(i))return i;i=ue(i)}return r}let o=zo(e,t);for(;o&&Fr(o)&&Rt(o);)o=zo(o,t);return o&&Te(o)&&Rt(o)&&!Mt(o)?r:o||Ur(e)||r}var ri=function(e){return ve(this,null,function*(){let t=this.getOffsetParent||qo,r=this.getDimensions,o=yield r(e.floating);return{reference:ni(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function ii(e){return X(e).direction==="rtl"}var ai={convertOffsetParentRelativeRectToViewportRelativeRect:Gr,getDocumentElement:te,getClippingRect:ti,getOffsetParent:qo,getElementRects:ri,getClientRects:Xr,getDimensions:oi,getScale:_e,isElement:G,isRTL:ii};function Yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function li(e,t){let r=null,o,i=te(e);function n(){clearTimeout(o),r==null||r.disconnect(),r=null}function a(c=!1,u=1){n();let m=e.getBoundingClientRect(),{left:h,top:d,width:p,height:b}=m;if(c||t(),!p||!b)return;let v=Je(d),x=Je(i.clientWidth-(h+p)),C=Je(i.clientHeight-(d+b)),w=Je(h),E={rootMargin:`${-v}px ${-x}px ${-C}px ${-w}px`,threshold:pe(0,Qe(1,u))||1},O=!0;function T($){let L=$[0].intersectionRatio;if(L!==u){if(!O)return a();L?a(!1,L):o=setTimeout(()=>{a(!1,1e-7)},1e3)}L===1&&!Yo(m,e.getBoundingClientRect())&&a(),O=!1}try{r=new IntersectionObserver(T,ge(Y({},E),{root:i.ownerDocument}))}catch($){r=new IntersectionObserver(T,E)}r.observe(e)}return a(!0),n}function Go(e,t,r,o={}){let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,m=Vt(e),h=i||n?[...m?Ae(m):[],...t?Ae(t):[]]:[];h.forEach(w=>{i&&w.addEventListener("scroll",r,{passive:!0}),n&&w.addEventListener("resize",r)});let d=m&&c?li(m,r):null,p=-1,b=null;a&&(b=new ResizeObserver(([w])=>{w&&w.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{b==null||b.observe(t)})),r()}),m&&!u&&b.observe(m),t&&b.observe(t));let v,x=u?be(e):null;u&&C();function C(){let w=be(e);x&&!Yo(x,w)&&r(),x=w,v=requestAnimationFrame(C)}return r(),()=>{h.forEach(w=>{i&&w.removeEventListener("scroll",r),n&&w.removeEventListener("resize",r)}),d==null||d(),b==null||b.disconnect(),b=null,u&&cancelAnimationFrame(v)}}var Xo=Hr;var Jo=jr,Zo=Ar;var Qo=(e,t,r)=>{let o=new Map,i=Y({platform:ai},r),n=ge(Y({},i.platform),{_c:o});return Vr(e,t,ge(Y({},i),{platform:n}))};function oe(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,a=null,c=null,u=null,m=!1,h=f(t),d=()=>{m||!u||(m=!0,c=u.children.insert(e.content))},p=()=>{d(),n&&a&&(i&&i(),i=Go(n,a,()=>{Qo(n,a,{placement:r.get(),middleware:[Xo(12),Zo(),Jo()],strategy:"fixed"}).then(({x:E,y:O,placement:T})=>{Object.assign(a.style,{left:`${E}px`,top:`${O}px`}),r.set(T)})}),h.set(!0))},b=()=>{i&&i(),i=null,h.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(p,100)},x=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},C={style:{position:"fixed",pointerEvents:"auto",visibility:E=>h.get(E)?"visible":"hidden"},_onMount:E=>a=E.domElement,_portal:E=>{let O=E.domElement.querySelector("#domphy-floating");if(!O){let T={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};O=E.children.insert(T).domElement}return O}};return R(e.content,C),{show:v,hide:x,anchorPartial:{onKeyDown:E=>E.key==="Escape"&&x(),_onMount:E=>{u=E.getRoot(),n=E.domElement;let O=T=>{if(!h.get()||!n||!a)return;let $=T.target;!n.contains($)&&!a.contains($)&&x()};E.getRoot().domElement.addEventListener("click",O),E.addHook("BeforeRemove",()=>{o&&clearTimeout(o),i&&(i(),i=null),c&&c.remove(),E.getRoot().domElement.removeEventListener("click",O)})}}}}function si(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:m,anchorPartial:h}=oe({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&m()};R(e.content,d);let p={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:C=>g(C,"inherit"),color:C=>l(C,"shift-9",o),backgroundColor:C=>l(C,"inherit",o)},b;e.input?(R(e.input,{onFocus:()=>u(),style:p,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>u(),value:C=>(a.get(C),""),style:p,_key:"combobox-input"};let v={div:C=>{let w=a.get(C),E=Array.isArray(w)?w:[w],T=t.filter($=>E.includes($.value)).map($=>({span:$.label,$:[Ve({color:o,removable:!0})],_key:$.value,_onRemove:L=>{let I=a.get(),A=(Array.isArray(I)?I:[I]).filter(U=>U!==$.value);n?a.set(A):a.set(A[0])}}));return T.push(b),T},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},x={_onInsert:C=>{C.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:C=>C.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:C=>`1px solid ${l(C,"shift-4","neutral")}`,paddingBlock:C=>s(y(C)*1),paddingInline:C=>s(y(C)*1),borderRadius:C=>s(y(C)*1),fontSize:C=>g(C,"inherit"),color:C=>l(C,"shift-9",o),backgroundColor:C=>l(C,"inherit",o)}};return R(h,x),h}function At(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=f(t),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=h=>{var d;return(d=a[n.get(h)])!=null?d:a["bottom-end"]},u=h=>h.includes("start")?o:h.includes("end")?"auto":"50%",m=h=>h.includes("end")?o:h.includes("start")?"auto":"50%";return{style:{fontSize:h=>g(h),backgroundColor:h=>l(h),color:h=>l(h,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:h=>l(h,"inherit",r),borderWidth:i?"1px":"0px",borderColor:h=>l(h,"inherit",r),borderTopStyle:h=>{let d=c(h);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:h=>{let d=c(h);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:h=>{let d=c(h);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:h=>{let d=c(h);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:h=>{let d=c(h);return d.includes("right")?0:d.includes("left")?"auto":m(d)},bottom:h=>{let d=c(h);return d.includes("bottom")?0:d.includes("top")?"auto":m(d)},left:h=>{let d=c(h);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:h=>{let d=c(h),p=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${p},${b}) rotate(45deg)`}}}}}function ci(e={}){var r;let t=f((r=e.color)!=null?r:"inherit","color");return{_onInsert:o=>{o.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(y(o)*2),paddingInline:o=>s(y(o)*4),margin:0}}}function ui(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>g(o,"inherit"),paddingBlock:o=>s(y(o)*1),paddingInline:o=>s(y(o)*3),borderRadius:o=>s(y(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(y(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function mi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>g(n,"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:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${l(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function hi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}function di(e={}){var i,n;let{duration:t=240}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:a=>{a.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>g(a,"inherit"),color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",r.get(a)),color:a=>l(a,"shift-10",r.get(a)),fontSize:a=>g(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(y(a)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(y(a)*2),outlineOffset:`-${s(.5)}`,outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>s(y(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:a=>s(y(a)*1),paddingBottom:a=>s(y(a)*3)}}}}function fi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function pi(e={}){let{color:t="neutral",open:r=!1}=e,o=f(r);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,a=u=>{u?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let m=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):n.style.opacity="0"};a(o.get());let c=o.addListener(a);i.addHook("Remove",()=>{c(),document.body.style.overflow=""})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>g(i,"inherit"),color:i=>l(i,"shift-10",t),backgroundColor:i=>l(i,"inherit",t),border:"none",padding:i=>s(y(i)*3),boxShadow:i=>`0 ${s(9)} ${s(16)} ${l(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>l(i,"shift-2","neutral"),opacity:.75}}}}function gi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>g(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function yi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>l(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>g(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function bi(e={}){var i;let{layout:t="horizontal"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(y(n)*3),paddingBlock:n=>s(y(n)*3),border:"none",borderRadius:n=>s(y(n)*2),fontSize:n=>g(n,"inherit"),backgroundColor:n=>l(n,"inherit",r.get(n)),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:n=>g(n,"inherit"),fontWeight:600,paddingBlock:n=>s(y(n)*1),borderRadius:n=>s(y(n)*2),color:n=>l(n,"shift-9",r.get(n)),backgroundColor:n=>l(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(y(n)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${s(2)} * -1)`,fontSize:n=>g(n,"decrease-1"),color:n=>l(n,"shift-9",r.get(n))}}}}var vi={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Si(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=vi[o.elementNode.tagName]||"inherit";return g(o,i)}}}}function Ci(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function xi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:s(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function wi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:s(4),height:s(4),flexShrink:"0",fontSize:o=>g(o),backgroundColor:"transparent",color:o=>l(o,"shift-9",t.get(o))}}}function ki(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>g(n,"inherit"),paddingBlock:n=>s(y(n)*1),paddingInline:n=>s(y(n)*1),blockSize:n=>s(6+y(n)*2),inlineSize:n=>s(6+y(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>s(y(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function Ei(e={}){var i,n;let{mode:t="datetime-local"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onSchedule:(a,c)=>{a.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:a=>g(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,borderRadius:a=>s(y(a)*1),paddingInline:a=>s(y(a)*3),height:a=>s(6+y(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-6","error")}`}}}}var V=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Se=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Nt=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Be=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Bt=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Ht=(e,t)=>Se(e,-((e.getDay()-t+7)%7));function _i(e){var t,r;try{let o=new Intl.Locale(e),i=(r=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?r:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function Ti(e={}){var Ft,Wt,Kt,Ut;let{mode:t="single",time:r=!1,min:o,max:i,disabledDate:n,locale:a=typeof navigator!="undefined"?navigator.language:"en-US",format:c,onChange:u}=e,m=(Ft=e.weekStartsOn)!=null?Ft:_i(a),h=f((Wt=e.accentColor)!=null?Wt:"primary","accentColor"),d=f((Kt=e.placement)!=null?Kt:"bottom-start"),p=f((Ut=e.value)!=null?Ut:t==="range"?[null,null]:null);u&&p.addListener(S=>u(S));let b=(()=>{let S=p.get(),k=t==="range"?S==null?void 0:S[0]:S;return k instanceof Date?k:new Date})(),v=f(b.getFullYear(),"viewYear"),x=f(b.getMonth(),"viewMonth"),C=f(V(b),"focused"),w=f(null,"hovered"),E=f(b.getHours(),"hour"),O=f(b.getMinutes(),"minute"),T=null,$=new Intl.DateTimeFormat(a,We({dateStyle:"medium"},r?{timeStyle:"short"}:{})),L=new Intl.DateTimeFormat(a,{month:"long",year:"numeric"}),I=new Intl.DateTimeFormat(a,{weekday:"short"}),ie=new Intl.DateTimeFormat(a,{dateStyle:"full"}),A=S=>S?$.format(S):"",U=S=>{if(c)return c(S);if(t==="range"){let[k,_]=S!=null?S:[null,null];return k?`${A(k)} \u2013 ${A(_)}`:""}return A(S)},He=Array.from({length:7},(S,k)=>I.format(new Date(2023,0,1+(k+m)%7))),je=S=>!!o&&V(S)<V(o)||!!i&&V(S)>V(i)||!!n&&n(S),j=S=>{if(!r)return V(S);let k=V(S);return k.setHours(E.get(),O.get(),0,0),k},me=S=>{var P;if(je(S))return;if(t==="single"){p.set(j(S)),r||ht();return}let[k,_]=(P=p.get())!=null?P:[null,null];!k||k&&_?p.set([j(S),null]):V(S)<V(k)?(p.set([j(S),j(k)]),r||ht()):(p.set([k,j(S)]),r||ht())},ae=()=>{var S;if(r)if(t==="single"){let k=p.get();k&&p.set(j(k))}else{let[k,_]=(S=p.get())!=null?S:[null,null];p.set([k&&j(k),_&&j(_)])}},ne=(S,k)=>{var Ce;if(t!=="range")return!1;let[_,P]=(Ce=p.get(k))!=null?Ce:[null,null],z=P!=null?P:w.get(k);if(!_||!z)return!1;let D=V(_)<=V(z)?_:z,K=V(_)<=V(z)?z:_,N=V(S);return N>=V(D)&&N<=V(K)},$e=(S,k)=>{let _=p.get(k);if(t==="range"){let[P,z]=_!=null?_:[null,null];return Be(S,P)||Be(S,z)}return Be(S,_)},J=S=>{v.set(S.getFullYear()),x.set(S.getMonth())},F=S=>{let k=Nt(new Date(v.get(),x.get(),1),S);J(k)},q=S=>v.set(v.get()+S),W=()=>{setTimeout(()=>{var S;(S=T==null?void 0:T.querySelector(`[data-date="${Bt(C.get())}"]`))==null||S.focus()},0)},ut=mn(),{show:ln,hide:sn,anchorPartial:mt}=oe({open:!1,placement:d,content:ut});function ht(){sn()}mt.onClick=()=>{};let cn={type:"text",readonly:!0,value:S=>U(p.get(S)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:()=>{dt()},onFocus:()=>{dt()},onKeyDown:S=>{let k=S.key;(k==="ArrowDown"||k==="Enter")&&(S.preventDefault(),dt())}};function dt(){var k;let S=(k=un())!=null?k:new Date;C.set(V(S)),J(S),ln(),W()}function un(){var k;let S=p.get();return t==="range"?(k=S==null?void 0:S[0])!=null?k:null:S!=null?S:null}return R(mt,cn),mt;function mn(){let S=(D,K,N)=>({button:D,type:"button",ariaLabel:K,onClick:N,style:Oi()}),k={div:[S("\xAB","Previous year",()=>q(-1)),S("\u2039","Previous month",()=>F(-1)),{div:D=>L.format(new Date(v.get(D),x.get(D),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:D=>g(D)}},S("\u203A","Next month",()=>F(1)),S("\xBB","Next year",()=>q(1))],style:{display:"flex",alignItems:"center",gap:s(1),marginBottom:s(2)}},_={div:He.map((D,K)=>({div:D,style:{textAlign:"center",fontSize:N=>g(N,"decrease-1"),fontWeight:"600",color:N=>l(N,"shift-7"),paddingBlock:s(1)},_key:K})),role:"row",style:en()},P={div:D=>hn(D),role:"grid",ariaLabel:"Calendar",onKeyDown:gn,onMouseLeave:()=>t==="range"&&w.set(null),style:{display:"flex",flexDirection:"column",gap:s(.5)}},z=[k,_,P];return r&&z.push(fn()),z.push(pn()),{div:z,role:"dialog",ariaModal:"false",_onMount:D=>{T=D.domElement},style:{minWidth:s(70),padding:s(3),borderRadius:s(2),backgroundColor:D=>l(D,"base"),color:D=>l(D,"shift-10"),border:D=>`1px solid ${l(D,"shift-4")}`,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"}}}function hn(S){let k=new Date(v.get(S),x.get(S),1),_=x.get(S),P=Ht(k,m),z=[];for(let D=0;D<6;D++){let K=[];for(let N=0;N<7;N++){let Ce=Se(P,D*7+N);K.push(dn(Ce,_,S))}z.push({div:K,role:"row",style:en(),_key:D})}return z}function dn(S,k,_){let P=je(S),z=$e(S,_),D=ne(S,_),K=S.getMonth()!==k,N=Be(S,C.get(_)),Ce=Be(S,new Date);return{button:String(S.getDate()),type:"button",role:"gridcell",tabIndex:N?0:-1,ariaSelected:z,ariaDisabled:P,disabled:P,ariaLabel:ie.format(S),dataDate:Bt(S),onClick:()=>me(S),onMouseEnter:()=>t==="range"&&w.set(S),style:{appearance:"none",border:"none",cursor:P?"not-allowed":"pointer",aspectRatio:"1",borderRadius:s(1),fontSize:M=>g(M),fontFamily:"inherit",opacity:P?.35:K?.5:1,backgroundColor:M=>z?l(M,"shift-7",h.get(M)):D?l(M,"shift-2",h.get(M)):"transparent",color:M=>z?l(M,"shift-0",h.get(M)):l(M,"shift-9"),outline:Ce?M=>`1px solid ${l(M,"shift-6",h.get(M))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:M=>z?l(M,"shift-7",h.get(M)):l(M,"shift-3",h.get(M))},"&:focus-visible":{outline:M=>`2px solid ${l(M,"shift-6",h.get(M))}`}},_key:Bt(S)}}function fn(){let S=(k,_,P)=>({select:Array.from({length:k},(z,D)=>({option:String(D).padStart(2,"0"),value:String(D),selected:K=>_.get(K)===D,_key:D})),ariaLabel:P,onChange:z=>{_.set(Number(z.target.value)),ae()},style:Pi()});return{div:[S(24,E,"Hour"),{span:":",style:{fontWeight:"600"}},S(60,O,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:s(1),marginTop:s(3)}}}function pn(){let S=(k,_)=>({button:k,type:"button",onClick:_,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:P=>g(P,"decrease-1"),color:P=>l(P,"shift-8",h.get(P)),padding:s(1)}});return{div:[S("Today",()=>{let k=new Date;C.set(V(k)),J(k),W()}),S("Clear",()=>{p.set(t==="range"?[null,null]:null),w.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:s(2),paddingTop:s(2),borderTop:k=>`1px solid ${l(k,"shift-3")}`}}}function gn(S){let k=S,_=C.get(),P=null;switch(k.key){case"ArrowLeft":P=Se(_,-1);break;case"ArrowRight":P=Se(_,1);break;case"ArrowUp":P=Se(_,-7);break;case"ArrowDown":P=Se(_,7);break;case"Home":P=Ht(_,m);break;case"End":P=Se(Ht(_,m),6);break;case"PageUp":P=Nt(_,k.shiftKey?-12:-1);break;case"PageDown":P=Nt(_,k.shiftKey?12:1);break;case"Enter":case" ":k.preventDefault(),me(_);return;default:return}k.preventDefault(),C.set(P),J(P),W()}}function en(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:s(.5)}}function Oi(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>g(e),color:e=>l(e,"shift-8"),width:s(7),height:s(7),borderRadius:s(1),"&:hover":{backgroundColor:e=>l(e,"shift-3")}}}function Pi(){return{fontFamily:"inherit",fontSize:e=>g(e),padding:s(1),borderRadius:s(1),border:e=>`1px solid ${l(e,"shift-4")}`,backgroundColor:e=>l(e,"base"),color:e=>l(e,"shift-9")}}function $i(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(y(n)*1),height:n=>s(6+y(n)*2),paddingInline:n=>s(y(n)*1),"&::-webkit-file-upload-button":{marginTop:n=>s(y(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-11",t.get(n)),backgroundColor:n=>l(n,"shift-1",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-3","neutral")}}}}function Di(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>g(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(y(n)*1),minWidth:s(32),paddingInline:n=>s(y(n)*3),paddingBlock:n=>s(y(n)*1),"&::placeholder":{color:n=>l(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function Ri(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(y(n)*3),paddingBlock:n=>s(y(n)*1),borderRadius:n=>s(y(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>l(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","warning")}`}}}}function Ii(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-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:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function zi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(y(n)*3),paddingInlineEnd:n=>s(y(n)*1.5),paddingBlock:n=>s(y(n)*1),borderRadius:n=>s(y(n)*1),fontSize:n=>g(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")}}}}function Mi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`}}}function Li(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>g(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function Vi(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>g(n,"inherit"),backgroundColor:n=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>l(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function Ai(e={}){var r;let t=f((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function Ni(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Bi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(y(o)*2),paddingInline:o=>s(y(o)*3),borderRadius:o=>s(y(o)*2)}}}function Hi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.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:n=>l(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>l(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}function ji(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>g(n,"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:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Fi(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>g(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",t)}`,borderRadius:o=>s(y(o)*1),paddingBlock:o=>s(y(o)*1),paddingLeft:o=>s(y(o)*3),paddingRight:o=>s(y(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${$t(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${s(2)} center`,backgroundSize:`${s(2.5)} ${s(1.5)}`,"&:not([multiple])":{height:o=>s(6+y(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-8","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function Wi(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=ke(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>g(n),color:n=>l(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>l(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}var on={to:{transform:"rotate(360deg)"}},tn=ke(JSON.stringify(on));function Ki(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>g(o),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${l(o,"shift-4",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${tn} 0.7s linear infinite`,[`@keyframes ${tn}`]:on}}}function Ui(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=f((a=e.value)!=null?a:r?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(h=>({input:null,name:e.name,value:h||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_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(y(c)*2),paddingInline:c=>s(y(c)*2),fontSize:c=>g(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function qi(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",u=>{let m=c.get(u);return a.multiple?m.includes(o):m==o}),n.addEvent("click",()=>{let u=c.get();a.multiple?u.includes(o)?c.set(u.filter(m=>m!==o)):c.set(u.concat([o])):u!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>g(n,"inherit"),height:n=>s(6+y(n)*2),paddingInline:n=>s(y(n)*3),border:"none",outline:"none",color:n=>l(n,"shift-9",r),backgroundColor:n=>l(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>l(n,"shift-6",t),color:n=>l(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function Yi(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:m,anchorPartial:h}=oe({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&m()};R(e.content,d);let p={div:v=>{let x=a.get(v),C=Array.isArray(x)?x:[x];return t.filter(E=>C.includes(E.value)).map(E=>({span:E.label,$:[Ve({color:o,removable:n})],_key:E.value,_onRemove:O=>{let T=a.get(),L=(Array.isArray(T)?T:[T]).filter(I=>I!==E.value);n?a.set(L):a.set(L[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},b={_onInsert:v=>{v.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(p),onClick:()=>c.get()?m():u(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+y(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(y(v)*2),borderRadius:v=>s(y(v)*1),fontSize:v=>g(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return R(h,b),h}function Gi(e={}){var r;let t=f((r=e.accentColor)!=null?r:"primary","accentColor");return{dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>g(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>g(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Xi(e={}){var n,a;let{checked:t=!1}=e,r=f(t),o=f((n=e.color)!=null?n:"neutral","color"),i=f((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:c=>{c.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>g(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${l(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>l(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>l(c,"shift-9"),backgroundColor:c=>l(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>l(c,"increase-3",i.get(c)),outline:"none",color:c=>l(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ji(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}function Zi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>g(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Qi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function ea(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>g(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function ta(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>g(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(y(o)*3),paddingBlock:o=>s(y(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(y(o)*3),paddingBlock:o=>s(y(o)*1),color:o=>l(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-3",t.get(o))}`,fontSize:o=>g(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(y(o)*3),paddingBlock:o=>s(y(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>l(o,"shift-2")+"!important"}}}}function oa(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=f((n=e.accentColor)!=null?n:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:a=>{a.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:a=>{if(o){let c=a.domElement;c.style.overflow="hidden";let u=()=>{c.style.height="auto",c.style.height=c.scrollHeight+"px"};c.addEventListener("input",u),u()}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>s(y(a)*2),paddingBlock:a=>s(y(a)*1.5),border:"none",borderRadius:a=>s(y(a)*1.5),fontSize:a=>g(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",t.get(a))}`,backgroundColor:a=>l(a,"inherit",t.get(a)),"&::placeholder":{color:a=>l(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${s(.5)} solid ${l(a,"shift-5",r.get(a))}`},"&:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",r.get(a))}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`,backgroundColor:a=>l(a,"shift-2","neutral")}}}}function na(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function ra(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function ia(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function aa(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>s(6+y(u)*2),height:u=>s(6+y(u)*2),paddingInline:u=>s(y(u)*2),borderRadius:u=>s(y(u)*1),border:"none",cursor:"pointer",fontSize:u=>g(u,"inherit"),backgroundColor:"transparent",color:u=>l(u,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=Xt(We({},n),{backgroundColor:u=>l(u,"shift-6",o),color:u=>l(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-6",o)}});return{_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let m={div:h=>{let d=i.get(h),p=[];p.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let b of ia(d,t))if(b==="...")p.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(y(v)*2),color:v=>l(v,"shift-7",r)}});else{let v=b===d;p.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(b),style:v?a:n})}return p.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),p},style:{display:"flex",alignItems:"center",gap:s(1)}};u.children.insert(m)},style:{display:"inline-flex"}}}function la(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:s(2),fontSize:o=>g(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var nn={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},sa={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},jt=e=>e==="left"||e==="right";function ca(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=f(r),a=jt(o)?s(80):s(64),c=i!=null?i:a;return{_onInsert:u=>{u.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(u,m)=>{u.target===m.domElement&&n.set(!1)},onTransitionEnd:(u,m)=>{let h=m.domElement;n.get()||(h.close(),document.body.style.overflow="")},_onMount:u=>{let m=u.domElement,h=p=>{p?(m.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{m.style.transform="translate(0, 0)"})):m.style.transform=nn[o]};h(n.get());let d=n.addListener(h);u.addHook("Remove",()=>{d(),document.body.style.overflow=""})},style:{transform:nn[o],transition:"transform 0.25s ease",fontSize:u=>g(u,"inherit"),color:u=>l(u,"shift-10",t),backgroundColor:u=>l(u,"inherit",t),border:"none",padding:u=>s(y(u)*3),margin:sa[o],width:jt(o)?c:"100dvw",height:jt(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:u=>`0 ${s(4)} ${s(12)} ${l(u,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:u=>l(u,"shift-2","neutral"),opacity:.75}}}}function ua(e){var p;let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=f(t),a=f(r),{show:c,hide:u,anchorPartial:m}=oe({open:n,placement:a,content:e.content}),h={role:"dialog",dataTone:"shift-11",onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),_onInsert:b=>{let v=b.attributes.get("id");i=v||b.nodeId,!v&&b.attributes.set("id",i)}};return(p=e.content).$||(p.$=[]),e.content.$.push(h),R(m,{ariaHaspopup:"dialog",ariaExpanded:b=>n.get(b),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),onClick:()=>{o==="click"&&(n.get()?u():c())},onFocus:()=>c(),onBlur:(b,v)=>{let x=b.relatedTarget,C=v.getRoot().domElement,w=i?C.querySelector(`#${CSS.escape(i)}`):null;x&&(w!=null&&w.contains(x))||u()},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),m}function ma(e={}){let{position:t="top-center",color:r="neutral"}=e,o=f(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:u=>{let m=u.domElement.querySelector(`#domphy-toast-${t}`);return m||(m=u.children.insert(c).domElement),m},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:u=>s(y(u)*2),paddingInline:u=>s(y(u)*4),borderRadius:u=>s(y(u)*2),fontSize:u=>g(u,"inherit"),color:u=>l(u,"shift-9",r),backgroundColor:u=>l(u,"inherit",r),boxShadow:u=>`0 ${s(2)} ${s(9)} ${l(u,"shift-4","neutral")}`,opacity:u=>Number(o.get(u)),transform:u=>o.get(u)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(u,m)=>{let h=d=>{d.propertyName==="transform"&&(u.domElement.removeEventListener("transitionend",h),m())};u.domElement.addEventListener("transitionend",h),o.set(!1)}}}function ha(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=f(r),n=f(o),a=null,c={span:b=>n.get(b)},{show:u,hide:m,anchorPartial:h}=oe({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:b=>{let v=b.attributes.get("id");a=v||b.nodeId,!v&&b.attributes.set("id",a)},style:{paddingBlock:b=>s(y(b)*1),paddingInline:b=>s(y(b)*3),borderRadius:b=>s(y(b)*1),color:b=>l(b,"shift-9"),backgroundColor:b=>l(b),fontSize:b=>g(b,"inherit")},$:[At({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),R(h,{onMouseEnter:()=>u(),onMouseLeave:()=>m(),onFocus:()=>u(),onBlur:()=>m(),onKeyDown:b=>b.key==="Escape"&&m(),_onMount:b=>a&&b.attributes.set("ariaDescribedby",a)}),h}function rn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function da(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,a)=>{if(!(n instanceof B))return;let c=n.domElement;c&&o.set(rn(n,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,a)=>{if(!(n instanceof B))return;let c=n.domElement;if(!c)return;let u=rn(n,a),m=o.get(u);if(!m)return;let h=c.getBoundingClientRect(),d=m.left-h.left,p=m.top-h.top;if(Math.abs(d)<.5&&Math.abs(p)<.5)return;let b=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${d}px, ${p}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=b,c.style.transform=v,c.removeEventListener("transitionend",C)},C=w=>{w.propertyName==="transform"&&x()};c.addEventListener("transitionend",C),setTimeout(x,t+r+34)}),o.clear()}}}function fa(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:f(e.activeKey||0)}}};R(o,i)}}}function pa(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var m,h;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let a=(h=(m=i.parent)==null?void 0:m.children.items)!=null?h:[];a=a.filter(d=>d.type=="ElementNode"&&d.attributes.get("role")=="tab");let c=i.key!==null&&i.key!==void 0?i.key:a.findIndex(d=>d==i),u={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:d=>n.activeKey.get(d)==c,onClick:()=>n.activeKey.set(c),onKeyDown:d=>{var w,E,O,T;let p=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(p))return;d.preventDefault();let b=((E=(w=i.parent)==null?void 0:w.children.items)!=null?E:[]).filter($=>$.type==="ElementNode"&&$.attributes.get("role")==="tab"),v=b.findIndex($=>$===i),x=v;p==="ArrowRight"?x=(v+1)%b.length:p==="ArrowLeft"?x=(v-1+b.length)%b.length:p==="Home"?x=0:p==="End"&&(x=b.length-1);let C=b[x];n.activeKey.set((O=C.key)!=null?O:x),(T=C.domElement)==null||T.focus()}};i.merge(u)},style:{cursor:"pointer",fontSize:i=>g(i,"inherit"),height:i=>s(6+y(i)*2),paddingInline:i=>s(y(i)*4),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`}}}}function ga(){return{role:"tabpanel",style:{paddingBlock:t=>s(y(t)*2),paddingInline:t=>s(y(t)*2)},_onInsert:t=>{var a,c;let r=t.getContext("tabs");if(!r){console.warn('"tabPanel" patch must be used inside a "tabs"');return}let o=(c=(a=t.parent)==null?void 0:a.children.items)!=null?c:[];o=o.filter(u=>u.type=="ElementNode"&&u.attributes.get("role")=="tabpanel");let i=t.key!==null&&t.key!==void 0?t.key:o.findIndex(u=>u==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:u=>r.activeKey.get(u)!=i};t.merge(n)}}}function ya(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let a={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:r}}};R(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>s(y(i)*2),paddingInline:i=>s(y(i)*2),fontSize:i=>g(i,"inherit"),backgroundColor:i=>l(i,"inherit",t)}}}function ba(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var u,m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu");if(!n){console.warn('"menuItem" patch must be used inside a "menu"');return}let a=(m=(u=i.parent)==null?void 0:u.children.items)!=null?m:[];a=a.filter(h=>h.type=="ElementNode"&&h.attributes.get("role")=="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:a.findIndex(h=>h==i);n.selectable&&(i.attributes.set("ariaCurrent",h=>n.activeKey.get(h)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var h,d,p,b;let a=i.key;if(a==="Enter"||a===" "){i.preventDefault(),(h=n.domElement)==null||h.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((p=(d=n.parent)==null?void 0:d.children.items)!=null?p:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem"),u=c.findIndex(v=>v===n),m=u;a==="ArrowDown"?m=(u+1)%c.length:a==="ArrowUp"?m=(u-1+c.length)%c.length:a==="Home"?m=0:a==="End"&&(m=c.length-1),(b=c[m].domElement)==null||b.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>s(2),width:"100%",fontSize:i=>g(i,"inherit"),height:i=>s(6+y(i)*2),paddingInline:i=>s(y(i)*3),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>l(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>l(i,"shift-3",t),color:i=>l(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}var an=e=>!!e&&typeof e.get=="function"&&e._isState===!0,Pe=e=>{let t={},r=[];for(let o in e){let i=e[o];o==="x"?r.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?r.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?r.push(`scale(${i})`):o==="rotate"?r.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return r.length&&(t.transform=r.join(" ")),t};function va(e={}){var a,c,u,m;let{initial:t,animate:r,exit:o,transition:i={}}=e,n={duration:(a=i.duration)!=null?a:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(m=i.iterations)!=null?m:1,fill:"both"};return{_onMount:h=>{let d=h.domElement;if(!d||typeof d.animate!="function")return;let p=an(r)?r.get():r;if(p?d.animate(t?[Pe(t),Pe(p)]:[Pe(p)],n):t&&Object.assign(d.style,Pe(t)),an(r)){let b=r.addListener(v=>{d.animate([Pe(v)],n)});h.setMetadata("motionRelease",b)}},_onBeforeRemove:(h,d)=>{let p=h.domElement;if(!p||!o||typeof p.animate!="function")return d();p.animate([Pe(o)],n).finished.then(d,d)},_onRemove:h=>{let d=h.getMetadata("motionRelease");d==null||d()}}}return wn(Sa);})();
6
6
  //# sourceMappingURL=core-theme-ui.global.js.map