@luigi-project/core-modular 0.0.2 → 0.0.3

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/luigi.js CHANGED
@@ -3,7 +3,7 @@ Static and dynamic nodes cannot be used together on the same level. Static node
3
3
  Remove the static node from the configuration to resolve this warning.
4
4
  Affected pathSegment:`,e,"Children:",t),t=t.filter(a=>a.pathSegment&&a.pathSegment.startsWith(":"))),s>1)){console.error(`Invalid node setup detected.
5
5
  Multiple dynamic nodes are not allowed on the same level. Stopped navigation.
6
- Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegment&&a.pathSegment.startsWith(":"))return n=a,!0}),n}buildNavItems(e,t,n){const r={},s=[];return e==null||e.forEach(a=>{var o,l,c;if(M.isNodeAccessPermitted(a,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(a.category){const f=a.category.id||a.category.label||a.category,h=this.luigi.i18n().getTranslation(a.category.label||a.category.id||a.category);let u=r[f];u||(u={category:{altText:a.category.altText||"",icon:a.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(a.category,h)}},r[f]=u,s.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:a,selected:a===t,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,altText:a.altText,icon:a.icon})}else s.push({altText:a.altText,icon:a.icon,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,node:a,selected:a===t})}),s}async shouldRedirect(e,t){var r;const n=t??await this.getPathData(e);if(e=="")return n.rootNodes[0].pathSegment;if(n.selectedNode&&!n.selectedNode.viewUrl&&((r=n.selectedNode.children)!=null&&r.length))return e+"/"+n.selectedNode.children[0].pathSegment}async getCurrentNode(e){var r;const t=await this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}async getPathParams(e){return(await this.getPathData(e)).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(s=>{(!t||s.tabNav)&&(s.tabNav===!1&&(n=!0),s.keepSelectedForChildren===!1?t=!0:(s.keepSelectedForChildren||s.tabNav&&!n)&&(t=!0,r=[])),r.push(s)}),r.reverse()}applyNavGroups(e){const t={},n=[],s=[];return e.forEach(a=>{if(a.node)s.push(a);else if(a.category){const o=a.category.id;o&&o.indexOf("::")>0?n.push(a):(a.category.isGroup,t[o]=a,s.push(a))}}),n.forEach(a=>{var c;const o=((c=a.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(a))}),s.filter(a=>{var o,l,c,f,h,u;if((o=a.category)!=null&&o.isGroup&&((l=a.category)!=null&&l.nodes)&&((c=a.category)==null?void 0:c.nodes.length)>0){for(let d=0;d<((f=a.category)==null?void 0:f.nodes.length);d++){const S=(h=a.category)==null?void 0:h.nodes[d];if(S.node&&!S.node.hideFromNav&&S.node.label||(u=S.category)!=null&&u.nodes&&S.category.nodes.filter(_=>{var E,R;return!((E=_.node)!=null&&E.hideFromNav)&&((R=_.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}async getLeftNavData(e,t){var S,_;const n=t??await this.getPathData(e);let r=[];const s=[];let a="";(S=n.nodesInPath)==null||S.forEach(E=>{E.children&&(E.tabNav||(a+="/"+(E.pathSegment||"")),s.push(E))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop());let f,h=c;c?n.rootNodes.includes(c)?(f=c,h=void 0):c.tabNav?f=l:f=[...s].pop():(f=[...s].pop(),h=void 0);let u=await this.getChildren(f,(f==null?void 0:f.context)||{})||[];r=this.buildNavItems(u,h,n);const d=M.buildPath(s,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:a.replace(/\/\/+/g,"/"),sideNavFooterText:(_=this.luigi.getConfig().settings)==null?void 0:_.sideNavFooterText,navClick:E=>E.node&&this.navItemClick(E.node,d)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}async getTopNavData(e,t){var h,u,d,S,_,E,R,L,U,z,G,K,J,j,k,I,$,m,te,H,O,re,g,ue,b,D,pe;const n=this.luigi.getConfig(),r=t??await this.getPathData(e),s=(d=(u=(h=n.navigation)==null?void 0:h.profile)==null?void 0:u.items)!=null&&d.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],a=((S=n.navigation)==null?void 0:S.appSwitcher)&&this.getAppSwitcherData((_=n.navigation)==null?void 0:_.appSwitcher,(E=n.settings)==null?void 0:E.header),o=M.updateHeaderTitle(a,r);s!=null&&s.length&&s.map(P=>({...P,label:this.luigi.i18n().getTranslation(P.label||"")}));const l=this.luigi.i18n().getTranslation((U=(L=(R=n.navigation)==null?void 0:R.profile)==null?void 0:L.logout)==null?void 0:U.label)||rt.logout.label,c=P=>{var Ue,Qe;if(P.openNodeInModal&&!((Ue=P.externalLink)!=null&&Ue.url))this.luigi.navigation().openAsModal(P.link||"",P.openNodeInModal===!0?{}:P.openNodeInModal);else if(P.link)this.luigi.navigation().navigate(P.link);else if((Qe=P.externalLink)!=null&&Qe.url)if(P.externalLink.sameWindow)window.location.href=P.externalLink.url;else{const tt=window.open(P.externalLink.url,"_blank","noopener noreferrer");tt&&(tt.opener=null,tt.focus())}},f={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&he.isLoggedIn(),items:s,itemClick:c,logout:{altText:this.luigi.i18n().getTranslation((K=(G=(z=n.navigation)==null?void 0:z.profile)==null?void 0:G.logout)==null?void 0:K.altText)||rt.logout.label,label:l,icon:((k=(j=(J=n.navigation)==null?void 0:J.profile)==null?void 0:j.logout)==null?void 0:k.icon)||rt.logout.icon,testId:((m=($=(I=n.navigation)==null?void 0:I.profile)==null?void 0:$.logout)==null?void 0:m.testId)||M.prepareForTests(l),doLogout:()=>{Te.logout()}},onUserInfoUpdate:P=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(Ue=>{Ue?P(Ue):Te.getUserInfoStore().subscribe(Qe=>{P(Qe)})})}};return{appTitle:o||((H=(te=n.settings)==null?void 0:te.header)==null?void 0:H.title),logo:(re=(O=n.settings)==null?void 0:O.header)==null?void 0:re.logo,topNodes:this.buildNavItems(r.rootNodes,void 0,r),productSwitcher:(g=n.navigation)==null?void 0:g.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||(ue=n.navigation)!=null&&ue.profile?f:void 0,appSwitcher:((b=n.navigation)==null?void 0:b.appSwitcher)&&this.getAppSwitcherData((D=n.navigation)==null?void 0:D.appSwitcher,(pe=n.settings)==null?void 0:pe.header),navClick:P=>P.node&&this.navItemClick(P.node,"")}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var s;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const a={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((s=n.items)==null||s.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===a.link))return n;n.items.unshift(a)}return n}async getTabNavData(e,t){var f;const n=t??await this.getPathData(e),r=n==null?void 0:n.selectedNode;let s;if(!r)return{};if(!r.tabNav&&(s=this.getParentNode(r,n),s&&!s.tabNav))return{};let a="";(f=n.nodesInPath)==null||f.forEach(h=>{h.children&&(a+="/"+(h.pathSegment||""))});const o=s?this.getTruncatedChildren(s.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:a.replace(/\/\/+/g,"/"),navClick:h=>h.node&&this.navItemClick(h.node,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");v.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=await this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}async shouldPreventNavigation(e){return!!(e!=null&&e.onNodeActivation&&(v.isFunction(e.onNodeActivation)||v.isAsyncFunction(e.onNodeActivation))&&await e.onNodeActivation(e)===!1)}async shouldPreventNavigationForPath(e){const{nodeObject:t}=await this.extractDataFromPath(e);return!!await this.shouldPreventNavigation(t)}async openViewInNewTab(e){if(await this.shouldPreventNavigationForPath(e))return;this.luigi.getConfigValue("routing.useHashRouting")&&(e="#"+e),window.open(e,"_blank","noopener,noreferrer")}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=e;return n.length&&n.forEach(r=>{r.isRootNode=!0}),n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}async handleNavigationRequest(e,t,n,r,s,a){var c;const o=e.replace(/\/\/+/g,"/"),l=!1;if(n)this.luigi.navigation().openAsModal(e,n,a);else{const f={detail:{preventContextUpdate:l,withoutSync:!!s}};if(await y.get(fe).closeModals(),r){await this.openViewInNewTab(e);return}if((c=this.luigi.getConfig().routing)!=null&&c.useHashRouting)if(!s)location.hash=o;else{const h=new CustomEvent("hashchange",f);window.history.pushState({path:"/#"+o},"","/#"+o),window.dispatchEvent(h)}else{const h=new CustomEvent("popstate",f);window.history.pushState({path:o},"",o),window.dispatchEvent(h)}}}async getChildren(e,t={}){const n=y.get(le);if(!e)return[];let r=[];if(n.hasChildren(e)){let a=n.getChildren(e);a&&(r=a.children)}else try{r=await we.getConfigValueFromObjectAsync(e,"children",t||e.context),r==null&&(r=[]),r=r.map(a=>this.getExpandStructuralPathSegment(a)).map(a=>this.bindChildToParent(a,e))||[]}catch(a){console.error("Could not lazy-load children for node",a)}let s=this.getAccessibleNodes(e,r,t);return n.setChildren(e,{children:r,filteredChildren:s}),s}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},r=(s,a)=>{const o=s.shift();let l={};return s.length?(l.pathSegment=o,a.hideFromNav&&(l.hideFromNav=a.hideFromNav),l.children=[r(s,a)]):(l=n,l.pathSegment=o),l};return r(t,e)}return e}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}}function ae(){}function Dt(i){return i()}function Et(){return Object.create(null)}function ze(i){i.forEach(Dt)}function xt(i){return typeof i=="function"}function kt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let We,ke;function vt(i,e){return i===e||(We||(We=document.createElement("a")),We.href=e,i===We.href)}function yi(i,e,t){const n=(function(r){if(!r)return document;const s=r.getRootNode?r.getRootNode():r.ownerDocument;return s&&s.host?s:r.ownerDocument})(i);if(!n.getElementById(e)){const r=Ae("style");r.id=e,r.textContent=t,(function(s,a){(function(o,l){o.appendChild(l)})(s.head||s,a),a.sheet})(n,r)}}function de(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function Ae(i){return document.createElement(i)}function Mt(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Ft(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Vt(i){Ft().$$.on_mount.push(i)}const _e=[],Me=[];let ye=[];const Ct=[],bi=Promise.resolve();let ot=!1;function lt(i){ye.push(i)}const st=new Set;let me=0;function w(){if(me!==0)return;const i=ke;do{try{for(;me<_e.length;){const e=_e[me];me++,Oe(e),Ri(e.$$)}}catch(e){throw _e.length=0,me=0,e}for(Oe(null),_e.length=0,me=0;Me.length;)Me.pop()();for(let e=0;e<ye.length;e+=1){const t=ye[e];st.has(t)||(st.add(t),t())}ye.length=0}while(_e.length);for(;Ct.length;)Ct.pop()();ot=!1,st.clear(),Oe(i)}function Ri(i){if(i.fragment!==null){i.update(),ze(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(lt)}}const Ai=new Set;function Pi(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],s=[];ye.forEach((a=>n.indexOf(a)===-1?r.push(a):s.push(a))),s.forEach((a=>a())),ye=r})(t.after_update),ze(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ii(i,e){i.$$.dirty[0]===-1&&(_e.push(i),ot||(ot=!0,bi.then(w)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Ht(i,e,t,n,r,s,a=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ae,not_equal:r,bound:Et(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Et(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};a&&a(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((d,S,..._)=>{const E=_.length?_[0]:S;return c.ctx&&r(c.ctx[d],c.ctx[d]=E)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](E),f&&Ii(i,d)),S})):[],c.update(),f=!0,ze(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const d=(function(S){return Array.from(S.childNodes)})(e.target);c.fragment&&c.fragment.l(d),d.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&(Ai.delete(h),h.i(u)),(function(d,S,_){const{fragment:E,after_update:R}=d.$$;E&&E.m(S,_),lt((()=>{const L=d.$$.on_mount.map(Dt).filter(xt);d.$$.on_destroy?d.$$.on_destroy.push(...L):ze(L),d.$$.on_mount=[]})),R.forEach(lt)})(i,e.target,e.anchor),w()}var h,u;Oe(l)}let Qt;function je(i,e,t,n){var s;const r=(s=t[i])==null?void 0:s.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function Wt(i,e,t,n,r,s){let a=class extends Qt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=je(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(a.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),s&&(a=s(a)),i.element=a,a}typeof HTMLElement=="function"&&(Qt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let o;return{c:function(){o=Ae("slot"),a!=="default"&&W(o,"name",a)},m:function(l,c){de(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(a){const o={};return a.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const a of this.$$s)a in r&&(n[a]=[t(a)]);for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=je(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||this[a]===void 0||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){const o=je(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const a in this.$$l)for(const o of this.$$l[a]){const l=this.$$c.$on(a,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=je(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Gt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Pi(this,1),this.$destroy=ae}$on(e,t){if(!xt(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var T;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(T||(T={}));class $i extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const p={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ht{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var s;const r=n||"custom";if((s=e==null?void 0:e.iframe)!=null&&s.contentWindow){const a=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},a.origin):e.iframe.contentWindow.postMessage({msg:r,...t},a.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,s){this.dispatch(e,t,n,s,r)}dispatch(e,t,n,r,s){const a=new $i(e,n,s,r);t.dispatchEvent(a)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,s,a,o,l,c,f,h;const t=this.getTargetContainer(e),n=(s=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:s.contentWindow;if(n&&n===e.source)switch(e.data.msg){case T.CUSTOM_MESSAGE:{const u=e.data.data,d=u.id;delete u.id,this.dispatch(p.CUSTOM_MESSAGE,t,{id:d,_metaData:{},data:u})}break;case T.GET_CONTEXT:n.postMessage({msg:T.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case T.NAVIGATION_REQUEST:this.dispatch(p.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:T.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case T.ALERT_REQUEST:this.dispatchWithPayload(p.ALERT_REQUEST,t,e,(o=(a=e.data)==null?void 0:a.data)==null?void 0:o.settings,(u=>{var d,S,_;t.notifyAlertClosed((_=(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.settings)==null?void 0:_.id,u)}));break;case T.INITIALIZED:this.dispatch(p.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case T.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(p.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.ADD_NODE_PARAMS_REQUEST:this.dispatch(p.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(p.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case T.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(p.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case T.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(p.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case T.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(p.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case T.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(p.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case T.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(p.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case T.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(p.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case T.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(p.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case T.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(d){console.warn(d)}this.dispatch(p.GO_BACK_REQUEST,t,u),this.dispatch(p.BACK_NAVIGATION_REQUEST,t,e)}break;case T.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(p.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,route:u}},e.origin)}));break;case T.NAVIGATION_COMPLETED_REPORT:this.dispatch(p.NAVIGATION_COMPLETED_REPORT,t,e);break;case T.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(p.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case T.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(p.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case T.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(p.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,pathExists:u}},e.origin)}));break;case T.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(p.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case T.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(p.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case T.ADD_BACKDROP_REQUEST:this.dispatch(p.ADD_BACKDROP_REQUEST,t,e);break;case T.REMOVE_BACKDROP_REQUEST:this.dispatch(p.REMOVE_BACKDROP_REQUEST,t,e);break;case T.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(p.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ht,Ee=new class{constructor(){this.updateContext=(i,e,t,n,r,s)=>{if(t){const a=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:s||{},internal:a,withoutSync:!0},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},T.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const s={...r};s.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),s.id=i,se.sendCustomMessageToIframe(n,s)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,T.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,T.ALERT_CLOSED)}},wt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Pe{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Li extends Pe{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=jt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Ni extends Pe{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let s="@media only screen ";r.minWidth!=null&&(s+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(s+=`and (max-width: ${r.maxWidth}px) `),s+=`{
6
+ Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegment&&a.pathSegment.startsWith(":"))return n=a,!0}),n}buildNavItems(e,t,n){const r={},s=[];return e==null||e.forEach(a=>{var o,l,c;if(M.isNodeAccessPermitted(a,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(a.category){const f=a.category.id||a.category.label||a.category,h=this.luigi.i18n().getTranslation(a.category.label||a.category.id||a.category);let u=r[f];u||(u={category:{altText:a.category.altText||"",icon:a.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(a.category,h)}},r[f]=u,s.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:a,selected:a===t,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,altText:a.altText,icon:a.icon})}else s.push({altText:a.altText,icon:a.icon,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,node:a,selected:a===t})}),s}async shouldRedirect(e,t){var r,s;const n=t??await this.getPathData(e);if(e=="")return(r=n.rootNodes[0])==null?void 0:r.pathSegment;if(n.selectedNode&&!n.selectedNode.viewUrl&&((s=n.selectedNode.children)!=null&&s.length))return e+"/"+n.selectedNode.children[0].pathSegment}async getCurrentNode(e){var r;const t=await this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}async getPathParams(e){return(await this.getPathData(e)).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(s=>{(!t||s.tabNav)&&(s.tabNav===!1&&(n=!0),s.keepSelectedForChildren===!1?t=!0:(s.keepSelectedForChildren||s.tabNav&&!n)&&(t=!0,r=[])),r.push(s)}),r.reverse()}applyNavGroups(e){const t={},n=[],s=[];return e.forEach(a=>{if(a.node)s.push(a);else if(a.category){const o=a.category.id;o&&o.indexOf("::")>0?n.push(a):(a.category.isGroup,t[o]=a,s.push(a))}}),n.forEach(a=>{var c;const o=((c=a.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(a))}),s.filter(a=>{var o,l,c,f,h,u;if((o=a.category)!=null&&o.isGroup&&((l=a.category)!=null&&l.nodes)&&((c=a.category)==null?void 0:c.nodes.length)>0){for(let d=0;d<((f=a.category)==null?void 0:f.nodes.length);d++){const S=(h=a.category)==null?void 0:h.nodes[d];if(S.node&&!S.node.hideFromNav&&S.node.label||(u=S.category)!=null&&u.nodes&&S.category.nodes.filter(_=>{var E,R;return!((E=_.node)!=null&&E.hideFromNav)&&((R=_.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}async getLeftNavData(e,t){var S,_;const n=t??await this.getPathData(e);let r=[];const s=[];let a="";(S=n.nodesInPath)==null||S.forEach(E=>{E.children&&(E.tabNav||(a+="/"+(E.pathSegment||"")),s.push(E))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop());let f,h=c;c?n.rootNodes.includes(c)?(f=c,h=void 0):c.tabNav?f=l:f=[...s].pop():(f=[...s].pop(),h=void 0);let u=await this.getChildren(f,(f==null?void 0:f.context)||{})||[];r=this.buildNavItems(u,h,n);const d=M.buildPath(s,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:a.replace(/\/\/+/g,"/"),sideNavFooterText:(_=this.luigi.getConfig().settings)==null?void 0:_.sideNavFooterText,navClick:E=>E.node&&this.navItemClick(E.node,d)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}async getTopNavData(e,t){var h,u,d,S,_,E,R,L,U,z,G,K,J,j,k,I,$,m,te,H,O,re,g,ue,b,D,pe;const n=this.luigi.getConfig(),r=t??await this.getPathData(e),s=(d=(u=(h=n.navigation)==null?void 0:h.profile)==null?void 0:u.items)!=null&&d.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],a=((S=n.navigation)==null?void 0:S.appSwitcher)&&this.getAppSwitcherData((_=n.navigation)==null?void 0:_.appSwitcher,(E=n.settings)==null?void 0:E.header),o=M.updateHeaderTitle(a,r);s!=null&&s.length&&s.map(P=>({...P,label:this.luigi.i18n().getTranslation(P.label||"")}));const l=this.luigi.i18n().getTranslation((U=(L=(R=n.navigation)==null?void 0:R.profile)==null?void 0:L.logout)==null?void 0:U.label)||rt.logout.label,c=P=>{var Ue,Qe;if(P.openNodeInModal&&!((Ue=P.externalLink)!=null&&Ue.url))this.luigi.navigation().openAsModal(P.link||"",P.openNodeInModal===!0?{}:P.openNodeInModal);else if(P.link)this.luigi.navigation().navigate(P.link);else if((Qe=P.externalLink)!=null&&Qe.url)if(P.externalLink.sameWindow)window.location.href=P.externalLink.url;else{const tt=window.open(P.externalLink.url,"_blank","noopener noreferrer");tt&&(tt.opener=null,tt.focus())}},f={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&he.isLoggedIn(),items:s,itemClick:c,logout:{altText:this.luigi.i18n().getTranslation((K=(G=(z=n.navigation)==null?void 0:z.profile)==null?void 0:G.logout)==null?void 0:K.altText)||rt.logout.label,label:l,icon:((k=(j=(J=n.navigation)==null?void 0:J.profile)==null?void 0:j.logout)==null?void 0:k.icon)||rt.logout.icon,testId:((m=($=(I=n.navigation)==null?void 0:I.profile)==null?void 0:$.logout)==null?void 0:m.testId)||M.prepareForTests(l),doLogout:()=>{Te.logout()}},onUserInfoUpdate:P=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(Ue=>{Ue?P(Ue):Te.getUserInfoStore().subscribe(Qe=>{P(Qe)})})}};return{appTitle:o||((H=(te=n.settings)==null?void 0:te.header)==null?void 0:H.title),logo:(re=(O=n.settings)==null?void 0:O.header)==null?void 0:re.logo,topNodes:this.buildNavItems(r.rootNodes,void 0,r),productSwitcher:(g=n.navigation)==null?void 0:g.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||(ue=n.navigation)!=null&&ue.profile?f:void 0,appSwitcher:((b=n.navigation)==null?void 0:b.appSwitcher)&&this.getAppSwitcherData((D=n.navigation)==null?void 0:D.appSwitcher,(pe=n.settings)==null?void 0:pe.header),navClick:P=>P.node&&this.navItemClick(P.node,"")}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var s;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const a={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((s=n.items)==null||s.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===a.link))return n;n.items.unshift(a)}return n}async getTabNavData(e,t){var f;const n=t??await this.getPathData(e),r=n==null?void 0:n.selectedNode;let s;if(!r)return{};if(!r.tabNav&&(s=this.getParentNode(r,n),s&&!s.tabNav))return{};let a="";(f=n.nodesInPath)==null||f.forEach(h=>{h.children&&(a+="/"+(h.pathSegment||""))});const o=s?this.getTruncatedChildren(s.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:a.replace(/\/\/+/g,"/"),navClick:h=>h.node&&this.navItemClick(h.node,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");v.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=await this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}async shouldPreventNavigation(e){return!!(e!=null&&e.onNodeActivation&&(v.isFunction(e.onNodeActivation)||v.isAsyncFunction(e.onNodeActivation))&&await e.onNodeActivation(e)===!1)}async shouldPreventNavigationForPath(e){const{nodeObject:t}=await this.extractDataFromPath(e);return!!await this.shouldPreventNavigation(t)}async openViewInNewTab(e){if(await this.shouldPreventNavigationForPath(e))return;this.luigi.getConfigValue("routing.useHashRouting")&&(e="#"+e),window.open(e,"_blank","noopener,noreferrer")}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=e;return n.length&&n.forEach(r=>{r.isRootNode=!0}),n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}async handleNavigationRequest(e,t,n,r,s,a){var c;const o=e.replace(/\/\/+/g,"/"),l=!1;if(n)this.luigi.navigation().openAsModal(e,n,a);else{const f={detail:{preventContextUpdate:l,withoutSync:!!s}};if(await y.get(fe).closeModals(),r){await this.openViewInNewTab(e);return}if((c=this.luigi.getConfig().routing)!=null&&c.useHashRouting)if(!s)location.hash=o;else{const h=new CustomEvent("hashchange",f);window.history.pushState({path:"/#"+o},"","/#"+o),window.dispatchEvent(h)}else{const h=new CustomEvent("popstate",f);window.history.pushState({path:o},"",o),window.dispatchEvent(h)}}}async getChildren(e,t={}){const n=y.get(le);if(!e)return[];let r=[];if(n.hasChildren(e)){let a=n.getChildren(e);a&&(r=a.children)}else try{r=await we.getConfigValueFromObjectAsync(e,"children",t||e.context),r==null&&(r=[]),r=r.map(a=>this.getExpandStructuralPathSegment(a)).map(a=>this.bindChildToParent(a,e))||[]}catch(a){console.error("Could not lazy-load children for node",a)}let s=this.getAccessibleNodes(e,r,t);return n.setChildren(e,{children:r,filteredChildren:s}),s}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},r=(s,a)=>{const o=s.shift();let l={};return s.length?(l.pathSegment=o,a.hideFromNav&&(l.hideFromNav=a.hideFromNav),l.children=[r(s,a)]):(l=n,l.pathSegment=o),l};return r(t,e)}return e}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}}function ae(){}function Dt(i){return i()}function Et(){return Object.create(null)}function ze(i){i.forEach(Dt)}function xt(i){return typeof i=="function"}function kt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let We,ke;function vt(i,e){return i===e||(We||(We=document.createElement("a")),We.href=e,i===We.href)}function yi(i,e,t){const n=(function(r){if(!r)return document;const s=r.getRootNode?r.getRootNode():r.ownerDocument;return s&&s.host?s:r.ownerDocument})(i);if(!n.getElementById(e)){const r=Ae("style");r.id=e,r.textContent=t,(function(s,a){(function(o,l){o.appendChild(l)})(s.head||s,a),a.sheet})(n,r)}}function de(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function Ae(i){return document.createElement(i)}function Mt(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Ft(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Vt(i){Ft().$$.on_mount.push(i)}const _e=[],Me=[];let ye=[];const Ct=[],bi=Promise.resolve();let ot=!1;function lt(i){ye.push(i)}const st=new Set;let me=0;function w(){if(me!==0)return;const i=ke;do{try{for(;me<_e.length;){const e=_e[me];me++,Oe(e),Ri(e.$$)}}catch(e){throw _e.length=0,me=0,e}for(Oe(null),_e.length=0,me=0;Me.length;)Me.pop()();for(let e=0;e<ye.length;e+=1){const t=ye[e];st.has(t)||(st.add(t),t())}ye.length=0}while(_e.length);for(;Ct.length;)Ct.pop()();ot=!1,st.clear(),Oe(i)}function Ri(i){if(i.fragment!==null){i.update(),ze(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(lt)}}const Ai=new Set;function Pi(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],s=[];ye.forEach((a=>n.indexOf(a)===-1?r.push(a):s.push(a))),s.forEach((a=>a())),ye=r})(t.after_update),ze(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ii(i,e){i.$$.dirty[0]===-1&&(_e.push(i),ot||(ot=!0,bi.then(w)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Ht(i,e,t,n,r,s,a=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ae,not_equal:r,bound:Et(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Et(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};a&&a(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((d,S,..._)=>{const E=_.length?_[0]:S;return c.ctx&&r(c.ctx[d],c.ctx[d]=E)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](E),f&&Ii(i,d)),S})):[],c.update(),f=!0,ze(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const d=(function(S){return Array.from(S.childNodes)})(e.target);c.fragment&&c.fragment.l(d),d.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&(Ai.delete(h),h.i(u)),(function(d,S,_){const{fragment:E,after_update:R}=d.$$;E&&E.m(S,_),lt((()=>{const L=d.$$.on_mount.map(Dt).filter(xt);d.$$.on_destroy?d.$$.on_destroy.push(...L):ze(L),d.$$.on_mount=[]})),R.forEach(lt)})(i,e.target,e.anchor),w()}var h,u;Oe(l)}let Qt;function je(i,e,t,n){var s;const r=(s=t[i])==null?void 0:s.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function Wt(i,e,t,n,r,s){let a=class extends Qt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=je(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(a.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),s&&(a=s(a)),i.element=a,a}typeof HTMLElement=="function"&&(Qt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let o;return{c:function(){o=Ae("slot"),a!=="default"&&W(o,"name",a)},m:function(l,c){de(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(a){const o={};return a.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const a of this.$$s)a in r&&(n[a]=[t(a)]);for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=je(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||this[a]===void 0||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){const o=je(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const a in this.$$l)for(const o of this.$$l[a]){const l=this.$$c.$on(a,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=je(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Gt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Pi(this,1),this.$destroy=ae}$on(e,t){if(!xt(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var T;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(T||(T={}));class $i extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const p={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ht{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var s;const r=n||"custom";if((s=e==null?void 0:e.iframe)!=null&&s.contentWindow){const a=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},a.origin):e.iframe.contentWindow.postMessage({msg:r,...t},a.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,s){this.dispatch(e,t,n,s,r)}dispatch(e,t,n,r,s){const a=new $i(e,n,s,r);t.dispatchEvent(a)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,s,a,o,l,c,f,h;const t=this.getTargetContainer(e),n=(s=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:s.contentWindow;if(n&&n===e.source)switch(e.data.msg){case T.CUSTOM_MESSAGE:{const u=e.data.data,d=u.id;delete u.id,this.dispatch(p.CUSTOM_MESSAGE,t,{id:d,_metaData:{},data:u})}break;case T.GET_CONTEXT:n.postMessage({msg:T.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case T.NAVIGATION_REQUEST:this.dispatch(p.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:T.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case T.ALERT_REQUEST:this.dispatchWithPayload(p.ALERT_REQUEST,t,e,(o=(a=e.data)==null?void 0:a.data)==null?void 0:o.settings,(u=>{var d,S,_;t.notifyAlertClosed((_=(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.settings)==null?void 0:_.id,u)}));break;case T.INITIALIZED:this.dispatch(p.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case T.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(p.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.ADD_NODE_PARAMS_REQUEST:this.dispatch(p.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(p.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case T.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(p.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case T.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(p.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case T.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(p.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case T.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(p.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case T.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(p.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case T.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(p.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case T.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(p.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case T.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(d){console.warn(d)}this.dispatch(p.GO_BACK_REQUEST,t,u),this.dispatch(p.BACK_NAVIGATION_REQUEST,t,e)}break;case T.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(p.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,route:u}},e.origin)}));break;case T.NAVIGATION_COMPLETED_REPORT:this.dispatch(p.NAVIGATION_COMPLETED_REPORT,t,e);break;case T.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(p.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case T.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(p.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case T.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(p.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var d,S;n.postMessage({msg:T.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(S=(d=e.data)==null?void 0:d.data)==null?void 0:S.id,pathExists:u}},e.origin)}));break;case T.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(p.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case T.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(p.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case T.ADD_BACKDROP_REQUEST:this.dispatch(p.ADD_BACKDROP_REQUEST,t,e);break;case T.REMOVE_BACKDROP_REQUEST:this.dispatch(p.REMOVE_BACKDROP_REQUEST,t,e);break;case T.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(p.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ht,Ee=new class{constructor(){this.updateContext=(i,e,t,n,r,s)=>{if(t){const a=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:s||{},internal:a,withoutSync:!0},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},T.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const s={...r};s.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),s.id=i,se.sendCustomMessageToIframe(n,s)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,T.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,T.ALERT_CLOSED)}},wt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Pe{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Li extends Pe{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=jt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Ni extends Pe{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let s="@media only screen ";r.minWidth!=null&&(s+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(s+=`and (max-width: ${r.maxWidth}px) `),s+=`{
7
7
  .${e} {
8
8
  grid-template-columns: ${r.columns||"auto"};
9
9
  grid-template-rows: ${r.rows||"auto"};