@telia-ace/widget-core-flamingo 1.1.67-rc.6 → 1.1.67-rc.7
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +8 -8
- package/index.mjs +24 -24
- package/package.json +1 -1
package/index.js
CHANGED
@@ -4,17 +4,17 @@
|
|
4
4
|
* @license
|
5
5
|
* Copyright 2019 Google LLC
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
7
|
-
*/const K=globalThis,$t=K.ShadowRoot&&(K.ShadyCSS===void 0||K.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_t=Symbol(),Ut=new WeakMap;let se=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==_t)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($t&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ut.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ut.set(e,t))}return t}toString(){return this.cssText}};const
|
7
|
+
*/const K=globalThis,$t=K.ShadowRoot&&(K.ShadyCSS===void 0||K.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_t=Symbol(),Ut=new WeakMap;let se=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==_t)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($t&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ut.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ut.set(e,t))}return t}toString(){return this.cssText}};const Ne=s=>new se(typeof s=="string"?s:s+"",void 0,_t),U=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new se(e,s,_t)},Me=(s,t)=>{if($t)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=K.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},It=$t?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Ne(e)})(s):s;/**
|
8
8
|
* @license
|
9
9
|
* Copyright 2017 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/const{is:Le,defineProperty:He,getOwnPropertyDescriptor:Be,getOwnPropertyNames:De,getOwnPropertySymbols:ze,getPrototypeOf:We}=Object,A=globalThis,kt=A.trustedTypes,Fe=kt?kt.emptyScript:"",at=A.reactiveElementPolyfillSupport,j=(s,t)=>s,J={toAttribute(s,t){switch(t){case Boolean:s=s?Fe:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},wt=(s,t)=>!Le(s,t),jt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:wt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),A.litPropertyMetadata??(A.litPropertyMetadata=new WeakMap);let O=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&He(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=Be(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;const t=We(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){const e=this.properties,i=[...De(e),...ze(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}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 r of i)e.unshift(It(r))}else t!==void 0&&e.push(It(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.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
|
11
|
+
*/const{is:Le,defineProperty:He,getOwnPropertyDescriptor:Be,getOwnPropertyNames:De,getOwnPropertySymbols:ze,getPrototypeOf:We}=Object,A=globalThis,kt=A.trustedTypes,Fe=kt?kt.emptyScript:"",at=A.reactiveElementPolyfillSupport,j=(s,t)=>s,J={toAttribute(s,t){switch(t){case Boolean:s=s?Fe:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},wt=(s,t)=>!Le(s,t),jt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:wt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),A.litPropertyMetadata??(A.litPropertyMetadata=new WeakMap);let O=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&He(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=Be(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;const t=We(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){const e=this.properties,i=[...De(e),...ze(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}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 r of i)e.unshift(It(r))}else t!==void 0&&e.push(It(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.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 Me(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var n;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:J).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:J;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??wt)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),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._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}};O.elementStyles=[],O.shadowRootOptions={mode:"open"},O[j("elementProperties")]=new Map,O[j("finalized")]=new Map,at==null||at({ReactiveElement:O}),(A.reactiveElementVersions??(A.reactiveElementVersions=[])).push("2.0.4");/**
|
12
12
|
* @license
|
13
13
|
* Copyright 2017 Google LLC
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
15
|
-
*/const
|
16
|
-
\f\r]`,k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
17
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Bt=/"/g,ae=/^(?:script|style|textarea|title)$/i,qe=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),T=qe(1),P=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Dt=new WeakMap,S=E.createTreeWalker(E,129);function ce(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return
|
15
|
+
*/const N=globalThis,X=N.trustedTypes,Nt=X?X.createPolicy("lit-html",{createHTML:s=>s}):void 0,re="$lit$",w=`lit$${(Math.random()+"").slice(9)}$`,ne="?"+w,Ye=`<${ne}>`,E=document,L=()=>E.createComment(""),H=s=>s===null||typeof s!="object"&&typeof s!="function",oe=Array.isArray,Ve=s=>oe(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ct=`[
|
16
|
+
\f\r]`,k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mt=/-->/g,Lt=/>/g,x=RegExp(`>|${ct}(?:([^\\s"'>=/]+)(${ct}*=${ct}*(?:[^
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ht=/'/g,Bt=/"/g,ae=/^(?:script|style|textarea|title)$/i,qe=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),T=qe(1),P=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Dt=new WeakMap,S=E.createTreeWalker(E,129);function ce(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Nt!==void 0?Nt.createHTML(t):t}const Ke=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=k;for(let a=0;a<e;a++){const c=s[a];let h,l,p=-1,f=0;for(;f<c.length&&(o.lastIndex=f,l=o.exec(c),l!==null);)f=o.lastIndex,o===k?l[1]==="!--"?o=Mt:l[1]!==void 0?o=Lt:l[2]!==void 0?(ae.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=x):l[3]!==void 0&&(o=x):o===x?l[0]===">"?(o=r??k,p=-1):l[1]===void 0?p=-2:(p=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?x:l[3]==='"'?Bt:Ht):o===Bt||o===Ht?o=x:o===Mt||o===Lt?o=k:(o=x,r=void 0);const d=o===x&&s[a+1].startsWith("/>")?" ":"";n+=o===k?c+Ye:p>=0?(i.push(h),c.slice(0,p)+re+c.slice(p)+w+d):c+w+(p===-2?a:d)}return[ce(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]};class B{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=Ke(t,e);if(this.el=B.createElement(h,i),S.currentNode=this.el.content,e===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=S.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(re)){const f=l[o++],d=r.getAttribute(p).split(w),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:n,name:g[2],strings:d,ctor:g[1]==="."?Ze:g[1]==="?"?Je:g[1]==="@"?Xe:et}),r.removeAttribute(p)}else p.startsWith(w)&&(c.push({type:6,index:n}),r.removeAttribute(p));if(ae.test(r.tagName)){const p=r.textContent.split(w),f=p.length-1;if(f>0){r.textContent=X?X.emptyScript:"";for(let d=0;d<f;d++)r.append(p[d],L()),S.nextNode(),c.push({type:2,index:++n});r.append(p[f],L())}}}else if(r.nodeType===8)if(r.data===ne)c.push({type:2,index:n});else{let p=-1;for(;(p=r.data.indexOf(w,p+1))!==-1;)c.push({type:7,index:n}),p+=w.length-1}n++}}static createElement(t,e){const i=E.createElement("template");return i.innerHTML=t,i}}function R(s,t,e=s,i){var o,a;if(t===P)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=H(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=R(s,r._$AS(s,t.values),r,i)),t}class Ge{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,r=((t==null?void 0:t.creationScope)??E).importNode(e,!0);S.currentNode=r;let n=S.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new W(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new Qe(n,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(n=S.nextNode(),o++)}return S.currentNode=E,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class W{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),H(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ve(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==u&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=B.createElement(ce(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Ge(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Dt.get(t.strings);return e===void 0&&Dt.set(t.strings,e=new B(t)),e}k(t){oe(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new W(this.S(L()),this.S(L()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(n===void 0)t=R(this,t,e,0),o=!H(t)||t!==this._$AH&&t!==P,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=R(this,a[i+c],e,c),h===P&&(h=this._$AH[c]),o||(o=!H(h)||h!==this._$AH[c]),h===u?t=u:t!==u&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!r&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ze extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class Je extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class Xe extends et{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??u)===P)return;const i=this._$AH,r=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==u&&(i===u||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Qe{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){R(this,t)}}const ht=N.litHtmlPolyfillSupport;ht==null||ht(B,W),(N.litHtmlVersions??(N.litHtmlVersions=[])).push("3.1.2");const ti=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new W(t.insertBefore(L(),n),n,void 0,e??{})}return r._$AI(s),r};/**
|
18
18
|
* @license
|
19
19
|
* Copyright 2017 Google LLC
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -54,7 +54,7 @@
|
|
54
54
|
* @license
|
55
55
|
* Copyright 2017 Google LLC
|
56
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
57
|
-
*/const
|
57
|
+
*/const M=(s,t)=>{var i;const e=s._$AN;if(e===void 0)return!1;for(const r of e)(i=r._$AO)==null||i.call(r,t,!1),M(r,t);return!0},Q=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},le=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),hi(t)}};function ai(s){this._$AN!==void 0?(Q(this),this._$AM=s,le(this)):this._$AM=s}function ci(s,t=!1,e=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)M(i[n],!1),Q(i[n]);else i!=null&&(M(i,!1),Q(i));else M(this,s)}const hi=s=>{s.type==At.CHILD&&(s._$AP??(s._$AP=ci),s._$AQ??(s._$AQ=ai))};class pe extends he{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),le(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,r;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),e&&(M(this,t),Q(this))}setValue(t){if(oi(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const li=new WeakMap;let zt=0;const pt=new Map,Wt=new WeakSet,Ft=()=>new Promise(s=>requestAnimationFrame(s)),pi=[{transform:"translateX(100%) scale(0)",opacity:0}],Yt=(s,t)=>{const e=s-t;return e===0?void 0:e},Vt=(s,t)=>{const e=s/t;return e===1?void 0:e},ut={left:(s,t)=>{const e=Yt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(s,t)=>{const e=Yt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateY(${e}px)`}},width:(s,t)=>{let e;t===0&&(t=1,e={width:"1px"});const i=Vt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(s,t)=>{let e;t===0&&(t=1,e={height:"1px"});const i=Vt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},ui={duration:333,easing:"ease-in-out"},di=["left","top","width","height","opacity","color","background"],qt=new WeakMap;class fi extends pe{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===At.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;(t=this.resolveFinished)==null||t.call(this),this.finished=new Promise(e=>{this.l=e})}async resolveFinished(){var t;(t=this.l)==null||t.call(this),this.l=void 0}render(t){return u}getController(){return li.get(this.u)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[e]){var r;const i=this.u===void 0;return i&&(this.u=(r=t.options)==null?void 0:r.host,this.u.addController(this),this.u.updateComplete.then(n=>this.t=!0),this.element=t.element,qt.set(this.element,this)),this.optionsOrCallback=e,(i||typeof e!="function")&&this.p(e),this.render(e)}p(t){t=t??{};const e=this.getController();e!==void 0&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=di),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(r=>{const n=e[r]??(ut[r]?void 0:i[r]),o=Number(n);t[r]=isNaN(o)?n+"":o}),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((i,r)=>{if(Array.isArray(i)){if(Array.isArray(r)&&r.length===i.length&&i.every((n,o)=>n===r[o]))return!1}else if(r===i)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),this.h}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await Ft;const e=this.O(),i=this.j(this.options.keyframeOptions,e),r=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,r,e);this.log("measured",[this.A,r,n,o]),t=this.calculateKeyframes(n,o)}else{const n=pt.get(this.options.inId);if(n){pt.delete(this.options.inId);const{from:o,to:a}=this.N(n,r,e);t=this.calculateKeyframes(o,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,zt++,t.forEach(c=>c.zIndex=zt)}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var t,e;this.P=this.element.getAttribute("style"),(t=this.webAnimation)==null||t.commitStyles(),(e=this.webAnimation)==null||e.cancel()}reconnected(){}async disconnected(){var e;if(!this.h||(this.options.id!==void 0&&pt.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Ft(),(e=this.i)==null?void 0:e.isConnected){const i=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,i),this.options.stabilizeOut){const r=this.m();this.log("stabilizing out");const n=this.A.left-r.left,o=this.A.top-r.top;getComputedStyle(this.element).position!=="static"||n===0&&o===0||(this.element.style.position="relative"),n!==0&&(this.element.style.left=n+"px"),o!==0&&(this.element.style.top=o+"px")}}const t=this.j(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;(e=(t=this.options).onStart)==null||e.call(t,this)}didFinish(t){var e,i;t&&((i=(e=this.options).onComplete)==null||i.call(e,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const t=[];for(let e=this.element.parentNode;e;e=e==null?void 0:e.parentNode){const i=qt.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Wt.has(this.u);return t||this.u.updateComplete.then(()=>{Wt.add(this.u)}),t}j(t,e=this.O()){const i={...ui};return e.forEach(r=>Object.assign(i,r.options.keyframeOptions)),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const r=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let n=1,o=1;return r.length>0&&(r.forEach(a=>{a.width&&(n/=a.width),a.height&&(o/=a.height)}),t.left!==void 0&&e.left!==void 0&&(t.left=n*t.left,e.left=n*e.left),t.top!==void 0&&e.top!==void 0&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,i=!1){const r={},n={};let o=!1;const a={};for(const c in e){const h=t[c],l=e[c];if(c in ut){const p=ut[c];if(h===void 0||l===void 0)continue;const f=p(h,l);f.transform!==void 0&&(a[c]=f.value,o=!0,r.transform=`${r.transform??""} ${f.transform}`,f.overrideFrom!==void 0&&Object.assign(r,f.overrideFrom))}else h!==l&&h!==void 0&&l!==void 0&&(o=!0,r[c]=h,n[c]=l)}return r.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[r,n]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),t!==void 0)){this.log("animate",[t,e]),i=!0,this.webAnimation=this.element.animate(t,e);const r=this.getController();r==null||r.add(this);try{await this.webAnimation.finished}catch{}r==null||r.remove(this)}return this.didFinish(i),i}isAnimating(){var t,e;return((t=this.webAnimation)==null?void 0:t.playState)==="running"||((e=this.webAnimation)==null?void 0:e.pending)}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}const gi=xt(fi),mi={name:"question",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9827 16.5432 47.4568 4.01731 32 4ZM32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.30769 18.9151 18.9151 8.30769 32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6775 45.0788 45.0788 55.6775 32 55.6923Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9423 37.5723L36.311 32.9068L36.7354 32.4448C39.7555 29.1161 40.7645 27.0647 40.7645 24.5087C40.7645 23.1091 40.4251 21.7942 39.7041 20.6491C38.3044 18.3587 35.6323 16.9166 32.2816 16.9166C28.7565 16.9166 25.3125 18.7414 23.2581 21.6772L23.1201 21.8791C22.8232 22.3032 22.696 22.6849 22.696 22.9818C22.696 23.7029 23.926 25.9932 25.2833 25.9932C25.5378 25.9932 25.7922 25.9084 26.0467 25.7388C26.2588 25.5691 26.5981 25.2298 27.0647 24.7208C28.8885 22.6849 30.1185 21.9215 31.7726 21.9215C33.6813 21.9215 35.081 23.1939 35.081 24.8905C35.081 26.375 34.2751 27.7746 32.3664 29.8529L28.2523 34.2216C27.9554 34.6033 27.7857 34.9426 27.7857 35.282C27.7857 35.6213 27.9978 36.1726 28.4219 36.8937C29.0581 37.8692 29.7368 38.3782 30.4578 38.3782C30.9244 38.3782 31.3909 38.1237 31.9423 37.5723ZM30.882 47.4972C29.2278 47.4972 27.6585 44.7403 27.6585 43.6799C27.6585 42.1954 30.0761 40.6261 32.4089 40.6261C33.6389 40.6261 34.2751 41.1775 34.2751 42.3227C34.2751 44.0616 33.4692 45.843 32.4513 46.7761C31.9423 47.2427 31.4334 47.4972 30.882 47.4972Z"/></svg>'};/**
|
58
58
|
* @license
|
59
59
|
* Copyright 2018 Google LLC
|
60
60
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -362,8 +362,8 @@
|
|
362
362
|
opacity: 0;
|
363
363
|
animation: slideDown 0.3s linear;
|
364
364
|
}
|
365
|
-
`;Ti([m({attribute:!1}),Ei({context:me})],rt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(p=>{const f=i(p),d=l[f.definitionId];if(!d){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(d.type,d.type);g&&(g.name=f.definitionId,g.application=e,d.properties&&g.writeProperties(d.properties),d.context&&g.writeContext(d.context),d.layout&&g.writeLayout(d.layout),c.addChild(g),d.children&&r(a,g,d.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return new rt}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Ct;const r=new i;return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const ve=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=ve.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let ye=ve;ye.ResolveWebComponentName=s=>`ace-${s}`;class be{constructor(t){this.widgetId=t}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}set(t,e){sessionStorage.setItem(this._prefixKey(t),e)}get(t){const e=sessionStorage.getItem(this._prefixKey(t));if(!e)return null;try{return JSON.parse(e)}catch{return e}}}class Ui{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class $e{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new Ui,this.renderStrategy=y.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new ye,this.components=[],this.trigger=null,this.renderStrategy=this.options.renderStrategy||y.Inline,this.triggerIcon=this.options.triggerIcon,this.storage=new be(this.id),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ie.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open","true")}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open","false")}mute(){this.
|
365
|
+
`;Ti([m({attribute:!1}),Ei({context:me})],rt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(p=>{const f=i(p),d=l[f.definitionId];if(!d){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(d.type,d.type);g&&(g.name=f.definitionId,g.application=e,d.properties&&g.writeProperties(d.properties),d.context&&g.writeContext(d.context),d.layout&&g.writeLayout(d.layout),c.addChild(g),d.children&&r(a,g,d.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return new rt}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Ct;const r=new i;return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const ve=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=ve.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let ye=ve;ye.ResolveWebComponentName=s=>`ace-${s}`;class be{constructor(t){this.widgetId=t}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}set(t,e){sessionStorage.setItem(this._prefixKey(t),e)}get(t){const e=sessionStorage.getItem(this._prefixKey(t));if(!e)return null;try{return JSON.parse(e)}catch{return e}}}class Ui{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class $e{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new Ui,this.renderStrategy=y.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new ye,this.components=[],this.trigger=null,this.renderStrategy=this.options.renderStrategy||y.Inline,this.triggerIcon=this.options.triggerIcon,this.storage=new be(this.id),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ie.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open","true")}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open","false")}mute(){this.storage.set("muteAudioNotifications","true")}unmute(){this.storage.set("muteAudioNotifications","false")}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===y.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new it,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===y.Trigger){const t=new _;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const Ii=s=>new D(s),_e=class{constructor(s=_e.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,apps:e.widgets.map(i=>{let r=y.Inline;return i.renderStrategy==="Trigger"&&(r=y.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let D=_e;D.endpoint="https://widgets.ace.teliacompany.net/api";class we{constructor(){this.applications=[],this.container=new bt("environment",this),setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate()}async activate(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}registerApp(t,e,i,r){const n=new bt(e,this),o=new $e(t,e,n,i,r);this.applications.push(o)}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Ae{constructor(t){this.configurations=[],this.httpClient=new D,this.httpClient=new D,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new we,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),await this.environment.bootstrap()}addGlobal(t){globalThis.widgets=t}}var ki=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,St=(s,t,e,i)=>{for(var r=i>1?void 0:i?ji(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ki(t,e,r),r};class I extends ${constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return u;if(this.widget.renderStrategy===y.Trigger){const t=new _;return t.application=this.widget,t}return this.widget.render()}}I.styles=[U`
|
366
366
|
:host {
|
367
367
|
display: block;
|
368
368
|
}
|
369
|
-
`];St([m({attribute:!0})],I.prototype,"name",2);St([F()],I.prototype,"widget",2);St([F()],I.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",it);customElements.get("ace-trigger")||customElements.define("ace-trigger",_);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Ct);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",rt);customElements.get("ace-widget")||customElements.define("ace-widget",I);const
|
369
|
+
`];St([m({attribute:!0})],I.prototype,"name",2);St([F()],I.prototype,"widget",2);St([F()],I.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",it);customElements.get("ace-trigger")||customElements.define("ace-trigger",_);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Ct);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",rt);customElements.get("ace-widget")||customElements.define("ace-widget",I);const Ni=async(s,t)=>{await new Ae(s).bootstrap(t)};exports.AceWidget=I;exports.Application=$e;exports.Container=bt;exports.Environment=we;exports.HttpClient=D;exports.Site=Ae;exports.StorageService=be;exports.Trigger=_;exports.WidgetComponent=ge;exports.applicationContext=me;exports.bootstrap=Ni;exports.createHttpClient=Ii;
|
package/index.mjs
CHANGED
@@ -587,7 +587,7 @@ const Te = (s) => new se(typeof s == "string" ? s : s + "", void 0, $t), U = (s,
|
|
587
587
|
* Copyright 2017 Google LLC
|
588
588
|
* SPDX-License-Identifier: BSD-3-Clause
|
589
589
|
*/
|
590
|
-
const { is: Ue, defineProperty: Ie, getOwnPropertyDescriptor: ke, getOwnPropertyNames:
|
590
|
+
const { is: Ue, defineProperty: Ie, getOwnPropertyDescriptor: ke, getOwnPropertyNames: Ne, getOwnPropertySymbols: je, getPrototypeOf: Me } = Object, w = globalThis, kt = w.trustedTypes, Le = kt ? kt.emptyScript : "", at = w.reactiveElementPolyfillSupport, k = (s, t) => s, Z = { toAttribute(s, t) {
|
591
591
|
switch (t) {
|
592
592
|
case Boolean:
|
593
593
|
s = s ? Le : null;
|
@@ -615,7 +615,7 @@ const { is: Ue, defineProperty: Ie, getOwnPropertyDescriptor: ke, getOwnProperty
|
|
615
615
|
}
|
616
616
|
}
|
617
617
|
return e;
|
618
|
-
} }, _t = (s, t) => !Ue(s, t),
|
618
|
+
} }, _t = (s, t) => !Ue(s, t), Nt = { attribute: !0, type: String, converter: Z, reflect: !1, hasChanged: _t };
|
619
619
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), w.litPropertyMetadata ?? (w.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
620
620
|
let O = class extends HTMLElement {
|
621
621
|
static addInitializer(t) {
|
@@ -624,7 +624,7 @@ let O = class extends HTMLElement {
|
|
624
624
|
static get observedAttributes() {
|
625
625
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
626
626
|
}
|
627
|
-
static createProperty(t, e =
|
627
|
+
static createProperty(t, e = Nt) {
|
628
628
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
629
629
|
const i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
630
630
|
r !== void 0 && Ie(this.prototype, t, r);
|
@@ -644,19 +644,19 @@ let O = class extends HTMLElement {
|
|
644
644
|
}, configurable: !0, enumerable: !0 };
|
645
645
|
}
|
646
646
|
static getPropertyOptions(t) {
|
647
|
-
return this.elementProperties.get(t) ??
|
647
|
+
return this.elementProperties.get(t) ?? Nt;
|
648
648
|
}
|
649
649
|
static _$Ei() {
|
650
650
|
if (this.hasOwnProperty(k("elementProperties")))
|
651
651
|
return;
|
652
|
-
const t =
|
652
|
+
const t = Me(this);
|
653
653
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
654
654
|
}
|
655
655
|
static finalize() {
|
656
656
|
if (this.hasOwnProperty(k("finalized")))
|
657
657
|
return;
|
658
658
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(k("properties"))) {
|
659
|
-
const e = this.properties, i = [...
|
659
|
+
const e = this.properties, i = [...Ne(e), ...je(e)];
|
660
660
|
for (const r of i)
|
661
661
|
this.createProperty(r, e[r]);
|
662
662
|
}
|
@@ -834,13 +834,13 @@ O.elementStyles = [], O.shadowRootOptions = { mode: "open" }, O[k("elementProper
|
|
834
834
|
* Copyright 2017 Google LLC
|
835
835
|
* SPDX-License-Identifier: BSD-3-Clause
|
836
836
|
*/
|
837
|
-
const
|
838
|
-
\f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
837
|
+
const N = globalThis, J = N.trustedTypes, jt = J ? J.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, re = "$lit$", _ = `lit$${(Math.random() + "").slice(9)}$`, ne = "?" + _, He = `<${ne}>`, E = document, M = () => E.createComment(""), L = (s) => s === null || typeof s != "object" && typeof s != "function", oe = Array.isArray, Be = (s) => oe(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ct = `[
|
838
|
+
\f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Mt = /-->/g, Lt = />/g, x = RegExp(`>|${ct}(?:([^\\s"'>=/]+)(${ct}*=${ct}*(?:[^
|
839
839
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, Bt = /"/g, ae = /^(?:script|style|textarea|title)$/i, De = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), T = De(1), P = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Dt = /* @__PURE__ */ new WeakMap(), S = E.createTreeWalker(E, 129);
|
840
840
|
function ce(s, t) {
|
841
841
|
if (!Array.isArray(s) || !s.hasOwnProperty("raw"))
|
842
842
|
throw Error("invalid template strings array");
|
843
|
-
return
|
843
|
+
return jt !== void 0 ? jt.createHTML(t) : t;
|
844
844
|
}
|
845
845
|
const ze = (s, t) => {
|
846
846
|
const e = s.length - 1, i = [];
|
@@ -849,7 +849,7 @@ const ze = (s, t) => {
|
|
849
849
|
const c = s[a];
|
850
850
|
let h, l, p = -1, f = 0;
|
851
851
|
for (; f < c.length && (o.lastIndex = f, l = o.exec(c), l !== null); )
|
852
|
-
f = o.lastIndex, o === I ? l[1] === "!--" ? o =
|
852
|
+
f = o.lastIndex, o === I ? l[1] === "!--" ? o = Mt : l[1] !== void 0 ? o = Lt : l[2] !== void 0 ? (ae.test(l[2]) && (r = RegExp("</" + l[2], "g")), o = x) : l[3] !== void 0 && (o = x) : o === x ? l[0] === ">" ? (o = r ?? I, p = -1) : l[1] === void 0 ? p = -2 : (p = o.lastIndex - l[2].length, h = l[1], o = l[3] === void 0 ? x : l[3] === '"' ? Bt : Ht) : o === Bt || o === Ht ? o = x : o === Mt || o === Lt ? o = I : (o = x, r = void 0);
|
853
853
|
const d = o === x && s[a + 1].startsWith("/>") ? " " : "";
|
854
854
|
n += o === I ? c + He : p >= 0 ? (i.push(h), c.slice(0, p) + re + c.slice(p) + _ + d) : c + _ + (p === -2 ? a : d);
|
855
855
|
}
|
@@ -879,8 +879,8 @@ class H {
|
|
879
879
|
if (f > 0) {
|
880
880
|
r.textContent = J ? J.emptyScript : "";
|
881
881
|
for (let d = 0; d < f; d++)
|
882
|
-
r.append(p[d],
|
883
|
-
r.append(p[f],
|
882
|
+
r.append(p[d], M()), S.nextNode(), c.push({ type: 2, index: ++n });
|
883
|
+
r.append(p[f], M());
|
884
884
|
}
|
885
885
|
}
|
886
886
|
} else if (r.nodeType === 8)
|
@@ -986,7 +986,7 @@ class D {
|
|
986
986
|
const e = this._$AH;
|
987
987
|
let i, r = 0;
|
988
988
|
for (const n of t)
|
989
|
-
r === e.length ? e.push(i = new D(this.S(
|
989
|
+
r === e.length ? e.push(i = new D(this.S(M()), this.S(M()), this, this.options)) : i = e[r], i._$AI(n), r++;
|
990
990
|
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
|
991
991
|
}
|
992
992
|
_$AR(t = this._$AA.nextSibling, e) {
|
@@ -1070,14 +1070,14 @@ class qe {
|
|
1070
1070
|
R(this, t);
|
1071
1071
|
}
|
1072
1072
|
}
|
1073
|
-
const ht =
|
1074
|
-
ht == null || ht(H, D), (
|
1073
|
+
const ht = N.litHtmlPolyfillSupport;
|
1074
|
+
ht == null || ht(H, D), (N.litHtmlVersions ?? (N.litHtmlVersions = [])).push("3.1.2");
|
1075
1075
|
const Ke = (s, t, e) => {
|
1076
1076
|
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
1077
1077
|
let r = i._$litPart$;
|
1078
1078
|
if (r === void 0) {
|
1079
1079
|
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
1080
|
-
i._$litPart$ = r = new D(t.insertBefore(
|
1080
|
+
i._$litPart$ = r = new D(t.insertBefore(M(), n), n, void 0, e ?? {});
|
1081
1081
|
}
|
1082
1082
|
return r._$AI(s), r;
|
1083
1083
|
};
|
@@ -1228,13 +1228,13 @@ const ti = (s) => s.strings === void 0;
|
|
1228
1228
|
* Copyright 2017 Google LLC
|
1229
1229
|
* SPDX-License-Identifier: BSD-3-Clause
|
1230
1230
|
*/
|
1231
|
-
const
|
1231
|
+
const j = (s, t) => {
|
1232
1232
|
var i;
|
1233
1233
|
const e = s._$AN;
|
1234
1234
|
if (e === void 0)
|
1235
1235
|
return !1;
|
1236
1236
|
for (const r of e)
|
1237
|
-
(i = r._$AO) == null || i.call(r, t, !1),
|
1237
|
+
(i = r._$AO) == null || i.call(r, t, !1), j(r, t);
|
1238
1238
|
return !0;
|
1239
1239
|
}, X = (s) => {
|
1240
1240
|
let t, e;
|
@@ -1262,11 +1262,11 @@ function ii(s, t = !1, e = 0) {
|
|
1262
1262
|
if (t)
|
1263
1263
|
if (Array.isArray(i))
|
1264
1264
|
for (let n = e; n < i.length; n++)
|
1265
|
-
|
1265
|
+
j(i[n], !1), X(i[n]);
|
1266
1266
|
else
|
1267
|
-
i != null && (
|
1267
|
+
i != null && (j(i, !1), X(i));
|
1268
1268
|
else
|
1269
|
-
|
1269
|
+
j(this, s);
|
1270
1270
|
}
|
1271
1271
|
const si = (s) => {
|
1272
1272
|
s.type == wt.CHILD && (s._$AP ?? (s._$AP = ii), s._$AQ ?? (s._$AQ = ei));
|
@@ -1280,7 +1280,7 @@ class pe extends he {
|
|
1280
1280
|
}
|
1281
1281
|
_$AO(t, e = !0) {
|
1282
1282
|
var i, r;
|
1283
|
-
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (
|
1283
|
+
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (j(this, t), X(this));
|
1284
1284
|
}
|
1285
1285
|
setValue(t) {
|
1286
1286
|
if (ti(this._$Ct))
|
@@ -2316,10 +2316,10 @@ class Ti {
|
|
2316
2316
|
this.root && (this.root.classList.add("hidden"), this.root.classList.remove("expanded")), this.storage.set("open", "false");
|
2317
2317
|
}
|
2318
2318
|
mute() {
|
2319
|
-
this.
|
2319
|
+
this.storage.set("muteAudioNotifications", "true");
|
2320
2320
|
}
|
2321
2321
|
unmute() {
|
2322
|
-
this.
|
2322
|
+
this.storage.set("muteAudioNotifications", "false");
|
2323
2323
|
}
|
2324
2324
|
registerComponent(t, e) {
|
2325
2325
|
this.componentResolver.registerComponent(t, e);
|