/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/@boldbi/boldbi-embedded-sdk@16.3.5/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.widgetBI=exports.BoldBI=void 0;const embeddingLocalization_1=require("./types/embeddingLocalization"),enum_1=require("./types/enum"),default_1=require("./types/default"),sdk_deprecation_utils_1=require("./utils/sdk_deprecation_utils");let bbEmbed,tabInstance;class BoldBI{constructor(e){this._authorizeResponse=null,this.loadPinboard=this.Invoke(function(){if(!this.invalidDetail){if(""==this.embedOptions.pinboardName)throw new Error(embeddingLocalization_1.errorMessages.PinboardNameEmpty);if(this.embedOptions.mode!=BoldBI.Mode.View)throw new Error(embeddingLocalization_1.errorMessages.UnablePinboardRender);if(this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],!this._checkWidgetList())if(this.embedOptions.embedType==BoldBI.EmbedType.Component)this._setEmbedDefaults(),this.isPinboardRendering=!0,this._showLoader(),this._isDependencyLoaded(this);else if(this.embedOptions.embedType==BoldBI.EmbedType.IFrame){const e=document.createElement("iframe");e.frameBorder=0,e.width=this.embedOptions.width,e.height=this.embedOptions.height,e.id=this.embedOptions.embedContainerId+"_"+this.embedOptions.dashboardId,e.allowfullscreen=this.embedOptions.dashboardSettings.showFullScreen,e.setAttribute("src",this.embedOptions.serverUrl+"/dashboards/"+this.embedOptions.dashboardId+"?isembed=true"),document.getElementById(this.embedOptions.embedContainerId).appendChild(e)}}}),this.loadDatasource=this.Invoke(function(){if(!this.invalidDetail&&((this.embedOptions.dashboardId||this.embedOptions.dashboardPath)&&(this.embedOptions.dashboardId=this.embedOptions.dashboardPath=""),""!=this.embedOptions.pinboardName&&(this.embedOptions.pinboardName=""),!this._checkWidgetList())){if(this.embedOptions.mode!=BoldBI.Mode.DataSource&&this.embedOptions.mode!=BoldBI.Mode.Connection)throw new Error(embeddingLocalization_1.errorMessages.EmbedModeInvalid);if(this.embedOptions.embedType==BoldBI.EmbedType.Component)this.isWidgetMode=!1,this.widgetName="",this.isDashboardViewMode=!1,this.dashboardViewName="",this._showLoader(),this._isDependencyLoaded(this);else if(this.embedOptions.embedType==BoldBI.EmbedType.IFrame){const e=document.createElement("iframe");e.frameBorder=0,e.width=this.embedOptions.width,e.height=this.embedOptions.height,e.id=this.embedOptions.embedContainerId+"_"+this.embedOptions.datasourceId,e.allowfullscreen=this.embedOptions.dashboardSettings.showFullScreen,e.setAttribute("src",this.embedOptions.serverUrl+"/datasource-designer/"+this.embedOptions.datasourceId+"?isembed=true"),document.getElementById(this.embedOptions.embedContainerId).appendChild(e)}}}),this.viewer={refresh:()=>{this.deprecated=!1,this.refreshDashboard()},resize:()=>{this.deprecated=!1,this.resizeDashboard()},resetFilter:()=>{this.deprecated=!1,this.clearAllFilter()},updateFilters:e=>{this.deprecated=!1,this.updateFilters(e)},exportAsExcel:e=>{this.deprecated=!1,e.widgetName?this.exportWidgetAsExcel(e):this.exportDashboardAsExcel(e)},exportAsImage:e=>{this.deprecated=!1,e.widgetName?this.exportWidgetAsImage(e):this.exportDashboardAsImage(e)},exportAsPdf:e=>{this.deprecated=!1,e.widgetName?this.exportWidgetAsPdf(e):this.exportDashboardAsPdf(e)},exportAsCSV:e=>{this.deprecated=!1,e.widgetName&&this.exportWidgetAsCsv(e)},addComment:(e,i)=>{this.deprecated=!1,e.widgetId?this.addWidgetComment(e,i):this.addDashboardComment(e,i)},editComment:(e,i)=>{this.deprecated=!1,e.widgetId?this.editWidgetComment(e,i):this.editDashboardComment(e,i)},deleteComment:(e,i)=>{this.deprecated=!1,e.widgetId?this.deleteWidgetComment(e,i):this.deleteDashboardComment(e,i)},fetchComments:(e,i,t)=>{this.deprecated=!1,this.getComments(e,i,t)}},this.pinboard={addWidget:(e,i,t)=>{this.deprecated=!1,this.addWidgetToPinboard(e,i,t)}},this.dataSource={refresh:()=>{this.deprecated=!1,this.updateDatasource()}},this.designer={publish:(e,i)=>{this.deprecated=!1,this.saveDashboard(e,i)}},this.widget={fetchData:(e,i,t)=>{this.deprecated=!1,this.getWidgetData(e,i,t)},refresh:(e,i,t)=>{this.deprecated=!1,this.refreshWidgetData(e,i,t)},getInstance:e=>(this.deprecated=!1,this.getWidgetInstance(e)),updatefilters:e=>{this.deprecated=!1,this.updateWidgetFilters(e)},dispose:e=>{this.deprecated=!1,this.removeWidgetInstance(e),this.deprecated=!1}},this.view={delete:(e,i)=>{this.deprecated=!1,this.deleteFilterView(e,i)},update:(e,i)=>{this.deprecated=!1,this.updateFilterView(e,i)},save:(e,i)=>{this.deprecated=!1,this.saveFilterView(e,i)},saveAs:(e,i)=>{this.deprecated=!1,this.saveAsFilterView(e,i)},fetchById:(e,i)=>{this.deprecated=!1,this.getViewByViewId(e,i)},fetchByDashboardId:(e,i)=>{this.deprecated=!1,this.getViewsByDashboardId(e,i)}},this._initializeUrls=this.Invoke(function(){if(this.embedOptions.enableDomainMasking){if(""===this.embedOptions.authorizationServer.url&&""===this.embedOptions.token&&""===this.embedOptions.embedToken)return this.designerRootUrl=this.embedOptions.serverUrl,!0;throw new Error(embeddingLocalization_1.errorMessages.DomainMaskingError)}if(this.embedOptions.serverUrl.indexOf("/bi")<=0)throw new Error(embeddingLocalization_1.errorMessages.InvalidBoldBIURL);return this.embedOptions.environment==BoldBI.Environment.Enterprise?(this.rootUrl=this.embedOptions.serverUrl.substr(0,this.embedOptions.serverUrl.indexOf("/bi/")>=0?this.embedOptions.serverUrl.indexOf("/bi/")+3:this.embedOptions.serverUrl.indexOf("/bi")+3),this.baseUrl=this.embedOptions.serverUrl,this.siteIdentifier=this.embedOptions.serverUrl.indexOf("/site/")>=0?this.embedOptions.serverUrl.substr(this.embedOptions.serverUrl.indexOf("/site/")+1):"",this.dashboardServerApiUrl=this.rootUrl+"/api"+(this._isEmptyOrSpaces(this.siteIdentifier)?"":"/"+this.siteIdentifier),this.designerRootUrl=this.rootUrl+"/designer",this.customThemeUrl=this.rootUrl.replace(/\/bi(?!.*\/bi)/,"/ums/theme/styles")):(this.rootUrl=this.embedOptions.serverUrl.endsWith("/")?this.embedOptions.serverUrl.slice(0,-1):this.embedOptions.serverUrl,this.baseUrl=this.embedOptions.serverUrl,this.siteIdentifier="",this.dashboardServerApiUrl=this.rootUrl+"/api"),this.scheduleEndpointUrl=this.baseUrl+"/datasources/recurrence-type-page",!0}),this._addJquerydependentFiles=this.Invoke(function(){if(this._checkDepedentFileExists(this.jQueryDepedentFile,!1)||null!=window.jQuery&&"3.5.0"==window.jQuery().jquery){const e=setInterval(()=>{window.jQuery&&(clearInterval(e),bbEmbed=window.bbEmbed=window.$,void 0!==window.bb$&&(bbEmbed=window.bbEmbed=window.bb$),this._addWrapperDependentFiles(this,this.wrapperDependentScriptFiles),this._loadDepedentFiles())},1e3)}else{const e=document.createElement("script");let i;i=this.embedOptions.environment==BoldBI.Environment.Enterprise?this.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+this.jQueryDepedentFile:this.rootUrl+"/cdn/scripts/designer/"+this.jQueryDepedentFile:this.cdnLink+"/scripts/designer/"+this.jQueryDepedentFile,e.setAttribute("src",this._appendEmbedResourceVersion(i)),this.embedOptions.nonce&&(e.nonce=this.embedOptions.nonce),document.head.appendChild(e),e.onload=()=>{try{const e=document.createElement("script");e.append(this.jqConflictFile),this.embedOptions.nonce&&(e.nonce=this.embedOptions.nonce),document.head.appendChild(e),bbEmbed=window.bbEmbed=window.bb$,this._addWrapperDependentFiles(this,this.wrapperDependentScriptFiles),this._loadDepedentFiles()}catch(e){this._throwError(embeddingLocalization_1.errorMessages.ServerNotFound),this.invalidDetail=!0}},e.onerror=e=>this._handleEnvironmentError(e)}}),this._renderDashboard=this.Invoke(function(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E,D,S,B,C,x,M,A,F,T,k,L,N,W,z,P,V,U,R,$,j,H,q,Q,J,G,K,X,Z,Y,ee,ie,te,se,oe,ne,de,ae,re,le,be,me,he,ce,pe,ue,ge,ve,fe,we,Ie,Oe,_e,ye,Ee,De,Se,Be,Ce,xe,Me,Ae,Fe,Te,ke,Le,Ne,We,ze,Pe,Ve,Ue,Re,$e,je,He,qe,Qe,Je,Ge,Ke,Xe,Ze,Ye,ei,ii,ti,si,oi,ni,di,ai,ri,li,bi,mi,hi,ci,pi,ui,gi,vi,fi,wi,Ii,Oi,_i,yi,Ei,Di,Si,Bi,Ci,xi,Mi,Ai,Fi,Ti,ki,Li,Ni,Wi,zi,Pi,Vi,Ui,Ri,$i,ji,Hi,qi,Qi,Ji,Gi,Ki,Xi,Zi,Yi,et,it,tt,st,ot,nt,dt,at,rt,lt,bt,mt,ht,ct,pt,ut,gt,vt,ft,wt,It,Ot,_t,yt,Et,Dt,St,Bt,Ct,xt,Mt,At,Ft,Tt,kt,Lt,Nt,Wt,zt,Pt,Vt,Ut,Rt,$t,jt,Ht,qt,Qt,Jt,Gt,Kt,Xt,Zt,Yt,es,is,ts,ss,os,ns,ds,as,rs,ls,bs,ms,hs,cs,ps,us,gs,vs,fs,ws,Is,Os,_s,ys,Es,Ds,Ss,Bs,Cs,xs,Ms,As,Fs,Ts,ks,Ls,Ns,Ws,zs,Ps,Vs,Us,Rs,$s,js,Hs,qs,Qs,Js,Gs,Ks,Xs,Zs,Ys,eo,io,to,so,oo,no,ao,ro,lo,bo,mo,ho,co,po,uo,go,vo,fo,wo,Io,Oo,_o,yo,Eo,Do,So,Bo,Co,xo,Mo,Ao,Fo,To,ko,Lo,No,Wo,zo,Po,Vo,Uo,Ro,$o,jo,Ho,qo,Qo,Jo,Go,Ko,Xo,Zo,Yo,en,tn,sn,on,nn,dn,an,rn,ln,bn,mn,hn,cn,pn,un,gn,vn,fn,wn,In,On,_n,yn,En,Dn,Sn,Bn,Cn,xn,Mn,An,Fn,Tn,kn,Ln,Nn,Wn,zn,Pn,Vn,Un,Rn,$n,jn,Hn,qn,Qn,Jn,Gn,Kn,Xn,Zn,Yn,ed,id,td,sd,od,nd,dd,ad,rd,ld,bd,md,hd,cd,pd,ud,gd,vd,fd,wd,Id,Od,_d,yd,Ed,Dd,Sd,Bd,Cd,xd,Md,Ad;const Fd=this;if(null==e)throw new Error(embeddingLocalization_1.errorMessages.NullResponse);const Td=e.Data;if(!e.Status&&!this.embedOptions.enableDomainMasking)throw e.errorMessage==embeddingLocalization_1.errorMessages.PageUnavailable&&(e.Status=!1,e.Message=e.errorMessage),e.Message===embeddingLocalization_1.errorMessages.ObjectRefNotSet&&("view"!==this.embedOptions.mode&&"design"!==this.embedOptions.mode||(this._isEmptyOrSpaces(this.embedOptions.dashboardId)&&this._isEmptyOrSpaces(this.embedOptions.dashboardPath)||(e.Message=embeddingLocalization_1.errorMessages.InvalidDbrdDetails),this._isEmptyOrSpaces(this.embedOptions.pinboardName)||(e.Message=embeddingLocalization_1.errorMessages.InvalidPinboardName))),null==e.Message?new Error(embeddingLocalization_1.errorMessages.InvalidResponse):new Error(e.Message);{if(Array.isArray(e.Data)&&this._isEmptyOrSpaces(this.embedOptions.dashboardId)&&this._isEmptyOrSpaces(this.embedOptions.dashboardPath)){for(const i of e.Data)if("ErrorMessage"in i){const t=`BoldBI Embedded: ${i.ErrorMessage}`;if(this._isNullOrUndefined(this.embedOptions.events.onError)||""===this.embedOptions.events.onError)console.error(t);else{const e=new Error(t);this.onErrorClient(e)}e.Data=e.Data.filter(e=>e!==i)}if(Td.filter(e=>"ErrorMessage"in e&&e.ErrorMessage.includes("Access denied for the item")).length===Td.length)throw new Error(embeddingLocalization_1.errorMessages.AccessDeniedItem);if(!e.Data.length)throw new Error(embeddingLocalization_1.errorMessages.InvalidDbrdDetails)}const Ld=e.Data;if(""!=this.embedOptions.pinboardName&&0==this.pinboardIds.length){if(!Ld.ColumnInfo)throw new Error(embeddingLocalization_1.errorMessages.InvalidPinboardName);this._renderPinboard(Ld)}else if(!this._isNullOrUndefined(Ld)&&Ld.length){if(this.isWidgetMode){const e=document.getElementById(this.embedOptions.embedContainerId);throw BoldBI._hasinstance(e,"embeddedBoldBI")&&BoldBI._removeinstance(e,"embeddedBoldBI"),new Error(embeddingLocalization_1.errorMessages.MultitabDbrdWidgetRender)}if(this.embedOptions.mode!=BoldBI.Mode.View){const e=document.getElementById(this.embedOptions.embedContainerId);throw BoldBI._hasinstance(e,"embeddedBoldBI")&&BoldBI._removeinstance(e,"embeddedBoldBI"),new Error(embeddingLocalization_1.errorMessages.NotRenderMultitabDashboard)}this._renderMultiTabDashboard(Ld)}else{let Td;this.embedOptions.enableDomainMasking||(Ld.ItemDetail=this.embedOptions.mode!==BoldBI.Mode.Connection?this.embedOptions.token||this.embedOptions.embedToken||"string"!=typeof e.Data.ItemDetail?e.Data.ItemDetail:JSON.parse(e.Data.ItemDetail):null),this.embedOptions.token||this.embedOptions.enableDomainMasking||this.embedOptions.isPublicDashboard||this.embedOptions.embedToken||((this.embedOptions.mode==BoldBI.Mode.View||Ld.ItemDetail&&Ld.ItemDetail.IsEnableDefaultView)&&(this.isDefaultView=Ld.ItemDetail.IsEnableDefaultView,this.embedOptions.dashboardSettings=this.embedOptions.dashboardSettings||{},this.embedOptions.dashboardSettings.filterOverviewSettings=this.embedOptions.dashboardSettings.filterOverviewSettings||{},this.embedOptions.settings=this.embedOptions.settings||{},this.embedOptions.settings.viewer=this.embedOptions.settings.viewer||{},this.embedOptions.settings.viewer.filterOverview=this.embedOptions.settings.viewer.filterOverview||{},Ld.ItemDetail.ItemViews&&(this.embedOptions.dashboardSettings.filterOverviewSettings.viewId=this.embedOptions.settings.viewer.filterOverview.viewId=Ld.ItemDetail.ItemViews[0].ViewId,this.embedOptions.dashboardSettings.filterOverviewSettings.viewName=this.embedOptions.settings.viewer.filterOverview.ViewName=Ld.ItemDetail.ItemViews[0].ViewName,this.embedOptions.filterParameters=Ld.ItemDetail.ItemViews[0].QueryString)),this.embedOptions.mode==BoldBI.Mode.View&&(this.dashboardUrl="/dashboard/"+Ld.ItemDetail.Id+"/"+Ld.ItemDetail.CategoryName+"/"+Ld.ItemDetail.Name+"?"),this.embedOptions.mode==BoldBI.Mode.View&&this.embedOptions.viewId&&(this.embedOptions.dashboardId=Ld.ItemDetail.Id)),this.accessToken=Fd.embedOptions.enableDomainMasking?null:Fd.embedOptions.token?Fd.embedOptions.token:this.embedOptions.embedToken?this.embedOptions.embedToken:Ld.access_token;let Nd,Wd="";if(this.pinboardIds.length>0){const e=this.authToken?Ld.Id:Ld.WidgetId;bbEmbed.map(this.pinboardIds,function(i){if(i.widgetId==e){const e=Fd._getDashboardInstance(i.pinboardContainerId+"_embeddedbi");Fd._isNullOrUndefined(e)&&(Td=i.pinboardContainerId)}}),Nd=this.authToken?Ld.ItemId:""}else if(this.isMultiTab){const e=this.embedOptions.token||this.embedOptions.embedToken?Ld.DashboardId.toString().replaceAll("-",""):Ld.ItemDetail.Id.toString().replaceAll("-","");Td="multi_"+e;const s=Fd._isNullOrUndefined(null===(i=Fd.embedOptions.dashboardSettings)||void 0===i?void 0:i.dashboardName)||"string"==typeof Fd.embedOptions.dashboardSettings.dashboardName?null===(t=Fd.embedOptions.settings.viewer)||void 0===t?void 0:t.dashboardName:Fd.embedOptions.dashboardSettings.dashboardName;!Fd._isNullOrUndefined(s)&&Array.isArray(s)&&bbEmbed.map(s,function(e){Ld.ItemDetail.Id===e.dashboardId&&(Wd=e.displayName)}),Nd=Fd.embedOptions.token||this.embedOptions.embedToken?Ld.DashboardId:""}else{Td=this.embedOptions.embedContainerId;const e=Fd._isNullOrUndefined(null===(s=Fd.embedOptions.dashboardSettings)||void 0===s?void 0:s.dashboardName)||"string"!=typeof Fd.embedOptions.dashboardSettings.dashboardName?null===(n=null===(o=Fd.embedOptions.settings)||void 0===o?void 0:o.viewer)||void 0===n?void 0:n.dashboardName:Fd.embedOptions.dashboardSettings.dashboardName;Fd._isNullOrUndefined(e)||"string"!=typeof e||(Wd=e)}const zd=this.pinboardIds.length>0?bbEmbed("#"+Td).height():this.isMultiTab?this.embedOptions.height.indexOf("%")>0?this.embedOptions.height.includes("calc")?"calc(100% - 36px)":"calc("+this.embedOptions.height+" - 36px)":parseInt(this.embedOptions.height,10)-36+"px":this.embedOptions.height;if(this.embedOptions.enableDomainMasking||this.embedOptions.isPublicDashboard||this.embedOptions.embedToken||void 0===e.Data.UserDetail||(Ld.UserDetail="string"==typeof e.Data.UserDetail?JSON.parse(e.Data.UserDetail):e.Data.UserDetail),this.embedOptions.mode==BoldBI.Mode.Connection&&bbEmbed('<style type="text/css"> .e-dashboarddesigner .bbi-dbrd-connection-mode-dlg .bbi-dbrd-connection-mode-header .bbi-dbrd-icon-container .bbi-dbrd-close-icon{ display: none !important} </style>').appendTo("head"),this._onBoldBIAuthorizionComplete(Ld),""==this.embedOptions.widgetList){document.getElementById(Td)&&(document.getElementById(Td).style.height=zd,document.getElementById(Td).style.width=""!=this.embedOptions.pinboardName?document.getElementById(Td).style.width:this.isMultiTab?"100%":this.embedOptions.width)}const Pd=this.embedOptions.mode===BoldBI.Mode.View,Vd=this.embedOptions.mode===BoldBI.Mode.Design,Ud=!((null===(d=this.embedOptions.authorizationServer)||void 0===d?void 0:d.url)||(null===(a=this.embedOptions.authorizationServer)||void 0===a?void 0:a.data)||this.embedOptions.token||this.embedOptions.embedToken);let Rd;Pd&&Ud&&(this._isNullOrUndefined(null===(r=this.embedOptions.dashboardSettings)||void 0===r?void 0:r.filterOverviewSettings)||(this.embedOptions.dashboardSettings.filterOverviewSettings.showSaveIcon=!1,this.embedOptions.dashboardSettings.filterOverviewSettings.showSaveAsIcon=!1),this._isNullOrUndefined(null===(b=null===(l=this.embedOptions.settings)||void 0===l?void 0:l.viewer)||void 0===b?void 0:b.filterOverview)||(this.embedOptions.settings.viewer.filterOverview.save=!1,this.embedOptions.settings.viewer.filterOverview.saveAs=!1));const $d=this._resolveThemeString(null===(c=null===(h=null===(m=this.embedOptions)||void 0===m?void 0:m.settings)||void 0===h?void 0:h.theme)||void 0===c?void 0:c.fontFamily,null===(p=this.embedOptions.dashboardSettings)||void 0===p?void 0:p.fontFamily),jd=this._resolveThemeBoolean(null===(g=null===(u=this.embedOptions.settings)||void 0===u?void 0:u.theme)||void 0===g?void 0:g.localTheme,null===(f=null===(v=this.embedOptions.dashboardSettings)||void 0===v?void 0:v.themeSettings)||void 0===f?void 0:f.isLocalTheme),Hd=this.embedOptions.environment===BoldBI.Environment.Enterprise?this.rootUrl.replace(/\/bi(?!.*\/bi)/,"/ums/user-interface/fonts")+"?family="+$d:""+(this.rootUrl+"/user-interface/fonts?family="+$d);Rd={siteUrl:this.baseUrl,serviceUrl:this.designerRootUrl,dataServiceUrl:this.designerRootUrl,serverUrl:this.dashboardServerApiUrl,hasAPIKey:!Fd.embedOptions.enableDomainMasking&&!this.embedOptions.isPublicDashboard&&!this._isJwtFormat(this.accessToken),viewerSettings:{serviceUrl:this.designerRootUrl+"/v1.0/design"},nonce:this.embedOptions.nonce,localeSettings:{culture:this._isEmptyOrSpaces(null===(I=null===(w=this.embedOptions)||void 0===w?void 0:w.localeSettings)||void 0===I?void 0:I.culture)?this._isEmptyOrSpaces(null===(y=null===(_=null===(O=this.embedOptions)||void 0===O?void 0:O.settings)||void 0===_?void 0:_.locale)||void 0===y?void 0:y.culture)?"en-US":this.embedOptions.settings.locale.culture:this.embedOptions.localeSettings.culture,dateFormat:this._isEmptyOrSpaces(null===(D=null===(E=this.embedOptions)||void 0===E?void 0:E.localeSettings)||void 0===D?void 0:D.dateFormat)?this._isEmptyOrSpaces(null===(C=null===(B=null===(S=this.embedOptions)||void 0===S?void 0:S.settings)||void 0===B?void 0:B.locale)||void 0===C?void 0:C.dateFormat)?"M/d/yyyy":this.embedOptions.settings.locale.dateFormat:this.embedOptions.localeSettings.dateFormat,timeFormat:this._isEmptyOrSpaces(null===(M=null===(x=this.embedOptions)||void 0===x?void 0:x.localeSettings)||void 0===M?void 0:M.timeFormat)?this._isEmptyOrSpaces(null===(T=null===(F=null===(A=this.embedOptions)||void 0===A?void 0:A.settings)||void 0===F?void 0:F.locale)||void 0===T?void 0:T.timeFormat)?"h:mm:ss tt":this.embedOptions.settings.locale.timeFormat:this.embedOptions.localeSettings.timeFormat},mode:this.embedOptions.mode,localData:{loadFromData:this.embedOptions.localData.loadFromData,layoutData:this.embedOptions.localData.layoutData,widgetData:this.embedOptions.localData.widgetData},environment:this.embedOptions.environment,IsEmbed:!0,siteIdentifier:this._isNullOrUndefined(this.siteIdentifier)||this._isEmptyOrSpaces(this.siteIdentifier)?"":this.siteIdentifier.replace(/^site\//i,""),_isPublic:this.embedOptions.mode!=BoldBI.Mode.Connection?this.embedOptions.enableDomainMasking||!this._isNullOrUndefined(this.embedOptions.embedToken)&&!this._isEmptyOrSpaces(this.embedOptions.embedToken)||this._isNullOrUndefined(Ld.ItemDetail)?"":Ld.ItemDetail.IsPublic:"",itemId:this.embedOptions.mode!=BoldBI.Mode.Connection?this.embedOptions.enableDomainMasking?this.embedOptions.dashboardId:this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?Ld.ItemDetail.Id:Fd.embedOptions.isdesignerdraft?Ld.draftItemID:Nd||this.embedOptions.dashboardId:"",dashboardPath:this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection?"":this.embedOptions.enableDomainMasking?this.embedOptions.dashboardId+"/0":this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?Ld.ItemDetail.ItemLocation:Nd?Nd+"/0":this.embedOptions.dashboardId+"/"+Ld.dashboardVersion,serviceAuthorizationToken:this.accessToken,dashboardName:this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection||this.embedOptions.enableDomainMasking||this._isNullOrUndefined(Ld.ItemDetail)?"":this._isEmptyOrSpaces(Wd)?Ld.ItemDetail.Name:Wd,dashboardDescription:this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection||this.embedOptions.enableDomainMasking||this._isNullOrUndefined(Ld.ItemDetail)?"":Ld.ItemDetail.Description,IsProxy:!!this.embedOptions.enableDomainMasking,theme:this._isEmptyOrSpaces(this.multiTabTheme)?this.embedOptions.theme:this.multiTabTheme,enableTheme:!1,enableFilterOverview:"boolean"==typeof this.embedOptions.dashboardSettings.enableFilterOverview?this.embedOptions.dashboardSettings.enableFilterOverview:null===(W=null===(N=null===(L=null===(k=this.embedOptions.settings)||void 0===k?void 0:k.viewer)||void 0===L?void 0:L.filterOverview)||void 0===N?void 0:N.enabled)||void 0===W||W,isPinWidget:this.pinboardIds.length>0,layoutSetting:this.embedOptions.layoutSettings,export:{Image:this.dashboardWidgetExports.export.image,Excel:this.dashboardWidgetExports.export.excel,Pdf:this.dashboardWidgetExports.export.pdf,CustomFontFamilyUrl:$d?Hd:"",IsDefaultFont:!1},dashboardExportMenuSettings:{showCSV:this.dashboardWidgetExports.export.csv,showExcel:this.dashboardWidgetExports.export.excel,showImage:this.dashboardWidgetExports.export.image,showPDF:this.dashboardWidgetExports.export.pdf},widgetExportMenuSettings:{showCSV:this.dashboardWidgetExports.export.csv,showExcel:this.dashboardWidgetExports.export.excel,showImage:this.dashboardWidgetExports.export.image,showPDF:this.dashboardWidgetExports.export.pdf},filterParameters:(this._isEmptyOrSpaces(this.embedOptions.filterParameters)?"":"&")+(this.isMultiTab&&window.multiTabFilterParameter?window.multiTabFilterParameter:this.embedOptions.filterParameters),designCanvasSettings:{margin:this._isNullOrUndefined(null===(P=null===(z=this.embedOptions)||void 0===z?void 0:z.designCanvasSettings)||void 0===P?void 0:P.margin)?this._isNullOrUndefined(null===(R=null===(U=null===(V=this.embedOptions)||void 0===V?void 0:V.settings)||void 0===U?void 0:U.designCanvas)||void 0===R?void 0:R.margin)?null:null===(j=null===($=this.embedOptions.settings)||void 0===$?void 0:$.designCanvas)||void 0===j?void 0:j.margin:this.embedOptions.designCanvasSettings.margin},widgetContainerSettings:{margin:this._isNullOrUndefined(null===(q=null===(H=this.embedOptions)||void 0===H?void 0:H.widgetContainerSettings)||void 0===q?void 0:q.margin)?this._isNullOrUndefined(null===(K=null===(G=null===(J=null===(Q=this.embedOptions)||void 0===Q?void 0:Q.settings)||void 0===J?void 0:J.viewer)||void 0===G?void 0:G.widgetContainer)||void 0===K?void 0:K.margin)?null:null===(Z=null===(X=this.embedOptions.settings.viewer)||void 0===X?void 0:X.widgetContainer)||void 0===Z?void 0:Z.margin:this.embedOptions.widgetContainerSettings.margin,boxShadow:this._isEmptyOrSpaces(null===(ee=null===(Y=this.embedOptions)||void 0===Y?void 0:Y.widgetContainerSettings)||void 0===ee?void 0:ee.boxShadow)?this._isEmptyOrSpaces(null===(oe=null===(se=null===(te=null===(ie=this.embedOptions)||void 0===ie?void 0:ie.settings)||void 0===te?void 0:te.viewer)||void 0===se?void 0:se.widgetContainer)||void 0===oe?void 0:oe.boxShadow)?null:null===(de=null===(ne=this.embedOptions.settings.viewer)||void 0===ne?void 0:ne.widgetContainer)||void 0===de?void 0:de.boxShadow:this.embedOptions.widgetContainerSettings.boxShadow},viewDataSettings:{checkShowAllColumns:"boolean"==typeof(null===(re=null===(ae=this.embedOptions.dashboardSettings)||void 0===ae?void 0:ae.viewDataSettings)||void 0===re?void 0:re.showAllColumns)?this.embedOptions.dashboardSettings.viewDataSettings.showAllColumns:null!==(me=null===(be=null===(le=this.embedOptions.settings)||void 0===le?void 0:le.viewData)||void 0===be?void 0:be.allColumns)&&void 0!==me&&me},viewDataActions:{allowExporting:"boolean"==typeof(null===(ce=null===(he=this.embedOptions.dashboardSettings)||void 0===he?void 0:he.viewDataSettings)||void 0===ce?void 0:ce.enableExporting)?this.embedOptions.dashboardSettings.viewDataSettings.enableExporting:null===(ge=null===(ue=null===(pe=this.embedOptions.settings)||void 0===pe?void 0:pe.viewData)||void 0===ue?void 0:ue.exporting)||void 0===ge||ge,allowColumnSelection:"boolean"==typeof(null===(fe=null===(ve=this.embedOptions.dashboardSettings)||void 0===ve?void 0:ve.viewDataSettings)||void 0===fe?void 0:fe.enableColumnSelection)?this.embedOptions.dashboardSettings.viewDataSettings.enableColumnSelection:null===(Oe=null===(Ie=null===(we=this.embedOptions.settings)||void 0===we?void 0:we.viewData)||void 0===Ie?void 0:Ie.columnSelection)||void 0===Oe||Oe},dashboardThemeSettings:{appearance:this._resolveThemeString(null===(Ee=null===(ye=null===(_e=this.embedOptions)||void 0===_e?void 0:_e.settings)||void 0===ye?void 0:ye.theme)||void 0===Ee?void 0:Ee.appearance,null===(Be=null===(Se=null===(De=this.embedOptions)||void 0===De?void 0:De.dashboardSettings)||void 0===Se?void 0:Se.themeSettings)||void 0===Be?void 0:Be.appearance,"light"),applicationTheme:this._resolveThemeString(null===(Me=null===(xe=null===(Ce=this.embedOptions)||void 0===Ce?void 0:Ce.settings)||void 0===xe?void 0:xe.theme)||void 0===Me?void 0:Me.application,null===(Te=null===(Fe=null===(Ae=this.embedOptions)||void 0===Ae?void 0:Ae.dashboardSettings)||void 0===Fe?void 0:Fe.themeSettings)||void 0===Te?void 0:Te.application,null),dashboardTheme:this._resolveThemeString(null===(Ne=null===(Le=null===(ke=this.embedOptions)||void 0===ke?void 0:ke.settings)||void 0===Le?void 0:Le.theme)||void 0===Ne?void 0:Ne.dashboard,null===(ze=null===(We=this.embedOptions.dashboardSettings)||void 0===We?void 0:We.themeSettings)||void 0===ze?void 0:ze.dashboard,jd?"boldBITheme":null)},hideMetrics:"boolean"==typeof(null===(Pe=this.embedOptions.dashboardSettings)||void 0===Pe?void 0:Pe.showMetrics)?!this.embedOptions.dashboardSettings.showMetrics:"boolean"==typeof(null===(Ue=null===(Ve=this.embedOptions.settings)||void 0===Ve?void 0:Ve.viewer)||void 0===Ue?void 0:Ue.metrics)&&!this.embedOptions.settings.viewer.metrics,widgets:this._getWidgetFilterInfo(),showConfirmPublishPopup:!0,actionComplete:function(e){Fd._onBoldBIDashboardInstaceActionComplete(e)},reportOpened:function(e){Fd._onBoldBIDashboardInstaceReportOpen(e)},performNavigateToDashboard:function(e){Fd._onBoldBIDashboardInstanceNavigateToDashboard(e)},beforeBannerIconRender:function(e){Fd._onBoldBIDashboardBeforeBannerIconRender(e,Ld)},beforeOtherOptionContextMenuRender:function(e){Fd._onBoldBIDashboardBeforeOtherOptionContextMenuRender(e)},_onSaveFilter:function(e){Fd._onBoldBIDashboardSaveFilter(e)},_onSaveAsFilter:function(e){Fd._onBoldBIDashboardSaveAsFilter(e)},_onViewSavedFilters:function(e){Fd._onBoldBIDashboardOpenViewSection(e)},onBannerIconClick:function(e){Fd._onBoldBIDashboardBannerIconClick(e)},getModelDataForDashboard:function(e){Fd._onGetLinkedDashboardDetails(e)},beforeWidgetIconRendered:function(e){Fd._onBoldBIDashboardBeforeWidgetIconRendered(e)},onWidgetIconClick:function(e){Fd._onBoldBIDashboardWidgetIconClick(e)},_onFavoriteStateChange:function(e){Fd._onBoldBIDashboardUpdatefavorite(e)},beforeNavigateUrlLinking:function(e){Fd._onBoldBIBeforeNavigateUrlLinking(e)},beforeViewdataIconRender:function(e){Fd._onBoldBIBeforeViewdataIconRender(e)},beforeControlMenuOpen:function(e){Fd._onBoldBIBeforeControlMenuOpen(e)},beforeDashboardMobileMenuOpen:function(e){Fd._onBoldBIBeforeDashboardMobileMenuOpen(e)},ajaxBeforeLoad:function(e){Fd._onBoldBIAjaxBeforeLoad(e)},beforeDesignerToolbarButtonsRendered:function(e){Fd._onBoldBIbeforeDesignerToolbarButtonsRendered(e)},onControlMenuClick:function(e){Fd._onBoldBIonControlMenuClick(e)},beforeDatasourceToolbarButtonsRendered:function(e){Fd._onBoldBIbeforeDatasourceToolbarButtonsRendered(e)},beforeDatasourceToolbarIconsRendered:function(e){Fd._onBoldBIbeforeDatasourceToolbarIconsRendered(e)},beforeDesignerToolbarIconsRendered:function(e){Fd._onBoldBIbeforeDesignerToolbarIconsRendered(e)},toolbarClick:function(e){Fd._onBoldBItoolbarClick(e)},beforeWidgetItemsListed:function(e){Fd._onBoldBIbeforeWidgetItemsListed(e)},beforeWidgetLayoutRender:function(e){Fd._onBoldBIbeforeWidgetLayoutRender(e)}},(Pd||this.embedOptions.mode==BoldBI.Mode.AIAssistant)&&(Rd.filterOverviewSettings={showSaveIcon:"boolean"==typeof(null===($e=null===(Re=this.embedOptions.dashboardSettings)||void 0===Re?void 0:Re.filterOverviewSettings)||void 0===$e?void 0:$e.showSaveIcon)?null===(He=null===(je=this.embedOptions.dashboardSettings)||void 0===je?void 0:je.filterOverviewSettings)||void 0===He?void 0:He.showSaveAsIcon:null!==(Ge=null===(Je=null===(Qe=null===(qe=this.embedOptions.settings)||void 0===qe?void 0:qe.viewer)||void 0===Qe?void 0:Qe.filterOverview)||void 0===Je?void 0:Je.save)&&void 0!==Ge&&Ge,showSaveAsIcon:"boolean"==typeof(null===(Xe=null===(Ke=this.embedOptions.dashboardSettings)||void 0===Ke?void 0:Ke.filterOverviewSettings)||void 0===Xe?void 0:Xe.showSaveAsIcon)?null===(Ye=null===(Ze=this.embedOptions.dashboardSettings)||void 0===Ze?void 0:Ze.filterOverviewSettings)||void 0===Ye?void 0:Ye.showSaveAsIcon:null!==(si=null===(ti=null===(ii=null===(ei=this.embedOptions.settings)||void 0===ei?void 0:ei.viewer)||void 0===ii?void 0:ii.filterOverview)||void 0===ti?void 0:ti.saveAs)&&void 0!==si&&si,showViewSavedFilterIcon:"boolean"==typeof(null===(ni=null===(oi=this.embedOptions.dashboardSettings)||void 0===oi?void 0:oi.filterOverviewSettings)||void 0===ni?void 0:ni.showViewSavedFilterIcon)?null===(ai=null===(di=this.embedOptions.dashboardSettings)||void 0===di?void 0:di.filterOverviewSettings)||void 0===ai?void 0:ai.showViewSavedFilterIcon:null!==(mi=null===(bi=null===(li=null===(ri=this.embedOptions.settings)||void 0===ri?void 0:ri.viewer)||void 0===li?void 0:li.filterOverview)||void 0===bi?void 0:bi.viewSavedFilter)&&void 0!==mi&&mi,viewId:this._isNullOrUndefined(null===(hi=this.embedOptions.dashboardSettings)||void 0===hi?void 0:hi.filterOverviewSettings)||this._isEmptyOrSpaces(this.embedOptions.dashboardSettings.filterOverviewSettings.viewId)?this._isNullOrUndefined(null===(pi=null===(ci=this.embedOptions.settings)||void 0===ci?void 0:ci.viewer)||void 0===pi?void 0:pi.filterOverview)||this._isEmptyOrSpaces(this.embedOptions.settings.viewer.filterOverview.viewId)?null:this.embedOptions.settings.viewer.filterOverview.viewId:this.embedOptions.dashboardSettings.filterOverviewSettings.viewId,viewName:this._isNullOrUndefined(null===(ui=this.embedOptions.dashboardSettings)||void 0===ui?void 0:ui.filterOverviewSettings)||this._isEmptyOrSpaces(this.embedOptions.dashboardSettings.filterOverviewSettings.viewName)?this._isNullOrUndefined(null===(vi=null===(gi=this.embedOptions.settings)||void 0===gi?void 0:gi.viewer)||void 0===vi?void 0:vi.filterOverview)||this._isEmptyOrSpaces(this.embedOptions.settings.viewer.filterOverview.viewName)?null:this.embedOptions.settings.viewer.filterOverview.viewName:this.embedOptions.dashboardSettings.filterOverviewSettings.viewName});const qd=Vd||Pd&&!this._isEmptyOrSpaces(this.embedOptions.dashboardId)&&(!Array.isArray(this.embedOptions.dashboardIds)||0===this.embedOptions.dashboardIds.length)&&this._isEmptyOrSpaces(this.embedOptions.pinboardName)&&(!Array.isArray(this.pinboardIds)||0===this.pinboardIds.length);if(Pd||Vd){const e=null===(fi=this.embedOptions.settings)||void 0===fi?void 0:fi.dashboardExperience,i=null==e?void 0:e.widgetProgress,t=null===(Ii=null===(wi=this.embedOptions.settings)||void 0===wi?void 0:wi.designer)||void 0===Ii?void 0:Ii.widgetsPanel,s="string"!=typeof(null==t?void 0:t.displayMode)||this._isEmptyOrSpaces(t.displayMode)?enum_1.WidgetPanelDisplayMode.Both:t.displayMode,o=function(e){return!!qd&&("boolean"!=typeof e||e)},n=null===(Oi=this.embedOptions.settings)||void 0===Oi?void 0:Oi.customErrorMessage;Rd.configInfo=Object.assign(Object.assign({},Rd.configInfo),{Designer:Object.assign(Object.assign({},null===(_i=Rd.configInfo)||void 0===_i?void 0:_i.Designer),{DashboardExperience:{EnableSkeletonLoading:o(null==e?void 0:e.enableSkeletonLoading),WidgetProgress:{ShowInBanner:o(null==i?void 0:i.showInBanner),ShowInDetailsView:o(null==i?void 0:i.showInDetailsView),ShowInWidgets:o(null==i?void 0:i.showInWidgets)},WidgetPanel:{EnableModernLayout:o(null==t?void 0:t.enableModernLayout),DisplayMode:s}},CustomErrorMessage:{CustomMessage:null!==(yi=null==n?void 0:n.customMessage)&&void 0!==yi?yi:""}})})}if(this.loadMultipleWidget){var kd=this.embedOptions.widgetList;kd.forEach(e=>{const i=document.createElement("div");i.id=`${e.containerId}_embeddedbi`,i.style.width="100%",i.style.height="100%";var t=document.getElementById(e.containerId);t&&t.append(i)});const i="string"==typeof e.Data.WidgetList?JSON.parse(e.Data.WidgetList):e.Data.WidgetList,t={};Object.keys(i).forEach(e=>{t[e.toLowerCase()]=i[e]});const s=kd.map(e=>{const i=e.widgetName.toLowerCase();return{widgetId:t[i]||"",container:`${e.containerId}_embeddedbi`}});Rd.loadMultipleWidget=this.loadMultipleWidget,Rd.multipleWidgetsCollection=s}if(""==this.embedOptions.widgetList&&(Rd.actionBegin=function(e){Fd._onBoldBIDashboardInstaceActionBegin(e,Td)}),(this.embedOptions.mode!=BoldBI.Mode.View||this.isWidgetMode||this.isMultipleWidgetMode||this.isPinboardRendering)&&this.embedOptions.mode!=BoldBI.Mode.Design&&this.embedOptions.mode!=BoldBI.Mode.AIAssistant||(Rd.languageSettings={hideLanguageDropdown:"boolean"==typeof(null===(Ei=this.embedOptions.languageSettings)||void 0===Ei?void 0:Ei.hideLanguageDropdown)?this.embedOptions.languageSettings.hideLanguageDropdown:null!==(Bi=null===(Si=null===(Di=this.embedOptions.settings)||void 0===Di?void 0:Di.language)||void 0===Si?void 0:Si.hideDropdown)&&void 0!==Bi&&Bi,languageCode:this._isEmptyOrSpaces(null===(xi=null===(Ci=this.embedOptions)||void 0===Ci?void 0:Ci.languageSettings)||void 0===xi?void 0:xi.languageCode)?this._isEmptyOrSpaces(null===(Fi=null===(Ai=null===(Mi=this.embedOptions)||void 0===Mi?void 0:Mi.settings)||void 0===Ai?void 0:Ai.language)||void 0===Fi?void 0:Fi.code)?"":this.embedOptions.settings.language.code:this.embedOptions.languageSettings.languageCode},Rd.customBrandSettings={hideHelpLink:"boolean"==typeof(null===(Ti=this.embedOptions.customBrandSettings)||void 0===Ti?void 0:Ti.hideHelpLink)?this.embedOptions.customBrandSettings.hideHelpLink:null!==(Ni=null===(Li=null===(ki=this.embedOptions.settings)||void 0===ki?void 0:ki.brand)||void 0===Li?void 0:Li.hideHelpLink)&&void 0!==Ni&&Ni,customBrandName:this._isEmptyOrSpaces(null===(zi=null===(Wi=this.embedOptions)||void 0===Wi?void 0:Wi.customBrandSettings)||void 0===zi?void 0:zi.customBrandName)?this._isEmptyOrSpaces(null===(Ui=null===(Vi=null===(Pi=this.embedOptions)||void 0===Pi?void 0:Pi.settings)||void 0===Vi?void 0:Vi.brand)||void 0===Ui?void 0:Ui.name)?"":this.embedOptions.settings.brand.name:this.embedOptions.customBrandSettings.customBrandName,customDomain:this._isEmptyOrSpaces(null===($i=null===(Ri=this.embedOptions)||void 0===Ri?void 0:Ri.customBrandSettings)||void 0===$i?void 0:$i.customDomain)?this._isEmptyOrSpaces(null===(qi=null===(Hi=null===(ji=this.embedOptions)||void 0===ji?void 0:ji.settings)||void 0===Hi?void 0:Hi.brand)||void 0===qi?void 0:qi.domain)?"":this.embedOptions.settings.brand.domain:this.embedOptions.customBrandSettings.customDomain}),this.embedOptions.enableDomainMasking||(this.embedOptions.mode==BoldBI.Mode.View&&!this.isPinboardRendering||this.embedOptions.mode==BoldBI.Mode.Design)&&(Rd.enableMobileView=this.restrictMobileView,this.embedOptions.isPublicDashboard||this.embedOptions.embedToken||!Ld.IsAnonymousUser||(Rd.anonymousUserEmail=Ld.email)),this.embedOptions.mode==BoldBI.Mode.Design){(this.authToken&&!this.embedOptions.dashboardId||!this.authToken&&!this.embedOptions.enableDomainMasking&&!this._isNullOrUndefined(Ld)&&Ld.ItemDetail.IsDraft)&&(Rd.dashboardPath="","string"!=typeof this.embedOptions.datasourceId||this._isEmptyOrSpaces(this.embedOptions.datasourceId)||(Rd.datasource=this.embedOptions.datasourceId));const e=this._isNullOrUndefined(Ld)||this.embedOptions.enableDomainMasking||this._isEmptyOrSpaces(Ld.DatasourceId)?"":Ld.DatasourceId;this._isEmptyOrSpaces(e)||(Rd.datasource=e);const i=Array.isArray(null===(Qi=this.embedOptions)||void 0===Qi?void 0:Qi.datasources)&&this.embedOptions.datasources.length>0?this.embedOptions.datasources:Array.isArray(null===(Gi=null===(Ji=this.embedOptions)||void 0===Ji?void 0:Ji.settings)||void 0===Gi?void 0:Gi.datasources)&&this.embedOptions.settings.datasources.length>0?this.embedOptions.settings.datasources:[];Rd.datasources=i,Rd.disableAutoRecover=this.disableAutoRecover,Rd.schedule={endPoint:this.scheduleEndpointUrl,summaryText:""},Rd.serverSettings={isAdmin:!this.embedOptions.enableDomainMasking&&(void 0!==Ld.IsAdmin&&Ld.IsAdmin)},Rd.intermediateDbStatus=this.embedOptions.enableDomainMasking?void 0:Ld.IntermediateDbStatus,Rd.connectionList=this.embedOptions.enableDomainMasking?void 0:Ld.ConnectionList,Rd.isAllowUserToCreateDatasource=this.embedOptions.enableDomainMasking?void 0:Ld.CanCreateDatasource,Rd.enablePublicDashboardSetting=!1,Rd.beforeNavigateToDashboard=function(e){Fd._onBoldBIBeforeNavigateToDashboard(e)},Rd.toolbarSettings={showToolbar:"boolean"==typeof(null===(Ki=this.embedOptions.toolbarSettings)||void 0===Ki?void 0:Ki.showToolbar)?this.embedOptions.toolbarSettings.showToolbar:null===(et=null===(Yi=null===(Zi=null===(Xi=this.embedOptions.settings)||void 0===Xi?void 0:Xi.designer)||void 0===Zi?void 0:Zi.toolbar)||void 0===Yi?void 0:Yi.enabled)||void 0===et||et},Rd.predefinedWidgets={categoryName:this._isEmptyOrSpaces(null===(tt=null===(it=this.embedOptions)||void 0===it?void 0:it.preConfiguredWidgets)||void 0===tt?void 0:tt.categoryName)?this._isEmptyOrSpaces(null===(dt=null===(nt=null===(ot=null===(st=this.embedOptions)||void 0===st?void 0:st.settings)||void 0===ot?void 0:ot.designer)||void 0===nt?void 0:nt.preConfiguredWidgets)||void 0===dt?void 0:dt.categoryName)?"":this.embedOptions.settings.designer.preConfiguredWidgets.categoryName:this.embedOptions.preConfiguredWidgets.categoryName,dashboardId:this._isEmptyOrSpaces(null===(rt=null===(at=this.embedOptions)||void 0===at?void 0:at.preConfiguredWidgets)||void 0===rt?void 0:rt.dashboardId)?this._isEmptyOrSpaces(null===(ht=null===(mt=null===(bt=null===(lt=this.embedOptions)||void 0===lt?void 0:lt.settings)||void 0===bt?void 0:bt.designer)||void 0===mt?void 0:mt.preConfiguredWidgets)||void 0===ht?void 0:ht.dashboardId)?"":this.embedOptions.settings.designer.preConfiguredWidgets.dashboardId:this.embedOptions.preConfiguredWidgets.dashboardId},this.embedOptions.environment==BoldBI.Environment.Enterprise?Rd.configuration=this.embedOptions.enableDomainMasking?" ":this.rootUrl+"/webdesignerservice/scripts/settings/"+Ld.Branding+"/settings.min.js":Rd.configuration=this.cdnLink+"/scripts/settings/"+Ld.Branding+"/settings.min.js",Rd.designerSettings={widgetsPanel:{hideExistingWidgets:"boolean"==typeof(null===(pt=null===(ct=this.embedOptions.dashboardSettings)||void 0===ct?void 0:ct.widgetsPanel)||void 0===pt?void 0:pt.hideExistingWidgets)?this.embedOptions.dashboardSettings.widgetsPanel.hideExistingWidgets:null!==(ft=null===(vt=null===(gt=null===(ut=this.embedOptions.settings)||void 0===ut?void 0:ut.designer)||void 0===gt?void 0:gt.widgetsPanel)||void 0===vt?void 0:vt.hideExistingWidgets)&&void 0!==ft&&ft,hideDefaultWidgets:"boolean"==typeof(null===(It=null===(wt=this.embedOptions.dashboardSettings)||void 0===wt?void 0:wt.widgetsPanel)||void 0===It?void 0:It.hideDefaultWidgets)?this.embedOptions.dashboardSettings.widgetsPanel.hideDefaultWidgets:null!==(Et=null===(yt=null===(_t=null===(Ot=this.embedOptions.settings)||void 0===Ot?void 0:Ot.designer)||void 0===_t?void 0:_t.widgetsPanel)||void 0===yt?void 0:yt.hideDefaultWidgets)&&void 0!==Et&&Et,defaultPanelDisplayText:(null===(St=null===(Dt=this.embedOptions.settings)||void 0===Dt?void 0:Dt.designer)||void 0===St?void 0:St.widgetsPanel)?null===(Ct=null===(Bt=this.embedOptions.settings)||void 0===Bt?void 0:Bt.designer)||void 0===Ct?void 0:Ct.widgetsPanel.defaultPanelDisplayText:"",existingPanelDisplayText:(null===(Mt=null===(xt=this.embedOptions.settings)||void 0===xt?void 0:xt.designer)||void 0===Mt?void 0:Mt.widgetsPanel)?null===(Ft=null===(At=this.embedOptions.settings)||void 0===At?void 0:At.designer)||void 0===Ft?void 0:Ft.widgetsPanel.existingPanelDisplayText:"",defaultPanelSearchPlaceholder:(null===(kt=null===(Tt=this.embedOptions.settings)||void 0===Tt?void 0:Tt.designer)||void 0===kt?void 0:kt.widgetsPanel)?null===(Nt=null===(Lt=this.embedOptions.settings)||void 0===Lt?void 0:Lt.designer)||void 0===Nt?void 0:Nt.widgetsPanel.defaultPanelSearchPlaceholder:"",existingPanelSearchPlaceholder:(null===(zt=null===(Wt=this.embedOptions.settings)||void 0===Wt?void 0:Wt.designer)||void 0===zt?void 0:zt.widgetsPanel)?null===(Vt=null===(Pt=this.embedOptions.settings)||void 0===Pt?void 0:Pt.designer)||void 0===Vt?void 0:Vt.widgetsPanel.existingPanelSearchPlaceholder:"",existingDashboards:Array.isArray(null===(Rt=null===(Ut=this.embedOptions.dashboardSettings)||void 0===Ut?void 0:Ut.widgetsPanel)||void 0===Rt?void 0:Rt.existingDashboards)&&this.embedOptions.dashboardSettings.widgetsPanel.existingDashboards.length>0?this.embedOptions.dashboardSettings.widgetsPanel.existingDashboards:Array.isArray(null===(Ht=null===(jt=null===($t=this.embedOptions.settings)||void 0===$t?void 0:$t.designer)||void 0===jt?void 0:jt.widgetsPanel)||void 0===Ht?void 0:Ht.existingDashboards)&&this.embedOptions.settings.designer.widgetsPanel.existingDashboards.length>0?this.embedOptions.settings.designer.widgetsPanel.existingDashboards:[],dragAndDropSettings:{rowSpan:null!==(Kt=null===(Gt=null===(Jt=null===(Qt=null===(qt=this.embedOptions.settings)||void 0===qt?void 0:qt.designer)||void 0===Qt?void 0:Qt.widgetsPanel)||void 0===Jt?void 0:Jt.dragAndDropSettings)||void 0===Gt?void 0:Gt.rowSpan)&&void 0!==Kt?Kt:null,columnSpan:null!==(is=null===(es=null===(Yt=null===(Zt=null===(Xt=this.embedOptions.settings)||void 0===Xt?void 0:Xt.designer)||void 0===Zt?void 0:Zt.widgetsPanel)||void 0===Yt?void 0:Yt.dragAndDropSettings)||void 0===es?void 0:es.columnSpan)&&void 0!==is?is:null,isWidgetMode:null!==(ds=null===(ns=null===(os=null===(ss=null===(ts=this.embedOptions.settings)||void 0===ts?void 0:ts.designer)||void 0===ss?void 0:ss.widgetsPanel)||void 0===os?void 0:os.dragAndDropSettings)||void 0===ns?void 0:ns.isWidgetMode)&&void 0!==ds&&ds}},dataSourceConfig:{hideDataSourceConfig:"boolean"==typeof(null===(rs=null===(as=this.embedOptions.dashboardSettings)||void 0===as?void 0:as.dataSourceConfig)||void 0===rs?void 0:rs.hideDataSourceConfig)?this.embedOptions.dashboardSettings.dataSourceConfig.hideDataSourceConfig:null!==(hs=null===(ms=null===(bs=null===(ls=this.embedOptions.settings)||void 0===ls?void 0:ls.designer)||void 0===bs?void 0:bs.dataSourceConfig)||void 0===ms?void 0:ms.hideDataSourceConfig)&&void 0!==hs&&hs,hideSampleDataSources:"boolean"==typeof(null===(ps=null===(cs=this.embedOptions.dashboardSettings)||void 0===cs?void 0:cs.dataSourceConfig)||void 0===ps?void 0:ps.hideSampleDataSources)?this.embedOptions.dashboardSettings.dataSourceConfig.hideSampleDataSources:null!==(fs=null===(vs=null===(gs=null===(us=this.embedOptions.settings)||void 0===us?void 0:us.designer)||void 0===gs?void 0:gs.dataSourceConfig)||void 0===vs?void 0:vs.hideSampleDataSources)&&void 0!==fs&&fs,hideDataSourceList:"boolean"==typeof(null===(Is=null===(ws=this.embedOptions.dashboardSettings)||void 0===ws?void 0:ws.dataSourceConfig)||void 0===Is?void 0:Is.hideDataSourceList)?this.embedOptions.dashboardSettings.dataSourceConfig.hideDataSourceList:null!==(Es=null===(ys=null===(_s=null===(Os=this.embedOptions.settings)||void 0===Os?void 0:Os.designer)||void 0===_s?void 0:_s.dataSourceConfig)||void 0===ys?void 0:ys.hideDataSourceList)&&void 0!==Es&&Es,hideExpression:"boolean"==typeof(null===(Ss=null===(Ds=this.embedOptions.dashboardSettings)||void 0===Ds?void 0:Ds.dataSourceConfig)||void 0===Ss?void 0:Ss.hideExpression)?this.embedOptions.dashboardSettings.dataSourceConfig.hideExpression:null!==(Ms=null===(xs=null===(Cs=null===(Bs=this.embedOptions.settings)||void 0===Bs?void 0:Bs.designer)||void 0===Cs?void 0:Cs.dataSourceConfig)||void 0===xs?void 0:xs.hideExpression)&&void 0!==Ms&&Ms},hidePropertySettingIcon:null===(Fs=null===(As=this.embedOptions.settings)||void 0===As?void 0:As.designer)||void 0===Fs?void 0:Fs.hideSettings},Rd.userSettings={hidePreviewAs:"boolean"==typeof(null===(Ts=this.embedOptions.dashboardSettings)||void 0===Ts?void 0:Ts.showPreviewAs)?!this.embedOptions.dashboardSettings.showPreviewAs:!(null===(Ns=null===(Ls=null===(ks=this.embedOptions.settings)||void 0===ks?void 0:ks.designer)||void 0===Ls?void 0:Ls.previewAs)||void 0===Ns||Ns)}}this.embedOptions.mode==BoldBI.Mode.Connection&&(Rd.connectionList=Ld.ConnectionList),this.embedOptions.mode==BoldBI.Mode.DataSource&&(Rd.itemId=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?Ld.ItemDetail.Id:this.embedOptions.datasourceId,Rd.datasourceName=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?Ld.ItemDetail.Name:this.embedOptions.datasourceName,Rd.datasource=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?Ld.ItemDetail.Id:this.embedOptions.datasourceId),this.isMultipleWidgetMode=""!=this.embedOptions.widgetList&&this.isMultipleWidgetMode,this.isWidgetMode&&(Rd.isPinWidget=this.isWidgetMode,Rd.widgetId=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?Ld.WidgetId:this.widgetName);const Qd="boolean"==typeof(null===(Ws=this.embedOptions.dashboardSettings)||void 0===Ws?void 0:Ws.showHeader)?this.embedOptions.dashboardSettings.showHeader:null===(Vs=null===(Ps=null===(zs=this.embedOptions.settings)||void 0===zs?void 0:zs.viewer)||void 0===Ps?void 0:Ps.header)||void 0===Vs||Vs;Rd.isHideHeader=0==Qd,this.isMultiTab&&(Rd.dashboardSettings={parentId:this.parentDbrdId,isMultiTab:null!=this.parentDbrdId&&""!==this.parentDbrdId});("boolean"==typeof(null===(Us=this.embedOptions.dynamicConnection)||void 0===Us?void 0:Us.isEnabled)?this.embedOptions.dynamicConnection.isEnabled:null!==(js=null===($s=null===(Rs=this.embedOptions.settings)||void 0===Rs?void 0:Rs.dynamicConnection)||void 0===$s?void 0:$s.enabled)&&void 0!==js&&js)&&(Rd.customIdentity=this._isEmptyOrSpaces(null===(qs=null===(Hs=this.embedOptions)||void 0===Hs?void 0:Hs.dynamicConnection)||void 0===qs?void 0:qs.identity)?this._isEmptyOrSpaces(null===(Gs=null===(Js=null===(Qs=this.embedOptions)||void 0===Qs?void 0:Qs.settings)||void 0===Js?void 0:Js.dynamicConnection)||void 0===Gs?void 0:Gs.identity)?"":this.embedOptions.settings.dynamicConnection.identity:this.embedOptions.dynamicConnection.identity);if(("boolean"==typeof(null===(Ks=this.embedOptions.autoRefreshSettings)||void 0===Ks?void 0:Ks.enabled)?null===(Xs=this.embedOptions.autoRefreshSettings)||void 0===Xs?void 0:Xs.enabled:null!==(io=null===(eo=null===(Ys=null===(Zs=this.embedOptions.settings)||void 0===Zs?void 0:Zs.viewer)||void 0===Ys?void 0:Ys.autoRefresh)||void 0===eo?void 0:eo.enabled)&&void 0!==io&&io)&&(Rd.enableAutoRefresh=!0,Rd.autoRefreshSettings={intervalSettings:{mode:"Hourly",hourlySchedule:{hours:"number"==typeof(null===(to=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===to?void 0:to.hours)?null===(so=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===so?void 0:so.hours:null===(ao=null===(no=null===(oo=this.embedOptions.settings.viewer)||void 0===oo?void 0:oo.autoRefresh)||void 0===no?void 0:no.hourlySchedule)||void 0===ao?void 0:ao.hours,minutes:"number"==typeof(null===(ro=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===ro?void 0:ro.minutes)?null===(lo=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===lo?void 0:lo.minutes:null===(ho=null===(mo=null===(bo=this.embedOptions.settings.viewer)||void 0===bo?void 0:bo.autoRefresh)||void 0===mo?void 0:mo.hourlySchedule)||void 0===ho?void 0:ho.minutes,seconds:"number"==typeof(null===(co=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===co?void 0:co.seconds)?null===(po=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===po?void 0:po.seconds:null===(vo=null===(go=null===(uo=this.embedOptions.settings.viewer)||void 0===uo?void 0:uo.autoRefresh)||void 0===go?void 0:go.hourlySchedule)||void 0===vo?void 0:vo.seconds}}}),this.embedOptions.mode==BoldBI.Mode.AIAssistant&&(Rd.isUnifiedAI=!0,Rd.dataSourceId=this.embedOptions.dataSourceId,Rd.dashboardApiUrl=this.dashboardServerApiUrl),(!this.loadMultipleWidget&&((null===(fo=this.embedOptions.embedAiAssistant)||void 0===fo?void 0:fo.enabled)||(null===(Io=null===(wo=this.embedOptions.settings)||void 0===wo?void 0:wo.aiAssistant)||void 0===Io?void 0:Io.enabled))||this.embedOptions.mode==BoldBI.Mode.AIAssistant)&&(Rd.embedAiAssistant={enableAiAssistant:!0,aiAssistantPosition:this._isEmptyOrSpaces(null===(_o=null===(Oo=this.embedOptions)||void 0===Oo?void 0:Oo.embedAiAssistant)||void 0===_o?void 0:_o.position)?this._isEmptyOrSpaces(null===(Do=null===(Eo=null===(yo=this.embedOptions)||void 0===yo?void 0:yo.settings)||void 0===Eo?void 0:Eo.aiAssistant)||void 0===Do?void 0:Do.position)?"bottom":this.embedOptions.settings.aiAssistant.position:this.embedOptions.embedAiAssistant.position,hideAIDataUsage:"boolean"==typeof(null===(So=this.embedOptions.embedAiAssistant)||void 0===So?void 0:So.hideAiDataUsage)?null===(Bo=this.embedOptions.embedAiAssistant)||void 0===Bo?void 0:Bo.hideAiDataUsage:"boolean"==typeof(null===(xo=null===(Co=this.embedOptions.settings)||void 0===Co?void 0:Co.aiAssistant)||void 0===xo?void 0:xo.hideUsageAnalytics)?null===(Ao=null===(Mo=this.embedOptions.settings)||void 0===Mo?void 0:Mo.aiAssistant)||void 0===Ao?void 0:Ao.hideUsageAnalytics:null!==(Lo=null===(ko=null===(To=null===(Fo=this.embedOptions.settings)||void 0===Fo?void 0:Fo.aiAssistant)||void 0===To?void 0:To.hideIcons)||void 0===ko?void 0:ko.usageAnalytics)&&void 0!==Lo&&Lo,hideAIChatHelp:"boolean"==typeof(null===(Wo=null===(No=this.embedOptions.embedAiAssistant)||void 0===No?void 0:No.hideIcons)||void 0===Wo?void 0:Wo.helpLink)?null===(Po=null===(zo=this.embedOptions.embedAiAssistant)||void 0===zo?void 0:zo.hideIcons)||void 0===Po?void 0:Po.helpLink:null!==(Ro=null===(Uo=null===(Vo=this.embedOptions.settings)||void 0===Vo?void 0:Vo.aiAssistant)||void 0===Uo?void 0:Uo.hideChatHelp)&&void 0!==Ro&&Ro,enableChatHistory:"boolean"!=typeof(null===(Ho=null===(jo=null===($o=this.embedOptions.settings)||void 0===$o?void 0:$o.aiAssistant)||void 0===jo?void 0:jo.hideIcons)||void 0===Ho?void 0:Ho.history)||!this.embedOptions.settings.aiAssistant.hideIcons.history,enableNewSession:"boolean"!=typeof(null===(Jo=null===(Qo=null===(qo=this.embedOptions.settings)||void 0===qo?void 0:qo.aiAssistant)||void 0===Qo?void 0:Qo.hideIcons)||void 0===Jo?void 0:Jo.newSession)||!this.embedOptions.settings.aiAssistant.hideIcons.newSession,showBetaTag:"boolean"!=typeof(null===(Ko=null===(Go=this.embedOptions.settings)||void 0===Go?void 0:Go.aiAssistant)||void 0===Ko?void 0:Ko.hideBetaTag)||!this.embedOptions.settings.aiAssistant.hideBetaTag,headerTextColorHex:this._isEmptyOrSpaces(null===(Zo=null===(Xo=this.embedOptions.settings)||void 0===Xo?void 0:Xo.aiAssistant)||void 0===Zo?void 0:Zo.headerTextColor)?"":this.embedOptions.settings.aiAssistant.headerTextColor,showChatLogo:"boolean"!=typeof(null===(en=null===(Yo=this.embedOptions.settings)||void 0===Yo?void 0:Yo.aiAssistant)||void 0===en?void 0:en.hideLogo)||!this.embedOptions.settings.aiAssistant.hideLogo,showWelcomeMessage:"boolean"!=typeof(null===(sn=null===(tn=this.embedOptions.settings)||void 0===tn?void 0:tn.aiAssistant)||void 0===sn?void 0:sn.hideWelcomeNote)||!this.embedOptions.settings.aiAssistant.hideWelcomeNote,showDashboardCategory:"boolean"!=typeof(null===(nn=null===(on=this.embedOptions.settings)||void 0===on?void 0:on.aiAssistant)||void 0===nn?void 0:nn.hideDashboardTag)||!this.embedOptions.settings.aiAssistant.hideDashboardTag,showDatasourceCategory:"boolean"!=typeof(null===(an=null===(dn=this.embedOptions.settings)||void 0===dn?void 0:dn.aiAssistant)||void 0===an?void 0:an.hideDatasourceTag)||!this.embedOptions.settings.aiAssistant.hideDatasourceTag,dashboardId:Array.isArray(null===(ln=null===(rn=this.embedOptions.settings)||void 0===rn?void 0:rn.aiAssistant)||void 0===ln?void 0:ln.dashboards)&&(null===(mn=null===(bn=this.embedOptions.settings)||void 0===bn?void 0:bn.aiAssistant)||void 0===mn?void 0:mn.dashboards.length)>0?this.embedOptions.settings.aiAssistant.dashboards:[],datasourceId:Array.isArray(null===(cn=null===(hn=this.embedOptions.settings)||void 0===hn?void 0:hn.aiAssistant)||void 0===cn?void 0:cn.dataSources)&&(null===(un=null===(pn=this.embedOptions.settings)||void 0===pn?void 0:pn.aiAssistant)||void 0===un?void 0:un.dataSources.length)>0?this.embedOptions.settings.aiAssistant.dataSources:[],suggestionCount:"number"==typeof(null===(vn=null===(gn=this.embedOptions.settings)||void 0===gn?void 0:gn.aiAssistant)||void 0===vn?void 0:vn.queryDisplayLimit)?this.embedOptions.settings.aiAssistant.queryDisplayLimit:6,customizedAITitle:this._isEmptyOrSpaces(this.embedOptions.embedAiAssistant.name)?null!==(In=null===(wn=null===(fn=this.embedOptions.settings)||void 0===fn?void 0:fn.aiAssistant)||void 0===wn?void 0:wn.name)&&void 0!==In?In:"":this.embedOptions.embedAiAssistant.name,customizedUserName:null!==(yn=null===(_n=null===(On=this.embedOptions.settings)||void 0===On?void 0:On.aiAssistant)||void 0===_n?void 0:_n.userName)&&void 0!==yn?yn:"",customDashboardSummaryIntroText:null!==(Sn=null===(Dn=null===(En=this.embedOptions.settings)||void 0===En?void 0:En.aiAssistant)||void 0===Dn?void 0:Dn.aiSummaryIntroMessage)&&void 0!==Sn?Sn:"",aiAssistantCustomPrompt:{welcomeMessage:null!==(xn=null===(Cn=null===(Bn=this.embedOptions.settings)||void 0===Bn?void 0:Bn.aiAssistant)||void 0===Cn?void 0:Cn.welcomeMessage)&&void 0!==xn?xn:"",exploreMessage:null!==(Fn=null===(An=null===(Mn=this.embedOptions.settings)||void 0===Mn?void 0:Mn.aiAssistant)||void 0===An?void 0:An.exploreMessage)&&void 0!==Fn?Fn:""},dashboardAiAssistantCustomPrompt:{welcomeMessage:null!==(Ln=null===(kn=null===(Tn=this.embedOptions.settings)||void 0===Tn?void 0:Tn.aiAssistant)||void 0===kn?void 0:kn.welcomeMessage)&&void 0!==Ln?Ln:"",exploreMessage:null!==(zn=null===(Wn=null===(Nn=this.embedOptions.settings)||void 0===Nn?void 0:Nn.aiAssistant)||void 0===Wn?void 0:Wn.exploreMessage)&&void 0!==zn?zn:"",widgetSuggestions:{title:null!==(Rn=null===(Un=null===(Vn=null===(Pn=this.embedOptions.settings)||void 0===Pn?void 0:Pn.aiAssistant)||void 0===Vn?void 0:Vn.widgetSuggestions)||void 0===Un?void 0:Un.title)&&void 0!==Rn?Rn:"",suggestionPrompt:null!==(qn=null===(Hn=null===(jn=null===($n=this.embedOptions.settings)||void 0===$n?void 0:$n.aiAssistant)||void 0===jn?void 0:jn.widgetSuggestions)||void 0===Hn?void 0:Hn.prompt)&&void 0!==qn?qn:""},dashboardSuggestions:{title:null!==(Kn=null===(Gn=null===(Jn=null===(Qn=this.embedOptions.settings)||void 0===Qn?void 0:Qn.aiAssistant)||void 0===Jn?void 0:Jn.dashboardSuggestions)||void 0===Gn?void 0:Gn.title)&&void 0!==Kn?Kn:"",suggestionPrompt:null!==(ed=null===(Yn=null===(Zn=null===(Xn=this.embedOptions.settings)||void 0===Xn?void 0:Xn.aiAssistant)||void 0===Zn?void 0:Zn.dashboardSuggestions)||void 0===Yn?void 0:Yn.prompt)&&void 0!==ed?ed:""}}},this.embedOptions.mode==BoldBI.Mode.AIAssistant&&(Rd.customBrandSettings=Object.assign(Object.assign({},Rd.customBrandSettings),{hideHelpLink:"boolean"==typeof(null===(sd=null===(td=null===(id=this.embedOptions.settings)||void 0===id?void 0:id.aiAssistant)||void 0===td?void 0:td.hideIcons)||void 0===sd?void 0:sd.helpLink)&&(null===(nd=null===(od=this.embedOptions.settings)||void 0===od?void 0:od.aiAssistant.hideIcons)||void 0===nd?void 0:nd.helpLink)}))),Rd.isAiSummariesEnabledGlobally="boolean"==typeof(null===(ad=null===(dd=this.embedOptions.embedAiAssistant)||void 0===dd?void 0:dd.summary)||void 0===ad?void 0:ad.enabled)?null===(ld=null===(rd=this.embedOptions.embedAiAssistant)||void 0===rd?void 0:rd.summary)||void 0===ld?void 0:ld.enabled:null!==(cd=null===(hd=null===(md=null===(bd=this.embedOptions.settings)||void 0===bd?void 0:bd.aiAssistant)||void 0===md?void 0:md.summary)||void 0===hd?void 0:hd.enabled)&&void 0!==cd&&cd,Rd.isAiSummariesEnabledGlobally&&(Rd.embedAiAssistant=Rd.embedAiAssistant||{},Rd.embedAiAssistant.summarization=Rd.embedAiAssistant.summarization||{},Rd.embedAiAssistant.summarization.enableWidgetSummary="boolean"==typeof(null===(ud=null===(pd=this.embedOptions.embedAiAssistant)||void 0===pd?void 0:pd.summary)||void 0===ud?void 0:ud.includeWidgetSummary)?null===(vd=null===(gd=this.embedOptions.embedAiAssistant)||void 0===gd?void 0:gd.summary)||void 0===vd?void 0:vd.includeWidgetSummary:null!==(Id=null===(wd=null===(fd=this.embedOptions.settings.aiAssistant)||void 0===fd?void 0:fd.summary)||void 0===wd?void 0:wd.widget)&&void 0!==Id&&Id,Rd.embedAiAssistant.summarization.enableDashboardSummary="boolean"==typeof(null===(_d=null===(Od=this.embedOptions.embedAiAssistant)||void 0===Od?void 0:Od.summary)||void 0===_d?void 0:_d.includeDashboardSummary)?null===(Ed=null===(yd=this.embedOptions.embedAiAssistant)||void 0===yd?void 0:yd.summary)||void 0===Ed?void 0:Ed.includeDashboardSummary:null!==(Cd=null===(Bd=null===(Sd=null===(Dd=this.embedOptions.settings)||void 0===Dd?void 0:Dd.aiAssistant)||void 0===Sd?void 0:Sd.summary)||void 0===Bd?void 0:Bd.dashboard)&&void 0!==Cd&&Cd),Fd.embedOptions.mode==BoldBI.Mode.AIAssistant){if(void 0===window.BoldBIAI||!window.BoldBIAI.UnifiedAIAgent)throw new Error(embeddingLocalization_1.errorMessages.AIAgentInitializationFailed);try{let e=window.bbEmbed.call(Fd,"#"+Td);new window.BoldBIAI.UnifiedAIAgent(e,Rd);console.log("AI Assitant initialized successfully.")}catch(e){console.error("Error initializing AI Assitant Agent:",e)}}if(Fd.embedOptions.mode!=BoldBI.Mode.AIAssistant&&window.bbEmbed instanceof Function){let e,i=window.bbEmbed.call(Fd,"#"+(Fd.pinboardIds.length>0?Td+"_embeddedbi":Fd.childContainer.id));if(0===i.length&&(i=window.bbEmbed.call(Fd,"#"+Td+"_embeddedbi"),e=Td+"_embeddedbi"),window.BoldBIDashboardDesigner instanceof Function){const t=this._getDashboardInstance(e);null!=t?(t.model=Object.assign(t.model,Rd),t.redrawDashboard()):window.BoldBIDashboardDesigner.call(Fd,i,Rd)}else this._throwError(embeddingLocalization_1.errorMessages.ErrorInBoldBIDesigner);if(1==this.isMultipleWidgetMode){const e="string"==typeof Ld.WidgetList?JSON.parse(Ld.WidgetList):Ld.WidgetList;let i=-1;if(Object.keys(e).forEach(t=>{if(i++,""==e[String(t)]){const s=embeddingLocalization_1.errorMessages.InvalidWidgetName;delete e[String(t)];const o=this.embedOptions.widgetList[Number(i)].containerId;this.errorOnContainer(s,o),this.embedOptions.widgetList.splice(i,1),i--}}),0==this.embedOptions.widgetList.length){if(this._isNullOrUndefined(this.embedOptions.events.onError)||""==this.embedOptions.events.onError)throw new Error(embeddingLocalization_1.errorMessages.InvalidAllWidgetNames);{const e=new Error(embeddingLocalization_1.errorMessages.InvalidAllWidgetNames);this.onErrorClient(e)}}Ld.WidgetList=JSON.stringify(e)}}else if(this.embedOptions.mode!=BoldBI.Mode.AIAssistant)throw new Error(embeddingLocalization_1.errorMessages.bbEmbedNotDefined);if(""==this.embedOptions.widgetList&&this._removeElementsClass(Td,".preloader-wrap","viewer-blue-loader"),this.isMultiTab&&!this.embedOptions.token&&!this.embedOptions.isPublicDashboard&&!this.embedOptions.embedToken&&Ld.ItemDetail.ItemViews){const e=null===(xd=this.embedOptions.dashboardSettings)||void 0===xd?void 0:xd.filterOverviewSettings,i=null===(Ad=null===(Md=this.embedOptions.settings)||void 0===Md?void 0:Md.viewer)||void 0===Ad?void 0:Ad.filterOverview;e&&(e.viewId=null,e.viewName=null),i&&(i.viewId=null,i.viewName=null),this.embedOptions.filterParameters=null}}}}),this._changeLayoutSuccess=this.Invoke(function(e){if(e.Status&&""!=this.homepageItemId&&this.isVirtualHomepage)this.afterVirtualHomepageSave(this.homepageItemId);else if(!e.Status)throw new Error(embeddingLocalization_1.errorMessages.LayoutFailure+e.Message)}),this._createPinboardDom=this.Invoke(function(e){const i=this;if(bbEmbed("#widget-container").attr("data-homepage-id",e.Id).attr("data-current-layout",e.ColumnInfo.Layout).attr("data-item-type",e.ItemType).attr("data-virtual-homepage",e.IsVirtualHomepage),"widget"==e.ItemType.toLowerCase()){const t=e.ColumnInfo.Column;bbEmbed.each(t,function(e){bbEmbed("#widget-container").append("<ul id=column-"+(e+1)+' class="widget-list" data-column-id='+(e+1)+"></ul>"),t[`${e}`].Item.length>0?bbEmbed.each(t[`${e}`].Item,function(s){var o,n,d,a,r;const l=null==t[`${e}`].Item[`${s}`].Id?"/bi/"+i.siteIdentifier+"/widgets/widgets":"/bi/"+i.siteIdentifier+"/dashboards",b=t[`${e}`].Item[`${s}`].Name,m=t[`${e}`].Item[`${s}`].WidgetType;let h=0;h=null!=m&&(m.includes("Card")||m.includes("Image"))?250:400;const c=null!=t[`${e}`].Item[`${s}`].QueryString?t[`${e}`].Item[`${s}`].QueryString:"",p=null==t[`${e}`].Item[`${s}`].TabId?l+"/"+t[`${e}`].Item[`${s}`].ItemId+"/"+(null!=t[`${e}`].Item[`${s}`].Id?t[`${e}`].Item[`${s}`].CategoryName+"/":"")+t[`${e}`].Item[`${s}`].ItemName+(""!=c?"?"+c:c):l+"/"+t[`${e}`].Item[`${s}`].ItemId+"/"+(null!=t[`${e}`].Item[`${s}`].Id?t[`${e}`].Item[`${s}`].CategoryName+"/":"")+t[`${e}`].Item[`${s}`].ItemName+"?tab="+t[`${e}`].Item[`${s}`].TabId+(""!=c?"&"+c:c),u=0!=s?'style="width:100%;height:100%;"':"";if(".sydj"!=t[`${e}`].Item[`${s}`].ItemExtension.toLowerCase())bbEmbed("#column-"+(e+1)).append('<li class="list-item" '+u+'><div class="widget" id=widget_'+(e+1)+"_"+(s+1)+' data-dashboardurl="'+p+'" style="height:100%;width:100%;"></div></li>');else{const t=("boolean"==typeof(null===(o=i.embedOptions.pinboardSettings)||void 0===o?void 0:o.enableUnpinWidget)?null===(n=i.embedOptions.pinboardSettings)||void 0===n?void 0:n.enableUnpinWidget:null===(r=null===(a=null===(d=i.embedOptions.settings)||void 0===d?void 0:d.pinboard)||void 0===a?void 0:a.unpinWidget)||void 0===r||r)?'<div id="widget-icons"><i class="items unpin-widget su su-delete" data-bs-toggle="tooltip" data-original-title="Unpin Widget"  style="color: black;" /></div>':"";bbEmbed("#column-"+(e+1)).append('<li class="list-item" '+u+'><div class="widget" id=widget_'+(e+1)+"_"+(s+1)+' data-dashboardurl="'+p+'" style="height: '+h+'px;width:100%;background:#fff;"><div class="widget-sortable" style="width:100%;float:left;display:block;height:0px"><div style="height:100%;width:100%;cursor:move;"><div id="item-name">'+b+"</div>"+t+"</div></div></div></li>")}}):bbEmbed("#column-"+(e+1)).append('<li class="empty click-container"><div class="empty-content empty-homepage"><span class="drag-widget" style="font-family:var(--font-family)">Drag your widgets here to customize layout</span></div></li>')});const s=bbEmbed("li.list-item a");for(let e=0;e<s.length;e++)bbEmbed("li.list-item a").eq(e).attr("href",bbEmbed("li.list-item a").eq(e).attr("data-url"))}else"dashboard"==e.ItemType.toLowerCase()&&(bbEmbed("#add-item, #layout-container, #divider").hide(),bbEmbed("#widget-container").append('<ul id="column-1" class="dashboard-column col-lg-12 col-md-12 col-sm-12 col-12" data-column-id="1"><li class="dashboard-list"><div class="dashboard" id="dashboard_1_1" style="height:100%;width:100%"></div></li></ul>'))}),this._dragAndDropSuccess=this.Invoke(function(e){if(!e.Status)throw new Error(embeddingLocalization_1.errorMessages.DragAndDropError+e.Message)}),this._renderMultiTabDashboard=this.Invoke(function(e){this.isMultiTab=!0;const i=this,t=bbEmbed("#"+i.embedOptions.embedContainerId);t.html(""),"undefined"!=typeof ejdashboard&&ejdashboard.base&&"function"==typeof ejdashboard.base.registerLicense&&ejdashboard.base.registerLicense("Ngo9BigBOggjGyl/Vkd+XU9FfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTH9Td0BiXH9ecnVWTmFfWkd3");const s=i.embedOptions.embedContainerId+"_parent_multi_tab_dashboard",o=bbEmbed('<div id="'+s+'" class="bi-dashboard parent-multitab-dbrd" style="height: 100% !important"></div>');t.append(o);const n=i.embedOptions.embedContainerId+"_multi_tab_dashboard",d=bbEmbed('<div id="'+n+'" class="multitab-dbrd" style="height: 100% !important"></div>');o.append(d);const a=bbEmbed('<div class="e-tab-header"></div>'),r=bbEmbed('<div class="e-content"></div>');bbEmbed.map(e,function(e){let t={};i.embedOptions.token||i.embedOptions.embedToken?(t.Id=e.DashboardId,t.Name=e.DashboardName,t.TabName=e.TabName||e.DashboardName):(t=JSON.parse(e.ItemDetail),t.TabName=e.TabName||t.Name),i.parentDbrdId=i.authToken?i.embedOptions.dashboardId:e.parentId;const s=t.Id.replaceAll("-","");i.dashboardDetails[`${s}`]=e,i._isNullOrUndefined(i.embedOptions.dashboardSettings.dashboardName)||"string"==typeof i.embedOptions.dashboardSettings.dashboardName||bbEmbed.map(i.embedOptions.dashboardSettings.dashboardName,function(e){t.Name=s==e.dashboardId.replaceAll("-","")?i._isEmptyOrSpaces(e.displayName)?t.Name:e.displayName:t.Name}),a.append(bbEmbed('<div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">'+t.TabName+"</div>"));const o=bbEmbed('<div style="height:100%;width:100%;overflow: hidden !important;" id="multi_'+s+'"></div>');r.append(bbEmbed("<div></div>").append(o.append('<div id="multi_'+s+'_embeddedbi" class="bbembed-multitab-dbrd"></div>')))}),d.append(a).append(r),tabInstance=new ejdashboard.navigations.Tab({enableAnimation:!1,selected:bbEmbed.proxy(this._tabSelected,this)}),tabInstance.appendTo("#"+n),bbEmbed(".e-tab-header .e-toolbar-item .e-tab-text").css({display:"inline-block",width:"150px","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis",color:"#000","font-family":"var(--font-family)","text-transform":"none"}),bbEmbed('<style type="text/css"> .embed-multi-tab-indicator{ background: var(--primary-branding-color) !important; border-radius: 4px; display: block !important; height: 5px !important;}</style>').appendTo("head"),bbEmbed(".e-control.e-tab .e-tab-header .e-indicator").addClass("embed-multi-tab-indicator"),bbEmbed.map(bbEmbed(".e-tab-header .e-toolbar-item .e-tab-text"),function(e,i){bbEmbed(e).attr("title",bbEmbed(e).text()),bbEmbed(bbEmbed(".e-content").find("#e-content-multi_tab_dashboard_"+i).children()).css({height:"100%",width:"100%",overflow:"hidden",display:"block",position:"absolute",left:bbEmbed(".e-content.e-lib.e-touch").width()*i})}),bbEmbed(".multitab-dbrd .e-content").attr("style","height: 100% !important"),bbEmbed.map(bbEmbed(".multitab-dbrd .e-content").children(),function(e){bbEmbed(e).css({height:"100%"})}),bbEmbed(t).css({"overflow-x":"hidden","overflow-y":"hidden",width:i.embedOptions.width}),bbEmbed("#"+n).css({width:bbEmbed(".e-content.e-lib.e-touch").width(),height:this.embedOptions.height}),bbEmbed(".e-tab-header")[0].ej2_instances[0].refreshOverflow(),tabInstance.resizeContext(),bbEmbed.map(e,function(e,t){if(0==t){const t={Apistatus:!0,Data:e,Status:!0};i._renderDashboard(t)}})}),this._getAuthorizationToken=this.Invoke(function(e){const i=this,t=e||this.embedOptions.dashboardId,s=this.embedOptions.dashboardIds.join(","),o=this.embedOptions.dashboardPaths.join(",");let n="embed_nonce="+this._uuidv4Generator()+"&embed_dashboard_id="+t+"&embed_dashboard_ids="+s+"&embed_dashboard_path="+this.embedOptions.dashboardPath+"&embed_dashboard_paths="+o+"&pinboard_name="+(this.pinBoardRendered?this.embedOptions.pinboardName:"")+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(this.embedOptions.anonymousToken.isEnabled){const{groupName:e,userEmail:i}=this.embedOptions.anonymousToken;n+=`&embed_user_email=${i}&embed_anonymous_token=true&embed_authorize_group=${e}`}if(this.embedOptions.viewId?n=n+"&embed_dashboardview_id="+this.embedOptions.viewId:this.embedOptions.viewName&&(n=n+"&embed_dashboardview_name="+this.embedOptions.viewName),this.isWidgetMode)if(0==this.isMultipleWidgetMode)n=n+"&embed_widget_isenabled="+this.isWidgetMode+"&embed_widget_name="+this.widgetName;else{const e=[];this.embedOptions.widgetList.forEach(function(i){e.push(i.widgetName.toLowerCase())}),n=n+"&embed_widget_isenabled="+this.isWidgetMode+"&embed_widget_list="+e}this.isMultiTab&&(n=n+"&isMultiTab="+this.isMultiTab),this._isEmptyOrSpaces(this.embedOptions.datasourceId)?this._isEmptyOrSpaces(this.embedOptions.datasourceName)||(n=n+"&embed_datasource_name="+this.embedOptions.datasourceName):n=n+"&embed_datasource_id="+this.embedOptions.datasourceId;const d={embedQuerString:encodeURI(n),embedQueryString:encodeURI(n),dashboardServerApiUrl:this.dashboardServerApiUrl};if(""!=this.embedOptions.authorizationServer.url)this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,d,this.embedOptions.authorizationServer.headers,this._renderDashboard);else if(this._isNullOrUndefined(this.embedOptions.authorizationServer.data)||""==this.embedOptions.authorizationServer.data||""!=this.embedOptions.authorizationServer.url)if(this.embedOptions.enableDomainMasking)this._renderDashboard(this.embedOptions.authorizationServer.data);else{if(""!=this.embedOptions.authorizationServer.url&&""!=this.embedOptions.authorizationServer.data||this.embedOptions.mode!=BoldBI.Mode.View||!this._isEmptyOrSpaces(this.embedOptions.pinboardName)||!(this.embedOptions.dashboardId||this.embedOptions.dashboardPath||this.embedOptions.dashboardIds||this.embedOptions.dashboardPaths))throw new Error(embeddingLocalization_1.errorMessages.AuthorizationServerMissing);bbEmbed.ajax({async:!0,type:"POST",url:this.dashboardServerApiUrl+this.embedAuthorizeEndPoint,data:JSON.stringify(n),contentType:"application/json",success:bbEmbed.proxy(i._renderDashboard,i)})}else this._renderDashboard(this.embedOptions.authorizationServer.data);this.pinBoardRendered=!0}),this._validateOptions=this.Invoke(function(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E,D,S,B,C;const x=e;this.embedOptions=Object.assign(Object.assign({},this.embedOptions),{embedContainer:e.embedContainerId,hideErrorMessage:e.hideErrorMessage,widgetSettings:Object.assign({},x.widgetSettings),exportSettings:Object.assign({},x.exportSettings),pinboardSettings:Object.assign({},x.pinboardtSettings),autoRefreshSettings:Object.assign({},x.autoRefreshSettings),designCanvasSettings:Object.assign({},x.designCanvasSettings),dashboardSettings:Object.assign({},x.dashboardSettings),embedAiAssistant:Object.assign({},x.embedAiAssistant),customBrandSettings:Object.assign({},x.customBrandSettings),toolbarSettings:Object.assign({},x.toolbarSettings),languageSettings:Object.assign({},x.languageSettings),localeSettings:Object.assign({},x.localeSettings),dynamicConnection:Object.assign({},x.dynamicConnection),settings:Object.assign({},x.settings)});const M=null===(i=x.settings)||void 0===i?void 0:i.viewer;this.editIgnore=null!==(o=null!==(s=null===(t=x.dashboardSettings)||void 0===t?void 0:t.edit)&&void 0!==s?s:null==M?void 0:M.edit)&&void 0!==o?o:(null==e?void 0:e.mode)===BoldBI.Mode.Design,this.bingMapRequired="boolean"==typeof x.isBingMapRequired?x.isBingMapRequired:null!==(d=null===(n=x.settings)||void 0===n?void 0:n.bingMapRequired)&&void 0!==d&&d,this.restrictMobileView="boolean"==typeof x.restrictMobileView?x.restrictMobileView:null!==(r=null===(a=x.settings)||void 0===a?void 0:a.restrictMobileView)&&void 0!==r&&r,this.disableAutoRecover="boolean"==typeof x.disableAutoRecover?x.disableAutoRecover:null!==(b=null===(l=x.settings)||void 0===l?void 0:l.disableAutoRecover)&&void 0!==b&&b;const A=this.embedOptions.dashboardSettings,F=this.embedOptions.widgetSettings,T=this.embedOptions.exportSettings,k=this.embedOptions.settings;if(this.dashboardWidgetExports.dashboard={showExport:"boolean"==typeof(null==A?void 0:A.showExport)?A.showExport:null===(h=null===(m=null==k?void 0:k.viewer)||void 0===m?void 0:m.export)||void 0===h||h,showMoreOption:"boolean"==typeof(null==A?void 0:A.showMoreOption)?A.showMoreOption:null===(p=null===(c=null==k?void 0:k.viewer)||void 0===c?void 0:c.moreOption)||void 0===p||p,showMetrics:"boolean"==typeof(null==A?void 0:A.showMetrics)?A.showMetrics:null===(g=null===(u=null==k?void 0:k.viewer)||void 0===u?void 0:u.metrics)||void 0===g||g},this.dashboardWidgetExports.widget={showExport:"boolean"==typeof(null==F?void 0:F.showExport)?F.showExport:null===(f=null===(v=null==k?void 0:k.widget)||void 0===v?void 0:v.export)||void 0===f||f,showMoreOption:"boolean"==typeof(null==F?void 0:F.showMoreOption)?F.showMoreOption:null===(I=null===(w=null==k?void 0:k.widget)||void 0===w?void 0:w.moreOption)||void 0===I||I},this.dashboardWidgetExports.export={excel:"boolean"==typeof(null==T?void 0:T.showExcel)?T.showExcel:null===(_=null===(O=null==k?void 0:k.export)||void 0===O?void 0:O.excel)||void 0===_||_,pdf:"boolean"==typeof(null==T?void 0:T.showPDF)?T.showPDF:null===(E=null===(y=null==k?void 0:k.export)||void 0===y?void 0:y.pdf)||void 0===E||E,image:"boolean"==typeof(null==T?void 0:T.showImage)?T.showImage:null===(S=null===(D=null==k?void 0:k.export)||void 0===D?void 0:D.image)||void 0===S||S,csv:"boolean"==typeof(null==T?void 0:T.showCSV)?T.showCSV:null===(C=null===(B=null==k?void 0:k.export)||void 0===B?void 0:B.csv)||void 0===C||C},!this._isEmptyOrSpaces(e.resourceVersion)&&!this._isValidResourceVersion(e.resourceVersion))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.InvalidResourceVersion);if(e.enableDomainMasking)return!0;if(this._isNullOrUndefined(e.onError)||(this.embedOptions.events.onError=e.onError),this._isEmptyOrSpaces(e.embedContainerId)&&this._isNullOrUndefined(e.widgetList))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.InvalidEmbedContainerID);if(this._isEmptyOrSpaces(e.serverUrl))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.EmptyServerURL);if(e.mode==BoldBI.Mode.AIAssistant)return!0;if(!this._isUrl(e.serverUrl))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.InvalidServerURL);if(!this._isEmptyOrSpaces(e.pinboardName))return!0;if(e.mode==BoldBI.Mode.Connection)return!0;if(e.dashboardPath||e.dashboardPaths&&e.mode!==BoldBI.Mode.DataSource){const i=e.dashboardPath?[e.dashboardPath]:e.dashboardPaths;i.forEach((e,t)=>{i[Number(t)]=`${e.startsWith("/")?"":"/"}${e}`.replace(/\/+$/,"");const s=i[Number(t)].split("/");if(3!==s.length||""!==s[0]||""===s[1]||""===s[2])throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardPath+e)}),e.dashboardPath?e.dashboardPath=i[0]:e.dashboardPaths=i}if(this._isEmptyOrSpaces(e.dashboardId)&&(!e.dashboardIds||!e.dashboardIds.length)&&(!e.dashboardPaths||!e.dashboardPaths.length)&&this._isEmptyOrSpaces(e.dashboardPath)&&e.mode!==BoldBI.Mode.Design&&this._isEmptyOrSpaces(e.datasourceId)&&this._isEmptyOrSpaces(e.datasourceName)){if(e.mode==BoldBI.Mode.DataSource)throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.EmptyDatasourceDetails);if(this._isEmptyOrSpaces(e.pinboardName)&&!this._isNullOrUndefined(e.pinboardName))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.PinboardNameEmpty);if(this._isEmptyOrSpaces(e.viewId))throw this.invalidDetail=!0,this._isNullOrUndefined(e.token)&&this._isNullOrUndefined(e.embedToken)?new Error(embeddingLocalization_1.errorMessages.EmptyDbrdOrViewID):new Error(embeddingLocalization_1.errorMessages.EmptyDbrdOrViewIDForToken)}return!0});const i=JSON.parse(JSON.stringify(default_1.DefaultConstructor));Object.assign(this,i,e),this.loadDashboard=this.Invoke(function(e){this._loadDashboard(e)}),this.loadMultitabDashboard=this.Invoke(function(e){this.deprecationMessage("loadMultitabDashboard"),this._loadMultitabDashboard(e)}),this.loadTabbedDashboards=this.Invoke(function(e){this.deprecated=!1,this._loadMultitabDashboard(e)}),this.loadView=this.Invoke(function(){this._loadView()}),this.loadDashboardWidget=this.Invoke(function(e,i){this.deprecationMessage("loadDashboardWidget"),this._loadDashboardWidget(e,i)}),this.loadAIAssistant=this.Invoke(function(){this._loadAIAssistant()}),this.loadWidget=this.Invoke(function(e,i){this.deprecated=!1,this._loadDashboardWidget(e,i)}),this.loadMultipleWidgets=this.Invoke(function(e){this.deprecationMessage("loadMultipleWidgets"),this._loadMultipleWidgets(e)}),this.loadWidgets=this.Invoke(function(e){this.deprecated=!1,this._loadMultipleWidgets(e)}),this.loadDesigner=this.Invoke(function(e){this._loadDesigner(e)}),this.refreshWidgetData=this.Invoke(function(e,i,t){this.deprecationMessage("refreshWidgetData"),this._refreshWidgetData(e,i,t)}),this.addWidgetToPinboard=this.Invoke(function(e,i,t){this.deprecationMessage("addWidgetToPinboard"),this._addWidgetToPinboard(e,i,t)}),this.saveFilterView=this.Invoke(function(e,i){this.deprecationMessage("saveFilterView"),this._saveFilterViews(e,i)}),this.saveAsFilterView=this.Invoke(function(e,i){this.deprecationMessage("saveAsFilterView"),this._saveAsFilterViews(e,i)}),this.updateFilterView=this.Invoke(function(e,i){this.deprecationMessage("updateFilterView"),this._updateFilterViews(e,i)}),this.getViewsByDashboardId=this.Invoke(function(e,i){this.deprecationMessage("getViewsByDashboardId"),this._getViewsByDashboardId(e,i)}),this.getViewByViewId=this.Invoke(function(e,i){this.deprecationMessage("getViewByViewId"),this._getViewByViewId(e,i)}),this.deleteFilterView=this.Invoke(function(e,i){this.deprecationMessage("deleteFilterView"),this._deleteFilterView(e,i)})}_loadAIAssistant(){this._isInvalidEmbed(BoldBI.Mode.AIAssistant,"EmbedModeInvalid")||(this._showLoader(),this._isAIDepdencyLoaded(this))}_loadDashboard(e){if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(null!=e&&(this.embedOptions.dashboardId=e),this._isEmptyOrSpaces(this.embedOptions.dashboardId)&&this._isEmptyOrSpaces(this.embedOptions.dashboardPath)&&this._isEmptyOrSpaces(this.embedOptions.ViewId))throw new Error(embeddingLocalization_1.errorMessages.EmptyDbrdOrViewID);if(this.embedOptions.anonymousToken.isEnabled){const{groupName:e,userEmail:i}=this.embedOptions.anonymousToken;if(this._isEmptyOrSpaces(e)&&this._isEmptyOrSpaces(i))throw new Error(embeddingLocalization_1.errorMessages.AnonymousEmailandGroup);if(this._isEmptyOrSpaces(e))throw new Error(embeddingLocalization_1.errorMessages.AnonymousGroup);if(this._isEmptyOrSpaces(i))throw new Error(embeddingLocalization_1.errorMessages.AnonymousEmail)}this._checkWidgetList()||(this.embedOptions.embedType==BoldBI.EmbedType.Component?(this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],this.isDashboardRendering=!0,this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this)):this.embedOptions.embedType==BoldBI.EmbedType.IFrame&&this._createIframe(`${this.embedOptions.serverUrl}/dashboards/${this.embedOptions.dashboardId}?isembed=true`))}}_loadMultitabDashboard(e){var i,t;if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(null!=e&&(this.embedOptions.dashboardIds=e),this.embedOptions.embedToken||this.embedOptions.token)throw new Error(embeddingLocalization_1.errorMessages.UnableMultitabDashboardToken);(null===(i=this.embedOptions.dashboardIds)||void 0===i?void 0:i.length)&&(this.embedOptions.dashboardIds=Array.from(new Set(this.embedOptions.dashboardIds))),(null===(t=this.embedOptions.dashboardPaths)||void 0===t?void 0:t.length)&&(this.embedOptions.dashboardPaths=Array.from(new Set(this.embedOptions.dashboardPaths))),this.embedOptions.embedType==BoldBI.EmbedType.Component&&(this.embedOptions.viewId="",this.embedOptions.viewName="",this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this))}}_loadView(){if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(""==this.embedOptions.viewId&&""==this.embedOptions.viewName)throw new Error(embeddingLocalization_1.errorMessages.EmptyViewDetails);this.embedOptions.embedType==BoldBI.EmbedType.Component&&(this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],this.isDashboardViewRendering=!0,this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this))}}_loadDashboardWidget(e,i){if(this._isEmptyOrSpaces(e))throw new Error(embeddingLocalization_1.errorMessages.EmptyWidgetID);this._isInvalidEmbed(BoldBI.Mode.View,"UnableWidgetRender")||(""!=this.embedOptions.pinboardName&&this.pinBoardRendered&&(this.embedOptions.pinboardName=""),this._checkWidgetList()||(this.embedOptions.embedType==BoldBI.EmbedType.Component?(this.embedOptions.viewId="",this.embedOptions.viewName="",this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],this._setEmbedDefaults(),this.isWidgetMode=!0,this.widgetName=e,this._showLoader(),this._isDependencyLoaded(this,i)):this.embedOptions.embedType==BoldBI.EmbedType.IFrame&&this._createIframe(`${this.embedOptions.serverUrl}/dashboards/${this.embedOptions.dashboardId}?isembed=true`)))}_loadMultipleWidgets(e){if(""==this.embedOptions.widgetList)throw new Error(embeddingLocalization_1.errorMessages.EmptyWidgetList);if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(null!=e&&(this.embedOptions.dashboardId=e),this.embedOptions.embedToken||this.embedOptions.token)throw new Error(embeddingLocalization_1.errorMessages.UnableMultipleWidgetsToken);if(this.embedOptions.embedType==BoldBI.EmbedType.Component){this._setEmbedDefaults(),this.isWidgetMode=!0,this.isMultipleWidgetMode=!0,this.loadMultipleWidget=!0;const i=setInterval(()=>{window.jQuery&&(clearInterval(i),this._widgetNamesEmpty()&&this._isDependencyLoaded(this,e))},1e3)}}}_loadDesigner(e){this._isInvalidEmbed(BoldBI.Mode.Design,"EmbedModeInvalid")||(null!=e&&(this.embedOptions.dashboardId=e),this._checkWidgetList()||(this.embedOptions.embedType==BoldBI.EmbedType.Component?(this.isDashboardRendering=!0,this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this)):this.embedOptions.embedType==BoldBI.EmbedType.IFrame&&this._createIframe(`${this.embedOptions.serverUrl}/dashboard-designer/${this.embedOptions.dashboardId}?isembed=true`)))}_createIframe(e){var i;const t=document.createElement("iframe");t.frameBorder=0,t.width=this.embedOptions.width,t.height=this.embedOptions.height,t.id=`${this.embedOptions.embedContainerId}_${this.embedOptions.dashboardId}`,t.allowfullscreen=this.embedOptions.dashboardSettings.showFullScreen,t.setAttribute("src",e),null===(i=document.getElementById(this.embedOptions.embedContainerId))||void 0===i||i.appendChild(t)}_setEmbedDefaults(){this.isWidgetMode=!1,this.widgetName="",this.isDashboardViewMode=!1,this.dashboardViewName=""}_isInvalidEmbed(e,i){if(this.invalidDetail)return!0;if(this.embedOptions.mode!==e)throw new Error(embeddingLocalization_1.errorMessages[i]);return""!=this.embedOptions.pinboardName&&(this.embedOptions.pinboardName=""),!1}_refreshWidgetData(e,i,t){if(1!=Array.isArray(e))throw new Error(embeddingLocalization_1.errorMessages.ArrayWidgetNames);if(this.isMultiTab){const s=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let o=0;o<s.length;o++)if(bbEmbed(s[`${o}`]).attr("id").includes(t.toString().replaceAll("-",""))>0){const t=bbEmbed(s[`${o}`]).attr("id"),n=this._getDashboardInstance(t);null!=n&&n.refreshWidget(e,i);break}}else if(this.isMultipleWidgetMode)this._multipleWidgets("refreshWidget",e,i);else{const t=this._getDashboardInstance();null!=t&&t.refreshWidget(e,i)}}_addWidgetToPinboard(e,i,t){if(this._isEmptyOrSpaces(e)||this._isEmptyOrSpaces(i)||this._isEmptyOrSpaces(t))throw this._isEmptyOrSpaces(e)||this._isEmptyOrSpaces(i)?new Error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidget):new Error(embeddingLocalization_1.errorMessages.InvalidWidgetName);{if(!/^[a-zA-Z0-9!@$^ ()_=\-}{.`~]*$/.test(t))throw new Error(embeddingLocalization_1.errorMessages.WidgetNameSpecialChar);const s=bbEmbed("#widget-container").attr("data-homepage-id"),o=this,n="embed_nonce="+this._uuidv4Generator()+"&homepageId="+s+"&isPinUpdate="+!0+"&pinWidgetId="+i+"&pinDashbooardId="+e+"&pinWidgetName="+(this._isNullOrUndefined(t)?null:t)+"&pinboard_name="+this.embedOptions.pinboardName+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime,d={embedQuerString:encodeURI(n),embedQueryString:encodeURI(n),dashboardServerApiUrl:this.dashboardServerApiUrl};this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,d,this.embedOptions.authorizationServer.headers,function(e){e.Status?o._addWidgetInPinboard(e.Data):e.Status||o._throwError(embeddingLocalization_1.errorMessages.UnableAddWidget+e.Message)})}}_makeAjaxRequest(e,i,t,s,o={},n){const d=this._validatetoken(this.accessToken),a=this;bbEmbed.ajax({async:!1,type:e,url:i,headers:{Authorization:d},data:JSON.stringify(t),contentType:"application/json",success:function(e){a[n](e,s,a,o)},error:function(e){a.ajaxErrorFnc(e)}})}_saveFilterViews(e,i){const t=this._isValidGuid(e.ItemId),s=!!this.isMultiTab&&this._isValidGuid(e.ChildItemId);if(this._isEmptyOrSpaces(e.ViewName)||this._isEmptyOrSpaces(e.QueryString)||!(this.isMultiTab&&s&&t||t)){if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID);if(this.isMultiTab&&!s)throw new Error(embeddingLocalization_1.errorMessages.InvalidChildDbrdID);if(this._isEmptyOrSpaces(e.ViewName))throw new Error(embeddingLocalization_1.errorMessages.InvalidViewName);if(this._isEmptyOrSpaces(e.QueryString))throw new Error(embeddingLocalization_1.errorMessages.InvalidQueryString)}else{const t={ViewName:e.ViewName,ItemId:e.ItemId,QueryString:e.QueryString,IsPublic:!1,ChildItemId:this.isMultiTab?e.ChildItemId:null,IsDefault:!!e.IsDefault&&e.IsDefault};this._makeAjaxRequest("POST",`${this.dashboardServerApiUrl}/v4.0/dashboards/views`,t,i,e,"_saveViewSuccess")}}_saveAsFilterViews(e,i){const t=this._isValidGuid(e.ItemId),s=!!this.isMultiTab&&this._isValidGuid(e.ChildItemId);if(this._isEmptyOrSpaces(e.ViewName)||this._isEmptyOrSpaces(e.QueryString)||!(this.isMultiTab&&s&&t||t)){if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID);if(this.isMultiTab&&!s)throw new Error(embeddingLocalization_1.errorMessages.InvalidChildDbrdID);if(this._isEmptyOrSpaces(e.ViewName))throw new Error(embeddingLocalization_1.errorMessages.InvalidViewName);if(this._isEmptyOrSpaces(e.QueryString))throw new Error(embeddingLocalization_1.errorMessages.InvalidQueryString)}else{const t={ViewName:e.ViewName,ItemId:e.ItemId,QueryString:e.QueryString,ChildItemId:this.isMultiTab?e.ChildItemId:null,IsDefault:!!e.IsDefault&&e.IsDefault};this._makeAjaxRequest("POST",`${this.dashboardServerApiUrl}/v4.0/dashboards/views`,t,i,e,"_saveViewSuccess")}}_updateFilterViews(e,i){const t=this._isValidGuid(e.DashboardId),s=this._isValidGuid(e.ViewId);if(t&&!this._isEmptyOrSpaces(e.QueryString)&&s){const t={ViewId:e.ViewId,DashboardId:e.DashboardId,QueryString:e.QueryString,IsDefault:e.IsDefault};this._makeAjaxRequest("PUT",`${this.dashboardServerApiUrl}/v4.0/dashboards/views`,t,i,e,"_updateFilterViewsSuccess")}else{if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID);if(!s)throw new Error(embeddingLocalization_1.errorMessages.InvalidViewID);if(this._isEmptyOrSpaces(e.QueryString))throw new Error(embeddingLocalization_1.errorMessages.InvalidQueryString)}}_getViewsByDashboardId(e,i){const t=this._isValidGuid(e);if(t){const t={DashboardId:e};this._makeAjaxRequest("GET",`${this.dashboardServerApiUrl}/v4.0/dashboards/${e}/views`,t,i,null,"_getViewsByDashboardIdSuccess")}else if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}_getViewByViewId(e,i){const t=this._isValidGuid(e);if(t){const t={ViewId:e};this._makeAjaxRequest("GET",`${this.dashboardServerApiUrl}/v4.0/dashboards/views/${e}`,t,i,null,"_getViewByViewIdSuccess")}else if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidViewID)}_deleteFilterView(e,i){const t=this._isValidGuid(e);if(t){const t={ViewId:e};this._makeAjaxRequest("DELETE",`${this.dashboardServerApiUrl}/v4.0/dashboards/views/${e}`,t,i,e,"_deleteFilterViewSuccess")}else if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidViewID)}_saveViewSuccess(e,i,t,s){const o=t;if(e.Status){const t={ItemId:s.ItemId,ViewId:e.Data,ViewName:s.ViewName};o._updateInFilterOverviewUI(t.ViewName,e.Data),window[`${i}`]instanceof Function?window[`${i}`].call(o,t,e.StatusMessage):i.call(o,t,e.StatusMessage)}else window[`${i}`]instanceof Function?window[`${i}`].call(o,null,e.StatusMessage):i.call(o,null,e.StatusMessage)}_updateFilterViewsSuccess(e,i,t,s){const o=t;if(e.Status){const t={};t.ViewId=s.ViewId,window[`${i}`]instanceof Function?window[`${i}`].call(o,t,e.StatusMessage):i.call(o,t,e.StatusMessage)}}_deleteFilterViewSuccess(e,i,t,s){var o=t;window[`${i}`]instanceof Function?window[`${i}`].call(o,s):i.call(o,s)}_getViewByViewIdSuccess(e,i,t){const s=t,o={};e&&(o.ViewId=e.ViewId,o.ViewName=e.ViewName,o.QueryString=e.QueryString),window[`${i}`]instanceof Function?window[`${i}`].call(s,o):i.call(s,o)}_getViewsByDashboardIdSuccess(e,i,t){const s=t;if(e){const t=[];for(let i=0;i<e.length;i++){const s={};s.ItemId=e[`${i}`].ItemId,s.ViewId=e[`${i}`].ViewId,s.ViewName=e[`${i}`].ViewName,s.QueryString=e[`${i}`].QueryString,t.push(s)}window[`${i}`]instanceof Function?window[`${i}`].call(s,t):i.call(s,t)}else window[`${i}`]instanceof Function?window[`${i}`].call(s):i.call(s)}_isValidGuid(e){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)}_initializeDashboardContainer(){const e=this.embedOptions.embedContainerId;this.childContainer=document.createElement("div"),this.childContainer.id=e+"_embeddedbi";const i=BoldBI._gettinstance(document.getElementById(e),"embeddedBoldBI");i&&void 0!==bbEmbed&&(this.deprecated=!1,i.destroy());const t=document.getElementById(e);t&&(t.innerHTML="",t.append(this.childContainer)),BoldBI._putinstance(t,"embeddedBoldBI",this.storeObj)}static create(e){const i=new BoldBI;if(i.isMultiTab=!1,i.parentDbrdId="",i.pinboardIds=[],delete window.multiTabFilterParameter,document.addEventListener&&(document.addEventListener("webkitfullscreenchange",function(){i._fullscreenExitHandler(i)},!1),document.addEventListener("mozfullscreenchange",function(){i._fullscreenExitHandler(i)},!1),document.addEventListener("fullscreenchange",function(){i._fullscreenExitHandler(i)},!1),document.addEventListener("MSFullscreenChange",function(){i._fullscreenExitHandler(i)},!1),window.addEventListener("resize",function(){i._isNullOrUndefined(bbEmbed)||(i.deprecated=!1,i.resizeDashboard()),i._isEmptyOrSpaces(i.embedOptions.pinboardName)&&(i._isNullOrUndefined(i.embedOptions.pinboardName)||i._isNullOrUndefined(bbEmbed))||i.setListMinimumHeight()})),i._validateOptions(e)){if(i._initializeEmbedOptions(e),i.embedOptions.embedType!=BoldBI.EmbedType.Component){i._throwError(embeddingLocalization_1.errorMessages.InvalidEmbedType,i.embedOptions.embedContainerId),i.invalidDetail=!0;const e=Object.assign(i);return i.storeObj=e,e}try{if(""==i.embedOptions.widgetList||i.embedOptions.embedContainerId){i.childContainer=document.createElement("div"),i.childContainer.id=i.embedOptions.embedContainerId+"_embeddedbi";const e=BoldBI._gettinstance(document.getElementById(i.embedOptions.embedContainerId),"embeddedBoldBI");null==e&&null==e||i._isNullOrUndefined(bbEmbed)||e.dispose(),document.getElementById(i.embedOptions.embedContainerId).innerHTML="",document.getElementById(i.embedOptions.embedContainerId).append(i.childContainer)}if(!i._initializeUrls()){i.invalidDetail=!0;const e=Object.assign(i);return i.storeObj=e,e}i.embedOptions.width||i.embedOptions.height||i._setDimensions(),i.IsDependencyLoaded||(i.embedOptions.environment==BoldBI.Environment.Cloud?(i._isEmptyOrSpaces(i.cdnLink)||i._isEmptyOrSpaces(i.designerRootUrl))&&i._getCloudLinks():i._addJquerydependentFiles())}catch(e){if(e.message==embeddingLocalization_1.errorMessages.CantReadNull)return alert(embeddingLocalization_1.errorMessages.InvalidEmbedContainerID),!1;{i._throwError(e.message,i.embedOptions.embedContainerId),i.invalidDetail=!0;const t=Object.assign(i);return i.storeObj=t,t}}if(""==i.embedOptions.widgetList||i.embedOptions.embedContainerId){const e=document.getElementById(i.embedOptions.embedContainerId);this._hasinstance(e,"embeddedBoldBI")&&this._removeinstance(e,"embeddedBoldBI")}const t=Object.assign(i);if(i.storeObj=t,""==i.embedOptions.widgetList||i.embedOptions.embedContainerId){const e=document.getElementById(i.embedOptions.embedContainerId);this._putinstance(e,"embeddedBoldBI",t)}return t}i._initializeEmbedOptions(e),i.invalidDetail=!0;const t=Object.assign(i);return i.storeObj=t,t}static getInstance(e){return BoldBI._widgetsCollection=[],this._gettinstance(document.getElementById(e),"embeddedBoldBI")}Invoke(e){const i=this;return function(...t){try{return e.apply(this,t)}catch(e){i._throwError(e,this.embedOptions.embedContainer)}}.bind(this)}dispose(){this.deprecated=!1,this.destroy()}destroy(){this.deprecationMessage("destroy");const e=this;if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.destroy()}BoldBI._removeinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBI"),document.getElementById(this.embedOptions.embedContainerId).innerHTML=""}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each(function(){const i=e._getDashboardInstance(this.id);null!=i&&i.destroy()}),BoldBI._removeinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBI"),document.getElementById(this.embedOptions.embedContainerId).innerHTML="";else{this.isMultipleWidgetMode&&this._multipleWidgets("destroy");const e=this.embedOptions.embedContainerId,i=this._getDashboardInstance();null!=i&&i.destroy(),BoldBI._removeinstance(document.getElementById(e),"embeddedBoldBI"),document.getElementById(e).innerHTML=""}1==this.embedOptions.isRemoveStyle&&document.querySelectorAll("link").forEach(function(i){e.cssFiles.forEach(function(e){-1!=i.href.toLowerCase().indexOf(e.toLowerCase())&&i.parentNode.removeChild(i)})})}loadDashboardView(){throw new Error(embeddingLocalization_1.errorMessages.NotImplementedMethod)}exportDashboardAsPdf(e){if(this.deprecationMessage("exportDashboardAsPdf"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportAsPdf(e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}else{const i=this._getDashboardInstance();null!=i&&(e?i.exportAsPdf(e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters):i.exportAsPdf())}}exportDashboardAsImage(e){if(this.deprecationMessage("exportDashboardAsImage"),parseInt(e.resolutionDpi,10)>300&&(e.resolutionDpi="300"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportAsImage(e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}else{const i=this._getDashboardInstance();null!=i&&(e?i.exportAsImage(e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters):i.exportAsImage())}}exportDashboardAsExcel(e){if(this.deprecationMessage("exportDashboardAsExcel"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportAsExcel(e.fileName,e.fileType)}else{const i=this._getDashboardInstance();null!=i&&(e?i.exportAsExcel(e.fileName,e.fileType):i.exportAsExcel())}}exportWidgetAsPdf(e){this.deprecationMessage("exportWidgetAsPdf");const i=this;if(this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsPdf(e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsPdf(e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsPdf",e.dashboardId,e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsPdf(e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}}exportWidgetAsImage(e){this.deprecationMessage("exportWidgetAsImage");const i=this;if(parseInt(e.resolutionDpi,10)>300&&(e.resolutionDpi="300"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsImage(e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsImage(e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsImage",e.dashboardId,e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsImage(e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}}exportWidgetAsExcel(e){this.deprecationMessage("exportWidgetAsExcel");const i=this;if(this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsExcel(e.widgetName,e.fileName,e.fileType)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsExcel(e.widgetName,e.fileName,e.fileType)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsExcel",e.dashboardId,e.widgetName,e.fileName,e.fileType);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsExcel(e.widgetName,e.fileName,e.fileType)}}exportWidgetAsCsv(e){this.deprecationMessage("exportWidgetAsCsv");const i=this;if(this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsCsv(e.widgetName,e.fileName)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsCsv(e.widgetName,e.fileName)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsCsv",e.dashboardId,e.widgetName,e.fileName);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsCsv(e.widgetName,e.fileName)}}updateDatasource(){this.deprecationMessage("updateDatasource");const e=this._getDashboardInstance();null!=e&&e.modules.queryDesigner.saveQueryInfo()}updateFilters(e){this.deprecationMessage("updateFilters");const i=this;if(this.isMultiTab){window.multiTabFilterParameter=e;const i=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let t=0;t<i.length;t++){const s=bbEmbed(i[`${t}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.option("filterParameters",e)}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each(function(){const t=i._getDashboardInstance(this.id);null!=t&&t.option("filterParameters",e)});else if(this.isMultipleWidgetMode)this._multipleWidgets("filterParameters",e);else{const i=this._getDashboardInstance();null!=i&&i.option("filterParameters",e)}}applyTheme(e){this.deprecated=!1,this.updateDashboardTheme(e)}updateDashboardTheme(e){if(this.deprecationMessage("updateDashboardTheme"),e&&""!==e.trim()){const i=this;this.embedOptions.dashboardSettings=this.embedOptions.dashboardSettings||{},this.embedOptions.settings.theme=this.embedOptions.settings.theme||{},this.embedOptions.dashboardSettings.themeSettings=this.embedOptions.dashboardSettings.themeSettings||{},this.embedOptions.dashboardSettings.themeSettings.dashboard=e,this.embedOptions.settings.theme.dashboard=e,document.querySelectorAll("link").forEach(function(e){e.href.includes("/dashboard?theme=")&&e.parentNode.removeChild(e)});const t=document.createElement("link");if(t.rel="stylesheet",this.embedOptions.environment==BoldBI.Environment.Enterprise?t.href=this.customThemeUrl+"/dashboard?theme="+e:t.href=this.rootUrl+"/theme/styles/dashboard?theme="+e,bbEmbed('link[href="'+t.href+'"]').length<1&&document.head.appendChild(t),this.isMultiTab){const i=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let t=0;t<i.length;t++){const s=bbEmbed(i[`${t}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.option("dashboardThemeSettings.dashboardTheme",e)}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each(function(){const t=i._getDashboardInstance(this.id);null!=t&&t.option("dashboardThemeSettings.dashboardTheme",e)});else{const i=this._getDashboardInstance();null!=i&&i.option("dashboardThemeSettings.dashboardTheme",e)}}else this._throwError(embeddingLocalization_1.errorMessages.InvalidThemeName)}resizeDashboard(e){this.deprecationMessage("resizeDashboard");const i=this;if(this.embedOptions.isDynamicWidth&&this.embedOptions.isDynamicHeight&&this._onBrowserWindowResize(),this.isMultiTab){bbEmbed("#"+i.embedOptions.embedContainerId+"_multi_tab_dashboard").css("width",bbEmbed("#"+i.embedOptions.embedContainerId).width()),window.multiTabFilterParameter=e;const t=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let e=0;e<t.length;e++){const s=bbEmbed(t[`${e}`]).attr("id"),o=this._getDashboardInstance(s);if(null!=o){const e=window[i.embedOptions.events.onResize];e instanceof Function&&e.call(this,o),this.embedOptions.events.onResize instanceof Function&&this.embedOptions.events.onResize.call(this,o),setTimeout(()=>{o.resizeDashboard()},200)}}this._tabSelected()}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each(function(){const e=i._getDashboardInstance(this.id);if(null!=e){const t=window[i.embedOptions.events.onResize];t instanceof Function&&t.call(i,e),i.embedOptions.events.onResize instanceof Function&&i.embedOptions.events.onResize.call(i,e),e.resizeDashboard()}});else if(this.isMultipleWidgetMode)this._multipleWidgets("resizeDashboard");else{const e=this._getDashboardInstance();if(null!=e){const t=window[i.embedOptions.events.onResize];t instanceof Function&&t.call(this,e),this.embedOptions.events.onResize instanceof Function&&this.embedOptions.events.onResize.call(this,e),setTimeout(()=>{e.resizeDashboard()},200)}}}deprecationMessage(e){this.deprecated&&(0,sdk_deprecation_utils_1.deprecatedMethod)(e),this.deprecated=!0}refreshDashboard(){this.deprecationMessage("refreshDashboard");const e=this;if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.updateDashboard()}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each(function(){const i=e._getDashboardInstance(this.id);null!=i&&i.updateDashboard()});else if(this.isMultipleWidgetMode)this._multipleWidgets("updateDashboard");else{const e=this._getDashboardInstance();null!=e&&e.updateDashboard()}}clearAllFilter(){if(this.deprecationMessage("clearAllFilter"),this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.clearAllFilters()}}else if(this.isMultipleWidgetMode)this._multipleWidgets("clearAllFilters");else{const e=this._getDashboardInstance();null!=e&&e.clearAllFilters()}}hidePopup(){if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.hideAllPopupsForDashboard()}}else{const e=this._getDashboardInstance();null!=e&&e.hideAllPopupsForDashboard()}}hideLoader(){this.deprecated=!1,this.hideWaitingIndicator()}hideWaitingIndicator(){if(this.deprecationMessage("hideWaitingIndicator"),this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=bbEmbed("#"+t+"_designAreaContainer").data("BoldBIDashboardWaitingPopup");null!=s&&s.destroy()}}else{const e=bbEmbed(".bbi-dashboarddesigner-designAreaContainer").data("BoldBIDashboardWaitingPopup");null!=e&&e.destroy()}}getWidgetData(e,i,t){let s;if(this.deprecationMessage("getWidgetData"),this.isMultiTab){const o=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let n=0;n<o.length;n++)if(bbEmbed(o[`${n}`]).attr("id").includes(t.toString().replaceAll("-",""))>0){const t=bbEmbed(o[`${n}`]).attr("id"),d=this._getDashboardInstance(t);null!=d&&(s=d.getWidgetData(e,i),s.toLowerCase().includes("widget")>0&&(window[`${i}`]instanceof Function?window[`${i}`].call(this,s):i.call(this,s)));break}}else{const t=this._getDashboardInstance();null!=t&&(s=t.getWidgetData(e,i),s.toLowerCase().includes("widget")>0&&(window[`${i}`]instanceof Function?window[`${i}`].call(this,s):i.call(this,s)))}}getWidgetDataWithFilters(e,i,t,s){let o;const n=JSON.stringify({dashboardId:i,widgetName:e,filter:t});if(this._isEmptyOrSpaces(i))return o={status:!1,message:embeddingLocalization_1.errorMessages.InvalidDashboardID,request:n},o;if(this._isEmptyOrSpaces(e))return o={status:!1,message:embeddingLocalization_1.errorMessages.InvalidWidgetName,request:n},o;const d=this;var a=this._validatetoken(d.accessToken);return bbEmbed.ajax({type:"POST",url:this.designerRootUrl+"/v1.0/design/loadwidgetdata",data:n,contentType:"application/json; charset=utf-8",beforeSend:function(e){e.setRequestHeader("Authorization",a),e.setRequestHeader("Caller",d.dashboardServerApiUrl)},success:function(e){o=e.Status?{status:e.Status,data:e.Data,message:e.Message,request:n}:{status:e.Status,message:e.Message,request:n},s.call(d,o)},error:function(e,i){o={status:!1,message:i,request:e},s.call(d,o)}}),o={status:!0,message:embeddingLocalization_1.errorMessages.InitFetch,request:n},o}fetchCategories(e,i){this.deprecated=!1,this.getDashboardCategories(e,i)}getDashboardCategories(e,i){this.deprecationMessage("getDashboardCategories");const t=this._isNullOrUndefined(i)||this._isEmptyOrSpaces(i)?this._getDashboardInstance():this._getDashboardInstance(i+"_embeddedbi");if(null!=t){const i=t.GetDashboardCategories(e);window[`${e}`]instanceof Function?window[`${e}`].call(this,i):e.call(this,i)}}createCategory(e,i,t,s){this.deprecated=!1,this.createDashboardCategory(e,i,t,s)}createDashboardCategory(e,i,t,s){this.deprecationMessage("createDashboardCategory");const o=this._isNullOrUndefined(s)||this._isEmptyOrSpaces(s)?this._getDashboardInstance():this._getDashboardInstance(s+"_embeddedbi");if(null!=o){const s=o.CreateDashboardCategory(e,i,t);window[`${t}`]instanceof Function?window[`${t}`].call(this,s):t.call(this,s)}}saveDashboard(e,i){this.deprecationMessage("saveDashboard");const t=this._isNullOrUndefined(i)||this._isEmptyOrSpaces(i)?this._getDashboardInstance():this._getDashboardInstance(i+"_embeddedbi");null!=t&&(t.model.serverSettings.enableMarkAsPublic=!!e.isPublic&&e.isPublic,t.saveDashboardToServer(e))}getWidgetInstance(e){this.deprecationMessage("getWidgetInstance");const i=new widgetBI;i.containerID=this.embedOptions.embedContainerId,this._widgetsCollection[this._widgetsCollection.length]=e;const t=Object.assign(i);return i.widgetCollection=this._widgetsCollection,BoldBI._hasinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBIWidget_"+e)||BoldBI._putinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBIWidget_"+e,t),t}updateWidgetFilters(e){this.deprecationMessage("updateWidgetFilters");const i=this,t=this._getWidgetFilterInfo();if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const s=bbEmbed(e[`${i}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.option("widgets",t)}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each(function(){const e=i._getDashboardInstance(this.id);null!=e&&e.option("widgets",t)});else if(this.isMultipleWidgetMode)this._multipleWidgets("widgets",t);else{const i=this._isNullOrUndefined(e)||this._isEmptyOrSpaces(e)?this._getDashboardInstance():this._getDashboardInstance(e+"_embeddedbi");null!=i&&i.option("widgets",t)}}_initializeEmbedOptions(e){(0,sdk_deprecation_utils_1.checkDeprecatedEmbedOptions)(e),this.embedOptions=Object.assign(this.embedOptions,e),this.embedOptions=(0,sdk_deprecation_utils_1.migrateDeprecatedEventKeys)(this.embedOptions)}_setDimensions(){const e=document.getElementById(this.embedOptions.embedContainerId);if(e.style.width&&e.style.height)this.embedOptions.width=e.style.width,this.embedOptions.height=e.style.height;else{const i=e.parentNode;this.embedOptions.width=`${(null==i?void 0:i.clientWidth)||window.innerWidth}px`,this.embedOptions.height=`${(null==i?void 0:i.clientHeight)||window.innerHeight}px`,Object.assign(this.embedOptions,{isDynamicWidth:!0,isDynamicHeight:!0})}}_onBrowserWindowResize(){if(this.embedOptions.isDynamicWidth&&this.embedOptions.isDynamicHeight){const e=document.getElementById(this.embedOptions.embedContainerId),i=e.parentNode;e.style.width=`${(null==i?void 0:i.clientWidth)||window.innerWidth}px`,e.style.height=`${(null==i?void 0:i.clientHeight)||window.innerHeight}px`}}_loadCloudDepedentFiles(e){const i=e.Data;this.cdnLink=i.CdnUrl,this.designerRootUrl=i.DesignerServerUrl,this._addJquerydependentFiles()}_handleEnvironmentError(e){"error"==e.type&&(this._throwError(embeddingLocalization_1.errorMessages.EnvironmentMemberError),this.invalidDetail=!0)}_getCloudLinks(){this._isEmptyOrSpaces(this.embedOptions.cloudCdnTimeStamp)?this._xhrRequestHelper("Get",this.dashboardServerApiUrl+"/system-settings/get-url",{},{},this._loadCloudDepedentFiles):(this.cdnLink=`https://cdn.boldbi.com/ds/${this.embedOptions.cloudCdnTimeStamp}/cdn`,this.designerRootUrl="https://data.boldbi.com",this._addJquerydependentFiles())}_loadDepedentFiles(){var e,i,t,s,o,n,d,a;const r=null===(i=null===(e=this.embedOptions)||void 0===e?void 0:e.dashboardSettings)||void 0===i?void 0:i.themeSettings,l=null===(s=null===(t=this.embedOptions)||void 0===t?void 0:t.settings)||void 0===s?void 0:s.theme,b=this._resolveThemeBoolean(null==l?void 0:l.localTheme,null==r?void 0:r.isLocalTheme),m=this._resolveThemeString(null==l?void 0:l.dashboard,null==r?void 0:r.dashboard),h=this._resolveThemeString(null==l?void 0:l.application,null==r?void 0:r.application);b||""===m?(b||""===h)&&r&&l||this._addedDependentFiles(this,this.applicationThemeCssFiles,!0):this._addedDependentFiles(this,this.dashboardThemeCssFiles,!0),this.embedOptions.mode==BoldBI.Mode.Design||this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection?this._addedDependentFiles(this,this.designerScriptFiles,!1):this._addedDependentFiles(this,this.viewerScriptFiles,!1);""!==this._resolveThemeString(null===(d=null===(n=null===(o=this.embedOptions)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.theme)||void 0===d?void 0:d.fontFamily,null===(a=this.embedOptions.dashboardSettings)||void 0===a?void 0:a.fontFamily)&&this._addedDependentFiles(this,this.fontFamilyCssFiles,!0),""!=this.embedOptions.pinboardName&&this._addedDependentFiles(this,this.pinBoardScriptFiles,!1),this.embedOptions.mode==BoldBI.Mode.AIAssistant&&(this._addedDependentFiles(this,this.AICssFiles,!0),this._addedDependentFiles(this,this.AIScriptFiles,!1),this._addedDependentFiles(this,this.applicationThemeCssFiles,!0)),this._addedDependentFiles(this,this.cssFiles,!0),""!=this.embedOptions.pinboardName&&this._addedDependentFiles(this,this.pinboardCssFiles,!0),this.embedOptions.mode!=BoldBI.Mode.Design&&this.embedOptions.mode!=BoldBI.Mode.DataSource&&this.embedOptions.mode!=BoldBI.Mode.Connection||this._addedDependentFiles(this,this.designerCssFiles,!0);this.bingMapRequired&&this._loadBingmapDependentFiles(),this.embedOptions.settings.azureMapRequired&&this._loadAzureMapDependentFiles(),this.embedOptions.mode!=BoldBI.Mode.AIAssistant&&this._loadDependentDesignerFiles(this)}_loadBingmapDependentFiles(){const e=document.createElement("script");this.embedOptions.nonce&&(e.nonce=this.embedOptions.nonce),e.src="https://www.bing.com/api/maps/mapcontrol",e.async=!0,document.head.appendChild(e)}_loadAzureMapDependentFiles(){const e=document.createElement("link");e.rel="stylesheet",e.href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css",document.head.appendChild(e);const i=document.createElement("script");this.embedOptions.nonce&&(i.nonce=this.embedOptions.nonce),i.type="text/javascript",i.src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js",i.async=!0,document.head.appendChild(i)}_loadDependentDesignerFiles(e){window.BoldBIDashboard instanceof Object&&window.BoldBIDashboard.createObject instanceof Function&&window.Designer instanceof Object?(e._addedDependentFiles(e,e.ejViewerDependentFiles,!1),e.embedOptions.mode!=BoldBI.Mode.Design&&e.embedOptions.mode!=BoldBI.Mode.DataSource&&e.embedOptions.mode!=BoldBI.Mode.Connection||e._addedDependentFiles(e,e.ejDesignerDependentFiles,!1)):setTimeout(e._loadDependentDesignerFiles,50,e)}_addWrapperDependentFiles(e,i){const t=e;i.forEach(function(e){if(!("jquery-ui.min.js"==e&&null!=window.jQuery.ui&&"1.14.1"==window.jQuery.ui.version||"jsrender.min.js"==e&&null!=window.jQuery.views&&"v1.0.0-beta"==window.jQuery.views.jsviews)){const i=document.createElement("script");this.embedOptions.nonce&&(i.nonce=this.embedOptions.nonce),"jquery.easing.1.3.min.js"==e?i.src=this._appendEmbedResourceVersion(t.embedOptions.environment==BoldBI.Environment.Enterprise?t.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+e:t.rootUrl+"/cdn/scripts/designer/"+e:t.cdnLink+"/scripts/designer/"+e):"jquery-ui.min.js"==e?i.src=this._appendEmbedResourceVersion(t.embedOptions.environment==BoldBI.Environment.Enterprise?t.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+e:t.rootUrl+"/cdn/scripts/"+e:t.cdnLink+"/scripts/"+e):"jsrender.min.js"==e&&(i.src=this._appendEmbedResourceVersion(t.embedOptions.environment==BoldBI.Environment.Enterprise?t.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+e:t.rootUrl+"/cdn/scripts/designer/"+e:t.cdnLink+"/scripts/designer/"+e)),document.head.appendChild(i),i.onerror=e=>this._handleEnvironmentError(e)}}.bind(t))}_getEmbedResourceVersion(){const e=this.resourceVersion||this.embedSDKWrapperVersion||"";return this._isValidResourceVersion(e)?e:this.embedSDKWrapperVersion||""}_isValidResourceVersion(e){return"string"==typeof e&&/^[0-9A-Za-z.-]{1,30}$/.test(e)}_isBoldBIStaticResource(e){return e.indexOf("/cdn/scripts/")>=0||e.indexOf("/cdn/css/")>=0||e.indexOf("/designer/localization/")>=0||e.indexOf("/webdesignerservice/themes/")>=0||e.indexOf("/scripts/designer/")>=0||e.indexOf("/css/designer/")>=0||e.indexOf("/localization/")>=0}_appendEmbedResourceVersion(e){const i=this._getEmbedResourceVersion();if(this._isEmptyOrSpaces(e)||this._isEmptyOrSpaces(i)||!this._isBoldBIStaticResource(e))return e;if(["/cdn/scripts/designer/jquery-3.5.0.min.js","/cdn/scripts/designer/jquery.easing.1.3.min.js","/cdn/scripts/jquery-ui.min.js","/cdn/scripts/designer/jsrender.min.js"].some(i=>e.indexOf(i)>=0))return e;if(e.indexOf("v=")>=0)return e;const t=-1===e.indexOf("?")?"?":"&";return e+t+"v="+encodeURIComponent(i)}_resolveThemeString(e,i,t=""){return this._isEmptyOrSpaces(e)?this._isEmptyOrSpaces(i)?t:i.trim():e.trim()}_resolveThemeBoolean(e,i,t=!1){return"boolean"==typeof e?e:"boolean"==typeof i?i:t}_addedDependentFiles(e,i,t){var s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E;let D="";const S=this._resolveThemeBoolean(null===(o=null===(s=this.embedOptions.settings)||void 0===s?void 0:s.theme)||void 0===o?void 0:o.localTheme,null===(d=null===(n=this.embedOptions.dashboardSettings)||void 0===n?void 0:n.themeSettings)||void 0===d?void 0:d.isLocalTheme),B=this._resolveThemeString(null===(l=null===(r=null===(a=this.embedOptions)||void 0===a?void 0:a.settings)||void 0===r?void 0:r.theme)||void 0===l?void 0:l.appearance,null===(h=null===(m=null===(b=this.embedOptions)||void 0===b?void 0:b.dashboardSettings)||void 0===m?void 0:m.themeSettings)||void 0===h?void 0:h.appearance,"light"),C=this._resolveThemeString(null===(u=null===(p=null===(c=this.embedOptions)||void 0===c?void 0:c.settings)||void 0===p?void 0:p.theme)||void 0===u?void 0:u.application,null===(f=null===(v=null===(g=this.embedOptions)||void 0===g?void 0:g.dashboardSettings)||void 0===v?void 0:v.themeSettings)||void 0===f?void 0:f.application),x=this._resolveThemeString(null===(O=null===(I=null===(w=this.embedOptions)||void 0===w?void 0:w.settings)||void 0===I?void 0:I.theme)||void 0===O?void 0:O.dashboard,null===(E=null===(y=null===(_=this.embedOptions)||void 0===_?void 0:_.dashboardSettings)||void 0===y?void 0:y.themeSettings)||void 0===E?void 0:E.dashboard);i.forEach(function(i){var s,o,n,d,a,r,l,b,m;if(!e._checkDepedentFileExists(i,t))if(t){const t=this._resolveThemeString(null===(n=null===(o=null===(s=this.embedOptions)||void 0===s?void 0:s.settings)||void 0===o?void 0:o.theme)||void 0===n?void 0:n.fontFamily,null===(d=this.embedOptions.dashboardSettings)||void 0===d?void 0:d.fontFamily);if(e.embedOptions.environment==BoldBI.Environment.Enterprise)if("font-server.min.css"==i)D=e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.rootUrl+"/cdn/css/"+i;else if("bootstrap.min.css"==i)D=e.rootUrl+"/Content/Styles/Bootstrap/"+i;else if("pinboard-embed.min.css"==i)D=e.rootUrl+"/cdn/css/"+i;else if("dashboard-viewer-bundle.min.css"==i)D=e.rootUrl+"/cdn/css/designer/"+i;else if("dashboard-designer.min.css"==i)D=e.rootUrl+"/cdn/css/designer/"+i;else if("boldbi.theme.definition.min.css"==i)D=S||!B||e.embedOptions.enableDomainMasking?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/light/"+i:e.rootUrl+"/cdn/css/designer/light/"+i:e.rootUrl+"/cdn/css/designer/"+B+"/"+i;else if("application.theme.css"==i||"dashboard.theme.css"==i)!S&&x?D=e.customThemeUrl+"/dashboard?theme="+x:!S&&C&&(D=e.customThemeUrl+"/application?theme="+C);else if("font-family.min.css"==i){const e=this.rootUrl.replace(/\/bi(?!.*\/bi)/,"/ums/user-interface/fonts");D=e+"?family="+t}else D=e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.rootUrl+"/webdesignerservice/themes/"+i;else"font-server.min.css"==i?D=e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.cdnLink+"/css/"+i:"bootstrap.min.css"==i||"pinboard-embed.min.css"==i?D=e.cdnLink+"/css/"+i:"boldbi.theme.definition.min.css"==i?D=!S&&B?e.cdnLink+"/css/designer/"+B+"/"+i:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/light/"+i:e.cdnLink+"/css/designer/light/"+i:"application.theme.css"==i||"dashboard.theme.css"==i?!S&&x?D=e.rootUrl+"/theme/styles/dashboard?theme="+x:!S&&C&&(D=e.rootUrl+"/theme/styles/application?theme="+C):D="font-family.min.css"==i?e.rootUrl+"/user-interface/fonts?family="+t:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.cdnLink+"/css/designer/"+i;D=e._appendEmbedResourceVersion(D);const a=document.createElement("link");a.rel="stylesheet",a.href=D,bbEmbed('link[href="'+D+'"]').length<1&&document.head.appendChild(a)}else{if(e.embedOptions.environment==BoldBI.Environment.Enterprise){const t=this._isEmptyOrSpaces(null===(r=null===(a=this.embedOptions)||void 0===a?void 0:a.localeSettings)||void 0===r?void 0:r.appLocale)?this._isEmptyOrSpaces(null===(m=null===(b=null===(l=this.embedOptions)||void 0===l?void 0:l.settings)||void 0===b?void 0:b.locale)||void 0===m?void 0:m.appLocale)?"en-US":this.embedOptions.settings.locale.appLocale:this.embedOptions.localeSettings.appLocale;D="bootstrap.min.js"==i?e.rootUrl+"/cdn/scripts/"+i:"designerlocalization.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.rootUrl+"/designer/localization/"+i+"?c="+t:"signalr.min.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.rootUrl+"/cdn/scripts/signalr/"+i:"bbi-unifiedaiagent.min.js"==i||"dashboard-designer-dependency.min.js"==i?e.rootUrl+"/cdn/scripts/designer/"+i:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.rootUrl+"/cdn/scripts/designer/"+i}else D="bootstrap.min.js"==i?e.cdnLink+"/scripts/"+i:"designerlocalization.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.designerRootUrl+"/localization/"+i:"signalr.min.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.cdnLink+"/scripts/signalr/"+i:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.cdnLink+"/scripts/designer/"+i;D=e._appendEmbedResourceVersion(D);const t=document.createElement("script");t.type="text/javascript",t.src=D,this.embedOptions.nonce&&(t.nonce=this.embedOptions.nonce),bbEmbed('script[src= "'+D+'"]').length<1&&document.head.appendChild(t),t.onerror=e=>this._handleEnvironmentError(e)}}.bind(e))}_checkDepedentFileExists(e,i){let t=!1;const s=i?"link":"script";return document.head.querySelectorAll(s).forEach(function(s){t||(t=i?-1!=s.href.indexOf(e):-1!=s.src.indexOf(e))}),t}getDashboardData(){return this._getDashboardInstance().getDashboardData()}_renderPinboard(e){var i,t,s,o;const n="boolean"==typeof(null===(i=this.embedOptions.pinboardSettings)||void 0===i?void 0:i.enablePinboardHeader)?null===(t=this.embedOptions.pinboardSettings)||void 0===t?void 0:t.enablePinboardHeader:null===(o=null===(s=this.embedOptions.settings.pinboard)||void 0===s?void 0:s.header)||void 0===o||o,d=bbEmbed('<div id="server-app-container" style="background: #f9f9f9; overflow: hidden !important;min-height: 600px; width:'+this.embedOptions.width+';"><div id="content-area" class="clearfix col-12 e-waitingpopup e-js" style="padding: 0;padding-bottom: 30px"><div id="homepage-page-container"><div id="homepage-header" style="display:'+(n?"block":"none")+';font-family:var(--font-family)"><div id="element-container"><div id="homepage-menu" style="margin-top: 5px"><span id="homepage-list-container" style="font-size: 15px;width: 165px;line-height: 18px;padding: 25px;">'+this.embedOptions.pinboardName+'</span></div><div id="options-container"><div id="pinboard-fullscreen" class="server-banner-icon e-dashboard-banner-icon bbi-dbrd-designer-hoverable su su-maximize-1 e-icon-dbrd-theme" data-tooltip="Fullscreen" data-name="fullscreen" data-event="true" style="font-size: 14px;display: block;float: left;margin: 8px 15px 0 7px; cursor: pointer"></div><div id="divider"></div><div id="layout-container"><div id="layout" class="dropdown-toggle" data-bs-toggle="dropdown">Edit Layout</div><div class="dropdown-menu" id="layout-items" role="menu"><span class="su su-single-column" id="1"></span><span class="su su-two-column" id="11"></span><span class="su su-small-big-column" id="12"></span><span class="su su-big-small-column" id="21"></span><span class="su su-three-column" id="111"></span></div></div></div></div></div><div id="widget-container" data-homepage-id="" data-current-layout="" data-virtual-homepage="" style="margin-bottom: 30px"></div></div></div></div>');bbEmbed("#"+this.embedOptions.embedContainerId).append(d),this._createPinboardDom(e),this._renderItem(e),this._removeElementsClass(this.embedOptions.embedContainerId,".preloader-wrap","viewer-blue-loader");const a=this;bbEmbed(document).on("click",".unpin-widget",function(e){var i,t,s,o,n,d;e.preventDefault();const r=bbEmbed("#"+bbEmbed(e.target).parents("li").find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner"),l=window[null===(t=null===(i=a.embedOptions.events)||void 0===i?void 0:i.pinboard)||void 0===t?void 0:t.onUnpin];l instanceof Function&&l.call(this,r),(null===(o=null===(s=a.embedOptions.events)||void 0===s?void 0:s.pinboard)||void 0===o?void 0:o.onUnpin)instanceof Function&&(null===(d=null===(n=a.embedOptions.events)||void 0===n?void 0:n.pinboard)||void 0===d||d.onUnpin.call(a,r)),a.column=parseInt(bbEmbed(this).closest("ul").attr("data-column-id"),10),a.position=bbEmbed(this).parents("li").index()+1,r.destroy(),a._unPinItem(a.column,a.position)}),bbEmbed(document).on("click","#pinboard-fullscreen",function(){const e=bbEmbed("#server-app-container")[0];if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; height:"+bbEmbed("#content-area").height()+"px;overflow: hidden !important;min-height: 600px; width:"+a.embedOptions.width),document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else if(bbEmbed("#server-app-container").removeAttr("style"),bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; overflow: auto !important"),e.requestFullscreen)e.requestFullscreen();else if(e.msRequestFullscreen)e.msRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else if("ActiveXObject"in window){new ActiveXObject("Wscript.shell").SendKeys("{F11}"),setTimeout(function(){(screen.availHeight||screen.height-30)<=window.innerHeight?bbEmbed("#pinboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"):bbEmbed("#pinboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen")},400)}}),bbEmbed(document).on("click","#layout-items span",function(){var e,i,t,s,o,n;const d=window[null===(i=null===(e=a.embedOptions.events)||void 0===e?void 0:e.pinboard)||void 0===i?void 0:i.onLayoutChange];d instanceof Function&&d.call(this,bbEmbed("#widget-container")),(null===(s=null===(t=a.embedOptions.events)||void 0===t?void 0:t.pinboard)||void 0===s?void 0:s.onLayoutChange)instanceof Function&&(null===(n=null===(o=a.embedOptions.events)||void 0===o?void 0:o.pinboard)||void 0===n||n.onLayoutChange.call(a,bbEmbed("#widget-container")));const r=bbEmbed("#widget-container").attr("data-current-layout");switch(bbEmbed("#widget-container").attr("data-current-layout",bbEmbed(this).attr("id")),bbEmbed("#layout-items span").removeClass("active"),bbEmbed(this).addClass("active"),bbEmbed(this).attr("id")){case"1":"1"!=r&&(a.changeLayout(1),"111"==r?a.appendListItem(1,2):"11"!=r&&"12"!=r&&"21"!=r||a.appendListItem(1,1),a._setLayout(1));break;case"11":"11"!=r&&(a.changeLayout(11),"111"==r?a.appendListItem(2,1):"1"==r&&a.createEmptyList(2,2),a._setLayout(11));break;case"12":"12"!=r&&(a.changeLayout(12),"111"==r?a.appendListItem(2,1):"1"==r&&a.createEmptyList(2,2),a._setLayout(12));break;case"21":"21"!=r&&(a.changeLayout(21),"111"==r?a.appendListItem(2,1):"1"==r&&a.createEmptyList(2,2),a._setLayout(21));break;case"111":"111"!=r&&(a.changeLayout(111),"1"==r?a.createEmptyList(2,3):"11"!=r&&"12"!=r&&"21"!=r||a.createEmptyList(3,3),a._setLayout(111))}}),bbEmbed.map(a.pinboardDetails,function(e){a.isWidgetMode=!0,a.widgetName=a.authToken?e.Id:e.WidgetId,a.isDashboardViewMode=!1,a.dashboardViewName="";const i={Apistatus:!0,Data:a.authToken?e:JSON.parse(e),Status:!0};a._renderDashboard(i)})}_widgetNamesEmpty(){const e=embeddingLocalization_1.errorMessages.EmptyWidgetName;for(let i=0;i<this.embedOptions.widgetList.length;i++){const t=this.embedOptions.widgetList[Number(i)];this._isEmptyOrSpaces(t.widgetName)&&(this.errorOnContainer(e,t.containerId),this.embedOptions.widgetList.splice(i,1),i--)}return this.embedOptions.widgetList.length>0}errorOnContainer(e,i){const t='<div id="embedded-bi-error" style="display:table;height:100%;width:100%;"><div style="display: table-cell;vertical-align: middle;text-align: center;"><div style="display: inline-block;"><img src='+this.errorImage+' style="float: left"/><div style="float: left;margin-left: 10px;line-height: 20px;">BoldBI Embedded: '+e+"</div></div>";document.getElementById(i).innerHTML=t}createEmptyList(e,i){for(let t=e;t<=i;t++)bbEmbed("#widget-container").append('<ul id="column-'+t+'" data-column-id="'+t+'" data-child-count="0"><li class="empty click-container"><div class="empty-content empty-homepage"><span class="drag-widget" style="font-family:var(--font-family)">Drag your widgets here to customize layout</span></div></li></ul>')}appendListItem(e,i){for(let t=e+1;t<=e+i;t++)bbEmbed("#column-"+t+" li:not(.empty)").length>0&&bbEmbed("#column-"+e+" li.empty").remove(),bbEmbed("#column-"+e).append(bbEmbed("#column-"+t+" li:not(.empty)")),bbEmbed("#column-"+t).remove()}changeLayout(e){const i=this;let t;i.homepageItemId=bbEmbed("#widget-container").attr("data-homepage-id"),i.isVirtualHomepage=bbEmbed("#widget-container").attr("data-virtual-homepage"),""==i.homepageItemId&&i.isVirtualHomepage&&bbEmbed("#initial-message").hide();const s="embed_nonce="+this._uuidv4Generator()+"&homepageId="+i.homepageItemId+"&layout="+e+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(i.authToken||i._isEmptyOrSpaces(i.embedOptions.authorizationServer.url)){const s=this._validatetoken(i.authToken);t={homepageId:i.homepageItemId,layout:e},bbEmbed.ajax({async:!1,type:"POST",url:i.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:s},data:JSON.stringify(t),contentType:"application/json",success:bbEmbed.proxy(i._changeLayoutSuccess,i)})}else t={embedQuerString:encodeURI(s),embedQueryString:encodeURI(s),dashboardServerApiUrl:this.dashboardServerApiUrl},this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,t,this.embedOptions.authorizationServer.headers,this._changeLayoutSuccess)}_checkEmptyHomepage(){let e=0,i=!1;return bbEmbed("#widget-container ul").each(function(t){return e=bbEmbed("#column-"+(t+1)+' li:not(".empty")').length,i=!(e>0),!(e>0)}),i}_setLayout(e){const i=bbEmbed("#widget-container").attr("data-item-type").toLowerCase();switch(bbEmbed("#layout-items").find("span#"+e).addClass("active"),e){case 1:bbEmbed("#column-1").removeClass().addClass("col-lg-12 col-md-12 col-sm-12 col-12");break;case 11:bbEmbed("#column-1,#column-2").removeClass().addClass("col-lg-6 col-md-6 col-sm-6 col-6");break;case 12:bbEmbed("#column-1").removeClass().addClass("col-lg-4 col-md-4 col-sm-4 col-4"),bbEmbed("#column-2").removeClass().addClass("col-lg-8 col-md-8 col-sm-8 col-8");break;case 21:bbEmbed("#column-1").removeClass().addClass("col-lg-8 col-md-8 col-sm-8 col-8"),bbEmbed("#column-2").removeClass().addClass("col-lg-4 col-md-4 col-sm-4 col-4");break;case 111:bbEmbed("#column-1,#column-2,#column-3").removeClass().addClass("col-lg-4 col-md-4 col-sm-4 col-4")}if(this._checkEmptyHomepage()&&(window.IsMobile?(bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("mobile-empty-homepage"),bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").text("Log in using a desktop client to add widgets to this pinboard.").show(),bbEmbed("#widget-container ul li.empty").css("border","none")):(bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").hide(),bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("empty-homepage"))),"dashboard"!=i){const e=this;this.enableSorting(),this.setListMinimumHeight(),bbEmbed(".pinBoardDbrd").each(function(){const i=e._getDashboardInstance(this.id),t=window[e.embedOptions.events.onResize];t instanceof Function&&t.call(e,i),e.embedOptions.events.onResize instanceof Function&&e.embedOptions.events.onResize.call(e,i),i.resizeDashboard()})}}setListMinimumHeight(){const e=[];bbEmbed("#widget-container > ul").each(function(i){let t=0;bbEmbed(this).find("li").each(function(){t=t+bbEmbed(this).innerHeight()+20}),e[`${i}`]=t});const i=Math.max(...e)>400?Math.max(...e):440;bbEmbed("#widget-container > ul").css("min-height",i),bbEmbed("#server-app-container").height(bbEmbed("#content-area").height())}enableSorting(){"function"!=typeof window.bbEmbed.uniqueSort&&(window.bbEmbed.uniqueSort=window.bbEmbed.unique);const e=this;window.bbEmbed("#column-1, #column-2, #column-3").sortable({connectWith:"ul",placeholder:"placeholder",handle:".e-rteItem .e-rte-content, .bbi-dbrd-control-header:not(.bbi-dbrd-control-menu-icon)",cancel:".empty, .bbi-dbrd-control-menu-icon",containment:"#server-app-container",cursor:"move",tolerance:"pointer",scroll:!0,scrollSensitivity:10,scrollSpeed:20,update:function(i,t){e.toColumn=bbEmbed(i.target).data("column-id"),e.toPosition=t.item.index()+1},start:function(i,t){var s,o,n,d,a,r;bbEmbed("li.placeholder").append('<div class="placeholder-text" style="color: dimgray; font-size: 20px;padding-top: 10px;text-align: center;font-family:var(--font-family)">Drag your widgets here to customize layout</div>'),bbEmbed("li.placeholder").css({height:t.item.height().toString()+"px","background-color":"#eeeeee",border:"dashed lightgray"}),bbEmbed("#widget-container ul li.empty").remove(),e.fromColumn=bbEmbed(i.target).data("column-id"),e.fromPosition=t.item.index()+1,e.toColumn=bbEmbed(i.target).data("column-id"),e.toPosition=t.item.index()+1;const l=bbEmbed("#"+t.item.find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner"),b=window[null===(o=null===(s=e.embedOptions.events)||void 0===s?void 0:s.pinboard)||void 0===o?void 0:o.onDrag];b instanceof Function&&b.call(this,l),(null===(d=null===(n=e.embedOptions.events)||void 0===n?void 0:n.pinboard)||void 0===d?void 0:d.onDrag)instanceof Function&&(null===(r=null===(a=e.embedOptions.events)||void 0===a?void 0:a.pinboard)||void 0===r||r.onDrag.call(e,l))},stop:function(i,t){var s,o,n,d,a,r;e.showEmptyList();const l=window[null===(o=null===(s=e.embedOptions.events)||void 0===s?void 0:s.pinboard)||void 0===o?void 0:o.onDrop],b=bbEmbed("#"+t.item.find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner");l instanceof Function&&l.call(this,b),(null===(d=null===(n=e.embedOptions.events)||void 0===n?void 0:n.pinboard)||void 0===d?void 0:d.onDrop)instanceof Function&&(null===(r=null===(a=e.embedOptions.events)||void 0===a?void 0:a.pinboard)||void 0===r||r.onDrop.call(e,b)),e.fromColumn==e.toColumn&&e.fromPosition==e.toPosition||(e.fromColumn!=e.toColumn&&window.bbEmbed("#"+t.item.find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner").resizeDashboard(),e.dragAndDrop(e.fromColumn,e.toColumn,e.fromPosition,e.toPosition)),e.setListMinimumHeight()}}),window.bbEmbed("#column-1, #column-2, #column-3").disableSelection()}showEmptyList(){bbEmbed("#widget-container ul").each(function(e){bbEmbed("#column-"+(e+1)+" li").length<1&&bbEmbed("#column-"+(e+1)).append('<li class="empty click-container"><div class="empty-content empty-homepage"><span class="drag-widget" style="font-family:var(--font-family)">Drag your widgets here to customize layout</span></div></li>')})}dragAndDrop(e,i,t,s){const o=this;let n;const d=bbEmbed("#widget-container").attr("data-homepage-id"),a={Column:e,Position:t},r={Column:i,Position:s},l="embed_nonce="+this._uuidv4Generator()+"&homepageId="+d+"&moveFrom="+JSON.stringify(a)+"&moveTo="+JSON.stringify(r)+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(o.authToken||o._isEmptyOrSpaces(o.embedOptions.authorizationServer.url)){var b=this._validatetoken(o.authToken);n={homepageId:d,moveFrom:JSON.stringify(a),moveTo:JSON.stringify(r)},bbEmbed.ajax({async:!1,type:"POST",url:o.dashboardServerApiUrl+this.embedGetDetailsEndPoint,data:JSON.stringify(n),headers:{Authorization:b},contentType:"application/json",success:bbEmbed.proxy(o._dragAndDropSuccess,o)})}else n={embedQuerString:encodeURI(l),embedQueryString:encodeURI(l),dashboardServerApiUrl:this.dashboardServerApiUrl},this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,n,this.embedOptions.authorizationServer.headers,this._dragAndDropSuccess)}_unPinItem(e,i){const t=this;let s;const o=bbEmbed("#widget-container").attr("data-homepage-id"),n={Column:e,Position:i},d="embed_nonce="+this._uuidv4Generator()+"&homepageId="+o+"&unpinPosition="+JSON.stringify(n)+"&isUnpin="+!0+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(t.authToken||t._isEmptyOrSpaces(t.embedOptions.authorizationServer.url)){let e=this._validatetoken(t.authToken);s={homepageId:o,unpinPosition:JSON.stringify(n),isUnpin:!0},bbEmbed.ajax({async:!1,type:"POST",url:t.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:e},data:JSON.stringify(s),contentType:"application/json",success:bbEmbed.proxy(t._unPinSuccess,t)})}else s={embedQuerString:encodeURI(d),embedQueryString:encodeURI(d),dashboardServerApiUrl:this.dashboardServerApiUrl},this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,s,this.embedOptions.authorizationServer.headers,this._unPinSuccess)}_unPinSuccess(e){if(e.Status){bbEmbed("#column-"+this.column+" li:eq("+(this.position-1)+")").remove(),this.showEmptyList();this.checkEmptyHomepage()&&(bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").hide(),bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("empty-homepage")),this.setListMinimumHeight()}}checkEmptyHomepage(){let e=0,i=!1;return bbEmbed("#widget-container ul").each(function(t){return e=bbEmbed("#column-"+(t+1)+' li:not(".empty")').length,i=!(e>0),!(e>0)}),i}_renderItem(e){const i=this;if(this._checkEmptyHomepage()&&(bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").hide(),bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("empty-homepage")),bbEmbed("#widget-container").hide(),"widget"==e.ItemType.toLowerCase()){this._setLayout(e.ColumnInfo.Layout);const t=e.ColumnInfo.Column;bbEmbed.each(t,function(e){t[`${e}`].Item.length>0?(bbEmbed.each(t[`${e}`].Item,function(s){if(".sydj"!=t[`${e}`].Item[`${s}`].ItemExtension.toLowerCase())bbEmbed("#widget_"+(e+1)+"_"+(s+1)).ejDashboardViewer({accessToken:this.accessToken,serviceUrl:this.dashboardServiceUrl,serverUrl:this.dashboardServerUrl,_enableHyperLinkOnErrorMessage:!1,cdnFilePath:this.isUseCdn?this.cdnLink+"/scripts/viewer":"",dashboardPath:t[`${e}`].Item[`${s}`].Path,_itemId:t[`${e}`].Item[`${s}`].ItemId,reportName:"",reportDescription:"",enableExport:!0,enablePrint:!1,actionBegin:function(e){"beforeNavigate"==e.eventType&&(this.hasWidgetLink=!0)},localeSettings:{resourcePath:""},enableWidgetMode:null!=t[`${e}`].Item[`${s}`].Id,filterParameters:t[`${e}`].Item[`${s}`].QueryString,showTab:null==t[`${e}`].Item[`${s}`].TabId,widgetModeSettings:{name:"",id:null==t[`${e}`].Item[`${s}`].Id?"":t[`${e}`].Item[`${s}`].Id,title:t[`${e}`].Item[`${s}`].Name},_selectedTabGuid:null==t[`${e}`].Item[`${s}`].TabId?"":t[`${e}`].Item[`${s}`].TabId,afterWidgetRender:bbEmbed.proxy(function(i,t){if("card"==t.data.controlType.toLowerCase()&&(bbEmbed("#widget_"+(e+1)+"_"+(s+1)+" .e-control-heading span").hasClass("e-control-title")||bbEmbed("#widget_"+(e+1)+"_"+(s+1)+" .e-control-heading").text(i[`${e}`].Item[`${s}`].Name)),i[`${e}`].Item[`${s}`].IsActive&&!i[`${e}`].Item[`${s}`].IsHavingPermission?(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control-container").append('<div class="no-permission"><span class="message">You do not have permission to view this widget.</span></div>')):i[`${e}`].Item[`${s}`].IsActive||i[`${e}`].Item[`${s}`].IsHavingPermission||(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control-container").append('<div class="no-permission"><span class="message">This widget has been deleted.</span></div>')),i[`${e}`].Item[`${s}`].IsActive&&i[`${e}`].Item[`${s}`].IsHavingPermission&&null!=i[`${e}`].Item[`${s}`].QueryString){const i=bbEmbed("#widget_"+(e+1)+"_"+(s+1));i.find("#filter-info").parent().append('<div class="filter-overview"><span id="heading">Applied Filters</span><div id="outer-div"><div id="scroller-content"><div id="applied-filters-container"></div></div></div></div>'),i.find(".filter-overview #applied-filters-container").height()>180&&i.find(".filter-overview #scroller-content").BoldBIDashboardScroller({height:180,width:248,scrollerSize:9}),i.find(".filter-overview").addClass("display-none")}},this,t),beforeWidgetIconRendered:bbEmbed.proxy(function(i,t){"widget not configured"!=t.widgetInformation.Name.toLowerCase()?window.IsMobile?bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="250px":"card"!=t.widgetInformation.Name.toLowerCase()?bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="400px":bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="250px":(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="200px",bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control-container").append('<div class="no-permission"><span class="message">This widget has been deleted.</span></div>')),t.iconsinformation.length>0&&"bbi-dbrd-link-enable"==t.iconsinformation[0].classname&&(t.iconsinformation[0].margintop="1px"),window.IsMobile||t.iconsinformation.unshift({classname:"su su-delete unpin",name:"Unpin Widget",datatooltip:"Unpin Widget",marginright:"-18px",margintop:"4px"});const o=i[`${e}`].Item[`${s}`].IsActive&&i[`${e}`].Item[`${s}`].IsHavingPermission&&"widget not configured"!=t.widgetInformation.Name.toLowerCase();o&&(t.iconsinformation.unshift({classname:"su su-maximize unpin",name:"Maximize Widget",datatooltip:"Maximize Widget",marginright:"-18px",margintop:"4px"}),t.iconsinformation.unshift({classname:"su su-open-link-newtab unpin",name:"Go to Dashboard",datatooltip:"Go to Dashboard",marginright:"-18px",margintop:"4px"})),o&&null!=i[`${e}`].Item[`${s}`].QueryString&&t.iconsinformation.unshift({id:"filter-info",classname:"su su-info unpin",name:"Applied Filters",datatooltip:"View Applied Filters",margintop:"4px",marginright:"0px"}),bbEmbed("#widget-container").show();bbEmbed("#widget_"+(e+1)+"_"+(s+1)).ejDashboardViewer().resize()},this,t),dashboardCreated:function(){const i=bbEmbed("#widget_"+(e+1)+"_"+(s+1)).attr("data-dashboardurl");bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".su-open-link-newtab").wrap(bbEmbed('<a class="redirect" href="'+i+'" target="_blank">'))},onMenuIconClick:function(e){if(void 0!==e.name&&"unpin widget"==e.name.toLowerCase()){const i=e.target.parents("ul").data("column-id"),t=e.target.parents("li").index()+1;this.unPinItem(i,t,e.event)}else if(void 0!==e.name&&"maximize widget"==e.name.toLowerCase());else if(void 0!==e.name&&"applied filters"==e.name.toLowerCase()){const i=bbEmbed(e.event.target).parent().find(".filter-overview");i.toggleClass("display-none"),bbEmbed(".filter-overview").not(i).addClass("display-none"),e.event.preventDefault()}}});else{const o=i.embedOptions.embedContainerId+"_pinBoard_"+(e+1)+"_"+(s+1);bbEmbed("#widget_"+(e+1)+"_"+(s+1)).append('<div class="pinWidget" style="height:calc(100% - 5px);width:calc(100% - 25px);overflow: hidden !important;" id="'+o+'"><div id="'+o+'_embeddedbi" class="pinBoardDbrd"></div ></div>'),i.pinBoardRendered=!1,i.pinboardIds.push({widgetId:t[`${e}`].Item[`${s}`].Id,pinboardContainerId:o}),i.pinboardDetails[i.pinboardDetails.length]=i.authToken?t[`${e}`].Item[`${s}`]:t[`${e}`].Item[`${s}`].WidgetDetails,t[`${e}`].Item[`${s}`].IsActive&&!t[`${e}`].Item[`${s}`].IsHavingPermission?(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find("iframe").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).append('<div class="no-permission"><span class="message">You do not have permission to view this widget.</span></div>')):t[`${e}`].Item[`${s}`].IsActive||t[`${e}`].Item[`${s}`].IsHavingPermission||(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find("iframe").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).append('<div class="no-permission"><span class="message">This widget has been deleted.</span></div>'))}}),bbEmbed("#widget-container").show()):bbEmbed("#widget-container").show()}),this.enableSorting(),this.setListMinimumHeight()}else if("dashboard"==e.ItemType.toLowerCase()){const i=e.ColumnInfo.Column;bbEmbed("#dashboard_1_1").css({height:bbEmbed(window).height()-bbEmbed("#header-area").outerHeight()-bbEmbed("#base-footer-div").outerHeight()-bbEmbed("#homepage-header").outerHeight()-30,width:bbEmbed("#content-area").width()-10}),i[0].Item[0].IsActive&&i[0].Item[0].IsHavingPermission&&".sydj"!=i[0].Item[0].ItemExtension.toLowerCase()?bbEmbed("#dashboard_1_1").ejDashboardViewer({dashboardPath:e.ColumnInfo.Column[0].Item[0].Path,_itemId:e.ColumnInfo.Column[0].Item[0].ItemId,reportName:"",reportDescription:"",enableExport:!0,enablePrint:!1,showGetLinkIcon:!1,localeSettings:{resourcePath:""},interactionSettings:{allowHistoryMaintenance:!1,handleHistoryEvent:!1},enableWidgetMode:!1,filterParameters:e.ColumnInfo.Column[0].Item[0].QueryString,showTab:null==e.ColumnInfo.Column[0].Item[0].TabId,_selectedTabGuid:null!=e.ColumnInfo.Column[0].Item[0].TabId?e.ColumnInfo.Column[0].Item[0].TabId:"",beforeControlMenuOpen:function(e){e.menuData.splice(1,1)},onTabSelectionFailure:"OnFailtoLoadChildDashboard",beforeContextMenuOpen:function(e){!function(e,i,t){let s=e.length;for(;s--;)e[`${s}`]&&Object.prototype.hasOwnProperty.call(e[`${s}`],i)&&arguments.length>2&&e[`${s}`][`${i}`]==t&&e.splice(s,1)}(e.menuData,"text","Export")}}):i[0].Item[0].IsActive?i[0].Item[0].IsActive&&!i[0].Item[0].IsHavingPermission?bbEmbed("#dashboard_1_1").append('<div class="no-permission"><span class="message">You do not have permission to view this dashboard.</span></div>'):i[0].Item[0].IsActive&&i[0].Item[0].IsHavingPermission&&".sydj"==i[0].Item[0].ItemExtension.toLowerCase()&&bbEmbed("#dashboard_1_1").append('<div class="no-permission"><span class="message">Currently this dashboard is not supported.</span></div>'):bbEmbed("#dashboard_1_1").append('<div class="no-permission"><span class="message">This dashboard has been deleted.</span></div>'),bbEmbed("#widget-container").show()}}_addWidgetInPinboard(e){const i=bbEmbed("#widget-container").find("ul:first");1==bbEmbed("#widget-container").find("ul:first li").length&&bbEmbed("#widget-container").find("ul:first li").hasClass("empty")&&bbEmbed("#widget-container").find("ul:first li").remove();const t=bbEmbed("#widget-container").find("ul:first li").length,s=e.ColumnInfo.Column[0],o=null==s.Item[0].Id?"/bi/"+this.siteIdentifier+"/widgets/widgets":"/bi/"+this.siteIdentifier+"/dashboards",n=s.Item[0].Name,d=s.Item[0].WidgetType;let a=0;a=null!=d&&(d.includes("Card")||d.includes("Image"))?250:400;const r=null!=s.Item[0].QueryString?s.Item[0].QueryString:"",l=null==s.Item[0].TabId?o+"/"+s.Item[0].ItemId+"/"+(null!=s.Item[0].Id?s.Item[0].CategoryName+"/":"")+s.Item[0].ItemName+(""!=r?"?"+r:r):o+"/"+s.Item[0].ItemId+"/"+(null!=s.Item[0].Id?s.Item[0].CategoryName+"/":"")+s.Item[0].ItemName+"?tab="+s.Item[0].TabId+(""!=r?"&"+r:r),b=this.embedOptions.pinboardSettings.enableUnpinWidget||void 0===this.embedOptions.pinboardSettings.enableUnpinWidget?'<div id="widget-icons"><i class="items unpin-widget su su-delete" data-bs-toggle="tooltip" data-original-title="Unpin Widget"  style="color: black;" /></div>':"";bbEmbed(i).prepend('<li class="list-item"><div class="widget" id=widget_1_'+(t+1)+' data-dashboardurl="'+l+'" style="height: '+a+'px;width:100%;background:#fff;"><div class="widget-sortable" style="width:100%;float:left;display:block;height:0px"><div style="height:100%;width:100%;cursor:move;"><div id="item-name">'+n+"</div>"+b+"</div></div></div></li>");const m=this.embedOptions.embedContainerId+"_pinBoard_1_"+(t+1);bbEmbed("#widget_1_"+(t+1)).append('<div class="pinWidget" style="height:calc(100% - 5px);width:calc(100% - 25px);overflow: hidden !important;" id="'+m+'"><div id="'+m+'_embeddedbi" class="pinBoardDbrd"></div ></div>'),this.pinBoardRendered=!1,this.pinboardIds.push({widgetId:s.Item[0].Id,pinboardContainerId:m}),this.loadWidget(s.Item[0].Id,s.Item[0].ItemId),this.enableSorting(),this.setListMinimumHeight(),this._removeElementsClass(this.embedOptions.embedContainerId,".preloader-wrap","viewer-blue-loader")}_tabSelected(){if("undefined"!=typeof ejdashboard&&ejdashboard.base&&"function"==typeof ejdashboard.base.registerLicense){const e=window.bbEmbed(".parent-multitab-dbrd").children().attr("id");for(let i=0;i<window.bbEmbed("#"+e+" .e-toolbar-item").length;i++)window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).attr("style","display:block !important"),window.bbEmbed("#"+e+" .e-toolbar-item.e-active").children().attr("aria-controls")=="e-content-"+e+"_"+i?this._handleTabSelected(e,i):window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).css({display:"block",position:"absolute",left:window.bbEmbed(".e-content.e-lib.e-touch").width()*(i+1)})}else{const e=window.bbEmbed(".multitab-dbrd").attr("id");for(let i=0;i<window.bbEmbed("#"+e+" .e-toolbar-item").length;i++)window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).attr("style","display:block !important"),window.bbEmbed("#"+e+" .e-toolbar-item.e-active").attr("aria-controls")=="e-content-"+e+"_"+i?this._handleTabSelected(e,i):window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).css({display:"block",position:"absolute",left:window.bbEmbed(".e-content.e-lib.e-touch").width()*(i+1)})}}_handleTabSelected(e,i){window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).css({display:"block",position:"absolute",left:0});const t=window.bbEmbed("#"+window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).children().attr("id")).data("BoldBIDashboardDesigner");if(null==t||null==t){const t=window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children().attr("id").split("_")[1],s={Apistatus:!0,Data:this.dashboardDetails[`${t}`],Status:!0};this._renderDashboard(s)}}_isAIDepdencyLoaded(e){e.embedOptions.mode==BoldBI.Mode.AIAssistant&&window.bbEmbed instanceof Function&&void 0!==window.BoldBIAI&&window.BoldBIAI.UnifiedAIAgent?e.embedOptions.token||e.embedOptions.embedToken?(e.tokenResponse={ItemDetail:{IsPublic:!1,Name:"AIAssitant"}},e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})):e._getAuthorizationToken():setTimeout(e._isAIDepdencyLoaded,500,e)}_isDependencyLoaded(e,i){if(window.bbEmbed instanceof Function&&window.BoldBIDashboard instanceof Object&&!e._isNullOrUndefined(window.BoldBIDashboard)&&window.BoldBIDashboard.Designer instanceof Object&&window.BoldBIDashboardDesigner instanceof Function&&!e._isEmptyOrSpaces(e.designerRootUrl)&&window.Designer instanceof Object)if(e.IsDependencyLoaded||(e.IsDependencyLoaded=!0),e.embedOptions.token||e.embedOptions.embedToken)if(e.authToken=e.embedOptions.token?e.embedOptions.token:e.embedOptions.embedToken,e.embedOptions.token&&e.embedOptions.isPublicDashboard||e.embedOptions.embedToken&&e.embedOptions.mode!=BoldBI.Mode.Design&&e.embedOptions.mode!=BoldBI.Mode.Connection&&e.embedOptions.mode!=BoldBI.Mode.DataSource&&!e.embedOptions.isMultiTabDashboard&&!e.widgetName&&!e.embedOptions.viewId&&!e.embedOptions.pinboardName&&!e.editIgnore)e.tokenResponse={dashboardVersion:e.embedOptions.customDashboardVersion,ItemDetail:{IsPublic:!0,Description:"",Name:""}},e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0});else{var t=e._validatetoken(e.authToken);if(e.embedOptions.dashboardPath&&!e.embedOptions.dashboardId)e._throwError(embeddingLocalization_1.errorMessages.DbrdPathTokenAPIError);else if(e.embedOptions.datasourceName&&!e.embedOptions.datasourceId)e._throwError(embeddingLocalization_1.errorMessages.DataSourceTokenAPIError);else if(e.embedOptions.viewName&&!e.embedOptions.viewId)e._throwError(embeddingLocalization_1.errorMessages.ViewNameTokenAPIError);else if(e.isDashboardRendering&&e.embedOptions.dashboardId||e.isPinboardRendering&&e.embedOptions.pinboardName){const i=e.isDashboardRendering?e.dashboardServerApiUrl+"/v5.0/dashboards/"+e.embedOptions.dashboardId+"?canIgnorePublishDetails=true":e.dashboardServerApiUrl+"/pinboard/"+e.embedOptions.pinboardName;bbEmbed.ajax({async:!1,type:"GET",url:i,headers:{Authorization:t},contentType:"application/json",success:function(i){var t;if(i){e.tokenResponse.dashboardVersion=i.Version,e.tokenResponse.CanWrite=null!==(t=null==i?void 0:i.CanWrite)&&void 0!==t&&t;const s=e.isDashboardRendering&&i.IsMultiDashboard&&e.embedOptions.mode==BoldBI.Mode.Design?"Designer embedding":e.isDashboardRendering&&i.IsMultiDashboard?i.TabDetail:e.isPinboardRendering&&i.Status?i.Data:e.tokenResponse;e._authorizeResponse={Apistatus:!0,Data:s,Status:!0},"Designer embedding"!=s&&e.embedOptions.mode!=BoldBI.Mode.Design?e._renderDashboard({Apistatus:!0,Data:s,Status:!0}):"Designer embedding"!=s&&e.embedOptions.mode==BoldBI.Mode.Design?i.CanWrite?e._renderDashboard({Apistatus:!0,Data:s,Status:!0}):e._throwError(embeddingLocalization_1.errorMessages.InvalidEditAccess):e._throwError(embeddingLocalization_1.errorMessages.NotRenderMultitabDashboard)}else e.embedOptions.isMultiTabDashboard&&e.embedOptions.embedToken&&e.embedOptions.mode==BoldBI.Mode.Design?e._throwError(embeddingLocalization_1.errorMessages.NotRenderMultitabDashboardForAnonymousUser):e.embedOptions.embedToken&&e.embedOptions.mode==BoldBI.Mode.Design?e._throwError(embeddingLocalization_1.errorMessages.NotRenderDesignerForAnonymousUser):e._throwError(embeddingLocalization_1.errorMessages.DashboardNotAvailable)},error:function(i){if(0==i.status&&e._throwError(embeddingLocalization_1.errorMessages.PageUnavailable),401==i.status){const i=e._isJwtFormat(e.authToken);e._throwError(i?embeddingLocalization_1.errorMessages.InvalidAccessToken:embeddingLocalization_1.errorMessages.InvalidApiKey)}else 404==i.status&&e.isDashboardRendering?e._throwError(embeddingLocalization_1.errorMessages.InvalidDashboardID):e._throwError(embeddingLocalization_1.errorMessages.InvalidPinboardName)}})}else if(e.isDashboardRendering&&e.embedOptions.mode==BoldBI.Mode.Design&&e._isEmptyOrSpaces(e.embedOptions.dashboardId)&&e._isEmptyOrSpaces(e.embedOptions.dashboardPath))bbEmbed.ajax({async:!1,type:"POST",url:e.dashboardServerApiUrl+"/v5.0/dashboards/drafts",headers:{Authorization:t},contentType:"application/json",success:function(i){e.embedOptions.isdesignerdraft=!0,e.tokenResponse.draftItemID=i.Id,e.tokenResponse.ItemDetail.Name=i.Name,e.tokenResponse.CanWrite=!0,e._authorizeResponse={Apistatus:!0,Data:e.tokenResponse,Status:!0},e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})},error:function(i){if(401==i.status){const i=e._isJwtFormat(e.authToken);e._throwError(i?embeddingLocalization_1.errorMessages.InvalidAccessToken:embeddingLocalization_1.errorMessages.InvalidApiKey)}else 403==i.status&&e._throwError(embeddingLocalization_1.errorMessages.ProvideCreatePermission)}});else if(e.embedOptions.viewId&&e.isDashboardViewRendering)bbEmbed.ajax({async:!1,type:"GET",url:e.dashboardServerApiUrl+"/v5.0/dashboards/views/"+e.embedOptions.viewId,headers:{Authorization:t},contentType:"application/json",success:function(i){e.embedOptions.dashboardSettings=e.embedOptions.dashboardSettings||{},e.embedOptions.dashboardSettings.filterOverviewSettings=e.embedOptions.dashboardSettings.filterOverviewSettings||{},e.embedOptions.settings=e.embedOptions.settings||{},e.embedOptions.settings.viewer=e.embedOptions.settings.viewer||{},e.embedOptions.settings.viewer.filterOverview=e.embedOptions.settings.viewer.filterOverview||{},e.embedOptions.dashboardId=i.ItemId,e.embedOptions.dashboardSettings.filterOverviewSettings.viewId=e.embedOptions.settings.viewer.filterOverview.viewId=e.embedOptions.viewId,e.embedOptions.dashboardSettings.filterOverviewSettings.viewName=e.embedOptions.settings.viewer.filterOverview.ViewName=i.ViewName,e.embedOptions.filterParameters=i.QueryString,e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})},error:function(i){if(401==i.status){const i=e._isJwtFormat(e.authToken);e._throwError(i?embeddingLocalization_1.errorMessages.InvalidAccessToken:embeddingLocalization_1.errorMessages.InvalidApiKey)}else 400==i.status?e._throwError(embeddingLocalization_1.errorMessages.InvalidViewID):404==i.status&&e._throwError(embeddingLocalization_1.errorMessages.ViewDetailsNotFound)}});else if(e.widgetName){const i=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/.exec(e.widgetName);/[a-zA-Z]/.test(e.widgetName)&&/\d/.test(e.widgetName)&&e.widgetName.includes("-")&&!i?e._throwError(embeddingLocalization_1.errorMessages.InvalidWidgetID):i?e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0}):e._throwError(embeddingLocalization_1.errorMessages.WidgetNameTokenAPIError)}else e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})}else e._getAuthorizationToken(i);else setTimeout(e._isDependencyLoaded,500,e)}checkCompatibility(){this.deprecated=!1,this.validateServerAndWrapperVersion()}validateServerAndWrapperVersion(){this.deprecationMessage("validateServerAndWrapperVersion");const e=this;e.embedOptions.environment==BoldBI.Environment.Enterprise?bbEmbed.ajax({async:!0,type:"POST",url:e.dashboardServerApiUrl+"/server-version/get",contentType:"application/json",success:function(i){console.log(e.embedSDKWrapperVersion===i.Data.split(".").slice(0,2).join(".")?embeddingLocalization_1.successMessages.MatchVersion:embeddingLocalization_1.errorMessages.NotMatchVersion)}}):console.log(embeddingLocalization_1.errorMessages.EnsureServerOrSDKVersion)}_getDashboardInstance(e){const i=window.bbEmbed.call(this,"#"+(e||this.childContainer.id))[0];if(i)return window.bbEmbed.data.call(this,i,"BoldBIDashboardDesigner")}_checkWidgetList(){if(this.embedOptions.widgetList.length>0&&!this.embedOptions.embedContainerId){const e=embeddingLocalization_1.errorMessages.ErrorLoadMultipleWidget;return this.embedOptions.widgetList.forEach(i=>{const t=i.containerId,s='<div id="embedded-bi-error" style="display:table;height:100%;width:100%;"><div style="display: table-cell;vertical-align: middle;text-align: center;"><div style="display: inline-block;"><img src='+this.errorImage+' style="float: left"/><div style="float: left;margin-left: 10px;line-height: 20px;">BoldBI Embedded: '+e+"</div></div>";document.getElementById(t).innerHTML=s}),!0}return this.embedOptions.widgetList="",!1}_onBoldBIDashboardInstaceActionBegin(e,i){var t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f;if(this.isMultiTab&&0===parseInt(null!==(n=null===(o=null===(s=null===(t=bbEmbed(".e-content .e-active"))||void 0===t?void 0:t.attr("id"))||void 0===s?void 0:s.split("_"))||void 0===o?void 0:o.pop())&&void 0!==n?n:"",10)){const e=bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner");(null===(d=null==e?void 0:e.modules)||void 0===d?void 0:d.themeHelper)&&this.setDefaultTheme(e.modules.themeHelper.getBannerBackground(),e.modules.themeHelper.getBannerTextColor(),e.modules.themeHelper.getBannerIconColor())}if(void 0!==e&&"renderLayout"===e.eventType)this._removeElementsClass(i,".preloader-wrap","viewer-blue-loader");if(this.embedOptions.mode==BoldBI.Mode.Connection||this.embedOptions.mode==BoldBI.Mode.Design){if(!document.querySelector('style[data-id="hideRefreshSettingsButton"]')){const e=document.createElement("style");e.type="text/css",e.setAttribute("data-id","hideRefreshSettingsButton");const i=".bbi-dbrd-datasource-schedule { display: none !important }";e.appendChild(document.createTextNode(i)),document.head.appendChild(e)}}const w=window[this.actionBeginFn];w instanceof Function&&w.call(this,e);const I=window[this.embedOptions.events.onActionStart];if(I instanceof Function&&I.call(this,e),this.embedOptions.events.onActionStart instanceof Function&&this.embedOptions.events.onActionStart.call(this,e),"dataSourceSaveAction"==e.eventType&&this._onBoldBIBeforeDatasourceSaveAction(e),"filterInteraction"==e.eventType){const i=window[null===(r=null===(a=this.embedOptions.events)||void 0===a?void 0:a.filters)||void 0===r?void 0:r.beforeApply];i instanceof Function&&i.call(this,e),(null===(b=null===(l=this.embedOptions.events)||void 0===l?void 0:l.filters)||void 0===b?void 0:b.beforeApply)instanceof Function&&(null===(h=null===(m=this.embedOptions.events)||void 0===m?void 0:m.filters)||void 0===h||h.beforeApply.call(this,e))}if("publishAsAction"==e.eventType){const i=window[null===(p=null===(c=this.embedOptions.events)||void 0===c?void 0:c.designer)||void 0===p?void 0:p.beforePublishDialogOpen];i instanceof Function&&i.call(this,e),(null===(g=null===(u=this.embedOptions.events)||void 0===u?void 0:u.designer)||void 0===g?void 0:g.beforePublishDialogOpen)instanceof Function&&(null===(f=null===(v=this.embedOptions.events)||void 0===v?void 0:v.designer)||void 0===f||f.beforePublishDialogOpen.call(this,e))}}_onBoldBIDashboardInstaceActionComplete(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v;const f=this;let w;const I=window[this.actionCompleteFn];this._isNullOrUndefined(e.data)||("createConnection"==e.data.event&&(this.embedOptions.datasourceId=e.data.source.data,this.embedOptions.mode=BoldBI.Mode.DataSource,this.isNewConnection=!0,f.authToken?f._renderDashboard({Apistatus:!0,Data:this.tokenResponse,Status:!0}):f._isEmptyOrSpaces(f.embedOptions.authorizationServer.url)?(w={embed_datasource_id:f.embedOptions.datasourceId,embed_mode:f.embedOptions.mode},bbEmbed.ajax({async:!1,type:"POST",url:f.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:"Bearer "+f.accessToken},data:JSON.stringify(w),contentType:"application/json",success:bbEmbed.proxy(f._renderDashboard,f)})):this._getAuthorizationToken()),"cancelDataSource"==e.data.event&&(this.embedOptions.mode=BoldBI.Mode.Connection,f.authToken?f._renderDashboard({Apistatus:!0,Data:this.tokenResponse,Status:!0}):f._isEmptyOrSpaces(f.embedOptions.authorizationServer.url)?(w={embed_mode:f.embedOptions.mode},bbEmbed.ajax({async:!1,type:"POST",url:f.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:"Bearer "+f.accessToken},data:JSON.stringify(w),contentType:"application/json",success:bbEmbed.proxy(f._renderDashboard,f)})):this._getAuthorizationToken()));const O="boolean"==typeof(null===(i=this.embedOptions.dashboardSettings)||void 0===i?void 0:i.edit)?null===(t=this.embedOptions.dashboardSettings)||void 0===t?void 0:t.edit:null!==(n=null===(o=null===(s=this.embedOptions.settings)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.edit)&&void 0!==n&&n;if("dashboardRendered"==e.eventType&&O){const e=document.querySelector('[data-name="editdashboard"]');e&&(e.removeAttribute("disabled"),e.classList.remove("disabled"),e.style.pointerEvents="auto",e.style.opacity="1")}if(this.pinboardIds.length>0&&"renderWidget"===e.eventType){0===e.source.element.find(".bbi-dbrd-control-header .bbi-dbrd-control-title-wrapper").length?(e.source.element.parents(".widget").find("#widget-icons").css("margin-top","8px"),e.source.element.attr("data-name").toLowerCase().includes("card")&&e.source.element.find(".bbi-dbrd-control").css("top","20px")):(e.source.element.find(".bbi-dbrd-control-header").css("margin-left","-8px"),e.source.element.find(".bbi-dbrd-control-title-wrapper").css("margin-left","8px"))}if("interactionCompleted"==e.eventType){w={filterData:this._getFilterData(e.source.data.encryptedData),data:e};const i=window[null===(a=null===(d=this.embedOptions.events)||void 0===d?void 0:d.filters)||void 0===a?void 0:a.onInteraction];i instanceof Function&&i.call(this,w),(null===(l=null===(r=this.embedOptions.events)||void 0===r?void 0:r.filters)||void 0===l?void 0:l.onInteraction)instanceof Function&&(null===(m=null===(b=this.embedOptions.events)||void 0===b?void 0:b.filters)||void 0===m||m.onInteraction.call(this,e))}else{I instanceof Function&&I.call(this,e);const i=window[this.embedOptions.events.onActionComplete];i instanceof Function&&i.call(this,e),this.embedOptions.events.onActionComplete instanceof Function&&this.embedOptions.events.onActionComplete.call(this,e)}if("filterInteraction"==e.eventType){const i=window[null===(c=null===(h=this.embedOptions.events)||void 0===h?void 0:h.filters)||void 0===c?void 0:c.afterApply];i instanceof Function&&i.call(this,e),(null===(u=null===(p=this.embedOptions.events)||void 0===p?void 0:p.filters)||void 0===u?void 0:u.afterApply)instanceof Function&&(null===(v=null===(g=this.embedOptions.events)||void 0===g?void 0:g.filters)||void 0===v||v.afterApply.call(this,e))}if("dataSourceSaveAction"==e.eventType&&JSON.parse(e.schema.schema).length>0&&this._onBoldBIAfterDatasourceSaveAction(e),"Save"==e.eventType){this._authorizeResponse.Data.ItemDetail.Name=e.data.dashboardName;const i=this._authorizeResponse.Data.ItemDetail.ItemLocation;this.authToken?this._authorizeResponse.Data.dashboardVersion=e.data.version:this._authorizeResponse.Data.ItemDetail.ItemLocation=i.replace(/\/\d+$/,"/"+e.data.version)}"SaveAs"==e.eventType&&(this._authorizeResponse.Data.ItemDetail.Id=e.data.dashboardId,this._authorizeResponse.Data.ItemDetail.Name=e.data.dashboardName,this.authToken?this._authorizeResponse.Data.dashboardVersion=e.data.version:this._authorizeResponse.Data.ItemDetail.ItemLocation=e.data.dashboardId+"/"+e.data.version,this.embedOptions.dashboardId=e.data.dashboardId)}_onBoldBIDashboardInstaceReportOpen(e){const i=window[this.reportOpenedFn];i instanceof Function&&i.call(this,e);const t=window[this.embedOptions.reportOpened];t instanceof Function&&t.call(this,e),this.embedOptions.reportOpened instanceof Function&&this.embedOptions.reportOpened.call(this,e)}_onBoldBIDashboardInstanceNavigateToDashboard(e){var i,t;this._initializeDashboardContainer(),this.embedOptions.mode=BoldBI.Mode.View,this.embedOptions.dashboardSettings.edit=this.editIgnore,(null===(t=null===(i=this.embedOptions.settings)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.edit)&&(this.embedOptions.settings.viewer.edit=this.editIgnore),this._authorizeResponse.Data.ItemDetail.Name=e.PublishName,this.embedOptions.isdesignerdraft&&this.authToken&&(this._authorizeResponse.Data.ItemDetail.Id=e.PublishId,"0"==this._authorizeResponse.Data.dashboardVersion||this._authorizeResponse.Data.dashboardVersion,this.embedOptions.dashboardId=e.PublishId),this._renderDashboard(this._authorizeResponse);const s=window[this.performNavigateDashboardFn];s instanceof Function&&s.call(this,e);const o=window[this.embedOptions.performNavigateToDashboard];o instanceof Function&&o.call(this,e),this.embedOptions.performNavigateToDashboard instanceof Function&&this.embedOptions.performNavigateToDashboard.call(this,e)}_onBoldBIBeforeDatasourceSaveAction(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.beforeSave];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.beforeSave)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.beforeSave.call(this,e))}_onBoldBIAfterDatasourceSaveAction(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.afterSave];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.afterSave)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.afterSave.call(this,e))}_onBoldBIDashboardBeforeBannerIconRender(e,i){var t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E,D,S,B,C,x=!1,M=!1;if(this.isEditGroupSeparatorEnabled=!1,e.iconsinformation.find(e=>"Summarize"===e.groupId)){var A=e.iconsinformation.shift();M=!0}const F=e.iconsinformation.shift();if(e.iconsinformation.find(e=>"translatorgroup"===e.groupId)){var T=e.iconsinformation.shift();x=!0}const k=e.iconsinformation.shift(),L=e.iconsinformation.shift();this.dashboardWidgetExports.dashboard.showMoreOption&&(this.dashboardWidgetExports.dashboard.showExport||this.dashboardWidgetExports.dashboard.showMetrics)&&(this.dashboardWidgetExports.export.excel||this.dashboardWidgetExports.export.image||this.dashboardWidgetExports.export.pdf||this.dashboardWidgetExports.export.csv||this.dashboardWidgetExports.dashboard.showMetrics)||(e.iconsinformation=this._arraySlice(e.iconsinformation,"groupName","Option"));if(0==("boolean"==typeof(null===(t=this.embedOptions.dashboardSettings)||void 0===t?void 0:t.showDashboardParameter)?this.embedOptions.dashboardSettings.showDashboardParameter:null===(n=null===(o=null===(s=this.embedOptions.settings)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.dashboardParameter)||void 0===n||n))for(let e=k.items.length-1;e>=0;e--)this._isNullOrUndefined(k.items[`${e}`])||"dashboardparameters"!=k.items[`${e}`][0].dataset.name||k.items.splice(e,1);("boolean"==typeof(null===(d=this.embedOptions.dashboardSettings)||void 0===d?void 0:d.showRefresh)?null===(a=this.embedOptions.dashboardSettings)||void 0===a?void 0:a.showRefresh:null===(b=null===(l=null===(r=this.embedOptions.settings)||void 0===r?void 0:r.viewer)||void 0===l?void 0:l.refresh)||void 0===b||b)||L.items.splice(0,1);const N=window[this.beforeBannerIconRenderFn],W="boolean"==typeof(null===(m=this.embedOptions.dashboardSettings)||void 0===m?void 0:m.enableFullScreen)?null===(h=this.embedOptions.dashboardSettings)||void 0===h?void 0:h.enableFullScreen:null!==(u=null===(p=null===(c=this.embedOptions.settings)||void 0===c?void 0:c.viewer)||void 0===p?void 0:p.fullScreen)&&void 0!==u&&u;if(W){const i={groupId:"refresh-fullscreen",groupName:"Refresh & FullScreen",enableGroupSeperator:!0,items:[this._createBannerIcon("<div/>","dashboard-refresh","e-dbrd-banner-refresh","Refresh","refreshdashboard",!0,!1,{display:"none","font-size":"14px"}),this._createBannerIcon("<div/>","dashboard-fullscreen",this.isFullscreen?"su su-minimize":"su su-maximize-1","Fullscreen","fullscreen",!0,!1,{"font-size":"14px"})]};e.iconsinformation.unshift(i)}const z="boolean"==typeof(null===(g=this.embedOptions.dashboardSettings)||void 0===g?void 0:g.edit)?null===(v=this.embedOptions.dashboardSettings)||void 0===v?void 0:v.edit:null!==(I=null===(w=null===(f=this.embedOptions.settings)||void 0===f?void 0:f.viewer)||void 0===w?void 0:w.edit)&&void 0!==I&&I;if(z&&((null===(O=null==i?void 0:i.ItemDetail)||void 0===O?void 0:O.CanWrite)||(null==i?void 0:i.CanWrite))){this.isEditGroupSeparatorEnabled=!0;const i=this._createBannerIcon("<a/>","dashboard-edit","su su-edit","Edit","editdashboard",!0,!1,{"font-size":"13px","padding-left":"7px"},""),t={groupId:"edit-share",groupName:"Edit & Share",items:[i]};t.enableGroupSeperator=!W,e.iconsinformation.unshift(t),i.attr("disabled","true"),i.addClass("disabled"),i.css("pointer-events","none"),i.css("opacity","0.5")}else this.isDashboardRendering&&z&&!(null===(_=null==i?void 0:i.ItemDetail)||void 0===_?void 0:_.CanWrite)&&!(null==i?void 0:i.CanWrite)&&console.warn("Edit is set to true, but you’re not authorized to make changes to this dashboard.");L.items.length>0&&(e.iconsinformation.unshift(L),e.iconsinformation[0].enableGroupSeperator=!W&&!this.isEditGroupSeparatorEnabled),k.items.length>0&&e.iconsinformation.unshift(k),x&&e.iconsinformation.unshift(T),F.items.length>0&&e.iconsinformation.unshift(F),M&&e.iconsinformation.unshift(A),N instanceof Function&&N.call(this,e);const P=window[null===(E=null===(y=this.embedOptions.events)||void 0===y?void 0:y.viewer)||void 0===E?void 0:E.beforeToolBarItemsRender];P instanceof Function&&P.call(this,e),(null===(S=null===(D=this.embedOptions.events)||void 0===D?void 0:D.viewer)||void 0===S?void 0:S.beforeToolBarItemsRender)instanceof Function&&(null===(C=null===(B=this.embedOptions.events)||void 0===B?void 0:B.viewer)||void 0===C||C.beforeToolBarItemsRender.call(this,e)),[...document.head.querySelectorAll("style")].some(e=>e.innerHTML.includes("#dashboard-refresh { display: none !important"))||bbEmbed('<style type="text/css"> #dashboard-refresh { display: none !important} </style>').appendTo("head");const V=document.querySelectorAll("script"),U=Array.from(V).filter(e=>e.src.includes("cultures/boldbi.cultures.min.js"));U.length>1&&U.slice(1).forEach(e=>{var i;null===(i=e.parentElement)||void 0===i||i.removeChild(e)})}_createBannerIcon(e,i,t,s,o,n,d,a,r){return bbEmbed(e,d?{id:i,html:bbEmbed("<span/>",{class:"icon-with-label",text:s,css:{"font-family":"Roboto",padding:"10px"}}),class:"server-banner-icon e-dashboard-banner-icon bbi-dbrd-designer-hoverable "+t,"data-name":o,"data-event":n,href:r,css:a}:{id:i,class:"server-banner-icon e-dashboard-banner-icon bbi-dbrd-designer-hoverable "+t,"data-tooltip":s,"data-name":o,"data-event":n,css:a})}_onBoldBIDashboardBeforeOtherOptionContextMenuRender(e){var i,t,s,o,n,d;0==this.dashboardWidgetExports.dashboard.showExport&&(e.iconsinformation=this._arraySlice(e.iconsinformation,"groupName","export"));const a=window[this.beforeOtherRenderFn];a instanceof Function&&a.call(this,e);const r=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.beforeContextMenuRender];r instanceof Function&&r.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.beforeContextMenuRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.beforeContextMenuRender.call(this,e))}_onBoldBIDashboardSaveFilter(e){var i,t;const s=this,o=(null===(t=null===(i=s.embedOptions.events)||void 0===i?void 0:i.filters)||void 0===t?void 0:t.beforeSaveViewDialogOpen)||s.embedOptions.dashboardSettings.saveFilterClick,n=window[s.beforeSaveViewDialogOpenFn];n instanceof Function&&n.call(s,e);const d=window[`${o}`];if(d instanceof Function&&d.call(s,e),o instanceof Function&&o.call(s,e),!1===e.cancel)if(""==s.embedOptions.dashboardId&&""==s.embedOptions.dashboardIds)console.error(embeddingLocalization_1.errorMessages.EmptyDbrdCreate);else{let i;if(bbEmbed("body").find("#save_view_dialog_wrapper").remove(),i=s.embedOptions.dashboardIds&&s.embedOptions.dashboardIds.length>0?s.embedOptions.dashboardId=s.getActiveChildDashboardId():s.isMultiTab?s.getActiveChildDashboardId():s.embedOptions.dashboardId,e.viewId){const t={ViewId:e.viewId,DashboardId:i,QueryString:e.data.encryptedData};s.updateFilterView(t,function(e,i){console.log(i+embeddingLocalization_1.successMessages.UpdateFilterViewMsg+e.ViewId)})}else s._createSaveViewDialog(e)}}_addSaveViewDialogStyles(){bbEmbed('<style type="text/css">                     #save_view_dialog_header .su-view { float: left; padding-top: 5px; padding-right: 5px; font-size: 14px; color: var(--primary-text-normal-color); }                     #save_view_dialog_content { font-size: 12px; line-height: 1.4; }                     #save_view_dialog_header #save_view_dialog_header_title { color: var(--primary-text-normal-color);font-family: var(--font-family); font-size: 14px; padding-top: 5px; line-height: 15px; }                     #view_name_left_col { width: 25%; font-family: var(--font-family); font-size: 13px; float: left; text-align: right; margin: 5px 0px; }                     #view_name_right_col { width: 61%; float: left; margin-left: 50px; }                     #view_name_division {height: 50px}                     #default_view_division {height: 50px}                     #default_view_left {width: 25%; font-size: 13px; font-family: var(--font-family); float: left; text-align: right; margin: 5px 0px;}                     #default_view_right { width: 61%; float: left; margin-left: 50px; margin-top:5px; margin-bottom:5px}                     #view_name_textbox { width: 100%; border: 1px solid var(--secondary-border-color); padding: 6px 12px; color: var(--primary-text-normal-color); background: var(--primary-background-color); font-size: 12px; }                     #view_name_textbox:focus { border-color: var(--primary-branding-border-color)!important; }                     #cancel_button:hover { background: var(--secondary-btn-bg-hover-color); border: 1px solid var(--secondary-btn-border-normal-color); color: var(--secondary-btn-text-hover-color); }                     #save_button:hover { background: var(--primary-btn-bg-hover-color); border: 1px solid var(--primary-btn-border-normal-color); color: var(--primary-btn-text-hover-color) !important; }                     #save_view_dialog_footer { padding: 10px 15px; border-top: 1px solid var(--secondary-border-color); background: var(--secondary-background-color); }                     #save_view_dialog .e-dlg-closeicon-btn { margin-right: 5px; padding: 5px 0px; width: 15px; height: 20px; }                     #save_view_dialog .e-dlg-closeicon-btn .e-icon-dlg-close { font-size: 10px; color: var(--hyper-link-hover-color); }                     #save_view_dialog .e-dlg-closeicon-btn:hover, #save_view_dialog .e-dlg-closeicon-btn { background: var(--primary-background-color); }                     #save_view_dialog .e-dlg-content { background: var(--primary-background-color); color: var(--primary-text-normal-color); padding-bottom: 25px; }                     #view_name_err_msg { display: none; color: #ff3b30; font-size: 12px; }                     #cancel_button { background: var(--secondary-btn-bg-normal-color); border: 1px solid var(--secondary-btn-border-normal-color); color: var(--secondary-text-normal-color); font-family: var(--font-family); }                     #save_button { margin-right: 15px; background: var(--primary-btn-bg-normal-color); border: 1px solid var(--primary-btn-border-normal-color); color: var(--primary-btn-text-normal-color); font-family: var(--font-family); }                     #save_view_dialog .e-dlg-header-content { padding: 10px 15px; height: 40px; background: var(--primary-background-color); color: var(--primary-text-normal-color); }                     #save_view_dialog { background: var(--primary-background-color); }                     .footer-button-class { border-radius: 4px; display: inline-block; cursor: pointer; font-size: 12px; float: right; font-weight: 600; height: 32px; line-height: 18px; min-width: 90px; outline: 0; text-align: center; padding: 6px 20px; }                     .e-dlg-overlay { position: fixed; }                     .viewname-textbox-error { border: 1px solid #ff3b30 !important; }                     .default_view_switch {position: relative;display: inline-block;width: 28px; /* Width of the switch */height: 16px; /* Height of the switch margin-top: */}                    .default_view_switch input {  display: none;}                    .default_view_slider {position: absolute;cursor: pointer;top: 0;left: 0;right: 0;bottom: 0;background-color: var(--material-switch-background-bg-normal-color); border: 1px solid var(--secondary-btn-border-normal-color); -webkit-transition: .4s;transition: .4s;border-radius: 16px; /* Half of the height for a round shape */}                    .default_view_slider:before { position: absolute; content: ""; height: 9px; /* Height minus border width */width: 9px; /* Height minus border width */top: 3px; /* (Width - Height) / 2 to center it horizontally */ bottom: 3px; /* (Height - Height) / 2 to center it vertically  */left:2px; background-color: var(--material-switch-foreground-bg-normal-color); -webkit-transition: .4s; transition: .4s; border-radius: 50%; }                    .default_view_slider:hover {border: 1px solid var(--hover-icon-color);}                    input:checked + .default_view_slider { background-color: var(--primary-branding-color); border-color:var(--primary-branding-border-color);}                    input:focus + .default_view_slider {  box-shadow: 0 0 0.5px #2196F3;}                    input:checked + .default_view_slider:before {-webkit-transform: translateX(17.5px); /* Half of the width minus half of the height */-ms-transform: translateX(17.5px);transform: translateX(13.5px);background-color: white;}                    #info-icon {padding-left: 15px; cursor: pointer; font-size: 12px;}                     .su-info:before {content: ⓘ;}                    .default_view_slider_disable:before { position: absolute; content: ""; height: 9px; /* Height minus border width */width: 9px; /* Height minus border width */top: 3px; /* (Width - Height) / 2 to center it horizontally */ bottom: 3px; /* (Height - Height) / 2 to center it vertically */left:2px;background: var(--material-switch-foreground-bg-disable-color); -webkit-transition: .4s; transition: .4s; border-radius: 50%; }                    .tooltip {position: relative;display: inline-block;}                    .tooltip .tooltiptext {visibility: hidden;font-size: 11.8px;width: 320px;background: var(--primary-background-color);font-family: var(--font-family);color: var(--primary-text-normal-color);text-align: left;border-radius: 6px;padding: 5px;position: absolute;z-index: 1;top:130%;left:270%;margin-left:-60px; opacity: 0;transition: opacity 0.3s; border: 1px solid var(--secondary-border-color); box-shadow: 0 6px 12px rgba(0,0,0,.175)}                    .tooltip:hover .tooltiptext {visibility: visible;opacity: 1;}                    </style > ').appendTo("head")}_createSaveViewDialog(e){const i=this;i._addSaveViewDialogStyles();const t=bbEmbed("<div>").attr({id:"save_view_dialog_wrapper",class:"bi-dashboard"}).appendTo("body"),s=bbEmbed("<div>").attr("id","save_view_dialog").appendTo(t),o=`\n            <div id='save_view_dialog_content'>\n                <div id = "view_name_division">\n                    <label id='view_name_left_col'>Name*</label>\n                    <div id='view_name_right_col'>\n                        <input type='text' id='view_name_textbox' data-query='${e.data.encryptedData}' data-id='${e.viewId}'>\n                        <span id='view_name_err_msg'></span>\n                    </div>\n                </div>\n                <div id="default_view_division">\n                <label class="text-label" id="default_view_left">Mark as Default</label>\n                    <div id='default_view_right'>\n                        <label class="default_view_switch">\n                            <input type="checkbox" id="default_view_checkbox">\n                            <span class="default_view_slider" id="default_slider"></span>\n                        </label>\n                        <div class="tooltip">\n                            <div class="su su-info bbi-dbrd-designer-hoverable" id="info-icon" data-tooltip></div>\n                            <div class="tooltiptext" id="tooltip-text"></div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        `,n=bbEmbed("<div>").attr("id","save_view_dialog_footer"),d=bbEmbed("<button>").attr("id","save_button").addClass("footer-button-class").text("Save").on("click",()=>i._saveFilterView(i)),a=bbEmbed("<button>").attr("id","cancel_button").addClass("footer-button-class").text("Cancel").on("click",function(){bbEmbed("body").find("#save_view_dialog_wrapper, #success_save_view_dialog_wrapper").remove()});n.append(a),n.append(d),s.append(n);new window.ejdashboard.popups.Dialog({header:'<div id="save_view_dialog_header"><span class="su su-view"></span><div id="save_view_dialog_header_title">Save View</div></div>',width:"600px",isModal:!0,showCloseIcon:!0,target:t[0],content:o}).appendTo("#save_view_dialog"),document.getElementById("view_name_textbox").addEventListener("input",function(){i._viewNameValidation()});const r=document.getElementById("info-icon"),l=document.getElementById("tooltip-text");let b;if(r.addEventListener("mouseover",function(){l.textContent=b}),r.addEventListener("mouseout",function(){l.textContent=""}),this.isDefaultView)document.getElementById("default_view_checkbox").checked=!0,b=embeddingLocalization_1.successMessages.NonDefaultViewInfoMsg;else{bbEmbed(".default_view_slider").css({background:"var(--material-switch-background-bg-disable-color)",border:"1px solid var(--material-switch-background-border-disable-color)"});document.getElementById("default_slider").classList.add("default_view_slider_disable"),document.getElementById("default_view_checkbox").checked=!1,document.getElementById("default_view_checkbox").disabled=!0,b=embeddingLocalization_1.successMessages.DefaultViewInfoMsg}}_saveFilterView(e){const i=e,t=bbEmbed("#view_name_textbox")[0];if(i._viewNameValidation()){let e;this.embedOptions.dashboardIds.length>0||(e=i.isMultiTab?i.getActiveChildDashboardId():"");const s=t.value,o=t.getAttribute("data-query"),n=t.getAttribute("data-id"),d={ViewName:s,ItemId:i.embedOptions.dashboardId,QueryString:o,ChildItemId:e,IsDefault:!!document.getElementById("default_view_checkbox").checked},a=e=>{e?bbEmbed("body").find("#save_view_dialog_wrapper").remove():i._viewNameValidation(!0)};"null"===n?i.saveFilterView(d,a):i.saveAsFilterView(d,a)}}_updateInFilterOverviewUI(e,i){let t={};t=this.isMultiTab?window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner"):this._getDashboardInstance(),t&&t._updateFilterOverview(e,i)}_viewNameValidation(e){const i=bbEmbed("#view_name_textbox"),t=bbEmbed("#view_name_err_msg"),s=!/^[a-zA-Z0-9!@$^ ()_=\-}{.`~]*$/.test(i.val()),o=this._isEmptyOrSpaces(i[0].value);return e||s||o?(t.css({display:"block","font-family":"var(--font-family)"}).text(e?embeddingLocalization_1.errorMessages.ExistedViewName:s?embeddingLocalization_1.errorMessages.AvoidSplChar:o?embeddingLocalization_1.errorMessages.EmptyViewName:""),i.addClass("viewname-textbox-error"),!1):(t.css("display","none").text(),i.removeClass("viewname-textbox-error"),!0)}getActiveChildDashboardId(){return window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner")._id.split("_")[1].replace(/^([\da-f]{8})([\da-f]{4})([\da-f]{4})([\da-f]{4})([\da-f]{12})$/,"$1-$2-$3-$4-$5")}_getParametersFromQueryString(e){return JSON.parse(decodeURIComponent(e).split("filterQuery=")[1]).map(e=>({name:e.dimfi&&!e.dimfi.c.toLowerCase().includes("include")?`${e.cn} (${e.dimfi.c})`:e.cn,values:e.dimfi?e.dimfi.t:e.idf.dfl}))}_onBoldBIDashboardSaveAsFilter(e){var i,t;const s=this,o=(null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.filters)||void 0===t?void 0:t.beforeSaveAsViewDialogOpen)||this.embedOptions.dashboardSettings.saveAsFilterClick,n=window[this.beforeSaveAsViewDialogOpenFn];n instanceof Function&&n.call(this,e);const d=window[`${o}`];d instanceof Function&&d.call(this,e),o instanceof Function&&o.call(this,e),!1===e.cancel&&(""==s.embedOptions.dashboardId?console.error(embeddingLocalization_1.errorMessages.EmptyDbrdCreate):(bbEmbed("body").find("#save_view_dialog_wrapper").remove(),s._createSaveViewDialog(e)))}_onBoldBIDashboardOpenViewSection(e){var i,t;const s=this,o=(null===(t=null===(i=s.embedOptions.events)||void 0===i?void 0:i.filters)||void 0===t?void 0:t.onSavedFilterClick)||s.embedOptions.dashboardSettings.viewSavedFiltersClick,n=window[s.onViewSavedFiltersClickFn],d=this.isMultiTab?this.getActiveChildDashboardId():this.embedOptions.dashboardId;this.deprecated=!1,this.getViewsByDashboardId(d,function(i){e.viewInfos=i}),n instanceof Function&&n.call(s,e);const a=window[`${o}`];a instanceof Function&&a.call(s,e),o instanceof Function&&o.call(s,e)}_onGetLinkedDashboardDetails(e){const i=this;var t,s=void 0!==e&&null!=e?e:"",o=this._isNullOrUndefined(s)||void 0===s.itemType||null==s.itemType?null:s.itemType;if(!this._isNullOrUndefined(o))if("set"==o.toLowerCase()){var n={itemIdList:e.itemCollection};const t=this._validatetoken(i.accessToken);bbEmbed.ajax({type:"POST",url:this.dashboardServerApiUrl+"/embed/linked-dashboard-details",headers:{Authorization:t},contentType:"application/json",data:JSON.stringify(n),success:function(e){i.embedOptions.dashboardDetailList=e.Data}})}else if("get"==o.toLowerCase()&&!this._isNullOrUndefined(i.embedOptions.dashboardDetailList)){var d=i.embedOptions.dashboardDetailList.filter(i=>i.Id===e.itemId),a=d[0].CategoryName;bbEmbed("#favorite_Item").attr("data-item-id",d[0].Id),bbEmbed("#dashboard_Comment").attr({"data-item-id":d[0].Id,"data-category-name":a,"data-item-name":d[0].Name}),bbEmbed("#isMultiDashboard").attr("data-item-id",e.itemId),t={itemId:e.itemId,dashboardPath:e.itemId+"/"+d[0].Version,dashboardName:d[0].Name},e.modelInfo=t}}_onBoldBIDashboardBannerIconClick(e){var i,t,s,o,n,d;if("fullscreen"==e.name.toLowerCase()&&this._switchFullscreenMode(e),"refreshdashboard"==e.name.toLowerCase())if(this.isMultiTab){window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner").updateDashboard()}else{this._getDashboardInstance().updateDashboard()}if("editdashboard"==e.name.toLowerCase()&&(this._initializeDashboardContainer(),this.embedOptions.mode=BoldBI.Mode.Design,this._renderDashboard(this._authorizeResponse)),"dashboardparameters"==e.name.toLowerCase()){const e=document.createElement("style");e.innerHTML=".remove-scroller-dashboard-parameter { width: 100% !important; height: 100% !important; color: #333; background: #fff; border-radius: 0; }",document.head.appendChild(e);const i=this;setTimeout(function(){const e=i.isMultiTab?window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner"):i._getDashboardInstance();bbEmbed("#"+e._id+"_dashboardparameter_dialog").addClass("remove-scroller-dashboard-parameter")},50)}const a=window[this.onBannerIconClickFn];a instanceof Function&&a.call(this,e);const r=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.onToolbarItemClick];if(r instanceof Function&&r.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.onToolbarItemClick)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.onToolbarItemClick.call(this,e)),void 0!==e.name&&"theming"==e.name.toLowerCase()){let i;if(this.isMultiTab){this.multiTabTheme=e.selectedTheme;const i=window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner");i.applyDashboardTheme(e.selectedTheme),this.setDefaultTheme(i.modules.themeHelper.getBannerBackground(),i.modules.themeHelper.getBannerTextColor(),i.modules.themeHelper.getBannerIconColor());const t=window.bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<t.length;i++)if(window.bbEmbed(window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd")).attr("id")!=window.bbEmbed(t[`${i}`]).attr("id")){const s=window.bbEmbed(t[`${i}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.applyDashboardTheme(e.selectedTheme)}}else{this._getDashboardInstance(i).applyDashboardTheme(e.selectedTheme)}}}getComments(e,i,t){this.deprecationMessage("getComments");const s=this,o={ItemId:"dashboard"==e?i.dashboardId:i.widgetId,DashboardItemId:"dashboard"==e&&this.isMultiTab?i.multitabDashboardId:i.dashboardId,ItemType:e,ParentItemId:this.isMultiTab?i.multitabDashboardId:null,CommentAction:3,OrderBy:1};var n=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:n},data:JSON.stringify(o),contentType:"application/json",success:function(o){if(o.Status)if("dashboard"==e)s.commentsArgs.Comments=o.Comments,s.commentsArgs.ActiveCommentsCount=o.ActiveCommentsCount,s.commentsArgs.SortBy=1,s.commentsArgs.DashboardId=o.ItemId,window[`${t}`]instanceof Function?window[`${t}`].call(s,s.commentsArgs):t.call(s,s.commentsArgs);else if("widget"==e){const e=bbEmbed("[data-widget-id="+i.widgetId+"]"),n=e[0].id,d=bbEmbed("#"+n).width(),a=e.offset().left+d,r=e.offset().top;let l=bbEmbed(window).width()-(a+350);l<0&&(l=bbEmbed(window).width()-(a-(bbEmbed(window).width()<450?0:75)),bbEmbed(window).width()<375&&(l=0)),s.commentsArgs.Comments=o.Comments,s.commentsArgs.Position={top:r+20,right:l+40},s.commentsArgs.ActiveCommentsCount=o.ActiveCommentsCount,s.commentsArgs.SortBy=1,s.commentsArgs.WidgetId=i.widgetId,s.commentsArgs.DashboardId=i.dashboardId,window[`${t}`]instanceof Function?window[`${t}`].call(s,s.commentsArgs):t.call(s,s.commentsArgs)}},error:function(e){s.ajaxErrorFnc(e)}})}addDashboardComment(e,i){this.deprecationMessage("addDashboardComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId),d=!e.parentCommentId||!!Number(e.parentCommentId);if(o&&n&&d&&!this._isEmptyOrSpaces(e.content)){const s=(new Date).toISOString(),o={ItemType:"dashboard",Comment:e.content,ItemId:e.dashboardId,ParentId:e.parentCommentId,ParentItemId:e.multitabDashboardId,CommentAction:0,CurrentDate:s,Url:this.dashboardUrl};var a=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:a},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("dashboard",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&n?d?this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidReplyCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}addWidgetComment(e,i){this.deprecationMessage("addWidgetComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=s.exec(e.widgetId),d=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId),a=!e.parentCommentId||!!Number(e.parentCommentId);if(n&&o&&d&&a&&!this._isEmptyOrSpaces(e.content)){const s=(new Date).toISOString(),o={ItemType:"widget",Comment:e.content,ItemId:e.widgetId,DashboardItemId:e.dashboardId,ParentId:e.parentCommentId,ParentItemId:e.multitabDashboardId,CommentAction:0,CurrentDate:s,Url:this.dashboardUrl};var r=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:r},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("widget",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&d&&n?a?this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidReplyCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidgetID)}deleteDashboardComment(e,i){this.deprecationMessage("deleteDashboardComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(o&&n&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"dashboard",CommentId:e.commentId,ItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:2,CurrentDate:s,Url:this.dashboardUrl};var d=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:d},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("dashboard",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&n?this._isEmptyOrSpaces(e.commentId)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}deleteWidgetComment(e,i){this.deprecationMessage("deleteWidgetComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=s.exec(e.widgetId),d=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(n&&o&&d&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"widget",CommentId:e.commentId,ItemId:e.widgetId,DashboardItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:2,CurrentDate:s,Url:this.dashboardUrl};var a=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:a},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("widget",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&d&&n?this._isEmptyOrSpaces(e.commentId)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidgetID)}editDashboardComment(e,i){this.deprecationMessage("editDashboardComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(o&&n&&!this._isEmptyOrSpaces(e.content)&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"dashboard",Comment:e.content,CommentId:e.commentId,ItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:1,CurrentDate:s,Url:this.dashboardUrl};var d=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:d},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("dashboard",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&n?this._isEmptyOrSpaces(e.commentId)?console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}editWidgetComment(e,i){this.deprecationMessage("editWidgetComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=s.exec(e.widgetId),d=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(n&&o&&d&&!this._isEmptyOrSpaces(e.content)&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"widget",Comment:e.content,CommentId:e.commentId,ItemId:e.widgetId,DashboardItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:1,CurrentDate:s,Url:this.dashboardUrl};var a=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:a},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.commentsArgs.StatusMessage=s.StatusMessage,t.deprecated=!1,t.getComments("widget",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&d&&n?this._isEmptyOrSpaces(e.commentId)?console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidgetID)}ajaxErrorFnc(e){let i="";i=0==e.status?embeddingLocalization_1.errorMessages.NetworkIssue:404==e.status?"Not Found"==e.statusText?embeddingLocalization_1.errorMessages.ViewIDNotFound:embeddingLocalization_1.errorMessages.PageNotFound:500==e.status?embeddingLocalization_1.errorMessages.InternalServerError:embeddingLocalization_1.errorMessages.UncaughtError+e.responseText,this._isNullOrUndefined(this.embedOptions.events.onError)||""==this.embedOptions.events.onError?console.error(i):this.onErrorClient(i)}setDefaultTheme(e,i,t){bbEmbed(".e-tab-header.e-control.e-toolbar.e-lib.e-keyboard").css("color",t),bbEmbed(".e-toolbar-item .e-tab-text").css("color",i),bbEmbed(".e-toolbar-item.e-active .e-tab-text").addClass("active-font-color"),bbEmbed(".multitab-dbrd").css("background",e),bbEmbed(".e-items.e-toolbar-items.e-lib.e-hscroll.e-control.e-touch .e-nav-arrow").css("color",t)}_switchFullscreenMode(e){const i=document.getElementById(e.target.parent().attr("id").split("_embeddedbi")[0]);if(this.isFullscreen=!1,document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else if(i.requestFullscreen)i.requestFullscreen();else if(i.msRequestFullscreen)i.msRequestFullscreen();else if(i.mozRequestFullScreen)i.mozRequestFullScreen();else if(i.webkitRequestFullscreen)i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else if("ActiveXObject"in window){new ActiveXObject("Wscript.shell").SendKeys("{F11}"),setTimeout(function(){(screen.availHeight||screen.height-30)<=window.innerHeight?(bbEmbed('<style id="embed-fullscreen" type="text/css"> .hide-dashboard-icons #dashboard-refresh {  display: block !important; } .hide-dashboard-icons ul.options, .hide-dashboard-icons .su-pin, .hide-dashboard-icons .su-edit, .hide-dashboard-icons .bbi-dbrd-banner-link, .hide-dashboard-icons .bbi-dbrd-banner-menu, .hide-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-dashboard-icons .bbi-dbrd-control-menu, .hide-dashboard-icons .e-dashboard-banner-menu, .hide-dashboard-icons .e-dashboard-banner-link, .hide-dashboard-icons .su-icon, .hide-dashboard-icons .bbi-dbrd-control-menu-icon, .hide-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#pinboard-fullscreen), .hide-dashboard-icons .e-dashboard-banner-description, .hide-dashboard-icons .server-banner-icon + .e-banner-verticalsplitline, .hide-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-dashboard-icons .bbi-dashboard-widget-menu { display: none !important; } .hide-dashboard-icons #dashboard { width: 100% !important; } .hide-embed-dashboard-icons .bbi-dbrd-banner-link, .hide-embed-dashboard-icons .bbi-dbrd-banner-menu, .hide-embed-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-embed-dashboard-icons .bbi-dbrd-control-menu, .hide-embed-dashboard-icons .e-dashboard-banner-menu, .hide-embed-dashboard-icons .e-dashboard-banner-link, .hide-embed-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#dashboard_otheroption):not(#dashboard-view):not(#dashboard-comment):not(#dashboard_dashboardmenu), .hide-embed-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-embed-dashboard-icons .saved-view .su.cursor-pointer { display: none !important; } </style>').appendTo("head"),bbEmbed("body").addClass("hide-dashboard-icons"),bbEmbed("#dashboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen")):(bbEmbed("#embed-fullscreen").remove(),bbEmbed("body").removeClass("hide-dashboard-icons"),this.isMultiTab&&bbEmbed("#"+this.embedOptions.embedContainerId).find(".multitab-dbrd").css("width",this.embedOptions.width),bbEmbed("#dashboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen"))},400)}}_fullscreenExitHandler(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O;if(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement){const i=document.getElementById("remove-view-saved");if("boolean"==typeof(null===(b=null===(l=this.embedOptions.dashboardSettings)||void 0===l?void 0:l.filterOverviewSettings)||void 0===b?void 0:b.showViewSavedFilterIcon)?null===(h=null===(m=this.embedOptions.dashboardSettings)||void 0===m?void 0:m.filterOverviewSettings)||void 0===h?void 0:h.showViewSavedFilterIcon:null!==(g=null===(u=null===(p=null===(c=this.embedOptions.settings)||void 0===c?void 0:c.viewer)||void 0===p?void 0:p.filterOverview)||void 0===u?void 0:u.viewSavedFilter)&&void 0!==g&&g)if(i)document.getElementById("remove-view-saved").innerHTML=".bbi-dbrd-view-saved { display: none; }";else{const e=document.createElement("style");e.type="text/css",e.id="remove-view-saved";const i=".bbi-dbrd-view-saved{display:none}";e.appendChild(document.createTextNode(i)),document.head.appendChild(e)}this.isFullscreen=!0;const t="boolean"==typeof(null===(v=this.embedOptions.dashboardSettings)||void 0===v?void 0:v.showRefresh)?null===(f=this.embedOptions.dashboardSettings)||void 0===f?void 0:f.showRefresh:null===(O=null===(I=null===(w=this.embedOptions.settings)||void 0===w?void 0:w.viewer)||void 0===I?void 0:I.refresh)||void 0===O||O;bbEmbed('<style id="embed-fullscreen" type="text/css"> .hide-dashboard-icons #dashboard-refresh { display:'+(t?"block !important":"none !important")+"; } .hide-dashboard-icons ul.options, .hide-dashboard-icons .su-pin, .hide-dashboard-icons .su-edit, .hide-dashboard-icons .bbi-dbrd-banner-link, .hide-dashboard-icons .bbi-dbrd-banner-menu, .hide-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-dashboard-icons .bbi-dbrd-control-menu, .hide-dashboard-icons .e-dashboard-banner-menu, .hide-dashboard-icons .e-dashboard-banner-link, .hide-dashboard-icons .su-icon, .hide-dashboard-icons .bbi-dbrd-control-menu-icon, .hide-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#pinboard-fullscreen), .hide-dashboard-icons .e-dashboard-banner-description, .hide-dashboard-icons .server-banner-icon + .e-banner-verticalsplitline, .hide-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-dashboard-icons .bbi-dashboard-widget-menu { display: none !important; } .hide-dashboard-icons #dashboard { width: 100% !important; } .hide-embed-dashboard-icons .bbi-dbrd-banner-link, .hide-embed-dashboard-icons .bbi-dbrd-banner-menu, .hide-embed-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-embed-dashboard-icons .bbi-dbrd-control-menu, .hide-embed-dashboard-icons .e-dashboard-banner-menu, .hide-embed-dashboard-icons .e-dashboard-banner-link, .hide-embed-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#dashboard_otheroption):not(#dashboard-view):not(#dashboard-comment):not(#dashboard_dashboardmenu), .hide-embed-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-embed-dashboard-icons .saved-view .su.cursor-pointer { display: none !important; } </style>").appendTo("head"),bbEmbed("body").addClass("hide-dashboard-icons"),e.isMultiTab?bbEmbed("#"+e.embedOptions.embedContainerId).find(".multitab-dbrd .e-content .e-active").find("#dashboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"):bbEmbed("#dashboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"),bbEmbed("#pinboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"),bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; overflow: auto !important")}else{bbEmbed("#embed-fullscreen").remove(),bbEmbed("body").removeClass("hide-dashboard-icons"),e.isMultiTab?(bbEmbed("#"+e.embedOptions.embedContainerId).find(".multitab-dbrd").css("width","100%"),bbEmbed("#"+e.embedOptions.embedContainerId).find(".multitab-dbrd .e-content .e-active").find("#dashboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen")):bbEmbed("#dashboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen"),bbEmbed("#pinboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen"),bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; height:"+bbEmbed("#content-area").height()+"px;overflow: hidden !important;min-height: 600px; width:"+e.embedOptions.width);("boolean"==typeof(null===(t=null===(i=this.embedOptions.dashboardSettings)||void 0===i?void 0:i.filterOverviewSettings)||void 0===t?void 0:t.showViewSavedFilterIcon)?null===(o=null===(s=this.embedOptions.dashboardSettings)||void 0===s?void 0:s.filterOverviewSettings)||void 0===o?void 0:o.showViewSavedFilterIcon:null!==(r=null===(a=null===(d=null===(n=this.embedOptions.settings)||void 0===n?void 0:n.viewer)||void 0===d?void 0:d.filterOverview)||void 0===a?void 0:a.viewSavedFilter)&&void 0!==r&&r)&&(document.getElementById("remove-view-saved").innerHTML=".bbi-dbrd-view-saved { display: block; }")}}_onBoldBIDashboardBeforeWidgetIconRendered(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p;const u="boolean"==typeof(null===(i=this.embedOptions.widgetSettings)||void 0===i?void 0:i.showMaximize)?this.embedOptions.widgetSettings.showMaximize:null===(o=null===(s=null===(t=this.embedOptions.settings)||void 0===t?void 0:t.widget)||void 0===s?void 0:s.maximize)||void 0===o||o,g="boolean"==typeof(null===(n=this.embedOptions.widgetSettings)||void 0===n?void 0:n.showFilter)?this.embedOptions.widgetSettings.showFilter:null===(r=null===(a=null===(d=this.embedOptions.settings)||void 0===d?void 0:d.widget)||void 0===a?void 0:a.filter)||void 0===r||r;u||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","maximize")),g||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","filter")),!1!==this.dashboardWidgetExports.widget.showExport&&(this.dashboardWidgetExports.export.excel||this.dashboardWidgetExports.export.image||this.dashboardWidgetExports.export.pdf||this.dashboardWidgetExports.export.csv)||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","export"),this._isNullOrUndefined(e.widgetInformation)||this._isNullOrUndefined(e.widgetInformation.widgetJson)||this._isNullOrUndefined(e.widgetInformation.widgetJson.ContainerSettings)||e.widgetInformation.widgetJson.ContainerSettings.ViewData&&1!=e.widgetInformation.widgetJson.ContainerSettings.ViewActionData||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","menu"))),0==this.dashboardWidgetExports.widget.showMoreOption&&(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","menu"));const v=window[this.beforeWidgetIconRenderedFn];v instanceof Function&&v.call(this,e);const f=window[null===(b=null===(l=this.embedOptions.events)||void 0===l?void 0:l.widget)||void 0===b?void 0:b.beforeToolBarItemsRender];f instanceof Function&&f.call(this,e),(null===(h=null===(m=this.embedOptions.events)||void 0===m?void 0:m.widget)||void 0===h?void 0:h.beforeToolBarItemsRender)instanceof Function&&(null===(p=null===(c=this.embedOptions.events)||void 0===c?void 0:c.widget)||void 0===p||p.beforeToolBarItemsRender.call(this,e))}_onBoldBIBeforeControlMenuOpen(e){var i,t,s,o,n,d;!1!==this.dashboardWidgetExports.widget.showExport&&(this.dashboardWidgetExports.export.excel||this.dashboardWidgetExports.export.image||this.dashboardWidgetExports.export.pdf||this.dashboardWidgetExports.export.csv)||(e.menuItems=this._arraySlice(e.menuItems,"id","export"));const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.beforeContextMenuRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.beforeContextMenuRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.beforeContextMenuRender.call(this,e))}_onBoldBIBeforeDashboardMobileMenuOpen(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u;const g="boolean"==typeof(null===(i=this.embedOptions.dashboardSettings)||void 0===i?void 0:i.showRefresh)?null===(t=this.embedOptions.dashboardSettings)||void 0===t?void 0:t.showRefresh:null===(n=null===(o=null===(s=this.embedOptions.settings)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.refresh)||void 0===n||n,v="boolean"==typeof(null===(d=this.embedOptions.dashboardSettings)||void 0===d?void 0:d.showDashboardParameter)?this.embedOptions.dashboardSettings.showDashboardParameter:null===(l=null===(r=null===(a=this.embedOptions.settings)||void 0===a?void 0:a.viewer)||void 0===r?void 0:r.dashboardParameter)||void 0===l||l;if(0==v||!g||0==this.dashboardWidgetExports.dashboard.showExport)for(let i=e.menuItems.length-1;i>=0;i--)(0==v&&"dashboardparameters"==e.menuItems[`${i}`].id||!g&&"refreshDashboard"==e.menuItems[`${i}`].id||0==this.dashboardWidgetExports.dashboard.showExport&&"export"==e.menuItems[`${i}`].id)&&e.menuItems.splice(i,1);const f=window[null===(m=null===(b=this.embedOptions.events)||void 0===b?void 0:b.viewer)||void 0===m?void 0:m.beforeMobileMenuOpen];f instanceof Function&&f.call(this,e),(null===(c=null===(h=this.embedOptions.events)||void 0===h?void 0:h.viewer)||void 0===c?void 0:c.beforeMobileMenuOpen)instanceof Function&&(null===(u=null===(p=this.embedOptions.events)||void 0===p?void 0:p.viewer)||void 0===u||u.beforeMobileMenuOpen.call(this,e))}_onBoldBIAjaxBeforeLoad(e){const i=window[this.embedOptions.events.onAjaxStart];i instanceof Function&&i.call(this,e),this.embedOptions.events.onAjaxStart instanceof Function&&this.embedOptions.events.onAjaxStart.call(this,e)}_onBoldBIbeforeDesignerToolbarButtonsRendered(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.designer)||void 0===t?void 0:t.beforeToolbarButtonsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.designer)||void 0===o?void 0:o.beforeToolbarButtonsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.designer)||void 0===d||d.beforeToolbarButtonsRender.call(this,e))}_onBoldBIbeforeDatasourceToolbarButtonsRendered(e){var i,t,s,o,n,d;for(let i=e.toolbarButtons.length-1;i>=0;i--)e.toolbarButtons[`${i}`].elementId!=this.embedOptions.embedContainerId+"_embeddedbi_continue_dashboard_button"&&e.toolbarButtons[`${i}`].elementId!=this.embedOptions.embedContainerId+"_embeddedbi_editScheduleButton"||e.toolbarButtons.splice(i,1),this.isNewConnection||this.embedOptions.mode==BoldBI.Mode.Design||e.toolbarButtons[`${i}`].elementId==this.embedOptions.embedContainerId+"_embeddedbi_cancelButton"&&e.toolbarButtons.splice(i,1);this.isNewConnection=!1;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.beforeToolbarButtonsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.beforeToolbarButtonsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.beforeToolbarButtonsRender.call(this,e))}_onBoldBIbeforeDatasourceToolbarIconsRendered(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.beforeToolbarIconsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.beforeToolbarIconsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.beforeToolbarIconsRender.call(this,e))}_onBoldBIbeforeDesignerToolbarIconsRendered(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.designer)||void 0===t?void 0:t.beforeToolbarIconsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.designer)||void 0===o?void 0:o.beforeToolbarIconsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.designer)||void 0===d||d.beforeToolbarIconsRender.call(this,e))}_onBoldBItoolbarClick(e){var i,t,s;const o=null===(i=this.embedOptions)||void 0===i?void 0:i.mode,n="design"===o?"designer":"datasource"===o?"datasource":null;if(!n)return;const d=null===(s=null===(t=this.embedOptions.events)||void 0===t?void 0:t[n])||void 0===s?void 0:s.onToolbarItemClick;if("string"==typeof d){const i=window[d];"function"==typeof i&&i.call(this,e)}"function"==typeof d&&d.call(this,e)}_onBoldBIbeforeWidgetItemsListed(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.designer)||void 0===t?void 0:t.beforeWidgetsListed];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.designer)||void 0===o?void 0:o.beforeWidgetsListed)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.designer)||void 0===d||d.beforeWidgetsListed.call(this,e))}_onBoldBIbeforeWidgetLayoutRender(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.beforeLayoutRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.beforeLayoutRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.beforeLayoutRender.call(this,e))}_onBoldBIDashboardWidgetIconClick(e){var i,t,s,o,n,d;const a=window[this.onWidgetIconClickFn];a instanceof Function&&a.call(this,e);const r=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.onToolbarItemClick];r instanceof Function&&r.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.onToolbarItemClick)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.onToolbarItemClick.call(this,e))}_onBoldBIonControlMenuClick(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.onToolbarItemClick];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.onToolbarItemClick)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.onToolbarItemClick.call(this,e))}_onBoldBIDashboardUpdatefavorite(e){const i=window[this.onFavoriteStateChangeFn];i instanceof Function&&i.call(this,e);const t=window[this.embedOptions.dashboardSettings.onFavoriteIconClick];t instanceof Function&&t.call(this,e),this.embedOptions.dashboardSettings.onFavoriteIconClick instanceof Function&&this.embedOptions.dashboardSettings.onFavoriteIconClick.call(this,e)}_onBoldBIBeforeNavigateUrlLinking(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.beforeUrlNavigation];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.beforeUrlNavigation)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.beforeUrlNavigation.call(this,e))}_onBoldBIBeforeViewdataIconRender(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.beforeViewDataRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.beforeViewDataRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.beforeViewDataRender.call(this,e))}_onBoldBIBeforeNavigateToDashboard(e){const i=window[this.embedOptions.beforeNavigateToDashboard];i instanceof Function&&i.call(this,e),this.embedOptions.beforeNavigateToDashboard instanceof Function&&this.embedOptions.beforeNavigateToDashboard.call(this,e)}_onBoldBIAuthorizionComplete(e){const i=window[this.embedOptions.authorizationServer.authorizionComplete];i instanceof Function&&i.call(this,e),this.embedOptions.authorizationServer.authorizionComplete instanceof Function&&this.embedOptions.authorizationServer.authorizionComplete.call(this,e)}_showLoader(e){this.isMultipleWidgetMode&&(this.embedOptions.embedContainerId=e);const i=this.embedOptions.embedContainerId,t=`\n        #${i} .viewer-blue-loader { display: block !important; }\n        #${i} .loader-icon { display: block; left: 0 !important; position: relative; margin: 0 auto; width: 54px; height: 54px; }\n        #${i} .loader-icon .circular { animation: rotate 2s linear infinite; height: 54px; width: 54px; position: relative; }\n        #${i} .loader-icon .path { stroke-dasharray: 1,200; stroke-dashoffset: 0; animation: dash 1.5s ease-in-out infinite; stroke: #5592FB; stroke-linecap: square; }\n        @keyframes rotate { 100% { transform: rotate(360deg); } }\n        @keyframes dash {\n            0% { stroke-dasharray: 1,200; stroke-dashoffset: 0; }\n            50% { stroke-dasharray: 89,200; stroke-dashoffset: -35; }\n            100% { stroke-dasharray: 89,200; stroke-dashoffset: -124; }\n        }\n        `;if(![...document.head.querySelectorAll("style")].some(e=>e.innerHTML.includes(`#${i} .viewer-blue-loader`))){const e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e)}const s='<div class="preloader-wrap viewer-blue-loader" style="display: none; width: '+this.embedOptions.width+";height: "+this.embedOptions.height+'; top: 0; bottom: 0; z-index : 2;"> <div id="loader_image" align="center" style="position:relative;top:45%;"> <div class="loader-blue loader-icon" id="loader-icon"> <svg class="circular"> <circle class="path" cx="27" cy="27" r="20" fill="none" stroke-width="4" stroke-miterlimit="10"></circle> </svg> </div> </div> </div>';this._removeElement("embedded-bi-error"),document.getElementById(this.embedOptions.embedContainerId).insertAdjacentHTML("afterbegin",s)}_xhrRequestHelper(e,i,t,s,o){const n=this,d=new XMLHttpRequest;d.open(e,i,!0),d.responseType="json",d.setRequestHeader("Content-type","application/json");for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&d.setRequestHeader(e,s[`${e}`]);d.onreadystatechange=function(){if(4==d.readyState&&200==d.status){const e="object"==typeof d.response?d.response:JSON.parse(d.response);n._authorizeResponse=e,o.call(n,e)}else 4==d.readyState&&404==d.status?n._throwError(embeddingLocalization_1.errorMessages.ServerNotFound):4==d.readyState&&n._throwError(d.statusText)},d.send(JSON.stringify(t))}_emptyHtml(e){document.getElementById(e).innerHTML=""}_removeElement(e){const i=document.getElementById(e);null!=i&&i.parentNode.removeChild(i)}_uuidv4Generator(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const i=16*Math.random()|0;return("x"==e?i:3&i|8).toString(16)})}_isEmptyOrSpaces(e){return void 0===e||null==e||null!=e.match(/^ *$/)}_isNullOrUndefined(e){return null==e||null==e}_isUrl(e){let i;try{i=new URL(e)}catch(e){return!1}return"http:"==i.protocol||"https:"==i.protocol}_throwError(e,i){var t,s,o,n,d,a,r,l;i=this._isEmptyOrSpaces(i)?this.embedOptions.embedContainerId:i;const b=!("boolean"==typeof this.embedOptions.hideErrorMessage?this.embedOptions.hideErrorMessage:null!==(s=null===(t=this.embedOptions.settings)||void 0===t?void 0:t.hideErrorMessage)&&void 0!==s&&s);if(i){e&&"string"==typeof e?e=e.replace(/^BoldBI Embedded:\s*/,""):e&&"string"==typeof e.message&&(e=e.message.replace(/^BoldBI Embedded:\s*/,""));const t=(null===(d=null===(n=null===(o=this.embedOptions)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.brand)||void 0===d?void 0:d.name)?this.embedOptions.settings.brand.name:"BoldBI Embedded";if(this._removeElementsClass(i,".preloader-wrap","viewer-blue-loader"),b){const s='<div id="embedded-bi-error" style="display:table;height:100%;width:100%;"><div style="display: table-cell;vertical-align: middle;text-align: center;"><div style="display: inline-block;"><img src='+this.errorImage+' style="float: left"/><div style="float: left;margin-left: 10px;line-height: 20px;">'+t+":"+e+"</div></div>",o=document.getElementById(i);o&&(o.innerHTML=s)}}else b&&alert(e);if(this._isNullOrUndefined(this.embedOptions.events.onError)||""==this.embedOptions.events.onError)throw new Error(embeddingLocalization_1.errorMessages.BoldBIEmbedded+e);{const i=(null===(l=null===(r=null===(a=this.embedOptions)||void 0===a?void 0:a.settings)||void 0===r?void 0:r.brand)||void 0===l?void 0:l.name)?new Error(this.embedOptions.settings.brand.name+":"+e):new Error(embeddingLocalization_1.errorMessages.BoldBIEmbedded+e);this.onErrorClient(i)}}onErrorClient(e){const i={errorStatus:!0,StatusMessage:e,StatusCode:500},t=window[this.embedOptions.events.onError];t instanceof Function&&t.call(this,i),this.embedOptions.events.onError instanceof Function&&this.embedOptions.events.onError.call(this,i)}_removeElementsClass(e,i,t){let s=[];if(this._isEmptyOrSpaces(e))s=document.querySelector(i);else if(this._isEmptyOrSpaces(i))s.push(document.getElementById(e));else{const t=document.getElementById(e);s=t?t.querySelectorAll(i):[]}s.forEach(function(e){this._removeClass(e,t)}.bind(this))}_hasClass(e,i){if(e.classList)return e.classList.contains(i);const t=RegExp;return!!e.className.match(new t("(\\s|^)"+i+"(\\s|$)"))}_addClass(e,i){e.classList?e.classList.add(i):this._hasClass(e,i)||(e.className+=" "+i)}_removeClass(e,i){if(e.classList)e.classList.remove(i);else if(this._hasClass(e,i)){const t=new RegExp("(\\s|^)"+i+"(\\s|$)");e.className=e.className.replace(t," ")}}_arraySlice(e,i,t){return e.forEach(function(e,s,o){e[`${i}`]==t&&o.splice(s,1)}.bind(this)),e}_getFilterData(e){const i={masterData:[]},t=decodeURI(e).replace(/~&~/g,String.fromCharCode(251)+String.fromCharCode(251)).replace(/~=~/g,String.fromCharCode(250)+String.fromCharCode(250)).replace(/~[?]~/g,String.fromCharCode(253)+String.fromCharCode(253)).replace(/~[/]~/g,String.fromCharCode(254)+String.fromCharCode(254)).replace(/&&/g,"&").replace(/&/g,"|,|").replace(/=/g,"|:|").replace(/~,~/g,String.fromCharCode(252)+String.fromCharCode(252)).split("|,|");for(let e=0;e<t.length;e++){const s=t[`${e}`].split("|:|");if(s.length>=2&&"FILTERQUERY"==s[0].trim().toUpperCase()){const e=s[1],t=bbEmbed.parseJSON(e);""!=t&&0!=t.length&&(i.masterData=this._lengthensSelectedFilterInfo(t),this._unEscapeSelectedFilterDataforURLFilter(i.masterData));continue}}return this._createFilterCollection(i.masterData)}_createFilterCollection(e){if(e){const i=[];return e.forEach(function(e){let t=e.ColumnName,s=[];e.InitialDateFilter.DisplayDateFilterList.length>0&&(s=e.InitialDateFilter.DisplayDateFilterList,e.IsRange&&(s=[s[0]+" - "+s[1]])),e.InitialMeasureFilter.Values.length>0&&(s=e.InitialMeasureFilter.Values),e.InitialDimensionFilter.Text.length>0&&(s=e.InitialDimensionFilter.Text,t=t+" ("+e.InitialDimensionFilter.DimesnionFilterCondition+")"),e.InitialDimensionFilter.Text.length>0&&(s=e.InitialDimensionFilter.Text),i.push({ColumnName:t,Values:s})}.bind(this)),i}}_lengthensSelectedFilterInfo(e){const i=[],t=e.length;for(let s=0;s<t;s++){const t=e[`${s}`],o=new SelectedFilterValue;this._hasValue(t,shortenEnum.UniqueColumnName)&&(o[lengthenEnum.UniqueColumnName]=t[shortenEnum.UniqueColumnName]),this._hasValue(t,shortenEnum.ReportName)&&(o[lengthenEnum.ReportName]=t[shortenEnum.ReportName]),this._hasValue(t,shortenEnum.IsStdDateTime)&&(o[lengthenEnum.IsStdDateTime]=t[shortenEnum.IsStdDateTime]),this._hasValue(t,shortenEnum.IsRange)&&(o[lengthenEnum.IsRange]=t[shortenEnum.IsRange]),this._hasValue(t,shortenEnum.IsGroupBarFilter)&&(o[lengthenEnum.IsGroupBarFilter]=t[shortenEnum.IsGroupBarFilter]),this._hasValue(t,shortenEnum.IsMultiSelection)&&(o[lengthenEnum.IsMultiSelection]=t[shortenEnum.IsMultiSelection]),this._hasValue(t,shortenEnum.ColumnName)&&(o[lengthenEnum.ColumnName]=t[shortenEnum.ColumnName]),this._hasValue(t,shortenEnum.FieldId)&&(o[lengthenEnum.FieldId]=t[shortenEnum.FieldId]),this._hasValue(t,shortenEnum.IsPoPWidget)&&(o[lengthenEnum.IsPoPWidget]=t[shortenEnum.IsPoPWidget]),this._hasValue(t,shortenEnum.InitialDateFilter)&&(this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFilterCondition)&&(o.InitialDateFilter[lengthenEnum.DateFilterCondition]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFilterCondition]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFilterList)&&(o.InitialDateFilter[lengthenEnum.DateFilterList]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFilterList]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFilterType)&&(o.InitialDateFilter[lengthenEnum.DateFilterType]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFilterType]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DisplayDateFilterList)&&(o.InitialDateFilter[lengthenEnum.DisplayDateFilterList]=t[shortenEnum.InitialDateFilter][shortenEnum.DisplayDateFilterList]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFormat)&&(o.InitialDateFilter[lengthenEnum.DateFormat]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFormat]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.SelectedRangeforRelativeFilter)&&(o.InitialDateFilter[lengthenEnum.SelectedRangeforRelativeFilter]=t[shortenEnum.InitialDateFilter][shortenEnum.SelectedRangeforRelativeFilter])),this._hasValue(t,shortenEnum.InitialDimensionFilter)&&(this._hasValue(t[shortenEnum.InitialDimensionFilter],shortenEnum.DimesnionFilterCondition)&&(o.InitialDimensionFilter[lengthenEnum.DimesnionFilterCondition]=t[shortenEnum.InitialDimensionFilter][shortenEnum.DimesnionFilterCondition]),this._hasValue(t[shortenEnum.InitialDimensionFilter],shortenEnum.Text)&&(o.InitialDimensionFilter[lengthenEnum.Text]=t[shortenEnum.InitialDimensionFilter][shortenEnum.Text])),this._hasValue(t,shortenEnum.InitialMeasureFilter)&&(this._hasValue(t[shortenEnum.InitialMeasureFilter],shortenEnum.MeasureFilterCondition)&&(o.InitialMeasureFilter[lengthenEnum.MeasureFilterCondition]=t[shortenEnum.InitialMeasureFilter][shortenEnum.MeasureFilterCondition]),this._hasValue(t[shortenEnum.InitialMeasureFilter],shortenEnum.Values)&&(o.InitialMeasureFilter[lengthenEnum.Values]=t[shortenEnum.InitialMeasureFilter][shortenEnum.Values])),this._hasValue(t,shortenEnum.PoPFilter)&&(this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.DateFieldId)&&(o.PoPFilter[lengthenEnum.DateFieldId]=t[shortenEnum.PoPFilter][shortenEnum.DateFieldId]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.PrimaryType)&&(o.PoPFilter[lengthenEnum.PrimaryType]=t[shortenEnum.PoPFilter][shortenEnum.PrimaryType]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.SecondaryType)&&(o.PoPFilter[lengthenEnum.SecondaryType]=t[shortenEnum.PoPFilter][shortenEnum.SecondaryType]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.PrimaryCustomRange)&&(o.PoPFilter[lengthenEnum.PrimaryCustomRange][lengthenEnum.StartRange]=t[shortenEnum.PoPFilter][shortenEnum.PrimaryCustomRange][shortenEnum.StartRange],o.PoPFilter[lengthenEnum.PrimaryCustomRange][lengthenEnum.EndRange]=t[shortenEnum.PoPFilter][shortenEnum.PrimaryCustomRange][shortenEnum.EndRange]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.SecondaryCustomRange)&&t[shortenEnum.PoPFilter][shortenEnum.SecondaryCustomRange].length>0&&(o.PoPFilter[lengthenEnum.SecondaryCustomRange][0][lengthenEnum.StartRange]=t[shortenEnum.PoPFilter][shortenEnum.SecondaryCustomRange][0][shortenEnum.StartRange],o.PoPFilter[lengthenEnum.SecondaryCustomRange][0][lengthenEnum.EndRange]=t[shortenEnum.PoPFilter][shortenEnum.SecondaryCustomRange][0][shortenEnum.EndRange])),this._hasValue(o,lengthenEnum.UniqueColumnName)&&this._hasValue(o,lengthenEnum.ReportName)&&i.push(o)}return i}_hasValue(e,i){return!this._isNullOrUndefined(e)&&!this._isNullOrUndefined(e[`${i}`])}_unEscapeSelectedFilterDataforURLFilter(e){for(let i=0;i<e.length;i++){const t=e[`${i}`];if(!this._isNullOrUndefined(t.InitialDimensionFilter.Text)&&0!=t.InitialDimensionFilter.Text.length)for(let e=0;e<t.InitialDimensionFilter.Text.length;e++)t.InitialDimensionFilter.Text[`${e}`]=t.InitialDimensionFilter.Text[`${e}`].replaceAll(String.fromCharCode(252)+String.fromCharCode(252),",").replaceAll(String.fromCharCode(251)+String.fromCharCode(251),"&").replaceAll(String.fromCharCode(250)+String.fromCharCode(250),"=").replaceAll(String.fromCharCode(253)+String.fromCharCode(253),"?").replaceAll(String.fromCharCode(254)+String.fromCharCode(254),"/")}return e}_getWidgetFilterInfo(){const e=this._widgetsCollection,i=[];if(1==Array.isArray(e))for(let t=0;t<e.length;t++){let s=BoldBI._gettinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBIWidget_"+e[`${t}`]);s=Array.isArray(s)?s:[s];const o=[];let n;for(let e=0;e<s.length;e++)n=s[`${e}`].includes("=")?{columnName:s[`${e}`].split("=")[0].toString(),values:s[`${e}`].split("=")[1].split(",")}:{values:s},o[o.length]=n;const d={id:e[`${t}`],filters:o};i[i.length]=d}return i}_multipleWidgets(e,...i){const t=this._getDashboardInstance();if(!this._isNullOrUndefined(t)){var s=t.loadMultipleWidget.multipleWidgetInstanceCollection;for(let t=0;t<s.length;t++){const o=s[t].currentInstance;if("widgets"==e)s[t].widgetId==i[0][0].id&&(o.model[e]=[],o.option(e,...i));else if("exportWidgetAsCsv"!=e&&"exportWidgetAsImage"!=e&&"exportWidgetAsExcel"!=e&&"exportWidgetAsPdf"!=e)"function"==typeof o[e]?o[e](...i):(o.model[e]="",o.option(e,...i));else if(s[t].widgetId==i[0]&&"function"==typeof o[e]){const t=i.slice(1);o[e](...t)}}}}applyStyles(){this.deprecated=!1,this.addStyles()}addStyles(){this.deprecationMessage("addStyles");this._loadDepedentFiles()}removeStyles(){this.deprecated=!1,this.destroyStyles()}destroyStyles(){this.deprecationMessage("destroyStyles");const e=this;document.querySelectorAll("link").forEach(function(i){e.cssFiles.forEach(function(e){-1!=i.href.toLowerCase().indexOf(e.toLowerCase())&&i.parentNode.removeChild(i)})})}_validatetoken(e){const i=e||this.authToken;return this._isJwtFormat(i)?`bearer ${i}`:`basic ${i}`}_isJwtFormat(e){return/^[A-Za-z0-9-_=]+?\.[A-Za-z0-9-_=]+?\.[A-Za-z0-9-_.+/=]*$/.test(e)}removeWidgetInstance(e){this.deprecationMessage("removeWidgetInstance");const i=document.getElementById(this.embedOptions.embedContainerId);BoldBI._removewidgetinstance(i,"embeddedBoldBIWidget_"+e),this._widgetsCollection=this._widgetsCollection.filter(i=>i!==e)}static _putinstance(e,i,t){BoldBI._storage.has(e)||BoldBI._storage.set(e,new Map),BoldBI._storage.get(e).set(i,t)}static _gettinstance(e,i){if(BoldBI._storage.has(e))return BoldBI._storage.get(e).get(i)}static _hasinstance(e,i){return BoldBI._storage.has(e)&&BoldBI._storage.get(e).has(i)}static _removeinstance(e,i){if(BoldBI._storage.has(e)){const t=BoldBI._storage.get(e).delete(i);return 0!=BoldBI._storage.get(e).size&&BoldBI._storage.delete(e),t}}static _removewidgetinstance(e,i){if(BoldBI._storage.has(e)){return BoldBI._storage.get(e).delete(i)}}}exports.BoldBI=BoldBI,BoldBI.Mode=enum_1.Mode,BoldBI.EmbedType=enum_1.EmbedType,BoldBI.Environment=enum_1.Environment,BoldBI.Theme=enum_1.Theme,BoldBI.WidgetPanelDisplayMode=enum_1.WidgetPanelDisplayMode,BoldBI._storage=new WeakMap,BoldBI._widgetsCollection=[];class widgetBI{constructor(){this.containerID="",this.widgetCollection=[],this.deprecated=!0}setFilterParameters(e){this.deprecated&&((0,sdk_deprecation_utils_1.deprecatedMethod)("setFilterParameters"),this.deprecated=!0);const i=this.widgetCollection;1==Array.isArray(i)&&BoldBI._hasinstance(document.getElementById(this.containerID),"embeddedBoldBIWidget_"+i[i.length-1])&&BoldBI._putinstance(document.getElementById(this.containerID),"embeddedBoldBIWidget_"+i[i.length-1],e)}setFilters(e){this.deprecated=!1,this.setFilterParameters(e)}}exports.widgetBI=widgetBI;
//# sourceMappingURL=/sm/face861b40083db40eb6fec10842fd0a00ceca2432117f2f558d919886fee56a.map