@telia-ace/widget-core-flamingo 1.1.79-rc.0 → 1.1.79-rc.2
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +18 -18
- package/index.mjs +25 -23
- package/package.json +1 -1
- package/bootstrap.d.ts +0 -6
- package/components/ace-widget.component.d.ts +0 -21
- package/components/trigger-slot.component.d.ts +0 -8
- package/components/trigger.component.d.ts +0 -24
- package/components/unresolved.component.d.ts +0 -7
- package/components/widget.component.d.ts +0 -18
- package/components/wrapper.component.d.ts +0 -17
- package/models/application.d.ts +0 -48
- package/models/container.d.ts +0 -16
- package/models/environment.d.ts +0 -25
- package/models/site.d.ts +0 -18
- package/services/component-platform.d.ts +0 -13
- package/services/component-resolver.d.ts +0 -8
- package/services/http-client.service.d.ts +0 -18
- package/services/site-api.d.ts +0 -7
- package/services/storage.service.d.ts +0 -20
- package/services/texts.service.d.ts +0 -10
- package/services/widget-api.d.ts +0 -9
- package/types.d.ts +0 -73
- package/utils/map-branding.d.ts +0 -1
package/index.js
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var ft=function(s,t){return ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},ft(s,t)};function F(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ft(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function gt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var ft=function(s,t){return ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},ft(s,t)};function F(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ft(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function gt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,o=[],n;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){n={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(n)throw n.error}}return o}function G(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return s.concat(o||Array.prototype.slice.call(t))}function _(s){return typeof s=="function"}function te(s){var t=function(i){Error.call(i),i.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ot=te(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
|
2
2
|
`+e.map(function(i,r){return r+1+") "+i.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function mt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var et=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function mt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var et=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,o;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var a=gt(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(v){t={error:v}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else n.remove(this);var h=this.initialTeardown;if(_(h))try{h()}catch(v){o=v instanceof ot?v.errors:[v]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=gt(d),f=p.next();!f.done;f=p.next()){var g=f.value;try{Tt(g)}catch(v){o=o??[],v instanceof ot?o=G(G([],J(o)),J(v.errors)):o.push(v)}}}catch(v){i={error:v}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}}if(o)throw new ot(o)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Tt(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&mt(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&mt(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),ee=et.EMPTY;function ie(s){return s instanceof et||s&&"closed"in s&&_(s.remove)&&_(s.add)&&_(s.unsubscribe)}function Tt(s){_(s)?s():s.unsubscribe()}var se={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},vt={setTimeout:function(s,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var r=vt.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,G([s,t],J(e))):setTimeout.apply(void 0,G([s,t],J(e)))},clearTimeout:function(s){var t=vt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(s)},delegate:void 0};function Pe(s){vt.setTimeout(function(){throw s})}function It(){}function K(s){s()}var re=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ie(e)&&e.add(i)):i.destination=Re,i}return t.create=function(e,i,r){return new yt(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(et),Oe=Function.prototype.bind;function nt(s,t){return Oe.call(s,t)}var Te=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){q(i)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){q(i)}else q(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){q(e)}},s}(),yt=function(s){F(t,s);function t(e,i,r){var o=s.call(this)||this,n;if(_(e)||!e)n={next:e??void 0,error:i??void 0,complete:r??void 0};else{var a;o&&se.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return o.unsubscribe()},n={next:e.next&&nt(e.next,a),error:e.error&&nt(e.error,a),complete:e.complete&&nt(e.complete,a)}):n=e}return o.destination=new Te(n),o}return t}(re);function q(s){Pe(s)}function Ie(s){throw s}var Re={closed:!0,next:It,error:Ie,complete:It},ke=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Me(s){return s}function Ne(s){return s.length===0?Me:s.length===1?s[0]:function(e){return s.reduce(function(i,r){return r(i)},e)}}var Rt=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,i){var r=this,o=je(t)?t:new yt(t,e,i);return K(function(){var n=r,a=n.operator,c=n.source;o.add(a?a.call(o,c):c?r._subscribe(o):r._trySubscribe(o))}),o},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var i=this;return e=kt(e),new e(function(r,o){var n=new yt({next:function(a){try{t(a)}catch(c){o(c),n.unsubscribe()}},error:o,complete:r});i.subscribe(n)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[ke]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ne(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=kt(t),new t(function(i,r){var o;e.subscribe(function(n){return o=n},function(n){return r(n)},function(){return i(o)})})},s.create=function(t){return new s(t)},s}();function kt(s){var t;return(t=s??se.Promise)!==null&&t!==void 0?t:Promise}function Ue(s){return s&&_(s.next)&&_(s.error)&&_(s.complete)}function je(s){return s&&s instanceof re||Ue(s)&&ie(s)}var He=te(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),$t=function(s){F(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new Mt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new He},t.prototype.next=function(e){var i=this;K(function(){var r,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var n=gt(i.currentObservers),a=n.next();!a.done;a=n.next()){var c=a.value;c.next(e)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;K(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;K(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,o=r.hasError,n=r.isStopped,a=r.observers;return o||n?ee:(this.currentObservers=null,a.push(e),new et(function(){i.currentObservers=null,mt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,o=i.thrownError,n=i.isStopped;r?e.error(o):n&&e.complete()},t.prototype.asObservable=function(){var e=new Rt;return e.source=this,e},t.create=function(e,i){return new Mt(e,i)},t}(Rt),Mt=function(s){F(t,s);function t(e,i){var r=s.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:ee},t}($t),oe=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=s.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,o=e._value;if(i)throw r;return this._throwIfClosed(),o},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}($t),ne=(s=>(s.Loading="loading",s.Ready="ready",s))(ne||{});class bt{constructor(t,e){this.state=new oe("loading"),this.resolvers=new Map,this.name=t,this.environment=e,this.state.next("ready")}setState(t){this.state.next(t)}async register(t,e){this.resolvers.set(t,e)}async get(t){return this.resolvers.get(t)}}/**
|
4
4
|
* @license
|
5
5
|
* Copyright 2019 Google LLC
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
7
|
-
*/const Z=globalThis,_t=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Nt=new WeakMap;let ae=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==At)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=Nt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Nt.set(e,t))}return t}toString(){return this.cssText}};const Le=s=>new ae(typeof s=="string"?s:s+"",void 0,At),M=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,
|
7
|
+
*/const Z=globalThis,_t=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Nt=new WeakMap;let ae=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==At)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=Nt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Nt.set(e,t))}return t}toString(){return this.cssText}};const Le=s=>new ae(typeof s=="string"?s:s+"",void 0,At),M=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new ae(e,s,At)},Be=(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=Z.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Ut=_t?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return Le(e)})(s):s;/**
|
8
8
|
* @license
|
9
9
|
* Copyright 2017 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/const{is:
|
11
|
+
*/const{is:De,defineProperty:ze,getOwnPropertyDescriptor:We,getOwnPropertyNames:Fe,getOwnPropertySymbols:Ve,getPrototypeOf:Ye}=Object,C=globalThis,jt=C.trustedTypes,qe=jt?jt.emptyScript:"",at=C.reactiveElementPolyfillSupport,H=(s,t)=>s,X={toAttribute(s,t){switch(t){case Boolean:s=s?qe: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}},xt=(s,t)=>!De(s,t),Ht={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:xt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),C.litPropertyMetadata??(C.litPropertyMetadata=new WeakMap);let I=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=Ht){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&&ze(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:o}=We(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return r==null?void 0:r.call(this)},set(n){const a=r==null?void 0:r.call(this);o.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ht}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const t=Ye(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){const e=this.properties,i=[...Fe(e),...Ve(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(Ut(r))}else t!==void 0&&e.push(Ut(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 Be(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 o;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const n=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:X).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){var o;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const n=i.getPropertyOptions(r),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:X;this._$Em=r,this[r]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??xt)(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[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,n]of r)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.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){}};I.elementStyles=[],I.shadowRootOptions={mode:"open"},I[H("elementProperties")]=new Map,I[H("finalized")]=new Map,at==null||at({ReactiveElement:I}),(C.reactiveElementVersions??(C.reactiveElementVersions=[])).push("2.0.4");/**
|
12
12
|
* @license
|
13
13
|
* Copyright 2017 Google LLC
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
15
|
-
*/const L=globalThis,Q=L.trustedTypes,Lt=Q?Q.createPolicy("lit-html",{createHTML:s=>s}):void 0,ce="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,he="?"+x,Ke=`<${he}>`,O=document,
|
16
|
-
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
17
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),zt=/'/g,Wt=/"/g,le=/^(?:script|style|textarea|title)$/i,Je=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),R=Je(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Ft=new WeakMap,P=O.createTreeWalker(O,129);function de(s,t){if(!Ct(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Lt!==void 0?Lt.createHTML(t):t}const Ge=(s,t)=>{const e=s.length-1,i=[];let r,
|
15
|
+
*/const L=globalThis,Q=L.trustedTypes,Lt=Q?Q.createPolicy("lit-html",{createHTML:s=>s}):void 0,ce="$lit$",x=`lit$${Math.random().toFixed(9).slice(2)}$`,he="?"+x,Ke=`<${he}>`,O=document,D=()=>O.createComment(""),z=s=>s===null||typeof s!="object"&&typeof s!="function",Ct=Array.isArray,Ze=s=>Ct(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ct=`[
|
16
|
+
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Bt=/-->/g,Dt=/>/g,S=RegExp(`>|${ct}(?:([^\\s"'>=/]+)(${ct}*=${ct}*(?:[^
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),zt=/'/g,Wt=/"/g,le=/^(?:script|style|textarea|title)$/i,Je=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),R=Je(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Ft=new WeakMap,P=O.createTreeWalker(O,129);function de(s,t){if(!Ct(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Lt!==void 0?Lt.createHTML(t):t}const Ge=(s,t)=>{const e=s.length-1,i=[];let r,o=t===2?"<svg>":t===3?"<math>":"",n=j;for(let a=0;a<e;a++){const c=s[a];let l,h,d=-1,p=0;for(;p<c.length&&(n.lastIndex=p,h=n.exec(c),h!==null);)p=n.lastIndex,n===j?h[1]==="!--"?n=Bt:h[1]!==void 0?n=Dt:h[2]!==void 0?(le.test(h[2])&&(r=RegExp("</"+h[2],"g")),n=S):h[3]!==void 0&&(n=S):n===S?h[0]===">"?(n=r??j,d=-1):h[1]===void 0?d=-2:(d=n.lastIndex-h[2].length,l=h[1],n=h[3]===void 0?S:h[3]==='"'?Wt:zt):n===Wt||n===zt?n=S:n===Bt||n===Dt?n=j:(n=S,r=void 0);const f=n===S&&s[a+1].startsWith("/>")?" ":"";o+=n===j?c+Ke:d>=0?(i.push(l),c.slice(0,d)+ce+c.slice(d)+x+f):c+x+(d===-2?a:f)}return[de(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let wt=class pe{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0;const a=t.length-1,c=this.parts,[l,h]=Ge(t,e);if(this.el=pe.createElement(l,i),P.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=P.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(ce)){const p=h[n++],f=r.getAttribute(d).split(x),g=/([.?@])?(.*)/.exec(p);c.push({type:1,index:o,name:g[2],strings:f,ctor:g[1]==="."?Qe:g[1]==="?"?ti:g[1]==="@"?ei:it}),r.removeAttribute(d)}else d.startsWith(x)&&(c.push({type:6,index:o}),r.removeAttribute(d));if(le.test(r.tagName)){const d=r.textContent.split(x),p=d.length-1;if(p>0){r.textContent=Q?Q.emptyScript:"";for(let f=0;f<p;f++)r.append(d[f],D()),P.nextNode(),c.push({type:2,index:++o});r.append(d[p],D())}}}else if(r.nodeType===8)if(r.data===he)c.push({type:2,index:o});else{let d=-1;for(;(d=r.data.indexOf(x,d+1))!==-1;)c.push({type:7,index:o}),d+=x.length-1}o++}}static createElement(t,e){const i=O.createElement("template");return i.innerHTML=t,i}};function k(s,t,e=s,i){var n,a;if(t===T)return t;let r=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const o=z(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==o&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=k(s,r._$AS(s,t.values),r,i)),t}class Xe{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)??O).importNode(e,!0);P.currentNode=r;let o=P.nextNode(),n=0,a=0,c=i[0];for(;c!==void 0;){if(n===c.index){let l;c.type===2?l=new V(o,o.nextSibling,this,t):c.type===1?l=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(l=new ii(o,this,t)),this._$AV.push(l),c=i[++a]}n!==(c==null?void 0:c.index)&&(o=P.nextNode(),n++)}return P.currentNode=O,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 V{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=k(this,t,e),z(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==T&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ze(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!==u&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=wt.createElement(de(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===r)this._$AH.p(e);else{const n=new Xe(r,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=Ft.get(t.strings);return e===void 0&&Ft.set(t.strings,e=new wt(t)),e}k(t){Ct(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const o of t)r===e.length?e.push(i=new V(this.O(D()),this.O(D()),this,this.options)):i=e[r],i._$AI(o),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 it{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,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 o=this.strings;let n=!1;if(o===void 0)t=k(this,t,e,0),n=!z(t)||t!==this._$AH&&t!==T,n&&(this._$AH=t);else{const a=t;let c,l;for(t=o[0],c=0;c<o.length-1;c++)l=k(this,a[i+c],e,c),l===T&&(l=this._$AH[c]),n||(n=!z(l)||l!==this._$AH[c]),l===u?t=u:t!==u&&(t+=(l??"")+o[c+1]),this._$AH[c]=l}n&&!r&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Qe extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class ti extends it{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class ei extends it{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){if((t=k(this,t,e,0)??u)===T)return;const i=this._$AH,r=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==u&&(i===u||r);r&&this.element.removeEventListener(this.name,this,i),o&&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 ii{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){k(this,t)}}const ht=L.litHtmlPolyfillSupport;ht==null||ht(wt,V),(L.litHtmlVersions??(L.litHtmlVersions=[])).push("3.2.1");const si=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const o=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new V(t.insertBefore(D(),o),o,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
|
@@ -22,11 +22,11 @@
|
|
22
22
|
* @license
|
23
23
|
* Copyright 2017 Google LLC
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
25
|
-
*/const ri={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:xt},
|
25
|
+
*/const ri={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:xt},oi=(s=ri,t,e)=>{const{kind:i,metadata:r}=e;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(e.name,s),i==="accessor"){const{name:n}=e;return{set(a){const c=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,c,s)},init(a){return a!==void 0&&this.P(n,void 0,s),a}}}if(i==="setter"){const{name:n}=e;return function(a){const c=this[n];t.call(this,a),this.requestUpdate(n,c,s)}}throw Error("Unsupported decorator location: "+i)};function m(s){return(t,e)=>typeof e=="object"?oi(s,t,e):((i,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,n?{...i,wrapped:!0}:i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}/**
|
26
26
|
* @license
|
27
27
|
* Copyright 2017 Google LLC
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
29
|
-
*/function N(s){return m({...s,state:!0,attribute:!1})}var
|
29
|
+
*/function N(s){return m({...s,state:!0,attribute:!1})}var ni=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,ci=(s,t,e,i)=>{for(var r=i>1?void 0:i?ai(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&ni(t,e,r),r};class st extends A{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(t){var e;return(e=this.shadowRoot)==null||e.appendChild(t),t}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),u}}st.styles=[M`
|
30
30
|
:host {
|
31
31
|
position: fixed;
|
32
32
|
display: flex;
|
@@ -54,15 +54,15 @@
|
|
54
54
|
* @license
|
55
55
|
* Copyright 2017 Google LLC
|
56
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
57
|
-
*/const
|
57
|
+
*/const B=(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),B(r,t);return!0},tt=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)},fe=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),pi(t)}};function li(s){this._$AN!==void 0?(tt(this),this._$AM=s,fe(this)):this._$AM=s}function di(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 o=e;o<i.length;o++)B(i[o],!1),tt(i[o]);else i!=null&&(B(i,!1),tt(i));else B(this,s)}const pi=s=>{s.type==St.CHILD&&(s._$AP??(s._$AP=di),s._$AQ??(s._$AQ=li))};class ge extends ue{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),fe(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&&(B(this,t),tt(this))}setValue(t){if(hi(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 ui=new WeakMap;let Vt=0;const dt=new Map,Yt=new WeakSet,qt=()=>new Promise(s=>requestAnimationFrame(s)),fi=[{transform:"translateX(100%) scale(0)",opacity:0}],Kt=(s,t)=>{const e=s-t;return e===0?void 0:e},Zt=(s,t)=>{const e=s/t;return e===1?void 0:e},pt={left:(s,t)=>{const e=Kt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(s,t)=>{const e=Kt(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=Zt(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=Zt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},gi={duration:333,easing:"ease-in-out"},mi=["left","top","width","height","opacity","color","background"],Jt=new WeakMap;class vi extends ge{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===St.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 ui.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(o=>this.t=!0),this.element=t.element,Jt.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=mi),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(r=>{const o=e[r]??(pt[r]?void 0:i[r]),n=Number(o);t[r]=isNaN(n)?o+"":n}),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((o,n)=>o===r[n]))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 qt;const e=this.O(),i=this.j(this.options.keyframeOptions,e),r=this.m();if(this.A!==void 0){const{from:o,to:n}=this.N(this.A,r,e);this.log("measured",[this.A,r,o,n]),t=this.calculateKeyframes(o,n)}else{const o=dt.get(this.options.inId);if(o){dt.delete(this.options.inId);const{from:n,to:a}=this.N(o,r,e);t=this.calculateKeyframes(n,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Vt++,t.forEach(c=>c.zIndex=Vt)}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&&dt.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await qt(),(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 o=this.A.left-r.left,n=this.A.top-r.top;getComputedStyle(this.element).position!=="static"||o===0&&n===0||(this.element.style.position="relative"),o!==0&&(this.element.style.left=o+"px"),n!==0&&(this.element.style.top=n+"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=Jt.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Yt.has(this.u);return t||this.u.updateComplete.then(()=>{Yt.add(this.u)}),t}j(t,e=this.O()){const i={...gi};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 o=1,n=1;return r.length>0&&(r.forEach(a=>{a.width&&(o/=a.width),a.height&&(n/=a.height)}),t.left!==void 0&&e.left!==void 0&&(t.left=o*t.left,e.left=o*e.left),t.top!==void 0&&e.top!==void 0&&(t.top=n*t.top,e.top=n*e.top)),{from:t,to:e}}calculateKeyframes(t,e,i=!1){const r={},o={};let n=!1;const a={};for(const c in e){const l=t[c],h=e[c];if(c in pt){const d=pt[c];if(l===void 0||h===void 0)continue;const p=d(l,h);p.transform!==void 0&&(a[c]=p.value,n=!0,r.transform=`${r.transform??""} ${p.transform}`,p.overrideFrom!==void 0&&Object.assign(r,p.overrideFrom))}else l!==h&&l!==void 0&&h!==void 0&&(n=!0,r[c]=l,o[c]=h)}return r.transformOrigin=o.transformOrigin=i?"center center":"top left",this.animatingProperties=a,n?[r,o]: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 yi=Et(vi),bi={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
|
61
|
-
*/const Gt=Et(class extends ue{constructor(s){var t;if(super(s),s.type!==St.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var i,r;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(
|
61
|
+
*/const Gt=Et(class extends ue{constructor(s){var t;if(super(s),s.type!==St.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var i,r;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in t)t[o]&&!((i=this.nt)!=null&&i.has(o))&&this.st.add(o);return this.render(t)}const e=s.element.classList;for(const o of this.st)o in t||(e.remove(o),this.st.delete(o));for(const o in t){const n=!!t[o];n===this.st.has(o)||(r=this.nt)!=null&&r.has(o)||(n?(e.add(o),this.st.add(o)):(e.remove(o),this.st.delete(o)))}return T}}),w=(s,t,e)=>{s&&e.style.setProperty(t,s)},me=(s,t)=>{var e,i,r,o,n,a,c,l,h;w((e=s.colors)==null?void 0:e.primaryBackground,"--primary-background",t),w((i=s.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),w((r=s.colors)==null?void 0:r.secondaryBackground,"--secondary-background",t),w((o=s.colors)==null?void 0:o.textOnSecondaryBackground,"--text-on-secondary-background",t),w((n=s.colors)==null?void 0:n.interactiveDestructiveBackground,"--destructive-color",t),w((a=s.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",t),w((c=s.colors)==null?void 0:c.interactivePrimaryBackground,"--interactive-primary-background",t),w((l=s.colors)==null?void 0:l.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",t),w((h=s.colors)==null?void 0:h.focusColor,"--focus-color",t)};/**
|
62
62
|
* @license
|
63
63
|
* Copyright 2020 Google LLC
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
65
|
-
*/const ve=()=>new wi;class wi{}const ut=new WeakMap,ye=Et(class extends ge{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(this.isConnected||(s=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let e=ut.get(t);e===void 0&&(e=new WeakMap,ut.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ut.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var $i=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,Y=(s,t,e,i)=>{for(var r=i>1?void 0:i?_i(t,e):t,
|
65
|
+
*/const ve=()=>new wi;class wi{}const ut=new WeakMap,ye=Et(class extends ge{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(this.isConnected||(s=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let e=ut.get(t);e===void 0&&(e=new WeakMap,ut.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ut.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var $i=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,Y=(s,t,e,i)=>{for(var r=i>1?void 0:i?_i(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&$i(t,e,r),r};class b extends A{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=ve(),this.widgetActive$=new oe(!1),this.componentIsDestroyed$=new $t}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.notify("widget-set-active",{widgetId:this.application.id,active:!0}),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.notify("widget-set-active",{widgetId:this.application.id,active:!1}),this.widgetActive$.next(!1),this.showTrigger())}notify(t,e={}){window!=null&&window.parent&&window.parent.postMessage({type:t,data:e},"*")}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&me(this.application.settings.branding,this)}async _renderSymbol(){var a,c,l;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return R` <img src=${e} class="trigger-icon" alt="" /> `;const i=(l=this.application)==null?void 0:l.triggerIcon;if(!i)return u;const r=async h=>bi,{type:o,content:n}=i;switch(o){case"Telia":{const h=await r();return h?R`<telia-icon
|
66
66
|
class="trigger-icon"
|
67
67
|
svg=${h.svg}
|
68
68
|
size="lg"
|
@@ -244,7 +244,7 @@
|
|
244
244
|
.trigger-label:hover {
|
245
245
|
opacity: 0.8;
|
246
246
|
}
|
247
|
-
`];Y([m({attribute:!1})],b.prototype,"application",2);Y([N()],b.prototype,"active",2);Y([N()],b.prototype,"triggerVisible",2);Y([N()],b.prototype,"loaded",2);Y([N()],b.prototype,"icon",2);var Ai=Object.defineProperty,xi=Object.getOwnPropertyDescriptor,E=(s,t,e,i)=>{for(var r=i>1?void 0:i?xi(t,e):t,
|
247
|
+
`];Y([m({attribute:!1})],b.prototype,"application",2);Y([N()],b.prototype,"active",2);Y([N()],b.prototype,"triggerVisible",2);Y([N()],b.prototype,"loaded",2);Y([N()],b.prototype,"icon",2);var Ai=Object.defineProperty,xi=Object.getOwnPropertyDescriptor,E=(s,t,e,i)=>{for(var r=i>1?void 0:i?xi(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&Ai(t,e,r),r};const be=s=>{class t extends s{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(i){this.properties=i}writeLayout(i){this.layout=i}writeContext(i){this.context=i}addChild(i){i.parent=this,this.nodes.push(i)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}}return t.styles=[M`
|
248
248
|
:host {
|
249
249
|
font-family: var(--font-family);
|
250
250
|
grid-column: span var(--width);
|
@@ -280,12 +280,12 @@
|
|
280
280
|
* @license
|
281
281
|
* Copyright 2021 Google LLC
|
282
282
|
* SPDX-License-Identifier: BSD-3-Clause
|
283
|
-
*/let Pi=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}};class Xt extends Ei{constructor(t,e,i){var r,
|
283
|
+
*/let Pi=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}};class Xt extends Ei{constructor(t,e,i){var r,o;super(e.context!==void 0?e.initialValue:i),this.onContextRequest=n=>{const a=n.composedPath()[0];n.context===this.context&&a!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,a,n.subscribe))},this.onProviderRequest=n=>{const a=n.composedPath()[0];if(n.context!==this.context||a===this.host)return;const c=new Set;for(const[l,{consumerHost:h}]of this.subscriptions)c.has(l)||(c.add(l),h.dispatchEvent(new Si(this.context,l,!0)));n.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(o=(r=this.host).addController)==null||o.call(r,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Pi(this.context))}}/**
|
284
284
|
* @license
|
285
285
|
* Copyright 2017 Google LLC
|
286
286
|
* SPDX-License-Identifier: BSD-3-Clause
|
287
|
-
*/function Oi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Xt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var
|
288
|
-
${Ci(this.nodes,
|
287
|
+
*/function Oi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Xt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var o;return(o=i.get(this))==null||o.setValue(r),t.set.call(this,r)},init(r){var o;return(o=i.get(this))==null||o.setValue(r),r}};{t.constructor.addInitializer(n=>{i.set(n,new Xt(n,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let o;if(r===void 0){const n=new WeakMap;o={get(){return n.get(this)},set(a){i.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{const n=r.set;o={...r,set(a){i.get(this).setValue(a),n==null||n.call(this,a)}}}return void Object.defineProperty(t,e,o)}}}var Ti=Object.defineProperty,Ii=Object.getOwnPropertyDescriptor,Ri=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ii(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&Ti(t,e,r),r};const we="application";class rt extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=ve()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&me(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,r;const t=this.application.settings.components.conversation;return((r=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:r.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),R`<div class="widget-container" ${ye(this.wrapperRef)}>
|
288
|
+
${Ci(this.nodes,o=>o)}
|
289
289
|
</div>`}}rt.styles=M`
|
290
290
|
:host {
|
291
291
|
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
@@ -421,8 +421,8 @@
|
|
421
421
|
animation: slideDown 0.3s linear;
|
422
422
|
pointer-events: none;
|
423
423
|
}
|
424
|
-
`;Ri([m({attribute:!1}),Oi({context:we})],rt.prototype,"application",2);class ki{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...l]=a;return{definitionId:c,overrides:l}}return{definitionId:a,overrides:[]}},r=(a,c,l,h)=>{l.forEach(d=>{const p=i(d),f=h[p.definitionId];if(!f){console.error(`No definition found for component type '${p.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=p.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&r(a,g,f.children,h))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",rt)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new Pt;const r=document.createElement(`ace-${e}`);return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const $e=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=$e.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let _e=$e;_e.ResolveWebComponentName=s=>`ace-${s}`;var y=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(y||{});class Ae{constructor(t,e,i,r){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i,this.storageEntries=r}set(t,e){if(this.disallowedKeys.includes(t))return;const i=this.storageEntries[t];if(!i){console.warn(`Storage key '${t}' is not defined.`);return}const r=i.category;if(this.policy[r]){const n={value:e,category:r};this.storage.setItem(this._prefixKey(t),JSON.stringify(n))}else console.warn(`Storage policy does not allow storing items in category: ${r}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}enforcePolicy(){var t;for(const[e,i]of Object.entries(this.storage)){const r=(t=JSON.parse(i))==null?void 0:t.category;this.policy[r]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class Mi{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 Ni{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class xe{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new ki,this.texts=new Mi,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new _e,this.components=[],this.trigger=null,this.api=new Ni(this),this.onMessageReceived=async a=>{var l;const c=a.data;switch(c.type){case"set-storage-policies":{const{policies:h}=c.data||[],d={[y.Analytics]:h.includes("analytics"),[y.Necessary]:h.includes("necessary"),[y.Functional]:h.includes("functional")};this.storage.updatePolicy(d);return}case"disallow-storage-key":{const{storageKey:h}=c.data||null;h&&this.storage.disallowKey(h);return}case"open":{this.appendToDOM();return}case"close":{this.hide();return}case"set-z-index":{const{zIndex:h}=c.data||null;h&&this.setZIndex(h);return}case"deactivate-widget":{const h=this.storage.get("open");this.hide(),(l=this.trigger)==null||l.hideTrigger(),h&&this.storage.set("open",!0);return}default:return}},this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[y.Necessary]:!0,[y.Functional]:!0,[y.Analytics]:!0};this.storage=new Ae(this.id,"sessionStorage",o,this.settings.storage),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{}),window.addEventListener("message",this.onMessageReceived)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(oe.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}window!=null&&window.parent&&window.parent.postMessage({type:"widget-activated",data:{widgetId:this.id}},"*")}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",!0)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0)}unmute(){this.storage.set("muteAudioNotifications",!1)}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===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new st,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top}render(){if(this._isEmbeddedInIFrame())return this.root;if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const Ui=s=>new W(s),Ce=class{constructor(s=Ce.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,triggers:e.triggers||[],apps:e.widgets.map(i=>{let r=$.Inline;return i.renderStrategy==="Trigger"&&(r=$.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 W=Ce;W.endpoint="https://widgets.ace.teliacompany.net/api";class ji{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[y.Analytics]:t.includes("analytics"),[y.Necessary]:t.includes("necessary"),[y.Functional]:t.includes("functional")};r.storage.updatePolicy(n)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Se{constructor(){this.applications=[],this.container=new bt("environment",this),this.bootstrapped=!1,this.site=null,this.widgetAPIHandlers=new Map,this.siteConfigurationHandlers=[],setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate(),this.siteConfigurationHandlers.forEach(t=>{this.site&&t(this.site.api)});for(const[t,e]of this.widgetAPIHandlers)e.forEach(i=>{i()});this.bootstrapped=!0}async activate(){var e;const t=this.applications.filter(i=>i.autoActivate);(((e=this.site)==null?void 0:e.triggers)||[]).filter(i=>i.triggerType==="visit").forEach(i=>{const r=window.location.pathname,n=i.condition.outputs||[];i.condition.type==="url"&&n.forEach(o=>{const a=o.action.type==="render_widget";if((o.value===r||o.value==="*")&&a){let l={widgetId:""};try{l=JSON.parse(o.action.data)}catch{l={widgetId:""}}const h=t.findIndex(p=>p.id===l.widgetId)>-1,d=this.applications.find(p=>p.id===l.widgetId);d&&!h&&(d.autoActivate=!0,t.push(d))}})});for await(const i of t)await i.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}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new bt(e,this),o=new xe(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Ee{constructor(t){this.configurations=[],this.httpClient=new W,this.api=new ji(this),this.triggers=[],this.httpClient=new W,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,this.triggers=e.triggers||[]}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"}}))}setHttpClient(t){this.httpClient=t}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Se,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),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var Hi=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,Ot=(s,t,e,i)=>{for(var r=i>1?void 0:i?Li(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&&Hi(t,e,r),r};class U extends A{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===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}U.styles=[M`
|
424
|
+
`;Ri([m({attribute:!1}),Oi({context:we})],rt.prototype,"application",2);class ki{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...l]=a;return{definitionId:c,overrides:l}}return{definitionId:a,overrides:[]}},r=(a,c,l,h)=>{l.forEach(d=>{const p=i(d),f=h[p.definitionId];if(!f){console.error(`No definition found for component type '${p.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=p.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&r(a,g,f.children,h))})},{entry:o,components:n}=t;return r(this,this.root,[o],n),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",rt)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new Pt;const r=document.createElement(`ace-${e}`);return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const $e=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=$e.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let _e=$e;_e.ResolveWebComponentName=s=>`ace-${s}`;var y=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(y||{});class Ae{constructor(t,e,i,r){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i,this.storageEntries=r}set(t,e){if(this.disallowedKeys.includes(t))return;const i=this.storageEntries[t];if(!i){console.warn(`Storage key '${t}' is not defined.`);return}const r=i.category;if(this.policy[r]){const o={value:e,category:r};this.storage.setItem(this._prefixKey(t),JSON.stringify(o))}else console.warn(`Storage policy does not allow storing items in category: ${r}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}enforcePolicy(){var t;for(const[e,i]of Object.entries(this.storage)){const r=(t=JSON.parse(i))==null?void 0:t.category;this.policy[r]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class Mi{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 Ni{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class xe{constructor(t,e,i,r,o){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=o,this.platform=new ki,this.texts=new Mi,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new _e,this.components=[],this.trigger=null,this.api=new Ni(this),this.onMessageReceived=async a=>{var l;const c=a.data;switch(c.type){case"set-storage-policies":{const{policies:h}=c.data||[],d={[y.Analytics]:h.includes("analytics"),[y.Necessary]:h.includes("necessary"),[y.Functional]:h.includes("functional")};this.storage.updatePolicy(d);return}case"disallow-storage-key":{const{storageKey:h}=c.data||null;h&&this.storage.disallowKey(h);return}case"open":{this.appendToDOM();return}case"close":{this.hide();return}case"set-z-index":{const{zIndex:h}=c.data||null;h&&this.setZIndex(h);return}case"deactivate-widget":{const h=this.storage.get("open");this.hide(),(l=this.trigger)==null||l.hideTrigger(),h&&this.storage.set("open",!0);return}default:return}},this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const n={[y.Necessary]:!0,[y.Functional]:!0,[y.Analytics]:!0};this.storage=new Ae(this.id,"sessionStorage",n,this.settings.storage),typeof o.autoActivate=="boolean"&&(this.autoActivate=o.autoActivate),o.anchor&&(this.anchor=o.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{}),window.addEventListener("message",this.onMessageReceived)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}window!=null&&window.parent&&window.parent.postMessage({type:"widget-activated",data:{widgetId:this.id}},"*")}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",!0)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0)}unmute(){this.storage.set("muteAudioNotifications",!1)}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===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new st,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top}render(){if(this._isEmbeddedInIFrame())return this.root;if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const Ui=s=>new W(s),Ce=class{constructor(s=Ce.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,triggers:e.triggers||[],apps:(e.widgets||[]).map(i=>{let r=$.Trigger;i.renderStrategy.toLowerCase()==="inline"&&(r=$.Inline);const o=i.widgetId?i.widgetId:i.id,n=typeof i.autoActivate=="boolean"?i.autoActivate:!1,a=typeof i.anchor=="string"?i.anchor:"BottomRight",c=typeof i.triggerIcon=="string"?i.triggerIcon:"question";return{id:o,widgetId:o,renderStrategy:r,autoActivate:n,anchor:a,triggerIcon:{type:"Telia",content:c}}})}: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 W=Ce;W.endpoint="https://widgets.ace.teliacompany.net/api";class ji{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const o={[y.Analytics]:t.includes("analytics"),[y.Necessary]:t.includes("necessary"),[y.Functional]:t.includes("functional")};r.storage.updatePolicy(o)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Se{constructor(){this.applications=[],this.container=new bt("environment",this),this.bootstrapped=!1,this.site=null,this.widgetAPIHandlers=new Map,this.siteConfigurationHandlers=[],setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate(),this.siteConfigurationHandlers.forEach(t=>{this.site&&t(this.site.api)});for(const[t,e]of this.widgetAPIHandlers)e.forEach(i=>{i()});this.bootstrapped=!0}async activate(){var e;const t=this.applications.filter(i=>i.autoActivate);(((e=this.site)==null?void 0:e.triggers)||[]).filter(i=>i.triggerType==="visit").forEach(i=>{const r=window.location.pathname,o=i.condition.outputs||[];i.condition.type==="url"&&o.forEach(n=>{const a=n.action.type==="render_widget";if((n.value===r||n.value==="*")&&a){let l={widgetId:""};try{l=JSON.parse(n.action.data)}catch{l={widgetId:""}}const h=t.findIndex(p=>p.id===l.widgetId)>-1,d=this.applications.find(p=>p.id===l.widgetId);d&&!h&&(d.autoActivate=!0,t.push(d))}})});for await(const i of t)await i.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}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const o=this.applications.find(n=>n.name===t);e(o==null?void 0:o.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const o=new bt(e,this),n=new xe(t,e,o,i,r);this.applications.push(n)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Ee{constructor(t){this.configurations=[],this.httpClient=new W,this.api=new ji(this),this.triggers=[],this.httpClient=new W,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,this.triggers=e.triggers||[]}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"}}))}setHttpClient(t){this.httpClient=t}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Se,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),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var Hi=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,Ot=(s,t,e,i)=>{for(var r=i>1?void 0:i?Li(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&Hi(t,e,r),r};class U extends A{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===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}U.styles=[M`
|
425
425
|
:host {
|
426
426
|
display: block;
|
427
427
|
}
|
428
|
-
`];Ot([m({attribute:!0})],U.prototype,"name",2);Ot([N()],U.prototype,"widget",2);Ot([N()],U.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",st);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Pt);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",rt);customElements.get("ace-widget")||customElements.define("ace-widget",U);const
|
428
|
+
`];Ot([m({attribute:!0})],U.prototype,"name",2);Ot([N()],U.prototype,"widget",2);Ot([N()],U.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",st);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Pt);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",rt);customElements.get("ace-widget")||customElements.define("ace-widget",U);const Bi=async(s,t,e={})=>{const i=new Ee(s);e.httpClient&&i.setHttpClient(e.httpClient),await i.bootstrap(t)};exports.AceWidget=U;exports.Application=xe;exports.Container=bt;exports.Environment=Se;exports.HttpClient=W;exports.Site=Ee;exports.StorageCategory=y;exports.StorageService=Ae;exports.Trigger=b;exports.WidgetComponent=be;exports.applicationContext=we;exports.bootstrap=Bi;exports.createHttpClient=Ui;
|
package/index.mjs
CHANGED
@@ -587,10 +587,10 @@ const ke = (s) => new ae(typeof s == "string" ? s : s + "", void 0, _t), M = (s,
|
|
587
587
|
* Copyright 2017 Google LLC
|
588
588
|
* SPDX-License-Identifier: BSD-3-Clause
|
589
589
|
*/
|
590
|
-
const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: je, getOwnPropertyNames: Le, getOwnPropertySymbols: He, getPrototypeOf:
|
590
|
+
const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: je, getOwnPropertyNames: Le, getOwnPropertySymbols: He, getPrototypeOf: Be } = Object, C = globalThis, jt = C.trustedTypes, De = jt ? jt.emptyScript : "", at = C.reactiveElementPolyfillSupport, j = (s, t) => s, G = { toAttribute(s, t) {
|
591
591
|
switch (t) {
|
592
592
|
case Boolean:
|
593
|
-
s = s ?
|
593
|
+
s = s ? De : null;
|
594
594
|
break;
|
595
595
|
case Object:
|
596
596
|
case Array:
|
@@ -649,7 +649,7 @@ let I = class extends HTMLElement {
|
|
649
649
|
static _$Ei() {
|
650
650
|
if (this.hasOwnProperty(j("elementProperties")))
|
651
651
|
return;
|
652
|
-
const t =
|
652
|
+
const t = Be(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() {
|
@@ -834,8 +834,8 @@ I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[j("elementProper
|
|
834
834
|
* Copyright 2017 Google LLC
|
835
835
|
* SPDX-License-Identifier: BSD-3-Clause
|
836
836
|
*/
|
837
|
-
const L = globalThis, X = L.trustedTypes, Ht = X ? X.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ce = "$lit$", x = `lit$${Math.random().toFixed(9).slice(2)}$`, he = "?" + x, ze = `<${he}>`, O = document,
|
838
|
-
\f\r]`, U = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
837
|
+
const L = globalThis, X = L.trustedTypes, Ht = X ? X.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ce = "$lit$", x = `lit$${Math.random().toFixed(9).slice(2)}$`, he = "?" + x, ze = `<${he}>`, O = document, B = () => O.createComment(""), D = (s) => s === null || typeof s != "object" && typeof s != "function", xt = Array.isArray, We = (s) => xt(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ct = `[
|
838
|
+
\f\r]`, U = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Bt = /-->/g, Dt = />/g, S = RegExp(`>|${ct}(?:([^\\s"'>=/]+)(${ct}*=${ct}*(?:[^
|
839
839
|
\f\r"'\`<>=]|("|')|))|$)`, "g"), zt = /'/g, Wt = /"/g, le = /^(?:script|style|textarea|title)$/i, Fe = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), R = Fe(1), T = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Ft = /* @__PURE__ */ new WeakMap(), P = O.createTreeWalker(O, 129);
|
840
840
|
function de(s, t) {
|
841
841
|
if (!xt(s) || !s.hasOwnProperty("raw"))
|
@@ -849,7 +849,7 @@ const Ve = (s, t) => {
|
|
849
849
|
const c = s[a];
|
850
850
|
let l, h, d = -1, p = 0;
|
851
851
|
for (; p < c.length && (o.lastIndex = p, h = o.exec(c), h !== null); )
|
852
|
-
p = o.lastIndex, o === U ? h[1] === "!--" ? o =
|
852
|
+
p = o.lastIndex, o === U ? h[1] === "!--" ? o = Bt : h[1] !== void 0 ? o = Dt : h[2] !== void 0 ? (le.test(h[2]) && (r = RegExp("</" + h[2], "g")), o = S) : h[3] !== void 0 && (o = S) : o === S ? h[0] === ">" ? (o = r ?? U, d = -1) : h[1] === void 0 ? d = -2 : (d = o.lastIndex - h[2].length, l = h[1], o = h[3] === void 0 ? S : h[3] === '"' ? Wt : zt) : o === Wt || o === zt ? o = S : o === Bt || o === Dt ? o = U : (o = S, r = void 0);
|
853
853
|
const f = o === S && s[a + 1].startsWith("/>") ? " " : "";
|
854
854
|
n += o === U ? c + ze : d >= 0 ? (i.push(l), c.slice(0, d) + ce + c.slice(d) + x + f) : c + x + (d === -2 ? a : f);
|
855
855
|
}
|
@@ -879,8 +879,8 @@ let bt = class pe {
|
|
879
879
|
if (p > 0) {
|
880
880
|
r.textContent = X ? X.emptyScript : "";
|
881
881
|
for (let f = 0; f < p; f++)
|
882
|
-
r.append(d[f],
|
883
|
-
r.append(d[p],
|
882
|
+
r.append(d[f], B()), P.nextNode(), c.push({ type: 2, index: ++n });
|
883
|
+
r.append(d[p], B());
|
884
884
|
}
|
885
885
|
}
|
886
886
|
} else if (r.nodeType === 8)
|
@@ -904,7 +904,7 @@ function k(s, t, e = s, i) {
|
|
904
904
|
if (t === T)
|
905
905
|
return t;
|
906
906
|
let r = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
907
|
-
const n =
|
907
|
+
const n = D(t) ? void 0 : t._$litDirective$;
|
908
908
|
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 = k(s, r._$AS(s, t.values), r, i)), t;
|
909
909
|
}
|
910
910
|
class Ye {
|
@@ -956,7 +956,7 @@ class W {
|
|
956
956
|
return this._$AB;
|
957
957
|
}
|
958
958
|
_$AI(t, e = this) {
|
959
|
-
t = k(this, t, e),
|
959
|
+
t = k(this, t, e), D(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== T && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : We(t) ? this.k(t) : this._(t);
|
960
960
|
}
|
961
961
|
O(t) {
|
962
962
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -965,7 +965,7 @@ class W {
|
|
965
965
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
966
966
|
}
|
967
967
|
_(t) {
|
968
|
-
this._$AH !== u &&
|
968
|
+
this._$AH !== u && D(this._$AH) ? this._$AA.nextSibling.data = t : this.T(O.createTextNode(t)), this._$AH = t;
|
969
969
|
}
|
970
970
|
$(t) {
|
971
971
|
var n;
|
@@ -986,7 +986,7 @@ class W {
|
|
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 W(this.O(
|
989
|
+
r === e.length ? e.push(i = new W(this.O(B()), this.O(B()), 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) {
|
@@ -1015,12 +1015,12 @@ class it {
|
|
1015
1015
|
const n = this.strings;
|
1016
1016
|
let o = !1;
|
1017
1017
|
if (n === void 0)
|
1018
|
-
t = k(this, t, e, 0), o = !
|
1018
|
+
t = k(this, t, e, 0), o = !D(t) || t !== this._$AH && t !== T, o && (this._$AH = t);
|
1019
1019
|
else {
|
1020
1020
|
const a = t;
|
1021
1021
|
let c, l;
|
1022
1022
|
for (t = n[0], c = 0; c < n.length - 1; c++)
|
1023
|
-
l = k(this, a[i + c], e, c), l === T && (l = this._$AH[c]), o || (o = !
|
1023
|
+
l = k(this, a[i + c], e, c), l === T && (l = this._$AH[c]), o || (o = !D(l) || l !== this._$AH[c]), l === u ? t = u : t !== u && (t += (l ?? "") + n[c + 1]), this._$AH[c] = l;
|
1024
1024
|
}
|
1025
1025
|
o && !r && this.j(t);
|
1026
1026
|
}
|
@@ -1077,7 +1077,7 @@ const Ge = (s, t, e) => {
|
|
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 W(t.insertBefore(
|
1080
|
+
i._$litPart$ = r = new W(t.insertBefore(B(), n), n, void 0, e ?? {});
|
1081
1081
|
}
|
1082
1082
|
return r._$AI(s), r;
|
1083
1083
|
};
|
@@ -2584,17 +2584,19 @@ const Vi = (s) => new tt(s), $e = class {
|
|
2584
2584
|
return e ? {
|
2585
2585
|
id: e.id,
|
2586
2586
|
triggers: e.triggers || [],
|
2587
|
-
apps: e.widgets.map((i) => {
|
2588
|
-
let r = w.
|
2589
|
-
|
2590
|
-
|
2591
|
-
|
2587
|
+
apps: (e.widgets || []).map((i) => {
|
2588
|
+
let r = w.Trigger;
|
2589
|
+
i.renderStrategy.toLowerCase() === "inline" && (r = w.Inline);
|
2590
|
+
const n = i.widgetId ? i.widgetId : i.id, o = typeof i.autoActivate == "boolean" ? i.autoActivate : !1, a = typeof i.anchor == "string" ? i.anchor : "BottomRight", c = typeof i.triggerIcon == "string" ? i.triggerIcon : "question";
|
2591
|
+
return {
|
2592
|
+
id: n,
|
2593
|
+
widgetId: n,
|
2592
2594
|
renderStrategy: r,
|
2593
|
-
autoActivate:
|
2594
|
-
anchor:
|
2595
|
+
autoActivate: o,
|
2596
|
+
anchor: a,
|
2595
2597
|
triggerIcon: {
|
2596
2598
|
type: "Telia",
|
2597
|
-
content:
|
2599
|
+
content: c
|
2598
2600
|
}
|
2599
2601
|
};
|
2600
2602
|
})
|
package/package.json
CHANGED
package/bootstrap.d.ts
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
import { Environment } from './models/environment';
|
2
|
-
import { InitConfig } from './types';
|
3
|
-
import { IHttpClient } from './services/http-client.service';
|
4
|
-
export declare const bootstrap: (urlOrConfig: string | InitConfig, handler: (environment: Environment) => void, config?: {
|
5
|
-
httpClient?: IHttpClient;
|
6
|
-
}) => Promise<void>;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { LitElement, nothing } from 'lit';
|
2
|
-
import { Application } from '../models/application';
|
3
|
-
import { Trigger } from './trigger.component';
|
4
|
-
declare enum AceWidgetState {
|
5
|
-
Deactivated = "deactivated",
|
6
|
-
Activated = "activated"
|
7
|
-
}
|
8
|
-
export declare class AceWidget extends LitElement {
|
9
|
-
static styles: import("lit").CSSResult[];
|
10
|
-
name: string;
|
11
|
-
widget?: Application;
|
12
|
-
status: AceWidgetState;
|
13
|
-
constructor();
|
14
|
-
connectedCallback(): Promise<void>;
|
15
|
-
disconnectedCallback(): void;
|
16
|
-
onEnvironmentCreated(event: any): Promise<void>;
|
17
|
-
activate(): Promise<void>;
|
18
|
-
getGlobalEnvironment(): Promise<void>;
|
19
|
-
render(): Trigger | import("./wrapper.component").Wrapper | typeof nothing | undefined;
|
20
|
-
}
|
21
|
-
export {};
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import type { WidgetAnchor } from '../types';
|
3
|
-
export declare class TriggerSlot extends LitElement {
|
4
|
-
static styles: import("lit").CSSResult[];
|
5
|
-
anchor: WidgetAnchor;
|
6
|
-
appendChild<T extends Node>(node: T): T;
|
7
|
-
render(): symbol;
|
8
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { LitElement, nothing } from 'lit';
|
2
|
-
import { Application } from '../models/application';
|
3
|
-
import { Ref } from 'lit-html/directives/ref.js';
|
4
|
-
import { BehaviorSubject, Subject } from 'rxjs';
|
5
|
-
export declare class Trigger extends LitElement {
|
6
|
-
static styles: import("lit").CSSResult[];
|
7
|
-
application?: Application;
|
8
|
-
active: boolean;
|
9
|
-
triggerVisible: boolean;
|
10
|
-
loaded: boolean;
|
11
|
-
icon: any;
|
12
|
-
containerRef: Ref<HTMLDivElement>;
|
13
|
-
widgetActive$: BehaviorSubject<boolean>;
|
14
|
-
componentIsDestroyed$: Subject<void>;
|
15
|
-
connectedCallback(): Promise<void>;
|
16
|
-
disconnectedCallback(): void;
|
17
|
-
toggleActive(): void;
|
18
|
-
notify(type: string, data?: Record<string, any>): void;
|
19
|
-
_applyBranding(): void;
|
20
|
-
_renderSymbol(): Promise<typeof nothing | import("lit-html").TemplateResult<1>>;
|
21
|
-
hideTrigger(): void;
|
22
|
-
showTrigger(): void;
|
23
|
-
render(): import("lit-html").TemplateResult<1>;
|
24
|
-
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
declare const UnresolvedComponent_base: (new (...args: any[]) => import("./widget.component").WidgetComponentType) & typeof LitElement;
|
3
|
-
export declare class UnresolvedComponent extends UnresolvedComponent_base {
|
4
|
-
static styles: import("lit").CSSResult[];
|
5
|
-
render(): import("lit-html").TemplateResult<1>;
|
6
|
-
}
|
7
|
-
export {};
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import { Application } from '../models/application';
|
3
|
-
type Constructor<T = object> = new (...args: any[]) => T;
|
4
|
-
export declare class WidgetComponentType {
|
5
|
-
name: string;
|
6
|
-
type: string;
|
7
|
-
application: Application;
|
8
|
-
parent?: WidgetComponentType;
|
9
|
-
properties: Record<string, any>;
|
10
|
-
context: Record<string, any>;
|
11
|
-
layout: Record<string, any>;
|
12
|
-
writeProperties: (properties: Record<string, any>) => void;
|
13
|
-
writeContext: (context: Record<string, any>) => void;
|
14
|
-
writeLayout: (layout: Record<string, any>) => void;
|
15
|
-
addChild: (node: WidgetComponentType) => void;
|
16
|
-
}
|
17
|
-
export declare const WidgetComponent: <T extends Constructor<LitElement>>(superClass: T) => Constructor<WidgetComponentType> & T;
|
18
|
-
export {};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { LitElement, PropertyValueMap } from 'lit';
|
2
|
-
import { Ref } from 'lit/directives/ref.js';
|
3
|
-
import { Application } from '../models/application';
|
4
|
-
export declare const applicationContext: {
|
5
|
-
__context__: Application;
|
6
|
-
};
|
7
|
-
export declare class Wrapper extends LitElement {
|
8
|
-
static styles: import("lit").CSSResult;
|
9
|
-
private nodes;
|
10
|
-
wrapperRef: Ref<HTMLDivElement>;
|
11
|
-
application: Application;
|
12
|
-
addChild(node: any): void;
|
13
|
-
private applyBranding;
|
14
|
-
private applyStyles;
|
15
|
-
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
16
|
-
render(): import("lit-html").TemplateResult<1>;
|
17
|
-
}
|
package/models/application.d.ts
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
import { Trigger } from '../components/trigger.component';
|
2
|
-
import { WidgetComponentType } from '../components/widget.component';
|
3
|
-
import { Wrapper } from '../components/wrapper.component';
|
4
|
-
import { ComponentPlatform } from '../services/component-platform';
|
5
|
-
import { StorageService } from '../services/storage.service';
|
6
|
-
import { TextsService } from '../services/texts.service';
|
7
|
-
import { WidgetAPI } from '../services/widget-api';
|
8
|
-
import { ApplicationOptions, PluginType, RenderStrategy, TriggerIcon, WidgetAnchor, WidgetConfig } from '../types';
|
9
|
-
import { Container } from './container';
|
10
|
-
export declare class Application {
|
11
|
-
id: string;
|
12
|
-
name: string;
|
13
|
-
container: Container;
|
14
|
-
settings: WidgetConfig;
|
15
|
-
private options;
|
16
|
-
platform: ComponentPlatform;
|
17
|
-
texts: TextsService;
|
18
|
-
storage: StorageService;
|
19
|
-
root?: Wrapper;
|
20
|
-
renderStrategy: RenderStrategy;
|
21
|
-
triggerIcon?: TriggerIcon;
|
22
|
-
anchor: WidgetAnchor;
|
23
|
-
autoActivate: boolean;
|
24
|
-
private plugins;
|
25
|
-
private componentResolver;
|
26
|
-
private components;
|
27
|
-
trigger: Trigger | null;
|
28
|
-
api: WidgetAPI;
|
29
|
-
constructor(id: string, name: string, container: Container, settings: WidgetConfig, options: ApplicationOptions);
|
30
|
-
activate(): Promise<void>;
|
31
|
-
private loadPlugins;
|
32
|
-
onMessageReceived: (event: any) => Promise<void>;
|
33
|
-
styles(): Record<string, any>;
|
34
|
-
branding(): Record<string, any>;
|
35
|
-
plugin(plugin: PluginType): this;
|
36
|
-
appendToDOM(): void;
|
37
|
-
hide(): void;
|
38
|
-
setZIndex(zIndex: number): void;
|
39
|
-
mute(): void;
|
40
|
-
unmute(): void;
|
41
|
-
registerComponent(type: string, component: any): void;
|
42
|
-
resolveComponent(type: string): any;
|
43
|
-
mountComponent(component: WidgetComponentType): void;
|
44
|
-
getComponent<T extends WidgetComponentType>(type: string): T | null;
|
45
|
-
private _getTargetElement;
|
46
|
-
private _isEmbeddedInIFrame;
|
47
|
-
render(): Trigger | Wrapper | undefined;
|
48
|
-
}
|
package/models/container.d.ts
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
2
|
-
import { Environment } from './environment';
|
3
|
-
export declare enum ContainerState {
|
4
|
-
Loading = "loading",
|
5
|
-
Ready = "ready"
|
6
|
-
}
|
7
|
-
export declare class Container {
|
8
|
-
name: string;
|
9
|
-
environment: Environment;
|
10
|
-
state: BehaviorSubject<ContainerState>;
|
11
|
-
private resolvers;
|
12
|
-
constructor(name: string, environment: Environment);
|
13
|
-
setState(state: ContainerState): void;
|
14
|
-
register(name: string, value: unknown): Promise<void>;
|
15
|
-
get<T>(name: string): Promise<T | undefined>;
|
16
|
-
}
|
package/models/environment.d.ts
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
import { Application } from './application';
|
2
|
-
import { Container } from './container';
|
3
|
-
import { ApplicationOptions, PluginType, WidgetConfig } from '../types';
|
4
|
-
import { WidgetAPI } from '../services/widget-api';
|
5
|
-
import { SiteAPI } from '../services/site-api';
|
6
|
-
import { Site } from './site';
|
7
|
-
export type WidgetAPIHandler = (widget?: WidgetAPI) => void;
|
8
|
-
export type SiteConfigurationHandler = (site: SiteAPI) => void;
|
9
|
-
export declare class Environment {
|
10
|
-
applications: Application[];
|
11
|
-
container: Container;
|
12
|
-
private bootstrapped;
|
13
|
-
private site;
|
14
|
-
widgetAPIHandlers: Map<string, WidgetAPIHandler[]>;
|
15
|
-
siteConfigurationHandlers: SiteConfigurationHandler[];
|
16
|
-
constructor();
|
17
|
-
bootstrap(): Promise<void>;
|
18
|
-
private activate;
|
19
|
-
private notifyWidgetsOfCreation;
|
20
|
-
configure(delegate: SiteConfigurationHandler): void;
|
21
|
-
widget(name: string, delegate: WidgetAPIHandler): void;
|
22
|
-
registerApp(id: string, name: string, config: WidgetConfig, options: ApplicationOptions): void;
|
23
|
-
registerSite(site: Site): void;
|
24
|
-
plugin(plugin: PluginType): this;
|
25
|
-
}
|
package/models/site.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import { IHttpClient } from '../services/http-client.service';
|
2
|
-
import { SiteAPI } from '../services/site-api';
|
3
|
-
import { InitConfig, SiteTrigger } from '../types';
|
4
|
-
import { Environment } from './environment';
|
5
|
-
export declare class Site {
|
6
|
-
environment?: Environment;
|
7
|
-
private configurations;
|
8
|
-
private url?;
|
9
|
-
private httpClient;
|
10
|
-
api: SiteAPI;
|
11
|
-
triggers: SiteTrigger[];
|
12
|
-
constructor(urlOrConfig: string | InitConfig);
|
13
|
-
load(url: string): Promise<void>;
|
14
|
-
loadFromConfig(config: InitConfig): void;
|
15
|
-
setHttpClient(client: IHttpClient): void;
|
16
|
-
bootstrap(handler: (environment: Environment) => void): Promise<void>;
|
17
|
-
private addGlobal;
|
18
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { WidgetComponentType } from '../components/widget.component';
|
2
|
-
import { Wrapper } from '../components/wrapper.component';
|
3
|
-
import { Application } from '../models/application';
|
4
|
-
import { WidgetConfig } from '../types';
|
5
|
-
export declare class ComponentPlatform {
|
6
|
-
private root;
|
7
|
-
constructor();
|
8
|
-
createComponentModel(settings: WidgetConfig, application: Application): Wrapper;
|
9
|
-
createRoot(): Wrapper;
|
10
|
-
createNode(name: string, type: string): WidgetComponentType;
|
11
|
-
private resolveComponent;
|
12
|
-
getRoot(): Wrapper;
|
13
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
export declare class ComponentResolver {
|
2
|
-
components: Map<string, any>;
|
3
|
-
getComponent(type: string): any;
|
4
|
-
registerComponent(type: string, component: any): void;
|
5
|
-
loadComponents(): Promise<void>;
|
6
|
-
private defineAsWebComponent;
|
7
|
-
static ResolveWebComponentName: (widgetComponentName: string) => string;
|
8
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { SiteConfig, WidgetConfig } from '../types';
|
2
|
-
type GetWidgetResponse = {
|
3
|
-
name: string;
|
4
|
-
config: WidgetConfig;
|
5
|
-
};
|
6
|
-
export interface IHttpClient {
|
7
|
-
getSite(url: string): Promise<SiteConfig | null>;
|
8
|
-
getWidget(widgetId: string): Promise<GetWidgetResponse | null>;
|
9
|
-
}
|
10
|
-
export declare const createHttpClient: (endpoint?: string) => IHttpClient;
|
11
|
-
export declare class HttpClient implements IHttpClient {
|
12
|
-
private _endpoint;
|
13
|
-
private static endpoint;
|
14
|
-
constructor(_endpoint?: string);
|
15
|
-
getSite(url: string): Promise<SiteConfig | null>;
|
16
|
-
getWidget(widgetId: string): Promise<GetWidgetResponse | null>;
|
17
|
-
}
|
18
|
-
export {};
|
package/services/site-api.d.ts
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
export declare enum StorageCategory {
|
2
|
-
Necessary = "necessary",
|
3
|
-
Functional = "functional",
|
4
|
-
Analytics = "analytics"
|
5
|
-
}
|
6
|
-
export declare class StorageService {
|
7
|
-
private storage;
|
8
|
-
private policy;
|
9
|
-
private widgetId;
|
10
|
-
private storageEntries;
|
11
|
-
private disallowedKeys;
|
12
|
-
constructor(widgetId: string, storageType: 'localStorage' | 'sessionStorage', policy: Record<StorageCategory, boolean>, storageEntries: Record<string, any>);
|
13
|
-
set<T>(key: string, value: T): void;
|
14
|
-
get<T>(key: string): T | null;
|
15
|
-
removeItem(key: string): void;
|
16
|
-
enforcePolicy(): void;
|
17
|
-
updatePolicy(newPolicy: Record<StorageCategory, boolean>): void;
|
18
|
-
disallowKey(key: string): void;
|
19
|
-
private _prefixKey;
|
20
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
export interface ITextsService {
|
2
|
-
loadTexts(texts: Record<string, string>): void;
|
3
|
-
get(key: string): string | null;
|
4
|
-
}
|
5
|
-
export declare class TextsService implements ITextsService {
|
6
|
-
private texts;
|
7
|
-
loadTexts(texts: Record<string, string>): void;
|
8
|
-
get(key: string, fallback?: string): string | null;
|
9
|
-
getOrFallback(key: string, fallback: string): string;
|
10
|
-
}
|
package/services/widget-api.d.ts
DELETED
package/types.d.ts
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
import { Application } from './models/application';
|
2
|
-
import { IHttpClient } from './services/http-client.service';
|
3
|
-
export type ComponentDefinition = {
|
4
|
-
name: string;
|
5
|
-
type: string;
|
6
|
-
properties?: Record<string, any>;
|
7
|
-
context?: Record<string, any>;
|
8
|
-
layout?: Record<string, any>;
|
9
|
-
children?: string[];
|
10
|
-
};
|
11
|
-
export type WidgetConfig = {
|
12
|
-
entry: string;
|
13
|
-
texts?: Record<string, string>;
|
14
|
-
components: Record<string, ComponentDefinition>;
|
15
|
-
storage: Record<string, any>;
|
16
|
-
branding: Record<string, any>;
|
17
|
-
styles?: Record<string, any>;
|
18
|
-
survey?: Record<string, any>;
|
19
|
-
};
|
20
|
-
export declare enum RenderStrategy {
|
21
|
-
Inline = "inline",
|
22
|
-
Trigger = "trigger"
|
23
|
-
}
|
24
|
-
export type ApplicationOptions = {
|
25
|
-
renderStrategy: RenderStrategy;
|
26
|
-
triggerIcon?: TriggerIcon;
|
27
|
-
autoActivate?: boolean;
|
28
|
-
anchor?: WidgetAnchor;
|
29
|
-
};
|
30
|
-
export type TriggerIcon = {
|
31
|
-
type: string;
|
32
|
-
content: string;
|
33
|
-
};
|
34
|
-
export type AppConfig = {
|
35
|
-
id: string;
|
36
|
-
widgetId: string;
|
37
|
-
renderStrategy: RenderStrategy;
|
38
|
-
triggerIcon?: TriggerIcon;
|
39
|
-
autoActivate?: boolean;
|
40
|
-
anchor?: WidgetAnchor;
|
41
|
-
};
|
42
|
-
export type SiteConfig = {
|
43
|
-
id: string;
|
44
|
-
triggers?: SiteTrigger[];
|
45
|
-
apps: AppConfig[];
|
46
|
-
};
|
47
|
-
export type SiteTrigger = {
|
48
|
-
id: string;
|
49
|
-
triggerType: 'visit';
|
50
|
-
condition: TriggerCondition;
|
51
|
-
};
|
52
|
-
export type TriggerCondition = {
|
53
|
-
type: 'url';
|
54
|
-
outputs: {
|
55
|
-
value: string;
|
56
|
-
action: {
|
57
|
-
type: string;
|
58
|
-
data: string;
|
59
|
-
};
|
60
|
-
}[];
|
61
|
-
};
|
62
|
-
export type InitConfig = {
|
63
|
-
apps: {
|
64
|
-
widgetId: string;
|
65
|
-
renderStrategy?: 'inline' | 'trigger';
|
66
|
-
triggerIcon?: string;
|
67
|
-
autoActivate?: boolean;
|
68
|
-
anchor?: WidgetAnchor;
|
69
|
-
}[];
|
70
|
-
httpClient?: IHttpClient;
|
71
|
-
};
|
72
|
-
export type PluginType = (app: Application) => Promise<void>;
|
73
|
-
export type WidgetAnchor = 'BottomRight' | 'BottomLeft';
|
package/utils/map-branding.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const mapBranding: (context: Record<string, any>, el: HTMLElement) => void;
|