@luzmo/embed 5.0.7 → 5.0.9

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.
@@ -1,10 +1,2094 @@
1
- var Dt=Object.defineProperty;var Pt=Object.getOwnPropertyDescriptor;var m=(t,e,r,i)=>{for(var s=i>1?void 0:i?Pt(e,r):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(s=(i?a(e,r,s):a(s))||s);return i&&s&&Dt(e,r,s),s};var P=(t,e)=>{let r="The dashboard component encountered an error";typeof e?.dashboardId=="string"&&(r+=` for dashboard with id ${e.dashboardId}`),typeof e?.dashboardSlug=="string"&&(r+=` for dashboard with slug ${e.dashboardSlug}`),typeof e?.container=="string"&&(r+=` in container ${e.container}`),t&&(r+=`:
2
- ${t}`,console.error(r))};var Te=t=>{let e=!1,r="",s=(document.body||document.documentElement).style,o={svg:!!("createElementNS"in document&&document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),flexbox:s.webkitFlexWrap===""||s.flexWrap==="",postMessage:!!window.postMessage},a=["svg","flexbox","postMessage"];for(let h of a)o[h]||(e=!0,t.browserNotSupported=t.browserNotSupported||[],t.browserNotSupported.push(h),r+=`Your browser does not support: ${h}
3
- `);let n=window.navigator.userAgent,d=n.includes("MSIE"),l=n.includes("Trident/");(d||l)&&(e=!0,r="IE is not supported."),e&&P(r)};var w={appServer:"https://app.luzmo.com/",apiHost:"https://api.luzmo.com/",dashboardId:null,dashboardSlug:null,container:null,key:null,token:null,language:"auto",qeVersion:null,editMode:null,screenMode:null,switchScreenModeOnResize:!0,itemId:null,mainColor:"",accentColor:"",itemDimensions:{width:"auto",height:"auto"},loaderBackground:"#f9f9f9",loaderFontColor:"#5a5a5a",loaderSpinnerColor:"rgba(255, 165, 0, 0.7)",loaderSpinnerBackground:"rgba(169, 169, 169, 0.14)",timezoneId:null,contextId:null};var Z=[{mode:"mobile",width:[150,767]},{mode:"tablet",width:[768,1199]},{mode:"desktop",width:[1200,1599]},{mode:"largeScreen",width:[1600,9999]},{mode:"fixed",width:[]}];var Tt={initializing:{en:"Initializing...",nl:"Laden...",fr:"Chargement..."},errorDashboard:{en:"Oops, we could not load this dashboard!",nl:"Oeps, we konden het dashboard niet laden.",fr:"Le chargement a echou\xE9."},errorItem:{en:"Oops, we could not load this item!",nl:"Oeps, we konden de grafiek niet laden.",fr:"Le chargement a echou\xE9."}},ne=Tt;var z=t=>t?t.endsWith("/")?t:`${t}/`:"",T=t=>t?t.endsWith("/")?t.slice(0,-1):t:"",ke=(t,e,r,i)=>{let s=(n,d)=>{let l=n.users.find(f=>f.id===d.id),h=l&&l.userAccessRight?{flagRead:l.userAccessRight.flagRead,flagUse:l.userAccessRight.flagUse,flagModify:l.userAccessRight.flagModify,flagOwn:l.userAccessRight.flagOwn}:{flagRead:!1,flagUse:!1,flagModify:!1,flagOwn:!1},S=n.groups.filter(f=>d.userGroups.includes(f.id)||f.public===!0).map(f=>{if(f.groupAccessRight)return f.groupAccessRight});for(let f of S)!h.flagRead&&f.flagRead&&(h.flagRead=f.flagRead),!h.flagUse&&f.flagUse&&(h.flagUse=f.flagUse),!h.flagModify&&f.flagModify&&(h.flagModify=f.flagModify),!h.flagOwn&&f.flagOwn&&(h.flagOwn=f.flagOwn);let g=n.integrations?.length>0?n.integrations.map(f=>{if(f.integrationAccessRight)return f.integrationAccessRight}):[];for(let f of g)!h.flagRead&&f.flagRead&&(h.flagRead=f.flagRead),!h.flagUse&&f.flagUse&&(h.flagUse=f.flagUse),!h.flagModify&&f.flagModify&&(h.flagModify=f.flagModify);return h},o=(n,d)=>{if(n==null)return"";if(typeof n!="object"||Object.keys(n).length===0)return typeof n=="object"&&Object.keys(n).length===0?"":n;let l;return l=d&&n[d]?n[d]:n[Object.keys(n)[0]],l==null&&(l=""),l},a=[];for(let n of t){let d={accessibleBy:[],accessRights:s(n,r),id:n.id,modifiedAt:n.modified_at,name:o(n.name,i.language),slug:null,tags:n.tags.map(g=>g.tag).sort((g,f)=>g.localeCompare(f))},l=n.integrations.find(g=>g.id===e);l?.integrationAccessRight?.slug&&(d.slug=l.integrationAccessRight.slug);let h=n.users.map(g=>({model:"User",id:g.id,name:o(g.name,r.locale_id)})),p=n.groups.map(g=>({model:"Group",id:g.id,name:o(g.name,r.locale_id)||{}})),S=n.integrations.map(g=>({model:"Integration",id:g.id,name:o(g.name,r.locale_id)||{}}));d.accessibleBy=[...h,...p,...S],a.push(d)}return a},Oe="0.0.0-shared-luzmo",He=t=>{let e=/^(%20|\s)*(javascript|data)/im,r=/[^\u0020-\u007E]/gim,i=/^([^:]+):/gm,s=new Set([".","/"]),o=l=>s.has(l[0]);if(!t)return"about:blank";let a=t.replaceAll(r,"").trim();if(o(a))return a;let n=a.match(i);if(!n)return a;let d=n[0];return e.test(d)?"about:blank":a},de=t=>JSON.parse(JSON.stringify(t)),kt=t=>t&&typeof t=="object",Q=(t,e)=>(Object.entries(e).forEach(([r,i])=>{r in t?t[r]===void 0?t[r]=i:t[r]=kt(i)?Q(t[r],i):t[r]:t[r]=i}),t);var y=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)});var le=t=>{let e=[],{appServer:r,language:i,qeVersion:s,loaderBackground:o,loaderSpinnerColor:a,loaderSpinnerBackground:n,loaderFontColor:d,screenMode:l,key:h,token:p,timezoneId:S,itemEmbedding:g,itemDimensions:f,dashboardId:Ie,dashboardSlug:Ae,itemId:Rt,mainColor:Re,accentColor:Le,editMode:De}=t.params;i&&i!=="auto"&&e.push("language="+i),s&&e.push(`qe_version=${s}`),o&&e.push(`ldrbg=${o}`),d&&e.push(`ldrftclr=${d}`),a&&e.push(`ldrspclr=${a}`),n&&e.push(`ldrspbg=${n}`),Re&&e.push(`mainColor=${Re}`),Le&&e.push(`accentColor=${Le}`),l&&l!=="auto"&&e.push("screenMode="+l),S&&e.push("timezoneId="+S),g&&f&&f.width&&e.push("width="+f.width),g&&f&&f.height&&e.push("height="+f.height),De&&e.push("editMode="+De);let Pe=h&&p?"#"+h+":"+p:"";e.push("version="+(t.VERSION||Oe));let Lt=g?`${r}i/${Ie||Ae}/${Rt}?${encodeURIComponent(e.join("&"))}${Pe}`:`${r}i/${Ie||Ae}?${encodeURIComponent(e.join("&"))}${Pe}`;return He(Lt)};var he=t=>{let e;(t.params.error||t.browserNotSupported.length>0)&&(t.params.error=!0,t.browserNotSupported&&(e="Browser is not supported."));let r=ne.initializing[t.params.language]||ne.initializing.en;return t.browserNotSupported||t.params.error?{loadingMsg:r,errorMsg:e}:{loadingMsg:r,errorMsg:""}};function v(t,e,r){t.promises[e]&&(t.promises[e].resolve(r),delete t.promises[e])}function F(t,e,r){t.promises[e]&&(t.promises[e].reject(r),delete t.promises[e])}function ee(t){let e={};return t.params.loaderBackground&&!t.iframeLoaded&&(e.background=t.params.loaderBackground),e}function Fe(t){let e=t.params.itemDimensions?.height||w.itemDimensions.height,r=t.params.itemEmbedding&&e!=="auto";return{display:t.iframeLoaded?"none":"",height:`${r?e:t.minHeight}px`}}function Ne(t){let e=t.params.loaderBackground||w.loaderBackground;if(t.params.itemEmbedding){t.loaderSize=24,t.borderWidth=4,t.minHeight=200;let r=t.params.itemDimensions?.width||w.itemDimensions.width,i=t.params.itemDimensions?.height||w.itemDimensions.height,s=r!=="auto",o=i!=="auto";return{background:e,width:s?`${r}px`:"100%",height:`${o?i:"200"}px`,"min-height":o?"":"200px"}}return{background:e}}function Ue(t){let{loaderSpinnerColor:e,loaderSpinnerBackground:r}=w,i=ze(t.borderWidth,t.params.loaderSpinnerColor||e),s=ze(t.borderWidth,t.params.loaderSpinnerBackground||r),o=`${t.loaderSize}px`;return{"border-top":i,"border-right":i,"border-bottom":s,"border-left":s,width:o,height:o}}function je(t){let e=t.params.itemDimensions?.height||w.itemDimensions.height,r=t.params.itemEmbedding&&e!=="auto",i=o=>`${(o-t.loaderSize-32)/2}px`;return{padding:`${t.params.itemId?i(r?Number.parseInt(`${e}`,10):t.minHeight):"128px"} 16px`}}function ce(t){let e=t.params.itemDimensions?.height||w.itemDimensions.height,r=t.params.itemDimensions?.width||w.itemDimensions.width;t.params.itemEmbedding&&e!=="auto"?t.iframeHeight=`${e}px`:t.params.itemEmbedding?t.iframeHeight="200px":["editFull","editLimited"].includes(t.params.editMode)?t.iframeHeight="100%":t.iframeHeight="400px",t.iframeWidth=t.params.itemEmbedding&&r!=="auto"?`${r}px`:"100%";let i={height:t.iframeHeight,width:t.iframeWidth};return t.iframeLoaded?i.opacity=1:t.error?(i.opacity=1,i.width="100%",i.height="400px"):i.opacity=0,i}function ze(t,e){return`${t}px solid ${e}`}var Ve=(t,e)=>{t?.contentWindow&&t.contentWindow.location.replace(e)};var me=(t,e,r)=>{let i=y();return e?.contentWindow?(e.contentWindow.postMessage({action:"exportDashboard",format:r||"png",_version:t.VERSION,requestId:i},"*"),new Promise((s,o)=>{t.promises[i]={resolve:s,reject:o},setTimeout(()=>{if(t.promises[i]){let a="exportDashboard request timed out.";t.promises[i].reject(new Error(a)),delete t.promises[i]}},12e5)})):Promise.reject(new Error("Cannot retrieve contentWindow."))};var We=(t,e)=>{if((t.dashboardId||t.dashboardSlug)&&e?.contentWindow){let i=y();return e.contentWindow.postMessage({action:"getAccessibleDashboards",_version:t.VERSION,requestId:i},"*"),new Promise((s,o)=>{t.promises[i]={resolve:s,reject:o},setTimeout(()=>{if(t.promises[i]){let a="getAccessibleDashboards request timed out.";t.promises[i].reject(new Error(a)),delete t.promises[i]}},2e3)})}let r=new Promise((i,s)=>{(()=>{try{window.fetch(`${String(t.params.apiHost)}0.1.0/authorization`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},redirect:"follow",body:JSON.stringify({action:"get",version:"0.1.0",key:t.authKey,token:t.authToken,find:{where:{id:t.authKey},attributes:["id","integration_id"],include:[{model:"User",attributes:["id","name","locale_id"],include:[{model:"Group"}]}]}})}).then(a=>a.json()).then(a=>{!a||!a.rows||a.rows.length===0||!a.rows[0].user||!a.rows[0].integration_id?s():(a.rows[0].user.userGroups=a.rows[0].user.groups.map(n=>n.id),delete a.rows[0].user.groups,i({integrationId:a.rows[0].integration_id,user:a.rows[0].user}))})}catch(o){s(o)}})()});return new Promise((i,s)=>void(()=>{try{r.then(o=>{window.fetch(`${String(t.params.apiHost)}0.1.0/securable`,{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},redirect:"follow",body:JSON.stringify({action:"get",version:"0.1.0",key:t.authKey,token:t.authToken,find:{where:{type:"dashboard",is_variant:!1},attributes:["id","name","modified_at"],order:[["modified_at","desc"]],include:[{model:"Tag",attributes:["tag"]},{model:"User",attributes:["id","name"]},{model:"Group",attributes:["id","name","public"]},{model:"Integration",attributes:["id","name"]}]}})}).then(n=>n.json()).then(n=>{let d=n.rows.length>0?ke(n.rows,o.integrationId,o.user,t):[];i(d)})}).catch(o=>{s(o)})}catch(o){s(o)}})())};var Be=(t,e,r)=>{if(e?.contentWindow){let i=y();return e.contentWindow.postMessage({action:"getData",id:r,_version:t.VERSION,requestId:i},"*"),new Promise((s,o)=>{t.promises[i]={resolve:s,reject:o},setTimeout(()=>{if(t.promises[i]){let a="getData request timed out.";t.promises[i].reject(new Error(a)),delete t.promises[i]}},2e3)})}return Promise.reject(new Error("Cannot retrieve contentWindow."))};var Ce=(t,e)=>{if(e?.contentWindow){let r=y();return e.contentWindow.postMessage({action:"getFilters",_version:t.VERSION,requestId:r},"*"),new Promise((i,s)=>{t.promises[r]={resolve:i,reject:s},setTimeout(()=>{if(t.promises[r]){let o="getFilters request timed out.";t.promises[r].reject(new Error(o)),delete t.promises[r]}},2e3)})}return Promise.reject(new Error("Cannot retrieve contentWindow."))};var ue=(t,e,r)=>e?(e.contentWindow.postMessage({action:"refreshData",id:r??null,_version:t.VERSION},"*"),Promise.resolve()):Promise.reject(new Error("Cannot retrieve contentWindow."));var qe=(t,e)=>e?(e.contentWindow.postMessage({action:"reloadDashboard",_version:t.VERSION},"*"),Promise.resolve()):Promise.reject(new Error("Cannot retrieve contentWindow."));var Ke=(t,e,r,i)=>e?(e.contentWindow.postMessage({action:"setAuthorization",key:r,token:i,_version:t.VERSION},"*"),Promise.resolve()):Promise.reject(new Error("Cannot retrieve contentWindow."));var Ge=(t,e,r)=>{if(e&&e.contentWindow){let i=y();return t.params.editMode===r?Promise.reject(new Error("editMode parameter is currently already set to "+r)):r!=="editFull"&&r!=="editLimited"&&r!=="view"?Promise.reject(new Error("The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'.")):(e.contentWindow.postMessage({action:"setEditMode",editMode:r,_version:t.VERSION,requestId:i},"*"),new Promise((s,o)=>{t.promises[i]={resolve:s,reject:o}}))}return Promise.reject(new Error("Cannot retrieve contentWindow."))};var Je=(t,e,r,i)=>{if(e){let s=y();return e.contentWindow.postMessage({action:"setFilters",itemId:r,filters:i,_version:t.VERSION,requestId:s},"*"),new Promise((o,a)=>{t.promises[s]={resolve:o,reject:a},setTimeout(()=>{if(t.promises[s]){let n="setFilters request timed out.";t.promises[s].reject(new Error(n)),delete t.promises[s]}},2e3)})}return Promise.reject()};var Xe=(t,e,r)=>{if(e){let i=y();return e.contentWindow.postMessage({action:"setPreview",preview:r,requestId:i,_version:t.VERSION},"*"),new Promise((s,o)=>{t.promises[i]={resolve:s,reject:o},setTimeout(()=>{if(t.promises[i]){let a="setPreview request timed out.";t.promises[i].reject(new Error(a)),delete t.promises[i]}},2e3)})}return Promise.reject(new Error("Cannot retrieve contentWindow."))};var N=t=>{if(!t.dimensions){t.params.error=!0,P("Got no valid dimensions.",t.params);return}let e=Object.keys(t.dimensions),r=[],i,s=0,o=0;if(!t.params.switchScreenModeOnResize&&t.currentScreenMode&&(t.params.screenMode=t.currentScreenMode),t.dimensions&&e?.[0]==="fixed")i="fixed",s=t.dimensions.fixed[0],o=t.dimensions.fixed[1];else{let d=["mobile","tablet","desktop","largeScreen"];if(t.params.itemEmbedding){let[l]=e,h=de(l);for(let p of d){let S=e.find(g=>g===p);S?h=de(S):t.dimensions[p]=t.dimensions[h]}}for(let l of e)if(d.includes(l)){let h=Z.find(p=>p.mode===l);r.push({...h,height:t.dimensions[l][1]||50})}if(r.map(l=>l.mode).includes(t.params.screenMode)||(t.params.screenMode="auto"),t.params.screenMode==="auto"){r.sort((l,h)=>d.indexOf(l.mode)-d.indexOf(h.mode));for(let l of r){let[h,p]=l.width;t.params.itemEmbedding&&t.params.itemDimensions&&t.params.itemDimensions.width!=="auto"&&t.params.itemDimensions.height==="auto"?h<t.params.itemDimensions.width&&(i=l.mode,s=Number.parseInt(t.params.itemDimensions.width,10),o=t.dimensions[i][1]):h<t.containerWidth&&(i=l.mode,t.params.itemEmbedding?(s=t.params.itemDimensions?.width&&t.params.itemDimensions?.width!=="auto"?Number.parseInt(t.params.itemDimensions.width,10):Math.min(t.containerWidth,p),o=t.params.itemDimensions?.height&&t.params.itemDimensions?.height!=="auto"?Number.parseInt(t.params.itemDimensions.height,10):t.dimensions[i][1],t.params.itemDimensions&&t.params.itemDimensions.width!=="auto"&&t.params.itemDimensions.height==="auto"&&(s=Number.parseInt(t.params.itemDimensions.width,10),o=t.dimensions[i][1])):(s=Math.max(Math.min(p,t.containerWidth),h),o=l.height))}}else{let{height:l,width:[h,p]}=r.find(S=>S.mode===t.params.screenMode);i=t.params.screenMode,s=Math.max(Math.min(p,t.containerWidth),h),o=l,t.params.itemEmbedding&&(t.params.itemDimensions?.width&&t.params.itemDimensions?.width!=="auto"&&(s=Number.parseInt(t.params.itemDimensions.width,10)),t.params.itemDimensions?.height&&t.params.itemDimensions?.height!=="auto"&&(o=Number.parseInt(t.params.itemDimensions.height,10)))}if(!i&&r.length>0){let[l]=r;i=l.mode,s=l.width[0],o=l.height}}t.currentScreenMode=i;let a={height:o===0?"100%":`${String(o)}px`,width:s===0?"100%":`${String(s)}px`,opacity:1};["editFull","editLimited"].includes(t.params.editMode)?(a.height="100%",a.width="100%"):t.params.itemEmbedding&&t.params.itemDimensions?(a.height=t.params.itemDimensions.height==="auto"?a.height:`${String(t.params.itemDimensions.height).replace("px","")}px`,a.width=t.params.itemDimensions.width==="auto"?a.width:`${String(t.params.itemDimensions.width).replace("px","")}px`):(a.height=o===0?"100%":`${String(o)}px`,a.width=s===0?"100%":`${String(s)}px`),t.currentScreenMode=i,t.iframeStyle=a};var pe=t=>{let e=Object.keys(w),r=[],i=["appServer","language","apiHost"],s=["key","token","screenMode","timezoneId","itemId","container","loaderBackground","loaderFontColor","loaderSpinnerColor","loaderSpinnerBackground"],o=["itemDimensions"],a=["mobile","tablet","desktop","largeScreen","fixed","auto"];for(let n of e)t.params[n]===null&&delete t.params[n];t.params=Q(t.params,w),(!t.params.dashboardId||typeof t.params.dashboardId!="string")&&(!t.params.dashboardSlug||typeof t.params.dashboardSlug!="string")&&(delete t.params.dashboardId,delete t.params.dashboardSlug);for(let n of i)typeof t.params[n]!="string"&&(delete t.params[n],r.push(`${n} needs to be of type string.`));for(let n of s)typeof t.params[n]!="string"&&t.params[n]!==null&&t.params[n]!==void 0&&(delete t.params[n],r.push(`${n} needs to be of type string or empty.`));if(t.params.screenMode&&!a.includes(t.params.screenMode)){let n=a.map(d=>`"${d}"`).join(", ");r.push(`"screenMode" needs should be one of these types: ${n}`),t.params.screenMode="auto"}t.params.itemId&&(t.params.itemEmbedding=!0);for(let n of o)typeof t.params[n]!="object"&&t.params[n]!==null&&(delete t.params[n],r.push(`${n} needs to be of type object or empty.`));if(typeof t.params.switchScreenModeOnResize!="boolean"&&(r.push("switchScreenModeOnResize needs to be of type boolean."),t.params.switchScreenModeOnResize=!0),t.params.itemDimensions){let n=["width","height"];for(let d of n)!["string","number"].includes(typeof t.params.itemDimensions[d])&&t.params.itemDimensions[d]!==null&&r.push(`itemDimensions ${d} needs to be of type string, number or empty.`)}t.params=Q(t.params,w),t.params.screenMode&&t.params.screenMode!=="auto"&&(t.params.switchScreenModeOnResize=!1),t.params.itemDimensions.width!=="auto"&&(t.params.itemDimensions.width=Number.parseInt(`${t.params.itemDimensions.width}`.replace("px",""),10)||"auto"),t.params.itemDimensions.height!=="auto"&&(t.params.itemDimensions.height=Number.parseInt(`${t.params.itemDimensions.height}`.replace("px",""),10)||"auto"),t.params.itemEmbedding=!!t.params.itemId,(t.params.error||r.length>0)&&P(r.join(`
4
- `),t.params)};var k={},Ot=async(t,e)=>{let r=typeof t=="function"?await t():t,i=document.createElement("script");i.type="text/javascript",i.addEventListener("load",e),i.src=r,document.querySelectorAll("head")[0].append(i)},Ye=t=>({});async function Ht(t){let e=k[t];if(e.inited)return e.lib;if(e.format==="var")return new Promise(r=>{let i=()=>{e.inited||(e.lib=window[t],e.lib.init(Ye(e.from)),e.inited=!0),r(e.lib)};return Ot(e.url,i)});if(["esm","systemjs"].includes(e.format))return new Promise((r,i)=>{(typeof e.url=="function"?e.url:()=>Promise.resolve(e.url))().then(o=>{import(o).then(a=>{if(!e.inited){let n=Ye(e.from);a.init(n),e.lib=a,e.lib.init(n),e.inited=!0}r(e.lib)}).catch(i)})})}function Ze(t,e){if(!t?.default&&e){let r=Object.create(null);return r.default=t,r.__esModule=!0,r}return t}async function Qe(t,e){return Ht(t).then(r=>r.get(e).then(i=>i()))}var tt=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBraileLabel="",this.ariaBraileRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var rt=new WeakMap,U=t=>{let e=rt.get(t);return e===void 0&&rt.set(t,e=new Map),e},zt=class{constructor(){this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(U(this)).map(([e,r])=>({name:e,value:r}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}setAttribute(e,r){U(this).set(e,String(r))}removeAttribute(e){U(this).delete(e)}toggleAttribute(e,r){if(this.hasAttribute(e)){if(r===void 0||!r)return this.removeAttribute(e),!1}else return r===void 0||r?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return U(this).has(e)}attachShadow(e){let r={host:this};return this.__shadowRootMode=e.mode,e&&e.mode==="open"&&(this.__shadowRoot=r),r}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new tt(this);return this.__internals=e,e}getAttribute(e){return U(this).get(e)??null}};var Ft=class extends zt{},it=Ft;var Nt=class{constructor(){this.__definitions=new Map}define(e,r){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
5
- Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);this.__definitions.set(e,{ctor:r,observedAttributes:r.observedAttributes??[]})}get(e){return this.__definitions.get(e)?.ctor}},Ut=Nt;var st=new Ut;var j=globalThis,te=j.ShadowRoot&&(j.ShadyCSS===void 0||j.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,fe=Symbol(),ot=new WeakMap,V=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==fe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(te&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=ot.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ot.set(r,e))}return e}toString(){return this.cssText}},at=t=>new V(typeof t=="string"?t:t+"",void 0,fe),ge=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,s,o)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new V(r,t,fe)},Se=(t,e)=>{if(te)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),s=j.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=r.cssText,t.appendChild(i)}},re=te||j.CSSStyleSheet===void 0?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return at(r)})(t):t;var{is:jt,defineProperty:Vt,getOwnPropertyDescriptor:Wt,getOwnPropertyNames:Bt,getOwnPropertySymbols:Ct,getPrototypeOf:qt}=Object,C=globalThis;C.customElements??=st;var nt=C.trustedTypes,Kt=nt?nt.emptyScript:"",Gt=C.reactiveElementPolyfillSupport,W=(t,e)=>t,B={toAttribute(t,e){switch(e){case Boolean:t=t?Kt:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},ie=(t,e)=>!jt(t,e),dt={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:ie};Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;var x=class extends(globalThis.HTMLElement??it){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=dt){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(e,i,r);s!==void 0&&Vt(this.prototype,e,s)}}static getPropertyDescriptor(e,r,i){let{get:s,set:o}=Wt(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get(){return s?.call(this)},set(a){let n=s?.call(this);o.call(this,a),this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??dt}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;let e=qt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){let r=this.properties,i=[...Bt(r),...Ct(r)];for(let s of i)this.createProperty(s,r[s])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,s]of r)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let s=this._$Eu(r,i);s!==void 0&&this._$Eh.set(s,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let s of i)r.unshift(re(s))}else e!==void 0&&r.push(re(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Se(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EC(e,r){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:B).toAttribute(r,i.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,r){let i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let o=i.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:B;this._$Em=s,this[s]=a.fromAttribute(r,o.type),this._$Em=null}}requestUpdate(e,r,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??ie)(this[e],r))return;this.P(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,i){this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[s,o]of i)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(r=>this._$EC(r,this[r])),this._$EU()}updated(e){}firstUpdated(e){}};x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[W("elementProperties")]=new Map,x[W("finalized")]=new Map,Gt?.({ReactiveElement:x}),(C.reactiveElementVersions??=[]).push("2.0.4");var oe=globalThis,se=oe.trustedTypes,lt=se?se.createPolicy("lit-html",{createHTML:t=>t}):void 0,ft="$lit$",M=`lit$${(Math.random()+"").slice(9)}$`,gt="?"+M,Jt=`<${gt}>`,L=oe.document===void 0?{createTreeWalker:()=>({})}:document,K=()=>L.createComment(""),G=t=>t===null||typeof t!="object"&&typeof t!="function",St=Array.isArray,Xt=t=>St(t)||typeof t?.[Symbol.iterator]=="function",be=`[
6
- \f\r]`,q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ht=/-->/g,ct=/>/g,A=RegExp(`>|${be}(?:([^\\s"'>=/]+)(${be}*=${be}*(?:[^
7
- \f\r"'\`<>=]|("|')|))|$)`,"g"),mt=/'/g,ut=/"/g,bt=/^(?:script|style|textarea|title)$/i,yt=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),_=yt(1),os=yt(2),E=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),pt=new WeakMap,R=L.createTreeWalker(L,129);function wt(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return lt!==void 0?lt.createHTML(e):e}var Yt=(t,e)=>{let r=t.length-1,i=[],s,o=e===2?"<svg>":"",a=q;for(let n=0;n<r;n++){let d=t[n],l,h,p=-1,S=0;for(;S<d.length&&(a.lastIndex=S,h=a.exec(d),h!==null);)S=a.lastIndex,a===q?h[1]==="!--"?a=ht:h[1]!==void 0?a=ct:h[2]!==void 0?(bt.test(h[2])&&(s=RegExp("</"+h[2],"g")),a=A):h[3]!==void 0&&(a=A):a===A?h[0]===">"?(a=s??q,p=-1):h[1]===void 0?p=-2:(p=a.lastIndex-h[2].length,l=h[1],a=h[3]===void 0?A:h[3]==='"'?ut:mt):a===ut||a===mt?a=A:a===ht||a===ct?a=q:(a=A,s=void 0);let g=a===A&&t[n+1].startsWith("/>")?" ":"";o+=a===q?d+Jt:p>=0?(i.push(l),d.slice(0,p)+ft+d.slice(p)+M+g):d+M+(p===-2?n:g)}return[wt(t,o+(t[r]||"<?>")+(e===2?"</svg>":"")),i]},J=class t{constructor({strings:e,_$litType$:r},i){let s;this.parts=[];let o=0,a=0,n=e.length-1,d=this.parts,[l,h]=Yt(e,r);if(this.el=t.createElement(l,i),R.currentNode=this.el.content,r===2){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=R.nextNode())!==null&&d.length<n;){if(s.nodeType===1){if(s.hasAttributes())for(let p of s.getAttributeNames())if(p.endsWith(ft)){let S=h[a++],g=s.getAttribute(p).split(M),f=/([.?@])?(.*)/.exec(S);d.push({type:1,index:o,name:f[2],strings:g,ctor:f[1]==="."?we:f[1]==="?"?_e:f[1]==="@"?xe:H}),s.removeAttribute(p)}else p.startsWith(M)&&(d.push({type:6,index:o}),s.removeAttribute(p));if(bt.test(s.tagName)){let p=s.textContent.split(M),S=p.length-1;if(S>0){s.textContent=se?se.emptyScript:"";for(let g=0;g<S;g++)s.append(p[g],K()),R.nextNode(),d.push({type:2,index:++o});s.append(p[S],K())}}}else if(s.nodeType===8)if(s.data===gt)d.push({type:2,index:o});else{let p=-1;for(;(p=s.data.indexOf(M,p+1))!==-1;)d.push({type:7,index:o}),p+=M.length-1}o++}}static createElement(e,r){let i=L.createElement("template");return i.innerHTML=e,i}};function O(t,e,r=t,i){if(e===E)return e;let s=i!==void 0?r._$Co?.[i]:r._$Cl,o=G(e)?void 0:e._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(t),s._$AT(t,r,i)),i!==void 0?(r._$Co??=[])[i]=s:r._$Cl=s),s!==void 0&&(e=O(t,s._$AS(t,e.values),s,i)),e}var ye=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:i}=this._$AD,s=(e?.creationScope??L).importNode(r,!0);R.currentNode=s;let o=R.nextNode(),a=0,n=0,d=i[0];for(;d!==void 0;){if(a===d.index){let l;d.type===2?l=new X(o,o.nextSibling,this,e):d.type===1?l=new d.ctor(o,d.name,d.strings,this,e):d.type===6&&(l=new Ee(o,this,e)),this._$AV.push(l),d=i[++n]}a!==d?.index&&(o=R.nextNode(),a++)}return R.currentNode=L,s}p(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},X=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,s){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=O(this,e,r),G(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==E&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Xt(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==b&&G(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=J.createElement(wt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(r);else{let o=new ye(s,this),a=o.u(this.options);o.p(r),this.T(a),this._$AH=o}}_$AC(e){let r=pt.get(e.strings);return r===void 0&&pt.set(e.strings,r=new J(e)),r}k(e){St(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,s=0;for(let o of e)s===r.length?r.push(i=new t(this.S(K()),this.S(K()),this,this.options)):i=r[s],i._$AI(o),s++;s<r.length&&(this._$AR(i&&i._$AB.nextSibling,s),r.length=s)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},H=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,s,o){this.type=1,this._$AH=b,this._$AN=void 0,this.element=e,this.name=r,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(e,r=this,i,s){let o=this.strings,a=!1;if(o===void 0)e=O(this,e,r,0),a=!G(e)||e!==this._$AH&&e!==E,a&&(this._$AH=e);else{let n=e,d,l;for(e=o[0],d=0;d<o.length-1;d++)l=O(this,n[i+d],r,d),l===E&&(l=this._$AH[d]),a||=!G(l)||l!==this._$AH[d],l===b?e=b:e!==b&&(e+=(l??"")+o[d+1]),this._$AH[d]=l}a&&!s&&this.j(e)}j(e){e===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},we=class extends H{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},_e=class extends H{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},xe=class extends H{constructor(e,r,i,s,o){super(e,r,i,s,o),this.type=5}_$AI(e,r=this){if((e=O(this,e,r,0)??b)===E)return;let i=this._$AH,s=e===b&&i!==b||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==b&&(i===b||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ee=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){O(this,e)}};var Zt=oe.litHtmlPolyfillSupport;Zt?.(J,X),(oe.litHtmlVersions??=[]).push("3.1.2");var _t=(t,e,r)=>{let i=r?.renderBefore??e,s=i._$litPart$;if(s===void 0){let o=r?.renderBefore??null;i._$litPart$=s=new X(e.insertBefore(K(),o),o,void 0,r??{})}return s._$AI(t),s};var $=class extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=_t(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};$._$litElement$=!0,$.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:$});var Qt=globalThis.litElementPolyfillSupport;Qt?.({LitElement:$});(globalThis.litElementVersions??=[]).push("4.0.4");var xt=t=>(e,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)};var er={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:ie},tr=(t=er,e,r)=>{let{kind:i,metadata:s}=r,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(r.name,t),i==="accessor"){let{name:a}=r;return{set(n){let d=e.get.call(this);e.set.call(this,n),this.requestUpdate(a,d,t)},init(n){return n!==void 0&&this.P(a,void 0,t),n}}}if(i==="setter"){let{name:a}=r;return function(n){let d=this[a];e.call(this,n),this.requestUpdate(a,d,t)}}throw Error("Unsupported decorator location: "+i)};function u(t){return(e,r)=>typeof r=="object"?tr(t,e,r):((i,s,o)=>{let a=s.hasOwnProperty(o);return s.constructor.createProperty(o,a?{...i,wrapped:!0}:i),a?Object.getOwnPropertyDescriptor(s,o):void 0})(t,e,r)}function ve(t){return u({...t,state:!0,attribute:!1})}var D=(t,e,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(t,e,r),r);function Me(t,e){return(r,i,s)=>{let o=a=>a.renderRoot?.querySelector(t)??null;if(e){let{get:a,set:n}=typeof i=="object"?r:s??(()=>{let d=Symbol();return{get(){return this[d]},set(l){this[d]=l}}})();return D(r,i,{get(){let d=a.call(this);return d===void 0&&(d=o(this),(d!==null||this.hasUpdated)&&n.call(this,d)),d}})}return D(r,i,{get(){return o(this)}})}}var Et={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},vt=t=>(...e)=>({_$litDirective$:t,values:e}),ae=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var Mt="important",rr=" !"+Mt,I=vt(class extends ae{constructor(t){if(super(t),t.type!==Et.ATTRIBUTE||t.name!=="style"||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{let i=t[r];return i==null?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(t,[e]){let{style:r}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(let i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?r.removeProperty(i):r[i]=null);for(let i in e){let s=e[i];if(s!=null){this.ft.add(i);let o=typeof s=="string"&&s.endsWith(rr);i.includes("-")||o?r.setProperty(i,o?s.slice(0,-11):s,o?Mt:""):r[i]=s}}return E}});var $t="5.0.7";var $e=class{constructor(){this._components=[]}},Y=new $e;var It=()=>{typeof window.__luzmoMessageHandler!="function"&&(window.__luzmoMessageHandler=t=>{let e=Y._components.find(r=>t.data.name===r._iframeId);if(e)switch(t.data?.type){case"load":{e.dispatchEvent(new CustomEvent("load",{detail:{data:t.data}})),e._loadTimeoutHandle&&(clearTimeout(e._loadTimeoutHandle),e._loadTimeoutHandle=void 0),e.iframeLoaded=!0,e.dimensions=t.data.dimensions,e._calculateDimAfterDashboardLoaded();break}case"error":{e.dashboardError=!0,e._loadTimeoutHandle&&(clearTimeout(e._loadTimeoutHandle),e._loadTimeoutHandle=void 0),e.iframeLoaded=!0,e._displayError();break}case"data":{v(e,t.data.requestId,t.data.data);break}case"filters":{v(e,t.data.requestId,t.data.filters);break}case"getAccessibleDashboards":{v(e,t.data.requestId,t.data.accessibleDashboards);break}case"dashboardAction":{e.dispatchEvent(new CustomEvent("dashboardAction",{detail:{data:t.data}}));break}case"export":{t.data.error?F(e,t.data.requestId,t.data):(e.dispatchEvent(new CustomEvent("exported",{detail:{data:t.data}})),v(e,t.data.requestId,t.data));break}case"changedFilters":{e.dispatchEvent(new CustomEvent("changedFilters",{detail:{data:t.data}}));break}case"customEvent":{e.dispatchEvent(new CustomEvent("customEvent",{detail:{data:t.data}}));break}case"chartsRendered":case"itemsRendered":{t.data.type="itemsRendered",e.dispatchEvent(new CustomEvent("itemsRendered",{detail:{data:t.data}}));break}case"setEditMode":{t.data.error?F(e,t.data.requestId,t.data):(v(e,t.data.requestId,t.data),e.params.editMode=t.data.editMode,e._containerStyle=ee(e),e.dimensions&&N(e));break}case"setFilters":{t.data.error?F(e,t.data.requestId,t.data):v(e,t.data.requestId,t.data);break}case"setPreview":{t.data.error?F(e,t.data.requestId,t.data):v(e,t.data.requestId,t.data);break}}},window.addEventListener("message",window.__luzmoMessageHandler,!1))};var At=ge`
1
+ (function (g, f) {
2
+ var hasExports = typeof exports === 'object';
3
+ if (typeof define === "function" && define.amd) {
4
+ define([], f);
5
+ } else if (typeof module === "object" && module.exports) {
6
+ module.exports = f();
7
+ } else {
8
+ var m = hasExports ? f() : f();
9
+ var root = hasExports ? exports : g;
10
+ for(var i in m) root[i] = m[i];
11
+ }}(typeof self !== 'undefined' ? self : this, () => {
12
+ var exports = {};
13
+ var module = { exports };
14
+ "use strict";
15
+ var __defProp = Object.defineProperty;
16
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
17
+ var __getOwnPropNames = Object.getOwnPropertyNames;
18
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
+ }
29
+ return to;
30
+ };
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+ var __decorateClass = (decorators, target, key, kind) => {
33
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
34
+ for (var i6 = decorators.length - 1, decorator; i6 >= 0; i6--)
35
+ if (decorator = decorators[i6])
36
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
37
+ if (kind && result)
38
+ __defProp(target, key, result);
39
+ return result;
40
+ };
41
+
42
+ // libs/embed-libs/embed/src/index.ts
43
+ var src_exports2 = {};
44
+ __export(src_exports2, {
45
+ LuzmoDashboard: () => LuzmoDashboard
46
+ });
47
+ module.exports = __toCommonJS(src_exports2);
48
+
49
+ // libs/embed-libs/shared-embed/src/lib/helpers/error.ts
50
+ var _handleError = (errorMessage, parameters) => {
51
+ let message = "The dashboard component encountered an error";
52
+ if (typeof parameters?.dashboardId === "string") {
53
+ message += ` for dashboard with id ${parameters.dashboardId}`;
54
+ }
55
+ if (typeof parameters?.dashboardSlug === "string") {
56
+ message += ` for dashboard with slug ${parameters.dashboardSlug}`;
57
+ }
58
+ if (typeof parameters?.container === "string") {
59
+ message += ` in container ${parameters.container}`;
60
+ }
61
+ if (errorMessage) {
62
+ message += `:
63
+ ${errorMessage}`;
64
+ console.error(message);
65
+ }
66
+ };
67
+
68
+ // libs/embed-libs/shared-embed/src/lib/helpers/browser-check.ts
69
+ var _browserCheck = (dashboardComponent) => {
70
+ let hasError = false;
71
+ let errorMessage = "";
72
+ const document_ = document.body || document.documentElement;
73
+ const style = document_.style;
74
+ const browserCheck = {
75
+ svg: !!("createElementNS" in document && document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect),
76
+ flexbox: style.webkitFlexWrap === "" || style.flexWrap === "",
77
+ postMessage: !!window.postMessage
78
+ };
79
+ const browserCheckKeys = ["svg", "flexbox", "postMessage"];
80
+ for (const key of browserCheckKeys) {
81
+ if (!browserCheck[key]) {
82
+ hasError = true;
83
+ dashboardComponent.browserNotSupported = dashboardComponent.browserNotSupported || [];
84
+ dashboardComponent.browserNotSupported.push(key);
85
+ errorMessage += `Your browser does not support: ${key}
86
+ `;
87
+ }
88
+ }
89
+ const ua = window.navigator.userAgent;
90
+ const msie = ua.includes("MSIE");
91
+ const trident = ua.includes("Trident/");
92
+ if (msie || trident) {
93
+ hasError = true;
94
+ errorMessage = "IE is not supported.";
95
+ }
96
+ if (hasError) {
97
+ _handleError(errorMessage);
98
+ }
99
+ };
100
+
101
+ // libs/embed-libs/shared-embed/src/lib/helpers/default-parameters.ts
102
+ var DEFAULT_PARAMETERS = {
103
+ appServer: "https://app.luzmo.com/",
104
+ apiHost: "https://api.luzmo.com/",
105
+ dashboardId: null,
106
+ dashboardSlug: null,
107
+ container: null,
108
+ key: null,
109
+ token: null,
110
+ language: "auto",
111
+ qeVersion: null,
112
+ editMode: null,
113
+ screenMode: null,
114
+ switchScreenModeOnResize: true,
115
+ itemId: null,
116
+ mainColor: "",
117
+ accentColor: "",
118
+ itemDimensions: {
119
+ width: "auto",
120
+ height: "auto"
121
+ },
122
+ loaderBackground: "#f9f9f9",
123
+ loaderFontColor: "#5a5a5a",
124
+ loaderSpinnerColor: "rgba(255, 165, 0, 0.7)",
125
+ loaderSpinnerBackground: "rgba(169, 169, 169, 0.14)",
126
+ timezoneId: null,
127
+ contextId: null
128
+ };
129
+
130
+ // libs/embed-libs/shared-embed/src/lib/helpers/extents.ts
131
+ var EXTENTS = [
132
+ { mode: "mobile", width: [150, 767] },
133
+ { mode: "tablet", width: [768, 1199] },
134
+ { mode: "desktop", width: [1200, 1599] },
135
+ { mode: "largeScreen", width: [1600, 9999] },
136
+ { mode: "fixed", width: [] }
137
+ ];
138
+
139
+ // libs/embed-libs/shared-embed/src/lib/helpers/translations.ts
140
+ var TRANSLATIONS = {
141
+ initializing: { en: "Initializing...", nl: "Laden...", fr: "Chargement..." },
142
+ errorDashboard: {
143
+ en: "Oops, we could not load this dashboard!",
144
+ nl: "Oeps, we konden het dashboard niet laden.",
145
+ fr: "Le chargement a echou\xE9."
146
+ },
147
+ errorItem: {
148
+ en: "Oops, we could not load this item!",
149
+ nl: "Oeps, we konden de grafiek niet laden.",
150
+ fr: "Le chargement a echou\xE9."
151
+ }
152
+ };
153
+ var translations_default = TRANSLATIONS;
154
+
155
+ // libs/embed-libs/shared-embed/src/lib/helpers/utils.ts
156
+ var addTrailingSlash = (serverUrl) => {
157
+ if (!serverUrl) {
158
+ return "";
159
+ }
160
+ return serverUrl.endsWith("/") ? serverUrl : `${serverUrl}/`;
161
+ };
162
+ var removeTrailingSlash = (serverUrl) => {
163
+ if (!serverUrl) {
164
+ return "";
165
+ }
166
+ return serverUrl.endsWith("/") ? serverUrl.slice(0, -1) : serverUrl;
167
+ };
168
+ var formatDashboardList = (dashboards, integrationId, user, dashboardComponent) => {
169
+ const combineRights = (securable, user2) => {
170
+ const matchingUser = securable.users.find((u3) => u3.id === user2.id);
171
+ const securableAccessRights = matchingUser && matchingUser.userAccessRight ? {
172
+ flagRead: matchingUser.userAccessRight.flagRead,
173
+ flagUse: matchingUser.userAccessRight.flagUse,
174
+ flagModify: matchingUser.userAccessRight.flagModify,
175
+ flagOwn: matchingUser.userAccessRight.flagOwn
176
+ } : {
177
+ flagRead: false,
178
+ flagUse: false,
179
+ flagModify: false,
180
+ flagOwn: false
181
+ };
182
+ const groups = securable.groups.filter(
183
+ (group) => user2.userGroups.includes(group.id) || group.public === true
184
+ );
185
+ const groupsAccess = groups.map((group) => {
186
+ if (group.groupAccessRight) {
187
+ return group.groupAccessRight;
188
+ }
189
+ });
190
+ for (const groupAccess of groupsAccess) {
191
+ if (!securableAccessRights.flagRead && groupAccess.flagRead) {
192
+ securableAccessRights.flagRead = groupAccess.flagRead;
193
+ }
194
+ if (!securableAccessRights.flagUse && groupAccess.flagUse) {
195
+ securableAccessRights.flagUse = groupAccess.flagUse;
196
+ }
197
+ if (!securableAccessRights.flagModify && groupAccess.flagModify) {
198
+ securableAccessRights.flagModify = groupAccess.flagModify;
199
+ }
200
+ if (!securableAccessRights.flagOwn && groupAccess.flagOwn) {
201
+ securableAccessRights.flagOwn = groupAccess.flagOwn;
202
+ }
203
+ }
204
+ const integrationsAccess = securable.integrations?.length > 0 ? securable.integrations.map((integration) => {
205
+ if (integration.integrationAccessRight) {
206
+ return integration.integrationAccessRight;
207
+ }
208
+ }) : [];
209
+ for (const integrationAccess of integrationsAccess) {
210
+ if (!securableAccessRights.flagRead && integrationAccess.flagRead) {
211
+ securableAccessRights.flagRead = integrationAccess.flagRead;
212
+ }
213
+ if (!securableAccessRights.flagUse && integrationAccess.flagUse) {
214
+ securableAccessRights.flagUse = integrationAccess.flagUse;
215
+ }
216
+ if (!securableAccessRights.flagModify && integrationAccess.flagModify) {
217
+ securableAccessRights.flagModify = integrationAccess.flagModify;
218
+ }
219
+ }
220
+ return securableAccessRights;
221
+ };
222
+ const localize = (item, locale) => {
223
+ if (item === null || item === void 0) {
224
+ return "";
225
+ }
226
+ if (typeof item !== "object" || Object.keys(item).length === 0) {
227
+ if (typeof item === "object" && Object.keys(item).length === 0) {
228
+ return "";
229
+ }
230
+ return item;
231
+ }
232
+ let localizedItem;
233
+ localizedItem = locale && item[locale] ? item[locale] : item[Object.keys(item)[0]];
234
+ if (localizedItem === void 0 || localizedItem === null) {
235
+ localizedItem = "";
236
+ }
237
+ return localizedItem;
238
+ };
239
+ const treatedDashboards = [];
240
+ for (const dashboard of dashboards) {
241
+ const treatedDashboard = {
242
+ accessibleBy: [],
243
+ accessRights: combineRights(dashboard, user),
244
+ id: dashboard.id,
245
+ modifiedAt: dashboard.modified_at,
246
+ name: localize(dashboard.name, dashboardComponent.language),
247
+ slug: null,
248
+ tags: dashboard.tags.map((t5) => t5.tag).sort((t1, t22) => t1.localeCompare(t22))
249
+ };
250
+ const currentIntegration = dashboard.integrations.find(
251
+ (i6) => i6.id === integrationId
252
+ );
253
+ if (currentIntegration?.integrationAccessRight?.slug) {
254
+ treatedDashboard.slug = currentIntegration.integrationAccessRight.slug;
255
+ }
256
+ const users = dashboard.users.map((u3) => ({
257
+ model: "User",
258
+ id: u3.id,
259
+ name: localize(u3.name, user.locale_id)
260
+ }));
261
+ const groups = dashboard.groups.map((g2) => ({
262
+ model: "Group",
263
+ id: g2.id,
264
+ name: localize(g2.name, user.locale_id) || {}
265
+ }));
266
+ const integrations = dashboard.integrations.map((i6) => ({
267
+ model: "Integration",
268
+ id: i6.id,
269
+ name: localize(i6.name, user.locale_id) || {}
270
+ }));
271
+ treatedDashboard.accessibleBy = [...users, ...groups, ...integrations];
272
+ treatedDashboards.push(treatedDashboard);
273
+ }
274
+ return treatedDashboards;
275
+ };
276
+ var VERSION = "0.0.0-shared-luzmo";
277
+ var sanitizeUrl = (url) => {
278
+ const invalidPrototcolRegex = /^(%20|\s)*(javascript|data)/im;
279
+ const ctrlCharactersRegex = /[^\u0020-\u007E]/gim;
280
+ const urlSchemeRegex = /^([^:]+):/gm;
281
+ const relativeFirstCharacters = /* @__PURE__ */ new Set([".", "/"]);
282
+ const isRelativeUrlWithoutProtocol = (relativeUrl) => relativeFirstCharacters.has(relativeUrl[0]);
283
+ if (!url) {
284
+ return "about:blank";
285
+ }
286
+ const sanitizedUrl = url.replaceAll(ctrlCharactersRegex, "").trim();
287
+ if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {
288
+ return sanitizedUrl;
289
+ }
290
+ const urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);
291
+ if (!urlSchemeParseResults) {
292
+ return sanitizedUrl;
293
+ }
294
+ const urlScheme = urlSchemeParseResults[0];
295
+ if (invalidPrototcolRegex.test(urlScheme)) {
296
+ return "about:blank";
297
+ }
298
+ return sanitizedUrl;
299
+ };
300
+ var cloneDeep = (obj) => JSON.parse(JSON.stringify(obj));
301
+ var isObject = (o6) => o6 && typeof o6 === "object";
302
+ var defaultsDeep = (target, defaults) => {
303
+ Object.entries(defaults).forEach(([k2, v2]) => {
304
+ if (k2 in target) {
305
+ if (target[k2] === void 0) {
306
+ target[k2] = v2;
307
+ } else {
308
+ target[k2] = isObject(v2) ? defaultsDeep(
309
+ target[k2],
310
+ v2
311
+ ) : target[k2];
312
+ }
313
+ } else {
314
+ target[k2] = v2;
315
+ }
316
+ });
317
+ return target;
318
+ };
319
+ var uuidv4 = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g, function(c4) {
320
+ const r7 = Math.random() * 16 | 0;
321
+ const v2 = c4 == "x" ? r7 : r7 & 3 | 8;
322
+ return v2.toString(16);
323
+ });
324
+
325
+ // libs/embed-libs/shared-embed/src/lib/helpers/iframe-url.ts
326
+ var createIframeUrl = (dashboardContent) => {
327
+ const searchString = [];
328
+ const {
329
+ appServer,
330
+ language,
331
+ qeVersion,
332
+ loaderBackground,
333
+ loaderSpinnerColor,
334
+ loaderSpinnerBackground,
335
+ loaderFontColor,
336
+ screenMode,
337
+ key,
338
+ token,
339
+ timezoneId,
340
+ itemEmbedding,
341
+ itemDimensions,
342
+ dashboardId,
343
+ dashboardSlug,
344
+ itemId,
345
+ mainColor,
346
+ accentColor,
347
+ editMode
348
+ } = dashboardContent.params;
349
+ if (language && language !== "auto") {
350
+ searchString.push("language=" + language);
351
+ }
352
+ if (qeVersion) {
353
+ searchString.push(`qe_version=${qeVersion}`);
354
+ }
355
+ if (loaderBackground) {
356
+ searchString.push(`ldrbg=${loaderBackground}`);
357
+ }
358
+ if (loaderFontColor) {
359
+ searchString.push(`ldrftclr=${loaderFontColor}`);
360
+ }
361
+ if (loaderSpinnerColor) {
362
+ searchString.push(`ldrspclr=${loaderSpinnerColor}`);
363
+ }
364
+ if (loaderSpinnerBackground) {
365
+ searchString.push(`ldrspbg=${loaderSpinnerBackground}`);
366
+ }
367
+ if (mainColor) {
368
+ searchString.push(`mainColor=${mainColor}`);
369
+ }
370
+ if (accentColor) {
371
+ searchString.push(`accentColor=${accentColor}`);
372
+ }
373
+ if (screenMode && screenMode !== "auto") {
374
+ searchString.push("screenMode=" + screenMode);
375
+ }
376
+ if (timezoneId) {
377
+ searchString.push("timezoneId=" + timezoneId);
378
+ }
379
+ if (itemEmbedding && itemDimensions && itemDimensions.width) {
380
+ searchString.push("width=" + itemDimensions.width);
381
+ }
382
+ if (itemEmbedding && itemDimensions && itemDimensions.height) {
383
+ searchString.push("height=" + itemDimensions.height);
384
+ }
385
+ if (editMode) {
386
+ searchString.push("editMode=" + editMode);
387
+ }
388
+ const keyTokenUrlAnchor = key && token ? "#" + key + ":" + token : "";
389
+ searchString.push("version=" + (dashboardContent.VERSION || VERSION));
390
+ const iframeUrl = itemEmbedding ? `${appServer}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
391
+ searchString.join("&")
392
+ )}${keyTokenUrlAnchor}` : `${appServer}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
393
+ searchString.join("&")
394
+ )}${keyTokenUrlAnchor}`;
395
+ return sanitizeUrl(iframeUrl);
396
+ };
397
+
398
+ // libs/embed-libs/shared-embed/src/lib/helpers/get-loader.ts
399
+ var getLoader = (dashboardComponent) => {
400
+ let errorMsg;
401
+ if (dashboardComponent.params.error || dashboardComponent.browserNotSupported.length > 0) {
402
+ dashboardComponent.params.error = true;
403
+ if (dashboardComponent.browserNotSupported) {
404
+ errorMsg = "Browser is not supported.";
405
+ }
406
+ }
407
+ const loadingMsg = translations_default.initializing[dashboardComponent.params.language] || translations_default.initializing.en;
408
+ return dashboardComponent.browserNotSupported || dashboardComponent.params.error ? { loadingMsg, errorMsg } : { loadingMsg, errorMsg: "" };
409
+ };
410
+
411
+ // libs/embed-libs/shared-embed/src/lib/helpers/promise-dispatch.ts
412
+ function resolvePromise(dashboardComponent, requestId, data) {
413
+ if (dashboardComponent.promises[requestId]) {
414
+ dashboardComponent.promises[requestId].resolve(data);
415
+ delete dashboardComponent.promises[requestId];
416
+ }
417
+ }
418
+ function rejectPromise(dashboardComponent, requestId, data) {
419
+ if (dashboardComponent.promises[requestId]) {
420
+ dashboardComponent.promises[requestId].reject(data);
421
+ delete dashboardComponent.promises[requestId];
422
+ }
423
+ }
424
+
425
+ // libs/embed-libs/shared-embed/src/lib/helpers/styles.ts
426
+ function containerStyles(dashboardComponent) {
427
+ const styles = {};
428
+ if (dashboardComponent.params.loaderBackground && !dashboardComponent.iframeLoaded) {
429
+ styles.background = dashboardComponent.params.loaderBackground;
430
+ }
431
+ return styles;
432
+ }
433
+ function containerLoaderStyles(dashboardComponent) {
434
+ const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
435
+ const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
436
+ const display = dashboardComponent.iframeLoaded ? "none" : "";
437
+ return {
438
+ display,
439
+ height: `${chartHeightDefined ? height : dashboardComponent.minHeight}px`
440
+ };
441
+ }
442
+ function loaderStyles(dashboardComponent) {
443
+ const background = dashboardComponent.params.loaderBackground || DEFAULT_PARAMETERS.loaderBackground;
444
+ if (dashboardComponent.params.itemEmbedding) {
445
+ dashboardComponent.loaderSize = 24;
446
+ dashboardComponent.borderWidth = 4;
447
+ dashboardComponent.minHeight = 200;
448
+ const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
449
+ const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
450
+ const chartWidthDefined = width !== "auto";
451
+ const chartHeightDefined = height !== "auto";
452
+ return {
453
+ background,
454
+ width: chartWidthDefined ? `${width}px` : "100%",
455
+ height: `${chartHeightDefined ? height : "200"}px`,
456
+ "min-height": chartHeightDefined ? "" : "200px"
457
+ };
458
+ }
459
+ return {
460
+ background
461
+ };
462
+ }
463
+ function plStyles(dashboardComponent) {
464
+ const {
465
+ loaderSpinnerColor: defaultSpinnerColor,
466
+ loaderSpinnerBackground: defaultSpinnerBackground
467
+ } = DEFAULT_PARAMETERS;
468
+ const spinnerColorBorder = generateBorderStyle(
469
+ dashboardComponent.borderWidth,
470
+ dashboardComponent.params.loaderSpinnerColor || defaultSpinnerColor
471
+ );
472
+ const spinnerBackgroundBorder = generateBorderStyle(
473
+ dashboardComponent.borderWidth,
474
+ dashboardComponent.params.loaderSpinnerBackground || defaultSpinnerBackground
475
+ );
476
+ const size = `${dashboardComponent.loaderSize}px`;
477
+ return {
478
+ "border-top": spinnerColorBorder,
479
+ "border-right": spinnerColorBorder,
480
+ "border-bottom": spinnerBackgroundBorder,
481
+ "border-left": spinnerBackgroundBorder,
482
+ width: size,
483
+ height: size
484
+ };
485
+ }
486
+ function lcStyles(dashboardComponent) {
487
+ const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
488
+ const chartHeightDefined = dashboardComponent.params.itemEmbedding && height !== "auto";
489
+ const getPaddingStr = (value) => `${(value - dashboardComponent.loaderSize - 32) / 2}px`;
490
+ const verticalPadding = dashboardComponent.params.itemId ? chartHeightDefined ? getPaddingStr(Number.parseInt(`${height}`, 10)) : getPaddingStr(dashboardComponent.minHeight) : "128px";
491
+ return {
492
+ padding: `${verticalPadding} 16px`
493
+ };
494
+ }
495
+ function calculateIframeStyles(dashboardComponent) {
496
+ const height = dashboardComponent.params.itemDimensions?.height || DEFAULT_PARAMETERS.itemDimensions.height;
497
+ const width = dashboardComponent.params.itemDimensions?.width || DEFAULT_PARAMETERS.itemDimensions.width;
498
+ if (dashboardComponent.params.itemEmbedding && height !== "auto") {
499
+ dashboardComponent.iframeHeight = `${height}px`;
500
+ } else if (dashboardComponent.params.itemEmbedding) {
501
+ dashboardComponent.iframeHeight = "200px";
502
+ } else if (["editFull", "editLimited"].includes(dashboardComponent.params.editMode)) {
503
+ dashboardComponent.iframeHeight = "100%";
504
+ } else {
505
+ dashboardComponent.iframeHeight = "400px";
506
+ }
507
+ dashboardComponent.iframeWidth = dashboardComponent.params.itemEmbedding && width !== "auto" ? `${width}px` : "100%";
508
+ const styles = {
509
+ height: dashboardComponent.iframeHeight,
510
+ width: dashboardComponent.iframeWidth
511
+ };
512
+ if (dashboardComponent.iframeLoaded) {
513
+ styles.opacity = 1;
514
+ } else if (dashboardComponent.error) {
515
+ styles.opacity = 1;
516
+ styles.width = "100%";
517
+ styles.height = "400px";
518
+ } else {
519
+ styles.opacity = 0;
520
+ }
521
+ return styles;
522
+ }
523
+ function generateBorderStyle(borderWidth, color) {
524
+ return `${borderWidth}px solid ${color}`;
525
+ }
526
+
527
+ // libs/embed-libs/shared-embed/src/lib/helpers/update-iframe-url.ts
528
+ var updateIframeUrl = (iframe, iframeUrl) => {
529
+ if (iframe?.contentWindow) {
530
+ iframe.contentWindow.location.replace(iframeUrl);
531
+ }
532
+ };
533
+
534
+ // libs/embed-libs/shared-embed/src/lib/methods/export-dashboard.ts
535
+ var exportDashboard = (dashboardComponent, iframe, format) => {
536
+ const requestId = uuidv4();
537
+ if (iframe?.contentWindow) {
538
+ iframe.contentWindow.postMessage(
539
+ {
540
+ action: "exportDashboard",
541
+ format: format || "png",
542
+ _version: dashboardComponent.VERSION,
543
+ requestId
544
+ },
545
+ "*"
546
+ );
547
+ return new Promise((resolve, reject) => {
548
+ dashboardComponent.promises[requestId] = { resolve, reject };
549
+ setTimeout(() => {
550
+ if (dashboardComponent.promises[requestId]) {
551
+ const errorMessage = "exportDashboard request timed out.";
552
+ dashboardComponent.promises[requestId].reject(
553
+ new Error(errorMessage)
554
+ );
555
+ delete dashboardComponent.promises[requestId];
556
+ }
557
+ }, 12e5);
558
+ });
559
+ }
560
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
561
+ };
562
+
563
+ // libs/embed-libs/shared-embed/src/lib/methods/get-accessible-dashboards.ts
564
+ var getAccessibleDashboards = (dashboardComponent, iframe) => {
565
+ if ((dashboardComponent.dashboardId || dashboardComponent.dashboardSlug) && iframe?.contentWindow) {
566
+ const requestId = uuidv4();
567
+ iframe.contentWindow.postMessage(
568
+ {
569
+ action: "getAccessibleDashboards",
570
+ _version: dashboardComponent.VERSION,
571
+ requestId
572
+ },
573
+ "*"
574
+ );
575
+ return new Promise((resolve, reject) => {
576
+ dashboardComponent.promises[requestId] = { resolve, reject };
577
+ setTimeout(() => {
578
+ if (dashboardComponent.promises[requestId]) {
579
+ const errorMessage = "getAccessibleDashboards request timed out.";
580
+ dashboardComponent.promises[requestId].reject(
581
+ new Error(errorMessage)
582
+ );
583
+ delete dashboardComponent.promises[requestId];
584
+ }
585
+ }, 2e3);
586
+ });
587
+ }
588
+ const fetchUser = new Promise((resolve, reject) => {
589
+ void (() => {
590
+ try {
591
+ const responsePromise = window.fetch(
592
+ `${String(dashboardComponent.params.apiHost)}0.1.0/authorization`,
593
+ {
594
+ method: "POST",
595
+ mode: "cors",
596
+ cache: "no-cache",
597
+ headers: { "Content-Type": "application/json" },
598
+ redirect: "follow",
599
+ body: JSON.stringify({
600
+ action: "get",
601
+ version: "0.1.0",
602
+ key: dashboardComponent.authKey,
603
+ token: dashboardComponent.authToken,
604
+ find: {
605
+ where: { id: dashboardComponent.authKey },
606
+ attributes: ["id", "integration_id"],
607
+ include: [
608
+ {
609
+ model: "User",
610
+ attributes: ["id", "name", "locale_id"],
611
+ include: [{ model: "Group" }]
612
+ }
613
+ ]
614
+ }
615
+ })
616
+ }
617
+ );
618
+ responsePromise.then((response) => response.json()).then((data) => {
619
+ if (!data || !data.rows || data.rows.length === 0 || !data.rows[0].user || !data.rows[0].integration_id) {
620
+ reject();
621
+ } else {
622
+ data.rows[0].user.userGroups = data.rows[0].user.groups.map(
623
+ (group) => group.id
624
+ );
625
+ delete data.rows[0].user.groups;
626
+ resolve({
627
+ integrationId: data.rows[0].integration_id,
628
+ user: data.rows[0].user
629
+ });
630
+ }
631
+ });
632
+ } catch (error) {
633
+ reject(error);
634
+ }
635
+ })();
636
+ });
637
+ return new Promise((resolve, reject) => void (() => {
638
+ try {
639
+ fetchUser.then((authorizationData) => {
640
+ const responsePromise = window.fetch(
641
+ `${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
642
+ {
643
+ method: "POST",
644
+ mode: "cors",
645
+ cache: "no-cache",
646
+ headers: { "Content-Type": "application/json" },
647
+ redirect: "follow",
648
+ body: JSON.stringify({
649
+ action: "get",
650
+ version: "0.1.0",
651
+ key: dashboardComponent.authKey,
652
+ token: dashboardComponent.authToken,
653
+ find: {
654
+ where: { type: "dashboard", is_variant: false },
655
+ attributes: ["id", "name", "modified_at"],
656
+ order: [["modified_at", "desc"]],
657
+ include: [
658
+ { model: "Tag", attributes: ["tag"] },
659
+ { model: "User", attributes: ["id", "name"] },
660
+ {
661
+ model: "Group",
662
+ attributes: ["id", "name", "public"]
663
+ },
664
+ { model: "Integration", attributes: ["id", "name"] }
665
+ ]
666
+ }
667
+ })
668
+ }
669
+ );
670
+ responsePromise.then((response) => response.json()).then((data) => {
671
+ const dashboardList = data.rows.length > 0 ? formatDashboardList(
672
+ data.rows,
673
+ authorizationData.integrationId,
674
+ authorizationData.user,
675
+ dashboardComponent
676
+ ) : [];
677
+ resolve(dashboardList);
678
+ });
679
+ }).catch((error) => {
680
+ reject(error);
681
+ });
682
+ } catch (error) {
683
+ reject(error);
684
+ }
685
+ })());
686
+ };
687
+
688
+ // libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
689
+ var getData = (dashboardComponent, iframe, itemId) => {
690
+ if (iframe?.contentWindow) {
691
+ const requestId = uuidv4();
692
+ iframe.contentWindow.postMessage(
693
+ {
694
+ action: "getData",
695
+ id: itemId,
696
+ _version: dashboardComponent.VERSION,
697
+ requestId
698
+ },
699
+ "*"
700
+ );
701
+ return new Promise((resolve, reject) => {
702
+ dashboardComponent.promises[requestId] = { resolve, reject };
703
+ setTimeout(() => {
704
+ if (dashboardComponent.promises[requestId]) {
705
+ const errorMessage = "getData request timed out.";
706
+ dashboardComponent.promises[requestId].reject(
707
+ new Error(errorMessage)
708
+ );
709
+ delete dashboardComponent.promises[requestId];
710
+ }
711
+ }, 2e3);
712
+ });
713
+ }
714
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
715
+ };
716
+
717
+ // libs/embed-libs/shared-embed/src/lib/methods/get-filters.ts
718
+ var getFilters = (dashboardComponent, iframe) => {
719
+ if (iframe?.contentWindow) {
720
+ const requestId = uuidv4();
721
+ iframe.contentWindow.postMessage(
722
+ { action: "getFilters", _version: dashboardComponent.VERSION, requestId },
723
+ "*"
724
+ );
725
+ return new Promise((resolve, reject) => {
726
+ dashboardComponent.promises[requestId] = { resolve, reject };
727
+ setTimeout(() => {
728
+ if (dashboardComponent.promises[requestId]) {
729
+ const errorMessage = "getFilters request timed out.";
730
+ dashboardComponent.promises[requestId].reject(
731
+ new Error(errorMessage)
732
+ );
733
+ delete dashboardComponent.promises[requestId];
734
+ }
735
+ }, 2e3);
736
+ });
737
+ }
738
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
739
+ };
740
+
741
+ // libs/embed-libs/shared-embed/src/lib/methods/refresh-data.ts
742
+ var refreshData = (dashboardComponent, iframe, itemId) => {
743
+ if (iframe) {
744
+ iframe.contentWindow.postMessage(
745
+ {
746
+ action: "refreshData",
747
+ id: itemId ?? null,
748
+ _version: dashboardComponent.VERSION
749
+ },
750
+ "*"
751
+ );
752
+ return Promise.resolve();
753
+ }
754
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
755
+ };
756
+
757
+ // libs/embed-libs/shared-embed/src/lib/methods/reload-dashboard.ts
758
+ var reloadDashboard = (dashboardComponent, iframe) => {
759
+ if (iframe) {
760
+ iframe.contentWindow.postMessage(
761
+ { action: "reloadDashboard", _version: dashboardComponent.VERSION },
762
+ "*"
763
+ );
764
+ return Promise.resolve();
765
+ }
766
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
767
+ };
768
+
769
+ // libs/embed-libs/shared-embed/src/lib/methods/set-authorization.ts
770
+ var setAuthorization = (dashboardComponent, iframe, key, token) => {
771
+ if (iframe) {
772
+ iframe.contentWindow.postMessage(
773
+ {
774
+ action: "setAuthorization",
775
+ key,
776
+ token,
777
+ _version: dashboardComponent.VERSION
778
+ },
779
+ "*"
780
+ );
781
+ return Promise.resolve();
782
+ }
783
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
784
+ };
785
+
786
+ // libs/embed-libs/shared-embed/src/lib/methods/set-edit-mode.ts
787
+ var setEditMode = (dashboardComponent, iframe, editMode) => {
788
+ if (iframe && iframe.contentWindow) {
789
+ const requestId = uuidv4();
790
+ if (dashboardComponent.params.editMode === editMode) {
791
+ return Promise.reject(
792
+ new Error("editMode parameter is currently already set to " + editMode)
793
+ );
794
+ } else if (editMode !== "editFull" && editMode !== "editLimited" && editMode !== "view") {
795
+ return Promise.reject(
796
+ new Error(
797
+ "The editMode parameter must be one of the following values: 'editFull', 'editLimited' or 'view'."
798
+ )
799
+ );
800
+ }
801
+ iframe.contentWindow.postMessage(
802
+ {
803
+ action: "setEditMode",
804
+ editMode,
805
+ _version: dashboardComponent.VERSION,
806
+ requestId
807
+ },
808
+ "*"
809
+ );
810
+ return new Promise((resolve, reject) => {
811
+ dashboardComponent.promises[requestId] = { resolve, reject };
812
+ });
813
+ }
814
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
815
+ };
816
+
817
+ // libs/embed-libs/shared-embed/src/lib/methods/set-filters.ts
818
+ var setFilters = (dashboardComponent, iframe, itemId, filters) => {
819
+ if (iframe) {
820
+ const requestId = uuidv4();
821
+ iframe.contentWindow.postMessage(
822
+ {
823
+ action: "setFilters",
824
+ itemId,
825
+ filters,
826
+ _version: dashboardComponent.VERSION,
827
+ requestId
828
+ },
829
+ "*"
830
+ );
831
+ return new Promise((resolve, reject) => {
832
+ dashboardComponent.promises[requestId] = { resolve, reject };
833
+ setTimeout(() => {
834
+ if (dashboardComponent.promises[requestId]) {
835
+ const errorMessage = "setFilters request timed out.";
836
+ dashboardComponent.promises[requestId].reject(
837
+ new Error(errorMessage)
838
+ );
839
+ delete dashboardComponent.promises[requestId];
840
+ }
841
+ }, 2e3);
842
+ });
843
+ }
844
+ return Promise.reject();
845
+ };
846
+
847
+ // libs/embed-libs/shared-embed/src/lib/methods/set-preview.ts
848
+ var setPreview = (dashboardComponent, iframe, preview) => {
849
+ if (iframe) {
850
+ const requestId = uuidv4();
851
+ iframe.contentWindow.postMessage(
852
+ {
853
+ action: "setPreview",
854
+ preview,
855
+ requestId,
856
+ _version: dashboardComponent.VERSION
857
+ },
858
+ "*"
859
+ );
860
+ return new Promise((resolve, reject) => {
861
+ dashboardComponent.promises[requestId] = { resolve, reject };
862
+ setTimeout(() => {
863
+ if (dashboardComponent.promises[requestId]) {
864
+ const errorMessage = "setPreview request timed out.";
865
+ dashboardComponent.promises[requestId].reject(
866
+ new Error(errorMessage)
867
+ );
868
+ delete dashboardComponent.promises[requestId];
869
+ }
870
+ }, 2e3);
871
+ });
872
+ }
873
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
874
+ };
875
+
876
+ // libs/embed-libs/shared-embed/src/lib/service/calculate-dimensions.ts
877
+ var _setCalculatedDimensions = (dashboardComponent) => {
878
+ if (!dashboardComponent.dimensions) {
879
+ dashboardComponent.params.error = true;
880
+ _handleError("Got no valid dimensions.", dashboardComponent.params);
881
+ return;
882
+ }
883
+ const dashboardDimensionKeys = Object.keys(
884
+ dashboardComponent.dimensions
885
+ );
886
+ const availableScreenModeExtents = [];
887
+ let currentMode;
888
+ let currentWidth = 0;
889
+ let currentHeight = 0;
890
+ if (!dashboardComponent.params.switchScreenModeOnResize && dashboardComponent.currentScreenMode) {
891
+ dashboardComponent.params.screenMode = dashboardComponent.currentScreenMode;
892
+ }
893
+ if (dashboardComponent.dimensions && dashboardDimensionKeys?.[0] === "fixed") {
894
+ currentMode = "fixed";
895
+ currentWidth = dashboardComponent.dimensions.fixed[0];
896
+ currentHeight = dashboardComponent.dimensions.fixed[1];
897
+ } else {
898
+ const screenModes = [
899
+ "mobile",
900
+ "tablet",
901
+ "desktop",
902
+ "largeScreen"
903
+ ];
904
+ if (dashboardComponent.params.itemEmbedding) {
905
+ const [firstMatch] = dashboardDimensionKeys;
906
+ let match = cloneDeep(firstMatch);
907
+ for (const screenMode of screenModes) {
908
+ const found = dashboardDimensionKeys.find((key) => key === screenMode);
909
+ if (found) {
910
+ match = cloneDeep(found);
911
+ } else {
912
+ dashboardComponent.dimensions[screenMode] = dashboardComponent.dimensions[match];
913
+ }
914
+ }
915
+ }
916
+ for (const key of dashboardDimensionKeys) {
917
+ if (screenModes.includes(key)) {
918
+ const screenMode = EXTENTS.find((extent) => extent.mode === key);
919
+ availableScreenModeExtents.push({
920
+ ...screenMode,
921
+ height: dashboardComponent.dimensions[key][1] || 50
922
+ });
923
+ }
924
+ }
925
+ if (!availableScreenModeExtents.map((screenModeExtent) => screenModeExtent.mode).includes(dashboardComponent.params.screenMode)) {
926
+ dashboardComponent.params.screenMode = "auto";
927
+ }
928
+ if (dashboardComponent.params.screenMode === "auto") {
929
+ availableScreenModeExtents.sort(
930
+ (a3, b3) => screenModes.indexOf(a3.mode) - screenModes.indexOf(b3.mode)
931
+ );
932
+ for (const screenModeExtent of availableScreenModeExtents) {
933
+ const [screenModeExtentMinWidth, screenModeExtentMaxWidth] = screenModeExtent.width;
934
+ if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
935
+ if (screenModeExtentMinWidth < dashboardComponent.params.itemDimensions.width) {
936
+ currentMode = screenModeExtent.mode;
937
+ currentWidth = Number.parseInt(
938
+ dashboardComponent.params.itemDimensions.width,
939
+ 10
940
+ );
941
+ currentHeight = dashboardComponent.dimensions[currentMode][1];
942
+ }
943
+ } else {
944
+ if (screenModeExtentMinWidth < dashboardComponent.containerWidth) {
945
+ currentMode = screenModeExtent.mode;
946
+ if (dashboardComponent.params.itemEmbedding) {
947
+ currentWidth = dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto" ? Number.parseInt(
948
+ dashboardComponent.params.itemDimensions.width,
949
+ 10
950
+ ) : Math.min(
951
+ dashboardComponent.containerWidth,
952
+ screenModeExtentMaxWidth
953
+ );
954
+ currentHeight = dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto" ? Number.parseInt(
955
+ dashboardComponent.params.itemDimensions.height,
956
+ 10
957
+ ) : dashboardComponent.dimensions[currentMode][1];
958
+ if (dashboardComponent.params.itemDimensions && dashboardComponent.params.itemDimensions.width !== "auto" && dashboardComponent.params.itemDimensions.height === "auto") {
959
+ currentWidth = Number.parseInt(
960
+ dashboardComponent.params.itemDimensions.width,
961
+ 10
962
+ );
963
+ currentHeight = dashboardComponent.dimensions[currentMode][1];
964
+ }
965
+ } else {
966
+ currentWidth = Math.max(
967
+ Math.min(
968
+ screenModeExtentMaxWidth,
969
+ dashboardComponent.containerWidth
970
+ ),
971
+ screenModeExtentMinWidth
972
+ );
973
+ currentHeight = screenModeExtent.height;
974
+ }
975
+ }
976
+ }
977
+ }
978
+ } else {
979
+ const {
980
+ height: chosenModeHeight,
981
+ width: [chosenModeMinWidth, chosenModeMaxWidth]
982
+ } = availableScreenModeExtents.find(
983
+ (d3) => d3.mode === dashboardComponent.params.screenMode
984
+ );
985
+ currentMode = dashboardComponent.params.screenMode;
986
+ currentWidth = Math.max(
987
+ Math.min(chosenModeMaxWidth, dashboardComponent.containerWidth),
988
+ chosenModeMinWidth
989
+ );
990
+ currentHeight = chosenModeHeight;
991
+ if (dashboardComponent.params.itemEmbedding) {
992
+ if (dashboardComponent.params.itemDimensions?.width && dashboardComponent.params.itemDimensions?.width !== "auto") {
993
+ currentWidth = Number.parseInt(
994
+ dashboardComponent.params.itemDimensions.width,
995
+ 10
996
+ );
997
+ }
998
+ if (dashboardComponent.params.itemDimensions?.height && dashboardComponent.params.itemDimensions?.height !== "auto") {
999
+ currentHeight = Number.parseInt(
1000
+ dashboardComponent.params.itemDimensions.height,
1001
+ 10
1002
+ );
1003
+ }
1004
+ }
1005
+ }
1006
+ if (!currentMode && availableScreenModeExtents.length > 0) {
1007
+ const [lowestModeExtent] = availableScreenModeExtents;
1008
+ currentMode = lowestModeExtent.mode;
1009
+ currentWidth = lowestModeExtent.width[0];
1010
+ currentHeight = lowestModeExtent.height;
1011
+ }
1012
+ }
1013
+ dashboardComponent.currentScreenMode = currentMode;
1014
+ const style = {
1015
+ height: currentHeight === 0 ? "100%" : `${String(currentHeight)}px`,
1016
+ width: currentWidth === 0 ? "100%" : `${String(currentWidth)}px`,
1017
+ opacity: 1
1018
+ };
1019
+ const dashboardEditModes = ["editFull", "editLimited"];
1020
+ if (dashboardEditModes.includes(dashboardComponent.params.editMode)) {
1021
+ style.height = "100%";
1022
+ style.width = "100%";
1023
+ } else if (dashboardComponent.params.itemEmbedding && dashboardComponent.params.itemDimensions) {
1024
+ style.height = dashboardComponent.params.itemDimensions.height === "auto" ? style.height : `${String(dashboardComponent.params.itemDimensions.height).replace(
1025
+ "px",
1026
+ ""
1027
+ )}px`;
1028
+ style.width = dashboardComponent.params.itemDimensions.width === "auto" ? style.width : `${String(dashboardComponent.params.itemDimensions.width).replace(
1029
+ "px",
1030
+ ""
1031
+ )}px`;
1032
+ } else {
1033
+ style.height = currentHeight === 0 ? "100%" : `${String(currentHeight)}px`;
1034
+ style.width = currentWidth === 0 ? "100%" : `${String(currentWidth)}px`;
1035
+ }
1036
+ dashboardComponent.currentScreenMode = currentMode;
1037
+ dashboardComponent.iframeStyle = style;
1038
+ };
1039
+
1040
+ // libs/embed-libs/shared-embed/src/lib/service/extend-and-validate.ts
1041
+ var _extendAndValidate = (dashboardContent) => {
1042
+ const defaultKeys = Object.keys(
1043
+ DEFAULT_PARAMETERS
1044
+ );
1045
+ const errorMessages = [];
1046
+ const requiredStringParams = [
1047
+ "appServer",
1048
+ "language",
1049
+ "apiHost"
1050
+ ];
1051
+ const requiredStringOrEmptyParams = [
1052
+ "key",
1053
+ "token",
1054
+ "screenMode",
1055
+ "timezoneId",
1056
+ "itemId",
1057
+ "container",
1058
+ "loaderBackground",
1059
+ "loaderFontColor",
1060
+ "loaderSpinnerColor",
1061
+ "loaderSpinnerBackground"
1062
+ ];
1063
+ const objectParams = ["itemDimensions"];
1064
+ const screenModes = [
1065
+ "mobile",
1066
+ "tablet",
1067
+ "desktop",
1068
+ "largeScreen",
1069
+ "fixed",
1070
+ "auto"
1071
+ ];
1072
+ for (const key of defaultKeys) {
1073
+ if (dashboardContent.params[key] === null) {
1074
+ delete dashboardContent.params[key];
1075
+ }
1076
+ }
1077
+ dashboardContent.params = defaultsDeep(
1078
+ dashboardContent.params,
1079
+ DEFAULT_PARAMETERS
1080
+ );
1081
+ if ((!dashboardContent.params.dashboardId || typeof dashboardContent.params.dashboardId !== "string") && (!dashboardContent.params.dashboardSlug || typeof dashboardContent.params.dashboardSlug !== "string")) {
1082
+ delete dashboardContent.params.dashboardId;
1083
+ delete dashboardContent.params.dashboardSlug;
1084
+ }
1085
+ for (const key of requiredStringParams) {
1086
+ if (typeof dashboardContent.params[key] !== "string") {
1087
+ delete dashboardContent.params[key];
1088
+ errorMessages.push(`${key} needs to be of type string.`);
1089
+ }
1090
+ }
1091
+ for (const key of requiredStringOrEmptyParams) {
1092
+ if (typeof dashboardContent.params[key] !== "string" && dashboardContent.params[key] !== null && dashboardContent.params[key] !== void 0) {
1093
+ delete dashboardContent.params[key];
1094
+ errorMessages.push(`${key} needs to be of type string or empty.`);
1095
+ }
1096
+ }
1097
+ if (dashboardContent.params.screenMode && !screenModes.includes(dashboardContent.params.screenMode)) {
1098
+ const validTypesString = screenModes.map((mode) => `"${mode}"`).join(", ");
1099
+ errorMessages.push(
1100
+ `"screenMode" needs should be one of these types: ${validTypesString}`
1101
+ );
1102
+ dashboardContent.params.screenMode = "auto";
1103
+ }
1104
+ if (dashboardContent.params.itemId) {
1105
+ dashboardContent.params.itemEmbedding = true;
1106
+ }
1107
+ for (const key of objectParams) {
1108
+ if (typeof dashboardContent.params[key] !== "object" && dashboardContent.params[key] !== null) {
1109
+ delete dashboardContent.params[key];
1110
+ errorMessages.push(`${key} needs to be of type object or empty.`);
1111
+ }
1112
+ }
1113
+ if (typeof dashboardContent.params.switchScreenModeOnResize !== "boolean") {
1114
+ errorMessages.push("switchScreenModeOnResize needs to be of type boolean.");
1115
+ dashboardContent.params.switchScreenModeOnResize = true;
1116
+ }
1117
+ if (dashboardContent.params.itemDimensions) {
1118
+ const itemDimensionsKeys = [
1119
+ "width",
1120
+ "height"
1121
+ ];
1122
+ for (const key of itemDimensionsKeys) {
1123
+ if (!["string", "number"].includes(
1124
+ typeof dashboardContent.params.itemDimensions[key]
1125
+ ) && dashboardContent.params.itemDimensions[key] !== null) {
1126
+ errorMessages.push(
1127
+ `itemDimensions ${key} needs to be of type string, number or empty.`
1128
+ );
1129
+ }
1130
+ }
1131
+ }
1132
+ dashboardContent.params = defaultsDeep(
1133
+ dashboardContent.params,
1134
+ DEFAULT_PARAMETERS
1135
+ );
1136
+ if (dashboardContent.params.screenMode && dashboardContent.params.screenMode !== "auto") {
1137
+ dashboardContent.params.switchScreenModeOnResize = false;
1138
+ }
1139
+ if (dashboardContent.params.itemDimensions.width !== "auto") {
1140
+ dashboardContent.params.itemDimensions.width = Number.parseInt(
1141
+ `${dashboardContent.params.itemDimensions.width}`.replace("px", ""),
1142
+ 10
1143
+ ) || "auto";
1144
+ }
1145
+ if (dashboardContent.params.itemDimensions.height !== "auto") {
1146
+ dashboardContent.params.itemDimensions.height = Number.parseInt(
1147
+ `${dashboardContent.params.itemDimensions.height}`.replace("px", ""),
1148
+ 10
1149
+ ) || "auto";
1150
+ }
1151
+ dashboardContent.params.itemEmbedding = !!dashboardContent.params.itemId;
1152
+ if (dashboardContent.params.error || errorMessages.length > 0) {
1153
+ _handleError(errorMessages.join("\n"), dashboardContent.params);
1154
+ }
1155
+ };
1156
+
1157
+ // libs/embed-libs/shared-embed/src/lib/constants/class-constants.ts
1158
+ var luzmoEmbedContainerClass = "luzmo-embed-container";
1159
+
1160
+ // libs/embed-libs/shared-embed/src/lib/helpers/remote-federation.ts
1161
+ var remotesMap = {
1162
+ // "remote_app": { url: "http://localhost:4201/remoteEntry.mjs", format: "esm", from: "vite" },
1163
+ };
1164
+ var loadJS = async (url, fn) => {
1165
+ const resolvedUrl = typeof url === "function" ? await url() : url;
1166
+ const script = document.createElement("script");
1167
+ script.type = "text/javascript";
1168
+ script.addEventListener("load", fn);
1169
+ script.src = resolvedUrl;
1170
+ document.querySelectorAll("head")[0].append(script);
1171
+ };
1172
+ var wrapShareModule = (remoteFrom) => ({});
1173
+ async function __federationMethodEnsure(remoteId) {
1174
+ const remote = remotesMap[remoteId];
1175
+ if (remote.inited) {
1176
+ return remote.lib;
1177
+ }
1178
+ if (remote.format === "var") {
1179
+ return new Promise((resolve) => {
1180
+ const callback = () => {
1181
+ if (!remote.inited) {
1182
+ remote.lib = window[remoteId];
1183
+ remote.lib.init(wrapShareModule(remote.from));
1184
+ remote.inited = true;
1185
+ }
1186
+ resolve(remote.lib);
1187
+ };
1188
+ return loadJS(remote.url, callback);
1189
+ });
1190
+ } else if (["esm", "systemjs"].includes(remote.format)) {
1191
+ return new Promise((resolve, reject) => {
1192
+ const getUrl = typeof remote.url === "function" ? remote.url : () => Promise.resolve(remote.url);
1193
+ getUrl().then((url) => {
1194
+ import(
1195
+ /* @vite-ignore */
1196
+ /* webpackIgnore: true */
1197
+ url
1198
+ ).then((lib) => {
1199
+ if (!remote.inited) {
1200
+ const shareScope = wrapShareModule(remote.from);
1201
+ lib.init(shareScope);
1202
+ remote.lib = lib;
1203
+ remote.lib.init(shareScope);
1204
+ remote.inited = true;
1205
+ }
1206
+ resolve(remote.lib);
1207
+ }).catch(reject);
1208
+ });
1209
+ });
1210
+ }
1211
+ }
1212
+ function __federationMethodWrapDefault(module2, need) {
1213
+ if (!(module2 == null ? void 0 : module2.default) && need) {
1214
+ const obj = /* @__PURE__ */ Object.create(null);
1215
+ obj.default = module2;
1216
+ obj.__esModule = true;
1217
+ return obj;
1218
+ }
1219
+ return module2;
1220
+ }
1221
+ async function __federationMethodGetRemote(remoteName, componentName) {
1222
+ return __federationMethodEnsure(remoteName).then((remote) => remote.get(componentName).then((factory) => factory()));
1223
+ }
1224
+
1225
+ // node_modules/@lit/reactive-element/css-tag.js
1226
+ var t = globalThis;
1227
+ var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
1228
+ var s = Symbol();
1229
+ var o = /* @__PURE__ */ new WeakMap();
1230
+ var n = class {
1231
+ constructor(t5, e7, o6) {
1232
+ if (this._$cssResult$ = true, o6 !== s)
1233
+ throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
1234
+ this.cssText = t5, this.t = e7;
1235
+ }
1236
+ get styleSheet() {
1237
+ let t5 = this.o;
1238
+ const s4 = this.t;
1239
+ if (e && void 0 === t5) {
1240
+ const e7 = void 0 !== s4 && 1 === s4.length;
1241
+ e7 && (t5 = o.get(s4)), void 0 === t5 && ((this.o = t5 = new CSSStyleSheet()).replaceSync(this.cssText), e7 && o.set(s4, t5));
1242
+ }
1243
+ return t5;
1244
+ }
1245
+ toString() {
1246
+ return this.cssText;
1247
+ }
1248
+ };
1249
+ var r = (t5) => new n("string" == typeof t5 ? t5 : t5 + "", void 0, s);
1250
+ var i = (t5, ...e7) => {
1251
+ const o6 = 1 === t5.length ? t5[0] : e7.reduce((e8, s4, o7) => e8 + ((t6) => {
1252
+ if (true === t6._$cssResult$)
1253
+ return t6.cssText;
1254
+ if ("number" == typeof t6)
1255
+ return t6;
1256
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + t6 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
1257
+ })(s4) + t5[o7 + 1], t5[0]);
1258
+ return new n(o6, t5, s);
1259
+ };
1260
+ var S = (s4, o6) => {
1261
+ if (e)
1262
+ s4.adoptedStyleSheets = o6.map((t5) => t5 instanceof CSSStyleSheet ? t5 : t5.styleSheet);
1263
+ else
1264
+ for (const e7 of o6) {
1265
+ const o7 = document.createElement("style"), n6 = t.litNonce;
1266
+ void 0 !== n6 && o7.setAttribute("nonce", n6), o7.textContent = e7.cssText, s4.appendChild(o7);
1267
+ }
1268
+ };
1269
+ var c = e ? (t5) => t5 : (t5) => t5 instanceof CSSStyleSheet ? ((t6) => {
1270
+ let e7 = "";
1271
+ for (const s4 of t6.cssRules)
1272
+ e7 += s4.cssText;
1273
+ return r(e7);
1274
+ })(t5) : t5;
1275
+
1276
+ // node_modules/@lit/reactive-element/reactive-element.js
1277
+ var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object;
1278
+ var a = globalThis;
1279
+ var c2 = a.trustedTypes;
1280
+ var l = c2 ? c2.emptyScript : "";
1281
+ var p = a.reactiveElementPolyfillSupport;
1282
+ var d = (t5, s4) => t5;
1283
+ var u = { toAttribute(t5, s4) {
1284
+ switch (s4) {
1285
+ case Boolean:
1286
+ t5 = t5 ? l : null;
1287
+ break;
1288
+ case Object:
1289
+ case Array:
1290
+ t5 = null == t5 ? t5 : JSON.stringify(t5);
1291
+ }
1292
+ return t5;
1293
+ }, fromAttribute(t5, s4) {
1294
+ let i6 = t5;
1295
+ switch (s4) {
1296
+ case Boolean:
1297
+ i6 = null !== t5;
1298
+ break;
1299
+ case Number:
1300
+ i6 = null === t5 ? null : Number(t5);
1301
+ break;
1302
+ case Object:
1303
+ case Array:
1304
+ try {
1305
+ i6 = JSON.parse(t5);
1306
+ } catch (t6) {
1307
+ i6 = null;
1308
+ }
1309
+ }
1310
+ return i6;
1311
+ } };
1312
+ var f = (t5, s4) => !i2(t5, s4);
1313
+ var y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
1314
+ Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
1315
+ var b = class extends HTMLElement {
1316
+ static addInitializer(t5) {
1317
+ this._$Ei(), (this.l ??= []).push(t5);
1318
+ }
1319
+ static get observedAttributes() {
1320
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
1321
+ }
1322
+ static createProperty(t5, s4 = y) {
1323
+ if (s4.state && (s4.attribute = false), this._$Ei(), this.elementProperties.set(t5, s4), !s4.noAccessor) {
1324
+ const i6 = Symbol(), r7 = this.getPropertyDescriptor(t5, i6, s4);
1325
+ void 0 !== r7 && e2(this.prototype, t5, r7);
1326
+ }
1327
+ }
1328
+ static getPropertyDescriptor(t5, s4, i6) {
1329
+ const { get: e7, set: h3 } = r2(this.prototype, t5) ?? { get() {
1330
+ return this[s4];
1331
+ }, set(t6) {
1332
+ this[s4] = t6;
1333
+ } };
1334
+ return { get() {
1335
+ return e7?.call(this);
1336
+ }, set(s5) {
1337
+ const r7 = e7?.call(this);
1338
+ h3.call(this, s5), this.requestUpdate(t5, r7, i6);
1339
+ }, configurable: true, enumerable: true };
1340
+ }
1341
+ static getPropertyOptions(t5) {
1342
+ return this.elementProperties.get(t5) ?? y;
1343
+ }
1344
+ static _$Ei() {
1345
+ if (this.hasOwnProperty(d("elementProperties")))
1346
+ return;
1347
+ const t5 = n2(this);
1348
+ t5.finalize(), void 0 !== t5.l && (this.l = [...t5.l]), this.elementProperties = new Map(t5.elementProperties);
1349
+ }
1350
+ static finalize() {
1351
+ if (this.hasOwnProperty(d("finalized")))
1352
+ return;
1353
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
1354
+ const t6 = this.properties, s4 = [...h(t6), ...o2(t6)];
1355
+ for (const i6 of s4)
1356
+ this.createProperty(i6, t6[i6]);
1357
+ }
1358
+ const t5 = this[Symbol.metadata];
1359
+ if (null !== t5) {
1360
+ const s4 = litPropertyMetadata.get(t5);
1361
+ if (void 0 !== s4)
1362
+ for (const [t6, i6] of s4)
1363
+ this.elementProperties.set(t6, i6);
1364
+ }
1365
+ this._$Eh = /* @__PURE__ */ new Map();
1366
+ for (const [t6, s4] of this.elementProperties) {
1367
+ const i6 = this._$Eu(t6, s4);
1368
+ void 0 !== i6 && this._$Eh.set(i6, t6);
1369
+ }
1370
+ this.elementStyles = this.finalizeStyles(this.styles);
1371
+ }
1372
+ static finalizeStyles(s4) {
1373
+ const i6 = [];
1374
+ if (Array.isArray(s4)) {
1375
+ const e7 = new Set(s4.flat(1 / 0).reverse());
1376
+ for (const s5 of e7)
1377
+ i6.unshift(c(s5));
1378
+ } else
1379
+ void 0 !== s4 && i6.push(c(s4));
1380
+ return i6;
1381
+ }
1382
+ static _$Eu(t5, s4) {
1383
+ const i6 = s4.attribute;
1384
+ return false === i6 ? void 0 : "string" == typeof i6 ? i6 : "string" == typeof t5 ? t5.toLowerCase() : void 0;
1385
+ }
1386
+ constructor() {
1387
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
1388
+ }
1389
+ _$Ev() {
1390
+ this._$ES = new Promise((t5) => this.enableUpdating = t5), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t5) => t5(this));
1391
+ }
1392
+ addController(t5) {
1393
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t5), void 0 !== this.renderRoot && this.isConnected && t5.hostConnected?.();
1394
+ }
1395
+ removeController(t5) {
1396
+ this._$EO?.delete(t5);
1397
+ }
1398
+ _$E_() {
1399
+ const t5 = /* @__PURE__ */ new Map(), s4 = this.constructor.elementProperties;
1400
+ for (const i6 of s4.keys())
1401
+ this.hasOwnProperty(i6) && (t5.set(i6, this[i6]), delete this[i6]);
1402
+ t5.size > 0 && (this._$Ep = t5);
1403
+ }
1404
+ createRenderRoot() {
1405
+ const t5 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
1406
+ return S(t5, this.constructor.elementStyles), t5;
1407
+ }
1408
+ connectedCallback() {
1409
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t5) => t5.hostConnected?.());
1410
+ }
1411
+ enableUpdating(t5) {
1412
+ }
1413
+ disconnectedCallback() {
1414
+ this._$EO?.forEach((t5) => t5.hostDisconnected?.());
1415
+ }
1416
+ attributeChangedCallback(t5, s4, i6) {
1417
+ this._$AK(t5, i6);
1418
+ }
1419
+ _$EC(t5, s4) {
1420
+ const i6 = this.constructor.elementProperties.get(t5), e7 = this.constructor._$Eu(t5, i6);
1421
+ if (void 0 !== e7 && true === i6.reflect) {
1422
+ const r7 = (void 0 !== i6.converter?.toAttribute ? i6.converter : u).toAttribute(s4, i6.type);
1423
+ this._$Em = t5, null == r7 ? this.removeAttribute(e7) : this.setAttribute(e7, r7), this._$Em = null;
1424
+ }
1425
+ }
1426
+ _$AK(t5, s4) {
1427
+ const i6 = this.constructor, e7 = i6._$Eh.get(t5);
1428
+ if (void 0 !== e7 && this._$Em !== e7) {
1429
+ const t6 = i6.getPropertyOptions(e7), r7 = "function" == typeof t6.converter ? { fromAttribute: t6.converter } : void 0 !== t6.converter?.fromAttribute ? t6.converter : u;
1430
+ this._$Em = e7, this[e7] = r7.fromAttribute(s4, t6.type), this._$Em = null;
1431
+ }
1432
+ }
1433
+ requestUpdate(t5, s4, i6) {
1434
+ if (void 0 !== t5) {
1435
+ if (i6 ??= this.constructor.getPropertyOptions(t5), !(i6.hasChanged ?? f)(this[t5], s4))
1436
+ return;
1437
+ this.P(t5, s4, i6);
1438
+ }
1439
+ false === this.isUpdatePending && (this._$ES = this._$ET());
1440
+ }
1441
+ P(t5, s4, i6) {
1442
+ this._$AL.has(t5) || this._$AL.set(t5, s4), true === i6.reflect && this._$Em !== t5 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t5);
1443
+ }
1444
+ async _$ET() {
1445
+ this.isUpdatePending = true;
1446
+ try {
1447
+ await this._$ES;
1448
+ } catch (t6) {
1449
+ Promise.reject(t6);
1450
+ }
1451
+ const t5 = this.scheduleUpdate();
1452
+ return null != t5 && await t5, !this.isUpdatePending;
1453
+ }
1454
+ scheduleUpdate() {
1455
+ return this.performUpdate();
1456
+ }
1457
+ performUpdate() {
1458
+ if (!this.isUpdatePending)
1459
+ return;
1460
+ if (!this.hasUpdated) {
1461
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
1462
+ for (const [t7, s5] of this._$Ep)
1463
+ this[t7] = s5;
1464
+ this._$Ep = void 0;
1465
+ }
1466
+ const t6 = this.constructor.elementProperties;
1467
+ if (t6.size > 0)
1468
+ for (const [s5, i6] of t6)
1469
+ true !== i6.wrapped || this._$AL.has(s5) || void 0 === this[s5] || this.P(s5, this[s5], i6);
1470
+ }
1471
+ let t5 = false;
1472
+ const s4 = this._$AL;
1473
+ try {
1474
+ t5 = this.shouldUpdate(s4), t5 ? (this.willUpdate(s4), this._$EO?.forEach((t6) => t6.hostUpdate?.()), this.update(s4)) : this._$EU();
1475
+ } catch (s5) {
1476
+ throw t5 = false, this._$EU(), s5;
1477
+ }
1478
+ t5 && this._$AE(s4);
1479
+ }
1480
+ willUpdate(t5) {
1481
+ }
1482
+ _$AE(t5) {
1483
+ this._$EO?.forEach((t6) => t6.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t5)), this.updated(t5);
1484
+ }
1485
+ _$EU() {
1486
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
1487
+ }
1488
+ get updateComplete() {
1489
+ return this.getUpdateComplete();
1490
+ }
1491
+ getUpdateComplete() {
1492
+ return this._$ES;
1493
+ }
1494
+ shouldUpdate(t5) {
1495
+ return true;
1496
+ }
1497
+ update(t5) {
1498
+ this._$Ej &&= this._$Ej.forEach((t6) => this._$EC(t6, this[t6])), this._$EU();
1499
+ }
1500
+ updated(t5) {
1501
+ }
1502
+ firstUpdated(t5) {
1503
+ }
1504
+ };
1505
+ b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4");
1506
+
1507
+ // node_modules/lit-html/lit-html.js
1508
+ var t2 = globalThis;
1509
+ var i3 = t2.trustedTypes;
1510
+ var s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t5) => t5 }) : void 0;
1511
+ var e3 = "$lit$";
1512
+ var h2 = `lit$${(Math.random() + "").slice(9)}$`;
1513
+ var o3 = "?" + h2;
1514
+ var n3 = `<${o3}>`;
1515
+ var r3 = document;
1516
+ var l2 = () => r3.createComment("");
1517
+ var c3 = (t5) => null === t5 || "object" != typeof t5 && "function" != typeof t5;
1518
+ var a2 = Array.isArray;
1519
+ var u2 = (t5) => a2(t5) || "function" == typeof t5?.[Symbol.iterator];
1520
+ var d2 = "[ \n\f\r]";
1521
+ var f2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
1522
+ var v = /-->/g;
1523
+ var _ = />/g;
1524
+ var m = RegExp(`>|${d2}(?:([^\\s"'>=/]+)(${d2}*=${d2}*(?:[^
1525
+ \f\r"'\`<>=]|("|')|))|$)`, "g");
1526
+ var p2 = /'/g;
1527
+ var g = /"/g;
1528
+ var $ = /^(?:script|style|textarea|title)$/i;
1529
+ var y2 = (t5) => (i6, ...s4) => ({ _$litType$: t5, strings: i6, values: s4 });
1530
+ var x = y2(1);
1531
+ var b2 = y2(2);
1532
+ var w = Symbol.for("lit-noChange");
1533
+ var T = Symbol.for("lit-nothing");
1534
+ var A = /* @__PURE__ */ new WeakMap();
1535
+ var E = r3.createTreeWalker(r3, 129);
1536
+ function C(t5, i6) {
1537
+ if (!Array.isArray(t5) || !t5.hasOwnProperty("raw"))
1538
+ throw Error("invalid template strings array");
1539
+ return void 0 !== s2 ? s2.createHTML(i6) : i6;
1540
+ }
1541
+ var P = (t5, i6) => {
1542
+ const s4 = t5.length - 1, o6 = [];
1543
+ let r7, l3 = 2 === i6 ? "<svg>" : "", c4 = f2;
1544
+ for (let i7 = 0; i7 < s4; i7++) {
1545
+ const s5 = t5[i7];
1546
+ let a3, u3, d3 = -1, y3 = 0;
1547
+ for (; y3 < s5.length && (c4.lastIndex = y3, u3 = c4.exec(s5), null !== u3); )
1548
+ y3 = c4.lastIndex, c4 === f2 ? "!--" === u3[1] ? c4 = v : void 0 !== u3[1] ? c4 = _ : void 0 !== u3[2] ? ($.test(u3[2]) && (r7 = RegExp("</" + u3[2], "g")), c4 = m) : void 0 !== u3[3] && (c4 = m) : c4 === m ? ">" === u3[0] ? (c4 = r7 ?? f2, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c4.lastIndex - u3[2].length, a3 = u3[1], c4 = void 0 === u3[3] ? m : '"' === u3[3] ? g : p2) : c4 === g || c4 === p2 ? c4 = m : c4 === v || c4 === _ ? c4 = f2 : (c4 = m, r7 = void 0);
1549
+ const x2 = c4 === m && t5[i7 + 1].startsWith("/>") ? " " : "";
1550
+ l3 += c4 === f2 ? s5 + n3 : d3 >= 0 ? (o6.push(a3), s5.slice(0, d3) + e3 + s5.slice(d3) + h2 + x2) : s5 + h2 + (-2 === d3 ? i7 : x2);
1551
+ }
1552
+ return [C(t5, l3 + (t5[s4] || "<?>") + (2 === i6 ? "</svg>" : "")), o6];
1553
+ };
1554
+ var V = class _V {
1555
+ constructor({ strings: t5, _$litType$: s4 }, n6) {
1556
+ let r7;
1557
+ this.parts = [];
1558
+ let c4 = 0, a3 = 0;
1559
+ const u3 = t5.length - 1, d3 = this.parts, [f3, v2] = P(t5, s4);
1560
+ if (this.el = _V.createElement(f3, n6), E.currentNode = this.el.content, 2 === s4) {
1561
+ const t6 = this.el.content.firstChild;
1562
+ t6.replaceWith(...t6.childNodes);
1563
+ }
1564
+ for (; null !== (r7 = E.nextNode()) && d3.length < u3; ) {
1565
+ if (1 === r7.nodeType) {
1566
+ if (r7.hasAttributes())
1567
+ for (const t6 of r7.getAttributeNames())
1568
+ if (t6.endsWith(e3)) {
1569
+ const i6 = v2[a3++], s5 = r7.getAttribute(t6).split(h2), e7 = /([.?@])?(.*)/.exec(i6);
1570
+ d3.push({ type: 1, index: c4, name: e7[2], strings: s5, ctor: "." === e7[1] ? k : "?" === e7[1] ? H : "@" === e7[1] ? I : R }), r7.removeAttribute(t6);
1571
+ } else
1572
+ t6.startsWith(h2) && (d3.push({ type: 6, index: c4 }), r7.removeAttribute(t6));
1573
+ if ($.test(r7.tagName)) {
1574
+ const t6 = r7.textContent.split(h2), s5 = t6.length - 1;
1575
+ if (s5 > 0) {
1576
+ r7.textContent = i3 ? i3.emptyScript : "";
1577
+ for (let i6 = 0; i6 < s5; i6++)
1578
+ r7.append(t6[i6], l2()), E.nextNode(), d3.push({ type: 2, index: ++c4 });
1579
+ r7.append(t6[s5], l2());
1580
+ }
1581
+ }
1582
+ } else if (8 === r7.nodeType)
1583
+ if (r7.data === o3)
1584
+ d3.push({ type: 2, index: c4 });
1585
+ else {
1586
+ let t6 = -1;
1587
+ for (; -1 !== (t6 = r7.data.indexOf(h2, t6 + 1)); )
1588
+ d3.push({ type: 7, index: c4 }), t6 += h2.length - 1;
1589
+ }
1590
+ c4++;
1591
+ }
1592
+ }
1593
+ static createElement(t5, i6) {
1594
+ const s4 = r3.createElement("template");
1595
+ return s4.innerHTML = t5, s4;
1596
+ }
1597
+ };
1598
+ function N(t5, i6, s4 = t5, e7) {
1599
+ if (i6 === w)
1600
+ return i6;
1601
+ let h3 = void 0 !== e7 ? s4._$Co?.[e7] : s4._$Cl;
1602
+ const o6 = c3(i6) ? void 0 : i6._$litDirective$;
1603
+ return h3?.constructor !== o6 && (h3?._$AO?.(false), void 0 === o6 ? h3 = void 0 : (h3 = new o6(t5), h3._$AT(t5, s4, e7)), void 0 !== e7 ? (s4._$Co ??= [])[e7] = h3 : s4._$Cl = h3), void 0 !== h3 && (i6 = N(t5, h3._$AS(t5, i6.values), h3, e7)), i6;
1604
+ }
1605
+ var S2 = class {
1606
+ constructor(t5, i6) {
1607
+ this._$AV = [], this._$AN = void 0, this._$AD = t5, this._$AM = i6;
1608
+ }
1609
+ get parentNode() {
1610
+ return this._$AM.parentNode;
1611
+ }
1612
+ get _$AU() {
1613
+ return this._$AM._$AU;
1614
+ }
1615
+ u(t5) {
1616
+ const { el: { content: i6 }, parts: s4 } = this._$AD, e7 = (t5?.creationScope ?? r3).importNode(i6, true);
1617
+ E.currentNode = e7;
1618
+ let h3 = E.nextNode(), o6 = 0, n6 = 0, l3 = s4[0];
1619
+ for (; void 0 !== l3; ) {
1620
+ if (o6 === l3.index) {
1621
+ let i7;
1622
+ 2 === l3.type ? i7 = new M(h3, h3.nextSibling, this, t5) : 1 === l3.type ? i7 = new l3.ctor(h3, l3.name, l3.strings, this, t5) : 6 === l3.type && (i7 = new L(h3, this, t5)), this._$AV.push(i7), l3 = s4[++n6];
1623
+ }
1624
+ o6 !== l3?.index && (h3 = E.nextNode(), o6++);
1625
+ }
1626
+ return E.currentNode = r3, e7;
1627
+ }
1628
+ p(t5) {
1629
+ let i6 = 0;
1630
+ for (const s4 of this._$AV)
1631
+ void 0 !== s4 && (void 0 !== s4.strings ? (s4._$AI(t5, s4, i6), i6 += s4.strings.length - 2) : s4._$AI(t5[i6])), i6++;
1632
+ }
1633
+ };
1634
+ var M = class _M {
1635
+ get _$AU() {
1636
+ return this._$AM?._$AU ?? this._$Cv;
1637
+ }
1638
+ constructor(t5, i6, s4, e7) {
1639
+ this.type = 2, this._$AH = T, this._$AN = void 0, this._$AA = t5, this._$AB = i6, this._$AM = s4, this.options = e7, this._$Cv = e7?.isConnected ?? true;
1640
+ }
1641
+ get parentNode() {
1642
+ let t5 = this._$AA.parentNode;
1643
+ const i6 = this._$AM;
1644
+ return void 0 !== i6 && 11 === t5?.nodeType && (t5 = i6.parentNode), t5;
1645
+ }
1646
+ get startNode() {
1647
+ return this._$AA;
1648
+ }
1649
+ get endNode() {
1650
+ return this._$AB;
1651
+ }
1652
+ _$AI(t5, i6 = this) {
1653
+ t5 = N(this, t5, i6), c3(t5) ? t5 === T || null == t5 || "" === t5 ? (this._$AH !== T && this._$AR(), this._$AH = T) : t5 !== this._$AH && t5 !== w && this._(t5) : void 0 !== t5._$litType$ ? this.$(t5) : void 0 !== t5.nodeType ? this.T(t5) : u2(t5) ? this.k(t5) : this._(t5);
1654
+ }
1655
+ S(t5) {
1656
+ return this._$AA.parentNode.insertBefore(t5, this._$AB);
1657
+ }
1658
+ T(t5) {
1659
+ this._$AH !== t5 && (this._$AR(), this._$AH = this.S(t5));
1660
+ }
1661
+ _(t5) {
1662
+ this._$AH !== T && c3(this._$AH) ? this._$AA.nextSibling.data = t5 : this.T(r3.createTextNode(t5)), this._$AH = t5;
1663
+ }
1664
+ $(t5) {
1665
+ const { values: i6, _$litType$: s4 } = t5, e7 = "number" == typeof s4 ? this._$AC(t5) : (void 0 === s4.el && (s4.el = V.createElement(C(s4.h, s4.h[0]), this.options)), s4);
1666
+ if (this._$AH?._$AD === e7)
1667
+ this._$AH.p(i6);
1668
+ else {
1669
+ const t6 = new S2(e7, this), s5 = t6.u(this.options);
1670
+ t6.p(i6), this.T(s5), this._$AH = t6;
1671
+ }
1672
+ }
1673
+ _$AC(t5) {
1674
+ let i6 = A.get(t5.strings);
1675
+ return void 0 === i6 && A.set(t5.strings, i6 = new V(t5)), i6;
1676
+ }
1677
+ k(t5) {
1678
+ a2(this._$AH) || (this._$AH = [], this._$AR());
1679
+ const i6 = this._$AH;
1680
+ let s4, e7 = 0;
1681
+ for (const h3 of t5)
1682
+ e7 === i6.length ? i6.push(s4 = new _M(this.S(l2()), this.S(l2()), this, this.options)) : s4 = i6[e7], s4._$AI(h3), e7++;
1683
+ e7 < i6.length && (this._$AR(s4 && s4._$AB.nextSibling, e7), i6.length = e7);
1684
+ }
1685
+ _$AR(t5 = this._$AA.nextSibling, i6) {
1686
+ for (this._$AP?.(false, true, i6); t5 && t5 !== this._$AB; ) {
1687
+ const i7 = t5.nextSibling;
1688
+ t5.remove(), t5 = i7;
1689
+ }
1690
+ }
1691
+ setConnected(t5) {
1692
+ void 0 === this._$AM && (this._$Cv = t5, this._$AP?.(t5));
1693
+ }
1694
+ };
1695
+ var R = class {
1696
+ get tagName() {
1697
+ return this.element.tagName;
1698
+ }
1699
+ get _$AU() {
1700
+ return this._$AM._$AU;
1701
+ }
1702
+ constructor(t5, i6, s4, e7, h3) {
1703
+ this.type = 1, this._$AH = T, this._$AN = void 0, this.element = t5, this.name = i6, this._$AM = e7, this.options = h3, s4.length > 2 || "" !== s4[0] || "" !== s4[1] ? (this._$AH = Array(s4.length - 1).fill(new String()), this.strings = s4) : this._$AH = T;
1704
+ }
1705
+ _$AI(t5, i6 = this, s4, e7) {
1706
+ const h3 = this.strings;
1707
+ let o6 = false;
1708
+ if (void 0 === h3)
1709
+ t5 = N(this, t5, i6, 0), o6 = !c3(t5) || t5 !== this._$AH && t5 !== w, o6 && (this._$AH = t5);
1710
+ else {
1711
+ const e8 = t5;
1712
+ let n6, r7;
1713
+ for (t5 = h3[0], n6 = 0; n6 < h3.length - 1; n6++)
1714
+ r7 = N(this, e8[s4 + n6], i6, n6), r7 === w && (r7 = this._$AH[n6]), o6 ||= !c3(r7) || r7 !== this._$AH[n6], r7 === T ? t5 = T : t5 !== T && (t5 += (r7 ?? "") + h3[n6 + 1]), this._$AH[n6] = r7;
1715
+ }
1716
+ o6 && !e7 && this.j(t5);
1717
+ }
1718
+ j(t5) {
1719
+ t5 === T ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t5 ?? "");
1720
+ }
1721
+ };
1722
+ var k = class extends R {
1723
+ constructor() {
1724
+ super(...arguments), this.type = 3;
1725
+ }
1726
+ j(t5) {
1727
+ this.element[this.name] = t5 === T ? void 0 : t5;
1728
+ }
1729
+ };
1730
+ var H = class extends R {
1731
+ constructor() {
1732
+ super(...arguments), this.type = 4;
1733
+ }
1734
+ j(t5) {
1735
+ this.element.toggleAttribute(this.name, !!t5 && t5 !== T);
1736
+ }
1737
+ };
1738
+ var I = class extends R {
1739
+ constructor(t5, i6, s4, e7, h3) {
1740
+ super(t5, i6, s4, e7, h3), this.type = 5;
1741
+ }
1742
+ _$AI(t5, i6 = this) {
1743
+ if ((t5 = N(this, t5, i6, 0) ?? T) === w)
1744
+ return;
1745
+ const s4 = this._$AH, e7 = t5 === T && s4 !== T || t5.capture !== s4.capture || t5.once !== s4.once || t5.passive !== s4.passive, h3 = t5 !== T && (s4 === T || e7);
1746
+ e7 && this.element.removeEventListener(this.name, this, s4), h3 && this.element.addEventListener(this.name, this, t5), this._$AH = t5;
1747
+ }
1748
+ handleEvent(t5) {
1749
+ "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t5) : this._$AH.handleEvent(t5);
1750
+ }
1751
+ };
1752
+ var L = class {
1753
+ constructor(t5, i6, s4) {
1754
+ this.element = t5, this.type = 6, this._$AN = void 0, this._$AM = i6, this.options = s4;
1755
+ }
1756
+ get _$AU() {
1757
+ return this._$AM._$AU;
1758
+ }
1759
+ _$AI(t5) {
1760
+ N(this, t5);
1761
+ }
1762
+ };
1763
+ var Z = t2.litHtmlPolyfillSupport;
1764
+ Z?.(V, M), (t2.litHtmlVersions ??= []).push("3.1.2");
1765
+ var j = (t5, i6, s4) => {
1766
+ const e7 = s4?.renderBefore ?? i6;
1767
+ let h3 = e7._$litPart$;
1768
+ if (void 0 === h3) {
1769
+ const t6 = s4?.renderBefore ?? null;
1770
+ e7._$litPart$ = h3 = new M(i6.insertBefore(l2(), t6), t6, void 0, s4 ?? {});
1771
+ }
1772
+ return h3._$AI(t5), h3;
1773
+ };
1774
+
1775
+ // node_modules/lit-element/lit-element.js
1776
+ var s3 = class extends b {
1777
+ constructor() {
1778
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1779
+ }
1780
+ createRenderRoot() {
1781
+ const t5 = super.createRenderRoot();
1782
+ return this.renderOptions.renderBefore ??= t5.firstChild, t5;
1783
+ }
1784
+ update(t5) {
1785
+ const i6 = this.render();
1786
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t5), this._$Do = j(i6, this.renderRoot, this.renderOptions);
1787
+ }
1788
+ connectedCallback() {
1789
+ super.connectedCallback(), this._$Do?.setConnected(true);
1790
+ }
1791
+ disconnectedCallback() {
1792
+ super.disconnectedCallback(), this._$Do?.setConnected(false);
1793
+ }
1794
+ render() {
1795
+ return w;
1796
+ }
1797
+ };
1798
+ s3._$litElement$ = true, s3["finalized", "finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: s3 });
1799
+ var r4 = globalThis.litElementPolyfillSupport;
1800
+ r4?.({ LitElement: s3 });
1801
+ (globalThis.litElementVersions ??= []).push("4.0.4");
1802
+
1803
+ // node_modules/@lit/reactive-element/decorators/custom-element.js
1804
+ var t3 = (t5) => (e7, o6) => {
1805
+ void 0 !== o6 ? o6.addInitializer(() => {
1806
+ customElements.define(t5, e7);
1807
+ }) : customElements.define(t5, e7);
1808
+ };
1809
+
1810
+ // node_modules/@lit/reactive-element/decorators/property.js
1811
+ var o4 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
1812
+ var r5 = (t5 = o4, e7, r7) => {
1813
+ const { kind: n6, metadata: i6 } = r7;
1814
+ let s4 = globalThis.litPropertyMetadata.get(i6);
1815
+ if (void 0 === s4 && globalThis.litPropertyMetadata.set(i6, s4 = /* @__PURE__ */ new Map()), s4.set(r7.name, t5), "accessor" === n6) {
1816
+ const { name: o6 } = r7;
1817
+ return { set(r8) {
1818
+ const n7 = e7.get.call(this);
1819
+ e7.set.call(this, r8), this.requestUpdate(o6, n7, t5);
1820
+ }, init(e8) {
1821
+ return void 0 !== e8 && this.P(o6, void 0, t5), e8;
1822
+ } };
1823
+ }
1824
+ if ("setter" === n6) {
1825
+ const { name: o6 } = r7;
1826
+ return function(r8) {
1827
+ const n7 = this[o6];
1828
+ e7.call(this, r8), this.requestUpdate(o6, n7, t5);
1829
+ };
1830
+ }
1831
+ throw Error("Unsupported decorator location: " + n6);
1832
+ };
1833
+ function n4(t5) {
1834
+ return (e7, o6) => "object" == typeof o6 ? r5(t5, e7, o6) : ((t6, e8, o7) => {
1835
+ const r7 = e8.hasOwnProperty(o7);
1836
+ return e8.constructor.createProperty(o7, r7 ? { ...t6, wrapped: true } : t6), r7 ? Object.getOwnPropertyDescriptor(e8, o7) : void 0;
1837
+ })(t5, e7, o6);
1838
+ }
1839
+
1840
+ // node_modules/@lit/reactive-element/decorators/state.js
1841
+ function r6(r7) {
1842
+ return n4({ ...r7, state: true, attribute: false });
1843
+ }
1844
+
1845
+ // node_modules/@lit/reactive-element/decorators/base.js
1846
+ var e4 = (e7, t5, c4) => (c4.configurable = true, c4.enumerable = true, Reflect.decorate && "object" != typeof t5 && Object.defineProperty(e7, t5, c4), c4);
1847
+
1848
+ // node_modules/@lit/reactive-element/decorators/query.js
1849
+ function e5(e7, r7) {
1850
+ return (n6, s4, i6) => {
1851
+ const o6 = (t5) => t5.renderRoot?.querySelector(e7) ?? null;
1852
+ if (r7) {
1853
+ const { get: e8, set: r8 } = "object" == typeof s4 ? n6 : i6 ?? (() => {
1854
+ const t5 = Symbol();
1855
+ return { get() {
1856
+ return this[t5];
1857
+ }, set(e9) {
1858
+ this[t5] = e9;
1859
+ } };
1860
+ })();
1861
+ return e4(n6, s4, { get() {
1862
+ let t5 = e8.call(this);
1863
+ return void 0 === t5 && (t5 = o6(this), (null !== t5 || this.hasUpdated) && r8.call(this, t5)), t5;
1864
+ } });
1865
+ }
1866
+ return e4(n6, s4, { get() {
1867
+ return o6(this);
1868
+ } });
1869
+ };
1870
+ }
1871
+
1872
+ // node_modules/lit-html/directive.js
1873
+ var t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
1874
+ var e6 = (t5) => (...e7) => ({ _$litDirective$: t5, values: e7 });
1875
+ var i4 = class {
1876
+ constructor(t5) {
1877
+ }
1878
+ get _$AU() {
1879
+ return this._$AM._$AU;
1880
+ }
1881
+ _$AT(t5, e7, i6) {
1882
+ this._$Ct = t5, this._$AM = e7, this._$Ci = i6;
1883
+ }
1884
+ _$AS(t5, e7) {
1885
+ return this.update(t5, e7);
1886
+ }
1887
+ update(t5, e7) {
1888
+ return this.render(...e7);
1889
+ }
1890
+ };
1891
+
1892
+ // node_modules/lit-html/directives/style-map.js
1893
+ var n5 = "important";
1894
+ var i5 = " !" + n5;
1895
+ var o5 = e6(class extends i4 {
1896
+ constructor(t5) {
1897
+ if (super(t5), t5.type !== t4.ATTRIBUTE || "style" !== t5.name || t5.strings?.length > 2)
1898
+ throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1899
+ }
1900
+ render(t5) {
1901
+ return Object.keys(t5).reduce((e7, r7) => {
1902
+ const s4 = t5[r7];
1903
+ return null == s4 ? e7 : e7 + `${r7 = r7.includes("-") ? r7 : r7.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s4};`;
1904
+ }, "");
1905
+ }
1906
+ update(e7, [r7]) {
1907
+ const { style: s4 } = e7.element;
1908
+ if (void 0 === this.ft)
1909
+ return this.ft = new Set(Object.keys(r7)), this.render(r7);
1910
+ for (const t5 of this.ft)
1911
+ null == r7[t5] && (this.ft.delete(t5), t5.includes("-") ? s4.removeProperty(t5) : s4[t5] = null);
1912
+ for (const t5 in r7) {
1913
+ const e8 = r7[t5];
1914
+ if (null != e8) {
1915
+ this.ft.add(t5);
1916
+ const r8 = "string" == typeof e8 && e8.endsWith(i5);
1917
+ t5.includes("-") || r8 ? s4.setProperty(t5, r8 ? e8.slice(0, -11) : e8, r8 ? n5 : "") : s4[t5] = e8;
1918
+ }
1919
+ }
1920
+ return w;
1921
+ }
1922
+ });
1923
+
1924
+ // libs/embed-libs/embed/package.json
1925
+ var version = "5.0.9";
1926
+
1927
+ // libs/embed-libs/embed/src/lib/luzmo-service.ts
1928
+ var LuzmoService = class {
1929
+ constructor() {
1930
+ this._components = [];
1931
+ }
1932
+ };
1933
+ var luzmo_service_default = new LuzmoService();
1934
+
1935
+ // libs/embed-libs/embed/src/lib/helper/event-bus-handler.ts
1936
+ var _setEventHandler = () => {
1937
+ if (typeof window.__luzmoMessageHandler === "function") {
1938
+ return;
1939
+ }
1940
+ window.__luzmoMessageHandler = (event) => {
1941
+ const dashboardComponent = luzmo_service_default._components.find(
1942
+ (c4) => event.data.name === c4._iframeId
1943
+ );
1944
+ if (!dashboardComponent) {
1945
+ return;
1946
+ }
1947
+ switch (event.data?.type) {
1948
+ case "load": {
1949
+ dashboardComponent.dispatchEvent(
1950
+ new CustomEvent("load", { detail: { data: event.data } })
1951
+ );
1952
+ if (dashboardComponent._loadTimeoutHandle) {
1953
+ clearTimeout(dashboardComponent._loadTimeoutHandle);
1954
+ dashboardComponent._loadTimeoutHandle = void 0;
1955
+ }
1956
+ dashboardComponent.iframeLoaded = true;
1957
+ dashboardComponent.dimensions = event.data.dimensions;
1958
+ dashboardComponent._calculateDimAfterDashboardLoaded();
1959
+ break;
1960
+ }
1961
+ case "error": {
1962
+ dashboardComponent.dashboardError = true;
1963
+ if (dashboardComponent._loadTimeoutHandle) {
1964
+ clearTimeout(dashboardComponent._loadTimeoutHandle);
1965
+ dashboardComponent._loadTimeoutHandle = void 0;
1966
+ }
1967
+ dashboardComponent.iframeLoaded = true;
1968
+ dashboardComponent._displayError();
1969
+ break;
1970
+ }
1971
+ case "data": {
1972
+ resolvePromise(
1973
+ dashboardComponent,
1974
+ event.data.requestId,
1975
+ event.data.data
1976
+ );
1977
+ break;
1978
+ }
1979
+ case "filters": {
1980
+ resolvePromise(
1981
+ dashboardComponent,
1982
+ event.data.requestId,
1983
+ event.data.filters
1984
+ );
1985
+ break;
1986
+ }
1987
+ case "getAccessibleDashboards": {
1988
+ resolvePromise(
1989
+ dashboardComponent,
1990
+ event.data.requestId,
1991
+ event.data.accessibleDashboards
1992
+ );
1993
+ break;
1994
+ }
1995
+ case "dashboardAction": {
1996
+ dashboardComponent.dispatchEvent(
1997
+ new CustomEvent("dashboardAction", { detail: { data: event.data } })
1998
+ );
1999
+ break;
2000
+ }
2001
+ case "export": {
2002
+ if (event.data.error) {
2003
+ rejectPromise(
2004
+ dashboardComponent,
2005
+ event.data.requestId,
2006
+ event.data
2007
+ );
2008
+ } else {
2009
+ dashboardComponent.dispatchEvent(
2010
+ new CustomEvent("exported", { detail: { data: event.data } })
2011
+ );
2012
+ resolvePromise(
2013
+ dashboardComponent,
2014
+ event.data.requestId,
2015
+ event.data
2016
+ );
2017
+ }
2018
+ break;
2019
+ }
2020
+ case "changedFilters": {
2021
+ dashboardComponent.dispatchEvent(
2022
+ new CustomEvent("changedFilters", { detail: { data: event.data } })
2023
+ );
2024
+ break;
2025
+ }
2026
+ case "customEvent": {
2027
+ dashboardComponent.dispatchEvent(
2028
+ new CustomEvent("customEvent", { detail: { data: event.data } })
2029
+ );
2030
+ break;
2031
+ }
2032
+ case "chartsRendered":
2033
+ case "itemsRendered": {
2034
+ event.data.type = "itemsRendered";
2035
+ dashboardComponent.dispatchEvent(
2036
+ new CustomEvent("itemsRendered", { detail: { data: event.data } })
2037
+ );
2038
+ break;
2039
+ }
2040
+ case "setEditMode": {
2041
+ if (event.data.error) {
2042
+ rejectPromise(
2043
+ dashboardComponent,
2044
+ event.data.requestId,
2045
+ event.data
2046
+ );
2047
+ } else {
2048
+ resolvePromise(
2049
+ dashboardComponent,
2050
+ event.data.requestId,
2051
+ event.data
2052
+ );
2053
+ dashboardComponent.params.editMode = event.data.editMode;
2054
+ dashboardComponent._containerStyle = containerStyles(dashboardComponent);
2055
+ if (dashboardComponent.dimensions) {
2056
+ _setCalculatedDimensions(dashboardComponent);
2057
+ }
2058
+ }
2059
+ break;
2060
+ }
2061
+ case "setFilters": {
2062
+ event.data.error ? rejectPromise(
2063
+ dashboardComponent,
2064
+ event.data.requestId,
2065
+ event.data
2066
+ ) : resolvePromise(
2067
+ dashboardComponent,
2068
+ event.data.requestId,
2069
+ event.data
2070
+ );
2071
+ break;
2072
+ }
2073
+ case "setPreview": {
2074
+ event.data.error ? rejectPromise(
2075
+ dashboardComponent,
2076
+ event.data.requestId,
2077
+ event.data
2078
+ ) : resolvePromise(
2079
+ dashboardComponent,
2080
+ event.data.requestId,
2081
+ event.data
2082
+ );
2083
+ break;
2084
+ }
2085
+ }
2086
+ };
2087
+ window.addEventListener("message", window.__luzmoMessageHandler, false);
2088
+ };
2089
+
2090
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-styles.ts
2091
+ var dashboardStyles = i`
8
2092
  @-webkit-keyframes spin {
9
2093
  0% {
10
2094
  -webkit-transform: rotate(0deg);
@@ -37,6 +2121,11 @@ Make sure to test your application with a production build as repeat registratio
37
2121
  border: 0;
38
2122
  }
39
2123
 
2124
+ .luzmo-embed-container-ede {
2125
+ width: 100%;
2126
+ height: 100%;
2127
+ }
2128
+
40
2129
  .luzmo-container-loader {
41
2130
  width: 100%;
42
2131
  position: relative;
@@ -104,29 +2193,426 @@ Make sure to test your application with a production build as repeat registratio
104
2193
  position: absolute;
105
2194
  transition-duration: 0.3s;
106
2195
  }
107
- `;var c=class extends ${constructor(r){super();this.language="auto";this.screenMode="auto";this.switchScreenModeOnResize=!0;this.editMode="view";this.experimental=!1;this.iframeStyle={};this._containerStyle={};this._loaderStyle={};this._lcStyle={};this._loadingCircleStyle={};this._containerLoaderStyle={};this._loaderMsg="";this._itemEmbedding=!1;this.browserError=!1;this.browserErrorMsg="";this.dashboardError=!1;this.browserNotSupported=[];this.VERSION=$t+"-wc-luzmo";this.isLibraryLoaded=!1;this.attributesMap={dashboardId:"dashboard-id",dashboardSlug:"dashboard-slug",itemId:"item-id",language:"language",qeVersion:"qe-version",screenMode:"screen-mode",switchScreenModeOnResize:"switch-screen-mode-on-resize",authKey:"auth-key",authToken:"auth-token",editMode:"edit-mode",mainColor:"main-color",accentColor:"accent-color",loaderBackground:"loader-background",loaderFontColor:"loader-font-color",loaderSpinnerColor:"loader-spinner-color",loaderSpinnerBackground:"loader-spinner-background",appServer:"app-server",apiHost:"api-host",itemDimensions:"item-dimensions",timezoneId:"timezone-id"};this.loaderSize=32;this.borderWidth=3;this.minHeight=400;this._containerId=y(),this._iframeId=`luzmo-dashboard-${this._containerId}`,this.iframeLoaded=!1,this.promises={},this.setInputParameters(r),this.params=this._setOptions(),this._onResize=()=>{if(this.shadowRoot?.querySelector(".dashboard-container")){if(this.containerWidth=this.container.clientWidth,this.params.switchScreenModeOnResize&&this.params.screenMode==="auto")for(let i of Z)i.width[0]<=window.innerWidth&&window.innerWidth<=i.width[1]&&(this.currentScreenMode=i.mode);this.iframeLoaded&&this._calculateDimAfterDashboardLoaded()}},this._resizeObserver=new ResizeObserver(i=>{window.requestAnimationFrame(()=>{!Array.isArray(i)||i.length===0||this._onResize()})})}loadLibrary(r){return k[r]?Promise.resolve(k[r].module):(k[r]={url:r?.startsWith("http://localhost")?`${T(r)}/remoteEntry.mjs`:`${T(r)}/dashboard-app/remoteEntry.mjs`,format:"esm",from:"vite",module:void 0},Qe(r,"./DashboardApp").then(i=>{let s=Ze(i,!0);return k[r].module=s,s}))}setInputParameters(r){if(!r)return;let i=["dashboardId","dashboardSlug","itemId","language","qeVersion","screenMode","switchScreenModeOnResize","accentColor","mainColor","authToken","authKey","editMode","loaderBackground","loaderFontColor","loaderSpinnerColor","loaderSpinnerBackground","timezoneId","itemDimensions","apiHost"];for(let s of i){let o=r[s];o&&(this[s]=o)}r.experimental&&(this.experimental=r.experimental),r.appServer&&(this.appServer=z(r.appServer))}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect();for(let r of Object.keys(this.promises))this.promises[r].reject(new Error("Dashboard component was removed"))}firstUpdated(){this._loaderMsg=he(this)?.loadingMsg,this._loaderStyles(),Y._components.push(this),this.initComponent()}initComponent(){this.params=this._setOptions(),this.getIsViewMode()?this.loadLibrary(this.params.appServer).then(async()=>{this.isLibraryLoaded=!0,await this.updateComplete;let r=this.renderRoot.querySelector("dashboard-component");this.dashboardReference=r.cloneNode(!0),r.replaceWith(this.dashboardReference),this.dashboardReference.addEventListener("load",i=>{setTimeout(()=>{this.containerWidth=this.dashboardReference.offsetWidth,this.dimensions=i.detail.dimensions,N(this),this.dispatchEvent(new CustomEvent("load",i.detail))})}),this.dashboardReference.addEventListener("itemsRendered",i=>this.dispatchEvent(new CustomEvent("itemsRendered",i.detail))),this.dashboardReference.addEventListener("customEvent",i=>this.dispatchEvent(new CustomEvent("customEvent",i.detail))),this.dashboardReference.addEventListener("changedFilters",i=>this.dispatchEvent(new CustomEvent("changedFilters",i.detail))),this.dashboardReference.addEventListener("dashboardAction",i=>this.dispatchEvent(new CustomEvent("dashboardAction",i.detail))),this.dashboardReference.addEventListener("export",i=>this.dispatchEvent(new CustomEvent("exported",i.detail))),this.setAllAttributes()}):(this.containerWidth=this.container?.clientWidth,pe(this),Te(this),this._setupLoader(),this.params.error||(this._loaderStyles(),It(),this._iframeUrl=le(this),this.iframe?.setAttribute("src",this._iframeUrl),this.iframeStyle=ce(this)),this.container&&this._resizeObserver.observe(this.container))}setAllAttributes(){if(this.dashboardReference)for(let r in this.attributesMap)!["authKey","authToken","apiHost","itemDimensions"].includes(r)&&this.params[r]&&this.dashboardReference.setAttribute(this.attributesMap[r],this.params[r]),this.params.itemDimensions&&this.dashboardReference.setAttribute("item-dimensions",JSON.stringify(this.params.itemDimensions)),this.params.apiHost&&this.dashboardReference.setAttribute("api-host",T(this.params.apiHost)),this.params.key&&this.dashboardReference.setAttribute("auth-key",this.params.key),this.params.token&&this.dashboardReference.setAttribute("auth-token",this.params.token)}updated(r){let i=new Set(["dashboardId","dashboardSlug","itemId","language","qeVersion","editMode","screenMode","switchScreenModeOnResize","authToken","authKey","appServer","timezoneId","itemDimensions"]);if(this.getIsViewMode()){if(this.dashboardReference){for(let[s]of r.entries())if(s==="appSever")this.loadLibrary(r[s]).then(async()=>{this.isLibraryLoaded=!0,await this.updateComplete,this.dashboardReference=this.renderRoot.querySelector("dashboard-component"),this.setAllAttributes()});else if(this.attributesMap[s]){let o=this.attributesMap[s]??s,a=typeof this[s]=="object"?JSON.stringify(this[s]):this[s]?.toString()||this[s];this.dashboardReference.setAttribute(o,a)}}}else for(let[s]of r.entries())i.has(s)&&s!=="editMode"?(this.iframeLoaded=!1,this._loadTimeoutHandle&&clearTimeout(this._loadTimeoutHandle),this._loadTimeoutHandle=setTimeout(()=>{console.error("Failed to load dashboard, appServer is likely down or unreachable.")},15*1e3),this.params=this._setOptions(),pe(this),this._setupLoader(),this._loaderStyles(),this._iframeUrl=le(this),this.iframe&&this._updateIframeUrl(),this.iframeStyle=ce(this)):i.has(s)&&s==="editMode"&&(this.iframeLoaded&&this.setEditMode(this.editMode),this.params=this._setOptions())}_setOptions(){let r={dashboardId:this.dashboardId,dashboardSlug:this.dashboardSlug};return this.itemId?(r.itemId=this.itemId,this._itemEmbedding=!0):this._itemEmbedding=!1,this.language&&(r.language=this.language),this.qeVersion&&(r.qeVersion=this.qeVersion),this.screenMode&&(r.screenMode=this.screenMode),r.switchScreenModeOnResize=this.switchScreenModeOnResize,this.authToken&&(r.token=this.authToken),this.authKey&&(r.key=this.authKey),this.editMode&&(r.editMode=this.editMode),this.mainColor&&(r.mainColor=this.mainColor),this.accentColor&&(r.accentColor=this.accentColor),this.loaderBackground&&(r.loaderBackground=this.loaderBackground),this.loaderFontColor&&(r.loaderFontColor=this.loaderFontColor),this.loaderSpinnerColor&&(r.loaderSpinnerColor=this.loaderSpinnerColor),this.loaderSpinnerBackground&&(r.loaderSpinnerBackground=this.loaderSpinnerBackground),this.timezoneId&&(r.timezoneId=this.timezoneId),this.itemDimensions&&(r.itemDimensions=this.itemDimensions),this.appServer?(this.appServer=this.getIsViewMode()?T(this.appServer):z(this.appServer),r.appServer=this.appServer):(this.appServer=z(w.appServer),r.appServer=this.appServer),this.apiHost?(this.apiHost=this.getIsViewMode()?T(this.apiHost):z(this.apiHost),r.apiHost=this.apiHost):(this.apiHost=this.appServer.includes("luzmo.com")?this.appServer.replace("app","api"):this.appServer,r.apiHost=this.apiHost),r}_updateIframeUrl(){Ve(this.iframe,this._iframeUrl)}_setupLoader(){let r=he(this);this._loaderMsg=r.loadingMsg,r.errorMsg&&(this.browserError=!0,this.browserErrorMsg=r.errorMsg,this._displayError())}_displayError(){this.dashboardError&&(this._loaderStyles(),this.iframeStyle.opacity=1),this.browserError&&(this._containerStyle.display="none")}_calculateDimAfterDashboardLoaded(){this.dashboardError=!1,this._loaderStyles(),N(this)}_loaderStyles(){this._containerStyle=ee(this),this._loaderStyle=Ne(this),this._loadingCircleStyle=Ue(this),this._containerLoaderStyle=Fe(this),this._lcStyle=je(this)}static get styles(){return[At]}render(){let r=_``,i=_`
2196
+ `;
2197
+
2198
+ // libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
2199
+ var LuzmoDashboard = class extends s3 {
2200
+ constructor(inputParameters) {
2201
+ super();
2202
+ this.language = "auto";
2203
+ this.screenMode = "auto";
2204
+ this.switchScreenModeOnResize = true;
2205
+ this.editMode = "view";
2206
+ this.experimental = false;
2207
+ this.iframeStyle = {};
2208
+ this._containerStyle = {};
2209
+ this._loaderStyle = {};
2210
+ this._lcStyle = {};
2211
+ this._loadingCircleStyle = {};
2212
+ this._containerLoaderStyle = {};
2213
+ this._loaderMsg = "";
2214
+ this._itemEmbedding = false;
2215
+ this.browserError = false;
2216
+ this.browserErrorMsg = "";
2217
+ this.dashboardError = false;
2218
+ this.browserNotSupported = [];
2219
+ this.VERSION = version + "-wc-luzmo";
2220
+ this.isLibraryLoaded = false;
2221
+ this.attributesMap = {
2222
+ dashboardId: "dashboard-id",
2223
+ dashboardSlug: "dashboard-slug",
2224
+ itemId: "item-id",
2225
+ language: "language",
2226
+ qeVersion: "qe-version",
2227
+ screenMode: "screen-mode",
2228
+ switchScreenModeOnResize: "switch-screen-mode-on-resize",
2229
+ authKey: "auth-key",
2230
+ authToken: "auth-token",
2231
+ editMode: "edit-mode",
2232
+ mainColor: "main-color",
2233
+ accentColor: "accent-color",
2234
+ loaderBackground: "loader-background",
2235
+ loaderFontColor: "loader-font-color",
2236
+ loaderSpinnerColor: "loader-spinner-color",
2237
+ loaderSpinnerBackground: "loader-spinner-background",
2238
+ appServer: "app-server",
2239
+ apiHost: "api-host",
2240
+ itemDimensions: "item-dimensions",
2241
+ timezoneId: "timezone-id"
2242
+ };
2243
+ this.loaderSize = 32;
2244
+ this.borderWidth = 3;
2245
+ this.minHeight = 400;
2246
+ this._containerId = uuidv4();
2247
+ this._iframeId = `luzmo-dashboard-${this._containerId}`;
2248
+ this.iframeLoaded = false;
2249
+ this.promises = {};
2250
+ this.setInputParameters(inputParameters);
2251
+ this.params = this._setOptions();
2252
+ this._onResize = () => {
2253
+ if (this.shadowRoot?.querySelector(".dashboard-container")) {
2254
+ this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
2255
+ if (this.params.switchScreenModeOnResize && this.params.screenMode === "auto") {
2256
+ for (const d3 of EXTENTS) {
2257
+ if (d3.width[0] <= window.innerWidth && window.innerWidth <= d3.width[1]) {
2258
+ this.currentScreenMode = d3.mode;
2259
+ }
2260
+ }
2261
+ }
2262
+ if (this.iframeLoaded) {
2263
+ this._calculateDimAfterDashboardLoaded();
2264
+ } else {
2265
+ if (this.dimensions) {
2266
+ this.containerWidth = this.luzmoEmbedContainer.offsetWidth;
2267
+ _setCalculatedDimensions(this);
2268
+ }
2269
+ }
2270
+ }
2271
+ };
2272
+ this._resizeObserver = new ResizeObserver((entries) => {
2273
+ window.requestAnimationFrame(() => {
2274
+ if (!Array.isArray(entries) || entries.length === 0) {
2275
+ return;
2276
+ }
2277
+ this._onResize();
2278
+ });
2279
+ });
2280
+ }
2281
+ loadLibrary(appServer) {
2282
+ if (remotesMap[appServer]) {
2283
+ return Promise.resolve(remotesMap[appServer].module);
2284
+ }
2285
+ remotesMap[appServer] = { url: appServer?.startsWith("http://localhost") ? `${removeTrailingSlash(appServer)}/remoteEntry.mjs` : `${removeTrailingSlash(appServer)}/dashboard-app/remoteEntry.mjs`, format: "esm", from: "vite", module: void 0 };
2286
+ return __federationMethodGetRemote(appServer, "./DashboardApp").then((module2) => {
2287
+ const wrappedModule = __federationMethodWrapDefault(module2, true);
2288
+ remotesMap[appServer].module = wrappedModule;
2289
+ return wrappedModule;
2290
+ });
2291
+ }
2292
+ setInputParameters(inputParameters) {
2293
+ if (!inputParameters) {
2294
+ return;
2295
+ }
2296
+ const params = [
2297
+ "dashboardId",
2298
+ "dashboardSlug",
2299
+ "itemId",
2300
+ "language",
2301
+ "qeVersion",
2302
+ "screenMode",
2303
+ "switchScreenModeOnResize",
2304
+ "accentColor",
2305
+ "mainColor",
2306
+ "authToken",
2307
+ "authKey",
2308
+ "editMode",
2309
+ "loaderBackground",
2310
+ "loaderFontColor",
2311
+ "loaderSpinnerColor",
2312
+ "loaderSpinnerBackground",
2313
+ "timezoneId",
2314
+ "itemDimensions",
2315
+ "apiHost"
2316
+ ];
2317
+ for (const key of params) {
2318
+ const value = inputParameters[key];
2319
+ if (value) {
2320
+ this[key] = value;
2321
+ }
2322
+ }
2323
+ if (inputParameters.experimental) {
2324
+ this.experimental = inputParameters.experimental;
2325
+ }
2326
+ if (inputParameters.appServer) {
2327
+ this.appServer = addTrailingSlash(inputParameters.appServer);
2328
+ }
2329
+ }
2330
+ // Set resize event listener
2331
+ connectedCallback() {
2332
+ super.connectedCallback();
2333
+ }
2334
+ // Set resize event listener
2335
+ disconnectedCallback() {
2336
+ super.disconnectedCallback();
2337
+ this._resizeObserver.disconnect();
2338
+ for (const promiseKey of Object.keys(this.promises)) {
2339
+ this.promises[promiseKey].reject(
2340
+ new Error("Dashboard component was removed")
2341
+ );
2342
+ }
2343
+ }
2344
+ firstUpdated() {
2345
+ this._loaderMsg = getLoader(this)?.loadingMsg;
2346
+ this._loaderStyles();
2347
+ luzmo_service_default._components.push(this);
2348
+ this.initComponent();
2349
+ if (this.luzmoEmbedContainer) {
2350
+ this._resizeObserver.observe(this.luzmoEmbedContainer);
2351
+ }
2352
+ }
2353
+ initComponent() {
2354
+ this.params = this._setOptions();
2355
+ if (this.getIsViewMode()) {
2356
+ this.loadLibrary(this.params.appServer).then(async () => {
2357
+ this.isLibraryLoaded = true;
2358
+ await this.updateComplete;
2359
+ const oldReference = this.renderRoot.querySelector("dashboard-component");
2360
+ this.dashboardReference = oldReference.cloneNode(true);
2361
+ oldReference.replaceWith(this.dashboardReference);
2362
+ this.dashboardReference.addEventListener("load", (payload) => {
2363
+ setTimeout(() => {
2364
+ this.containerWidth = this.dashboardReference.offsetWidth;
2365
+ this.dimensions = payload.detail.dimensions;
2366
+ _setCalculatedDimensions(this);
2367
+ });
2368
+ this.dispatchEvent(new CustomEvent("load", payload));
2369
+ });
2370
+ this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
2371
+ this.dashboardReference.addEventListener("customEvent", (payload) => this.dispatchEvent(new CustomEvent("customEvent", payload)));
2372
+ this.dashboardReference.addEventListener("changedFilters", (payload) => this.dispatchEvent(new CustomEvent("changedFilters", payload)));
2373
+ this.dashboardReference.addEventListener("dashboardAction", (payload) => this.dispatchEvent(new CustomEvent("dashboardAction", payload)));
2374
+ this.dashboardReference.addEventListener("export", (payload) => this.dispatchEvent(new CustomEvent("exported", payload)));
2375
+ this.setAllAttributes();
2376
+ });
2377
+ } else {
2378
+ this.containerWidth = this.container?.clientWidth;
2379
+ _extendAndValidate(this);
2380
+ _browserCheck(this);
2381
+ this._setupLoader();
2382
+ if (!this.params.error) {
2383
+ this._loaderStyles();
2384
+ _setEventHandler();
2385
+ this._iframeUrl = createIframeUrl(this);
2386
+ this.iframe?.setAttribute("src", this._iframeUrl);
2387
+ this.iframeStyle = calculateIframeStyles(this);
2388
+ }
2389
+ }
2390
+ }
2391
+ setAllAttributes() {
2392
+ if (this.dashboardReference) {
2393
+ for (const key in this.attributesMap) {
2394
+ if (!["authKey", "authToken", "apiHost", "itemDimensions"].includes(key) && this.params[key]) {
2395
+ this.dashboardReference.setAttribute(this.attributesMap[key], this.params[key]);
2396
+ }
2397
+ if (this.params.itemDimensions) {
2398
+ this.dashboardReference.setAttribute("item-dimensions", JSON.stringify(this.params.itemDimensions));
2399
+ }
2400
+ if (this.params.apiHost) {
2401
+ this.dashboardReference.setAttribute("api-host", removeTrailingSlash(this.params.apiHost));
2402
+ }
2403
+ if (this.params.key) {
2404
+ this.dashboardReference.setAttribute("auth-key", this.params.key);
2405
+ }
2406
+ if (this.params.token) {
2407
+ this.dashboardReference.setAttribute("auth-token", this.params.token);
2408
+ }
2409
+ }
2410
+ }
2411
+ }
2412
+ // Reload dashboard when triggerproperty changes
2413
+ updated(changedProperties) {
2414
+ const triggerProperties = /* @__PURE__ */ new Set([
2415
+ "dashboardId",
2416
+ "dashboardSlug",
2417
+ "itemId",
2418
+ "language",
2419
+ "qeVersion",
2420
+ "editMode",
2421
+ "screenMode",
2422
+ "switchScreenModeOnResize",
2423
+ "authToken",
2424
+ "authKey",
2425
+ "appServer",
2426
+ "timezoneId",
2427
+ "itemDimensions"
2428
+ ]);
2429
+ if (this.getIsViewMode()) {
2430
+ if (this.dashboardReference) {
2431
+ for (const [propertyName] of changedProperties.entries()) {
2432
+ if (propertyName === "appSever") {
2433
+ this.loadLibrary(changedProperties[propertyName]).then(async () => {
2434
+ this.isLibraryLoaded = true;
2435
+ await this.updateComplete;
2436
+ this.dashboardReference = this.renderRoot.querySelector("dashboard-component");
2437
+ this.setAllAttributes();
2438
+ });
2439
+ } else if (this.attributesMap[propertyName]) {
2440
+ const mappedAttributeName = this.attributesMap[propertyName] ?? propertyName;
2441
+ const attributeValue = typeof this[propertyName] === "object" ? JSON.stringify(this[propertyName]) : this[propertyName]?.toString() || this[propertyName];
2442
+ this.dashboardReference.setAttribute(mappedAttributeName, attributeValue);
2443
+ }
2444
+ }
2445
+ }
2446
+ } else {
2447
+ for (const [propertyName] of changedProperties.entries()) {
2448
+ if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
2449
+ this.iframeLoaded = false;
2450
+ if (this._loadTimeoutHandle) {
2451
+ clearTimeout(this._loadTimeoutHandle);
2452
+ }
2453
+ this._loadTimeoutHandle = setTimeout(() => {
2454
+ console.error(
2455
+ "Failed to load dashboard, appServer is likely down or unreachable."
2456
+ );
2457
+ }, 15 * 1e3);
2458
+ this.params = this._setOptions();
2459
+ _extendAndValidate(this);
2460
+ this._setupLoader();
2461
+ this._loaderStyles();
2462
+ this._iframeUrl = createIframeUrl(this);
2463
+ if (this.iframe) {
2464
+ this._updateIframeUrl();
2465
+ }
2466
+ this.iframeStyle = calculateIframeStyles(this);
2467
+ } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
2468
+ if (this.iframeLoaded) {
2469
+ this.setEditMode(this.editMode);
2470
+ }
2471
+ this.params = this._setOptions();
2472
+ }
2473
+ }
2474
+ }
2475
+ }
2476
+ // Set params
2477
+ _setOptions() {
2478
+ const defaultParameters = {
2479
+ dashboardId: this.dashboardId,
2480
+ dashboardSlug: this.dashboardSlug
2481
+ };
2482
+ if (this.itemId) {
2483
+ defaultParameters.itemId = this.itemId;
2484
+ this._itemEmbedding = true;
2485
+ } else {
2486
+ this._itemEmbedding = false;
2487
+ }
2488
+ if (this.language) {
2489
+ defaultParameters.language = this.language;
2490
+ }
2491
+ if (this.qeVersion) {
2492
+ defaultParameters.qeVersion = this.qeVersion;
2493
+ }
2494
+ if (this.screenMode) {
2495
+ defaultParameters.screenMode = this.screenMode;
2496
+ }
2497
+ defaultParameters.switchScreenModeOnResize = this.switchScreenModeOnResize;
2498
+ if (this.authToken) {
2499
+ defaultParameters.token = this.authToken;
2500
+ }
2501
+ if (this.authKey) {
2502
+ defaultParameters.key = this.authKey;
2503
+ }
2504
+ if (this.editMode) {
2505
+ defaultParameters.editMode = this.editMode;
2506
+ }
2507
+ if (this.mainColor) {
2508
+ defaultParameters.mainColor = this.mainColor;
2509
+ }
2510
+ if (this.accentColor) {
2511
+ defaultParameters.accentColor = this.accentColor;
2512
+ }
2513
+ if (this.loaderBackground) {
2514
+ defaultParameters.loaderBackground = this.loaderBackground;
2515
+ }
2516
+ if (this.loaderFontColor) {
2517
+ defaultParameters.loaderFontColor = this.loaderFontColor;
2518
+ }
2519
+ if (this.loaderSpinnerColor) {
2520
+ defaultParameters.loaderSpinnerColor = this.loaderSpinnerColor;
2521
+ }
2522
+ if (this.loaderSpinnerBackground) {
2523
+ defaultParameters.loaderSpinnerBackground = this.loaderSpinnerBackground;
2524
+ }
2525
+ if (this.timezoneId) {
2526
+ defaultParameters.timezoneId = this.timezoneId;
2527
+ }
2528
+ if (this.itemDimensions) {
2529
+ defaultParameters.itemDimensions = this.itemDimensions;
2530
+ }
2531
+ if (this.appServer) {
2532
+ this.appServer = this.getIsViewMode() ? removeTrailingSlash(this.appServer) : addTrailingSlash(this.appServer);
2533
+ defaultParameters.appServer = this.appServer;
2534
+ } else {
2535
+ this.appServer = addTrailingSlash(
2536
+ DEFAULT_PARAMETERS.appServer
2537
+ );
2538
+ defaultParameters.appServer = this.appServer;
2539
+ }
2540
+ if (this.apiHost) {
2541
+ this.apiHost = this.getIsViewMode() ? removeTrailingSlash(this.apiHost) : addTrailingSlash(this.apiHost);
2542
+ defaultParameters.apiHost = this.apiHost;
2543
+ } else {
2544
+ this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
2545
+ defaultParameters.apiHost = this.apiHost;
2546
+ }
2547
+ return defaultParameters;
2548
+ }
2549
+ _updateIframeUrl() {
2550
+ updateIframeUrl(this.iframe, this._iframeUrl);
2551
+ }
2552
+ // Setup loader / browser error
2553
+ _setupLoader() {
2554
+ const data = getLoader(this);
2555
+ this._loaderMsg = data.loadingMsg;
2556
+ if (data.errorMsg) {
2557
+ this.browserError = true;
2558
+ this.browserErrorMsg = data.errorMsg;
2559
+ this._displayError();
2560
+ }
2561
+ }
2562
+ _displayError() {
2563
+ if (this.dashboardError) {
2564
+ this._loaderStyles();
2565
+ this.iframeStyle.opacity = 1;
2566
+ }
2567
+ if (this.browserError) {
2568
+ this._containerStyle.display = "none";
2569
+ }
2570
+ }
2571
+ _calculateDimAfterDashboardLoaded() {
2572
+ this.dashboardError = false;
2573
+ this._loaderStyles();
2574
+ _setCalculatedDimensions(this);
2575
+ }
2576
+ // Set loader styles
2577
+ _loaderStyles() {
2578
+ this._containerStyle = containerStyles(this);
2579
+ this._loaderStyle = loaderStyles(this);
2580
+ this._loadingCircleStyle = plStyles(this);
2581
+ this._containerLoaderStyle = containerLoaderStyles(this);
2582
+ this._lcStyle = lcStyles(this);
2583
+ }
2584
+ static get styles() {
2585
+ return [dashboardStyles];
2586
+ }
2587
+ render() {
2588
+ let toBeRenderedHTML = x``;
2589
+ const loader = x`
108
2590
  <div
109
2591
  class="luzmo-container-loader"
110
2592
  id="luzmo-container-loader-${this._containerId}"
111
- style=${I(this._containerLoaderStyle)}
2593
+ style=${o5(
2594
+ this._containerLoaderStyle
2595
+ )}
112
2596
  >
113
2597
  <div
114
2598
  class="luzmo-loader"
115
2599
  id="luzmo-loader-${this._containerId}"
116
- style=${I(this._loaderStyle)}
2600
+ style=${o5(this._loaderStyle)}
117
2601
  >
118
2602
  <div
119
2603
  class="luzmo-lc"
120
- style=${I(this._lcStyle)}
2604
+ style=${o5(this._lcStyle)}
121
2605
  >
122
2606
  <div
123
2607
  class="luzmo-loading-circle"
124
- style=${I(this._loadingCircleStyle)}
2608
+ style=${o5(
2609
+ this._loadingCircleStyle
2610
+ )}
125
2611
  ></div>
126
- ${this._itemEmbedding?"":_`
2612
+ ${this._itemEmbedding ? "" : x`
127
2613
  <div
128
2614
  class="luzmo-loading-message"
129
- style=${I({color:this.loaderFontColor})}
2615
+ style=${o5({ color: this.loaderFontColor })}
130
2616
  >
131
2617
  ${this._loaderMsg}
132
2618
  </div>
@@ -134,61 +2620,340 @@ Make sure to test your application with a production build as repeat registratio
134
2620
  </div>
135
2621
  </div>
136
2622
  </div>
137
- `;return this.getIsViewMode()?r=this.isLibraryLoaded?_`
138
- ${this.dashboardId||this.dashboardSlug?_`<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}" api-host="${this.params.apiHost}"></dashboard-component>`:_`
2623
+ `;
2624
+ if (this.getIsViewMode()) {
2625
+ toBeRenderedHTML = this.isLibraryLoaded ? x`
2626
+ ${this.dashboardId || this.dashboardSlug ? x`<dashboard-component dashboard-id="${this.params.dashboardId}" app-server="${this.params.appServer}" api-host="${this.params.apiHost}"></dashboard-component>` : x`
139
2627
  <div id="luzmo-error-${this._containerId}">
140
2628
  <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
141
2629
  </div>
142
2630
  `}
143
- `:_`${i}`:r=_`
144
- ${this.dashboardId||this.dashboardSlug?_`
145
- ${i}
2631
+ ` : x`${loader}`;
2632
+ } else {
2633
+ toBeRenderedHTML = x`
2634
+ ${this.dashboardId || this.dashboardSlug ? x`
2635
+ ${loader}
146
2636
  <iframe
147
2637
  class="luzmo-embed-dashboard"
148
2638
  id="${this._iframeId}"
149
2639
  name="${this._iframeId}"
150
- style=${I(this.iframeStyle)}
2640
+ style=${o5(this.iframeStyle)}
151
2641
  src="${this._iframeUrl}"
152
2642
  frameborder="0"
153
2643
  ></iframe>
154
- `:_`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
155
- ${this.browserError?_`
2644
+ ` : x`<!-- the dashboard will inititialize when you provide a dashboardSlug or a dashboardId -->`}
2645
+ ${this.browserError ? x`
156
2646
  <div id="luzmo-error-${this._containerId}">
157
2647
  <h3 class="luzmo-error">${this.browserErrorMsg}</h3>
158
2648
  </div>
159
- `:""}
160
- `,_`
161
- <div
162
- class="dashboard-container"
163
- style=${I(Object.assign({},this._containerStyle,{width:this.iframeStyle.width??"100%",height:this.iframeStyle.height??"100%"}))}
164
- >
165
- ${r}
2649
+ ` : ""}
2650
+ `;
2651
+ }
2652
+ return x`
2653
+ <div class="${luzmoEmbedContainerClass} ${!this.getIsViewMode() ? `${luzmoEmbedContainerClass}-ede` : ""}">
2654
+ <div
2655
+ class="dashboard-container"
2656
+ style=${o5(Object.assign({}, this._containerStyle, {
2657
+ width: this.iframeStyle.width ?? "100%",
2658
+ height: this.iframeStyle.height ?? "100%"
2659
+ }))}
2660
+ >
2661
+ ${toBeRenderedHTML}
2662
+ </div>
166
2663
  </div>
167
- `}getDashboards(){return new Promise(r=>r(Y._components))}getData(r){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.getData(r):this.getIsViewMode()?Promise.reject():Be(this,this.iframe,r)}getFilters(){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.getFilters():this.getIsViewMode()?Promise.reject():Ce(this,this.iframe)}setFilters(r,i){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.setFilters(r,i):this.getIsViewMode()?Promise.reject():Je(this,this.iframe,r,i)}setAuthorization(r,i){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.setAuthorization(r,i):this.getIsViewMode()?Promise.reject():Ke(this,this.iframe,r,i)}refreshData(r){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.refreshData(r):this.getIsViewMode()?Promise.reject():r?ue(this,this.iframe,r):ue(this,this.iframe)}reloadDashboard(){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.reloadDashboard():this.getIsViewMode()?Promise.reject():qe(this,this.iframe)}exportDashboard(r){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.exportDashboard(r):this.getIsViewMode()?Promise.reject():r?me(this,this.iframe,r):me(this,this.iframe)}getAccessibleDashboards(){return this.getIsViewMode()?this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.getAccessibleDashboards():Promise.reject():We(this,this.iframe)}addFilters(r,i){return this.dashboardReference.addFilters(r,i)}setEditMode(r){return this.dashboardReference&&r==="view"?(this.editMode="view",this.params.editMode="view",this.initComponent(),Promise.resolve({type:"setEditMode",editMode:r})):this.dashboardReference&&["editFull","editLimited"].includes(r)?(this.editMode=r,this.params.editMode=r,this.initComponent(),Promise.resolve({type:"setEditMode",editMode:r})):this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.setEditMode(r):this.getIsViewMode()?Promise.reject():Ge(this,this.iframe,r)}setPreview(r){return this.getIsViewMode()&&this.dashboardReference?this.dashboardReference.setPreview(r):Xe(this,this.iframe,r)}getIsViewMode(){return!!(this.experimental&&this.params.editMode==="view"||this.params.editMode===void 0)}};m([Me(".dashboard-container")],c.prototype,"container",2),m([Me("iframe")],c.prototype,"iframe",2),m([u()],c.prototype,"dashboardId",2),m([u()],c.prototype,"dashboardSlug",2),m([u()],c.prototype,"itemId",2),m([u()],c.prototype,"language",2),m([u()],c.prototype,"qeVersion",2),m([u()],c.prototype,"screenMode",2),m([u({converter:{fromAttribute:r=>r==="true",toAttribute:String}})],c.prototype,"switchScreenModeOnResize",2),m([u()],c.prototype,"editMode",2),m([u()],c.prototype,"mainColor",2),m([u()],c.prototype,"accentColor",2),m([u()],c.prototype,"authToken",2),m([u()],c.prototype,"authKey",2),m([u()],c.prototype,"loaderBackground",2),m([u()],c.prototype,"loaderFontColor",2),m([u()],c.prototype,"loaderSpinnerColor",2),m([u()],c.prototype,"loaderSpinnerBackground",2),m([u()],c.prototype,"appServer",2),m([u()],c.prototype,"timezoneId",2),m([u()],c.prototype,"apiHost",2),m([u({type:Object})],c.prototype,"itemDimensions",2),m([u()],c.prototype,"experimental",2),m([u({attribute:!1})],c.prototype,"_containerId",2),m([u({attribute:!1})],c.prototype,"_iframeId",2),m([u({attribute:!1})],c.prototype,"params",2),m([u({attribute:!1})],c.prototype,"_iframeUrl",2),m([u({attribute:!1})],c.prototype,"iframeLoaded",2),m([u({attribute:!1})],c.prototype,"promises",2),m([u({attribute:!1})],c.prototype,"iframeStyle",2),m([u({attribute:!1})],c.prototype,"_containerStyle",2),m([u({attribute:!1})],c.prototype,"_loaderStyle",2),m([u({attribute:!1})],c.prototype,"_lcStyle",2),m([u({attribute:!1})],c.prototype,"_loadingCircleStyle",2),m([u({attribute:!1})],c.prototype,"_containerLoaderStyle",2),m([u({attribute:!1})],c.prototype,"_loaderMsg",2),m([u({attribute:!1})],c.prototype,"containerWidth",2),m([u({attribute:!1})],c.prototype,"dimensions",2),m([u({attribute:!1})],c.prototype,"currentScreenMode",2),m([u({attribute:!1})],c.prototype,"_itemEmbedding",2),m([u({attribute:!1})],c.prototype,"browserError",2),m([u({attribute:!1})],c.prototype,"browserErrorMsg",2),m([u({attribute:!1})],c.prototype,"dashboardError",2),m([u({attribute:!1})],c.prototype,"browserNotSupported",2),m([u({attribute:!1})],c.prototype,"VERSION",2),m([ve()],c.prototype,"isLibraryLoaded",2),m([ve()],c.prototype,"dashboardReference",2),c=m([xt("luzmo-dashboard")],c);export{c as LuzmoDashboard};
168
- /*! Bundled license information:
169
2664
 
170
- @lit-labs/ssr-dom-shim/lib/element-internals.js:
171
- (**
172
- * @license
173
- * Copyright 2023 Google LLC
174
- * SPDX-License-Identifier: BSD-3-Clause
175
- *)
2665
+ `;
2666
+ }
2667
+ getDashboards() {
2668
+ return new Promise(
2669
+ (resolve) => resolve(luzmo_service_default._components)
2670
+ );
2671
+ }
2672
+ // Public methods
2673
+ getData(itemId) {
2674
+ if (this.getIsViewMode() && this.dashboardReference) {
2675
+ return this.dashboardReference.getData(itemId);
2676
+ }
2677
+ if (!this.getIsViewMode()) {
2678
+ return getData(this, this.iframe, itemId);
2679
+ }
2680
+ return Promise.reject();
2681
+ }
2682
+ getFilters() {
2683
+ if (this.getIsViewMode() && this.dashboardReference) {
2684
+ return this.dashboardReference.getFilters();
2685
+ }
2686
+ if (!this.getIsViewMode()) {
2687
+ return getFilters(this, this.iframe);
2688
+ }
2689
+ return Promise.reject();
2690
+ }
2691
+ setFilters(itemId, filters) {
2692
+ if (this.getIsViewMode() && this.dashboardReference) {
2693
+ return this.dashboardReference.setFilters(itemId, filters);
2694
+ }
2695
+ if (!this.getIsViewMode()) {
2696
+ return setFilters(this, this.iframe, itemId, filters);
2697
+ }
2698
+ return Promise.reject();
2699
+ }
2700
+ setAuthorization(key, token) {
2701
+ if (this.getIsViewMode() && this.dashboardReference) {
2702
+ return this.dashboardReference.setAuthorization(key, token);
2703
+ }
2704
+ if (!this.getIsViewMode()) {
2705
+ return setAuthorization(this, this.iframe, key, token);
2706
+ }
2707
+ return Promise.reject();
2708
+ }
2709
+ refreshData(itemId) {
2710
+ if (this.getIsViewMode() && this.dashboardReference) {
2711
+ return this.dashboardReference.refreshData(itemId);
2712
+ }
2713
+ if (!this.getIsViewMode()) {
2714
+ return itemId ? refreshData(this, this.iframe, itemId) : refreshData(this, this.iframe);
2715
+ }
2716
+ return Promise.reject();
2717
+ }
2718
+ reloadDashboard() {
2719
+ if (this.getIsViewMode() && this.dashboardReference) {
2720
+ return this.dashboardReference.reloadDashboard();
2721
+ }
2722
+ if (!this.getIsViewMode()) {
2723
+ return reloadDashboard(this, this.iframe);
2724
+ }
2725
+ return Promise.reject();
2726
+ }
2727
+ exportDashboard(format) {
2728
+ if (this.getIsViewMode() && this.dashboardReference) {
2729
+ return this.dashboardReference.exportDashboard(format);
2730
+ }
2731
+ if (!this.getIsViewMode()) {
2732
+ return format ? exportDashboard(this, this.iframe, format) : exportDashboard(this, this.iframe);
2733
+ }
2734
+ return Promise.reject();
2735
+ }
2736
+ getAccessibleDashboards() {
2737
+ if (!this.getIsViewMode()) {
2738
+ return getAccessibleDashboards(this, this.iframe);
2739
+ }
2740
+ if (this.getIsViewMode() && this.dashboardReference) {
2741
+ return this.dashboardReference.getAccessibleDashboards();
2742
+ }
2743
+ return Promise.reject();
2744
+ }
2745
+ addFilters(itemId, filters) {
2746
+ return this.dashboardReference.addFilters(itemId, filters);
2747
+ }
2748
+ setEditMode(editMode) {
2749
+ if (this.dashboardReference && editMode === "view") {
2750
+ this.editMode = "view";
2751
+ this.params.editMode = "view";
2752
+ this.initComponent();
2753
+ return Promise.resolve({
2754
+ type: "setEditMode",
2755
+ editMode
2756
+ });
2757
+ }
2758
+ if (this.dashboardReference && ["editFull", "editLimited"].includes(editMode)) {
2759
+ this.editMode = editMode;
2760
+ this.params.editMode = editMode;
2761
+ this.initComponent();
2762
+ return Promise.resolve({
2763
+ type: "setEditMode",
2764
+ editMode
2765
+ });
2766
+ }
2767
+ if (this.getIsViewMode() && this.dashboardReference) {
2768
+ return this.dashboardReference.setEditMode(editMode);
2769
+ }
2770
+ if (!this.getIsViewMode()) {
2771
+ return setEditMode(this, this.iframe, editMode);
2772
+ }
2773
+ return Promise.reject();
2774
+ }
2775
+ setPreview(preview) {
2776
+ if (this.getIsViewMode() && this.dashboardReference) {
2777
+ return this.dashboardReference.setPreview(preview);
2778
+ }
2779
+ return setPreview(this, this.iframe, preview);
2780
+ }
2781
+ getIsViewMode() {
2782
+ if (this.experimental && this.params.editMode === "view" || this.params.editMode === void 0) {
2783
+ return true;
2784
+ }
2785
+ return false;
2786
+ }
2787
+ };
2788
+ __decorateClass([
2789
+ e5(".dashboard-container")
2790
+ ], LuzmoDashboard.prototype, "container", 2);
2791
+ __decorateClass([
2792
+ e5(`.${luzmoEmbedContainerClass}`)
2793
+ ], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
2794
+ __decorateClass([
2795
+ e5("iframe")
2796
+ ], LuzmoDashboard.prototype, "iframe", 2);
2797
+ __decorateClass([
2798
+ n4()
2799
+ ], LuzmoDashboard.prototype, "dashboardId", 2);
2800
+ __decorateClass([
2801
+ n4()
2802
+ ], LuzmoDashboard.prototype, "dashboardSlug", 2);
2803
+ __decorateClass([
2804
+ n4()
2805
+ ], LuzmoDashboard.prototype, "itemId", 2);
2806
+ __decorateClass([
2807
+ n4()
2808
+ ], LuzmoDashboard.prototype, "language", 2);
2809
+ __decorateClass([
2810
+ n4()
2811
+ ], LuzmoDashboard.prototype, "qeVersion", 2);
2812
+ __decorateClass([
2813
+ n4()
2814
+ ], LuzmoDashboard.prototype, "screenMode", 2);
2815
+ __decorateClass([
2816
+ n4({
2817
+ converter: {
2818
+ fromAttribute: (value) => value === "true",
2819
+ toAttribute: String
2820
+ }
2821
+ })
2822
+ ], LuzmoDashboard.prototype, "switchScreenModeOnResize", 2);
2823
+ __decorateClass([
2824
+ n4()
2825
+ ], LuzmoDashboard.prototype, "editMode", 2);
2826
+ __decorateClass([
2827
+ n4()
2828
+ ], LuzmoDashboard.prototype, "mainColor", 2);
2829
+ __decorateClass([
2830
+ n4()
2831
+ ], LuzmoDashboard.prototype, "accentColor", 2);
2832
+ __decorateClass([
2833
+ n4()
2834
+ ], LuzmoDashboard.prototype, "authToken", 2);
2835
+ __decorateClass([
2836
+ n4()
2837
+ ], LuzmoDashboard.prototype, "authKey", 2);
2838
+ __decorateClass([
2839
+ n4()
2840
+ ], LuzmoDashboard.prototype, "loaderBackground", 2);
2841
+ __decorateClass([
2842
+ n4()
2843
+ ], LuzmoDashboard.prototype, "loaderFontColor", 2);
2844
+ __decorateClass([
2845
+ n4()
2846
+ ], LuzmoDashboard.prototype, "loaderSpinnerColor", 2);
2847
+ __decorateClass([
2848
+ n4()
2849
+ ], LuzmoDashboard.prototype, "loaderSpinnerBackground", 2);
2850
+ __decorateClass([
2851
+ n4()
2852
+ ], LuzmoDashboard.prototype, "appServer", 2);
2853
+ __decorateClass([
2854
+ n4()
2855
+ ], LuzmoDashboard.prototype, "timezoneId", 2);
2856
+ __decorateClass([
2857
+ n4()
2858
+ ], LuzmoDashboard.prototype, "apiHost", 2);
2859
+ __decorateClass([
2860
+ n4({ type: Object })
2861
+ ], LuzmoDashboard.prototype, "itemDimensions", 2);
2862
+ __decorateClass([
2863
+ n4()
2864
+ ], LuzmoDashboard.prototype, "experimental", 2);
2865
+ __decorateClass([
2866
+ n4({ attribute: false })
2867
+ ], LuzmoDashboard.prototype, "_containerId", 2);
2868
+ __decorateClass([
2869
+ n4({ attribute: false })
2870
+ ], LuzmoDashboard.prototype, "_iframeId", 2);
2871
+ __decorateClass([
2872
+ n4({ attribute: false })
2873
+ ], LuzmoDashboard.prototype, "params", 2);
2874
+ __decorateClass([
2875
+ n4({ attribute: false })
2876
+ ], LuzmoDashboard.prototype, "_iframeUrl", 2);
2877
+ __decorateClass([
2878
+ n4({ attribute: false })
2879
+ ], LuzmoDashboard.prototype, "iframeLoaded", 2);
2880
+ __decorateClass([
2881
+ n4({ attribute: false })
2882
+ ], LuzmoDashboard.prototype, "promises", 2);
2883
+ __decorateClass([
2884
+ n4({ attribute: false })
2885
+ ], LuzmoDashboard.prototype, "iframeStyle", 2);
2886
+ __decorateClass([
2887
+ n4({ attribute: false })
2888
+ ], LuzmoDashboard.prototype, "_containerStyle", 2);
2889
+ __decorateClass([
2890
+ n4({ attribute: false })
2891
+ ], LuzmoDashboard.prototype, "_loaderStyle", 2);
2892
+ __decorateClass([
2893
+ n4({ attribute: false })
2894
+ ], LuzmoDashboard.prototype, "_lcStyle", 2);
2895
+ __decorateClass([
2896
+ n4({ attribute: false })
2897
+ ], LuzmoDashboard.prototype, "_loadingCircleStyle", 2);
2898
+ __decorateClass([
2899
+ n4({ attribute: false })
2900
+ ], LuzmoDashboard.prototype, "_containerLoaderStyle", 2);
2901
+ __decorateClass([
2902
+ n4({ attribute: false })
2903
+ ], LuzmoDashboard.prototype, "_loaderMsg", 2);
2904
+ __decorateClass([
2905
+ n4({ attribute: false })
2906
+ ], LuzmoDashboard.prototype, "containerWidth", 2);
2907
+ __decorateClass([
2908
+ n4({ attribute: false })
2909
+ ], LuzmoDashboard.prototype, "dimensions", 2);
2910
+ __decorateClass([
2911
+ n4({ attribute: false })
2912
+ ], LuzmoDashboard.prototype, "currentScreenMode", 2);
2913
+ __decorateClass([
2914
+ n4({ attribute: false })
2915
+ ], LuzmoDashboard.prototype, "_itemEmbedding", 2);
2916
+ __decorateClass([
2917
+ n4({ attribute: false })
2918
+ ], LuzmoDashboard.prototype, "browserError", 2);
2919
+ __decorateClass([
2920
+ n4({ attribute: false })
2921
+ ], LuzmoDashboard.prototype, "browserErrorMsg", 2);
2922
+ __decorateClass([
2923
+ n4({ attribute: false })
2924
+ ], LuzmoDashboard.prototype, "dashboardError", 2);
2925
+ __decorateClass([
2926
+ n4({ attribute: false })
2927
+ ], LuzmoDashboard.prototype, "browserNotSupported", 2);
2928
+ __decorateClass([
2929
+ n4({ attribute: false })
2930
+ ], LuzmoDashboard.prototype, "VERSION", 2);
2931
+ __decorateClass([
2932
+ r6()
2933
+ ], LuzmoDashboard.prototype, "isLibraryLoaded", 2);
2934
+ __decorateClass([
2935
+ r6()
2936
+ ], LuzmoDashboard.prototype, "dashboardReference", 2);
2937
+ LuzmoDashboard = __decorateClass([
2938
+ t3("luzmo-dashboard")
2939
+ ], LuzmoDashboard);
2940
+ /*! Bundled license information:
176
2941
 
177
- @lit-labs/ssr-dom-shim/index.js:
2942
+ @lit/reactive-element/css-tag.js:
178
2943
  (**
179
2944
  * @license
180
2945
  * Copyright 2019 Google LLC
181
2946
  * SPDX-License-Identifier: BSD-3-Clause
182
2947
  *)
183
2948
 
184
- @lit/reactive-element/node/css-tag.js:
2949
+ @lit/reactive-element/reactive-element.js:
185
2950
  (**
186
2951
  * @license
187
- * Copyright 2019 Google LLC
2952
+ * Copyright 2017 Google LLC
188
2953
  * SPDX-License-Identifier: BSD-3-Clause
189
2954
  *)
190
2955
 
191
- lit-html/node/lit-html.js:
2956
+ lit-html/lit-html.js:
192
2957
  (**
193
2958
  * @license
194
2959
  * Copyright 2017 Google LLC
@@ -202,94 +2967,111 @@ lit-element/lit-element.js:
202
2967
  * SPDX-License-Identifier: BSD-3-Clause
203
2968
  *)
204
2969
 
205
- lit-html/node/is-server.js:
2970
+ lit-html/is-server.js:
206
2971
  (**
207
2972
  * @license
208
2973
  * Copyright 2022 Google LLC
209
2974
  * SPDX-License-Identifier: BSD-3-Clause
210
2975
  *)
211
2976
 
212
- @lit/reactive-element/node/decorators/custom-element.js:
2977
+ @lit/reactive-element/decorators/custom-element.js:
213
2978
  (**
214
2979
  * @license
215
2980
  * Copyright 2017 Google LLC
216
2981
  * SPDX-License-Identifier: BSD-3-Clause
217
2982
  *)
218
2983
 
219
- @lit/reactive-element/node/decorators/property.js:
2984
+ @lit/reactive-element/decorators/property.js:
220
2985
  (**
221
2986
  * @license
222
2987
  * Copyright 2017 Google LLC
223
2988
  * SPDX-License-Identifier: BSD-3-Clause
224
2989
  *)
225
2990
 
226
- @lit/reactive-element/node/decorators/state.js:
2991
+ @lit/reactive-element/decorators/state.js:
227
2992
  (**
228
2993
  * @license
229
2994
  * Copyright 2017 Google LLC
230
2995
  * SPDX-License-Identifier: BSD-3-Clause
231
2996
  *)
232
2997
 
233
- @lit/reactive-element/node/decorators/event-options.js:
2998
+ @lit/reactive-element/decorators/event-options.js:
234
2999
  (**
235
3000
  * @license
236
3001
  * Copyright 2017 Google LLC
237
3002
  * SPDX-License-Identifier: BSD-3-Clause
238
3003
  *)
239
3004
 
240
- @lit/reactive-element/node/decorators/base.js:
3005
+ @lit/reactive-element/decorators/base.js:
241
3006
  (**
242
3007
  * @license
243
3008
  * Copyright 2017 Google LLC
244
3009
  * SPDX-License-Identifier: BSD-3-Clause
245
3010
  *)
246
3011
 
247
- @lit/reactive-element/node/decorators/query.js:
3012
+ @lit/reactive-element/decorators/query.js:
248
3013
  (**
249
3014
  * @license
250
3015
  * Copyright 2017 Google LLC
251
3016
  * SPDX-License-Identifier: BSD-3-Clause
252
3017
  *)
253
3018
 
254
- @lit/reactive-element/node/decorators/query-all.js:
3019
+ @lit/reactive-element/decorators/query-all.js:
255
3020
  (**
256
3021
  * @license
257
3022
  * Copyright 2017 Google LLC
258
3023
  * SPDX-License-Identifier: BSD-3-Clause
259
3024
  *)
260
3025
 
261
- @lit/reactive-element/node/decorators/query-async.js:
3026
+ @lit/reactive-element/decorators/query-async.js:
262
3027
  (**
263
3028
  * @license
264
3029
  * Copyright 2017 Google LLC
265
3030
  * SPDX-License-Identifier: BSD-3-Clause
266
3031
  *)
267
3032
 
268
- @lit/reactive-element/node/decorators/query-assigned-elements.js:
3033
+ @lit/reactive-element/decorators/query-assigned-elements.js:
269
3034
  (**
270
3035
  * @license
271
3036
  * Copyright 2021 Google LLC
272
3037
  * SPDX-License-Identifier: BSD-3-Clause
273
3038
  *)
274
3039
 
275
- @lit/reactive-element/node/decorators/query-assigned-nodes.js:
3040
+ @lit/reactive-element/decorators/query-assigned-nodes.js:
276
3041
  (**
277
3042
  * @license
278
3043
  * Copyright 2017 Google LLC
279
3044
  * SPDX-License-Identifier: BSD-3-Clause
280
3045
  *)
281
3046
 
282
- lit-html/node/directive.js:
3047
+ lit-html/directive.js:
283
3048
  (**
284
3049
  * @license
285
3050
  * Copyright 2017 Google LLC
286
3051
  * SPDX-License-Identifier: BSD-3-Clause
287
3052
  *)
288
3053
 
289
- lit-html/node/directives/style-map.js:
3054
+ lit-html/directives/style-map.js:
290
3055
  (**
291
3056
  * @license
292
3057
  * Copyright 2018 Google LLC
293
3058
  * SPDX-License-Identifier: BSD-3-Clause
294
3059
  *)
295
3060
  */
3061
+ if (typeof module.exports == "object" && typeof exports == "object") {
3062
+ var __cp = (to, from, except, desc) => {
3063
+ if ((from && typeof from === "object") || typeof from === "function") {
3064
+ for (let key of Object.getOwnPropertyNames(from)) {
3065
+ if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
3066
+ Object.defineProperty(to, key, {
3067
+ get: () => from[key],
3068
+ enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
3069
+ });
3070
+ }
3071
+ }
3072
+ return to;
3073
+ };
3074
+ module.exports = __cp(module.exports, exports);
3075
+ }
3076
+ return module.exports;
3077
+ }))