godown 3.11.1 → 3.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/godown.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license MIT
3
- * @version 3.11.1
3
+ * @version 3.11.2
4
4
  * Require Lit Core (import from `"lit"`)
5
5
  */
6
6
  import{noChange as t,nothing as e,html as o,svg as r,LitElement as s,unsafeCSS as a,css as l}from"lit";function h(t,e,o,r){var s,a=arguments.length,l=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,r);else for(var h=t.length-1;h>=0;h--)(s=t[h])&&(l=(a<3?s(l):a>3?s(e,o,l):s(e,o))||l);return a>3&&l&&Object.defineProperty(e,o,l),l}"function"==typeof SuppressedError&&SuppressedError;const d=t=>null==t,c=t=>"string"==typeof t,p=t=>null!==t&&"object"==typeof t,{isArray:u}=Array,f=(t,...e)=>{const o={};for(const r in t)e.includes(r)||(o[r]=t[r]);return o},v=t=>(t=>{var e;return(null===(e=t.match(/[A-Z][^A-Z_-\s]*|[^A-Z_-\s]+/g))||void 0===e?void 0:e.map((t=>t.toLowerCase())))||[]})(t).join("-");function*m(t){for(const e of u(t)?t:Object.entries(t))e&&(yield e)}const g=t=>p(t)&&"_$cssResult$"in t,y=t=>!d(t)&&!1!==t,$=t=>{let e="";for(const[o,r]of m(t))if(r){const t=p(r)&&!g(r)?_(r):r;y(t)&&(e+=o?`${o}{${t}}`:t)}return e},_=t=>{let e="";for(const[o,r]of m(t))o&&y(r)&&(e+=`${o}:${r};`);return e},w=(t,e)=>t?`var(${t})`:"";class StyleController{constructor(t,e){(this.host=t).addController(this),this.computeStyle=e}hostUpdated(){const t=this.host.shadowRoot?.adoptedStyleSheets;if(!t)return;void 0!==this.styleID&&t.splice(this.styleID,1);const e=this.computeStyle();this.styleID=e?t.push((t=>{if(c(t)){const e=new CSSStyleSheet;return e.replaceSync(t),e}return g(t)?t.styleSheet:t})(e))-1:void 0}}const x=(...t)=>e=>{const o=[];for(let t=Object.getPrototypeOf(e);t.styles;t=Object.getPrototypeOf(t))o.push(t.styles);e.styles=[...o,...t]},k=(t,e)=>o=>{t||=v(o.name),o.protoName=t;(({tagName:t,styles:e,autoDefine:o=!1,registry:r=customElements})=>s=>{s.elementTagName=t,e&&x(e)(s),o&&!r.get(t)&&r.define(t,s)})({tagName:o.godownConfig.tag(t),...e})(o)}
@@ -44,5 +44,5 @@ const H={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:G},W=(t=H,e,
44
44
  * @license
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
- */var o,r},et=6;let it=class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};const ot=(t,e)=>(t?t+(e?" "+e:""):e)||"",rt=(...t)=>t.reduce(((t,e)=>{if(!e)return t;if(u(e))return ot(t,rt(...e));if(p(e)){for(const o in e)e[o]&&(t=ot(t,o));return t}return ot(t,e)}),"");function st(t,e){(t=>d(t)||!1===t)(e)?this.removeAttribute(t):!0===e?this.setAttribute(t,""):c(e)||(t=>"number"==typeof t)(e)&&!Number.isNaN(e)?this.setAttribute(t,String(e)):this[t]=e}const nt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class AttrDirective extends it{render(t,e){}update(e,[o,r=st]){if(o&&e.type===et)for(const t in o)r.call(e.element,t,o[t]);return t}}),at=((t,e)=>o=>t({...e,...o}))(nt,{width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),lt=t=>o`<slot name="${t||e}"></slot>`,ht=(t,r)=>{if(!t)return e;const s=c(t)?t:$(t);return s?o`<style media="${e}">${s}</style>`:e},dt=t=>(e,...s)=>{const a=r(e,s),l=c(t)?t:t.join(" "),h=t=>o`<svg viewBox="${l}" ${at(t)}>${a}</svg>`;return h.body=a,h.viewBox=l,h};function*ct(t,e,o){for(let o=0;o<t;o++)yield e(o)}function pt(t,e=this){if(!e||!t)return[];const o=new Set;e instanceof Element&&e.shadowRoot&&pt(t,e.shadowRoot).forEach((t=>o.add(t))),e.querySelectorAll(t).forEach((t=>o.add(t)));for(const r of e.children)pt(t,r).forEach((t=>o.add(t)));return Array.from(o)}function ut(t,e=this){if(!e||!t)return null;let o;if(e instanceof Element&&e.shadowRoot&&(o=ut(t,e.shadowRoot),o))return o;if(o=e.querySelector(t),o)return o;for(const r of e.children)if(o=ut(t,r),o)return o;return null}class Events{constructor(){this.inner=new Map}add(t,e,o,r){if(!t||!o)return;const s=this.inner.get(e)||new Map,a=s.get(t)||new Set;return a.add(o),s.set(t,a),this.inner.set(e,s),t.addEventListener(e,o,r),o}remove(t,e,o,r){if(!t||!o)return;const s=this.inner.get(e);if(s){const r=s.get(t);r&&(r.delete(o),r.size||(s.delete(t),s.size||this.inner.delete(e)))}t.removeEventListener(e,o,r)}removeAll(){this.inner.forEach(((t,e)=>{t.forEach(((t,o)=>{t.forEach((t=>{o.removeEventListener(e,t)}))})),t.clear()})),this.inner.clear()}}class Observers{constructor(){this.inner=new Map}add(t,e,o,r){const[s,a]=((t,e,o)=>{let r,s;switch(t){case MutationObserver:case ResizeObserver:r=new t(e),s=t=>r.observe(t,o);break;case IntersectionObserver:r=new t(e,o),s=t=>r.observe(t);break;case PerformanceObserver:r=new t(e),s=()=>r.observe(o)}return[r,s]})(e,o,r);if(s)return this.inner.set(s,(this.inner.get(s)||new Set).add(t)),a(t),s}remove(t,e){t.disconnect();const o=this.inner.get(t);"unobserve"in t?(e?(t.unobserve(e),o?.delete(e)):(o?.forEach((e=>{t.unobserve(e)})),o?.clear()),o&&!o.size&&this.inner.delete(t)):o&&this.inner.delete(t)}removeAll(){this.inner.forEach(((t,e)=>{this.remove(e)}))}}class Ranger{constructor(t,e,o){this.max=Math.max(t,e),this.min=Math.min(t,e),this.diff=this.max-this.min,this.step=o}random(){return this.normalize(Math.random()*this.diff+this.min)}present(t){return this.normalize(t*this.diff)}normalize(t){return t=this.restrict(t),this.step?this.min+Math.round((t-this.min)/this.step)*this.step:t}restrict(t){return this.max<=t?this.max:this.min>=t?this.min:t}}const ft=(t,e,o)=>t.startsWith(e)&&t.endsWith(o);class RouteTree{constructor(){this.matchType=RouteTree.MatchTypes.strict,this.children=[]}insert(t,e,o=0){if(e||(e=RouteTree.split(t)),e.length===o)return void(this.pattern=t);const r=e[o];let s=this.findStrict(r);s||(s=new RouteTree,s.part=r,s.matchType=RouteTree.dynamic(r).matchType,this.children.push(s),this.sorted=!1),s.insert(t,e,o+1)}search(t,e=0){if(c(t)&&(t=RouteTree.split(t)),this.sorted||this.sort(),t.length===e||RouteTree.dynamic(this.part).matchType===RouteTree.MatchTypes.multi)return this.pattern?this:null;const o=t[e],r=this.filterWide(o);for(const o of r){const r=o.search(t,e+1);if(null!==r)return r}return null}findStrict(t){return this.children.find((e=>e.part===t))||null}filterWide(t){return this.children.filter((e=>e.part===t||e.matchType))}sort(){const{children:t}=this;if(t.length){t.sort(((t,e)=>t.matchType-e.matchType));for(const e of t)e.sort()}this.sorted=!0}static parseParams(t,e){const o=RouteTree.split(t),r=RouteTree.split(e),s={};for(let t=0;t<r.length;t++){const e=r[t],{key:a,matchType:l}=RouteTree.dynamic(e);if(l===RouteTree.MatchTypes.single)s[a]=o[t];else if(l===RouteTree.MatchTypes.multi){s[a]=o.slice(t).join("/");break}}return s}static dynamic(t){if(t){if(ft(t,"{","}")||ft(t,"[","]")){t=t.slice(1,-1);const e=RouteTree.dynamic(t);return e.matchType||=RouteTree.MatchTypes.single,e}if(t.startsWith(":"))return{key:t.slice(1),matchType:RouteTree.MatchTypes.single};if(t.startsWith("*"))return{key:t.slice(1),matchType:RouteTree.MatchTypes.multi};if(t.startsWith("..."))return{key:t.slice(3),matchType:RouteTree.MatchTypes.multi}}return{key:t,matchType:RouteTree.MatchTypes.strict}}static split(t){return t.split("/").filter((t=>t))}}RouteTree.MatchTypes={strict:0,single:1,multi:2};class Timeouts{constructor(){this.inner=new Set}add(t){if(void 0!==t)return t=+t,this.inner.has(t)&&clearTimeout(t),this.inner.add(t),t}remove(t){void 0!==t&&(t=+t,clearTimeout(t),this.inner.delete(t))}removeAll(){this.inner.forEach(clearTimeout),this.inner.clear()}}const vt=(t,{attribute:e})=>!0===e||void 0===e?String(t).toLowerCase():!1!==e&&"symbol"!=typeof t?e:void 0,mt=/^[\s\S]*{[\s\S]*}$/;class GodownElement extends s{static define(t=this.elementTagName,e){this.isDefined()||this.godownConfig.define(t,this,e)}static isDefined(){return!!this.getDefined()}static getDefined(){return this.godownConfig.get(this.elementTagName)}static finalize(){super.finalize(),this.elementAttributes=new Map;for(const[t,e]of this.elementProperties.entries()){const o=vt(t,e);o&&this.elementAttributes.set(o,t)}}get observedRecord(){const t={};for(const[e,o]of this.constructor.elementAttributes.entries())t[e]=this[o];return t}get _slot(){return this.shadowRoot?this.shadowRoot.querySelector("slot:not([name])"):null}get _slotAll(){return this.shadowRoot?[...this.shadowRoot.querySelectorAll("slot")]:[]}get _slottedAll(){return[...this.querySelectorAll("[slot]")]}get _slottedNames(){return this._slottedAll.map((t=>t.getAttribute("slot"))).filter((t=>t))}getBoundingClientRect(){let t;return this.contents&&(t=this.contentsRoot||this.shadowRoot?.firstElementChild)&&t!==this?t.getBoundingClientRect():super.getBoundingClientRect()}getClientRects(){let t;return this.contents&&(t=this.contentsRoot||this.shadowRoot?.firstElementChild)&&t!==this?t.getClientRects():super.getClientRects()}get stylex(){return this.__stylex.css}set stylex(t){t=t.trim(),mt.test(t)||(t=`:host{${t}}`),this.shadowRoot?(this.__stylex.index&&this.shadowRoot.adoptedStyleSheets.splice(this.__stylex.index,1),this.__stylex.css=t,this.__stylex.index=this.adoptStyles(t)):this.__stylex.lazy=t}constructor(t){super(),this.events=new Events,this.observers=new Observers,this.timeouts=new Timeouts,this.__stylex={},this.assign={...GodownElement.godownConfig?.assign||{},...t}}connectedCallback(){super.connectedCallback(),this.assign&&(Object.assign(this,this.assign),this.assign=null);const{lazy:t}=this.__stylex;t&&(this.adoptStyles(t),this.__stylex.lazy="")}disconnectedCallback(){this.events.removeAll(),this.observers.removeAll(),this.timeouts.removeAll()}mount(t){this.firstUpdated(t)}unmount(){this.disconnectedCallback()}remount(t){this.unmount(),this.connectedCallback(),this.mount(t)}deepQuerySelector(t){return ut.call(this,t)}deepQuerySelectorAll(t){return pt.call(this,t)}adoptStyles(...t){if(!this.shadowRoot||!t.length)return;const e=this.shadowRoot.adoptedStyleSheets,o=new CSSStyleSheet;return t.forEach((t=>o.insertRule(t.toString()))),e.push(o),e.length-1}dispatchCustomEvent(t,e,o){this.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0,...o}))}}GodownElement.godownConfig=new class GodownConfig{constructor(t){this.assign=null,this.prefix="godown",this.suffix="",this.components=new Map,this.registry=customElements,t&&Object.assign(this,t)}tag(t){return v(this.prefix+"-"+t+"-"+this.suffix)}define(t,e,o){this.registry.define(t,e,o),this.components.set(t,e)}get(t){return this.registry.get(t)}getName(t){const{getName:e}=this.registry;return e?e(t):[...this.components.entries()].find((([,e])=>e===t))?.[0]||null}whenDefined(t){return this.registry.whenDefined(t)}upgrade(t){this.registry.upgrade(t)}},h([Y({type:Boolean,reflect:!0})],GodownElement.prototype,"contents",void 0),h([Y({reflect:!0})],GodownElement.prototype,"stylex",null);class GlobalStyle extends GodownElement{}const gt=((t,e)=>((t,e)=>((t,e)=>{if(!t||!e)return t;let o=0;for(;o<t.length&&e(t.slice(o,o+1));)o+=1;return t.slice(o)})(((t,e)=>{if(!t||!e)return t;let o=t.length;for(;o>0&&e(t.slice(o-1,o));)o-=1;return t.slice(0,o)})(t,e),e))(t,(t=>t===e)))(GlobalStyle.godownConfig.prefix,"-");function yt(t,e=1){return function(t){return a(`--${t}`)}(gt+"-".repeat(e)+t)}const bt={background:yt("background",2),foreground:yt("foreground",2),backgroundClip:yt("background-clip",2),primaryBackground:yt("primary",2),primaryForeground:yt("primary-foreground",2),muted:yt("muted",2),active:yt("active",2),passive:yt("passive",2),input:yt("input",2),radius:yt("radius",2),ringWidth:yt("ring-width",2),ringColor:yt("ring-color",2)};GlobalStyle.styles=[a(((t,e,o)=>{const r=[...m(e)];return((t,{truecase:e,falsecase:o})=>{const r="@supports";let s="";return e&&(s+=`${r}(${t}){${e}}`),o&&(s+=`${r} not(${t}){${o}}`),s})("color:light-dark(#fff,#000)",{truecase:$([[t,_(r.map((([t,[e,o]])=>[t,`light-dark(${e},${o})`])))]]),falsecase:$([[t,_(r.map((([t,e])=>[t,e[o]])))]])})})(":host",[[bt.background,["hsl(0 0% 96%)","hsl(0 0% 4%)"]],[bt.foreground,["hsl(0 0% 4%)","hsl(0 0% 96%)"]],[bt.muted,["hsl(0 0% 90%)","hsl(0 0% 18%)"]]],1)),a($({":host":_([[bt.primaryBackground,w(bt.foreground)],[bt.primaryForeground,w(bt.background)],[bt.active,w(bt.primaryBackground)],[bt.passive,w(bt.muted)],[bt.backgroundClip,`linear-gradient(to bottom, ${w(bt.foreground)}, ${w(bt.muted)})`],[bt.ringColor,w(bt.passive)],[bt.ringWidth,".075em"]])})),l`button,dialog,input{border:0;outline:0}*{box-sizing:border-box;font-size:100%;font-style:normal;margin:0;padding:0}:host{border-style:none;box-sizing:border-box;outline-style:none}a{text-decoration:none}span{white-space:nowrap}svg{-webkit-user-select:none;user-select:none}:host([contents]){display:contents}[part=root]{height:100%;width:100%}:host([contents]) [part=root]{height:inherit;width:inherit}:where(:host([contents]) [part=root]){all:inherit;display:revert}`,l`:host{${bt.radius}:0.2em;border-radius:var(${bt.radius})}`];const $t=({width:t,color:e,inset:o})=>`outline-style:solid;outline-color:${e};outline-width:${t};${o?`outline-offset:calc(-1 * ${t});`:""}`,_t=({width:t,color:e,inset:o})=>`box-shadow:${o?"inset":""} 0 0 0 ${t} ${e};`,wt={outline:(t,e)=>$t({width:t,color:e,inset:!1}),"outline-inset":(t,e)=>$t({width:t,color:e,inset:!0}),"box-shadow":(t,e)=>_t({width:t,color:e,inset:!1}),shadow:(t,e)=>_t({width:t,color:e,inset:!1}),"box-shadow-inset":(t,e)=>_t({width:t,color:e,inset:!0}),"shadow-inset":(t,e)=>_t({width:t,color:e,inset:!0}),border:(t,e)=>(({width:t,color:e})=>`border-style:solid;border-color:${e};border-width:${t};border-style:solid;`)({width:t,color:e})};class RingBuilder{constructor({selector:t=":host",width:e=w(bt.ringWidth),color:o=w(bt.ringColor),type:r}={}){if(r&&r in wt){const s=wt[r](e,o);this.css=`${t}{${s}}`}else this.css=""}get styleSheet(){return a(this.css).styleSheet}}let xt=class Alert extends GlobalStyle{constructor(){super(),this.ringType="border",new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css))}render(){return o`<div part="root" ${nt(this.observedRecord)}> <div>${lt("prefix")}</div> <div part="content"> <strong part="title">${this.title||lt("title")}</strong> ${this.content||lt()} </div> <div>${lt("suffix")}</div> </div>`}static alert(t,e){const o=new this;return Object.assign(o,e),t.appendChild(o),o}};h([Y({attribute:"ring-type"})],xt.prototype,"ringType",void 0),h([Y()],xt.prototype,"title",void 0),h([Y()],xt.prototype,"content",void 0),xt=h([k("alert"),x(l`:host{background:var(${bt.background})}:host,:where(:host([contents]) [part=root]){display:block}[part=root]{align-items:center;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr;padding:.75em}[part=content],[part=root]{display:grid}`)],xt);var kt=xt;kt.define();let St=class Avatar extends GlobalStyle{constructor(){super(...arguments),this.name="",this.round=!1}render(){return o`<div part="root" ${nt(f(this.observedRecord,"src"))}> ${this._renderAvatar()} </div>`}_renderAvatar(){return this.src?o`<img part="image" src="${this.src}" alt="${this.name}" @error=${this._handleError}/>`:this.name?o`<span part="name">${this.formatName()}</span>`:lt()}formatName(){return this.name}_handleError(){this.src=void 0}};h([Y()],St.prototype,"src",void 0),h([Y()],St.prototype,"name",void 0),h([Y({type:Boolean})],St.prototype,"round",void 0),St=h([k("avatar"),x(l`:host{background:var(${bt.passive});height:2em;overflow:hidden;vertical-align:bottom;width:2em}:host,[part=root]{display:inline-flex}:host([contents]) [part=root]{display:inline-flex;height:inherit;width:inherit}:host([round]){border-radius:50%}[part=image]{height:100%;object-fit:cover;width:100%}[part=root]{align-items:center;border-radius:inherit;justify-content:center;position:relative}`)],St);var Ct=St;Ct.define();const Rt="button",Et=yt(Rt);let Tt=class Button extends GlobalStyle{constructor(){super(...arguments),this.plain=!1,this.disabled=!1,this.active=!1,this.round=!1}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${this.content||lt()} <span part="modal-root"></span> </div>`}focus(){this.disabled||(this.active=!0,super.focus())}blur(){this.active=!1,super.blur()}connectedCallback(){super.connectedCallback(),this.events.add(this,"click",this._handelClick,!0)}_handelClick(t){if(this.disabled)return t.stopPropagation(),void t.preventDefault();this.plain||this._handleModal(t)}_handleModal(t){const e=document.createElement("i"),{width:o,height:r}=this.getBoundingClientRect(),{x:s,y:a}=this._root.getBoundingClientRect(),l=2*Math.sqrt(r**2+o**2)+"px";e.style.height=l,e.style.width=l,e.style.left=t.x-s+"px",e.style.top=t.y-a+"px",e.style.animationName="kf",this._modalRoot.appendChild(e),e.addEventListener("animationend",(()=>e.remove()),{once:!0})}};h([Y({type:Boolean,reflect:!0})],Tt.prototype,"plain",void 0),h([Y({type:Boolean,reflect:!0})],Tt.prototype,"disabled",void 0),h([Y({type:Boolean,reflect:!0})],Tt.prototype,"active",void 0),h([Y({type:Boolean,reflect:!0})],Tt.prototype,"round",void 0),h([Y()],Tt.prototype,"content",void 0),h([tt("modal-root")],Tt.prototype,"_modalRoot",void 0),h([tt("root")],Tt.prototype,"_root",void 0),Tt=h([k(Rt),x(l`:host(:not([disabled]):active){transform:scale(var(${Et}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([plain]){${Et}--gradients:unset;${Et}--focus-scale:unset}`,l`:host{${Et}--modal-animation-duration:1.5s;${Et}--focus-scale:.97;${Et}--deg:45deg;background:var(${bt.primaryBackground});border-style:none;border-width:var(${bt.ringWidth});color:var(${bt.primaryForeground});cursor:pointer;display:block;overflow:hidden;text-align:center;width:-moz-fit-content;width:fit-content}[part=root]:not([contents]){height:100%;width:100%}[part=root]{padding:.25em .75em;position:relative;-webkit-user-select:none;user-select:none}i{animation-duration:var(${Et}--modal-animation-duration);background:var(${Et}--modal-background,currentColor);border-radius:50%;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transform-origin:0 0;visibility:visible;width:100%}@keyframes kf{0%{opacity:var(${Et}--modal-opacity,.1);transform:scale(0) translate(-50%,-50%)}80%{transform:scale(1) translate(-50%,-50%)}to{opacity:0}}`)],Tt);var At=Tt;let Mt=class Badge extends At{constructor(){super(...arguments),this.plain=!0,this.round=!0}};Mt=h([k("badge"),x(l`:host{font-size:.75em}[part=root]{padding:0 .5em}`)],Mt);var Pt=Mt;Pt.define();const zt="breath",Bt=yt(zt),Ot=/[\s,]+/;let It=class Breath extends GlobalStyle{render(){const t=this.getTexts();return o`<div part="root" ${nt(this.observedRecord)}> ${[t.map(this._renderText),ht(this._computeStyle(t.length))]} </div>`}_renderText(t){return o`<span class="rel"> <span class="nocolor">${t}</span> <span class="colorful">${t}</span> </span>`}getTexts(){return Array.isArray(this.content)?this.content:(this.content||this.textContent).split(Ot).filter((t=>t))}_computeStyle(t){const e=50/t,o=this.duration||1e3*(2*t+2);let r="";for(let e=1;e<=t;e++)r+=`.rel:nth-child(${e}) .colorful{animation-delay:${-o/t*(t-e+1)}ms;background:var(${Bt}--${e},var(${Bt}--${(e-1)%3+1}));}`;return`.colorful{animation-duration:${o}ms;}@keyframes colorfulN{0%,${3*e}%{opacity:0;}${e}%,${2*e}%{opacity:1;}}${r}`}};h([Y()],It.prototype,"content",void 0),h([Y({type:Number})],It.prototype,"duration",void 0),It=h([k(zt),x(l`:host{${Bt}--deg:60deg;${Bt}--1-1:#dd3c3c;${Bt}--1-2:#f5993d;${Bt}--2-1:#26d944;${Bt}--2-2:#29a3a3;${Bt}--3-1:#8c30e8;${Bt}--3-2:#0d80f2;${Bt}--1:linear-gradient(var(${Bt}--deg),var(${Bt}--1-1),var(${Bt}--1-2));${Bt}--2:linear-gradient(var(${Bt}--deg),var(${Bt}--2-1),var(${Bt}--2-2));${Bt}--3:linear-gradient(var(${Bt}--deg),var(${Bt}--3-1),var(${Bt}--3-2))}`,l`:host{align-items:center;direction:ltr;font-size:2em;margin:auto;width:-moz-fit-content;width:fit-content}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}::selection{background:none}.rel{font-size:inherit;font-weight:800;letter-spacing:-.05em;position:relative}`,l`.colorful,.nocolor{animation-iteration-count:infinite;-webkit-background-clip:text!important;background-clip:text!important;box-sizing:border-box;color:transparent;display:inline-block;padding:0 .05em}.colorful{animation-name:colorfulN;opacity:0}.nocolor{background:var(${bt.backgroundClip});position:absolute;top:0}`)],It);var Dt=It;Dt.define(),At.define();const Nt="card",Ut=yt(Nt);let jt=class Card extends GlobalStyle{constructor(){super(),this.ringType="border",this.footer=!1,this.header=!1,new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css))}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${[this.header?lt("header"):"",lt(),this.footer?lt("footer"):""]} </div>`}};h([Y({attribute:"ring-type"})],jt.prototype,"ringType",void 0),h([Y({type:Boolean})],jt.prototype,"footer",void 0),h([Y({type:Boolean})],jt.prototype,"header",void 0),jt=h([k(Nt),x(l`:host{${Ut}--padding:.75em;background:var(${bt.background});display:block;flex-shrink:0}slot{display:block;padding:var(${Ut}--padding)}[part=root]{border-radius:inherit}[name=footer]{padding-top:0}[name=header]{padding-bottom:0}`)],jt);var Vt=jt;Vt.define();const Lt=dt("0 0 256 256")`<path fill="currentColor" d="M165.66 202.34a8 8 0 0 1-11.32 11.32l-80-80a8 8 0 0 1 0-11.32l80-80a8 8 0 0 1 11.32 11.32L91.31 128Z">`,Gt=dt("0 0 256 256")`<path fill="currentColor" d="m181.66 133.66l-80 80a8 8 0 0 1-11.32-11.32L164.69 128L90.34 53.66a8 8 0 0 1 11.32-11.32l80 80a8 8 0 0 1 0 11.32">`;function Ft(t){return t.getBoundingClientRect().width}let qt=class Carousel extends GlobalStyle{constructor(){super(...arguments),this.index=0,this.autoChange=0}render(){return o`<div part="root" ${nt(this.observedRecord)}> <i part="prev" @click="${this.prev}"> ${Lt()} </i> <div part="move-root">${lt()}</div> <i part="next" @click="${this.next}"> ${Gt()} </i> </div>`}connectedCallback(){super.connectedCallback(),this.children.length&&(this.__cloneFirst?.remove(),this.__cloneLast?.remove(),this.__cloneLast=this.firstElementChild.cloneNode(!0),this.__cloneFirst=this.lastElementChild.cloneNode(!0),this.appendChild(this.__cloneLast),this.insertBefore(this.__cloneFirst,this.firstElementChild)),this.observers.add(this,ResizeObserver,(()=>{this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,!0)}))}async firstUpdated(){await this.updateComplete,this.show(this.index,!0)}attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),"index"===t&&this.isConnected&&this.show(this.index)}show(t,e){t=this.normalizeIndex(t),this.index=t,this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,e),this.dispatchCustomEvent("change",t),this.timeouts.remove(this.intervalID),this.autoChange>0&&(this.intervalID=this.timeouts.add(setInterval((()=>{this.next()}),this.autoChange)))}next(){this.index===this.childElementCount-3?(this._doTranslateX("0",!0),this.show(0)):this.show(this.index+1)}prev(){0===this.index?(this._doTranslateX(`-${this.childElementCount-1}00%`,!0),this.show(this.children.length-3)):this.show(this.index-1)}_doTranslateX(t,e){this._moveRoot.style.transform=`translateX(${t})`,this._moveRoot.style.transition=e?"none":""}_computeOffset(){let t=0;for(let e=0;e<=this.index;e++)t-=Ft(this.children[e]);return t+=(Ft(this)-Ft(this.children[this.index+1]))/2,t}normalizeIndex(t){return t<0?0:t>this.children.length-3?this.children.length-3:t}};h([Y({type:Number})],qt.prototype,"index",void 0),h([Y({type:Number})],qt.prototype,"autoChange",void 0),h([tt("move-root")],qt.prototype,"_moveRoot",void 0),qt=h([k("carousel"),x(l`:host{display:block;transition:.3s}[part=root]{direction:ltr;overflow:hidden}[part=move-root],[part=root]{display:flex;height:100%;position:relative;transition:inherit;width:100%}[part=next],[part=prev]{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;-webkit-user-select:none;user-select:none;width:1.5em;z-index:1}[part=prev]{left:0}[part=next]{right:0}slot::slotted(*){flex-shrink:0!important}`)],qt);var Ht=qt;Ht.define();const Wt="chip",Yt=yt(Wt);let Xt=class Chip extends GlobalStyle{constructor(){super(...arguments),this.position="top-right",this.value=0,this.dot=!1,this.max=99}formatValue(t){return t>this.max?this.max+"+":t+""}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${lt()} ${this.value||this.dot?o`<div part="chip">${this.dot?"":this.formatValue(this.value)}</div>`:""} </div>`}};h([Y()],Xt.prototype,"position",void 0),h([Y({type:Number})],Xt.prototype,"value",void 0),h([Y({type:Boolean})],Xt.prototype,"dot",void 0),h([Y({type:Number})],Xt.prototype,"max",void 0),Xt=h([k(Wt),x(l`:host{${Yt}--offset:0%;${Yt}--offset-x:var(${Yt}--offset);${Yt}--offset-y:var(${Yt}--offset)}:host,:host([contents]) [part=root]{display:inline-block}[part=root]{position:relative}[part=chip]{background:var(${bt.primaryBackground});border-radius:calc(infinity*1px);color:var(${bt.primaryForeground});font-size:75%;padding:0 .5em;position:absolute;transform:translate(-50%,-50%);-webkit-user-select:none;user-select:none}[part=chip]:empty{border-radius:50%;font-size:100%;height:.5em;padding:0;width:.5em}[position^=top] [part=chip]{top:calc(var(${Yt}--offset-y))}[position$=right] [part=chip]{left:calc(100% - var(${Yt}--offset-x))}[position^=bottom] [part=chip]{top:calc(100% - var(${Yt}--offset-y))}[position$=left] [part=chip]{left:calc(var(${Yt}--offset-x))}`)],Xt);var Zt=Xt;Zt.define();const Kt=dt("0 0 256 256")`<path fill="currentColor" d="m213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32">`;class SuperOpenable extends GlobalStyle{constructor(){super(...arguments),this.open=!1}toggle(t=!this.open){this.open=t}close(){this.open=!1}show(){this.open=!0}updated(t){void 0!==t.get("open")&&this.dispatchCustomEvent("change",this.open)}}h([Y({type:Boolean,reflect:!0})],SuperOpenable.prototype,"open",void 0);const Qt="details",Jt=yt(Qt);let te=class Details extends SuperOpenable{constructor(){super(...arguments),this.float=!1,this.fill=!1,this.summary=""}render(){return o`<dl part="root" ${nt(this.observedRecord)}> <dt part="title" @click="${()=>this.toggle()}"> <span part="summary">${this.summary||lt("summary")}</span> <span part="icon">${Kt()}</span> </dt> <dd part="details" @click=${this.fill?()=>this.toggle():null}> <div style="min-height: 0;">${lt()}</div> </dd> </dl>`}};h([Y({type:Boolean})],te.prototype,"float",void 0),h([Y({type:Boolean})],te.prototype,"fill",void 0),h([Y()],te.prototype,"summary",void 0),te=h([k(Qt),x(l`:host{${Jt}--icon-deg-open:0deg;${Jt}--icon-deg-close:90deg;display:block;transition:.3s}[part=root]{padding:.25em;position:relative}[part=title]{align-items:center;direction:ltr;grid-template-columns:auto auto;height:100%;justify-content:space-between}[part=details],[part=title]{display:grid;overflow:hidden;transition:inherit}[part=details]{grid-template-rows:0fr}:host([open]) [part=details]{grid-template-rows:1fr}[float] [part=details]{position:absolute;top:100%;width:100%}[part]{transition:inherit;transition-property:transform,grid-template-rows}[part=icon]{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;transform:rotate(var(${Jt}--icon-deg-close))}:host([open]) [part=icon]{transform:rotate(var(${Jt}--icon-deg-open))}`)],te);var ee=te;ee.define();const ie="dialog",oe=yt(ie),re=/[\s,]+/;let se=class Dialog extends SuperOpenable{constructor(){super(...arguments),this.key="Escape",this.__modalInvoke=!1}set modal(t){this.contents=t}get modal(){return this.contents}render(){return o`<dialog part="root" ${nt(this.observedRecord)}> ${lt()} </dialog>`}showModal(){this.modal=!0,this.__modalInvoke=!0,this.show()}attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),"open"===t&&(this.open?this.modal?this._dialog.showModal():this._dialog.show():this._dialog.close())}updated(t){t.has("open")&&(this.open?(this.__submitEvent=this.events.add(this,"submit",this._handelSubmit),this.key&&(this.__keydownEvent=this.events.add(document,"keydown",this._handleKeydown.bind(this)))):(this.events.remove(this,"submit",this.__submitEvent),this.events.remove(document,"keydown",this.__keydownEvent)))}_handleKeydown(t){const e=this.key.split(re);(e.includes(t.key)||e.includes(t.code))&&(t.preventDefault(),this.close())}_handelSubmit(t){"dialog"===t.target.method&&(t.preventDefault(),this.close())}close(){this.__modalInvoke&&(this.modal=!1,this.__modalInvoke=!1),this.open=!1}};h([Y({type:Boolean,reflect:!0})],se.prototype,"modal",null),h([Y()],se.prototype,"key",void 0),h([K("dialog")],se.prototype,"_dialog",void 0),se=h([k(ie),x(l`:host{${oe}--background-modal:#000;${oe}--opacity-modal:0.2;background:none;display:block;left:50%;margin:auto;position:fixed;top:50%;transform:translate(-50%,-50%);width:-moz-fit-content;width:fit-content}:host(:not([open])){visibility:hidden}:host([contents]) dialog{position:fixed}dialog{background:inherit;position:relative}::backdrop{background:var(${oe}--background-modal);opacity:var(${oe}--opacity-modal)}`)],se);var ne=se;ne.define();let ae=class Divider extends GlobalStyle{constructor(){super(...arguments),this.vertical=!1}render(){return o`<div part="root"></div>`}};h([Y({type:Boolean,reflect:!0})],ae.prototype,"vertical",void 0),ae=h([k("divider"),x(l`:host{background:currentColor;color:var(${bt.passive});display:block;height:.05em;width:100%}:host([vertical]){height:100%;width:.05em}`)],ae);var le=ae;le.define();let he=class Dragbox extends GlobalStyle{constructor(){super(...arguments),this.__drag=!1}get _offsetParent(){return this.offsetParent??document.body}render(){return o`<div part="root" ${nt(this.observedRecord)} @mousedown="${this._handleDragStart}"> ${lt()} </div>`}firstUpdated(){this.reset()}_handleDragStart(t){this.__x=t.x,this.__y=t.y;const e=this._offsetParent.getBoundingClientRect(),o=this.getBoundingClientRect();this.__t=o.top-e.top,this.__l=o.left-e.left,this.__drag=!0,this.__handleMouseMove=this.events.add(document,"mousemove",this._handleDrag.bind(this)),this.__handleMouseLeave=this.events.add(document,"mouseleave",this._handleDragEnd.bind(this)),this.__handleMouseUp=this.events.add(document,"mouseup",this._handleDragEnd.bind(this))}_handleDragEnd(){this.__drag=!1,this.events.remove(document,"mousemove",this.__handleMouseMove),this.events.remove(document,"mouseleave",this.__handleMouseLeave),this.events.remove(document,"mouseup",this.__handleMouseUp)}_handleDrag(t){if(!this.__drag)return;const{__x:e,__y:o,__l:r,__t:s,style:a}=this,{height:l,width:h}=this._offsetParent.getBoundingClientRect(),{width:d,height:c}=this.getBoundingClientRect(),p=t.x-(e-r),u=t.y-(o-s);a.left=p<0?"0":p<h-d?`${p}px`:h-d+"px",a.top=u<0?"0":u<l-c?`${u}px`:l-c+"px"}reset(){const{x:t,y:e,style:o,offsetWidth:r,offsetHeight:s,offsetLeft:a,offsetTop:l}=this,{height:h,width:d}=this._offsetParent.getBoundingClientRect();o.left=t||"0",o.top=e||"0",a>d-r&&(o.left=d-r+"px"),l>h-s&&(o.top=h-s+"px")}};h([Y()],he.prototype,"x",void 0),h([Y()],he.prototype,"y",void 0),he=h([k("dragbox"),x(l`:host{display:block;position:absolute}:host(:active){-webkit-user-select:none;user-select:none}`)],he);var de=he;de.define();let ce=class Flex extends GlobalStyle{constructor(){super(...arguments),this.vertical=!1}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${[lt(),ht($({":host":{gap:this.gap,"flex-flow":this.flexFlow,"flex-direction":this.vertical&&"column","align-items":this.items,"justify-content":this.content}}))]} </div>`}};h([Y({attribute:"flex-flow"})],ce.prototype,"flexFlow",void 0),h([Y()],ce.prototype,"gap",void 0),h([Y()],ce.prototype,"content",void 0),h([Y()],ce.prototype,"items",void 0),h([Y({type:Boolean})],ce.prototype,"vertical",void 0),ce=h([k("flex"),x(l`:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}`)],ce);var pe,ue=ce;ue.define();let fe=pe=class Form extends GlobalStyle{constructor(){super(...arguments),this.name="",this.nameValue=this.namevalue}get value(){return pe.buildValue(this._slot.assignedElements())}render(){return lt()}reset(){this.deepQuerySelectorAll("*").forEach((t=>{t.tagName!==this.tagName&&t.reset&&t.reset()}))}namevalue(){return[this.name,this.value]}static buildValue(t){const e={};for(const o of t)if("FORM"===o.tagName)Object.assign(e,Object.fromEntries(new FormData(o).entries()));else if(o.namevalue){const[t,r]=o.namevalue();t&&(e[t]=r)}else if(o.name&&void 0!==o.value)e[o.name]=o.value;else if(o.shadowRoot)for(const t of o.shadowRoot.querySelectorAll("slot"))Object.assign(e,this.buildValue(t.assignedElements()));return e}};h([Y()],fe.prototype,"name",void 0),fe=pe=h([k("form"),x(l`:host{display:block}`)],fe);var ve=fe;ve.define();const me=t=>{return e=t,Number.isNaN(+e)?t:`repeat(${t},1fr)`;var e};let ge=class Grid extends GlobalStyle{render(){return o`<div part="root" ${nt(this.observedRecord)}> ${[lt(),ht($({":host":{gap:this.gap,"grid-template-columns":me(this.columns),"grid-template-rows":me(this.rows),"place-content":this.content,"place-items":this.items}}))]} </div>`}};h([Y()],ge.prototype,"gap",void 0),h([Y()],ge.prototype,"columns",void 0),h([Y()],ge.prototype,"rows",void 0),h([Y()],ge.prototype,"content",void 0),h([Y()],ge.prototype,"items",void 0),ge=h([k("grid"),x(l`:host,:host([contents]) [part=root]{display:grid}[part=root]{display:contents}`)],ge);var ye,be=ge;be.define();let $e=ye=class Router extends GlobalStyle{constructor(){super(...arguments),this.__fieldRouteTree=new RouteTree,this.__slottedRouteTree=new RouteTree,this.__cacheRecord=new Map,this.component=null,this.pathname=location.pathname,this.default=lt(),this.type="united",this.cache=!1,this.handlePopstate=this.events.add(window,"popstate",(()=>{this.pathname=location.pathname}))}get params(){return this.path?RouteTree.parseParams(this.pathname,this.path):{}}set routes(t){this.__routes=t,this.collectFieldRoutes(t)}get routes(){return this.__routes}clear(){this.__cacheRecord.clear()}render(){let t;if(this.cache&&(t=this.__cacheRecord.get(this.pathname))&&(this.component=t.component,this.path=t.path,this.pathname=t.pathname),!t)switch(this.type){case"field":this.component=this.fieldComponent();break;case"slotted":this.component=this.slottedComponent();break;default:this.component=this.fieldComponent()??this.slottedComponent()}return this.component??this.default}connectedCallback(){super.connectedCallback(),ye.routerInstances.add(this),"field"!==this.type&&(this.observers.add(this,MutationObserver,this.collectSlottedRoutes,{attributes:!0,attributeFilter:["slot"],subtree:!0}),this.collectSlottedRoutes())}disconnectedCallback(){super.disconnectedCallback(),ye.routerInstances.delete(this)}useRouter(){return{pathname:this.pathname,params:this.params,path:this.path,component:this.component}}updated(t){if(t.has("pathname")||t.has("path")){const t=this.useRouter();!this.__cacheRecord.has(this.pathname)&&this.path&&this.__cacheRecord.set(this.pathname,t),this.dispatchCustomEvent("change",t)}}fieldComponent(t){if(t||=this.__fieldRouteTree.search(this.pathname)?.pattern,this.path=t,!t)return null;const e=this.routes.find((e=>e.path===t));return e?"render"in e?e.render?.(f(this.useRouter(),"component"))||null:e.component:null}slottedComponent(t){const e=this._slottedNames;return t||=this.__slottedRouteTree.search(this.pathname)?.pattern,this.path=t,t?(this.path=e.find((e=>e===t)),this.path?lt(this.path):null):null}collectSlottedRoutes(){this.__slottedRouteTree=new RouteTree,this.clear(),this._slottedNames.forEach((t=>{this.__slottedRouteTree.insert(t)}))}collectFieldRoutes(t){this.__fieldRouteTree=new RouteTree,this.clear(),t.forEach((({path:t})=>{this.__fieldRouteTree.insert(t)}))}static updateAll(){this.routerInstances.forEach((t=>{t.handlePopstate()}))}search(t){return this.__fieldRouteTree.search(t)||this.__slottedRouteTree.search(t)}};$e.routerInstances=new Set,h([X()],$e.prototype,"component",void 0),h([X()],$e.prototype,"path",void 0),h([Y()],$e.prototype,"pathname",void 0),h([X()],$e.prototype,"default",void 0),h([Y()],$e.prototype,"type",void 0),h([Y({type:Boolean})],$e.prototype,"cache",void 0),h([X()],$e.prototype,"routes",null),$e=ye=h([k("router"),x(l`:host{display:contents}`)],$e);var _e=$e;const we="auto";let xe=class Link extends GlobalStyle{constructor(){super(...arguments),this.type=we,this.suppress=!1,this.replace=!1,this.target="_self",this.state={},this.handleState=()=>{switch(this.type){case we:case"push":if(!this.replace){history.pushState(this.state,"",this.href);break}case"replace":history.replaceState(this.state,"",this.href)}}}get pathname(){return new URL(this.href,location.href).pathname}_handleClick(t){const{state:e,type:o,href:r,pathname:s,suppress:a}=this;if(!r)return;if(this.dispatchCustomEvent("navigate",{...this.observedRecord,pathname:s,state:e}),r.startsWith("#")||"normal"===o)return;this.handleState();const l=[..._e.routerInstances];a||o===we&&!l.some((t=>t.search(location.pathname)))||(t.preventDefault(),_e.routerInstances.forEach((t=>{t.handlePopstate()})))}render(){return o`<a part="root" ${nt(this.observedRecord)} href="${this.href||e}" target="${this.target}" @click=${this._handleClick}> ${lt()} </a>`}};h([Y()],xe.prototype,"type",void 0),h([Y({type:Boolean})],xe.prototype,"suppress",void 0),h([Y({type:Boolean})],xe.prototype,"replace",void 0),h([Y()],xe.prototype,"href",void 0),h([Y()],xe.prototype,"target",void 0),xe=h([k("link"),x(l`:host{color:currentColor;cursor:default;display:inline-block}:host([href]){cursor:pointer}a{color:currentColor;display:contents}`)],xe);var ke=xe;let Se=class Heading extends ke{constructor(){super(...arguments),this.as="h1",this.anchor="#",this.side="left"}render(){const t=this.href||(this.id?"#"+this.id:void 0);return o`<a part="root" href="${t||e}"> ${this.wrapHeading(lt(),t?o`<i part="${rt("anchor",this.side)}">${this.anchor}</i>`:"")} </a>`}wrapHeading(...t){switch(this.as){case"h2":return o`<h2>${t}</h2>`;case"h3":return o`<h3>${t}</h3>`;case"h4":return o`<h4>${t}</h4>`;case"h5":return o`<h5>${t}</h5>`;case"h6":return o`<h6>${t}</h6>`;default:return o`<h1>${t}</h1>`}}};h([Y()],Se.prototype,"as",void 0),h([Y()],Se.prototype,"anchor",void 0),h([Y()],Se.prototype,"side",void 0),Se=h([k("heading"),x(l`:host{display:block;text-align:start}[part~=anchor]{min-width:1.25em;position:absolute;right:100%;text-align:center}[part~=left][part~=anchor]{right:100%}[part~=right][part~=anchor]{left:100%}h1,h2,h3,h4,h5,h6{font-size:revert;position:relative;width:-moz-fit-content;width:fit-content}`)],Se);var Ce=Se;Ce.define();const Re=dt("0 0 256 256")`<path fill="currentColor" d="M53.92 34.62a8 8 0 1 0-11.84 10.76l19.24 21.17C25 88.84 9.38 123.2 8.69 124.76a8 8 0 0 0 0 6.5c.35.79 8.82 19.57 27.65 38.4C61.43 194.74 93.12 208 128 208a127.1 127.1 0 0 0 52.07-10.83l22 24.21a8 8 0 1 0 11.84-10.76Zm47.33 75.84l41.67 45.85a32 32 0 0 1-41.67-45.85M128 192c-30.78 0-57.67-11.19-79.93-33.25A133.2 133.2 0 0 1 25 128c4.69-8.79 19.66-33.39 47.35-49.38l18 19.75a48 48 0 0 0 63.66 70l14.73 16.2A112 112 0 0 1 128 192m6-95.43a8 8 0 0 1 3-15.72a48.16 48.16 0 0 1 38.77 42.64a8 8 0 0 1-7.22 8.71a6 6 0 0 1-.75 0a8 8 0 0 1-8-7.26A32.09 32.09 0 0 0 134 96.57m113.28 34.69c-.42.94-10.55 23.37-33.36 43.8a8 8 0 1 1-10.67-11.92a132.8 132.8 0 0 0 27.8-35.14a133.2 133.2 0 0 0-23.12-30.77C185.67 75.19 158.78 64 128 64a118.4 118.4 0 0 0-19.36 1.57A8 8 0 1 1 106 49.79A134 134 0 0 1 128 48c34.88 0 66.57 13.26 91.66 38.35c18.83 18.83 27.3 37.62 27.65 38.41a8 8 0 0 1 0 6.5Z">`,Ee=l`:host([disabled]){cursor:not-allowed;filter:brightness(.85)}input:disabled{cursor:inherit}input::-ms-clear,input::-ms-reveal{display:none}`;let Te=class SuperInput extends GlobalStyle{constructor(){super(...arguments),this.autofocus=!1,this.ringType="border",this.disabled=!1,this.compositing=!1,this.makeId=Math.random().toString(36).slice(1),this.nameValue=this.namevalue}get observedRecord(){return f(super.observedRecord,"default","value")}set defaultValue(t){this.default=t}get defaultValue(){return this.default}namevalue(){return[this.name,this.value]}reset(){this.value=this.default,this._input.value=this.default}_handleInput(t){t.stopPropagation(),this.compositing||(this.value=t.target.value?.trim(),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}_handleChange(t){this.dispatchCustomEvent("change",this.value)}connectedCallback(){super.connectedCallback(),this._connectedInit()}_connectedInit(){this.default??=this.value||"",this.value??=this.default}_compositionInit(){this._input&&(this.events.add(this._input,"compositionstart",(()=>this.compositing=!0)),this.events.add(this._input,"compositionend",(t=>{this.compositing=!1,this._handleInput(t)})))}_changeInputType(t){this._input&&(this._input.type=t)}focus(t){this._input?.focus(t)}firstUpdated(){this._compositionInit()}_renderPrefix(){return o`<i part="prefix">${lt("prefix")}</i>`}_renderSuffix(){return o`<i part="suffix">${lt("suffix")}</i>`}};h([Y()],Te.prototype,"autocomplete",void 0),h([Y({attribute:"ring-type"})],Te.prototype,"ringType",void 0),h([Y({type:Boolean,reflect:!0})],Te.prototype,"disabled",void 0),h([Y({reflect:!0})],Te.prototype,"type",void 0),h([Y({reflect:!0})],Te.prototype,"placeholder",void 0),h([Y({reflect:!0})],Te.prototype,"name",void 0),h([Y()],Te.prototype,"value",void 0),h([Y()],Te.prototype,"default",void 0),h([tt("input")],Te.prototype,"_input",void 0),Te=h([x(Ee)],Te);let Ae=class Input extends Te{constructor(){super(),this.type="text",this.variant="default",new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css+("outline"===this.variant?`:host{${bt.ringColor}:currentColor}`:"")))}render(){return o`<label part="root" ${nt(this.observedRecord)}> ${[this._renderPrefix(),o`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||e}" autocomplete="${this.autocomplete||e}" placeholder="${this.placeholder||e}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){const t="password";return this.type===t?o`<i part="suffix icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${Re()} </i>`:super._renderSuffix()}};h([Y()],Ae.prototype,"variant",void 0),h([tt("input")],Ae.prototype,"_input",void 0),Ae=h([k("input"),x(l`:host{display:block;${bt.input}-space:0.2em;${bt.input}-icon-color:grey}:host(:active),:host(:focus-within){${bt.ringColor}:currentColor;${bt.input}-icon-color:currentColor}[part~=root]{align-items:center;border-radius:inherit;display:flex;padding:.4em .5em;position:relative}[part=input]{background:none;color:currentColor;flex-grow:1;height:100%;width:100%}[part~=icon]{align-items:center;color:var(${bt.input}-icon-color);display:flex;justify-content:center}[part~=prefix],[part~=suffix]{display:flex;height:100%}[part~=suffix][part~=icon]{padding-inline-start:var(${bt.input}-space)}[part~=prefix][part~=icon]{padding-inline-end:var(${bt.input}-space)}`)],Ae);var Me=Ae;Me.define();let Pe=class Layout extends GlobalStyle{constructor(){super(...arguments),this.sticky=!1}render(){return o`<div part="root" ${nt(this.observedRecord)}> <header part="header">${lt("header")}</header> <main part="main">${lt()}</main> <footer part="footer">${lt("footer")}</footer> </div>`}};h([Y({type:Boolean})],Pe.prototype,"sticky",void 0),Pe=h([k("layout"),x(l`:host{flex-direction:column;grid-template-rows:auto 1fr auto;min-height:100%;width:100%}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}[part=main]{flex:1;width:100%}[part=footer],[part=header]{flex-shrink:0;width:100%}[sticky] header{position:sticky;top:0}`)],Pe);var ze=Pe;ze.define(),ke.define();let Be=class Progress extends GlobalStyle{constructor(){super(...arguments),this.max=1,this.min=0}render(){let t,e=20;if(!d(this.value)){const o=new Ranger(this.min,this.max);e=(+this.value-this.min)/o.diff*100,t="static"}return o`<div part="root" ${nt(this.observedRecord)} class="${t}"> <i part="value" style="width:${e}%;"></i> </div>`}};h([Y({type:Number})],Be.prototype,"max",void 0),h([Y({type:Number})],Be.prototype,"min",void 0),h([Y({type:Number})],Be.prototype,"value",void 0),Be=h([k("progress"),x(l`:host{background:var(${bt.passive});border-radius:.25em;color:var(${bt.active});height:.5em;width:100%}:host,[part=root]{display:block}[part=root]{border-radius:inherit;overflow:hidden;position:relative;z-index:1}[part=value]{animation:progress 1.8s ease-in-out infinite alternate;background:currentColor;border-radius:inherit;height:100%;left:0;position:absolute;top:0;transition:all .3s;z-index:2}@keyframes progress{0%{left:0}to{left:80%}}.static [part=value]{animation:none}`)],Be);var Oe=Be;Oe.define();const Ie="range",De=yt(Ie);let Ne=class Range extends Te{constructor(){super(...arguments),this.min=0,this.max=100,this.vertical=!1,this.__focusStack=[]}get range(){return Array.isArray(this.value)}get rangeValue(){return this.range?this.value:[this.value]}padValue(t,e=0){const{rangeValue:o}=this,r=t-o.length;return r>0?new Array(r).fill(e).concat(o):o}attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),"max"!==t&&"min"!==t&&"step"!==t||(this._ranger=new Ranger(this.min,this.max,this.step))}get observedRecord(){return f(super.observedRecord,"ring-type")}render(){const t=this.padValue(2),e=Math.min(...t),r=Math.max(...t),s=this._ranger.diff;return o`<div part="root" ${nt(this.observedRecord)} @mousedown="${this.disabled?null:this._handleMousedownRoot}" style="${_([["--from",(e-this.min)/s*100+"%"],["--to",(r-this.min)/s*100+"%"],...t.map(((t,e)=>[`--handle-${e}`,(t-this.min)/s*100+"%"]))])}"> <div part="track"></div> ${ct(this.rangeValue.length,(t=>this._renderHandle(t)))} </div>`}_renderHandle(t){const{disabled:e,range:r,rangeValue:s}=this,a=!r||r&&t===s.length-1&&1===s.length;return o`<i tabindex="0" part="${rt("handle",`handle-${t}`)}" @mousedown="${e?null:this.createMouseDown(t)}" style="${_({"z-index":this.__focusStack.indexOf(t)+1,"--handle":`var(--${a?"to":`handle-${t}`})`})}"></i>`}focusHandle(t){this.lastFocus=t;const e=this.__focusStack.indexOf(t);-1!==e&&this.__focusStack.splice(e,1),this.__focusStack.push(t);const o=this._handles.item(t);o?.focus(),this.__keydownEvent||(this.__keydownEvent=this.events.add(document,"keydown",this.createKeydownEvent(t)))}blurHandle(){this.lastFocus=void 0,this.__keydownEvent=this.events.remove(document,"keydown",this.__keydownEvent)}createKeydownEvent(t){return e=>{const{rangeValue:o,step:r}=this;o.length<2&&(t=0);const s=o[t];"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.createSetValue(t)(s-r)):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),this.createSetValue(t)(s+r))}}createMouseDown(t){return e=>{this.focusHandle(t),this.createMousedownListener(this.createSetValue(t))(e)}}createSetValue(t){return e=>{const o=this._ranger.normalize(e);let r=o;this.range&&(r=[...this.value],r[t]=o),this.value=r,this.dispatchCustomEvent("change",this.value)}}_computeValue({clientX:t,clientY:e}){const{top:o,left:r,height:s,width:a}=this._root.getBoundingClientRect();return this._ranger.present(this.vertical?(e-o)/s:(t-r)/a)}_handleMousedownRoot(t){const e=this._computeValue(t),o=this.range?this.rangeValue.reduce(((t,o,r)=>Math.abs(e-o)<Math.abs(e-this.rangeValue[t])?r:t),0):0,r=this.createSetValue(o);r(e),this.createMousedownListener(r)(t),this.focusHandle(o)}createMousedownListener(t){return e=>{e.preventDefault(),e.stopPropagation();const o=this.createMousemoveListener(t);this.events.add(document,"mousemove",o);const r=()=>{this.events.remove(document,"mousemove",o),this.events.remove(document,"mouseup",r)};this.events.add(document,"mouseup",r)}}createMousemoveListener(t){return e=>{const o=this._computeValue(e);o===this._ranger.restrict(o)&&t?.call(this,o)}}_connectedInit(){this._ranger=new Ranger(this.min,this.max,this.step);const t=this._ranger.diff;this.step||=t/100,d(this.value)&&(d(this.default)?this.value=Math.round(t/2/this.step)*this.step:this.value=this.default),this.default??=this.value}reset(){this.value=this.default}sort(){return this.value=this.toSorted()}toSorted(){return this.range?[...this.value].sort(((t,e)=>t-e)):this.value}};h([Y({type:Number})],Ne.prototype,"min",void 0),h([Y({type:Number})],Ne.prototype,"max",void 0),h([Y({type:Number})],Ne.prototype,"step",void 0),h([Y({type:Boolean,reflect:!0})],Ne.prototype,"vertical",void 0),h([Y({type:Array})],Ne.prototype,"value",void 0),h([Y({type:Array})],Ne.prototype,"default",void 0),h([tt("root")],Ne.prototype,"_root",void 0),h([J("[part=handle]")],Ne.prototype,"_handles",void 0),h([X()],Ne.prototype,"lastFocus",void 0),Ne=h([k(Ie),x(l`:host{${De}--track-width:.5em;${De}--handle-scale:1;${De}--track-background:var(${bt.active});background:var(${bt.passive});display:block;height:var(${De}--track-width);width:100%}:host([contents]) [part=root]{width:inherit}:host([vertical]){height:100%;width:-moz-fit-content;width:fit-content}[part=root]{position:relative;--from:0%;--to:50%}[part=root],[part=track]{border-radius:inherit;min-height:inherit}[part=track]{background:var(${De}--track-background);height:100%;justify-content:space-between;left:min(var(--from),var(--to));pointer-events:none;width:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)))}[part=track],[part~=handle]{display:flex;position:absolute}[part~=handle]{align-items:center;background:var(${bt.background});border:.1em solid;border-radius:50%;height:1em;justify-content:center;outline:0;transform:scale(var(${De}--handle-scale)) translate(-50%,-25%);transform-origin:0 25%;-webkit-user-select:none;user-select:none;width:1em}`,l`[vertical]{height:inherit;width:var(${De}--track-width)}[vertical] i{transform:translate(-25%,-50%)}[vertical] [part=track]{height:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)));left:0;top:min(var(--from),var(--to));width:100%}`,l`[part~=handle]{left:var(--handle);top:0}[vertical] [part~=handle]{left:0;top:var(--handle)}`)],Ne);var Ue=Ne;Ue.define();const je="rotate",Ve=yt(je);let Le=class Rotate extends GlobalStyle{render(){return o`<div part="root"> <div part="slot" @mousemove="${this._handleRotate}"> ${lt()} </div> <i @mouseleave="${this.reset}"></i> </div>`}reset(){this._root.style.removeProperty("transform"),this._root.style.removeProperty("transition")}_handleRotate(t){const{rotateX:e,rotateY:o}=this._computeOffset(t);this._root.style.setProperty("transform",`rotateX(${e}rad) rotateY(${o}rad)`),this._root.style.setProperty("transition","0s")}_computeOffset(t){const{left:e,top:o,width:r,height:s}=this._root.getBoundingClientRect(),{clientX:a,clientY:l}=t;return{rotateX:-(l-o-s/2)/s/2,rotateY:(a-e-r/2)/r/2}}};h([tt("root")],Le.prototype,"_root",void 0),Le=h([k(je),x(l`:host{display:block;transition:all .5s ease-in-out;width:-moz-fit-content;width:fit-content;${Ve}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{box-sizing:content-box;height:100%;margin:calc(var(${Ve}--offset)*-1);padding:var(${Ve}--offset);position:absolute;top:0;width:100%}[part=slot]{z-index:2}`)],Le);var Ge=Le;Ge.define(),_e.define();const Fe=a("[direction-inset-align]");l`[direction^=top] ${Fe}{top:0}[direction^=bottom] ${Fe}{bottom:0}[direction$=right] ${Fe}{right:0}[direction$=left] ${Fe}{left:0}`;const qe=a("[direction-outset-place]"),He=l`[direction^=top] ${qe}{bottom:100%}[direction^=bottom] ${qe}{top:100%}[direction$=right] ${qe}{left:100%}[direction$=left] ${qe}{right:100%}`;function We(t,e){return t&&e&&t.toLowerCase().includes(e.toLowerCase())}function Ye(t,e){if(t){const o="checked";e?t.setAttribute(o,""):t.removeAttribute(o)}}let Xe=class Select extends Me{constructor(){super(...arguments),this.multiple=!1,this.visible=!1,this.autoDirection="bottom",this.__store=[]}get observedRecord(){return{...super.observedRecord,direction:this.direction||this.autoDirection}}render(){return o`<label part="root" ${nt(this.observedRecord)}> ${[this._renderPrefix(),o`<input part="input" type="${this.type}" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||e}" autocomplete="${this.autocomplete||e}" placeholder="${this.placeholder||e}" @focus="${this._handleFocus}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix(),o`<label part="content" direction-outset-place> ${lt()} </label>`]} </label>`}_renderSuffix(){return o`<i part="suffix icon">${Kt()}</i>`}_handleFocus(){if(!this.direction){const{top:t,bottom:e}=this.getBoundingClientRect();window.innerHeight-e<this._content.clientHeight&&t>this._content.clientHeight?this.autoDirection="top":this.autoDirection="bottom"}this.visible=!0}firstUpdated(){this.events.add(this._content,"click",(t=>{t.preventDefault(),t.stopPropagation();const{target:e}=t,o=this.optionValue(e);if(o){const t=this.select(o,e.textContent);this.multiple||Ye(this.lastChecked,0),Ye(e,t),this.lastChecked=e}this._input.focus()})),this.events.add(document,"click",(t=>{t.stopPropagation();const e=t.composedPath()[0];e&&!this.shadowRoot.contains(e)&&this.blur()}))}_connectedInit(){if(!this.value){const t=[...this.querySelectorAll("[checked]")];(this.multiple?t:t.length?[this.lastChecked=t[0]]:[]).forEach((t=>{Ye(t,this.select(this.optionValue(t),t.textContent))})),this.default=this.value,this.defaultText=this.text,this.defaultChecked=t}this.text||(this.text="")}reset(){this.value=this.default,this.text=this.defaultText,this.querySelectorAll("[checked]").forEach((t=>Ye(t,0))),this.defaultChecked.forEach((t=>Ye(t,1)))}select(t,e){e||=t,e=e.trim();let o=0;if(this.multiple){const r=this.__store.findIndex((e=>e.value===t));r>-1?this.__store.splice(r,1):(this.__store.push({value:t,text:e}),o=1),this.value=this.__store.map((t=>t.value)),this.text=this.__store.map((t=>t.text)).join(", ")}else this.value===t?(this.value="",this.text=""):(this.value=t,this.text=e,o=1);return this.dispatchCustomEvent("select",this.value),this.filter(),o}filter(t){t=t?.trim(),[...this.children].forEach((e=>{this.filterCallback(e,!t||We(this.optionValue(e),t)||We(e.textContent,t),t)}))}filterCallback(t,e,o){t.style.display=e?"":"none"}_handleInput(t){if(t.stopPropagation(),this.compositing)return;const e=this._input.value;this.filter(this.multiple?function(t,e){const o=e.slice(0,t).lastIndexOf(",")+1||0,r=e.indexOf(",",t)||e.length;return e.slice(o,r)}(this._input.selectionStart,e):e),this.dispatchCustomEvent("input",this.value,{bubbles:!0})}focus(t){this._input.focus(t),this.visible=!0}blur(){this._input.blur(),this.visible=!1,super.blur()}optionValue(t){return t.value||t.getAttribute("value")||""}};h([Y()],Xe.prototype,"text",void 0),h([tt("content")],Xe.prototype,"_content",void 0),h([Y()],Xe.prototype,"direction",void 0),h([Y({type:Boolean})],Xe.prototype,"multiple",void 0),h([Y({type:Boolean})],Xe.prototype,"visible",void 0),h([X()],Xe.prototype,"autoDirection",void 0),Xe=h([k("select"),x(He,l`.outline,:host(:focus-within){${bt.input}-outline-color:currentColor}[part=input]{text-overflow:ellipsis}[part=content]{position:absolute;visibility:hidden;width:100%}[visible] [part=content]{visibility:visible}`)],Xe);var Ze=Xe;Ze.define();const Ke="skeleton",Qe=yt(Ke);let Je=class Skeleton extends GlobalStyle{constructor(){super(...arguments),this.loading=!0}render(){return this.loading?o`<div part="root">${lt("loading")}</div>`:lt()}};h([X()],Je.prototype,"loading",void 0),Je=h([k(Ke),x(l`:host{${Qe}--from:var(${bt.background});${Qe}--to:var(${bt.passive});${Qe}--deg:95deg;${Qe}--duration:2s;animation:_ var(${Qe}--duration) ease-in-out infinite none running;background-color:transparent;background-image:linear-gradient(var(${Qe}--deg),var(${Qe}--from) 36%,var(${Qe}--to) 50%,var(${Qe}--from) 64%);background-size:200% 100%;flex-shrink:0;height:2em;overflow:hidden;width:100%}@keyframes _{0%{background-position:150%}to{background-position:-50%}}[part=root]{display:contents}:host,:host([contents]) [part=root]{display:block}`)],Je);var ti=Je;ti.define();const ei="split",ii=yt(ei);let oi=class Split extends Te{constructor(){super(),this.len=6,this.index=-1,this.current=-1,this.currentValue=[],new StyleController(this,(()=>new RingBuilder({selector:"[part=input-box]",type:this.ringType}).css))}get observedRecord(){return f(super.observedRecord,"ring-type")}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${ct(this.len,(t=>o`<span part="input-box" ring-type="${this.ringType}" class="${rt({focus:this.current===t})}" @click="${this.disabled?null:()=>this.focusAt(t)}"> ${this.currentValue[t]} </span>`))} <input part="input" @blur=${this.blur} @input="${this._handleInput}" @change="${this._handleChange}" .value="${this.value.padStart(this.len," ")}"/> </div>`}connectedCallback(){super.connectedCallback(),this.reset()}_handleInput(t){t.stopPropagation(),this.compositing||(this.fillInput(t.data),this.value=this.currentValue.join(""),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}fillInput(t){if(null===t){if(null!==this.currentValue[this.current])this.currentValue[this.current]=null;else{this.currentValue[this.current-1]=null;const t=this.currentValue.findLastIndex((t=>null!==t));this.current=this.current-1<0?t<0?0:t:this.current-1}return}const e=t.length>1;if(this.currentValue[this.current]=t[0],this.current+1>=this.len?(this.current=this.currentValue.indexOf(null),-1===this.current&&this.blur()):this.current+=1,e){const e=t.slice(1);e&&this.fillInput(e)}}focus(){this.focusAt(this.current),super.focus()}focusAt(t){this.current=t,this._input.focus()}blur(){this._input.blur(),this.current=-1,super.blur()}reset(){this.current=-1,this.value=this.default,this.currentValue=this.value.split("").concat(Array(this.len-this.value.length).fill(null)),this.index>-1&&(this.current=this.index)}};h([Y({type:Number})],oi.prototype,"len",void 0),h([Y({type:Number})],oi.prototype,"index",void 0),h([X()],oi.prototype,"current",void 0),h([X()],oi.prototype,"currentValue",void 0),oi=h([k(ei),x(l`:host{border-radius:.1em;display:block;width:-moz-fit-content;width:fit-content;${ii}--size:2em;${ii}--gap:.25em}[part=root]{display:flex;gap:var(${ii}--gap);justify-content:space-between;position:relative}[part=input-box],[part=root]{border-radius:inherit;vertical-align:top}[part=input-box]{align-items:center;display:inline-flex;height:var(${ii}--size);justify-content:center;width:var(${ii}--size)}[part=input]{background:none;height:100%;opacity:0;position:absolute;width:100%;z-index:-1}.focus,[part=input-box]:active{${bt.ringColor}:var(${bt.active})}`)],oi);var ri=oi;ri.define();const si="switch",ni=yt(si);let ai=class Switch extends Te{constructor(){super(...arguments),this.default=!1,this.value=!1}set checked(t){this.value=t}get checked(){return this.value}get observedRecord(){return f(super.observedRecord,"ring-type")}render(){return o`<div part="root" ${nt(this.observedRecord)} class="round"> <input part="input" type="checkbox" ?disabled="${this.disabled}" ?checked="${this.value}" @change="${this._handleChange}"/> <span part="handle"></span> </div>`}reset(){this.value=this.default,this._input.checked=this.value}_connectedInit(){this.default?this.value=!0:this.value&&(this.value=!0,this.default=!0)}_handleChange(){const{checked:t}=this._input;this.value=t,this.dispatchCustomEvent("change",this.value)}};h([Y({type:Boolean})],ai.prototype,"default",void 0),h([Y({type:Boolean,attribute:"checked",reflect:!0})],ai.prototype,"value",void 0),ai=h([k(si),x(l`:host,:host([contents]) [part=root]{display:inline-block}:host{${ni}-width:3em;${ni}-height:calc(var(${ni}-width)/2);${ni}-handle-size:1.25em;${ni}-handle-space:calc(var(${ni}-width)/4 - var(${ni}-handle-size)/2);background:var(${bt.passive});border-radius:calc(var(${ni}-height)/2);height:var(${ni}-height);transition:.2s ease-in-out;transition-property:background,left;vertical-align:bottom;width:var(${ni}-width)}:host([checked]){background:var(${bt.active})}[part=root]{position:relative}[part=handle],[part=root]{align-items:center;display:flex;transition:inherit}[part=handle]{background:var(${bt.background});border-radius:100%;height:var(${ni}-handle-size);justify-content:center;left:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%) translateX(var(${ni}-handle-space));width:var(${ni}-handle-size)}:host([checked]) [part=handle]{left:50%}[part=input]{height:100%;opacity:0;width:100%}`)],ai);var li=ai;li.define();const hi="text",di=yt(hi);let ci=class Text extends GlobalStyle{constructor(){super(...arguments),this.underline="none",this.clip=!1}render(){return o`<span part="root" ${nt(this.observedRecord)} class="${rt(this.underline)}"> ${lt()} </span>`}};h([Y()],ci.prototype,"underline",void 0),h([Y({type:Boolean})],ci.prototype,"clip",void 0),ci=h([k(hi),x(l`:host{${di}--color:currentColor;${di}--color-hover:currentColor;${di}--color-active:currentColor;display:inline-block;overflow-wrap:break-word;text-overflow:ellipsis}[part=root]{color:var(${di}--color);display:inline-block;overflow:hidden;overflow-wrap:inherit;text-overflow:inherit;vertical-align:bottom;white-space:nowrap}[part=root]:hover{color:var(${di}--color-hover,var(${di}--color))}[part=root]:active{color:var(${di}--color-active,var(${di}--color))}.active:active,.always,.hover:hover{text-decoration:underline}.none{text-decoration:none}[clip]{background:var(${bt.backgroundClip});color:transparent;display:inline-block;-webkit-text-fill-color:transparent;background-clip:text;-webkit-background-clip:text}`)],ci);var pi=ci;pi.define();const ui="tabs",fi=yt(ui),vi="hover";let mi=class Tabs extends GlobalStyle{constructor(){super(),this.ringType="border",this.useSlot=!1,this.index=0,new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css))}render(){return o`<ul part="root" ${nt(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map(((t,e)=>t||this.useSlot?o`<li part="${rt("item",{selected:this.index===e})}" @mouseenter=${()=>{this.move(this._lastIndex,e),this._lastIndex=e}} @click=${()=>this.select(e)}> ${this.useSlot?lt(t):t} <div part="indicator"></div> </li>`:""))} </ul>`}connectedCallback(){super.connectedCallback(),this._lastIndex=this.index}_handleMouseLeave(){const t=this._items[this._lastIndex];t&&t.part.remove(vi),this._lastIndex=this.index}move(t,e){if(t===e)return;const{_items:o,_indicators:r}=this,s=o[e];if(!s)return;s.part.add(vi);const a=o[t];if(!a)return;a.part.remove(vi);const l=r[e],h=r[t];if(!l||!h)return;const d=h.getBoundingClientRect(),c=s.getBoundingClientRect(),p=d.x-c.x,u=d.y-c.y,f=d.width,{style:v}=l;v.transform=`translate3d(${p}px,${u}px,0)`,v.width=f+"px",v.transition=h.style.transition="none",l.getBoundingClientRect(),v.width=v.transform=v.transition=h.style.transition=""}select(t){const{index:e,tabs:o,_lastIndex:r,useSlot:s}=this;o&&e!==t&&t in o&&(this.dispatchCustomEvent("select",t),this.move(r,t),this._lastIndex=t,e in o&&(o[e]||s)&&(this.index=t))}};h([Y({attribute:"ring-type"})],mi.prototype,"ringType",void 0),h([Y({type:Boolean})],mi.prototype,"useSlot",void 0),h([Y({type:Array})],mi.prototype,"tabs",void 0),h([Y({type:Number})],mi.prototype,"index",void 0),h([J("[part~=item]")],mi.prototype,"_items",void 0),h([J("[part=indicator]")],mi.prototype,"_indicators",void 0),mi=h([k(ui),x(l`:host{${fi}--indicator-background:var(${bt.passive});${fi}--space:0.25em;border-radius:var(${bt.radius});cursor:default;display:flex;transition:.3s ease-in-out;width:-moz-fit-content;width:fit-content}[part=root]{border-radius:inherit;display:flex;flex-direction:inherit;gap:var(${fi}--space);overflow-x:clip;padding:.2em;position:relative;transition:inherit;transition-property:width,transform,opacity;z-index:1}[useslot] [part~=item]{padding:0}[part~=item]{display:block;padding:0 .25em;position:relative;white-space:nowrap}[part=indicator],[part~=item]{border-radius:inherit;transition:inherit;transition-property:inherit;width:100%}[part=indicator]{background:var(${fi}--indicator-background);height:100%;inset:0;opacity:0;position:absolute;z-index:-1}[part~=selected]{background:var(${fi}--indicator-background)}[part~=hover] [part=indicator],[part~=selected] [part=indicator]{opacity:1}`)],mi);var gi=mi;function yi(t,e=2){return t.toString().padStart(e,"0").split("")}gi.define();let bi=class Time extends GlobalStyle{constructor(){super(...arguments),this.escape="%",this.format="YYYY-MM-DD hh:mm:ss",this.time=new Date}render(){return o`<span part="root" ${nt(this.observedRecord)}> ${function(t,e=new Date,o="%"){var r;if(!t)return t;if(isNaN(e.getTime()))return;const s=`${o}${o}`,a=[];t=t.replace(new RegExp(`${o}([ZYMDhmsS${o}])`,"g"),((t,e)=>(a.push(e),s)));const l=e.getTimezoneOffset()/-60,h={Z:[l>=0?"+"+l.toString():l.toString()],Y:e.getFullYear().toString().split(""),M:yi(e.getMonth()+1),D:yi(e.getDate()),h:yi(e.getHours()),m:yi(e.getMinutes()),s:yi(e.getSeconds()),S:yi(e.getMilliseconds(),3)},d=[];for(const e of t.split("").reverse()){const t=null===(r=h[e])||void 0===r?void 0:r.pop();t?d.push(t):d.push(e)}return d.reverse().join("").replace(new RegExp(s,"g"),(()=>a.shift()))}(this.format,this.time,this.escape)} </span>`}updated(t){t.has("timeout")&&this.timeout&&(this.timeouts.remove(this.timeoutId),this.timeoutId=this.timeouts.add(setInterval((()=>{this.dispatchCustomEvent("time",this.time),this.time=new Date(this.time.getTime()+(this.gap||this.timeout))}),Math.abs(this.timeout))))}};h([Y()],bi.prototype,"escape",void 0),h([Y()],bi.prototype,"format",void 0),h([Y({type:Object})],bi.prototype,"time",void 0),h([Y({type:Number})],bi.prototype,"timeout",void 0),h([Y({type:Number})],bi.prototype,"gap",void 0),bi=h([k("time"),x(l`:host{text-align:center}`)],bi);var $i,_i=bi;_i.define();const wi="tooltip",xi=yt(wi);let ki=$i=class Tooltip extends SuperOpenable{constructor(){super(...arguments),this.direction="top",this.align="center",this.propagation=!1,this.type="hover"}render(){const t=$i.aligns[this.align]||"inherit",e="focus"===this.type;return o`<div part="root" ${nt(this.observedRecord)} tabindex="${e?0:-1}" @focus="${e?()=>this.open=!0:null}" @blur="${e?()=>this.open=!1:null}" @mouseenter="${e?null:()=>this.open=!0}" @mouseleave="${e?null:()=>this.open=!1}" style="justify-content:${t};align-items:${t}"> ${lt()} <div part="tip" direction-outset-place> ${this.tip?o`<span class="passive">${this.tip}</span>`:lt("tip")} </div> </div>`}};ki.aligns={start:"flex-start",end:"flex-end",center:"center","flex-start":"flex-start","flex-end":"flex-end"},h([Y()],ki.prototype,"tip",void 0),h([Y()],ki.prototype,"direction",void 0),h([Y()],ki.prototype,"align",void 0),h([Y({type:Boolean})],ki.prototype,"propagation",void 0),h([Y()],ki.prototype,"type",void 0),ki=$i=h([k(wi),x(He,l`:host{${xi}--tip-background:inherit;width:-moz-fit-content;width:fit-content}:host,[part=root]{display:inline-flex}[part=root]{border-radius:inherit;position:relative;transition:inherit}[part=tip]{height:-moz-fit-content;height:fit-content;position:absolute;transition:inherit;-webkit-user-select:none;user-select:none;visibility:hidden;width:-moz-fit-content;width:fit-content}:host([open]) [part=tip]{visibility:visible}.passive{background:var(${xi}--tip-background)}[propagation] [part=tip]{pointer-events:none}`)],ki);var Si=ki;Si.define();const Ci="typewriter",Ri=yt(Ci);let Ei=class Typewriter extends GlobalStyle{constructor(){super(...arguments),this.content="",this.ended=!1,this.max=100,this.min=50,this.delay=0,this.index=0,this.contentInternal=""}get len(){return this.content.length}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${lt()} ${this.contentInternal} <i part="cursor" ?hidden="${this.ended}"></i> </div>`}connectedCallback(){super.connectedCallback(),this._ranger=new Ranger(this.min,this.max)}firstUpdated(){this.content||=this._slot?.assignedNodes()[0]?.textContent.trim()||"",!this.ended&&this.len&&this.write()}updated(t){t.has("index")&&this.dispatchCustomEvent(this.index===this.len?"done":"write",this.contentInternal)}write(t=this.index){this.contentInternal=this.content.slice(0,t+1);const e=this.delay||this._ranger.random();this.timeoutID=this.timeouts.add(setTimeout((()=>{const e=t+1;e<=this.len&&(this.index=e,this.write())}),e))}stop(){clearTimeout(this.timeoutID)}end(){this.ended=!0}};h([Y()],Ei.prototype,"content",void 0),h([Y({type:Boolean})],Ei.prototype,"ended",void 0),h([Y({type:Number})],Ei.prototype,"max",void 0),h([Y({type:Number})],Ei.prototype,"min",void 0),h([Y({type:Number})],Ei.prototype,"delay",void 0),h([Y({type:Number})],Ei.prototype,"index",void 0),h([X()],Ei.prototype,"contentInternal",void 0),h([K("i")],Ei.prototype,"_i",void 0),Ei=h([k(Ci),x(l`:host{${Ri}--cursor-width:.05em}:host,:host([contents]) [part=root]{display:inline-block}i{animation:s 1.5s steps(1) infinite;border-right:var(${Ri}--cursor-width) solid;margin-left:.02em}@keyframes s{0%{border-color:currentColor}50%{border-color:transparent}}slot{display:none}`)],Ei);var Ti=Ei;Ti.define();export{kt as Alert,Ct as Avatar,Pt as Badge,Dt as Breath,At as Button,Vt as Card,Ht as Carousel,Zt as Chip,ee as Details,ne as Dialog,le as Divider,de as Dragbox,ue as Flex,ve as Form,be as Grid,Ce as Heading,Me as Input,ze as Layout,ke as Link,Oe as Progress,Ue as Range,Ge as Rotate,_e as Router,Ze as Select,ti as Skeleton,ri as Split,li as Switch,gi as Tabs,pi as Text,_i as Time,Si as Tooltip,Ti as Typewriter};
47
+ */var o,r},et=6;let it=class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};const ot=(t,e)=>(t?t+(e?" "+e:""):e)||"",rt=(...t)=>t.reduce(((t,e)=>{if(!e)return t;if(u(e))return ot(t,rt(...e));if(p(e)){for(const o in e)e[o]&&(t=ot(t,o));return t}return ot(t,e)}),"");function st(t,e){(t=>d(t)||!1===t)(e)?this.removeAttribute(t):!0===e?this.setAttribute(t,""):c(e)||(t=>"number"==typeof t)(e)&&!Number.isNaN(e)?this.setAttribute(t,String(e)):this[t]=e}const nt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class AttrDirective extends it{render(t,e){}update(e,[o,r=st]){if(o&&e.type===et)for(const t in o)r.call(e.element,t,o[t]);return t}}),at=((t,e)=>o=>t({...e,...o}))(nt,{width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),lt=t=>o`<slot name="${t||e}"></slot>`,ht=(t,r)=>{if(!t)return e;const s=c(t)?t:$(t);return s?o`<style media="${e}">${s}</style>`:e},dt=t=>(e,...s)=>{const a=r(e,s),l=c(t)?t:t.join(" "),h=t=>o`<svg viewBox="${l}" ${at(t)}>${a}</svg>`;return h.body=a,h.viewBox=l,h};function*ct(t,e,o){for(let o=0;o<t;o++)yield e(o)}function pt(t,e=this){if(!e||!t)return[];const o=new Set;e instanceof Element&&e.shadowRoot&&pt(t,e.shadowRoot).forEach((t=>o.add(t))),e.querySelectorAll(t).forEach((t=>o.add(t)));for(const r of e.children)pt(t,r).forEach((t=>o.add(t)));return Array.from(o)}function ut(t,e=this){if(!e||!t)return null;let o;if(e instanceof Element&&e.shadowRoot&&(o=ut(t,e.shadowRoot),o))return o;if(o=e.querySelector(t),o)return o;for(const r of e.children)if(o=ut(t,r),o)return o;return null}class Events{constructor(){this.inner=new Map}add(t,e,o,r){if(!t||!o)return;const s=this.inner.get(e)||new Map,a=s.get(t)||new Set;return a.add(o),s.set(t,a),this.inner.set(e,s),t.addEventListener(e,o,r),o}remove(t,e,o,r){if(!t||!o)return;const s=this.inner.get(e);if(s){const r=s.get(t);r&&(r.delete(o),r.size||(s.delete(t),s.size||this.inner.delete(e)))}t.removeEventListener(e,o,r)}removeAll(){this.inner.forEach(((t,e)=>{t.forEach(((t,o)=>{t.forEach((t=>{o.removeEventListener(e,t)}))})),t.clear()})),this.inner.clear()}}class Observers{constructor(){this.inner=new Map}add(t,e,o,r){const[s,a]=((t,e,o)=>{let r,s;switch(t){case MutationObserver:case ResizeObserver:r=new t(e),s=t=>r.observe(t,o);break;case IntersectionObserver:r=new t(e,o),s=t=>r.observe(t);break;case PerformanceObserver:r=new t(e),s=()=>r.observe(o)}return[r,s]})(e,o,r);if(s)return this.inner.set(s,(this.inner.get(s)||new Set).add(t)),a(t),s}remove(t,e){t.disconnect();const o=this.inner.get(t);"unobserve"in t?(e?(t.unobserve(e),o?.delete(e)):(o?.forEach((e=>{t.unobserve(e)})),o?.clear()),o&&!o.size&&this.inner.delete(t)):o&&this.inner.delete(t)}removeAll(){this.inner.forEach(((t,e)=>{this.remove(e)}))}}class Ranger{constructor(t,e,o){this.max=Math.max(t,e),this.min=Math.min(t,e),this.diff=this.max-this.min,this.step=o}random(){return this.normalize(Math.random()*this.diff+this.min)}present(t){return this.normalize(t*this.diff)}normalize(t){return t=this.restrict(t),this.step?this.min+Math.round((t-this.min)/this.step)*this.step:t}restrict(t){return this.max<=t?this.max:this.min>=t?this.min:t}}const ft=(t,e,o)=>t.startsWith(e)&&t.endsWith(o);class RouteTree{constructor(){this.matchType=RouteTree.MatchTypes.strict,this.children=[]}insert(t,e,o=0){if(e||(e=RouteTree.split(t)),e.length===o)return void(this.pattern=t);const r=e[o];let s=this.findStrict(r);s||(s=new RouteTree,s.part=r,s.matchType=RouteTree.dynamic(r).matchType,this.children.push(s),this.sorted=!1),s.insert(t,e,o+1)}search(t,e=0){if(c(t)&&(t=RouteTree.split(t)),this.sorted||this.sort(),t.length===e||RouteTree.dynamic(this.part).matchType===RouteTree.MatchTypes.multi)return this.pattern?this:null;const o=t[e],r=this.filterWide(o);for(const o of r){const r=o.search(t,e+1);if(null!==r)return r}return null}findStrict(t){return this.children.find((e=>e.part===t))||null}filterWide(t){return this.children.filter((e=>e.part===t||e.matchType))}sort(){const{children:t}=this;if(t.length){t.sort(((t,e)=>t.matchType-e.matchType));for(const e of t)e.sort()}this.sorted=!0}static parseParams(t,e){const o=RouteTree.split(t),r=RouteTree.split(e),s={};for(let t=0;t<r.length;t++){const e=r[t],{key:a,matchType:l}=RouteTree.dynamic(e);if(l===RouteTree.MatchTypes.single)s[a]=o[t];else if(l===RouteTree.MatchTypes.multi){s[a]=o.slice(t).join("/");break}}return s}static dynamic(t){if(t){if(ft(t,"{","}")||ft(t,"[","]")){t=t.slice(1,-1);const e=RouteTree.dynamic(t);return e.matchType||=RouteTree.MatchTypes.single,e}if(t.startsWith(":"))return{key:t.slice(1),matchType:RouteTree.MatchTypes.single};if(t.startsWith("*"))return{key:t.slice(1),matchType:RouteTree.MatchTypes.multi};if(t.startsWith("..."))return{key:t.slice(3),matchType:RouteTree.MatchTypes.multi}}return{key:t,matchType:RouteTree.MatchTypes.strict}}static split(t){return t.split("/").filter((t=>t))}}RouteTree.MatchTypes={strict:0,single:1,multi:2};class Timeouts{constructor(){this.inner=new Set}add(t){if(void 0!==t)return t=+t,this.inner.has(t)&&clearTimeout(t),this.inner.add(t),t}remove(t){void 0!==t&&(t=+t,clearTimeout(t),this.inner.delete(t))}removeAll(){this.inner.forEach(clearTimeout),this.inner.clear()}}const vt=(t,{attribute:e})=>!0===e||void 0===e?String(t).toLowerCase():!1!==e&&"symbol"!=typeof t?e:void 0,mt=/^[\s\S]*{[\s\S]*}$/;class GodownElement extends s{static define(t=this.elementTagName,e){this.isDefined()||this.godownConfig.define(t,this,e)}static isDefined(){return!!this.getDefined()}static getDefined(){return this.godownConfig.get(this.elementTagName)}static finalize(){super.finalize(),this.elementAttributes=new Map;for(const[t,e]of this.elementProperties.entries()){const o=vt(t,e);o&&this.elementAttributes.set(o,t)}}get observedRecord(){const t={};for(const[e,o]of this.constructor.elementAttributes.entries())t[e]=this[o];return t}get _slot(){return this.shadowRoot?this.shadowRoot.querySelector("slot:not([name])"):null}get _slotAll(){return this.shadowRoot?[...this.shadowRoot.querySelectorAll("slot")]:[]}get _slottedAll(){return[...this.querySelectorAll("[slot]")]}get _slottedNames(){return this._slottedAll.map((t=>t.getAttribute("slot"))).filter((t=>t))}getBoundingClientRect(){let t;return this.contents&&(t=this.contentsRoot||this.shadowRoot?.firstElementChild)&&t!==this?t.getBoundingClientRect():super.getBoundingClientRect()}getClientRects(){let t;return this.contents&&(t=this.contentsRoot||this.shadowRoot?.firstElementChild)&&t!==this?t.getClientRects():super.getClientRects()}get stylex(){return this.__stylex.css}set stylex(t){t=t.trim(),mt.test(t)||(t=`:host{${t}}`),this.shadowRoot?(this.__stylex.index&&this.shadowRoot.adoptedStyleSheets.splice(this.__stylex.index,1),this.__stylex.css=t,this.__stylex.index=this.adoptStyles(t)):this.__stylex.lazy=t}constructor(t){super(),this.events=new Events,this.observers=new Observers,this.timeouts=new Timeouts,this.__stylex={},this.assign={...GodownElement.godownConfig?.assign||{},...t}}connectedCallback(){super.connectedCallback(),this.assign&&(Object.assign(this,this.assign),this.assign=null);const{lazy:t}=this.__stylex;t&&(this.adoptStyles(t),this.__stylex.lazy="")}disconnectedCallback(){this.events.removeAll(),this.observers.removeAll(),this.timeouts.removeAll()}mount(t){this.firstUpdated(t)}unmount(){this.disconnectedCallback()}remount(t){this.unmount(),this.connectedCallback(),this.mount(t)}deepQuerySelector(t){return ut.call(this,t)}deepQuerySelectorAll(t){return pt.call(this,t)}adoptStyles(...t){if(!this.shadowRoot||!t.length)return;const e=this.shadowRoot.adoptedStyleSheets,o=new CSSStyleSheet;return t.forEach((t=>o.insertRule(t.toString()))),e.push(o),e.length-1}dispatchCustomEvent(t,e,o){this.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0,...o}))}}GodownElement.godownConfig=new class GodownConfig{constructor(t){this.assign=null,this.prefix="godown",this.suffix="",this.components=new Map,this.registry=customElements,t&&Object.assign(this,t)}tag(t){return v(this.prefix+"-"+t+"-"+this.suffix)}define(t,e,o){this.registry.define(t,e,o),this.components.set(t,e)}get(t){return this.registry.get(t)}getName(t){const{getName:e}=this.registry;return e?e(t):[...this.components.entries()].find((([,e])=>e===t))?.[0]||null}whenDefined(t){return this.registry.whenDefined(t)}upgrade(t){this.registry.upgrade(t)}},h([Y({type:Boolean,reflect:!0})],GodownElement.prototype,"contents",void 0),h([Y({reflect:!0})],GodownElement.prototype,"stylex",null);class GlobalStyle extends GodownElement{}const gt=((t,e)=>((t,e)=>((t,e)=>{if(!t||!e)return t;let o=0;for(;o<t.length&&e(t.slice(o,o+1));)o+=1;return t.slice(o)})(((t,e)=>{if(!t||!e)return t;let o=t.length;for(;o>0&&e(t.slice(o-1,o));)o-=1;return t.slice(0,o)})(t,e),e))(t,(t=>t===e)))(GlobalStyle.godownConfig.prefix,"-");function yt(t,e=1){return function(t){return a(`--${t}`)}(gt+"-".repeat(e)+t)}const bt={background:yt("background",2),foreground:yt("foreground",2),backgroundClip:yt("background-clip",2),primaryBackground:yt("primary",2),primaryForeground:yt("primary-foreground",2),muted:yt("muted",2),active:yt("active",2),passive:yt("passive",2),input:yt("input",2),radius:yt("radius",2),ringWidth:yt("ring-width",2),ringColor:yt("ring-color",2)};GlobalStyle.styles=[a(((t,e,o)=>{const r=[...m(e)];return((t,{truecase:e,falsecase:o})=>{const r="@supports";let s="";return e&&(s+=`${r}(${t}){${e}}`),o&&(s+=`${r} not (${t}){${o}}`),s})("color:light-dark(#fff,#000)",{truecase:$([[t,_(r.map((([t,[e,o]])=>[t,`light-dark(${e},${o})`])))]]),falsecase:$([[t,_(r.map((([t,e])=>[t,e[o]])))]])})})(":host",[[bt.background,["hsl(0 0% 96%)","hsl(0 0% 4%)"]],[bt.foreground,["hsl(0 0% 4%)","hsl(0 0% 96%)"]],[bt.muted,["hsl(0 0% 90%)","hsl(0 0% 18%)"]]],1)),a($({":host":_([[bt.primaryBackground,w(bt.foreground)],[bt.primaryForeground,w(bt.background)],[bt.active,w(bt.primaryBackground)],[bt.passive,w(bt.muted)],[bt.backgroundClip,`linear-gradient(to bottom, ${w(bt.foreground)}, ${w(bt.muted)})`],[bt.ringColor,w(bt.passive)],[bt.ringWidth,".075em"]])})),l`button,dialog,input{border:0;outline:0}*{box-sizing:border-box;font-size:100%;font-style:normal;margin:0;padding:0}:host{border-style:none;box-sizing:border-box;outline-style:none}a{text-decoration:none}span{white-space:nowrap}svg{-webkit-user-select:none;user-select:none}:host([contents]){display:contents}[part=root]{height:100%;width:100%}:host([contents]) [part=root]{height:inherit;width:inherit}:where(:host([contents]) [part=root]){all:inherit;display:revert}`,l`:host{${bt.radius}:0.2em;border-radius:var(${bt.radius})}`];const $t=({width:t,color:e,inset:o})=>`outline-style:solid;outline-color:${e};outline-width:${t};${o?`outline-offset:calc(-1 * ${t});`:""}`,_t=({width:t,color:e,inset:o})=>`box-shadow:${o?"inset":""} 0 0 0 ${t} ${e};`,wt={outline:(t,e)=>$t({width:t,color:e,inset:!1}),"outline-inset":(t,e)=>$t({width:t,color:e,inset:!0}),"box-shadow":(t,e)=>_t({width:t,color:e,inset:!1}),shadow:(t,e)=>_t({width:t,color:e,inset:!1}),"box-shadow-inset":(t,e)=>_t({width:t,color:e,inset:!0}),"shadow-inset":(t,e)=>_t({width:t,color:e,inset:!0}),border:(t,e)=>(({width:t,color:e})=>`border-style:solid;border-color:${e};border-width:${t};border-style:solid;`)({width:t,color:e})};class RingBuilder{constructor({selector:t=":host",width:e=w(bt.ringWidth),color:o=w(bt.ringColor),type:r}={}){if(r&&r in wt){const s=wt[r](e,o);this.css=`${t}{${s}}`}else this.css=""}get styleSheet(){return a(this.css).styleSheet}}let xt=class Alert extends GlobalStyle{constructor(){super(),this.ringType="border",new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css))}render(){return o`<div part="root" ${nt(this.observedRecord)}> <div>${lt("prefix")}</div> <div part="content"> <strong part="title">${this.title||lt("title")}</strong> ${this.content||lt()} </div> <div>${lt("suffix")}</div> </div>`}static alert(t,e){const o=new this;return Object.assign(o,e),t.appendChild(o),o}};h([Y({attribute:"ring-type"})],xt.prototype,"ringType",void 0),h([Y()],xt.prototype,"title",void 0),h([Y()],xt.prototype,"content",void 0),xt=h([k("alert"),x(l`:host{background:var(${bt.background})}:host,:where(:host([contents]) [part=root]){display:block}[part=root]{align-items:center;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr;padding:.75em}[part=content],[part=root]{display:grid}`)],xt);var kt=xt;kt.define();let St=class Avatar extends GlobalStyle{constructor(){super(...arguments),this.name="",this.round=!1}render(){return o`<div part="root" ${nt(f(this.observedRecord,"src"))}> ${this._renderAvatar()} </div>`}_renderAvatar(){return this.src?o`<img part="image" src="${this.src}" alt="${this.name}" @error=${this._handleError}/>`:this.name?o`<span part="name">${this.formatName()}</span>`:lt()}formatName(){return this.name}_handleError(){this.src=void 0}};h([Y()],St.prototype,"src",void 0),h([Y()],St.prototype,"name",void 0),h([Y({type:Boolean})],St.prototype,"round",void 0),St=h([k("avatar"),x(l`:host{background:var(${bt.passive});height:2em;overflow:hidden;vertical-align:bottom;width:2em}:host,[part=root]{display:inline-flex}:host([contents]) [part=root]{display:inline-flex;height:inherit;width:inherit}:host([round]){border-radius:50%}[part=image]{height:100%;object-fit:cover;width:100%}[part=root]{align-items:center;border-radius:inherit;justify-content:center;position:relative}`)],St);var Ct=St;Ct.define();const Rt="button",Et=yt(Rt);let Tt=class Button extends GlobalStyle{constructor(){super(...arguments),this.plain=!1,this.disabled=!1,this.active=!1,this.round=!1}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${this.content||lt()} <span part="modal-root"></span> </div>`}focus(){this.disabled||(this.active=!0,super.focus())}blur(){this.active=!1,super.blur()}connectedCallback(){super.connectedCallback(),this.events.add(this,"click",this._handelClick,!0)}_handelClick(t){if(this.disabled)return t.stopPropagation(),void t.preventDefault();this.plain||this._handleModal(t)}_handleModal(t){const e=document.createElement("i"),{width:o,height:r}=this.getBoundingClientRect(),{x:s,y:a}=this._root.getBoundingClientRect(),l=2*Math.sqrt(r**2+o**2)+"px";e.style.height=l,e.style.width=l,e.style.left=t.x-s+"px",e.style.top=t.y-a+"px",e.style.animationName="kf",this._modalRoot.appendChild(e),e.addEventListener("animationend",(()=>e.remove()),{once:!0})}};h([Y({type:Boolean,reflect:!0})],Tt.prototype,"plain",void 0),h([Y({type:Boolean,reflect:!0})],Tt.prototype,"disabled",void 0),h([Y({type:Boolean,reflect:!0})],Tt.prototype,"active",void 0),h([Y({type:Boolean,reflect:!0})],Tt.prototype,"round",void 0),h([Y()],Tt.prototype,"content",void 0),h([tt("modal-root")],Tt.prototype,"_modalRoot",void 0),h([tt("root")],Tt.prototype,"_root",void 0),Tt=h([k(Rt),x(l`:host(:not([disabled]):active){transform:scale(var(${Et}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([plain]){${Et}--gradients:unset;${Et}--focus-scale:unset}`,l`:host{${Et}--modal-animation-duration:1.5s;${Et}--focus-scale:.97;${Et}--deg:45deg;background:var(${bt.primaryBackground});border-style:none;border-width:var(${bt.ringWidth});color:var(${bt.primaryForeground});cursor:pointer;display:block;overflow:hidden;text-align:center;width:-moz-fit-content;width:fit-content}[part=root]:not([contents]){height:100%;width:100%}[part=root]{padding:.25em .75em;position:relative;-webkit-user-select:none;user-select:none}i{animation-duration:var(${Et}--modal-animation-duration);background:var(${Et}--modal-background,currentColor);border-radius:50%;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transform-origin:0 0;visibility:visible;width:100%}@keyframes kf{0%{opacity:var(${Et}--modal-opacity,.1);transform:scale(0) translate(-50%,-50%)}80%{transform:scale(1) translate(-50%,-50%)}to{opacity:0}}`)],Tt);var At=Tt;let Mt=class Badge extends At{constructor(){super(...arguments),this.plain=!0,this.round=!0}};Mt=h([k("badge"),x(l`:host{font-size:.75em}[part=root]{padding:0 .5em}`)],Mt);var Pt=Mt;Pt.define();const zt="breath",Bt=yt(zt),Ot=/[\s,]+/;let It=class Breath extends GlobalStyle{render(){const t=this.getTexts();return o`<div part="root" ${nt(this.observedRecord)}> ${[t.map(this._renderText),ht(this._computeStyle(t.length))]} </div>`}_renderText(t){return o`<span class="rel"> <span class="nocolor">${t}</span> <span class="colorful">${t}</span> </span>`}getTexts(){return Array.isArray(this.content)?this.content:(this.content||this.textContent).split(Ot).filter((t=>t))}_computeStyle(t){const e=50/t,o=this.duration||1e3*(2*t+2);let r="";for(let e=1;e<=t;e++)r+=`.rel:nth-child(${e}) .colorful{animation-delay:${-o/t*(t-e+1)}ms;background:var(${Bt}--${e},var(${Bt}--${(e-1)%3+1}));}`;return`.colorful{animation-duration:${o}ms;}@keyframes colorfulN{0%,${3*e}%{opacity:0;}${e}%,${2*e}%{opacity:1;}}${r}`}};h([Y()],It.prototype,"content",void 0),h([Y({type:Number})],It.prototype,"duration",void 0),It=h([k(zt),x(l`:host{${Bt}--deg:60deg;${Bt}--1-1:#dd3c3c;${Bt}--1-2:#f5993d;${Bt}--2-1:#26d944;${Bt}--2-2:#29a3a3;${Bt}--3-1:#8c30e8;${Bt}--3-2:#0d80f2;${Bt}--1:linear-gradient(var(${Bt}--deg),var(${Bt}--1-1),var(${Bt}--1-2));${Bt}--2:linear-gradient(var(${Bt}--deg),var(${Bt}--2-1),var(${Bt}--2-2));${Bt}--3:linear-gradient(var(${Bt}--deg),var(${Bt}--3-1),var(${Bt}--3-2))}`,l`:host{align-items:center;direction:ltr;font-size:2em;margin:auto;width:-moz-fit-content;width:fit-content}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}::selection{background:none}.rel{font-size:inherit;font-weight:800;letter-spacing:-.05em;position:relative}`,l`.colorful,.nocolor{animation-iteration-count:infinite;-webkit-background-clip:text!important;background-clip:text!important;box-sizing:border-box;color:transparent;display:inline-block;padding:0 .05em}.colorful{animation-name:colorfulN;opacity:0}.nocolor{background:var(${bt.backgroundClip});position:absolute;top:0}`)],It);var Dt=It;Dt.define(),At.define();const Nt="card",Ut=yt(Nt);let jt=class Card extends GlobalStyle{constructor(){super(),this.ringType="border",this.footer=!1,this.header=!1,new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css))}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${[this.header?lt("header"):"",lt(),this.footer?lt("footer"):""]} </div>`}};h([Y({attribute:"ring-type"})],jt.prototype,"ringType",void 0),h([Y({type:Boolean})],jt.prototype,"footer",void 0),h([Y({type:Boolean})],jt.prototype,"header",void 0),jt=h([k(Nt),x(l`:host{${Ut}--padding:.75em;background:var(${bt.background});display:block;flex-shrink:0}slot{display:block;padding:var(${Ut}--padding)}[part=root]{border-radius:inherit}[name=footer]{padding-top:0}[name=header]{padding-bottom:0}`)],jt);var Vt=jt;Vt.define();const Lt=dt("0 0 256 256")`<path fill="currentColor" d="M165.66 202.34a8 8 0 0 1-11.32 11.32l-80-80a8 8 0 0 1 0-11.32l80-80a8 8 0 0 1 11.32 11.32L91.31 128Z">`,Gt=dt("0 0 256 256")`<path fill="currentColor" d="m181.66 133.66l-80 80a8 8 0 0 1-11.32-11.32L164.69 128L90.34 53.66a8 8 0 0 1 11.32-11.32l80 80a8 8 0 0 1 0 11.32">`;function Ft(t){return t.getBoundingClientRect().width}let qt=class Carousel extends GlobalStyle{constructor(){super(...arguments),this.index=0,this.autoChange=0}render(){return o`<div part="root" ${nt(this.observedRecord)}> <i part="prev" @click="${this.prev}"> ${Lt()} </i> <div part="move-root">${lt()}</div> <i part="next" @click="${this.next}"> ${Gt()} </i> </div>`}connectedCallback(){super.connectedCallback(),this.children.length&&(this.__cloneFirst?.remove(),this.__cloneLast?.remove(),this.__cloneLast=this.firstElementChild.cloneNode(!0),this.__cloneFirst=this.lastElementChild.cloneNode(!0),this.appendChild(this.__cloneLast),this.insertBefore(this.__cloneFirst,this.firstElementChild)),this.observers.add(this,ResizeObserver,(()=>{this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,!0)}))}async firstUpdated(){await this.updateComplete,this.show(this.index,!0)}attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),"index"===t&&this.isConnected&&this.show(this.index)}show(t,e){t=this.normalizeIndex(t),this.index=t,this._offset=this._computeOffset(),this._doTranslateX(`${this._offset}px`,e),this.dispatchCustomEvent("change",t),this.timeouts.remove(this.intervalID),this.autoChange>0&&(this.intervalID=this.timeouts.add(setInterval((()=>{this.next()}),this.autoChange)))}next(){this.index===this.childElementCount-3?(this._doTranslateX("0",!0),this.show(0)):this.show(this.index+1)}prev(){0===this.index?(this._doTranslateX(`-${this.childElementCount-1}00%`,!0),this.show(this.children.length-3)):this.show(this.index-1)}_doTranslateX(t,e){this._moveRoot.style.transform=`translateX(${t})`,this._moveRoot.style.transition=e?"none":""}_computeOffset(){let t=0;for(let e=0;e<=this.index;e++)t-=Ft(this.children[e]);return t+=(Ft(this)-Ft(this.children[this.index+1]))/2,t}normalizeIndex(t){return t<0?0:t>this.children.length-3?this.children.length-3:t}};h([Y({type:Number})],qt.prototype,"index",void 0),h([Y({type:Number})],qt.prototype,"autoChange",void 0),h([tt("move-root")],qt.prototype,"_moveRoot",void 0),qt=h([k("carousel"),x(l`:host{display:block;transition:.3s}[part=root]{direction:ltr;overflow:hidden}[part=move-root],[part=root]{display:flex;height:100%;position:relative;transition:inherit;width:100%}[part=next],[part=prev]{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;-webkit-user-select:none;user-select:none;width:1.5em;z-index:1}[part=prev]{left:0}[part=next]{right:0}slot::slotted(*){flex-shrink:0!important}`)],qt);var Ht=qt;Ht.define();const Wt="chip",Yt=yt(Wt);let Xt=class Chip extends GlobalStyle{constructor(){super(...arguments),this.position="top-right",this.value=0,this.dot=!1,this.max=99}formatValue(t){return t>this.max?this.max+"+":t+""}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${lt()} ${this.value||this.dot?o`<div part="chip">${this.dot?"":this.formatValue(this.value)}</div>`:""} </div>`}};h([Y()],Xt.prototype,"position",void 0),h([Y({type:Number})],Xt.prototype,"value",void 0),h([Y({type:Boolean})],Xt.prototype,"dot",void 0),h([Y({type:Number})],Xt.prototype,"max",void 0),Xt=h([k(Wt),x(l`:host{${Yt}--offset:0%;${Yt}--offset-x:var(${Yt}--offset);${Yt}--offset-y:var(${Yt}--offset)}:host,:host([contents]) [part=root]{display:inline-block}[part=root]{position:relative}[part=chip]{background:var(${bt.primaryBackground});border-radius:calc(infinity*1px);color:var(${bt.primaryForeground});font-size:75%;padding:0 .5em;position:absolute;transform:translate(-50%,-50%);-webkit-user-select:none;user-select:none}[part=chip]:empty{border-radius:50%;font-size:100%;height:.5em;padding:0;width:.5em}[position^=top] [part=chip]{top:calc(var(${Yt}--offset-y))}[position$=right] [part=chip]{left:calc(100% - var(${Yt}--offset-x))}[position^=bottom] [part=chip]{top:calc(100% - var(${Yt}--offset-y))}[position$=left] [part=chip]{left:calc(var(${Yt}--offset-x))}`)],Xt);var Zt=Xt;Zt.define();const Kt=dt("0 0 256 256")`<path fill="currentColor" d="m213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32">`;class SuperOpenable extends GlobalStyle{constructor(){super(...arguments),this.open=!1}toggle(t=!this.open){this.open=t}close(){this.open=!1}show(){this.open=!0}updated(t){void 0!==t.get("open")&&this.dispatchCustomEvent("change",this.open)}}h([Y({type:Boolean,reflect:!0})],SuperOpenable.prototype,"open",void 0);const Qt="details",Jt=yt(Qt);let te=class Details extends SuperOpenable{constructor(){super(...arguments),this.float=!1,this.fill=!1,this.summary=""}render(){return o`<dl part="root" ${nt(this.observedRecord)}> <dt part="title" @click="${()=>this.toggle()}"> <span part="summary">${this.summary||lt("summary")}</span> <span part="icon">${Kt()}</span> </dt> <dd part="details" @click=${this.fill?()=>this.toggle():null}> <div style="min-height: 0;">${lt()}</div> </dd> </dl>`}};h([Y({type:Boolean})],te.prototype,"float",void 0),h([Y({type:Boolean})],te.prototype,"fill",void 0),h([Y()],te.prototype,"summary",void 0),te=h([k(Qt),x(l`:host{${Jt}--icon-deg-open:0deg;${Jt}--icon-deg-close:90deg;display:block;transition:.3s}[part=root]{padding:.25em;position:relative}[part=title]{align-items:center;direction:ltr;grid-template-columns:auto auto;height:100%;justify-content:space-between}[part=details],[part=title]{display:grid;overflow:hidden;transition:inherit}[part=details]{grid-template-rows:0fr}:host([open]) [part=details]{grid-template-rows:1fr}[float] [part=details]{position:absolute;top:100%;width:100%}[part]{transition:inherit;transition-property:transform,grid-template-rows}[part=icon]{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;transform:rotate(var(${Jt}--icon-deg-close))}:host([open]) [part=icon]{transform:rotate(var(${Jt}--icon-deg-open))}`)],te);var ee=te;ee.define();const ie="dialog",oe=yt(ie),re=/[\s,]+/;let se=class Dialog extends SuperOpenable{constructor(){super(...arguments),this.key="Escape",this.__modalInvoke=!1}set modal(t){this.contents=t}get modal(){return this.contents}render(){return o`<dialog part="root" ${nt(this.observedRecord)}> ${lt()} </dialog>`}showModal(){this.modal=!0,this.__modalInvoke=!0,this.show()}attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),"open"===t&&(this.open?this.modal?this._dialog.showModal():this._dialog.show():this._dialog.close())}updated(t){t.has("open")&&(this.open?(this.__submitEvent=this.events.add(this,"submit",this._handelSubmit),this.key&&(this.__keydownEvent=this.events.add(document,"keydown",this._handleKeydown.bind(this)))):(this.events.remove(this,"submit",this.__submitEvent),this.events.remove(document,"keydown",this.__keydownEvent)))}_handleKeydown(t){const e=this.key.split(re);(e.includes(t.key)||e.includes(t.code))&&(t.preventDefault(),this.close())}_handelSubmit(t){"dialog"===t.target.method&&(t.preventDefault(),this.close())}close(){this.__modalInvoke&&(this.modal=!1,this.__modalInvoke=!1),this.open=!1}};h([Y({type:Boolean,reflect:!0})],se.prototype,"modal",null),h([Y()],se.prototype,"key",void 0),h([K("dialog")],se.prototype,"_dialog",void 0),se=h([k(ie),x(l`:host{${oe}--background-modal:#000;${oe}--opacity-modal:0.2;background:none;display:block;left:50%;margin:auto;position:fixed;top:50%;transform:translate(-50%,-50%);width:-moz-fit-content;width:fit-content}:host(:not([open])){visibility:hidden}:host([contents]) dialog{position:fixed}dialog{background:inherit;position:relative}::backdrop{background:var(${oe}--background-modal);opacity:var(${oe}--opacity-modal)}`)],se);var ne=se;ne.define();let ae=class Divider extends GlobalStyle{constructor(){super(...arguments),this.vertical=!1}render(){return o`<div part="root"></div>`}};h([Y({type:Boolean,reflect:!0})],ae.prototype,"vertical",void 0),ae=h([k("divider"),x(l`:host{background:currentColor;color:var(${bt.passive});display:block;height:.05em;width:100%}:host([vertical]){height:100%;width:.05em}`)],ae);var le=ae;le.define();let he=class Dragbox extends GlobalStyle{constructor(){super(...arguments),this.__drag=!1}get _offsetParent(){return this.offsetParent??document.body}render(){return o`<div part="root" ${nt(this.observedRecord)} @mousedown="${this._handleDragStart}"> ${lt()} </div>`}firstUpdated(){this.reset()}_handleDragStart(t){this.__x=t.x,this.__y=t.y;const e=this._offsetParent.getBoundingClientRect(),o=this.getBoundingClientRect();this.__t=o.top-e.top,this.__l=o.left-e.left,this.__drag=!0,this.__handleMouseMove=this.events.add(document,"mousemove",this._handleDrag.bind(this)),this.__handleMouseLeave=this.events.add(document,"mouseleave",this._handleDragEnd.bind(this)),this.__handleMouseUp=this.events.add(document,"mouseup",this._handleDragEnd.bind(this))}_handleDragEnd(){this.__drag=!1,this.events.remove(document,"mousemove",this.__handleMouseMove),this.events.remove(document,"mouseleave",this.__handleMouseLeave),this.events.remove(document,"mouseup",this.__handleMouseUp)}_handleDrag(t){if(!this.__drag)return;const{__x:e,__y:o,__l:r,__t:s,style:a}=this,{height:l,width:h}=this._offsetParent.getBoundingClientRect(),{width:d,height:c}=this.getBoundingClientRect(),p=t.x-(e-r),u=t.y-(o-s);a.left=p<0?"0":p<h-d?`${p}px`:h-d+"px",a.top=u<0?"0":u<l-c?`${u}px`:l-c+"px"}reset(){const{x:t,y:e,style:o,offsetWidth:r,offsetHeight:s,offsetLeft:a,offsetTop:l}=this,{height:h,width:d}=this._offsetParent.getBoundingClientRect();o.left=t||"0",o.top=e||"0",a>d-r&&(o.left=d-r+"px"),l>h-s&&(o.top=h-s+"px")}};h([Y()],he.prototype,"x",void 0),h([Y()],he.prototype,"y",void 0),he=h([k("dragbox"),x(l`:host{display:block;position:absolute}:host(:active){-webkit-user-select:none;user-select:none}`)],he);var de=he;de.define();let ce=class Flex extends GlobalStyle{constructor(){super(...arguments),this.vertical=!1}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${[lt(),ht($({":host":{gap:this.gap,"flex-flow":this.flexFlow,"flex-direction":this.vertical&&"column","align-items":this.items,"justify-content":this.content}}))]} </div>`}};h([Y({attribute:"flex-flow"})],ce.prototype,"flexFlow",void 0),h([Y()],ce.prototype,"gap",void 0),h([Y()],ce.prototype,"content",void 0),h([Y()],ce.prototype,"items",void 0),h([Y({type:Boolean})],ce.prototype,"vertical",void 0),ce=h([k("flex"),x(l`:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}`)],ce);var pe,ue=ce;ue.define();let fe=pe=class Form extends GlobalStyle{constructor(){super(...arguments),this.name="",this.nameValue=this.namevalue}get value(){return pe.buildValue(this._slot.assignedElements())}render(){return lt()}reset(){this.deepQuerySelectorAll("*").forEach((t=>{t.tagName!==this.tagName&&t.reset&&t.reset()}))}namevalue(){return[this.name,this.value]}static buildValue(t){const e={};for(const o of t)if("FORM"===o.tagName)Object.assign(e,Object.fromEntries(new FormData(o).entries()));else if(o.namevalue){const[t,r]=o.namevalue();t&&(e[t]=r)}else if(o.name&&void 0!==o.value)e[o.name]=o.value;else if(o.shadowRoot)for(const t of o.shadowRoot.querySelectorAll("slot"))Object.assign(e,this.buildValue(t.assignedElements()));return e}};h([Y()],fe.prototype,"name",void 0),fe=pe=h([k("form"),x(l`:host{display:block}`)],fe);var ve=fe;ve.define();const me=t=>{return e=t,Number.isNaN(+e)?t:`repeat(${t},1fr)`;var e};let ge=class Grid extends GlobalStyle{render(){return o`<div part="root" ${nt(this.observedRecord)}> ${[lt(),ht($({":host":{gap:this.gap,"grid-template-columns":me(this.columns),"grid-template-rows":me(this.rows),"place-content":this.content,"place-items":this.items}}))]} </div>`}};h([Y()],ge.prototype,"gap",void 0),h([Y()],ge.prototype,"columns",void 0),h([Y()],ge.prototype,"rows",void 0),h([Y()],ge.prototype,"content",void 0),h([Y()],ge.prototype,"items",void 0),ge=h([k("grid"),x(l`:host,:host([contents]) [part=root]{display:grid}[part=root]{display:contents}`)],ge);var ye,be=ge;be.define();let $e=ye=class Router extends GlobalStyle{constructor(){super(...arguments),this.__fieldRouteTree=new RouteTree,this.__slottedRouteTree=new RouteTree,this.__cacheRecord=new Map,this.component=null,this.pathname=location.pathname,this.default=lt(),this.type="united",this.cache=!1,this.handlePopstate=this.events.add(window,"popstate",(()=>{this.pathname=location.pathname}))}get params(){return this.path?RouteTree.parseParams(this.pathname,this.path):{}}set routes(t){this.__routes=t,this.collectFieldRoutes(t)}get routes(){return this.__routes}clear(){this.__cacheRecord.clear()}render(){let t;if(this.cache&&(t=this.__cacheRecord.get(this.pathname))&&(this.component=t.component,this.path=t.path,this.pathname=t.pathname),!t)switch(this.type){case"field":this.component=this.fieldComponent();break;case"slotted":this.component=this.slottedComponent();break;default:this.component=this.fieldComponent()??this.slottedComponent()}return this.component??this.default}connectedCallback(){super.connectedCallback(),ye.routerInstances.add(this),"field"!==this.type&&(this.observers.add(this,MutationObserver,this.collectSlottedRoutes,{attributes:!0,attributeFilter:["slot"],subtree:!0}),this.collectSlottedRoutes())}disconnectedCallback(){super.disconnectedCallback(),ye.routerInstances.delete(this)}useRouter(){return{pathname:this.pathname,params:this.params,path:this.path,component:this.component}}updated(t){if(t.has("pathname")||t.has("path")){const t=this.useRouter();!this.__cacheRecord.has(this.pathname)&&this.path&&this.__cacheRecord.set(this.pathname,t),this.dispatchCustomEvent("change",t)}}fieldComponent(t){if(t||=this.__fieldRouteTree.search(this.pathname)?.pattern,this.path=t,!t)return null;const e=this.routes.find((e=>e.path===t));return e?"render"in e?e.render?.(f(this.useRouter(),"component"))||null:e.component:null}slottedComponent(t){const e=this._slottedNames;return t||=this.__slottedRouteTree.search(this.pathname)?.pattern,this.path=t,t?(this.path=e.find((e=>e===t)),this.path?lt(this.path):null):null}collectSlottedRoutes(){this.__slottedRouteTree=new RouteTree,this.clear(),this._slottedNames.forEach((t=>{this.__slottedRouteTree.insert(t)}))}collectFieldRoutes(t){this.__fieldRouteTree=new RouteTree,this.clear(),t.forEach((({path:t})=>{this.__fieldRouteTree.insert(t)}))}static updateAll(){this.routerInstances.forEach((t=>{t.handlePopstate()}))}search(t){return this.__fieldRouteTree.search(t)||this.__slottedRouteTree.search(t)}};$e.routerInstances=new Set,h([X()],$e.prototype,"component",void 0),h([X()],$e.prototype,"path",void 0),h([Y()],$e.prototype,"pathname",void 0),h([X()],$e.prototype,"default",void 0),h([Y()],$e.prototype,"type",void 0),h([Y({type:Boolean})],$e.prototype,"cache",void 0),h([X()],$e.prototype,"routes",null),$e=ye=h([k("router"),x(l`:host{display:contents}`)],$e);var _e=$e;const we="auto";let xe=class Link extends GlobalStyle{constructor(){super(...arguments),this.type=we,this.suppress=!1,this.replace=!1,this.target="_self",this.state={},this.handleState=()=>{switch(this.type){case we:case"push":if(!this.replace){history.pushState(this.state,"",this.href);break}case"replace":history.replaceState(this.state,"",this.href)}}}get pathname(){return new URL(this.href,location.href).pathname}_handleClick(t){const{state:e,type:o,href:r,pathname:s,suppress:a}=this;if(!r)return;if(this.dispatchCustomEvent("navigate",{...this.observedRecord,pathname:s,state:e}),r.startsWith("#")||"normal"===o)return;this.handleState();const l=[..._e.routerInstances];a||o===we&&!l.some((t=>t.search(location.pathname)))||(t.preventDefault(),_e.routerInstances.forEach((t=>{t.handlePopstate()})))}render(){return o`<a part="root" ${nt(this.observedRecord)} href="${this.href||e}" target="${this.target}" @click=${this._handleClick}> ${lt()} </a>`}};h([Y()],xe.prototype,"type",void 0),h([Y({type:Boolean})],xe.prototype,"suppress",void 0),h([Y({type:Boolean})],xe.prototype,"replace",void 0),h([Y()],xe.prototype,"href",void 0),h([Y()],xe.prototype,"target",void 0),xe=h([k("link"),x(l`:host{color:currentColor;cursor:default;display:inline-block}:host([href]){cursor:pointer}a{color:currentColor;display:contents}`)],xe);var ke=xe;let Se=class Heading extends ke{constructor(){super(...arguments),this.as="h1",this.anchor="#",this.side="left"}render(){const t=this.href||(this.id?"#"+this.id:void 0);return o`<a part="root" href="${t||e}"> ${this.wrapHeading(lt(),t?o`<i part="${rt("anchor",this.side)}">${this.anchor}</i>`:"")} </a>`}wrapHeading(...t){switch(this.as){case"h2":return o`<h2>${t}</h2>`;case"h3":return o`<h3>${t}</h3>`;case"h4":return o`<h4>${t}</h4>`;case"h5":return o`<h5>${t}</h5>`;case"h6":return o`<h6>${t}</h6>`;default:return o`<h1>${t}</h1>`}}};h([Y()],Se.prototype,"as",void 0),h([Y()],Se.prototype,"anchor",void 0),h([Y()],Se.prototype,"side",void 0),Se=h([k("heading"),x(l`:host{display:block;text-align:start}[part~=anchor]{min-width:1.25em;position:absolute;right:100%;text-align:center}[part~=left][part~=anchor]{right:100%}[part~=right][part~=anchor]{left:100%}h1,h2,h3,h4,h5,h6{font-size:revert;position:relative;width:-moz-fit-content;width:fit-content}`)],Se);var Ce=Se;Ce.define();const Re=dt("0 0 256 256")`<path fill="currentColor" d="M53.92 34.62a8 8 0 1 0-11.84 10.76l19.24 21.17C25 88.84 9.38 123.2 8.69 124.76a8 8 0 0 0 0 6.5c.35.79 8.82 19.57 27.65 38.4C61.43 194.74 93.12 208 128 208a127.1 127.1 0 0 0 52.07-10.83l22 24.21a8 8 0 1 0 11.84-10.76Zm47.33 75.84l41.67 45.85a32 32 0 0 1-41.67-45.85M128 192c-30.78 0-57.67-11.19-79.93-33.25A133.2 133.2 0 0 1 25 128c4.69-8.79 19.66-33.39 47.35-49.38l18 19.75a48 48 0 0 0 63.66 70l14.73 16.2A112 112 0 0 1 128 192m6-95.43a8 8 0 0 1 3-15.72a48.16 48.16 0 0 1 38.77 42.64a8 8 0 0 1-7.22 8.71a6 6 0 0 1-.75 0a8 8 0 0 1-8-7.26A32.09 32.09 0 0 0 134 96.57m113.28 34.69c-.42.94-10.55 23.37-33.36 43.8a8 8 0 1 1-10.67-11.92a132.8 132.8 0 0 0 27.8-35.14a133.2 133.2 0 0 0-23.12-30.77C185.67 75.19 158.78 64 128 64a118.4 118.4 0 0 0-19.36 1.57A8 8 0 1 1 106 49.79A134 134 0 0 1 128 48c34.88 0 66.57 13.26 91.66 38.35c18.83 18.83 27.3 37.62 27.65 38.41a8 8 0 0 1 0 6.5Z">`,Ee=l`:host([disabled]){cursor:not-allowed;filter:brightness(.85)}input:disabled{cursor:inherit}input::-ms-clear,input::-ms-reveal{display:none}`;let Te=class SuperInput extends GlobalStyle{constructor(){super(...arguments),this.autofocus=!1,this.ringType="border",this.disabled=!1,this.compositing=!1,this.makeId=Math.random().toString(36).slice(1),this.nameValue=this.namevalue}get observedRecord(){return f(super.observedRecord,"default","value")}set defaultValue(t){this.default=t}get defaultValue(){return this.default}namevalue(){return[this.name,this.value]}reset(){this.value=this.default,this._input.value=this.default}_handleInput(t){t.stopPropagation(),this.compositing||(this.value=t.target.value?.trim(),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}_handleChange(t){this.dispatchCustomEvent("change",this.value)}connectedCallback(){super.connectedCallback(),this._connectedInit()}_connectedInit(){this.default??=this.value||"",this.value??=this.default}_compositionInit(){this._input&&(this.events.add(this._input,"compositionstart",(()=>this.compositing=!0)),this.events.add(this._input,"compositionend",(t=>{this.compositing=!1,this._handleInput(t)})))}_changeInputType(t){this._input&&(this._input.type=t)}focus(t){this._input?.focus(t)}firstUpdated(){this._compositionInit()}_renderPrefix(){return o`<i part="prefix">${lt("prefix")}</i>`}_renderSuffix(){return o`<i part="suffix">${lt("suffix")}</i>`}};h([Y()],Te.prototype,"autocomplete",void 0),h([Y({attribute:"ring-type"})],Te.prototype,"ringType",void 0),h([Y({type:Boolean,reflect:!0})],Te.prototype,"disabled",void 0),h([Y({reflect:!0})],Te.prototype,"type",void 0),h([Y({reflect:!0})],Te.prototype,"placeholder",void 0),h([Y({reflect:!0})],Te.prototype,"name",void 0),h([Y()],Te.prototype,"value",void 0),h([Y()],Te.prototype,"default",void 0),h([tt("input")],Te.prototype,"_input",void 0),Te=h([x(Ee)],Te);let Ae=class Input extends Te{constructor(){super(),this.type="text",this.variant="default",new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css+("outline"===this.variant?`:host{${bt.ringColor}:currentColor}`:"")))}render(){return o`<label part="root" ${nt(this.observedRecord)}> ${[this._renderPrefix(),o`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||e}" autocomplete="${this.autocomplete||e}" placeholder="${this.placeholder||e}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){const t="password";return this.type===t?o`<i part="suffix icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${Re()} </i>`:super._renderSuffix()}};h([Y()],Ae.prototype,"variant",void 0),h([tt("input")],Ae.prototype,"_input",void 0),Ae=h([k("input"),x(l`:host{display:block;${bt.input}-space:0.2em;${bt.input}-icon-color:grey}:host(:active),:host(:focus-within){${bt.ringColor}:currentColor;${bt.input}-icon-color:currentColor}[part~=root]{align-items:center;border-radius:inherit;display:flex;padding:.4em .5em;position:relative}[part=input]{background:none;color:currentColor;flex-grow:1;height:100%;width:100%}[part~=icon]{align-items:center;color:var(${bt.input}-icon-color);display:flex;justify-content:center}[part~=prefix],[part~=suffix]{display:flex;height:100%}[part~=suffix][part~=icon]{padding-inline-start:var(${bt.input}-space)}[part~=prefix][part~=icon]{padding-inline-end:var(${bt.input}-space)}`)],Ae);var Me=Ae;Me.define();let Pe=class Layout extends GlobalStyle{constructor(){super(...arguments),this.sticky=!1}render(){return o`<div part="root" ${nt(this.observedRecord)}> <header part="header">${lt("header")}</header> <main part="main">${lt()}</main> <footer part="footer">${lt("footer")}</footer> </div>`}};h([Y({type:Boolean})],Pe.prototype,"sticky",void 0),Pe=h([k("layout"),x(l`:host{flex-direction:column;grid-template-rows:auto 1fr auto;min-height:100%;width:100%}:host,:host([contents]) [part=root]{display:flex}[part=root]{display:contents}[part=main]{flex:1;width:100%}[part=footer],[part=header]{flex-shrink:0;width:100%}[sticky] header{position:sticky;top:0}`)],Pe);var ze=Pe;ze.define(),ke.define();let Be=class Progress extends GlobalStyle{constructor(){super(...arguments),this.max=1,this.min=0}render(){let t,e=20;if(!d(this.value)){const o=new Ranger(this.min,this.max);e=(+this.value-this.min)/o.diff*100,t="static"}return o`<div part="root" ${nt(this.observedRecord)} class="${t}"> <i part="value" style="width:${e}%;"></i> </div>`}};h([Y({type:Number})],Be.prototype,"max",void 0),h([Y({type:Number})],Be.prototype,"min",void 0),h([Y({type:Number})],Be.prototype,"value",void 0),Be=h([k("progress"),x(l`:host{background:var(${bt.passive});border-radius:.25em;color:var(${bt.active});height:.5em;width:100%}:host,[part=root]{display:block}[part=root]{border-radius:inherit;overflow:hidden;position:relative;z-index:1}[part=value]{animation:progress 1.8s ease-in-out infinite alternate;background:currentColor;border-radius:inherit;height:100%;left:0;position:absolute;top:0;transition:all .3s;z-index:2}@keyframes progress{0%{left:0}to{left:80%}}.static [part=value]{animation:none}`)],Be);var Oe=Be;Oe.define();const Ie="range",De=yt(Ie);let Ne=class Range extends Te{constructor(){super(...arguments),this.min=0,this.max=100,this.vertical=!1,this.__focusStack=[]}get range(){return Array.isArray(this.value)}get rangeValue(){return this.range?this.value:[this.value]}padValue(t,e=0){const{rangeValue:o}=this,r=t-o.length;return r>0?new Array(r).fill(e).concat(o):o}attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),"max"!==t&&"min"!==t&&"step"!==t||(this._ranger=new Ranger(this.min,this.max,this.step))}get observedRecord(){return f(super.observedRecord,"ring-type")}render(){const t=this.padValue(2),e=Math.min(...t),r=Math.max(...t),s=this._ranger.diff;return o`<div part="root" ${nt(this.observedRecord)} @mousedown="${this.disabled?null:this._handleMousedownRoot}" style="${_([["--from",(e-this.min)/s*100+"%"],["--to",(r-this.min)/s*100+"%"],...t.map(((t,e)=>[`--handle-${e}`,(t-this.min)/s*100+"%"]))])}"> <div part="track"></div> ${ct(this.rangeValue.length,(t=>this._renderHandle(t)))} </div>`}_renderHandle(t){const{disabled:e,range:r,rangeValue:s}=this,a=!r||r&&t===s.length-1&&1===s.length;return o`<i tabindex="0" part="${rt("handle",`handle-${t}`)}" @mousedown="${e?null:this.createMouseDown(t)}" style="${_({"z-index":this.__focusStack.indexOf(t)+1,"--handle":`var(--${a?"to":`handle-${t}`})`})}"></i>`}focusHandle(t){this.lastFocus=t;const e=this.__focusStack.indexOf(t);-1!==e&&this.__focusStack.splice(e,1),this.__focusStack.push(t);const o=this._handles.item(t);o?.focus(),this.__keydownEvent||(this.__keydownEvent=this.events.add(document,"keydown",this.createKeydownEvent(t)))}blurHandle(){this.lastFocus=void 0,this.__keydownEvent=this.events.remove(document,"keydown",this.__keydownEvent)}createKeydownEvent(t){return e=>{const{rangeValue:o,step:r}=this;o.length<2&&(t=0);const s=o[t];"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),this.createSetValue(t)(s-r)):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),this.createSetValue(t)(s+r))}}createMouseDown(t){return e=>{this.focusHandle(t),this.createMousedownListener(this.createSetValue(t))(e)}}createSetValue(t){return e=>{const o=this._ranger.normalize(e);let r=o;this.range&&(r=[...this.value],r[t]=o),this.value=r,this.dispatchCustomEvent("change",this.value)}}_computeValue({clientX:t,clientY:e}){const{top:o,left:r,height:s,width:a}=this._root.getBoundingClientRect();return this._ranger.present(this.vertical?(e-o)/s:(t-r)/a)}_handleMousedownRoot(t){const e=this._computeValue(t),o=this.range?this.rangeValue.reduce(((t,o,r)=>Math.abs(e-o)<Math.abs(e-this.rangeValue[t])?r:t),0):0,r=this.createSetValue(o);r(e),this.createMousedownListener(r)(t),this.focusHandle(o)}createMousedownListener(t){return e=>{e.preventDefault(),e.stopPropagation();const o=this.createMousemoveListener(t);this.events.add(document,"mousemove",o);const r=()=>{this.events.remove(document,"mousemove",o),this.events.remove(document,"mouseup",r)};this.events.add(document,"mouseup",r)}}createMousemoveListener(t){return e=>{const o=this._computeValue(e);o===this._ranger.restrict(o)&&t?.call(this,o)}}_connectedInit(){this._ranger=new Ranger(this.min,this.max,this.step);const t=this._ranger.diff;this.step||=t/100,d(this.value)&&(d(this.default)?this.value=Math.round(t/2/this.step)*this.step:this.value=this.default),this.default??=this.value}reset(){this.value=this.default}sort(){return this.value=this.toSorted()}toSorted(){return this.range?[...this.value].sort(((t,e)=>t-e)):this.value}};h([Y({type:Number})],Ne.prototype,"min",void 0),h([Y({type:Number})],Ne.prototype,"max",void 0),h([Y({type:Number})],Ne.prototype,"step",void 0),h([Y({type:Boolean,reflect:!0})],Ne.prototype,"vertical",void 0),h([Y({type:Array})],Ne.prototype,"value",void 0),h([Y({type:Array})],Ne.prototype,"default",void 0),h([tt("root")],Ne.prototype,"_root",void 0),h([J("[part=handle]")],Ne.prototype,"_handles",void 0),h([X()],Ne.prototype,"lastFocus",void 0),Ne=h([k(Ie),x(l`:host{${De}--track-width:.5em;${De}--handle-scale:1;${De}--track-background:var(${bt.active});background:var(${bt.passive});display:block;height:var(${De}--track-width);width:100%}:host([contents]) [part=root]{width:inherit}:host([vertical]){height:100%;width:-moz-fit-content;width:fit-content}[part=root]{position:relative;--from:0%;--to:50%}[part=root],[part=track]{border-radius:inherit;min-height:inherit}[part=track]{background:var(${De}--track-background);height:100%;justify-content:space-between;left:min(var(--from),var(--to));pointer-events:none;width:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)))}[part=track],[part~=handle]{display:flex;position:absolute}[part~=handle]{align-items:center;background:var(${bt.background});border:.1em solid;border-radius:50%;height:1em;justify-content:center;outline:0;transform:scale(var(${De}--handle-scale)) translate(-50%,-25%);transform-origin:0 25%;-webkit-user-select:none;user-select:none;width:1em}`,l`[vertical]{height:inherit;width:var(${De}--track-width)}[vertical] i{transform:translate(-25%,-50%)}[vertical] [part=track]{height:max(calc(var(--to) - var(--from)),calc(var(--from) - var(--to)));left:0;top:min(var(--from),var(--to));width:100%}`,l`[part~=handle]{left:var(--handle);top:0}[vertical] [part~=handle]{left:0;top:var(--handle)}`)],Ne);var Ue=Ne;Ue.define();const je="rotate",Ve=yt(je);let Le=class Rotate extends GlobalStyle{render(){return o`<div part="root"> <div part="slot" @mousemove="${this._handleRotate}"> ${lt()} </div> <i @mouseleave="${this.reset}"></i> </div>`}reset(){this._root.style.removeProperty("transform"),this._root.style.removeProperty("transition")}_handleRotate(t){const{rotateX:e,rotateY:o}=this._computeOffset(t);this._root.style.setProperty("transform",`rotateX(${e}rad) rotateY(${o}rad)`),this._root.style.setProperty("transition","0s")}_computeOffset(t){const{left:e,top:o,width:r,height:s}=this._root.getBoundingClientRect(),{clientX:a,clientY:l}=t;return{rotateX:-(l-o-s/2)/s/2,rotateY:(a-e-r/2)/r/2}}};h([tt("root")],Le.prototype,"_root",void 0),Le=h([k(je),x(l`:host{display:block;transition:all .5s ease-in-out;width:-moz-fit-content;width:fit-content;${Ve}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{box-sizing:content-box;height:100%;margin:calc(var(${Ve}--offset)*-1);padding:var(${Ve}--offset);position:absolute;top:0;width:100%}[part=slot]{z-index:2}`)],Le);var Ge=Le;Ge.define(),_e.define();const Fe=a("[direction-inset-align]");l`[direction^=top] ${Fe}{top:0}[direction^=bottom] ${Fe}{bottom:0}[direction$=right] ${Fe}{right:0}[direction$=left] ${Fe}{left:0}`;const qe=a("[direction-outset-place]"),He=l`[direction^=top] ${qe}{bottom:100%}[direction^=bottom] ${qe}{top:100%}[direction$=right] ${qe}{left:100%}[direction$=left] ${qe}{right:100%}`;function We(t,e){return t&&e&&t.toLowerCase().includes(e.toLowerCase())}function Ye(t,e){if(t){const o="checked";e?t.setAttribute(o,""):t.removeAttribute(o)}}let Xe=class Select extends Me{constructor(){super(...arguments),this.multiple=!1,this.visible=!1,this.autoDirection="bottom",this.__store=[]}get observedRecord(){return{...super.observedRecord,direction:this.direction||this.autoDirection}}render(){return o`<label part="root" ${nt(this.observedRecord)}> ${[this._renderPrefix(),o`<input part="input" type="${this.type}" .value="${this.text}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||e}" autocomplete="${this.autocomplete||e}" placeholder="${this.placeholder||e}" @focus="${this._handleFocus}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix(),o`<label part="content" direction-outset-place> ${lt()} </label>`]} </label>`}_renderSuffix(){return o`<i part="suffix icon">${Kt()}</i>`}_handleFocus(){if(!this.direction){const{top:t,bottom:e}=this.getBoundingClientRect();window.innerHeight-e<this._content.clientHeight&&t>this._content.clientHeight?this.autoDirection="top":this.autoDirection="bottom"}this.visible=!0}firstUpdated(){this.events.add(this._content,"click",(t=>{t.preventDefault(),t.stopPropagation();const{target:e}=t,o=this.optionValue(e);if(o){const t=this.select(o,e.textContent);this.multiple||Ye(this.lastChecked,0),Ye(e,t),this.lastChecked=e}this._input.focus()})),this.events.add(document,"click",(t=>{t.stopPropagation();const e=t.composedPath()[0];e&&!this.shadowRoot.contains(e)&&this.blur()}))}_connectedInit(){if(!this.value){const t=[...this.querySelectorAll("[checked]")];(this.multiple?t:t.length?[this.lastChecked=t[0]]:[]).forEach((t=>{Ye(t,this.select(this.optionValue(t),t.textContent))})),this.default=this.value,this.defaultText=this.text,this.defaultChecked=t}this.text||(this.text="")}reset(){this.value=this.default,this.text=this.defaultText,this.querySelectorAll("[checked]").forEach((t=>Ye(t,0))),this.defaultChecked.forEach((t=>Ye(t,1)))}select(t,e){e||=t,e=e.trim();let o=0;if(this.multiple){const r=this.__store.findIndex((e=>e.value===t));r>-1?this.__store.splice(r,1):(this.__store.push({value:t,text:e}),o=1),this.value=this.__store.map((t=>t.value)),this.text=this.__store.map((t=>t.text)).join(", ")}else this.value===t?(this.value="",this.text=""):(this.value=t,this.text=e,o=1);return this.dispatchCustomEvent("select",this.value),this.filter(),o}filter(t){t=t?.trim(),[...this.children].forEach((e=>{this.filterCallback(e,!t||We(this.optionValue(e),t)||We(e.textContent,t),t)}))}filterCallback(t,e,o){t.style.display=e?"":"none"}_handleInput(t){if(t.stopPropagation(),this.compositing)return;const e=this._input.value;this.filter(this.multiple?function(t,e){const o=e.slice(0,t).lastIndexOf(",")+1||0,r=e.indexOf(",",t)||e.length;return e.slice(o,r)}(this._input.selectionStart,e):e),this.dispatchCustomEvent("input",this.value,{bubbles:!0})}focus(t){this._input.focus(t),this.visible=!0}blur(){this._input.blur(),this.visible=!1,super.blur()}optionValue(t){return t.value||t.getAttribute("value")||""}};h([Y()],Xe.prototype,"text",void 0),h([tt("content")],Xe.prototype,"_content",void 0),h([Y()],Xe.prototype,"direction",void 0),h([Y({type:Boolean})],Xe.prototype,"multiple",void 0),h([Y({type:Boolean})],Xe.prototype,"visible",void 0),h([X()],Xe.prototype,"autoDirection",void 0),Xe=h([k("select"),x(He,l`.outline,:host(:focus-within){${bt.input}-outline-color:currentColor}[part=input]{text-overflow:ellipsis}[part=content]{position:absolute;visibility:hidden;width:100%}[visible] [part=content]{visibility:visible}`)],Xe);var Ze=Xe;Ze.define();const Ke="skeleton",Qe=yt(Ke);let Je=class Skeleton extends GlobalStyle{constructor(){super(...arguments),this.loading=!0}render(){return this.loading?o`<div part="root">${lt("loading")}</div>`:lt()}};h([X()],Je.prototype,"loading",void 0),Je=h([k(Ke),x(l`:host{${Qe}--from:var(${bt.background});${Qe}--to:var(${bt.passive});${Qe}--deg:95deg;${Qe}--duration:2s;animation:_ var(${Qe}--duration) ease-in-out infinite none running;background-color:transparent;background-image:linear-gradient(var(${Qe}--deg),var(${Qe}--from) 36%,var(${Qe}--to) 50%,var(${Qe}--from) 64%);background-size:200% 100%;flex-shrink:0;height:2em;overflow:hidden;width:100%}@keyframes _{0%{background-position:150%}to{background-position:-50%}}[part=root]{display:contents}:host,:host([contents]) [part=root]{display:block}`)],Je);var ti=Je;ti.define();const ei="split",ii=yt(ei);let oi=class Split extends Te{constructor(){super(),this.len=6,this.index=-1,this.current=-1,this.currentValue=[],new StyleController(this,(()=>new RingBuilder({selector:"[part=input-box]",type:this.ringType}).css))}get observedRecord(){return f(super.observedRecord,"ring-type")}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${ct(this.len,(t=>o`<span part="input-box" ring-type="${this.ringType}" class="${rt({focus:this.current===t})}" @click="${this.disabled?null:()=>this.focusAt(t)}"> ${this.currentValue[t]} </span>`))} <input part="input" @blur=${this.blur} @input="${this._handleInput}" @change="${this._handleChange}" .value="${this.value.padStart(this.len," ")}"/> </div>`}connectedCallback(){super.connectedCallback(),this.reset()}_handleInput(t){t.stopPropagation(),this.compositing||(this.fillInput(t.data),this.value=this.currentValue.join(""),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}fillInput(t){if(null===t){if(null!==this.currentValue[this.current])this.currentValue[this.current]=null;else{this.currentValue[this.current-1]=null;const t=this.currentValue.findLastIndex((t=>null!==t));this.current=this.current-1<0?t<0?0:t:this.current-1}return}const e=t.length>1;if(this.currentValue[this.current]=t[0],this.current+1>=this.len?(this.current=this.currentValue.indexOf(null),-1===this.current&&this.blur()):this.current+=1,e){const e=t.slice(1);e&&this.fillInput(e)}}focus(){this.focusAt(this.current),super.focus()}focusAt(t){this.current=t,this._input.focus()}blur(){this._input.blur(),this.current=-1,super.blur()}reset(){this.current=-1,this.value=this.default,this.currentValue=this.value.split("").concat(Array(this.len-this.value.length).fill(null)),this.index>-1&&(this.current=this.index)}};h([Y({type:Number})],oi.prototype,"len",void 0),h([Y({type:Number})],oi.prototype,"index",void 0),h([X()],oi.prototype,"current",void 0),h([X()],oi.prototype,"currentValue",void 0),oi=h([k(ei),x(l`:host{border-radius:.1em;display:block;width:-moz-fit-content;width:fit-content;${ii}--size:2em;${ii}--gap:.25em}[part=root]{display:flex;gap:var(${ii}--gap);justify-content:space-between;position:relative}[part=input-box],[part=root]{border-radius:inherit;vertical-align:top}[part=input-box]{align-items:center;display:inline-flex;height:var(${ii}--size);justify-content:center;width:var(${ii}--size)}[part=input]{background:none;height:100%;opacity:0;position:absolute;width:100%;z-index:-1}.focus,[part=input-box]:active{${bt.ringColor}:var(${bt.active})}`)],oi);var ri=oi;ri.define();const si="switch",ni=yt(si);let ai=class Switch extends Te{constructor(){super(...arguments),this.default=!1,this.value=!1}set checked(t){this.value=t}get checked(){return this.value}get observedRecord(){return f(super.observedRecord,"ring-type")}render(){return o`<div part="root" ${nt(this.observedRecord)} class="round"> <input part="input" type="checkbox" ?disabled="${this.disabled}" ?checked="${this.value}" @change="${this._handleChange}"/> <span part="handle"></span> </div>`}reset(){this.value=this.default,this._input.checked=this.value}_connectedInit(){this.default?this.value=!0:this.value&&(this.value=!0,this.default=!0)}_handleChange(){const{checked:t}=this._input;this.value=t,this.dispatchCustomEvent("change",this.value)}};h([Y({type:Boolean})],ai.prototype,"default",void 0),h([Y({type:Boolean,attribute:"checked",reflect:!0})],ai.prototype,"value",void 0),ai=h([k(si),x(l`:host,:host([contents]) [part=root]{display:inline-block}:host{${ni}-width:3em;${ni}-height:calc(var(${ni}-width)/2);${ni}-handle-size:1.25em;${ni}-handle-space:calc(var(${ni}-width)/4 - var(${ni}-handle-size)/2);background:var(${bt.passive});border-radius:calc(var(${ni}-height)/2);height:var(${ni}-height);transition:.2s ease-in-out;transition-property:background,left;vertical-align:bottom;width:var(${ni}-width)}:host([checked]){background:var(${bt.active})}[part=root]{position:relative}[part=handle],[part=root]{align-items:center;display:flex;transition:inherit}[part=handle]{background:var(${bt.background});border-radius:100%;height:var(${ni}-handle-size);justify-content:center;left:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%) translateX(var(${ni}-handle-space));width:var(${ni}-handle-size)}:host([checked]) [part=handle]{left:50%}[part=input]{height:100%;opacity:0;width:100%}`)],ai);var li=ai;li.define();const hi="text",di=yt(hi);let ci=class Text extends GlobalStyle{constructor(){super(...arguments),this.underline="none",this.clip=!1}render(){return o`<span part="root" ${nt(this.observedRecord)} class="${rt(this.underline)}"> ${lt()} </span>`}};h([Y()],ci.prototype,"underline",void 0),h([Y({type:Boolean})],ci.prototype,"clip",void 0),ci=h([k(hi),x(l`:host{${di}--color:currentColor;${di}--color-hover:currentColor;${di}--color-active:currentColor;display:inline-block;overflow-wrap:break-word;text-overflow:ellipsis}[part=root]{color:var(${di}--color);display:inline-block;overflow:hidden;overflow-wrap:inherit;text-overflow:inherit;vertical-align:bottom;white-space:nowrap}[part=root]:hover{color:var(${di}--color-hover,var(${di}--color))}[part=root]:active{color:var(${di}--color-active,var(${di}--color))}.active:active,.always,.hover:hover{text-decoration:underline}.none{text-decoration:none}[clip]{background:var(${bt.backgroundClip});color:transparent;display:inline-block;-webkit-text-fill-color:transparent;background-clip:text;-webkit-background-clip:text}`)],ci);var pi=ci;pi.define();const ui="tabs",fi=yt(ui),vi="hover";let mi=class Tabs extends GlobalStyle{constructor(){super(),this.ringType="border",this.useSlot=!1,this.index=0,new StyleController(this,(()=>new RingBuilder({type:this.ringType}).css))}render(){return o`<ul part="root" ${nt(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map(((t,e)=>t||this.useSlot?o`<li part="${rt("item",{selected:this.index===e})}" @mouseenter=${()=>{this.move(this._lastIndex,e),this._lastIndex=e}} @click=${()=>this.select(e)}> ${this.useSlot?lt(t):t} <div part="indicator"></div> </li>`:""))} </ul>`}connectedCallback(){super.connectedCallback(),this._lastIndex=this.index}_handleMouseLeave(){const t=this._items[this._lastIndex];t&&t.part.remove(vi),this._lastIndex=this.index}move(t,e){if(t===e)return;const{_items:o,_indicators:r}=this,s=o[e];if(!s)return;s.part.add(vi);const a=o[t];if(!a)return;a.part.remove(vi);const l=r[e],h=r[t];if(!l||!h)return;const d=h.getBoundingClientRect(),c=s.getBoundingClientRect(),p=d.x-c.x,u=d.y-c.y,f=d.width,{style:v}=l;v.transform=`translate3d(${p}px,${u}px,0)`,v.width=f+"px",v.transition=h.style.transition="none",l.getBoundingClientRect(),v.width=v.transform=v.transition=h.style.transition=""}select(t){const{index:e,tabs:o,_lastIndex:r,useSlot:s}=this;o&&e!==t&&t in o&&(this.dispatchCustomEvent("select",t),this.move(r,t),this._lastIndex=t,e in o&&(o[e]||s)&&(this.index=t))}};h([Y({attribute:"ring-type"})],mi.prototype,"ringType",void 0),h([Y({type:Boolean})],mi.prototype,"useSlot",void 0),h([Y({type:Array})],mi.prototype,"tabs",void 0),h([Y({type:Number})],mi.prototype,"index",void 0),h([J("[part~=item]")],mi.prototype,"_items",void 0),h([J("[part=indicator]")],mi.prototype,"_indicators",void 0),mi=h([k(ui),x(l`:host{${fi}--indicator-background:var(${bt.passive});${fi}--space:0.25em;border-radius:var(${bt.radius});cursor:default;display:flex;transition:.3s ease-in-out;width:-moz-fit-content;width:fit-content}[part=root]{border-radius:inherit;display:flex;flex-direction:inherit;gap:var(${fi}--space);overflow-x:clip;padding:.2em;position:relative;transition:inherit;transition-property:width,transform,opacity;z-index:1}[useslot] [part~=item]{padding:0}[part~=item]{display:block;padding:0 .25em;position:relative;white-space:nowrap}[part=indicator],[part~=item]{border-radius:inherit;transition:inherit;transition-property:inherit;width:100%}[part=indicator]{background:var(${fi}--indicator-background);height:100%;inset:0;opacity:0;position:absolute;z-index:-1}[part~=selected]{background:var(${fi}--indicator-background)}[part~=hover] [part=indicator],[part~=selected] [part=indicator]{opacity:1}`)],mi);var gi=mi;function yi(t,e=2){return t.toString().padStart(e,"0").split("")}gi.define();let bi=class Time extends GlobalStyle{constructor(){super(...arguments),this.escape="%",this.format="YYYY-MM-DD hh:mm:ss",this.time=new Date}render(){return o`<span part="root" ${nt(this.observedRecord)}> ${function(t,e=new Date,o="%"){var r;if(!t)return t;if(isNaN(e.getTime()))return;const s=`${o}${o}`,a=[];t=t.replace(new RegExp(`${o}([ZYMDhmsS${o}])`,"g"),((t,e)=>(a.push(e),s)));const l=e.getTimezoneOffset()/-60,h={Z:[l>=0?"+"+l.toString():l.toString()],Y:e.getFullYear().toString().split(""),M:yi(e.getMonth()+1),D:yi(e.getDate()),h:yi(e.getHours()),m:yi(e.getMinutes()),s:yi(e.getSeconds()),S:yi(e.getMilliseconds(),3)},d=[];for(const e of t.split("").reverse()){const t=null===(r=h[e])||void 0===r?void 0:r.pop();t?d.push(t):d.push(e)}return d.reverse().join("").replace(new RegExp(s,"g"),(()=>a.shift()))}(this.format,this.time,this.escape)} </span>`}updated(t){t.has("timeout")&&this.timeout&&(this.timeouts.remove(this.timeoutId),this.timeoutId=this.timeouts.add(setInterval((()=>{this.dispatchCustomEvent("time",this.time),this.time=new Date(this.time.getTime()+(this.gap||this.timeout))}),Math.abs(this.timeout))))}};h([Y()],bi.prototype,"escape",void 0),h([Y()],bi.prototype,"format",void 0),h([Y({type:Object})],bi.prototype,"time",void 0),h([Y({type:Number})],bi.prototype,"timeout",void 0),h([Y({type:Number})],bi.prototype,"gap",void 0),bi=h([k("time"),x(l`:host{text-align:center}`)],bi);var $i,_i=bi;_i.define();const wi="tooltip",xi=yt(wi);let ki=$i=class Tooltip extends SuperOpenable{constructor(){super(...arguments),this.direction="top",this.align="center",this.propagation=!1,this.type="hover"}render(){const t=$i.aligns[this.align]||"inherit",e="focus"===this.type;return o`<div part="root" ${nt(this.observedRecord)} tabindex="${e?0:-1}" @focus="${e?()=>this.open=!0:null}" @blur="${e?()=>this.open=!1:null}" @mouseenter="${e?null:()=>this.open=!0}" @mouseleave="${e?null:()=>this.open=!1}" style="justify-content:${t};align-items:${t}"> ${lt()} <div part="tip" direction-outset-place> ${this.tip?o`<span class="passive">${this.tip}</span>`:lt("tip")} </div> </div>`}};ki.aligns={start:"flex-start",end:"flex-end",center:"center","flex-start":"flex-start","flex-end":"flex-end"},h([Y()],ki.prototype,"tip",void 0),h([Y()],ki.prototype,"direction",void 0),h([Y()],ki.prototype,"align",void 0),h([Y({type:Boolean})],ki.prototype,"propagation",void 0),h([Y()],ki.prototype,"type",void 0),ki=$i=h([k(wi),x(He,l`:host{${xi}--tip-background:inherit;width:-moz-fit-content;width:fit-content}:host,[part=root]{display:inline-flex}[part=root]{border-radius:inherit;position:relative;transition:inherit}[part=tip]{height:-moz-fit-content;height:fit-content;position:absolute;transition:inherit;-webkit-user-select:none;user-select:none;visibility:hidden;width:-moz-fit-content;width:fit-content}:host([open]) [part=tip]{visibility:visible}.passive{background:var(${xi}--tip-background)}[propagation] [part=tip]{pointer-events:none}`)],ki);var Si=ki;Si.define();const Ci="typewriter",Ri=yt(Ci);let Ei=class Typewriter extends GlobalStyle{constructor(){super(...arguments),this.content="",this.ended=!1,this.max=100,this.min=50,this.delay=0,this.index=0,this.contentInternal=""}get len(){return this.content.length}render(){return o`<div part="root" ${nt(this.observedRecord)}> ${lt()} ${this.contentInternal} <i part="cursor" ?hidden="${this.ended}"></i> </div>`}connectedCallback(){super.connectedCallback(),this._ranger=new Ranger(this.min,this.max)}firstUpdated(){this.content||=this._slot?.assignedNodes()[0]?.textContent.trim()||"",!this.ended&&this.len&&this.write()}updated(t){t.has("index")&&this.dispatchCustomEvent(this.index===this.len?"done":"write",this.contentInternal)}write(t=this.index){this.contentInternal=this.content.slice(0,t+1);const e=this.delay||this._ranger.random();this.timeoutID=this.timeouts.add(setTimeout((()=>{const e=t+1;e<=this.len&&(this.index=e,this.write())}),e))}stop(){clearTimeout(this.timeoutID)}end(){this.ended=!0}};h([Y()],Ei.prototype,"content",void 0),h([Y({type:Boolean})],Ei.prototype,"ended",void 0),h([Y({type:Number})],Ei.prototype,"max",void 0),h([Y({type:Number})],Ei.prototype,"min",void 0),h([Y({type:Number})],Ei.prototype,"delay",void 0),h([Y({type:Number})],Ei.prototype,"index",void 0),h([X()],Ei.prototype,"contentInternal",void 0),h([K("i")],Ei.prototype,"_i",void 0),Ei=h([k(Ci),x(l`:host{${Ri}--cursor-width:.05em}:host,:host([contents]) [part=root]{display:inline-block}i{animation:s 1.5s steps(1) infinite;border-right:var(${Ri}--cursor-width) solid;margin-left:.02em}@keyframes s{0%{border-color:currentColor}50%{border-color:transparent}}slot{display:none}`)],Ei);var Ti=Ei;Ti.define();export{kt as Alert,Ct as Avatar,Pt as Badge,Dt as Breath,At as Button,Vt as Card,Ht as Carousel,Zt as Chip,ee as Details,ne as Dialog,le as Divider,de as Dragbox,ue as Flex,ve as Form,be as Grid,Ce as Heading,Me as Input,ze as Layout,ke as Link,Oe as Progress,Ue as Range,Ge as Rotate,_e as Router,Ze as Select,ti as Skeleton,ri as Split,li as Switch,gi as Tabs,pi as Text,_i as Time,Si as Tooltip,Ti as Typewriter};
48
48
  //# sourceMappingURL=godown.js.map