1 | import{e,_ as t,o as i,r,x as o,i as a,n as s,t as n,m as l,a as d,E as c,b as h,s as p,D as u,c as f,d as m,f as v,g,h as b,j as _,k as y,B as x,l as w,p as k,q as E,u as S,T as A,v as T,w as C,y as R}from"./styles-B7oMzmOl.js";let I;function $(e,t=F){const i=z(e,t);return i&&(i.tabIndex=0,i.focus()),i}function L(e,t=F){const i=D(e,t);return i&&(i.tabIndex=0,i.focus()),i}function O(e,t=F){for(let i=0;i<e.length;i++){const r=e[i];if(0===r.tabIndex&&t(r))return{item:r,index:i}}return null}function z(e,t=F){for(const i of e)if(t(i))return i;return null}function D(e,t=F){for(let i=e.length-1;i>=0;i--){const r=e[i];if(t(r))return r}return null}function P(e,t,i=F,r=!0){if(t){const o=function(e,t,i=F,r=!0){for(let o=1;o<e.length;o++){const a=(o+t)%e.length;if(a<t&&!r)return null;const s=e[a];if(i(s))return s}return e[t]?e[t]:null}(e,t.index,i,r);return o&&(o.tabIndex=0,o.focus()),o}return $(e,i)}function B(e,t,i=F,r=!0){if(t){const o=function(e,t,i=F,r=!0){for(let o=1;o<e.length;o++){const a=(t-o+e.length)%e.length;if(a>t&&!r)return null;const s=e[a];if(i(s))return s}return e[t]?e[t]:null}(e,t.index,i,r);return o&&(o.tabIndex=0,o.focus()),o}return L(e,i)}function F(e){return!e.disabled}const U={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class M{constructor(e){this.handleKeydown=e=>{const t=e.key;if(e.defaultPrevented||!this.isNavigableKey(t))return;const i=this.items;if(!i.length)return;const r=O(i,this.isActivatable);e.preventDefault();const o=this.isRtl();let a=null;switch(t){case U.ArrowDown:case o?U.ArrowLeft:U.ArrowRight:a=P(i,r,this.isActivatable,this.wrapNavigation());break;case U.ArrowUp:case o?U.ArrowRight:U.ArrowLeft:a=B(i,r,this.isActivatable,this.wrapNavigation());break;case U.Home:a=$(i,this.isActivatable);break;case U.End:a=L(i,this.isActivatable)}a&&r&&r.item!==a&&(r.item.tabIndex=-1)},this.onDeactivateItems=()=>{const e=this.items;for(const t of e)this.deactivateItem(t)},this.onRequestActivation=e=>{this.onDeactivateItems();const t=e.target;this.activateItem(t),t.focus()},this.onSlotchange=()=>{const e=this.items;let t=!1;for(const i of e){!(!i.disabled&&i.tabIndex>-1)||t?i.tabIndex=-1:(t=!0,i.tabIndex=0)}if(t)return;const i=z(e,this.isActivatable);i&&(i.tabIndex=0)};const{isItem:t,getPossibleItems:i,isRtl:r,deactivateItem:o,activateItem:a,isNavigableKey:s,isActivatable:n,wrapNavigation:l}=e;this.isItem=t,this.getPossibleItems=i,this.isRtl=r,this.deactivateItem=o,this.activateItem=a,this.isNavigableKey=s,this.isActivatable=n,this.wrapNavigation=l??(()=>!0)}get items(){const e=this.getPossibleItems(),t=[];for(const i of e){if(this.isItem(i)){t.push(i);continue}const e=i.item;e&&this.isItem(e)&&t.push(e)}return t}activateNextItem(){const e=this.items,t=O(e,this.isActivatable);return t&&(t.item.tabIndex=-1),P(e,t,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const e=this.items,t=O(e,this.isActivatable);return t&&(t.item.tabIndex=-1),B(e,t,this.isActivatable,this.wrapNavigation())}}const N=new Set(Object.values(U));class H extends r{get items(){return this.listController.items}constructor(){super(),this.listController=new M({isItem:e=>e.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:e=>{e.tabIndex=-1},activateItem:e=>{e.tabIndex=0},isNavigableKey:e=>N.has(e),isActivatable:e=>!e.disabled&&"text"!==e.type}),this.internals=this.attachInternals(),this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown)}render(){return o`
|
2 | <slot
|
3 | @deactivate-items=${this.listController.onDeactivateItems}
|
4 | @request-activation=${this.listController.onRequestActivation}
|
5 | @slotchange=${this.listController.onSlotchange}>
|
6 | </slot>
|
7 | `}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}}t([i({flatten:!0})],H.prototype,"slotItems",void 0);const q=a`:host{background:var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;display:flex;flex-direction:column;outline:none;padding:8px 0;position:relative}
|
8 | `;class W extends H{}W.styles=[q],customElements.define("ew-list",W);class Z extends r{constructor(){super(...arguments),this.multiline=!1}render(){return o`
|
9 | <slot name="container"></slot>
|
10 | <slot class="non-text" name="start"></slot>
|
11 | <div class="text">
|
12 | <slot name="overline" @slotchange=${this.handleTextSlotChange}></slot>
|
13 | <slot
|
14 | class="default-slot"
|
15 | @slotchange=${this.handleTextSlotChange}></slot>
|
16 | <slot name="headline" @slotchange=${this.handleTextSlotChange}></slot>
|
17 | <slot
|
18 | name="supporting-text"
|
19 | @slotchange=${this.handleTextSlotChange}></slot>
|
20 | </div>
|
21 | <slot class="non-text" name="trailing-supporting-text"></slot>
|
22 | <slot class="non-text" name="end"></slot>
|
23 | `}handleTextSlotChange(){let e=!1,t=0;for(const i of this.textSlots)if(V(i)&&(t+=1),t>1){e=!0;break}this.multiline=e}}function V(e){for(const i of e.assignedNodes({flatten:!0})){var t;const e=i.nodeType===Node.ELEMENT_NODE,r=i.nodeType===Node.TEXT_NODE&&(null===(t=i.textContent)||void 0===t?void 0:t.match(/\S/));if(e||r)return!0}return!1}t([s({type:Boolean,reflect:!0})],Z.prototype,"multiline",void 0),t([function(t){return(i,r)=>e(i,r,{get(){return(this.renderRoot??I??(I=document.createDocumentFragment())).querySelectorAll(t)}})}(".text slot")],Z.prototype,"textSlots",void 0);const j=a`:host{color:var(--md-sys-color-on-surface, #1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, 0.875rem);font-weight:var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}
|
24 | `;let G=class extends Z{};G.styles=[j],G=t([n("md-item")],G);const K=Symbol.for(""),Y=e=>{if((null==e?void 0:e.r)===K)return null==e?void 0:e._$litStatic$},X=(e,...t)=>({_$litStatic$:t.reduce(((t,i,r)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[r+1]),e[0]),r:K}),J=new Map,Q=(e=>(t,...i)=>{const r=i.length;let o,a;const s=[],n=[];let l,d=0,c=!1;for(;d<r;){for(l=t[d];d<r&&void 0!==(a=i[d],o=Y(a));)l+=o+t[++d],c=!0;d!==r&&n.push(a),s.push(l),d++}if(d===r&&s.push(t[r]),c){const e=s.join("$$lit$$");void 0===(t=J.get(e))&&(s.raw=s,J.set(e,t=s)),i=n}return e(t,...i)})(o),ee=l(r);class te extends ee{constructor(){super(...arguments),this.disabled=!1,this.type="text",this.isListItem=!0,this.href="",this.target=""}get isDisabled(){return this.disabled&&"link"!==this.type}willUpdate(e){this.href&&(this.type="link"),super.willUpdate(e)}render(){return this.renderListItem(o`
|
25 | <md-item>
|
26 | <div slot="container">
|
27 | ${this.renderRipple()} ${this.renderFocusRing()}
|
28 | </div>
|
29 | <slot name="start" slot="start"></slot>
|
30 | <slot name="end" slot="end"></slot>
|
31 | ${this.renderBody()}
|
32 | </md-item>
|
33 | `)}renderListItem(e){const t="link"===this.type;let i;switch(this.type){case"link":i=X`a`;break;case"button":i=X`button`;break;default:i=X`li`}const r="text"!==this.type,o=t&&this.target?this.target:c;return Q`
|
34 | <${i}
|
35 | id="item"
|
36 | tabindex="${this.isDisabled||!r?-1:0}"
|
37 | ?disabled=${this.isDisabled}
|
38 | role="listitem"
|
39 | aria-selected=${this.ariaSelected||c}
|
40 | aria-checked=${this.ariaChecked||c}
|
41 | aria-expanded=${this.ariaExpanded||c}
|
42 | aria-haspopup=${this.ariaHasPopup||c}
|
43 | class="list-item ${h(this.getRenderClasses())}"
|
44 | href=${this.href||c}
|
45 | target=${o}
|
46 | @focus=${this.onFocus}
|
47 | >${e}</${i}>
|
48 | `}renderRipple(){return"text"===this.type?c:o` <md-ripple
|
49 | part="ripple"
|
50 | for="item"
|
51 | ?disabled=${this.isDisabled}></md-ripple>`}renderFocusRing(){return"text"===this.type?c:o` <md-focus-ring
|
52 | @visibility-changed=${this.onFocusRingVisibilityChanged}
|
53 | part="focus-ring"
|
54 | for="item"
|
55 | inward></md-focus-ring>`}onFocusRingVisibilityChanged(e){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return o`
|
56 | <slot></slot>
|
57 | <slot name="overline" slot="overline"></slot>
|
58 | <slot name="headline" slot="headline"></slot>
|
59 | <slot name="supporting-text" slot="supporting-text"></slot>
|
60 | <slot
|
61 | name="trailing-supporting-text"
|
62 | slot="trailing-supporting-text"></slot>
|
63 | `}onFocus(){-1===this.tabIndex&&this.dispatchEvent(new Event("request-activation",{bubbles:!0,composed:!0}))}focus(){var e;null===(e=this.listItemRoot)||void 0===e||e.focus()}}te.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([s({type:Boolean,reflect:!0})],te.prototype,"disabled",void 0),t([s({reflect:!0})],te.prototype,"type",void 0),t([s({type:Boolean,attribute:"md-list-item",reflect:!0})],te.prototype,"isListItem",void 0),t([s()],te.prototype,"href",void 0),t([s()],te.prototype,"target",void 0),t([d(".list-item")],te.prototype,"listItemRoot",void 0);const ie=a`:host{display:flex;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-ripple-hover-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, 0.3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-list-item-one-line-container-height, 56px);padding-top:var(--md-list-item-top-space, 12px);padding-bottom:var(--md-list-item-bottom-space, 12px);padding-inline-start:var(--md-list-item-leading-space, 16px);padding-inline-end:var(--md-list-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}@media(forced-colors: active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}
|
64 | `;class re extends te{}re.styles=[ie],customElements.define("ew-list-item",re);class oe extends u{}oe.styles=[p],customElements.define("ew-divider",oe);const ae=Symbol("createValidator"),se=Symbol("getValidityAnchor"),ne=Symbol("privateValidator"),le=Symbol("privateSyncValidity"),de=Symbol("privateCustomValidationMessage");function ce(e){var t;class i extends e{constructor(){super(...arguments),this[t]=""}get validity(){return this[le](),this[f].validity}get validationMessage(){return this[le](),this[f].validationMessage}get willValidate(){return this[le](),this[f].willValidate}checkValidity(){return this[le](),this[f].checkValidity()}reportValidity(){return this[le](),this[f].reportValidity()}setCustomValidity(e){this[de]=e,this[le]()}requestUpdate(e,t,i){super.requestUpdate(e,t,i),this[le]()}firstUpdated(e){super.firstUpdated(e),this[le]()}[(t=de,le)](){this[ne]||(this[ne]=this[ae]());const{validity:e,validationMessage:t}=this[ne].getValidity(),i=!!this[de],r=this[de]||t;this[f].setValidity({...e,customError:i},r,this[se]()??void 0)}[ae](){throw new Error("Implement [createValidator]")}[se](){throw new Error("Implement [getValidityAnchor]")}}return i}const he=Symbol("getFormValue"),pe=Symbol("getFormState");function ue(e){class i extends e{get form(){return this[f].form}get labels(){return this[f].labels}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}attributeChangedCallback(e,t,i){if("name"!==e&&"disabled"!==e)super.attributeChangedCallback(e,t,i);else{const i="disabled"===e?null!==t:t;this.requestUpdate(e,i)}}requestUpdate(e,t,i){super.requestUpdate(e,t,i),this[f].setFormValue(this[he](),this[pe]())}[he](){throw new Error("Implement [getFormValue]")}[pe](){return this[he]()}formDisabledCallback(e){this.disabled=e}}return i.formAssociated=!0,t([s({noAccessor:!0})],i.prototype,"name",null),t([s({type:Boolean,noAccessor:!0})],i.prototype,"disabled",null),i}class fe{constructor(e){this.getCurrentState=e,this.currentValidity={validity:{},validationMessage:""}}getValidity(){const e=this.getCurrentState();if(!(!this.prevState||!this.equals(this.prevState,e)))return this.currentValidity;const{validity:t,validationMessage:i}=this.computeValidity(e);return this.prevState=this.copy(e),this.currentValidity={validationMessage:i,validity:{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing}},this.currentValidity}}class me extends fe{computeValidity(e){return this.checkboxControl||(this.checkboxControl=document.createElement("input"),this.checkboxControl.type="checkbox"),this.checkboxControl.checked=e.checked,this.checkboxControl.required=e.required,{validity:this.checkboxControl.validity,validationMessage:this.checkboxControl.validationMessage}}equals(e,t){return e.checked===t.checked&&e.required===t.required}copy({checked:e,required:t}){return{checked:e,required:t}}}const ve=l(ce(ue(m(r))));class ge extends ve{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",(e=>{g(e)&&this.input&&(this.focus(),b(this.input))}))}update(e){(e.has("checked")||e.has("disabled")||e.has("indeterminate"))&&(this.prevChecked=e.get("checked")??this.checked,this.prevDisabled=e.get("disabled")??this.disabled,this.prevIndeterminate=e.get("indeterminate")??this.indeterminate),super.update(e)}render(){const e=!this.prevChecked&&!this.prevIndeterminate,t=this.prevChecked&&!this.prevIndeterminate,i=this.prevIndeterminate,r=this.checked&&!this.indeterminate,a=this.indeterminate,s=h({disabled:this.disabled,selected:r||a,unselected:!r&&!a,checked:r,indeterminate:a,"prev-unselected":e,"prev-checked":t,"prev-indeterminate":i,"prev-disabled":this.prevDisabled}),{ariaLabel:n,ariaInvalid:l}=this;return o`
|
65 | <div class="container ${s}">
|
66 | <input
|
67 | type="checkbox"
|
68 | id="input"
|
69 | aria-checked=${a?"mixed":c}
|
70 | aria-label=${n||c}
|
71 | aria-invalid=${l||c}
|
72 | ?disabled=${this.disabled}
|
73 | ?required=${this.required}
|
74 | .indeterminate=${this.indeterminate}
|
75 | .checked=${this.checked}
|
76 | @input=${this.handleInput}
|
77 | @change=${this.handleChange} />
|
78 |
|
79 | <div class="outline"></div>
|
80 | <div class="background"></div>
|
81 | <md-focus-ring part="focus-ring" for="input"></md-focus-ring>
|
82 | <md-ripple for="input" ?disabled=${this.disabled}></md-ripple>
|
83 | <svg class="icon" viewBox="0 0 18 18" aria-hidden="true">
|
84 | <rect class="mark short" />
|
85 | <rect class="mark long" />
|
86 | </svg>
|
87 | </div>
|
88 | `}handleInput(e){const t=e.target;this.checked=t.checked,this.indeterminate=t.indeterminate}handleChange(e){_(this,e)}[he](){return!this.checked||this.indeterminate?null:this.value}[pe](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(e){this.checked="true"===e}[ae](){return new me((()=>this))}[se](){return this.input}}ge.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([s({type:Boolean})],ge.prototype,"checked",void 0),t([s({type:Boolean})],ge.prototype,"indeterminate",void 0),t([s({type:Boolean})],ge.prototype,"required",void 0),t([s()],ge.prototype,"value",void 0),t([v()],ge.prototype,"prevChecked",void 0),t([v()],ge.prototype,"prevDisabled",void 0),t([v()],ge.prototype,"prevIndeterminate",void 0),t([d("input")],ge.prototype,"input",void 0);const be=a`:host{border-start-start-radius:var(--md-checkbox-container-shape-start-start, var(--md-checkbox-container-shape, 2px));border-start-end-radius:var(--md-checkbox-container-shape-start-end, var(--md-checkbox-container-shape, 2px));border-end-end-radius:var(--md-checkbox-container-shape-end-end, var(--md-checkbox-container-shape, 2px));border-end-start-radius:var(--md-checkbox-container-shape-end-start, var(--md-checkbox-container-shape, 2px));display:inline-flex;height:var(--md-checkbox-container-size, 18px);position:relative;vertical-align:top;width:var(--md-checkbox-container-size, 18px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-checkbox-container-size, 18px))/2)}md-focus-ring{height:44px;inset:unset;width:44px}input{appearance:none;height:48px;margin:0;opacity:0;outline:none;position:absolute;width:48px;z-index:1;cursor:inherit}:host([touch-target=none]) input{height:100%;width:100%}.container{border-radius:inherit;display:flex;height:100%;place-content:center;place-items:center;position:relative;width:100%}.outline,.background,.icon{inset:0;position:absolute}.outline,.background{border-radius:inherit}.outline{border-color:var(--md-checkbox-outline-color, var(--md-sys-color-on-surface-variant, #49454f));border-style:solid;border-width:var(--md-checkbox-outline-width, 2px);box-sizing:border-box}.background{background-color:var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4))}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}:where(.selected) :is(.background,.icon){opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-ripple{border-radius:var(--md-checkbox-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));height:var(--md-checkbox-state-layer-size, 40px);inset:unset;width:var(--md-checkbox-state-layer-size, 40px);--md-ripple-hover-color: var(--md-checkbox-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-checkbox-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-checkbox-pressed-state-layer-opacity, 0.12)}.selected md-ripple{--md-ripple-hover-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12)}.icon{fill:var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));height:var(--md-checkbox-icon-size, 18px);width:var(--md-checkbox-icon-size, 18px)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}:where(:hover) .outline{border-color:var(--md-checkbox-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-hover-outline-width, 2px)}:where(:hover) .background{background:var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4))}:where(:hover) .icon{fill:var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:focus-within) .outline{border-color:var(--md-checkbox-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-focus-outline-width, 2px)}:where(:focus-within) .background{background:var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4))}:where(:focus-within) .icon{fill:var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:active) .outline{border-color:var(--md-checkbox-pressed-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-pressed-outline-width, 2px)}:where(:active) .background{background:var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4))}:where(:active) .icon{fill:var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff))}:where(.disabled,.prev-disabled) :is(.background,.icon,.mark){animation-duration:0s;transition-duration:0s}:where(.disabled) .outline{border-color:var(--md-checkbox-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-disabled-outline-width, 2px);opacity:var(--md-checkbox-disabled-container-opacity, 0.38)}:where(.selected.disabled) .outline{visibility:hidden}:where(.selected.disabled) .background{background:var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-checkbox-selected-disabled-container-opacity, 0.38)}:where(.disabled) .icon{fill:var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fef7ff))}@media(forced-colors: active){.background{background-color:CanvasText}.selected.disabled .background{background-color:GrayText;opacity:1}.outline{border-color:CanvasText}.disabled .outline{border-color:GrayText;opacity:1}.icon{fill:Canvas}}
|
89 | `;class _e extends ge{}_e.styles=[be],customElements.define("ew-checkbox",_e);class ye{constructor(e){this.targetElement=e,this.state={bold:!1,italic:!1,underline:!1,strikethrough:!1,foregroundColor:null,backgroundColor:null,carriageReturn:!1,secret:!1}}logs(){return this.targetElement.innerText}addLine(e){const t=/(?:\033|\\033)(?:\[(.*?)[@-~]|\].*?(?:\007|\033\\))/g;let i=0;this.state.carriageReturn&&("\n"!==e&&this.targetElement.removeChild(this.targetElement.lastChild),this.state.carriageReturn=!1),e.includes("\r")&&(this.state.carriageReturn=!0);const r=document.createElement("span");r.classList.add("line"),this.targetElement.appendChild(r);const o=e=>{if(""===e)return;const t=document.createElement("span");if(this.state.bold&&t.classList.add("log-bold"),this.state.italic&&t.classList.add("log-italic"),this.state.underline&&t.classList.add("log-underline"),this.state.strikethrough&&t.classList.add("log-strikethrough"),this.state.secret&&t.classList.add("log-secret"),null!==this.state.foregroundColor&&t.classList.add(`log-fg-${this.state.foregroundColor}`),null!==this.state.backgroundColor&&t.classList.add(`log-bg-${this.state.backgroundColor}`),t.appendChild(document.createTextNode(e)),r.appendChild(t),this.state.secret){const e=document.createElement("span");e.classList.add("log-secret-redacted"),e.appendChild(document.createTextNode("[redacted]")),r.appendChild(e)}};for(;;){const r=t.exec(e);if(null===r)break;const a=r.index;if(o(e.substring(i,a)),i=a+r[0].length,void 0!==r[1])for(const e of r[1].split(";"))switch(parseInt(e)){case 0:this.state.bold=!1,this.state.italic=!1,this.state.underline=!1,this.state.strikethrough=!1,this.state.foregroundColor=null,this.state.backgroundColor=null,this.state.secret=!1;break;case 1:this.state.bold=!0;break;case 3:this.state.italic=!0;break;case 4:this.state.underline=!0;break;case 5:this.state.secret=!0;break;case 6:this.state.secret=!1;break;case 9:this.state.strikethrough=!0;break;case 22:this.state.bold=!1;break;case 23:this.state.italic=!1;break;case 24:this.state.underline=!1;break;case 29:this.state.strikethrough=!1;break;case 30:this.state.foregroundColor="black";break;case 31:this.state.foregroundColor="red";break;case 32:this.state.foregroundColor="green";break;case 33:this.state.foregroundColor="yellow";break;case 34:this.state.foregroundColor="blue";break;case 35:this.state.foregroundColor="magenta";break;case 36:this.state.foregroundColor="cyan";break;case 37:this.state.foregroundColor="white";break;case 39:this.state.foregroundColor=null;break;case 41:this.state.backgroundColor="red";break;case 42:this.state.backgroundColor="green";break;case 43:this.state.backgroundColor="yellow";break;case 44:this.state.backgroundColor="blue";break;case 45:this.state.backgroundColor="magenta";break;case 46:this.state.backgroundColor="cyan";break;case 47:this.state.backgroundColor="white";break;case 40:case 49:this.state.backgroundColor=null}}const a=this.targetElement.scrollTop>this.targetElement.scrollHeight-this.targetElement.offsetHeight-50;o(e.substring(i)),a&&(this.targetElement.scrollTop=this.targetElement.scrollHeight)}}const xe=e=>new Promise((t=>setTimeout(t,e)));class we{constructor(){this.chunks=""}transform(e,t){this.chunks+=e;const i=this.chunks.split("\r\n");this.chunks=i.pop(),i.forEach((e=>t.enqueue(e+"\r\n")))}flush(e){e.enqueue(this.chunks)}}class ke{transform(e,t){const i=new Date,r=i.getHours().toString().padStart(2,"0"),o=i.getMinutes().toString().padStart(2,"0"),a=i.getSeconds().toString().padStart(2,"0");t.enqueue(`[${r}:${o}:${a}]${e}`)}}class Ee extends HTMLElement{constructor(){super(...arguments),this.allowInput=!0}logs(){var e;return(null===(e=this._console)||void 0===e?void 0:e.logs())||""}connectedCallback(){if(this._console)return;if(this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n :host, input {\n background-color: #1c1c1c;\n color: #ddd;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,\n monospace;\n line-height: 1.45;\n display: flex;\n flex-direction: column;\n }\n form {\n display: flex;\n align-items: center;\n padding: 0 8px 0 16px;\n }\n input {\n flex: 1;\n padding: 4px;\n margin: 0 8px;\n border: 0;\n outline: none;\n }\n \n .log {\n flex: 1;\n background-color: #1c1c1c;\n font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,\n monospace;\n font-size: 12px;\n padding: 16px;\n overflow: auto;\n line-height: 1.45;\n border-radius: 3px;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n color: #ddd;\n }\n\n .log-bold {\n font-weight: bold;\n }\n .log-italic {\n font-style: italic;\n }\n .log-underline {\n text-decoration: underline;\n }\n .log-strikethrough {\n text-decoration: line-through;\n }\n .log-underline.log-strikethrough {\n text-decoration: underline line-through;\n }\n .log-secret {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n .log-secret-redacted {\n opacity: 0;\n width: 1px;\n font-size: 1px;\n }\n .log-fg-black {\n color: rgb(128, 128, 128);\n }\n .log-fg-red {\n color: rgb(255, 0, 0);\n }\n .log-fg-green {\n color: rgb(0, 255, 0);\n }\n .log-fg-yellow {\n color: rgb(255, 255, 0);\n }\n .log-fg-blue {\n color: rgb(0, 0, 255);\n }\n .log-fg-magenta {\n color: rgb(255, 0, 255);\n }\n .log-fg-cyan {\n color: rgb(0, 255, 255);\n }\n .log-fg-white {\n color: rgb(187, 187, 187);\n }\n .log-bg-black {\n background-color: rgb(0, 0, 0);\n }\n .log-bg-red {\n background-color: rgb(255, 0, 0);\n }\n .log-bg-green {\n background-color: rgb(0, 255, 0);\n }\n .log-bg-yellow {\n background-color: rgb(255, 255, 0);\n }\n .log-bg-blue {\n background-color: rgb(0, 0, 255);\n }\n .log-bg-magenta {\n background-color: rgb(255, 0, 255);\n }\n .log-bg-cyan {\n background-color: rgb(0, 255, 255);\n }\n .log-bg-white {\n background-color: rgb(255, 255, 255);\n }\n\n </style>\n <div class="log"></div>\n ${this.allowInput?"<form>\n >\n <input autofocus>\n </form>\n ":""}\n `,this._console=new ye(this.shadowRoot.querySelector("div")),this.allowInput){const e=this.shadowRoot.querySelector("input");this.addEventListener("click",(()=>{var t;""===(null===(t=getSelection())||void 0===t?void 0:t.toString())&&e.focus()})),e.addEventListener("keydown",(e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),this._sendCommand())}))}const e=new AbortController,t=this._connect(e.signal);this._cancelConnection=()=>(e.abort(),t)}async _connect(e){this.logger.debug("Starting console read loop");try{await this.port.readable.pipeThrough(new TextDecoderStream,{signal:e}).pipeThrough(new TransformStream(new we)).pipeThrough(new TransformStream(new ke)).pipeTo(new WritableStream({write:e=>{this._console.addLine(e.replace("\r",""))}})),e.aborted||(this._console.addLine(""),this._console.addLine(""),this._console.addLine("Terminal disconnected"))}catch(e){this._console.addLine(""),this._console.addLine(""),this._console.addLine(`Terminal disconnected: ${e}`)}finally{await xe(100),this.logger.debug("Finished console read loop")}}async _sendCommand(){const e=this.shadowRoot.querySelector("input"),t=e.value,i=new TextEncoder,r=this.port.writable.getWriter();await r.write(i.encode(t+"\r\n")),this._console.addLine(`> ${t}\r\n`),e.value="",e.focus();try{r.releaseLock()}catch(e){console.error("Ignoring release lock error",e)}}async disconnect(){this._cancelConnection&&(await this._cancelConnection(),this._cancelConnection=void 0)}async reset(){this.logger.debug("Triggering reset"),await this.port.setSignals({dataTerminalReady:!1,requestToSend:!0}),await xe(250),await this.port.setSignals({dataTerminalReady:!1,requestToSend:!1}),await xe(250),await new Promise((e=>setTimeout(e,1e3)))}}function Se(e,t=!0){return t&&"rtl"===getComputedStyle(e).getPropertyValue("direction").trim()}customElements.define("ewt-console",Ee);const Ae=l(m(r));class Te extends Ae{get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get form(){return this[f].form}get labels(){return this[f].labels}constructor(){super(),this.disabled=!1,this.softDisabled=!1,this.flipIconInRtl=!1,this.href="",this.target="",this.ariaLabelSelected="",this.toggle=!1,this.selected=!1,this.type="submit",this.value="",this.flipIcon=Se(this,this.flipIconInRtl),this.addEventListener("click",this.handleClick.bind(this))}willUpdate(){this.href&&(this.disabled=!1,this.softDisabled=!1)}render(){const e=this.href?X`div`:X`button`,{ariaLabel:t,ariaHasPopup:i,ariaExpanded:r}=this,o=t&&this.ariaLabelSelected,a=this.toggle?this.selected:c;let s=c;return this.href||(s=o&&this.selected?this.ariaLabelSelected:t),Q`<${e}
|
90 | class="icon-button ${h(this.getRenderClasses())}"
|
91 | id="button"
|
92 | aria-label="${s||c}"
|
93 | aria-haspopup="${!this.href&&i||c}"
|
94 | aria-expanded="${!this.href&&r||c}"
|
95 | aria-pressed="${a}"
|
96 | aria-disabled=${!this.href&&this.softDisabled||c}
|
97 | ?disabled="${!this.href&&this.disabled}"
|
98 | @click="${this.handleClickOnChild}">
|
99 | ${this.renderFocusRing()}
|
100 | ${this.renderRipple()}
|
101 | ${this.selected?c:this.renderIcon()}
|
102 | ${this.selected?this.renderSelectedIcon():c}
|
103 | ${this.renderTouchTarget()}
|
104 | ${this.href&&this.renderLink()}
|
105 | </${e}>`}renderLink(){const{ariaLabel:e}=this;return o`
|
106 | <a
|
107 | class="link"
|
108 | id="link"
|
109 | href="${this.href}"
|
110 | target="${this.target||c}"
|
111 | aria-label="${e||c}"></a>
|
112 | `}getRenderClasses(){return{"flip-icon":this.flipIcon,selected:this.toggle&&this.selected}}renderIcon(){return o`<span class="icon"><slot></slot></span>`}renderSelectedIcon(){return o`<span class="icon icon--selected"
|
113 | ><slot name="selected"><slot></slot></slot
|
114 | ></span>`}renderTouchTarget(){return o`<span class="touch"></span>`}renderFocusRing(){return o`<md-focus-ring
|
115 | part="focus-ring"
|
116 | for=${this.href?"link":"button"}></md-focus-ring>`}renderRipple(){const e=!this.href&&(this.disabled||this.softDisabled);return o`<md-ripple
|
117 | for=${this.href?"link":c}
|
118 | ?disabled="${e}"></md-ripple>`}connectedCallback(){this.flipIcon=Se(this,this.flipIconInRtl),super.connectedCallback()}handleClick(e){if(!this.href&&this.softDisabled)return e.stopImmediatePropagation(),void e.preventDefault()}async handleClickOnChild(e){await 0,!this.toggle||this.disabled||this.softDisabled||e.defaultPrevented||(this.selected=!this.selected,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}}y(Te),Te.formAssociated=!0,Te.shadowRootOptions={mode:"open",delegatesFocus:!0},t([s({type:Boolean,reflect:!0})],Te.prototype,"disabled",void 0),t([s({type:Boolean,attribute:"soft-disabled",reflect:!0})],Te.prototype,"softDisabled",void 0),t([s({type:Boolean,attribute:"flip-icon-in-rtl"})],Te.prototype,"flipIconInRtl",void 0),t([s()],Te.prototype,"href",void 0),t([s()],Te.prototype,"target",void 0),t([s({attribute:"aria-label-selected"})],Te.prototype,"ariaLabelSelected",void 0),t([s({type:Boolean})],Te.prototype,"toggle",void 0),t([s({type:Boolean,reflect:!0})],Te.prototype,"selected",void 0),t([s()],Te.prototype,"type",void 0),t([s({reflect:!0})],Te.prototype,"value",void 0),t([v()],Te.prototype,"flipIcon",void 0);const Ce=a`:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:var(--_container-height);width:var(--_container-width);justify-content:center}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) max(0px,(48px - var(--_container-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){pointer-events:none}.icon-button{place-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;place-content:center;outline:none;padding:0;position:relative;text-decoration:none;user-select:none;z-index:0;flex:1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.icon ::slotted(*){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size);font-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.flip-icon .icon{transform:scaleX(-1)}.icon{display:inline-flex}.link{height:100%;outline:none;position:absolute;width:100%}.touch{position:absolute;height:max(48px,100%);width:max(48px,100%)}:host([touch-target=none]) .touch{display:none}@media(forced-colors: active){:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1}}
|
119 | `,Re=a`:host{--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-icon-button-disabled-icon-opacity, 0.38);--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-height: var(--md-icon-button-state-layer-height, 40px);--_state-layer-shape: var(--md-icon-button-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));--_state-layer-width: var(--md-icon-button-state-layer-width, 40px);--_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-icon-button-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-icon-button-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-icon-button-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-opacity: var(--md-icon-button-pressed-state-layer-opacity, 0.12);--_container-shape-start-start: 0;--_container-shape-start-end: 0;--_container-shape-end-end: 0;--_container-shape-end-start: 0;--_container-height: 0;--_container-width: 0;height:var(--_state-layer-height);width:var(--_state-layer-width)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_state-layer-height))/2) max(0px,(48px - var(--_state-layer-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_state-layer-shape);--md-focus-ring-shape-start-end: var(--_state-layer-shape);--md-focus-ring-shape-end-end: var(--_state-layer-shape);--md-focus-ring-shape-end-start: var(--_state-layer-shape)}.standard{background-color:rgba(0,0,0,0);color:var(--_icon-color);--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}.standard:hover{color:var(--_hover-icon-color)}.standard:focus{color:var(--_focus-icon-color)}.standard:active{color:var(--_pressed-icon-color)}.standard:is(:disabled,[aria-disabled=true]){color:var(--_disabled-icon-color)}md-ripple{border-radius:var(--_state-layer-shape)}.standard:is(:disabled,[aria-disabled=true]){opacity:var(--_disabled-icon-opacity)}.selected{--md-ripple-hover-color: var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity: var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_selected-pressed-state-layer-opacity)}.selected:not(:disabled,[aria-disabled=true]){color:var(--_selected-icon-color)}.selected:not(:disabled,[aria-disabled=true]):hover{color:var(--_selected-hover-icon-color)}.selected:not(:disabled,[aria-disabled=true]):focus{color:var(--_selected-focus-icon-color)}.selected:not(:disabled,[aria-disabled=true]):active{color:var(--_selected-pressed-icon-color)}
|
120 | `;class Ie extends Te{}Ie.styles=[Ce,Re],customElements.define("ew-icon-button",Ie);const $e=a`:host{--_active-indicator-color: var(--md-filled-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-text-field-active-indicator-height, 1px);--_caret-color: var(--md-filled-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-color: var(--md-filled-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_disabled-active-indicator-color: var(--md-filled-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-text-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-text-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-text-field-disabled-container-opacity, 0.04);--_disabled-input-text-color: var(--md-filled-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-input-text-opacity: var(--md-filled-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-filled-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-filled-text-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-caret-color: var(--md-filled-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-filled-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-filled-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-input-text-color: var(--md-filled-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-text-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-filled-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-label-text-color: var(--md-filled-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-text-field-focus-active-indicator-height, 3px);--_focus-input-text-color: var(--md-filled-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-text-field-hover-active-indicator-height, 1px);--_hover-input-text-color: var(--md-filled-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-text-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-filled-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_input-text-font: var(--md-filled-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_input-text-line-height: var(--md-filled-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_input-text-placeholder-color: var(--md-filled-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-filled-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-filled-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_input-text-suffix-color: var(--md-filled-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-weight: var(--md-filled-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_label-text-color: var(--md-filled-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-filled-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-filled-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-filled-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-filled-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-icon-color: var(--md-filled-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-text-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-line-height: var(--md-filled-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-filled-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-weight: var(--md-filled-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_trailing-icon-color: var(--md-filled-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-text-field-trailing-icon-size, 24px);--_container-shape-start-start: var(--md-filled-text-field-container-shape-start-start, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-filled-text-field-container-shape-start-end, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-filled-text-field-container-shape-end-end, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-filled-text-field-container-shape-end-start, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_icon-input-space: var(--md-filled-text-field-icon-input-space, 16px);--_leading-space: var(--md-filled-text-field-leading-space, 16px);--_trailing-space: var(--md-filled-text-field-trailing-space, 16px);--_top-space: var(--md-filled-text-field-top-space, 16px);--_bottom-space: var(--md-filled-text-field-bottom-space, 16px);--_input-text-prefix-trailing-space: var(--md-filled-text-field-input-text-prefix-trailing-space, 2px);--_input-text-suffix-leading-space: var(--md-filled-text-field-input-text-suffix-leading-space, 2px);--_with-label-top-space: var(--md-filled-text-field-with-label-top-space, 8px);--_with-label-bottom-space: var(--md-filled-text-field-with-label-bottom-space, 8px);--_focus-caret-color: var(--md-filled-text-field-focus-caret-color, var(--md-sys-color-primary, #6750a4));--_with-leading-icon-leading-space: var(--md-filled-text-field-with-leading-icon-leading-space, 12px);--_with-trailing-icon-trailing-space: var(--md-filled-text-field-with-trailing-icon-trailing-space, 12px);--md-filled-field-active-indicator-color: var(--_active-indicator-color);--md-filled-field-active-indicator-height: var(--_active-indicator-height);--md-filled-field-bottom-space: var(--_bottom-space);--md-filled-field-container-color: var(--_container-color);--md-filled-field-container-shape-end-end: var(--_container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_container-shape-start-start);--md-filled-field-content-color: var(--_input-text-color);--md-filled-field-content-font: var(--_input-text-font);--md-filled-field-content-line-height: var(--_input-text-line-height);--md-filled-field-content-size: var(--_input-text-size);--md-filled-field-content-space: var(--_icon-input-space);--md-filled-field-content-weight: var(--_input-text-weight);--md-filled-field-disabled-active-indicator-color: var(--_disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_error-active-indicator-color);--md-filled-field-error-content-color: var(--_error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_error-label-text-color);--md-filled-field-error-leading-content-color: var(--_error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_label-text-color);--md-filled-field-label-text-font: var(--_label-text-font);--md-filled-field-label-text-line-height: var(--_label-text-line-height);--md-filled-field-label-text-populated-line-height: var(--_label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_label-text-populated-size);--md-filled-field-label-text-size: var(--_label-text-size);--md-filled-field-label-text-weight: var(--_label-text-weight);--md-filled-field-leading-content-color: var(--_leading-icon-color);--md-filled-field-leading-space: var(--_leading-space);--md-filled-field-supporting-text-color: var(--_supporting-text-color);--md-filled-field-supporting-text-font: var(--_supporting-text-font);--md-filled-field-supporting-text-line-height: var(--_supporting-text-line-height);--md-filled-field-supporting-text-size: var(--_supporting-text-size);--md-filled-field-supporting-text-weight: var(--_supporting-text-weight);--md-filled-field-top-space: var(--_top-space);--md-filled-field-trailing-content-color: var(--_trailing-icon-color);--md-filled-field-trailing-space: var(--_trailing-space);--md-filled-field-with-label-bottom-space: var(--_with-label-bottom-space);--md-filled-field-with-label-top-space: var(--_with-label-top-space);--md-filled-field-with-leading-content-leading-space: var(--_with-leading-icon-leading-space);--md-filled-field-with-trailing-content-trailing-space: var(--_with-trailing-icon-trailing-space)}
|
121 | `;class Le extends r{constructor(){super(...arguments),this.disabled=!1,this.error=!1,this.focused=!1,this.label="",this.noAsterisk=!1,this.populated=!1,this.required=!1,this.resizable=!1,this.supportingText="",this.errorText="",this.count=-1,this.max=-1,this.hasStart=!1,this.hasEnd=!1,this.isAnimating=!1,this.refreshErrorAlert=!1,this.disableTransitions=!1}get counterText(){const e=this.count??-1,t=this.max??-1;return e<0||t<=0?"":`${e} / ${t}`}get supportingOrErrorText(){return this.error&&this.errorText?this.errorText:this.supportingText}reannounceError(){this.refreshErrorAlert=!0}update(e){e.has("disabled")&&void 0!==e.get("disabled")&&(this.disableTransitions=!0),this.disabled&&this.focused&&(e.set("focused",!0),this.focused=!1),this.animateLabelIfNeeded({wasFocused:e.get("focused"),wasPopulated:e.get("populated")}),super.update(e)}render(){var e,t,i,r;const a=this.renderLabel(!0),s=this.renderLabel(!1),n=null===(e=this.renderOutline)||void 0===e?void 0:e.call(this,a),l={disabled:this.disabled,"disable-transitions":this.disableTransitions,error:this.error&&!this.disabled,focused:this.focused,"with-start":this.hasStart,"with-end":this.hasEnd,populated:this.populated,resizable:this.resizable,required:this.required,"no-label":!this.label};return o`
|
122 | <div class="field ${h(l)}">
|
123 | <div class="container-overflow">
|
124 | ${null===(t=this.renderBackground)||void 0===t?void 0:t.call(this)}
|
125 | <slot name="container"></slot>
|
126 | ${null===(i=this.renderStateLayer)||void 0===i?void 0:i.call(this)} ${null===(r=this.renderIndicator)||void 0===r?void 0:r.call(this)} ${n}
|
127 | <div class="container">
|
128 | <div class="start">
|
129 | <slot name="start"></slot>
|
130 | </div>
|
131 | <div class="middle">
|
132 | <div class="label-wrapper">
|
133 | ${s} ${n?c:a}
|
134 | </div>
|
135 | <div class="content">
|
136 | <slot></slot>
|
137 | </div>
|
138 | </div>
|
139 | <div class="end">
|
140 | <slot name="end"></slot>
|
141 | </div>
|
142 | </div>
|
143 | </div>
|
144 | ${this.renderSupportingText()}
|
145 | </div>
|
146 | `}updated(e){(e.has("supportingText")||e.has("errorText")||e.has("count")||e.has("max"))&&this.updateSlottedAriaDescribedBy(),this.refreshErrorAlert&&requestAnimationFrame((()=>{this.refreshErrorAlert=!1})),this.disableTransitions&&requestAnimationFrame((()=>{this.disableTransitions=!1}))}renderSupportingText(){const{supportingOrErrorText:e,counterText:t}=this;if(!e&&!t)return c;const i=o`<span>${e}</span>`,r=t?o`<span class="counter">${t}</span>`:c,a=this.error&&this.errorText&&!this.refreshErrorAlert;return o`
|
147 | <div class="supporting-text" role=${a?"alert":c}>${i}${r}</div>
|
148 | <slot
|
149 | name="aria-describedby"
|
150 | @slotchange=${this.updateSlottedAriaDescribedBy}></slot>
|
151 | `}updateSlottedAriaDescribedBy(){for(const e of this.slottedAriaDescribedBy)x(o`${this.supportingOrErrorText} ${this.counterText}`,e),e.setAttribute("hidden","")}renderLabel(e){if(!this.label)return c;let t;t=e?this.focused||this.populated||this.isAnimating:!this.focused&&!this.populated&&!this.isAnimating;const i={hidden:!t,floating:e,resting:!e},r=`${this.label}${this.required&&!this.noAsterisk?"*":""}`;return o`
|
152 | <span class="label ${h(i)}" aria-hidden=${!t}
|
153 | >${r}</span
|
154 | >
|
155 | `}animateLabelIfNeeded({wasFocused:e,wasPopulated:t}){var i,r,o;if(!this.label)return;e??(e=this.focused),t??(t=this.populated);(e||t)!==(this.focused||this.populated)&&(this.isAnimating=!0,null===(i=this.labelAnimation)||void 0===i||i.cancel(),this.labelAnimation=null===(r=this.floatingLabelEl)||void 0===r?void 0:r.animate(this.getLabelKeyframes(),{duration:150,easing:w.STANDARD}),null===(o=this.labelAnimation)||void 0===o||o.addEventListener("finish",(()=>{this.isAnimating=!1})))}getLabelKeyframes(){const{floatingLabelEl:e,restingLabelEl:t}=this;if(!e||!t)return[];const{x:i,y:r,height:o}=e.getBoundingClientRect(),{x:a,y:s,height:n}=t.getBoundingClientRect(),l=e.scrollWidth,d=t.scrollWidth,c=d/l,h=`translateX(${a-i}px) translateY(${s-r+Math.round((n-o*c)/2)}px) scale(${c})`,p="translateX(0) translateY(0) scale(1)",u=t.clientWidth,f=d>u?u/c+"px":"";return this.focused||this.populated?[{transform:h,width:f},{transform:p,width:f}]:[{transform:p,width:f},{transform:h,width:f}]}getSurfacePositionClientRect(){return this.containerEl.getBoundingClientRect()}}t([s({type:Boolean})],Le.prototype,"disabled",void 0),t([s({type:Boolean})],Le.prototype,"error",void 0),t([s({type:Boolean})],Le.prototype,"focused",void 0),t([s()],Le.prototype,"label",void 0),t([s({type:Boolean,attribute:"no-asterisk"})],Le.prototype,"noAsterisk",void 0),t([s({type:Boolean})],Le.prototype,"populated",void 0),t([s({type:Boolean})],Le.prototype,"required",void 0),t([s({type:Boolean})],Le.prototype,"resizable",void 0),t([s({attribute:"supporting-text"})],Le.prototype,"supportingText",void 0),t([s({attribute:"error-text"})],Le.prototype,"errorText",void 0),t([s({type:Number})],Le.prototype,"count",void 0),t([s({type:Number})],Le.prototype,"max",void 0),t([s({type:Boolean,attribute:"has-start"})],Le.prototype,"hasStart",void 0),t([s({type:Boolean,attribute:"has-end"})],Le.prototype,"hasEnd",void 0),t([i({slot:"aria-describedby"})],Le.prototype,"slottedAriaDescribedBy",void 0),t([v()],Le.prototype,"isAnimating",void 0),t([v()],Le.prototype,"refreshErrorAlert",void 0),t([v()],Le.prototype,"disableTransitions",void 0),t([d(".label.floating")],Le.prototype,"floatingLabelEl",void 0),t([d(".label.resting")],Le.prototype,"restingLabelEl",void 0),t([d(".container")],Le.prototype,"containerEl",void 0);class Oe extends Le{renderBackground(){return o` <div class="background"></div> `}renderStateLayer(){return o` <div class="state-layer"></div> `}renderIndicator(){return o`<div class="active-indicator"></div>`}}const ze=a`@layer styles{:host{--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_bottom-space: var(--md-filled-field-bottom-space, 16px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1d1b20));--_content-font: var(--md-filled-field-content-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_content-line-height: var(--md-filled-field-content-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_content-size: var(--md-filled-field-content-size, var(--md-sys-typescale-body-large-size, 1rem));--_content-space: var(--md-filled-field-content-space, 16px);--_content-weight: var(--md-filled-field-content-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 3px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-filled-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-filled-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-space: var(--md-filled-field-leading-space, 16px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-leading-space: var(--md-filled-field-supporting-text-leading-space, 16px);--_supporting-text-line-height: var(--md-filled-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-filled-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-top-space: var(--md-filled-field-supporting-text-top-space, 4px);--_supporting-text-trailing-space: var(--md-filled-field-supporting-text-trailing-space, 16px);--_supporting-text-weight: var(--md-filled-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_top-space: var(--md-filled-field-top-space, 16px);--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-space: var(--md-filled-field-trailing-space, 16px);--_with-label-bottom-space: var(--md-filled-field-with-label-bottom-space, 8px);--_with-label-top-space: var(--md-filled-field-with-label-top-space, 8px);--_with-leading-content-leading-space: var(--md-filled-field-with-leading-content-leading-space, 12px);--_with-trailing-content-trailing-space: var(--md-filled-field-with-trailing-content-trailing-space, 12px);--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-none, 0px)))}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:var(--_with-label-top-space)}.field:not(.with-start) .label-wrapper{margin-inline-start:var(--_leading-space)}.field:not(.with-end) .label-wrapper{margin-inline-end:var(--_trailing-space)}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%;z-index:1}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .content ::slotted(*){padding-inline-start:var(--_leading-space)}.field:not(.with-end) .content ::slotted(*){padding-inline-end:var(--_trailing-space)}.field:not(.no-label) .content ::slotted(:not(textarea)){padding-bottom:var(--_with-label-bottom-space);padding-top:calc(var(--_with-label-top-space) + var(--_label-text-populated-line-height))}.field:not(.no-label) .content ::slotted(textarea){margin-bottom:var(--_with-label-bottom-space);margin-top:calc(var(--_with-label-top-space) + var(--_label-text-populated-line-height))}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}.resizable .container{bottom:var(--_focus-active-indicator-height);clip-path:inset(var(--_focus-active-indicator-height) 0 0 0)}.resizable .container>*{top:var(--_focus-active-indicator-height)}}@layer hcm{@media(forced-colors: active){.disabled .active-indicator::before{border-color:GrayText;opacity:1}}}
|
156 | `,De=a`:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}slot[name=container]{border-radius:inherit}slot[name=container]::slotted(*){border-radius:inherit;inset:0;pointer-events:none;position:absolute}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}
|
157 | `;let Pe=class extends Oe{};Pe.styles=[De,ze],Pe=t([n("md-filled-field")],Pe);const Be={},Fe=k(class extends E{constructor(e){if(super(e),e.type!==S.PROPERTY&&e.type!==S.ATTRIBUTE&&e.type!==S.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===A||t===c)return t;const i=e.element,r=e.name;if(e.type===S.PROPERTY){if(t===i[r])return A}else if(e.type===S.BOOLEAN_ATTRIBUTE){if(!!t===i.hasAttribute(r))return A}else if(e.type===S.ATTRIBUTE&&i.getAttribute(r)===t+"")return A;return((e,t=Be)=>{e._$AH=t})(e),t}}),Ue="important",Me=" !"+Ue,Ne=k(class extends E{constructor(e){var t;if(super(e),e.type!==S.ATTRIBUTE||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const r=e[i];return null==r?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const r=t[e];if(null!=r){this.ft.add(e);const t="string"==typeof r&&r.endsWith(Me);e.includes("-")||t?i.setProperty(e,t?r.slice(0,-11):r,t?Ue:""):i[e]=r}}return A}}),He={fromAttribute:e=>e??"",toAttribute:e=>e||null},qe=Symbol("onReportValidity"),We=Symbol("privateCleanupFormListeners"),Ze=Symbol("privateDoNotReportInvalid"),Ve=Symbol("privateIsSelfReportingValidity"),je=Symbol("privateCallOnReportValidity");function Ge(e){var t,i,r;class o extends e{constructor(...e){super(...e),this[t]=new AbortController,this[i]=!1,this[r]=!1,this.addEventListener("invalid",(e=>{!this[Ze]&&e.isTrusted&&this.addEventListener("invalid",(()=>{this[je](e)}),{once:!0})}),{capture:!0})}checkValidity(){this[Ze]=!0;const e=super.checkValidity();return this[Ze]=!1,e}reportValidity(){this[Ve]=!0;const e=super.reportValidity();return e&&this[je](null),this[Ve]=!1,e}[(t=We,i=Ze,r=Ve,je)](e){const t=null==e?void 0:e.defaultPrevented;if(t)return;this[qe](e);!t&&(null==e?void 0:e.defaultPrevented)&&(this[Ve]||function(e,t){if(!e)return!0;let i;for(const t of e.elements)if(t.matches(":invalid")){i=t;break}return i===t}(this[f].form,this))&&this.focus()}[qe](e){throw new Error("Implement [onReportValidity]")}formAssociatedCallback(e){super.formAssociatedCallback&&super.formAssociatedCallback(e),this[We].abort(),e&&(this[We]=new AbortController,function(e,t,i,r){const o=function(e){if(!Ke.has(e)){const t=new EventTarget;Ke.set(e,t);for(const i of["reportValidity","requestSubmit"]){const r=e[i];e[i]=function(){t.dispatchEvent(new Event("before"));const e=Reflect.apply(r,this,arguments);return t.dispatchEvent(new Event("after")),e}}}return Ke.get(e)}(t);let a,s=!1,n=!1;o.addEventListener("before",(()=>{n=!0,a=new AbortController,s=!1,e.addEventListener("invalid",(()=>{s=!0}),{signal:a.signal})}),{signal:r}),o.addEventListener("after",(()=>{var e;n=!1,null===(e=a)||void 0===e||e.abort(),s||i()}),{signal:r}),t.addEventListener("submit",(()=>{n||i()}),{signal:r})}(this,e,(()=>{this[je](null)}),this[We].signal))}}return o}const Ke=new WeakMap;class Ye extends fe{computeValidity({state:e,renderedControl:t}){let i=t;Xe(e)&&!i?(i=this.inputControl||document.createElement("input"),this.inputControl=i):i||(i=this.textAreaControl||document.createElement("textarea"),this.textAreaControl=i);const r=Xe(e)?i:null;if(r&&(r.type=e.type),i.value!==e.value&&(i.value=e.value),i.required=e.required,r){const t=e;t.pattern?r.pattern=t.pattern:r.removeAttribute("pattern"),t.min?r.min=t.min:r.removeAttribute("min"),t.max?r.max=t.max:r.removeAttribute("max"),t.step?r.step=t.step:r.removeAttribute("step")}return(e.minLength??-1)>-1?i.setAttribute("minlength",String(e.minLength)):i.removeAttribute("minlength"),(e.maxLength??-1)>-1?i.setAttribute("maxlength",String(e.maxLength)):i.removeAttribute("maxlength"),{validity:i.validity,validationMessage:i.validationMessage}}equals({state:e},{state:t}){const i=e.type===t.type&&e.value===t.value&&e.required===t.required&&e.minLength===t.minLength&&e.maxLength===t.maxLength;return Xe(e)&&Xe(t)?i&&e.pattern===t.pattern&&e.min===t.min&&e.max===t.max&&e.step===t.step:i}copy({state:e}){return{state:Xe(e)?this.copyInput(e):this.copyTextArea(e),renderedControl:null}}copyInput(e){const{type:t,pattern:i,min:r,max:o,step:a}=e;return{...this.copySharedState(e),type:t,pattern:i,min:r,max:o,step:a}}copyTextArea(e){return{...this.copySharedState(e),type:e.type}}copySharedState({value:e,required:t,minLength:i,maxLength:r}){return{value:e,required:t,minLength:i,maxLength:r}}}function Xe(e){return"textarea"!==e.type}const Je=l(Ge(ce(ue(m(r)))));class Qe extends Je{constructor(){super(...arguments),this.error=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.required=!1,this.value="",this.prefixText="",this.suffixText="",this.hasLeadingIcon=!1,this.hasTrailingIcon=!1,this.supportingText="",this.textDirection="",this.rows=2,this.cols=20,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.noSpinner=!1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText=""}get selectionDirection(){return this.getInputOrTextarea().selectionDirection}set selectionDirection(e){this.getInputOrTextarea().selectionDirection=e}get selectionEnd(){return this.getInputOrTextarea().selectionEnd}set selectionEnd(e){this.getInputOrTextarea().selectionEnd=e}get selectionStart(){return this.getInputOrTextarea().selectionStart}set selectionStart(e){this.getInputOrTextarea().selectionStart=e}get valueAsNumber(){const e=this.getInput();return e?e.valueAsNumber:NaN}set valueAsNumber(e){const t=this.getInput();t&&(t.valueAsNumber=e,this.value=t.value)}get valueAsDate(){const e=this.getInput();return e?e.valueAsDate:null}set valueAsDate(e){const t=this.getInput();t&&(t.valueAsDate=e,this.value=t.value)}get hasError(){return this.error||this.nativeError}select(){this.getInputOrTextarea().select()}setRangeText(...e){this.getInputOrTextarea().setRangeText(...e),this.value=this.getInputOrTextarea().value}setSelectionRange(e,t,i){this.getInputOrTextarea().setSelectionRange(e,t,i)}stepDown(e){const t=this.getInput();t&&(t.stepDown(e),this.value=t.value)}stepUp(e){const t=this.getInput();t&&(t.stepUp(e),this.value=t.value)}reset(){this.dirty=!1,this.value=this.getAttribute("value")??"",this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(e,t,i){"value"===e&&this.dirty||super.attributeChangedCallback(e,t,i)}render(){const e={disabled:this.disabled,error:!this.disabled&&this.hasError,textarea:"textarea"===this.type,"no-spinner":this.noSpinner};return o`
|
158 | <span class="text-field ${h(e)}">
|
159 | ${this.renderField()}
|
160 | </span>
|
161 | `}updated(e){const t=this.getInputOrTextarea().value;this.value!==t&&(this.value=t)}renderField(){return Q`<${this.fieldTag}
|
162 | class="field"
|
163 | count=${this.value.length}
|
164 | ?disabled=${this.disabled}
|
165 | ?error=${this.hasError}
|
166 | error-text=${this.getErrorText()}
|
167 | ?focused=${this.focused}
|
168 | ?has-end=${this.hasTrailingIcon}
|
169 | ?has-start=${this.hasLeadingIcon}
|
170 | label=${this.label}
|
171 | ?no-asterisk=${this.noAsterisk}
|
172 | max=${this.maxLength}
|
173 | ?populated=${!!this.value}
|
174 | ?required=${this.required}
|
175 | ?resizable=${"textarea"===this.type}
|
176 | supporting-text=${this.supportingText}
|
177 | >
|
178 | ${this.renderLeadingIcon()}
|
179 | ${this.renderInputOrTextarea()}
|
180 | ${this.renderTrailingIcon()}
|
181 | <div id="description" slot="aria-describedby"></div>
|
182 | <slot name="container" slot="container"></slot>
|
183 | </${this.fieldTag}>`}renderLeadingIcon(){return o`
|
184 | <span class="icon leading" slot="start">
|
185 | <slot name="leading-icon" @slotchange=${this.handleIconChange}></slot>
|
186 | </span>
|
187 | `}renderTrailingIcon(){return o`
|
188 | <span class="icon trailing" slot="end">
|
189 | <slot name="trailing-icon" @slotchange=${this.handleIconChange}></slot>
|
190 | </span>
|
191 | `}renderInputOrTextarea(){const e={direction:this.textDirection},t=this.ariaLabel||this.label||c,i=this.autocomplete,r=(this.maxLength??-1)>-1,a=(this.minLength??-1)>-1;if("textarea"===this.type)return o`
|
192 | <textarea
|
193 | class="input"
|
194 | style=${Ne(e)}
|
195 | aria-describedby="description"
|
196 | aria-invalid=${this.hasError}
|
197 | aria-label=${t}
|
198 | autocomplete=${i||c}
|
199 | name=${this.name||c}
|
200 | ?disabled=${this.disabled}
|
201 | maxlength=${r?this.maxLength:c}
|
202 | minlength=${a?this.minLength:c}
|
203 | placeholder=${this.placeholder||c}
|
204 | ?readonly=${this.readOnly}
|
205 | ?required=${this.required}
|
206 | rows=${this.rows}
|
207 | cols=${this.cols}
|
208 | .value=${Fe(this.value)}
|
209 | @change=${this.redispatchEvent}
|
210 | @focus=${this.handleFocusChange}
|
211 | @blur=${this.handleFocusChange}
|
212 | @input=${this.handleInput}
|
213 | @select=${this.redispatchEvent}></textarea>
|
214 | `;const s=this.renderPrefix(),n=this.renderSuffix(),l=this.inputMode;return o`
|
215 | <div class="input-wrapper">
|
216 | ${s}
|
217 | <input
|
218 | class="input"
|
219 | style=${Ne(e)}
|
220 | aria-describedby="description"
|
221 | aria-invalid=${this.hasError}
|
222 | aria-label=${t}
|
223 | autocomplete=${i||c}
|
224 | name=${this.name||c}
|
225 | ?disabled=${this.disabled}
|
226 | inputmode=${l||c}
|
227 | max=${this.max||c}
|
228 | maxlength=${r?this.maxLength:c}
|
229 | min=${this.min||c}
|
230 | minlength=${a?this.minLength:c}
|
231 | pattern=${this.pattern||c}
|
232 | placeholder=${this.placeholder||c}
|
233 | ?readonly=${this.readOnly}
|
234 | ?required=${this.required}
|
235 | ?multiple=${this.multiple}
|
236 | step=${this.step||c}
|
237 | type=${this.type}
|
238 | .value=${Fe(this.value)}
|
239 | @change=${this.redispatchEvent}
|
240 | @focus=${this.handleFocusChange}
|
241 | @blur=${this.handleFocusChange}
|
242 | @input=${this.handleInput}
|
243 | @select=${this.redispatchEvent} />
|
244 | ${n}
|
245 | </div>
|
246 | `}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(e,t){if(!e)return c;return o`<span class="${h({suffix:t,prefix:!t})}">${e}</span>`}getErrorText(){return this.error?this.errorText:this.nativeErrorText}handleFocusChange(){var e;this.focused=(null===(e=this.inputOrTextarea)||void 0===e?void 0:e.matches(":focus"))??!1}handleInput(e){this.dirty=!0,this.value=e.target.value}redispatchEvent(e){_(this,e)}getInputOrTextarea(){return this.inputOrTextarea||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.inputOrTextarea}getInput(){return"textarea"===this.type?null:this.getInputOrTextarea()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0,this.hasTrailingIcon=this.trailingIcons.length>0}[he](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}focus(){this.getInputOrTextarea().focus()}[ae](){return new Ye((()=>({state:this,renderedControl:this.inputOrTextarea})))}[se](){return this.inputOrTextarea}[qe](e){null==e||e.preventDefault();const t=this.getErrorText();var i;(this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText())&&(null===(i=this.field)||void 0===i||i.reannounceError())}}Qe.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([s({type:Boolean,reflect:!0})],Qe.prototype,"error",void 0),t([s({attribute:"error-text"})],Qe.prototype,"errorText",void 0),t([s()],Qe.prototype,"label",void 0),t([s({type:Boolean,attribute:"no-asterisk"})],Qe.prototype,"noAsterisk",void 0),t([s({type:Boolean,reflect:!0})],Qe.prototype,"required",void 0),t([s()],Qe.prototype,"value",void 0),t([s({attribute:"prefix-text"})],Qe.prototype,"prefixText",void 0),t([s({attribute:"suffix-text"})],Qe.prototype,"suffixText",void 0),t([s({type:Boolean,attribute:"has-leading-icon"})],Qe.prototype,"hasLeadingIcon",void 0),t([s({type:Boolean,attribute:"has-trailing-icon"})],Qe.prototype,"hasTrailingIcon",void 0),t([s({attribute:"supporting-text"})],Qe.prototype,"supportingText",void 0),t([s({attribute:"text-direction"})],Qe.prototype,"textDirection",void 0),t([s({type:Number})],Qe.prototype,"rows",void 0),t([s({type:Number})],Qe.prototype,"cols",void 0),t([s({reflect:!0})],Qe.prototype,"inputMode",void 0),t([s()],Qe.prototype,"max",void 0),t([s({type:Number})],Qe.prototype,"maxLength",void 0),t([s()],Qe.prototype,"min",void 0),t([s({type:Number})],Qe.prototype,"minLength",void 0),t([s({type:Boolean,attribute:"no-spinner"})],Qe.prototype,"noSpinner",void 0),t([s()],Qe.prototype,"pattern",void 0),t([s({reflect:!0,converter:He})],Qe.prototype,"placeholder",void 0),t([s({type:Boolean,reflect:!0})],Qe.prototype,"readOnly",void 0),t([s({type:Boolean,reflect:!0})],Qe.prototype,"multiple",void 0),t([s()],Qe.prototype,"step",void 0),t([s({reflect:!0})],Qe.prototype,"type",void 0),t([s({reflect:!0})],Qe.prototype,"autocomplete",void 0),t([v()],Qe.prototype,"dirty",void 0),t([v()],Qe.prototype,"focused",void 0),t([v()],Qe.prototype,"nativeError",void 0),t([v()],Qe.prototype,"nativeErrorText",void 0),t([d(".input")],Qe.prototype,"inputOrTextarea",void 0),t([d(".field")],Qe.prototype,"field",void 0),t([i({slot:"leading-icon"})],Qe.prototype,"leadingIcons",void 0),t([i({slot:"trailing-icon"})],Qe.prototype,"trailingIcons",void 0);class et extends Qe{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}const tt=a`:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}slot[name=container]{border-radius:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}
|
247 | `;class it extends et{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}it.styles=[tt,$e],customElements.define("ew-filled-text-field",it);class rt extends r{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return o`<span class="shadow"></span>`}}const ot=a`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}
|
248 | `;let at=class extends rt{};at.styles=[ot],at=t([n("md-elevation")],at);const st=function(e,t){return new CustomEvent("close-menu",{bubbles:!0,composed:!0,detail:{initiator:e,reason:t,itemPath:[e]}})},nt={SPACE:"Space",ENTER:"Enter"},lt="click-selection",dt="keydown",ct={ESCAPE:"Escape",SPACE:nt.SPACE,ENTER:nt.ENTER};function ht(e){return Object.values(ct).some((t=>t===e))}function pt(e,t){const i=new Event("md-contains",{bubbles:!0,composed:!0});let r=[];const o=e=>{r=e.composedPath()};t.addEventListener("md-contains",o),e.dispatchEvent(i),t.removeEventListener("md-contains",o);return r.length>0}const ut="none",ft="list-root",mt="first-item",vt="last-item",gt="end-start",bt="start-start";class _t{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:i,surfaceCorner:r,positioning:o,xOffset:a,yOffset:s,disableBlockFlip:n,disableInlineFlip:l,repositionStrategy:d}=this.getProperties(),c=i.toLowerCase().trim(),h=r.toLowerCase().trim();if(!e||!t)return;const p=window.innerWidth,u=window.innerHeight,f=document.createElement("div");f.style.opacity="0",f.style.position="fixed",f.style.display="block",f.style.inset="0",document.body.appendChild(f);const m=f.getBoundingClientRect();f.remove();const v=window.innerHeight-m.bottom,g=window.innerWidth-m.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,e.popover&&e.isConnected&&e.showPopover();const b=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),_=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),[y,x]=h.split("-"),[w,k]=c.split("-"),E="ltr"===getComputedStyle(e).direction;let{blockInset:S,blockOutOfBoundsCorrection:A,surfaceBlockProperty:T}=this.calculateBlock({surfaceRect:b,anchorRect:_,anchorBlock:w,surfaceBlock:y,yOffset:s,positioning:o,windowInnerHeight:u,blockScrollbarHeight:v});if(A&&!n){const e="start"===y?"end":"start",t="start"===w?"end":"start",i=this.calculateBlock({surfaceRect:b,anchorRect:_,anchorBlock:t,surfaceBlock:e,yOffset:s,positioning:o,windowInnerHeight:u,blockScrollbarHeight:v});A>i.blockOutOfBoundsCorrection&&(S=i.blockInset,A=i.blockOutOfBoundsCorrection,T=i.surfaceBlockProperty)}let{inlineInset:C,inlineOutOfBoundsCorrection:R,surfaceInlineProperty:I}=this.calculateInline({surfaceRect:b,anchorRect:_,anchorInline:k,surfaceInline:x,xOffset:a,positioning:o,isLTR:E,windowInnerWidth:p,inlineScrollbarWidth:g});if(R&&!l){const e="start"===x?"end":"start",t="start"===k?"end":"start",i=this.calculateInline({surfaceRect:b,anchorRect:_,anchorInline:t,surfaceInline:e,xOffset:a,positioning:o,isLTR:E,windowInnerWidth:p,inlineScrollbarWidth:g});Math.abs(R)>Math.abs(i.inlineOutOfBoundsCorrection)&&(C=i.inlineInset,R=i.inlineOutOfBoundsCorrection,I=i.surfaceInlineProperty)}"move"===d&&(S-=A,C-=R),this.surfaceStylesInternal={display:"block",opacity:"1",[T]:`${S}px`,[I]:`${C}px`},"resize"===d&&(A&&(this.surfaceStylesInternal.height=b.height-A+"px"),R&&(this.surfaceStylesInternal.width=b.width-R+"px")),this.host.requestUpdate()}calculateBlock(e){const{surfaceRect:t,anchorRect:i,anchorBlock:r,surfaceBlock:o,yOffset:a,positioning:s,windowInnerHeight:n,blockScrollbarHeight:l}=e,d="fixed"===s||"document"===s?1:0,c="document"===s?1:0,h="start"===o?1:0,p="end"===o?1:0,u=(r!==o?1:0)*i.height+a,f=h*i.top+p*(n-i.bottom-l);return{blockInset:d*f+c*(h*window.scrollY-p*window.scrollY)+u,blockOutOfBoundsCorrection:Math.abs(Math.min(0,n-f-u-t.height)),surfaceBlockProperty:"start"===o?"inset-block-start":"inset-block-end"}}calculateInline(e){const{isLTR:t,surfaceInline:i,anchorInline:r,anchorRect:o,surfaceRect:a,xOffset:s,positioning:n,windowInnerWidth:l,inlineScrollbarWidth:d}=e,c="fixed"===n||"document"===n?1:0,h="document"===n?1:0,p=t?1:0,u=t?0:1,f="start"===i?1:0,m="end"===i?1:0,v=(r!==i?1:0)*o.width+s,g=p*(f*o.left+m*(l-o.right-d))+u*(f*(l-o.right-d)+m*o.left);let b="start"===i?"inset-inline-start":"inset-inline-end";return"document"!==n&&"fixed"!==n||(b="start"===i&&t||"end"===i&&!t?"left":"right"),{inlineInset:c*g+v+h*(p*(f*window.scrollX-m*window.scrollX)+u*(m*window.scrollX-f*window.scrollX)),inlineOutOfBoundsCorrection:Math.abs(Math.min(0,l-g-v-a.width)),surfaceInlineProperty:b}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const e=this.getProperties();let t=!1;for(const[i,r]of Object.entries(e))if(t=t||r!==this.lastValues[i],t)break;const i=this.lastValues.isOpen!==e.isOpen,r=!!e.anchorEl,o=!!e.surfaceEl;t&&r&&o&&(this.lastValues.isOpen=e.isOpen,e.isOpen?(this.lastValues=e,await this.position(),e.onOpen()):i&&(await e.beforeClose(),this.close(),e.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const e=this.getProperties().surfaceEl;null!=e&&e.popover&&null!=e&&e.isConnected&&e.hidePopover()}}const yt=0,xt=1,wt=2;class kt{constructor(e){this.getProperties=e,this.typeaheadRecords=[],this.typaheadBuffer="",this.cancelTypeaheadTimeout=0,this.isTypingAhead=!1,this.lastActiveRecord=null,this.onKeydown=e=>{this.isTypingAhead?this.typeahead(e):this.beginTypeahead(e)},this.endTypeahead=()=>{this.isTypingAhead=!1,this.typaheadBuffer="",this.typeaheadRecords=[]}}get items(){return this.getProperties().getItems()}get active(){return this.getProperties().active}beginTypeahead(e){this.active&&("Space"===e.code||"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code||(this.isTypingAhead=!0,this.typeaheadRecords=this.items.map(((e,t)=>[t,e,e.typeaheadText.trim().toLowerCase()])),this.lastActiveRecord=this.typeaheadRecords.find((e=>0===e[xt].tabIndex))??null,this.lastActiveRecord&&(this.lastActiveRecord[xt].tabIndex=-1),this.typeahead(e)))}typeahead(e){if(e.defaultPrevented)return;if(clearTimeout(this.cancelTypeaheadTimeout),"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code)return this.endTypeahead(),void(this.lastActiveRecord&&(this.lastActiveRecord[xt].tabIndex=-1));"Space"===e.code&&e.preventDefault(),this.cancelTypeaheadTimeout=setTimeout(this.endTypeahead,this.getProperties().typeaheadBufferTime),this.typaheadBuffer+=e.key.toLowerCase();const t=this.lastActiveRecord?this.lastActiveRecord[yt]:-1,i=this.typeaheadRecords.length,r=e=>(e[yt]+i-t)%i,o=this.typeaheadRecords.filter((e=>!e[xt].disabled&&e[wt].startsWith(this.typaheadBuffer))).sort(((e,t)=>r(e)-r(t)));if(0===o.length)return clearTimeout(this.cancelTypeaheadTimeout),this.lastActiveRecord&&(this.lastActiveRecord[xt].tabIndex=-1),void this.endTypeahead();const a=1===this.typaheadBuffer.length;let s;s=this.lastActiveRecord===o[0]&&a?o[1]??o[0]:o[0],this.lastActiveRecord&&(this.lastActiveRecord[xt].tabIndex=-1),this.lastActiveRecord=s,s[xt].tabIndex=0,s[xt].focus()}}const Et=new Set([U.ArrowDown,U.ArrowUp,U.Home,U.End]),St=new Set([U.ArrowLeft,U.ArrowRight,...Et]);class At extends r{get openDirection(){return"start"===this.menuCorner.split("-")[0]?"DOWN":"UP"}get anchorElement(){return this.anchor?this.getRootNode().querySelector(`#${this.anchor}`):this.currentAnchorElement}set anchorElement(e){this.currentAnchorElement=e,this.requestUpdate("anchorElement")}constructor(){super(),this.anchor="",this.positioning="absolute",this.quick=!1,this.hasOverflow=!1,this.open=!1,this.xOffset=0,this.yOffset=0,this.noHorizontalFlip=!1,this.noVerticalFlip=!1,this.typeaheadDelay=200,this.anchorCorner=gt,this.menuCorner=bt,this.stayOpenOnOutsideClick=!1,this.stayOpenOnFocusout=!1,this.skipRestoreFocus=!1,this.defaultFocus=mt,this.noNavigationWrap=!1,this.typeaheadActive=!0,this.isSubmenu=!1,this.pointerPath=[],this.isRepositioning=!1,this.openCloseAnimationSignal=T(),this.listController=new M({isItem:e=>e.hasAttribute("md-menu-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:e=>{e.selected=!1,e.tabIndex=-1},activateItem:e=>{e.selected=!0,e.tabIndex=0},isNavigableKey:e=>{if(!this.isSubmenu)return St.has(e);return e===("rtl"===getComputedStyle(this).direction?U.ArrowLeft:U.ArrowRight)||Et.has(e)},wrapNavigation:()=>!this.noNavigationWrap}),this.lastFocusedElement=null,this.typeaheadController=new kt((()=>({getItems:()=>this.items,typeaheadBufferTime:this.typeaheadDelay,active:this.typeaheadActive}))),this.currentAnchorElement=null,this.internals=this.attachInternals(),this.menuPositionController=new _t(this,(()=>({anchorCorner:this.anchorCorner,surfaceCorner:this.menuCorner,surfaceEl:this.surfaceEl,anchorEl:this.anchorElement,positioning:"popover"===this.positioning?"document":this.positioning,isOpen:this.open,xOffset:this.xOffset,yOffset:this.yOffset,disableBlockFlip:this.noVerticalFlip,disableInlineFlip:this.noHorizontalFlip,onOpen:this.onOpened,beforeClose:this.beforeClose,onClose:this.onClosed,repositionStrategy:this.hasOverflow&&"popover"!==this.positioning?"move":"resize"}))),this.onWindowResize=()=>{this.isRepositioning||"document"!==this.positioning&&"fixed"!==this.positioning&&"popover"!==this.positioning||(this.isRepositioning=!0,this.reposition(),this.isRepositioning=!1)},this.handleFocusout=async e=>{const t=this.anchorElement;if(this.stayOpenOnFocusout||!this.open||this.pointerPath.includes(t))return;if(e.relatedTarget){if(pt(e.relatedTarget,this)||0!==this.pointerPath.length&&pt(e.relatedTarget,t))return}else if(this.pointerPath.includes(this))return;const i=this.skipRestoreFocus;this.skipRestoreFocus=!0,this.close(),await this.updateComplete,this.skipRestoreFocus=i},this.onOpened=async()=>{this.lastFocusedElement=function(e=document){let t=e.activeElement;for(;t&&null!==(i=t)&&void 0!==i&&null!==(i=i.shadowRoot)&&void 0!==i&&i.activeElement;){var i;t=t.shadowRoot.activeElement}return t}();const e=this.items,t=O(e);t&&this.defaultFocus!==ut&&(t.item.tabIndex=-1);let i=!this.quick;switch(this.quick?this.dispatchEvent(new Event("opening")):i=!!await this.animateOpen(),this.defaultFocus){case mt:const t=z(e);t&&(t.tabIndex=0,t.focus(),await t.updateComplete);break;case vt:const i=D(e);i&&(i.tabIndex=0,i.focus(),await i.updateComplete);break;case ft:this.focus()}i||this.dispatchEvent(new Event("opened"))},this.beforeClose=async()=>{var e,t;(this.open=!1,this.skipRestoreFocus)||(null===(e=this.lastFocusedElement)||void 0===e||null===(t=e.focus)||void 0===t||t.call(e));this.quick||await this.animateClose()},this.onClosed=()=>{this.quick&&(this.dispatchEvent(new Event("closing")),this.dispatchEvent(new Event("closed")))},this.onWindowPointerdown=e=>{this.pointerPath=e.composedPath()},this.onDocumentClick=e=>{if(!this.open)return;const t=e.composedPath();this.stayOpenOnOutsideClick||t.includes(this)||t.includes(this.anchorElement)||(this.open=!1)},this.internals.role="menu",this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keydown",this.captureKeydown,{capture:!0}),this.addEventListener("focusout",this.handleFocusout)}get items(){return this.listController.items}willUpdate(e){e.has("open")&&(this.open?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"))}update(e){e.has("open")&&(this.open?this.setUpGlobalEventListeners():this.cleanUpGlobalEventListeners()),e.has("positioning")&&"popover"===this.positioning&&!this.showPopover&&(this.positioning="fixed"),super.update(e)}connectedCallback(){super.connectedCallback(),this.open&&this.setUpGlobalEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpGlobalEventListeners()}getBoundingClientRect(){return this.surfaceEl?this.surfaceEl.getBoundingClientRect():super.getBoundingClientRect()}getClientRects(){return this.surfaceEl?this.surfaceEl.getClientRects():super.getClientRects()}render(){return this.renderSurface()}renderSurface(){return o`
|
249 | <div
|
250 | class="menu ${h(this.getSurfaceClasses())}"
|
251 | style=${Ne(this.menuPositionController.surfaceStyles)}
|
252 | popover=${"popover"===this.positioning?"manual":c}>
|
253 | ${this.renderElevation()}
|
254 | <div class="items">
|
255 | <div class="item-padding"> ${this.renderMenuItems()} </div>
|
256 | </div>
|
257 | </div>
|
258 | `}renderMenuItems(){return o`<slot
|
259 | @close-menu=${this.onCloseMenu}
|
260 | @deactivate-items=${this.onDeactivateItems}
|
261 | @request-activation=${this.onRequestActivation}
|
262 | @deactivate-typeahead=${this.handleDeactivateTypeahead}
|
263 | @activate-typeahead=${this.handleActivateTypeahead}
|
264 | @stay-open-on-focusout=${this.handleStayOpenOnFocusout}
|
265 | @close-on-focusout=${this.handleCloseOnFocusout}
|
266 | @slotchange=${this.listController.onSlotchange}></slot>`}renderElevation(){return o`<md-elevation part="elevation"></md-elevation>`}getSurfaceClasses(){return{open:this.open,fixed:"fixed"===this.positioning,"has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&ht(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const i=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const r=this.openCloseAnimationSignal.start(),o=e.offsetHeight,a="UP"===i,s=this.items,n=250/s.length,l=e.animate([{height:"0px"},{height:`${o}px`}],{duration:500,easing:w.EMPHASIZED}),d=t.animate([{transform:a?`translateY(-${o}px)`:""},{transform:""}],{duration:500,easing:w.EMPHASIZED}),c=e.animate([{opacity:0},{opacity:1}],50),h=[];for(let e=0;e<s.length;e++){const t=s[a?s.length-1-e:e],i=t.animate([{opacity:0},{opacity:1}],{duration:250,delay:n*e});t.classList.toggle("md-menu-hidden",!0),i.addEventListener("finish",(()=>{t.classList.toggle("md-menu-hidden",!1)})),h.push([t,i])}let p=e=>{};const u=new Promise((e=>{p=e}));return r.addEventListener("abort",(()=>{l.cancel(),d.cancel(),c.cancel(),h.forEach((([e,t])=>{e.classList.toggle("md-menu-hidden",!1),t.cancel()})),p(!0)})),l.addEventListener("finish",(()=>{e.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),p(!1)})),await u}animateClose(){let e;const t=new Promise((t=>{e=t})),i=this.surfaceEl,r=this.slotEl;if(!i||!r)return e(!1),t;const o="UP"===this.openDirection;this.dispatchEvent(new Event("closing")),i.classList.toggle("animating",!0);const a=this.openCloseAnimationSignal.start(),s=i.offsetHeight,n=this.items,l=150,d=50/n.length,c=i.animate([{height:`${s}px`},{height:.35*s+"px"}],{duration:l,easing:w.EMPHASIZED_ACCELERATE}),h=r.animate([{transform:""},{transform:o?`translateY(-${.65*s}px)`:""}],{duration:l,easing:w.EMPHASIZED_ACCELERATE}),p=i.animate([{opacity:1},{opacity:0}],{duration:50,delay:100}),u=[];for(let e=0;e<n.length;e++){const t=n[o?e:n.length-1-e],i=t.animate([{opacity:1},{opacity:0}],{duration:50,delay:50+d*e});i.addEventListener("finish",(()=>{t.classList.toggle("md-menu-hidden",!0)})),u.push([t,i])}return a.addEventListener("abort",(()=>{c.cancel(),h.cancel(),p.cancel(),u.forEach((([e,t])=>{t.cancel(),e.classList.toggle("md-menu-hidden",!1)})),e(!1)})),c.addEventListener("finish",(()=>{i.classList.toggle("animating",!1),u.forEach((([e])=>{e.classList.toggle("md-menu-hidden",!1)})),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),e(!0)})),t}handleKeydown(e){this.pointerPath=[],this.listController.handleKeydown(e)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(e){e.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(e){e.stopPropagation(),this.listController.onRequestActivation(e)}handleDeactivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1;this.slotItems.forEach((e=>{var t;null===(t=e.close)||void 0===t||t.call(e)}))}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}t([d(".menu")],At.prototype,"surfaceEl",void 0),t([d("slot")],At.prototype,"slotEl",void 0),t([s()],At.prototype,"anchor",void 0),t([s()],At.prototype,"positioning",void 0),t([s({type:Boolean})],At.prototype,"quick",void 0),t([s({type:Boolean,attribute:"has-overflow"})],At.prototype,"hasOverflow",void 0),t([s({type:Boolean,reflect:!0})],At.prototype,"open",void 0),t([s({type:Number,attribute:"x-offset"})],At.prototype,"xOffset",void 0),t([s({type:Number,attribute:"y-offset"})],At.prototype,"yOffset",void 0),t([s({type:Boolean,attribute:"no-horizontal-flip"})],At.prototype,"noHorizontalFlip",void 0),t([s({type:Boolean,attribute:"no-vertical-flip"})],At.prototype,"noVerticalFlip",void 0),t([s({type:Number,attribute:"typeahead-delay"})],At.prototype,"typeaheadDelay",void 0),t([s({attribute:"anchor-corner"})],At.prototype,"anchorCorner",void 0),t([s({attribute:"menu-corner"})],At.prototype,"menuCorner",void 0),t([s({type:Boolean,attribute:"stay-open-on-outside-click"})],At.prototype,"stayOpenOnOutsideClick",void 0),t([s({type:Boolean,attribute:"stay-open-on-focusout"})],At.prototype,"stayOpenOnFocusout",void 0),t([s({type:Boolean,attribute:"skip-restore-focus"})],At.prototype,"skipRestoreFocus",void 0),t([s({attribute:"default-focus"})],At.prototype,"defaultFocus",void 0),t([s({type:Boolean,attribute:"no-navigation-wrap"})],At.prototype,"noNavigationWrap",void 0),t([i({flatten:!0})],At.prototype,"slotItems",void 0),t([v()],At.prototype,"typeaheadActive",void 0);const Tt=a`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}
|
267 | `;let Ct=class extends At{};Ct.styles=[Tt],Ct=t([n("md-menu")],Ct);class Rt extends fe{computeValidity(e){return this.selectControl||(this.selectControl=document.createElement("select")),x(o`<option value=${e.value}></option>`,this.selectControl),this.selectControl.value=e.value,this.selectControl.required=e.required,{validity:this.selectControl.validity,validationMessage:this.selectControl.validationMessage}}equals(e,t){return e.value===t.value&&e.required===t.required}copy({value:e,required:t}){return{value:e,required:t}}}var It;const $t=Symbol("value"),Lt=l(Ge(ce(ue(m(r)))));class Ot extends Lt{get value(){return this[$t]}set value(e){this.lastUserSetValue=e,this.select(e)}get options(){var e;return(null===(e=this.menu)||void 0===e?void 0:e.items)??[]}get selectedIndex(){const[e,t]=(this.getSelectedOptions()??[])[0]??[];return t??-1}set selectedIndex(e){this.lastUserSetSelectedIndex=e,this.selectIndex(e)}get selectedOptions(){return(this.getSelectedOptions()??[]).map((([e])=>e))}get hasError(){return this.error||this.nativeError}constructor(){super(),this.quick=!1,this.required=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.supportingText="",this.error=!1,this.menuPositioning="popover",this.clampMenuWidth=!1,this.typeaheadDelay=200,this.hasLeadingIcon=!1,this.displayText="",this.menuAlign="start",this[It]="",this.lastUserSetValue=null,this.lastUserSetSelectedIndex=null,this.lastSelectedOption=null,this.lastSelectedOptionRecords=[],this.nativeError=!1,this.nativeErrorText="",this.focused=!1,this.open=!1,this.defaultFocus=ut,this.prevOpen=this.open,this.selectWidth=0,this.addEventListener("focus",this.handleFocus.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}select(e){const t=this.options.find((t=>t.value===e));t&&this.selectItem(t)}selectIndex(e){const t=this.options[e];t&&this.selectItem(t)}reset(){for(const e of this.options)e.selected=e.hasAttribute("selected");this.updateValueAndDisplayText(),this.nativeError=!1,this.nativeErrorText=""}[(It=$t,qe)](e){null==e||e.preventDefault();const t=this.getErrorText();var i;(this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText())&&(null===(i=this.field)||void 0===i||i.reannounceError())}update(e){if(this.hasUpdated||this.initUserSelection(),this.prevOpen!==this.open&&this.open){const e=this.getBoundingClientRect();this.selectWidth=e.width}this.prevOpen=this.open,super.update(e)}render(){return o`
|
268 | <span
|
269 | class="select ${h(this.getRenderClasses())}"
|
270 | @focusout=${this.handleFocusout}>
|
271 | ${this.renderField()} ${this.renderMenu()}
|
272 | </span>
|
273 | `}async firstUpdated(e){var t;await(null===(t=this.menu)||void 0===t?void 0:t.updateComplete),this.lastSelectedOptionRecords.length||this.initUserSelection(),this.lastSelectedOptionRecords.length||this.options.length||setTimeout((()=>{this.updateValueAndDisplayText()})),super.firstUpdated(e)}getRenderClasses(){return{disabled:this.disabled,error:this.error,open:this.open}}renderField(){return Q`
|
274 | <${this.fieldTag}
|
275 | aria-haspopup="listbox"
|
276 | role="combobox"
|
277 | part="field"
|
278 | id="field"
|
279 | tabindex=${this.disabled?"-1":"0"}
|
280 | aria-label=${this.ariaLabel||c}
|
281 | aria-describedby="description"
|
282 | aria-expanded=${this.open?"true":"false"}
|
283 | aria-controls="listbox"
|
284 | class="field"
|
285 | label=${this.label}
|
286 | ?no-asterisk=${this.noAsterisk}
|
287 | .focused=${this.focused||this.open}
|
288 | .populated=${!!this.displayText}
|
289 | .disabled=${this.disabled}
|
290 | .required=${this.required}
|
291 | .error=${this.hasError}
|
292 | ?has-start=${this.hasLeadingIcon}
|
293 | has-end
|
294 | supporting-text=${this.supportingText}
|
295 | error-text=${this.getErrorText()}
|
296 | @keydown=${this.handleKeydown}
|
297 | @click=${this.handleClick}>
|
298 | ${this.renderFieldContent()}
|
299 | <div id="description" slot="aria-describedby"></div>
|
300 | </${this.fieldTag}>`}renderFieldContent(){return[this.renderLeadingIcon(),this.renderLabel(),this.renderTrailingIcon()]}renderLeadingIcon(){return o`
|
301 | <span class="icon leading" slot="start">
|
302 | <slot name="leading-icon" @slotchange=${this.handleIconChange}></slot>
|
303 | </span>
|
304 | `}renderTrailingIcon(){return o`
|
305 | <span class="icon trailing" slot="end">
|
306 | <slot name="trailing-icon" @slotchange=${this.handleIconChange}>
|
307 | <svg height="5" viewBox="7 10 10 5" focusable="false">
|
308 | <polygon
|
309 | class="down"
|
310 | stroke="none"
|
311 | fill-rule="evenodd"
|
312 | points="7 10 12 15 17 10"></polygon>
|
313 | <polygon
|
314 | class="up"
|
315 | stroke="none"
|
316 | fill-rule="evenodd"
|
317 | points="7 15 12 10 17 15"></polygon>
|
318 | </svg>
|
319 | </slot>
|
320 | </span>
|
321 | `}renderLabel(){return o`<div id="label">${this.displayText||o` `}</div>`}renderMenu(){const e=this.label||this.ariaLabel;return o`<div class="menu-wrapper">
|
322 | <md-menu
|
323 | id="listbox"
|
324 | .defaultFocus=${this.defaultFocus}
|
325 | role="listbox"
|
326 | tabindex="-1"
|
327 | aria-label=${e||c}
|
328 | stay-open-on-focusout
|
329 | part="menu"
|
330 | exportparts="focus-ring: menu-focus-ring"
|
331 | anchor="field"
|
332 | style=${Ne({"--__menu-min-width":`${this.selectWidth}px`,"--__menu-max-width":this.clampMenuWidth?`${this.selectWidth}px`:void 0})}
|
333 | no-navigation-wrap
|
334 | .open=${this.open}
|
335 | .quick=${this.quick}
|
336 | .positioning=${this.menuPositioning}
|
337 | .typeaheadDelay=${this.typeaheadDelay}
|
338 | .anchorCorner=${"start"===this.menuAlign?"end-start":"end-end"}
|
339 | .menuCorner=${"start"===this.menuAlign?"start-start":"start-end"}
|
340 | @opening=${this.handleOpening}
|
341 | @opened=${this.redispatchEvent}
|
342 | @closing=${this.redispatchEvent}
|
343 | @closed=${this.handleClosed}
|
344 | @close-menu=${this.handleCloseMenu}
|
345 | @request-selection=${this.handleRequestSelection}
|
346 | @request-deselection=${this.handleRequestDeselection}>
|
347 | ${this.renderMenuContent()}
|
348 | </md-menu>
|
349 | </div>`}renderMenuContent(){return o`<slot></slot>`}handleKeydown(e){if(this.open||this.disabled||!this.menu)return;const t=this.menu.typeaheadController,i="Space"===e.code||"ArrowDown"===e.code||"ArrowUp"===e.code||"End"===e.code||"Home"===e.code||"Enter"===e.code;if(!t.isTypingAhead&&i){switch(e.preventDefault(),this.open=!0,e.code){case"Space":case"ArrowDown":case"Enter":this.defaultFocus=ut;break;case"End":this.defaultFocus=vt;break;case"ArrowUp":case"Home":this.defaultFocus=mt}return}if(1===e.key.length){var r,o;t.onKeydown(e),e.preventDefault();const{lastActiveRecord:i}=t;if(!i)return;null===(r=this.labelEl)||void 0===r||null===(o=r.setAttribute)||void 0===o||o.call(r,"aria-live","polite");this.selectItem(i[xt])&&this.dispatchInteractionEvents()}}handleClick(){this.open=!this.open}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}handleFocusout(e){e.relatedTarget&&pt(e.relatedTarget,this)||(this.open=!1)}getSelectedOptions(){if(!this.menu)return this.lastSelectedOptionRecords=[],null;const e=this.menu.items;return this.lastSelectedOptionRecords=function(e){const t=[];for(let i=0;i<e.length;i++){const r=e[i];r.selected&&t.push([r,i])}return t}(e),this.lastSelectedOptionRecords}async getUpdateComplete(){var e;return await(null===(e=this.menu)||void 0===e?void 0:e.updateComplete),super.getUpdateComplete()}updateValueAndDisplayText(){const e=this.getSelectedOptions()??[];let t=!1;if(e.length){const[i]=e[0];t=this.lastSelectedOption!==i,this.lastSelectedOption=i,this[$t]=i.value,this.displayText=i.displayText}else t=null!==this.lastSelectedOption,this.lastSelectedOption=null,this[$t]="",this.displayText="";return t}async handleOpening(e){var t,i,r;if(null===(t=this.labelEl)||void 0===t||null===(i=t.removeAttribute)||void 0===i||i.call(t,"aria-live"),this.redispatchEvent(e),this.defaultFocus!==ut)return;const o=this.menu.items,a=null===(r=O(o))||void 0===r?void 0:r.item;let[s]=this.lastSelectedOptionRecords[0]??[null];a&&a!==s&&(a.tabIndex=-1),s=s??o[0],s&&(s.tabIndex=0,s.focus())}redispatchEvent(e){_(this,e)}handleClosed(e){this.open=!1,this.redispatchEvent(e)}handleCloseMenu(e){const t=e.detail.reason,i=e.detail.itemPath[0];this.open=!1;let r=!1;var o;"click-selection"===t.kind||"keydown"===t.kind&&(o=t.key,Object.values(nt).some((e=>e===o)))?r=this.selectItem(i):(i.tabIndex=-1,i.blur()),r&&this.dispatchInteractionEvents()}selectItem(e){return(this.getSelectedOptions()??[]).forEach((([t])=>{e!==t&&(t.selected=!1)})),e.selected=!0,this.updateValueAndDisplayText()}handleRequestSelection(e){const t=e.target;this.lastSelectedOptionRecords.some((([e])=>e===t))||this.selectItem(t)}handleRequestDeselection(e){const t=e.target;this.lastSelectedOptionRecords.some((([e])=>e===t))&&this.updateValueAndDisplayText()}initUserSelection(){this.lastUserSetValue&&!this.lastSelectedOptionRecords.length?this.select(this.lastUserSetValue):null===this.lastUserSetSelectedIndex||this.lastSelectedOptionRecords.length?this.updateValueAndDisplayText():this.selectIndex(this.lastUserSetSelectedIndex)}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0}dispatchInteractionEvents(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))}getErrorText(){return this.error?this.errorText:this.nativeErrorText}[he](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}click(){var e;null===(e=this.field)||void 0===e||e.click()}[ae](){return new Rt((()=>this))}[se](){return this.field}}Ot.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([s({type:Boolean})],Ot.prototype,"quick",void 0),t([s({type:Boolean})],Ot.prototype,"required",void 0),t([s({type:String,attribute:"error-text"})],Ot.prototype,"errorText",void 0),t([s()],Ot.prototype,"label",void 0),t([s({type:Boolean,attribute:"no-asterisk"})],Ot.prototype,"noAsterisk",void 0),t([s({type:String,attribute:"supporting-text"})],Ot.prototype,"supportingText",void 0),t([s({type:Boolean,reflect:!0})],Ot.prototype,"error",void 0),t([s({attribute:"menu-positioning"})],Ot.prototype,"menuPositioning",void 0),t([s({type:Boolean,attribute:"clamp-menu-width"})],Ot.prototype,"clampMenuWidth",void 0),t([s({type:Number,attribute:"typeahead-delay"})],Ot.prototype,"typeaheadDelay",void 0),t([s({type:Boolean,attribute:"has-leading-icon"})],Ot.prototype,"hasLeadingIcon",void 0),t([s({attribute:"display-text"})],Ot.prototype,"displayText",void 0),t([s({attribute:"menu-align"})],Ot.prototype,"menuAlign",void 0),t([s()],Ot.prototype,"value",null),t([s({type:Number,attribute:"selected-index"})],Ot.prototype,"selectedIndex",null),t([v()],Ot.prototype,"nativeError",void 0),t([v()],Ot.prototype,"nativeErrorText",void 0),t([v()],Ot.prototype,"focused",void 0),t([v()],Ot.prototype,"open",void 0),t([v()],Ot.prototype,"defaultFocus",void 0),t([d(".field")],Ot.prototype,"field",void 0),t([d("md-menu")],Ot.prototype,"menu",void 0),t([d("#label")],Ot.prototype,"labelEl",void 0),t([i({slot:"leading-icon",flatten:!0})],Ot.prototype,"leadingIcons",void 0);class zt extends Ot{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}const Dt=a`:host{--_text-field-active-indicator-color: var(--md-filled-select-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-active-indicator-height: var(--md-filled-select-text-field-active-indicator-height, 1px);--_text-field-container-color: var(--md-filled-select-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_text-field-disabled-active-indicator-color: var(--md-filled-select-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-active-indicator-height: var(--md-filled-select-text-field-disabled-active-indicator-height, 1px);--_text-field-disabled-active-indicator-opacity: var(--md-filled-select-text-field-disabled-active-indicator-opacity, 0.38);--_text-field-disabled-container-color: var(--md-filled-select-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-container-opacity: var(--md-filled-select-text-field-disabled-container-opacity, 0.04);--_text-field-disabled-input-text-color: var(--md-filled-select-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-input-text-opacity: var(--md-filled-select-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-filled-select-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-label-text-opacity: var(--md-filled-select-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-filled-select-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-leading-icon-opacity: var(--md-filled-select-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-supporting-text-color: var(--md-filled-select-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-supporting-text-opacity: var(--md-filled-select-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-filled-select-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-trailing-icon-opacity: var(--md-filled-select-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-active-indicator-color: var(--md-filled-select-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-active-indicator-color: var(--md-filled-select-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-input-text-color: var(--md-filled-select-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-focus-label-text-color: var(--md-filled-select-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-filled-select-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-supporting-text-color: var(--md-filled-select-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-filled-select-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-active-indicator-color: var(--md-filled-select-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-input-text-color: var(--md-filled-select-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-label-text-color: var(--md-filled-select-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-filled-select-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-state-layer-color: var(--md-filled-select-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-state-layer-opacity: var(--md-filled-select-text-field-error-hover-state-layer-opacity, 0.08);--_text-field-error-hover-supporting-text-color: var(--md-filled-select-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-filled-select-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-filled-select-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-label-text-color: var(--md-filled-select-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-filled-select-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-supporting-text-color: var(--md-filled-select-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-filled-select-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-active-indicator-color: var(--md-filled-select-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-active-indicator-height: var(--md-filled-select-text-field-focus-active-indicator-height, 3px);--_text-field-focus-input-text-color: var(--md-filled-select-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-focus-label-text-color: var(--md-filled-select-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-filled-select-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-supporting-text-color: var(--md-filled-select-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-filled-select-text-field-focus-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_text-field-hover-active-indicator-color: var(--md-filled-select-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-active-indicator-height: var(--md-filled-select-text-field-hover-active-indicator-height, 1px);--_text-field-hover-input-text-color: var(--md-filled-select-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-label-text-color: var(--md-filled-select-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-leading-icon-color: var(--md-filled-select-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-state-layer-color: var(--md-filled-select-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-state-layer-opacity: var(--md-filled-select-text-field-hover-state-layer-opacity, 0.08);--_text-field-hover-supporting-text-color: var(--md-filled-select-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-filled-select-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-filled-select-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-input-text-font: var(--md-filled-select-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-input-text-line-height: var(--md-filled-select-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-input-text-size: var(--md-filled-select-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-input-text-weight: var(--md-filled-select-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-label-text-color: var(--md-filled-select-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-font: var(--md-filled-select-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-label-text-line-height: var(--md-filled-select-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-label-text-populated-line-height: var(--md-filled-select-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-label-text-populated-size: var(--md-filled-select-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-label-text-size: var(--md-filled-select-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-label-text-weight: var(--md-filled-select-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-leading-icon-color: var(--md-filled-select-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-filled-select-text-field-leading-icon-size, 24px);--_text-field-supporting-text-color: var(--md-filled-select-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-font: var(--md-filled-select-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-supporting-text-line-height: var(--md-filled-select-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-supporting-text-size: var(--md-filled-select-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-supporting-text-weight: var(--md-filled-select-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-trailing-icon-color: var(--md-filled-select-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-filled-select-text-field-trailing-icon-size, 24px);--_text-field-container-shape-start-start: var(--md-filled-select-text-field-container-shape-start-start, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_text-field-container-shape-start-end: var(--md-filled-select-text-field-container-shape-start-end, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_text-field-container-shape-end-end: var(--md-filled-select-text-field-container-shape-end-end, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_text-field-container-shape-end-start: var(--md-filled-select-text-field-container-shape-end-start, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--md-filled-field-active-indicator-color: var(--_text-field-active-indicator-color);--md-filled-field-active-indicator-height: var(--_text-field-active-indicator-height);--md-filled-field-container-color: var(--_text-field-container-color);--md-filled-field-container-shape-end-end: var(--_text-field-container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_text-field-container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_text-field-container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_text-field-container-shape-start-start);--md-filled-field-content-color: var(--_text-field-input-text-color);--md-filled-field-content-font: var(--_text-field-input-text-font);--md-filled-field-content-line-height: var(--_text-field-input-text-line-height);--md-filled-field-content-size: var(--_text-field-input-text-size);--md-filled-field-content-weight: var(--_text-field-input-text-weight);--md-filled-field-disabled-active-indicator-color: var(--_text-field-disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_text-field-disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_text-field-disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_text-field-disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_text-field-disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_text-field-disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_text-field-disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_text-field-disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_text-field-disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_text-field-disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_text-field-disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_text-field-disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_text-field-disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_text-field-disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_text-field-disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_text-field-error-active-indicator-color);--md-filled-field-error-content-color: var(--_text-field-error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_text-field-error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_text-field-error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_text-field-error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_text-field-error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_text-field-error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_text-field-error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_text-field-error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_text-field-error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_text-field-error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_text-field-error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_text-field-error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_text-field-error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_text-field-error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_text-field-error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_text-field-error-label-text-color);--md-filled-field-error-leading-content-color: var(--_text-field-error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_text-field-error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_text-field-error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_text-field-focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_text-field-focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_text-field-focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_text-field-focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_text-field-focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_text-field-focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_text-field-focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_text-field-hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_text-field-hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_text-field-hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_text-field-hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_text-field-hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_text-field-hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_text-field-hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_text-field-hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_text-field-hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_text-field-label-text-color);--md-filled-field-label-text-font: var(--_text-field-label-text-font);--md-filled-field-label-text-line-height: var(--_text-field-label-text-line-height);--md-filled-field-label-text-populated-line-height: var(--_text-field-label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_text-field-label-text-populated-size);--md-filled-field-label-text-size: var(--_text-field-label-text-size);--md-filled-field-label-text-weight: var(--_text-field-label-text-weight);--md-filled-field-leading-content-color: var(--_text-field-leading-icon-color);--md-filled-field-supporting-text-color: var(--_text-field-supporting-text-color);--md-filled-field-supporting-text-font: var(--_text-field-supporting-text-font);--md-filled-field-supporting-text-line-height: var(--_text-field-supporting-text-line-height);--md-filled-field-supporting-text-size: var(--_text-field-supporting-text-size);--md-filled-field-supporting-text-weight: var(--_text-field-supporting-text-weight);--md-filled-field-trailing-content-color: var(--_text-field-trailing-icon-color)}[has-start] .icon.leading{font-size:var(--_text-field-leading-icon-size);height:var(--_text-field-leading-icon-size);width:var(--_text-field-leading-icon-size)}.icon.trailing{font-size:var(--_text-field-trailing-icon-size);height:var(--_text-field-trailing-icon-size);width:var(--_text-field-trailing-icon-size)}
|
350 | `,Pt=a`:host{color:unset;min-width:210px;display:flex}.field{cursor:default;outline:none}.select{position:relative;flex-direction:column}.icon.trailing svg,.icon ::slotted(*){fill:currentColor}.icon ::slotted(*){width:inherit;height:inherit;font-size:inherit}.icon slot{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.icon.trailing :is(.up,.down){opacity:0;transition:opacity 75ms linear 75ms}.select:not(.open) .down,.select.open .up{opacity:1}.field,.select,md-menu{min-width:inherit;width:inherit;max-width:inherit;display:flex}md-menu{min-width:var(--__menu-min-width);max-width:var(--__menu-max-width, inherit)}.menu-wrapper{width:0px;height:0px;max-width:inherit}md-menu ::slotted(:not[disabled]){cursor:pointer}.field,.select{width:100%}:host{display:inline-flex}:host([disabled]){pointer-events:none}
|
351 | `;class Bt extends zt{}Bt.styles=[Pt,Dt],customElements.define("ew-filled-select",Bt);const Ft=a`:host{display:flex;--md-ripple-hover-color: var(--md-menu-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-menu-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-menu-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-menu-item-pressed-state-layer-opacity, 0.12)}:host([disabled]){opacity:var(--md-menu-item-disabled-opacity, 0.3);pointer-events:none}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled){cursor:pointer}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;color:var(--md-menu-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-menu-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-menu-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-menu-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-menu-item-one-line-container-height, 56px);padding-top:var(--md-menu-item-top-space, 12px);padding-bottom:var(--md-menu-item-bottom-space, 12px);padding-inline-start:var(--md-menu-item-leading-space, 16px);padding-inline-end:var(--md-menu-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-menu-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-menu-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-menu-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-menu-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-menu-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-menu-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-menu-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-menu-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-menu-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}.list-item{background-color:var(--md-menu-item-container-color, transparent)}.list-item.selected{background-color:var(--md-menu-item-selected-container-color, var(--md-sys-color-secondary-container, #e8def8))}.selected:not(.disabled) ::slotted(*){color:var(--md-menu-item-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b))}@media(forced-colors: active){:host([disabled]),:host([disabled]) slot{color:GrayText;opacity:1}.list-item{position:relative}.list-item.selected::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}}
|
352 | `;class Ut{constructor(e,t){this.host=e,this.internalTypeaheadText=null,this.onClick=()=>{this.host.keepOpen||this.host.dispatchEvent(st(this.host,{kind:lt}))},this.onKeydown=e=>{if(this.host.href&&"Enter"===e.code){const e=this.getInteractiveElement();e instanceof HTMLAnchorElement&&e.click()}if(e.defaultPrevented)return;const t=e.code;this.host.keepOpen&&"Escape"!==t||ht(t)&&(e.preventDefault(),this.host.dispatchEvent(st(this.host,{kind:dt,key:t})))},this.getHeadlineElements=t.getHeadlineElements,this.getSupportingTextElements=t.getSupportingTextElements,this.getDefaultElements=t.getDefaultElements,this.getInteractiveElement=t.getInteractiveElement,this.host.addController(this)}get typeaheadText(){if(null!==this.internalTypeaheadText)return this.internalTypeaheadText;const e=this.getHeadlineElements(),t=[];return e.forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getDefaultElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getSupportingTextElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),t.join(" ")}get tagName(){switch(this.host.type){case"link":return"a";case"button":return"button";default:return"li"}}get role(){return"option"===this.host.type?"option":"menuitem"}hostConnected(){this.host.toggleAttribute("md-menu-item",!0)}hostUpdate(){this.host.href&&(this.host.type="link")}setTypeaheadText(e){this.internalTypeaheadText=e}}class Mt{get role(){return this.menuItemController.role}get typeaheadText(){return this.menuItemController.typeaheadText}setTypeaheadText(e){this.menuItemController.setTypeaheadText(e)}get displayText(){return null!==this.internalDisplayText?this.internalDisplayText:this.menuItemController.typeaheadText}setDisplayText(e){this.internalDisplayText=e}constructor(e,t){this.host=e,this.internalDisplayText=null,this.firstUpdate=!0,this.onClick=()=>{this.menuItemController.onClick()},this.onKeydown=e=>{this.menuItemController.onKeydown(e)},this.lastSelected=this.host.selected,this.menuItemController=new Ut(e,t),e.addController(this)}hostUpdate(){this.lastSelected!==this.host.selected&&(this.host.ariaSelected=this.host.selected?"true":"false")}hostUpdated(){this.lastSelected===this.host.selected||this.firstUpdate||(this.host.selected?this.host.dispatchEvent(new Event("request-selection",{bubbles:!0,composed:!0})):this.host.dispatchEvent(new Event("request-deselection",{bubbles:!0,composed:!0}))),this.lastSelected=this.host.selected,this.firstUpdate=!1}}const Nt=l(r);class Ht extends Nt{constructor(){super(...arguments),this.disabled=!1,this.isMenuItem=!0,this.selected=!1,this.value="",this.type="option",this.selectOptionController=new Mt(this,{getHeadlineElements:()=>this.headlineElements,getSupportingTextElements:()=>this.supportingTextElements,getDefaultElements:()=>this.defaultElements,getInteractiveElement:()=>this.listItemRoot})}get typeaheadText(){return this.selectOptionController.typeaheadText}set typeaheadText(e){this.selectOptionController.setTypeaheadText(e)}get displayText(){return this.selectOptionController.displayText}set displayText(e){this.selectOptionController.setDisplayText(e)}render(){return this.renderListItem(o`
|
353 | <md-item>
|
354 | <div slot="container">
|
355 | ${this.renderRipple()} ${this.renderFocusRing()}
|
356 | </div>
|
357 | <slot name="start" slot="start"></slot>
|
358 | <slot name="end" slot="end"></slot>
|
359 | ${this.renderBody()}
|
360 | </md-item>
|
361 | `)}renderListItem(e){return o`
|
362 | <li
|
363 | id="item"
|
364 | tabindex=${this.disabled?-1:0}
|
365 | role=${this.selectOptionController.role}
|
366 | aria-label=${this.ariaLabel||c}
|
367 | aria-selected=${this.ariaSelected||c}
|
368 | aria-checked=${this.ariaChecked||c}
|
369 | aria-expanded=${this.ariaExpanded||c}
|
370 | aria-haspopup=${this.ariaHasPopup||c}
|
371 | class="list-item ${h(this.getRenderClasses())}"
|
372 | @click=${this.selectOptionController.onClick}
|
373 | @keydown=${this.selectOptionController.onKeydown}
|
374 | >${e}</li
|
375 | >
|
376 | `}renderRipple(){return o` <md-ripple
|
377 | part="ripple"
|
378 | for="item"
|
379 | ?disabled=${this.disabled}></md-ripple>`}renderFocusRing(){return o` <md-focus-ring
|
380 | part="focus-ring"
|
381 | for="item"
|
382 | inward></md-focus-ring>`}getRenderClasses(){return{disabled:this.disabled,selected:this.selected}}renderBody(){return o`
|
383 | <slot></slot>
|
384 | <slot name="overline" slot="overline"></slot>
|
385 | <slot name="headline" slot="headline"></slot>
|
386 | <slot name="supporting-text" slot="supporting-text"></slot>
|
387 | <slot
|
388 | name="trailing-supporting-text"
|
389 | slot="trailing-supporting-text"></slot>
|
390 | `}focus(){var e;null===(e=this.listItemRoot)||void 0===e||e.focus()}}Ht.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([s({type:Boolean,reflect:!0})],Ht.prototype,"disabled",void 0),t([s({type:Boolean,attribute:"md-menu-item",reflect:!0})],Ht.prototype,"isMenuItem",void 0),t([s({type:Boolean})],Ht.prototype,"selected",void 0),t([s()],Ht.prototype,"value",void 0),t([d(".list-item")],Ht.prototype,"listItemRoot",void 0),t([i({slot:"headline"})],Ht.prototype,"headlineElements",void 0),t([i({slot:"supporting-text"})],Ht.prototype,"supportingTextElements",void 0),t([function(t){return(i,r)=>{const{slot:o}=t,a="slot"+(o?`[name=${o}]`:":not([name])");return e(i,r,{get(){var e;const i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(a);return(null==i?void 0:i.assignedNodes(t))??[]}})}}({slot:""})],Ht.prototype,"defaultElements",void 0),t([s({attribute:"typeahead-text"})],Ht.prototype,"typeaheadText",null),t([s({attribute:"display-text"})],Ht.prototype,"displayText",null);class qt extends Ht{}qt.styles=[Ft],customElements.define("ew-select-option",qt);const Wt=l(r);class Zt extends Wt{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){const{ariaLabel:e}=this;return o`
|
391 | <div
|
392 | class="progress ${h(this.getRenderClasses())}"
|
393 | role="progressbar"
|
394 | aria-label="${e||c}"
|
395 | aria-valuemin="0"
|
396 | aria-valuemax=${this.max}
|
397 | aria-valuenow=${this.indeterminate?c:this.value}
|
398 | >${this.renderIndicator()}</div
|
399 | >
|
400 | `}getRenderClasses(){return{indeterminate:this.indeterminate,"four-color":this.fourColor}}}t([s({type:Number})],Zt.prototype,"value",void 0),t([s({type:Number})],Zt.prototype,"max",void 0),t([s({type:Boolean})],Zt.prototype,"indeterminate",void 0),t([s({type:Boolean,attribute:"four-color"})],Zt.prototype,"fourColor",void 0);class Vt extends Zt{renderIndicator(){return this.indeterminate?this.renderIndeterminateContainer():this.renderDeterminateContainer()}renderDeterminateContainer(){const e=100*(1-this.value/this.max);return o`
|
401 | <svg viewBox="0 0 4800 4800">
|
402 | <circle class="track" pathLength="100"></circle>
|
403 | <circle
|
404 | class="active-track"
|
405 | pathLength="100"
|
406 | stroke-dashoffset=${e}></circle>
|
407 | </svg>
|
408 | `}renderIndeterminateContainer(){return o` <div class="spinner">
|
409 | <div class="left">
|
410 | <div class="circle"></div>
|
411 | </div>
|
412 | <div class="right">
|
413 | <div class="circle"></div>
|
414 | </div>
|
415 | </div>`}}const jt=a`:host{--_active-indicator-color: var(--md-circular-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-width: var(--md-circular-progress-active-indicator-width, 10);--_four-color-active-indicator-four-color: var(--md-circular-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-circular-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-circular-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-circular-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_size: var(--md-circular-progress-size, 48px);display:inline-flex;vertical-align:middle;width:var(--_size);height:var(--_size);position:relative;align-items:center;justify-content:center;contain:strict;content-visibility:auto}.progress{flex:1;align-self:stretch;margin:4px}.progress,.spinner,.left,.right,.circle,svg,.track,.active-track{position:absolute;inset:0}svg{transform:rotate(-90deg)}circle{cx:50%;cy:50%;r:calc(50%*(1 - var(--_active-indicator-width)/100));stroke-width:calc(var(--_active-indicator-width)*1%);stroke-dasharray:100;fill:rgba(0,0,0,0)}.active-track{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);stroke:var(--_active-indicator-color)}.track{stroke:rgba(0,0,0,0)}.progress.indeterminate{animation:linear infinite linear-rotate;animation-duration:1568.2352941176ms}.spinner{animation:infinite both rotate-arc;animation-duration:5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.left{overflow:hidden;inset:0 50% 0 0}.right{overflow:hidden;inset:0 0 0 50%}.circle{box-sizing:border-box;border-radius:50%;border:solid calc(var(--_active-indicator-width)/100*(var(--_size) - 8px));border-color:var(--_active-indicator-color) var(--_active-indicator-color) rgba(0,0,0,0) rgba(0,0,0,0);animation:expand-arc;animation-iteration-count:infinite;animation-fill-mode:both;animation-duration:1333ms,5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.four-color .circle{animation-name:expand-arc,four-color}.left .circle{rotate:135deg;inset:0 -100% 0 0}.right .circle{rotate:100deg;inset:0 0 0 -100%;animation-delay:-666.5ms,0ms}@media(forced-colors: active){.active-track{stroke:CanvasText}.circle{border-color:CanvasText CanvasText Canvas Canvas}}@keyframes expand-arc{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes rotate-arc{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes linear-rotate{to{transform:rotate(360deg)}}@keyframes four-color{0%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}15%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}25%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}40%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}50%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}65%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}75%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}90%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}100%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}}
|
416 | `;class Gt extends Vt{}Gt.styles=[jt],customElements.define("ew-circular-progress",Gt);class Kt extends r{render(){return o`
|
417 | <div>
|
418 | <ew-circular-progress
|
419 | active
|
420 | ?indeterminate=${void 0===this.progress}
|
421 | .value=${void 0!==this.progress?this.progress/100:void 0}
|
422 | ></ew-circular-progress>
|
423 | ${void 0!==this.progress?o`<div>${this.progress}%</div>`:""}
|
424 | </div>
|
425 | ${this.label}
|
426 | `}}Kt.styles=a`
|
427 | :host {
|
428 | display: flex;
|
429 | flex-direction: column;
|
430 | text-align: center;
|
431 | }
|
432 | ew-circular-progress {
|
433 | margin-bottom: 16px;
|
434 | }
|
435 | `,t([s()],Kt.prototype,"label",void 0),t([s()],Kt.prototype,"progress",void 0),customElements.define("ewt-page-progress",Kt);class Yt extends r{render(){return o`
|
436 | <div class="icon">${this.icon}</div>
|
437 | ${this.label}
|
438 | `}}Yt.styles=a`
|
439 | :host {
|
440 | display: flex;
|
441 | flex-direction: column;
|
442 | text-align: center;
|
443 | }
|
444 | .icon {
|
445 | font-size: 50px;
|
446 | line-height: 80px;
|
447 | color: black;
|
448 | }
|
449 | `,t([s()],Yt.prototype,"icon",void 0),t([s()],Yt.prototype,"label",void 0),customElements.define("ewt-page-message",Yt);const Xt=C`
|
450 | <svg width="24" height="24" viewBox="0 0 24 24">
|
451 | <path
|
452 | fill="currentColor"
|
453 | d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
|
454 | />
|
455 | </svg>
|
456 | `,Jt=C`
|
457 | <svg viewBox="0 0 24 24">
|
458 | <path
|
459 | fill="currentColor"
|
460 | d="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"
|
461 | />
|
462 | </svg>
|
463 | `,Qt=C`
|
464 | <svg slot="start" viewBox="0 0 24 24">
|
465 | <path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z" />
|
466 | </svg>
|
467 | `,ei=C`
|
468 | <svg slot="start" viewBox="0 0 24 24">
|
469 | <path d="M12,21L15.6,16.2C14.6,15.45 13.35,15 12,15C10.65,15 9.4,15.45 8.4,16.2L12,21M12,3C7.95,3 4.21,4.34 1.2,6.6L3,9C5.5,7.12 8.62,6 12,6C15.38,6 18.5,7.12 21,9L22.8,6.6C19.79,4.34 16.05,3 12,3M12,9C9.3,9 6.81,9.89 4.8,11.4L6.6,13.8C8.1,12.67 9.97,12 12,12C14.03,12 15.9,12.67 17.4,13.8L19.2,11.4C17.19,9.89 14.7,9 12,9Z" />
|
470 | </svg>
|
471 | `,ti=C`
|
472 | <svg slot="start" viewBox="0 0 24 24">
|
473 | <path d="M20,19V7H4V19H20M20,3A2,2 0 0,1 22,5V19A2,2 0 0,1 20,21H4A2,2 0 0,1 2,19V5C2,3.89 2.9,3 4,3H20M13,17V15H18V17H13M9.58,13L5.57,9H8.4L11.7,12.3C12.09,12.69 12.09,13.33 11.7,13.72L8.42,17H5.59L9.58,13Z" />
|
474 | </svg>
|
475 | `,ii=C`
|
476 | <svg slot="start" viewBox="0 0 24 24">
|
477 | <path d="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />
|
478 | </svg>
|
479 | `,ri=C`
|
480 | <svg slot="start" viewBox="0 0 24 24">
|
481 | <path d="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864" />
|
482 | </svg>
|
483 | `,oi=C`
|
484 | <svg slot="start" viewBox="0 0 24 24">
|
485 | <path d="M15,14C17.67,14 23,15.33 23,18V20H7V18C7,15.33 12.33,14 15,14M15,12A4,4 0 0,1 11,8A4,4 0 0,1 15,4A4,4 0 0,1 19,8A4,4 0 0,1 15,12M5,9.59L7.12,7.46L8.54,8.88L6.41,11L8.54,13.12L7.12,14.54L5,12.41L2.88,14.54L1.46,13.12L3.59,11L1.46,8.88L2.88,7.46L5,9.59Z" />
|
486 | </svg>
|
487 | `,ai=C`
|
488 | <svg slot="start" viewBox="0 0 24 24">
|
489 | <path d="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z" />
|
490 | </svg>
|
491 | `,si=["I".charCodeAt(0),"M".charCodeAt(0),"P".charCodeAt(0),"R".charCodeAt(0),"O".charCodeAt(0),"V".charCodeAt(0),1];var ni,li;!function(e){e[e.CURRENT_STATE=1]="CURRENT_STATE",e[e.ERROR_STATE=2]="ERROR_STATE",e[e.RPC=3]="RPC",e[e.RPC_RESULT=4]="RPC_RESULT"}(ni||(ni={})),function(e){e[e.READY=2]="READY",e[e.PROVISIONING=3]="PROVISIONING",e[e.PROVISIONED=4]="PROVISIONED"}(li||(li={}));const di={0:"NO_ERROR",1:"INVALID_RPC_PACKET",2:"UNKNOWN_RPC_COMMAND",3:"UNABLE_TO_CONNECT",254:"TIMEOUT",255:"UNKNOWN_ERROR"};class ci extends Error{constructor(){super("Port is not ready")}}const hi=e=>"["+e.map((e=>((e,t=2)=>{let i=e.toString(16).toUpperCase();return i.startsWith("-")?"-0x"+i.substring(1).padStart(t,"0"):"0x"+i.padStart(t,"0")})(e))).join(", ")+"]";class pi extends EventTarget{constructor(e,t){if(super(),this.port=e,this.logger=t,this.error=0,null===e.readable)throw new Error("Port is not readable");if(null===e.writable)throw new Error("Port is not writable")}async initialize(e=1e3){var t;if(this.logger.log("Initializing Improv Serial"),this._processInput(),await(t=1e3,new Promise((e=>setTimeout(e,t)))),void 0===this._reader)throw new ci;try{await new Promise((async(t,i)=>{setTimeout((()=>i(new Error("Improv Wi-Fi Serial not detected"))),e),await this.requestCurrentState(),t(void 0)})),await this.requestInfo()}catch(e){throw await this.close(),e}return this.info}async close(){this._reader&&await new Promise((e=>{this._reader.cancel(),this.addEventListener("disconnect",e,{once:!0})}))}async requestCurrentState(){let e;try{await new Promise((async(t,i)=>{this.addEventListener("state-changed",t,{once:!0});e=this._sendRPCWithResponse(2,[]),e.catch((e=>{this.removeEventListener("state-changed",t),i(e)}))}))}catch(e){throw this._rpcFeedback=void 0,new Error(`Error fetching current state: ${e}`)}if(this.state!==li.PROVISIONED)return void(this._rpcFeedback=void 0);const t=await e;this.nextUrl=t[0]}async requestInfo(e){const t=await this._sendRPCWithResponse(3,[],e);this.info={firmware:t[0],version:t[1],name:t[3],chipFamily:t[2]}}async provision(e,t,i){const r=new TextEncoder,o=r.encode(e),a=r.encode(t),s=[o.length,...o,a.length,...a],n=await this._sendRPCWithResponse(1,s,i);this.nextUrl=n[0]}async scan(){const e=(await this._sendRPCWithMultipleResponses(4,[])).map((([e,t,i])=>({name:e,rssi:parseInt(t),secured:"YES"===i})));return e.sort(((e,t)=>e.name.toLocaleLowerCase().localeCompare(t.name.toLocaleLowerCase()))),e}_sendRPC(e,t){this.writePacketToStream(ni.RPC,[e,t.length,...t])}async _sendRPCWithResponse(e,t,i){if(this._rpcFeedback)throw new Error("Only 1 RPC command that requires feedback can be active");return await this._awaitRPCResultWithTimeout(new Promise(((i,r)=>{this._rpcFeedback={command:e,resolve:i,reject:r},this._sendRPC(e,t)})),i)}async _sendRPCWithMultipleResponses(e,t,i){if(this._rpcFeedback)throw new Error("Only 1 RPC command that requires feedback can be active");return await this._awaitRPCResultWithTimeout(new Promise(((i,r)=>{this._rpcFeedback={command:e,resolve:i,reject:r,receivedData:[]},this._sendRPC(e,t)})),i)}async _awaitRPCResultWithTimeout(e,t){return t?await new Promise(((i,r)=>{const o=setTimeout((()=>this._setError(254)),t);e.finally((()=>clearTimeout(o))),e.then(i,r)})):await e}async _processInput(){this.logger.debug("Starting read loop"),this._reader=this.port.readable.getReader();try{let e,t=[],i=0;for(;;){const{value:r,done:o}=await this._reader.read();if(o)break;if(r&&0!==r.length)for(const o of r){if(!1===e){10===o&&(e=void 0);continue}if(!0===e){t.push(o),t.length===i&&(this._handleIncomingPacket(t),e=void 0,t=[]);continue}if(10===o){t=[];continue}if(t.push(o),9!==t.length)continue;if(e="IMPROV"===String.fromCharCode(...t.slice(0,6)),!e){t=[];continue}i=9+t[8]+1}}}catch(e){this.logger.error("Error while reading serial port",e)}finally{this._reader.releaseLock(),this._reader=void 0}this.logger.debug("Finished read loop"),this.dispatchEvent(new Event("disconnect"))}_handleIncomingPacket(e){const t=e.slice(6),i=t[0],r=t[1],o=t[2],a=t.slice(3,3+o);if(this.logger.debug("PROCESS",{version:i,packetType:r,packetLength:o,data:hi(a)}),1!==i)return void this.logger.error("Received unsupported version",i);let s=t[3+o],n=0;for(let t=0;t<e.length-1;t++)n+=e[t];if(n&=255,n===s)if(r===ni.CURRENT_STATE)this.state=a[0],this.dispatchEvent(new CustomEvent("state-changed",{detail:this.state}));else if(r===ni.ERROR_STATE)this._setError(a[0]);else if(r===ni.RPC_RESULT){if(!this._rpcFeedback)return void this.logger.error("Received result while not waiting for one");const e=a[0];if(e!==this._rpcFeedback.command)return void this.logger.error(`Received result for command ${e} but expected ${this._rpcFeedback.command}`);const t=[],i=a[1];let r=2;for(;r<2+i;)t.push(String.fromCodePoint(...a.slice(r+1,r+a[r]+1))),r+=a[r]+1;"receivedData"in this._rpcFeedback?t.length>0?this._rpcFeedback.receivedData.push(t):(this._rpcFeedback.resolve(this._rpcFeedback.receivedData),this._rpcFeedback=void 0):(this._rpcFeedback.resolve(t),this._rpcFeedback=void 0)}else this.logger.error("Unable to handle packet",t);else this.logger.error(`Received invalid checksum ${s}. Expected ${n}`)}async writePacketToStream(e,t){const i=new Uint8Array([...si,e,t.length,...t,0,0]);i[i.length-2]=255&i.reduce(((e,t)=>e+t),0),i[i.length-1]=10,this.logger.debug("Writing to stream:",hi(new Array(...i)));const r=this.port.writable.getWriter();await r.write(i);try{r.releaseLock()}catch(e){console.error("Ignoring release lock error",e)}}_setError(e){this.error=e,e>0&&this._rpcFeedback&&(this._rpcFeedback.reject(di[e]||`UNKNOWN_ERROR (${e})`),this._rpcFeedback=void 0),this.dispatchEvent(new CustomEvent("error-changed",{detail:this.error}))}}class ui extends Error{}function fi(e){let t=e.length;for(;--t>=0;)e[t]=0}const mi=256,vi=286,gi=30,bi=15,_i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),yi=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),xi=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),wi=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ki=new Array(576);fi(ki);const Ei=new Array(60);fi(Ei);const Si=new Array(512);fi(Si);const Ai=new Array(256);fi(Ai);const Ti=new Array(29);fi(Ti);const Ci=new Array(gi);function Ri(e,t,i,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}let Ii,$i,Li;function Oi(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}fi(Ci);const zi=e=>e<256?Si[e]:Si[256+(e>>>7)],Di=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Pi=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,Di(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},Bi=(e,t,i)=>{Pi(e,i[2*t],i[2*t+1])},Fi=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},Ui=(e,t,i)=>{const r=new Array(16);let o,a,s=0;for(o=1;o<=bi;o++)s=s+i[o-1]<<1,r[o]=s;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=Fi(r[t]++,t))}},Mi=e=>{let t;for(t=0;t<vi;t++)e.dyn_ltree[2*t]=0;for(t=0;t<gi;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Ni=e=>{e.bi_valid>8?Di(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Hi=(e,t,i,r)=>{const o=2*t,a=2*i;return e[o]<e[a]||e[o]===e[a]&&r[t]<=r[i]},qi=(e,t,i)=>{const r=e.heap[i];let o=i<<1;for(;o<=e.heap_len&&(o<e.heap_len&&Hi(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!Hi(t,r,e.heap[o],e.depth));)e.heap[i]=e.heap[o],i=o,o<<=1;e.heap[i]=r},Wi=(e,t,i)=>{let r,o,a,s,n=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+n++],r+=(255&e.pending_buf[e.sym_buf+n++])<<8,o=e.pending_buf[e.sym_buf+n++],0===r?Bi(e,o,t):(a=Ai[o],Bi(e,a+mi+1,t),s=_i[a],0!==s&&(o-=Ti[a],Pi(e,o,s)),r--,a=zi(r),Bi(e,a,i),s=yi[a],0!==s&&(r-=Ci[a],Pi(e,r,s)))}while(n<e.sym_next);Bi(e,256,t)},Zi=(e,t)=>{const i=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.elems;let s,n,l,d=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<a;s++)0!==i[2*s]?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):i[2*s+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=d<2?++d:0,i[2*l]=1,e.depth[l]=0,e.opt_len--,o&&(e.static_len-=r[2*l+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)qi(e,i,s);l=a;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],qi(e,i,1),n=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=n,i[2*l]=i[2*s]+i[2*n],e.depth[l]=(e.depth[s]>=e.depth[n]?e.depth[s]:e.depth[n])+1,i[2*s+1]=i[2*n+1]=l,e.heap[1]=l++,qi(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,n=t.stat_desc.extra_base,l=t.stat_desc.max_length;let d,c,h,p,u,f,m=0;for(p=0;p<=bi;p++)e.bl_count[p]=0;for(i[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)c=e.heap[d],p=i[2*i[2*c+1]+1]+1,p>l&&(p=l,m++),i[2*c+1]=p,c>r||(e.bl_count[p]++,u=0,c>=n&&(u=s[c-n]),f=i[2*c],e.opt_len+=f*(p+u),a&&(e.static_len+=f*(o[2*c+1]+u)));if(0!==m){do{for(p=l-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(p=l;0!==p;p--)for(c=e.bl_count[p];0!==c;)h=e.heap[--d],h>r||(i[2*h+1]!==p&&(e.opt_len+=(p-i[2*h+1])*i[2*h],i[2*h+1]=p),c--)}})(e,t),Ui(i,d,e.bl_count)},Vi=(e,t,i)=>{let r,o,a=-1,s=t[1],n=0,l=7,d=4;for(0===s&&(l=138,d=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)o=s,s=t[2*(r+1)+1],++n<l&&o===s||(n<d?e.bl_tree[2*o]+=n:0!==o?(o!==a&&e.bl_tree[2*o]++,e.bl_tree[32]++):n<=10?e.bl_tree[34]++:e.bl_tree[36]++,n=0,a=o,0===s?(l=138,d=3):o===s?(l=6,d=3):(l=7,d=4))},ji=(e,t,i)=>{let r,o,a=-1,s=t[1],n=0,l=7,d=4;for(0===s&&(l=138,d=3),r=0;r<=i;r++)if(o=s,s=t[2*(r+1)+1],!(++n<l&&o===s)){if(n<d)do{Bi(e,o,e.bl_tree)}while(0!=--n);else 0!==o?(o!==a&&(Bi(e,o,e.bl_tree),n--),Bi(e,16,e.bl_tree),Pi(e,n-3,2)):n<=10?(Bi(e,17,e.bl_tree),Pi(e,n-3,3)):(Bi(e,18,e.bl_tree),Pi(e,n-11,7));n=0,a=o,0===s?(l=138,d=3):o===s?(l=6,d=3):(l=7,d=4)}};let Gi=!1;const Ki=(e,t,i,r)=>{Pi(e,0+(r?1:0),3),Ni(e),Di(e,i),Di(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};var Yi=e=>{Gi||((()=>{let e,t,i,r,o;const a=new Array(16);for(i=0,r=0;r<28;r++)for(Ti[r]=i,e=0;e<1<<_i[r];e++)Ai[i++]=r;for(Ai[i-1]=r,o=0,r=0;r<16;r++)for(Ci[r]=o,e=0;e<1<<yi[r];e++)Si[o++]=r;for(o>>=7;r<gi;r++)for(Ci[r]=o<<7,e=0;e<1<<yi[r]-7;e++)Si[256+o++]=r;for(t=0;t<=bi;t++)a[t]=0;for(e=0;e<=143;)ki[2*e+1]=8,e++,a[8]++;for(;e<=255;)ki[2*e+1]=9,e++,a[9]++;for(;e<=279;)ki[2*e+1]=7,e++,a[7]++;for(;e<=287;)ki[2*e+1]=8,e++,a[8]++;for(Ui(ki,287,a),e=0;e<gi;e++)Ei[2*e+1]=5,Ei[2*e]=Fi(e,5);Ii=new Ri(ki,_i,257,vi,bi),$i=new Ri(Ei,yi,0,gi,bi),Li=new Ri(new Array(0),xi,0,19,7)})(),Gi=!0),e.l_desc=new Oi(e.dyn_ltree,Ii),e.d_desc=new Oi(e.dyn_dtree,$i),e.bl_desc=new Oi(e.bl_tree,Li),e.bi_buf=0,e.bi_valid=0,Mi(e)},Xi=(e,t,i,r)=>{let o,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<mi;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Zi(e,e.l_desc),Zi(e,e.d_desc),s=(e=>{let t;for(Vi(e,e.dyn_ltree,e.l_desc.max_code),Vi(e,e.dyn_dtree,e.d_desc.max_code),Zi(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*wi[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),o=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=o&&(o=a)):o=a=i+5,i+4<=o&&-1!==t?Ki(e,t,i,r):4===e.strategy||a===o?(Pi(e,2+(r?1:0),3),Wi(e,ki,Ei)):(Pi(e,4+(r?1:0),3),((e,t,i,r)=>{let o;for(Pi(e,t-257,5),Pi(e,i-1,5),Pi(e,r-4,4),o=0;o<r;o++)Pi(e,e.bl_tree[2*wi[o]+1],3);ji(e,e.dyn_ltree,t-1),ji(e,e.dyn_dtree,i-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Wi(e,e.dyn_ltree,e.dyn_dtree)),Mi(e),r&&Ni(e)},Ji={_tr_init:Yi,_tr_stored_block:Ki,_tr_flush_block:Xi,_tr_tally:(e,t,i)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(Ai[i]+mi+1)]++,e.dyn_dtree[2*zi(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Pi(e,2,3),Bi(e,256,ki),(e=>{16===e.bi_valid?(Di(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Qi=(e,t,i,r)=>{let o=65535&e|0,a=e>>>16&65535|0,s=0;for(;0!==i;){s=i>2e3?2e3:i,i-=s;do{o=o+t[r++]|0,a=a+o|0}while(--s);o%=65521,a%=65521}return o|a<<16|0};const er=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var tr=(e,t,i,r)=>{const o=er,a=r+i;e^=-1;for(let i=r;i<a;i++)e=e>>>8^o[255&(e^t[i])];return-1^e},ir={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},rr={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:or,_tr_stored_block:ar,_tr_flush_block:sr,_tr_tally:nr,_tr_align:lr}=Ji,{Z_NO_FLUSH:dr,Z_PARTIAL_FLUSH:cr,Z_FULL_FLUSH:hr,Z_FINISH:pr,Z_BLOCK:ur,Z_OK:fr,Z_STREAM_END:mr,Z_STREAM_ERROR:vr,Z_DATA_ERROR:gr,Z_BUF_ERROR:br,Z_DEFAULT_COMPRESSION:_r,Z_FILTERED:yr,Z_HUFFMAN_ONLY:xr,Z_RLE:wr,Z_FIXED:kr,Z_DEFAULT_STRATEGY:Er,Z_UNKNOWN:Sr,Z_DEFLATED:Ar}=rr,Tr=258,Cr=262,Rr=42,Ir=113,$r=666,Lr=(e,t)=>(e.msg=ir[t],t),Or=e=>2*e-(e>4?9:0),zr=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Dr=e=>{let t,i,r,o=e.w_size;t=e.hash_size,r=t;do{i=e.head[--r],e.head[r]=i>=o?i-o:0}while(--t);t=o,r=t;do{i=e.prev[--r],e.prev[r]=i>=o?i-o:0}while(--t)};let Pr=(e,t,i)=>(t<<e.hash_shift^i)&e.hash_mask;const Br=e=>{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},Fr=(e,t)=>{sr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Br(e.strm)},Ur=(e,t)=>{e.pending_buf[e.pending++]=t},Mr=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Nr=(e,t,i,r)=>{let o=e.avail_in;return o>r&&(o=r),0===o?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),i),1===e.state.wrap?e.adler=Qi(e.adler,t,o,i):2===e.state.wrap&&(e.adler=tr(e.adler,t,o,i)),e.next_in+=o,e.total_in+=o,o)},Hr=(e,t)=>{let i,r,o=e.max_chain_length,a=e.strstart,s=e.prev_length,n=e.nice_match;const l=e.strstart>e.w_size-Cr?e.strstart-(e.w_size-Cr):0,d=e.window,c=e.w_mask,h=e.prev,p=e.strstart+Tr;let u=d[a+s-1],f=d[a+s];e.prev_length>=e.good_match&&(o>>=2),n>e.lookahead&&(n=e.lookahead);do{if(i=t,d[i+s]===f&&d[i+s-1]===u&&d[i]===d[a]&&d[++i]===d[a+1]){a+=2,i++;do{}while(d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&a<p);if(r=Tr-(p-a),a=p-Tr,r>s){if(e.match_start=t,s=r,r>=n)break;u=d[a+s-1],f=d[a+s]}}}while((t=h[t&c])>l&&0!=--o);return s<=e.lookahead?s:e.lookahead},qr=e=>{const t=e.w_size;let i,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Cr)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Dr(e),r+=t),0===e.strm.avail_in)break;if(i=Nr(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=Pr(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=Pr(e,e.ins_h,e.window[o+3-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Cr&&0!==e.strm.avail_in)},Wr=(e,t)=>{let i,r,o,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,n=e.strm.avail_in;do{if(i=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o)break;if(o=e.strm.avail_out-o,r=e.strstart-e.block_start,i>r+e.strm.avail_in&&(i=r+e.strm.avail_in),i>o&&(i=o),i<a&&(0===i&&t!==pr||t===dr||i!==r+e.strm.avail_in))break;s=t===pr&&i===r+e.strm.avail_in?1:0,ar(e,0,0,s),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,Br(e.strm),r&&(r>i&&(r=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,i-=r),i&&(Nr(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===s);return n-=e.strm.avail_in,n&&(n>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=n&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-n,e.strm.next_in),e.strstart),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==dr&&t!==pr&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(Nr(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,a=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=a||(r||t===pr)&&t!==dr&&0===e.strm.avail_in&&r<=o)&&(i=r>o?o:r,s=t===pr&&0===e.strm.avail_in&&i===r?1:0,ar(e,e.block_start,i,s),e.block_start+=i,Br(e.strm)),s?3:1)},Zr=(e,t)=>{let i,r;for(;;){if(e.lookahead<Cr){if(qr(e),e.lookahead<Cr&&t===dr)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Pr(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-Cr&&(e.match_length=Hr(e,i)),e.match_length>=3)if(r=nr(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Pr(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Pr(e,e.ins_h,e.window[e.strstart+1]);else r=nr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Fr(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===pr?(Fr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Fr(e,!1),0===e.strm.avail_out)?1:2},Vr=(e,t)=>{let i,r,o;for(;;){if(e.lookahead<Cr){if(qr(e),e.lookahead<Cr&&t===dr)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Pr(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-Cr&&(e.match_length=Hr(e,i),e.match_length<=5&&(e.strategy===yr||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-3,r=nr(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=o&&(e.ins_h=Pr(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Fr(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=nr(e,0,e.window[e.strstart-1]),r&&Fr(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=nr(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===pr?(Fr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Fr(e,!1),0===e.strm.avail_out)?1:2};function jr(e,t,i,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=o}const Gr=[new jr(0,0,0,0,Wr),new jr(4,4,8,4,Zr),new jr(4,5,16,8,Zr),new jr(4,6,32,32,Zr),new jr(4,4,16,16,Vr),new jr(8,16,32,32,Vr),new jr(8,16,128,128,Vr),new jr(8,32,128,256,Vr),new jr(32,128,258,1024,Vr),new jr(32,258,258,4096,Vr)];function Kr(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ar,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),zr(this.dyn_ltree),zr(this.dyn_dtree),zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),zr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Yr=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Rr&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Ir&&t.status!==$r?1:0},Xr=e=>{if(Yr(e))return Lr(e,vr);e.total_in=e.total_out=0,e.data_type=Sr;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Rr:Ir,e.adler=2===t.wrap?0:1,t.last_flush=-2,or(t),fr},Jr=e=>{const t=Xr(e);var i;return t===fr&&((i=e.state).window_size=2*i.w_size,zr(i.head),i.max_lazy_match=Gr[i.level].max_lazy,i.good_match=Gr[i.level].good_length,i.nice_match=Gr[i.level].nice_length,i.max_chain_length=Gr[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),t},Qr=(e,t,i,r,o,a)=>{if(!e)return vr;let s=1;if(t===_r&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),o<1||o>9||i!==Ar||r<8||r>15||t<0||t>9||a<0||a>kr||8===r&&1!==s)return Lr(e,vr);8===r&&(r=9);const n=new Kr;return e.state=n,n.strm=e,n.status=Rr,n.wrap=s,n.gzhead=null,n.w_bits=r,n.w_size=1<<n.w_bits,n.w_mask=n.w_size-1,n.hash_bits=o+7,n.hash_size=1<<n.hash_bits,n.hash_mask=n.hash_size-1,n.hash_shift=~~((n.hash_bits+3-1)/3),n.window=new Uint8Array(2*n.w_size),n.head=new Uint16Array(n.hash_size),n.prev=new Uint16Array(n.w_size),n.lit_bufsize=1<<o+6,n.pending_buf_size=4*n.lit_bufsize,n.pending_buf=new Uint8Array(n.pending_buf_size),n.sym_buf=n.lit_bufsize,n.sym_end=3*(n.lit_bufsize-1),n.level=t,n.strategy=a,n.method=i,Jr(e)};var eo=(e,t)=>{let i=t.length;if(Yr(e))return vr;const r=e.state,o=r.wrap;if(2===o||1===o&&r.status!==Rr||r.lookahead)return vr;if(1===o&&(e.adler=Qi(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===o&&(zr(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(i-r.w_size,i),0),t=e,i=r.w_size}const a=e.avail_in,s=e.next_in,n=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,qr(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Pr(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,qr(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=n,e.avail_in=a,r.wrap=o,fr},to={deflateInit:(e,t)=>Qr(e,t,Ar,15,8,Er),deflateInit2:Qr,deflateReset:Jr,deflateResetKeep:Xr,deflateSetHeader:(e,t)=>Yr(e)||2!==e.state.wrap?vr:(e.state.gzhead=t,fr),deflate:(e,t)=>{if(Yr(e)||t>ur||t<0)return e?Lr(e,vr):vr;const i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===$r&&t!==pr)return Lr(e,0===e.avail_out?br:vr);const r=i.last_flush;if(i.last_flush=t,0!==i.pending){if(Br(e),0===e.avail_out)return i.last_flush=-1,fr}else if(0===e.avail_in&&Or(t)<=Or(r)&&t!==pr)return Lr(e,br);if(i.status===$r&&0!==e.avail_in)return Lr(e,br);if(i.status===Rr&&0===i.wrap&&(i.status=Ir),i.status===Rr){let t=Ar+(i.w_bits-8<<4)<<8,r=-1;if(r=i.strategy>=xr||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,Mr(i,t),0!==i.strstart&&(Mr(i,e.adler>>>16),Mr(i,65535&e.adler)),e.adler=1,i.status=Ir,Br(e),0!==i.pending)return i.last_flush=-1,fr}if(57===i.status)if(e.adler=0,Ur(i,31),Ur(i,139),Ur(i,8),i.gzhead)Ur(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Ur(i,255&i.gzhead.time),Ur(i,i.gzhead.time>>8&255),Ur(i,i.gzhead.time>>16&255),Ur(i,i.gzhead.time>>24&255),Ur(i,9===i.level?2:i.strategy>=xr||i.level<2?4:0),Ur(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Ur(i,255&i.gzhead.extra.length),Ur(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=tr(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(Ur(i,0),Ur(i,0),Ur(i,0),Ur(i,0),Ur(i,0),Ur(i,9===i.level?2:i.strategy>=xr||i.level<2?4:0),Ur(i,3),i.status=Ir,Br(e),0!==i.pending)return i.last_flush=-1,fr;if(69===i.status){if(i.gzhead.extra){let t=i.pending,r=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+r>i.pending_buf_size;){let o=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+o),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>t&&(e.adler=tr(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex+=o,Br(e),0!==i.pending)return i.last_flush=-1,fr;t=0,r-=o}let o=new Uint8Array(i.gzhead.extra);i.pending_buf.set(o.subarray(i.gzindex,i.gzindex+r),i.pending),i.pending+=r,i.gzhead.hcrc&&i.pending>t&&(e.adler=tr(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=tr(e.adler,i.pending_buf,i.pending-r,r)),Br(e),0!==i.pending)return i.last_flush=-1,fr;r=0}t=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Ur(i,t)}while(0!==t);i.gzhead.hcrc&&i.pending>r&&(e.adler=tr(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=tr(e.adler,i.pending_buf,i.pending-r,r)),Br(e),0!==i.pending)return i.last_flush=-1,fr;r=0}t=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Ur(i,t)}while(0!==t);i.gzhead.hcrc&&i.pending>r&&(e.adler=tr(e.adler,i.pending_buf,i.pending-r,r))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(Br(e),0!==i.pending))return i.last_flush=-1,fr;Ur(i,255&e.adler),Ur(i,e.adler>>8&255),e.adler=0}if(i.status=Ir,Br(e),0!==i.pending)return i.last_flush=-1,fr}if(0!==e.avail_in||0!==i.lookahead||t!==dr&&i.status!==$r){let r=0===i.level?Wr(i,t):i.strategy===xr?((e,t)=>{let i;for(;;){if(0===e.lookahead&&(qr(e),0===e.lookahead)){if(t===dr)return 1;break}if(e.match_length=0,i=nr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(Fr(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===pr?(Fr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Fr(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===wr?((e,t)=>{let i,r,o,a;const s=e.window;for(;;){if(e.lookahead<=Tr){if(qr(e),e.lookahead<=Tr&&t===dr)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(o=e.strstart-1,r=s[o],r===s[++o]&&r===s[++o]&&r===s[++o])){a=e.strstart+Tr;do{}while(r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&o<a);e.match_length=Tr-(a-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=nr(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=nr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(Fr(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===pr?(Fr(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Fr(e,!1),0===e.strm.avail_out)?1:2})(i,t):Gr[i.level].func(i,t);if(3!==r&&4!==r||(i.status=$r),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),fr;if(2===r&&(t===cr?lr(i):t!==ur&&(ar(i,0,0,!1),t===hr&&(zr(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Br(e),0===e.avail_out))return i.last_flush=-1,fr}return t!==pr?fr:i.wrap<=0?mr:(2===i.wrap?(Ur(i,255&e.adler),Ur(i,e.adler>>8&255),Ur(i,e.adler>>16&255),Ur(i,e.adler>>24&255),Ur(i,255&e.total_in),Ur(i,e.total_in>>8&255),Ur(i,e.total_in>>16&255),Ur(i,e.total_in>>24&255)):(Mr(i,e.adler>>>16),Mr(i,65535&e.adler)),Br(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?fr:mr)},deflateEnd:e=>{if(Yr(e))return vr;const t=e.state.status;return e.state=null,t===Ir?Lr(e,gr):fr},deflateSetDictionary:eo,deflateInfo:"pako deflate (from Nodeca project)"};const io=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ro={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)io(i,t)&&(e[t]=i[t])}}return e},flattenChunks:e=>{let t=0;for(let i=0,r=e.length;i<r;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,r=0,o=e.length;t<o;t++){let o=e[t];i.set(o,r),r+=o.length}return i}};let oo=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){oo=!1}const ao=new Uint8Array(256);for(let e=0;e<256;e++)ao[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ao[254]=ao[254]=1;var so={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,r,o,a,s=e.length,n=0;for(o=0;o<s;o++)i=e.charCodeAt(o),55296==(64512&i)&&o+1<s&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),o++)),n+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(n),a=0,o=0;a<n;o++)i=e.charCodeAt(o),55296==(64512&i)&&o+1<s&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),o++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|63&i):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|63&i):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|63&i);return t},buf2string:(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,o;const a=new Array(2*i);for(o=0,r=0;r<i;){let t=e[r++];if(t<128){a[o++]=t;continue}let s=ao[t];if(s>4)a[o++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<i;)t=t<<6|63&e[r++],s--;s>1?a[o++]=65533:t<65536?a[o++]=t:(t-=65536,a[o++]=55296|t>>10&1023,a[o++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&oo)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i})(a,o)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+ao[e[i]]>t?i:t}};var no=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const lo=Object.prototype.toString,{Z_NO_FLUSH:co,Z_SYNC_FLUSH:ho,Z_FULL_FLUSH:po,Z_FINISH:uo,Z_OK:fo,Z_STREAM_END:mo,Z_DEFAULT_COMPRESSION:vo,Z_DEFAULT_STRATEGY:go,Z_DEFLATED:bo}=rr;function _o(e){this.options=ro.assign({level:vo,method:bo,chunkSize:16384,windowBits:15,memLevel:8,strategy:go},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new no,this.strm.avail_out=0;let i=to.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==fo)throw new Error(ir[i]);if(t.header&&to.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?so.string2buf(t.dictionary):"[object ArrayBuffer]"===lo.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=to.deflateSetDictionary(this.strm,e),i!==fo)throw new Error(ir[i]);this._dict_set=!0}}function yo(e,t){const i=new _o(t);if(i.push(e,!0),i.err)throw i.msg||ir[i.err];return i.result}_o.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let o,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?uo:co,"string"==typeof e?i.input=so.string2buf(e):"[object ArrayBuffer]"===lo.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(a===ho||a===po)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(o=to.deflate(i,a),o===mo)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),o=to.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===fo;if(0!==i.avail_out){if(a>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},_o.prototype.onData=function(e){this.chunks.push(e)},_o.prototype.onEnd=function(e){e===fo&&(this.result=ro.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var xo={Deflate:_o,deflate:yo,deflateRaw:function(e,t){return(t=t||{}).raw=!0,yo(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,yo(e,t)},constants:rr};const wo=16209;var ko=function(e,t){let i,r,o,a,s,n,l,d,c,h,p,u,f,m,v,g,b,_,y,x,w,k,E,S;const A=e.state;i=e.next_in,E=e.input,r=i+(e.avail_in-5),o=e.next_out,S=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),n=A.dmax,l=A.wsize,d=A.whave,c=A.wnext,h=A.window,p=A.hold,u=A.bits,f=A.lencode,m=A.distcode,v=(1<<A.lenbits)-1,g=(1<<A.distbits)-1;e:do{u<15&&(p+=E[i++]<<u,u+=8,p+=E[i++]<<u,u+=8),b=f[p&v];t:for(;;){if(_=b>>>24,p>>>=_,u-=_,_=b>>>16&255,0===_)S[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=f[(65535&b)+(p&(1<<_)-1)];continue t}if(32&_){A.mode=16191;break e}e.msg="invalid literal/length code",A.mode=wo;break e}y=65535&b,_&=15,_&&(u<_&&(p+=E[i++]<<u,u+=8),y+=p&(1<<_)-1,p>>>=_,u-=_),u<15&&(p+=E[i++]<<u,u+=8,p+=E[i++]<<u,u+=8),b=m[p&g];i:for(;;){if(_=b>>>24,p>>>=_,u-=_,_=b>>>16&255,!(16&_)){if(0==(64&_)){b=m[(65535&b)+(p&(1<<_)-1)];continue i}e.msg="invalid distance code",A.mode=wo;break e}if(x=65535&b,_&=15,u<_&&(p+=E[i++]<<u,u+=8,u<_&&(p+=E[i++]<<u,u+=8)),x+=p&(1<<_)-1,x>n){e.msg="invalid distance too far back",A.mode=wo;break e}if(p>>>=_,u-=_,_=o-a,x>_){if(_=x-_,_>d&&A.sane){e.msg="invalid distance too far back",A.mode=wo;break e}if(w=0,k=h,0===c){if(w+=l-_,_<y){y-=_;do{S[o++]=h[w++]}while(--_);w=o-x,k=S}}else if(c<_){if(w+=l+c-_,_-=c,_<y){y-=_;do{S[o++]=h[w++]}while(--_);if(w=0,c<y){_=c,y-=_;do{S[o++]=h[w++]}while(--_);w=o-x,k=S}}}else if(w+=c-_,_<y){y-=_;do{S[o++]=h[w++]}while(--_);w=o-x,k=S}for(;y>2;)S[o++]=k[w++],S[o++]=k[w++],S[o++]=k[w++],y-=3;y&&(S[o++]=k[w++],y>1&&(S[o++]=k[w++]))}else{w=o-x;do{S[o++]=S[w++],S[o++]=S[w++],S[o++]=S[w++],y-=3}while(y>2);y&&(S[o++]=S[w++],y>1&&(S[o++]=S[w++]))}break}}break}}while(i<r&&o<s);y=u>>3,i-=y,u-=y<<3,p&=(1<<u)-1,e.next_in=i,e.next_out=o,e.avail_in=i<r?r-i+5:5-(i-r),e.avail_out=o<s?s-o+257:257-(o-s),A.hold=p,A.bits=u};const Eo=15,So=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ao=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),To=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Co=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Ro=(e,t,i,r,o,a,s,n)=>{const l=n.bits;let d,c,h,p,u,f,m=0,v=0,g=0,b=0,_=0,y=0,x=0,w=0,k=0,E=0,S=null;const A=new Uint16Array(16),T=new Uint16Array(16);let C,R,I,$=null;for(m=0;m<=Eo;m++)A[m]=0;for(v=0;v<r;v++)A[t[i+v]]++;for(_=l,b=Eo;b>=1&&0===A[b];b--);if(_>b&&(_=b),0===b)return o[a++]=20971520,o[a++]=20971520,n.bits=1,0;for(g=1;g<b&&0===A[g];g++);for(_<g&&(_=g),w=1,m=1;m<=Eo;m++)if(w<<=1,w-=A[m],w<0)return-1;if(w>0&&(0===e||1!==b))return-1;for(T[1]=0,m=1;m<Eo;m++)T[m+1]=T[m]+A[m];for(v=0;v<r;v++)0!==t[i+v]&&(s[T[t[i+v]]++]=v);if(0===e?(S=$=s,f=20):1===e?(S=So,$=Ao,f=257):(S=To,$=Co,f=0),E=0,v=0,m=g,u=a,y=_,x=0,h=-1,k=1<<_,p=k-1,1===e&&k>852||2===e&&k>592)return 1;for(;;){C=m-x,s[v]+1<f?(R=0,I=s[v]):s[v]>=f?(R=$[s[v]-f],I=S[s[v]-f]):(R=96,I=0),d=1<<m-x,c=1<<y,g=c;do{c-=d,o[u+(E>>x)+c]=C<<24|R<<16|I|0}while(0!==c);for(d=1<<m-1;E&d;)d>>=1;if(0!==d?(E&=d-1,E+=d):E=0,v++,0==--A[m]){if(m===b)break;m=t[i+s[v]]}if(m>_&&(E&p)!==h){for(0===x&&(x=_),u+=g,y=m-x,w=1<<y;y+x<b&&(w-=A[y+x],!(w<=0));)y++,w<<=1;if(k+=1<<y,1===e&&k>852||2===e&&k>592)return 1;h=E&p,o[h]=_<<24|y<<16|u-a|0}}return 0!==E&&(o[u+E]=m-x<<24|64<<16|0),n.bits=_,0};const{Z_FINISH:Io,Z_BLOCK:$o,Z_TREES:Lo,Z_OK:Oo,Z_STREAM_END:zo,Z_NEED_DICT:Do,Z_STREAM_ERROR:Po,Z_DATA_ERROR:Bo,Z_MEM_ERROR:Fo,Z_BUF_ERROR:Uo,Z_DEFLATED:Mo}=rr,No=16180,Ho=16190,qo=16191,Wo=16192,Zo=16194,Vo=16199,jo=16200,Go=16206,Ko=16209,Yo=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Xo(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Jo=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<No||t.mode>16211?1:0},Qo=e=>{if(Jo(e))return Po;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=No,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Oo},ea=e=>{if(Jo(e))return Po;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Qo(e)},ta=(e,t)=>{let i;if(Jo(e))return Po;const r=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Po:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,ea(e))},ia=(e,t)=>{if(!e)return Po;const i=new Xo;e.state=i,i.strm=e,i.window=null,i.mode=No;const r=ta(e,t);return r!==Oo&&(e.state=null),r};let ra,oa,aa=!0;const sa=e=>{if(aa){ra=new Int32Array(512),oa=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ro(1,e.lens,0,288,ra,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ro(2,e.lens,0,32,oa,0,e.work,{bits:5}),aa=!1}e.lencode=ra,e.lenbits=9,e.distcode=oa,e.distbits=5},na=(e,t,i,r)=>{let o;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(i-a.wsize,i),0),a.wnext=0,a.whave=a.wsize):(o=a.wsize-a.wnext,o>r&&(o=r),a.window.set(t.subarray(i-r,i-r+o),a.wnext),(r-=o)?(a.window.set(t.subarray(i-r,i),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0};var la=(e,t)=>{let i,r,o,a,s,n,l,d,c,h,p,u,f,m,v,g,b,_,y,x,w,k,E=0;const S=new Uint8Array(4);let A,T;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Jo(e)||!e.output||!e.input&&0!==e.avail_in)return Po;i=e.state,i.mode===qo&&(i.mode=Wo),s=e.next_out,o=e.output,l=e.avail_out,a=e.next_in,r=e.input,n=e.avail_in,d=i.hold,c=i.bits,h=n,p=l,k=Oo;e:for(;;)switch(i.mode){case No:if(0===i.wrap){i.mode=Wo;break}for(;c<16;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(2&i.wrap&&35615===d){0===i.wbits&&(i.wbits=15),i.check=0,S[0]=255&d,S[1]=d>>>8&255,i.check=tr(i.check,S,2,0),d=0,c=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",i.mode=Ko;break}if((15&d)!==Mo){e.msg="unknown compression method",i.mode=Ko;break}if(d>>>=4,c-=4,w=8+(15&d),0===i.wbits&&(i.wbits=w),w>15||w>i.wbits){e.msg="invalid window size",i.mode=Ko;break}i.dmax=1<<i.wbits,i.flags=0,e.adler=i.check=1,i.mode=512&d?16189:qo,d=0,c=0;break;case 16181:for(;c<16;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(i.flags=d,(255&i.flags)!==Mo){e.msg="unknown compression method",i.mode=Ko;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=Ko;break}i.head&&(i.head.text=d>>8&1),512&i.flags&&4&i.wrap&&(S[0]=255&d,S[1]=d>>>8&255,i.check=tr(i.check,S,2,0)),d=0,c=0,i.mode=16182;case 16182:for(;c<32;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}i.head&&(i.head.time=d),512&i.flags&&4&i.wrap&&(S[0]=255&d,S[1]=d>>>8&255,S[2]=d>>>16&255,S[3]=d>>>24&255,i.check=tr(i.check,S,4,0)),d=0,c=0,i.mode=16183;case 16183:for(;c<16;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}i.head&&(i.head.xflags=255&d,i.head.os=d>>8),512&i.flags&&4&i.wrap&&(S[0]=255&d,S[1]=d>>>8&255,i.check=tr(i.check,S,2,0)),d=0,c=0,i.mode=16184;case 16184:if(1024&i.flags){for(;c<16;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}i.length=d,i.head&&(i.head.extra_len=d),512&i.flags&&4&i.wrap&&(S[0]=255&d,S[1]=d>>>8&255,i.check=tr(i.check,S,2,0)),d=0,c=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(u=i.length,u>n&&(u=n),u&&(i.head&&(w=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(a,a+u),w)),512&i.flags&&4&i.wrap&&(i.check=tr(i.check,r,u,a)),n-=u,a+=u,i.length-=u),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===n)break e;u=0;do{w=r[a+u++],i.head&&w&&i.length<65536&&(i.head.name+=String.fromCharCode(w))}while(w&&u<n);if(512&i.flags&&4&i.wrap&&(i.check=tr(i.check,r,u,a)),n-=u,a+=u,w)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===n)break e;u=0;do{w=r[a+u++],i.head&&w&&i.length<65536&&(i.head.comment+=String.fromCharCode(w))}while(w&&u<n);if(512&i.flags&&4&i.wrap&&(i.check=tr(i.check,r,u,a)),n-=u,a+=u,w)break e}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;c<16;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(4&i.wrap&&d!==(65535&i.check)){e.msg="header crc mismatch",i.mode=Ko;break}d=0,c=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=qo;break;case 16189:for(;c<32;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}e.adler=i.check=Yo(d),d=0,c=0,i.mode=Ho;case Ho:if(0===i.havedict)return e.next_out=s,e.avail_out=l,e.next_in=a,e.avail_in=n,i.hold=d,i.bits=c,Do;e.adler=i.check=1,i.mode=qo;case qo:if(t===$o||t===Lo)break e;case Wo:if(i.last){d>>>=7&c,c-=7&c,i.mode=Go;break}for(;c<3;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}switch(i.last=1&d,d>>>=1,c-=1,3&d){case 0:i.mode=16193;break;case 1:if(sa(i),i.mode=Vo,t===Lo){d>>>=2,c-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg="invalid block type",i.mode=Ko}d>>>=2,c-=2;break;case 16193:for(d>>>=7&c,c-=7&c;c<32;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if((65535&d)!=(d>>>16^65535)){e.msg="invalid stored block lengths",i.mode=Ko;break}if(i.length=65535&d,d=0,c=0,i.mode=Zo,t===Lo)break e;case Zo:i.mode=16195;case 16195:if(u=i.length,u){if(u>n&&(u=n),u>l&&(u=l),0===u)break e;o.set(r.subarray(a,a+u),s),n-=u,a+=u,l-=u,s+=u,i.length-=u;break}i.mode=qo;break;case 16196:for(;c<14;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(i.nlen=257+(31&d),d>>>=5,c-=5,i.ndist=1+(31&d),d>>>=5,c-=5,i.ncode=4+(15&d),d>>>=4,c-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=Ko;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;c<3;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}i.lens[C[i.have++]]=7&d,d>>>=3,c-=3}for(;i.have<19;)i.lens[C[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,A={bits:i.lenbits},k=Ro(0,i.lens,0,19,i.lencode,0,i.work,A),i.lenbits=A.bits,k){e.msg="invalid code lengths set",i.mode=Ko;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;E=i.lencode[d&(1<<i.lenbits)-1],v=E>>>24,g=E>>>16&255,b=65535&E,!(v<=c);){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(b<16)d>>>=v,c-=v,i.lens[i.have++]=b;else{if(16===b){for(T=v+2;c<T;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(d>>>=v,c-=v,0===i.have){e.msg="invalid bit length repeat",i.mode=Ko;break}w=i.lens[i.have-1],u=3+(3&d),d>>>=2,c-=2}else if(17===b){for(T=v+3;c<T;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}d>>>=v,c-=v,w=0,u=3+(7&d),d>>>=3,c-=3}else{for(T=v+7;c<T;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}d>>>=v,c-=v,w=0,u=11+(127&d),d>>>=7,c-=7}if(i.have+u>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=Ko;break}for(;u--;)i.lens[i.have++]=w}}if(i.mode===Ko)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=Ko;break}if(i.lenbits=9,A={bits:i.lenbits},k=Ro(1,i.lens,0,i.nlen,i.lencode,0,i.work,A),i.lenbits=A.bits,k){e.msg="invalid literal/lengths set",i.mode=Ko;break}if(i.distbits=6,i.distcode=i.distdyn,A={bits:i.distbits},k=Ro(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,A),i.distbits=A.bits,k){e.msg="invalid distances set",i.mode=Ko;break}if(i.mode=Vo,t===Lo)break e;case Vo:i.mode=jo;case jo:if(n>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=a,e.avail_in=n,i.hold=d,i.bits=c,ko(e,p),s=e.next_out,o=e.output,l=e.avail_out,a=e.next_in,r=e.input,n=e.avail_in,d=i.hold,c=i.bits,i.mode===qo&&(i.back=-1);break}for(i.back=0;E=i.lencode[d&(1<<i.lenbits)-1],v=E>>>24,g=E>>>16&255,b=65535&E,!(v<=c);){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(g&&0==(240&g)){for(_=v,y=g,x=b;E=i.lencode[x+((d&(1<<_+y)-1)>>_)],v=E>>>24,g=E>>>16&255,b=65535&E,!(_+v<=c);){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}d>>>=_,c-=_,i.back+=_}if(d>>>=v,c-=v,i.back+=v,i.length=b,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=qo;break}if(64&g){e.msg="invalid literal/length code",i.mode=Ko;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(T=i.extra;c<T;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}i.length+=d&(1<<i.extra)-1,d>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;E=i.distcode[d&(1<<i.distbits)-1],v=E>>>24,g=E>>>16&255,b=65535&E,!(v<=c);){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(0==(240&g)){for(_=v,y=g,x=b;E=i.distcode[x+((d&(1<<_+y)-1)>>_)],v=E>>>24,g=E>>>16&255,b=65535&E,!(_+v<=c);){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}d>>>=_,c-=_,i.back+=_}if(d>>>=v,c-=v,i.back+=v,64&g){e.msg="invalid distance code",i.mode=Ko;break}i.offset=b,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(T=i.extra;c<T;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}i.offset+=d&(1<<i.extra)-1,d>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=Ko;break}i.mode=16204;case 16204:if(0===l)break e;if(u=p-l,i.offset>u){if(u=i.offset-u,u>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=Ko;break}u>i.wnext?(u-=i.wnext,f=i.wsize-u):f=i.wnext-u,u>i.length&&(u=i.length),m=i.window}else m=o,f=s-i.offset,u=i.length;u>l&&(u=l),l-=u,i.length-=u;do{o[s++]=m[f++]}while(--u);0===i.length&&(i.mode=jo);break;case 16205:if(0===l)break e;o[s++]=i.length,l--,i.mode=jo;break;case Go:if(i.wrap){for(;c<32;){if(0===n)break e;n--,d|=r[a++]<<c,c+=8}if(p-=l,e.total_out+=p,i.total+=p,4&i.wrap&&p&&(e.adler=i.check=i.flags?tr(i.check,o,p,s-p):Qi(i.check,o,p,s-p)),p=l,4&i.wrap&&(i.flags?d:Yo(d))!==i.check){e.msg="incorrect data check",i.mode=Ko;break}d=0,c=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;c<32;){if(0===n)break e;n--,d+=r[a++]<<c,c+=8}if(4&i.wrap&&d!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=Ko;break}d=0,c=0}i.mode=16208;case 16208:k=zo;break e;case Ko:k=Bo;break e;case 16210:return Fo;default:return Po}return e.next_out=s,e.avail_out=l,e.next_in=a,e.avail_in=n,i.hold=d,i.bits=c,(i.wsize||p!==e.avail_out&&i.mode<Ko&&(i.mode<Go||t!==Io))&&na(e,e.output,e.next_out,p-e.avail_out),h-=e.avail_in,p-=e.avail_out,e.total_in+=h,e.total_out+=p,i.total+=p,4&i.wrap&&p&&(e.adler=i.check=i.flags?tr(i.check,o,p,e.next_out-p):Qi(i.check,o,p,e.next_out-p)),e.data_type=i.bits+(i.last?64:0)+(i.mode===qo?128:0)+(i.mode===Vo||i.mode===Zo?256:0),(0===h&&0===p||t===Io)&&k===Oo&&(k=Uo),k},da={inflateReset:ea,inflateReset2:ta,inflateResetKeep:Qo,inflateInit:e=>ia(e,15),inflateInit2:ia,inflate:la,inflateEnd:e=>{if(Jo(e))return Po;let t=e.state;return t.window&&(t.window=null),e.state=null,Oo},inflateGetHeader:(e,t)=>{if(Jo(e))return Po;const i=e.state;return 0==(2&i.wrap)?Po:(i.head=t,t.done=!1,Oo)},inflateSetDictionary:(e,t)=>{const i=t.length;let r,o,a;return Jo(e)?Po:(r=e.state,0!==r.wrap&&r.mode!==Ho?Po:r.mode===Ho&&(o=1,o=Qi(o,t,i,0),o!==r.check)?Bo:(a=na(e,t,i,i),a?(r.mode=16210,Fo):(r.havedict=1,Oo)))},inflateInfo:"pako inflate (from Nodeca project)"};var ca=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const ha=Object.prototype.toString,{Z_NO_FLUSH:pa,Z_FINISH:ua,Z_OK:fa,Z_STREAM_END:ma,Z_NEED_DICT:va,Z_STREAM_ERROR:ga,Z_DATA_ERROR:ba,Z_MEM_ERROR:_a}=rr;function ya(e){this.options=ro.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new no,this.strm.avail_out=0;let i=da.inflateInit2(this.strm,t.windowBits);if(i!==fa)throw new Error(ir[i]);if(this.header=new ca,da.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=so.string2buf(t.dictionary):"[object ArrayBuffer]"===ha.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=da.inflateSetDictionary(this.strm,t.dictionary),i!==fa)))throw new Error(ir[i])}function xa(e,t){const i=new ya(t);if(i.push(e),i.err)throw i.msg||ir[i.err];return i.result}ya.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let a,s,n;if(this.ended)return!1;for(s=t===~~t?t:!0===t?ua:pa,"[object ArrayBuffer]"===ha.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),a=da.inflate(i,s),a===va&&o&&(a=da.inflateSetDictionary(i,o),a===fa?a=da.inflate(i,s):a===ba&&(a=va));i.avail_in>0&&a===ma&&i.state.wrap>0&&0!==e[i.next_in];)da.inflateReset(i),a=da.inflate(i,s);switch(a){case ga:case ba:case va:case _a:return this.onEnd(a),this.ended=!0,!1}if(n=i.avail_out,i.next_out&&(0===i.avail_out||a===ma))if("string"===this.options.to){let e=so.utf8border(i.output,i.next_out),t=i.next_out-e,o=so.buf2string(i.output,e);i.next_out=t,i.avail_out=r-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(o)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(a!==fa||0!==n){if(a===ma)return a=da.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},ya.prototype.onData=function(e){this.chunks.push(e)},ya.prototype.onEnd=function(e){e===fa&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ro.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var wa={Inflate:ya,inflate:xa,inflateRaw:function(e,t){return(t=t||{}).raw=!0,xa(e,t)},ungzip:xa,constants:rr};const{Deflate:ka,deflate:Ea,deflateRaw:Sa,gzip:Aa}=xo,{Inflate:Ta,inflate:Ca,inflateRaw:Ra,ungzip:Ia}=wa;var $a,La,Oa=Ea,za=Ta;class Da{constructor(e,t=!1,i=!0){this.device=e,this.tracing=t,this.slipReaderEnabled=!1,this.baudrate=0,this.traceLog="",this.lastTraceTime=Date.now(),this.buffer=new Uint8Array(0),this.SLIP_END=192,this.SLIP_ESC=219,this.SLIP_ESC_END=220,this.SLIP_ESC_ESC=221,this._DTR_state=!1,this.slipReaderEnabled=i}getInfo(){const e=this.device.getInfo();return e.usbVendorId&&e.usbProductId?`WebSerial VendorID 0x${e.usbVendorId.toString(16)} ProductID 0x${e.usbProductId.toString(16)}`:""}getPid(){return this.device.getInfo().usbProductId}trace(e){const t=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${e}`;console.log(t),this.traceLog+=t+"\n"}async returnTrace(){try{await navigator.clipboard.writeText(this.traceLog),console.log("Text copied to clipboard!")}catch(e){console.error("Failed to copy text:",e)}}hexify(e){return Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("").padEnd(16," ")}hexConvert(e,t=!0){if(t&&e.length>16){let t="",i=e;for(;i.length>0;){const e=i.slice(0,16),r=String.fromCharCode(...e).split("").map((e=>" "===e||e>=" "&&e<="~"&&" "!==e?e:".")).join("");i=i.slice(16),t+=`\n ${this.hexify(e.slice(0,8))} ${this.hexify(e.slice(8))} | ${r}`}return t}return this.hexify(e)}slipWriter(e){const t=[];t.push(192);for(let i=0;i<e.length;i++)219===e[i]?t.push(219,221):192===e[i]?t.push(219,220):t.push(e[i]);return t.push(192),new Uint8Array(t)}async write(e){const t=this.slipWriter(e);if(this.device.writable){const e=this.device.writable.getWriter();this.tracing&&(console.log("Write bytes"),this.trace(`Write ${t.length} bytes: ${this.hexConvert(t)}`)),await e.write(t),e.releaseLock()}}appendArray(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}async*readLoop(e){if(this.reader)try{for(;;){const t=new Promise(((t,i)=>setTimeout((()=>i(new Error("Read timeout exceeded"))),e))),i=await Promise.race([this.reader.read(),t]);if(null===i)break;const{value:r,done:o}=i;if(o||!r)break;yield r}}catch(e){console.error("Error reading from serial port:",e)}finally{this.buffer=new Uint8Array(0)}}async newRead(e,t){if(this.buffer.length>=e){const t=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),t}for(;this.buffer.length<e;){const e=this.readLoop(t),{value:i,done:r}=await e.next();if(r||!i)break;this.buffer=this.appendArray(this.buffer,i)}const i=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),i}async flushInput(){var e;this.reader&&!await this.reader.closed&&(await this.reader.cancel(),this.reader.releaseLock(),this.reader=null===(e=this.device.readable)||void 0===e?void 0:e.getReader())}async flushOutput(){var e,t;this.buffer=new Uint8Array(0),await(null===(e=this.device.writable)||void 0===e?void 0:e.getWriter().close()),null===(t=this.device.writable)||void 0===t||t.getWriter().releaseLock()}inWaiting(){return this.buffer.length}detectPanicHandler(e){const t=new TextDecoder("utf-8").decode(e),i=t.match(/G?uru Meditation Error: (?:Core \d panic'ed \(([a-zA-Z ]*)\))?/)||t.match(/F?atal exception \(\d+\): (?:([a-zA-Z ]*)?.*epc)?/);if(i){const e=i[1]||i[2];throw new Error("Guru Meditation Error detected"+(e?` (${e})`:""))}}async*read(e){var t;this.reader||(this.reader=null===(t=this.device.readable)||void 0===t?void 0:t.getReader());let i=null,r=!1,o=!1;for(;;){const t=this.inWaiting(),a=await this.newRead(t>0?t:1,e);if(!a||0===a.length){const e=null===i?o?"Serial data stream stopped: Possible serial noise or corruption.":"No serial data received.":"Packet content transfer stopped";throw this.trace(e),new Error(e)}this.trace(`Read ${a.length} bytes: ${this.hexConvert(a)}`);let s=0;for(;s<a.length;){const t=a[s++];if(null===i){if(t!==this.SLIP_END){this.trace(`Read invalid data: ${this.hexConvert(a)}`);const i=await this.newRead(this.inWaiting(),e);throw this.trace(`Remaining data in serial buffer: ${this.hexConvert(i)}`),this.detectPanicHandler(new Uint8Array([...a,...i||[]])),new Error(`Invalid head of packet (0x${t.toString(16)}): Possible serial noise or corruption.`)}i=new Uint8Array(0)}else if(r)if(r=!1,t===this.SLIP_ESC_END)i=this.appendArray(i,new Uint8Array([this.SLIP_END]));else{if(t!==this.SLIP_ESC_ESC){this.trace(`Read invalid data: ${this.hexConvert(a)}`);const i=await this.newRead(this.inWaiting(),e);throw this.trace(`Remaining data in serial buffer: ${this.hexConvert(i)}`),this.detectPanicHandler(new Uint8Array([...a,...i||[]])),new Error(`Invalid SLIP escape (0xdb, 0x${t.toString(16)})`)}i=this.appendArray(i,new Uint8Array([this.SLIP_ESC]))}else t===this.SLIP_ESC?r=!0:t===this.SLIP_END?(this.trace(`Received full packet: ${this.hexConvert(i)}`),this.buffer=this.appendArray(this.buffer,a.slice(s)),yield i,i=null,o=!0):i=this.appendArray(i,new Uint8Array([t]))}}}async*rawRead(){if(this.reader)try{for(;;){const{value:e,done:t}=await this.reader.read();if(t||!e)break;this.tracing&&(console.log("Raw Read bytes"),this.trace(`Read ${e.length} bytes: ${this.hexConvert(e)}`)),yield e}}catch(e){console.error("Error reading from serial port:",e)}finally{this.buffer=new Uint8Array(0)}}async setRTS(e){await this.device.setSignals({requestToSend:e}),await this.setDTR(this._DTR_state)}async setDTR(e){this._DTR_state=e,await this.device.setSignals({dataTerminalReady:e})}async connect(e=115200,t={}){var i;await this.device.open({baudRate:e,dataBits:null==t?void 0:t.dataBits,stopBits:null==t?void 0:t.stopBits,bufferSize:null==t?void 0:t.bufferSize,parity:null==t?void 0:t.parity,flowControl:null==t?void 0:t.flowControl}),this.baudrate=e,this.reader=null===(i=this.device.readable)||void 0===i?void 0:i.getReader()}async sleep(e){return new Promise((t=>setTimeout(t,e)))}async waitForUnlock(e){for(;this.device.readable&&this.device.readable.locked||this.device.writable&&this.device.writable.locked;)await this.sleep(e)}async disconnect(){var e,t;(null===(e=this.device.readable)||void 0===e?void 0:e.locked)&&await(null===(t=this.reader)||void 0===t?void 0:t.cancel()),await this.waitForUnlock(400),await this.device.close(),this.reader=void 0}}function Pa(e){return new Promise((t=>setTimeout(t,e)))}class Ba{constructor(e,t){this.resetDelay=t,this.transport=e}async reset(){await this.transport.setDTR(!1),await this.transport.setRTS(!0),await Pa(100),await this.transport.setDTR(!0),await this.transport.setRTS(!1),await Pa(this.resetDelay),await this.transport.setDTR(!1)}}class Fa{constructor(e){this.transport=e}async reset(){await this.transport.setRTS(!1),await this.transport.setDTR(!1),await Pa(100),await this.transport.setDTR(!0),await this.transport.setRTS(!1),await Pa(100),await this.transport.setRTS(!0),await this.transport.setDTR(!1),await this.transport.setRTS(!0),await Pa(100),await this.transport.setRTS(!1),await this.transport.setDTR(!1)}}function Ua(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ma=Ua(La?$a:(La=1,$a=function(e){return atob(e)}));async function Na(e){let t;switch(e){case"ESP32":t=await import("./stub_flasher_32-BLbsWvxO.js");break;case"ESP32-C2":t=await import("./stub_flasher_32c2-wLQhZItC.js");break;case"ESP32-C3":t=await import("./stub_flasher_32c3-DmSvHQKL.js");break;case"ESP32-C5":t=await import("./stub_flasher_32c5-BwEHy6UZ.js");break;case"ESP32-C6":t=await import("./stub_flasher_32c6-ZuxjUVr4.js");break;case"ESP32-C61":t=await import("./stub_flasher_32c61-DeKkw9vN.js");break;case"ESP32-H2":t=await import("./stub_flasher_32h2-CZ4EIL3w.js");break;case"ESP32-P4":t=await import("./stub_flasher_32p4-BvuBbdjO.js");break;case"ESP32-S2":t=await import("./stub_flasher_32s2-CrsP1231.js");break;case"ESP32-S3":t=await import("./stub_flasher_32s3-CiJyd6Fk.js");break;case"ESP8266":t=await import("./stub_flasher_8266-CQFcqJ_a.js")}if(t)return{bss_start:t.bss_start,data:t.data,data_start:t.data_start,entry:t.entry,text:t.text,text_start:t.text_start,decodedData:Ha(t.data),decodedText:Ha(t.text)}}function Ha(e){const t=Ma(e).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}function qa(e,t,i=255){const r=e.length%t;if(0!==r){const o=new Uint8Array(t-r).fill(i),a=new Uint8Array(e.length+o.length);return a.set(e),a.set(o,e.length),a}return e}class Wa{constructor(e){this.ESP_RAM_BLOCK=6144,this.ESP_FLASH_BEGIN=2,this.ESP_FLASH_DATA=3,this.ESP_FLASH_END=4,this.ESP_MEM_BEGIN=5,this.ESP_MEM_END=6,this.ESP_MEM_DATA=7,this.ESP_WRITE_REG=9,this.ESP_READ_REG=10,this.ESP_SPI_ATTACH=13,this.ESP_CHANGE_BAUDRATE=15,this.ESP_FLASH_DEFL_BEGIN=16,this.ESP_FLASH_DEFL_DATA=17,this.ESP_FLASH_DEFL_END=18,this.ESP_SPI_FLASH_MD5=19,this.ESP_ERASE_FLASH=208,this.ESP_ERASE_REGION=209,this.ESP_READ_FLASH=210,this.ESP_RUN_USER_CODE=211,this.ESP_IMAGE_MAGIC=233,this.ESP_CHECKSUM_MAGIC=239,this.ROM_INVALID_RECV_MSG=5,this.DEFAULT_TIMEOUT=3e3,this.ERASE_REGION_TIMEOUT_PER_MB=3e4,this.ERASE_WRITE_TIMEOUT_PER_MB=4e4,this.MD5_TIMEOUT_PER_MB=8e3,this.CHIP_ERASE_TIMEOUT=12e4,this.FLASH_READ_TIMEOUT=1e5,this.MAX_TIMEOUT=2*this.CHIP_ERASE_TIMEOUT,this.CHIP_DETECT_MAGIC_REG_ADDR=1073745920,this.DETECTED_FLASH_SIZES={18:"256KB",19:"512KB",20:"1MB",21:"2MB",22:"4MB",23:"8MB",24:"16MB"},this.DETECTED_FLASH_SIZES_NUM={18:256,19:512,20:1024,21:2048,22:4096,23:8192,24:16384},this.USB_JTAG_SERIAL_PID=4097,this.romBaudrate=115200,this.debugLogging=!1,this.syncStubDetected=!1,this.flashSizeBytes=function(e){let t=-1;return-1!==e.indexOf("KB")?t=1024*parseInt(e.slice(0,e.indexOf("KB"))):-1!==e.indexOf("MB")&&(t=1024*parseInt(e.slice(0,e.indexOf("MB")))*1024),t},this.IS_STUB=!1,this.FLASH_WRITE_SIZE=16384,this.transport=e.transport,this.baudrate=e.baudrate,e.serialOptions&&(this.serialOptions=e.serialOptions),e.romBaudrate&&(this.romBaudrate=e.romBaudrate),e.terminal&&(this.terminal=e.terminal,this.terminal.clean()),void 0!==e.debugLogging&&(this.debugLogging=e.debugLogging),e.port&&(this.transport=new Da(e.port)),void 0!==e.enableTracing&&(this.transport.tracing=e.enableTracing),this.info("esptool.js"),this.info("Serial port "+this.transport.getInfo())}_sleep(e){return new Promise((t=>setTimeout(t,e)))}write(e,t=!0){this.terminal?t?this.terminal.writeLine(e):this.terminal.write(e):console.log(e)}error(e,t=!0){this.write(`Error: ${e}`,t)}info(e,t=!0){this.write(e,t)}debug(e,t=!0){this.debugLogging&&this.write(`Debug: ${e}`,t)}_shortToBytearray(e){return new Uint8Array([255&e,e>>8&255])}_intToByteArray(e){return new Uint8Array([255&e,e>>8&255,e>>16&255,e>>24&255])}_byteArrayToShort(e,t){return e|t>>8}_byteArrayToInt(e,t,i,r){return e|t<<8|i<<16|r<<24}_appendBuffer(e,t){const i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer}_appendArray(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e,0),i.set(t,e.length),i}ui8ToBstr(e){let t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t}bstrToUi8(e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}async flushInput(){try{await this.transport.flushInput()}catch(e){this.error(e.message)}}async readPacket(e=null,t=this.DEFAULT_TIMEOUT){for(let i=0;i<100;i++){const{value:i}=await this.transport.read(t).next();if(!i||i.length<8)continue;const r=i[0];if(1!==r)continue;const o=i[1],a=this._byteArrayToInt(i[4],i[5],i[6],i[7]),s=i.slice(8);if(1==r){if(null==e||o==e)return[a,s];if(0!=s[0]&&s[1]==this.ROM_INVALID_RECV_MSG)throw await this.flushInput(),new ui("unsupported command error")}}throw new ui("invalid response")}async command(e=null,t=new Uint8Array(0),i=0,r=!0,o=this.DEFAULT_TIMEOUT){if(null!=e){this.transport.tracing&&this.transport.trace(`command op:0x${e.toString(16).padStart(2,"0")} data len=${t.length} wait_response=${r?1:0} timeout=${(o/1e3).toFixed(3)} data=${this.transport.hexConvert(t)}`);const a=new Uint8Array(8+t.length);let s;for(a[0]=0,a[1]=e,a[2]=this._shortToBytearray(t.length)[0],a[3]=this._shortToBytearray(t.length)[1],a[4]=this._intToByteArray(i)[0],a[5]=this._intToByteArray(i)[1],a[6]=this._intToByteArray(i)[2],a[7]=this._intToByteArray(i)[3],s=0;s<t.length;s++)a[8+s]=t[s];await this.transport.write(a)}return r?this.readPacket(e,o):[0,new Uint8Array(0)]}async readReg(e,t=this.DEFAULT_TIMEOUT){const i=this._intToByteArray(e);return(await this.command(this.ESP_READ_REG,i,void 0,void 0,t))[0]}async writeReg(e,t,i=4294967295,r=0,o=0){let a=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));a=this._appendArray(a,this._intToByteArray(i)),a=this._appendArray(a,this._intToByteArray(r)),o>0&&(a=this._appendArray(a,this._intToByteArray(this.chip.UART_DATE_REG_ADDR)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(o))),await this.checkCommand("write target memory",this.ESP_WRITE_REG,a)}async sync(){this.debug("Sync");const e=new Uint8Array(36);let t;for(e[0]=7,e[1]=7,e[2]=18,e[3]=32,t=0;t<32;t++)e[4+t]=85;try{let t=await this.command(8,e,void 0,void 0,100);this.syncStubDetected=0===t[0];for(let e=0;e<7;e++)t=await this.command(),this.syncStubDetected=this.syncStubDetected&&0===t[0];return t}catch(e){throw this.debug("Sync err "+e),e}}async _connectAttempt(e="default_reset",t){this.debug("_connect_attempt "+e),await t.reset();const i=this.transport.inWaiting(),r=await this.transport.newRead(i>0?i:1,this.DEFAULT_TIMEOUT),o=Array.from(r,(e=>String.fromCharCode(e))).join("").match(/boot:(0x[0-9a-fA-F]+)(.*waiting for download)?/);let a=!1,s="",n=!1;o&&(a=!0,s=o[1],n=!!o[2]);let l="";for(let e=0;e<5;e++)try{this.debug(`Sync connect attempt ${e}`);const t=await this.sync();return this.debug(t[0].toString()),"success"}catch(e){this.debug(`Error at sync ${e}`),l=e instanceof Error?e.message:"string"==typeof e?e:JSON.stringify(e)}return a&&(l=`Wrong boot mode detected (${s}).\n This chip needs to be in download mode.`,n&&(l="Download mode successfully detected, but getting no sync reply:\n The serial TX path seems to be down.")),l}constructResetSequency(){if(this.transport.getPid()===this.USB_JTAG_SERIAL_PID)return this.debug("using USB JTAG Serial Reset"),[new Fa(this.transport)];{const e=50,t=e+500;return this.debug("using Classic Serial Reset"),[new Ba(this.transport,e),new Ba(this.transport,t)]}}async connect(e="default_reset",t=7,i=!1){let r;this.info("Connecting...",!1),await this.transport.connect(this.romBaudrate,this.serialOptions);const o=this.constructResetSequency();for(let i=0;i<t;i++){const t=o[i%o.length];if(r=await this._connectAttempt(e,t),"success"===r)break}if("success"!==r)throw new ui("Failed to connect with the device");if(this.debug("Connect attempt successful."),this.info("\n\r",!1),!i){const e=await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR)>>>0;this.debug("Chip Magic "+e.toString(16));const t=await async function(e){switch(e){case 15736195:{const{ESP32ROM:e}=await import("./esp32-DlivVhIs.js");return new e}case 1867591791:case 2084675695:{const{ESP32C2ROM:e}=await import("./esp32c2-B8k8_i-D.js");return new e}case 1763790959:case 456216687:case 1216438383:case 1130455151:{const{ESP32C3ROM:e}=await import("./esp32c3-CgdtzNJE.js");return new e}case 752910447:{const{ESP32C6ROM:e}=await import("./esp32c6-C6rrFJso.js");return new e}case 871374959:case 606167151:{const{ESP32C61ROM:e}=await import("./esp32c61-BUPwzLDb.js");return new e}case 285294703:case 1675706479:{const{ESP32C5ROM:e}=await import("./esp32c5-CFQToUlC.js");return new e}case 3619110528:{const{ESP32H2ROM:e}=await import("./esp32h2-IsK8MXMR.js");return new e}case 9:{const{ESP32S3ROM:e}=await import("./esp32s3-vxLttl29.js");return new e}case 1990:{const{ESP32S2ROM:e}=await import("./esp32s2-Bl3uMkxu.js");return new e}case 4293968129:{const{ESP8266ROM:e}=await import("./esp8266-Dk4lBEaC.js");return new e}case 0:case 182303440:case 117676761:{const{ESP32P4ROM:e}=await import("./esp32p4-DD6i9EGh.js");return new e}default:return null}}(e);if(null===this.chip)throw new ui(`Unexpected CHIP magic value ${e}. Failed to autodetect chip type.`);this.chip=t}}async detectChip(e="default_reset"){await this.connect(e,this.romBaudrate),this.info("Detecting chip type... ",!1),null!=this.chip?this.info(this.chip.CHIP_NAME):this.info("unknown!")}async checkCommand(e="",t=null,i=new Uint8Array(0),r=0,o=this.DEFAULT_TIMEOUT){this.debug("check_command "+e);const a=await this.command(t,i,r,void 0,o);return a[1].length>4?a[1]:a[0]}async memBegin(e,t,i,r){if(this.IS_STUB){const t=r,i=r+e,o=await Na(this.chip.CHIP_NAME);if(o){const e=[[o.bss_start||o.data_start,o.data_start+o.decodedData.length],[o.text_start,o.text_start+o.decodedText.length]];for(const[r,o]of e)if(t<o&&i>r)throw new ui(`Software loader is resident at 0x${r.toString(16).padStart(8,"0")}-0x${o.toString(16).padStart(8,"0")}. \n Can't load binary at overlapping address range 0x${t.toString(16).padStart(8,"0")}-0x${i.toString(16).padStart(8,"0")}. \n Either change binary loading address, or use the no-stub option to disable the software loader.`)}}this.debug("mem_begin "+e+" "+t+" "+i+" "+r.toString(16));let o=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));o=this._appendArray(o,this._intToByteArray(i)),o=this._appendArray(o,this._intToByteArray(r)),await this.checkCommand("enter RAM download mode",this.ESP_MEM_BEGIN,o)}checksum(e,t=this.ESP_CHECKSUM_MAGIC){for(let i=0;i<e.length;i++)t^=e[i];return t}async memBlock(e,t){let i=this._appendArray(this._intToByteArray(e.length),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,e);const r=this.checksum(e);await this.checkCommand("write to target RAM",this.ESP_MEM_DATA,i,r)}async memFinish(e){const t=0===e?1:0,i=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));await this.checkCommand("leave RAM download mode",this.ESP_MEM_END,i,void 0,200)}async flashSpiAttach(e){const t=this._intToByteArray(e);await this.checkCommand("configure SPI flash pins",this.ESP_SPI_ATTACH,t)}timeoutPerMb(e,t){const i=e*(t/1e6);return i<3e3?3e3:i}async flashBegin(e,t){const i=Math.floor((e+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),r=this.chip.getEraseSize(t,e),o=new Date,a=o.getTime();let s=3e3;0==this.IS_STUB&&(s=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,e)),this.debug("flash begin "+r+" "+i+" "+this.FLASH_WRITE_SIZE+" "+t+" "+e);let n=this._appendArray(this._intToByteArray(r),this._intToByteArray(i));n=this._appendArray(n,this._intToByteArray(this.FLASH_WRITE_SIZE)),n=this._appendArray(n,this._intToByteArray(t)),0==this.IS_STUB&&(n=this._appendArray(n,this._intToByteArray(0))),await this.checkCommand("enter Flash download mode",this.ESP_FLASH_BEGIN,n,void 0,s);const l=o.getTime();return 0!=e&&0==this.IS_STUB&&this.info("Took "+(l-a)/1e3+"."+(l-a)%1e3+"s to erase flash block"),i}async flashDeflBegin(e,t,i){const r=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),o=Math.floor((e+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),a=new Date,s=a.getTime();let n,l;this.IS_STUB?(n=e,l=this.DEFAULT_TIMEOUT):(n=o*this.FLASH_WRITE_SIZE,l=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,n)),this.info("Compressed "+e+" bytes to "+t+"...");let d=this._appendArray(this._intToByteArray(n),this._intToByteArray(r));d=this._appendArray(d,this._intToByteArray(this.FLASH_WRITE_SIZE)),d=this._appendArray(d,this._intToByteArray(i)),"ESP32-S2"!==this.chip.CHIP_NAME&&"ESP32-S3"!==this.chip.CHIP_NAME&&"ESP32-C3"!==this.chip.CHIP_NAME&&"ESP32-C2"!==this.chip.CHIP_NAME||!1!==this.IS_STUB||(d=this._appendArray(d,this._intToByteArray(0))),await this.checkCommand("enter compressed flash mode",this.ESP_FLASH_DEFL_BEGIN,d,void 0,l);const c=a.getTime();return 0!=e&&!1===this.IS_STUB&&this.info("Took "+(c-s)/1e3+"."+(c-s)%1e3+"s to erase flash block"),r}async flashBlock(e,t,i){let r=this._appendArray(this._intToByteArray(e.length),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,e);const o=this.checksum(e);await this.checkCommand("write to target Flash after seq "+t,this.ESP_FLASH_DATA,r,o,i)}async flashDeflBlock(e,t,i){let r=this._appendArray(this._intToByteArray(e.length),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,e);const o=this.checksum(e);this.debug("flash_defl_block "+e[0].toString(16)+" "+e[1].toString(16)),await this.checkCommand("write compressed data to flash after seq "+t,this.ESP_FLASH_DEFL_DATA,r,o,i)}async flashFinish(e=!1){const t=e?0:1,i=this._intToByteArray(t);await this.checkCommand("leave Flash mode",this.ESP_FLASH_END,i)}async flashDeflFinish(e=!1){const t=e?0:1,i=this._intToByteArray(t);await this.checkCommand("leave compressed flash mode",this.ESP_FLASH_DEFL_END,i)}async runSpiflashCommand(e,t,i){const r=this.chip.SPI_REG_BASE,o=r+0,a=r+this.chip.SPI_USR_OFFS,s=r+this.chip.SPI_USR1_OFFS,n=r+this.chip.SPI_USR2_OFFS,l=r+this.chip.SPI_W0_OFFS;let d;d=null!=this.chip.SPI_MOSI_DLEN_OFFS?async(e,t)=>{const i=r+this.chip.SPI_MOSI_DLEN_OFFS,o=r+this.chip.SPI_MISO_DLEN_OFFS;e>0&&await this.writeReg(i,e-1),t>0&&await this.writeReg(o,t-1)}:async(e,t)=>{const i=s,r=(0===t?0:t-1)<<8|(0===e?0:e-1)<<17;await this.writeReg(i,r)};const c=1<<18;if(i>32)throw new ui("Reading more than 32 bits back from a SPI flash operation is unsupported");if(t.length>64)throw new ui("Writing more than 64 bytes of data with one SPI command is unsupported");const h=8*t.length,p=await this.readReg(a),u=await this.readReg(n);let f,m=1<<31;i>0&&(m|=268435456),h>0&&(m|=134217728),await d(h,i),await this.writeReg(a,m);let v=7<<28|e;if(await this.writeReg(n,v),0==h)await this.writeReg(l,0);else{if(t.length%4!=0){const e=new Uint8Array(t.length%4);t=this._appendArray(t,e)}let e=l;for(f=0;f<t.length-4;f+=4)v=this._byteArrayToInt(t[f],t[f+1],t[f+2],t[f+3]),await this.writeReg(e,v),e+=4}for(await this.writeReg(o,c),f=0;f<10&&(v=await this.readReg(o)&c,0!=v);f++);if(10===f)throw new ui("SPI command did not complete in time");const g=await this.readReg(l);return await this.writeReg(a,p),await this.writeReg(n,u),g}async readFlashId(){const e=new Uint8Array(0);return await this.runSpiflashCommand(159,e,24)}async eraseFlash(){this.info("Erasing flash (this may take a while)...");let e=new Date;const t=e.getTime(),i=await this.checkCommand("erase flash",this.ESP_ERASE_FLASH,void 0,void 0,this.CHIP_ERASE_TIMEOUT);e=new Date;const r=e.getTime();return this.info("Chip erase completed successfully in "+(r-t)/1e3+"s"),i}toHex(e){return Array.prototype.map.call(e,(e=>("00"+e.toString(16)).slice(-2))).join("")}async flashMd5sum(e,t){const i=this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB,t);let r=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0));let o=await this.checkCommand("calculate md5sum",this.ESP_SPI_FLASH_MD5,r,void 0,i);o instanceof Uint8Array&&o.length>16&&(o=o.slice(0,16));return this.toHex(o)}async readFlash(e,t,i=null){let r=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(4096)),r=this._appendArray(r,this._intToByteArray(1024));const o=await this.checkCommand("read flash",this.ESP_READ_FLASH,r);if(0!=o)throw new ui("Failed to read memory: "+o);let a=new Uint8Array(0);for(;a.length<t;){const{value:e}=await this.transport.read(this.FLASH_READ_TIMEOUT).next();if(!(e instanceof Uint8Array))throw new ui("Failed to read memory: "+e);e.length>0&&(a=this._appendArray(a,e),await this.transport.write(this._intToByteArray(a.length)),i&&i(e,a.length,t))}return a}async runStub(){if(this.syncStubDetected)return this.info("Stub is already running. No upload is necessary."),this.chip;this.info("Uploading stub...");const e=await Na(this.chip.CHIP_NAME);if(void 0===e)throw this.debug("Error loading Stub json"),new Error("Error loading Stub json");const t=[e.decodedText,e.decodedData];for(let i=0;i<t.length;i++)if(t[i]){const r=0===i?e.text_start:e.data_start,o=t[i].length,a=Math.floor((o+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK);await this.memBegin(o,a,this.ESP_RAM_BLOCK,r);for(let e=0;e<a;e++){const r=e*this.ESP_RAM_BLOCK,o=r+this.ESP_RAM_BLOCK;await this.memBlock(t[i].slice(r,o),e)}}this.info("Running stub..."),await this.memFinish(e.entry);const{value:i}=await this.transport.read(this.DEFAULT_TIMEOUT).next(),r=String.fromCharCode(...i);if("OHAI"!==r)throw new ui(`Failed to start stub. Unexpected response ${r}`);return this.info("Stub running..."),this.IS_STUB=!0,this.chip}async changeBaud(){this.info("Changing baudrate to "+this.baudrate);const e=this.IS_STUB?this.romBaudrate:0,t=this._appendArray(this._intToByteArray(this.baudrate),this._intToByteArray(e));await this.command(this.ESP_CHANGE_BAUDRATE,t),this.info("Changed"),await this.transport.disconnect(),await this._sleep(50),await this.transport.connect(this.baudrate,this.serialOptions)}async main(e="default_reset"){await this.detectChip(e);const t=await this.chip.getChipDescription(this);return this.info("Chip is "+t),this.info("Features: "+await this.chip.getChipFeatures(this)),this.info("Crystal is "+await this.chip.getCrystalFreq(this)+"MHz"),this.info("MAC: "+await this.chip.readMac(this)),await this.chip.readMac(this),void 0!==this.chip.postConnect&&await this.chip.postConnect(this),await this.runStub(),this.romBaudrate!==this.baudrate&&await this.changeBaud(),t}parseFlashSizeArg(e){if(void 0===this.chip.FLASH_SIZES[e])throw new ui("Flash size "+e+" is not supported by this chip type. Supported sizes: "+this.chip.FLASH_SIZES);return this.chip.FLASH_SIZES[e]}_updateImageFlashParams(e,t,i,r,o){if(this.debug("_update_image_flash_params "+i+" "+r+" "+o),e.length<8)return e;if(t!=this.chip.BOOTLOADER_FLASH_OFFSET)return e;if("keep"===i&&"keep"===r&&"keep"===o)return this.info("Not changing the image"),e;const a=parseInt(e[0]);let s=parseInt(e[2]);const n=parseInt(e[3]);if(a!==this.ESP_IMAGE_MAGIC)return this.info("Warning: Image file at 0x"+t.toString(16)+" doesn't look like an image file, so not changing any flash settings."),e;if("keep"!==r){s={qio:0,qout:1,dio:2,dout:3}[r]}let l=15&n;if("keep"!==o){l={"40m":0,"26m":1,"20m":2,"80m":15}[o]}let d=240&n;"keep"!==i&&(d=this.parseFlashSizeArg(i));const c=s<<8|l+d;return this.info("Flash params set to "+c.toString(16)),parseInt(e[2])!==s<<8&&(e=e.substring(0,2)+(s<<8).toString()+e.substring(3)),parseInt(e[3])!==l+d&&(e=e.substring(0,3)+(l+d).toString()+e.substring(4)),e}async writeFlash(e){if(this.debug("EspLoader program"),"keep"!==e.flashSize){const t=this.flashSizeBytes(e.flashSize);for(let i=0;i<e.fileArray.length;i++)if(e.fileArray[i].data.length+e.fileArray[i].address>t)throw new ui(`File ${i+1} doesn't fit in the available flash`)}let t,i;!0===this.IS_STUB&&!0===e.eraseAll&&await this.eraseFlash();for(let r=0;r<e.fileArray.length;r++){if(this.debug("Data Length "+e.fileArray[r].data.length),t=e.fileArray[r].data,this.debug("Image Length "+t.length),0===t.length){this.debug("Warning: File is empty");continue}t=this.ui8ToBstr(qa(this.bstrToUi8(t),4)),i=e.fileArray[r].address,t=this._updateImageFlashParams(t,i,e.flashSize,e.flashMode,e.flashFreq);let o=null;e.calculateMD5Hash&&(o=e.calculateMD5Hash(t),this.debug("Image MD5 "+o));const a=t.length;let s;if(e.compress){const e=this.bstrToUi8(t);t=this.ui8ToBstr(Oa(e,{level:9})),s=await this.flashDeflBegin(a,t.length,i)}else s=await this.flashBegin(a,i);let n=0,l=0;const d=t.length;e.reportProgress&&e.reportProgress(r,0,d);let c=new Date;const h=c.getTime();let p=5e3;const u=new za({chunkSize:1});let f=0;for(u.onData=function(e){f+=e.byteLength};t.length>0;){this.debug("Write loop "+i+" "+n+" "+s),this.info("Writing at 0x"+(i+f).toString(16)+"... ("+Math.floor(100*(n+1)/s)+"%)");const o=this.bstrToUi8(t.slice(0,this.FLASH_WRITE_SIZE));if(!e.compress)throw new ui("Yet to handle Non Compressed writes");{const e=f;u.push(o,!1);const t=f-e;let i=3e3;this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)>3e3&&(i=this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)),!1===this.IS_STUB&&(p=i),await this.flashDeflBlock(o,n,p),this.IS_STUB&&(p=i)}l+=o.length,t=t.slice(this.FLASH_WRITE_SIZE,t.length),n++,e.reportProgress&&e.reportProgress(r,l,d)}this.IS_STUB&&await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR,p),c=new Date;const m=c.getTime()-h;if(e.compress&&this.info("Wrote "+a+" bytes ("+l+" compressed) at 0x"+i.toString(16)+" in "+m/1e3+" seconds."),o){const e=await this.flashMd5sum(i,a);if(new String(e).valueOf()!=new String(o).valueOf())throw this.info("File md5: "+o),this.info("Flash md5: "+e),new ui("MD5 of file does not match data in flash!");this.info("Hash of data verified.")}}this.info("Leaving..."),this.IS_STUB&&(await this.flashBegin(0,0),e.compress?await this.flashDeflFinish():await this.flashFinish())}async flashId(){this.debug("flash_id");const e=await this.readFlashId();this.info("Manufacturer: "+(255&e).toString(16));const t=e>>16&255;this.info("Device: "+(e>>8&255).toString(16)+t.toString(16)),this.info("Detected flash size: "+this.DETECTED_FLASH_SIZES[t])}async getFlashSize(){this.debug("flash_id");const e=await this.readFlashId()>>16&255;return this.DETECTED_FLASH_SIZES_NUM[e]}async hardReset(){await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1)}async softReset(){if(this.IS_STUB){if("ESP8266"!=this.chip.CHIP_NAME)throw new ui("Soft resetting is currently only supported on ESP8266");await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}else await this.flashBegin(0,0),await this.flashFinish(!1)}}const Za=async e=>{await e.device.setSignals({dataTerminalReady:!1,requestToSend:!0}),await xe(250),await e.device.setSignals({dataTerminalReady:!1,requestToSend:!1}),await xe(250)},Va=(e,t="")=>{const i=new Blob([e],{type:"text/plain"}),r=URL.createObjectURL(i);((e,t="")=>{const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)})(r,t),setTimeout((()=>URL.revokeObjectURL(r)),0)};console.log("ESP Web Tools 10.1.0 by Open Home Foundation; https://esphome.github.io/esp-web-tools/");class ja extends r{constructor(){super(...arguments),this.logger=console,this._state="DASHBOARD",this._installErase=!1,this._installConfirmed=!1,this._provisionForce=!1,this._wasProvisioned=!1,this._busy=!1,this._selectedSsid=null,this._bodyOverflow=null,this._handleDisconnect=()=>{this._state="ERROR",this._error="Disconnected"}}render(){if(!this.port)return o``;let e,t,i=!1;return void 0===this._client&&"INSTALL"!==this._state&&"LOGS"!==this._state?this._error?[e,t]=this._renderError(this._error):t=this._renderProgress("Connecting"):"INSTALL"===this._state?[e,t,i]=this._renderInstall():"ASK_ERASE"===this._state?[e,t]=this._renderAskErase():"ERROR"===this._state?[e,t]=this._renderError(this._error):"DASHBOARD"===this._state?[e,t,i]=this._client?this._renderDashboard():this._renderDashboardNoImprov():"PROVISION"===this._state?[e,t]=this._renderProvision():"LOGS"===this._state&&([e,t]=this._renderLogs()),o`
|
492 | <ew-dialog
|
493 | open
|
494 | .heading=${e}
|
495 | @cancel=${this._preventDefault}
|
496 | @closed=${this._handleClose}
|
497 | >
|
498 | ${e?o`<div slot="headline">${e}</div>`:""}
|
499 | ${i?o`
|
500 | <ew-icon-button slot="headline" @click=${this._closeDialog}>
|
501 | ${Xt}
|
502 | </ew-icon-button>
|
503 | `:""}
|
504 | ${t}
|
505 | </ew-dialog>
|
506 | `}_renderProgress(e,t){return o`
|
507 | <ewt-page-progress
|
508 | slot="content"
|
509 | .label=${e}
|
510 | .progress=${t}
|
511 | ></ewt-page-progress>
|
512 | `}_renderError(e){return["Error",o`
|
513 | <ewt-page-message
|
514 | slot="content"
|
515 | .icon=${"⚠️"}
|
516 | .label=${e}
|
517 | ></ewt-page-message>
|
518 | <div slot="actions">
|
519 | <ew-text-button @click=${this._closeDialog}>Close</ew-text-button>
|
520 | </div>
|
521 | `]}_renderDashboard(){const e=this._manifest.name;let t;return t=o`
|
522 | <div slot="content">
|
523 | <ew-list>
|
524 | <ew-list-item>
|
525 | <div slot="headline">Connected to ${this._info.name}</div>
|
526 | <div slot="supporting-text">
|
527 | ${this._info.firmware} ${this._info.version}
|
528 | (${this._info.chipFamily})
|
529 | </div>
|
530 | </ew-list-item>
|
531 | ${this._isSameVersion?"":o`
|
532 | <ew-list-item
|
533 | type="button"
|
534 | @click=${()=>{this._isSameFirmware?this._startInstall(!1):this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}}
|
535 | >
|
536 | ${Qt}
|
537 | <div slot="headline">
|
538 | ${this._isSameFirmware?`Update ${this._manifest.name}`:`Install ${this._manifest.name}`}
|
539 | </div>
|
540 | </ew-list-item>
|
541 | `}
|
542 | ${void 0===this._client.nextUrl?"":o`
|
543 | <ew-list-item
|
544 | type="link"
|
545 | href=${this._client.nextUrl}
|
546 | target="_blank"
|
547 | >
|
548 | ${ii}
|
549 | <div slot="headline">Visit Device</div>
|
550 | </ew-list-item>
|
551 | `}
|
552 | ${this._manifest.home_assistant_domain&&this._client.state===li.PROVISIONED?o`
|
553 | <ew-list-item
|
554 | type="link"
|
555 | href=${`https://my.home-assistant.io/redirect/config_flow_start/?domain=${this._manifest.home_assistant_domain}`}
|
556 | target="_blank"
|
557 | >
|
558 | ${ri}
|
559 | <div slot="headline">Add to Home Assistant</div>
|
560 | </ew-list-item>
|
561 | `:""}
|
562 | <ew-list-item
|
563 | type="button"
|
564 | @click=${()=>{this._state="PROVISION",this._client.state===li.PROVISIONED&&(this._provisionForce=!0)}}
|
565 | >
|
566 | ${ei}
|
567 | <div slot="headline">
|
568 | ${this._client.state===li.READY?"Connect to Wi-Fi":"Change Wi-Fi"}
|
569 | </div>
|
570 | </ew-list-item>
|
571 | <ew-list-item
|
572 | type="button"
|
573 | @click=${async()=>{const e=this._client;e&&(await this._closeClientWithoutEvents(e),await xe(100)),this._client=void 0,this._state="LOGS"}}
|
574 | >
|
575 | ${ti}
|
576 | <div slot="headline">Logs & Console</div>
|
577 | </ew-list-item>
|
578 | ${this._isSameFirmware&&this._manifest.funding_url?o`
|
579 | <ew-list-item
|
580 | type="link"
|
581 | href=${this._manifest.funding_url}
|
582 | target="_blank"
|
583 | >
|
584 | ${ai}
|
585 | <div slot="headline">Fund Development</div>
|
586 | </ew-list-item>
|
587 | `:""}
|
588 | ${this._isSameVersion?o`
|
589 | <ew-list-item
|
590 | type="button"
|
591 | class="danger"
|
592 | @click=${()=>this._startInstall(!0)}
|
593 | >
|
594 | ${oi}
|
595 | <div slot="headline">Erase User Data</div>
|
596 | </ew-list-item>
|
597 | `:""}
|
598 | </ew-list>
|
599 | </div>
|
600 | `,[e,t,!0]}_renderDashboardNoImprov(){const e=this._manifest.name;let t;return t=o`
|
601 | <div slot="content">
|
602 | <ew-list>
|
603 | <ew-list-item
|
604 | type="button"
|
605 | @click=${()=>{this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}}
|
606 | >
|
607 | ${Qt}
|
608 | <div slot="headline">${`Install ${this._manifest.name}`}</div>
|
609 | </ew-list-item>
|
610 | <ew-list-item
|
611 | type="button"
|
612 | @click=${async()=>{this._client=void 0,this._state="LOGS"}}
|
613 | >
|
614 | ${ti}
|
615 | <div slot="headline">Logs & Console</div>
|
616 | </ew-list-item>
|
617 | </ew-list>
|
618 | </div>
|
619 | `,[e,t,!0]}_renderProvision(){var e;let t,i="Configure Wi-Fi";if(this._busy)return[i,this._renderProgress(void 0===this._ssids?"Scanning for networks":"Trying to connect")];if(this._provisionForce||this._client.state!==li.PROVISIONED){let i;switch(this._client.error){case 3:i="Unable to connect";break;case 254:i="Timeout";break;case 0:case 2:break;default:i=`Unknown error (${this._client.error})`}const r=null===(e=this._ssids)||void 0===e?void 0:e.find((e=>e.name===this._selectedSsid));t=o`
|
620 | <ew-icon-button slot="headline" @click=${this._updateSsids}>
|
621 | ${Jt}
|
622 | </ew-icon-button>
|
623 | <div slot="content">
|
624 | <div>Connect your device to the network to start using it.</div>
|
625 | ${i?o`<p class="error">${i}</p>`:""}
|
626 | ${null!==this._ssids?o`
|
627 | <ew-filled-select
|
628 | menu-positioning="fixed"
|
629 | label="Network"
|
630 | @change=${e=>{const t=e.target.selectedIndex;this._selectedSsid=t===this._ssids.length?null:this._ssids[t].name}}
|
631 | >
|
632 | ${this._ssids.map((e=>o`
|
633 | <ew-select-option
|
634 | .selected=${r===e}
|
635 | .value=${e.name}
|
636 | >
|
637 | ${e.name}
|
638 | </ew-select-option>
|
639 | `))}
|
640 | <ew-divider></ew-divider>
|
641 | <ew-select-option .selected=${!r}>
|
642 | Join other…
|
643 | </ew-select-option>
|
644 | </ew-filled-select>
|
645 | `:""}
|
646 | ${r?"":o`
|
647 | <ew-filled-text-field
|
648 | label="Network Name"
|
649 | name="ssid"
|
650 | ></ew-filled-text-field>
|
651 | `}
|
652 | ${!r||r.secured?o`
|
653 | <ew-filled-text-field
|
654 | label="Password"
|
655 | name="password"
|
656 | type="password"
|
657 | ></ew-filled-text-field>
|
658 | `:""}
|
659 | </div>
|
660 | <div slot="actions">
|
661 | <ew-text-button
|
662 | @click=${()=>{this._state="DASHBOARD"}}
|
663 | >
|
664 | ${this._installState&&this._installErase?"Skip":"Back"}
|
665 | </ew-text-button>
|
666 | <ew-text-button @click=${this._doProvision}>Connect</ew-text-button>
|
667 | </div>
|
668 | `}else{i=void 0;const e=!this._wasProvisioned&&(void 0!==this._client.nextUrl||"home_assistant_domain"in this._manifest);t=o`
|
669 | <div slot="content">
|
670 | <ewt-page-message
|
671 | .icon=${"🎉"}
|
672 | label="Device connected to the network!"
|
673 | ></ewt-page-message>
|
674 | ${e?o`
|
675 | <ew-list>
|
676 | ${void 0===this._client.nextUrl?"":o`
|
677 | <ew-list-item
|
678 | type="link"
|
679 | href=${this._client.nextUrl}
|
680 | target="_blank"
|
681 | @click=${()=>{this._state="DASHBOARD"}}
|
682 | >
|
683 | ${ii}
|
684 | <div slot="headline">Visit Device</div>
|
685 | </ew-list-item>
|
686 | `}
|
687 | ${this._manifest.home_assistant_domain?o`
|
688 | <ew-list-item
|
689 | type="link"
|
690 | href=${`https://my.home-assistant.io/redirect/config_flow_start/?domain=${this._manifest.home_assistant_domain}`}
|
691 | target="_blank"
|
692 | @click=${()=>{this._state="DASHBOARD"}}
|
693 | >
|
694 | ${ri}
|
695 | <div slot="headline">Add to Home Assistant</div>
|
696 | </ew-list-item>
|
697 | `:""}
|
698 | <ew-list-item
|
699 | type="button"
|
700 | @click=${()=>{this._state="DASHBOARD"}}
|
701 | >
|
702 | <div slot="start" class="fake-icon"></div>
|
703 | <div slot="headline">Skip</div>
|
704 | </ew-list-item>
|
705 | </ew-list>
|
706 | `:""}
|
707 | </div>
|
708 |
|
709 | ${e?"":o`
|
710 | <div slot="actions">
|
711 | <ew-text-button
|
712 | @click=${()=>{this._state="DASHBOARD"}}
|
713 | >
|
714 | Continue
|
715 | </ew-text-button>
|
716 | </div>
|
717 | `}
|
718 | `}return[i,t]}_renderAskErase(){return["Erase device",o`
|
719 | <div slot="content">
|
720 | <div>
|
721 | Do you want to erase the device before installing
|
722 | ${this._manifest.name}? All data on the device will be lost.
|
723 | </div>
|
724 | <label class="formfield">
|
725 | <ew-checkbox touch-target="wrapper" class="danger"></ew-checkbox>
|
726 | Erase device
|
727 | </label>
|
728 | </div>
|
729 | <div slot="actions">
|
730 | <ew-text-button
|
731 | @click=${()=>{this._state="DASHBOARD"}}
|
732 | >
|
733 | Back
|
734 | </ew-text-button>
|
735 | <ew-text-button
|
736 | @click=${()=>{const e=this.shadowRoot.querySelector("ew-checkbox");this._startInstall(e.checked)}}
|
737 | >
|
738 | Next
|
739 | </ew-text-button>
|
740 | </div>
|
741 | `]}_renderInstall(){let e,t;const i=!this._installErase&&this._isSameFirmware;if(!this._installConfirmed&&this._isSameVersion)e="Erase User Data",t=o`
|
742 | <div slot="content">
|
743 | Do you want to reset your device and erase all user data from your
|
744 | device?
|
745 | </div>
|
746 | <div slot="actions">
|
747 | <ew-text-button class="danger" @click=${this._confirmInstall}>
|
748 | Erase User Data
|
749 | </ew-text-button>
|
750 | </div>
|
751 | `;else if(this._installConfirmed)if(this._installState&&"initializing"!==this._installState.state&&"preparing"!==this._installState.state)if("erasing"===this._installState.state)e="Installing",t=this._renderProgress("Erasing");else if("writing"===this._installState.state||"finished"===this._installState.state&&void 0===this._client){let i,r;e="Installing","finished"===this._installState.state?r="Wrapping up":this._installState.details.percentage<4?r="Installing":i=this._installState.details.percentage,t=this._renderProgress(o`
|
752 | ${r?o`${r}<br />`:""}
|
753 | <br />
|
754 | This will take
|
755 | ${"ESP8266"===this._installState.chipFamily?"a minute":"2 minutes"}.<br />
|
756 | Keep this page visible to prevent slow down
|
757 | `,i)}else if("finished"===this._installState.state){e=void 0;const i=null!==this._client;t=o`
|
758 | <ewt-page-message
|
759 | slot="content"
|
760 | .icon=${"🎉"}
|
761 | label="Installation complete!"
|
762 | ></ewt-page-message>
|
763 |
|
764 | <div slot="actions">
|
765 | <ew-text-button
|
766 | @click=${()=>{this._state=i&&this._installErase?"PROVISION":"DASHBOARD"}}
|
767 | >
|
768 | Next
|
769 | </ew-text-button>
|
770 | </div>
|
771 | `}else"error"===this._installState.state&&(e="Installation failed",t=o`
|
772 | <ewt-page-message
|
773 | slot="content"
|
774 | .icon=${"⚠️"}
|
775 | .label=${this._installState.message}
|
776 | ></ewt-page-message>
|
777 | <div slot="actions">
|
778 | <ew-text-button
|
779 | @click=${async()=>{this._initialize(),this._state="DASHBOARD"}}
|
780 | >
|
781 | Back
|
782 | </ew-text-button>
|
783 | </div>
|
784 | `);else e="Installing",t=this._renderProgress("Preparing installation");else{e="Confirm Installation";const r=i?"update to":"install";t=o`
|
785 | <div slot="content">
|
786 | ${i?o`Your device is running
|
787 | ${this._info.firmware} ${this._info.version}.<br /><br />`:""}
|
788 | Do you want to ${r}
|
789 | ${this._manifest.name} ${this._manifest.version}?
|
790 | ${this._installErase?o`<br /><br />All data on the device will be erased.`:""}
|
791 | </div>
|
792 | <div slot="actions">
|
793 | <ew-text-button
|
794 | @click=${()=>{this._state="DASHBOARD"}}
|
795 | >
|
796 | Back
|
797 | </ew-text-button>
|
798 | <ew-text-button @click=${this._confirmInstall}>
|
799 | Install
|
800 | </ew-text-button>
|
801 | </div>
|
802 | `}return[e,t,!1]}_renderLogs(){let e;return e=o`
|
803 | <div slot="content">
|
804 | <ewt-console .port=${this.port} .logger=${this.logger}></ewt-console>
|
805 | </div>
|
806 | <div slot="actions">
|
807 | <ew-text-button
|
808 | @click=${async()=>{await this.shadowRoot.querySelector("ewt-console").reset()}}
|
809 | >
|
810 | Reset Device
|
811 | </ew-text-button>
|
812 | <ew-text-button
|
813 | @click=${()=>{Va(this.shadowRoot.querySelector("ewt-console").logs(),"esp-web-tools-logs.txt"),this.shadowRoot.querySelector("ewt-console").reset()}}
|
814 | >
|
815 | Download Logs
|
816 | </ew-text-button>
|
817 | <ew-text-button
|
818 | @click=${async()=>{await this.shadowRoot.querySelector("ewt-console").disconnect(),this._state="DASHBOARD",this._initialize()}}
|
819 | >
|
820 | Back
|
821 | </ew-text-button>
|
822 | </div>
|
823 | `,["Logs",e]}willUpdate(e){e.has("_state")&&("ERROR"!==this._state&&(this._error=void 0),"PROVISION"===this._state?this._updateSsids():this._provisionForce=!1,"INSTALL"===this._state&&(this._installConfirmed=!1,this._installState=void 0))}async _updateSsids(e=0){const t=this._ssids;let i;this._ssids=void 0,this._busy=!0;try{i=await this._client.scan()}catch(e){return void 0===this._ssids&&(this._ssids=null,this._selectedSsid=null),void(this._busy=!1)}if(0===i.length&&e<3)return console.log("SCHEDULE RETRY",e),void setTimeout((()=>this._updateSsids(e+1)),1e3);t?this._selectedSsid&&!i.find((e=>e.name===this._selectedSsid))&&(this._selectedSsid=i[0].name):this._selectedSsid=i.length?i[0].name:null,this._ssids=i,this._busy=!1}firstUpdated(e){super.firstUpdated(e),this._bodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._initialize()}updated(e){super.updated(e),e.has("_state")&&this.setAttribute("state",this._state),"PROVISION"===this._state&&(e.has("_selectedSsid")&&null===this._selectedSsid?this._focusFormElement("ew-filled-text-field[name=ssid]"):e.has("_ssids")&&this._focusFormElement())}_focusFormElement(e="ew-filled-text-field, ew-filled-select"){const t=this.shadowRoot.querySelector(e);t&&t.updateComplete.then((()=>setTimeout((()=>t.focus()),100)))}async _initialize(e=!1){if(null===this.port.readable||null===this.port.writable)return this._state="ERROR",void(this._error="Serial port is not readable/writable. Close any other application using it and try again.");try{this._manifest=await(async e=>{const t=new URL(e,location.toString()).toString(),i=await fetch(t),r=await i.json();return"new_install_skip_erase"in r&&(console.warn('Manifest option "new_install_skip_erase" is deprecated. Use "new_install_prompt_erase" instead.'),r.new_install_skip_erase&&(r.new_install_prompt_erase=!0)),r})(this.manifestPath)}catch(e){return this._state="ERROR",void(this._error="Failed to download manifest")}if(0===this._manifest.new_install_improv_wait_time)return void(this._client=null);const t=new pi(this.port,this.logger);t.addEventListener("state-changed",(()=>{this.requestUpdate()})),t.addEventListener("error-changed",(()=>this.requestUpdate()));try{const i=e?void 0!==this._manifest.new_install_improv_wait_time?1e3*this._manifest.new_install_improv_wait_time:1e4:1e3;this._info=await t.initialize(i),this._client=t,t.addEventListener("disconnect",this._handleDisconnect)}catch(e){this._info=void 0,e instanceof ci?(this._state="ERROR",this._error="Serial port is not ready. Close any other application using it and try again."):(this._client=null,this.logger.error("Improv initialization failed.",e))}}_startInstall(e){this._state="INSTALL",this._installErase=e,this._installConfirmed=!1}async _confirmInstall(){this._installConfirmed=!0,this._installState=void 0,this._client&&await this._closeClientWithoutEvents(this._client),this._client=void 0,await this.port.close(),(async(e,t,i,r,o)=>{let a,s;const n=t=>e({...t,manifest:r,build:a,chipFamily:s}),l=new Da(t),d=new Wa({transport:l,baudrate:115200,romBaudrate:115200,enableTracing:!1});window.esploader=d,n({state:"initializing",message:"Initializing...",details:{done:!1}});try{await d.main(),await d.flashId()}catch(e){return console.error(e),n({state:"error",message:"Failed to initialize. Try resetting your device or holding the BOOT button while clicking INSTALL.",details:{error:"failed_initialize",details:e}}),await Za(l),void await l.disconnect()}if(s=d.chip.CHIP_NAME,n({state:"initializing",message:`Initialized. Found ${s}`,details:{done:!0}}),a=r.builds.find((e=>e.chipFamily===s)),!a)return n({state:"error",message:`Your ${s} board is not supported.`,details:{error:"not_supported",details:s}}),await Za(l),void await l.disconnect();n({state:"preparing",message:"Preparing installation...",details:{done:!1}});const c=new URL(i,location.toString()).toString(),h=a.parts.map((async e=>{const t=new URL(e.path,c).toString(),i=await fetch(t);if(!i.ok)throw new Error(`Downlading firmware ${e.path} failed: ${i.status}`);const r=new FileReader,o=await i.blob();return new Promise((e=>{r.addEventListener("load",(()=>e(r.result))),r.readAsBinaryString(o)}))})),p=[];let u=0;for(let e=0;e<h.length;e++)try{const t=await h[e];p.push({data:t,address:a.parts[e].offset}),u+=t.length}catch(e){return n({state:"error",message:e.message,details:{error:"failed_firmware_download",details:e.message}}),await Za(l),void await l.disconnect()}n({state:"preparing",message:"Installation prepared",details:{done:!0}}),o&&(n({state:"erasing",message:"Erasing device...",details:{done:!1}}),await d.eraseFlash(),n({state:"erasing",message:"Device erased",details:{done:!0}})),n({state:"writing",message:"Writing progress: 0%",details:{bytesTotal:u,bytesWritten:0,percentage:0}});let f=0;try{await d.writeFlash({fileArray:p,flashSize:"keep",flashMode:"keep",flashFreq:"keep",eraseAll:!1,compress:!0,reportProgress:(e,t,i)=>{const r=t/i*p[e].data.length,o=Math.floor((f+r)/u*100);t!==i?n({state:"writing",message:`Writing progress: ${o}%`,details:{bytesTotal:u,bytesWritten:f+t,percentage:o}}):f+=r}})}catch(e){return n({state:"error",message:e.message,details:{error:"write_failed",details:e}}),await Za(l),void await l.disconnect()}n({state:"writing",message:"Writing complete",details:{bytesTotal:u,bytesWritten:f,percentage:100}}),await xe(100),console.log("HARD RESET"),await Za(l),console.log("DISCONNECT"),await l.disconnect(),n({state:"finished",message:"All done!"})})((e=>{this._installState=e,"finished"===e.state?xe(100).then((()=>this.port.open({baudRate:115200}))).then((()=>this._initialize(!0))).then((()=>this.requestUpdate())):"error"===e.state&&xe(100).then((()=>this.port.open({baudRate:115200})))}),this.port,this.manifestPath,this._manifest,this._installErase)}async _doProvision(){var e;this._busy=!0,this._wasProvisioned=this._client.state===li.PROVISIONED;const t=null===this._selectedSsid?this.shadowRoot.querySelector("ew-filled-text-field[name=ssid]").value:this._selectedSsid,i=(null===(e=this.shadowRoot.querySelector("ew-filled-text-field[name=password]"))||void 0===e?void 0:e.value)||"";try{await this._client.provision(t,i,3e4)}catch(e){return}finally{this._busy=!1,this._provisionForce=!1}}_closeDialog(){this.shadowRoot.querySelector("ew-dialog").close()}async _handleClose(){this._client&&await this._closeClientWithoutEvents(this._client),((e,t,i,r)=>{r=r||{};const o=new CustomEvent(t,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed,detail:i});e.dispatchEvent(o)})(this,"closed"),document.body.style.overflow=this._bodyOverflow,this.parentNode.removeChild(this)}get _isSameFirmware(){var e;return!!this._info&&((null===(e=this.overrides)||void 0===e?void 0:e.checkSameFirmware)?this.overrides.checkSameFirmware(this._manifest,this._info):this._info.firmware===this._manifest.name)}get _isSameVersion(){return this._isSameFirmware&&this._info.version===this._manifest.version}async _closeClientWithoutEvents(e){e.removeEventListener("disconnect",this._handleDisconnect),await e.close()}_preventDefault(e){e.preventDefault()}}ja.styles=[R,a`
|
824 | :host {
|
825 | --mdc-dialog-max-width: 390px;
|
826 | }
|
827 | div[slot="headline"] {
|
828 | padding-right: 48px;
|
829 | }
|
830 | ew-icon-button[slot="headline"] {
|
831 | position: absolute;
|
832 | right: 4px;
|
833 | top: 8px;
|
834 | }
|
835 | ew-icon-button[slot="headline"] svg {
|
836 | padding: 8px;
|
837 | color: var(--text-color);
|
838 | }
|
839 | .dialog-nav svg {
|
840 | color: var(--text-color);
|
841 | }
|
842 | .table-row {
|
843 | display: flex;
|
844 | }
|
845 | .table-row.last {
|
846 | margin-bottom: 16px;
|
847 | }
|
848 | .table-row svg {
|
849 | width: 20px;
|
850 | margin-right: 8px;
|
851 | }
|
852 | ew-filled-text-field,
|
853 | ew-filled-select {
|
854 | display: block;
|
855 | margin-top: 16px;
|
856 | }
|
857 | label.formfield {
|
858 | display: inline-flex;
|
859 | align-items: center;
|
860 | padding-right: 8px;
|
861 | }
|
862 | ew-list {
|
863 | margin: 0 -24px;
|
864 | padding: 0;
|
865 | }
|
866 | ew-list-item svg {
|
867 | height: 24px;
|
868 | }
|
869 | ewt-page-message + ew-list {
|
870 | padding-top: 16px;
|
871 | }
|
872 | .fake-icon {
|
873 | width: 24px;
|
874 | }
|
875 | .error {
|
876 | color: var(--danger-color);
|
877 | }
|
878 | .danger {
|
879 | --mdc-theme-primary: var(--danger-color);
|
880 | --mdc-theme-secondary: var(--danger-color);
|
881 | --md-sys-color-primary: var(--danger-color);
|
882 | --md-sys-color-on-surface: var(--danger-color);
|
883 | }
|
884 | button.link {
|
885 | background: none;
|
886 | color: inherit;
|
887 | border: none;
|
888 | padding: 0;
|
889 | font: inherit;
|
890 | text-align: left;
|
891 | text-decoration: underline;
|
892 | cursor: pointer;
|
893 | }
|
894 | :host([state="LOGS"]) ew-dialog {
|
895 | max-width: 90vw;
|
896 | max-height: 90vh;
|
897 | }
|
898 | ewt-console {
|
899 | width: calc(80vw - 48px);
|
900 | height: calc(90vh - 168px);
|
901 | }
|
902 | `],t([v()],ja.prototype,"_client",void 0),t([v()],ja.prototype,"_state",void 0),t([v()],ja.prototype,"_installErase",void 0),t([v()],ja.prototype,"_installConfirmed",void 0),t([v()],ja.prototype,"_installState",void 0),t([v()],ja.prototype,"_provisionForce",void 0),t([v()],ja.prototype,"_error",void 0),t([v()],ja.prototype,"_busy",void 0),t([v()],ja.prototype,"_ssids",void 0),t([v()],ja.prototype,"_selectedSsid",void 0),customElements.define("ewt-install-dialog",ja);export{ja as EwtInstallDialog};
|