@fluid-topics/ft-snap-scroll 0.1.15 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-snap-scroll.d.ts +2 -2
- package/build/ft-snap-scroll.inline-styles.js +762 -0
- package/build/ft-snap-scroll.js +131 -137
- package/build/ft-snap-scroll.light.js +379 -437
- package/build/ft-snap-scroll.min.js +414 -461
- package/build/index.d.ts +2 -0
- package/build/index.js +5 -0
- package/build/inline-styles.d.ts +2 -0
- package/build/inline-styles.js +4 -0
- package/package.json +6 -6
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
!function(){
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
5
|
+
* This code may only be used under the BSD style license found at
|
|
6
|
+
* http://polymer.github.io/LICENSE.txt
|
|
7
|
+
* The complete set of authors may be found at
|
|
8
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
9
|
+
* The complete set of contributors may be found at
|
|
10
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
11
|
+
* Code distributed by Google as part of the polymer project is also
|
|
12
|
+
* subject to an additional IP rights grant found at
|
|
13
|
+
* http://polymer.github.io/PATENTS.txt
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
|
+
*/
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,o=window.customElements,n=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,n){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(n))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=n.prototype.attributeChangedCallback,a=new Set(n.observedAttributes||[]);f(n,a,l);const h={elementClass:n,connectedCallback:n.prototype.connectedCallback,disconnectedCallback:n.prototype.disconnectedCallback,adoptedCallback:n.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:n.formAssociated,formAssociatedCallback:n.prototype.formAssociatedCallback,formDisabledCallback:n.prototype.formDisabledCallback,formResetCallback:n.prototype.formResetCallback,formStateRestoreCallback:n.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,h),this._definitionsByClass.set(n,h);let c=e.call(o,t);c||(c=p(t),i.call(o,t,c)),this===window.customElements&&(r.set(n,h),h.standInClass=c);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)s.delete(t),u(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(n),this._whenDefinedPromises.delete(t)),n}upgrade(){b.push(this),o.upgrade.apply(o,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const i=this._getDefinition(t);if(void 0!==i)return Promise.resolve(i.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,i,e){let o=this._awaitingUpgrade.get(i);o||this._awaitingUpgrade.set(i,o=new Set),e?o.add(t):o.delete(t)}},window.HTMLElement=function(){let i=a;if(i)return a=void 0,i;const e=r.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return i=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(i,this.constructor.prototype),n.set(i,e),i},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let i=t.getRootNode();if(!h(i)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),h(i)||(i=l.get(i)?.getRootNode()||document)}return i.customElements},p=i=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const o=c(e)||window.customElements,n=o._getDefinition(i);return n?u(e,n):s.set(e,o),e}connectedCallback(){const t=n.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=n.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){n.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=n.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=n.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=n.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=n.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,i,e)=>{if(0===i.size||void 0===e)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,n){const s=t.toLowerCase();if(i.has(s)){const t=this.getAttribute(s);o.call(this,s,n),e.call(this,s,t,n)}else o.call(this,s,n)});const n=t.prototype.removeAttribute;n&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(i.has(o)){const t=this.getAttribute(o);n.call(this,o),e.call(this,o,t,null)}else n.call(this,o)})},d=i=>{const e=Object.getPrototypeOf(i);if(e!==window.HTMLElement)return e===t||"HTMLElement"===e?.prototype?.constructor?.name?Object.setPrototypeOf(i,window.HTMLElement):d(e)},u=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),n.set(t,i),a=t;try{new i.elementClass}catch(t){d(i.elementClass),new i.elementClass}i.observedAttributes.forEach((e=>{t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=y.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let b=[document];const v=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){b.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&l.set(t,this),b.pop(),t}};v(ShadowRoot,"createElement",document),v(ShadowRoot,"importNode",document),v(Element,"insertAdjacentHTML");const g=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){b.push(this),e.set.call(this,t),b.pop()}})};if(g(Element,"innerHTML"),g(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,i=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const o=i.call(this,...e);return t.set(o,this),o},e.forEach((i=>{const e=window.ElementInternals.prototype,o=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==n.get(e).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...i)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class s{constructor(t){const i=new Map;t.forEach(((t,e)=>{const o=t.getAttribute("name"),n=i.get(o)||[];this[+e]=t,n.push(t),i.set(o,n)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),i=[];for(const e of t){const t=n.get(e);t&&!0!==t.formAssociated||i.push(e)}return new s(i)}})}}try{window.customElements.define("custom-element",null)}catch(t){const i=window.customElements.define;window.customElements.define=(t,e,o)=>{try{i.bind(window.customElements)(t,e,o)}catch(i){console.warn(t,e,o,i)}}}class t{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,i){this.callbacks=[t],this.debounce(i)}queue(t,i){this.callbacks.push(t),this.debounce(i)}cancel(){null!=this._debounce&&window.clearTimeout(this._debounce)}debounce(t){this.cancel(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout)}runCallbacks(){for(let t of this.callbacks)t();this.callbacks=[]}}
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2017 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
+
*/const i=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(e){e.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(e){e.createProperty(i.key,t)}};
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/function e(t){return(e,o)=>void 0!==o?((t,i,e)=>{i.constructor.createProperty(e,t)})(t,e,o):i(t,e)
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2017 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*/}function o(t){return e({...t,state:!0})}
|
|
33
|
+
/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2017 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
+
*/const n=({finisher:t,descriptor:i})=>(e,o)=>{var n;if(void 0===o){const o=null!==(n=e.originalKey)&&void 0!==n?n:e.key,s=null!=i?{kind:"method",placement:"prototype",key:o,descriptor:i(e.key)}:{...e,key:o};return null!=t&&(s.finisher=function(i){t(i,o)}),s}{const n=e.constructor;void 0!==i&&Object.defineProperty(e,o,i(o)),null==t||t(n,o)}}
|
|
38
|
+
/**
|
|
39
|
+
* @license
|
|
40
|
+
* Copyright 2017 Google LLC
|
|
41
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
42
|
+
*/;function s(t,i){return n({descriptor:e=>{const o={get(){var i,e;return null!==(e=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==e?e:null},enumerable:!0,configurable:!0};if(i){const i="symbol"==typeof e?Symbol():"__"+e;o.get=function(){var e,o;return void 0===this[i]&&(this[i]=null!==(o=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==o?o:null),this[i]}}return o}})}
|
|
43
|
+
/**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2021 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*/var r;const l=null!=(null===(r=window.HTMLSlotElement)||void 0===r?void 0:r.prototype.assignedElements)?(t,i)=>t.assignedElements(i):(t,i)=>t.assignedNodes(i).filter((t=>t.nodeType===Node.ELEMENT_NODE));const a=t=>i=>{window.customElements.get(t)||window.customElements.define(t,i)}
|
|
48
|
+
/**
|
|
49
|
+
* @license
|
|
50
|
+
* Copyright 2019 Google LLC
|
|
51
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
52
|
+
*/,h=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,c=Symbol(),p=new Map;class f{constructor(t,i){if(this._$cssResult$=!0,i!==c)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=p.get(this.cssText);return h&&void 0===t&&(p.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const d=t=>new f("string"==typeof t?t:t+"",c),u=(t,...i)=>{const e=1===t.length?t[0]:i.reduce(((i,e,o)=>i+(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.")})(e)+t[o+1]),t[0]);return new f(e,c)},y=(t,i)=>{h?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((i=>{const e=document.createElement("style"),o=window.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}))},b=h?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const e of t.cssRules)i+=e.cssText;return d(i)})(t):t
|
|
53
|
+
/**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2017 Google LLC
|
|
56
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
+
*/;var v;const g=window.trustedTypes,m=g?g.emptyScript:"",x=window.reactiveElementPolyfillSupport,w={toAttribute(t,i){switch(i){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},$=(t,i)=>i!==t&&(i==i||t==t),O={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:$};class S extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,e)=>{const o=this._$Eh(e,i);void 0!==o&&(this._$Eu.set(o,e),t.push(o))})),t}static createProperty(t,i=O){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,e,i);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(o){const n=this[t];this[i]=o,this.requestUpdate(t,n,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||O}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(b(t))}else void 0!==t&&i.push(b(t));return i}static _$Eh(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,e;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.call(t))}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return y(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,e){this._$AK(t,e)}_$ES(t,i,e=O){var o,n;const s=this.constructor._$Eh(t,e);if(void 0!==s&&!0===e.reflect){const r=(null!==(n=null===(o=e.converter)||void 0===o?void 0:o.toAttribute)&&void 0!==n?n:w.toAttribute)(i,e.type);this._$Ei=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Ei=null}}_$AK(t,i){var e,o,n;const s=this.constructor,r=s._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=s.getPropertyOptions(r),l=t.converter,a=null!==(n=null!==(o=null===(e=l)||void 0===e?void 0:e.fromAttribute)&&void 0!==o?o:"function"==typeof l?l:null)&&void 0!==n?n:w.fromAttribute;this._$Ei=r,this[r]=a(i,t.type),this._$Ei=null}}requestUpdate(t,i,e){let o=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||$)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$Ei!==t&&(void 0===this._$E_&&(this._$E_=new Map),this._$E_.set(t,e))):o=!1),!this.isUpdatePending&&o&&(this._$Ep=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(e)):this._$EU()}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(e)}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$E_&&(this._$E_.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$E_=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
|
|
58
|
+
/**
|
|
59
|
+
* @license
|
|
60
|
+
* Copyright 2017 Google LLC
|
|
61
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
+
*/
|
|
63
|
+
var k;S.finalized=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null==x||x({ReactiveElement:S}),(null!==(v=globalThis.reactiveElementVersions)&&void 0!==v?v:globalThis.reactiveElementVersions=[]).push("1.2.2");const C=globalThis.trustedTypes,E=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,N=`lit$${(Math.random()+"").slice(9)}$`,R="?"+N,z=`<${R}>`,M=document,F=(t="")=>M.createComment(t),U=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,A=/>/g,j=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,_=/'/g,D=/"/g,P=/^(?:script|style|textarea|title)$/i,I=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),H=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),K=new WeakMap,Z=M.createTreeWalker(M,129,null,!1),V=(t,i)=>{const e=t.length-1,o=[];let n,s=2===i?"<svg>":"",r=B;for(let i=0;i<e;i++){const e=t[i];let l,a,h=-1,c=0;for(;c<e.length&&(r.lastIndex=c,a=r.exec(e),null!==a);)c=r.lastIndex,r===B?"!--"===a[1]?r=L:void 0!==a[1]?r=A:void 0!==a[2]?(P.test(a[2])&&(n=RegExp("</"+a[2],"g")),r=j):void 0!==a[3]&&(r=j):r===j?">"===a[0]?(r=null!=n?n:B,h=-1):void 0===a[1]?h=-2:(h=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?j:'"'===a[3]?D:_):r===D||r===_?r=j:r===L||r===A?r=B:(r=j,n=void 0);const p=r===j&&t[i+1].startsWith("/>")?" ":"";s+=r===B?e+z:h>=0?(o.push(l),e.slice(0,h)+"$lit$"+e.slice(h)+N+p):e+N+(-2===h?(o.push(void 0),i):p)}const l=s+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==E?E.createHTML(l):l,o]};class X{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let n=0,s=0;const r=t.length-1,l=this.parts,[a,h]=V(t,i);if(this.el=X.createElement(a,e),Z.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=Z.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(N)){const e=h[s++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(N),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:n,name:i[2],strings:t,ctor:"."===i[1]?Q:"?"===i[1]?it:"@"===i[1]?et:G})}else l.push({type:6,index:n})}for(const i of t)o.removeAttribute(i)}if(P.test(o.tagName)){const t=o.textContent.split(N),i=t.length-1;if(i>0){o.textContent=C?C.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],F()),Z.nextNode(),l.push({type:2,index:++n});o.append(t[i],F())}}}else if(8===o.nodeType)if(o.data===R)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(N,t+1));)l.push({type:7,index:n}),t+=N.length-1}n++}}static createElement(t,i){const e=M.createElement("template");return e.innerHTML=t,e}}function q(t,i,e=t,o){var n,s,r,l;if(i===H)return i;let a=void 0!==o?null===(n=e._$Cl)||void 0===n?void 0:n[o]:e._$Cu;const h=U(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(s=null==a?void 0:a._$AO)||void 0===s||s.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=a:e._$Cu=a),void 0!==a&&(i=q(t,a._$AS(t,i.values),a,o)),i}class J{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,n=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:M).importNode(e,!0);Z.currentNode=n;let s=Z.nextNode(),r=0,l=0,a=o[0];for(;void 0!==a;){if(r===a.index){let i;2===a.type?i=new Y(s,s.nextSibling,this,t):1===a.type?i=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(i=new ot(s,this,t)),this.v.push(i),a=o[++l]}r!==(null==a?void 0:a.index)&&(s=Z.nextNode(),r++)}return n}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class Y{constructor(t,i,e,o){var n;this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cg=null===(n=null==o?void 0:o.isConnected)||void 0===n||n}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}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=q(this,t,i),U(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==H&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var i;return T(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==W&&U(this._$AH)?this._$AA.nextSibling.data=t:this.S(M.createTextNode(t)),this._$AH=t}T(t){var i;const{values:e,_$litType$:o}=t,n="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=X.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===n)this._$AH.m(e);else{const t=new J(n,this),i=t.p(this.options);t.m(e),this.S(i),this._$AH=t}}_$AC(t){let i=K.get(t.strings);return void 0===i&&K.set(t.strings,i=new X(t)),i}A(t){T(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const n of t)o===i.length?i.push(e=new Y(this.M(F()),this.M(F()),this,this.options)):e=i[o],e._$AI(n),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class G{constructor(t,i,e,o,n){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=n,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=W}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const n=this.strings;let s=!1;if(void 0===n)t=q(this,t,i,0),s=!U(t)||t!==this._$AH&&t!==H,s&&(this._$AH=t);else{const o=t;let r,l;for(t=n[0],r=0;r<n.length-1;r++)l=q(this,o[e+r],i,r),l===H&&(l=this._$AH[r]),s||(s=!U(l)||l!==this._$AH[r]),l===W?t=W:t!==W&&(t+=(null!=l?l:"")+n[r+1]),this._$AH[r]=l}s&&!o&&this.k(t)}k(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Q extends G{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===W?void 0:t}}const tt=C?C.emptyScript:"";class it extends G{constructor(){super(...arguments),this.type=4}k(t){t&&t!==W?this.element.setAttribute(this.name,tt):this.element.removeAttribute(this.name)}}class et extends G{constructor(t,i,e,o,n){super(t,i,e,o,n),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=q(this,t,i,0))&&void 0!==e?e:W)===H)return;const o=this._$AH,n=t===W&&o!==W||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==W&&(o===W||n);n&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class ot{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){q(this,t)}}const nt=window.litHtmlPolyfillSupport;
|
|
64
|
+
/**
|
|
65
|
+
* @license
|
|
66
|
+
* Copyright 2017 Google LLC
|
|
67
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
+
*/
|
|
69
|
+
var st,rt;null==nt||nt(X,Y),(null!==(k=globalThis.litHtmlVersions)&&void 0!==k?k:globalThis.litHtmlVersions=[]).push("2.1.3");class lt extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,e)=>{var o,n;const s=null!==(o=null==e?void 0:e.renderBefore)&&void 0!==o?o:i;let r=s._$litPart$;if(void 0===r){const t=null!==(n=null==e?void 0:e.renderBefore)&&void 0!==n?n:null;s._$litPart$=r=new Y(i.insertBefore(F(),t),t,void 0,null!=e?e:{})}return r._$AI(t),r})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return H}}lt.finalized=!0,lt._$litElement$=!0,null===(st=globalThis.litElementHydrateSupport)||void 0===st||st.call(globalThis,{LitElement:lt});const at=globalThis.litElementPolyfillSupport;null==at||at({LitElement:lt}),(null!==(rt=globalThis.litElementVersions)&&void 0!==rt?rt:globalThis.litElementVersions=[]).push("3.1.2");class ht{constructor(t,i,e,o,n){this.name=t,this.category=i,this.fallbackVariable=e,this.defaultValue=o,this.context=n,this._$cssResult$=!0,this.value=this.get()}get cssText(){return this.value.cssText}get styleSheet(){return this.value.styleSheet}toString(){return this.value.toString()}static create(t,i,e){return new ht(t,i,void 0,e)}static extend(t,i,e){return new ht(t,i.category,i,e)}static external(t,i){return new ht(t.name,t.category,t.fallbackVariable,t.defaultValue,i)}get(t){return u`var(${d(this.name)}, ${this.defaultCssValue(t)})`}defaultCssValue(t){return this.fallbackVariable?this.fallbackVariable.get(null!=t?t:this.defaultValue):d(null!=t?t:this.defaultValue)}lastResortDefaultValue(){var t,i;return null!==(t=this.defaultValue)&&void 0!==t?t:null===(i=this.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()}breadcrumb(){return this.fallbackVariable?[this.fallbackVariable.name,...this.fallbackVariable.breadcrumb()]:[]}}function ct(t,i){return d(`${t.name}: ${i}`)}const pt={colorPrimary:ht.create("--ft-color-primary","COLOR","#2196F3"),colorPrimaryVariant:ht.create("--ft-color-primary-variant","COLOR","#1976D2"),colorSecondary:ht.create("--ft-color-secondary","COLOR","#FFCC80"),colorSecondaryVariant:ht.create("--ft-color-secondary-variant","COLOR","#F57C00"),colorSurface:ht.create("--ft-color-surface","COLOR","#FFFFFF"),colorContent:ht.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),colorError:ht.create("--ft-color-error","COLOR","#B00020"),colorOutline:ht.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),colorOpacityHigh:ht.create("--ft-color-opacity-high","NUMBER","1"),colorOpacityMedium:ht.create("--ft-color-opacity-medium","NUMBER","0.74"),colorOpacityDisabled:ht.create("--ft-color-opacity-disabled","NUMBER","0.38"),colorOnPrimary:ht.create("--ft-color-on-primary","COLOR","#FFFFFF"),colorOnPrimaryHigh:ht.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),colorOnPrimaryMedium:ht.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnPrimaryDisabled:ht.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSecondary:ht.create("--ft-color-on-secondary","COLOR","#FFFFFF"),colorOnSecondaryHigh:ht.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),colorOnSecondaryMedium:ht.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnSecondaryDisabled:ht.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSurface:ht.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceHigh:ht.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceMedium:ht.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),colorOnSurfaceDisabled:ht.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),opacityContentOnSurfaceDisabled:ht.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),opacityContentOnSurfaceEnable:ht.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),opacityContentOnSurfaceHover:ht.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),opacityContentOnSurfaceFocused:ht.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),opacityContentOnSurfacePressed:ht.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),opacityContentOnSurfaceSelected:ht.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),opacityContentOnSurfaceDragged:ht.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),opacityPrimaryOnSurfaceDisabled:ht.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),opacityPrimaryOnSurfaceEnable:ht.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),opacityPrimaryOnSurfaceHover:ht.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),opacityPrimaryOnSurfaceFocused:ht.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),opacityPrimaryOnSurfacePressed:ht.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),opacityPrimaryOnSurfaceSelected:ht.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),opacityPrimaryOnSurfaceDragged:ht.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),opacitySurfaceOnPrimaryDisabled:ht.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),opacitySurfaceOnPrimaryEnable:ht.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),opacitySurfaceOnPrimaryHover:ht.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),opacitySurfaceOnPrimaryFocused:ht.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),opacitySurfaceOnPrimaryPressed:ht.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),opacitySurfaceOnPrimarySelected:ht.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),opacitySurfaceOnPrimaryDragged:ht.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),elevation00:ht.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),elevation01:ht.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation02:ht.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation03:ht.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),elevation04:ht.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),elevation06:ht.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),elevation08:ht.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),elevation12:ht.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),elevation16:ht.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),elevation24:ht.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),borderRadiusS:ht.create("--ft-border-radius-S","SIZE","4px"),borderRadiusM:ht.create("--ft-border-radius-M","SIZE","8px"),borderRadiusL:ht.create("--ft-border-radius-L","SIZE","12px"),borderRadiusXL:ht.create("--ft-border-radius-XL","SIZE","16px"),titleFont:ht.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),contentFont:ht.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),transitionDuration:ht.create("--ft-transition-duration","UNKNOWN","250ms"),transitionTimingFunction:ht.create("--ft-transition-timing-function","UNKNOWN","ease-in-out")};
|
|
70
|
+
/**
|
|
71
|
+
* @license
|
|
72
|
+
* Copyright 2021 Google LLC
|
|
73
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
+
*/class ft extends(function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:i,elementDefinitions:e,shadowRootOptions:o}=t;e&&!i&&(t.registry=new CustomElementRegistry,Object.entries(e).forEach((([i,e])=>t.registry.define(i,e))));const n=this.renderOptions.creationScope=this.attachShadow({...o,customElements:t.registry});return y(n,this.constructor.elementStyles),n}}}(lt)){getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),I`
|
|
75
|
+
${t.map((t=>I`
|
|
76
|
+
<style>${t}</style>
|
|
77
|
+
`))}
|
|
78
|
+
${this.getTemplate()}
|
|
79
|
+
`}updated(t){super.updated(t),setTimeout((()=>this.contentAvailableCallback(t)),0)}contentAvailableCallback(t){}}const dt=u`
|
|
80
|
+
.ft-no-text-select {
|
|
81
|
+
-webkit-touch-callout: none;
|
|
82
|
+
-webkit-user-select: none;
|
|
83
|
+
-khtml-user-select: none;
|
|
84
|
+
-moz-user-select: none;
|
|
85
|
+
-ms-user-select: none;
|
|
86
|
+
user-select: none;
|
|
87
|
+
}
|
|
88
|
+
`;var ut,yt,bt;const vt=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(bt=null===(yt=null===(ut=window.safari)||void 0===ut?void 0:ut.pushNotification)||void 0===yt?void 0:yt.toString())&&void 0!==bt?bt:""),gt=1;
|
|
89
|
+
/**
|
|
90
|
+
* @license
|
|
91
|
+
* Copyright 2017 Google LLC
|
|
92
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* @license
|
|
96
|
+
* Copyright 2018 Google LLC
|
|
97
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
+
*/
|
|
99
|
+
const mt=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==gt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.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((i=>t[i])).join(" ")+" "}update(t,[i]){var e,o;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(e=this.et)||void 0===e?void 0:e.has(t))&&this.st.add(t);return this.render(i)}const n=t.element.classList;this.st.forEach((t=>{t in i||(n.remove(t),this.st.delete(t))}));for(const t in i){const e=!!i[t];e===this.st.has(t)||(null===(o=this.et)||void 0===o?void 0:o.has(t))||(e?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return H}});var xt=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};const wt={color:ht.extend("--ft-ripple-color",pt.colorContent),primaryColor:ht.extend("--ft-ripple-primary-color",ht.extend("--ft-ripple-color",pt.colorPrimary)),secondaryColor:ht.extend("--ft-ripple-secondary-color",ht.extend("--ft-ripple-color",pt.colorSecondary)),opacityContentOnSurfacePressed:ht.external(pt.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:ht.external(pt.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:ht.external(pt.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:ht.external(pt.opacityContentOnSurfaceSelected,"Design system")};class $t extends ft{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed)},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var i,e;let{x:o,y:n}=this.getCoordinates(t),s=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-s.x:s.width/2),this.originY=Math.round(null!=n?n-s.y:s.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return I`
|
|
100
|
+
<style>
|
|
101
|
+
.ft-ripple .ft-ripple--effect,
|
|
102
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
103
|
+
width: ${this.rippleSize}px;
|
|
104
|
+
height: ${this.rippleSize}px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ft-ripple .ft-ripple--effect {
|
|
108
|
+
left: ${this.originX}px;
|
|
109
|
+
top: ${this.originY}px;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
112
|
+
<div class="${mt(t)}">
|
|
113
|
+
<div class="ft-ripple--background"></div>
|
|
114
|
+
<div class="ft-ripple--effect"></div>
|
|
115
|
+
</div>
|
|
116
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){super.updated(t),t.has("disabled")&&this.disabled&&this.endRipple(),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),n=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",n),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",n),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let o,n;return null!=i.x?({x:o,y:n}=i):null!=e.touches&&(o=e.touches[0].clientX,n=e.touches[0].clientY),{x:o,y:n}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}$t.elementDefinitions={},$t.styles=u`
|
|
117
|
+
:host {
|
|
118
|
+
display: contents;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ft-ripple {
|
|
122
|
+
position: absolute;
|
|
123
|
+
inset: 0;
|
|
124
|
+
pointer-events: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ft-ripple .ft-ripple--background,
|
|
132
|
+
.ft-ripple .ft-ripple--effect {
|
|
133
|
+
position: absolute;
|
|
134
|
+
opacity: 0;
|
|
135
|
+
background-color: ${wt.color};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background,
|
|
139
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
140
|
+
background-color: ${wt.secondaryColor};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background,
|
|
144
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
145
|
+
background-color: ${wt.primaryColor};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ft-ripple .ft-ripple--background {
|
|
149
|
+
top: 0;
|
|
150
|
+
left: 0;
|
|
151
|
+
height: 100%;
|
|
152
|
+
width: 100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ft-ripple .ft-ripple--effect,
|
|
156
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
157
|
+
border-radius: 50%;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ft-ripple .ft-ripple--effect {
|
|
161
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
162
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
166
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
167
|
+
left: 50%;
|
|
168
|
+
top: 50%;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
172
|
+
transform: translate(-50%, -50%);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
176
|
+
opacity: ${wt.opacityContentOnSurfaceHover};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
180
|
+
opacity: ${wt.opacityContentOnSurfaceSelected};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
184
|
+
opacity: ${wt.opacityContentOnSurfaceFocused};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
188
|
+
opacity: ${wt.opacityContentOnSurfacePressed};
|
|
189
|
+
transform: translate(-50%, -50%) scale(1);
|
|
190
|
+
}
|
|
191
|
+
`,xt([e({type:Boolean})],$t.prototype,"primary",void 0),xt([e({type:Boolean})],$t.prototype,"secondary",void 0),xt([e({type:Boolean})],$t.prototype,"unbounded",void 0),xt([e({type:Boolean})],$t.prototype,"activated",void 0),xt([e({type:Boolean})],$t.prototype,"selected",void 0),xt([e({type:Boolean})],$t.prototype,"disabled",void 0),xt([o()],$t.prototype,"hovered",void 0),xt([o()],$t.prototype,"focused",void 0),xt([o()],$t.prototype,"pressed",void 0),xt([o()],$t.prototype,"rippling",void 0),xt([o()],$t.prototype,"rippleSize",void 0),xt([o()],$t.prototype,"originX",void 0),xt([o()],$t.prototype,"originY",void 0),xt([s(".ft-ripple")],$t.prototype,"ripple",void 0),xt([s(".ft-ripple--effect")],$t.prototype,"rippleEffect",void 0),a("ft-ripple")($t);
|
|
192
|
+
/**
|
|
193
|
+
* @license
|
|
194
|
+
* Copyright 2020 Google LLC
|
|
195
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
196
|
+
*/
|
|
197
|
+
const Ot=t=>({_$litStatic$:t}),St=new Map,kt=(t=>(i,...e)=>{var o;const n=e.length;let s,r;const l=[],a=[];let h,c=0,p=!1;for(;c<n;){for(h=i[c];c<n&&void 0!==(r=e[c],s=null===(o=r)||void 0===o?void 0:o._$litStatic$);)h+=s+i[++c],p=!0;a.push(r),l.push(h),c++}if(c===n&&l.push(i[n]),p){const t=l.join("$$lit$$");void 0===(i=St.get(t))&&(l.raw=l,St.set(t,i=l)),e=a}return t(i,...e)})(I);var Ct,Et=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Ct||(Ct={}));const Nt=ht.extend("--ft-typography-font-family",pt.titleFont),Rt=ht.extend("--ft-typography-font-family",pt.contentFont),zt={fontFamily:Rt,fontSize:ht.create("--ft-typography-font-size","SIZE","16px"),fontWeight:ht.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:ht.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:ht.create("--ft-typography-line-height","SIZE","24px"),textTransform:ht.create("--ft-typography-text-transform","UNKNOWN","inherit")},Mt=ht.extend("--ft-typography-title-font-family",Nt),Ft=ht.extend("--ft-typography-title-font-size",zt.fontSize,"20px"),Ut=ht.extend("--ft-typography-title-font-weight",zt.fontWeight,"normal"),Tt=ht.extend("--ft-typography-title-letter-spacing",zt.letterSpacing,"0.15px"),Bt=ht.extend("--ft-typography-title-line-height",zt.lineHeight,"24px"),Lt=ht.extend("--ft-typography-title-text-transform",zt.textTransform,"inherit"),At=ht.extend("--ft-typography-title-dense-font-family",Nt),jt=ht.extend("--ft-typography-title-dense-font-size",zt.fontSize,"14px"),_t=ht.extend("--ft-typography-title-dense-font-weight",zt.fontWeight,"normal"),Dt=ht.extend("--ft-typography-title-dense-letter-spacing",zt.letterSpacing,"0.105px"),Pt=ht.extend("--ft-typography-title-dense-line-height",zt.lineHeight,"24px"),It=ht.extend("--ft-typography-title-dense-text-transform",zt.textTransform,"inherit"),Ht=ht.extend("--ft-typography-subtitle1-font-family",Rt),Wt=ht.extend("--ft-typography-subtitle1-font-size",zt.fontSize,"16px"),Kt=ht.extend("--ft-typography-subtitle1-font-weight",zt.fontWeight,"600"),Zt=ht.extend("--ft-typography-subtitle1-letter-spacing",zt.letterSpacing,"0.144px"),Vt=ht.extend("--ft-typography-subtitle1-line-height",zt.lineHeight,"24px"),Xt=ht.extend("--ft-typography-subtitle1-text-transform",zt.textTransform,"inherit"),qt=ht.extend("--ft-typography-subtitle2-font-family",Rt),Jt=ht.extend("--ft-typography-subtitle2-font-size",zt.fontSize,"14px"),Yt=ht.extend("--ft-typography-subtitle2-font-weight",zt.fontWeight,"normal"),Gt=ht.extend("--ft-typography-subtitle2-letter-spacing",zt.letterSpacing,"0.098px"),Qt=ht.extend("--ft-typography-subtitle2-line-height",zt.lineHeight,"24px"),ti=ht.extend("--ft-typography-subtitle2-text-transform",zt.textTransform,"inherit"),ii=ht.extend("--ft-typography-body1-font-family",Rt),ei=ht.extend("--ft-typography-body1-font-size",zt.fontSize,"16px"),oi=ht.extend("--ft-typography-body1-font-weight",zt.fontWeight,"normal"),ni=ht.extend("--ft-typography-body1-letter-spacing",zt.letterSpacing,"0.496px"),si=ht.extend("--ft-typography-body1-line-height",zt.lineHeight,"24px"),ri=ht.extend("--ft-typography-body1-text-transform",zt.textTransform,"inherit"),li=ht.extend("--ft-typography-body2-font-family",Rt),ai=ht.extend("--ft-typography-body2-font-size",zt.fontSize,"14px"),hi=ht.extend("--ft-typography-body2-font-weight",zt.fontWeight,"normal"),ci=ht.extend("--ft-typography-body2-letter-spacing",zt.letterSpacing,"0.252px"),pi=ht.extend("--ft-typography-body2-line-height",zt.lineHeight,"20px"),fi=ht.extend("--ft-typography-body2-text-transform",zt.textTransform,"inherit"),di=ht.extend("--ft-typography-caption-font-family",Rt),ui=ht.extend("--ft-typography-caption-font-size",zt.fontSize,"12px"),yi=ht.extend("--ft-typography-caption-font-weight",zt.fontWeight,"normal"),bi=ht.extend("--ft-typography-caption-letter-spacing",zt.letterSpacing,"0.396px"),vi=ht.extend("--ft-typography-caption-line-height",zt.lineHeight,"16px"),gi=ht.extend("--ft-typography-caption-text-transform",zt.textTransform,"inherit"),mi=ht.extend("--ft-typography-breadcrumb-font-family",Rt),xi=ht.extend("--ft-typography-breadcrumb-font-size",zt.fontSize,"10px"),wi=ht.extend("--ft-typography-breadcrumb-font-weight",zt.fontWeight,"normal"),$i=ht.extend("--ft-typography-breadcrumb-letter-spacing",zt.letterSpacing,"0.33px"),Oi=ht.extend("--ft-typography-breadcrumb-line-height",zt.lineHeight,"16px"),Si=ht.extend("--ft-typography-breadcrumb-text-transform",zt.textTransform,"inherit"),ki=ht.extend("--ft-typography-overline-font-family",Rt),Ci=ht.extend("--ft-typography-overline-font-size",zt.fontSize,"10px"),Ei=ht.extend("--ft-typography-overline-font-weight",zt.fontWeight,"normal"),Ni=ht.extend("--ft-typography-overline-letter-spacing",zt.letterSpacing,"1.5px"),Ri=ht.extend("--ft-typography-overline-line-height",zt.lineHeight,"16px"),zi=ht.extend("--ft-typography-overline-text-transform",zt.textTransform,"uppercase"),Mi={fontFamily:ht.extend("--ft-typography-button-font-family",Rt),fontSize:ht.extend("--ft-typography-button-font-size",zt.fontSize,"14px"),fontWeight:ht.extend("--ft-typography-button-font-weight",zt.fontWeight,"600"),letterSpacing:ht.extend("--ft-typography-button-letter-spacing",zt.letterSpacing,"1.246px"),lineHeight:ht.extend("--ft-typography-button-line-height",zt.lineHeight,"16px"),textTransform:ht.extend("--ft-typography-button-text-transform",zt.textTransform,"uppercase")},Fi=u`
|
|
198
|
+
.ft-typography--title {
|
|
199
|
+
font-family: ${Mt};
|
|
200
|
+
font-size: ${Ft};
|
|
201
|
+
font-weight: ${Ut};
|
|
202
|
+
letter-spacing: ${Tt};
|
|
203
|
+
line-height: ${Bt};
|
|
204
|
+
text-transform: ${Lt};
|
|
205
|
+
}
|
|
206
|
+
`,Ui=u`
|
|
207
|
+
.ft-typography--title-dense {
|
|
208
|
+
font-family: ${At};
|
|
209
|
+
font-size: ${jt};
|
|
210
|
+
font-weight: ${_t};
|
|
211
|
+
letter-spacing: ${Dt};
|
|
212
|
+
line-height: ${Pt};
|
|
213
|
+
text-transform: ${It};
|
|
214
|
+
}
|
|
215
|
+
`,Ti=u`
|
|
216
|
+
.ft-typography--subtitle1 {
|
|
217
|
+
font-family: ${Ht};
|
|
218
|
+
font-size: ${Wt};
|
|
219
|
+
font-weight: ${Kt};
|
|
220
|
+
letter-spacing: ${Zt};
|
|
221
|
+
line-height: ${Vt};
|
|
222
|
+
text-transform: ${Xt};
|
|
223
|
+
}
|
|
224
|
+
`,Bi=u`
|
|
225
|
+
.ft-typography--subtitle2 {
|
|
226
|
+
font-family: ${qt};
|
|
227
|
+
font-size: ${Jt};
|
|
228
|
+
font-weight: ${Yt};
|
|
229
|
+
letter-spacing: ${Gt};
|
|
230
|
+
line-height: ${Qt};
|
|
231
|
+
text-transform: ${ti};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
`,Li=u`
|
|
235
|
+
.ft-typography--body1 {
|
|
236
|
+
font-family: ${ii};
|
|
237
|
+
font-size: ${ei};
|
|
238
|
+
font-weight: ${oi};
|
|
239
|
+
letter-spacing: ${ni};
|
|
240
|
+
line-height: ${si};
|
|
241
|
+
text-transform: ${ri};
|
|
242
|
+
}
|
|
243
|
+
`,Ai=u`
|
|
244
|
+
.ft-typography--body2 {
|
|
245
|
+
font-family: ${li};
|
|
246
|
+
font-size: ${ai};
|
|
247
|
+
font-weight: ${hi};
|
|
248
|
+
letter-spacing: ${ci};
|
|
249
|
+
line-height: ${pi};
|
|
250
|
+
text-transform: ${fi};
|
|
251
|
+
}
|
|
252
|
+
`,ji=u`
|
|
253
|
+
.ft-typography--caption {
|
|
254
|
+
font-family: ${di};
|
|
255
|
+
font-size: ${ui};
|
|
256
|
+
font-weight: ${yi};
|
|
257
|
+
letter-spacing: ${bi};
|
|
258
|
+
line-height: ${vi};
|
|
259
|
+
text-transform: ${gi};
|
|
260
|
+
}
|
|
261
|
+
`,_i=u`
|
|
262
|
+
.ft-typography--breadcrumb {
|
|
263
|
+
font-family: ${mi};
|
|
264
|
+
font-size: ${xi};
|
|
265
|
+
font-weight: ${wi};
|
|
266
|
+
letter-spacing: ${$i};
|
|
267
|
+
line-height: ${Oi};
|
|
268
|
+
text-transform: ${Si};
|
|
269
|
+
}
|
|
270
|
+
`,Di=u`
|
|
271
|
+
.ft-typography--overline {
|
|
272
|
+
font-family: ${ki};
|
|
273
|
+
font-size: ${Ci};
|
|
274
|
+
font-weight: ${Ei};
|
|
275
|
+
letter-spacing: ${Ni};
|
|
276
|
+
line-height: ${Ri};
|
|
277
|
+
text-transform: ${zi};
|
|
278
|
+
}
|
|
279
|
+
`,Pi=u`
|
|
280
|
+
.ft-typography--button {
|
|
281
|
+
font-family: ${Mi.fontFamily};
|
|
282
|
+
font-size: ${Mi.fontSize};
|
|
283
|
+
font-weight: ${Mi.fontWeight};
|
|
284
|
+
letter-spacing: ${Mi.letterSpacing};
|
|
285
|
+
line-height: ${Mi.lineHeight};
|
|
286
|
+
text-transform: ${Mi.textTransform};
|
|
287
|
+
}
|
|
288
|
+
`;class Ii extends ft{constructor(){super(...arguments),this.variant=Ct.body1}render(){return this.element?kt`
|
|
289
|
+
<${Ot(this.element)}
|
|
290
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
291
|
+
<slot></slot>
|
|
292
|
+
</${Ot(this.element)}>
|
|
293
|
+
`:kt`
|
|
294
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
295
|
+
`}}Ii.styles=[Fi,Ui,Ti,Bi,Li,Ai,ji,_i,Di,Pi,u`
|
|
296
|
+
.ft-typography {
|
|
297
|
+
vertical-align: inherit;
|
|
298
|
+
}
|
|
299
|
+
`],Et([e()],Ii.prototype,"element",void 0),Et([e()],Ii.prototype,"variant",void 0),a("ft-typography")(Ii);
|
|
300
|
+
/**
|
|
301
|
+
* @license
|
|
302
|
+
* Copyright 2021 Google LLC
|
|
303
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
|
304
|
+
*/
|
|
305
|
+
const Hi=u`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`
|
|
306
|
+
/**
|
|
307
|
+
* @license
|
|
308
|
+
* Copyright 2018 Google LLC
|
|
309
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
310
|
+
*/;let Wi=class extends lt{render(){return I`<span><slot></slot></span>`}};Wi.styles=[Hi],Wi=
|
|
311
|
+
/*! *****************************************************************************
|
|
312
|
+
Copyright (c) Microsoft Corporation.
|
|
313
|
+
|
|
314
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
315
|
+
purpose with or without fee is hereby granted.
|
|
316
|
+
|
|
317
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
318
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
319
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
320
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
321
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
322
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
323
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
324
|
+
***************************************************************************** */
|
|
325
|
+
function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r}([(t=>i=>"function"==typeof i?((t,i)=>(window.customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:e,elements:o}=i;return{kind:e,elements:o,finisher(i){window.customElements.define(t,i)}}})(t,i))("mwc-icon")],Wi);var Ki=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};const Zi=ht.create("--ft-tooltip-distance","SIZE","4px"),Vi=ht.create("--ft-tooltip-color","COLOR","#FFFFFF"),Xi=ht.create("--ft-tooltip-background-color","COLOR","#666666"),qi=ht.create("--ft-tooltip-z-index","NUMBER","1"),Ji=ht.external(pt.borderRadiusS,"Design system");class Yi extends ft{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new t,this.revealDebouncer=new t}render(){return I`
|
|
326
|
+
<div part="container"
|
|
327
|
+
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
328
|
+
@mouseenter=${this.onHover}
|
|
329
|
+
@mouseleave=${this.onOut}
|
|
330
|
+
@focusin=${this.onHover}
|
|
331
|
+
@focusout=${this.onOut}
|
|
332
|
+
@touchstart=${this.onTouch}>
|
|
333
|
+
<div part="tooltip" class="ft-tooltip ft-tooltip--${this.position}" ?hidden=${!this.visible}>
|
|
334
|
+
<div part="tooltip-content" class="ft-tooltip--content">
|
|
335
|
+
<ft-typography variant="caption">${this.text}</ft-typography>
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
<slot></slot>
|
|
339
|
+
</div>
|
|
340
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2,n=this.tooltip.style;switch(this.position){case"top":n.top=-this.tooltip.clientHeight+"px",n.left=o+"px";break;case"bottom":n.top=i.height+"px",n.left=o+"px";break;case"left":n.top=e+"px",n.left=-this.tooltip.clientWidth+"px";break;case"right":n.top=e+"px",n.left=i.width+"px"}n.maxWidth=Math.max(i.width,150)+"px"}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}Yi.elementDefinitions={"ft-typography":Ii},Yi.styles=u`
|
|
341
|
+
.ft-tooltip--container {
|
|
342
|
+
display: block;
|
|
343
|
+
position: relative;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.ft-tooltip--inline {
|
|
347
|
+
display: inline-block;
|
|
348
|
+
max-width: 100%;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.ft-tooltip {
|
|
352
|
+
position: absolute;
|
|
353
|
+
box-sizing: border-box;
|
|
354
|
+
overflow: hidden;
|
|
355
|
+
width: max-content;
|
|
356
|
+
max-width: 150px;
|
|
357
|
+
text-align: center;
|
|
358
|
+
padding: ${Zi};
|
|
359
|
+
z-index: ${qi};
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.ft-tooltip--content {
|
|
363
|
+
padding: 4px 8px;
|
|
364
|
+
border-radius: ${Ji};
|
|
365
|
+
background-color: ${Xi};
|
|
366
|
+
color: ${Vi};
|
|
367
|
+
top: -500px;
|
|
368
|
+
left: -500px;
|
|
369
|
+
position: relative;
|
|
370
|
+
word-break: break-word;
|
|
371
|
+
}
|
|
372
|
+
`,Ki([e()],Yi.prototype,"text",void 0),Ki([e({type:Boolean})],Yi.prototype,"manual",void 0),Ki([e({type:Boolean})],Yi.prototype,"inline",void 0),Ki([e({type:Number})],Yi.prototype,"delay",void 0),Ki([e()],Yi.prototype,"position",void 0),Ki([
|
|
373
|
+
/**
|
|
374
|
+
* @license
|
|
375
|
+
* Copyright 2017 Google LLC
|
|
376
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
377
|
+
*/
|
|
378
|
+
function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},e?function(t){const{slot:i,selector:e}=null!=t?t:{};return n({descriptor:o=>({get(){var o;const n="slot"+(i?`[name=${i}]`:":not([name])"),s=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(n),r=null!=s?l(s,t):[];return e?r.filter((t=>t.matches(e))):r},enumerable:!0,configurable:!0})})}({slot:s,flatten:i,selector:e}):n({descriptor:t=>({get(){var t,i;const e="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e);return null!==(i=null==n?void 0:n.assignedNodes(o))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}("",!0)],Yi.prototype,"slotNodes",void 0),Ki([s(".ft-tooltip--container")],Yi.prototype,"container",void 0),Ki([s("slot")],Yi.prototype,"target",void 0),Ki([s(".ft-tooltip")],Yi.prototype,"tooltip",void 0),Ki([s(".ft-tooltip--content")],Yi.prototype,"tooltipContent",void 0),Ki([o()],Yi.prototype,"visible",void 0),a("ft-tooltip")(Yi);const Gi={color:ht.extend("--ft-loader-color",pt.colorPrimary),size:ht.create("--ft-loader-size","SIZE","80px")};class Qi extends ft{static get styles(){return u`
|
|
379
|
+
:host {
|
|
380
|
+
line-height: 0;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.ft-loader {
|
|
384
|
+
display: inline-block;
|
|
385
|
+
position: relative;
|
|
386
|
+
|
|
387
|
+
width: ${Gi.size};
|
|
388
|
+
height: ${Gi.size};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.ft-loader div {
|
|
392
|
+
position: absolute;
|
|
393
|
+
top: 37.5%;
|
|
394
|
+
width: 25%;
|
|
395
|
+
height: 25%;
|
|
396
|
+
border-radius: 50%;
|
|
397
|
+
background: ${Gi.color};
|
|
398
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.ft-loader div:nth-child(1) {
|
|
402
|
+
left: 2.5%;
|
|
403
|
+
animation: appear 0.6s infinite;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.ft-loader div:nth-child(2) {
|
|
407
|
+
left: 2.5%;
|
|
408
|
+
animation: move 0.6s infinite;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.ft-loader div:nth-child(3) {
|
|
412
|
+
left: 37.5%;
|
|
413
|
+
animation: move 0.6s infinite;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.ft-loader div:nth-child(4) {
|
|
417
|
+
left: 72.5%;
|
|
418
|
+
animation: disappear 0.6s infinite;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
@keyframes appear {
|
|
422
|
+
0% {
|
|
423
|
+
transform: scale(0);
|
|
424
|
+
}
|
|
425
|
+
100% {
|
|
426
|
+
transform: scale(1);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
@keyframes disappear {
|
|
431
|
+
0% {
|
|
432
|
+
transform: scale(1);
|
|
433
|
+
}
|
|
434
|
+
100% {
|
|
435
|
+
transform: scale(0);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
@keyframes move {
|
|
440
|
+
0% {
|
|
441
|
+
transform: translate(0, 0);
|
|
442
|
+
}
|
|
443
|
+
100% {
|
|
444
|
+
transform: translate(calc(0.35 * ${Gi.size}), 0);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
`}render(){return I`
|
|
448
|
+
<div class="ft-loader">
|
|
449
|
+
<div></div>
|
|
450
|
+
<div></div>
|
|
451
|
+
<div></div>
|
|
452
|
+
<div></div>
|
|
453
|
+
</div>
|
|
454
|
+
`}}a("ft-loader")(Qi);var te=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};const ie=ht.extend("--ft-button-color",pt.colorPrimary),ee={backgroundColor:ht.extend("--ft-button-background-color",pt.colorSurface),borderRadius:ht.extend("--ft-button-border-radius",pt.borderRadiusL),color:ie,fontSize:ht.extend("--ft-button-font-size",Mi.fontSize),iconSize:ht.create("--ft-button-icon-size","SIZE","24px"),rippleColor:ht.extend("--ft-button-ripple-color",ie),opacityDisabled:ht.external(pt.colorOpacityDisabled,"Design system")},oe=ht.extend("--ft-button-primary-color",ht.extend("--ft-button-color",pt.colorOnPrimary)),ne={backgroundColor:ht.extend("--ft-button-primary-background-color",ht.extend("--ft-button-background-color",pt.colorPrimary)),color:oe,rippleColor:ht.extend("--ft-button-primary-ripple-color",oe)},se=ht.extend("--ft-button-dense-border-radius",ht.extend("--ft-button-border-radius",pt.borderRadiusM));class re extends ft{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}static get styles(){return[dt,u`
|
|
455
|
+
:host {
|
|
456
|
+
display: inline-block;
|
|
457
|
+
max-width: 100%;
|
|
458
|
+
pointer-events: none;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
button {
|
|
462
|
+
box-shadow: 0px 0px 0px transparent;
|
|
463
|
+
border: 0px solid transparent;
|
|
464
|
+
text-shadow: 0px 0px 0px transparent;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
button:hover {
|
|
468
|
+
box-shadow: 0px 0px 0px transparent;
|
|
469
|
+
border: 0px solid transparent;
|
|
470
|
+
text-shadow: 0px 0px 0px transparent;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
button:active {
|
|
474
|
+
outline: none;
|
|
475
|
+
border: none;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
button:focus {
|
|
479
|
+
outline: 0;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.ft-button {
|
|
483
|
+
position: relative;
|
|
484
|
+
display: flex;
|
|
485
|
+
justify-content: center;
|
|
486
|
+
align-items: center;
|
|
487
|
+
width: 100%;
|
|
488
|
+
overflow: hidden;
|
|
489
|
+
box-sizing: border-box;
|
|
490
|
+
border: none;
|
|
491
|
+
pointer-events: auto;
|
|
492
|
+
|
|
493
|
+
--ft-button-internal-font-size: ${ee.fontSize};
|
|
494
|
+
--ft-button-internal-line-height: calc(var(--ft-button-internal-font-size) + 2px);
|
|
495
|
+
--ft-button-internal-color: ${ee.color};
|
|
496
|
+
--mdc-icon-size: ${ee.iconSize};
|
|
497
|
+
--ft-button-internal-vertical-padding: 6px;
|
|
498
|
+
--ft-button-internal-horizontal-padding: 8px;
|
|
499
|
+
${ct(wt.color,ee.rippleColor)};
|
|
500
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), var(--mdc-icon-size));
|
|
501
|
+
|
|
502
|
+
border-radius: ${ee.borderRadius};
|
|
503
|
+
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
504
|
+
background-color: ${ee.backgroundColor};
|
|
505
|
+
color: var(--ft-button-internal-color);
|
|
506
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.ft-button:not([disabled]):hover {
|
|
510
|
+
cursor: pointer;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.ft-button--dense {
|
|
514
|
+
--ft-button-internal-vertical-padding: 2px;
|
|
515
|
+
--ft-button-internal-horizontal-padding: 4px;
|
|
516
|
+
border-radius: ${se};
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.ft-button--round {
|
|
520
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + var(--ft-button-internal-vertical-padding));
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.ft-button[disabled] {
|
|
524
|
+
filter: grayscale(1);
|
|
525
|
+
opacity: ${ee.opacityDisabled};
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.ft-button.ft-button--primary {
|
|
529
|
+
background-color: ${ne.backgroundColor};
|
|
530
|
+
--ft-button-internal-color: ${ne.color};
|
|
531
|
+
${ct(wt.color,ne.rippleColor)};
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.ft-button.ft-button--outlined {
|
|
535
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
536
|
+
padding: calc(var(--ft-button-internal-vertical-padding) - 1px) calc(var(--ft-button-internal-horizontal-padding) - 1px);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.ft-button:focus {
|
|
540
|
+
outline: none;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.ft-button--label {
|
|
544
|
+
overflow: hidden;
|
|
545
|
+
white-space: nowrap;
|
|
546
|
+
text-overflow: ellipsis;
|
|
547
|
+
display: block;
|
|
548
|
+
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
549
|
+
${ct(Mi.fontSize,"var(--ft-button-internal-font-size)")};
|
|
550
|
+
${ct(Mi.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.ft-button--safari-fix .ft-button--label {
|
|
554
|
+
margin-right: 0;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.ft-button--safari-fix .ft-button--label:after {
|
|
558
|
+
content: "\\0000a0";
|
|
559
|
+
display: inline-block;
|
|
560
|
+
width: 0;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.ft-button--label[hidden] {
|
|
564
|
+
display: none;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
mwc-icon {
|
|
568
|
+
flex-shrink: 0;
|
|
569
|
+
width: var(--mdc-icon-size);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.ft-button--label[hidden] + mwc-icon {
|
|
573
|
+
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
574
|
+
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.ft-button:not(.ft-button--trailing-icon) mwc-icon,
|
|
578
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
579
|
+
order: -1;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
ft-loader {
|
|
583
|
+
${ct(Gi.size,ee.iconSize)};
|
|
584
|
+
${ct(Gi.color,"var(--ft-button-internal-color)")};
|
|
585
|
+
}
|
|
586
|
+
`]}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-button--safari-fix":vt,"ft-no-text-select":!0};return this.addTooltip(I`
|
|
587
|
+
<button part="button"
|
|
588
|
+
class="${mt(t)}"
|
|
589
|
+
aria-label="${this.getLabel()}"
|
|
590
|
+
?disabled=${this.isDisabled()}>
|
|
591
|
+
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
592
|
+
<ft-typography part="label"
|
|
593
|
+
variant="button"
|
|
594
|
+
class="ft-button--label"
|
|
595
|
+
?hidden=${!this.hasTextContent()}>
|
|
596
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
597
|
+
</ft-typography>
|
|
598
|
+
${this.resolveIcon()}
|
|
599
|
+
</button>
|
|
600
|
+
`)}addTooltip(t){return this.hasTextContent()||0===this.getLabel().trim().length?t:I`
|
|
601
|
+
<ft-tooltip part="tooltip"
|
|
602
|
+
text="${this.getLabel()}"
|
|
603
|
+
position="${this.tooltipPosition}">
|
|
604
|
+
${t}
|
|
605
|
+
</ft-tooltip>
|
|
606
|
+
`}resolveIcon(){return this.loading?I`
|
|
607
|
+
<ft-loader></ft-loader> `:this.icon?I`
|
|
608
|
+
<mwc-icon>${this.icon}</mwc-icon> `:W}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}re.elementDefinitions={"ft-ripple":$t,"ft-tooltip":Yi,"ft-typography":Ii,"mwc-icon":Wi,"ft-loader":Qi},te([e({type:Boolean})],re.prototype,"primary",void 0),te([e({type:Boolean})],re.prototype,"outlined",void 0),te([e({type:Boolean})],re.prototype,"disabled",void 0),te([e({type:Boolean})],re.prototype,"dense",void 0),te([e({type:Boolean})],re.prototype,"round",void 0),te([e({type:String})],re.prototype,"label",void 0),te([e({type:String})],re.prototype,"icon",void 0),te([e({type:Boolean})],re.prototype,"trailingIcon",void 0),te([e({type:Boolean})],re.prototype,"loading",void 0),te([e({type:String})],re.prototype,"tooltipPosition",void 0),te([s(".ft-button")],re.prototype,"button",void 0),te([s(".ft-button--label slot")],re.prototype,"slottedContent",void 0),a("ft-button")(re);var le=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};const ae={buttonsColor:ht.extend("--ft-snap-scroll-buttons-color",pt.colorPrimary),buttonsZIndex:ht.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:ht.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:ht.external(pt.colorSurface,"Design system")};class he extends CustomEvent{constructor(t,i){super("current-element-change",{detail:{index:t,element:i}})}}class ce extends ft{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new t(200),this.updateScrollDebouncer=new t(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let i=this.elements[t];if(i){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,e=this.contentSlot[this.scrollAttribute]+this.prevSize;(i[this.offsetAttribute]<e||i[this.offsetAttribute]+i[this.sizeAttribute]>t)&&this.scrollToElement(i)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=mt({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":vt}),i=this.controls&&this.withScroll;return I`
|
|
609
|
+
<div part="container" class="${t}">
|
|
610
|
+
<ft-button
|
|
611
|
+
class="ft-snap-scroll--previous"
|
|
612
|
+
part="controls"
|
|
613
|
+
primary
|
|
614
|
+
icon="${this.horizontal?"arrow_back_ios_new":"expand_less"}"
|
|
615
|
+
?hidden=${!i||this.startReached}
|
|
616
|
+
?disabled=${!i||this.startReached}
|
|
617
|
+
@click=${this.previous}
|
|
618
|
+
></ft-button>
|
|
619
|
+
<slot class="ft-snap-scroll--content"
|
|
620
|
+
part="content"
|
|
621
|
+
@slotchange=${this.onSlotChange}></slot>
|
|
622
|
+
<ft-button
|
|
623
|
+
class="ft-snap-scroll--next"
|
|
624
|
+
part="controls"
|
|
625
|
+
primary
|
|
626
|
+
icon="${this.horizontal?"arrow_forward_ios":"expand_more"}"
|
|
627
|
+
?hidden=${!i||this.endReached}
|
|
628
|
+
?disabled=${!i||this.endReached}
|
|
629
|
+
@click=${this.next}
|
|
630
|
+
></ft-button>
|
|
631
|
+
</div>
|
|
632
|
+
`}updated(t){var i;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(i=this.listenedContainer)||void 0===i||i.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new he(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const i=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<i&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var i,e;t&&(this.horizontal?null===(i=this.contentSlot)||void 0===i||i.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(e=this.contentSlot)||void 0===e||e.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,i;this.elements=null!==(i=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==i?i:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let i=0;i<this.elements.length;i++)(t<0||this.getDistanceFromStart(this.elements[i])<this.getDistanceFromStart(this.elements[t]))&&(t=i);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const i=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-i)}}ce.elementDefinitions={"ft-button":re},ce.styles=u`
|
|
633
|
+
.ft-snap-scroll {
|
|
634
|
+
box-sizing: border-box;
|
|
635
|
+
position: relative;
|
|
636
|
+
display: flex;
|
|
637
|
+
|
|
638
|
+
--ft-snap-scroll-transparent-color: transparent;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
642
|
+
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
643
|
+
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
644
|
+
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.ft-snap-scroll,
|
|
648
|
+
.ft-snap-scroll--content {
|
|
649
|
+
overflow: hidden;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.ft-snap-scroll--limit-size,
|
|
653
|
+
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
654
|
+
width: 100%;
|
|
655
|
+
height: 100%;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.ft-snap-scroll--content {
|
|
659
|
+
flex-grow: 1;
|
|
660
|
+
flex-shrink: 1;
|
|
661
|
+
box-sizing: border-box;
|
|
662
|
+
scroll-snap-align: start;
|
|
663
|
+
display: flex;
|
|
664
|
+
flex-wrap: nowrap;
|
|
665
|
+
align-items: flex-start;
|
|
666
|
+
justify-content: flex-start;
|
|
667
|
+
gap: ${ae.gap};
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
671
|
+
display: none;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
675
|
+
-ms-overflow-style: none;
|
|
676
|
+
scrollbar-width: none;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.ft-snap-scroll--content::slotted(*) {
|
|
680
|
+
flex-shrink: 0;
|
|
681
|
+
flex-grow: 1;
|
|
682
|
+
max-height: 100%;
|
|
683
|
+
max-width: 100%;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.ft-snap-scroll--horizontal,
|
|
687
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
688
|
+
width: 100%;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.ft-snap-scroll--vertical,
|
|
692
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
693
|
+
height: 100%;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
697
|
+
flex-direction: row;
|
|
698
|
+
overflow-x: auto;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
702
|
+
flex-direction: column;
|
|
703
|
+
overflow-y: auto;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.ft-snap-scroll--previous,
|
|
707
|
+
.ft-snap-scroll--next {
|
|
708
|
+
position: absolute;
|
|
709
|
+
display: flex;
|
|
710
|
+
z-index: ${ae.buttonsZIndex};
|
|
711
|
+
opacity: 1;
|
|
712
|
+
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
713
|
+
${ct(ee.backgroundColor,"transparent")};
|
|
714
|
+
${ct(ee.color,ae.buttonsColor)};
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.ft-snap-scroll--previous[hidden],
|
|
718
|
+
.ft-snap-scroll--next[hidden] {
|
|
719
|
+
z-index: -1;
|
|
720
|
+
opacity: 0;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous {
|
|
724
|
+
top: 0;
|
|
725
|
+
left: -1px;
|
|
726
|
+
bottom: 0;
|
|
727
|
+
background: linear-gradient(to right, ${ae.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
731
|
+
top: -1px;
|
|
732
|
+
left: 0;
|
|
733
|
+
right: 0;
|
|
734
|
+
background: linear-gradient(to bottom, ${ae.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
738
|
+
top: 0;
|
|
739
|
+
right: -1px;
|
|
740
|
+
bottom: 0;
|
|
741
|
+
background: linear-gradient(to left, ${ae.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
745
|
+
left: 0;
|
|
746
|
+
right: 0;
|
|
747
|
+
bottom: -1px;
|
|
748
|
+
background: linear-gradient(to top, ${ae.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
752
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
753
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
754
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
755
|
+
background-color: ${ae.colorSurface};
|
|
756
|
+
}
|
|
757
|
+
`,le([e({type:Boolean})],ce.prototype,"horizontal",void 0),le([e({type:Boolean})],ce.prototype,"hideScrollbar",void 0),le([e({type:Boolean})],ce.prototype,"controls",void 0),le([e({type:Boolean})],ce.prototype,"limitSize",void 0),le([o()],ce.prototype,"elements",void 0),le([o()],ce.prototype,"currentElement",void 0),le([o()],ce.prototype,"withScroll",void 0),le([o()],ce.prototype,"startReached",void 0),le([o()],ce.prototype,"endReached",void 0),le([s(".ft-snap-scroll--content")],ce.prototype,"contentSlot",void 0),a("ft-snap-scroll")(function t(i){var e;let o;if("elementDefinitions"in i){o={};const e=i.elementDefinitions;for(let i in e)o[i]=t(e[i])}return e=class extends i{constructor(...t){super(t),this._constructor=this.constructor}render(){var t;let e=null!==(t=i.styles)&&void 0!==t?t:[];return Array.isArray(e)||(e=[e]),I`
|
|
758
|
+
${e.map((t=>I`
|
|
759
|
+
<style>${t}</style>
|
|
760
|
+
`))}
|
|
761
|
+
${super.render()}
|
|
762
|
+
`}},e.styles=void 0,e.elementDefinitions=o,e}(ce))}();
|