vendor: 4,774 bytes, lines 1-19
1/******/ (() => { // webpackBootstrap 2/******/ "use strict"; 3 4;// ./node_modules/@lit/reactive-element/css-tag.js 5/** 6 * @license 7 * Copyright 2019 Google LLC 8 * SPDX-License-Identifier: BSD-3-Clause 9 */ 10const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n("string"==typeof t?t:t+"",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t; 11//# sourceMappingURL=css-tag.js.map 12 13;// ./node_modules/@lit/reactive-element/reactive-element.js 14 15/** 16 * @license 17 * Copyright 2017 Google LLC 18 * SPDX-License-Identifier: BSD-3-Clause 19 */const{is:reactive_element_i,defineProperty:reactive_element_e,getOwnPropertyDescriptor:h,getOwnPropertyNames:reactive_element_r,getOwnPropertySymbols:reactive_element_o,getPrototypeOf:reactive_element_n}=Object,a=globalThis,reactive_element_c=a.trustedTypes,l=reactive_element_c?reactive_element_c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!reactive_element_i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&reactive_element_e(this.prototype,t,h)}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=reactive_element_n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...reactive_element_r(t),...reactive_element_o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c(s))}else void 0!==s&&i.push(c(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}
vendor: 4,185 bytes, lines 19-28
19removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.0"); 20//# sourceMappingURL=reactive-element.js.map 21 22;// ./node_modules/lit-html/lit-html.js 23/** 24 * @license 25 * Copyright 2017 Google LLC 26 * SPDX-License-Identifier: BSD-3-Clause 27 */ 28const lit_html_t=globalThis,lit_html_i=lit_html_t.trustedTypes,lit_html_s=lit_html_i?lit_html_i.createPolicy("lit-html",{createHTML:t=>t}):void 0,lit_html_e="$lit$",lit_html_h=`lit$${Math.random().toFixed(9).slice(2)}$`,lit_html_o="?"+lit_html_h,lit_html_n=`<${lit_html_o}>`,lit_html_r=document,lit_html_l=()=>lit_html_r.createComment(""),lit_html_c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,lit_html_a=Array.isArray,lit_html_u=t=>lit_html_a(t)||"function"==typeof t?.[Symbol.iterator],lit_html_d="[ \t\n\f\r]",lit_html_f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${lit_html_d}(?:([^\\s"'>=/]+)(${lit_html_d}*=${lit_html_d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),lit_html_p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,lit_html_y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=lit_html_y(1),lit_html_b=lit_html_y(2),w=lit_html_y(3),T=Symbol.for("lit-noC
28hange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=lit_html_r.createTreeWalker(lit_html_r,129);function P(t,i){if(!lit_html_a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==lit_html_s?lit_html_s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=lit_html_f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===lit_html_f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??lit_html_f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:lit_html_p):c===g||c===lit_html_p?c=m:c===v||c===_?c=lit_html_f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===lit_html_f?s+lit_html_n:d>=0?(o.push(a),s.slice(0,d)+lit_html_e+s.slice(d)+lit_html_h+x):s+lit_html_h+(-2===d?i:x)}return[P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(lit_html_e)){const i=v[a++],s=r.getAttribute(t).split(lit_html_h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t)}else t.startsWith(lit_html_h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(lit_html_h),s=t.length-1;if(s>0){r.textContent=lit_html_i?lit_html_i.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],lit_html_l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],lit_html_l())}}}else if(8===r.nodeType)if(r.data===lit_html_o)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=r.data.indexOf(lit_html_h,t+1));)d.push({type:7,index:c}),t+=lit_html_h.length-1}c++}}static createElement(t,i){const s=lit_html_r.createElement("template");return s.innerHTML=t,s}}function lit_html_S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=lit_html_c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=lit_html_S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??lit_html_r).importNode(i,!0);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n]}o!==l?.index&&(h=C.nextNode(),o++)}return C.currentNode=lit_html_r,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=lit_html_S(this,t,i),lit_html_c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):lit_html_u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==E&&lit_html_c(this._$AH)?this._$AA.nextSibling.data=t:this.T(lit_html_r.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}
vendor: 3,917 bytes, lines 28-44
28_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){lit_html_a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(lit_html_l()),this.O(lit_html_l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=lit_html_S(this,t,i,0),o=!lit_html_c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=lit_html_S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!lit_html_c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class H extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===E?void 0:t}}class I extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E)}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=lit_html_S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){lit_html_S(this,t)}}const Z={M:lit_html_e,P:lit_html_h,A:lit_html_o,C:1,L:V,R:M,D:lit_html_u,V:lit_html_S,I:R,H:k,N:I,U:L,B:H,F:z},j=lit_html_t.litHtmlPolyfillSupport;j?.(N,R),(lit_html_t.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(lit_html_l(),t),t,void 0,s??{})}return h._$AI(t),h}; 29//# sourceMappingURL=lit-html.js.map 30 31;// ./node_modules/lit-element/lit-element.js 32 33/** 34 * @license 35 * Copyright 2017 Google LLC 36 * SPDX-License-Identifier: BSD-3-Clause 37 */const lit_element_s=globalThis;class lit_element_i extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T}}lit_element_i._$litElement$=!0,lit_element_i["finalized"]=!0,lit_element_s.litElementHydrateSupport?.({LitElement:lit_element_i});const lit_element_o=lit_element_s.litElementPolyfillSupport;lit_element_o?.({LitElement:lit_element_i});const lit_element_n=(/* unused pure expression or super */ null && ({_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL}));(lit_element_s.litElementVersions??=[]).push("4.2.0"); 38//# sourceMappingURL=lit-element.js.map 39 40;// ./node_modules/lit/index.js 41 42//# sourceMappingURL=index.js.map 43 44;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7DUCI5S4.js
vendor: 5,625 bytes, lines 45-236
45// src/components/spinner/spinner.styles.ts 46 47var spinner_styles_default = i` 48 :host { 49 --track-width: 2px; 50 --track-color: rgb(128 128 128 / 25%); 51 --indicator-color: var(--sl-color-primary-600); 52 --speed: 2s; 53 54 display: inline-flex; 55 width: 1em; 56 height: 1em; 57 flex: none; 58 } 59 60 .spinner { 61 flex: 1 1 auto; 62 height: 100%; 63 width: 100%; 64 } 65 66 .spinner__track, 67 .spinner__indicator { 68 fill: none; 69 stroke-width: var(--track-width); 70 r: calc(0.5em - var(--track-width) / 2); 71 cx: 0.5em; 72 cy: 0.5em; 73 transform-origin: 50% 50%; 74 } 75 76 .spinner__track { 77 stroke: var(--track-color); 78 transform-origin: 0% 0%; 79 } 80 81 .spinner__indicator { 82 stroke: var(--indicator-color); 83 stroke-linecap: round; 84 stroke-dasharray: 150% 75%; 85 animation: spin var(--speed) linear infinite; 86 } 87 88 @keyframes spin { 89 0% { 90 transform: rotate(0deg); 91 stroke-dasharray: 0.05em, 3em; 92 } 93 94 50% { 95 transform: rotate(450deg); 96 stroke-dasharray: 1.375em, 1.375em; 97 } 98 99 100% { 100 transform: rotate(1080deg); 101 stroke-dasharray: 0.05em, 3em; 102 } 103 } 104`; 105 106 107 108;// ./node_modules/@shoelace-style/localize/dist/index.js 109const connectedElements = new Set(); 110const translations = new Map(); 111let fallback; 112let documentDirection = 'ltr'; 113let documentLanguage = 'en'; 114const isClient = typeof MutationObserver !== 'undefined' && 115 typeof document !== 'undefined' && 116 typeof document.documentElement !== 'undefined'; 117if (isClient) { 118 const documentElementObserver = new MutationObserver(update); 119 documentDirection = document.documentElement.dir || 'ltr'; 120 documentLanguage = document.documentElement.lang || navigator.language; 121 documentElementObserver.observe(document.documentElement, { 122 attributes: true, 123 attributeFilter: ['dir', 'lang'] 124 }); 125} 126function registerTranslation(...translation) { 127 translation.map(t => { 128 const code = t.$code.toLowerCase(); 129 if (translations.has(code)) { 130 translations.set(code, Object.assign(Object.assign({}, translations.get(code)), t)); 131 } 132 else { 133 translations.set(code, t); 134 } 135 if (!fallback) { 136 fallback = t; 137 } 138 }); 139 update(); 140} 141function update() { 142 if (isClient) { 143 documentDirection = document.documentElement.dir || 'ltr'; 144 documentLanguage = document.documentElement.lang || navigator.language; 145 } 146 [...connectedElements.keys()].map(el => { 147 if (typeof el.requestUpdate === 'function') { 148 el.requestUpdate(); 149 } 150 }); 151} 152class LocalizeController { 153 constructor(host) { 154 this.host = host; 155 this.host.addController(this); 156 } 157 hostConnected() { 158 connectedElements.add(this.host); 159 } 160 hostDisconnected() { 161 connectedElements.delete(this.host); 162 } 163 dir() { 164 return `${this.host.dir || documentDirection}`.toLowerCase(); 165 } 166 lang() { 167 const lang = `${this.host.lang || documentLanguage}`.toLowerCase().replace(/_/g, '-'); 168 try { 169 new Intl.Locale(lang); 170 return lang; 171 } 172 catch (_a) { 173 return fallback ? fallback.$code.toLowerCase() : 'en'; 174 } 175 } 176 getTranslationData(lang) { 177 var _a, _b; 178 let locale; 179 try { 180 locale = new Intl.Locale(lang.replace(/_/g, '-')); 181 } 182 catch (_c) { 183 return { locale: undefined, language: '', region: '', primary: undefined, secondary: undefined }; 184 } 185 const language = locale.language.toLowerCase(); 186 const region = (_b = (_a = locale.region) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : ''; 187 const primary = translations.get(`${language}-${region}`); 188 const secondary = translations.get(language); 189 return { locale, language, region, primary, secondary }; 190 } 191 exists(key, options) { 192 var _a; 193 const { primary, secondary } = this.getTranslationData((_a = options.lang) !== null && _a !== void 0 ? _a : this.lang()); 194 options = Object.assign({ includeFallback: false }, options); 195 if ((primary && primary[key]) || 196 (secondary && secondary[key]) || 197 (options.includeFallback && fallback && fallback[key])) { 198 return true; 199 } 200 return false; 201 } 202 term(key, ...args) { 203 const { primary, secondary } = this.getTranslationData(this.lang()); 204 let term; 205 if (primary && primary[key]) { 206 term = primary[key]; 207 } 208 else if (secondary && secondary[key]) { 209 term = secondary[key]; 210 } 211 else if (fallback && fallback[key]) { 212 term = fallback[key]; 213 } 214 else { 215 console.error(`No translation found for: ${String(key)}`); 216 return String(key); 217 } 218 if (typeof term === 'function') { 219 return term(...args); 220 } 221 return term; 222 } 223 date(dateToFormat, options) { 224 dateToFormat = new Date(dateToFormat); 225 return new Intl.DateTimeFormat(this.lang(), options).format(dateToFormat); 226 } 227 number(numberToFormat, options) { 228 numberToFormat = Number(numberToFormat); 229 return isNaN(numberToFormat) ? '' : new Intl.NumberFormat(this.lang(), options).format(numberToFormat); 230 } 231 relativeTime(value, unit, options) { 232 return new Intl.RelativeTimeFormat(this.lang(), options).format(value, unit); 233 } 234} 235 236;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7BTDLTNI.js
237// src/translations/en.ts 238 239var translation = { 240 $code: "en", 241 $name: "English", 242 $dir: "ltr", 243 carousel: "Carousel", 244 clearEntry: "Clear entry", 245 close: "Close", 246 copied: "Copied", 247 copy: "Copy", 248 currentValue: "Current value", 249 error: "Error", 250 goToSlide: (slide, count) => `Go to slide ${slide} of ${count}`, 251 hidePassword: "Hide password", 252 loading: "Loading", 253 nextSlide: "Next slide", 254 numOptionsSelected: (num) => { 255 if (num === 0) return "No options selected"; 256 if (num === 1) return "1 option selected"; 257 return `${num} options selected`; 258 }, 259 previousSlide: "Previous slide", 260 progress: "Progress", 261 remove: "Remove", 262 resize: "Resize", 263 scrollToEnd: "Scroll to end", 264 scrollToStart: "Scroll to start", 265 selectAColorFromTheScreen: "Select a color from the screen", 266 showPassword: "Show password", 267 slideNum: (slide) => `Slide ${slide}`, 268 toggleColorFormat: "Toggle color format" 269}; 270registerTranslation(translation); 271var en_default = translation; 272 273 274 275;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6CTB5ZDJ.js 276 277
278// src/utilities/localize.ts 279 280 281var chunk_6CTB5ZDJ_LocalizeController = class extends LocalizeController { 282}; 283registerTranslation(en_default); 284 285 286 287;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TUVJKY7S.js
288// src/styles/component.styles.ts 289 290var component_styles_default = i` 291 :host { 292 box-sizing: border-box; 293 } 294 295 :host *, 296 :host *::before, 297 :host *::after { 298 box-sizing: inherit; 299 } 300 301 [hidden] { 302 display: none !important; 303 } 304`; 305 306 307 308;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.KAW7D32O.js 309var __defProp = Object.defineProperty; 310var __defProps = Object.defineProperties; 311var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 312var __getOwnPropDescs = Object.getOwnPropertyDescriptors; 313var __getOwnPropSymbols = Object.getOwnPropertySymbols; 314var __hasOwnProp = Object.prototype.hasOwnProperty; 315var __propIsEnum = Object.prototype.propertyIsEnumerable; 316var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name); 317var __typeError = (msg) => { 318 throw TypeError(msg); 319}; 320var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 321var __spreadValues = (a, b) => { 322 for (var prop in b || (b = {})) 323 if (__hasOwnProp.call(b, prop)) 324 __defNormalProp(a, prop, b[prop]); 325 if (__getOwnPropSymbols) 326 for (var prop of __getOwnPropSymbols(b)) { 327 if (__propIsEnum.call(b, prop)) 328 __defNormalProp(a, prop, b[prop]); 329 } 330 return a; 331}; 332var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); 333var __decorateClass = (decorators, target, key, kind) => { 334 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; 335 for (var i = decorators.length - 1, decorator; i >= 0; i--) 336 if (decorator = decorators[i]) 337 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 338 if (kind && result) __defProp(target, key, result); 339 return result; 340}; 341var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); 342var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); 343var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); 344var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); 345var __await = function(promise, isYieldStar) { 346 this[0] = promise; 347 this[1] = isYieldStar; 348}; 349var __yieldStar = (value) => { 350 var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {}; 351 if (obj == null) { 352 obj = value[__knownSymbol("iterator")](); 353 method = (k) => it[k] = (x) => obj[k](x); 354 } else { 355 obj = obj.call(value); 356 method = (k) => it[k] = (v) => { 357 if (isAwait) { 358 isAwait = false; 359 if (k === "throw") throw v; 360 return v; 361 } 362 isAwait = true; 363 return { 364 done: false, 365 value: new __await(new Promise((resolve) => { 366 var x = obj[k](v); 367 if (!(x instanceof Object)) __typeError("Object expected"); 368 resolve(x); 369 }), 1) 370 }; 371 }; 372 } 373 return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => { 374 throw x; 375 }, "return" in obj && method("return"), it; 376}; 377 378 379 380;// ./node_modules/@lit/reactive-element/decorators/property.js 381 382/** 383 * @license 384 * Copyright 2017 Google LLC 385 * SPDX-License-Identifier: BSD-3-Clause 386 */const property_o={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f},property_r=(t=property_o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),"accessor"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+n)};function property_n(t){return(e,o)=>"object"==typeof o?property_r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)} 387//# sourceMappingURL=property.js.map 388 389;// ./node_modules/@lit/reactive-element/decorators/state.js 390 391/** 392 * @license 393 * Copyright 2017 Google LLC 394 * SPDX-License-Identifier: BSD-3-Clause 395 */function state_r(r){return property_n({...r,state:!0,attribute:!1})} 396//# sourceMappingURL=state.js.map 397 398;// ./node_modules/@lit/reactive-element/decorators/event-options.js 399/** 400 * @license 401 * Copyright 2017 Google LLC 402 * SPDX-License-Identifier: BSD-3-Clause 403 */ 404function event_options_t(t){return(n,o)=>{const c="function"==typeof n?n:n[o];Object.assign(c,t)}} 405//# sourceMappingURL=event-options.js.map 406 407;// ./node_modules/@lit/reactive-element/decorators/base.js 408/** 409 * @license 410 * Copyright 2017 Google LLC 411 * SPDX-License-Identifier: BSD-3-Clause 412 */ 413const base_e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c); 414//# sourceMappingURL=base.js.map 415 416;// ./node_modules/@lit/reactive-element/decorators/query.js 417 418/** 419 * @license 420 * Copyright 2017 Google LLC 421 * SPDX-License-Identifier: BSD-3-Clause 422 */function query_e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}="object"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return base_e(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return base_e(n,s,{get(){return o(this)}})}} 423//# sourceMappingURL=query.js.map 424 425;// ./node_modules/lit/decorators.js 426 427//# sourceMappingURL=decorators.js.map 428 429;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.4TUIT776.js 430 431
vendor: 2,932 bytes, lines 432-524
432// src/internal/shoelace-element.ts 433 434 435var _hasRecordedInitialProperties; 436var ShoelaceElement = class extends lit_element_i { 437 constructor() { 438 super(); 439 __privateAdd(this, _hasRecordedInitialProperties, false); 440 // Store the constructor value of all `static properties = {}` 441 this.initialReflectedProperties = /* @__PURE__ */ new Map(); 442 Object.entries(this.constructor.dependencies).forEach(([name, component]) => { 443 this.constructor.define(name, component); 444 }); 445 } 446 emit(name, options) { 447 const event = new CustomEvent(name, __spreadValues({ 448 bubbles: true, 449 cancelable: false, 450 composed: true, 451 detail: {} 452 }, options)); 453 this.dispatchEvent(event); 454 return event; 455 } 456 /* eslint-enable */ 457 static define(name, elementConstructor = this, options = {}) { 458 const currentlyRegisteredConstructor = customElements.get(name); 459 if (!currentlyRegisteredConstructor) { 460 try { 461 customElements.define(name, elementConstructor, options); 462 } catch (_err) { 463 customElements.define(name, class extends elementConstructor { 464 }, options); 465 } 466 return; 467 } 468 let newVersion = " (unknown version)"; 469 let existingVersion = newVersion; 470 if ("version" in elementConstructor && elementConstructor.version) { 471 newVersion = " v" + elementConstructor.version; 472 } 473 if ("version" in currentlyRegisteredConstructor && currentlyRegisteredConstructor.version) { 474 existingVersion = " v" + currentlyRegisteredConstructor.version; 475 } 476 if (newVersion && existingVersion && newVersion === existingVersion) { 477 return; 478 } 479 console.warn( 480 `Attempted to register <${name}>${newVersion}, but <${name}>${existingVersion} has already been registered.` 481 ); 482 } 483 attributeChangedCallback(name, oldValue, newValue) { 484 if (!__privateGet(this, _hasRecordedInitialProperties)) { 485 this.constructor.elementProperties.forEach( 486 (obj, prop) => { 487 if (obj.reflect && this[prop] != null) { 488 this.initialReflectedProperties.set(prop, this[prop]); 489 } 490 } 491 ); 492 __privateSet(this, _hasRecordedInitialProperties, true); 493 } 494 super.attributeChangedCallback(name, oldValue, newValue); 495 } 496 willUpdate(changedProperties) { 497 super.willUpdate(changedProperties); 498 this.initialReflectedProperties.forEach((value, prop) => { 499 if (changedProperties.has(prop) && this[prop] == null) { 500 this[prop] = value; 501 } 502 }); 503 } 504}; 505_hasRecordedInitialProperties = new WeakMap(); 506/* eslint-disable */ 507// @ts-expect-error This is auto-injected at build time. 508ShoelaceElement.version = "2.20.1"; 509ShoelaceElement.dependencies = {}; 510__decorateClass([ 511 property_n() 512], ShoelaceElement.prototype, "dir", 2); 513__decorateClass([ 514 property_n() 515], ShoelaceElement.prototype, "lang", 2); 516 517 518 519;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.36O46B5H.js 520 521 522 523 524
525// src/components/spinner/spinner.component.ts 526 527var SlSpinner = class extends ShoelaceElement { 528 constructor() { 529 super(...arguments); 530 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 531 } 532 render() { 533 return x` 534 <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}> 535 <circle class="spinner__track"></circle> 536 <circle class="spinner__indicator"></circle> 537 </svg> 538 `; 539 } 540}; 541SlSpinner.styles = [component_styles_default, spinner_styles_default]; 542 543 544 545;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3RPBFEDE.js
vendor: 5,613 bytes, lines 546-705
546 547 548// src/internal/form.ts 549var formCollections = /* @__PURE__ */ new WeakMap(); 550var reportValidityOverloads = /* @__PURE__ */ new WeakMap(); 551var checkValidityOverloads = /* @__PURE__ */ new WeakMap(); 552var userInteractedControls = /* @__PURE__ */ new WeakSet(); 553var interactions = /* @__PURE__ */ new WeakMap(); 554var FormControlController = class { 555 constructor(host, options) { 556 this.handleFormData = (event) => { 557 const disabled = this.options.disabled(this.host); 558 const name = this.options.name(this.host); 559 const value = this.options.value(this.host); 560 const isButton = this.host.tagName.toLowerCase() === "sl-button"; 561 if (this.host.isConnected && !disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") { 562 if (Array.isArray(value)) { 563 value.forEach((val) => { 564 event.formData.append(name, val.toString()); 565 }); 566 } else { 567 event.formData.append(name, value.toString()); 568 } 569 } 570 }; 571 this.handleFormSubmit = (event) => { 572 var _a; 573 const disabled = this.options.disabled(this.host); 574 const reportValidity = this.options.reportValidity; 575 if (this.form && !this.form.noValidate) { 576 (_a = formCollections.get(this.form)) == null ? void 0 : _a.forEach((control) => { 577 this.setUserInteracted(control, true); 578 }); 579 } 580 if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) { 581 event.preventDefault(); 582 event.stopImmediatePropagation(); 583 } 584 }; 585 this.handleFormReset = () => { 586 this.options.setValue(this.host, this.options.defaultValue(this.host)); 587 this.setUserInteracted(this.host, false); 588 interactions.set(this.host, []); 589 }; 590 this.handleInteraction = (event) => { 591 const emittedEvents = interactions.get(this.host); 592 if (!emittedEvents.includes(event.type)) { 593 emittedEvents.push(event.type); 594 } 595 if (emittedEvents.length === this.options.assumeInteractionOn.length) { 596 this.setUserInteracted(this.host, true); 597 } 598 }; 599 this.checkFormValidity = () => { 600 if (this.form && !this.form.noValidate) { 601 const elements = this.form.querySelectorAll("*"); 602 for (const element of elements) { 603 if (typeof element.checkValidity === "function") { 604 if (!element.checkValidity()) { 605 return false; 606 } 607 } 608 } 609 } 610 return true; 611 }; 612 this.reportFormValidity = () => { 613 if (this.form && !this.form.noValidate) { 614 const elements = this.form.querySelectorAll("*"); 615 for (const element of elements) { 616 if (typeof element.reportValidity === "function") { 617 if (!element.reportValidity()) { 618 return false; 619 } 620 } 621 } 622 } 623 return true; 624 }; 625 (this.host = host).addController(this); 626 this.options = __spreadValues({ 627 form: (input) => { 628 const formId = input.form; 629 if (formId) { 630 const root = input.getRootNode(); 631 const form = root.querySelector(`#${formId}`); 632 if (form) { 633 return form; 634 } 635 } 636 return input.closest("form"); 637 }, 638 name: (input) => input.name, 639 value: (input) => input.value, 640 defaultValue: (input) => input.defaultValue, 641 disabled: (input) => { 642 var _a; 643 return (_a = input.disabled) != null ? _a : false; 644 }, 645 reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true, 646 checkValidity: (input) => typeof input.checkValidity === "function" ? input.checkValidity() : true, 647 setValue: (input, value) => input.value = value, 648 assumeInteractionOn: ["sl-input"] 649 }, options); 650 } 651 hostConnected() { 652 const form = this.options.form(this.host); 653 if (form) { 654 this.attachForm(form); 655 } 656 interactions.set(this.host, []); 657 this.options.assumeInteractionOn.forEach((event) => { 658 this.host.addEventListener(event, this.handleInteraction); 659 }); 660 } 661 hostDisconnected() { 662 this.detachForm(); 663 interactions.delete(this.host); 664 this.options.assumeInteractionOn.forEach((event) => { 665 this.host.removeEventListener(event, this.handleInteraction); 666 }); 667 } 668 hostUpdated() { 669 const form = this.options.form(this.host); 670 if (!form) { 671 this.detachForm(); 672 } 673 if (form && this.form !== form) { 674 this.detachForm(); 675 this.attachForm(form); 676 } 677 if (this.host.hasUpdated) { 678 this.setValidity(this.host.validity.valid); 679 } 680 } 681 attachForm(form) { 682 if (form) { 683 this.form = form; 684 if (formCollections.has(this.form)) { 685 formCollections.get(this.form).add(this.host); 686 } else { 687 formCollections.set(this.form, /* @__PURE__ */ new Set([this.host])); 688 } 689 this.form.addEventListener("formdata", this.handleFormData); 690 this.form.addEventListener("submit", this.handleFormSubmit); 691 this.form.addEventListener("reset", this.handleFormReset); 692 if (!reportValidityOverloads.has(this.form)) { 693 reportValidityOverloads.set(this.form, this.form.reportValidity); 694 this.form.reportValidity = () => this.reportFormValidity(); 695 } 696 if (!checkValidityOverloads.has(this.form)) { 697 checkValidityOverloads.set(this.form, this.form.checkValidity); 698 this.form.checkValidity = () => this.checkFormValidity(); 699 } 700 } else { 701 this.form = void 0; 702 } 703 } 704 detachForm() { 705 if (!this.form)
vendor: 3,066 bytes, lines 705-787
705 return; 706 const formCollection = formCollections.get(this.form); 707 if (!formCollection) { 708 return; 709 } 710 formCollection.delete(this.host); 711 if (formCollection.size <= 0) { 712 this.form.removeEventListener("formdata", this.handleFormData); 713 this.form.removeEventListener("submit", this.handleFormSubmit); 714 this.form.removeEventListener("reset", this.handleFormReset); 715 if (reportValidityOverloads.has(this.form)) { 716 this.form.reportValidity = reportValidityOverloads.get(this.form); 717 reportValidityOverloads.delete(this.form); 718 } 719 if (checkValidityOverloads.has(this.form)) { 720 this.form.checkValidity = checkValidityOverloads.get(this.form); 721 checkValidityOverloads.delete(this.form); 722 } 723 this.form = void 0; 724 } 725 } 726 setUserInteracted(el, hasInteracted) { 727 if (hasInteracted) { 728 userInteractedControls.add(el); 729 } else { 730 userInteractedControls.delete(el); 731 } 732 el.requestUpdate(); 733 } 734 doAction(type, submitter) { 735 if (this.form) { 736 const button = document.createElement("button"); 737 button.type = type; 738 button.style.position = "absolute"; 739 button.style.width = "0"; 740 button.style.height = "0"; 741 button.style.clipPath = "inset(50%)"; 742 button.style.overflow = "hidden"; 743 button.style.whiteSpace = "nowrap"; 744 if (submitter) { 745 button.name = submitter.name; 746 button.value = submitter.value; 747 ["formaction", "formenctype", "formmethod", "formnovalidate", "formtarget"].forEach((attr) => { 748 if (submitter.hasAttribute(attr)) { 749 button.setAttribute(attr, submitter.getAttribute(attr)); 750 } 751 }); 752 } 753 this.form.append(button); 754 button.click(); 755 button.remove(); 756 } 757 } 758 /** Returns the associated `<form>` element, if one exists. */ 759 getForm() { 760 var _a; 761 return (_a = this.form) != null ? _a : null; 762 } 763 /** Resets the form, restoring all the control to their default value */ 764 reset(submitter) { 765 this.doAction("reset", submitter); 766 } 767 /** Submits the form, triggering validation and form data injection. */ 768 submit(submitter) { 769 this.doAction("submit", submitter); 770 } 771 /** 772 * Synchronously sets the form control's validity. Call this when you know the future validity but need to update 773 * the host element immediately, i.e. before Lit updates the component in the next update. 774 */ 775 setValidity(isValid) { 776 const host = this.host; 777 const hasInteracted = Boolean(userInteractedControls.has(host)); 778 const required = Boolean(host.required); 779 host.toggleAttribute("data-required", required); 780 host.toggleAttribute("data-optional", !required); 781 host.toggleAttribute("data-invalid", !isValid); 782 host.toggleAttribute("data-valid", isValid); 783 host.toggleAttribute("data-user-invalid", !isValid && hasInteracted); 784 host.toggleAttribute("data-user-valid", isValid && hasInteracted); 785 } 786 /** 787 * Updates the form control's validity based on the current value of `host.validity.valid`. C
787all this when anything 788 * that affects constraint validation changes so the component receives the correct validity states. 789 */ 790 updateValidity() { 791 const host = this.host; 792 this.setValidity(host.validity.valid); 793 } 794 /** 795 * Dispatches a non-bubbling, cancelable custom event of type `sl-invalid`. 796 * If the `sl-invalid` event will be cancelled then the original `invalid` 797 * event (which may have been passed as argument) will also be cancelled. 798 * If no original `invalid` event has been passed then the `sl-invalid` 799 * event will be cancelled before being dispatched. 800 */ 801 emitInvalidEvent(originalInvalidEvent) { 802 const slInvalidEvent = new CustomEvent("sl-invalid", { 803 bubbles: false, 804 composed: false, 805 cancelable: true, 806 detail: {} 807 }); 808 if (!originalInvalidEvent) { 809 slInvalidEvent.preventDefault(); 810 } 811 if (!this.host.dispatchEvent(slInvalidEvent)) { 812 originalInvalidEvent == null ? void 0 : originalInvalidEvent.preventDefault(); 813 } 814 } 815}; 816var validValidityState = Object.freeze({ 817 badInput: false, 818 customError: false, 819 patternMismatch: false, 820 rangeOverflow: false, 821 rangeUnderflow: false, 822 stepMismatch: false, 823 tooLong: false, 824 tooShort: false, 825 typeMismatch: false, 826 valid: true, 827 valueMissing: false 828}); 829var valueMissingValidityState = Object.freeze(__spreadProps(__spreadValues({}, validValidityState), { 830 valid: false, 831 valueMissing: true 832})); 833var customErrorValidityState = Object.freeze(__spreadProps(__spreadValues({}, validValidityState), { 834 valid: false, 835 customError: true 836})); 837 838 839 840;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MAQXLKQ7.js
841// src/components/button/button.styles.ts 842 843var button_styles_default = i` 844 :host { 845 display: inline-block; 846 position: relative; 847 width: auto; 848 cursor: pointer; 849 } 850 851 .button { 852 display: inline-flex; 853 align-items: stretch; 854 justify-content: center; 855 width: 100%; 856 border-style: solid; 857 border-width: var(--sl-input-border-width); 858 font-family: var(--sl-input-font-family); 859 font-weight: var(--sl-font-weight-semibold); 860 text-decoration: none; 861 user-select: none; 862 -webkit-user-select: none; 863 white-space: nowrap; 864 vertical-align: middle; 865 padding: 0; 866 transition: 867 var(--sl-transition-x-fast) background-color, 868 var(--sl-transition-x-fast) color, 869 var(--sl-transition-x-fast) border, 870 var(--sl-transition-x-fast) box-shadow; 871 cursor: inherit; 872 } 873 874 .button::-moz-focus-inner { 875 border: 0; 876 } 877 878 .button:focus { 879 outline: none; 880 } 881 882 .button:focus-visible { 883 outline: var(--sl-focus-ring); 884 outline-offset: var(--sl-focus-ring-offset); 885 } 886 887 .button--disabled { 888 opacity: 0.5; 889 cursor: not-allowed; 890 } 891 892 /* When disabled, prevent mouse events from bubbling up from children */ 893 .button--disabled * { 894 pointer-events: none; 895 } 896 897 .button__prefix, 898 .button__suffix { 899 flex: 0 0 auto; 900 display: flex; 901 align-items: center; 902 pointer-events: none; 903 } 904 905 .button__label { 906 display: inline-block; 907 } 908 909 .button__label::slotted(sl-icon) { 910 vertical-align: -2px; 911 } 912 913 /* 914 * Standard buttons 915 */ 916 917 /* Default */ 918 .button--standard.button--default { 919 background-color: var(--sl-color-neutral-0); 920 border-color: var(--sl-input-border-color); 921 color: var(--sl-color-neutral-700); 922 } 923 924 .button--standard.button--default:hover:not(.button--disabled) { 925 background-color: var(--sl-color-primary-50); 926 border-color: var(--sl-color-primary-300); 927 color: var(--sl-color-primary-700); 928 } 929 930 .button--standard.button--default:active:not(.button--disabled) { 931 background-color: var(--sl-color-primary-100); 932 border-color: var(--sl-color-primary-400); 933 color: var(--sl-color-primary-700); 934 } 935 936 /* Primary */ 937 .button--standard.button--primary { 938 background-color: var(--sl-color-primary-600); 939 border-color: var(--sl-color-primary-600); 940 color: var(--sl-color-neutral-0); 941 } 942 943 .button--standard.button--primary:hover:not(.button--disabled) { 944 background-color: var(--sl-color-primary-500); 945 border-color: var(--sl-color-primary-500); 946 color: var(--sl-color-neutral-0); 947 } 948 949 .button--standard.button--primary:active:not(.button--disabled) { 950 background-color: var(--sl-color-primary-600); 951 border-color: var(--sl-color-primary-600); 952 color: var(--sl-color-neutral-0); 953 } 954 955 /* Success */ 956 .button--standard.button--success { 957 background-color: var(--sl-color-success-600); 958 border-color: var(--sl-color-success-600); 959 color: var(--sl-color-neutral-0); 960 } 961 962 .button--standard.button--success:hover:not(.button--disabled) { 963 background-color: var(--sl-color-success-500); 964 border-color: var(--sl-color-success-500); 965 color: var(--sl-color-neutral-0); 966 } 967 968 .button--standard.button--success:active:not(.button--disabled) { 969 background-color: var(--sl-color-success-600); 970 border-color: var(--sl-color-success-600); 971 color: var(--sl-color-neutral-0); 972 } 973 974 /* Neutral */ 975 .button--standard.button--neutral { 976 background-color: var(--sl-color-neutral-600); 977 border-color: var(--sl-color-neutral-600); 978 color: var(--sl-color-neutral-0); 979 } 980 981 .button--standard.button--neutral:hover:not(.button--disabled) { 982 background-color: var(--sl-color-neutral-500); 983 border-color: var(--sl-color-neutral-500); 984 color: var(--sl-color-neutral-0); 985 } 986 987 .button--standard.button--neutral:active:not(.button--disabled) { 988 background-color: var(--sl-color-neutral-600); 989 border-color: var(--sl-color-neutral-600); 990 color: var(--sl-color-neutral-0); 991 } 992 993 /* Warning */ 994 .button--standard.button--warning { 995 background-color: var(--sl-color-warning-600); 996 border-color: var(--sl-color-warning-600); 997 color: var(--sl-color-neutral-0); 998 } 999 .button--standard.button--warning:hover:not(.button--disabled) { 1000 background-color: var(--sl-color-warning-500); 1001 border-color: var(--sl-color-warning-500); 1002 color: var(--sl-color-neutral-0); 1003 } 1004 1005 .button--standard.button--warning:active:not(.button--disabled) { 1006 background-color: var(--sl-color-warning-600); 1007 border-color: var(--sl-color-warning-600); 1008 color: var(--sl-color-neutral-0); 1009 } 1010 1011 /* Danger */ 1012 .button--standard.button--danger { 1013 background-color: var(--sl-color-danger-600); 1014 border-color: var(--sl-color-danger-600); 1015 color: var(--sl-color-neutral-0); 1016 } 1017 1018 .button--standard.button--danger:hover:not(.button--disabled) { 1019 background-color: var(--sl-color-danger-500); 1020 border-color: var(--sl-color-danger-500); 1021 color: var(--sl-color-neutral-0); 1022 } 1023 1024 .button--standard.button--danger:active:not(.button--disabled) { 1025 background-color: var(--sl-color-danger-600); 1026 border-color: var(--sl-color-danger-600); 1027 color: var(--sl-color-neutral-0); 1028 } 1029 1030 /* 1031 * Outline buttons 1032 */ 1033 1034 .button--outline { 1035 background: none; 1036 border: solid 1px; 1037 } 1038 1039 /* Default */ 1040 .button--outline.button--default { 1041 border-color: var(--sl-input-border-color); 1042 color: var(--sl-color-neutral-700); 1043 } 1044 1045 .button--outline.button--default:hover:not(.button--disabled), 1046 .button--outline.button--default.button--checked:not(.button--disabled) { 1047 border-color: var(--sl-color-primary-600); 1048 background-color: var(--sl-color-primary-600); 1049 color: var(--sl-color-neutral-0); 1050 } 1051 1052 .button--outline.button--default:active:not(.button--disabled) { 1053 border-color: var(--sl-color-primary-700); 1054 background-color: var(--sl-color-primary-700); 1055 color: var(--sl-color-neutral-0); 1056 } 1057 1058 /* Primary */ 1059 .button--outline.button--primary { 1060 border-color: var(--sl-color-primary-600); 1061 color: var(--sl-color-primary-600); 1062 } 1063 1064 .button--outline.button--primary:hover:not(.button--disabled), 1065 .button--outline.button--primary.button--checked:not(.button--disabled) { 1066 background-color: var(--sl-color-primary-600); 1067 color: var(--sl-color-neutral-0); 1068 } 1069 1070 .button--outline.button--primary:active:not(.button--disabled) { 1071 border-color: var(--sl-color-primary-700); 1072 background-color: var(--sl-color-primary-700); 1073 color: var(--sl-color-neutral-0); 1074 } 1075 1076 /* Success */ 1077 .button--outline.button--success { 1078 border-color: var(--sl-color-success-600); 1079 color: var(--sl-color-success-600); 1080 } 1081 1082 .button--outline.button--success:hover:not(.button--disabled), 1083 .button--outline.button--success.button--checked:not(.button--disabled) { 1084 background-color: var(--sl-color-success-600); 1085 color: var(--sl-color-neutral-0); 1086 } 1087 1088 .button--outline.button--success:active:not(.button--disabled) { 1089 border-color: var(--sl-color-success-700); 1090 background-color: var(--sl-color-success-700); 1091 color: var(--sl-color-neutral-0); 1092 } 1093 1094 /* Neutral */ 1095 .button--outline.button--neutral { 1096 border-color: var(--sl-color-neutral-600); 1097 color: var(--sl-color-neutral-600); 1098 } 1099 1100 .button--outline.button--neutral:hover:not(.button--disabled), 1101 .button--outline.button--neutral.button--checked:not(.button--disabled) { 1102 background-color: var(--sl-color-neutral-600); 1103 color: var(--sl-color-neutral-0); 1104 } 1105 1106 .button--outline.button--neutral:active:not(.button--disabled) { 1107 border-color: var(--sl-color-neutral-700); 1108 background-color: var(--sl-color-neutral-700); 1109 color: var(--sl-color-neutral-0); 1110 } 1111 1112 /* Warning */ 1113 .button--outline.button--warning { 1114 border-color: var(--sl-color-warning-600); 1115 color: var(--sl-color-warning-600); 1116 } 1117 1118 .button--outline.button--warning:hover:not(.button--disabled), 1119 .button--outline.button--warning.button--checked:not(.button--disabled) { 1120 background-color: var(--sl-color-warning-600); 1121 color: var(--sl-color-neutral-0); 1122 } 1123 1124 .button--outline.button--warning:active:not(.button--disabled) { 1125 border-color: var(--sl-color-warning-700); 1126 background-color: var(--sl-color-warning-700); 1127 color: var(--sl-color-neutral-0); 1128 } 1129 1130 /* Danger */ 1131 .button--outline.button--danger { 1132 border-color: var(--sl-color-danger-600); 1133 color: var(--sl-color-danger-600); 1134 } 1135 1136 .button--outline.button--danger:hover:not(.button--disabled), 1137 .button--outline.button--danger.button--checked:not(.button--disabled) { 1138 background-color: var(--sl-color-danger-600); 1139 color: var(--sl-color-neutral-0); 1140 } 1141 1142 .button--outline.button--danger:active:not(.button--disabled) { 1143 border-color: var(--sl-color-danger-700); 1144 background-color: var(--sl-color-danger-700); 1145 color: var(--sl-color-neutral-0); 1146 } 1147 1148 @media (forced-colors: active) { 1149 .button.button--outline.button--checked:not(.button--disabled) { 1150 outline: solid 2px transparent; 1151 } 1152 } 1153 1154 /* 1155 * Text buttons 1156 */ 1157 1158 .button--text { 1159 background-color: transparent; 1160 border-color: transparent; 1161 color: var(--sl-color-primary-600); 1162 } 1163 1164 .button--text:hover:not(.button--disabled) { 1165 background-color: transparent; 1166 border-color: transparent; 1167 color: var(--sl-color-primary-500); 1168 } 1169 1170 .button--text:focus-visible:not(.button--disabled) { 1171 background-color: transparent; 1172 border-color: transparent; 1173 color: var(--sl-color-primary-500); 1174 } 1175 1176 .button--text:active:not(.button--disabled) { 1177 background-color: transparent; 1178 border-color: transparent; 1179 color: var(--sl-color-primary-700); 1180 } 1181 1182 /* 1183 * Size modifiers 1184 */ 1185 1186 .button--small { 1187 height: auto; 1188 min-height: var(--sl-input-height-small); 1189 font-size: var(--sl-button-font-size-small); 1190 line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2); 1191 border-radius: var(--sl-input-border-radius-small); 1192 } 1193 1194 .button--medium { 1195 height: auto; 1196 min-height: var(--sl-input-height-medium); 1197 font-size: var(--sl-button-font-size-medium); 1198 line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2); 1199 border-radius: var(--sl-input-border-radius-medium); 1200 } 1201 1202 .button--large { 1203 height: auto; 1204 min-height: var(--sl-input-height-large); 1205 font-size: var(--sl-button-font-size-large); 1206 line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2); 1207 border-radius: var(--sl-input-border-radius-large); 1208 } 1209 1210 /* 1211 * Pill modifier 1212 */ 1213 1214 .button--pill.button--small { 1215 border-radius: var(--sl-input-height-small); 1216 } 1217 1218 .button--pill.button--medium { 1219 border-radius: var(--sl-input-height-medium); 1220 } 1221 1222 .button--pill.button--large { 1223 border-radius: var(--sl-input-height-large); 1224 } 1225 1226 /* 1227 * Circle modifier 1228 */ 1229 1230 .button--circle { 1231 padding-left: 0; 1232 padding-right: 0; 1233 } 1234 1235 .button--circle.button--small { 1236 width: var(--sl-input-height-small); 1237 border-radius: 50%; 1238 } 1239 1240 .button--circle.button--medium { 1241 width: var(--sl-input-height-medium); 1242 border-radius: 50%; 1243 } 1244 1245 .button--circle.button--large { 1246 width: var(--sl-input-height-large); 1247 border-radius: 50%; 1248 } 1249 1250 .button--circle .button__prefix, 1251 .button--circle .button__suffix, 1252 .button--circle .button__caret { 1253 display: none; 1254 } 1255 1256 /* 1257 * Caret modifier 1258 */ 1259 1260 .button--caret .button__suffix { 1261 display: none; 1262 } 1263 1264 .button--caret .button__caret { 1265 height: auto; 1266 } 1267 1268 /* 1269 * Loading modifier 1270 */ 1271 1272 .button--loading { 1273 position: relative; 1274 cursor: wait; 1275 } 1276 1277 .button--loading .button__prefix, 1278 .button--loading .button__label, 1279 .button--loading .button__suffix, 1280 .button--loading .button__caret { 1281 visibility: hidden; 1282 } 1283 1284 .button--loading sl-spinner { 1285 --indicator-color: currentColor; 1286 position: absolute; 1287 font-size: 1em; 1288 height: 1em; 1289 width: 1em; 1290 top: calc(50% - 0.5em); 1291 left: calc(50% - 0.5em); 1292 } 1293 1294 /* 1295 * Badges 1296 */ 1297 1298 .button ::slotted(sl-badge) { 1299 position: absolute; 1300 top: 0; 1301 right: 0; 1302 translate: 50% -50%; 1303 pointer-events: none; 1304 } 1305 1306 .button--rtl ::slotted(sl-badge) { 1307 right: auto; 1308 left: 0; 1309 translate: -50% -50%; 1310 } 1311 1312 /* 1313 * Button spacing 1314 */ 1315 1316 .button--has-label.button--small .button__label { 1317 padding: 0 var(--sl-spacing-small); 1318 } 1319 1320 .button--has-label.button--medium .button__label { 1321 padding: 0 var(--sl-spacing-medium); 1322 } 1323 1324 .button--has-label.button--large .button__label { 1325 padding: 0 var(--sl-spacing-large); 1326 } 1327 1328 .button--has-prefix.button--small { 1329 padding-inline-start: var(--sl-spacing-x-small); 1330 } 1331 1332 .button--has-prefix.button--small .button__label { 1333 padding-inline-start: var(--sl-spacing-x-small); 1334 } 1335 1336 .button--has-prefix.button--medium { 1337 padding-inline-start: var(--sl-spacing-small); 1338 } 1339 1340 .button--has-prefix.button--medium .button__label { 1341 padding-inline-start: var(--sl-spacing-small); 1342 } 1343 1344 .button--has-prefix.button--large { 1345 padding-inline-start: var(--sl-spacing-small); 1346 } 1347 1348 .button--has-prefix.button--large .button__label { 1349 padding-inline-start: var(--sl-spacing-small); 1350 } 1351 1352 .button--has-suffix.button--small, 1353 .button--caret.button--small { 1354 padding-inline-end: var(--sl-spacing-x-small); 1355 } 1356 1357 .button--has-suffix.button--small .button__label, 1358 .button--caret.button--small .button__label { 1359 padding-inline-end: var(--sl-spacing-x-small); 1360 } 1361 1362 .button--has-suffix.button--medium, 1363 .button--caret.button--medium { 1364 padding-inline-end: var(--sl-spacing-small); 1365 } 1366 1367 .button--has-suffix.button--medium .button__label, 1368 .button--caret.button--medium .button__label { 1369 padding-inline-end: var(--sl-spacing-small); 1370 } 1371 1372 .button--has-suffix.button--large, 1373 .button--caret.button--large { 1374 padding-inline-end: var(--sl-spacing-small); 1375 } 1376 1377 .button--has-suffix.button--large .button__label, 1378 .button--caret.button--large .button__label { 1379 padding-inline-end: var(--sl-spacing-small); 1380 } 1381 1382 /*
1383 * Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.). 1384 * This means buttons aren't always direct descendants of the button group, thus we can't target them with the 1385 * ::slotted selector. To work around this, the button group component does some magic to add these special classes to 1386 * buttons and we style them here instead. 1387 */ 1388 1389 :host([data-sl-button-group__button--first]:not([data-sl-button-group__button--last])) .button { 1390 border-start-end-radius: 0; 1391 border-end-end-radius: 0; 1392 } 1393 1394 :host([data-sl-button-group__button--inner]) .button { 1395 border-radius: 0; 1396 } 1397 1398 :host([data-sl-button-group__button--last]:not([data-sl-button-group__button--first])) .button { 1399 border-start-start-radius: 0; 1400 border-end-start-radius: 0; 1401 } 1402 1403 /* All except the first */ 1404 :host([data-sl-button-group__button]:not([data-sl-button-group__button--first])) { 1405 margin-inline-start: calc(-1 * var(--sl-input-border-width)); 1406 } 1407 1408 /* Add a visual separator between solid buttons */ 1409 :host( 1410 [data-sl-button-group__button]:not( 1411 [data-sl-button-group__button--first], 1412 [data-sl-button-group__button--radio], 1413 [variant='default'] 1414 ):not(:hover) 1415 ) 1416 .button:after { 1417 content: ''; 1418 position: absolute; 1419 top: 0; 1420 inset-inline-start: 0; 1421 bottom: 0; 1422 border-left: solid 1px rgb(128 128 128 / 33%); 1423 mix-blend-mode: multiply; 1424 } 1425 1426 /* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */ 1427 :host([data-sl-button-group__button--hover]) { 1428 z-index: 1; 1429 } 1430 1431 /* Focus and checked are always on top */ 1432 :host([data-sl-button-group__button--focus]), 1433 :host([data-sl-button-group__button][checked]) { 1434 z-index: 2; 1435 } 1436`; 1437 1438 1439 1440;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NYIIDP5N.js
vendor: 1,724 bytes, lines 1441-1501
1441// src/internal/slot.ts 1442var HasSlotController = class { 1443 constructor(host, ...slotNames) { 1444 this.slotNames = []; 1445 this.handleSlotChange = (event) => { 1446 const slot = event.target; 1447 if (this.slotNames.includes("[default]") && !slot.name || slot.name && this.slotNames.includes(slot.name)) { 1448 this.host.requestUpdate(); 1449 } 1450 }; 1451 (this.host = host).addController(this); 1452 this.slotNames = slotNames; 1453 } 1454 hasDefaultSlot() { 1455 return [...this.host.childNodes].some((node) => { 1456 if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "") { 1457 return true; 1458 } 1459 if (node.nodeType === node.ELEMENT_NODE) { 1460 const el = node; 1461 const tagName = el.tagName.toLowerCase(); 1462 if (tagName === "sl-visually-hidden") { 1463 return false; 1464 } 1465 if (!el.hasAttribute("slot")) { 1466 return true; 1467 } 1468 } 1469 return false; 1470 }); 1471 } 1472 hasNamedSlot(name) { 1473 return this.host.querySelector(`:scope > [slot="${name}"]`) !== null; 1474 } 1475 test(slotName) { 1476 return slotName === "[default]" ? this.hasDefaultSlot() : this.hasNamedSlot(slotName); 1477 } 1478 hostConnected() { 1479 this.host.shadowRoot.addEventListener("slotchange", this.handleSlotChange); 1480 } 1481 hostDisconnected() { 1482 this.host.shadowRoot.removeEventListener("slotchange", this.handleSlotChange); 1483 } 1484}; 1485function getTextContent(slot) { 1486 if (!slot) { 1487 return ""; 1488 } 1489 const nodes = slot.assignedNodes({ flatten: true }); 1490 let text = ""; 1491 [...nodes].forEach((node) => { 1492 if (node.nodeType === Node.TEXT_NODE) { 1493 text += node.textContent; 1494 } 1495 }); 1496 return text; 1497} 1498 1499 1500 1501;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3Y6SB6QS.js
vendor: 931 bytes, lines 1502-1531
1502// src/utilities/base-path.ts 1503var basePath = ""; 1504function setBasePath(path) { 1505 basePath = path; 1506} 1507function getBasePath(subpath = "") { 1508 if (!basePath) { 1509 const scripts = [...document.getElementsByTagName("script")]; 1510 const configScript = scripts.find((script) => script.hasAttribute("data-shoelace")); 1511 if (configScript) { 1512 setBasePath(configScript.getAttribute("data-shoelace")); 1513 } else { 1514 const fallbackScript = scripts.find((s) => { 1515 return /shoelace(\.min)?\.js($|\?)/.test(s.src) || /shoelace-autoloader(\.min)?\.js($|\?)/.test(s.src); 1516 }); 1517 let path = ""; 1518 if (fallbackScript) { 1519 path = fallbackScript.getAttribute("src"); 1520 } 1521 setBasePath(path.split("/").slice(0, -1).join("/")); 1522 } 1523 } 1524 return basePath.replace(/\/$/, "") + (subpath ? `/${subpath.replace(/^\//, "")}` : ``); 1525} 1526 1527 1528 1529;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.P7ZG6EMR.js 1530 1531
1532// src/components/icon/library.default.ts 1533var library = { 1534 name: "default", 1535 resolver: (name) => getBasePath(`assets/icons/${name}.svg`) 1536}; 1537var library_default_default = library; 1538 1539 1540 1541;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3TFKS637.js
vendor: 7,770 bytes, lines 1542-1665
1542// src/components/icon/library.system.ts 1543var icons = { 1544 caret: ` 1545 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> 1546 <polyline points="6 9 12 15 18 9"></polyline> 1547 </svg> 1548 `, 1549 check: ` 1550 <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16"> 1551 <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"> 1552 <g stroke="currentColor"> 1553 <g transform="translate(3.428571, 3.428571)"> 1554 <path d="M0,5.71428571 L3.42857143,9.14285714"></path> 1555 <path d="M9.14285714,0 L3.42857143,9.14285714"></path> 1556 </g> 1557 </g> 1558 </g> 1559 </svg> 1560 `, 1561 "chevron-down": ` 1562 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16"> 1563 <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/> 1564 </svg> 1565 `, 1566 "chevron-left": ` 1567 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16"> 1568 <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/> 1569 </svg> 1570 `, 1571 "chevron-right": ` 1572 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16"> 1573 <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/> 1574 </svg> 1575 `, 1576 copy: ` 1577 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16"> 1578 <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/> 1579 </svg> 1580 `, 1581 eye: ` 1582 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> 1583 <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> 1584 <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> 1585 </svg> 1586 `, 1587 "eye-slash": ` 1588 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16"> 1589 <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/> 1590 <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/> 1591 <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/> 1592 </svg> 1593 `, 1594 eyedropper: ` 1595 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16"> 1596 <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path> 1597 </svg> 1598 `, 1599 "grip-vertical": ` 1600 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16"> 1601 <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path> 1602 </svg> 1603 `, 1604 indeterminate: ` 1605 <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16"> 1606 <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"> 1607 <g stroke="currentColor" stroke-width="2"> 1608 <g transform="translate(2.285714, 6.857143)"> 1609 <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path> 1610 </g> 1611 </g> 1612 </g> 1613 </svg> 1614 `, 1615 "person-fill": ` 1616 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16"> 1617 <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/> 1618 </svg> 1619 `, 1620 "play-fill": ` 1621 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16"> 1622 <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path> 1623 </svg> 1624 `, 1625 "pause-fill": ` 1626 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16"> 1627 <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path> 1628 </svg> 1629 `, 1630 radio: ` 1631 <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16"> 1632 <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 1633 <g fill="currentColor"> 1634 <circle cx="8" cy="8" r="3.42857143"></circle> 1635 </g> 1636 </g> 1637 </svg> 1638 `, 1639 "star-fill": ` 1640 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"> 1641 <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/> 1642 </svg> 1643 `, 1644 "x-lg": ` 1645 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16"> 1646 <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/> 1647 </svg> 1648 `, 1649 "x-circle-fill": ` 1650 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16"> 1651 <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path> 1652 </svg> 1653 ` 1654}; 1655var systemLibrary = { 1656 name: "system", 1657 resolver: (name) => { 1658 if (name in icons) { 1659 return `data:image/svg+xml,${encodeURIComponent(icons[name])}`; 1660 } 1661 return ""; 1662 } 1663}; 1664var library_system_default = systemLibrary; 1665
1666 1667 1668;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZL53POKZ.js 1669 1670 1671
1672// src/components/icon/library.ts 1673var registry = [library_default_default, library_system_default]; 1674var watchedIcons = []; 1675function watchIcon(icon) { 1676 watchedIcons.push(icon); 1677} 1678function unwatchIcon(icon) { 1679 watchedIcons = watchedIcons.filter((el) => el !== icon); 1680} 1681function getIconLibrary(name) { 1682 return registry.find((lib) => lib.name === name); 1683} 1684function registerIconLibrary(name, options) { 1685 unregisterIconLibrary(name); 1686 registry.push({ 1687 name, 1688 resolver: options.resolver, 1689 mutator: options.mutator, 1690 spriteSheet: options.spriteSheet 1691 }); 1692 watchedIcons.forEach((icon) => { 1693 if (icon.library === name) { 1694 icon.setIcon(); 1695 } 1696 }); 1697} 1698function unregisterIconLibrary(name) { 1699 registry = registry.filter((lib) => lib.name !== name); 1700} 1701 1702 1703 1704;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.QLXRCYS4.js
1705// src/components/icon/icon.styles.ts 1706 1707var icon_styles_default = i` 1708 :host { 1709 display: inline-block; 1710 width: 1em; 1711 height: 1em; 1712 box-sizing: content-box !important; 1713 } 1714 1715 svg { 1716 display: block; 1717 height: 100%; 1718 width: 100%; 1719 } 1720`; 1721 1722 1723 1724;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GMYPQTFK.js 1725 1726
1727// src/internal/watch.ts 1728function watch(propertyName, options) { 1729 const resolvedOptions = __spreadValues({ 1730 waitUntilFirstUpdate: false 1731 }, options); 1732 return (proto, decoratedFnName) => { 1733 const { update } = proto; 1734 const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName]; 1735 proto.update = function(changedProps) { 1736 watchedProperties.forEach((property) => { 1737 const key = property; 1738 if (changedProps.has(key)) { 1739 const oldValue = changedProps.get(key); 1740 const newValue = this[key]; 1741 if (oldValue !== newValue) { 1742 if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) { 1743 this[decoratedFnName](oldValue, newValue); 1744 } 1745 } 1746 } 1747 }); 1748 update.call(this, changedProps); 1749 }; 1750 }; 1751} 1752 1753 1754 1755;// ./node_modules/lit-html/directive-helpers.js 1756 1757/** 1758 * @license 1759 * Copyright 2020 Google LLC 1760 * SPDX-License-Identifier: BSD-3-Clause 1761 */const{I:directive_helpers_t}=Z,directive_helpers_i=o=>null===o||"object"!=typeof o&&"function"!=typeof o,directive_helpers_n=(/* unused pure expression or super */ null && ({HTML:1,SVG:2,MATHML:3})),directive_helpers_e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,directive_helpers_l=o=>null!=o?._$litType$?.h,directive_helpers_c=o=>void 0!==o?._$litDirective$,directive_helpers_d=o=>o?._$litDirective$,directive_helpers_f=o=>void 0===o.strings,directive_helpers_s=()=>document.createComment(""),directive_helpers_r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(directive_helpers_s(),l),c=e.insertBefore(directive_helpers_s(),l);n=new directive_helpers_t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},directive_helpers_v=(o,t,i=o)=>(o._$AI(t,i),o),directive_helpers_u={},directive_helpers_m=(o,t=directive_helpers_u)=>o._$AH=t,directive_helpers_p=o=>o._$AH,directive_helpers_M=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},directive_helpers_h=o=>{o._$AR()}; 1762//# sourceMappingURL=directive-helpers.js.map 1763 1764;// ./node_modules/lit/directive-helpers.js 1765 1766//# sourceMappingURL=directive-helpers.js.map 1767 1768;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YHLNUJ7P.js 1769 1770 1771 1772 1773 1774 1775
1776// src/components/icon/icon.component.ts 1777 1778 1779 1780var CACHEABLE_ERROR = Symbol(); 1781var RETRYABLE_ERROR = Symbol(); 1782var parser; 1783var iconCache = /* @__PURE__ */ new Map(); 1784var SlIcon = class extends ShoelaceElement { 1785 constructor() { 1786 super(...arguments); 1787 this.initialRender = false; 1788 this.svg = null; 1789 this.label = ""; 1790 this.library = "default"; 1791 } 1792 /** Given a URL, this function returns the resulting SVG element or an appropriate error symbol. */ 1793 async resolveIcon(url, library) { 1794 var _a; 1795 let fileData; 1796 if (library == null ? void 0 : library.spriteSheet) { 1797 this.svg = x`<svg part="svg"> 1798 <use part="use" href="${url}"></use> 1799 </svg>`; 1800 return this.svg; 1801 } 1802 try { 1803 fileData = await fetch(url, { mode: "cors" }); 1804 if (!fileData.ok) return fileData.status === 410 ? CACHEABLE_ERROR : RETRYABLE_ERROR; 1805 } catch (e) { 1806 return RETRYABLE_ERROR; 1807 } 1808 try { 1809 const div = document.createElement("div"); 1810 div.innerHTML = await fileData.text(); 1811 const svg = div.firstElementChild; 1812 if (((_a = svg == null ? void 0 : svg.tagName) == null ? void 0 : _a.toLowerCase()) !== "svg") return CACHEABLE_ERROR; 1813 if (!parser) parser = new DOMParser(); 1814 const doc = parser.parseFromString(svg.outerHTML, "text/html"); 1815 const svgEl = doc.body.querySelector("svg"); 1816 if (!svgEl) return CACHEABLE_ERROR; 1817 svgEl.part.add("svg"); 1818 return document.adoptNode(svgEl); 1819 } catch (e) { 1820 return CACHEABLE_ERROR; 1821 } 1822 } 1823 connectedCallback() { 1824 super.connectedCallback(); 1825 watchIcon(this); 1826 } 1827 firstUpdated() { 1828 this.initialRender = true; 1829 this.setIcon(); 1830 } 1831 disconnectedCallback() { 1832 super.disconnectedCallback(); 1833 unwatchIcon(this); 1834 } 1835 getIconSource() { 1836 const library = getIconLibrary(this.library); 1837 if (this.name && library) { 1838 return { 1839 url: library.resolver(this.name), 1840 fromLibrary: true 1841 }; 1842 } 1843 return { 1844 url: this.src, 1845 fromLibrary: false 1846 }; 1847 } 1848 handleLabelChange() { 1849 const hasLabel = typeof this.label === "string" && this.label.length > 0; 1850 if (hasLabel) { 1851 this.setAttribute("role", "img"); 1852 this.setAttribute("aria-label", this.label); 1853 this.removeAttribute("aria-hidden"); 1854 } else { 1855 this.removeAttribute("role"); 1856 this.removeAttribute("aria-label"); 1857 this.setAttribute("aria-hidden", "true"); 1858 } 1859 } 1860 async setIcon() { 1861 var _a; 1862 const { url, fromLibrary } = this.getIconSource(); 1863 const library = fromLibrary ? getIconLibrary(this.library) : void 0; 1864 if (!url) { 1865 this.svg = null; 1866 return; 1867 } 1868 let iconResolver = iconCache.get(url); 1869 if (!iconResolver) { 1870 iconResolver = this.resolveIcon(url, library); 1871 iconCache.set(url, iconResolver); 1872 } 1873 if (!this.initialRender) { 1874 return; 1875 } 1876 const svg = await iconResolver; 1877 if (svg === RETRYABLE_ERROR) { 1878 iconCache.delete(url); 1879 } 1880 if (url !== this.getIconSource().url) { 1881 return; 1882 } 1883 if (directive_helpers_e(svg)) { 1884 this.svg = svg; 1885 if (library) { 1886 await this.updateComplete; 1887 const shadowSVG = this.shadowRoot.querySelector("[part='svg']"); 1888 if (typeof library.mutator === "function" && shadowSVG) { 1889 library.mutator(shadowSVG); 1890 } 1891 } 1892 return; 1893 } 1894 switch (svg) { 1895 case RETRYABLE_ERROR: 1896 case CACHEABLE_ERROR: 1897 this.svg = null; 1898 this.emit("sl-error"); 1899 break; 1900 default: 1901 this.svg = svg.cloneNode(true); 1902 (_a = library == null ? void 0 : library.mutator) == null ? void 0 : _a.call(library, this.svg); 1903 this.emit("sl-load"); 1904 } 1905 } 1906 render() { 1907 return this.svg; 1908 } 1909}; 1910SlIcon.styles = [component_styles_default, icon_styles_default]; 1911__decorateClass([ 1912 state_r() 1913], SlIcon.prototype, "svg", 2); 1914__decorateClass([ 1915 property_n({ reflect: true }) 1916], SlIcon.prototype, "name", 2); 1917__decorateClass([ 1918 property_n() 1919], SlIcon.prototype, "src", 2); 1920__decorateClass([ 1921 property_n() 1922], SlIcon.prototype, "label", 2); 1923__decorateClass([ 1924 property_n({ reflect: true }) 1925], SlIcon.prototype, "library", 2); 1926__decorateClass([ 1927 watch("label") 1928], SlIcon.prototype, "handleLabelChange", 1); 1929__decorateClass([ 1930 watch(["name", "src", "library"]) 1931], SlIcon.prototype, "setIcon", 1); 1932 1933 1934 1935;// ./node_modules/lit-html/directive.js 1936/** 1937 * @license 1938 * Copyright 2017 Google LLC 1939 * SPDX-License-Identifier: BSD-3-Clause 1940 */ 1941const directive_t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},directive_e=t=>(...e)=>({_$litDirective$:t,values:e});class directive_i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} 1942//# sourceMappingURL=directive.js.map 1943 1944;// ./node_modules/lit-html/directives/class-map.js 1945 1946/** 1947 * @license 1948 * Copyright 2018 Google LLC 1949 * SPDX-License-Identifier: BSD-3-Clause 1950 */const class_map_e=directive_e(class extends directive_i{constructor(t){if(super(t),t.type!==directive_t.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}
1950update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return T}}); 1951//# sourceMappingURL=class-map.js.map 1952 1953;// ./node_modules/lit/directives/class-map.js 1954 1955//# sourceMappingURL=class-map.js.map 1956 1957;// ./node_modules/lit-html/static.js 1958 1959/** 1960 * @license 1961 * Copyright 2020 Google LLC 1962 * SPDX-License-Identifier: BSD-3-Clause 1963 */ 1964const static_a=Symbol.for(""),static_o=t=>{if(t?.r===static_a)return t?._$litStatic$},static_s=t=>({_$litStatic$:t,r:static_a}),static_i=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:static_a}),static_l=new Map,static_n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=!1;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=static_o(i));)c+=s+r[++$],f=!0;$!==a&&u.push(i),n.push(c),$++}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=static_l.get(t))&&(n.raw=n,static_l.set(t,r=n)),e=u}return t(r,...e)},static_u=static_n(x),static_c=static_n(lit_html_b),static_$=static_n(w); 1965//# sourceMappingURL=static.js.map 1966 1967;// ./node_modules/lit/static-html.js 1968 1969//# sourceMappingURL=static-html.js.map 1970 1971;// ./node_modules/lit-html/directives/if-defined.js 1972 1973/** 1974 * @license 1975 * Copyright 2018 Google LLC 1976 * SPDX-License-Identifier: BSD-3-Clause 1977 */const if_defined_o=o=>o??E; 1978//# sourceMappingURL=if-defined.js.map 1979 1980;// ./node_modules/lit/directives/if-defined.js 1981 1982//# sourceMappingURL=if-defined.js.map 1983 1984;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SBCFYC2S.js 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995
vendor: 4,172 bytes, lines 1996-2140
1996// src/components/button/button.component.ts 1997 1998 1999 2000 2001var SlButton = class extends ShoelaceElement { 2002 constructor() { 2003 super(...arguments); 2004 this.formControlController = new FormControlController(this, { 2005 assumeInteractionOn: ["click"] 2006 }); 2007 this.hasSlotController = new HasSlotController(this, "[default]", "prefix", "suffix"); 2008 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 2009 this.hasFocus = false; 2010 this.invalid = false; 2011 this.title = ""; 2012 this.variant = "default"; 2013 this.size = "medium"; 2014 this.caret = false; 2015 this.disabled = false; 2016 this.loading = false; 2017 this.outline = false; 2018 this.pill = false; 2019 this.circle = false; 2020 this.type = "button"; 2021 this.name = ""; 2022 this.value = ""; 2023 this.href = ""; 2024 this.rel = "noreferrer noopener"; 2025 } 2026 /** Gets the validity state object */ 2027 get validity() { 2028 if (this.isButton()) { 2029 return this.button.validity; 2030 } 2031 return validValidityState; 2032 } 2033 /** Gets the validation message */ 2034 get validationMessage() { 2035 if (this.isButton()) { 2036 return this.button.validationMessage; 2037 } 2038 return ""; 2039 } 2040 firstUpdated() { 2041 if (this.isButton()) { 2042 this.formControlController.updateValidity(); 2043 } 2044 } 2045 handleBlur() { 2046 this.hasFocus = false; 2047 this.emit("sl-blur"); 2048 } 2049 handleFocus() { 2050 this.hasFocus = true; 2051 this.emit("sl-focus"); 2052 } 2053 handleClick() { 2054 if (this.type === "submit") { 2055 this.formControlController.submit(this); 2056 } 2057 if (this.type === "reset") { 2058 this.formControlController.reset(this); 2059 } 2060 } 2061 handleInvalid(event) { 2062 this.formControlController.setValidity(false); 2063 this.formControlController.emitInvalidEvent(event); 2064 } 2065 isButton() { 2066 return this.href ? false : true; 2067 } 2068 isLink() { 2069 return this.href ? true : false; 2070 } 2071 handleDisabledChange() { 2072 if (this.isButton()) { 2073 this.formControlController.setValidity(this.disabled); 2074 } 2075 } 2076 /** Simulates a click on the button. */ 2077 click() { 2078 this.button.click(); 2079 } 2080 /** Sets focus on the button. */ 2081 focus(options) { 2082 this.button.focus(options); 2083 } 2084 /** Removes focus from the button. */ 2085 blur() { 2086 this.button.blur(); 2087 } 2088 /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ 2089 checkValidity() { 2090 if (this.isButton()) { 2091 return this.button.checkValidity(); 2092 } 2093 return true; 2094 } 2095 /** Gets the associated form, if one exists. */ 2096 getForm() { 2097 return this.formControlController.getForm(); 2098 } 2099 /** Checks for validity and shows the browser's validation message if the control is invalid. */ 2100 reportValidity() { 2101 if (this.isButton()) { 2102 return this.button.reportValidity(); 2103 } 2104 return true; 2105 } 2106 /** Sets a custom validation message. Pass an empty string to restore validity. */ 2107 setCustomValidity(message) { 2108 if (this.isButton()) { 2109 this.button.setCustomValidity(message); 2110 this.formControlController.updateValidity(); 2111 } 2112 } 2113 render() { 2114 const isLink = this.isLink(); 2115 const tag = isLink ? static_i`a` : static_i`button`; 2116 return static_u` 2117 <${tag} 2118 part="base" 2119 class=${class_map_e({ 2120 button: true, 2121 "button--default": this.variant === "default", 2122 "button--primary": this.variant === "primary", 2123 "button--success": this.variant === "success", 2124 "button--neutral": this.variant === "neutral", 2125 "button--warning": this.variant === "warning", 2126 "button--danger": this.variant === "danger", 2127 "button--text": this.variant === "text", 2128 "button--small": this.size === "small", 2129 "button--medium": this.size === "medium", 2130 "button--large": this.size === "large", 2131 "button--caret": this.caret, 2132 "button--circle": this.circle, 2133 "button--disabled": this.disabled, 2134 "button--focused": this.hasFocus, 2135 "button--loading": this.loading, 2136 "button--standard": !this.outline, 2137 "button--outline": this.outline, 2138 "button--pill": this.pill, 2139 "button--rtl": this.localize.dir() === "rtl", 2140 "button--has-label": this.hasSlotController.test("[default]"),
2141 "button--has-prefix": this.hasSlotController.test("prefix"), 2142 "button--has-suffix": this.hasSlotController.test("suffix") 2143 })} 2144 ?disabled=${if_defined_o(isLink ? void 0 : this.disabled)} 2145 type=${if_defined_o(isLink ? void 0 : this.type)} 2146 title=${this.title} 2147 name=${if_defined_o(isLink ? void 0 : this.name)} 2148 value=${if_defined_o(isLink ? void 0 : this.value)} 2149 href=${if_defined_o(isLink && !this.disabled ? this.href : void 0)} 2150 target=${if_defined_o(isLink ? this.target : void 0)} 2151 download=${if_defined_o(isLink ? this.download : void 0)} 2152 rel=${if_defined_o(isLink ? this.rel : void 0)} 2153 role=${if_defined_o(isLink ? void 0 : "button")} 2154 aria-disabled=${this.disabled ? "true" : "false"} 2155 tabindex=${this.disabled ? "-1" : "0"} 2156 @blur=${this.handleBlur} 2157 @focus=${this.handleFocus} 2158 @invalid=${this.isButton() ? this.handleInvalid : null} 2159 @click=${this.handleClick} 2160 > 2161 <slot name="prefix" part="prefix" class="button__prefix"></slot> 2162 <slot part="label" class="button__label"></slot> 2163 <slot name="suffix" part="suffix" class="button__suffix"></slot> 2164 ${this.caret ? static_u` <sl-icon part="caret" class="button__caret" library="system" name="caret"></sl-icon> ` : ""} 2165 ${this.loading ? static_u`<sl-spinner part="spinner"></sl-spinner>` : ""} 2166 </${tag}> 2167 `; 2168 } 2169}; 2170SlButton.styles = [component_styles_default, button_styles_default]; 2171SlButton.dependencies = { 2172 "sl-icon": SlIcon, 2173 "sl-spinner": SlSpinner 2174}; 2175__decorateClass([ 2176 query_e(".button") 2177], SlButton.prototype, "button", 2); 2178__decorateClass([ 2179 state_r() 2180], SlButton.prototype, "hasFocus", 2); 2181__decorateClass([ 2182 state_r() 2183], SlButton.prototype, "invalid", 2); 2184__decorateClass([ 2185 property_n() 2186], SlButton.prototype, "title", 2); 2187__decorateClass([ 2188 property_n({ reflect: true }) 2189], SlButton.prototype, "variant", 2); 2190__decorateClass([ 2191 property_n({ reflect: true }) 2192], SlButton.prototype, "size", 2); 2193__decorateClass([ 2194 property_n({ type: Boolean, reflect: true }) 2195], SlButton.prototype, "caret", 2); 2196__decorateClass([ 2197 property_n({ type: Boolean, reflect: true }) 2198], SlButton.prototype, "disabled", 2); 2199__decorateClass([ 2200 property_n({ type: Boolean, reflect: true }) 2201], SlButton.prototype, "loading", 2); 2202__decorateClass([ 2203 property_n({ type: Boolean, reflect: true }) 2204], SlButton.prototype, "outline", 2); 2205__decorateClass([ 2206 property_n({ type: Boolean, reflect: true }) 2207], SlButton.prototype, "pill", 2); 2208__decorateClass([ 2209 property_n({ type: Boolean, reflect: true }) 2210], SlButton.prototype, "circle", 2); 2211__decorateClass([ 2212 property_n() 2213], SlButton.prototype, "type", 2); 2214__decorateClass([ 2215 property_n() 2216], SlButton.prototype, "name", 2); 2217__decorateClass([ 2218 property_n() 2219], SlButton.prototype, "value", 2); 2220__decorateClass([ 2221 property_n() 2222], SlButton.prototype, "href", 2); 2223__decorateClass([ 2224 property_n() 2225], SlButton.prototype, "target", 2); 2226__decorateClass([ 2227 property_n() 2228], SlButton.prototype, "rel", 2); 2229__decorateClass([ 2230 property_n() 2231], SlButton.prototype, "download", 2); 2232__decorateClass([ 2233 property_n() 2234], SlButton.prototype, "form", 2); 2235__decorateClass([ 2236 property_n({ attribute: "formaction" }) 2237], SlButton.prototype, "formAction", 2); 2238__decorateClass([ 2239 property_n({ attribute: "formenctype" }) 2240], SlButton.prototype, "formEnctype", 2); 2241__decorateClass([ 2242 property_n({ attribute: "formmethod" }) 2243], SlButton.prototype, "formMethod", 2); 2244__decorateClass([ 2245 property_n({ attribute: "formnovalidate", type: Boolean }) 2246], SlButton.prototype, "formNoValidate", 2); 2247__decorateClass([ 2248 property_n({ attribute: "formtarget" }) 2249], SlButton.prototype, "formTarget", 2); 2250__decorateClass([ 2251 watch("disabled", { waitUntilFirstUpdate: true }) 2252], SlButton.prototype, "handleDisabledChange", 1); 2253 2254 2255 2256;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.JCXLDPQF.js 2257/* unused harmony import specifier */ var chunk_JCXLDPQF_SlButton; 2258 2259
2260// src/components/button/button.ts 2261var button_default = (/* unused pure expression or super */ null && (chunk_JCXLDPQF_SlButton)); 2262SlButton.define("sl-button"); 2263 2264 2265 2266;// ./node_modules/@shoelace-style/shoelace/dist/components/button/button.js 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.R3NF57O3.js
2289// src/components/checkbox/checkbox.styles.ts 2290 2291var checkbox_styles_default = i` 2292 :host { 2293 display: inline-block; 2294 } 2295 2296 .checkbox { 2297 position: relative; 2298 display: inline-flex; 2299 align-items: flex-start; 2300 font-family: var(--sl-input-font-family); 2301 font-weight: var(--sl-input-font-weight); 2302 color: var(--sl-input-label-color); 2303 vertical-align: middle; 2304 cursor: pointer; 2305 } 2306 2307 .checkbox--small { 2308 --toggle-size: var(--sl-toggle-size-small); 2309 font-size: var(--sl-input-font-size-small); 2310 } 2311 2312 .checkbox--medium { 2313 --toggle-size: var(--sl-toggle-size-medium); 2314 font-size: var(--sl-input-font-size-medium); 2315 } 2316 2317 .checkbox--large { 2318 --toggle-size: var(--sl-toggle-size-large); 2319 font-size: var(--sl-input-font-size-large); 2320 } 2321 2322 .checkbox__control { 2323 flex: 0 0 auto; 2324 position: relative; 2325 display: inline-flex; 2326 align-items: center; 2327 justify-content: center; 2328 width: var(--toggle-size); 2329 height: var(--toggle-size); 2330 border: solid var(--sl-input-border-width) var(--sl-input-border-color); 2331 border-radius: 2px; 2332 background-color: var(--sl-input-background-color); 2333 color: var(--sl-color-neutral-0); 2334 transition: 2335 var(--sl-transition-fast) border-color, 2336 var(--sl-transition-fast) background-color, 2337 var(--sl-transition-fast) color, 2338 var(--sl-transition-fast) box-shadow; 2339 } 2340 2341 .checkbox__input { 2342 position: absolute; 2343 opacity: 0; 2344 padding: 0; 2345 margin: 0; 2346 pointer-events: none; 2347 } 2348 2349 .checkbox__checked-icon, 2350 .checkbox__indeterminate-icon { 2351 display: inline-flex; 2352 width: var(--toggle-size); 2353 height: var(--toggle-size); 2354 } 2355 2356 /* Hover */ 2357 .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover { 2358 border-color: var(--sl-input-border-color-hover); 2359 background-color: var(--sl-input-background-color-hover); 2360 } 2361 2362 /* Focus */ 2363 .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control { 2364 outline: var(--sl-focus-ring); 2365 outline-offset: var(--sl-focus-ring-offset); 2366 } 2367 2368 /* Checked/indeterminate */ 2369 .checkbox--checked .checkbox__control, 2370 .checkbox--indeterminate .checkbox__control { 2371 border-color: var(--sl-color-primary-600); 2372 background-color: var(--sl-color-primary-600); 2373 } 2374 2375 /* Checked/indeterminate + hover */ 2376 .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover, 2377 .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover { 2378 border-color: var(--sl-color-primary-500); 2379 background-color: var(--sl-color-primary-500); 2380 } 2381 2382 /* Checked/indeterminate + focus */ 2383 .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control, 2384 .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control { 2385 outline: var(--sl-focus-ring); 2386 outline-offset: var(--sl-focus-ring-offset); 2387 } 2388 2389 /* Disabled */ 2390 .checkbox--disabled { 2391 opacity: 0.5; 2392 cursor: not-allowed; 2393 } 2394 2395 .checkbox__label { 2396 display: inline-block; 2397 color: var(--sl-input-label-color); 2398 line-height: var(--toggle-size); 2399 margin-inline-start: 0.5em; 2400 user-select: none; 2401 -webkit-user-select: none; 2402 } 2403 2404 :host([required]) .checkbox__label::after { 2405 content: var(--sl-input-required-content); 2406 color: var(--sl-input-required-content-color); 2407 margin-inline-start: var(--sl-input-required-content-offset); 2408 } 2409`; 2410 2411 2412 2413;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GI7VDIWX.js
vendor: 993 bytes, lines 2414-2437
2414// src/internal/default-value.ts 2415 2416var defaultValue = (propertyName = "value") => (proto, key) => { 2417 const ctor = proto.constructor; 2418 const attributeChangedCallback = ctor.prototype.attributeChangedCallback; 2419 ctor.prototype.attributeChangedCallback = function(name, old, value) { 2420 var _a; 2421 const options = ctor.getPropertyOptions(propertyName); 2422 const attributeName = typeof options.attribute === "string" ? options.attribute : propertyName; 2423 if (name === attributeName) { 2424 const converter = options.converter || u; 2425 const fromAttribute = typeof converter === "function" ? converter : (_a = converter == null ? void 0 : converter.fromAttribute) != null ? _a : u.fromAttribute; 2426 const newValue = fromAttribute(value, options.type); 2427 if (this[propertyName] !== newValue) { 2428 this[key] = newValue; 2429 } 2430 } 2431 attributeChangedCallback.call(this, name, old, value); 2432 }; 2433}; 2434 2435 2436 2437;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.SI4ACBFK.js
vendor: 2,793 bytes, lines 2438-2524
2438// src/styles/form-control.styles.ts 2439 2440var form_control_styles_default = i` 2441 .form-control .form-control__label { 2442 display: none; 2443 } 2444 2445 .form-control .form-control__help-text { 2446 display: none; 2447 } 2448 2449 /* Label */ 2450 .form-control--has-label .form-control__label { 2451 display: inline-block; 2452 color: var(--sl-input-label-color); 2453 margin-bottom: var(--sl-spacing-3x-small); 2454 } 2455 2456 .form-control--has-label.form-control--small .form-control__label { 2457 font-size: var(--sl-input-label-font-size-small); 2458 } 2459 2460 .form-control--has-label.form-control--medium .form-control__label { 2461 font-size: var(--sl-input-label-font-size-medium); 2462 } 2463 2464 .form-control--has-label.form-control--large .form-control__label { 2465 font-size: var(--sl-input-label-font-size-large); 2466 } 2467 2468 :host([required]) .form-control--has-label .form-control__label::after { 2469 content: var(--sl-input-required-content); 2470 margin-inline-start: var(--sl-input-required-content-offset); 2471 color: var(--sl-input-required-content-color); 2472 } 2473 2474 /* Help text */ 2475 .form-control--has-help-text .form-control__help-text { 2476 display: block; 2477 color: var(--sl-input-help-text-color); 2478 margin-top: var(--sl-spacing-3x-small); 2479 } 2480 2481 .form-control--has-help-text.form-control--small .form-control__help-text { 2482 font-size: var(--sl-input-help-text-font-size-small); 2483 } 2484 2485 .form-control--has-help-text.form-control--medium .form-control__help-text { 2486 font-size: var(--sl-input-help-text-font-size-medium); 2487 } 2488 2489 .form-control--has-help-text.form-control--large .form-control__help-text { 2490 font-size: var(--sl-input-help-text-font-size-large); 2491 } 2492 2493 .form-control--has-help-text.form-control--radio-group .form-control__help-text { 2494 margin-top: var(--sl-spacing-2x-small); 2495 } 2496`; 2497 2498 2499 2500;// ./node_modules/lit-html/directives/live.js 2501 2502/** 2503 * @license 2504 * Copyright 2020 Google LLC 2505 * SPDX-License-Identifier: BSD-3-Clause 2506 */const live_l=directive_e(class extends directive_i{constructor(r){if(super(r),r.type!==directive_t.PROPERTY&&r.type!==directive_t.ATTRIBUTE&&r.type!==directive_t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!directive_helpers_f(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t]){if(t===T||t===E)return t;const o=i.element,l=i.name;if(i.type===directive_t.PROPERTY){if(t===o[l])return T}else if(i.type===directive_t.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(l))return T}else if(i.type===directive_t.ATTRIBUTE&&o.getAttribute(l)===t+"")return T;return directive_helpers_m(i),t}}); 2507//# sourceMappingURL=live.js.map 2508 2509;// ./node_modules/lit/directives/live.js 2510 2511//# sourceMappingURL=live.js.map 2512 2513;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.XSFJLY2D.js 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524
vendor: 4,212 bytes, lines 2525-2661
2525// src/components/checkbox/checkbox.component.ts 2526 2527 2528 2529 2530 2531var SlCheckbox = class extends ShoelaceElement { 2532 constructor() { 2533 super(...arguments); 2534 this.formControlController = new FormControlController(this, { 2535 value: (control) => control.checked ? control.value || "on" : void 0, 2536 defaultValue: (control) => control.defaultChecked, 2537 setValue: (control, checked) => control.checked = checked 2538 }); 2539 this.hasSlotController = new HasSlotController(this, "help-text"); 2540 this.hasFocus = false; 2541 this.title = ""; 2542 this.name = ""; 2543 this.size = "medium"; 2544 this.disabled = false; 2545 this.checked = false; 2546 this.indeterminate = false; 2547 this.defaultChecked = false; 2548 this.form = ""; 2549 this.required = false; 2550 this.helpText = ""; 2551 } 2552 /** Gets the validity state object */ 2553 get validity() { 2554 return this.input.validity; 2555 } 2556 /** Gets the validation message */ 2557 get validationMessage() { 2558 return this.input.validationMessage; 2559 } 2560 firstUpdated() { 2561 this.formControlController.updateValidity(); 2562 } 2563 handleClick() { 2564 this.checked = !this.checked; 2565 this.indeterminate = false; 2566 this.emit("sl-change"); 2567 } 2568 handleBlur() { 2569 this.hasFocus = false; 2570 this.emit("sl-blur"); 2571 } 2572 handleInput() { 2573 this.emit("sl-input"); 2574 } 2575 handleInvalid(event) { 2576 this.formControlController.setValidity(false); 2577 this.formControlController.emitInvalidEvent(event); 2578 } 2579 handleFocus() { 2580 this.hasFocus = true; 2581 this.emit("sl-focus"); 2582 } 2583 handleDisabledChange() { 2584 this.formControlController.setValidity(this.disabled); 2585 } 2586 handleStateChange() { 2587 this.input.checked = this.checked; 2588 this.input.indeterminate = this.indeterminate; 2589 this.formControlController.updateValidity(); 2590 } 2591 /** Simulates a click on the checkbox. */ 2592 click() { 2593 this.input.click(); 2594 } 2595 /** Sets focus on the checkbox. */ 2596 focus(options) { 2597 this.input.focus(options); 2598 } 2599 /** Removes focus from the checkbox. */ 2600 blur() { 2601 this.input.blur(); 2602 } 2603 /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ 2604 checkValidity() { 2605 return this.input.checkValidity(); 2606 } 2607 /** Gets the associated form, if one exists. */ 2608 getForm() { 2609 return this.formControlController.getForm(); 2610 } 2611 /** Checks for validity and shows the browser's validation message if the control is invalid. */ 2612 reportValidity() { 2613 return this.input.reportValidity(); 2614 } 2615 /** 2616 * Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear 2617 * the custom validation message, call this method with an empty string. 2618 */ 2619 setCustomValidity(message) { 2620 this.input.setCustomValidity(message); 2621 this.formControlController.updateValidity(); 2622 } 2623 render() { 2624 const hasHelpTextSlot = this.hasSlotController.test("help-text"); 2625 const hasHelpText = this.helpText ? true : !!hasHelpTextSlot; 2626 return x` 2627 <div 2628 class=${class_map_e({ 2629 "form-control": true, 2630 "form-control--small": this.size === "small", 2631 "form-control--medium": this.size === "medium", 2632 "form-control--large": this.size === "large", 2633 "form-control--has-help-text": hasHelpText 2634 })} 2635 > 2636 <label 2637 part="base" 2638 class=${class_map_e({ 2639 checkbox: true, 2640 "checkbox--checked": this.checked, 2641 "checkbox--disabled": this.disabled, 2642 "checkbox--focused": this.hasFocus, 2643 "checkbox--indeterminate": this.indeterminate, 2644 "checkbox--small": this.size === "small", 2645 "checkbox--medium": this.size === "medium", 2646 "checkbox--large": this.size === "large" 2647 })} 2648 > 2649 <input 2650 class="checkbox__input" 2651 type="checkbox" 2652 title=${this.title} 2653 name=${this.name} 2654 value=${if_defined_o(this.value)} 2655 .indeterminate=${live_l(this.indeterminate)} 2656 .checked=${live_l(this.checked)} 2657 .disabled=${this.disabled} 2658 .required=${this.required} 2659 aria-checked=${this.checked ? "true" : "false"} 2660 aria-describedby="help-text" 2661 @click=${this.handleClick}
2662 @input=${this.handleInput} 2663 @invalid=${this.handleInvalid} 2664 @blur=${this.handleBlur} 2665 @focus=${this.handleFocus} 2666 /> 2667 2668 <span 2669 part="control${this.checked ? " control--checked" : ""}${this.indeterminate ? " control--indeterminate" : ""}" 2670 class="checkbox__control" 2671 > 2672 ${this.checked ? x` 2673 <sl-icon part="checked-icon" class="checkbox__checked-icon" library="system" name="check"></sl-icon> 2674 ` : ""} 2675 ${!this.checked && this.indeterminate ? x` 2676 <sl-icon 2677 part="indeterminate-icon" 2678 class="checkbox__indeterminate-icon" 2679 library="system" 2680 name="indeterminate" 2681 ></sl-icon> 2682 ` : ""} 2683 </span> 2684 2685 <div part="label" class="checkbox__label"> 2686 <slot></slot> 2687 </div> 2688 </label> 2689 2690 <div 2691 aria-hidden=${hasHelpText ? "false" : "true"} 2692 class="form-control__help-text" 2693 id="help-text" 2694 part="form-control-help-text" 2695 > 2696 <slot name="help-text">${this.helpText}</slot> 2697 </div> 2698 </div> 2699 `; 2700 } 2701}; 2702SlCheckbox.styles = [component_styles_default, form_control_styles_default, checkbox_styles_default]; 2703SlCheckbox.dependencies = { "sl-icon": SlIcon }; 2704__decorateClass([ 2705 query_e('input[type="checkbox"]') 2706], SlCheckbox.prototype, "input", 2); 2707__decorateClass([ 2708 state_r() 2709], SlCheckbox.prototype, "hasFocus", 2); 2710__decorateClass([ 2711 property_n() 2712], SlCheckbox.prototype, "title", 2); 2713__decorateClass([ 2714 property_n() 2715], SlCheckbox.prototype, "name", 2); 2716__decorateClass([ 2717 property_n() 2718], SlCheckbox.prototype, "value", 2); 2719__decorateClass([ 2720 property_n({ reflect: true }) 2721], SlCheckbox.prototype, "size", 2); 2722__decorateClass([ 2723 property_n({ type: Boolean, reflect: true }) 2724], SlCheckbox.prototype, "disabled", 2); 2725__decorateClass([ 2726 property_n({ type: Boolean, reflect: true }) 2727], SlCheckbox.prototype, "checked", 2); 2728__decorateClass([ 2729 property_n({ type: Boolean, reflect: true }) 2730], SlCheckbox.prototype, "indeterminate", 2); 2731__decorateClass([ 2732 defaultValue("checked") 2733], SlCheckbox.prototype, "defaultChecked", 2); 2734__decorateClass([ 2735 property_n({ reflect: true }) 2736], SlCheckbox.prototype, "form", 2); 2737__decorateClass([ 2738 property_n({ type: Boolean, reflect: true }) 2739], SlCheckbox.prototype, "required", 2); 2740__decorateClass([ 2741 property_n({ attribute: "help-text" }) 2742], SlCheckbox.prototype, "helpText", 2); 2743__decorateClass([ 2744 watch("disabled", { waitUntilFirstUpdate: true }) 2745], SlCheckbox.prototype, "handleDisabledChange", 1); 2746__decorateClass([ 2747 watch(["checked", "indeterminate"], { waitUntilFirstUpdate: true }) 2748], SlCheckbox.prototype, "handleStateChange", 1); 2749 2750 2751 2752;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.D5YQDJ7X.js 2753/* unused harmony import specifier */ var chunk_D5YQDJ7X_SlCheckbox; 2754 2755
2756// src/components/checkbox/checkbox.ts 2757var checkbox_default = (/* unused pure expression or super */ null && (chunk_D5YQDJ7X_SlCheckbox)); 2758SlCheckbox.define("sl-checkbox"); 2759 2760 2761 2762;// ./node_modules/@shoelace-style/shoelace/dist/components/checkbox/checkbox.js 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZGGPD2XJ.js 2783/* unused harmony import specifier */ var chunk_ZGGPD2XJ_SlIcon; 2784 2785
2786// src/components/icon/icon.ts 2787var icon_default = (/* unused pure expression or super */ null && (chunk_ZGGPD2XJ_SlIcon)); 2788SlIcon.define("sl-icon"); 2789 2790 2791 2792;// ./node_modules/@shoelace-style/shoelace/dist/components/icon/icon.js 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6I2T3DLI.js
2807// src/components/icon-button/icon-button.styles.ts 2808 2809var icon_button_styles_default = i` 2810 :host { 2811 display: inline-block; 2812 color: var(--sl-color-neutral-600); 2813 } 2814 2815 .icon-button { 2816 flex: 0 0 auto; 2817 display: flex; 2818 align-items: center; 2819 background: none; 2820 border: none; 2821 border-radius: var(--sl-border-radius-medium); 2822 font-size: inherit; 2823 color: inherit; 2824 padding: var(--sl-spacing-x-small); 2825 cursor: pointer; 2826 transition: var(--sl-transition-x-fast) color; 2827 -webkit-appearance: none; 2828 } 2829 2830 .icon-button:hover:not(.icon-button--disabled), 2831 .icon-button:focus-visible:not(.icon-button--disabled) { 2832 color: var(--sl-color-primary-600); 2833 } 2834 2835 .icon-button:active:not(.icon-button--disabled) { 2836 color: var(--sl-color-primary-700); 2837 } 2838 2839 .icon-button:focus { 2840 outline: none; 2841 } 2842 2843 .icon-button--disabled { 2844 opacity: 0.5; 2845 cursor: not-allowed; 2846 } 2847 2848 .icon-button:focus-visible { 2849 outline: var(--sl-focus-ring); 2850 outline-offset: var(--sl-focus-ring-offset); 2851 } 2852 2853 .icon-button__icon { 2854 pointer-events: none; 2855 } 2856`; 2857 2858 2859 2860;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7E4JTYWU.js 2861 2862 2863 2864 2865 2866
vendor: 3,125 bytes, lines 2867-2979
2867// src/components/icon-button/icon-button.component.ts 2868 2869 2870 2871 2872var SlIconButton = class extends ShoelaceElement { 2873 constructor() { 2874 super(...arguments); 2875 this.hasFocus = false; 2876 this.label = ""; 2877 this.disabled = false; 2878 } 2879 handleBlur() { 2880 this.hasFocus = false; 2881 this.emit("sl-blur"); 2882 } 2883 handleFocus() { 2884 this.hasFocus = true; 2885 this.emit("sl-focus"); 2886 } 2887 handleClick(event) { 2888 if (this.disabled) { 2889 event.preventDefault(); 2890 event.stopPropagation(); 2891 } 2892 } 2893 /** Simulates a click on the icon button. */ 2894 click() { 2895 this.button.click(); 2896 } 2897 /** Sets focus on the icon button. */ 2898 focus(options) { 2899 this.button.focus(options); 2900 } 2901 /** Removes focus from the icon button. */ 2902 blur() { 2903 this.button.blur(); 2904 } 2905 render() { 2906 const isLink = this.href ? true : false; 2907 const tag = isLink ? static_i`a` : static_i`button`; 2908 return static_u` 2909 <${tag} 2910 part="base" 2911 class=${class_map_e({ 2912 "icon-button": true, 2913 "icon-button--disabled": !isLink && this.disabled, 2914 "icon-button--focused": this.hasFocus 2915 })} 2916 ?disabled=${if_defined_o(isLink ? void 0 : this.disabled)} 2917 type=${if_defined_o(isLink ? void 0 : "button")} 2918 href=${if_defined_o(isLink ? this.href : void 0)} 2919 target=${if_defined_o(isLink ? this.target : void 0)} 2920 download=${if_defined_o(isLink ? this.download : void 0)} 2921 rel=${if_defined_o(isLink && this.target ? "noreferrer noopener" : void 0)} 2922 role=${if_defined_o(isLink ? void 0 : "button")} 2923 aria-disabled=${this.disabled ? "true" : "false"} 2924 aria-label="${this.label}" 2925 tabindex=${this.disabled ? "-1" : "0"} 2926 @blur=${this.handleBlur} 2927 @focus=${this.handleFocus} 2928 @click=${this.handleClick} 2929 > 2930 <sl-icon 2931 class="icon-button__icon" 2932 name=${if_defined_o(this.name)} 2933 library=${if_defined_o(this.library)} 2934 src=${if_defined_o(this.src)} 2935 aria-hidden="true" 2936 ></sl-icon> 2937 </${tag}> 2938 `; 2939 } 2940}; 2941SlIconButton.styles = [component_styles_default, icon_button_styles_default]; 2942SlIconButton.dependencies = { "sl-icon": SlIcon }; 2943__decorateClass([ 2944 query_e(".icon-button") 2945], SlIconButton.prototype, "button", 2); 2946__decorateClass([ 2947 state_r() 2948], SlIconButton.prototype, "hasFocus", 2); 2949__decorateClass([ 2950 property_n() 2951], SlIconButton.prototype, "name", 2); 2952__decorateClass([ 2953 property_n() 2954], SlIconButton.prototype, "library", 2); 2955__decorateClass([ 2956 property_n() 2957], SlIconButton.prototype, "src", 2); 2958__decorateClass([ 2959 property_n() 2960], SlIconButton.prototype, "href", 2); 2961__decorateClass([ 2962 property_n() 2963], SlIconButton.prototype, "target", 2); 2964__decorateClass([ 2965 property_n() 2966], SlIconButton.prototype, "download", 2); 2967__decorateClass([ 2968 property_n() 2969], SlIconButton.prototype, "label", 2); 2970__decorateClass([ 2971 property_n({ type: Boolean, reflect: true }) 2972], SlIconButton.prototype, "disabled", 2); 2973 2974 2975 2976;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EZCUSG7Q.js 2977/* unused harmony import specifier */ var chunk_EZCUSG7Q_SlIconButton; 2978 2979
2980// src/components/icon-button/icon-button.ts 2981var icon_button_default = (/* unused pure expression or super */ null && (chunk_EZCUSG7Q_SlIconButton)); 2982SlIconButton.define("sl-icon-button"); 2983 2984 2985 2986;// ./node_modules/@shoelace-style/shoelace/dist/components/icon-button/icon-button.js 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GGT72J62.js
3003// src/components/input/input.styles.ts 3004 3005var input_styles_default = i` 3006 :host { 3007 display: block; 3008 } 3009 3010 .input { 3011 flex: 1 1 auto; 3012 display: inline-flex; 3013 align-items: stretch; 3014 justify-content: start; 3015 position: relative; 3016 width: 100%; 3017 font-family: var(--sl-input-font-family); 3018 font-weight: var(--sl-input-font-weight); 3019 letter-spacing: var(--sl-input-letter-spacing); 3020 vertical-align: middle; 3021 overflow: hidden; 3022 cursor: text; 3023 transition: 3024 var(--sl-transition-fast) color, 3025 var(--sl-transition-fast) border, 3026 var(--sl-transition-fast) box-shadow, 3027 var(--sl-transition-fast) background-color; 3028 } 3029 3030 /* Standard inputs */ 3031 .input--standard { 3032 background-color: var(--sl-input-background-color); 3033 border: solid var(--sl-input-border-width) var(--sl-input-border-color); 3034 } 3035 3036 .input--standard:hover:not(.input--disabled) { 3037 background-color: var(--sl-input-background-color-hover); 3038 border-color: var(--sl-input-border-color-hover); 3039 } 3040 3041 .input--standard.input--focused:not(.input--disabled) { 3042 background-color: var(--sl-input-background-color-focus); 3043 border-color: var(--sl-input-border-color-focus); 3044 box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color); 3045 } 3046 3047 .input--standard.input--focused:not(.input--disabled) .input__control { 3048 color: var(--sl-input-color-focus); 3049 } 3050 3051 .input--standard.input--disabled { 3052 background-color: var(--sl-input-background-color-disabled); 3053 border-color: var(--sl-input-border-color-disabled); 3054 opacity: 0.5; 3055 cursor: not-allowed; 3056 } 3057 3058 .input--standard.input--disabled .input__control { 3059 color: var(--sl-input-color-disabled); 3060 } 3061 3062 .input--standard.input--disabled .input__control::placeholder { 3063 color: var(--sl-input-placeholder-color-disabled); 3064 } 3065 3066 /* Filled inputs */ 3067 .input--filled { 3068 border: none; 3069 background-color: var(--sl-input-filled-background-color); 3070 color: var(--sl-input-color); 3071 } 3072 3073 .input--filled:hover:not(.input--disabled) { 3074 background-color: var(--sl-input-filled-background-color-hover); 3075 } 3076 3077 .input--filled.input--focused:not(.input--disabled) { 3078 background-color: var(--sl-input-filled-background-color-focus); 3079 outline: var(--sl-focus-ring); 3080 outline-offset: var(--sl-focus-ring-offset); 3081 } 3082 3083 .input--filled.input--disabled { 3084 background-color: var(--sl-input-filled-background-color-disabled); 3085 opacity: 0.5; 3086 cursor: not-allowed; 3087 } 3088 3089 .input__control { 3090 flex: 1 1 auto; 3091 font-family: inherit; 3092 font-size: inherit; 3093 font-weight: inherit; 3094 min-width: 0; 3095 height: 100%; 3096 color: var(--sl-input-color); 3097 border: none; 3098 background: inherit; 3099 box-shadow: none; 3100 padding: 0; 3101 margin: 0; 3102 cursor: inherit; 3103 -webkit-appearance: none; 3104 } 3105 3106 .input__control::-webkit-search-decoration, 3107 .input__control::-webkit-search-cancel-button, 3108 .input__control::-webkit-search-results-button, 3109 .input__control::-webkit-search-results-decoration { 3110 -webkit-appearance: none; 3111 } 3112 3113 .input__control:-webkit-autofill, 3114 .input__control:-webkit-autofill:hover, 3115 .input__control:-webkit-autofill:focus, 3116 .input__control:-webkit-autofill:active { 3117 box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important; 3118 -webkit-text-fill-color: var(--sl-color-primary-500); 3119 caret-color: var(--sl-input-color); 3120 } 3121 3122 .input--filled .input__control:-webkit-autofill, 3123 .input--filled .input__control:-webkit-autofill:hover, 3124 .input--filled .input__control:-webkit-autofill:focus, 3125 .input--filled .input__control:-webkit-autofill:active { 3126 box-shadow: 0 0 0 var(--sl-input-height-large) var(--sl-input-filled-background-color) inset !important; 3127 } 3128 3129 .input__control::placeholder { 3130 color: var(--sl-input-placeholder-color); 3131 user-select: none; 3132 -webkit-user-select: none; 3133 } 3134 3135 .input:hover:not(.input--disabled) .input__control { 3136 color: var(--sl-input-color-hover); 3137 } 3138 3139 .input__control:focus { 3140 outline: none; 3141 } 3142 3143 .input__prefix, 3144 .input__suffix { 3145 display: inline-flex; 3146 flex: 0 0 auto; 3147 align-items: center; 3148 cursor: default; 3149 } 3150 3151 .input__prefix ::slotted(sl-icon), 3152 .input__suffix ::slotted(sl-icon) { 3153 color: var(--sl-input-icon-color); 3154 } 3155 3156 /* 3157 * Size modifiers 3158 */ 3159 3160 .input--small { 3161 border-radius: var(--sl-input-border-radius-small); 3162 font-size: var(--sl-input-font-size-small); 3163 height: var(--sl-input-height-small); 3164 } 3165
3166 .input--small .input__control { 3167 height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2); 3168 padding: 0 var(--sl-input-spacing-small); 3169 } 3170 3171 .input--small .input__clear, 3172 .input--small .input__password-toggle { 3173 width: calc(1em + var(--sl-input-spacing-small) * 2); 3174 } 3175 3176 .input--small .input__prefix ::slotted(*) { 3177 margin-inline-start: var(--sl-input-spacing-small); 3178 } 3179 3180 .input--small .input__suffix ::slotted(*) { 3181 margin-inline-end: var(--sl-input-spacing-small); 3182 } 3183 3184 .input--medium { 3185 border-radius: var(--sl-input-border-radius-medium); 3186 font-size: var(--sl-input-font-size-medium); 3187 height: var(--sl-input-height-medium); 3188 } 3189 3190 .input--medium .input__control { 3191 height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2); 3192 padding: 0 var(--sl-input-spacing-medium); 3193 } 3194 3195 .input--medium .input__clear, 3196 .input--medium .input__password-toggle { 3197 width: calc(1em + var(--sl-input-spacing-medium) * 2); 3198 } 3199 3200 .input--medium .input__prefix ::slotted(*) { 3201 margin-inline-start: var(--sl-input-spacing-medium); 3202 } 3203 3204 .input--medium .input__suffix ::slotted(*) { 3205 margin-inline-end: var(--sl-input-spacing-medium); 3206 } 3207 3208 .input--large { 3209 border-radius: var(--sl-input-border-radius-large); 3210 font-size: var(--sl-input-font-size-large); 3211 height: var(--sl-input-height-large); 3212 } 3213 3214 .input--large .input__control { 3215 height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2); 3216 padding: 0 var(--sl-input-spacing-large); 3217 } 3218 3219 .input--large .input__clear, 3220 .input--large .input__password-toggle { 3221 width: calc(1em + var(--sl-input-spacing-large) * 2); 3222 } 3223 3224 .input--large .input__prefix ::slotted(*) { 3225 margin-inline-start: var(--sl-input-spacing-large); 3226 } 3227 3228 .input--large .input__suffix ::slotted(*) { 3229 margin-inline-end: var(--sl-input-spacing-large); 3230 } 3231 3232 /* 3233 * Pill modifier 3234 */ 3235 3236 .input--pill.input--small { 3237 border-radius: var(--sl-input-height-small); 3238 } 3239 3240 .input--pill.input--medium { 3241 border-radius: var(--sl-input-height-medium); 3242 } 3243 3244 .input--pill.input--large { 3245 border-radius: var(--sl-input-height-large); 3246 } 3247 3248 /* 3249 * Clearable + Password Toggle 3250 */ 3251 3252 .input__clear, 3253 .input__password-toggle { 3254 display: inline-flex; 3255 align-items: center; 3256 justify-content: center; 3257 font-size: inherit; 3258 color: var(--sl-input-icon-color); 3259 border: none; 3260 background: none; 3261 padding: 0; 3262 transition: var(--sl-transition-fast) color; 3263 cursor: pointer; 3264 } 3265 3266 .input__clear:hover, 3267 .input__password-toggle:hover { 3268 color: var(--sl-input-icon-color-hover); 3269 } 3270 3271 .input__clear:focus, 3272 .input__password-toggle:focus { 3273 outline: none; 3274 } 3275 3276 /* Don't show the browser's password toggle in Edge */ 3277 ::-ms-reveal { 3278 display: none; 3279 } 3280 3281 /* Hide the built-in number spinner */ 3282 .input--no-spin-buttons input[type='number']::-webkit-outer-spin-button, 3283 .input--no-spin-buttons input[type='number']::-webkit-inner-spin-button { 3284 -webkit-appearance: none; 3285 display: none; 3286 } 3287 3288 .input--no-spin-buttons input[type='number'] { 3289 -moz-appearance: textfield; 3290 } 3291`; 3292 3293 3294 3295;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.VM65NPGC.js 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307
vendor: 8,069 bytes, lines 3308-3549
3308// src/components/input/input.component.ts 3309 3310 3311 3312 3313 3314var SlInput = class extends ShoelaceElement { 3315 constructor() { 3316 super(...arguments); 3317 this.formControlController = new FormControlController(this, { 3318 assumeInteractionOn: ["sl-blur", "sl-input"] 3319 }); 3320 this.hasSlotController = new HasSlotController(this, "help-text", "label"); 3321 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 3322 this.hasFocus = false; 3323 this.title = ""; 3324 // make reactive to pass through 3325 this.__numberInput = Object.assign(document.createElement("input"), { type: "number" }); 3326 this.__dateInput = Object.assign(document.createElement("input"), { type: "date" }); 3327 this.type = "text"; 3328 this.name = ""; 3329 this.value = ""; 3330 this.defaultValue = ""; 3331 this.size = "medium"; 3332 this.filled = false; 3333 this.pill = false; 3334 this.label = ""; 3335 this.helpText = ""; 3336 this.clearable = false; 3337 this.disabled = false; 3338 this.placeholder = ""; 3339 this.readonly = false; 3340 this.passwordToggle = false; 3341 this.passwordVisible = false; 3342 this.noSpinButtons = false; 3343 this.form = ""; 3344 this.required = false; 3345 this.spellcheck = true; 3346 } 3347 // 3348 // NOTE: We use an in-memory input for these getters/setters instead of the one in the template because the properties 3349 // can be set before the component is rendered. 3350 // 3351 /** 3352 * Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. This will use the native `<input type="{{type}}">` implementation and may result in an error. 3353 */ 3354 get valueAsDate() { 3355 var _a; 3356 this.__dateInput.type = this.type; 3357 this.__dateInput.value = this.value; 3358 return ((_a = this.input) == null ? void 0 : _a.valueAsDate) || this.__dateInput.valueAsDate; 3359 } 3360 set valueAsDate(newValue) { 3361 this.__dateInput.type = this.type; 3362 this.__dateInput.valueAsDate = newValue; 3363 this.value = this.__dateInput.value; 3364 } 3365 /** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */ 3366 get valueAsNumber() { 3367 var _a; 3368 this.__numberInput.value = this.value; 3369 return ((_a = this.input) == null ? void 0 : _a.valueAsNumber) || this.__numberInput.valueAsNumber; 3370 } 3371 set valueAsNumber(newValue) { 3372 this.__numberInput.valueAsNumber = newValue; 3373 this.value = this.__numberInput.value; 3374 } 3375 /** Gets the validity state object */ 3376 get validity() { 3377 return this.input.validity; 3378 } 3379 /** Gets the validation message */ 3380 get validationMessage() { 3381 return this.input.validationMessage; 3382 } 3383 firstUpdated() { 3384 this.formControlController.updateValidity(); 3385 } 3386 handleBlur() { 3387 this.hasFocus = false; 3388 this.emit("sl-blur"); 3389 } 3390 handleChange() { 3391 this.value = this.input.value; 3392 this.emit("sl-change"); 3393 } 3394 handleClearClick(event) { 3395 event.preventDefault(); 3396 if (this.value !== "") { 3397 this.value = ""; 3398 this.emit("sl-clear"); 3399 this.emit("sl-input"); 3400 this.emit("sl-change"); 3401 } 3402 this.input.focus(); 3403 } 3404 handleFocus() { 3405 this.hasFocus = true; 3406 this.emit("sl-focus"); 3407 } 3408 handleInput() { 3409 this.value = this.input.value; 3410 this.formControlController.updateValidity(); 3411 this.emit("sl-input"); 3412 } 3413 handleInvalid(event) { 3414 this.formControlController.setValidity(false); 3415 this.formControlController.emitInvalidEvent(event); 3416 } 3417 handleKeyDown(event) { 3418 const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey; 3419 if (event.key === "Enter" && !hasModifier) { 3420 setTimeout(() => { 3421 if (!event.defaultPrevented && !event.isComposing) { 3422 this.formControlController.submit(); 3423 } 3424 }); 3425 } 3426 } 3427 handlePasswordToggle() { 3428 this.passwordVisible = !this.passwordVisible; 3429 } 3430 handleDisabledChange() { 3431 this.formControlController.setValidity(this.disabled); 3432 } 3433 handleStepChange() { 3434 this.input.step = String(this.step); 3435 this.formControlController.updateValidity(); 3436 } 3437 async handleValueChange() { 3438 await this.updateComplete; 3439 this.formControlController.updateValidity(); 3440 } 3441 /** Sets focus on the input. */ 3442 focus(options) { 3443 this.input.focus(options); 3444 } 3445 /** Removes focus from the input. */ 3446 blur() { 3447 this.input.blur(); 3448 } 3449 /** Selects all the text in the input. */ 3450 select() { 3451 this.input.select(); 3452 } 3453 /** Sets the start and end positions of the text selection (0-based). */ 3454 setSelectionRange(selectionStart, selectionEnd, selectionDirection = "none") { 3455 this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection); 3456 } 3457 /** Replaces a range of text with a new string. */ 3458 setRangeText(replacement, start, end, selectMode = "preserve") { 3459 const selectionStart = start != null ? start : this.input.selectionStart; 3460 const selectionEnd = end != null ? end : this.input.selectionEnd; 3461 this.input.setRangeText(replacement, selectionStart, selectionEnd, selectMode); 3462 if (this.value !== this.input.value) { 3463 this.value = this.input.value; 3464 } 3465 } 3466 /** Displays the browser picker for an input element (only works if the browser supports it for the input type). */ 3467 showPicker() { 3468 if ("showPicker" in HTMLInputElement.prototype) { 3469 this.input.showPicker(); 3470 } 3471 } 3472 /** Increments the value of a numeric input type by the value of the step attribute. */ 3473 stepUp() { 3474 this.input.stepUp(); 3475 if (this.value !== this.input.value) { 3476 this.value = this.input.value; 3477 } 3478 } 3479 /** Decrements the value of a numeric input type by the value of the step attribute. */ 3480 stepDown() { 3481 this.input.stepDown(); 3482 if (this.value !== this.input.value) { 3483 this.value = this.input.value; 3484 } 3485 } 3486 /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ 3487 checkValidity() { 3488 return this.input.checkValidity(); 3489 } 3490 /** Gets the associated form, if one exists. */ 3491 getForm() { 3492 return this.formControlController.getForm(); 3493 } 3494 /** Checks for validity and shows the browser's validation message if the control is invalid. */ 3495 reportValidity() { 3496 return this.input.reportValidity(); 3497 } 3498 /** Sets a custom validation message. Pass an empty string to restore validity. */ 3499 setCustomValidity(message) { 3500 this.input.setCustomValidity(message); 3501 this.formControlController.updateValidity(); 3502 } 3503 render() { 3504 const hasLabelSlot = this.hasSlotController.test("label"); 3505 const hasHelpTextSlot = this.hasSlotController.test("help-text"); 3506 const hasLabel = this.label ? true : !!hasLabelSlot; 3507 const hasHelpText = this.helpText ? true : !!hasHelpTextSlot; 3508 const hasClearIcon = this.clearable && !this.disabled && !this.readonly; 3509 const isClearIconVisible = hasClearIcon && (typeof this.value === "number" || this.value.length > 0); 3510 return x` 3511 <div 3512 part="form-control" 3513 class=${class_map_e({ 3514 "form-control": true, 3515 "form-control--small": this.size === "small", 3516 "form-control--medium": this.size === "medium", 3517 "form-control--large": this.size === "large", 3518 "form-control--has-label": hasLabel, 3519 "form-control--has-help-text": hasHelpText 3520 })} 3521 > 3522 <label 3523 part="form-control-label" 3524 class="form-control__label" 3525 for="input" 3526 aria-hidden=${hasLabel ? "false" : "true"} 3527 > 3528 <slot name="label">${this.label}</slot> 3529 </label> 3530 3531 <div part="form-control-input" class="form-control-input"> 3532 <div 3533 part="base" 3534 class=${class_map_e({ 3535 input: true, 3536 // Sizes 3537 "input--small": this.size === "small", 3538 "input--medium": this.size === "medium", 3539 "input--large": this.size === "large", 3540 // States 3541 "input--pill": this.pill, 3542 "input--standard": !this.filled, 3543 "input--filled": this.filled, 3544 "input--disabled": this.disabled, 3545 "input--focused": this.hasFocus, 3546 "input--empty": !this.value, 3547 "input--no-spin-buttons": this.noSpinButtons 3548 })} 3549 >
3550 <span part="prefix" class="input__prefix"> 3551 <slot name="prefix"></slot> 3552 </span> 3553 3554 <input 3555 part="input" 3556 id="input" 3557 class="input__control" 3558 type=${this.type === "password" && this.passwordVisible ? "text" : this.type} 3559 title=${this.title} 3560 name=${if_defined_o(this.name)} 3561 ?disabled=${this.disabled} 3562 ?readonly=${this.readonly} 3563 ?required=${this.required} 3564 placeholder=${if_defined_o(this.placeholder)} 3565 minlength=${if_defined_o(this.minlength)} 3566 maxlength=${if_defined_o(this.maxlength)} 3567 min=${if_defined_o(this.min)} 3568 max=${if_defined_o(this.max)} 3569 step=${if_defined_o(this.step)} 3570 .value=${live_l(this.value)} 3571 autocapitalize=${if_defined_o(this.autocapitalize)} 3572 autocomplete=${if_defined_o(this.autocomplete)} 3573 autocorrect=${if_defined_o(this.autocorrect)} 3574 ?autofocus=${this.autofocus} 3575 spellcheck=${this.spellcheck} 3576 pattern=${if_defined_o(this.pattern)} 3577 enterkeyhint=${if_defined_o(this.enterkeyhint)} 3578 inputmode=${if_defined_o(this.inputmode)} 3579 aria-describedby="help-text" 3580 @change=${this.handleChange} 3581 @input=${this.handleInput} 3582 @invalid=${this.handleInvalid} 3583 @keydown=${this.handleKeyDown} 3584 @focus=${this.handleFocus} 3585 @blur=${this.handleBlur} 3586 /> 3587 3588 ${isClearIconVisible ? x` 3589 <button 3590 part="clear-button" 3591 class="input__clear" 3592 type="button" 3593 aria-label=${this.localize.term("clearEntry")} 3594 @click=${this.handleClearClick} 3595 tabindex="-1" 3596 > 3597 <slot name="clear-icon"> 3598 <sl-icon name="x-circle-fill" library="system"></sl-icon> 3599 </slot> 3600 </button> 3601 ` : ""} 3602 ${this.passwordToggle && !this.disabled ? x` 3603 <button 3604 part="password-toggle-button" 3605 class="input__password-toggle" 3606 type="button" 3607 aria-label=${this.localize.term(this.passwordVisible ? "hidePassword" : "showPassword")} 3608 @click=${this.handlePasswordToggle} 3609 tabindex="-1" 3610 > 3611 ${this.passwordVisible ? x` 3612 <slot name="show-password-icon"> 3613 <sl-icon name="eye-slash" library="system"></sl-icon> 3614 </slot> 3615 ` : x` 3616 <slot name="hide-password-icon"> 3617 <sl-icon name="eye" library="system"></sl-icon> 3618 </slot> 3619 `} 3620 </button> 3621 ` : ""} 3622 3623 <span part="suffix" class="input__suffix"> 3624 <slot name="suffix"></slot> 3625 </span> 3626 </div> 3627 </div> 3628 3629 <div 3630 part="form-control-help-text" 3631 id="help-text" 3632 class="form-control__help-text" 3633 aria-hidden=${hasHelpText ? "false" : "true"} 3634 > 3635 <slot name="help-text">${this.helpText}</slot> 3636 </div> 3637 </div> 3638 `; 3639 } 3640}; 3641SlInput.styles = [component_styles_default, form_control_styles_default, input_styles_default]; 3642SlInput.dependencies = { "sl-icon": SlIcon }; 3643__decorateClass([ 3644 query_e(".input__control") 3645], SlInput.prototype, "input", 2); 3646__decorateClass([ 3647 state_r() 3648], SlInput.prototype, "hasFocus", 2); 3649__decorateClass([ 3650 property_n() 3651], SlInput.prototype, "title", 2); 3652__decorateClass([ 3653 property_n({ reflect: true }) 3654], SlInput.prototype, "type", 2); 3655__decorateClass([ 3656 property_n() 3657], SlInput.prototype, "name", 2); 3658__decorateClass([ 3659 property_n() 3660], SlInput.prototype, "value", 2); 3661__decorateClass([ 3662 defaultValue() 3663], SlInput.prototype, "defaultValue", 2); 3664__decorateClass([ 3665 property_n({ reflect: true }) 3666], SlInput.prototype, "size", 2); 3667__decorateClass([
vendor: 2,695 bytes, lines 3668-3756
3668 property_n({ type: Boolean, reflect: true }) 3669], SlInput.prototype, "filled", 2); 3670__decorateClass([ 3671 property_n({ type: Boolean, reflect: true }) 3672], SlInput.prototype, "pill", 2); 3673__decorateClass([ 3674 property_n() 3675], SlInput.prototype, "label", 2); 3676__decorateClass([ 3677 property_n({ attribute: "help-text" }) 3678], SlInput.prototype, "helpText", 2); 3679__decorateClass([ 3680 property_n({ type: Boolean }) 3681], SlInput.prototype, "clearable", 2); 3682__decorateClass([ 3683 property_n({ type: Boolean, reflect: true }) 3684], SlInput.prototype, "disabled", 2); 3685__decorateClass([ 3686 property_n() 3687], SlInput.prototype, "placeholder", 2); 3688__decorateClass([ 3689 property_n({ type: Boolean, reflect: true }) 3690], SlInput.prototype, "readonly", 2); 3691__decorateClass([ 3692 property_n({ attribute: "password-toggle", type: Boolean }) 3693], SlInput.prototype, "passwordToggle", 2); 3694__decorateClass([ 3695 property_n({ attribute: "password-visible", type: Boolean }) 3696], SlInput.prototype, "passwordVisible", 2); 3697__decorateClass([ 3698 property_n({ attribute: "no-spin-buttons", type: Boolean }) 3699], SlInput.prototype, "noSpinButtons", 2); 3700__decorateClass([ 3701 property_n({ reflect: true }) 3702], SlInput.prototype, "form", 2); 3703__decorateClass([ 3704 property_n({ type: Boolean, reflect: true }) 3705], SlInput.prototype, "required", 2); 3706__decorateClass([ 3707 property_n() 3708], SlInput.prototype, "pattern", 2); 3709__decorateClass([ 3710 property_n({ type: Number }) 3711], SlInput.prototype, "minlength", 2); 3712__decorateClass([ 3713 property_n({ type: Number }) 3714], SlInput.prototype, "maxlength", 2); 3715__decorateClass([ 3716 property_n() 3717], SlInput.prototype, "min", 2); 3718__decorateClass([ 3719 property_n() 3720], SlInput.prototype, "max", 2); 3721__decorateClass([ 3722 property_n() 3723], SlInput.prototype, "step", 2); 3724__decorateClass([ 3725 property_n() 3726], SlInput.prototype, "autocapitalize", 2); 3727__decorateClass([ 3728 property_n() 3729], SlInput.prototype, "autocorrect", 2); 3730__decorateClass([ 3731 property_n() 3732], SlInput.prototype, "autocomplete", 2); 3733__decorateClass([ 3734 property_n({ type: Boolean }) 3735], SlInput.prototype, "autofocus", 2); 3736__decorateClass([ 3737 property_n() 3738], SlInput.prototype, "enterkeyhint", 2); 3739__decorateClass([ 3740 property_n({ 3741 type: Boolean, 3742 converter: { 3743 // Allow "true|false" attribute values but keep the property boolean 3744 fromAttribute: (value) => !value || value === "false" ? false : true, 3745 toAttribute: (value) => value ? "true" : "false" 3746 } 3747 }) 3748], SlInput.prototype, "spellcheck", 2); 3749__decorateClass([ 3750 property_n() 3751], SlInput.prototype, "inputmode", 2); 3752__decorateClass([ 3753 watch("disabled", { waitUntilFirstUpdate: true }) 3754], SlInput.prototype, "handleDisabledChange", 1); 3755__decorateClass([ 3756 watch("step", { waitUntilFirstUpdate: true })
3757], SlInput.prototype, "handleStepChange", 1); 3758__decorateClass([ 3759 watch("value", { waitUntilFirstUpdate: true }) 3760], SlInput.prototype, "handleValueChange", 1); 3761 3762 3763 3764;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.XA43ZQPC.js 3765/* unused harmony import specifier */ var chunk_XA43ZQPC_SlInput; 3766 3767
3768// src/components/input/input.ts 3769var input_default = (/* unused pure expression or super */ null && (chunk_XA43ZQPC_SlInput)); 3770SlInput.define("sl-input"); 3771 3772 3773 3774;// ./node_modules/@shoelace-style/shoelace/dist/components/input/input.js 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3KSWVBQ5.js
3797// src/components/popup/popup.styles.ts 3798 3799var popup_styles_default = i` 3800 :host { 3801 --arrow-color: var(--sl-color-neutral-1000); 3802 --arrow-size: 6px; 3803 3804 /* 3805 * These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant 3806 * 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating. 3807 */ 3808 --arrow-size-diagonal: calc(var(--arrow-size) * 0.7071); 3809 --arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size)); 3810 3811 display: contents; 3812 } 3813 3814 .popup { 3815 position: absolute; 3816 isolation: isolate; 3817 max-width: var(--auto-size-available-width, none); 3818 max-height: var(--auto-size-available-height, none); 3819 } 3820 3821 .popup--fixed { 3822 position: fixed; 3823 } 3824 3825 .popup:not(.popup--active) { 3826 display: none; 3827 } 3828 3829 .popup__arrow { 3830 position: absolute; 3831 width: calc(var(--arrow-size-diagonal) * 2); 3832 height: calc(var(--arrow-size-diagonal) * 2); 3833 rotate: 45deg; 3834 background: var(--arrow-color); 3835 z-index: -1; 3836 } 3837 3838 /* Hover bridge */ 3839 .popup-hover-bridge:not(.popup-hover-bridge--visible) { 3840 display: none; 3841 } 3842 3843 .popup-hover-bridge { 3844 position: fixed; 3845 z-index: calc(var(--sl-z-index-dropdown) - 1); 3846 top: 0; 3847 right: 0; 3848 bottom: 0; 3849 left: 0; 3850 clip-path: polygon( 3851 var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0), 3852 var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0), 3853 var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0), 3854 var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0) 3855 ); 3856 } 3857`; 3858 3859 3860 3861;// ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 3862/** 3863 * Custom positioning reference element. 3864 * @see https://floating-ui.com/docs/virtual-elements 3865 */ 3866 3867const sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); 3868const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); 3869const placements = /*#__PURE__*/(/* unused pure expression or super */ null && (sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); 3870const min = Math.min; 3871const max = Math.max; 3872const round = Math.round; 3873const floor = Math.floor; 3874const createCoords = v => ({ 3875 x: v, 3876 y: v 3877}); 3878const oppositeSideMap = { 3879 left: 'right', 3880 right: 'left', 3881 bottom: 'top', 3882 top: 'bottom' 3883}; 3884const oppositeAlignmentMap = { 3885 start: 'end', 3886 end: 'start' 3887}; 3888function clamp(start, value, end) { 3889 return max(start, min(value, end)); 3890} 3891function evaluate(value, param) { 3892 return typeof value === 'function' ? value(param) : value; 3893} 3894function getSide(placement) { 3895 return placement.split('-')[0]; 3896} 3897function getAlignment(placement) { 3898 return placement.split('-')[1]; 3899} 3900function getOppositeAxis(axis) { 3901 return axis === 'x' ? 'y' : 'x'; 3902} 3903function getAxisLength(axis) { 3904 return axis === 'y' ? 'height' : 'width'; 3905} 3906function getSideAxis(placement) { 3907 return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x'; 3908} 3909function getAlignmentAxis(placement) { 3910 return getOppositeAxis(getSideAxis(placement)); 3911} 3912function getAlignmentSides(placement, rects, rtl) { 3913 if (rtl === void 0) { 3914 rtl = false; 3915 } 3916 const alignment = getAlignment(placement); 3917 const alignmentAxis = getAlignmentAxis(placement); 3918 const length = getAxisLength(alignmentAxis); 3919 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; 3920 if (rects.reference[length] > rects.floating[length]) { 3921 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 3922 } 3923 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 3924} 3925function getExpandedPlacements(placement) { 3926 const oppositePlacement = getOppositePlacement(placement); 3927 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 3928} 3929function getOppositeAlignmentPlacement(placement) { 3930 return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); 3931} 3932function getSideList(side, isStart, rtl) { 3933 const lr = ['left', 'right']; 3934 const rl = ['right', 'left']; 3935 const tb = ['top', 'bottom']; 3936 const bt = ['bottom', 'top']; 3937 switch (side) { 3938 case 'top': 3939 case 'bottom': 3940 if (rtl) return isStart ? rl : lr; 3941 return isStart ? lr : rl; 3942 case 'left': 3943 case 'right': 3944 return isStart ? tb : bt; 3945 default: 3946 return []; 3947 } 3948} 3949function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 3950 const alignment = getAlignment(placement); 3951 let list = getSideList(getSide(placement), direction === 'start', rtl); 3952 if (alignment) { 3953 list = list.map(side => side + "-" + alignment); 3954 if (flipAlignment) { 3955 list = list.concat(list.map(getOppositeAlignmentPlacement)); 3956 } 3957 } 3958 return list; 3959} 3960function getOppositePlacement(placement) { 3961 return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); 3962}
vendor: 4,354 bytes, lines 3963-4129
3963function expandPaddingObject(padding) { 3964 return { 3965 top: 0, 3966 right: 0, 3967 bottom: 0, 3968 left: 0, 3969 ...padding 3970 }; 3971} 3972function getPaddingObject(padding) { 3973 return typeof padding !== 'number' ? expandPaddingObject(padding) : { 3974 top: padding, 3975 right: padding, 3976 bottom: padding, 3977 left: padding 3978 }; 3979} 3980function rectToClientRect(rect) { 3981 const { 3982 x, 3983 y, 3984 width, 3985 height 3986 } = rect; 3987 return { 3988 width, 3989 height, 3990 top: y, 3991 left: x, 3992 right: x + width, 3993 bottom: y + height, 3994 x, 3995 y 3996 }; 3997} 3998 3999 4000 4001;// ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs 4002/* unused harmony import specifier */ var floating_ui_core_getAlignment; 4003/* unused harmony import specifier */ var floating_ui_core_getSide; 4004/* unused harmony import specifier */ var floating_ui_core_getOppositeAlignmentPlacement; 4005/* unused harmony import specifier */ var floating_ui_core_placements; 4006/* unused harmony import specifier */ var floating_ui_core_evaluate; 4007/* unused harmony import specifier */ var floating_ui_core_getAlignmentSides; 4008/* unused harmony import specifier */ var floating_ui_core_sides; 4009/* unused harmony import specifier */ var floating_ui_core_min; 4010/* unused harmony import specifier */ var floating_ui_core_max; 4011/* unused harmony import specifier */ var floating_ui_core_rectToClientRect; 4012/* unused harmony import specifier */ var floating_ui_core_getPaddingObject; 4013/* unused harmony import specifier */ var floating_ui_core_getSideAxis; 4014/* unused harmony import specifier */ var floating_ui_core_getOppositeAxis; 4015 4016 4017 4018function computeCoordsFromPlacement(_ref, placement, rtl) { 4019 let { 4020 reference, 4021 floating 4022 } = _ref; 4023 const sideAxis = getSideAxis(placement); 4024 const alignmentAxis = getAlignmentAxis(placement); 4025 const alignLength = getAxisLength(alignmentAxis); 4026 const side = getSide(placement); 4027 const isVertical = sideAxis === 'y'; 4028 const commonX = reference.x + reference.width / 2 - floating.width / 2; 4029 const commonY = reference.y + reference.height / 2 - floating.height / 2; 4030 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 4031 let coords; 4032 switch (side) { 4033 case 'top': 4034 coords = { 4035 x: commonX, 4036 y: reference.y - floating.height 4037 }; 4038 break; 4039 case 'bottom': 4040 coords = { 4041 x: commonX, 4042 y: reference.y + reference.height 4043 }; 4044 break; 4045 case 'right': 4046 coords = { 4047 x: reference.x + reference.width, 4048 y: commonY 4049 }; 4050 break; 4051 case 'left': 4052 coords = { 4053 x: reference.x - floating.width, 4054 y: commonY 4055 }; 4056 break; 4057 default: 4058 coords = { 4059 x: reference.x, 4060 y: reference.y 4061 }; 4062 } 4063 switch (getAlignment(placement)) { 4064 case 'start': 4065 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 4066 break; 4067 case 'end': 4068 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 4069 break; 4070 } 4071 return coords; 4072} 4073 4074/** 4075 * Computes the `x` and `y` coordinates that will place the floating element 4076 * next to a given reference element. 4077 * 4078 * This export does not have any `platform` interface logic. You will need to 4079 * write one for the platform you are using Floating UI with. 4080 */ 4081const computePosition = async (reference, floating, config) => { 4082 const { 4083 placement = 'bottom', 4084 strategy = 'absolute', 4085 middleware = [], 4086 platform 4087 } = config; 4088 const validMiddleware = middleware.filter(Boolean); 4089 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); 4090 let rects = await platform.getElementRects({ 4091 reference, 4092 floating, 4093 strategy 4094 }); 4095 let { 4096 x, 4097 y 4098 } = computeCoordsFromPlacement(rects, placement, rtl); 4099 let statefulPlacement = placement; 4100 let middlewareData = {}; 4101 let resetCount = 0; 4102 for (let i = 0; i < validMiddleware.length; i++) { 4103 const { 4104 name, 4105 fn 4106 } = validMiddleware[i]; 4107 const { 4108 x: nextX, 4109 y: nextY, 4110 data, 4111 reset 4112 } = await fn({ 4113 x, 4114 y, 4115 initialPlacement: placement, 4116 placement: statefulPlacement, 4117 strategy, 4118 middlewareData, 4119 rects, 4120 platform, 4121 elements: { 4122 reference, 4123 floating 4124 } 4125 }); 4126 x = nextX != null ? nextX : x; 4127 y = nextY != null ? nextY : y; 4128 middlewareData = { 4129 ...middlewareData,
vendor: 4,608 bytes, lines 4130-4270
4130 [name]: { 4131 ...middlewareData[name], 4132 ...data 4133 } 4134 }; 4135 if (reset && resetCount <= 50) { 4136 resetCount++; 4137 if (typeof reset === 'object') { 4138 if (reset.placement) { 4139 statefulPlacement = reset.placement; 4140 } 4141 if (reset.rects) { 4142 rects = reset.rects === true ? await platform.getElementRects({ 4143 reference, 4144 floating, 4145 strategy 4146 }) : reset.rects; 4147 } 4148 ({ 4149 x, 4150 y 4151 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 4152 } 4153 i = -1; 4154 } 4155 } 4156 return { 4157 x, 4158 y, 4159 placement: statefulPlacement, 4160 strategy, 4161 middlewareData 4162 }; 4163}; 4164 4165/** 4166 * Resolves with an object of overflow side offsets that determine how much the 4167 * element is overflowing a given clipping boundary on each side. 4168 * - positive = overflowing the boundary by that number of pixels 4169 * - negative = how many pixels left before it will overflow 4170 * - 0 = lies flush with the boundary 4171 * @see https://floating-ui.com/docs/detectOverflow 4172 */ 4173async function detectOverflow(state, options) { 4174 var _await$platform$isEle; 4175 if (options === void 0) { 4176 options = {}; 4177 } 4178 const { 4179 x, 4180 y, 4181 platform, 4182 rects, 4183 elements, 4184 strategy 4185 } = state; 4186 const { 4187 boundary = 'clippingAncestors', 4188 rootBoundary = 'viewport', 4189 elementContext = 'floating', 4190 altBoundary = false, 4191 padding = 0 4192 } = evaluate(options, state); 4193 const paddingObject = getPaddingObject(padding); 4194 const altContext = elementContext === 'floating' ? 'reference' : 'floating'; 4195 const element = elements[altBoundary ? altContext : elementContext]; 4196 const clippingClientRect = rectToClientRect(await platform.getClippingRect({ 4197 element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), 4198 boundary, 4199 rootBoundary, 4200 strategy 4201 })); 4202 const rect = elementContext === 'floating' ? { 4203 x, 4204 y, 4205 width: rects.floating.width, 4206 height: rects.floating.height 4207 } : rects.reference; 4208 const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); 4209 const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { 4210 x: 1, 4211 y: 1 4212 } : { 4213 x: 1, 4214 y: 1 4215 }; 4216 const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ 4217 elements, 4218 rect, 4219 offsetParent, 4220 strategy 4221 }) : rect); 4222 return { 4223 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 4224 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 4225 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 4226 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 4227 }; 4228} 4229 4230/** 4231 * Provides data to position an inner element of the floating element so that it 4232 * appears centered to the reference element. 4233 * @see https://floating-ui.com/docs/arrow 4234 */ 4235const arrow = options => ({ 4236 name: 'arrow', 4237 options, 4238 async fn(state) { 4239 const { 4240 x, 4241 y, 4242 placement, 4243 rects, 4244 platform, 4245 elements, 4246 middlewareData 4247 } = state; 4248 // Since `element` is required, we don't Partial<> the type. 4249 const { 4250 element, 4251 padding = 0 4252 } = evaluate(options, state) || {}; 4253 if (element == null) { 4254 return {}; 4255 } 4256 const paddingObject = getPaddingObject(padding); 4257 const coords = { 4258 x, 4259 y 4260 }; 4261 const axis = getAlignmentAxis(placement); 4262 const length = getAxisLength(axis); 4263 const arrowDimensions = await platform.getDimensions(element); 4264 const isYAxis = axis === 'y'; 4265 const minProp = isYAxis ? 'top' : 'left'; 4266 const maxProp = isYAxis ? 'bottom' : 'right'; 4267 const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; 4268 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 4269 const startDiff = coords[axis] - rects.reference[axis]; 4270 const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
vendor: 7,164 bytes, lines 4271-4442
4271 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; 4272 4273 // DOM platform can return `window` as the `offsetParent`. 4274 if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { 4275 clientSize = elements.floating[clientProp] || rects.floating[length]; 4276 } 4277 const centerToReference = endDiff / 2 - startDiff / 2; 4278 4279 // If the padding is large enough that it causes the arrow to no longer be 4280 // centered, modify the padding so that it is centered. 4281 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 4282 const minPadding = min(paddingObject[minProp], largestPossiblePadding); 4283 const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); 4284 4285 // Make sure the arrow doesn't overflow the floating element if the center 4286 // point is outside the floating element's bounds. 4287 const min$1 = minPadding; 4288 const max = clientSize - arrowDimensions[length] - maxPadding; 4289 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 4290 const offset = clamp(min$1, center, max); 4291 4292 // If the reference is small enough that the arrow's padding causes it to 4293 // to point to nothing for an aligned placement, adjust the offset of the 4294 // floating element itself. To ensure `shift()` continues to take action, 4295 // a single reset is performed when this is true. 4296 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 4297 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; 4298 return { 4299 [axis]: coords[axis] + alignmentOffset, 4300 data: { 4301 [axis]: offset, 4302 centerOffset: center - offset - alignmentOffset, 4303 ...(shouldAddOffset && { 4304 alignmentOffset 4305 }) 4306 }, 4307 reset: shouldAddOffset 4308 }; 4309 } 4310}); 4311 4312function getPlacementList(alignment, autoAlignment, allowedPlacements) { 4313 const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => floating_ui_core_getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => floating_ui_core_getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => floating_ui_core_getSide(placement) === placement); 4314 return allowedPlacementsSortedByAlignment.filter(placement => { 4315 if (alignment) { 4316 return floating_ui_core_getAlignment(placement) === alignment || (autoAlignment ? floating_ui_core_getOppositeAlignmentPlacement(placement) !== placement : false); 4317 } 4318 return true; 4319 }); 4320} 4321/** 4322 * Optimizes the visibility of the floating element by choosing the placement 4323 * that has the most space available automatically, without needing to specify a 4324 * preferred placement. Alternative to `flip`. 4325 * @see https://floating-ui.com/docs/autoPlacement 4326 */ 4327const autoPlacement = function (options) { 4328 if (options === void 0) { 4329 options = {}; 4330 } 4331 return { 4332 name: 'autoPlacement', 4333 options, 4334 async fn(state) { 4335 var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; 4336 const { 4337 rects, 4338 middlewareData, 4339 placement, 4340 platform, 4341 elements 4342 } = state; 4343 const { 4344 crossAxis = false, 4345 alignment, 4346 allowedPlacements = floating_ui_core_placements, 4347 autoAlignment = true, 4348 ...detectOverflowOptions 4349 } = floating_ui_core_evaluate(options, state); 4350 const placements$1 = alignment !== undefined || allowedPlacements === floating_ui_core_placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; 4351 const overflow = await detectOverflow(state, detectOverflowOptions); 4352 const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; 4353 const currentPlacement = placements$1[currentIndex]; 4354 if (currentPlacement == null) { 4355 return {}; 4356 } 4357 const alignmentSides = floating_ui_core_getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); 4358 4359 // Make `computeCoords` start from the right place. 4360 if (placement !== currentPlacement) { 4361 return { 4362 reset: { 4363 placement: placements$1[0] 4364 } 4365 }; 4366 } 4367 const currentOverflows = [overflow[floating_ui_core_getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; 4368 const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { 4369 placement: currentPlacement, 4370 overflows: currentOverflows 4371 }]; 4372 const nextPlacement = placements$1[currentIndex + 1]; 4373 4374 // There are more placements to check. 4375 if (nextPlacement) { 4376 return { 4377 data: { 4378 index: currentIndex + 1, 4379 overflows: allOverflows 4380 }, 4381 reset: { 4382 placement: nextPlacement 4383 } 4384 }; 4385 } 4386 const placementsSortedByMostSpace = allOverflows.map(d => { 4387 const alignment = floating_ui_core_getAlignment(d.placement); 4388 return [d.placement, alignment && crossAxis ? 4389 // Check along the mainAxis and main crossAxis side. 4390 d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : 4391 // Check only the mainAxis. 4392 d.overflows[0], d.overflows]; 4393 }).sort((a, b) => a[1] - b[1]); 4394 const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, 4395 // Aligned placements should not check their opposite crossAxis 4396 // side. 4397 floating_ui_core_getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); 4398 const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; 4399 if (resetPlacement !== placement) { 4400 return { 4401 data: { 4402 index: currentIndex + 1, 4403 overflows: allOverflows 4404 }, 4405 reset: { 4406 placement: resetPlacement 4407 } 4408 }; 4409 } 4410 return {}; 4411 } 4412 }; 4413}; 4414 4415/** 4416 * Optimizes the visibility of the floating element by flipping the `placement` 4417 * in order to keep it in view when the preferred placement(s) will overflow the 4418 * clipping boundary. Alternative to `autoPlacement`. 4419 * @see https://floating-ui.com/docs/flip 4420 */ 4421const flip = function (options) { 4422 if (options === void 0) { 4423 options = {}; 4424 } 4425 return { 4426 name: 'flip', 4427 options, 4428 async fn(state) { 4429 var _middlewareData$arrow, _middlewareData$flip; 4430 const { 4431 placement, 4432 middlewareData, 4433 rects, 4434 initialPlacement, 4435 platform, 4436 elements 4437 } = state; 4438 const { 4439 mainAxis: checkMainAxis = true, 4440 crossAxis: checkCrossAxis = true, 4441 fallbackPlacements: specifiedFallbackPlacements, 4442 fallbackStrategy = 'bestFit',
vendor: 6,605 bytes, lines 4443-4614
4443 fallbackAxisSideDirection = 'none', 4444 flipAlignment = true, 4445 ...detectOverflowOptions 4446 } = evaluate(options, state); 4447 4448 // If a reset by the arrow was caused due to an alignment offset being 4449 // added, we should skip any logic now since `flip()` has already done its 4450 // work. 4451 // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 4452 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 4453 return {}; 4454 } 4455 const side = getSide(placement); 4456 const initialSideAxis = getSideAxis(initialPlacement); 4457 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 4458 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 4459 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 4460 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; 4461 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 4462 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 4463 } 4464 const placements = [initialPlacement, ...fallbackPlacements]; 4465 const overflow = await detectOverflow(state, detectOverflowOptions); 4466 const overflows = []; 4467 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 4468 if (checkMainAxis) { 4469 overflows.push(overflow[side]); 4470 } 4471 if (checkCrossAxis) { 4472 const sides = getAlignmentSides(placement, rects, rtl); 4473 overflows.push(overflow[sides[0]], overflow[sides[1]]); 4474 } 4475 overflowsData = [...overflowsData, { 4476 placement, 4477 overflows 4478 }]; 4479 4480 // One or more sides is overflowing. 4481 if (!overflows.every(side => side <= 0)) { 4482 var _middlewareData$flip2, _overflowsData$filter; 4483 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 4484 const nextPlacement = placements[nextIndex]; 4485 if (nextPlacement) { 4486 var _overflowsData$; 4487 const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false; 4488 const hasInitialMainAxisOverflow = ((_overflowsData$ = overflowsData[0]) == null ? void 0 : _overflowsData$.overflows[0]) > 0; 4489 if (!ignoreCrossAxisOverflow || hasInitialMainAxisOverflow) { 4490 // Try next placement and re-run the lifecycle. 4491 return { 4492 data: { 4493 index: nextIndex, 4494 overflows: overflowsData 4495 }, 4496 reset: { 4497 placement: nextPlacement 4498 } 4499 }; 4500 } 4501 } 4502 4503 // First, find the candidates that fit on the mainAxis side of overflow, 4504 // then find the placement that fits the best on the main crossAxis side. 4505 let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 4506 4507 // Otherwise fallback. 4508 if (!resetPlacement) { 4509 switch (fallbackStrategy) { 4510 case 'bestFit': 4511 { 4512 var _overflowsData$filter2; 4513 const placement = (_overflowsData$filter2 = overflowsData.filter(d => { 4514 if (hasFallbackAxisSideDirection) { 4515 const currentSideAxis = getSideAxis(d.placement); 4516 return currentSideAxis === initialSideAxis || 4517 // Create a bias to the `y` side axis due to horizontal 4518 // reading directions favoring greater width. 4519 currentSideAxis === 'y'; 4520 } 4521 return true; 4522 }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 4523 if (placement) { 4524 resetPlacement = placement; 4525 } 4526 break; 4527 } 4528 case 'initialPlacement': 4529 resetPlacement = initialPlacement; 4530 break; 4531 } 4532 } 4533 if (placement !== resetPlacement) { 4534 return { 4535 reset: { 4536 placement: resetPlacement 4537 } 4538 }; 4539 } 4540 } 4541 return {}; 4542 } 4543 }; 4544}; 4545 4546function getSideOffsets(overflow, rect) { 4547 return { 4548 top: overflow.top - rect.height, 4549 right: overflow.right - rect.width, 4550 bottom: overflow.bottom - rect.height, 4551 left: overflow.left - rect.width 4552 }; 4553} 4554function isAnySideFullyClipped(overflow) { 4555 return floating_ui_core_sides.some(side => overflow[side] >= 0); 4556} 4557/** 4558 * Provides data to hide the floating element in applicable situations, such as 4559 * when it is not in the same clipping context as the reference element. 4560 * @see https://floating-ui.com/docs/hide 4561 */ 4562const hide = function (options) { 4563 if (options === void 0) { 4564 options = {}; 4565 } 4566 return { 4567 name: 'hide', 4568 options, 4569 async fn(state) { 4570 const { 4571 rects 4572 } = state; 4573 const { 4574 strategy = 'referenceHidden', 4575 ...detectOverflowOptions 4576 } = floating_ui_core_evaluate(options, state); 4577 switch (strategy) { 4578 case 'referenceHidden': 4579 { 4580 const overflow = await detectOverflow(state, { 4581 ...detectOverflowOptions, 4582 elementContext: 'reference' 4583 }); 4584 const offsets = getSideOffsets(overflow, rects.reference); 4585 return { 4586 data: { 4587 referenceHiddenOffsets: offsets, 4588 referenceHidden: isAnySideFullyClipped(offsets) 4589 } 4590 }; 4591 } 4592 case 'escaped': 4593 { 4594 const overflow = await detectOverflow(state, { 4595 ...detectOverflowOptions, 4596 altBoundary: true 4597 }); 4598 const offsets = getSideOffsets(overflow, rects.floating); 4599 return { 4600 data: { 4601 escapedOffsets: offsets, 4602 escaped: isAnySideFullyClipped(offsets) 4603 } 4604 }; 4605 } 4606 default: 4607 { 4608 return {}; 4609 } 4610 } 4611 } 4612 }; 4613}; 4614
vendor: 5,459 bytes, lines 4615-4766
4615function getBoundingRect(rects) { 4616 const minX = floating_ui_core_min(...rects.map(rect => rect.left)); 4617 const minY = floating_ui_core_min(...rects.map(rect => rect.top)); 4618 const maxX = floating_ui_core_max(...rects.map(rect => rect.right)); 4619 const maxY = floating_ui_core_max(...rects.map(rect => rect.bottom)); 4620 return { 4621 x: minX, 4622 y: minY, 4623 width: maxX - minX, 4624 height: maxY - minY 4625 }; 4626} 4627function getRectsByLine(rects) { 4628 const sortedRects = rects.slice().sort((a, b) => a.y - b.y); 4629 const groups = []; 4630 let prevRect = null; 4631 for (let i = 0; i < sortedRects.length; i++) { 4632 const rect = sortedRects[i]; 4633 if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { 4634 groups.push([rect]); 4635 } else { 4636 groups[groups.length - 1].push(rect); 4637 } 4638 prevRect = rect; 4639 } 4640 return groups.map(rect => floating_ui_core_rectToClientRect(getBoundingRect(rect))); 4641} 4642/** 4643 * Provides improved positioning for inline reference elements that can span 4644 * over multiple lines, such as hyperlinks or range selections. 4645 * @see https://floating-ui.com/docs/inline 4646 */ 4647const inline = function (options) { 4648 if (options === void 0) { 4649 options = {}; 4650 } 4651 return { 4652 name: 'inline', 4653 options, 4654 async fn(state) { 4655 const { 4656 placement, 4657 elements, 4658 rects, 4659 platform, 4660 strategy 4661 } = state; 4662 // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a 4663 // ClientRect's bounds, despite the event listener being triggered. A 4664 // padding of 2 seems to handle this issue. 4665 const { 4666 padding = 2, 4667 x, 4668 y 4669 } = floating_ui_core_evaluate(options, state); 4670 const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); 4671 const clientRects = getRectsByLine(nativeClientRects); 4672 const fallback = floating_ui_core_rectToClientRect(getBoundingRect(nativeClientRects)); 4673 const paddingObject = floating_ui_core_getPaddingObject(padding); 4674 function getBoundingClientRect() { 4675 // There are two rects and they are disjoined. 4676 if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { 4677 // Find the first rect in which the point is fully inside. 4678 return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; 4679 } 4680 4681 // There are 2 or more connected rects. 4682 if (clientRects.length >= 2) { 4683 if (floating_ui_core_getSideAxis(placement) === 'y') { 4684 const firstRect = clientRects[0]; 4685 const lastRect = clientRects[clientRects.length - 1]; 4686 const isTop = floating_ui_core_getSide(placement) === 'top'; 4687 const top = firstRect.top; 4688 const bottom = lastRect.bottom; 4689 const left = isTop ? firstRect.left : lastRect.left; 4690 const right = isTop ? firstRect.right : lastRect.right; 4691 const width = right - left; 4692 const height = bottom - top; 4693 return { 4694 top, 4695 bottom, 4696 left, 4697 right, 4698 width, 4699 height, 4700 x: left, 4701 y: top 4702 }; 4703 } 4704 const isLeftSide = floating_ui_core_getSide(placement) === 'left'; 4705 const maxRight = floating_ui_core_max(...clientRects.map(rect => rect.right)); 4706 const minLeft = floating_ui_core_min(...clientRects.map(rect => rect.left)); 4707 const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); 4708 const top = measureRects[0].top; 4709 const bottom = measureRects[measureRects.length - 1].bottom; 4710 const left = minLeft; 4711 const right = maxRight; 4712 const width = right - left; 4713 const height = bottom - top; 4714 return { 4715 top, 4716 bottom, 4717 left, 4718 right, 4719 width, 4720 height, 4721 x: left, 4722 y: top 4723 }; 4724 } 4725 return fallback; 4726 } 4727 const resetRects = await platform.getElementRects({ 4728 reference: { 4729 getBoundingClientRect 4730 }, 4731 floating: elements.floating, 4732 strategy 4733 }); 4734 if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { 4735 return { 4736 reset: { 4737 rects: resetRects 4738 } 4739 }; 4740 } 4741 return {}; 4742 } 4743 }; 4744}; 4745 4746// For type backwards-compatibility, the `OffsetOptions` type was also 4747// Derivable. 4748 4749async function convertValueToCoords(state, options) { 4750 const { 4751 placement, 4752 platform, 4753 elements 4754 } = state; 4755 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 4756 const side = getSide(placement); 4757 const alignment = getAlignment(placement); 4758 const isVertical = getSideAxis(placement) === 'y'; 4759 const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; 4760 const crossAxisMulti = rtl && isVertical ? -1 : 1; 4761 const rawValue = evaluate(options, state); 4762 4763 // eslint-disable-next-line prefer-const 4764 let { 4765 mainAxis, 4766 crossAxis,
vendor: 14,460 bytes, lines 4767-5203
4767 alignmentAxis 4768 } = typeof rawValue === 'number' ? { 4769 mainAxis: rawValue, 4770 crossAxis: 0, 4771 alignmentAxis: null 4772 } : { 4773 mainAxis: rawValue.mainAxis || 0, 4774 crossAxis: rawValue.crossAxis || 0, 4775 alignmentAxis: rawValue.alignmentAxis 4776 }; 4777 if (alignment && typeof alignmentAxis === 'number') { 4778 crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; 4779 } 4780 return isVertical ? { 4781 x: crossAxis * crossAxisMulti, 4782 y: mainAxis * mainAxisMulti 4783 } : { 4784 x: mainAxis * mainAxisMulti, 4785 y: crossAxis * crossAxisMulti 4786 }; 4787} 4788 4789/** 4790 * Modifies the placement by translating the floating element along the 4791 * specified axes. 4792 * A number (shorthand for `mainAxis` or distance), or an axes configuration 4793 * object may be passed. 4794 * @see https://floating-ui.com/docs/offset 4795 */ 4796const offset = function (options) { 4797 if (options === void 0) { 4798 options = 0; 4799 } 4800 return { 4801 name: 'offset', 4802 options, 4803 async fn(state) { 4804 var _middlewareData$offse, _middlewareData$arrow; 4805 const { 4806 x, 4807 y, 4808 placement, 4809 middlewareData 4810 } = state; 4811 const diffCoords = await convertValueToCoords(state, options); 4812 4813 // If the placement is the same and the arrow caused an alignment offset 4814 // then we don't need to change the positioning coordinates. 4815 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 4816 return {}; 4817 } 4818 return { 4819 x: x + diffCoords.x, 4820 y: y + diffCoords.y, 4821 data: { 4822 ...diffCoords, 4823 placement 4824 } 4825 }; 4826 } 4827 }; 4828}; 4829 4830/** 4831 * Optimizes the visibility of the floating element by shifting it in order to 4832 * keep it in view when it will overflow the clipping boundary. 4833 * @see https://floating-ui.com/docs/shift 4834 */ 4835const shift = function (options) { 4836 if (options === void 0) { 4837 options = {}; 4838 } 4839 return { 4840 name: 'shift', 4841 options, 4842 async fn(state) { 4843 const { 4844 x, 4845 y, 4846 placement 4847 } = state; 4848 const { 4849 mainAxis: checkMainAxis = true, 4850 crossAxis: checkCrossAxis = false, 4851 limiter = { 4852 fn: _ref => { 4853 let { 4854 x, 4855 y 4856 } = _ref; 4857 return { 4858 x, 4859 y 4860 }; 4861 } 4862 }, 4863 ...detectOverflowOptions 4864 } = evaluate(options, state); 4865 const coords = { 4866 x, 4867 y 4868 }; 4869 const overflow = await detectOverflow(state, detectOverflowOptions); 4870 const crossAxis = getSideAxis(getSide(placement)); 4871 const mainAxis = getOppositeAxis(crossAxis); 4872 let mainAxisCoord = coords[mainAxis]; 4873 let crossAxisCoord = coords[crossAxis]; 4874 if (checkMainAxis) { 4875 const minSide = mainAxis === 'y' ? 'top' : 'left'; 4876 const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; 4877 const min = mainAxisCoord + overflow[minSide]; 4878 const max = mainAxisCoord - overflow[maxSide]; 4879 mainAxisCoord = clamp(min, mainAxisCoord, max); 4880 } 4881 if (checkCrossAxis) { 4882 const minSide = crossAxis === 'y' ? 'top' : 'left'; 4883 const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; 4884 const min = crossAxisCoord + overflow[minSide]; 4885 const max = crossAxisCoord - overflow[maxSide]; 4886 crossAxisCoord = clamp(min, crossAxisCoord, max); 4887 } 4888 const limitedCoords = limiter.fn({ 4889 ...state, 4890 [mainAxis]: mainAxisCoord, 4891 [crossAxis]: crossAxisCoord 4892 }); 4893 return { 4894 ...limitedCoords, 4895 data: { 4896 x: limitedCoords.x - x, 4897 y: limitedCoords.y - y, 4898 enabled: { 4899 [mainAxis]: checkMainAxis, 4900 [crossAxis]: checkCrossAxis 4901 } 4902 } 4903 }; 4904 } 4905 }; 4906}; 4907/** 4908 * Built-in `limiter` that will stop `shift()` at a certain point. 4909 */ 4910const limitShift = function (options) { 4911 if (options === void 0) { 4912 options = {}; 4913 } 4914 return { 4915 options, 4916 fn(state) { 4917 const { 4918 x, 4919 y, 4920 placement, 4921 rects, 4922 middlewareData 4923 } = state; 4924 const { 4925 offset = 0, 4926 mainAxis: checkMainAxis = true, 4927 crossAxis: checkCrossAxis = true 4928 } = floating_ui_core_evaluate(options, state); 4929 const coords = { 4930 x, 4931 y 4932 }; 4933 const crossAxis = floating_ui_core_getSideAxis(placement); 4934 const mainAxis = floating_ui_core_getOppositeAxis(crossAxis); 4935 let mainAxisCoord = coords[mainAxis]; 4936 let crossAxisCoord = coords[crossAxis]; 4937 const rawOffset = floating_ui_core_evaluate(offset, state); 4938 const computedOffset = typeof rawOffset === 'number' ? { 4939 mainAxis: rawOffset, 4940 crossAxis: 0 4941 } : { 4942 mainAxis: 0, 4943 crossAxis: 0, 4944 ...rawOffset 4945 }; 4946 if (checkMainAxis) { 4947 const len = mainAxis === 'y' ? 'height' : 'width'; 4948 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 4949 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 4950 if (mainAxisCoord < limitMin) { 4951 mainAxisCoord = limitMin; 4952 } else if (mainAxisCoord > limitMax) { 4953 mainAxisCoord = limitMax; 4954 } 4955 } 4956 if (checkCrossAxis) { 4957 var _middlewareData$offse, _middlewareData$offse2; 4958 const len = mainAxis === 'y' ? 'width' : 'height'; 4959 const isOriginSide = ['top', 'left'].includes(floating_ui_core_getSide(placement)); 4960 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); 4961 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); 4962 if (crossAxisCoord < limitMin) { 4963 crossAxisCoord = limitMin; 4964 } else if (crossAxisCoord > limitMax) { 4965 crossAxisCoord = limitMax; 4966 } 4967 } 4968 return { 4969 [mainAxis]: mainAxisCoord, 4970 [crossAxis]: crossAxisCoord 4971 }; 4972 } 4973 }; 4974}; 4975 4976/** 4977 * Provides data that allows you to change the size of the floating element — 4978 * for instance, prevent it from overflowing the clipping boundary or match the 4979 * width of the reference element. 4980 * @see https://floating-ui.com/docs/size 4981 */ 4982const size = function (options) { 4983 if (options === void 0) { 4984 options = {}; 4985 } 4986 return { 4987 name: 'size', 4988 options, 4989 async fn(state) { 4990 var _state$middlewareData, _state$middlewareData2; 4991 const { 4992 placement, 4993 rects, 4994 platform, 4995 elements 4996 } = state; 4997 const { 4998 apply = () => {}, 4999 ...detectOverflowOptions 5000 } = evaluate(options, state); 5001 const overflow = await detectOverflow(state, detectOverflowOptions); 5002 const side = getSide(placement); 5003 const alignment = getAlignment(placement); 5004 const isYAxis = getSideAxis(placement) === 'y'; 5005 const { 5006 width, 5007 height 5008 } = rects.floating; 5009 let heightSide; 5010 let widthSide; 5011 if (side === 'top' || side === 'bottom') { 5012 heightSide = side; 5013 widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; 5014 } else { 5015 widthSide = side; 5016 heightSide = alignment === 'end' ? 'top' : 'bottom'; 5017 } 5018 const maximumClippingHeight = height - overflow.top - overflow.bottom; 5019 const maximumClippingWidth = width - overflow.left - overflow.right; 5020 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 5021 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 5022 const noShift = !state.middlewareData.shift; 5023 let availableHeight = overflowAvailableHeight; 5024 let availableWidth = overflowAvailableWidth; 5025 if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { 5026 availableWidth = maximumClippingWidth; 5027 } 5028 if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { 5029 availableHeight = maximumClippingHeight; 5030 } 5031 if (noShift && !alignment) { 5032 const xMin = max(overflow.left, 0); 5033 const xMax = max(overflow.right, 0); 5034 const yMin = max(overflow.top, 0); 5035 const yMax = max(overflow.bottom, 0); 5036 if (isYAxis) { 5037 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); 5038 } else { 5039 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); 5040 } 5041 } 5042 await apply({ 5043 ...state, 5044 availableWidth, 5045 availableHeight 5046 }); 5047 const nextDimensions = await platform.getDimensions(elements.floating); 5048 if (width !== nextDimensions.width || height !== nextDimensions.height) { 5049 return { 5050 reset: { 5051 rects: true 5052 } 5053 }; 5054 } 5055 return {}; 5056 } 5057 }; 5058}; 5059 5060 5061 5062;// ./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 5063function hasWindow() { 5064 return typeof window !== 'undefined'; 5065} 5066function getNodeName(node) { 5067 if (isNode(node)) { 5068 return (node.nodeName || '').toLowerCase(); 5069 } 5070 // Mocked nodes in testing environments may not be instances of Node. By 5071 // returning `#document` an infinite loop won't occur. 5072 // https://github.com/floating-ui/floating-ui/issues/2317 5073 return '#document'; 5074} 5075function getWindow(node) { 5076 var _node$ownerDocument; 5077 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 5078} 5079function getDocumentElement(node) { 5080 var _ref; 5081 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 5082} 5083function isNode(value) { 5084 if (!hasWindow()) { 5085 return false; 5086 } 5087 return value instanceof Node || value instanceof getWindow(value).Node; 5088} 5089function isElement(value) { 5090 if (!hasWindow()) { 5091 return false; 5092 } 5093 return value instanceof Element || value instanceof getWindow(value).Element; 5094} 5095function isHTMLElement(value) { 5096 if (!hasWindow()) { 5097 return false; 5098 } 5099 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 5100} 5101function isShadowRoot(value) { 5102 if (!hasWindow() || typeof ShadowRoot === 'undefined') { 5103 return false; 5104 } 5105 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 5106} 5107function isOverflowElement(element) { 5108 const { 5109 overflow, 5110 overflowX, 5111 overflowY, 5112 display 5113 } = floating_ui_utils_dom_getComputedStyle(element); 5114 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); 5115} 5116function isTableElement(element) { 5117 return ['table', 'td', 'th'].includes(getNodeName(element)); 5118} 5119function isTopLayer(element) { 5120 return [':popover-open', ':modal'].some(selector => { 5121 try { 5122 return element.matches(selector); 5123 } catch (e) { 5124 return false; 5125 } 5126 }); 5127} 5128function isContainingBlock(elementOrCss) { 5129 const webkit = isWebKit(); 5130 const css = isElement(elementOrCss) ? floating_ui_utils_dom_getComputedStyle(elementOrCss) : elementOrCss; 5131 5132 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 5133 // https://drafts.csswg.org/css-transforms-2/#individual-transforms 5134 return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); 5135} 5136function getContainingBlock(element) { 5137 let currentNode = getParentNode(element); 5138 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 5139 if (isContainingBlock(currentNode)) { 5140 return currentNode; 5141 } else if (isTopLayer(currentNode)) { 5142 return null; 5143 } 5144 currentNode = getParentNode(currentNode); 5145 } 5146 return null; 5147} 5148function isWebKit() { 5149 if (typeof CSS === 'undefined' || !CSS.supports) return false; 5150 return CSS.supports('-webkit-backdrop-filter', 'none'); 5151} 5152function isLastTraversableNode(node) { 5153 return ['html', 'body', '#document'].includes(getNodeName(node)); 5154} 5155function floating_ui_utils_dom_getComputedStyle(element) { 5156 return getWindow(element).getComputedStyle(element); 5157} 5158function getNodeScroll(element) { 5159 if (isElement(element)) { 5160 return { 5161 scrollLeft: element.scrollLeft, 5162 scrollTop: element.scrollTop 5163 }; 5164 } 5165 return { 5166 scrollLeft: element.scrollX, 5167 scrollTop: element.scrollY 5168 }; 5169} 5170function getParentNode(node) { 5171 if (getNodeName(node) === 'html') { 5172 return node; 5173 } 5174 const result = 5175 // Step into the shadow DOM of the parent of a slotted node. 5176 node.assignedSlot || 5177 // DOM Element detected. 5178 node.parentNode || 5179 // ShadowRoot detected. 5180 isShadowRoot(node) && node.host || 5181 // Fallback. 5182 getDocumentElement(node); 5183 return isShadowRoot(result) ? result.host : result; 5184} 5185function getNearestOverflowAncestor(node) { 5186 const parentNode = getParentNode(node); 5187 if (isLastTraversableNode(parentNode)) { 5188 return node.ownerDocument ? node.ownerDocument.body : node.body; 5189 } 5190 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 5191 return parentNode; 5192 } 5193 return getNearestOverflowAncestor(parentNode); 5194} 5195function getOverflowAncestors(node, list, traverseIframes) { 5196 var _node$ownerDocument2; 5197 if (list === void 0) { 5198 list = []; 5199 } 5200 if (traverseIframes === void 0) { 5201 traverseIframes = true; 5202 } 5203 const scrollableAncestor = getNearestOverflowAncestor(node);
vendor: 4,005 bytes, lines 5204-5329
5204 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 5205 const win = getWindow(scrollableAncestor); 5206 if (isBody) { 5207 const frameElement = getFrameElement(win); 5208 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 5209 } 5210 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 5211} 5212function getFrameElement(win) { 5213 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 5214} 5215 5216 5217 5218;// ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 5219/* unused harmony import specifier */ var detectOverflow$1; 5220/* unused harmony import specifier */ var autoPlacement$1; 5221/* unused harmony import specifier */ var hide$1; 5222/* unused harmony import specifier */ var inline$1; 5223/* unused harmony import specifier */ var limitShift$1; 5224 5225 5226 5227 5228 5229function getCssDimensions(element) { 5230 const css = floating_ui_utils_dom_getComputedStyle(element); 5231 // In testing environments, the `width` and `height` properties are empty 5232 // strings for SVG elements, returning NaN. Fallback to `0` in this case. 5233 let width = parseFloat(css.width) || 0; 5234 let height = parseFloat(css.height) || 0; 5235 const hasOffset = isHTMLElement(element); 5236 const offsetWidth = hasOffset ? element.offsetWidth : width; 5237 const offsetHeight = hasOffset ? element.offsetHeight : height; 5238 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 5239 if (shouldFallback) { 5240 width = offsetWidth; 5241 height = offsetHeight; 5242 } 5243 return { 5244 width, 5245 height, 5246 $: shouldFallback 5247 }; 5248} 5249 5250function unwrapElement(element) { 5251 return !isElement(element) ? element.contextElement : element; 5252} 5253 5254function getScale(element) { 5255 const domElement = unwrapElement(element); 5256 if (!isHTMLElement(domElement)) { 5257 return createCoords(1); 5258 } 5259 const rect = domElement.getBoundingClientRect(); 5260 const { 5261 width, 5262 height, 5263 $ 5264 } = getCssDimensions(domElement); 5265 let x = ($ ? round(rect.width) : rect.width) / width; 5266 let y = ($ ? round(rect.height) : rect.height) / height; 5267 5268 // 0, NaN, or Infinity should always fallback to 1. 5269 5270 if (!x || !Number.isFinite(x)) { 5271 x = 1; 5272 } 5273 if (!y || !Number.isFinite(y)) { 5274 y = 1; 5275 } 5276 return { 5277 x, 5278 y 5279 }; 5280} 5281 5282const noOffsets = /*#__PURE__*/createCoords(0); 5283function getVisualOffsets(element) { 5284 const win = getWindow(element); 5285 if (!isWebKit() || !win.visualViewport) { 5286 return noOffsets; 5287 } 5288 return { 5289 x: win.visualViewport.offsetLeft, 5290 y: win.visualViewport.offsetTop 5291 }; 5292} 5293function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 5294 if (isFixed === void 0) { 5295 isFixed = false; 5296 } 5297 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 5298 return false; 5299 } 5300 return isFixed; 5301} 5302 5303function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 5304 if (includeScale === void 0) { 5305 includeScale = false; 5306 } 5307 if (isFixedStrategy === void 0) { 5308 isFixedStrategy = false; 5309 } 5310 const clientRect = element.getBoundingClientRect(); 5311 const domElement = unwrapElement(element); 5312 let scale = createCoords(1); 5313 if (includeScale) { 5314 if (offsetParent) { 5315 if (isElement(offsetParent)) { 5316 scale = getScale(offsetParent); 5317 } 5318 } else { 5319 scale = getScale(element); 5320 } 5321 } 5322 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 5323 let x = (clientRect.left + visualOffsets.x) / scale.x; 5324 let y = (clientRect.top + visualOffsets.y) / scale.y; 5325 let width = clientRect.width / scale.x; 5326 let height = clientRect.height / scale.y; 5327 if (domElement) { 5328 const win = getWindow(domElement); 5329 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
vendor: 8,238 bytes, lines 5330-5550
5330 let currentWin = win; 5331 let currentIFrame = getFrameElement(currentWin); 5332 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 5333 const iframeScale = getScale(currentIFrame); 5334 const iframeRect = currentIFrame.getBoundingClientRect(); 5335 const css = floating_ui_utils_dom_getComputedStyle(currentIFrame); 5336 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 5337 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 5338 x *= iframeScale.x; 5339 y *= iframeScale.y; 5340 width *= iframeScale.x; 5341 height *= iframeScale.y; 5342 x += left; 5343 y += top; 5344 currentWin = getWindow(currentIFrame); 5345 currentIFrame = getFrameElement(currentWin); 5346 } 5347 } 5348 return rectToClientRect({ 5349 width, 5350 height, 5351 x, 5352 y 5353 }); 5354} 5355 5356// If <html> has a CSS width greater than the viewport, then this will be 5357// incorrect for RTL. 5358function getWindowScrollBarX(element, rect) { 5359 const leftScroll = getNodeScroll(element).scrollLeft; 5360 if (!rect) { 5361 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 5362 } 5363 return rect.left + leftScroll; 5364} 5365 5366function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) { 5367 if (ignoreScrollbarX === void 0) { 5368 ignoreScrollbarX = false; 5369 } 5370 const htmlRect = documentElement.getBoundingClientRect(); 5371 const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : 5372 // RTL <body> scrollbar. 5373 getWindowScrollBarX(documentElement, htmlRect)); 5374 const y = htmlRect.top + scroll.scrollTop; 5375 return { 5376 x, 5377 y 5378 }; 5379} 5380 5381function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 5382 let { 5383 elements, 5384 rect, 5385 offsetParent, 5386 strategy 5387 } = _ref; 5388 const isFixed = strategy === 'fixed'; 5389 const documentElement = getDocumentElement(offsetParent); 5390 const topLayer = elements ? isTopLayer(elements.floating) : false; 5391 if (offsetParent === documentElement || topLayer && isFixed) { 5392 return rect; 5393 } 5394 let scroll = { 5395 scrollLeft: 0, 5396 scrollTop: 0 5397 }; 5398 let scale = createCoords(1); 5399 const offsets = createCoords(0); 5400 const isOffsetParentAnElement = isHTMLElement(offsetParent); 5401 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 5402 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 5403 scroll = getNodeScroll(offsetParent); 5404 } 5405 if (isHTMLElement(offsetParent)) { 5406 const offsetRect = getBoundingClientRect(offsetParent); 5407 scale = getScale(offsetParent); 5408 offsets.x = offsetRect.x + offsetParent.clientLeft; 5409 offsets.y = offsetRect.y + offsetParent.clientTop; 5410 } 5411 } 5412 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0); 5413 return { 5414 width: rect.width * scale.x, 5415 height: rect.height * scale.y, 5416 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 5417 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 5418 }; 5419} 5420 5421function getClientRects(element) { 5422 return Array.from(element.getClientRects()); 5423} 5424 5425// Gets the entire size of the scrollable document area, even extending outside 5426// of the `<html>` and `<body>` rect bounds if horizontally scrollable. 5427function getDocumentRect(element) { 5428 const html = getDocumentElement(element); 5429 const scroll = getNodeScroll(element); 5430 const body = element.ownerDocument.body; 5431 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 5432 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 5433 let x = -scroll.scrollLeft + getWindowScrollBarX(element); 5434 const y = -scroll.scrollTop; 5435 if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') { 5436 x += max(html.clientWidth, body.clientWidth) - width; 5437 } 5438 return { 5439 width, 5440 height, 5441 x, 5442 y 5443 }; 5444} 5445 5446function getViewportRect(element, strategy) { 5447 const win = getWindow(element); 5448 const html = getDocumentElement(element); 5449 const visualViewport = win.visualViewport; 5450 let width = html.clientWidth; 5451 let height = html.clientHeight; 5452 let x = 0; 5453 let y = 0; 5454 if (visualViewport) { 5455 width = visualViewport.width; 5456 height = visualViewport.height; 5457 const visualViewportBased = isWebKit(); 5458 if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { 5459 x = visualViewport.offsetLeft; 5460 y = visualViewport.offsetTop; 5461 } 5462 } 5463 return { 5464 width, 5465 height, 5466 x, 5467 y 5468 }; 5469} 5470 5471// Returns the inner client rect, subtracting scrollbars if present. 5472function getInnerBoundingClientRect(element, strategy) { 5473 const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); 5474 const top = clientRect.top + element.clientTop; 5475 const left = clientRect.left + element.clientLeft; 5476 const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); 5477 const width = element.clientWidth * scale.x; 5478 const height = element.clientHeight * scale.y; 5479 const x = left * scale.x; 5480 const y = top * scale.y; 5481 return { 5482 width, 5483 height, 5484 x, 5485 y 5486 }; 5487} 5488function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 5489 let rect; 5490 if (clippingAncestor === 'viewport') { 5491 rect = getViewportRect(element, strategy); 5492 } else if (clippingAncestor === 'document') { 5493 rect = getDocumentRect(getDocumentElement(element)); 5494 } else if (isElement(clippingAncestor)) { 5495 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 5496 } else { 5497 const visualOffsets = getVisualOffsets(element); 5498 rect = { 5499 x: clippingAncestor.x - visualOffsets.x, 5500 y: clippingAncestor.y - visualOffsets.y, 5501 width: clippingAncestor.width, 5502 height: clippingAncestor.height 5503 }; 5504 } 5505 return rectToClientRect(rect); 5506} 5507function hasFixedPositionAncestor(element, stopNode) { 5508 const parentNode = getParentNode(element); 5509 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 5510 return false; 5511 } 5512 return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); 5513} 5514 5515// A "clipping ancestor" is an `overflow` element with the characteristic of 5516// clipping (or hiding) child elements. This returns all clipping ancestors 5517// of the given element up the tree. 5518function getClippingElementAncestors(element, cache) { 5519 const cachedResult = cache.get(element); 5520 if (cachedResult) { 5521 return cachedResult; 5522 } 5523 let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); 5524 let currentContainingBlockComputedStyle = null; 5525 const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed'; 5526 let currentNode = elementIsFixed ? getParentNode(element) : element; 5527 5528 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 5529 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 5530 const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode); 5531 const currentNodeIsContaining = isContainingBlock(currentNode); 5532 if (!currentNodeIsContaining && computedStyle.position === 'fixed') { 5533 currentContainingBlockComputedStyle = null; 5534 } 5535 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 5536 if (shouldDropCurrentNode) { 5537 // Drop non-containing blocks. 5538 result = result.filter(ancestor => ancestor !== currentNode); 5539 } else { 5540 // Record last containing block for next iteration. 5541 currentContainingBlockComputedStyle = computedStyle; 5542 } 5543 currentNode = getParentNode(currentNode); 5544 } 5545 cache.set(element, result); 5546 return result; 5547} 5548 5549// Gets the maximum area that the element is visible in due to any number of 5550// clipping ancestors.
vendor: 5,514 bytes, lines 5551-5708
5551function getClippingRect(_ref) { 5552 let { 5553 element, 5554 boundary, 5555 rootBoundary, 5556 strategy 5557 } = _ref; 5558 const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 5559 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 5560 const firstClippingAncestor = clippingAncestors[0]; 5561 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { 5562 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); 5563 accRect.top = max(rect.top, accRect.top); 5564 accRect.right = min(rect.right, accRect.right); 5565 accRect.bottom = min(rect.bottom, accRect.bottom); 5566 accRect.left = max(rect.left, accRect.left); 5567 return accRect; 5568 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); 5569 return { 5570 width: clippingRect.right - clippingRect.left, 5571 height: clippingRect.bottom - clippingRect.top, 5572 x: clippingRect.left, 5573 y: clippingRect.top 5574 }; 5575} 5576 5577function getDimensions(element) { 5578 const { 5579 width, 5580 height 5581 } = getCssDimensions(element); 5582 return { 5583 width, 5584 height 5585 }; 5586} 5587 5588function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 5589 const isOffsetParentAnElement = isHTMLElement(offsetParent); 5590 const documentElement = getDocumentElement(offsetParent); 5591 const isFixed = strategy === 'fixed'; 5592 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 5593 let scroll = { 5594 scrollLeft: 0, 5595 scrollTop: 0 5596 }; 5597 const offsets = createCoords(0); 5598 5599 // If the <body> scrollbar appears on the left (e.g. RTL systems). Use 5600 // Firefox with layout.scrollbar.side = 3 in about:config to test this. 5601 function setLeftRTLScrollbarOffset() { 5602 offsets.x = getWindowScrollBarX(documentElement); 5603 } 5604 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 5605 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 5606 scroll = getNodeScroll(offsetParent); 5607 } 5608 if (isOffsetParentAnElement) { 5609 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 5610 offsets.x = offsetRect.x + offsetParent.clientLeft; 5611 offsets.y = offsetRect.y + offsetParent.clientTop; 5612 } else if (documentElement) { 5613 setLeftRTLScrollbarOffset(); 5614 } 5615 } 5616 if (isFixed && !isOffsetParentAnElement && documentElement) { 5617 setLeftRTLScrollbarOffset(); 5618 } 5619 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 5620 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 5621 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 5622 return { 5623 x, 5624 y, 5625 width: rect.width, 5626 height: rect.height 5627 }; 5628} 5629 5630function isStaticPositioned(element) { 5631 return floating_ui_utils_dom_getComputedStyle(element).position === 'static'; 5632} 5633 5634function getTrueOffsetParent(element, polyfill) { 5635 if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') { 5636 return null; 5637 } 5638 if (polyfill) { 5639 return polyfill(element); 5640 } 5641 let rawOffsetParent = element.offsetParent; 5642 5643 // Firefox returns the <html> element as the offsetParent if it's non-static, 5644 // while Chrome and Safari return the <body> element. The <body> element must 5645 // be used to perform the correct calculations even if the <html> element is 5646 // non-static. 5647 if (getDocumentElement(element) === rawOffsetParent) { 5648 rawOffsetParent = rawOffsetParent.ownerDocument.body; 5649 } 5650 return rawOffsetParent; 5651} 5652 5653// Gets the closest ancestor positioned element. Handles some edge cases, 5654// such as table ancestors and cross browser bugs. 5655function getOffsetParent(element, polyfill) { 5656 const win = getWindow(element); 5657 if (isTopLayer(element)) { 5658 return win; 5659 } 5660 if (!isHTMLElement(element)) { 5661 let svgOffsetParent = getParentNode(element); 5662 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 5663 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 5664 return svgOffsetParent; 5665 } 5666 svgOffsetParent = getParentNode(svgOffsetParent); 5667 } 5668 return win; 5669 } 5670 let offsetParent = getTrueOffsetParent(element, polyfill); 5671 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 5672 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 5673 } 5674 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 5675 return win; 5676 } 5677 return offsetParent || getContainingBlock(element) || win; 5678} 5679 5680const getElementRects = async function (data) { 5681 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 5682 const getDimensionsFn = this.getDimensions; 5683 const floatingDimensions = await getDimensionsFn(data.floating); 5684 return { 5685 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 5686 floating: { 5687 x: 0, 5688 y: 0, 5689 width: floatingDimensions.width, 5690 height: floatingDimensions.height 5691 } 5692 }; 5693}; 5694 5695function isRTL(element) { 5696 return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl'; 5697} 5698 5699const platform = { 5700 convertOffsetParentRelativeRectToViewportRelativeRect, 5701 getDocumentElement: getDocumentElement, 5702 getClippingRect, 5703 getOffsetParent, 5704 getElementRects, 5705 getClientRects, 5706 getDimensions, 5707 getScale, 5708 isElement:
vendor: 5,768 bytes, lines 5708-5884
5708 isElement, 5709 isRTL 5710}; 5711 5712function rectsAreEqual(a, b) { 5713 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 5714} 5715 5716// https://samthor.au/2021/observing-dom/ 5717function observeMove(element, onMove) { 5718 let io = null; 5719 let timeoutId; 5720 const root = getDocumentElement(element); 5721 function cleanup() { 5722 var _io; 5723 clearTimeout(timeoutId); 5724 (_io = io) == null || _io.disconnect(); 5725 io = null; 5726 } 5727 function refresh(skip, threshold) { 5728 if (skip === void 0) { 5729 skip = false; 5730 } 5731 if (threshold === void 0) { 5732 threshold = 1; 5733 } 5734 cleanup(); 5735 const elementRectForRootMargin = element.getBoundingClientRect(); 5736 const { 5737 left, 5738 top, 5739 width, 5740 height 5741 } = elementRectForRootMargin; 5742 if (!skip) { 5743 onMove(); 5744 } 5745 if (!width || !height) { 5746 return; 5747 } 5748 const insetTop = floor(top); 5749 const insetRight = floor(root.clientWidth - (left + width)); 5750 const insetBottom = floor(root.clientHeight - (top + height)); 5751 const insetLeft = floor(left); 5752 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 5753 const options = { 5754 rootMargin, 5755 threshold: max(0, min(1, threshold)) || 1 5756 }; 5757 let isFirstUpdate = true; 5758 function handleObserve(entries) { 5759 const ratio = entries[0].intersectionRatio; 5760 if (ratio !== threshold) { 5761 if (!isFirstUpdate) { 5762 return refresh(); 5763 } 5764 if (!ratio) { 5765 // If the reference is clipped, the ratio is 0. Throttle the refresh 5766 // to prevent an infinite loop of updates. 5767 timeoutId = setTimeout(() => { 5768 refresh(false, 1e-7); 5769 }, 1000); 5770 } else { 5771 refresh(false, ratio); 5772 } 5773 } 5774 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 5775 // It's possible that even though the ratio is reported as 1, the 5776 // element is not actually fully within the IntersectionObserver's root 5777 // area anymore. This can happen under performance constraints. This may 5778 // be a bug in the browser's IntersectionObserver implementation. To 5779 // work around this, we compare the element's bounding rect now with 5780 // what it was at the time we created the IntersectionObserver. If they 5781 // are not equal then the element moved, so we refresh. 5782 refresh(); 5783 } 5784 isFirstUpdate = false; 5785 } 5786 5787 // Older browsers don't support a `document` as the root and will throw an 5788 // error. 5789 try { 5790 io = new IntersectionObserver(handleObserve, { 5791 ...options, 5792 // Handle <iframe>s 5793 root: root.ownerDocument 5794 }); 5795 } catch (_e) { 5796 io = new IntersectionObserver(handleObserve, options); 5797 } 5798 io.observe(element); 5799 } 5800 refresh(true); 5801 return cleanup; 5802} 5803 5804/** 5805 * Automatically updates the position of the floating element when necessary. 5806 * Should only be called when the floating element is mounted on the DOM or 5807 * visible on the screen. 5808 * @returns cleanup function that should be invoked when the floating element is 5809 * removed from the DOM or hidden from the screen. 5810 * @see https://floating-ui.com/docs/autoUpdate 5811 */ 5812function autoUpdate(reference, floating, update, options) { 5813 if (options === void 0) { 5814 options = {}; 5815 } 5816 const { 5817 ancestorScroll = true, 5818 ancestorResize = true, 5819 elementResize = typeof ResizeObserver === 'function', 5820 layoutShift = typeof IntersectionObserver === 'function', 5821 animationFrame = false 5822 } = options; 5823 const referenceEl = unwrapElement(reference); 5824 const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : []; 5825 ancestors.forEach(ancestor => { 5826 ancestorScroll && ancestor.addEventListener('scroll', update, { 5827 passive: true 5828 }); 5829 ancestorResize && ancestor.addEventListener('resize', update); 5830 }); 5831 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; 5832 let reobserveFrame = -1; 5833 let resizeObserver = null; 5834 if (elementResize) { 5835 resizeObserver = new ResizeObserver(_ref => { 5836 let [firstEntry] = _ref; 5837 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) { 5838 // Prevent update loops when using the `size` middleware. 5839 // https://github.com/floating-ui/floating-ui/issues/1740 5840 resizeObserver.unobserve(floating); 5841 cancelAnimationFrame(reobserveFrame); 5842 reobserveFrame = requestAnimationFrame(() => { 5843 var _resizeObserver; 5844 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 5845 }); 5846 } 5847 update(); 5848 }); 5849 if (referenceEl && !animationFrame) { 5850 resizeObserver.observe(referenceEl); 5851 } 5852 resizeObserver.observe(floating); 5853 } 5854 let frameId; 5855 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 5856 if (animationFrame) { 5857 frameLoop(); 5858 } 5859 function frameLoop() { 5860 const nextRefRect = getBoundingClientRect(reference); 5861 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 5862 update(); 5863 } 5864 prevRefRect = nextRefRect; 5865 frameId = requestAnimationFrame(frameLoop); 5866 } 5867 update(); 5868 return () => { 5869 var _resizeObserver2; 5870 ancestors.forEach(ancestor => { 5871 ancestorScroll && ancestor.removeEventListener('scroll', update); 5872 ancestorResize && ancestor.removeEventListener('resize', update); 5873 }); 5874 cleanupIo == null || cleanupIo(); 5875 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 5876 resizeObserver = null; 5877 if (animationFrame) { 5878 cancelAnimationFrame(frameId); 5879 } 5880 }; 5881} 5882 5883/** 5884 *
5884Resolves with an object of overflow side offsets that determine how much the 5885 * element is overflowing a given clipping boundary on each side. 5886 * - positive = overflowing the boundary by that number of pixels 5887 * - negative = how many pixels left before it will overflow 5888 * - 0 = lies flush with the boundary 5889 * @see https://floating-ui.com/docs/detectOverflow 5890 */ 5891const floating_ui_dom_detectOverflow = (/* unused pure expression or super */ null && (detectOverflow$1)); 5892 5893/** 5894 * Modifies the placement by translating the floating element along the 5895 * specified axes. 5896 * A number (shorthand for `mainAxis` or distance), or an axes configuration 5897 * object may be passed. 5898 * @see https://floating-ui.com/docs/offset 5899 */ 5900const floating_ui_dom_offset = offset; 5901 5902/** 5903 * Optimizes the visibility of the floating element by choosing the placement 5904 * that has the most space available automatically, without needing to specify a 5905 * preferred placement. Alternative to `flip`. 5906 * @see https://floating-ui.com/docs/autoPlacement 5907 */ 5908const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1)); 5909 5910/** 5911 * Optimizes the visibility of the floating element by shifting it in order to 5912 * keep it in view when it will overflow the clipping boundary. 5913 * @see https://floating-ui.com/docs/shift 5914 */ 5915const floating_ui_dom_shift = shift; 5916 5917/** 5918 * Optimizes the visibility of the floating element by flipping the `placement` 5919 * in order to keep it in view when the preferred placement(s) will overflow the 5920 * clipping boundary. Alternative to `autoPlacement`. 5921 * @see https://floating-ui.com/docs/flip 5922 */ 5923const floating_ui_dom_flip = flip; 5924 5925/** 5926 * Provides data that allows you to change the size of the floating element — 5927 * for instance, prevent it from overflowing the clipping boundary or match the 5928 * width of the reference element. 5929 * @see https://floating-ui.com/docs/size 5930 */ 5931const floating_ui_dom_size = size; 5932 5933/** 5934 * Provides data to hide the floating element in applicable situations, such as 5935 * when it is not in the same clipping context as the reference element. 5936 * @see https://floating-ui.com/docs/hide 5937 */ 5938const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1)); 5939 5940/** 5941 * Provides data to position an inner element of the floating element so that it 5942 * appears centered to the reference element. 5943 * @see https://floating-ui.com/docs/arrow 5944 */ 5945const floating_ui_dom_arrow = arrow; 5946 5947/** 5948 * Provides improved positioning for inline reference elements that can span 5949 * over multiple lines, such as hyperlinks or range selections. 5950 * @see https://floating-ui.com/docs/inline 5951 */ 5952const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1)); 5953 5954/** 5955 * Built-in `limiter` that will stop `shift()` at a certain point. 5956 */ 5957const floating_ui_dom_limitShift = (/* unused pure expression or super */ null && (limitShift$1)); 5958 5959/** 5960 * Computes the `x` and `y` coordinates that will place the floating element 5961 * next to a given reference element. 5962 */ 5963const floating_ui_dom_computePosition = (reference, floating, options) => { 5964 // This caches the expensive `getClippingElementAncestors` function so that 5965 // multiple lifecycle resets re-use the same result. It only lives for a 5966 // single call. If other functions become expensive, we can add them as well. 5967 const cache = new Map(); 5968 const mergedOptions = { 5969 platform, 5970 ...options 5971 }; 5972 const platformWithCache = { 5973 ...mergedOptions.platform, 5974 _c: cache 5975 }; 5976 return computePosition(reference, floating, { 5977 ...mergedOptions, 5978 platform: platformWithCache 5979 }); 5980}; 5981 5982 5983 5984;// ./node_modules/composed-offset-position/dist/composed-offset-position.browser.min.mjs 5985function composed_offset_position_browser_min_e(t){return composed_offset_position_browser_min_i(t)}function composed_offset_position_browser_min_n(t){return composed_offset_position_browser_min_f(t,"offsetTop")}function composed_offset_position_browser_min_o(t){return composed_offset_position_browser_min_f(t,"offsetLeft")}function composed_offset_position_browser_min_r(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function composed_offset_position_browser_min_i(e){for(let t=e;t;t=composed_offset_position_browser_min_r(t))if(t instanceof Element&&"none"===getComputedStyle(t).display)return null;for(let n=composed_offset_position_browser_min_r(e);n;n=composed_offset_position_browser_min_r(n)){if(!(n instanceof Element))continue;const e=getComputedStyle(n);if("contents"!==e.display){if("static"!==e.position||isContainingBlock(e))return n;if("BODY"===n.tagName)return n}}return null}function composed_offset_position_browser_min_f(t,e){let n=t[e],o=composed_offset_position_browser_min_i(t);const r=function(t){const e=new Set;let n=t.getRootNode();for(;n;)e.add(n),n=n.parentNode?n.parentNode.getRootNode():null;return e}(t);for(;o&&!r.has(o.getRootNode());)n-=o[e],o=composed_offset_position_browser_min_i(o);return n} 5986 5987;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5JY5FUCG.js 5988 5989 5990 5991 5992 5993
vendor: 13,822 bytes, lines 5994-6395
5994// src/components/popup/popup.component.ts 5995 5996 5997 5998 5999 6000function isVirtualElement(e) { 6001 return e !== null && typeof e === "object" && "getBoundingClientRect" in e && ("contextElement" in e ? e.contextElement instanceof Element : true); 6002} 6003var SlPopup = class extends ShoelaceElement { 6004 constructor() { 6005 super(...arguments); 6006 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 6007 this.active = false; 6008 this.placement = "top"; 6009 this.strategy = "absolute"; 6010 this.distance = 0; 6011 this.skidding = 0; 6012 this.arrow = false; 6013 this.arrowPlacement = "anchor"; 6014 this.arrowPadding = 10; 6015 this.flip = false; 6016 this.flipFallbackPlacements = ""; 6017 this.flipFallbackStrategy = "best-fit"; 6018 this.flipPadding = 0; 6019 this.shift = false; 6020 this.shiftPadding = 0; 6021 this.autoSizePadding = 0; 6022 this.hoverBridge = false; 6023 this.updateHoverBridge = () => { 6024 if (this.hoverBridge && this.anchorEl) { 6025 const anchorRect = this.anchorEl.getBoundingClientRect(); 6026 const popupRect = this.popup.getBoundingClientRect(); 6027 const isVertical = this.placement.includes("top") || this.placement.includes("bottom"); 6028 let topLeftX = 0; 6029 let topLeftY = 0; 6030 let topRightX = 0; 6031 let topRightY = 0; 6032 let bottomLeftX = 0; 6033 let bottomLeftY = 0; 6034 let bottomRightX = 0; 6035 let bottomRightY = 0; 6036 if (isVertical) { 6037 if (anchorRect.top < popupRect.top) { 6038 topLeftX = anchorRect.left; 6039 topLeftY = anchorRect.bottom; 6040 topRightX = anchorRect.right; 6041 topRightY = anchorRect.bottom; 6042 bottomLeftX = popupRect.left; 6043 bottomLeftY = popupRect.top; 6044 bottomRightX = popupRect.right; 6045 bottomRightY = popupRect.top; 6046 } else { 6047 topLeftX = popupRect.left; 6048 topLeftY = popupRect.bottom; 6049 topRightX = popupRect.right; 6050 topRightY = popupRect.bottom; 6051 bottomLeftX = anchorRect.left; 6052 bottomLeftY = anchorRect.top; 6053 bottomRightX = anchorRect.right; 6054 bottomRightY = anchorRect.top; 6055 } 6056 } else { 6057 if (anchorRect.left < popupRect.left) { 6058 topLeftX = anchorRect.right; 6059 topLeftY = anchorRect.top; 6060 topRightX = popupRect.left; 6061 topRightY = popupRect.top; 6062 bottomLeftX = anchorRect.right; 6063 bottomLeftY = anchorRect.bottom; 6064 bottomRightX = popupRect.left; 6065 bottomRightY = popupRect.bottom; 6066 } else { 6067 topLeftX = popupRect.right; 6068 topLeftY = popupRect.top; 6069 topRightX = anchorRect.left; 6070 topRightY = anchorRect.top; 6071 bottomLeftX = popupRect.right; 6072 bottomLeftY = popupRect.bottom; 6073 bottomRightX = anchorRect.left; 6074 bottomRightY = anchorRect.bottom; 6075 } 6076 } 6077 this.style.setProperty("--hover-bridge-top-left-x", `${topLeftX}px`); 6078 this.style.setProperty("--hover-bridge-top-left-y", `${topLeftY}px`); 6079 this.style.setProperty("--hover-bridge-top-right-x", `${topRightX}px`); 6080 this.style.setProperty("--hover-bridge-top-right-y", `${topRightY}px`); 6081 this.style.setProperty("--hover-bridge-bottom-left-x", `${bottomLeftX}px`); 6082 this.style.setProperty("--hover-bridge-bottom-left-y", `${bottomLeftY}px`); 6083 this.style.setProperty("--hover-bridge-bottom-right-x", `${bottomRightX}px`); 6084 this.style.setProperty("--hover-bridge-bottom-right-y", `${bottomRightY}px`); 6085 } 6086 }; 6087 } 6088 async connectedCallback() { 6089 super.connectedCallback(); 6090 await this.updateComplete; 6091 this.start(); 6092 } 6093 disconnectedCallback() { 6094 super.disconnectedCallback(); 6095 this.stop(); 6096 } 6097 async updated(changedProps) { 6098 super.updated(changedProps); 6099 if (changedProps.has("active")) { 6100 if (this.active) { 6101 this.start(); 6102 } else { 6103 this.stop(); 6104 } 6105 } 6106 if (changedProps.has("anchor")) { 6107 this.handleAnchorChange(); 6108 } 6109 if (this.active) { 6110 await this.updateComplete; 6111 this.reposition(); 6112 } 6113 } 6114 async handleAnchorChange() { 6115 await this.stop(); 6116 if (this.anchor && typeof this.anchor === "string") { 6117 const root = this.getRootNode(); 6118 this.anchorEl = root.getElementById(this.anchor); 6119 } else if (this.anchor instanceof Element || isVirtualElement(this.anchor)) { 6120 this.anchorEl = this.anchor; 6121 } else { 6122 this.anchorEl = this.querySelector('[slot="anchor"]'); 6123 } 6124 if (this.anchorEl instanceof HTMLSlotElement) { 6125 this.anchorEl = this.anchorEl.assignedElements({ flatten: true })[0]; 6126 } 6127 if (this.anchorEl && this.active) { 6128 this.start(); 6129 } 6130 } 6131 start() { 6132 if (!this.anchorEl || !this.active) { 6133 return; 6134 } 6135 this.cleanup = autoUpdate(this.anchorEl, this.popup, () => { 6136 this.reposition(); 6137 }); 6138 } 6139 async stop() { 6140 return new Promise((resolve) => { 6141 if (this.cleanup) { 6142 this.cleanup(); 6143 this.cleanup = void 0; 6144 this.removeAttribute("data-current-placement"); 6145 this.style.removeProperty("--auto-size-available-width"); 6146 this.style.removeProperty("--auto-size-available-height"); 6147 requestAnimationFrame(() => resolve()); 6148 } else { 6149 resolve(); 6150 } 6151 }); 6152 } 6153 /** Forces the popup to recalculate and reposition itself. */ 6154 reposition() { 6155 if (!this.active || !this.anchorEl) { 6156 return; 6157 } 6158 const middleware = [ 6159 // The offset middleware goes first 6160 floating_ui_dom_offset({ mainAxis: this.distance, crossAxis: this.skidding }) 6161 ]; 6162 if (this.sync) { 6163 middleware.push( 6164 floating_ui_dom_size({ 6165 apply: ({ rects }) => { 6166 const syncWidth = this.sync === "width" || this.sync === "both"; 6167 const syncHeight = this.sync === "height" || this.sync === "both"; 6168 this.popup.style.width = syncWidth ? `${rects.reference.width}px` : ""; 6169 this.popup.style.height = syncHeight ? `${rects.reference.height}px` : ""; 6170 } 6171 }) 6172 ); 6173 } else { 6174 this.popup.style.width = ""; 6175 this.popup.style.height = ""; 6176 } 6177 if (this.flip) { 6178 middleware.push( 6179 floating_ui_dom_flip({ 6180 boundary: this.flipBoundary, 6181 // @ts-expect-error - We're converting a string attribute to an array here 6182 fallbackPlacements: this.flipFallbackPlacements, 6183 fallbackStrategy: this.flipFallbackStrategy === "best-fit" ? "bestFit" : "initialPlacement", 6184 padding: this.flipPadding 6185 }) 6186 ); 6187 } 6188 if (this.shift) { 6189 middleware.push( 6190 floating_ui_dom_shift({ 6191 boundary: this.shiftBoundary, 6192 padding: this.shiftPadding 6193 }) 6194 ); 6195 } 6196 if (this.autoSize) { 6197 middleware.push( 6198 floating_ui_dom_size({ 6199 boundary: this.autoSizeBoundary, 6200 padding: this.autoSizePadding, 6201 apply: ({ availableWidth, availableHeight }) => { 6202 if (this.autoSize === "vertical" || this.autoSize === "both") { 6203 this.style.setProperty("--auto-size-available-height", `${availableHeight}px`); 6204 } else { 6205 this.style.removeProperty("--auto-size-available-height"); 6206 } 6207 if (this.autoSize === "horizontal" || this.autoSize === "both") { 6208 this.style.setProperty("--auto-size-available-width", `${availableWidth}px`); 6209 } else { 6210 this.style.removeProperty("--auto-size-available-width"); 6211 } 6212 } 6213 }) 6214 ); 6215 } else { 6216 this.style.removeProperty("--auto-size-available-width"); 6217 this.style.removeProperty("--auto-size-available-height"); 6218 } 6219 if (this.arrow) { 6220 middleware.push( 6221 floating_ui_dom_arrow({ 6222 element: this.arrowEl, 6223 padding: this.arrowPadding 6224 }) 6225 ); 6226 } 6227 const getOffsetParent = this.strategy === "absolute" ? (element) => platform.getOffsetParent(element, composed_offset_position_browser_min_e) : platform.getOffsetParent; 6228 floating_ui_dom_computePosition(this.anchorEl, this.popup, { 6229 placement: this.placement, 6230 middleware, 6231 strategy: this.strategy, 6232 platform: __spreadProps(__spreadValues({}, platform), { 6233 getOffsetParent 6234 }) 6235 }).then(({ x, y, middlewareData, placement }) => { 6236 const isRtl = this.localize.dir() === "rtl"; 6237 const staticSide = { top: "bottom", right: "left", bottom: "top", left: "right" }[placement.split("-")[0]]; 6238 this.setAttribute("data-current-placement", placement); 6239 Object.assign(this.popup.style, { 6240 left: `${x}px`, 6241 top: `${y}px` 6242 }); 6243 if (this.arrow) { 6244 const arrowX = middlewareData.arrow.x; 6245 const arrowY = middlewareData.arrow.y; 6246 let top = ""; 6247 let right = ""; 6248 let bottom = ""; 6249 let left = ""; 6250 if (this.arrowPlacement === "start") { 6251 const value = typeof arrowX === "number" ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : ""; 6252 top = typeof arrowY === "number" ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : ""; 6253 right = isRtl ? value : ""; 6254 left = isRtl ? "" : value; 6255 } else if (this.arrowPlacement === "end") { 6256 const value = typeof arrowX === "number" ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : ""; 6257 right = isRtl ? "" : value; 6258 left = isRtl ? value : ""; 6259 bottom = typeof arrowY === "number" ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : ""; 6260 } else if (this.arrowPlacement === "center") { 6261 left = typeof arrowX === "number" ? `calc(50% - var(--arrow-size-diagonal))` : ""; 6262 top = typeof arrowY === "number" ? `calc(50% - var(--arrow-size-diagonal))` : ""; 6263 } else { 6264 left = typeof arrowX === "number" ? `${arrowX}px` : ""; 6265 top = typeof arrowY === "number" ? `${arrowY}px` : ""; 6266 } 6267 Object.assign(this.arrowEl.style, { 6268 top, 6269 right, 6270 bottom, 6271 left, 6272 [staticSide]: "calc(var(--arrow-size-diagonal) * -1)" 6273 }); 6274 } 6275 }); 6276 requestAnimationFrame(() => this.updateHoverBridge()); 6277 this.emit("sl-reposition"); 6278 } 6279 render() { 6280 return x` 6281 <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot> 6282 6283 <span 6284 part="hover-bridge" 6285 class=${class_map_e({ 6286 "popup-hover-bridge": true, 6287 "popup-hover-bridge--visible": this.hoverBridge && this.active 6288 })} 6289 ></span> 6290 6291 <div 6292 part="popup" 6293 class=${class_map_e({ 6294 popup: true, 6295 "popup--active": this.active, 6296 "popup--fixed": this.strategy === "fixed", 6297 "popup--has-arrow": this.arrow 6298 })} 6299 > 6300 <slot></slot> 6301 ${this.arrow ? x`<div part="arrow" class="popup__arrow" role="presentation"></div>` : ""} 6302 </div> 6303 `; 6304 } 6305}; 6306SlPopup.styles = [component_styles_default, popup_styles_default]; 6307__decorateClass([ 6308 query_e(".popup") 6309], SlPopup.prototype, "popup", 2); 6310__decorateClass([ 6311 query_e(".popup__arrow") 6312], SlPopup.prototype, "arrowEl", 2); 6313__decorateClass([ 6314 property_n() 6315], SlPopup.prototype, "anchor", 2); 6316__decorateClass([ 6317 property_n({ type: Boolean, reflect: true }) 6318], SlPopup.prototype, "active", 2); 6319__decorateClass([ 6320 property_n({ reflect: true }) 6321], SlPopup.prototype, "placement", 2); 6322__decorateClass([ 6323 property_n({ reflect: true }) 6324], SlPopup.prototype, "strategy", 2); 6325__decorateClass([ 6326 property_n({ type: Number }) 6327], SlPopup.prototype, "distance", 2); 6328__decorateClass([ 6329 property_n({ type: Number }) 6330], SlPopup.prototype, "skidding", 2); 6331__decorateClass([ 6332 property_n({ type: Boolean }) 6333], SlPopup.prototype, "arrow", 2); 6334__decorateClass([ 6335 property_n({ attribute: "arrow-placement" }) 6336], SlPopup.prototype, "arrowPlacement", 2); 6337__decorateClass([ 6338 property_n({ attribute: "arrow-padding", type: Number }) 6339], SlPopup.prototype, "arrowPadding", 2); 6340__decorateClass([ 6341 property_n({ type: Boolean }) 6342], SlPopup.prototype, "flip", 2); 6343__decorateClass([ 6344 property_n({ 6345 attribute: "flip-fallback-placements", 6346 converter: { 6347 fromAttribute: (value) => { 6348 return value.split(" ").map((p) => p.trim()).filter((p) => p !== ""); 6349 }, 6350 toAttribute: (value) => { 6351 return value.join(" "); 6352 } 6353 } 6354 }) 6355], SlPopup.prototype, "flipFallbackPlacements", 2); 6356__decorateClass([ 6357 property_n({ attribute: "flip-fallback-strategy" }) 6358], SlPopup.prototype, "flipFallbackStrategy", 2); 6359__decorateClass([ 6360 property_n({ type: Object }) 6361], SlPopup.prototype, "flipBoundary", 2); 6362__decorateClass([ 6363 property_n({ attribute: "flip-padding", type: Number }) 6364], SlPopup.prototype, "flipPadding", 2); 6365__decorateClass([ 6366 property_n({ type: Boolean }) 6367], SlPopup.prototype, "shift", 2); 6368__decorateClass([ 6369 property_n({ type: Object }) 6370], SlPopup.prototype, "shiftBoundary", 2); 6371__decorateClass([ 6372 property_n({ attribute: "shift-padding", type: Number }) 6373], SlPopup.prototype, "shiftPadding", 2); 6374__decorateClass([ 6375 property_n({ attribute: "auto-size" }) 6376], SlPopup.prototype, "autoSize", 2); 6377__decorateClass([ 6378 property_n() 6379], SlPopup.prototype, "sync", 2); 6380__decorateClass([ 6381 property_n({ type: Object }) 6382], SlPopup.prototype, "autoSizeBoundary", 2); 6383__decorateClass([ 6384 property_n({ attribute: "auto-size-padding", type: Number }) 6385], SlPopup.prototype, "autoSizePadding", 2); 6386__decorateClass([ 6387 property_n({ attribute: "hover-bridge", type: Boolean }) 6388], SlPopup.prototype, "hoverBridge", 2); 6389 6390 6391 6392;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.XZNBUGX7.js 6393/* unused harmony import specifier */ var chunk_XZNBUGX7_SlPopup; 6394 6395
6396// src/components/popup/popup.ts 6397var popup_default = (/* unused pure expression or super */ null && (chunk_XZNBUGX7_SlPopup)); 6398SlPopup.define("sl-popup"); 6399 6400 6401 6402;// ./node_modules/@shoelace-style/shoelace/dist/components/popup/popup.js 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.FKMWLPHV.js
6414// src/components/radio/radio.styles.ts 6415 6416var radio_styles_default = i` 6417 :host { 6418 display: block; 6419 } 6420 6421 :host(:focus-visible) { 6422 outline: 0px; 6423 } 6424 6425 .radio { 6426 display: inline-flex; 6427 align-items: top; 6428 font-family: var(--sl-input-font-family); 6429 font-size: var(--sl-input-font-size-medium); 6430 font-weight: var(--sl-input-font-weight); 6431 color: var(--sl-input-label-color); 6432 vertical-align: middle; 6433 cursor: pointer; 6434 } 6435 6436 .radio--small { 6437 --toggle-size: var(--sl-toggle-size-small); 6438 font-size: var(--sl-input-font-size-small); 6439 } 6440 6441 .radio--medium { 6442 --toggle-size: var(--sl-toggle-size-medium); 6443 font-size: var(--sl-input-font-size-medium); 6444 } 6445 6446 .radio--large { 6447 --toggle-size: var(--sl-toggle-size-large); 6448 font-size: var(--sl-input-font-size-large); 6449 } 6450 6451 .radio__checked-icon { 6452 display: inline-flex; 6453 width: var(--toggle-size); 6454 height: var(--toggle-size); 6455 } 6456 6457 .radio__control { 6458 flex: 0 0 auto; 6459 position: relative; 6460 display: inline-flex; 6461 align-items: center; 6462 justify-content: center; 6463 width: var(--toggle-size); 6464 height: var(--toggle-size); 6465 border: solid var(--sl-input-border-width) var(--sl-input-border-color); 6466 border-radius: 50%; 6467 background-color: var(--sl-input-background-color); 6468 color: transparent; 6469 transition: 6470 var(--sl-transition-fast) border-color, 6471 var(--sl-transition-fast) background-color, 6472 var(--sl-transition-fast) color, 6473 var(--sl-transition-fast) box-shadow; 6474 } 6475 6476 .radio__input { 6477 position: absolute; 6478 opacity: 0; 6479 padding: 0; 6480 margin: 0; 6481 pointer-events: none; 6482 } 6483 6484 /* Hover */ 6485 .radio:not(.radio--checked):not(.radio--disabled) .radio__control:hover { 6486 border-color: var(--sl-input-border-color-hover); 6487 background-color: var(--sl-input-background-color-hover); 6488 } 6489 6490 /* Checked */ 6491 .radio--checked .radio__control { 6492 color: var(--sl-color-neutral-0); 6493 border-color: var(--sl-color-primary-600); 6494 background-color: var(--sl-color-primary-600); 6495 } 6496 6497 /* Checked + hover */ 6498 .radio.radio--checked:not(.radio--disabled) .radio__control:hover { 6499 border-color: var(--sl-color-primary-500); 6500 background-color: var(--sl-color-primary-500); 6501 } 6502 6503 /* Checked + focus */ 6504 :host(:focus-visible) .radio__control { 6505 outline: var(--sl-focus-ring); 6506 outline-offset: var(--sl-focus-ring-offset); 6507 } 6508 6509 /* Disabled */ 6510 .radio--disabled { 6511 opacity: 0.5; 6512 cursor: not-allowed; 6513 } 6514 6515 /* When the control isn't checked, hide the circle for Windows High Contrast mode a11y */ 6516 .radio:not(.radio--checked) svg circle { 6517 opacity: 0; 6518 } 6519 6520 .radio__label { 6521 display: inline-block; 6522 color: var(--sl-input-label-color); 6523 line-height: var(--toggle-size); 6524 margin-inline-start: 0.5em; 6525 user-select: none; 6526 -webkit-user-select: none; 6527 } 6528`; 6529 6530 6531 6532;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZSG32LO3.js 6533 6534 6535 6536 6537 6538 6539
vendor: 2,800 bytes, lines 6540-6636
6540// src/components/radio/radio.component.ts 6541 6542 6543 6544var SlRadio = class extends ShoelaceElement { 6545 constructor() { 6546 super(); 6547 this.checked = false; 6548 this.hasFocus = false; 6549 this.size = "medium"; 6550 this.disabled = false; 6551 this.handleBlur = () => { 6552 this.hasFocus = false; 6553 this.emit("sl-blur"); 6554 }; 6555 this.handleClick = () => { 6556 if (!this.disabled) { 6557 this.checked = true; 6558 } 6559 }; 6560 this.handleFocus = () => { 6561 this.hasFocus = true; 6562 this.emit("sl-focus"); 6563 }; 6564 this.addEventListener("blur", this.handleBlur); 6565 this.addEventListener("click", this.handleClick); 6566 this.addEventListener("focus", this.handleFocus); 6567 } 6568 connectedCallback() { 6569 super.connectedCallback(); 6570 this.setInitialAttributes(); 6571 } 6572 setInitialAttributes() { 6573 this.setAttribute("role", "radio"); 6574 this.setAttribute("tabindex", "-1"); 6575 this.setAttribute("aria-disabled", this.disabled ? "true" : "false"); 6576 } 6577 handleCheckedChange() { 6578 this.setAttribute("aria-checked", this.checked ? "true" : "false"); 6579 this.setAttribute("tabindex", this.checked ? "0" : "-1"); 6580 } 6581 handleDisabledChange() { 6582 this.setAttribute("aria-disabled", this.disabled ? "true" : "false"); 6583 } 6584 render() { 6585 return x` 6586 <span 6587 part="base" 6588 class=${class_map_e({ 6589 radio: true, 6590 "radio--checked": this.checked, 6591 "radio--disabled": this.disabled, 6592 "radio--focused": this.hasFocus, 6593 "radio--small": this.size === "small", 6594 "radio--medium": this.size === "medium", 6595 "radio--large": this.size === "large" 6596 })} 6597 > 6598 <span part="${`control${this.checked ? " control--checked" : ""}`}" class="radio__control"> 6599 ${this.checked ? x` <sl-icon part="checked-icon" class="radio__checked-icon" library="system" name="radio"></sl-icon> ` : ""} 6600 </span> 6601 6602 <slot part="label" class="radio__label"></slot> 6603 </span> 6604 `; 6605 } 6606}; 6607SlRadio.styles = [component_styles_default, radio_styles_default]; 6608SlRadio.dependencies = { "sl-icon": SlIcon }; 6609__decorateClass([ 6610 state_r() 6611], SlRadio.prototype, "checked", 2); 6612__decorateClass([ 6613 state_r() 6614], SlRadio.prototype, "hasFocus", 2); 6615__decorateClass([ 6616 property_n() 6617], SlRadio.prototype, "value", 2); 6618__decorateClass([ 6619 property_n({ reflect: true }) 6620], SlRadio.prototype, "size", 2); 6621__decorateClass([ 6622 property_n({ type: Boolean, reflect: true }) 6623], SlRadio.prototype, "disabled", 2); 6624__decorateClass([ 6625 watch("checked") 6626], SlRadio.prototype, "handleCheckedChange", 1); 6627__decorateClass([ 6628 watch("disabled", { waitUntilFirstUpdate: true }) 6629], SlRadio.prototype, "handleDisabledChange", 1); 6630 6631 6632 6633;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MSKEYBDI.js 6634/* unused harmony import specifier */ var chunk_MSKEYBDI_SlRadio; 6635 6636
6637// src/components/radio/radio.ts 6638var radio_default = (/* unused pure expression or super */ null && (chunk_MSKEYBDI_SlRadio)); 6639SlRadio.define("sl-radio"); 6640 6641 6642 6643;// ./node_modules/@shoelace-style/shoelace/dist/components/radio/radio.js 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.5D6IT2SR.js
6660// src/components/range/range.styles.ts 6661 6662var range_styles_default = i` 6663 :host { 6664 --thumb-size: 20px; 6665 --tooltip-offset: 10px; 6666 --track-color-active: var(--sl-color-neutral-200); 6667 --track-color-inactive: var(--sl-color-neutral-200); 6668 --track-active-offset: 0%; 6669 --track-height: 6px; 6670 6671 display: block; 6672 } 6673 6674 .range { 6675 position: relative; 6676 } 6677 6678 .range__control { 6679 --percent: 0%; 6680 -webkit-appearance: none; 6681 border-radius: 3px; 6682 width: 100%; 6683 height: var(--track-height); 6684 background: transparent; 6685 line-height: var(--sl-input-height-medium); 6686 vertical-align: middle; 6687 margin: 0; 6688 6689 background-image: linear-gradient( 6690 to right, 6691 var(--track-color-inactive) 0%, 6692 var(--track-color-inactive) min(var(--percent), var(--track-active-offset)), 6693 var(--track-color-active) min(var(--percent), var(--track-active-offset)), 6694 var(--track-color-active) max(var(--percent), var(--track-active-offset)), 6695 var(--track-color-inactive) max(var(--percent), var(--track-active-offset)), 6696 var(--track-color-inactive) 100% 6697 ); 6698 } 6699 6700 .range--rtl .range__control { 6701 background-image: linear-gradient( 6702 to left, 6703 var(--track-color-inactive) 0%, 6704 var(--track-color-inactive) min(var(--percent), var(--track-active-offset)), 6705 var(--track-color-active) min(var(--percent), var(--track-active-offset)), 6706 var(--track-color-active) max(var(--percent), var(--track-active-offset)), 6707 var(--track-color-inactive) max(var(--percent), var(--track-active-offset)), 6708 var(--track-color-inactive) 100% 6709 ); 6710 } 6711 6712 /* Webkit */ 6713 .range__control::-webkit-slider-runnable-track { 6714 width: 100%; 6715 height: var(--track-height); 6716 border-radius: 3px; 6717 border: none; 6718 } 6719 6720 .range__control::-webkit-slider-thumb { 6721 border: none; 6722 width: var(--thumb-size); 6723 height: var(--thumb-size); 6724 border-radius: 50%; 6725 background-color: var(--sl-color-primary-600); 6726 border: solid var(--sl-input-border-width) var(--sl-color-primary-600); 6727 -webkit-appearance: none; 6728 margin-top: calc(var(--thumb-size) / -2 + var(--track-height) / 2); 6729 cursor: pointer; 6730 } 6731 6732 .range__control:enabled::-webkit-slider-thumb:hover { 6733 background-color: var(--sl-color-primary-500); 6734 border-color: var(--sl-color-primary-500); 6735 } 6736 6737 .range__control:enabled:focus-visible::-webkit-slider-thumb { 6738 outline: var(--sl-focus-ring); 6739 outline-offset: var(--sl-focus-ring-offset); 6740 } 6741 6742 .range__control:enabled::-webkit-slider-thumb:active { 6743 background-color: var(--sl-color-primary-500); 6744 border-color: var(--sl-color-primary-500); 6745 cursor: grabbing; 6746 } 6747 6748 /* Firefox */ 6749 .range__control::-moz-focus-outer { 6750 border: 0; 6751 } 6752 6753 .range__control::-moz-range-progress { 6754 background-color: var(--track-color-active); 6755 border-radius: 3px; 6756 height: var(--track-height); 6757 } 6758 6759 .range__control::-moz-range-track { 6760 width: 100%; 6761 height: var(--track-height); 6762 background-color: var(--track-color-inactive); 6763 border-radius: 3px; 6764 border: none; 6765 } 6766 6767 .range__control::-moz-range-thumb { 6768 border: none; 6769 height: var(--thumb-size); 6770 width: var(--thumb-size); 6771 border-radius: 50%; 6772 background-color: var(--sl-color-primary-600); 6773 border-color: var(--sl-color-primary-600); 6774 transition: 6775 var(--sl-transition-fast) border-color, 6776 var(--sl-transition-fast) background-color, 6777 var(--sl-transition-fast) color, 6778 var(--sl-transition-fast) box-shadow; 6779 cursor: pointer; 6780 } 6781 6782 .range__control:enabled::-moz-range-thumb:hover { 6783 background-color: var(--sl-color-primary-500); 6784 border-color: var(--sl-color-primary-500); 6785 } 6786 6787 .range__control:enabled:focus-visible::-moz-range-thumb { 6788 outline: var(--sl-focus-ring); 6789 outline-offset: var(--sl-focus-ring-offset); 6790 } 6791 6792 .range__control:enabled::-moz-range-thumb:active { 6793 background-color: var(--sl-color-primary-500); 6794 border-color: var(--sl-color-primary-500); 6795 cursor: grabbing; 6796 } 6797 6798 /* States */ 6799 .range__control:focus-visible { 6800 outline: none; 6801 } 6802 6803 .range__control:disabled { 6804 opacity: 0.5; 6805 } 6806 6807 .range__control:disabled::-webkit-slider-thumb {
6808 cursor: not-allowed; 6809 } 6810 6811 .range__control:disabled::-moz-range-thumb { 6812 cursor: not-allowed; 6813 } 6814 6815 /* Tooltip output */ 6816 .range__tooltip { 6817 position: absolute; 6818 z-index: var(--sl-z-index-tooltip); 6819 left: 0; 6820 border-radius: var(--sl-tooltip-border-radius); 6821 background-color: var(--sl-tooltip-background-color); 6822 font-family: var(--sl-tooltip-font-family); 6823 font-size: var(--sl-tooltip-font-size); 6824 font-weight: var(--sl-tooltip-font-weight); 6825 line-height: var(--sl-tooltip-line-height); 6826 color: var(--sl-tooltip-color); 6827 opacity: 0; 6828 padding: var(--sl-tooltip-padding); 6829 transition: var(--sl-transition-fast) opacity; 6830 pointer-events: none; 6831 } 6832 6833 .range__tooltip:after { 6834 content: ''; 6835 position: absolute; 6836 width: 0; 6837 height: 0; 6838 left: 50%; 6839 translate: calc(-1 * var(--sl-tooltip-arrow-size)); 6840 } 6841 6842 .range--tooltip-visible .range__tooltip { 6843 opacity: 1; 6844 } 6845 6846 /* Tooltip on top */ 6847 .range--tooltip-top .range__tooltip { 6848 top: calc(-1 * var(--thumb-size) - var(--tooltip-offset)); 6849 } 6850 6851 .range--tooltip-top .range__tooltip:after { 6852 border-top: var(--sl-tooltip-arrow-size) solid var(--sl-tooltip-background-color); 6853 border-left: var(--sl-tooltip-arrow-size) solid transparent; 6854 border-right: var(--sl-tooltip-arrow-size) solid transparent; 6855 top: 100%; 6856 } 6857 6858 /* Tooltip on bottom */ 6859 .range--tooltip-bottom .range__tooltip { 6860 bottom: calc(-1 * var(--thumb-size) - var(--tooltip-offset)); 6861 } 6862 6863 .range--tooltip-bottom .range__tooltip:after { 6864 border-bottom: var(--sl-tooltip-arrow-size) solid var(--sl-tooltip-background-color); 6865 border-left: var(--sl-tooltip-arrow-size) solid transparent; 6866 border-right: var(--sl-tooltip-arrow-size) solid transparent; 6867 bottom: 100%; 6868 } 6869 6870 @media (forced-colors: active) { 6871 .range__control, 6872 .range__tooltip { 6873 border: solid 1px transparent; 6874 } 6875 6876 .range__control::-webkit-slider-thumb { 6877 border: solid 1px transparent; 6878 } 6879 6880 .range__control::-moz-range-thumb { 6881 border: solid 1px transparent; 6882 } 6883 6884 .range__tooltip:after { 6885 display: none; 6886 } 6887 } 6888`; 6889 6890 6891 6892;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HRYVEIKV.js 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903
vendor: 4,485 bytes, lines 6904-7052
6904// src/components/range/range.component.ts 6905 6906 6907 6908 6909 6910var SlRange = class extends ShoelaceElement { 6911 constructor() { 6912 super(...arguments); 6913 this.formControlController = new FormControlController(this); 6914 this.hasSlotController = new HasSlotController(this, "help-text", "label"); 6915 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 6916 this.hasFocus = false; 6917 this.hasTooltip = false; 6918 this.title = ""; 6919 this.name = ""; 6920 this.value = 0; 6921 this.label = ""; 6922 this.helpText = ""; 6923 this.disabled = false; 6924 this.min = 0; 6925 this.max = 100; 6926 this.step = 1; 6927 this.tooltip = "top"; 6928 this.tooltipFormatter = (value) => value.toString(); 6929 this.form = ""; 6930 this.defaultValue = 0; 6931 } 6932 /** Gets the validity state object */ 6933 get validity() { 6934 return this.input.validity; 6935 } 6936 /** Gets the validation message */ 6937 get validationMessage() { 6938 return this.input.validationMessage; 6939 } 6940 connectedCallback() { 6941 super.connectedCallback(); 6942 this.resizeObserver = new ResizeObserver(() => this.syncRange()); 6943 if (this.value < this.min) { 6944 this.value = this.min; 6945 } 6946 if (this.value > this.max) { 6947 this.value = this.max; 6948 } 6949 this.updateComplete.then(() => { 6950 this.syncRange(); 6951 this.resizeObserver.observe(this.input); 6952 }); 6953 } 6954 disconnectedCallback() { 6955 var _a; 6956 super.disconnectedCallback(); 6957 (_a = this.resizeObserver) == null ? void 0 : _a.unobserve(this.input); 6958 } 6959 handleChange() { 6960 this.emit("sl-change"); 6961 } 6962 handleInput() { 6963 this.value = parseFloat(this.input.value); 6964 this.emit("sl-input"); 6965 this.syncRange(); 6966 } 6967 handleBlur() { 6968 this.hasFocus = false; 6969 this.hasTooltip = false; 6970 this.emit("sl-blur"); 6971 } 6972 handleFocus() { 6973 this.hasFocus = true; 6974 this.hasTooltip = true; 6975 this.emit("sl-focus"); 6976 } 6977 handleThumbDragStart() { 6978 this.hasTooltip = true; 6979 } 6980 handleThumbDragEnd() { 6981 this.hasTooltip = false; 6982 } 6983 syncProgress(percent) { 6984 this.input.style.setProperty("--percent", `${percent * 100}%`); 6985 } 6986 syncTooltip(percent) { 6987 if (this.output !== null) { 6988 const inputWidth = this.input.offsetWidth; 6989 const tooltipWidth = this.output.offsetWidth; 6990 const thumbSize = getComputedStyle(this.input).getPropertyValue("--thumb-size"); 6991 const isRtl = this.localize.dir() === "rtl"; 6992 const percentAsWidth = inputWidth * percent; 6993 if (isRtl) { 6994 const x = `${inputWidth - percentAsWidth}px + ${percent} * ${thumbSize}`; 6995 this.output.style.translate = `calc((${x} - ${tooltipWidth / 2}px - ${thumbSize} / 2))`; 6996 } else { 6997 const x = `${percentAsWidth}px - ${percent} * ${thumbSize}`; 6998 this.output.style.translate = `calc(${x} - ${tooltipWidth / 2}px + ${thumbSize} / 2)`; 6999 } 7000 } 7001 } 7002 handleValueChange() { 7003 this.formControlController.updateValidity(); 7004 this.input.value = this.value.toString(); 7005 this.value = parseFloat(this.input.value); 7006 this.syncRange(); 7007 } 7008 handleDisabledChange() { 7009 this.formControlController.setValidity(this.disabled); 7010 } 7011 syncRange() { 7012 const percent = Math.max(0, (this.value - this.min) / (this.max - this.min)); 7013 this.syncProgress(percent); 7014 if (this.tooltip !== "none" && this.hasTooltip) { 7015 this.updateComplete.then(() => this.syncTooltip(percent)); 7016 } 7017 } 7018 handleInvalid(event) { 7019 this.formControlController.setValidity(false); 7020 this.formControlController.emitInvalidEvent(event); 7021 } 7022 /** Sets focus on the range. */ 7023 focus(options) { 7024 this.input.focus(options); 7025 } 7026 /** Removes focus from the range. */ 7027 blur() { 7028 this.input.blur(); 7029 } 7030 /** Increments the value of the range by the value of the step attribute. */ 7031 stepUp() { 7032 this.input.stepUp(); 7033 if (this.value !== Number(this.input.value)) { 7034 this.value = Number(this.input.value); 7035 } 7036 } 7037 /** Decrements the value of the range by the value of the step attribute. */ 7038 stepDown() { 7039 this.input.stepDown(); 7040 if (this.value !== Number(this.input.value)) { 7041 this.value = Number(this.input.value); 7042 } 7043 } 7044 /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ 7045 checkValidity() { 7046 return this.input.checkValidity(); 7047 } 7048 /** Gets the associated form, if one exists. */ 7049 getForm() { 7050 return this.formControlController.getForm(); 7051 } 7052 /** Checks for validity and shows the browser's validation message if the control is invali
7052d. */ 7053 reportValidity() { 7054 return this.input.reportValidity(); 7055 } 7056 /** Sets a custom validation message. Pass an empty string to restore validity. */ 7057 setCustomValidity(message) { 7058 this.input.setCustomValidity(message); 7059 this.formControlController.updateValidity(); 7060 } 7061 render() { 7062 const hasLabelSlot = this.hasSlotController.test("label"); 7063 const hasHelpTextSlot = this.hasSlotController.test("help-text"); 7064 const hasLabel = this.label ? true : !!hasLabelSlot; 7065 const hasHelpText = this.helpText ? true : !!hasHelpTextSlot; 7066 return x` 7067 <div 7068 part="form-control" 7069 class=${class_map_e({ 7070 "form-control": true, 7071 "form-control--medium": true, 7072 // range only has one size 7073 "form-control--has-label": hasLabel, 7074 "form-control--has-help-text": hasHelpText 7075 })} 7076 > 7077 <label 7078 part="form-control-label" 7079 class="form-control__label" 7080 for="input" 7081 aria-hidden=${hasLabel ? "false" : "true"} 7082 > 7083 <slot name="label">${this.label}</slot> 7084 </label> 7085 7086 <div part="form-control-input" class="form-control-input"> 7087 <div 7088 part="base" 7089 class=${class_map_e({ 7090 range: true, 7091 "range--disabled": this.disabled, 7092 "range--focused": this.hasFocus, 7093 "range--rtl": this.localize.dir() === "rtl", 7094 "range--tooltip-visible": this.hasTooltip, 7095 "range--tooltip-top": this.tooltip === "top", 7096 "range--tooltip-bottom": this.tooltip === "bottom" 7097 })} 7098 @mousedown=${this.handleThumbDragStart} 7099 @mouseup=${this.handleThumbDragEnd} 7100 @touchstart=${this.handleThumbDragStart} 7101 @touchend=${this.handleThumbDragEnd} 7102 > 7103 <input 7104 part="input" 7105 id="input" 7106 class="range__control" 7107 title=${this.title} 7108 type="range" 7109 name=${if_defined_o(this.name)} 7110 ?disabled=${this.disabled} 7111 min=${if_defined_o(this.min)} 7112 max=${if_defined_o(this.max)} 7113 step=${if_defined_o(this.step)} 7114 .value=${live_l(this.value.toString())} 7115 aria-describedby="help-text" 7116 @change=${this.handleChange} 7117 @focus=${this.handleFocus} 7118 @input=${this.handleInput} 7119 @invalid=${this.handleInvalid} 7120 @blur=${this.handleBlur} 7121 /> 7122 ${this.tooltip !== "none" && !this.disabled ? x` 7123 <output part="tooltip" class="range__tooltip"> 7124 ${typeof this.tooltipFormatter === "function" ? this.tooltipFormatter(this.value) : this.value} 7125 </output> 7126 ` : ""} 7127 </div> 7128 </div> 7129 7130 <div 7131 part="form-control-help-text" 7132 id="help-text" 7133 class="form-control__help-text" 7134 aria-hidden=${hasHelpText ? "false" : "true"} 7135 > 7136 <slot name="help-text">${this.helpText}</slot> 7137 </div> 7138 </div> 7139 `; 7140 } 7141}; 7142SlRange.styles = [component_styles_default, form_control_styles_default, range_styles_default]; 7143__decorateClass([ 7144 query_e(".range__control") 7145], SlRange.prototype, "input", 2); 7146__decorateClass([ 7147 query_e(".range__tooltip") 7148], SlRange.prototype, "output", 2); 7149__decorateClass([ 7150 state_r() 7151], SlRange.prototype, "hasFocus", 2); 7152__decorateClass([ 7153 state_r() 7154], SlRange.prototype, "hasTooltip", 2); 7155__decorateClass([ 7156 property_n() 7157], SlRange.prototype, "title", 2); 7158__decorateClass([ 7159 property_n() 7160], SlRange.prototype, "name", 2); 7161__decorateClass([ 7162 property_n({ type: Number }) 7163], SlRange.prototype, "value", 2); 7164__decorateClass([ 7165 property_n() 7166], SlRange.prototype, "label", 2); 7167__decorateClass([ 7168 property_n({ attribute: "help-text" }) 7169], SlRange.prototype, "helpText", 2); 7170__decorateClass([ 7171 property_n({ type: Boolean, reflect: true }) 7172], SlRange.prototype, "disabled", 2); 7173__decorateClass([ 7174 property_n({ type: Number }) 7175], SlRange.prototype, "min", 2); 7176__decorateClass([ 7177 property_n({ type: Number }) 7178], SlRange.prototype, "max", 2); 7179__decorateClass([
7180 property_n({ type: Number }) 7181], SlRange.prototype, "step", 2); 7182__decorateClass([ 7183 property_n() 7184], SlRange.prototype, "tooltip", 2); 7185__decorateClass([ 7186 property_n({ attribute: false }) 7187], SlRange.prototype, "tooltipFormatter", 2); 7188__decorateClass([ 7189 property_n({ reflect: true }) 7190], SlRange.prototype, "form", 2); 7191__decorateClass([ 7192 defaultValue() 7193], SlRange.prototype, "defaultValue", 2); 7194__decorateClass([ 7195 event_options_t({ passive: true }) 7196], SlRange.prototype, "handleThumbDragStart", 1); 7197__decorateClass([ 7198 watch("value", { waitUntilFirstUpdate: true }) 7199], SlRange.prototype, "handleValueChange", 1); 7200__decorateClass([ 7201 watch("disabled", { waitUntilFirstUpdate: true }) 7202], SlRange.prototype, "handleDisabledChange", 1); 7203__decorateClass([ 7204 watch("hasTooltip", { waitUntilFirstUpdate: true }) 7205], SlRange.prototype, "syncRange", 1); 7206 7207 7208 7209;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.CKH4GVK3.js 7210/* unused harmony import specifier */ var chunk_CKH4GVK3_SlRange; 7211 7212
7213// src/components/range/range.ts 7214var range_default = (/* unused pure expression or super */ null && (chunk_CKH4GVK3_SlRange)); 7215SlRange.define("sl-range"); 7216 7217 7218 7219;// ./node_modules/@shoelace-style/shoelace/dist/components/range/range.js 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EA437WHD.js 7236/* unused harmony import specifier */ var chunk_EA437WHD_SlSpinner; 7237 7238
7239// src/components/spinner/spinner.ts 7240var spinner_default = (/* unused pure expression or super */ null && (chunk_EA437WHD_SlSpinner)); 7241SlSpinner.define("sl-spinner"); 7242 7243 7244 7245;// ./node_modules/@shoelace-style/shoelace/dist/components/spinner/spinner.js 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.EU44RQUN.js
7257// src/components/switch/switch.styles.ts 7258 7259var switch_styles_default = i` 7260 :host { 7261 display: inline-block; 7262 } 7263 7264 :host([size='small']) { 7265 --height: var(--sl-toggle-size-small); 7266 --thumb-size: calc(var(--sl-toggle-size-small) + 4px); 7267 --width: calc(var(--height) * 2); 7268 7269 font-size: var(--sl-input-font-size-small); 7270 } 7271 7272 :host([size='medium']) { 7273 --height: var(--sl-toggle-size-medium); 7274 --thumb-size: calc(var(--sl-toggle-size-medium) + 4px); 7275 --width: calc(var(--height) * 2); 7276 7277 font-size: var(--sl-input-font-size-medium); 7278 } 7279 7280 :host([size='large']) { 7281 --height: var(--sl-toggle-size-large); 7282 --thumb-size: calc(var(--sl-toggle-size-large) + 4px); 7283 --width: calc(var(--height) * 2); 7284 7285 font-size: var(--sl-input-font-size-large); 7286 } 7287 7288 .switch { 7289 position: relative; 7290 display: inline-flex; 7291 align-items: center; 7292 font-family: var(--sl-input-font-family); 7293 font-size: inherit; 7294 font-weight: var(--sl-input-font-weight); 7295 color: var(--sl-input-label-color); 7296 vertical-align: middle; 7297 cursor: pointer; 7298 } 7299 7300 .switch__control { 7301 flex: 0 0 auto; 7302 position: relative; 7303 display: inline-flex; 7304 align-items: center; 7305 justify-content: center; 7306 width: var(--width); 7307 height: var(--height); 7308 background-color: var(--sl-color-neutral-400); 7309 border: solid var(--sl-input-border-width) var(--sl-color-neutral-400); 7310 border-radius: var(--height); 7311 transition: 7312 var(--sl-transition-fast) border-color, 7313 var(--sl-transition-fast) background-color; 7314 } 7315 7316 .switch__control .switch__thumb { 7317 width: var(--thumb-size); 7318 height: var(--thumb-size); 7319 background-color: var(--sl-color-neutral-0); 7320 border-radius: 50%; 7321 border: solid var(--sl-input-border-width) var(--sl-color-neutral-400); 7322 translate: calc((var(--width) - var(--height)) / -2); 7323 transition: 7324 var(--sl-transition-fast) translate ease, 7325 var(--sl-transition-fast) background-color, 7326 var(--sl-transition-fast) border-color, 7327 var(--sl-transition-fast) box-shadow; 7328 } 7329 7330 .switch__input { 7331 position: absolute; 7332 opacity: 0; 7333 padding: 0; 7334 margin: 0; 7335 pointer-events: none; 7336 } 7337 7338 /* Hover */ 7339 .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover { 7340 background-color: var(--sl-color-neutral-400); 7341 border-color: var(--sl-color-neutral-400); 7342 } 7343 7344 .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb { 7345 background-color: var(--sl-color-neutral-0); 7346 border-color: var(--sl-color-neutral-400); 7347 } 7348 7349 /* Focus */ 7350 .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control { 7351 background-color: var(--sl-color-neutral-400); 7352 border-color: var(--sl-color-neutral-400); 7353 } 7354 7355 .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb { 7356 background-color: var(--sl-color-neutral-0); 7357 border-color: var(--sl-color-primary-600); 7358 outline: var(--sl-focus-ring); 7359 outline-offset: var(--sl-focus-ring-offset); 7360 } 7361 7362 /* Checked */ 7363 .switch--checked .switch__control { 7364 background-color: var(--sl-color-primary-600); 7365 border-color: var(--sl-color-primary-600); 7366 } 7367 7368 .switch--checked .switch__control .switch__thumb { 7369 background-color: var(--sl-color-neutral-0); 7370 border-color: var(--sl-color-primary-600); 7371 translate: calc((var(--width) - var(--height)) / 2); 7372 } 7373 7374 /* Checked + hover */ 7375 .switch.switch--checked:not(.switch--disabled) .switch__control:hover { 7376 background-color: var(--sl-color-primary-600); 7377 border-color: var(--sl-color-primary-600); 7378 } 7379 7380 .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb { 7381 background-color: var(--sl-color-neutral-0); 7382 border-color: var(--sl-color-primary-600); 7383 } 7384 7385 /* Checked + focus */ 7386 .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control { 7387 background-color: var(--sl-color-primary-600); 7388 border-color: var(--sl-color-primary-600); 7389 } 7390 7391 .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb { 7392 background-color: var(--sl-color-neutral-0); 7393 border-color: var(--sl-color-primary-600); 7394 outline: var(--sl-focus-ring); 7395 outline-offset: var(--sl-focus-ring-offset); 7396 } 7397 7398 /* Disabled */ 7399 .switch--disabled { 7400 opacity: 0.5;
7401 cursor: not-allowed; 7402 } 7403 7404 .switch__label { 7405 display: inline-block; 7406 line-height: var(--height); 7407 margin-inline-start: 0.5em; 7408 user-select: none; 7409 -webkit-user-select: none; 7410 } 7411 7412 :host([required]) .switch__label::after { 7413 content: var(--sl-input-required-content); 7414 color: var(--sl-input-required-content-color); 7415 margin-inline-start: var(--sl-input-required-content-offset); 7416 } 7417 7418 @media (forced-colors: active) { 7419 .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb, 7420 .switch--checked .switch__control .switch__thumb { 7421 background-color: ButtonText; 7422 } 7423 } 7424`; 7425 7426 7427 7428;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TSAI7XEG.js 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438
vendor: 4,204 bytes, lines 7439-7582
7439// src/components/switch/switch.component.ts 7440 7441 7442 7443 7444 7445var SlSwitch = class extends ShoelaceElement { 7446 constructor() { 7447 super(...arguments); 7448 this.formControlController = new FormControlController(this, { 7449 value: (control) => control.checked ? control.value || "on" : void 0, 7450 defaultValue: (control) => control.defaultChecked, 7451 setValue: (control, checked) => control.checked = checked 7452 }); 7453 this.hasSlotController = new HasSlotController(this, "help-text"); 7454 this.hasFocus = false; 7455 this.title = ""; 7456 this.name = ""; 7457 this.size = "medium"; 7458 this.disabled = false; 7459 this.checked = false; 7460 this.defaultChecked = false; 7461 this.form = ""; 7462 this.required = false; 7463 this.helpText = ""; 7464 } 7465 /** Gets the validity state object */ 7466 get validity() { 7467 return this.input.validity; 7468 } 7469 /** Gets the validation message */ 7470 get validationMessage() { 7471 return this.input.validationMessage; 7472 } 7473 firstUpdated() { 7474 this.formControlController.updateValidity(); 7475 } 7476 handleBlur() { 7477 this.hasFocus = false; 7478 this.emit("sl-blur"); 7479 } 7480 handleInput() { 7481 this.emit("sl-input"); 7482 } 7483 handleInvalid(event) { 7484 this.formControlController.setValidity(false); 7485 this.formControlController.emitInvalidEvent(event); 7486 } 7487 handleClick() { 7488 this.checked = !this.checked; 7489 this.emit("sl-change"); 7490 } 7491 handleFocus() { 7492 this.hasFocus = true; 7493 this.emit("sl-focus"); 7494 } 7495 handleKeyDown(event) { 7496 if (event.key === "ArrowLeft") { 7497 event.preventDefault(); 7498 this.checked = false; 7499 this.emit("sl-change"); 7500 this.emit("sl-input"); 7501 } 7502 if (event.key === "ArrowRight") { 7503 event.preventDefault(); 7504 this.checked = true; 7505 this.emit("sl-change"); 7506 this.emit("sl-input"); 7507 } 7508 } 7509 handleCheckedChange() { 7510 this.input.checked = this.checked; 7511 this.formControlController.updateValidity(); 7512 } 7513 handleDisabledChange() { 7514 this.formControlController.setValidity(true); 7515 } 7516 /** Simulates a click on the switch. */ 7517 click() { 7518 this.input.click(); 7519 } 7520 /** Sets focus on the switch. */ 7521 focus(options) { 7522 this.input.focus(options); 7523 } 7524 /** Removes focus from the switch. */ 7525 blur() { 7526 this.input.blur(); 7527 } 7528 /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ 7529 checkValidity() { 7530 return this.input.checkValidity(); 7531 } 7532 /** Gets the associated form, if one exists. */ 7533 getForm() { 7534 return this.formControlController.getForm(); 7535 } 7536 /** Checks for validity and shows the browser's validation message if the control is invalid. */ 7537 reportValidity() { 7538 return this.input.reportValidity(); 7539 } 7540 /** Sets a custom validation message. Pass an empty string to restore validity. */ 7541 setCustomValidity(message) { 7542 this.input.setCustomValidity(message); 7543 this.formControlController.updateValidity(); 7544 } 7545 render() { 7546 const hasHelpTextSlot = this.hasSlotController.test("help-text"); 7547 const hasHelpText = this.helpText ? true : !!hasHelpTextSlot; 7548 return x` 7549 <div 7550 class=${class_map_e({ 7551 "form-control": true, 7552 "form-control--small": this.size === "small", 7553 "form-control--medium": this.size === "medium", 7554 "form-control--large": this.size === "large", 7555 "form-control--has-help-text": hasHelpText 7556 })} 7557 > 7558 <label 7559 part="base" 7560 class=${class_map_e({ 7561 switch: true, 7562 "switch--checked": this.checked, 7563 "switch--disabled": this.disabled, 7564 "switch--focused": this.hasFocus, 7565 "switch--small": this.size === "small", 7566 "switch--medium": this.size === "medium", 7567 "switch--large": this.size === "large" 7568 })} 7569 > 7570 <input 7571 class="switch__input" 7572 type="checkbox" 7573 title=${this.title} 7574 name=${this.name} 7575 value=${if_defined_o(this.value)} 7576 .checked=${live_l(this.checked)} 7577 .disabled=${this.disabled} 7578 .required=${this.required} 7579 role="switch" 7580 aria-checked=${this.checked ? "true" : "false"} 7581 aria-describedby="help-text" 7582 @click=${this.handleClick}
7583 @input=${this.handleInput} 7584 @invalid=${this.handleInvalid} 7585 @blur=${this.handleBlur} 7586 @focus=${this.handleFocus} 7587 @keydown=${this.handleKeyDown} 7588 /> 7589 7590 <span part="control" class="switch__control"> 7591 <span part="thumb" class="switch__thumb"></span> 7592 </span> 7593 7594 <div part="label" class="switch__label"> 7595 <slot></slot> 7596 </div> 7597 </label> 7598 7599 <div 7600 aria-hidden=${hasHelpText ? "false" : "true"} 7601 class="form-control__help-text" 7602 id="help-text" 7603 part="form-control-help-text" 7604 > 7605 <slot name="help-text">${this.helpText}</slot> 7606 </div> 7607 </div> 7608 `; 7609 } 7610}; 7611SlSwitch.styles = [component_styles_default, form_control_styles_default, switch_styles_default]; 7612__decorateClass([ 7613 query_e('input[type="checkbox"]') 7614], SlSwitch.prototype, "input", 2); 7615__decorateClass([ 7616 state_r() 7617], SlSwitch.prototype, "hasFocus", 2); 7618__decorateClass([ 7619 property_n() 7620], SlSwitch.prototype, "title", 2); 7621__decorateClass([ 7622 property_n() 7623], SlSwitch.prototype, "name", 2); 7624__decorateClass([ 7625 property_n() 7626], SlSwitch.prototype, "value", 2); 7627__decorateClass([ 7628 property_n({ reflect: true }) 7629], SlSwitch.prototype, "size", 2); 7630__decorateClass([ 7631 property_n({ type: Boolean, reflect: true }) 7632], SlSwitch.prototype, "disabled", 2); 7633__decorateClass([ 7634 property_n({ type: Boolean, reflect: true }) 7635], SlSwitch.prototype, "checked", 2); 7636__decorateClass([ 7637 defaultValue("checked") 7638], SlSwitch.prototype, "defaultChecked", 2); 7639__decorateClass([ 7640 property_n({ reflect: true }) 7641], SlSwitch.prototype, "form", 2); 7642__decorateClass([ 7643 property_n({ type: Boolean, reflect: true }) 7644], SlSwitch.prototype, "required", 2); 7645__decorateClass([ 7646 property_n({ attribute: "help-text" }) 7647], SlSwitch.prototype, "helpText", 2); 7648__decorateClass([ 7649 watch("checked", { waitUntilFirstUpdate: true }) 7650], SlSwitch.prototype, "handleCheckedChange", 1); 7651__decorateClass([ 7652 watch("disabled", { waitUntilFirstUpdate: true }) 7653], SlSwitch.prototype, "handleDisabledChange", 1); 7654 7655 7656 7657;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.IADS735N.js 7658/* unused harmony import specifier */ var chunk_IADS735N_SlSwitch; 7659 7660
7661// src/components/switch/switch.ts 7662var switch_default = (/* unused pure expression or super */ null && (chunk_IADS735N_SlSwitch)); 7663SlSwitch.define("sl-switch"); 7664 7665 7666 7667;// ./node_modules/@shoelace-style/shoelace/dist/components/switch/switch.js 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.V2OL7VMD.js
7682// src/components/tag/tag.styles.ts 7683 7684var tag_styles_default = i` 7685 :host { 7686 display: inline-block; 7687 } 7688 7689 .tag { 7690 display: flex; 7691 align-items: center; 7692 border: solid 1px; 7693 line-height: 1; 7694 white-space: nowrap; 7695 user-select: none; 7696 -webkit-user-select: none; 7697 } 7698 7699 .tag__remove::part(base) { 7700 color: inherit; 7701 padding: 0; 7702 } 7703 7704 /* 7705 * Variant modifiers 7706 */ 7707 7708 .tag--primary { 7709 background-color: var(--sl-color-primary-50); 7710 border-color: var(--sl-color-primary-200); 7711 color: var(--sl-color-primary-800); 7712 } 7713 7714 .tag--primary:active > sl-icon-button { 7715 color: var(--sl-color-primary-600); 7716 } 7717 7718 .tag--success { 7719 background-color: var(--sl-color-success-50); 7720 border-color: var(--sl-color-success-200); 7721 color: var(--sl-color-success-800); 7722 } 7723 7724 .tag--success:active > sl-icon-button { 7725 color: var(--sl-color-success-600); 7726 } 7727 7728 .tag--neutral { 7729 background-color: var(--sl-color-neutral-50); 7730 border-color: var(--sl-color-neutral-200); 7731 color: var(--sl-color-neutral-800); 7732 } 7733 7734 .tag--neutral:active > sl-icon-button { 7735 color: var(--sl-color-neutral-600); 7736 } 7737 7738 .tag--warning { 7739 background-color: var(--sl-color-warning-50); 7740 border-color: var(--sl-color-warning-200); 7741 color: var(--sl-color-warning-800); 7742 } 7743 7744 .tag--warning:active > sl-icon-button { 7745 color: var(--sl-color-warning-600); 7746 } 7747 7748 .tag--danger { 7749 background-color: var(--sl-color-danger-50); 7750 border-color: var(--sl-color-danger-200); 7751 color: var(--sl-color-danger-800); 7752 } 7753 7754 .tag--danger:active > sl-icon-button { 7755 color: var(--sl-color-danger-600); 7756 } 7757 7758 /* 7759 * Size modifiers 7760 */ 7761 7762 .tag--small { 7763 font-size: var(--sl-button-font-size-small); 7764 height: calc(var(--sl-input-height-small) * 0.8); 7765 line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2); 7766 border-radius: var(--sl-input-border-radius-small); 7767 padding: 0 var(--sl-spacing-x-small); 7768 } 7769 7770 .tag--medium { 7771 font-size: var(--sl-button-font-size-medium); 7772 height: calc(var(--sl-input-height-medium) * 0.8); 7773 line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2); 7774 border-radius: var(--sl-input-border-radius-medium); 7775 padding: 0 var(--sl-spacing-small); 7776 } 7777 7778 .tag--large { 7779 font-size: var(--sl-button-font-size-large); 7780 height: calc(var(--sl-input-height-large) * 0.8); 7781 line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2); 7782 border-radius: var(--sl-input-border-radius-large); 7783 padding: 0 var(--sl-spacing-medium); 7784 } 7785 7786 .tag__remove { 7787 margin-inline-start: var(--sl-spacing-x-small); 7788 } 7789 7790 /* 7791 * Pill modifier 7792 */ 7793 7794 .tag--pill { 7795 border-radius: var(--sl-border-radius-pill); 7796 } 7797`; 7798 7799 7800 7801;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6R4LM7O6.js 7802 7803 7804 7805 7806 7807 7808
7809// src/components/tag/tag.component.ts 7810 7811 7812 7813var SlTag = class extends ShoelaceElement { 7814 constructor() { 7815 super(...arguments); 7816 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 7817 this.variant = "neutral"; 7818 this.size = "medium"; 7819 this.pill = false; 7820 this.removable = false; 7821 } 7822 handleRemoveClick() { 7823 this.emit("sl-remove"); 7824 } 7825 render() { 7826 return x` 7827 <span 7828 part="base" 7829 class=${class_map_e({ 7830 tag: true, 7831 // Types 7832 "tag--primary": this.variant === "primary", 7833 "tag--success": this.variant === "success", 7834 "tag--neutral": this.variant === "neutral", 7835 "tag--warning": this.variant === "warning", 7836 "tag--danger": this.variant === "danger", 7837 "tag--text": this.variant === "text", 7838 // Sizes 7839 "tag--small": this.size === "small", 7840 "tag--medium": this.size === "medium", 7841 "tag--large": this.size === "large", 7842 // Modifiers 7843 "tag--pill": this.pill, 7844 "tag--removable": this.removable 7845 })} 7846 > 7847 <slot part="content" class="tag__content"></slot> 7848 7849 ${this.removable ? x` 7850 <sl-icon-button 7851 part="remove-button" 7852 exportparts="base:remove-button__base" 7853 name="x-lg" 7854 library="system" 7855 label=${this.localize.term("remove")} 7856 class="tag__remove" 7857 @click=${this.handleRemoveClick} 7858 tabindex="-1" 7859 ></sl-icon-button> 7860 ` : ""} 7861 </span> 7862 `; 7863 } 7864}; 7865SlTag.styles = [component_styles_default, tag_styles_default]; 7866SlTag.dependencies = { "sl-icon-button": SlIconButton }; 7867__decorateClass([ 7868 property_n({ reflect: true }) 7869], SlTag.prototype, "variant", 2); 7870__decorateClass([ 7871 property_n({ reflect: true }) 7872], SlTag.prototype, "size", 2); 7873__decorateClass([ 7874 property_n({ type: Boolean, reflect: true }) 7875], SlTag.prototype, "pill", 2); 7876__decorateClass([ 7877 property_n({ type: Boolean }) 7878], SlTag.prototype, "removable", 2); 7879 7880 7881 7882;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6CGWZTF5.js 7883/* unused harmony import specifier */ var chunk_6CGWZTF5_SlTag; 7884 7885
7886// src/components/tag/tag.ts 7887var tag_default = (/* unused pure expression or super */ null && (chunk_6CGWZTF5_SlTag)); 7888SlTag.define("sl-tag"); 7889 7890 7891 7892;// ./node_modules/@shoelace-style/shoelace/dist/components/tag/tag.js 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.6KE6SBMU.js
7913// src/components/textarea/textarea.styles.ts 7914 7915var textarea_styles_default = i` 7916 :host { 7917 display: block; 7918 } 7919 7920 .textarea { 7921 display: grid; 7922 align-items: center; 7923 position: relative; 7924 width: 100%; 7925 font-family: var(--sl-input-font-family); 7926 font-weight: var(--sl-input-font-weight); 7927 line-height: var(--sl-line-height-normal); 7928 letter-spacing: var(--sl-input-letter-spacing); 7929 vertical-align: middle; 7930 transition: 7931 var(--sl-transition-fast) color, 7932 var(--sl-transition-fast) border, 7933 var(--sl-transition-fast) box-shadow, 7934 var(--sl-transition-fast) background-color; 7935 cursor: text; 7936 } 7937 7938 /* Standard textareas */ 7939 .textarea--standard { 7940 background-color: var(--sl-input-background-color); 7941 border: solid var(--sl-input-border-width) var(--sl-input-border-color); 7942 } 7943 7944 .textarea--standard:hover:not(.textarea--disabled) { 7945 background-color: var(--sl-input-background-color-hover); 7946 border-color: var(--sl-input-border-color-hover); 7947 } 7948 .textarea--standard:hover:not(.textarea--disabled) .textarea__control { 7949 color: var(--sl-input-color-hover); 7950 } 7951 7952 .textarea--standard.textarea--focused:not(.textarea--disabled) { 7953 background-color: var(--sl-input-background-color-focus); 7954 border-color: var(--sl-input-border-color-focus); 7955 color: var(--sl-input-color-focus); 7956 box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color); 7957 } 7958 7959 .textarea--standard.textarea--focused:not(.textarea--disabled) .textarea__control { 7960 color: var(--sl-input-color-focus); 7961 } 7962 7963 .textarea--standard.textarea--disabled { 7964 background-color: var(--sl-input-background-color-disabled); 7965 border-color: var(--sl-input-border-color-disabled); 7966 opacity: 0.5; 7967 cursor: not-allowed; 7968 } 7969 7970 .textarea__control, 7971 .textarea__size-adjuster { 7972 grid-area: 1 / 1 / 2 / 2; 7973 } 7974 7975 .textarea__size-adjuster { 7976 visibility: hidden; 7977 pointer-events: none; 7978 opacity: 0; 7979 } 7980 7981 .textarea--standard.textarea--disabled .textarea__control { 7982 color: var(--sl-input-color-disabled); 7983 } 7984 7985 .textarea--standard.textarea--disabled .textarea__control::placeholder { 7986 color: var(--sl-input-placeholder-color-disabled); 7987 } 7988 7989 /* Filled textareas */ 7990 .textarea--filled { 7991 border: none; 7992 background-color: var(--sl-input-filled-background-color); 7993 color: var(--sl-input-color); 7994 } 7995 7996 .textarea--filled:hover:not(.textarea--disabled) { 7997 background-color: var(--sl-input-filled-background-color-hover); 7998 } 7999 8000 .textarea--filled.textarea--focused:not(.textarea--disabled) { 8001 background-color: var(--sl-input-filled-background-color-focus); 8002 outline: var(--sl-focus-ring); 8003 outline-offset: var(--sl-focus-ring-offset); 8004 } 8005 8006 .textarea--filled.textarea--disabled { 8007 background-color: var(--sl-input-filled-background-color-disabled); 8008 opacity: 0.5; 8009 cursor: not-allowed; 8010 } 8011 8012 .textarea__control { 8013 font-family: inherit; 8014 font-size: inherit; 8015 font-weight: inherit; 8016 line-height: 1.4; 8017 color: var(--sl-input-color); 8018 border: none; 8019 background: none; 8020 box-shadow: none; 8021 cursor: inherit; 8022 -webkit-appearance: none; 8023 } 8024 8025 .textarea__control::-webkit-search-decoration, 8026 .textarea__control::-webkit-search-cancel-button, 8027 .textarea__control::-webkit-search-results-button, 8028 .textarea__control::-webkit-search-results-decoration { 8029 -webkit-appearance: none; 8030 } 8031 8032 .textarea__control::placeholder { 8033 color: var(--sl-input-placeholder-color); 8034 user-select: none; 8035 -webkit-user-select: none; 8036 } 8037 8038 .textarea__control:focus { 8039 outline: none; 8040 } 8041 8042 /* 8043 * Size modifiers 8044 */ 8045 8046 .textarea--small { 8047 border-radius: var(--sl-input-border-radius-small); 8048 font-size: var(--sl-input-font-size-small); 8049 } 8050 8051 .textarea--small .textarea__control { 8052 padding: 0.5em var(--sl-input-spacing-small); 8053 } 8054 8055 .textarea--medium { 8056 border-radius: var(--sl-input-border-radius-medium); 8057 font-size: var(--sl-input-font-size-medium); 8058 } 8059 8060 .textarea--medium .textarea__control { 8061 padding: 0.5em var(--sl-input-spacing-medium); 8062 } 8063 8064 .textarea--large { 8065 border-radius: var(--sl-input-border-radius-large); 8066 font-size: var(--sl-input-font-size-large); 8067 } 8068 8069 .textarea--large .textarea__control { 8070 padding: 0.5em var(--sl-input-spacing-large); 8071 } 8072 8073 /* 8074 * Resize types 8075 */ 8076 8077 .textarea--resize-none .textarea__control { 8078 resize: none; 8079 } 8080 8081 .textarea--resize-vertical .textarea__control { 8082 resize: vertical; 8083 } 8084 8085 .textarea--resize-auto .textarea__control { 8086 height: auto; 8087 resize: none; 8088 overflow-y: hidden; 8089 } 8090`; 8091 8092 8093 8094;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.Q3IETUAU.js 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104
vendor: 4,320 bytes, lines 8105-8249
8105// src/components/textarea/textarea.component.ts 8106 8107 8108 8109 8110 8111var SlTextarea = class extends ShoelaceElement { 8112 constructor() { 8113 super(...arguments); 8114 this.formControlController = new FormControlController(this, { 8115 assumeInteractionOn: ["sl-blur", "sl-input"] 8116 }); 8117 this.hasSlotController = new HasSlotController(this, "help-text", "label"); 8118 this.hasFocus = false; 8119 this.title = ""; 8120 this.name = ""; 8121 this.value = ""; 8122 this.size = "medium"; 8123 this.filled = false; 8124 this.label = ""; 8125 this.helpText = ""; 8126 this.placeholder = ""; 8127 this.rows = 4; 8128 this.resize = "vertical"; 8129 this.disabled = false; 8130 this.readonly = false; 8131 this.form = ""; 8132 this.required = false; 8133 this.spellcheck = true; 8134 this.defaultValue = ""; 8135 } 8136 /** Gets the validity state object */ 8137 get validity() { 8138 return this.input.validity; 8139 } 8140 /** Gets the validation message */ 8141 get validationMessage() { 8142 return this.input.validationMessage; 8143 } 8144 connectedCallback() { 8145 super.connectedCallback(); 8146 this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight()); 8147 this.updateComplete.then(() => { 8148 this.setTextareaHeight(); 8149 this.resizeObserver.observe(this.input); 8150 }); 8151 } 8152 firstUpdated() { 8153 this.formControlController.updateValidity(); 8154 } 8155 disconnectedCallback() { 8156 var _a; 8157 super.disconnectedCallback(); 8158 if (this.input) { 8159 (_a = this.resizeObserver) == null ? void 0 : _a.unobserve(this.input); 8160 } 8161 } 8162 handleBlur() { 8163 this.hasFocus = false; 8164 this.emit("sl-blur"); 8165 } 8166 handleChange() { 8167 this.value = this.input.value; 8168 this.setTextareaHeight(); 8169 this.emit("sl-change"); 8170 } 8171 handleFocus() { 8172 this.hasFocus = true; 8173 this.emit("sl-focus"); 8174 } 8175 handleInput() { 8176 this.value = this.input.value; 8177 this.emit("sl-input"); 8178 } 8179 handleInvalid(event) { 8180 this.formControlController.setValidity(false); 8181 this.formControlController.emitInvalidEvent(event); 8182 } 8183 setTextareaHeight() { 8184 if (this.resize === "auto") { 8185 this.sizeAdjuster.style.height = `${this.input.clientHeight}px`; 8186 this.input.style.height = "auto"; 8187 this.input.style.height = `${this.input.scrollHeight}px`; 8188 } else { 8189 this.input.style.height = ""; 8190 } 8191 } 8192 handleDisabledChange() { 8193 this.formControlController.setValidity(this.disabled); 8194 } 8195 handleRowsChange() { 8196 this.setTextareaHeight(); 8197 } 8198 async handleValueChange() { 8199 await this.updateComplete; 8200 this.formControlController.updateValidity(); 8201 this.setTextareaHeight(); 8202 } 8203 /** Sets focus on the textarea. */ 8204 focus(options) { 8205 this.input.focus(options); 8206 } 8207 /** Removes focus from the textarea. */ 8208 blur() { 8209 this.input.blur(); 8210 } 8211 /** Selects all the text in the textarea. */ 8212 select() { 8213 this.input.select(); 8214 } 8215 /** Gets or sets the textarea's scroll position. */ 8216 scrollPosition(position) { 8217 if (position) { 8218 if (typeof position.top === "number") this.input.scrollTop = position.top; 8219 if (typeof position.left === "number") this.input.scrollLeft = position.left; 8220 return void 0; 8221 } 8222 return { 8223 top: this.input.scrollTop, 8224 left: this.input.scrollTop 8225 }; 8226 } 8227 /** Sets the start and end positions of the text selection (0-based). */ 8228 setSelectionRange(selectionStart, selectionEnd, selectionDirection = "none") { 8229 this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection); 8230 } 8231 /** Replaces a range of text with a new string. */ 8232 setRangeText(replacement, start, end, selectMode = "preserve") { 8233 const selectionStart = start != null ? start : this.input.selectionStart; 8234 const selectionEnd = end != null ? end : this.input.selectionEnd; 8235 this.input.setRangeText(replacement, selectionStart, selectionEnd, selectMode); 8236 if (this.value !== this.input.value) { 8237 this.value = this.input.value; 8238 this.setTextareaHeight(); 8239 } 8240 } 8241 /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ 8242 checkValidity() { 8243 return this.input.checkValidity(); 8244 } 8245 /** Gets the associated form, if one exists. */ 8246 getForm() { 8247 return this.formControlController.getForm(); 8248 } 8249 /** Checks for validity and shows the browser's validation message if the control is invali
8249d. */ 8250 reportValidity() { 8251 return this.input.reportValidity(); 8252 } 8253 /** Sets a custom validation message. Pass an empty string to restore validity. */ 8254 setCustomValidity(message) { 8255 this.input.setCustomValidity(message); 8256 this.formControlController.updateValidity(); 8257 } 8258 render() { 8259 const hasLabelSlot = this.hasSlotController.test("label"); 8260 const hasHelpTextSlot = this.hasSlotController.test("help-text"); 8261 const hasLabel = this.label ? true : !!hasLabelSlot; 8262 const hasHelpText = this.helpText ? true : !!hasHelpTextSlot; 8263 return x` 8264 <div 8265 part="form-control" 8266 class=${class_map_e({ 8267 "form-control": true, 8268 "form-control--small": this.size === "small", 8269 "form-control--medium": this.size === "medium", 8270 "form-control--large": this.size === "large", 8271 "form-control--has-label": hasLabel, 8272 "form-control--has-help-text": hasHelpText 8273 })} 8274 > 8275 <label 8276 part="form-control-label" 8277 class="form-control__label" 8278 for="input" 8279 aria-hidden=${hasLabel ? "false" : "true"} 8280 > 8281 <slot name="label">${this.label}</slot> 8282 </label> 8283 8284 <div part="form-control-input" class="form-control-input"> 8285 <div 8286 part="base" 8287 class=${class_map_e({ 8288 textarea: true, 8289 "textarea--small": this.size === "small", 8290 "textarea--medium": this.size === "medium", 8291 "textarea--large": this.size === "large", 8292 "textarea--standard": !this.filled, 8293 "textarea--filled": this.filled, 8294 "textarea--disabled": this.disabled, 8295 "textarea--focused": this.hasFocus, 8296 "textarea--empty": !this.value, 8297 "textarea--resize-none": this.resize === "none", 8298 "textarea--resize-vertical": this.resize === "vertical", 8299 "textarea--resize-auto": this.resize === "auto" 8300 })} 8301 > 8302 <textarea 8303 part="textarea" 8304 id="input" 8305 class="textarea__control" 8306 title=${this.title} 8307 name=${if_defined_o(this.name)} 8308 .value=${live_l(this.value)} 8309 ?disabled=${this.disabled} 8310 ?readonly=${this.readonly} 8311 ?required=${this.required} 8312 placeholder=${if_defined_o(this.placeholder)} 8313 rows=${if_defined_o(this.rows)} 8314 minlength=${if_defined_o(this.minlength)} 8315 maxlength=${if_defined_o(this.maxlength)} 8316 autocapitalize=${if_defined_o(this.autocapitalize)} 8317 autocorrect=${if_defined_o(this.autocorrect)} 8318 ?autofocus=${this.autofocus} 8319 spellcheck=${if_defined_o(this.spellcheck)} 8320 enterkeyhint=${if_defined_o(this.enterkeyhint)} 8321 inputmode=${if_defined_o(this.inputmode)} 8322 aria-describedby="help-text" 8323 @change=${this.handleChange} 8324 @input=${this.handleInput} 8325 @invalid=${this.handleInvalid} 8326 @focus=${this.handleFocus} 8327 @blur=${this.handleBlur} 8328 ></textarea> 8329 <!-- This "adjuster" exists to prevent layout shifting. https://github.com/shoelace-style/shoelace/issues/2180 --> 8330 <div part="textarea-adjuster" class="textarea__size-adjuster" ?hidden=${this.resize !== "auto"}></div> 8331 </div> 8332 </div> 8333 8334 <div 8335 part="form-control-help-text" 8336 id="help-text" 8337 class="form-control__help-text" 8338 aria-hidden=${hasHelpText ? "false" : "true"} 8339 > 8340 <slot name="help-text">${this.helpText}</slot> 8341 </div> 8342 </div> 8343 `; 8344 } 8345}; 8346SlTextarea.styles = [component_styles_default, form_control_styles_default, textarea_styles_default]; 8347__decorateClass([ 8348 query_e(".textarea__control") 8349], SlTextarea.prototype, "input", 2); 8350__decorateClass([ 8351 query_e(".textarea__size-adjuster") 8352], SlTextarea.prototype, "sizeAdjuster", 2); 8353__decorateClass([ 8354 state_r() 8355], SlTextarea.prototype, "hasFocus", 2); 8356__decorateClass([ 8357 property_n() 8358], SlTextarea.prototype, "title", 2); 8359__decorateClass([ 8360 property_n()
vendor: 2,684 bytes, lines 8361-8450
8361], SlTextarea.prototype, "name", 2); 8362__decorateClass([ 8363 property_n() 8364], SlTextarea.prototype, "value", 2); 8365__decorateClass([ 8366 property_n({ reflect: true }) 8367], SlTextarea.prototype, "size", 2); 8368__decorateClass([ 8369 property_n({ type: Boolean, reflect: true }) 8370], SlTextarea.prototype, "filled", 2); 8371__decorateClass([ 8372 property_n() 8373], SlTextarea.prototype, "label", 2); 8374__decorateClass([ 8375 property_n({ attribute: "help-text" }) 8376], SlTextarea.prototype, "helpText", 2); 8377__decorateClass([ 8378 property_n() 8379], SlTextarea.prototype, "placeholder", 2); 8380__decorateClass([ 8381 property_n({ type: Number }) 8382], SlTextarea.prototype, "rows", 2); 8383__decorateClass([ 8384 property_n() 8385], SlTextarea.prototype, "resize", 2); 8386__decorateClass([ 8387 property_n({ type: Boolean, reflect: true }) 8388], SlTextarea.prototype, "disabled", 2); 8389__decorateClass([ 8390 property_n({ type: Boolean, reflect: true }) 8391], SlTextarea.prototype, "readonly", 2); 8392__decorateClass([ 8393 property_n({ reflect: true }) 8394], SlTextarea.prototype, "form", 2); 8395__decorateClass([ 8396 property_n({ type: Boolean, reflect: true }) 8397], SlTextarea.prototype, "required", 2); 8398__decorateClass([ 8399 property_n({ type: Number }) 8400], SlTextarea.prototype, "minlength", 2); 8401__decorateClass([ 8402 property_n({ type: Number }) 8403], SlTextarea.prototype, "maxlength", 2); 8404__decorateClass([ 8405 property_n() 8406], SlTextarea.prototype, "autocapitalize", 2); 8407__decorateClass([ 8408 property_n() 8409], SlTextarea.prototype, "autocorrect", 2); 8410__decorateClass([ 8411 property_n() 8412], SlTextarea.prototype, "autocomplete", 2); 8413__decorateClass([ 8414 property_n({ type: Boolean }) 8415], SlTextarea.prototype, "autofocus", 2); 8416__decorateClass([ 8417 property_n() 8418], SlTextarea.prototype, "enterkeyhint", 2); 8419__decorateClass([ 8420 property_n({ 8421 type: Boolean, 8422 converter: { 8423 // Allow "true|false" attribute values but keep the property boolean 8424 fromAttribute: (value) => !value || value === "false" ? false : true, 8425 toAttribute: (value) => value ? "true" : "false" 8426 } 8427 }) 8428], SlTextarea.prototype, "spellcheck", 2); 8429__decorateClass([ 8430 property_n() 8431], SlTextarea.prototype, "inputmode", 2); 8432__decorateClass([ 8433 defaultValue() 8434], SlTextarea.prototype, "defaultValue", 2); 8435__decorateClass([ 8436 watch("disabled", { waitUntilFirstUpdate: true }) 8437], SlTextarea.prototype, "handleDisabledChange", 1); 8438__decorateClass([ 8439 watch("rows", { waitUntilFirstUpdate: true }) 8440], SlTextarea.prototype, "handleRowsChange", 1); 8441__decorateClass([ 8442 watch("value", { waitUntilFirstUpdate: true }) 8443], SlTextarea.prototype, "handleValueChange", 1); 8444 8445 8446 8447;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.WMS2VUJ6.js 8448/* unused harmony import specifier */ var chunk_WMS2VUJ6_SlTextarea; 8449 8450
8451// src/components/textarea/textarea.ts 8452var textarea_default = (/* unused pure expression or super */ null && (chunk_WMS2VUJ6_SlTextarea)); 8453SlTextarea.define("sl-textarea"); 8454 8455 8456 8457;// ./node_modules/@shoelace-style/shoelace/dist/components/textarea/textarea.js 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.FW7UWQXB.js
8472// src/components/tooltip/tooltip.styles.ts 8473 8474var tooltip_styles_default = i` 8475 :host { 8476 --max-width: 20rem; 8477 --hide-delay: 0ms; 8478 --show-delay: 150ms; 8479 8480 display: contents; 8481 } 8482 8483 .tooltip { 8484 --arrow-size: var(--sl-tooltip-arrow-size); 8485 --arrow-color: var(--sl-tooltip-background-color); 8486 } 8487 8488 .tooltip::part(popup) { 8489 z-index: var(--sl-z-index-tooltip); 8490 } 8491 8492 .tooltip[placement^='top']::part(popup) { 8493 transform-origin: bottom; 8494 } 8495 8496 .tooltip[placement^='bottom']::part(popup) { 8497 transform-origin: top; 8498 } 8499 8500 .tooltip[placement^='left']::part(popup) { 8501 transform-origin: right; 8502 } 8503 8504 .tooltip[placement^='right']::part(popup) { 8505 transform-origin: left; 8506 } 8507 8508 .tooltip__body { 8509 display: block; 8510 width: max-content; 8511 max-width: var(--max-width); 8512 border-radius: var(--sl-tooltip-border-radius); 8513 background-color: var(--sl-tooltip-background-color); 8514 font-family: var(--sl-tooltip-font-family); 8515 font-size: var(--sl-tooltip-font-size); 8516 font-weight: var(--sl-tooltip-font-weight); 8517 line-height: var(--sl-tooltip-line-height); 8518 text-align: start; 8519 white-space: normal; 8520 color: var(--sl-tooltip-color); 8521 padding: var(--sl-tooltip-padding); 8522 pointer-events: none; 8523 user-select: none; 8524 -webkit-user-select: none; 8525 } 8526`; 8527 8528 8529 8530;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.K7JGTRV7.js 8531/* unused harmony import specifier */ var chunk_K7JGTRV7_spreadProps; 8532/* unused harmony import specifier */ var chunk_K7JGTRV7_spreadValues; 8533 8534
vendor: 1,454 bytes, lines 8535-8573
8535// src/utilities/animation-registry.ts 8536var defaultAnimationRegistry = /* @__PURE__ */ new Map(); 8537var customAnimationRegistry = /* @__PURE__ */ new WeakMap(); 8538function ensureAnimation(animation) { 8539 return animation != null ? animation : { keyframes: [], options: { duration: 0 } }; 8540} 8541function getLogicalAnimation(animation, dir) { 8542 if (dir.toLowerCase() === "rtl") { 8543 return { 8544 keyframes: animation.rtlKeyframes || animation.keyframes, 8545 options: animation.options 8546 }; 8547 } 8548 return animation; 8549} 8550function setDefaultAnimation(animationName, animation) { 8551 defaultAnimationRegistry.set(animationName, ensureAnimation(animation)); 8552} 8553function setAnimation(el, animationName, animation) { 8554 customAnimationRegistry.set(el, chunk_K7JGTRV7_spreadProps(chunk_K7JGTRV7_spreadValues({}, customAnimationRegistry.get(el)), { [animationName]: ensureAnimation(animation) })); 8555} 8556function getAnimation(el, animationName, options) { 8557 const customAnimation = customAnimationRegistry.get(el); 8558 if (customAnimation == null ? void 0 : customAnimation[animationName]) { 8559 return getLogicalAnimation(customAnimation[animationName], options.dir); 8560 } 8561 const defaultAnimation = defaultAnimationRegistry.get(animationName); 8562 if (defaultAnimation) { 8563 return getLogicalAnimation(defaultAnimation, options.dir); 8564 } 8565 return { 8566 keyframes: [], 8567 options: { duration: 0 } 8568 }; 8569} 8570 8571 8572 8573;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.B4BZKR24.js
8574// src/internal/event.ts 8575function waitForEvent(el, eventName) { 8576 return new Promise((resolve) => { 8577 function done(event) { 8578 if (event.target === el) { 8579 el.removeEventListener(eventName, done); 8580 resolve(); 8581 } 8582 } 8583 el.addEventListener(eventName, done); 8584 }); 8585} 8586 8587 8588 8589;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.AJ3ENQ5C.js 8590 8591
vendor: 1,484 bytes, lines 8592-8648
8592// src/internal/animate.ts 8593function animateTo(el, keyframes, options) { 8594 return new Promise((resolve) => { 8595 if ((options == null ? void 0 : options.duration) === Infinity) { 8596 throw new Error("Promise-based animations must be finite."); 8597 } 8598 const animation = el.animate(keyframes, __spreadProps(__spreadValues({}, options), { 8599 duration: prefersReducedMotion() ? 0 : options.duration 8600 })); 8601 animation.addEventListener("cancel", resolve, { once: true }); 8602 animation.addEventListener("finish", resolve, { once: true }); 8603 }); 8604} 8605function parseDuration(delay) { 8606 delay = delay.toString().toLowerCase(); 8607 if (delay.indexOf("ms") > -1) { 8608 return parseFloat(delay); 8609 } 8610 if (delay.indexOf("s") > -1) { 8611 return parseFloat(delay) * 1e3; 8612 } 8613 return parseFloat(delay); 8614} 8615function prefersReducedMotion() { 8616 const query = window.matchMedia("(prefers-reduced-motion: reduce)"); 8617 return query.matches; 8618} 8619function stopAnimations(el) { 8620 return Promise.all( 8621 el.getAnimations().map((animation) => { 8622 return new Promise((resolve) => { 8623 animation.cancel(); 8624 requestAnimationFrame(resolve); 8625 }); 8626 }) 8627 ); 8628} 8629function shimKeyframesHeightAuto(keyframes, calculatedHeight) { 8630 return keyframes.map((keyframe) => __spreadProps(__spreadValues({}, keyframe), { 8631 height: keyframe.height === "auto" ? `${calculatedHeight}px` : keyframe.height 8632 })); 8633} 8634 8635 8636 8637;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.NU24CZHH.js 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648
vendor: 7,241 bytes, lines 8649-8891
8649// src/components/tooltip/tooltip.component.ts 8650 8651 8652 8653var SlTooltip = class extends ShoelaceElement { 8654 constructor() { 8655 super(); 8656 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 8657 this.content = ""; 8658 this.placement = "top"; 8659 this.disabled = false; 8660 this.distance = 8; 8661 this.open = false; 8662 this.skidding = 0; 8663 this.trigger = "hover focus"; 8664 this.hoist = false; 8665 this.handleBlur = () => { 8666 if (this.hasTrigger("focus")) { 8667 this.hide(); 8668 } 8669 }; 8670 this.handleClick = () => { 8671 if (this.hasTrigger("click")) { 8672 if (this.open) { 8673 this.hide(); 8674 } else { 8675 this.show(); 8676 } 8677 } 8678 }; 8679 this.handleFocus = () => { 8680 if (this.hasTrigger("focus")) { 8681 this.show(); 8682 } 8683 }; 8684 this.handleDocumentKeyDown = (event) => { 8685 if (event.key === "Escape") { 8686 event.stopPropagation(); 8687 this.hide(); 8688 } 8689 }; 8690 this.handleMouseOver = () => { 8691 if (this.hasTrigger("hover")) { 8692 const delay = parseDuration(getComputedStyle(this).getPropertyValue("--show-delay")); 8693 clearTimeout(this.hoverTimeout); 8694 this.hoverTimeout = window.setTimeout(() => this.show(), delay); 8695 } 8696 }; 8697 this.handleMouseOut = () => { 8698 if (this.hasTrigger("hover")) { 8699 const delay = parseDuration(getComputedStyle(this).getPropertyValue("--hide-delay")); 8700 clearTimeout(this.hoverTimeout); 8701 this.hoverTimeout = window.setTimeout(() => this.hide(), delay); 8702 } 8703 }; 8704 this.addEventListener("blur", this.handleBlur, true); 8705 this.addEventListener("focus", this.handleFocus, true); 8706 this.addEventListener("click", this.handleClick); 8707 this.addEventListener("mouseover", this.handleMouseOver); 8708 this.addEventListener("mouseout", this.handleMouseOut); 8709 } 8710 disconnectedCallback() { 8711 var _a; 8712 super.disconnectedCallback(); 8713 (_a = this.closeWatcher) == null ? void 0 : _a.destroy(); 8714 document.removeEventListener("keydown", this.handleDocumentKeyDown); 8715 } 8716 firstUpdated() { 8717 this.body.hidden = !this.open; 8718 if (this.open) { 8719 this.popup.active = true; 8720 this.popup.reposition(); 8721 } 8722 } 8723 hasTrigger(triggerType) { 8724 const triggers = this.trigger.split(" "); 8725 return triggers.includes(triggerType); 8726 } 8727 async handleOpenChange() { 8728 var _a, _b; 8729 if (this.open) { 8730 if (this.disabled) { 8731 return; 8732 } 8733 this.emit("sl-show"); 8734 if ("CloseWatcher" in window) { 8735 (_a = this.closeWatcher) == null ? void 0 : _a.destroy(); 8736 this.closeWatcher = new CloseWatcher(); 8737 this.closeWatcher.onclose = () => { 8738 this.hide(); 8739 }; 8740 } else { 8741 document.addEventListener("keydown", this.handleDocumentKeyDown); 8742 } 8743 await stopAnimations(this.body); 8744 this.body.hidden = false; 8745 this.popup.active = true; 8746 const { keyframes, options } = getAnimation(this, "tooltip.show", { dir: this.localize.dir() }); 8747 await animateTo(this.popup.popup, keyframes, options); 8748 this.popup.reposition(); 8749 this.emit("sl-after-show"); 8750 } else { 8751 this.emit("sl-hide"); 8752 (_b = this.closeWatcher) == null ? void 0 : _b.destroy(); 8753 document.removeEventListener("keydown", this.handleDocumentKeyDown); 8754 await stopAnimations(this.body); 8755 const { keyframes, options } = getAnimation(this, "tooltip.hide", { dir: this.localize.dir() }); 8756 await animateTo(this.popup.popup, keyframes, options); 8757 this.popup.active = false; 8758 this.body.hidden = true; 8759 this.emit("sl-after-hide"); 8760 } 8761 } 8762 async handleOptionsChange() { 8763 if (this.hasUpdated) { 8764 await this.updateComplete; 8765 this.popup.reposition(); 8766 } 8767 } 8768 handleDisabledChange() { 8769 if (this.disabled && this.open) { 8770 this.hide(); 8771 } 8772 } 8773 /** Shows the tooltip. */ 8774 async show() { 8775 if (this.open) { 8776 return void 0; 8777 } 8778 this.open = true; 8779 return waitForEvent(this, "sl-after-show"); 8780 } 8781 /** Hides the tooltip */ 8782 async hide() { 8783 if (!this.open) { 8784 return void 0; 8785 } 8786 this.open = false; 8787 return waitForEvent(this, "sl-after-hide"); 8788 } 8789 // 8790 // NOTE: Tooltip is a bit unique in that we're using aria-live instead of aria-labelledby to trick screen readers into 8791 // announcing the content. It works really well, but it violates an accessibility rule. We're also adding the 8792 // aria-describedby attribute to a slot, which is required by <sl-popup> to correctly locate the first assigned 8793 // element, otherwise positioning is incorrect. 8794 // 8795 render() { 8796 return x` 8797 <sl-popup 8798 part="base" 8799 exportparts=" 8800 popup:base__popup, 8801 arrow:base__arrow 8802 " 8803 class=${class_map_e({ 8804 tooltip: true, 8805 "tooltip--open": this.open 8806 })} 8807 placement=${this.placement} 8808 distance=${this.distance} 8809 skidding=${this.skidding} 8810 strategy=${this.hoist ? "fixed" : "absolute"} 8811 flip 8812 shift 8813 arrow 8814 hover-bridge 8815 > 8816 ${""} 8817 <slot slot="anchor" aria-describedby="tooltip"></slot> 8818 8819 ${""} 8820 <div part="body" id="tooltip" class="tooltip__body" role="tooltip" aria-live=${this.open ? "polite" : "off"}> 8821 <slot name="content">${this.content}</slot> 8822 </div> 8823 </sl-popup> 8824 `; 8825 } 8826}; 8827SlTooltip.styles = [component_styles_default, tooltip_styles_default]; 8828SlTooltip.dependencies = { "sl-popup": SlPopup }; 8829__decorateClass([ 8830 query_e("slot:not([name])") 8831], SlTooltip.prototype, "defaultSlot", 2); 8832__decorateClass([ 8833 query_e(".tooltip__body") 8834], SlTooltip.prototype, "body", 2); 8835__decorateClass([ 8836 query_e("sl-popup") 8837], SlTooltip.prototype, "popup", 2); 8838__decorateClass([ 8839 property_n() 8840], SlTooltip.prototype, "content", 2); 8841__decorateClass([ 8842 property_n() 8843], SlTooltip.prototype, "placement", 2); 8844__decorateClass([ 8845 property_n({ type: Boolean, reflect: true }) 8846], SlTooltip.prototype, "disabled", 2); 8847__decorateClass([ 8848 property_n({ type: Number }) 8849], SlTooltip.prototype, "distance", 2); 8850__decorateClass([ 8851 property_n({ type: Boolean, reflect: true }) 8852], SlTooltip.prototype, "open", 2); 8853__decorateClass([ 8854 property_n({ type: Number }) 8855], SlTooltip.prototype, "skidding", 2); 8856__decorateClass([ 8857 property_n() 8858], SlTooltip.prototype, "trigger", 2); 8859__decorateClass([ 8860 property_n({ type: Boolean }) 8861], SlTooltip.prototype, "hoist", 2); 8862__decorateClass([ 8863 watch("open", { waitUntilFirstUpdate: true }) 8864], SlTooltip.prototype, "handleOpenChange", 1); 8865__decorateClass([ 8866 watch(["content", "distance", "hoist", "placement", "skidding"]) 8867], SlTooltip.prototype, "handleOptionsChange", 1); 8868__decorateClass([ 8869 watch("disabled") 8870], SlTooltip.prototype, "handleDisabledChange", 1); 8871setDefaultAnimation("tooltip.show", { 8872 keyframes: [ 8873 { opacity: 0, scale: 0.8 }, 8874 { opacity: 1, scale: 1 } 8875 ], 8876 options: { duration: 150, easing: "ease" } 8877}); 8878setDefaultAnimation("tooltip.hide", { 8879 keyframes: [ 8880 { opacity: 1, scale: 1 }, 8881 { opacity: 0, scale: 0.8 } 8882 ], 8883 options: { duration: 150, easing: "ease" } 8884}); 8885 8886 8887 8888;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.URTPIBTY.js 8889/* unused harmony import specifier */ var chunk_URTPIBTY_SlTooltip; 8890 8891
8892// src/components/tooltip/tooltip.ts 8893var tooltip_default = (/* unused pure expression or super */ null && (chunk_URTPIBTY_SlTooltip)); 8894SlTooltip.define("sl-tooltip"); 8895 8896 8897 8898;// ./node_modules/@shoelace-style/shoelace/dist/components/tooltip/tooltip.js 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BWVSW6TI.js
8916// src/components/tree-item/tree-item.styles.ts 8917 8918var tree_item_styles_default = i` 8919 :host { 8920 display: block; 8921 outline: 0; 8922 z-index: 0; 8923 } 8924 8925 :host(:focus) { 8926 outline: none; 8927 } 8928 8929 slot:not([name])::slotted(sl-icon) { 8930 margin-inline-end: var(--sl-spacing-x-small); 8931 } 8932 8933 .tree-item { 8934 position: relative; 8935 display: flex; 8936 align-items: stretch; 8937 flex-direction: column; 8938 color: var(--sl-color-neutral-700); 8939 cursor: pointer; 8940 user-select: none; 8941 -webkit-user-select: none; 8942 } 8943 8944 .tree-item__checkbox { 8945 pointer-events: none; 8946 } 8947 8948 .tree-item__expand-button, 8949 .tree-item__checkbox, 8950 .tree-item__label { 8951 font-family: var(--sl-font-sans); 8952 font-size: var(--sl-font-size-medium); 8953 font-weight: var(--sl-font-weight-normal); 8954 line-height: var(--sl-line-height-dense); 8955 letter-spacing: var(--sl-letter-spacing-normal); 8956 } 8957 8958 .tree-item__checkbox::part(base) { 8959 display: flex; 8960 align-items: center; 8961 } 8962 8963 .tree-item__indentation { 8964 display: block; 8965 width: 1em; 8966 flex-shrink: 0; 8967 } 8968 8969 .tree-item__expand-button { 8970 display: flex; 8971 align-items: center; 8972 justify-content: center; 8973 box-sizing: content-box; 8974 color: var(--sl-color-neutral-500); 8975 padding: var(--sl-spacing-x-small); 8976 width: 1rem; 8977 height: 1rem; 8978 flex-shrink: 0; 8979 cursor: pointer; 8980 } 8981 8982 .tree-item__expand-button { 8983 transition: var(--sl-transition-medium) rotate ease; 8984 } 8985 8986 .tree-item--expanded .tree-item__expand-button { 8987 rotate: 90deg; 8988 } 8989 8990 .tree-item--expanded.tree-item--rtl .tree-item__expand-button { 8991 rotate: -90deg; 8992 } 8993 8994 .tree-item--expanded slot[name='expand-icon'], 8995 .tree-item:not(.tree-item--expanded) slot[name='collapse-icon'] { 8996 display: none; 8997 } 8998 8999 .tree-item:not(.tree-item--has-expand-button) .tree-item__expand-icon-slot { 9000 display: none; 9001 } 9002 9003 .tree-item__expand-button--visible { 9004 cursor: pointer; 9005 } 9006 9007 .tree-item__item { 9008 display: flex; 9009 align-items: center; 9010 border-inline-start: solid 3px transparent; 9011 } 9012 9013 .tree-item--disabled .tree-item__item { 9014 opacity: 0.5; 9015 outline: none; 9016 cursor: not-allowed; 9017 } 9018 9019 :host(:focus-visible) .tree-item__item { 9020 outline: var(--sl-focus-ring); 9021 outline-offset: var(--sl-focus-ring-offset); 9022 z-index: 2; 9023 } 9024 9025 :host(:not([aria-disabled='true'])) .tree-item--selected .tree-item__item { 9026 background-color: var(--sl-color-neutral-100); 9027 border-inline-start-color: var(--sl-color-primary-600); 9028 } 9029 9030 :host(:not([aria-disabled='true'])) .tree-item__expand-button { 9031 color: var(--sl-color-neutral-600); 9032 } 9033 9034 .tree-item__label { 9035 display: flex; 9036 align-items: center; 9037 transition: var(--sl-transition-fast) color; 9038 } 9039 9040 .tree-item__children { 9041 display: block; 9042 font-size: calc(1em + var(--indent-size, var(--sl-spacing-medium))); 9043 } 9044 9045 /* Indentation lines */ 9046 .tree-item__children { 9047 position: relative; 9048 } 9049 9050 .tree-item__children::before { 9051 content: ''; 9052 position: absolute; 9053 top: var(--indent-guide-offset); 9054 bottom: var(--indent-guide-offset); 9055 left: calc(1em - (var(--indent-guide-width) / 2) - 1px); 9056 border-inline-end: var(--indent-guide-width) var(--indent-guide-style) var(--indent-guide-color); 9057 z-index: 1; 9058 } 9059 9060 .tree-item--rtl .tree-item__children::before { 9061 left: auto; 9062 right: 1em; 9063 } 9064 9065 @media (forced-colors: active) { 9066 :host(:not([aria-disabled='true'])) .tree-item--selected .tree-item__item { 9067 outline: dashed 1px SelectedItem; 9068 } 9069 } 9070`; 9071 9072 9073 9074;// ./node_modules/lit-html/directives/when.js 9075/** 9076 * @license 9077 * Copyright 2021 Google LLC 9078 * SPDX-License-Identifier: BSD-3-Clause 9079 */ 9080function when_n(n,r,t){return n?r(n):t?.(n)} 9081//# sourceMappingURL=when.js.map 9082 9083;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.P4TU54CC.js 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095
vendor: 6,926 bytes, lines 9096-9310
9096// src/components/tree-item/tree-item.component.ts 9097 9098 9099 9100 9101 9102var _SlTreeItem = class _SlTreeItem extends ShoelaceElement { 9103 constructor() { 9104 super(...arguments); 9105 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 9106 this.indeterminate = false; 9107 this.isLeaf = false; 9108 this.loading = false; 9109 this.selectable = false; 9110 this.expanded = false; 9111 this.selected = false; 9112 this.disabled = false; 9113 this.lazy = false; 9114 } 9115 static isTreeItem(node) { 9116 return node instanceof Element && node.getAttribute("role") === "treeitem"; 9117 } 9118 connectedCallback() { 9119 super.connectedCallback(); 9120 this.setAttribute("role", "treeitem"); 9121 this.setAttribute("tabindex", "-1"); 9122 if (this.isNestedItem()) { 9123 this.slot = "children"; 9124 } 9125 } 9126 firstUpdated() { 9127 this.childrenContainer.hidden = !this.expanded; 9128 this.childrenContainer.style.height = this.expanded ? "auto" : "0"; 9129 this.isLeaf = !this.lazy && this.getChildrenItems().length === 0; 9130 this.handleExpandedChange(); 9131 } 9132 async animateCollapse() { 9133 this.emit("sl-collapse"); 9134 await stopAnimations(this.childrenContainer); 9135 const { keyframes, options } = getAnimation(this, "tree-item.collapse", { dir: this.localize.dir() }); 9136 await animateTo( 9137 this.childrenContainer, 9138 shimKeyframesHeightAuto(keyframes, this.childrenContainer.scrollHeight), 9139 options 9140 ); 9141 this.childrenContainer.hidden = true; 9142 this.emit("sl-after-collapse"); 9143 } 9144 // Checks whether the item is nested into an item 9145 isNestedItem() { 9146 const parent = this.parentElement; 9147 return !!parent && _SlTreeItem.isTreeItem(parent); 9148 } 9149 handleChildrenSlotChange() { 9150 this.loading = false; 9151 this.isLeaf = !this.lazy && this.getChildrenItems().length === 0; 9152 } 9153 willUpdate(changedProperties) { 9154 if (changedProperties.has("selected") && !changedProperties.has("indeterminate")) { 9155 this.indeterminate = false; 9156 } 9157 } 9158 async animateExpand() { 9159 this.emit("sl-expand"); 9160 await stopAnimations(this.childrenContainer); 9161 this.childrenContainer.hidden = false; 9162 const { keyframes, options } = getAnimation(this, "tree-item.expand", { dir: this.localize.dir() }); 9163 await animateTo( 9164 this.childrenContainer, 9165 shimKeyframesHeightAuto(keyframes, this.childrenContainer.scrollHeight), 9166 options 9167 ); 9168 this.childrenContainer.style.height = "auto"; 9169 this.emit("sl-after-expand"); 9170 } 9171 handleLoadingChange() { 9172 this.setAttribute("aria-busy", this.loading ? "true" : "false"); 9173 if (!this.loading) { 9174 this.animateExpand(); 9175 } 9176 } 9177 handleDisabledChange() { 9178 this.setAttribute("aria-disabled", this.disabled ? "true" : "false"); 9179 } 9180 handleSelectedChange() { 9181 this.setAttribute("aria-selected", this.selected ? "true" : "false"); 9182 } 9183 handleExpandedChange() { 9184 if (!this.isLeaf) { 9185 this.setAttribute("aria-expanded", this.expanded ? "true" : "false"); 9186 } else { 9187 this.removeAttribute("aria-expanded"); 9188 } 9189 } 9190 handleExpandAnimation() { 9191 if (this.expanded) { 9192 if (this.lazy) { 9193 this.loading = true; 9194 this.emit("sl-lazy-load"); 9195 } else { 9196 this.animateExpand(); 9197 } 9198 } else { 9199 this.animateCollapse(); 9200 } 9201 } 9202 handleLazyChange() { 9203 this.emit("sl-lazy-change"); 9204 } 9205 /** Gets all the nested tree items in this node. */ 9206 getChildrenItems({ includeDisabled = true } = {}) { 9207 return this.childrenSlot ? [...this.childrenSlot.assignedElements({ flatten: true })].filter( 9208 (item) => _SlTreeItem.isTreeItem(item) && (includeDisabled || !item.disabled) 9209 ) : []; 9210 } 9211 render() { 9212 const isRtl = this.localize.dir() === "rtl"; 9213 const showExpandButton = !this.loading && (!this.isLeaf || this.lazy); 9214 return x` 9215 <div 9216 part="base" 9217 class="${class_map_e({ 9218 "tree-item": true, 9219 "tree-item--expanded": this.expanded, 9220 "tree-item--selected": this.selected, 9221 "tree-item--disabled": this.disabled, 9222 "tree-item--leaf": this.isLeaf, 9223 "tree-item--has-expand-button": showExpandButton, 9224 "tree-item--rtl": this.localize.dir() === "rtl" 9225 })}" 9226 > 9227 <div 9228 class="tree-item__item" 9229 part=" 9230 item 9231 ${this.disabled ? "item--disabled" : ""} 9232 ${this.expanded ? "item--expanded" : ""} 9233 ${this.indeterminate ? "item--indeterminate" : ""} 9234 ${this.selected ? "item--selected" : ""} 9235 " 9236 > 9237 <div class="tree-item__indentation" part="indentation"></div> 9238 9239 <div 9240 part="expand-button" 9241 class=${class_map_e({ 9242 "tree-item__expand-button": true, 9243 "tree-item__expand-button--visible": showExpandButton 9244 })} 9245 aria-hidden="true" 9246 > 9247 ${when_n( 9248 this.loading, 9249 () => x` <sl-spinner part="spinner" exportparts="base:spinner__base"></sl-spinner> ` 9250 )} 9251 <slot class="tree-item__expand-icon-slot" name="expand-icon"> 9252 <sl-icon library="system" name=${isRtl ? "chevron-left" : "chevron-right"}></sl-icon> 9253 </slot> 9254 <slot class="tree-item__expand-icon-slot" name="collapse-icon"> 9255 <sl-icon library="system" name=${isRtl ? "chevron-left" : "chevron-right"}></sl-icon> 9256 </slot> 9257 </div> 9258 9259 ${when_n( 9260 this.selectable, 9261 () => x` 9262 <sl-checkbox 9263 part="checkbox" 9264 exportparts=" 9265 base:checkbox__base, 9266 control:checkbox__control, 9267 control--checked:checkbox__control--checked, 9268 control--indeterminate:checkbox__control--indeterminate, 9269 checked-icon:checkbox__checked-icon, 9270 indeterminate-icon:checkbox__indeterminate-icon, 9271 label:checkbox__label 9272 " 9273 class="tree-item__checkbox" 9274 ?disabled="${this.disabled}" 9275 ?checked="${live_l(this.selected)}" 9276 ?indeterminate="${this.indeterminate}" 9277 tabindex="-1" 9278 ></sl-checkbox> 9279 ` 9280 )} 9281 9282 <slot class="tree-item__label" part="label"></slot> 9283 </div> 9284 9285 <div class="tree-item__children" part="children" role="group"> 9286 <slot name="children" @slotchange="${this.handleChildrenSlotChange}"></slot> 9287 </div> 9288 </div> 9289 `; 9290 } 9291}; 9292_SlTreeItem.styles = [component_styles_default, tree_item_styles_default]; 9293_SlTreeItem.dependencies = { 9294 "sl-checkbox": SlCheckbox, 9295 "sl-icon": SlIcon, 9296 "sl-spinner": SlSpinner 9297}; 9298__decorateClass([ 9299 state_r() 9300], _SlTreeItem.prototype, "indeterminate", 2); 9301__decorateClass([ 9302 state_r() 9303], _SlTreeItem.prototype, "isLeaf", 2); 9304__decorateClass([ 9305 state_r() 9306], _SlTreeItem.prototype, "loading", 2); 9307__decorateClass([ 9308 state_r() 9309], _SlTreeItem.prototype, "selectable", 2); 9310__decorateClass([
9311 property_n({ type: Boolean, reflect: true }) 9312], _SlTreeItem.prototype, "expanded", 2); 9313__decorateClass([ 9314 property_n({ type: Boolean, reflect: true }) 9315], _SlTreeItem.prototype, "selected", 2); 9316__decorateClass([ 9317 property_n({ type: Boolean, reflect: true }) 9318], _SlTreeItem.prototype, "disabled", 2); 9319__decorateClass([ 9320 property_n({ type: Boolean, reflect: true }) 9321], _SlTreeItem.prototype, "lazy", 2); 9322__decorateClass([ 9323 query_e("slot:not([name])") 9324], _SlTreeItem.prototype, "defaultSlot", 2); 9325__decorateClass([ 9326 query_e("slot[name=children]") 9327], _SlTreeItem.prototype, "childrenSlot", 2); 9328__decorateClass([ 9329 query_e(".tree-item__item") 9330], _SlTreeItem.prototype, "itemElement", 2); 9331__decorateClass([ 9332 query_e(".tree-item__children") 9333], _SlTreeItem.prototype, "childrenContainer", 2); 9334__decorateClass([ 9335 query_e(".tree-item__expand-button slot") 9336], _SlTreeItem.prototype, "expandButtonSlot", 2); 9337__decorateClass([ 9338 watch("loading", { waitUntilFirstUpdate: true }) 9339], _SlTreeItem.prototype, "handleLoadingChange", 1); 9340__decorateClass([ 9341 watch("disabled") 9342], _SlTreeItem.prototype, "handleDisabledChange", 1); 9343__decorateClass([ 9344 watch("selected") 9345], _SlTreeItem.prototype, "handleSelectedChange", 1); 9346__decorateClass([ 9347 watch("expanded", { waitUntilFirstUpdate: true }) 9348], _SlTreeItem.prototype, "handleExpandedChange", 1); 9349__decorateClass([ 9350 watch("expanded", { waitUntilFirstUpdate: true }) 9351], _SlTreeItem.prototype, "handleExpandAnimation", 1); 9352__decorateClass([ 9353 watch("lazy", { waitUntilFirstUpdate: true }) 9354], _SlTreeItem.prototype, "handleLazyChange", 1); 9355var SlTreeItem = _SlTreeItem; 9356setDefaultAnimation("tree-item.expand", { 9357 keyframes: [ 9358 { height: "0", opacity: "0", overflow: "hidden" }, 9359 { height: "auto", opacity: "1", overflow: "hidden" } 9360 ], 9361 options: { duration: 250, easing: "cubic-bezier(0.4, 0.0, 0.2, 1)" } 9362}); 9363setDefaultAnimation("tree-item.collapse", { 9364 keyframes: [ 9365 { height: "auto", opacity: "1", overflow: "hidden" }, 9366 { height: "0", opacity: "0", overflow: "hidden" } 9367 ], 9368 options: { duration: 200, easing: "cubic-bezier(0.4, 0.0, 0.2, 1)" } 9369}); 9370 9371 9372 9373;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.G7B7WU5W.js
9374// src/components/tree/tree.styles.ts 9375 9376var tree_styles_default = i` 9377 :host { 9378 /* 9379 * These are actually used by tree item, but we define them here so they can more easily be set and all tree items 9380 * stay consistent. 9381 */ 9382 --indent-guide-color: var(--sl-color-neutral-200); 9383 --indent-guide-offset: 0; 9384 --indent-guide-style: solid; 9385 --indent-guide-width: 0; 9386 --indent-size: var(--sl-spacing-large); 9387 9388 display: block; 9389 9390 /* 9391 * Tree item indentation uses the "em" unit to increment its width on each level, so setting the font size to zero 9392 * here removes the indentation for all the nodes on the first level. 9393 */ 9394 font-size: 0; 9395 } 9396`; 9397 9398 9399 9400;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.HF7GESMZ.js
9401// src/internal/math.ts 9402function chunk_HF7GESMZ_clamp(value, min, max) { 9403 const noNegativeZero = (n) => Object.is(n, -0) ? 0 : n; 9404 if (value < min) { 9405 return noNegativeZero(min); 9406 } 9407 if (value > max) { 9408 return noNegativeZero(max); 9409 } 9410 return noNegativeZero(value); 9411} 9412 9413 9414 9415;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MSDIZVRW.js 9416 9417 9418 9419 9420 9421 9422 9423 9424
vendor: 10,593 bytes, lines 9425-9713
9425// src/components/tree/tree.component.ts 9426 9427 9428function syncCheckboxes(changedTreeItem, initialSync = false) { 9429 function syncParentItem(treeItem) { 9430 const children = treeItem.getChildrenItems({ includeDisabled: false }); 9431 if (children.length) { 9432 const allChecked = children.every((item) => item.selected); 9433 const allUnchecked = children.every((item) => !item.selected && !item.indeterminate); 9434 treeItem.selected = allChecked; 9435 treeItem.indeterminate = !allChecked && !allUnchecked; 9436 } 9437 } 9438 function syncAncestors(treeItem) { 9439 const parentItem = treeItem.parentElement; 9440 if (SlTreeItem.isTreeItem(parentItem)) { 9441 syncParentItem(parentItem); 9442 syncAncestors(parentItem); 9443 } 9444 } 9445 function syncDescendants(treeItem) { 9446 for (const childItem of treeItem.getChildrenItems()) { 9447 childItem.selected = initialSync ? treeItem.selected || childItem.selected : !childItem.disabled && treeItem.selected; 9448 syncDescendants(childItem); 9449 } 9450 if (initialSync) { 9451 syncParentItem(treeItem); 9452 } 9453 } 9454 syncDescendants(changedTreeItem); 9455 syncAncestors(changedTreeItem); 9456} 9457var SlTree = class extends ShoelaceElement { 9458 constructor() { 9459 super(); 9460 this.selection = "single"; 9461 this.clickTarget = null; 9462 this.localize = new chunk_6CTB5ZDJ_LocalizeController(this); 9463 // Initializes new items by setting the `selectable` property and the expanded/collapsed icons if any 9464 this.initTreeItem = (item) => { 9465 item.selectable = this.selection === "multiple"; 9466 ["expand", "collapse"].filter((status) => !!this.querySelector(`[slot="${status}-icon"]`)).forEach((status) => { 9467 const existingIcon = item.querySelector(`[slot="${status}-icon"]`); 9468 const expandButtonIcon = this.getExpandButtonIcon(status); 9469 if (!expandButtonIcon) return; 9470 if (existingIcon === null) { 9471 item.append(expandButtonIcon); 9472 } else if (existingIcon.hasAttribute("data-default")) { 9473 existingIcon.replaceWith(expandButtonIcon); 9474 } else { 9475 } 9476 }); 9477 }; 9478 this.handleTreeChanged = (mutations) => { 9479 for (const mutation of mutations) { 9480 const addedNodes = [...mutation.addedNodes].filter(SlTreeItem.isTreeItem); 9481 const removedNodes = [...mutation.removedNodes].filter(SlTreeItem.isTreeItem); 9482 addedNodes.forEach(this.initTreeItem); 9483 if (this.lastFocusedItem && removedNodes.includes(this.lastFocusedItem)) { 9484 this.lastFocusedItem = null; 9485 } 9486 } 9487 }; 9488 this.handleFocusOut = (event) => { 9489 const relatedTarget = event.relatedTarget; 9490 if (!relatedTarget || !this.contains(relatedTarget)) { 9491 this.tabIndex = 0; 9492 } 9493 }; 9494 this.handleFocusIn = (event) => { 9495 const target = event.target; 9496 if (event.target === this) { 9497 this.focusItem(this.lastFocusedItem || this.getAllTreeItems()[0]); 9498 } 9499 if (SlTreeItem.isTreeItem(target) && !target.disabled) { 9500 if (this.lastFocusedItem) { 9501 this.lastFocusedItem.tabIndex = -1; 9502 } 9503 this.lastFocusedItem = target; 9504 this.tabIndex = -1; 9505 target.tabIndex = 0; 9506 } 9507 }; 9508 this.addEventListener("focusin", this.handleFocusIn); 9509 this.addEventListener("focusout", this.handleFocusOut); 9510 this.addEventListener("sl-lazy-change", this.handleSlotChange); 9511 } 9512 async connectedCallback() { 9513 super.connectedCallback(); 9514 this.setAttribute("role", "tree"); 9515 this.setAttribute("tabindex", "0"); 9516 await this.updateComplete; 9517 this.mutationObserver = new MutationObserver(this.handleTreeChanged); 9518 this.mutationObserver.observe(this, { childList: true, subtree: true }); 9519 } 9520 disconnectedCallback() { 9521 var _a; 9522 super.disconnectedCallback(); 9523 (_a = this.mutationObserver) == null ? void 0 : _a.disconnect(); 9524 } 9525 // Generates a clone of the expand icon element to use for each tree item 9526 getExpandButtonIcon(status) { 9527 const slot = status === "expand" ? this.expandedIconSlot : this.collapsedIconSlot; 9528 const icon = slot.assignedElements({ flatten: true })[0]; 9529 if (icon) { 9530 const clone = icon.cloneNode(true); 9531 [clone, ...clone.querySelectorAll("[id]")].forEach((el) => el.removeAttribute("id")); 9532 clone.setAttribute("data-default", ""); 9533 clone.slot = `${status}-icon`; 9534 return clone; 9535 } 9536 return null; 9537 } 9538 selectItem(selectedItem) { 9539 const previousSelection = [...this.selectedItems]; 9540 if (this.selection === "multiple") { 9541 selectedItem.selected = !selectedItem.selected; 9542 if (selectedItem.lazy) { 9543 selectedItem.expanded = true; 9544 } 9545 syncCheckboxes(selectedItem); 9546 } else if (this.selection === "single" || selectedItem.isLeaf) { 9547 const items = this.getAllTreeItems(); 9548 for (const item of items) { 9549 item.selected = item === selectedItem; 9550 } 9551 } else if (this.selection === "leaf") { 9552 selectedItem.expanded = !selectedItem.expanded; 9553 } 9554 const nextSelection = this.selectedItems; 9555 if (previousSelection.length !== nextSelection.length || nextSelection.some((item) => !previousSelection.includes(item))) { 9556 Promise.all(nextSelection.map((el) => el.updateComplete)).then(() => { 9557 this.emit("sl-selection-change", { detail: { selection: nextSelection } }); 9558 }); 9559 } 9560 } 9561 getAllTreeItems() { 9562 return [...this.querySelectorAll("sl-tree-item")]; 9563 } 9564 focusItem(item) { 9565 item == null ? void 0 : item.focus(); 9566 } 9567 handleKeyDown(event) { 9568 if (!["ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft", "Home", "End", "Enter", " "].includes(event.key)) { 9569 return; 9570 } 9571 if (event.composedPath().some((el) => { 9572 var _a; 9573 return ["input", "textarea"].includes((_a = el == null ? void 0 : el.tagName) == null ? void 0 : _a.toLowerCase()); 9574 })) { 9575 return; 9576 } 9577 const items = this.getFocusableItems(); 9578 const isLtr = this.localize.dir() === "ltr"; 9579 const isRtl = this.localize.dir() === "rtl"; 9580 if (items.length > 0) { 9581 event.preventDefault(); 9582 const activeItemIndex = items.findIndex((item) => item.matches(":focus")); 9583 const activeItem = items[activeItemIndex]; 9584 const focusItemAt = (index) => { 9585 const item = items[chunk_HF7GESMZ_clamp(index, 0, items.length - 1)]; 9586 this.focusItem(item); 9587 }; 9588 const toggleExpand = (expanded) => { 9589 activeItem.expanded = expanded; 9590 }; 9591 if (event.key === "ArrowDown") { 9592 focusItemAt(activeItemIndex + 1); 9593 } else if (event.key === "ArrowUp") { 9594 focusItemAt(activeItemIndex - 1); 9595 } else if (isLtr && event.key === "ArrowRight" || isRtl && event.key === "ArrowLeft") { 9596 if (!activeItem || activeItem.disabled || activeItem.expanded || activeItem.isLeaf && !activeItem.lazy) { 9597 focusItemAt(activeItemIndex + 1); 9598 } else { 9599 toggleExpand(true); 9600 } 9601 } else if (isLtr && event.key === "ArrowLeft" || isRtl && event.key === "ArrowRight") { 9602 if (!activeItem || activeItem.disabled || activeItem.isLeaf || !activeItem.expanded) { 9603 focusItemAt(activeItemIndex - 1); 9604 } else { 9605 toggleExpand(false); 9606 } 9607 } else if (event.key === "Home") { 9608 focusItemAt(0); 9609 } else if (event.key === "End") { 9610 focusItemAt(items.length - 1); 9611 } else if (event.key === "Enter" || event.key === " ") { 9612 if (!activeItem.disabled) { 9613 this.selectItem(activeItem); 9614 } 9615 } 9616 } 9617 } 9618 handleClick(event) { 9619 const target = event.target; 9620 const treeItem = target.closest("sl-tree-item"); 9621 const isExpandButton = event.composedPath().some((el) => { 9622 var _a; 9623 return (_a = el == null ? void 0 : el.classList) == null ? void 0 : _a.contains("tree-item__expand-button"); 9624 }); 9625 if (!treeItem || treeItem.disabled || target !== this.clickTarget) { 9626 return; 9627 } 9628 if (isExpandButton) { 9629 treeItem.expanded = !treeItem.expanded; 9630 } else { 9631 this.selectItem(treeItem); 9632 } 9633 } 9634 handleMouseDown(event) { 9635 this.clickTarget = event.target; 9636 } 9637 handleSlotChange() { 9638 const items = this.getAllTreeItems(); 9639 items.forEach(this.initTreeItem); 9640 } 9641 async handleSelectionChange() { 9642 const isSelectionMultiple = this.selection === "multiple"; 9643 const items = this.getAllTreeItems(); 9644 this.setAttribute("aria-multiselectable", isSelectionMultiple ? "true" : "false"); 9645 for (const item of items) { 9646 item.selectable = isSelectionMultiple; 9647 } 9648 if (isSelectionMultiple) { 9649 await this.updateComplete; 9650 [...this.querySelectorAll(":scope > sl-tree-item")].forEach( 9651 (treeItem) => syncCheckboxes(treeItem, true) 9652 ); 9653 } 9654 } 9655 /** @internal Returns the list of tree items that are selected in the tree. */ 9656 get selectedItems() { 9657 const items = this.getAllTreeItems(); 9658 const isSelected = (item) => item.selected; 9659 return items.filter(isSelected); 9660 } 9661 /** @internal Gets focusable tree items in the tree. */ 9662 getFocusableItems() { 9663 const items = this.getAllTreeItems(); 9664 const collapsedItems = /* @__PURE__ */ new Set(); 9665 return items.filter((item) => { 9666 var _a; 9667 if (item.disabled) return false; 9668 const parent = (_a = item.parentElement) == null ? void 0 : _a.closest("[role=treeitem]"); 9669 if (parent && (!parent.expanded || parent.loading || collapsedItems.has(parent))) { 9670 collapsedItems.add(item); 9671 } 9672 return !collapsedItems.has(item); 9673 }); 9674 } 9675 render() { 9676 return x` 9677 <div 9678 part="base" 9679 class="tree" 9680 @click=${this.handleClick} 9681 @keydown=${this.handleKeyDown} 9682 @mousedown=${this.handleMouseDown} 9683 > 9684 <slot @slotchange=${this.handleSlotChange}></slot> 9685 <span hidden aria-hidden="true"><slot name="expand-icon"></slot></span> 9686 <span hidden aria-hidden="true"><slot name="collapse-icon"></slot></span> 9687 </div> 9688 `; 9689 } 9690}; 9691SlTree.styles = [component_styles_default, tree_styles_default]; 9692__decorateClass([ 9693 query_e("slot:not([name])") 9694], SlTree.prototype, "defaultSlot", 2); 9695__decorateClass([ 9696 query_e("slot[name=expand-icon]") 9697], SlTree.prototype, "expandedIconSlot", 2); 9698__decorateClass([ 9699 query_e("slot[name=collapse-icon]") 9700], SlTree.prototype, "collapsedIconSlot", 2); 9701__decorateClass([ 9702 property_n() 9703], SlTree.prototype, "selection", 2); 9704__decorateClass([ 9705 watch("selection") 9706], SlTree.prototype, "handleSelectionChange", 1); 9707 9708 9709 9710;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.J5ZM7LIC.js 9711/* unused harmony import specifier */ var chunk_J5ZM7LIC_SlTree; 9712 9713
9714// src/components/tree/tree.ts 9715var tree_default = (/* unused pure expression or super */ null && (chunk_J5ZM7LIC_SlTree)); 9716SlTree.define("sl-tree"); 9717 9718 9719 9720;// ./node_modules/@shoelace-style/shoelace/dist/components/tree/tree.js 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751;// ./node_modules/@shoelace-style/shoelace/dist/chunks/chunk.GTHX4FOE.js 9752/* unused harmony import specifier */ var chunk_GTHX4FOE_SlTreeItem; 9753 9754
9755// src/components/tree-item/tree-item.ts 9756var tree_item_default = (/* unused pure expression or super */ null && (chunk_GTHX4FOE_SlTreeItem)); 9757SlTreeItem.define("sl-tree-item"); 9758 9759 9760 9761;// ./node_modules/@shoelace-style/shoelace/dist/components/tree-item/tree-item.js 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789;// ./webpack.shoelace.source.js 9790 // icon, spinner 9791 // icon 9792 // no depends 9793 // icon 9794 // icon 9795 // no depends 9796 // icon 9797 // no depends 9798 // no depends 9799 // no depends 9800 // icon, icon-button 9801 // no depends 9802 // popup 9803 // no depends 9804 // checkbox, icon, spinner 9805 9806/******/ })() 9807;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.