@telia-ace/widget-runtime-flamingo 1.1.121-rc.1 → 1.1.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1629,14 +1629,14 @@ let Ie = class {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
};
|
|
1631
1631
|
const Os = (i) => new Ie(typeof i == "string" ? i : i + "", void 0, te), Re = (i, ...t) => {
|
|
1632
|
-
const e = i.length === 1 ? i[0] : t.reduce((s, n, r) => s + ((o) => {
|
|
1632
|
+
const e = i.length === 1 ? i[0] : t.reduce(((s, n, r) => s + ((o) => {
|
|
1633
1633
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
1634
1634
|
if (typeof o == "number") return o;
|
|
1635
1635
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
1636
|
-
})(n) + i[r + 1], i[0]);
|
|
1636
|
+
})(n) + i[r + 1]), i[0]);
|
|
1637
1637
|
return new Ie(e, i, te);
|
|
1638
1638
|
}, Ss = (i, t) => {
|
|
1639
|
-
if (Xt) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
1639
|
+
if (Xt) i.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
1640
1640
|
else for (const e of t) {
|
|
1641
1641
|
const s = document.createElement("style"), n = ft.litNonce;
|
|
1642
1642
|
n !== void 0 && s.setAttribute("nonce", n), s.textContent = e.cssText, i.appendChild(s);
|
|
@@ -1748,7 +1748,7 @@ let z = class extends HTMLElement {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
_$Ev() {
|
|
1750
1750
|
var t;
|
|
1751
|
-
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
|
|
1751
|
+
this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach(((e) => e(this)));
|
|
1752
1752
|
}
|
|
1753
1753
|
addController(t) {
|
|
1754
1754
|
var e;
|
|
@@ -1769,19 +1769,19 @@ let z = class extends HTMLElement {
|
|
|
1769
1769
|
}
|
|
1770
1770
|
connectedCallback() {
|
|
1771
1771
|
var t;
|
|
1772
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
1772
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach(((e) => {
|
|
1773
1773
|
var s;
|
|
1774
1774
|
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
|
1775
|
-
});
|
|
1775
|
+
}));
|
|
1776
1776
|
}
|
|
1777
1777
|
enableUpdating(t) {
|
|
1778
1778
|
}
|
|
1779
1779
|
disconnectedCallback() {
|
|
1780
1780
|
var t;
|
|
1781
|
-
(t = this._$EO) == null || t.forEach((e) => {
|
|
1781
|
+
(t = this._$EO) == null || t.forEach(((e) => {
|
|
1782
1782
|
var s;
|
|
1783
1783
|
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
1784
|
-
});
|
|
1784
|
+
}));
|
|
1785
1785
|
}
|
|
1786
1786
|
attributeChangedCallback(t, e, s) {
|
|
1787
1787
|
this._$AK(t, s);
|
|
@@ -1846,10 +1846,10 @@ let z = class extends HTMLElement {
|
|
|
1846
1846
|
let t = !1;
|
|
1847
1847
|
const e = this._$AL;
|
|
1848
1848
|
try {
|
|
1849
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((n) => {
|
|
1849
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach(((n) => {
|
|
1850
1850
|
var r;
|
|
1851
1851
|
return (r = n.hostUpdate) == null ? void 0 : r.call(n);
|
|
1852
|
-
}), this.update(e)) : this._$EM();
|
|
1852
|
+
})), this.update(e)) : this._$EM();
|
|
1853
1853
|
} catch (n) {
|
|
1854
1854
|
throw t = !1, this._$EM(), n;
|
|
1855
1855
|
}
|
|
@@ -1859,10 +1859,10 @@ let z = class extends HTMLElement {
|
|
|
1859
1859
|
}
|
|
1860
1860
|
_$AE(t) {
|
|
1861
1861
|
var e;
|
|
1862
|
-
(e = this._$EO) == null || e.forEach((s) => {
|
|
1862
|
+
(e = this._$EO) == null || e.forEach(((s) => {
|
|
1863
1863
|
var n;
|
|
1864
1864
|
return (n = s.hostUpdated) == null ? void 0 : n.call(s);
|
|
1865
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
1865
|
+
})), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
1866
1866
|
}
|
|
1867
1867
|
_$EM() {
|
|
1868
1868
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -1877,7 +1877,7 @@ let z = class extends HTMLElement {
|
|
|
1877
1877
|
return !0;
|
|
1878
1878
|
}
|
|
1879
1879
|
update(t) {
|
|
1880
|
-
this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
|
|
1880
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach(((e) => this._$ET(e, this[e])))), this._$EM();
|
|
1881
1881
|
}
|
|
1882
1882
|
updated(t) {
|
|
1883
1883
|
}
|
|
@@ -2230,12 +2230,12 @@ const Zs = Gs(class extends Ys {
|
|
|
2230
2230
|
if (super(i), i.type !== Ks.ATTRIBUTE || i.name !== "class" || ((t = i.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.");
|
|
2231
2231
|
}
|
|
2232
2232
|
render(i) {
|
|
2233
|
-
return " " + Object.keys(i).filter((t) => i[t]).join(" ") + " ";
|
|
2233
|
+
return " " + Object.keys(i).filter(((t) => i[t])).join(" ") + " ";
|
|
2234
2234
|
}
|
|
2235
2235
|
update(i, [t]) {
|
|
2236
2236
|
var s, n;
|
|
2237
2237
|
if (this.st === void 0) {
|
|
2238
|
-
this.st = /* @__PURE__ */ new Set(), i.strings !== void 0 && (this.nt = new Set(i.strings.join(" ").split(/\s/).filter((r) => r !== "")));
|
|
2238
|
+
this.st = /* @__PURE__ */ new Set(), i.strings !== void 0 && (this.nt = new Set(i.strings.join(" ").split(/\s/).filter(((r) => r !== ""))));
|
|
2239
2239
|
for (const r in t) t[r] && !((s = this.nt) != null && s.has(r)) && this.st.add(r);
|
|
2240
2240
|
return this.render(t);
|
|
2241
2241
|
}
|
|
@@ -2510,7 +2510,7 @@ class ii {
|
|
|
2510
2510
|
*/
|
|
2511
2511
|
render() {
|
|
2512
2512
|
const { widgetDOMElement: t, triggerDOMElement: e } = this.options, s = this.container.get("$widget");
|
|
2513
|
-
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === j.Badge && Cs(e), import("./render-
|
|
2513
|
+
return t.getAttribute("data-rendered") === "true" ? Promise.resolve() : (e && this.options.triggerType === j.Badge && Cs(e), import("./render-C2BAGuUX.mjs").then((n) => n.default(this.container, t)).then(() => {
|
|
2514
2514
|
if (t.setAttribute("data-rendered", "true"), e && this.options.triggerType === j.Badge) {
|
|
2515
2515
|
const r = this.options.triggerOptions.openTooltip;
|
|
2516
2516
|
Le(e, r);
|
|
@@ -3076,15 +3076,15 @@ class K extends li {
|
|
|
3076
3076
|
*/
|
|
3077
3077
|
function ui({ context: i, subscribe: t }) {
|
|
3078
3078
|
return (e, s) => {
|
|
3079
|
-
typeof s == "object" ? s.addInitializer(function() {
|
|
3079
|
+
typeof s == "object" ? s.addInitializer((function() {
|
|
3080
3080
|
new $e(this, { context: i, callback: (n) => {
|
|
3081
3081
|
e.set.call(this, n);
|
|
3082
3082
|
}, subscribe: t });
|
|
3083
|
-
}) : e.constructor.addInitializer((n) => {
|
|
3083
|
+
})) : e.constructor.addInitializer(((n) => {
|
|
3084
3084
|
new $e(n, { context: i, callback: (r) => {
|
|
3085
3085
|
n[s] = r;
|
|
3086
3086
|
}, subscribe: t });
|
|
3087
|
-
});
|
|
3087
|
+
}));
|
|
3088
3088
|
};
|
|
3089
3089
|
}
|
|
3090
3090
|
const pi = "children", gi = "descriptor", mi = "container", fi = "context", yi = "layout", vi = "properties";
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2019 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/const ft=globalThis,Xt=ft.ShadowRoot&&(ft.ShadyCSS===void 0||ft.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,te=Symbol(),de=new WeakMap;let Re=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==te)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(Xt&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=de.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&de.set(e,t))}return t}toString(){return this.cssText}};const Vs=i=>new Re(typeof i=="string"?i:i+"",void 0,te),ee=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[r+1],i[0]);return new Re(e,i,te)},Hs=(i,t)=>{if(Xt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),n=ft.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},ue=Xt?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Vs(e)})(i):i;/**
|
|
25
|
+
*/const ft=globalThis,Xt=ft.ShadowRoot&&(ft.ShadyCSS===void 0||ft.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,te=Symbol(),de=new WeakMap;let Re=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==te)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(Xt&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=de.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&de.set(e,t))}return t}toString(){return this.cssText}};const Vs=i=>new Re(typeof i=="string"?i:i+"",void 0,te),ee=(i,...t)=>{const e=i.length===1?i[0]:t.reduce(((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[r+1]),i[0]);return new Re(e,i,te)},Hs=(i,t)=>{if(Xt)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),n=ft.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},ue=Xt?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Vs(e)})(i):i;/**
|
|
26
26
|
* @license
|
|
27
27
|
* Copyright 2017 Google LLC
|
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/const{is:zs,defineProperty:Bs,getOwnPropertyDescriptor:Ws,getOwnPropertyNames:qs,getOwnPropertySymbols:Js,getPrototypeOf:Fs}=Object,M=globalThis,pe=M.trustedTypes,Ks=pe?pe.emptyScript:"",jt=M.reactiveElementPolyfillSupport,tt=(i,t)=>i,$t={toAttribute(i,t){switch(t){case Boolean:i=i?Ks:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},se=(i,t)=>!zs(i,t),ge={attribute:!0,type:String,converter:$t,reflect:!1,useDefault:!1,hasChanged:se};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),M.litPropertyMetadata??(M.litPropertyMetadata=new WeakMap);let z=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=ge){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Bs(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:r}=Ws(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:n,set(o){const a=n==null?void 0:n.call(this);r==null||r.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ge}static _$Ei(){if(this.hasOwnProperty(tt("elementProperties")))return;const t=Fs(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(tt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tt("properties"))){const e=this.properties,s=[...qs(e),...Js(e)];for(const n of s)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(ue(n))}else t!==void 0&&e.push(ue(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s: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 s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Hs(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 s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var r;const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:$t).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r,o;const s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const a=s.getPropertyOptions(n),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:$t;this._$Em=n;const c=h.fromAttribute(e,a.type);this[n]=c??((o=this._$Ej)==null?void 0:o.get(n))??c,this._$Em=null}}requestUpdate(t,e,s){var n;if(t!==void 0){const r=this.constructor,o=this[t];if(s??(s=r.getPropertyOptions(t)),!((s.hasChanged??se)(o,e)||s.useDefault&&s.reflect&&o===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:r},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),r!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){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 s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n){const{wrapped:a}=o,h=this[r];a!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(e)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var n;return(n=s.hostUpdated)==null?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[tt("elementProperties")]=new Map,z[tt("finalized")]=new Map,jt==null||jt({ReactiveElement:z}),(M.reactiveElementVersions??(M.reactiveElementVersions=[])).push("2.1.1");/**
|
|
29
|
+
*/const{is:zs,defineProperty:Bs,getOwnPropertyDescriptor:Ws,getOwnPropertyNames:qs,getOwnPropertySymbols:Js,getPrototypeOf:Fs}=Object,M=globalThis,pe=M.trustedTypes,Ks=pe?pe.emptyScript:"",jt=M.reactiveElementPolyfillSupport,tt=(i,t)=>i,$t={toAttribute(i,t){switch(t){case Boolean:i=i?Ks:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},se=(i,t)=>!zs(i,t),ge={attribute:!0,type:String,converter:$t,reflect:!1,useDefault:!1,hasChanged:se};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),M.litPropertyMetadata??(M.litPropertyMetadata=new WeakMap);let z=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=ge){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Bs(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:r}=Ws(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:n,set(o){const a=n==null?void 0:n.call(this);r==null||r.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ge}static _$Ei(){if(this.hasOwnProperty(tt("elementProperties")))return;const t=Fs(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(tt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tt("properties"))){const e=this.properties,s=[...qs(e),...Js(e)];for(const n of s)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(ue(n))}else t!==void 0&&e.push(ue(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s: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 s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Hs(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 s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var r;const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:$t).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r,o;const s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const a=s.getPropertyOptions(n),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:$t;this._$Em=n;const c=h.fromAttribute(e,a.type);this[n]=c??((o=this._$Ej)==null?void 0:o.get(n))??c,this._$Em=null}}requestUpdate(t,e,s){var n;if(t!==void 0){const r=this.constructor,o=this[t];if(s??(s=r.getPropertyOptions(t)),!((s.hasChanged??se)(o,e)||s.useDefault&&s.reflect&&o===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:r},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),r!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){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 s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n){const{wrapped:a}=o,h=this[r];a!==!0||this._$AL.has(r)||h===void 0||this.C(r,void 0,o,h)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)})),this.update(e)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var n;return(n=s.hostUpdated)==null?void 0:n.call(s)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[tt("elementProperties")]=new Map,z[tt("finalized")]=new Map,jt==null||jt({ReactiveElement:z}),(M.reactiveElementVersions??(M.reactiveElementVersions=[])).push("2.1.1");/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2018 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
-
*/const ai=ze(class extends Be{constructor(i){var t;if(super(i),i.type!==He.ATTRIBUTE||i.name!=="class"||((t=i.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(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var s,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(t)}const e=i.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const o=!!t[r];o===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return D}}),dt=(i,t,e)=>{i&&e.style.setProperty(t,i)},We=(i,t)=>{var e,s,n,r;dt((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),dt((s=i.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),dt((n=i.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),dt((r=i.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var ci=Object.defineProperty,ct=(i,t,e,s)=>{for(var n=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=o(t,e,n)||n);return n&&ci(t,e,n),n};const re=class re extends q{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var e;const t=((e=this.container)==null?void 0:e.get("$settings"))??{};t!=null&&t.branding&&We(t.branding,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-BG1RS3tz.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?X`<telia-icon
|
|
55
|
+
*/const ai=ze(class extends Be{constructor(i){var t;if(super(i),i.type!==He.ATTRIBUTE||i.name!=="class"||((t=i.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(i){return" "+Object.keys(i).filter((t=>i[t])).join(" ")+" "}update(i,[t]){var s,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((r=>r!==""))));for(const r in t)t[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(t)}const e=i.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const o=!!t[r];o===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return D}}),dt=(i,t,e)=>{i&&e.style.setProperty(t,i)},We=(i,t)=>{var e,s,n,r;dt((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),dt((s=i.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),dt((n=i.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),dt((r=i.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var ci=Object.defineProperty,ct=(i,t,e,s)=>{for(var n=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=o(t,e,n)||n);return n&&ci(t,e,n),n};const re=class re extends q{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var e;const t=((e=this.container)==null?void 0:e.get("$settings"))??{};t!=null&&t.branding&&We(t.branding,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-BG1RS3tz.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?X`<telia-icon
|
|
56
56
|
class="trigger-icon"
|
|
57
57
|
svg=${r.svg}
|
|
58
58
|
size="lg"
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
align-items: center;
|
|
160
160
|
fill: var(--trigger-text-color, var(--text-on-primary-background));
|
|
161
161
|
}
|
|
162
|
-
`];let L=re;ct([F({attribute:!1})],L.prototype,"symbol");ct([F({attribute:!1})],L.prototype,"container");ct([C()],L.prototype,"active");ct([C()],L.prototype,"loaded");ct([C()],L.prototype,"icon");var U=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(U||{});const hi=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",qe=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",li=async(i,t,e,s,n,r=!1)=>{var l,d;const o=hi(e,s),a=qe(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",L);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},di="modals";class ui{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===U.Badge&&Us(e),Promise.resolve().then(()=>require("./render-sTeOjtXZ.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===U.Badge){const r=this.options.triggerOptions.openTooltip;Ie(e,r)}gs(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,di,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=Ts(e,{label:n,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const ut="changesets",pi=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class ne{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,ut,m.Necessary,{medium:f.Local}).then(e=>new ne(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,ut,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:pi(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,ut,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return A(this)(()=>O(this.container,ut,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new K(t,a)})}})}))}}const gi=i=>{const{container:t}=i;return ne.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new G(i,n),o=Ne(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Ce.Deactivating&&o()}),r})},mi=i=>Promise.resolve().then(()=>Is).then(({StorageProvider:t})=>new t),fi=i=>Promise.resolve().then(()=>Gt).then(({ActionResolver:t})=>new t(i)),yi=i=>Promise.resolve().then(()=>Gt).then(({ComponentResolver:t})=>new t(i)),vi=i=>Promise.resolve().then(()=>Gt).then(()=>gi(i.get("$widget"))),zt="$settings",Bt="open",$e="activeStickyWidget";class bi extends ds{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>mi(this.container)),this.container.registerFactory("settings",()=>O(this.container,zt,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),as(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>yi(this.container)),this.container.registerAsync("actionResolver",()=>fi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>vi(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=ot(),triggerDOMElement:r,withRenderState:o}=t,h=qe(e)===U.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await li(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>b.querySelectorAll("[data-loading=true]").length===0,[b]=this.widget.container.get("widgetDOMElements"),x=(kt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},ht={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(b,ht)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(b,x)=>{x.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===U.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==U.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:b})=>{d.render().then(()=>this.renderState()).then(x=>b&&b.action&&b.action==="hide"?x===w.open?this.hide():this.open():x===w.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===U.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new ui(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),P(this.container,zt,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return P(this.container,zt,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return O(this.container,Bt,f.Session).then((e=w.closed)=>e)}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?w.open:t==="close"?w.closed:w.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===w.open),s!==w.hidden?s===w.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([P(this.container,Bt,m.Necessary,{medium:f.Session}),P(this.container,Bt,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}).then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?Ie(s,r):js(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,$e,f.Local).then(e=>e===this.widget.name?P(this.container,$e,m.Necessary,{medium:f.Local,scope:Y.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
162
|
+
`];let L=re;ct([F({attribute:!1})],L.prototype,"symbol");ct([F({attribute:!1})],L.prototype,"container");ct([C()],L.prototype,"active");ct([C()],L.prototype,"loaded");ct([C()],L.prototype,"icon");var U=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(U||{});const hi=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",qe=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",li=async(i,t,e,s,n,r=!1)=>{var l,d;const o=hi(e,s),a=qe(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",L);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},di="modals";class ui{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===U.Badge&&Us(e),Promise.resolve().then(()=>require("./render-C5X01J2f.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===U.Badge){const r=this.options.triggerOptions.openTooltip;Ie(e,r)}gs(this.container,t);const n=this.container.get("$environment").widgets.all();O(this.container,di,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=Ts(e,{label:n,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const ut="changesets",pi=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class ne{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,ut,m.Necessary,{medium:f.Local}).then(e=>new ne(t,e))}write(t,e,s,n){return A(this)(()=>O(this.container,ut,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:pi(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,ut,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return A(this)(()=>O(this.container,ut,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new K(t,a)})}})}))}}const gi=i=>{const{container:t}=i;return ne.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new G(i,n),o=Ne(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Ce.Deactivating&&o()}),r})},mi=i=>Promise.resolve().then(()=>Is).then(({StorageProvider:t})=>new t),fi=i=>Promise.resolve().then(()=>Gt).then(({ActionResolver:t})=>new t(i)),yi=i=>Promise.resolve().then(()=>Gt).then(({ComponentResolver:t})=>new t(i)),vi=i=>Promise.resolve().then(()=>Gt).then(()=>gi(i.get("$widget"))),zt="$settings",Bt="open",$e="activeStickyWidget";class bi extends ds{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>mi(this.container)),this.container.registerFactory("settings",()=>O(this.container,zt,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),as(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>yi(this.container)),this.container.registerAsync("actionResolver",()=>fi(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>vi(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=ot(),triggerDOMElement:r,withRenderState:o}=t,h=qe(e)===U.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await li(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>b.querySelectorAll("[data-loading=true]").length===0,[b]=this.widget.container.get("widgetDOMElements"),x=(kt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},ht={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(b,ht)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(b,x)=>{x.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===U.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==U.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:b})=>{d.render().then(()=>this.renderState()).then(x=>b&&b.action&&b.action==="hide"?x===w.open?this.hide():this.open():x===w.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===U.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new ui(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),P(this.container,zt,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return P(this.container,zt,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return O(this.container,Bt,f.Session).then((e=w.closed)=>e)}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?w.open:t==="close"?w.closed:w.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===w.open),s!==w.hidden?s===w.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([P(this.container,Bt,m.Necessary,{medium:f.Session}),P(this.container,Bt,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}).then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?Ie(s,r):js(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,$e,f.Local).then(e=>e===this.widget.name?P(this.container,$e,m.Necessary,{medium:f.Local,scope:Y.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
163
163
|
* @license
|
|
164
164
|
* Copyright 2021 Google LLC
|
|
165
165
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
* @license
|
|
184
184
|
* Copyright 2022 Google LLC
|
|
185
185
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
186
|
-
*/function _i({context:i,subscribe:t}){return(e,s)=>{typeof s=="object"?s.addInitializer(function(){new _e(this,{context:i,callback:n=>{e.set.call(this,n)},subscribe:t})}):e.constructor.addInitializer(n=>{new _e(n,{context:i,callback:r=>{n[s]=r},subscribe:t})})}}const Fe="children",Ke="descriptor",Ge="container",Ye="context",Ze="layout",Qe="properties";class Xe{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,e){if(!this._container||!this._descriptor)return;const s=await G.getInstance(this._container),n=new K(s).withId(this._descriptor.id);await s.actions(n,this._descriptor.type||ot()).dispatch(t,e)}}const xi=async(i,t)=>{const e=i.properties().provider;let s={},n="";Array.isArray(e)?(n=e[0],s=e[1]):n=e||"";const r=await t.getAsync(n);if(!r)throw new Error("No provider defined in ListComponent");return r.applyComponentNodeSettings(i.node.id,s),{provider:r,settings:s}},Ai=async(i,t)=>{const{provider:e,settings:s={}}=await xi(i,t);return{addResource:(n,r)=>e.addResource(n,r),getData:(n,r)=>e.getData(n,r,s)}};class ts{constructor(t){this.container=t,this.resources=new Map,this.nodeConfiguration=new Map}async getData(t,e,s){const n=this.resources.get(t);if(!n)throw new Error(`Unable to get EntityProvider for "${t}"`);return await n.query(e,s)}addResource(t,e){this.resources.set(t,e)}applyComponentNodeSettings(t,e){this.nodeConfiguration.set(t,e)}}const xe=i=>({title:i.Title,id:i.Id.toString()});class Ei extends ts{constructor(t){super(t),this.addResource("item",{query:async(e,s)=>{const n=e.itemId,r="78aacc09-ae6f-5485-5ca3-9dacebb95825",o=t.get("$widget").name,a=s.projection||"",c=await(await fetch(`${a}/guides/${n}?client=${r}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`)).json();return c?xe(c):null}}),this.addResource("items",{query:async(e,s)=>{const r=t.get("$widget").name,o=s.projection||"",d=await(await fetch(`${o}/guides?client=&funnel=${r}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`)).json();return{items:(d.Matches||[]).map(u=>xe(u)),totalItems:(d==null?void 0:d.TotalMatches)||0}}})}}const Ci=async i=>{i.registerAsync("guideProvider",()=>new Ei(i))},Oi=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),Me(i,t,s||(()=>{}),t,n))),Si=i=>{const t={};return Object.keys(i).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=i[e])}),t},es=(i,t)=>{const e=Si(t);Object.entries(e).forEach(([s,n])=>{i.style.setProperty(s.replace("css-",""),n)})};var Pi=Object.defineProperty,R=(i,t,e,s)=>{for(var n=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=o(t,e,n)||n);return n&&Pi(t,e,n),n};const ki=i=>{const e=class e extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new B(this,Ke,void 0),this._childrenProvider=new B(this,Fe,[]),this._propertiesProvider=new B(this,Qe,{}),this._contextProvider=new B(this,Ye,{}),this._layoutProvider=new B(this,Ze,{}),this.actions=new Xe(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),G.getInstance(this.container).then(async n=>{var o,a;const r=n.nodes.get(this.entry);if(r){this._propertyChangeListener=n.events.subscribe("components:properties-changed",(u,p)=>{r.id===p.node.id&&this._setProperties(p.node.attributes.properties)}),this._contextChangeListener=n.events.subscribe("components:context-changed",(u,p)=>{r.id===p.node.id&&this._setContext(p.node.attributes.context)}),this._layoutChangeListener=n.events.subscribe("components:layout-changed",(u,p)=>{r.id===p.node.id&&this._setLayout(p.node.attributes.layout)});const h="default";this._unmountNode=r.mount(this.container),this._setDescriptor(qt(r,h)),this._setProperties(r.attributes.properties),this._setContext(r.attributes.context),this._setLayout(this.layout);const c=r.getChildren(h).map(u=>qt(u));this._childrenProvider.setValue(c);const l=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const d=l.getComponent(((a=this.descriptor)==null?void 0:a.type)||"");d.then&&d.then(u=>{this.component=u.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),es(this.renderRoot.host,this.properties)}_setProperties(n){this._propertiesProvider.setValue(n),this.properties=n}_setContext(n){this._contextProvider.setValue(n),this.context=n}_setLayout(n){this._layoutProvider.setValue(n),this.layout=n}_setDescriptor(n){this.descriptor=n,this._descriptorProvider.setValue(n),this.actions.setDescriptor(n)}};e.styles=[i.styles??[],ee`
|
|
186
|
+
*/function _i({context:i,subscribe:t}){return(e,s)=>{typeof s=="object"?s.addInitializer((function(){new _e(this,{context:i,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new _e(n,{context:i,callback:r=>{n[s]=r},subscribe:t})}))}}const Fe="children",Ke="descriptor",Ge="container",Ye="context",Ze="layout",Qe="properties";class Xe{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,e){if(!this._container||!this._descriptor)return;const s=await G.getInstance(this._container),n=new K(s).withId(this._descriptor.id);await s.actions(n,this._descriptor.type||ot()).dispatch(t,e)}}const xi=async(i,t)=>{const e=i.properties().provider;let s={},n="";Array.isArray(e)?(n=e[0],s=e[1]):n=e||"";const r=await t.getAsync(n);if(!r)throw new Error("No provider defined in ListComponent");return r.applyComponentNodeSettings(i.node.id,s),{provider:r,settings:s}},Ai=async(i,t)=>{const{provider:e,settings:s={}}=await xi(i,t);return{addResource:(n,r)=>e.addResource(n,r),getData:(n,r)=>e.getData(n,r,s)}};class ts{constructor(t){this.container=t,this.resources=new Map,this.nodeConfiguration=new Map}async getData(t,e,s){const n=this.resources.get(t);if(!n)throw new Error(`Unable to get EntityProvider for "${t}"`);return await n.query(e,s)}addResource(t,e){this.resources.set(t,e)}applyComponentNodeSettings(t,e){this.nodeConfiguration.set(t,e)}}const xe=i=>({title:i.Title,id:i.Id.toString()});class Ei extends ts{constructor(t){super(t),this.addResource("item",{query:async(e,s)=>{const n=e.itemId,r="78aacc09-ae6f-5485-5ca3-9dacebb95825",o=t.get("$widget").name,a=s.projection||"",c=await(await fetch(`${a}/guides/${n}?client=${r}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`)).json();return c?xe(c):null}}),this.addResource("items",{query:async(e,s)=>{const r=t.get("$widget").name,o=s.projection||"",d=await(await fetch(`${o}/guides?client=&funnel=${r}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`)).json();return{items:(d.Matches||[]).map(u=>xe(u)),totalItems:(d==null?void 0:d.TotalMatches)||0}}})}}const Ci=async i=>{i.registerAsync("guideProvider",()=>new Ei(i))},Oi=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),Me(i,t,s||(()=>{}),t,n))),Si=i=>{const t={};return Object.keys(i).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=i[e])}),t},es=(i,t)=>{const e=Si(t);Object.entries(e).forEach(([s,n])=>{i.style.setProperty(s.replace("css-",""),n)})};var Pi=Object.defineProperty,R=(i,t,e,s)=>{for(var n=void 0,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=o(t,e,n)||n);return n&&Pi(t,e,n),n};const ki=i=>{const e=class e extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new B(this,Ke,void 0),this._childrenProvider=new B(this,Fe,[]),this._propertiesProvider=new B(this,Qe,{}),this._contextProvider=new B(this,Ye,{}),this._layoutProvider=new B(this,Ze,{}),this.actions=new Xe(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),G.getInstance(this.container).then(async n=>{var o,a;const r=n.nodes.get(this.entry);if(r){this._propertyChangeListener=n.events.subscribe("components:properties-changed",(u,p)=>{r.id===p.node.id&&this._setProperties(p.node.attributes.properties)}),this._contextChangeListener=n.events.subscribe("components:context-changed",(u,p)=>{r.id===p.node.id&&this._setContext(p.node.attributes.context)}),this._layoutChangeListener=n.events.subscribe("components:layout-changed",(u,p)=>{r.id===p.node.id&&this._setLayout(p.node.attributes.layout)});const h="default";this._unmountNode=r.mount(this.container),this._setDescriptor(qt(r,h)),this._setProperties(r.attributes.properties),this._setContext(r.attributes.context),this._setLayout(this.layout);const c=r.getChildren(h).map(u=>qt(u));this._childrenProvider.setValue(c);const l=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const d=l.getComponent(((a=this.descriptor)==null?void 0:a.type)||"");d.then&&d.then(u=>{this.component=u.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),es(this.renderRoot.host,this.properties)}_setProperties(n){this._propertiesProvider.setValue(n),this.properties=n}_setContext(n){this._contextProvider.setValue(n),this.context=n}_setLayout(n){this._layoutProvider.setValue(n),this.layout=n}_setDescriptor(n){this.descriptor=n,this._descriptorProvider.setValue(n),this.actions.setDescriptor(n)}};e.styles=[i.styles??[],ee`
|
|
187
187
|
:host {
|
|
188
188
|
font-family: var(--font-family);
|
|
189
189
|
grid-column: span var(--width);
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-VZwzuJ8Y.js");exports.ActionsController=t.ActionsController;exports.DataProvider=t.DataProvider;exports.GridWidget=t.Widget;exports.GuideProviderPlugin=t.GuideProviderPlugin;exports.Widget=t.Widget;exports.WidgetComponent=t.WidgetComponent;exports.childrenContext=t.childrenContext;exports.containerContext=t.containerContext;exports.contextCtx=t.contextCtx;exports.createDataProvider=t.createDataProvider;exports.createWebComponent=t.createLitComponent;exports.descriptorContext=t.descriptorContext;exports.layoutCtx=t.layoutCtx;exports.propertiesCtx=t.propertiesCtx;
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, D as o, h as r, G as s, h as i, W as n, j as d, c as C, l as c, s as x, u as p, k as l, p as W, q as g } from "./index-
|
|
1
|
+
import { A as a, D as o, h as r, G as s, h as i, W as n, j as d, c as C, l as c, s as x, u as p, k as l, p as W, q as g } from "./index-Cz3Sz1kR.mjs";
|
|
2
2
|
export {
|
|
3
3
|
a as ActionsController,
|
|
4
4
|
o as DataProvider,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { i as L, t as D, e as A, E as b, a as P, b as z, c as E, d as M, m as Y, o as f, x as g, f as R, n as N, r as u, T as w, W as T, g as j } from "./index-
|
|
1
|
+
import { i as L, t as D, e as A, E as b, a as P, b as z, c as E, d as M, m as Y, o as f, x as g, f as R, n as N, r as u, T as w, W as T, g as j } from "./index-Cz3Sz1kR.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
7
|
const S = (t) => (e, s) => {
|
|
8
|
-
s !== void 0 ? s.addInitializer(() => {
|
|
8
|
+
s !== void 0 ? s.addInitializer((() => {
|
|
9
9
|
customElements.define(t, e);
|
|
10
|
-
}) : customElements.define(t, e);
|
|
10
|
+
})) : customElements.define(t, e);
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
@@ -319,7 +319,7 @@ class et {
|
|
|
319
319
|
return this.Y;
|
|
320
320
|
}
|
|
321
321
|
pause() {
|
|
322
|
-
this.Y ?? (this.Y = new Promise((e) => this.Z = e));
|
|
322
|
+
this.Y ?? (this.Y = new Promise(((e) => this.Z = e)));
|
|
323
323
|
}
|
|
324
324
|
resume() {
|
|
325
325
|
var e;
|
|
@@ -337,7 +337,7 @@ class st extends G {
|
|
|
337
337
|
super(...arguments), this._$Cwt = x, this._$Cbt = [], this._$CK = new tt(this), this._$CX = new et();
|
|
338
338
|
}
|
|
339
339
|
render(...e) {
|
|
340
|
-
return e.find((s) => !C(s)) ?? w;
|
|
340
|
+
return e.find(((s) => !C(s))) ?? w;
|
|
341
341
|
}
|
|
342
342
|
update(e, s) {
|
|
343
343
|
const n = this._$Cbt;
|
|
@@ -348,14 +348,14 @@ class st extends G {
|
|
|
348
348
|
for (let a = 0; a < s.length && !(a > this._$Cwt); a++) {
|
|
349
349
|
const h = s[a];
|
|
350
350
|
if (!C(h)) return this._$Cwt = a, h;
|
|
351
|
-
a < i && h === n[a] || (this._$Cwt = x, i = 0, Promise.resolve(h).then(async (v) => {
|
|
351
|
+
a < i && h === n[a] || (this._$Cwt = x, i = 0, Promise.resolve(h).then((async (v) => {
|
|
352
352
|
for (; o.get(); ) await o.get();
|
|
353
353
|
const d = r.deref();
|
|
354
354
|
if (d !== void 0) {
|
|
355
355
|
const y = d._$Cbt.indexOf(h);
|
|
356
356
|
y > -1 && y < d._$Cwt && (d._$Cwt = y, d.setValue(v));
|
|
357
357
|
}
|
|
358
|
-
}));
|
|
358
|
+
})));
|
|
359
359
|
}
|
|
360
360
|
return w;
|
|
361
361
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-VZwzuJ8Y.js");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const $=t=>(e,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)};/**
|
|
5
|
+
*/const $=t=>(e,s)=>{s!==void 0?s.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2020 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2021 Google LLC
|
|
102
102
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
-
*/class Y{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class j{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??(this.Y=new Promise(e=>this.Z=e))}resume(){var e;(e=this.Z)==null||e.call(this),this.Y=this.Z=void 0}}/**
|
|
103
|
+
*/class Y{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class j{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??(this.Y=new Promise((e=>this.Z=e)))}resume(){var e;(e=this.Z)==null||e.call(this),this.Y=this.Z=void 0}}/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright 2017 Google LLC
|
|
106
106
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
107
|
-
*/const b=t=>!A(t)&&typeof t.then=="function",_=1073741823;class N extends C{constructor(){super(...arguments),this._$Cwt=_,this._$Cbt=[],this._$CK=new Y(this),this._$CX=new j}render(...e){return e.find(s=>!b(s))??r.T}update(e,s){const n=this._$Cbt;let i=n.length;this._$Cbt=s;const o=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let c=0;c<s.length&&!(c>this._$Cwt);c++){const l=s[c];if(!b(l))return this._$Cwt=c,l;c<i&&l===n[c]||(this._$Cwt=_,i=0,Promise.resolve(l).then(async g=>{for(;a.get();)await a.get();const p=o.deref();if(p!==void 0){const m=p._$Cbt.indexOf(l);m>-1&&m<p._$Cwt&&(p._$Cwt=m,p.setValue(g))}}))}return r.T}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}const I=r.e(N);var W=Object.getOwnPropertyDescriptor,H=(t,e,s,n)=>{for(var i=n>1?void 0:n?W(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=a(i)||i);return i};const x=r.WidgetComponent(r.i$1);let y=class extends x{constructor(){super(...arguments),this._resolveChildComponent=async t=>{const s=(await this.container.getAsync("componentResolver")).getComponent(t);if(s.then)return s.then(n=>n.default)},this._resolveAllChildren=async t=>Promise.all(t.map(async e=>{let s=customElements.get(`ace-${e.type}`);return s||(s=await this._resolveChildComponent(e.type||"")),{...e,component:s}}))}render(){var t;return this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.renderRoot.host.style.setProperty("--columns",((t=this._propertiesProvider.value.columns)==null?void 0:t.toString())||"1"),r.appendStyleFromProperties(this.renderRoot.host,this._propertiesProvider.value),r.x`
|
|
107
|
+
*/const b=t=>!A(t)&&typeof t.then=="function",_=1073741823;class N extends C{constructor(){super(...arguments),this._$Cwt=_,this._$Cbt=[],this._$CK=new Y(this),this._$CX=new j}render(...e){return e.find((s=>!b(s)))??r.T}update(e,s){const n=this._$Cbt;let i=n.length;this._$Cbt=s;const o=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let c=0;c<s.length&&!(c>this._$Cwt);c++){const l=s[c];if(!b(l))return this._$Cwt=c,l;c<i&&l===n[c]||(this._$Cwt=_,i=0,Promise.resolve(l).then((async g=>{for(;a.get();)await a.get();const p=o.deref();if(p!==void 0){const m=p._$Cbt.indexOf(l);m>-1&&m<p._$Cwt&&(p._$Cwt=m,p.setValue(g))}})))}return r.T}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}const I=r.e(N);var W=Object.getOwnPropertyDescriptor,H=(t,e,s,n)=>{for(var i=n>1?void 0:n?W(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(i=a(i)||i);return i};const x=r.WidgetComponent(r.i$1);let y=class extends x{constructor(){super(...arguments),this._resolveChildComponent=async t=>{const s=(await this.container.getAsync("componentResolver")).getComponent(t);if(s.then)return s.then(n=>n.default)},this._resolveAllChildren=async t=>Promise.all(t.map(async e=>{let s=customElements.get(`ace-${e.type}`);return s||(s=await this._resolveChildComponent(e.type||"")),{...e,component:s}}))}render(){var t;return this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.renderRoot.host.style.setProperty("--columns",((t=this._propertiesProvider.value.columns)==null?void 0:t.toString())||"1"),r.appendStyleFromProperties(this.renderRoot.host,this._propertiesProvider.value),r.x`
|
|
108
108
|
${I(this._resolveAllChildren(this._childrenProvider.value).then(e=>r.x`
|
|
109
109
|
${e.map(s=>{if(s.type==="area")return r.x`<ace-area entry=${s.id}></ace-area>`;const n=new s.component;return n.entry=s.id,n})}
|
|
110
110
|
`))}
|