@m3e/tooltip 1.1.10 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -3,38 +3,55 @@
3
3
  * Copyright (c) 2025 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{LitElement as t,html as e,unsafeCSS as s,css as i}from"lit";import{M3eAriaDescriber as o}from"@m3e/core/a11y";import{M3ePlatform as r}from"@m3e/core/platform";import{positionAnchor as n}from"@m3e/core/anchoring";import{M3eDirectionality as a}from"@m3e/core/bidi";import{HtmlFor as h,AttachInternals as l,HoverController as c,LongPressController as d,isDisabledMixin as p,DesignToken as u}from"@m3e/core";function f(t,e,s,i){var o,r=arguments.length,n=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(e,s,n):o(e,s))||n);return r>3&&n&&Object.defineProperty(e,s,n),n}function m(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function y(t,e,s,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,s):o?o.value=s:e.set(t,s),s}"function"==typeof SuppressedError&&SuppressedError;
6
+ import{ActionElementBase as t,HtmlFor as e,HoverController as i,LongPressController as s,isDisabledMixin as o,DesignToken as r,hasAssignedNodes as n,getTextContent as a}from"@m3e/core";import{LitElement as h,unsafeCSS as l,css as c,html as d}from"lit";import{M3eInteractivityChecker as p,M3eAriaDescriber as u}from"@m3e/core/a11y";import{M3eDirectionality as f}from"@m3e/core/bidi";import{M3ePlatform as m}from"@m3e/core/platform";import{positionAnchor as g}from"@m3e/core/anchoring";function b(t,e,i,s){var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}function v(t,e,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(t):s?s.value:e.get(t)}function $(t,e,i,s,o){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?o.call(t,i):o?o.value=i:e.set(t,i),i}"function"==typeof SuppressedError&&SuppressedError;
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
11
  */
12
- const b=globalThis,g=b.ShadowRoot&&(void 0===b.ShadyCSS||b.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,v=Symbol(),w=new WeakMap;
12
+ const _=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},y=globalThis,w=y.ShadowRoot&&(void 0===y.ShadyCSS||y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,A=Symbol(),S=new WeakMap;
13
13
  /**
14
14
  * @license
15
15
  * Copyright 2019 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
- */let _=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==v)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(g&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=w.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&w.set(e,t))}return t}toString(){return this.cssText}};const $=(t,e)=>{if(g)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),i=b.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=s.cssText,t.appendChild(e)}},E=g?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new _("string"==typeof t?t:t+"",void 0,v))(e)})(t):t,{is:S,defineProperty:P,getOwnPropertyDescriptor:C,getOwnPropertyNames:U,getOwnPropertySymbols:O,getPrototypeOf:k}=Object,x=globalThis,A=x.trustedTypes,T=A?A.emptyScript:"",M=x.reactiveElementPolyfillSupport,D=(t,e)=>t,R={toAttribute(t,e){switch(e){case Boolean:t=t?T:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},j=(t,e)=>!S(t,e),z={attribute:!0,type:String,converter:R,reflect:!1,useDefault:!1,hasChanged:j};
17
+ */let E=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==A)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(w&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=S.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&S.set(e,t))}return t}toString(){return this.cssText}};const x=w?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new E("string"==typeof t?t:t+"",void 0,A))(e)})(t):t,{is:P,defineProperty:k,getOwnPropertyDescriptor:C,getOwnPropertyNames:T,getOwnPropertySymbols:M,getPrototypeOf:U}=Object,O=globalThis,H=O.trustedTypes,N=H?H.emptyScript:"",R=O.reactiveElementPolyfillSupport,W=(t,e)=>t,D={toAttribute(t,e){switch(e){case Boolean:t=t?N:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){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}},z=(t,e)=>!P(t,e),j={attribute:!0,type:String,converter:D,reflect:!1,useDefault:!1,hasChanged:z};
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */Symbol.metadata??=Symbol("metadata"),x.litPropertyMetadata??=new WeakMap;class W 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,e=z){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&P(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=C(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const r=i?.call(this);o?.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??z}static _$Ei(){if(this.hasOwnProperty(D("elementProperties")))return;const t=k(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,e=[...U(t),...O(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(E(t))}else void 0!==t&&e.push(E(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"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?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $(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,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const o=(void 0!==s.converter?.toAttribute?s.converter:R).toAttribute(e,s.type);this._$Em=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:R;this._$Em=i;const r=o.fromAttribute(e,t.type);this[i]=r??this._$Ej?.get(i)??r,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const i=this.constructor,o=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??j)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:o},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==o||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===i&&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,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}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){}}W.elementStyles=[],W.shadowRootOptions={mode:"open"},W[D("elementProperties")]=new Map,W[D("finalized")]=new Map,M?.({ReactiveElement:W}),(x.reactiveElementVersions??=[]).push("2.1.1");
22
+ */Symbol.metadata??=Symbol("metadata"),O.litPropertyMetadata??=new WeakMap;class I 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,e=j){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&k(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=C(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const r=s?.call(this);o?.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??j}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;const t=U(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){const t=this.properties,e=[...T(t),...M(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(x(t))}else void 0!==t&&e.push(x(t));return e}static _$Eu(t,e){const i=e.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?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.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((t,e)=>{if(w)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),s=y.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(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,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:D).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:D;this._$Em=s;const r=o.fromAttribute(e,t.type);this[s]=r??this._$Ej?.get(s)??r,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const s=this.constructor,o=this[t];if(i??=s.getPropertyOptions(t),!((i.hasChanged??z)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==o||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&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,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}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){}}I.elementStyles=[],I.shadowRootOptions={mode:"open"},I[W("elementProperties")]=new Map,I[W("finalized")]=new Map,R?.({ReactiveElement:I}),(O.reactiveElementVersions??=[]).push("2.1.1");
23
23
  /**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
27
  */
28
- const L={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:j},N=(t=L,e,s)=>{const{kind:i,metadata:o}=s;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),r.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const o=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,o,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=s;return function(s){const o=this[i];e.call(this,s),this.requestUpdate(i,o,t)}}throw Error("Unsupported decorator location: "+i)};function q(t){return(e,s)=>"object"==typeof s?N(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}
28
+ const L={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:z},q=(t=L,e,i)=>{const{kind:s,metadata:o}=i;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,o,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];e.call(this,i),this.requestUpdate(s,o,t)}}throw Error("Unsupported decorator location: "+s)};function B(t){return(e,i)=>"object"==typeof i?q(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}
29
29
  /**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */var G,H,B,I,J,K,F,V,X,Q,Y;let Z=Y=class extends(h(l(t))){constructor(){super(...arguments),G.add(this),H.set(this,void 0),B.set(this,null),I.set(this,void 0),J.set(this,()=>this.hide()),K.set(this,new c(this,{target:null,endDelay:200,callback:t=>{t?this.show():this.hide()}})),F.set(this,new d(this,{target:null,callback:t=>{t?this.show():this.hide()}})),this.disabled=!1,this.position="below",this.touchGestures="auto"}get showDelay(){return m(this,K,"f").startDelay}set showDelay(t){m(this,K,"f").startDelay=t}get hideDelay(){return m(this,K,"f").endDelay}set hideDelay(t){m(this,K,"f").endDelay=t}attach(t){super.attach(t),m(this,H,"f")&&o.describe(t,m(this,H,"f")),r.iOS||r.Android?(m(this,F,"f").observe(t),m(this,G,"m",Q).call(this)):m(this,K,"f").observe(t),t.addEventListener("click",m(this,J,"f"))}detach(){this.control&&(m(this,H,"f")&&o.removeDescription(this.control,m(this,H,"f")),m(this,K,"f").unobserve(this.control),m(this,F,"f").observe(this.control),this.control.removeEventListener("click",m(this,J,"f")),this.hide()),super.detach()}connectedCallback(){super.connectedCallback(),this.ariaHidden="true"}update(t){super.update(t),t.has("disabled")&&this.disabled&&this.hide()}render(){return e`<div class="base" popover="manual" @toggle="${m(this,G,"m",X)}"><slot @slotchange="${m(this,G,"m",V)}"></slot></div>`}async show(){!this.control||this.disabled||p(this.control)&&this.control.disabled||(Y.__openTooltips.filter(t=>t!==this).forEach(t=>t.hide()),this._base.showPopover(),y(this,I,await n(this._base,this.control,{position:"above"===this.position?"top":"below"===this.position?"bottom":"before"===this.position?"ltr"===a.current?"left":"right":"ltr"===a.current?"right":"left",inline:!0,flip:!0,shift:!0,offset:4},(t,e)=>{"rtl"===a.current?(this._base.style.right=window.innerWidth-t-this._base.clientWidth+"px",this._base.style.left=""):(this._base.style.left=`${t}px`,this._base.style.right=""),this._base.style.top=`${e}px`}),"f"),Y.__openTooltips.includes(this)||Y.__openTooltips.push(this))}hide(){this._base.hidePopover(),m(this,I,"f")?.call(this),y(this,I,void 0,"f"),m(this,K,"f").clearDelays()}};H=new WeakMap,B=new WeakMap,I=new WeakMap,J=new WeakMap,K=new WeakMap,F=new WeakMap,G=new WeakSet,V=function(){this.isConnected&&this.control&&(m(this,H,"f")&&o.removeDescription(this.control,m(this,H,"f")),y(this,H,this.textContent,"f"),m(this,H,"f")&&o.describe(this.control,m(this,H,"f")))},X=function(t){if("open"===t.newState){const t=this._base.getBoundingClientRect().height>parseFloat(getComputedStyle(this._base).minHeight);this.classList.toggle("-multiline",t)}},Q=function(){if("off"!==this.touchGestures&&m(this,B,"f")){const t=m(this,B,"f").style;("on"===this.touchGestures||"INPUT"!==m(this,B,"f").nodeName&&"TEXTAREA"!==m(this,B,"f").nodeName)&&(t.userSelect=t.msUserSelect=t.webkitUserSelect=t.MozUserSelect="none"),"on"!==this.touchGestures&&m(this,B,"f").draggable||(t.webkitUserDrag="none"),t.touchAction="none",t.webkitTapHighlightColor="transparent"}},Z.styles=i`:host { display: contents; } .base { position: absolute; pointer-events: none; margin: unset; border: unset; word-break: normal; overflow-wrap: anywhere; padding: var(--m3e-tooltip-padding, 0.25rem 0.5rem); min-width: var(--m3e-tooltip-min-width, 2.5rem); max-width: var(--m3e-tooltip-max-width, 12.5rem); min-height: var(--m3e-tooltip-min-height, 1.5rem); max-height: var(--m3e-tooltip-max-height, 40vh); box-sizing: border-box; overflow: hidden; text-align: center; border-radius: var(--m3e-tooltip-shape, ${u.shape.corner.extraSmall}); background-color: var(--m3e-tooltip-container-color, ${u.color.inverseSurface}); color: var(--m3e-tooltip-supporting-text-color, ${u.color.inverseOnSurface}); font-size: var(--m3e-tooltip-supporting-text-font-size, ${u.typescale.standard.body.small.fontSize}); font-weight: var( --m3e-tooltip-supporting-text-font-weight, ${u.typescale.standard.body.small.fontWeight} ); line-height: var( --m3e-tooltip-supporting-text-line-height, ${u.typescale.standard.body.small.lineHeight} ); letter-spacing: var( --m3e-tooltip-supporting-text-tracking, ${u.typescale.standard.body.small.tracking} ); visibility: hidden; opacity: 0; transform: scale(0.8); transition: ${s(`opacity ${u.motion.duration.short3} ${u.motion.easing.standard}, \n transform ${u.motion.duration.short3} ${u.motion.easing.standard},\n overlay ${u.motion.duration.short3} ${u.motion.easing.standard} allow-discrete,\n visibility ${u.motion.duration.short3} ${u.motion.easing.standard} allow-discrete`)}; } :host(.-multiline) .base { text-align: start; } .base::backdrop { background-color: transparent; } .base:not(:popover-open) { visibility: hidden; opacity: 0; transform: scale(0.8); } .base:popover-open { visibility: visible; opacity: 1; transform: scale(1); } @starting-style { .base:popover-open { opacity: 0; transform: scale(0.8); } } @media (prefers-reduced-motion) { .base { transition: none; } } @media (forced-colors: active) { .base { background-color: Canvas; color: CanvasText; box-sizing: border-box; border: 1px solid CanvasText; } }`,Z.__openTooltips=new Array,f([
33
+ */function V(t){return B({...t,state:!0,attribute:!1})}
34
+ /**
35
+ * @license
36
+ * Copyright 2017 Google LLC
37
+ * SPDX-License-Identifier: BSD-3-Clause
38
+ */let F=class extends t{constructor(){super(...arguments),this.disableRestoreFocus=!1}_onClick(){this.closest("m3e-rich-tooltip")?.hide(!this.disableRestoreFocus)}};b([B({attribute:"disable-restore-focus",type:Boolean})],F.prototype,"disableRestoreFocus",void 0),F=b([_("m3e-rich-tooltip-action")],F);
39
+ /**
40
+ * @license
41
+ * Copyright 2017 Google LLC
42
+ * SPDX-License-Identifier: BSD-3-Clause
43
+ */
44
+ const G=globalThis,K=G.trustedTypes,J=K?K.createPolicy("lit-html",{createHTML:t=>t}):void 0,Z="$lit$",X=`lit$${Math.random().toFixed(9).slice(2)}$`,Q="?"+X,Y=`<${Q}>`,tt=document,et=()=>tt.createComment(""),it=t=>null===t||"object"!=typeof t&&"function"!=typeof t,st=Array.isArray,ot="[ \t\n\f\r]",rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,at=/>/g,ht=RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),lt=/'/g,ct=/"/g,dt=/^(?:script|style|textarea|title)$/i,pt=Symbol.for("lit-noChange"),ut=Symbol.for("lit-nothing"),ft=new WeakMap,mt=tt.createTreeWalker(tt,129);function gt(t,e){if(!st(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==J?J.createHTML(e):e}const bt=(t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":3===e?"<math>":"",n=rt;for(let e=0;e<i;e++){const i=t[e];let a,h,l=-1,c=0;for(;c<i.length&&(n.lastIndex=c,h=n.exec(i),null!==h);)c=n.lastIndex,n===rt?"!--"===h[1]?n=nt:void 0!==h[1]?n=at:void 0!==h[2]?(dt.test(h[2])&&(o=RegExp("</"+h[2],"g")),n=ht):void 0!==h[3]&&(n=ht):n===ht?">"===h[0]?(n=o??rt,l=-1):void 0===h[1]?l=-2:(l=n.lastIndex-h[2].length,a=h[1],n=void 0===h[3]?ht:'"'===h[3]?ct:lt):n===ct||n===lt?n=ht:n===nt||n===at?n=rt:(n=ht,o=void 0);const d=n===ht&&t[e+1].startsWith("/>")?" ":"";r+=n===rt?i+Y:l>=0?(s.push(a),i.slice(0,l)+Z+i.slice(l)+X+d):i+X+(-2===l?e:d)}return[gt(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class vt{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const n=t.length-1,a=this.parts,[h,l]=bt(t,e);if(this.el=vt.createElement(h,i),mt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=mt.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(Z)){const e=l[r++],i=s.getAttribute(t).split(X),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:n[2],strings:i,ctor:"."===n[1]?At:"?"===n[1]?St:"@"===n[1]?Et:wt}),s.removeAttribute(t)}else t.startsWith(X)&&(a.push({type:6,index:o}),s.removeAttribute(t));if(dt.test(s.tagName)){const t=s.textContent.split(X),e=t.length-1;if(e>0){s.textContent=K?K.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],et()),mt.nextNode(),a.push({type:2,index:++o});s.append(t[e],et())}}}else if(8===s.nodeType)if(s.data===Q)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(X,t+1));)a.push({type:7,index:o}),t+=X.length-1}o++}}static createElement(t,e){const i=tt.createElement("template");return i.innerHTML=t,i}}function $t(t,e,i=t,s){if(e===pt)return e;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const r=it(e)?void 0:e._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),void 0===r?o=void 0:(o=new r(t),o._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(e=$t(t,o._$AS(t,e.values),o,s)),e}class _t{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??tt).importNode(e,!0);mt.currentNode=s;let o=mt.nextNode(),r=0,n=0,a=i[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new yt(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new xt(o,this,t)),this._$AV.push(e),a=i[++n]}r!==a?.index&&(o=mt.nextNode(),r++)}return mt.currentNode=tt,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class yt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=ut,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=$t(this,t,e),it(t)?t===ut||null==t||""===t?(this._$AH!==ut&&this._$AR(),this._$AH=ut):t!==this._$AH&&t!==pt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>st(t)||"function"==typeof t?.[Symbol.iterator])(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!==ut&&it(this._$AH)?this._$AA.nextSibling.data=t:this.T(tt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=vt.createElement(gt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new _t(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=ft.get(t.strings);return void 0===e&&ft.set(t.strings,e=new vt(t)),e}k(t){st(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new yt(this.O(et()),this.O(et()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class wt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=ut,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ut}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=$t(this,t,e,0),r=!it(t)||t!==this._$AH&&t!==pt,r&&(this._$AH=t);else{const s=t;let n,a;for(t=o[0],n=0;n<o.length-1;n++)a=$t(this,s[i+n],e,n),a===pt&&(a=this._$AH[n]),r||=!it(a)||a!==this._$AH[n],a===ut?t=ut:t!==ut&&(t+=(a??"")+o[n+1]),this._$AH[n]=a}r&&!s&&this.j(t)}j(t){t===ut?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class At extends wt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ut?void 0:t}}class St extends wt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ut)}}class Et extends wt{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=$t(this,t,e,0)??ut)===pt)return;const i=this._$AH,s=t===ut&&i!==ut||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==ut&&(i===ut||s);s&&this.element.removeEventListener(this.name,this,i),o&&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 xt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){$t(this,t)}}const Pt=G.litHtmlPolyfillSupport;Pt?.(vt,yt),(G.litHtmlVersions??=[]).push("3.3.1");
45
+ /**
46
+ * @license
47
+ * Copyright 2018 Google LLC
48
+ * SPDX-License-Identifier: BSD-3-Clause
49
+ */
50
+ const kt=t=>t??ut;var Ct,Tt,Mt,Ut,Ot,Ht,Nt,Rt,Wt,Dt;class zt extends(e(h)){constructor(){super(...arguments),Ct.add(this),Mt.set(this,null),Ut.set(this,void 0),Ot.set(this,!1),Ht.set(this,()=>v(this,Ct,"m",Wt).call(this)),Nt.set(this,new i(this,{target:null,endDelay:200,callback:(t,e)=>{if(!this._isInteractive)if(t){if(e===this._base)return void $(this,Ot,!0,"f");this.show()}else v(this,Ot,"f")&&e!==this._base||($(this,Ot,!1,"f"),this.hide())}})),Rt.set(this,new s(this,{target:null,callback:t=>{this._isInteractive||(t?this.show():this.hide())}})),this.disabled=!1,this.touchGestures="auto"}get showDelay(){return v(this,Nt,"f").startDelay}set showDelay(t){v(this,Nt,"f").startDelay=t}get hideDelay(){return v(this,Nt,"f").endDelay}set hideDelay(t){v(this,Nt,"f").endDelay=t}get isOpen(){return Tt.__openTooltips.includes(this)}get _isInteractive(){return!1}attach(t){super.attach(t),m.iOS||m.Android?(v(this,Rt,"f").observe(t),v(this,Ct,"m",Dt).call(this)):v(this,Nt,"f").observe(t),t.addEventListener("click",v(this,Ht,"f"))}detach(){this.control&&(v(this,Nt,"f").unobserve(this.control),v(this,Rt,"f").observe(this.control),this.control.removeEventListener("click",v(this,Ht,"f")),this.hide()),super.detach()}update(t){super.update(t),t.has("disabled")&&this.disabled&&this.hide()}firstUpdated(t){super.firstUpdated(t),this._base&&v(this,Nt,"f").observe(this._base)}async show(){!this.control||this.disabled||o(this.control)&&this.control.disabled||(Tt.__openTooltips.filter(t=>t!==this).forEach(t=>t.hide()),this._base.showPopover(),$(this,Ut,await g(this._base,this.control,{position:this._anchorPosition,inline:!0,flip:!0,shift:!0,offset:4},(t,e)=>this._updatePosition(this._base,t,e)),"f"),Tt.__openTooltips.includes(this)||Tt.__openTooltips.push(this))}hide(){this._base.hidePopover(),v(this,Ut,"f")?.call(this),$(this,Ut,void 0,"f"),v(this,Nt,"f").clearDelays(),Tt.__openTooltips.includes(this)&&(Tt.__openTooltips=Tt.__openTooltips.filter(t=>t!==this))}}var jt,It,Lt,qt,Bt,Vt,Ft,Gt,Kt,Jt,Zt,Xt,Qt,Yt,te,ee;Tt=zt,Mt=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Ht=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,Ct=new WeakSet,Wt=function(){this._isInteractive?Tt.__openTooltips.includes(this)?this.hide():this.show():this.hide()},Dt=function(){if("off"!==this.touchGestures&&v(this,Mt,"f")){const t=v(this,Mt,"f").style;("on"===this.touchGestures||"INPUT"!==v(this,Mt,"f").nodeName&&"TEXTAREA"!==v(this,Mt,"f").nodeName)&&(t.userSelect=t.msUserSelect=t.webkitUserSelect=t.MozUserSelect="none"),"on"!==this.touchGestures&&v(this,Mt,"f").draggable||(t.webkitUserDrag="none"),t.touchAction="none",t.webkitTapHighlightColor="transparent"}},zt.__openTooltips=new Array,b([
34
51
  /**
35
52
  * @license
36
53
  * Copyright 2017 Google LLC
37
54
  * SPDX-License-Identifier: BSD-3-Clause
38
55
  */
39
- function(t){return(e,s,i)=>((t,e,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,s),s))(e,s,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}(".base")],Z.prototype,"_base",void 0),f([q({type:Boolean,reflect:!0})],Z.prototype,"disabled",void 0),f([q()],Z.prototype,"position",void 0),f([q({attribute:"show-delay",type:Number})],Z.prototype,"showDelay",null),f([q({attribute:"hide-delay",type:Number})],Z.prototype,"hideDelay",null),f([q({attribute:"touch-gestures"})],Z.prototype,"touchGestures",void 0),Z=Y=f([(t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("m3e-tooltip")],Z);export{Z as M3eTooltipElement};
56
+ function(t){return(e,i,s)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}(".base")],zt.prototype,"_base",void 0),b([B({type:Boolean,reflect:!0})],zt.prototype,"disabled",void 0),b([B({attribute:"show-delay",type:Number})],zt.prototype,"showDelay",null),b([B({attribute:"hide-delay",type:Number})],zt.prototype,"hideDelay",null),b([B({attribute:"touch-gestures"})],zt.prototype,"touchGestures",void 0);let ie=ee=class extends zt{constructor(){super(...arguments),jt.add(this),It.set(this,ee.__nextId++),Lt.set(this,""),qt.set(this,""),Bt.set(this,""),Vt.set(this,!1),this._hasSubhead=!1,this._interactive=!1,Ft.set(this,t=>v(this,jt,"m",Jt).call(this,t)),this.position="below-after"}get _isInteractive(){return this._interactive}get _anchorPosition(){switch(this.position){case"above":return"top";case"above-after":return"rtl"===f.current?"top-start":"top-end";case"above-before":return"rtl"===f.current?"top-end":"top-start";case"after":return"rtl"===f.current?"left":"right";case"before":return"rtl"===f.current?"right":"left";case"below":return"bottom";case"below-after":return"rtl"===f.current?"bottom-start":"bottom-end";case"below-before":return"rtl"===f.current?"bottom-end":"bottom-start"}}render(){const t=this._interactive&&this._hasSubhead?`m3e-rich-tooltip-${v(this,It,"f")}-subhead`:void 0;return d`<div class="base" popover="manual" role="${kt(this._interactive?"dialog":void 0)}" aria-labelledby="${kt(t)}" @keydown="${v(this,jt,"m",Zt)}" @beforetoggle="${v(this,jt,"m",Gt)}" @toggle="${v(this,jt,"m",Kt)}"><m3e-elevation level="3"></m3e-elevation><div class="subhead" id="${kt(t)}"><slot name="subhead" @slotchange="${v(this,jt,"m",Xt)}"></slot></div><div class="content"><slot @slotchange="${v(this,jt,"m",Qt)}"></slot></div><div class="actions"><slot name="actions" @slotchange="${v(this,jt,"m",Yt)}"></slot></div></div>`}show(){return this._interactive&&document.addEventListener("click",v(this,Ft,"f")),super.show()}hide(t=!0){this._interactive&&document.removeEventListener("click",v(this,Ft,"f")),super.hide(),t&&this._interactive&&this.control&&p.isFocusable(this.control)&&this.control.focus()}attach(t){super.attach(t),v(this,jt,"m",te).call(this),this._interactive&&(t.ariaHasPopup="dialog")}update(t){super.update(t),t.has("_interactive")&&(this.ariaHidden=this._interactive?null:"true",v(this,jt,"m",te).call(this),this.control&&this._interactive&&(this.control.ariaHasPopup="dialog"))}_updatePosition(t,e,i){this.position.includes("before")&&"before"!==this.position&&("rtl"===f.current?e+=this.control?.clientWidth??0:e-=this.control?.clientWidth??0),this.position.includes("after")&&"after"!==this.position&&("rtl"===f.current?e-=this.control?.clientWidth??0:e+=this.control?.clientWidth??0),"rtl"===f.current?(t.style.right=window.innerWidth-e-t.clientWidth+"px",t.style.left=""):(t.style.left=`${e}px`,t.style.right=""),t.style.top=`${i}px`}};var se,oe,re,ne;It=new WeakMap,Lt=new WeakMap,qt=new WeakMap,Bt=new WeakMap,Vt=new WeakMap,Ft=new WeakMap,jt=new WeakSet,Gt=function(t){const e=new ToggleEvent("beforetoggle",{oldState:t.oldState,newState:t.newState,bubbles:!0,composed:!0,cancelable:t.cancelable});this.dispatchEvent(e)||(t.preventDefault(),this.hide())},Kt=function(t){const e=new ToggleEvent("toggle",{oldState:t.oldState,newState:t.newState,bubbles:!0,composed:!0});this.dispatchEvent(e)},Jt=function(t){t.composedPath().some(t=>t instanceof ee||t===this.control)||this.hide()},Zt=function(t){"Escape"!==t.key||t.shiftKey||t.ctrlKey||(t.preventDefault(),this.hide())},Xt=function(t){this._hasSubhead=n(t.target),this.shadowRoot?.querySelector(".base")?.classList.toggle("has-subhead",this._hasSubhead),$(this,Lt,this._hasSubhead?a(t.target,!0):"","f"),v(this,jt,"m",te).call(this)},Qt=function(t){this._interactive=p.findInteractiveElements(this).length>0,$(this,qt,a(t.target,!0),"f"),v(this,jt,"m",te).call(this)},Yt=function(t){this.shadowRoot?.querySelector(".base")?.classList.toggle("has-actions",n(t.target)),this._interactive=p.findInteractiveElements(this).length>0,v(this,jt,"m",te).call(this)},te=function(){const t=v(this,Lt,"f")?`${v(this,Lt,"f")}/n${v(this,qt,"f")}`:v(this,qt,"f");this.isConnected&&this.control&&(v(this,Bt,"f")&&v(this,Vt,"f")&&(u.removeDescription(this.control,v(this,Bt,"f")),$(this,Vt,!1,"f")),$(this,Bt,t,"f"),v(this,Bt,"f")&&!this._interactive&&(u.describe(this.control,v(this,Bt,"f")),$(this,Vt,!0,"f")))},ie.styles=c`:host { display: contents; } .base { display: flex; flex-direction: column; position: absolute; padding: unset; margin: unset; border: unset; padding-block-start: var(--m3e-rich-tooltip-padding-top, 0.75rem); padding-inline: var(--m3e-rich-tooltip-padding-inline, 1rem); max-width: var(--m3e-rich-tooltip-max-width, 20rem); box-sizing: border-box; overflow: visible; border-radius: var(--m3e-rich-tooltip-shape, ${r.shape.corner.medium}); background-color: var(--m3e-rich-tooltip-container-color, ${r.color.surfaceContainer}); visibility: hidden; opacity: 0; transform: scale(0.8); transition: ${l(`opacity ${r.motion.duration.short3} ${r.motion.easing.standard}, \n transform ${r.motion.duration.short3} ${r.motion.easing.standard},\n overlay ${r.motion.duration.short3} ${r.motion.easing.standard} allow-discrete,\n visibility ${r.motion.duration.short3} ${r.motion.easing.standard} allow-discrete`)}; } .base:not(.has-actions) { padding-block-end: var(--m3e-rich-tooltip-padding-bottom, 0.75rem); } .base::backdrop { background-color: transparent; } .base:not(:popover-open) { visibility: hidden; opacity: 0; transform: scale(0.8); } .base:popover-open { visibility: visible; opacity: 1; transform: scale(1); } .base:not(.has-subhead) .subhead, .base:not(.has-actions) .actions { display: none; } .subhead { color: var(--m3e-rich-tooltip-subhead-color, ${r.color.onSurfaceVariant}); font-size: var(--m3e-rich-tooltip-subhead-font-size, ${r.typescale.standard.title.small.fontSize}); font-weight: var( --m3e-rich-tooltip-subhead-font-weight, ${r.typescale.standard.title.small.fontWeight} ); line-height: var( --m3e-rich-tooltip-subhead-line-height, ${r.typescale.standard.title.small.lineHeight} ); letter-spacing: var(--m3e-rich-tooltip-subhead-tracking, ${r.typescale.standard.title.small.tracking}); padding-block-end: var(--m3e-rich-tooltip-subhead-bottom-space, 0.25rem); } .content { color: var(--m3e-rich-tooltip-supporting-text-color, ${r.color.onSurfaceVariant}); font-size: var( --m3e-rich-tooltip-supporting-text-font-size, ${r.typescale.standard.body.medium.fontSize} ); font-weight: var( --m3e-rich-tooltip-supporting-text-font-weight, ${r.typescale.standard.body.medium.fontWeight} ); line-height: var( --m3e-rich-tooltip-supporting-text-line-height, ${r.typescale.standard.body.medium.lineHeight} ); letter-spacing: var( --m3e-rich-tooltip-supporting-text-tracking, ${r.typescale.standard.body.medium.tracking} ); } .actions { margin-inline: calc( 0px - calc( var(--m3e-rich-tooltip-padding-inline, 1rem) - var(--m3e-rich-tooltip-actions-padding-inline, 0.25rem) ) ); padding-block-start: var(--m3e-rich-tooltip-actions-top-space, 0.75rem); padding-block-end: var(--m3e-rich-tooltip-actions-bottom-space, 0.5rem); } ::slotted([slot="actions"]) { flex: none; display: flex; align-items: center; min-height: 1.5rem; column-gap: 0.5rem; } ::slotted([slot="actions"][end]) { justify-content: flex-end; } @starting-style { .base:popover-open { opacity: 0; transform: scale(0.8); } } @media (prefers-reduced-motion) { .base { transition: none; } } @media (forced-colors: active) { .base { background-color: Canvas; color: CanvasText; box-sizing: border-box; border: 1px solid CanvasText; } }`,ie.__nextId=0,b([V()],ie.prototype,"_hasSubhead",void 0),b([V()],ie.prototype,"_interactive",void 0),b([B()],ie.prototype,"position",void 0),ie=ee=b([_("m3e-rich-tooltip")],ie);let ae=class extends zt{constructor(){super(...arguments),se.add(this),oe.set(this,void 0),this.position="below"}get _anchorPosition(){return"above"===this.position?"top":"below"===this.position?"bottom":"before"===this.position?"ltr"===f.current?"left":"right":"ltr"===f.current?"right":"left"}attach(t){super.attach(t),v(this,oe,"f")&&u.describe(t,v(this,oe,"f"))}detach(){this.control&&v(this,oe,"f")&&u.removeDescription(this.control,v(this,oe,"f")),super.detach()}connectedCallback(){super.connectedCallback(),this.ariaHidden="true"}render(){return d`<div class="base" popover="manual" @toggle="${v(this,se,"m",ne)}"><slot @slotchange="${v(this,se,"m",re)}"></slot></div>`}_updatePosition(t,e,i){"rtl"===f.current?(t.style.right=window.innerWidth-e-t.clientWidth+"px",t.style.left=""):(t.style.left=`${e}px`,t.style.right=""),t.style.top=`${i}px`}};oe=new WeakMap,se=new WeakSet,re=function(t){const e=a(t.target,!0);this.isConnected&&this.control?(v(this,oe,"f")&&u.removeDescription(this.control,v(this,oe,"f")),$(this,oe,e,"f"),v(this,oe,"f")&&u.describe(this.control,v(this,oe,"f"))):$(this,oe,e,"f")},ne=function(t){if("open"===t.newState){const t=this._base.getBoundingClientRect().height>parseFloat(getComputedStyle(this._base).minHeight);this.classList.toggle("-multiline",t)}},ae.styles=c`:host { display: contents; } .base { position: absolute; pointer-events: none; margin: unset; border: unset; word-break: normal; overflow-wrap: anywhere; padding: var(--m3e-tooltip-padding, 0.25rem 0.5rem); min-width: var(--m3e-tooltip-min-width, 2.5rem); max-width: var(--m3e-tooltip-max-width, 12.5rem); min-height: var(--m3e-tooltip-min-height, 1.5rem); max-height: var(--m3e-tooltip-max-height, 40vh); box-sizing: border-box; overflow: hidden; text-align: center; border-radius: var(--m3e-tooltip-shape, ${r.shape.corner.extraSmall}); background-color: var(--m3e-tooltip-container-color, ${r.color.inverseSurface}); color: var(--m3e-tooltip-supporting-text-color, ${r.color.inverseOnSurface}); font-size: var(--m3e-tooltip-supporting-text-font-size, ${r.typescale.standard.body.small.fontSize}); font-weight: var( --m3e-tooltip-supporting-text-font-weight, ${r.typescale.standard.body.small.fontWeight} ); line-height: var( --m3e-tooltip-supporting-text-line-height, ${r.typescale.standard.body.small.lineHeight} ); letter-spacing: var( --m3e-tooltip-supporting-text-tracking, ${r.typescale.standard.body.small.tracking} ); visibility: hidden; opacity: 0; transform: scale(0.8); transition: ${l(`opacity ${r.motion.duration.short3} ${r.motion.easing.standard}, \n transform ${r.motion.duration.short3} ${r.motion.easing.standard},\n overlay ${r.motion.duration.short3} ${r.motion.easing.standard} allow-discrete,\n visibility ${r.motion.duration.short3} ${r.motion.easing.standard} allow-discrete`)}; } :host(.-multiline) .base { text-align: start; } .base::backdrop { background-color: transparent; } .base:not(:popover-open) { visibility: hidden; opacity: 0; transform: scale(0.8); } .base:popover-open { visibility: visible; opacity: 1; transform: scale(1); } @starting-style { .base:popover-open { opacity: 0; transform: scale(0.8); } } @media (prefers-reduced-motion) { .base { transition: none; } } @media (forced-colors: active) { .base { background-color: Canvas; color: CanvasText; box-sizing: border-box; border: 1px solid CanvasText; } }`,b([B()],ae.prototype,"position",void 0),ae=b([_("m3e-tooltip")],ae);export{F as M3eRichTooltipActionElement,ie as M3eRichTooltipElement,ae as M3eTooltipElement,zt as TooltipElementBase};
40
57
  //# sourceMappingURL=index.min.js.map