@telia-ace/widget-runtime-flamingo 1.1.111-rc.0 → 1.1.111-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index-C7Sm0jBi.js DELETED
@@ -1,198 +0,0 @@
1
- "use strict";const Nt=(n,t,e,...s)=>{const i=`[${n.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(i,...s);break;case"warning":console.warn(i,...s);break;case"error":console.error(i,...s);break}},es=n=>{const t=n.container||n;return{info:(e,...s)=>Nt(t,"info",e,...s),warn:(e,...s)=>Nt(t,"warning",e,...s),error:(e,...s)=>Nt(t,"error",e,...s)}};var et=(n=>(n.Implementation="implementation",n.Widget="widget",n))(et||{}),N=(n=>(n.Pre="pre",n.Post="post",n))(N||{});const ss=(n,t,e,s)=>{try{const i=new t(e,s);return{name:n,invoke:(r,o)=>{let a;return i[r]&&(a=i[r].call(i,o)),Promise.resolve(a)},getInstance:()=>i}}catch(i){if(i.message&&i.message.indexOf("is not a constructor")>=0)return{name:n,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw i}};function re(n,t){return typeof n>"u"?t:n}let ns=class{constructor(t={}){this.part=t}createCommand(t,e,s){let i;typeof e=="function"?i={scope:et.Widget,stage:N.Post,defaultArgs:void 0,handlerResolver:e}:i={scope:re(e.scope,et.Widget),stage:re(e.stage,N.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>i):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Ae=n=>{const t=new ns({});return n(t),t.get()};Ae(n=>{n.createCommand("types.register",{scope:et.Implementation,stage:N.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:N.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:N.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:N.Pre},t=>(e,s,i)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=i);const c=d=>{const{transformPluginSettings:l}=t.container.get("$environmentOptions"),u=l?l(h||{},o,t.container,a):s;try{const p=ss(o,a,r,u);r.get("$plugins").push(p),d&&p.invoke("initialize",null)}catch(p){es(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});function is(n){const t={};return[].filter.call(n.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=n.getAttribute(e)),t}const rs=(n,t,e)=>{const s=is(n);e({sourceDOMElement:n,eventType:t,data:s})};function oe(n,t,e){n.forEach(s=>{s.dataset.attached!=="true"&&(rs(s,t,e),s.dataset.monitored="true")})}function os(n,t,e){const s=n.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{oe(o.triggerElements,t,e)});const i=n.container.get("triggerElements");i&&oe(i,t,e)}Ae(n=>{n.createCommand("ready",{scope:et.Implementation,stage:N.Pre},t=>e=>{const{container:s}=t,i=s.owner;s.get("bootstrapping").ready?e(i):i.events.subscribeOnce("bootstrap:ready",()=>{e(i)})})});const Mt=(n,t,e,...s)=>{const i=`[${n.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(i,...s);break;case"warning":console.warn(i,...s);break;case"error":console.error(i,...s);break}},as=n=>{const t=n.container||n;return{info:(e,...s)=>Mt(t,"info",e,...s),warn:(e,...s)=>Mt(t,"warning",e,...s),error:(e,...s)=>Mt(t,"error",e,...s)}};var mt=(n=>(n.Implementation="implementation",n.Widget="widget",n))(mt||{}),T=(n=>(n.Pre="pre",n.Post="post",n))(T||{});const cs=(n,t,e,s)=>{try{const i=new t(e,s);return{name:n,invoke:(r,o)=>{let a;return i[r]&&(a=i[r].call(i,o)),Promise.resolve(a)},getInstance:()=>i}}catch(i){if(i.message&&i.message.indexOf("is not a constructor")>=0)return{name:n,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw i}};function ae(n,t){return typeof n>"u"?t:n}class hs{constructor(t={}){this.part=t}createCommand(t,e,s){let i;typeof e=="function"?i={scope:mt.Widget,stage:T.Post,defaultArgs:void 0,handlerResolver:e}:i={scope:ae(e.scope,mt.Widget),stage:ae(e.stage,T.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>i):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const Jt=n=>{const t=new hs({});return n(t),t.get()};Jt(n=>{n.createCommand("types.register",{scope:mt.Implementation,stage:T.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:T.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:T.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:T.Pre},t=>(e,s,i)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=i);const c=d=>{const{transformPluginSettings:l}=t.container.get("$environmentOptions"),u=l?l(h||{},o,t.container,a):s;try{const p=cs(o,a,r,u);r.get("$plugins").push(p),d&&p.invoke("initialize",null)}catch(p){as(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});var Ee=(n=>(n.Activating="activating",n.Loading="loading",n.Activated="activated",n.Deactivating="deactivating",n.Deactivated="deactivated",n))(Ee||{});class ds{constructor(t){this.container=t,this.widget=t.get("$widget"),this.settings=t.get("$settings"),this.events=this.widget.events,this.widget.events.subscribe("settings:change",(e,s)=>{this.settings=s})}}const _t=(n,t,...e)=>typeof t=="string"?n(`[humany] ${t}`,...e):n(t,...e),Z=class{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>Z.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>Z.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>Z.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>Z.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};let b=Z;b.log=(...n)=>_t(console.log,...n);b.warn=(...n)=>_t(console.warn,...n);b.error=(...n)=>_t(console.error,...n);b.info=(...n)=>_t(console.info,...n);const Ce=n=>{let t={},e,s;if(typeof n!="object"||n===null)return n;t=Array.isArray(n)?[]:{};for(s in n)e=n[s],t[s]=typeof e=="object"&&e!==null?Ce(e):e;return t};function ce(n){let t=0;if(n.length===0)return t.toString();for(let e=0;e<n.length;e++){const s=n.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let ls=class{constructor(t,e){this.lockWarningTime=t,this.lockErrorTime=e,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,i){this.tasks.push({task:t,resolve:e,reject:s,done:i}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){let e;const s=setTimeout(()=>{process.env.NODE_ENV!=="production"&&b.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,t),e=setTimeout(()=>{t.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),i=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(i).then(this.next).then(()=>i.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const ht=new WeakMap;function A(n,t=5e3,e=1e3){return ht.has(n)||ht.set(n,new ls(t,e)),s=>new Promise((i,r)=>{const o=ht.get(n);o.add(s,i,r,()=>{o.tasks.length||ht.delete(n)})})}const us=(n,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let i=!1;return()=>{i||(n.get("$widget").events.dispatch("widget:data-loaded",{element:t}),i=!0)}})();if(!e())return s();new MutationObserver((i,r)=>{i.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},ps=(n,t)=>{n.get("$widget").container.getAsync("components").then(e=>{e.events.subscribeOnce("components:component-model-initialized",()=>{let s=e.nodes.visible.reduce((r,o)=>(!o.name||!o.type||o.type==="view"||o.type==="root"||o.attributes.layout.size==="none"||t.querySelector(`[data-name="${o.name}"]`)||r.push(o.name),r),[]),i=!1;new MutationObserver((r,o)=>{r.forEach(a=>{if(a.addedNodes){const h=Array.from(a.addedNodes).reduce((c,d)=>{const l=d.getAttribute&&d.getAttribute("data-name");return l&&s.indexOf(l)>-1&&c.push(l),c},[]);s=s.filter(c=>h.indexOf(c)===-1),!i&&s.length===0&&(i=!0,us(n,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},S=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function rt(){return S()+S()+"-"+S()+"-"+S()+"-"+S()+"-"+S()+S()+S()}class gs{constructor(t){const{events:e}=t.get("$widget");this.events=e.createChild(this)}action(t,e,s){this.events.dispatch("data:action",{action:e,value:s,target:t},{bubbles:!0})}subscribe(t,e){return this.events.subscribe("data:action",(s,{action:i,value:r,target:o})=>t===o&&e(t,i,r))}}const Oe=n=>{const t=[];return[(e,s)=>{t.push(n.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let F=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new fs(this.platform,this)}},Ft=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new xt(t,new F(t).withId(e.id),s);const[i,r]=Oe(this.platform.events);this.subscribe=i,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}};class fs{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new xt(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}}const ms=(n,t,e)=>{const s=n.concat(),i=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),d=(l,u)=>(h=!1,i(l,Object.assign({},o,u),a));return Promise.resolve(c(r,d,a)).then(l=>({...l,cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return i(t,{},e)};let xt=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const i=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(i),i}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),i={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(d=>c.target.match(d))).map(c=>c.fn);return Promise.all(a.map(c=>{const d=new Ft(this.platform,c,this.ns);return ms(h,e,d).then(l=>{const{data:u={},options:p,cancelled:g}=l;return Promise.resolve(g?{}:o.fn(u,p,d)).then(v=>{i[c.id]=v})})}))})).then(()=>i)}watch(t,e){let s=t,i=this.ns;const r=t.split(".");r.length>1&&(i=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:i};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};Jt(n=>{n.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:i})=>{e.handlers&&e.handlers.forEach(([r,o])=>{i.addComponentHandler(r,o)})})})});let Bt=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=rt(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&b.error("Trying to mount an already mounted component node.",this),()=>{}):(this.events.dispatch("components:node-mounted",{node:this}),this.mountCount===0&&(this.mountCount=this.mountCount+1,this.events.dispatch("components:node-enter",{node:this})),()=>{s.delete(this),this.events.dispatch("components:node-unmounted",{node:this}),this.mountCount=this.mountCount-1,this.mountCount===0&&this.events.dispatch("components:node-exit",{node:this})})}appendChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const i=[{properties:t},e];return this.changesets.push(i),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(i);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const i=[{properties:t},e];return this.changesets.push(i),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(i);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const i=[{layout:t},e];return this.changesets.push(i),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(i);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const i=[{context:t},e];return this.changesets.push(i),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(i);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,i,r)=>{const{order:o=r}=i.attributes.layout;return s[o]?s.splice(o,0,i):s[o]=i,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],i=s.indexOf(t);i>-1&&(s.splice(i,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const Se=(n,t,e)=>{for(let s=0,i=n.length;s<i&&e(n[s])!==!0;s++){const r=t[n[s].id]||"default",o=n[s].getChildren(r);Se(o,t,e)}},At=(n,t,e)=>{if(e(n)!==!0){const s=t[n.id]||"default",i=n.children[s];Se(i,t,e)}},ut=(n,t)=>{const e=[];return At(n,t,s=>{e.push(s)}),e},Pe=(n,t,e)=>{let s;return At(n,t,i=>{if(e(i))return s=i,!0}),s};let ys=class{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(i,r)=>{this.all.push(r.node),this.visible=ut(t,e)}),s.subscribe("components:node-removed",(i,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=ut(t,e)}),s.subscribe("components:node-switched",(i,r)=>{this.visible=ut(t,e)})}query(t={}){const e=[];return At(this.root,this.switches,s=>{Object.keys(t).every(i=>t[i]===s[i])&&e.push(s)}),e}get(t){return Pe(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}};class bs{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}}const vs=n=>{let t=n,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},ws=n=>n.map(([t,e])=>[vs(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),Dt=n=>n instanceof Date?!1:n&&typeof n=="object"&&!Array.isArray(n),E=(n,...t)=>{if(!t.length)return n;const e=t.shift();if(Dt(n)&&Dt(e))for(const s in e)Dt(e[s])?(n[s]||Object.assign(n,{[s]:{}}),E(n[s],e[s])):Object.assign(n,{[s]:e[s]});return E(n,...t)},$s=(n,t)=>!n||n==="all"?!0:n.some(e=>t.indexOf(e)>-1),_s=(n,t)=>{let e=[],s=[],i;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=ws(e.map((d,l)=>[d,s[l]])),c=(d,l)=>{var u;const p=a.get(d)||{},g=l.context&&!p.context,v=l.properties&&!p.properties,x=l.layout&&!p.layout;a.set(d,{context:p.context||g,properties:p.properties||v,layout:p.layout||x}),v&&(d.attributes.properties={}),x&&(d.attributes.layout={}),g&&(d.attributes.context=E({},(u=d.parent)==null?void 0:u.attributes.context));const ct=[],St=[],Pt=[];if(d.changesets.forEach($=>{const[_,kt]=$;$s(kt.breakpoints,n.breakpoints)&&(v&&(typeof _.properties=="function"?ct.push(_.properties):E(d.attributes.properties,_.properties)),x&&(typeof _.layout=="function"?St.push(_.layout):E(d.attributes.layout,_.layout)),g&&(typeof _.context=="function"?Pt.push(_.context):E(d.attributes.context,_.context)))}),ct.forEach($=>{E(d.attributes.properties,$(d.attributes.properties))}),St.forEach($=>{E(d.attributes.layout,$(d.attributes.layout))}),Pt.forEach($=>{E(d.attributes.context,$(d.attributes.context))}),g||l.recursive){const $=n.getBranch(d),_=l.recursive?l:{context:!!g};d.getChildren($).forEach(kt=>{c(kt,_)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([d,l])=>{c(d,l)}),e=[],s=[],t(a)},o=()=>{clearTimeout(i),i=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const d=s[c];return h.context&&(d.context=!0),h.properties&&(d.properties=!0),h.layout&&(d.layout=!0),h.recursive&&(d.recursive=!0),o()}return e.push(a),s.push(h),o()}};class K{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new bs,this.events=t.events.createChild(this);const s=new Bt(this.events,"root");s.name=`root-${t.name}`,this.nodes=new ys(s,this.switches,this.events);const i=this.processNode=_s(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
2
- ${o.map(a=>`${a.name||"<no name>"} (${a.id})
3
- `)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:d,removes:l}=h,[u,p]=c;d.match(o.node)&&(u.properties&&l.push(a.writeProperties(u.properties,p)),u.context&&l.push(a.writeContext(u.context,p)),u.layout&&l.push(a.writeLayout(u.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{i(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{i(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{i(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{i(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{i(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{i(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{i(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new Bt(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new F(this)}actions(t,e){return new xt(this,t,e)}write(t){const{provider:e,target:s,attributes:i,options:r={},removable:o}=t,a=t.key||rt(),h={changeset:[i,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,i,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let d=()=>{};i.properties&&(d=c.writeProperties(i.properties,r,o)),i.context&&(d=c.writeContext(i.context,r,o)),i.layout&&(d=c.writeContext(i.layout,r,o)),h.removes.push(d)}}),()=>{if(o){h.removes.forEach(d=>d());const c=this.changesets.indexOf(h);c>-1&&this.changesets.splice(c,1)}}}addComponentHandler(t,e){this.customComponentHandler.add(t,e)}getComponentHandler(t){return this.customComponentHandler.get(t)}dispose(){this.subscriptions.forEach(t=>t())}}const xs=n=>{if(Array.isArray(n)){const[t,...e]=n;return{definitionId:t,overrides:e}}return{definitionId:n,overrides:[]}},yt=(n,t,e,s,i,r)=>{e.forEach(o=>{const a=xs(o),h=s[a.definitionId];if(a.definitionId==="view"){const c=n.createNode("view");c.name="view",Object.keys(i).forEach(d=>{const l=i[d];yt(n,c,[l.entry],s,i,d)}),t.appendChild(c),a.overrides.forEach(d=>{d.properties&&c.writeProperties(d.properties,{breakpoints:d.breakpoints}),d.context&&c.writeContext(d.context,{breakpoints:d.breakpoints}),d.layout&&c.writeLayout(d.layout,{breakpoints:d.breakpoints})})}else if(n.getComponentHandler(h.type)){const c=n.getComponentHandler(h.type);c&&c(a,{platform:n,node:t,references:e,definitions:s,views:i,branch:r})}else{const c=s[a.definitionId];if(process.env.NODE_ENV!=="production"&&!c){b.error(`No definition found for component type '${a.definitionId}'.`);return}const d=n.createNode(c.type);d.name=a.definitionId,d.tags=c.tags||[],c.properties&&d.writeProperties(c.properties),c.context&&d.writeContext(c.context),c.layout&&d.writeLayout(c.layout),t.appendChild(d,r),a.overrides.forEach(l=>{const u={breakpoints:l.breakpoints};l.properties&&d.writeProperties(l.properties,u),l.context&&d.writeContext(l.context,u),l.layout&&d.writeLayout(l.layout,u)}),c.children&&yt(n,d,c.children,s,i)}})},ke=(n,t)=>{const{entry:e,components:s,breakpoints:i,views:r}=t,o=[];return Object.keys(i).forEach(a=>{const h=i[a],c=window.matchMedia(h);c.matches&&n.breakpoints.push(a);const d=l=>{l.matches?n.addBreakpoint(a):n.removeBreakpoint(a)};c.addListener(d),o.push(()=>c.removeListener(d))}),yt(n,n.nodes.root,[e],s,r),()=>o.forEach(a=>{a()})},Wt=(n,t)=>({id:n.id,type:n.type,name:n.name,branch:t||"default"}),Ne=(n,t,e,s=rt(),i={})=>n.getAsync("components").then(r=>{let o;if(typeof t=="string"){const c=new F(r);c.ofType(t),o=c}else o=t;const a={},h=c=>{const d=a[c.id];return d?Promise.resolve(d.controller):K.getInstance(n).then(l=>new Ft(l,c,s))};r.events.subscribe("components:node-enter",(c,{node:d})=>{o.match(d)&&h(d).then(l=>{Promise.resolve(e(l)).then(u=>{a[d.id]={dispose:u,controller:l}})})}),r.events.subscribe("components:node-exit",(c,{node:d})=>{const l=a[d.id];l&&(l.dispose&&l.dispose(),i.reuseController||(l.controller.dispose(),delete a[d.id]))})});class As{constructor(t){this.aliases=new Map,this.components=new Map,this.logger=new b;const{events:e}=t.get("$widget");this.events=e}getComponent(t){const e=this.aliases.get(t),s=this.components.get(e||t)||null;return process.env.NODE_ENV!=="production"&&(s||this.logger.warn(e||t,`Unable to resolve component: "${e||t}". You most likely forgot to register the required plugin for: ${e||t}.`)),s}registerComponent(t,e){return this.components.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.components.delete(t)}}registerResolver(t,e){return this.events.subscribe("component-resolver:resolve",(s,i)=>{if(i===t){const r=this.getComponent(t);e(r)}})}registerAlias(t,e){return this.aliases.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.aliases.delete(t)}}}var w=(n=>(n.open="open",n.closed="closed",n.hidden="hidden",n))(w||{});const Kt=Object.freeze(Object.defineProperty({__proto__:null,ActionResolver:gs,ActionsController:xt,ComponentNode:Bt,ComponentNodeController:Ft,ComponentPlatform:K,ComponentQuery:F,ComponentResolver:As,WidgetRenderState:w,asDescriptor:Wt,createChildren:yt,createComponentModel:ke,createEventSubscriber:Oe,extendComponent:Ne,findComponent:Pe,findVisibleComponents:ut,traverseComponents:At},Symbol.toStringTag,{value:"Module"}));var m=(n=>(n.Cookie="cookie",n.Local="local",n.Session="session",n))(m||{}),G=(n=>(n.Tenant="tenant",n.Implementation="implementation",n.Widget="widget",n))(G||{}),f=(n=>(n.Necessary="necessary",n.Functional="functional",n.Analytical="analytical",n.Marketing="marketing",n))(f||{});const P=(n,t,e,s={})=>he(n,e).then(i=>(process.env.NODE_ENV!=="production"&&i&&b.warn(`createStorageWriter: Attempted to create storage writer using unallowed category.
4
- Key: ${t}
5
- Category: ${JSON.stringify(e)}
6
- Options: ${JSON.stringify(s)}`),r=>(Zt(n),he(n,e).then(o=>{if(o){process.env.NODE_ENV!=="production"&&b.warn(`storageWriter: Attempted to write to storage using unallowed category.
7
- Key: ${t}
8
- Category: ${JSON.stringify(e)}
9
- Value: ${JSON.stringify(r)}
10
- Options: ${JSON.stringify(s)}`);return}const{scope:a=G.Widget,medium:h=m.Session,duration:c}=s,d=Cs();return d[a][t]=Yt(r,e,c),h===m.Cookie?ks(n,d):Ms(n,h,d)})))),O=(n,t,e=m.Session)=>(Zt(n),typeof t>"u"?(process.env.NODE_ENV!=="production"&&b.warn("readStorage: Undefined key passed when reading storage. ",t,e),Promise.resolve(void 0)):e===m.Cookie?Ps(n).then(s=>vt(s,t)):Ns(n,e).then(s=>vt(s,t))),B=n=>!!Object.entries(n).filter(([t,e])=>typeof e<"u").length,Lt=n=>Object.entries(n).filter(([t,e])=>typeof e<"u").forEach(([t,{value:e}])=>{typeof e>"u"&&delete n[t]}),Me=(n,t)=>{const e={tenant:{...n.tenant,...t.tenant},implementation:{...n.implementation,...t.implementation},widget:{...n.widget,...t.widget}};return Lt(e.tenant),Lt(e.implementation),Lt(e.widget),e},Es=n=>Object.entries(n).reduce((t,e)=>{const[s,i]=e;return Object.entries(i).forEach(r=>{const[o,{expiration:a}]=r;a&&t.push(a)}),t},[]).slice().sort((t,e)=>new Date(e).valueOf()-new Date(t).valueOf()).shift()||Ct(),Et=n=>{const{name:t,implementation:{name:e,tenant:s}}=n.get("$widget");return[`humany_${s}`,`humany_${ce(s+e)}`,`humany_${ce(s+e+t)}`]},It=n=>{const t=new RegExp(`(?:^|;)\\s?${n}=(.*?)(?:;|$)`,"i"),e=document.cookie.match(t);return e&&e[1]&&JSON.parse(e[1])||void 0},Rt=(n,t,e)=>{const s=`${n}=${JSON.stringify(t).trim()}`,i=`expires=${new Date(e).toUTCString()}`,r="path=/",o="SameSite=None;Secure";return document.cookie=`${s}; ${i}; ${r}; ${o}`},Gt=n=>{const[t,e,s]=Et(n),i=It(t)||{},r=It(e)||{},o=It(s)||{};return{tenant:i,implementation:r,widget:o}},De=(n,t)=>{const e=Gt(n),s=Me(e,t),[i,r,o]=Et(n),{tenant:a,implementation:h,widget:c}=s,d=Es(t),l=Ct({days:-1});Rt(i,a,B(a)?d:l),Rt(r,h,B(h)?d:l),Rt(o,c,B(c)?d:l)},bt=(n,t)=>{const[e,s,i]=Et(n),r=t.getItem(e)||"{}",o=t.getItem(s)||"{}",a=t.getItem(i)||"{}";return{tenant:JSON.parse(r),implementation:JSON.parse(o),widget:JSON.parse(a)}},qt=(n,t,e)=>{const s=bt(n,t),i=Me(s,e),[r,o,a]=Et(n),{tenant:h,implementation:c,widget:d}=i;B(h)?t.setItem(r,JSON.stringify(h)):t.removeItem(r),B(c)?t.setItem(o,JSON.stringify(c)):t.removeItem(o),B(d)?t.setItem(a,JSON.stringify(d)):t.removeItem(a);const{events:l}=n.get("$widget");l.dispatch("storage:changed",{})},Cs=()=>({tenant:{},implementation:{},widget:{}}),Os=n=>n?!!n&&new Date>new Date(n):!1,vt=(n,t)=>{const e=n.widget[t]||n.implementation[t]||n.tenant[t];return e==null?void 0:e.value},Yt=(n,t,e)=>e?{value:n,category:t,expiration:typeof e=="object"?Ct(e):e}:{value:n,category:t},pt=(n,t)=>{const e=Ce(n);return Object.entries(e).forEach(([s,i])=>{Object.entries(i).forEach(([r,o])=>{const{expiration:a,category:h}=o;(Os(a)||Ss(t,h))&&(i[r]=Yt(void 0,h,a))})}),e},he=(n,t)=>O(n,"storagePolicy",m.Cookie).then((e=[f.Necessary])=>!!t&&e.indexOf(t)===-1),Ss=(n=[f.Necessary],t)=>!!t&&n.indexOf(t)===-1,Zt=n=>{const t=Gt(n),e=bt(n,window.localStorage),s=bt(n,sessionStorage),i=vt(t,"storagePolicy"),[r,o,a]=[t,e,s].map(h=>pt(h,i));De(n,r),qt(n,window.localStorage,o),qt(n,window.sessionStorage,a)},Ct=(n={days:30})=>{const{days:t=0,hours:e=0,minutes:s=0,seconds:i=0}=n,r=new Date;return r.setTime(r.getTime()+e*60*60*1e3),r.setTime(r.getTime()+t*24*60*60*1e3),r.setTime(r.getTime()+s*60*1e3),r.setTime(r.getTime()+i*1e3),r.toISOString()},Ps=n=>A(document)(()=>Gt(n)),ks=(n,t)=>A(document)(()=>De(n,t)),Ns=(n,t)=>{const e=t===m.Local?window.localStorage:window.sessionStorage;return A(e)(()=>bt(n,e))},Ms=(n,t,e)=>{const s=t===m.Local?window.localStorage:window.sessionStorage;return A(s)(()=>qt(n,s,e))};let gt=class{constructor(){this.memory={tenant:{},implementation:{},widget:{}}}async setItem(t,e,s={}){return A(this)(()=>{const i=pt(this.memory,[f.Necessary]),{scope:r=G.Tenant,expiration:o}=s;i[r][t]=Yt(e,f.Necessary,(o==null?void 0:o.toISOString())||Ct()),this.memory=i,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
11
- Key: ${t}
12
- Value: ${JSON.stringify(e)}
13
- Options: ${JSON.stringify(s)}
14
- Memory: ${JSON.stringify(i)}`)})}async getItem(t){return A(this)(()=>{const e=pt(this.memory,[f.Necessary]);process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value fetched from legacy memory storage.
15
- Key: ${t}
16
- Memory: ${JSON.stringify(e)}`);const s=vt(e,t);return this.memory=e,s})}async removeItem(t){return A(this)(()=>{const e=pt(this.memory,[f.Necessary]);delete e.tenant[t],delete e.implementation[t],delete e.widget[t],this.memory=e,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value removed from memory.
17
- Key: ${t}
18
- Memory: ${JSON.stringify(e)}`)})}async clear(){return Promise.resolve()}},Ds=class{constructor(){this.cookies=new gt,this.session=new gt,this.local=new gt}};Jt(n=>{n.createCommand("storage",t=>(e={})=>{const{consent:s}=e;if(typeof s<"u"){if(typeof s!="number"&&typeof s!="string"&&!Array.isArray(s)){process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
19
- Passed consent: ${JSON.stringify(s)}`);return}if(Array.isArray(s)&&!s.every(r=>typeof r=="number"||typeof r=="string")){process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
20
- Passed consent: ${JSON.stringify(s)}`);return}const i=[f.Necessary,f.Functional,f.Analytical,f.Marketing].filter((r,o,a)=>typeof s=="number"?s>o:typeof s=="string"?a.indexOf(s)+1>o:Array.isArray(s)?s.findIndex(h=>h===o+1||h===r)>-1:!0);return i.indexOf(f.Necessary)===-1&&(process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent does not include category: '${f.Necessary}'. Consent has to atleast include the '${f.Necessary}' category.
21
- Passed consent: ${JSON.stringify(s)}`),i.unshift(f.Necessary)),P(t.container,"storagePolicy",f.Necessary,{medium:m.Cookie,scope:G.Tenant,duration:{days:365}}).then(r=>r(i)).then(()=>{Zt(t.container),t.events.dispatch("storage:policy-changed",i)})}})});const Ls=Object.freeze(Object.defineProperty({__proto__:null,StorageCategory:f,StorageMedium:m,StorageProvider:Ds,StorageScope:G,StorageService:gt,createStorageWriter:P,readStorage:O},Symbol.toStringTag,{value:"Module"})),Is=n=>{const t=(i,r)=>{i&&(r?i.classList.add("ace-tabbing"):i.classList.remove("ace-tabbing"))},e=i=>{i.key==="Tab"?t(n,!0):i.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")||t(n,!1)},s=i=>{document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")&&document.activeElement.classList.contains("ace-tabbing")||t(n,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",s),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",s)}};function Rs(n,t){const{widgetName:e,label:s="",ariaLabel:i="",tooltip:r=""}=t;return n.classList.add("ace-widget-trigger"),n.classList.add(`ace-widget_${e}`),s.length&&n.classList.add("trigger-has-text"),i.length&&!n.getAttribute("aria-label")&&n.setAttribute("aria-label",i),i.length&&!n.getAttribute("tabindex")&&n.setAttribute("tabindex","0"),r.length&&!n.getAttribute("title")&&n.setAttribute("title",r),Is(n)}function Ts(n,t){n instanceof HTMLElement?(t&&n.setAttribute("title",t),n.classList.remove("ace-trigger-active"),n.classList.remove("ace-trigger-loading")):n instanceof Array&&n.forEach(e=>{t&&e.setAttribute("title",t),e.classList.remove("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}function Us(n){n instanceof HTMLElement?(n.classList.remove("ace-trigger-active"),n.classList.add("ace-trigger-loading")):n instanceof Array&&n.forEach(t=>{t.classList.remove("ace-trigger-active"),t.classList.add("ace-trigger-loading")})}function Le(n,t){n instanceof HTMLElement?(t&&n.setAttribute("title",t),n.classList.add("ace-trigger-active"),n.classList.remove("ace-trigger-loading")):n instanceof Array&&n.forEach(e=>{t&&e.setAttribute("title",t),e.classList.add("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}/**
22
- * @license
23
- * Copyright 2019 Google LLC
24
- * SPDX-License-Identifier: BSD-3-Clause
25
- */const ft=globalThis,Qt=ft.ShadowRoot&&(ft.ShadyCSS===void 0||ft.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xt=Symbol(),de=new WeakMap;let Ie=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Xt)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(Qt&&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 js=n=>new Ie(typeof n=="string"?n:n+"",void 0,Xt),te=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((s,i,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.")})(i)+n[r+1],n[0]);return new Ie(e,n,Xt)},Vs=(n,t)=>{if(Qt)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=ft.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},le=Qt?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return js(e)})(n):n;/**
26
- * @license
27
- * Copyright 2017 Google LLC
28
- * SPDX-License-Identifier: BSD-3-Clause
29
- */const{is:Hs,defineProperty:zs,getOwnPropertyDescriptor:Bs,getOwnPropertyNames:Ws,getOwnPropertySymbols:qs,getPrototypeOf:Js}=Object,M=globalThis,ue=M.trustedTypes,Fs=ue?ue.emptyScript:"",Tt=M.reactiveElementPolyfillSupport,X=(n,t)=>n,wt={toAttribute(n,t){switch(t){case Boolean:n=n?Fs:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},ee=(n,t)=>!Hs(n,t),pe={attribute:!0,type:String,converter:wt,reflect:!1,hasChanged:ee};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),M.litPropertyMetadata??(M.litPropertyMetadata=new WeakMap);class H 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=pe){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&zs(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=Bs(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const a=i==null?void 0:i.call(this);r.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??pe}static _$Ei(){if(this.hasOwnProperty(X("elementProperties")))return;const t=Js(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(X("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(X("properties"))){const e=this.properties,s=[...Ws(e),...qs(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,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 i of s)e.unshift(le(i))}else t!==void 0&&e.push(le(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 Vs(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)}_$EC(t,e){var r;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:wt).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){var r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const o=s.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:wt;this._$Em=i,this[i]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??ee)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.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 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 i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),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){}}H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[X("elementProperties")]=new Map,H[X("finalized")]=new Map,Tt==null||Tt({ReactiveElement:H}),(M.reactiveElementVersions??(M.reactiveElementVersions=[])).push("2.0.4");/**
30
- * @license
31
- * Copyright 2017 Google LLC
32
- * SPDX-License-Identifier: BSD-3-Clause
33
- */const tt=globalThis,$t=tt.trustedTypes,ge=$t?$t.createPolicy("lit-html",{createHTML:n=>n}):void 0,Re="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Te="?"+k,Ks=`<${Te}>`,V=document,st=()=>V.createComment(""),nt=n=>n===null||typeof n!="object"&&typeof n!="function",se=Array.isArray,Gs=n=>se(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Ut=`[
34
- \f\r]`,Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,fe=/-->/g,me=/>/g,I=RegExp(`>|${Ut}(?:([^\\s"'>=/]+)(${Ut}*=${Ut}*(?:[^
35
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ye=/'/g,be=/"/g,Ue=/^(?:script|style|textarea|title)$/i,Ys=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),Q=Ys(1),D=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),ve=new WeakMap,U=V.createTreeWalker(V,129);function je(n,t){if(!se(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ge!==void 0?ge.createHTML(t):t}const Zs=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":t===3?"<math>":"",o=Y;for(let a=0;a<e;a++){const h=n[a];let c,d,l=-1,u=0;for(;u<h.length&&(o.lastIndex=u,d=o.exec(h),d!==null);)u=o.lastIndex,o===Y?d[1]==="!--"?o=fe:d[1]!==void 0?o=me:d[2]!==void 0?(Ue.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=I):d[3]!==void 0&&(o=I):o===I?d[0]===">"?(o=i??Y,l=-1):d[1]===void 0?l=-2:(l=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?I:d[3]==='"'?be:ye):o===be||o===ye?o=I:o===fe||o===me?o=Y:(o=I,i=void 0);const p=o===I&&n[a+1].startsWith("/>")?" ":"";r+=o===Y?h+Ks:l>=0?(s.push(c),h.slice(0,l)+Re+h.slice(l)+k+p):h+k+(l===-2?a:p)}return[je(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class it{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const a=t.length-1,h=this.parts,[c,d]=Zs(t,e);if(this.el=it.createElement(c,s),U.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=U.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(Re)){const u=d[o++],p=i.getAttribute(l).split(k),g=/([.?@])?(.*)/.exec(u);h.push({type:1,index:r,name:g[2],strings:p,ctor:g[1]==="."?Xs:g[1]==="?"?tn:g[1]==="@"?en:Ot}),i.removeAttribute(l)}else l.startsWith(k)&&(h.push({type:6,index:r}),i.removeAttribute(l));if(Ue.test(i.tagName)){const l=i.textContent.split(k),u=l.length-1;if(u>0){i.textContent=$t?$t.emptyScript:"";for(let p=0;p<u;p++)i.append(l[p],st()),U.nextNode(),h.push({type:2,index:++r});i.append(l[u],st())}}}else if(i.nodeType===8)if(i.data===Te)h.push({type:2,index:r});else{let l=-1;for(;(l=i.data.indexOf(k,l+1))!==-1;)h.push({type:7,index:r}),l+=k.length-1}r++}}static createElement(t,e){const s=V.createElement("template");return s.innerHTML=t,s}}function q(n,t,e=n,s){var o,a;if(t===D)return t;let i=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=nt(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=q(n,i._$AS(n,t.values),i,s)),t}class Qs{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:s}=this._$AD,i=((t==null?void 0:t.creationScope)??V).importNode(e,!0);U.currentNode=i;let r=U.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new ot(r,r.nextSibling,this,t):h.type===1?c=new h.ctor(r,h.name,h.strings,this,t):h.type===6&&(c=new sn(r,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(r=U.nextNode(),o++)}return U.currentNode=V,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class ot{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=y,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.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=q(this,t,e),nt(t)?t===y||t==null||t===""?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==D&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Gs(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!==y&&nt(this._$AH)?this._$AA.nextSibling.data=t:this.T(V.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=it.createElement(je(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(e);else{const o=new Qs(i,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=ve.get(t.strings);return e===void 0&&ve.set(t.strings,e=new it(t)),e}k(t){se(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new ot(this.O(st()),this.O(st()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Ot{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=y,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=q(this,t,e,0),o=!nt(t)||t!==this._$AH&&t!==D,o&&(this._$AH=t);else{const a=t;let h,c;for(t=r[0],h=0;h<r.length-1;h++)c=q(this,a[s+h],e,h),c===D&&(c=this._$AH[h]),o||(o=!nt(c)||c!==this._$AH[h]),c===y?t=y:t!==y&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!i&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Xs extends Ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}}class tn extends Ot{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==y)}}class en extends Ot{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=q(this,t,e,0)??y)===D)return;const s=this._$AH,i=t===y&&s!==y||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==y&&(s===y||i);i&&this.element.removeEventListener(this.name,this,s),r&&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 sn{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){q(this,t)}}const jt=tt.litHtmlPolyfillSupport;jt==null||jt(it,ot),(tt.litHtmlVersions??(tt.litHtmlVersions=[])).push("3.2.1");const nn=(n,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new ot(t.insertBefore(st(),r),r,void 0,e??{})}return i._$AI(n),i};/**
36
- * @license
37
- * Copyright 2017 Google LLC
38
- * SPDX-License-Identifier: BSD-3-Clause
39
- */let W=class extends H{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=nn(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return D}};var xe;W._$litElement$=!0,W.finalized=!0,(xe=globalThis.litElementHydrateSupport)==null||xe.call(globalThis,{LitElement:W});const Vt=globalThis.litElementPolyfillSupport;Vt==null||Vt({LitElement:W});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
40
- * @license
41
- * Copyright 2017 Google LLC
42
- * SPDX-License-Identifier: BSD-3-Clause
43
- */const rn={attribute:!0,type:String,converter:wt,reflect:!1,hasChanged:ee},on=(n=rn,t,e)=>{const{kind:s,metadata:i}=e;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),r.set(e.name,n),s==="accessor"){const{name:o}=e;return{set(a){const h=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,h,n)},init(a){return a!==void 0&&this.P(o,void 0,n),a}}}if(s==="setter"){const{name:o}=e;return function(a){const h=this[o];t.call(this,a),this.requestUpdate(o,h,n)}}throw Error("Unsupported decorator location: "+s)};function J(n){return(t,e)=>typeof e=="object"?on(n,t,e):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,t,e)}/**
44
- * @license
45
- * Copyright 2017 Google LLC
46
- * SPDX-License-Identifier: BSD-3-Clause
47
- */function C(n){return J({...n,state:!0,attribute:!1})}/**
48
- * @license
49
- * Copyright 2017 Google LLC
50
- * SPDX-License-Identifier: BSD-3-Clause
51
- */const Ve={ATTRIBUTE:1,CHILD:2},He=n=>(...t)=>({_$litDirective$:n,values:t});let ze=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
52
- * @license
53
- * Copyright 2018 Google LLC
54
- * SPDX-License-Identifier: BSD-3-Clause
55
- */const an=He(class extends ze{constructor(n){var t;if(super(n),n.type!==Ve.ATTRIBUTE||n.name!=="class"||((t=n.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(n){return" "+Object.keys(n).filter(t=>n[t]).join(" ")+" "}update(n,[t]){var s,i;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.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=n.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)||(i=this.nt)!=null&&i.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return D}}),dt=(n,t,e)=>{n&&e.style.setProperty(t,n)},Be=(n,t)=>{var e,s,i,r;dt((e=n.colors)==null?void 0:e.primaryBackground,"--primary-background",t),dt((s=n.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),dt((i=n.colors)==null?void 0:i.secondaryBackground,"--secondary-background",t),dt((r=n.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var cn=Object.defineProperty,at=(n,t,e,s)=>{for(var i=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=o(t,e,i)||i);return i&&cn(t,e,i),i};const ie=class ie extends W{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&&Be(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:i}=t;switch(s){case"Telia":{const r=await e(i);return r?Q`<telia-icon
56
- class="trigger-icon"
57
- svg=${r.svg}
58
- size="lg"
59
- ></telia-icon>`:y}case"FontAwesome":return Q`<i class="trigger-fa-icon fa fa-${i}"></i>`;case"Uri":return Q`<i
60
- class="trigger-custom-icon"
61
- style="background: url(${i}) no-repeat center center;background-size: contain;"
62
- ></i>`;default:return y}}}render(){return Q`<button
63
- class=${an({trigger:!0,active:this.active,rendered:this.loaded})}
64
- @click=${this._toggleActive}
65
- >
66
- ${this.icon}
67
- <span class="trigger-close">
68
- <svg
69
- width="18"
70
- height="9"
71
- viewBox="0 0 18 9"
72
- fill="none"
73
- xmlns="http://www.w3.org/2000/svg"
74
- >
75
- <path
76
- d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z"
77
- fill="white"
78
- />
79
- </svg>
80
- </span>
81
- <span class="trigger-loader">
82
- <svg viewBox="25 25 50 50">
83
- <circle
84
- cx="50"
85
- cy="50"
86
- r="20"
87
- fill="none"
88
- stroke="#000"
89
- stroke-width="2"
90
- stroke-miterlimit="10"
91
- />
92
- </svg>
93
- </span>
94
- </button>`}};ie.styles=[te`
95
- :host {
96
- --voca-rem-multiplier: 0.625;
97
- display: block;
98
- box-sizing: border-box;
99
- }
100
-
101
- .trigger {
102
- position: fixed;
103
- transform: scale(0);
104
- box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
105
- bottom: 20px;
106
- right: 20px;
107
- z-index: 5;
108
- display: flex;
109
- align-items: center;
110
- justify-content: center;
111
- border: none;
112
- line-height: 55px;
113
- height: 55px;
114
- width: 55px;
115
- border-radius: 55px;
116
- cursor: pointer;
117
- background-color: var(--trigger-bg, var(--primary-background));
118
- font-family: Lato;
119
- text-decoration: none;
120
- border: 3px dashed transparent;
121
- box-sizing: border-box;
122
- transition: transform 200ms ease-out;
123
- }
124
- .trigger:hover {
125
- transform: scale(1.1) !important;
126
- }
127
- .trigger.rendered {
128
- transform: scale(1);
129
- }
130
- .trigger.active .trigger-icon {
131
- opacity: 0;
132
- transform: rotate(-180deg) scale(0);
133
- }
134
- .trigger.active .trigger-close {
135
- opacity: 1;
136
- transform: rotate(0deg) scale(1);
137
- }
138
-
139
- .trigger-icon {
140
- display: inline-block;
141
- line-height: inherit;
142
- text-align: center;
143
- opacity: 1;
144
- transform: rotate(0deg) scale(1);
145
- transition: opacity 200ms ease-out, transform 200ms ease-out;
146
- color: var(--trigger-text-color, var(--text-on-primary-background));
147
- }
148
- .trigger-close {
149
- opacity: 0;
150
- transition: transform 200ms ease-out;
151
- transform: rotate(180deg) scale(0);
152
- position: absolute;
153
- top: 0;
154
- bottom: 0;
155
- left: 0;
156
- right: 0;
157
- display: flex;
158
- justify-content: center;
159
- align-items: center;
160
- fill: var(--trigger-text-color, var(--text-on-primary-background));
161
- }
162
- `];let L=ie;at([J({attribute:!1})],L.prototype,"symbol");at([J({attribute:!1})],L.prototype,"container");at([C()],L.prototype,"active");at([C()],L.prototype,"loaded");at([C()],L.prototype,"icon");var j=(n=>(n.Inline="inline",n.Link="link",n.Badge="badge",n.Unsupported="unsupported",n))(j||{});const hn=(n,t)=>n&&t?"both":n?"widgetDOM":t?"triggerDOM":"none",We=n=>n?typeof n=="boolean"&&n?"link":typeof n=="object"&&!Array.isArray(n)?"badge":"unsupported":"inline",dn=async(n,t,e,s,i,r=!1)=>{var d,l;const o=hn(e,s),a=We(i),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",(d=s==null?void 0:s.parentNode)==null||d.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"}):(l=s==null?void 0:s.parentNode)==null||l.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=i.symbol,p.container=n,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},ln="modals";class un{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 i=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...i,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===j.Badge&&Us(e),Promise.resolve().then(()=>require("./render-ENE9aPcF.js")).then(i=>i.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===j.Badge){const r=this.options.triggerOptions.openTooltip;Le(e,r)}ps(this.container,t);const i=this.container.get("$environment").widgets.all();O(this.container,ln,m.Session).then(r=>{r&&r.forEach(o=>{i.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:i,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const d=Rs(e,{label:i,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(d)}async dispose(){var s,i,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&&((i=t.parentNode)==null||i.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 lt="changesets",pn=n=>{const t={tags:n.tags};return n.context&&typeof n.context!="function"&&(t.context=n.context),n.properties&&typeof n.properties!="function"&&(t.properties=n.properties),n.layout&&typeof n.layout!="function"&&(t.layout=n.layout),t};class ne{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return P(t,lt,f.Necessary,{medium:m.Local}).then(e=>new ne(t,e))}write(t,e,s,i){return A(this)(()=>O(this.container,lt,m.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:i,attributes:pn(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>O(this.container,lt,m.Local).then((e={})=>{const{keys:s=[],items:i={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete i[t],this.storageWriter(e)}))}load(t){return A(this)(()=>O(this.container,lt,m.Local).then((e={})=>{const{keys:s=[],items:i={}}=e;s.forEach(r=>{const o=i[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new F(t,a)})}})}))}}const gn=n=>{const{container:t}=n;return ne.create(t).then(e=>{const s=t.get("$settings"),i={localStorage:e},r=new K(n,i),o=ke(r,s);return n.events.subscribe("widget:state-change",(a,h)=>{h.state===Ee.Deactivating&&o()}),r})},fn=n=>Promise.resolve().then(()=>Ls).then(({StorageProvider:t})=>new t),mn=n=>Promise.resolve().then(()=>Kt).then(({ActionResolver:t})=>new t(n)),yn=n=>Promise.resolve().then(()=>Kt).then(({ComponentResolver:t})=>new t(n)),bn=n=>Promise.resolve().then(()=>Kt).then(()=>gn(n.get("$widget"))),Ht="$settings",zt="open",we="activeStickyWidget";class vn 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(i=>{const{activate:r}=i;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>fn(this.container)),this.container.registerFactory("settings",()=>O(this.container,Ht,m.Local).then((e={})=>({...this.container.get("$settings"),...e}))),os(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>yn(this.container)),this.container.registerAsync("actionResolver",()=>mn(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>bn(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:i},r])=>(s.subscribe(this.widget.name,(h,c,d)=>this.onAction(c,d)),(h=>{i.nodes.query({type:"view"}).forEach(c=>{i.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:i=rt(),triggerDOMElement:r,withRenderState:o}=t,h=We(e)===j.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await dn(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const d=()=>{const g=()=>v.querySelectorAll("[data-loading=true]").length===0,[v]=this.widget.container.get("widgetDOMElements"),x=(Pt,$)=>{g()&&(c.callback&&c.callback(),$.disconnect())},ct={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(x).observe(v,ct)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(v,x)=>{x.unresolvedQueries===0&&d()})});const l=this.getOrCreateViewOutlet(i,c);if(this.outlets.set(i,l),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===j.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),l==null||l.renderBadge(e)),c.triggerType!==j.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:v})=>{l.render().then(()=>this.renderState()).then(x=>v&&v.action&&v.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===j.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 un(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,Ht,f.Necessary,{medium:m.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(i=>s(i).then(()=>{const r={...e,...i};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return P(this.container,Ht,f.Necessary,{medium:m.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,zt,m.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(i=>{var r;return(r=i.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,zt,f.Necessary,{medium:m.Session}),P(this.container,zt,f.Necessary,{medium:m.Local,duration:{minutes:5}}),e("renderState")]).then(([i,r,o])=>{t==="unset"||!t?(r(),i()):i(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:i}=this.container.get("$settings");return s.activate!==i?this.setSettings(()=>Promise.resolve({activate:i})):Promise.resolve()}).then(()=>t).then(({components:s})=>{this.outlets.forEach(i=>{var r;return(r=i.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:i}}=e,{openTooltip:r,closedTooltip:o}=i||{};s&&(t?Le(s,r):Ts(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),O(this.container,we,m.Local).then(e=>e===this.widget.name?P(this.container,we,f.Necessary,{medium:m.Local,scope:G.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
163
- * @license
164
- * Copyright 2021 Google LLC
165
- * SPDX-License-Identifier: BSD-3-Clause
166
- */let qe=class extends Event{constructor(t,e,s){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=s??!1}};/**
167
- * @license
168
- * Copyright 2021 Google LLC
169
- * SPDX-License-Identifier: BSD-3-Clause
170
- *//**
171
- * @license
172
- * Copyright 2021 Google LLC
173
- * SPDX-License-Identifier: BSD-3-Clause
174
- */let $e=class{constructor(t,e,s,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const r=e;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new qe(this.context,this.t,this.subscribe))}};/**
175
- * @license
176
- * Copyright 2021 Google LLC
177
- * SPDX-License-Identifier: BSD-3-Clause
178
- */class wn{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const s=e||!Object.is(t,this.o);this.o=t,s&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:s}]of this.subscriptions)e(this.o,s)},t!==void 0&&(this.value=t)}addCallback(t,e,s){if(!s)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:i}=this.subscriptions.get(t);t(this.value,i)}clearCallbacks(){this.subscriptions.clear()}}/**
179
- * @license
180
- * Copyright 2021 Google LLC
181
- * SPDX-License-Identifier: BSD-3-Clause
182
- */class $n extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}}class z extends wn{constructor(t,e,s){var i,r;super(e.context!==void 0?e.initialValue:s),this.onContextRequest=o=>{const a=o.composedPath()[0];o.context===this.context&&a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{const a=o.composedPath()[0];if(o.context!==this.context||a===this.host)return;const h=new Set;for(const[c,{consumerHost:d}]of this.subscriptions)h.has(c)||(h.add(c),d.dispatchEvent(new qe(this.context,c,!0)));o.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(r=(i=this.host).addController)==null||r.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new $n(this.context))}}/**
183
- * @license
184
- * Copyright 2022 Google LLC
185
- * SPDX-License-Identifier: BSD-3-Clause
186
- */function _n({context:n,subscribe:t}){return(e,s)=>{typeof s=="object"?s.addInitializer(function(){new $e(this,{context:n,callback:i=>{e.set.call(this,i)},subscribe:t})}):e.constructor.addInitializer(i=>{new $e(i,{context:n,callback:r=>{i[s]=r},subscribe:t})})}}const Je="children",Fe="descriptor",Ke="container",Ge="context",Ye="layout",Ze="properties";class Qe{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 K.getInstance(this._container),i=new F(s).withId(this._descriptor.id);await s.actions(i,this._descriptor.type||rt()).dispatch(t,e)}}const xn=async(n,t)=>{const e=n.properties().provider;let s={},i="";Array.isArray(e)?(i=e[0],s=e[1]):i=e||"";const r=await t.getAsync(i);if(!r)throw new Error("No provider defined in ListComponent");return r.applyComponentNodeSettings(n.node.id,s),{provider:r,settings:s}},An=async(n,t)=>{const{provider:e,settings:s={}}=await xn(n,t);return{addResource:(i,r)=>e.addResource(i,r),getData:(i,r)=>e.getData(i,r,s)}};class Xe{constructor(t){this.container=t,this.resources=new Map,this.nodeConfiguration=new Map}async getData(t,e,s){const i=this.resources.get(t);if(!i)throw new Error(`Unable to get EntityProvider for "${t}"`);return await i.query(e,s)}addResource(t,e){this.resources.set(t,e)}applyComponentNodeSettings(t,e){this.nodeConfiguration.set(t,e)}}const _e=n=>({title:n.Title,id:n.Id.toString()});class En extends Xe{constructor(t){super(t),this.addResource("item",{query:async(e,s)=>{const i=e.itemId,r="78aacc09-ae6f-5485-5ca3-9dacebb95825",o=t.get("$widget").name,a=s.projection||"",c=await(await fetch(`${a}/guides/${i}?client=${r}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`)).json();return c?_e(c):null}}),this.addResource("items",{query:async(e,s)=>{const i="",r=t.get("$widget").name,o=s.projection||"",l=await(await fetch(`${o}/guides?client=${i}&funnel=${r}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`)).json();return{items:(l.Matches||[]).map(u=>_e(u)),totalItems:(l==null?void 0:l.TotalMatches)||0}}})}}const Cn=async n=>{n.registerAsync("guideProvider",()=>new En(n))},On=(n,t,e,s,i)=>n.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),Ne(n,t,s||(()=>{}),t,i))),Sn=n=>{const t={};return Object.keys(n).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=n[e])}),t},ts=(n,t)=>{const e=Sn(t);Object.entries(e).forEach(([s,i])=>{n.style.setProperty(s.replace("css-",""),i)})};var Pn=Object.defineProperty,R=(n,t,e,s)=>{for(var i=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=o(t,e,i)||i);return i&&Pn(t,e,i),i};const kn=n=>{const e=class e extends n{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new z(this,Fe,void 0),this._childrenProvider=new z(this,Je,[]),this._propertiesProvider=new z(this,Ze,{}),this._contextProvider=new z(this,Ge,{}),this._layoutProvider=new z(this,Ye,{}),this.actions=new Qe(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),K.getInstance(this.container).then(async i=>{var o,a;const r=i.nodes.get(this.entry);if(r){this._propertyChangeListener=i.events.subscribe("components:properties-changed",(u,p)=>{r.id===p.node.id&&this._setProperties(p.node.attributes.properties)}),this._contextChangeListener=i.events.subscribe("components:context-changed",(u,p)=>{r.id===p.node.id&&this._setContext(p.node.attributes.context)}),this._layoutChangeListener=i.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(Wt(r,h)),this._setProperties(r.attributes.properties),this._setContext(r.attributes.context),this._setLayout(this.layout);const c=r.getChildren(h).map(u=>Wt(u));this._childrenProvider.setValue(c);const d=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const l=d.getComponent(((a=this.descriptor)==null?void 0:a.type)||"");l.then&&l.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))`),ts(this.renderRoot.host,this.properties)}_setProperties(i){this._propertiesProvider.setValue(i),this.properties=i}_setContext(i){this._contextProvider.setValue(i),this.context=i}_setLayout(i){this._layoutProvider.setValue(i),this.layout=i}_setDescriptor(i){this.descriptor=i,this._descriptorProvider.setValue(i),this.actions.setDescriptor(i)}};e.styles=[n.styles??[],te`
187
- :host {
188
- font-family: var(--font-family);
189
- grid-column: span var(--width);
190
- max-width: 100%;
191
- overflow: hidden;
192
- box-sizing: border-box;
193
- display: block;
194
- }
195
- * {
196
- box-sizing: border-box;
197
- }
198
- `];let t=e;return R([_n({context:Ke}),J({attribute:!1})],t.prototype,"container"),R([J()],t.prototype,"entry"),R([C()],t.prototype,"descriptor"),R([C()],t.prototype,"component"),R([C()],t.prototype,"context"),R([C()],t.prototype,"layout"),R([C()],t.prototype,"properties"),t};exports.ActionsController=Qe;exports.DataProvider=Xe;exports.E=y;exports.GuideProviderPlugin=Cn;exports.T=D;exports.Widget=vn;exports.WidgetComponent=kn;exports.appendStyleFromProperties=ts;exports.childrenContext=Je;exports.containerContext=Ke;exports.contextCtx=Ge;exports.createDataProvider=An;exports.createLitComponent=On;exports.descriptorContext=Fe;exports.e=He;exports.et=K;exports.i=ze;exports.i$1=z;exports.i$2=te;exports.layoutCtx=Ye;exports.mapBranding=Be;exports.n=J;exports.ot=w;exports.propertiesCtx=Ze;exports.r=W;exports.r$1=C;exports.t=Ve;exports.x=Q;
@@ -1,120 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-C7Sm0jBi.js");/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const v=e=>(t,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};/**
6
- * @license
7
- * Copyright 2020 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const A=e=>e===null||typeof e!="object"&&typeof e!="function",P=e=>e.strings===void 0;/**
10
- * @license
11
- * Copyright 2017 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */const u=(e,t)=>{var n;const s=e._$AN;if(s===void 0)return!1;for(const i of s)(n=i._$AO)==null||n.call(i,t,!1),u(i,t);return!0},f=e=>{let t,s;do{if((t=e._$AM)===void 0)break;s=t._$AN,s.delete(e),e=t}while((s==null?void 0:s.size)===0)},w=e=>{for(let t;t=e._$AM;e=t){let s=t._$AN;if(s===void 0)t._$AN=s=new Set;else if(s.has(e))break;s.add(e),k(t)}};function R(e){this._$AN!==void 0?(f(this),this._$AM=e,w(this)):this._$AM=e}function S(e,t=!1,s=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(n))for(let o=s;o<n.length;o++)u(n[o],!1),f(n[o]);else n!=null&&(u(n,!1),f(n));else u(this,e)}const k=e=>{e.type==r.t.CHILD&&(e._$AP??(e._$AP=S),e._$AQ??(e._$AQ=R))};class C extends r.i{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,s,n){super._$AT(t,s,n),w(this),this.isConnected=t._$AU}_$AO(t,s=!0){var n,i;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),s&&(u(this,t),f(this))}setValue(t){if(P(this._$Ct))this._$Ct._$AI(t,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=t,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
14
- * @license
15
- * Copyright 2020 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */const Y=()=>new O;let O=class{};const y=new WeakMap,L=r.e(class extends C{render(e){return r.E}update(e,[t]){var n;const s=t!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=t,this.ht=(n=e.options)==null?void 0:n.host,this.rt(this.ct=e.element)),r.E}rt(e){if(this.isConnected||(e=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let s=y.get(t);s===void 0&&(s=new WeakMap,y.set(t,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,e),e!==void 0&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){var e,t;return typeof this.Y=="function"?(e=y.get(this.ht??globalThis))==null?void 0:e.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)}}),E=async e=>await e.get("$widget").invoke("renderState"),D=async(e,t)=>{const s=e.get("$widget");return(await e.getAsync("actionResolver")).subscribe(s.name,t)},M=(e,t,s=!1)=>{const n=e.reduce((a,{breakpoints:c=[],values:d})=>c.length?t.some(g=>c.includes(g))?{...a,...d}:a:{...a,...d},{}),i={},o=n.type;return i.height=n.height||"",i.width=n.width||"",n.type==="floating"||n.type==="inline"&&s&&(i.height="calc(100vh - 120px)"),{type:o,styles:i}};var T=Object.defineProperty,z=Object.getOwnPropertyDescriptor,l=(e,t,s,n)=>{for(var i=n>1?void 0:n?z(t,s):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,s,i):a(i))||i);return n&&i&&T(t,s,i),i};let h=class extends r.r{constructor(){super(),this._provider=new r.i$1(this,r.containerContext,void 0),this.wrapperRef=Y(),this.breakpoints=[],this.breakpointsSet=!1}connectedCallback(){super.connectedCallback(),this._provider.setValue(this.container),this.container&&(E(this.container).then(e=>{this.renderState=e}),D(this.container,(e,t)=>{switch(t){case"close":case"open":this.renderState=t==="open"?r.ot.open:r.ot.closed;break;case"hide":this.renderState=r.ot.hidden}}).then(e=>{this._unsubscribeRenderState=e}),r.et.getInstance(this.container).then(e=>{this.componentPlatform=e,this.breakpoints=this.componentPlatform.breakpoints,this.breakpointsSet=!0,this._unsubscribePropChange=this.componentPlatform.events.subscribe("components:properties-changed",(t,s)=>{var n,i;((n=s==null?void 0:s.node)==null?void 0:n.type)==="root"&&(this.breakpoints=(i=this.componentPlatform)!=null&&i.breakpoints?[...this.componentPlatform.breakpoints]:[])}),this.entry=this.componentPlatform.nodes.root.children.default[0].id||void 0}))}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeRenderState&&this._unsubscribeRenderState(),this._unsubscribePropChange&&this._unsubscribePropChange()}applyBranding(){var e;if(this.wrapperRef.value){const t=(e=this.container)==null?void 0:e.get("$settings");t!=null&&t.branding&&r.mapBranding(t.branding,this.wrapperRef.value)}}render(){var t,s,n,i;let e;if(!this.entry||!this.breakpointsSet)return r.E;if(this.container&&this.renderState){const[o]=this.container.get("widgetDOMElements");o&&o.setAttribute("data-state",this.renderState)}if(this.container){const o=this.container.get("$settings");o!=null&&o.layout&&(e=M(o.layout,this.breakpoints,!!o.trigger),e.type==="floating"?(this.renderRoot.host.classList.add("floating"),this.renderRoot.host.classList.remove("inline")):(this.renderRoot.host.classList.add("inline"),this.renderRoot.host.classList.remove("floating")),Object.entries(e.styles).forEach(([a,c])=>{this.renderRoot.host.style.setProperty(a,c)}))}return this.renderState&&(this.renderState===r.ot.hidden?((t=this.wrapperRef.value)==null||t.classList.add("hidden"),(s=this.wrapperRef.value)==null||s.classList.remove("expanded")):((n=this.wrapperRef.value)==null||n.classList.remove("hidden"),(i=this.wrapperRef.value)==null||i.classList.add("expanded"))),this.applyBranding(),r.x`
18
- <div class="widget-container" ${L(this.wrapperRef)}>
19
- <ace-area entry=${this.entry}></ace-area>
20
- </div>
21
- `}};h.styles=r.i$2`
22
- :host {
23
- --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
24
- --spacing-xs: 0.2rem;
25
- --spacing-sm: 0.5rem;
26
- --spacing-md: 1rem;
27
- --spacing-lg: 1.2rem;
28
- --spacing-xl: 1.8rem;
29
-
30
- /* --primary-color: #29003e; */
31
- /* --secondary-color: #00558f; */
32
- --text-color: #222222;
33
- --link-color: #990ae3;
34
- --gray-color: #f3f3f8;
35
- --gray-dark-color: #a6a6a6;
36
-
37
- --box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
38
- --border-radius: var(--spacing-sm);
39
- --border-radius-sm: var(--spacing-sm);
40
- }
41
- :host {
42
- --voca-rem-multiplier: 0.625;
43
- box-sizing: border-box;
44
- display: block;
45
- }
46
-
47
- :host(.floating) {
48
- position: fixed;
49
- z-index: 6;
50
- inset: auto 20px 95px auto;
51
- max-height: calc(100vh - 120px);
52
- }
53
- :host(.floating) .widget-container {
54
- box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
55
- border-radius: 0.7rem;
56
- }
57
- :host(.inline) {
58
- height: 100%;
59
- position: fixed;
60
- inset: 0 0 0 0;
61
- }
62
-
63
- * {
64
- box-sizing: border-box;
65
- }
66
- .widget-container {
67
- height: 100%;
68
- background-color: var(--primary-background);
69
- padding: 0 var(--spacing-sm);
70
- }
71
- .widget-container.expanded {
72
- opacity: 1;
73
- animation: slideUp 0.5s;
74
- }
75
- .widget-container.hidden {
76
- opacity: 0;
77
- animation: slideDown 0.5s;
78
- }
79
- @keyframes slideDown {
80
- from {
81
- transform: translateY(0);
82
- opacity: 1;
83
- }
84
- to {
85
- transform: translateY(100%);
86
- opacity: 0;
87
- }
88
- }
89
- @keyframes slideUp {
90
- from {
91
- transform: translateY(100%);
92
- opacity: 0;
93
- }
94
- to {
95
- transform: translateY(0);
96
- opacity: 1;
97
- }
98
- }
99
- `;l([r.n({attribute:!1})],h.prototype,"container",2);l([r.r$1()],h.prototype,"componentPlatform",2);l([r.r$1()],h.prototype,"renderState",2);l([r.r$1()],h.prototype,"breakpoints",2);l([r.r$1()],h.prototype,"breakpointsSet",2);l([r.r$1()],h.prototype,"entry",2);h=l([v("ace-widget-wrapper")],h);/**
100
- * @license
101
- * Copyright 2021 Google LLC
102
- * SPDX-License-Identifier: BSD-3-Clause
103
- */class j{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}class N{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??(this.Z=new Promise(t=>this.q=t))}resume(){var t;(t=this.q)==null||t.call(this),this.Z=this.q=void 0}}/**
104
- * @license
105
- * Copyright 2017 Google LLC
106
- * SPDX-License-Identifier: BSD-3-Clause
107
- */const b=e=>!A(e)&&typeof e.then=="function",_=1073741823;class q extends C{constructor(){super(...arguments),this._$Cwt=_,this._$Cbt=[],this._$CK=new j(this),this._$CX=new N}render(...t){return t.find(s=>!b(s))??r.T}update(t,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 d=s[c];if(!b(d))return this._$Cwt=c,d;c<i&&d===n[c]||(this._$Cwt=_,i=0,Promise.resolve(d).then(async g=>{for(;a.get();)await a.get();const p=o.deref();if(p!==void 0){const m=p._$Cbt.indexOf(d);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(q);var W=Object.getOwnPropertyDescriptor,H=(e,t,s,n)=>{for(var i=n>1?void 0:n?W(t,s):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i};const x=r.WidgetComponent(r.r);let $=class extends x{constructor(){super(...arguments),this._resolveChildComponent=async e=>{const s=(await this.container.getAsync("componentResolver")).getComponent(e);if(s.then)return s.then(n=>n.default)},this._resolveAllChildren=async e=>Promise.all(e.map(async t=>{let s=customElements.get(`ace-${t.type}`);return s||(s=await this._resolveChildComponent(t.type||"")),{...t,component:s}}))}render(){var e;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",((e=this._propertiesProvider.value.columns)==null?void 0:e.toString())||"1"),r.appendStyleFromProperties(this.renderRoot.host,this._propertiesProvider.value),r.x`
108
- ${I(this._resolveAllChildren(this._childrenProvider.value).then(t=>r.x`
109
- ${t.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
- `))}
111
- `}};$.styles=[x.styles||[],r.i$2`
112
- :host {
113
- height: 100%;
114
- display: grid;
115
- justify-content: center;
116
- grid-auto-rows: max-content;
117
- grid-template-rows: auto;
118
- grid-template-columns: repeat(var(--columns), 1fr);
119
- }
120
- `];$=H([v("ace-area")],$);const K=(e,t)=>{const s=new h;s.container=e,t.appendChild(s)};exports.default=K;