@databrainhq/plugin 0.14.4 → 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webcomponents.es.js +100 -19
- package/dist/webcomponents.umd.js +81 -2
- package/package.json +1 -1
|
@@ -969,7 +969,7 @@ Check the top-level render call using <`+Wt+">.")}return Lt}}function Or(Le,Lt){
|
|
|
969
969
|
}`),(j=t.cardCustomization.padding)!=null&&j.trim()&&(e=`${e}
|
|
970
970
|
.dbn-metric-card {
|
|
971
971
|
padding: ${t.cardCustomization.padding} !important;
|
|
972
|
-
}`),i){const T=document.querySelectorAll("dbn-dashboard");T.length&&T.forEach((A,h)=>{if(A&&A.shadowRoot){const x=document.querySelector(`#dbn-dashboard-${h}-admin-styles`);if(x)x.innerHTML=e;else{const O=document.createElement("style");O.setAttribute("id",`dbn-dashboard-${h}-admin-styles`),O.innerHTML=e,A.shadowRoot.appendChild(O)}}});const y=document.querySelectorAll("dbn-metric");y.length&&y.forEach((A,h)=>{if(A.shadowRoot){const x=document.querySelector(`#dbn-metric-${h}-admin-styles`);if(x)x.innerHTML=e;else{const O=document.createElement("style");O.setAttribute("id",`dbn-metric-${h}-admin-styles`),O.innerHTML=e,A.shadowRoot.appendChild(O)}}});const z=document.querySelector("#dbn-portal");if(z&&z.shadowRoot){const A=document.querySelector("#dbn-portal-admin-styles");A&&z.shadowRoot.removeChild(A)}}else{const T=document.querySelector("#dbn-admin-styles")||document.createElement("style");T.setAttribute("id","dbn-admin-styles"),T.innerHTML=e,document.querySelector("#dbn-admin-styles")||document.head.appendChild(T)}},[t])},wge=({token:t,dashboardId:i})=>l1([F6,{dashboardId:i}],()=>{const e=i?`${tD}?dashboardId=${i}`:tD;return Wa(e,{method:"GET",token:t})},{enabled:!!t}),Cge=(t,i)=>l1([$6,{dashboardId:t,clientId:i}],()=>Wa(`${LDe}?id=${t}&clientId=${i}`,{method:"GET"}),{enabled:!!t&&!!i}),Qge=t=>l1(pDe,()=>Wa(xDe,{method:"GET",token:t}),{enabled:!!t}),kge=(t,i)=>l1([hDe,{id:i}],()=>Wa(`${ODe}?metricId=${i}`,{method:"GET",token:t}),{enabled:!!t}),Uge=({externalDashboardId:t,clientId:i})=>{const e=qx(),{data:n,isLoading:r}=Cge(t,i),[M,a]=De.useMemo(()=>{const N=n;return[(N==null?void 0:N.layout)||[],!!(N!=null&&N.isLocked)]},[n]),{mutateAsync:u,isLoading:o}=Mge();return{saveLayout:De.useCallback(async(N,D)=>{await u({clientId:i,externalDashboardId:t,layout:N,isLocked:!!D},{onSuccess:g=>{if(!g)return;const l=g;e.setQueryData([$6,{dashboardId:t,clientId:i}],j=>({...j,...l}))}})},[u,i,t]),layout:M,isLayoutLocked:a,isLoadingLayout:r||o}},mge=(t,i)=>{let e=t.replace(/;([^;]*)$/,"");const n=parseInt(i,10);if(e.toLowerCase().includes("limit")){const r=parseInt(e.toLowerCase().split("limit")[1].trim(),10),M=Math.min(r,n);e=e.replace(`limit ${r}`,`limit ${M}`),e=e.replace(`LIMIT ${r}`,`LIMIT ${M}`)}else e+=` limit ${n}`;return e},Yge=({limit:t,query:i,clientName:e,tenancyType:n,values:r})=>{const M=mge(i,t),a=e?n===lse?M.replace(new RegExp(G7,"g"),e):Number(e)?M.replace(new RegExp(vx,"g"),e):M.replace(new RegExp(H7,"g"),e):M;return r?a.replace(/[^']+_variable/g,o=>`${r[o]}`):a},bge=({clientName:t,tenancyType:i,values:e,query:n,companyId:r,workspaceId:M,metricId:a})=>{const{mutate:u}=jge();return{getUnderlyingData:({columnName:s,value:N,setData:D,setLoading:g,isSingleValueChart:l})=>{const j=Yge({query:n,limit:"5000",clientName:t,tenancyType:i,values:e});D([]),g(!0),u({columnName:l?void 0:s,companyId:r,query:j,value:l||N==null?void 0:N.replace(/'/g,"''"),workspaceId:M,metricId:a},{onSuccess(T){const y=T==null?void 0:T.data;y&&Array.isArray(y)&&y.length?(D(y),g(!1)):(D([]),g(!1))},onError(){D([]),g(!1)}})}}},_ge=({range:t,count:i,time:e,from:n,to:r})=>{const M=new Date;new Date(M).setDate(M.getDate()-1);const u=M.getMonth(),o=M.getFullYear();let s,N;if(t==="This"){switch(e){case"Year":s=new Date(o,0,1),N=new Date(M);break;case"Month":s=new Date(o,u,1),N=new Date(M);break;case"Week":{const D=M.getDate()-M.getDay();s=new Date(M.setDate(D)),N=new Date(M.setDate(D+6));break}case"Day":s=new Date(M),N=new Date(M);break;default:s=new Date(0),N=new Date(M)}return{startDate:s,endDate:N}}if(t==="Last"){switch(e){case"Year":{let D,g;i===1?(D=i,g=o-1):(D=i-1,g=o),s=new Date(o-D,0,1),N=new Date(g,11,31);break}case"Month":{const D=i===1?u-1:u-i+1;s=new Date(o,D,1),N=new Date(o,u,i===1?0:31);break}case"Week":{const D=new Date(M.setDate(M.getDate()-(M.getDay()+1)%7)),g=new Date(D.getFullYear(),D.getMonth(),D.getDate()-6),l=i-1;s=new Date(g.setDate(g.getDate()-7*l)),N=new Date(D.setDate(D.getDate()-7*(l-1))),l===0&&(N=new Date(M));break}case"Day":s=new Date(M),s.setDate(M.getDate()-i),N=new Date(M);break;default:s=new Date(0),N=new Date(M)}return{startDate:s,endDate:N}}return{startDate:n||new Date(0),endDate:r||new Date(M)}},Rge=({data:t,format:i,measureColumn:e,timeColumn:n,dimensionColumn:r,startDate:M})=>t.reduce((u,o)=>{const s=Number(o[e]),N=new Date(o[n]);let D;switch(i){case"Week":{D=`Week ${Math.ceil((N.getDate()+M.getDay())/7)}`;break}case"Quarter":{const l=Math.ceil((N.getMonth()+1)/3),j=N.getFullYear();D=`Q${l} ${j}`;break}case"Month":{D=`${N.toLocaleString("default",{month:"long"})} ${N.getFullYear()}`;break}case"Day":{D=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][N.getDay()];break}default:D=o[n]}const g=u.find(l=>l[r]===D);return g?g[e]+=s:u.push({[r]:D,[e]:s}),u},[]),Pge=({dimensionColumn:t,endDate:i,measureColumn:e,format:n,groupedDataList:r,time:M,count:a,range:u})=>{const o=new Date().getFullYear(),s=o-1;let N=[],D=[];if(a===1&&u==="This"&&(N=Array.from({length:12},(T,y)=>({[t]:`${new Date(2e3,y,1).toLocaleString("default",{month:"long"})} ${o}`,[e]:0})),D=[{[t]:`Q1 ${o}`,[e]:0},{[t]:`Q2 ${o}`,[e]:0},{[t]:`Q3 ${o}`,[e]:0},{[t]:`Q4 ${o}`,[e]:0}]),a===1&&u==="Last"&&(N=Array.from({length:12},(T,y)=>({[t]:`${new Date(2e3,y,1).toLocaleString("default",{month:"long"})} ${s}`,[e]:0})),D=[{[t]:`Q1 ${s}`,[e]:0},{[t]:`Q2 ${s}`,[e]:0},{[t]:`Q3 ${s}`,[e]:0},{[t]:`Q4 ${s}`,[e]:0}]),a>1&&u==="Last"){for(let T=o-a+1;T<=o;T++)for(let y=0;y<12;y++)N.push({[t]:`${new Date(T,y,1).toLocaleString("default",{month:"long"})} ${new Date(T,y,1).getFullYear()}`,[e]:0});for(let T=o-a;T<=o;T++)D.push({[t]:`Q1 ${T}`,[e]:0},{[t]:`Q2 ${T}`,[e]:0},{[t]:`Q3 ${T}`,[e]:0},{[t]:`Q4 ${T}`,[e]:0})}const g=Array.from({length:4},(T,y)=>({[t]:`Week ${y+1}`,[e]:0})),l=[{[t]:"Sunday",[e]:0},{[t]:"Monday",[e]:0},{[t]:"Tuesday",[e]:0},{[t]:"Wednesday",[e]:0},{[t]:"Thursday",[e]:0},{[t]:"Friday",[e]:0},{[t]:"Saturday",[e]:0}];let j=[];switch(`${u}${a>1?` ${a} `:" "}${M} By ${n}`){case"This Year By Month":case"Last Year By Month":case`Last ${a} Year By Month`:{j=N.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Year By Quarter":case"Last Year By Quarter":case`Last ${a} Year By Quarter`:{j=D.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Month By Week":case"Last Month By Week":{j=g.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Week By Day":case"Last Week By Day":{j=l.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Quarter By Month":{const y=(Math.ceil((i.getMonth()+1)/3)-1)*3,z=y+2;j=N.slice(y,z+1).map(h=>{const x=r.find(O=>O[t]===h[t]);return x||h});break}case"Last Quarter By Month":{const T=Math.ceil((i.getMonth()+1)/3),z=((T===1?4:T-1)-1)*3,A=z+2;j=N.slice(z,A+1).map(x=>{const O=r.find(d=>d[t]===x[t]);return O||x});break}case`Last ${a} Month By Month`:{j=Array.from({length:a},(T,y)=>{const z=new Date(i.getFullYear(),i.getMonth()-y,1);return{[t]:`${z.toLocaleString("default",{month:"long"})} ${z.getFullYear()}`,[e]:0}}).reverse().map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}default:j=r}return j},Vge=({data:t,dimensionColumn:i,measureColumn:e,timeColumn:n,option:r})=>{const{endDate:M,startDate:a}=_ge({range:r.range,count:r.count,from:r.startDate,to:r.endDate,time:r.time});if(r.time==="Week"&&r.count>1)return t.map(N=>({[i]:N[i],[e]:N[e]}));const u=Rge({data:t,dimensionColumn:i,format:r.format,measureColumn:e,startDate:a,timeColumn:n}),o=Object.values(u);return r.name==="Custom"?o:Pge({dimensionColumn:i,endDate:M,format:r.format,groupedDataList:o,measureColumn:e,time:r.time,count:r.count,range:r.range})},Fge=t=>l1([HDe,t],()=>Wa(BDe,{method:"POST",data:t}),{enabled:!!t.id}),$ge=t=>l1([ZDe,t],()=>Wa(`${GDe}?id=${t}`,{method:"GET"}),{enabled:!!t}),K6=t=>t instanceof Date&&!Number.isNaN(t.getTime()),q6=({isTimeColumn:t,timeColumnName:i,timeCount:e,timeGrain:n,timeRangeIndicator:r,databaseType:M,endDate:a=new Date,startDate:u=new Date,comparsionOperator:o})=>{const s=M==null?void 0:M.toLowerCase();let N="";switch(r){case"last":e===1?n==="day"?s==="bigquery"?N=`EXTRACT(DAYOFYEAR FROM ${i}) = EXTRACT(DAYOFYEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`DAYOFYEAR(${i}) = DAYOFYEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('doy' FROM ${i}) = EXTRACT('doy' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="year"?s==="bigquery"?N=`EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e}`:N=`EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:n==="quarter"?s==="bigquery"?N=`EXTRACT(QUARTER FROM ${i}) = EXTRACT(QUARTER FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`QUARTER(${i}) = QUARTER(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('quarter' FROM ${i}) = EXTRACT('quarter' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="week"?s==="bigquery"?N=`EXTRACT(WEEK FROM ${i}) = EXTRACT(WEEK FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`WEEK(${i}) = WEEK(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('week' FROM ${i}) = EXTRACT('week' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="month"&&(s==="bigquery"?N=`EXTRACT(MONTH FROM ${i}) = EXTRACT(MONTH FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`MONTH(${i}) = MONTH(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('month' FROM ${i}) = EXTRACT('month' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`):n==="day"?s==="bigquery"?N=`EXTRACT(DAYOFYEAR FROM ${i}) >= EXTRACT(DAYOFYEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`DAYOFYEAR(${i}) >= DAYOFYEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('doy' FROM ${i}) >= EXTRACT('doy' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="year"?s==="bigquery"?N=`EXTRACT(YEAR FROM ${i}) >= EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`YEAR(${i}) >= YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e}`:N=`EXTRACT('year' FROM ${i}) >= EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:n==="quarter"?s==="bigquery"?N=`EXTRACT(QUARTER FROM ${i}) >= EXTRACT(QUARTER FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`QUARTER(${i}) >= QUARTER(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('quarter' FROM ${i}) >= EXTRACT('quarter' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="week"?s==="bigquery"?N=`EXTRACT(WEEK FROM ${i}) >= EXTRACT(WEEK FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`WEEK(${i}) >= WEEK(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('week' FROM ${i}) >= EXTRACT('week' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="month"&&(s==="bigquery"?N=`EXTRACT(MONTH FROM ${i}) >= EXTRACT(MONTH FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`MONTH(${i}) >= MONTH(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('month' FROM ${i}) >= EXTRACT('month' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`);break;case"this":n==="day"?s==="bigquery"?N=`EXTRACT(DAYOFYEAR FROM ${i}) = EXTRACT(DAYOFYEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`DAYOFYEAR(${i}) = DAYOFYEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('doy' FROM ${i}) = EXTRACT('doy' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="year"?s==="bigquery"?N=`EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="quarter"?s==="bigquery"?N=`EXTRACT(QUARTER FROM ${i}) = EXTRACT(QUARTER FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`QUARTER(${i}) = QUARTER(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('quarter' FROM ${i}) = EXTRACT('quarter' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="week"?s==="bigquery"?N=`EXTRACT(WEEK FROM ${i}) = EXTRACT(WEEK FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`WEEK(${i}) = WEEK(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('week' FROM ${i}) = EXTRACT('week' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="month"&&(s==="bigquery"?N=`EXTRACT(MONTH FROM ${i}) = EXTRACT(MONTH FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`MONTH(${i}) = MONTH(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('month' FROM ${i}) = EXTRACT('month' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`);break;case"custom date":{const g=new Date(u).toISOString().slice(0,10);N=`${i} ${o||"="} '${g}'`;break}default:{const D=new Date(u),g=new Date(a);if(K6(D)&&K6(g)){const l=D.toISOString().slice(0,10),j=g.toISOString().slice(0,10);N=`${i} BETWEEN '${l}' AND '${j}'`}else{const l=new Date().toISOString().slice(0,10),j=new Date().toISOString().slice(0,10);N=`${i} BETWEEN '${l}' AND '${j}'`}break}}return N},Wge=(t,i)=>t.reduce((e,n)=>{const r=n[i];return r&&(e[r]||(e[r]=[]),e[r].push(n)),e},{}),Bge=({query:t,rlsConditions:i,tenancyLevel:e,clientId:n,values:r,isAllClient:M})=>{let a=n?e==="DATABASE"?t.replace(new RegExp(G7,"g"),n):Number(n)?M?t.replace(new RegExp(`=\\s*['"]?${vx}['"]?`,"g"),"IS NOT NULL"):t.replace(new RegExp(vx,"g"),n):M?t.replace(new RegExp(`=\\s*['"]?${vx}['"]?`,"g"),"IS NOT NULL"):t.replace(new RegExp(H7,"g"),n):t;return i.filter(o=>o.isAddOnMetrics&&o.isVariableFilter).forEach(o=>{var s,N,D,g,l,j,T,y,z;if(["string","boolean","default","number"].includes(o.datatype)){const A=o.datatype==="number"?Number((s=o.selectedVariableValue)==null?void 0:s.value)||0:`'${(N=o.selectedVariableValue)==null?void 0:N.value}'`;a=(D=o.variableStrings)!=null&&D[0]?a.replace(new RegExp(o.variableStrings[0],"g"),A):a}else{const A=(g=o.selectedVariableValue)!=null&&g.startDate?new Date((l=o.selectedVariableValue)==null?void 0:l.startDate):new Date(new Date().setFullYear(1,0,1)),h=(j=o.selectedVariableValue)!=null&&j.endDate?new Date((T=o.selectedVariableValue)==null?void 0:T.endDate):new Date,x=`'${A==null?void 0:A.toISOString().slice(0,10)}'`;a=(y=o.variableStrings)!=null&&y[0]?a.replace(new RegExp(o.variableStrings[0],"g"),x):a;const O=`'${h==null?void 0:h.toISOString().slice(0,10)}'`;a=(z=o.variableStrings)!=null&&z[1]?a.replace(new RegExp(o.variableStrings[1],"g"),O):a}}),r&&(a=a.replace(/[^']+_variable/g,o=>`${r[o]}`)),a},Hge=(t,i)=>{switch(i.toLowerCase()){case"postgres":case"redshift":case"snowflake":return`"${t}"`;case"bigquery":case"mysql":case"mongodb":case"databricks":case"clickhouse":return`\`${t}\``;default:return`${t.replace(" ","_")}`}},rp=(t,i,e)=>{const n=e.toLowerCase(),r=i==="number",M=i==="string",a=i==="date";let u="";r?u=n==="mongodb"||n==="mysql"?"AS SIGNED":"AS BIGINT":M?n==="postgres"||n==="redshift"||n==="snowflake"?u="AS VARCHAR":n==="mongodb"||n==="mysql"?u="AS CHAR":u="AS STRING":a&&(u="AS DATE");let o="";return n==="mongodb"?o=`\`${t}\``:n==="bigquery"||n==="mysql"||n==="databricks"?o=`${t}`:o=`"${t}"`,u?`CAST(${o} ${u})`:o},eP=(t,i,e)=>{let n=i;const r=t.tableName.split(/\.(?=[^.]*$)/).map(o=>`${Hge(o,e)}`).join("."),M=t.tableName,a=n.includes(r),u=n.includes(M);if(a||u){const o=a?new RegExp(`${r}\\s*WHERE`,"gi"):new RegExp(`${M}\\s*WHERE`,"gi"),s=`\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*WHERE`,N=a?new RegExp(`${r}${s}`,"gi"):new RegExp(`${M}${s}`,"gi"),D=a?new RegExp(`FROM\\s*${r}\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*`,"gi"):new RegExp(`FROM\\s*${M}\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*`,"gi"),g=o.test(n),l=N.test(n),j=D.test(n);if(g||l)n=n.replace(l?N:o,T=>`${T} ${t.condition} AND `);else{const T=j?D:u?M:r;n=n.replace(T,y=>`${y} WHERE ${t.condition}`)}}return n},Gge=(t,i,e)=>{let n=t;return Object.keys(i).map(M=>{const a=i[M].map(u=>{var o,s,N,D,g,l,j,T;return u.datatype==="date"?`${q6({isTimeColumn:!!u.datatype,timeColumnName:rp(u.columnName,void 0,e),timeCount:((o=u.options.find(y=>y.name===u.value))==null?void 0:o.count)||1,timeGrain:((N=(s=u.options.find(y=>y.name===u.value))==null?void 0:s.time)==null?void 0:N.toLowerCase())||"year",timeRangeIndicator:((g=(D=u.options.find(y=>y.name===u.value))==null?void 0:D.range)==null?void 0:g.toLowerCase())||"last",databaseType:e==null?void 0:e.toLowerCase(),endDate:(l=u.options.find(y=>y.name===u.value))==null?void 0:l.endDate,startDate:(j=u.options.find(y=>y.name===u.value))==null?void 0:j.startDate,comparsionOperator:(T=u.comparisonOperator)==null?void 0:T.value})} ${u.applyOnColumns?`${u.applyOnColumns.map(y=>{var z,A,h,x,O,d,E;return`${y.logicalOperator.value||"AND"} ${q6({isTimeColumn:!!u.datatype,timeColumnName:rp(y.columnName.value,void 0,e),timeCount:((z=u.options.find(C=>C.name===u.value))==null?void 0:z.count)||1,timeGrain:((h=(A=u.options.find(C=>C.name===u.value))==null?void 0:A.time)==null?void 0:h.toLowerCase())||"year",timeRangeIndicator:((O=(x=u.options.find(C=>C.name===u.value))==null?void 0:x.range)==null?void 0:O.toLowerCase())||"last",databaseType:e==null?void 0:e.toLowerCase(),endDate:(d=u.options.find(C=>C.name===u.value))==null?void 0:d.endDate,startDate:(E=u.options.find(C=>C.name===u.value))==null?void 0:E.startDate,comparsionOperator:y.comparisonOperator.value})}`}).join(" ")}`:""}`:`${rp(u.columnName,u.datatype,e)} ${Array.isArray(u.value)?"IN":"="} ${Array.isArray(u.value)?`(${u.value.map(y=>typeof y=="string"?`'${y}'`:y).join(", ")})`:typeof u.value=="string"?`'${u.value}'`:u.value}`});return{tableName:M,condition:a.join(" AND ")}}).forEach(M=>{n=eP(M,n,e)}),n},Zge=({rlsConditions:t,dbName:i,query:e})=>{const n=Wge(t.filter(M=>M.isAddOnMetrics),"tableName");return Gge(e,n,i)},yd=({query:t,clientId:i="",rlsConditions:e,globalFilters:n={filters:[],tableName:""},dbName:r,tenancyLevel:M,values:a,isAllClient:u})=>{var j;const o=Bge({isAllClient:u,query:t,rlsConditions:e,tenancyLevel:M,clientId:i,values:a}),s=e.filter(T=>T.isAddOnMetrics&&!T.isVariableFilter);if(((j=n==null?void 0:n.filters)==null?void 0:j.length)===0&&s.length===0)return o;const N=Zge({rlsConditions:s,dbName:r,query:o}),{filters:D,tableName:g}=n;if(!g||D.length===0)return N;const l=D.map(({column:T,operator:y,value:z,as:A})=>A==="date"&&typeof z=="string"?`${z}`:`${rp(T,A,r)} ${y} ${Array.isArray(z)?`(${z.map(h=>`${h}`).join(", ")})`:A==="date"?`'${z!=null&&z.startDate?new Date(z.startDate).toISOString().slice(0,10):new Date().toISOString().slice(0,10)}' AND '${z!=null&&z.endDate?new Date(z.endDate).toISOString().slice(0,10):new Date().toISOString().slice(0,10)}'`:`${z}`}`).join(" AND ");return eP({tableName:g,condition:l},N,r)},Jge=t=>{const e=t.slice(0,100).flatMap(a=>Object.entries(a)),n={};e.forEach(([a,u])=>{n[a]?n[a][Number(u)||Number(u)===0?"number":"other"]=(n[a][Number(u)||Number(u)===0?"number":"other"]||0)+1:n[a]={[Number(u)||Number(u)===0?"number":"other"]:1}});const r=[],M=[];return Object.entries(n).forEach(([a,u])=>{Object.entries(u).reduce((s,N)=>s[1]>N[1]?s:N)[0]==="number"?r.push(a):M.push(a)}),{numberKeys:r,otherKeys:M}},Xge=t=>{const{numberKeys:i,otherKeys:e}=Jge(t),n=i.length+e.length;if(n===1&&i.length)return[Se.singleValue,Se.table,Se.gauge];if(i.length===0)return[Se.table,Se.singleValue];if(i.length>=1){const r=Object.values(Se);return n<3?r.filter(M=>M!==Se.sankey):r}return[]},Kge=(t,i)=>{var r,M,a,u;const e=(M=(r=i==null?void 0:i[t.name])==null?void 0:r.defaultOption)==null?void 0:M.toString(),n=((u=(a=i==null?void 0:i[t.name])==null?void 0:a.options)==null?void 0:u.filter(o=>{if(o==null)return!1;switch(t.datatype){case"string":{if(typeof o!="string"||!o)return!1;break}case"number":{if(typeof o!="number"||!Number(o))return!1;break}case"date":{if(typeof o!="object"||!o.name||!["Last","This","Custom"].includes(o.range)||o.range!=="Custom"&&!o.time&&!["Day","Week","Month","Quarter","Year"].includes(o.time))return!1;break}}return!0}))||[];return e&&n.length?{value:e,options:n}:void 0},cy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qge=({dataArray:t,timeStampKey:i,type:e,valuekeys:n,groupBy:r,labelSettings:M,customSettings:a,backGroundColor:u,fillXAxis:o,isCumulativeBar:s})=>{const N=n.map(j=>t.sort((y,z)=>new Date(y[i]).getTime()-new Date(z[i]).getTime()).reduce((y,z)=>{const h={yearly:O=>O.getFullYear(),monthly:O=>{const d=O.getMonth(),E=O.getFullYear();return`${cy[d]} - ${E}`},weekly:O=>{const d=new Date(O.getTime());return d.setDate(O.getDate()-O.getDay()),d.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:O=>`${O.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:O=>{const d=O.getMonth(),E=Math.floor(d/3)+1,C=O.getFullYear();return`Q${E} ${C}`}}[r],x=h(new Date(z[i]));return y[x]||(y[x]=0),y[x]+=Number(z[j])||0,y},{})),D=[];if(o){if(r===Ns.month){const j=Array.from(new Set(Object.keys(N[0]).map(z=>z.split(" - ")[1]))).sort(),T=cy.findIndex(z=>N[0][`${z} - ${j[0]}`]!==void 0)+1,y=cy.findIndex(z=>N[0][`${z} - ${j[j.length-1]}`]!==void 0)+1;j.length>1?N.forEach(z=>{const A={};j.forEach(h=>{cy.forEach((x,O)=>{const d=`${x} - ${h}`;cy.includes(x)&&z[d]===void 0?h===j[0]&&O>=T||h===j[j.length-1]&&O<y?A[d]=0:h!==j[0]&&h!==j[j.length-1]&&(A[d]=z[d]||0):A[d]=z[d]||0})}),D.push(A)}):N.forEach(z=>{const A={};cy.forEach((h,x)=>{const O=`${h} - ${j[0]}`;cy.includes(h)&&z[O]===void 0?x>=T&&x<y&&(A[O]=0):A[O]=z[O]||0}),D.push(A)})}else if(r===Ns.quarter){const j=Array.from(new Set(Object.keys(N[0]).map(y=>y.split(" ")[0]))),T=Array.from(new Set(Object.keys(N[0]).map(y=>y.split(" ")[1]))).sort();N.forEach(y=>{const z={};T.forEach(A=>{j.forEach(h=>{const x=`${h} ${A}`;z[x]=y[x]||0})}),D.push(z)})}}const g=j=>{let T=0;return j.map(z=>(T+=z[1],[z[0],T]))};return o&&[Ns.month,Ns.quarter].includes(r)?D.map((j,T)=>({data:s&&e==="bar"?g(Object.entries(j)):Object.entries(j).sort((y,z)=>{const A=new Date(y[0]),h=new Date(z[0]);return A.getFullYear()-h.getFullYear()}),type:e==="area"?"line":e==="stack"?"bar":e,name:n[T],label:{show:M.show,position:M.position},emphasis:{focus:"series"},...e==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...e==="bar"?{barWidth:`${(a==null?void 0:a.barWidth)||0}%`,showBackground:u==null?void 0:u.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:a==null?void 0:a.barRadius}}:{},...e==="stack"?{stack:"total"}:{}})):N.map((j,T)=>({data:s&&e==="bar"?g(Object.entries(j)):Object.entries(j),type:e==="area"?"line":e==="stack"?"bar":e,name:n[T],label:{show:M.show,position:M.position},emphasis:{focus:"series"},...e==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...e==="bar"?{barWidth:`${(a==null?void 0:a.barWidth)||0}%`,showBackground:u==null?void 0:u.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:a==null?void 0:a.barRadius}}:{},...e==="stack"?{stack:"total"}:{}}))},tP=({data:t,timeStampKey:i})=>!Array.isArray(t)||t.length<1?!1:t.every(e=>{const n=new Date(e[i]);return!Number.isNaN(n.getTime())}),ele=t=>{const i=t.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&i.right<=(window.innerWidth||document.documentElement.clientWidth)},dw=(t,i)=>(t==null?void 0:t.length)!==(i==null?void 0:i.length)?!1:t==null?void 0:t.every(e=>i==null?void 0:i.includes(e)),dl=t=>{const i=new Date(t);return i instanceof Date&&!Number.isNaN(i.getTime())?i:null},iP=({metric:t,globalFilters:i={tableName:"",filters:[]},rlsFilters:e,clientId:n,tenancyLevel:r,isInternalApp:M,appFilters:a,setCrossDashboardFilters:u,crossDashboardFilters:o,metricFilterOptions:s,isAllClient:N})=>{var Dt,ve,pt,Ct,dt,Zt,$t,Mt,It;const D=De.useRef(null),[g,l]=De.useState({limit:10,offset:0}),[j,T]=De.useState(0),[y,z]=De.useState((t==null?void 0:t.rlsConditions)||[]),[A,h]=De.useState(!1),[x,O]=De.useState(),[d,E]=De.useState([]),[C,k]=De.useState(!0),[Q,S]=De.useState([]),[b,Y]=De.useState([]),[m,R]=De.useState(!1),[P,W]=De.useState([]),[B,X]=De.useState(null),[F,G]=De.useState(t.chartOptions),J=De.useMemo(()=>{const We={};if(e!=null&&e.values)for(const Tt in e.values){const He=`${Tt}_variable`;We[He]=e.values[Tt]}return We},[e==null?void 0:e.values]),{data:ee,isLoading:q}=Fge({isAllClient:N,id:t.id,drillFilters:(Dt=t==null?void 0:t.drillDownSettings)!=null&&Dt.isEnableGroupBy?Q:[],clientId:n,tenancyLevel:r,rlsConditions:P,globalFilters:i,filterValues:J,limit:(ve=F==null?void 0:F.tableSettings)!=null&&ve.isServerSidePagination&&(F==null?void 0:F.chartType)===Se.table?Math.min(g.limit,1e3):void 0,offset:(pt=F==null?void 0:F.tableSettings)!=null&&pt.isServerSidePagination&&(F==null?void 0:F.chartType)===Se.table?g.offset:void 0});De.useEffect(()=>{var We;z(((We=t==null?void 0:t.rlsConditions)==null?void 0:We.map(Tt=>{var jt,lt,kt,ii;let He=Tt;if(s){const gi=Kge(He,s);gi&&(He={...He,value:gi.value?He.datatype==="string"?[gi.value]:gi.value:He.value,options:He.datatype==="date"?gi.options.map(ht=>({...ht,startDate:dl(ht.fromDate)??ht.startDate,endDate:dl(ht.toDate)??ht.endDate,minDate:dl(ht.minDate)??void 0,maxDate:dl(ht.maxDate)??void 0,fromDate:dl(ht.fromDate)??void 0,toDate:dl(ht.toDate)??void 0})):gi.options,variableOptions:He.datatype==="date"?gi.options.map(ht=>({startDate:dl(ht.fromDate)??ht.startDate,endDate:dl(ht.toDate)??ht.endDate,value:ht.name,label:ht.name})):gi.options.map(ht=>({value:ht,label:ht})),selectedVariableValue:gi.value?He.datatype==="string"?{value:gi.value,label:gi.value}:{startDate:dl((lt=(jt=gi.options)==null?void 0:jt.find(ht=>ht.name===gi.value))==null?void 0:lt.fromDate),endDate:dl((ii=(kt=gi.options)==null?void 0:kt.find(ht=>ht.name===gi.value))==null?void 0:ii.toDate),value:gi.value,label:gi.value}:He.selectedVariableValue})}return r==="DATABASE"?{...He,tableName:`${n}.${Tt.tableName.split(".").slice(1).join(".")}`}:He}))||[])},[t==null?void 0:t.rlsConditions,s,r]);const ie=De.useMemo(()=>{var We,Tt;return!!y.length&&((Tt=(We=y.find(He=>He.isAddOnMetrics&&He.datatype==="date"&&He.columnName===F.xAxis))==null?void 0:We.options)==null?void 0:Tt.every(He=>He.format))},[y,F]),re=We=>We.includes("____")?We.split("____")[1]:We.includes("^^^^^^")?We.split("^^^^^^")[1]:We,le=De.useMemo(()=>{var We,Tt,He,jt;return re(((jt=(We=t==null?void 0:t.datasetMetricSettings)==null?void 0:We.selectedDimensions)==null?void 0:jt[Q.length<((He=(Tt=t==null?void 0:t.datasetMetricSettings)==null?void 0:Tt.selectedDimensions)==null?void 0:He.length)?Q.length:0])||"")},[t==null?void 0:t.datasetMetricSettings,Q]);De.useEffect(()=>{var He,jt;const Tt=((He=t==null?void 0:t.drillDownSettings)==null?void 0:He.isEnableGroupBy)?y||[]:y!=null&&y.length?[...y,...o||[]]:[...o||[]];(jt=Tt==null?void 0:Tt.filter(lt=>lt.isAddOnMetrics))!=null&&jt.length?W(Tt.filter(lt=>lt.isAddOnMetrics).map(lt=>{var kt,ii,gi,ht,Et,ai;return M?{...lt,dimensionColumn:F.xAxis||"",measureColumn:((kt=F.yAxisList)==null?void 0:kt[0])||""}:{...lt,dimensionColumn:F.xAxis||"",measureColumn:((ii=F.yAxisList)==null?void 0:ii[0])||"",value:lt.isAppFilter?lt.datatype==="date"?(gi=lt==null?void 0:lt.options)==null?void 0:gi.find(Dn=>{var Tr;return Dn.name===((Tr=a==null?void 0:a.values)==null?void 0:Tr[lt.name])}):lt.datatype==="string"&&typeof((ht=a==null?void 0:a.values)==null?void 0:ht[lt.name])=="string"?[(Et=a==null?void 0:a.values)==null?void 0:Et[lt.name]]:(ai=a==null?void 0:a.values)==null?void 0:ai[lt.name]:lt.value}})):W([])},[y,a,o,(Ct=t==null?void 0:t.drillDownSettings)==null?void 0:Ct.isEnableGroupBy,r,M,n]);const Ne=De.useMemo(()=>{var We,Tt,He,jt,lt;return(F==null?void 0:F.chartType)===Se.singleValue&&!!((We=F==null?void 0:F.customSettings)!=null&&We.comparisonValueShow)&&!!((Tt=F==null?void 0:F.customSettings)!=null&&Tt.comparisonTimeColumn)&&!!((He=F==null?void 0:F.customSettings)!=null&&He.comparisonTimeGrain)&&!!((jt=F==null?void 0:F.customSettings)!=null&&jt.comparisonTimePeriod)&&!!((lt=F==null?void 0:F.customSettings)!=null&<.comparisonTableName)&&!!(F!=null&&F.singleValue)},[F]);De.useEffect(()=>{var jt;const We=ee,Tt=We!=null&&We.data&&typeof We.data=="string"?JSON.parse(We.data):[];if((F==null?void 0:F.chartType)===Se.table&&T((We==null?void 0:We.totalRecords)||0),ie){const lt=y.find(kt=>kt.isAddOnMetrics&&kt.datatype==="date");if(lt){const kt=Vge({data:Tt||[],dimensionColumn:lt.columnName,measureColumn:((jt=F.yAxisList)==null?void 0:jt[0])||"",option:lt.options.find(ii=>ii.name===lt.value),timeColumn:F.xAxis||lt.columnName});E(kt)}else E(Tt??[])}else E(Tt??[]);const He=We==null?void 0:We.metaData;Y((He==null?void 0:He.groupbyColumnList)||[])},[ee,ie,Ne]),De.useEffect(()=>{var We,Tt,He,jt,lt,kt,ii,gi;if((We=t==null?void 0:t.drillDownSettings)!=null&&We.isEnableGroupBy&&d.length){const ht=(jt=(He=(Tt=t==null?void 0:t.drillDownSettings)==null?void 0:Tt.drilldownChartSettings)==null?void 0:He.find(Et=>Et.name===le))==null?void 0:jt.chartSettings;ht&&((kt=(lt=t==null?void 0:t.datasetMetricSettings)==null?void 0:lt.selectedDimensions)!=null&&kt.length)&&((gi=(ii=t==null?void 0:t.datasetMetricSettings)==null?void 0:ii.selectedDimensions)==null?void 0:gi.length)>(Q==null?void 0:Q.length)?G(ht):G(Et=>{var ai,Dn,Tr,eM;return{...Et,xAxis:le,yAxisList:F.chartType==="table"?[le,...((Dn=(ai=t==null?void 0:t.datasetMetricSettings)==null?void 0:ai.metrics)==null?void 0:Dn.map(dr=>{var Or;return(Or=dr==null?void 0:dr.as)==null?void 0:Or.replace(/["`]+/g,"")}))||[]]:(eM=(Tr=t==null?void 0:t.datasetMetricSettings)==null?void 0:Tr.metrics)==null?void 0:eM.map(dr=>{var Or;return(Or=dr==null?void 0:dr.as)==null?void 0:Or.replace(/["`]+/g,"")})}})}},[d,t.drillDownSettings,t==null?void 0:t.datasetMetricSettings,Q]),De.useEffect(()=>{q&&k(!0),!d.length&&!q&&setTimeout(()=>{k(!1)},5e3)},[q,d]);const se=De.useCallback((We,Tt,He,jt)=>{z(He?lt=>lt.map(kt=>{var ii;return kt.name===We?{...kt,value:Tt,options:kt.options.map(gi=>Tt===gi.name?{...gi,...He}:gi),variableOptions:(ii=kt.variableOptions)==null?void 0:ii.map(gi=>gi.value===Tt?{...gi,...He}:gi),selectedVariableValue:{value:Tt,label:Tt,endDate:He.endDate,startDate:He.startDate}}:kt}):jt?lt=>lt.map(kt=>kt.name===We?{...kt,value:jt.map(ii=>ii.value)}:kt):lt=>lt.map(kt=>kt.name===We?{...kt,value:Tt,selectedVariableValue:{value:Tt,label:Tt}}:kt))},[]),Ie=De.useCallback(We=>{ie||(We.event&&We.event.event.preventDefault(),O(We))},[y]),{getUnderlyingData:Oe}=bge({clientName:n,tenancyType:r,values:J,companyId:t==null?void 0:t.companyId,query:t==null?void 0:t.query,workspaceId:(dt=t==null?void 0:t.companyIntegration)==null?void 0:dt.workspaceId,metricId:t==null?void 0:t.id}),ye=De.useMemo(()=>Array.isArray(d)&&d.length&&(x!=null&&x.name)?d.map(We=>{const Tt=Object.entries(We).find(([,He])=>He===x.name);return Tt==null?void 0:Tt[0]}).filter(We=>We)[0]:"",[d,x==null?void 0:x.name]),$e=De.useCallback((We,Tt)=>{var kt,ii,gi,ht,Et,ai,Dn,Tr,eM;const He=re(((ii=(kt=t==null?void 0:t.datasetMetricSettings)==null?void 0:kt.selectedDimensions)==null?void 0:ii[Q==null?void 0:Q.length])||""),jt=(Et=(ht=(gi=t==null?void 0:t.datasetMetricSettings)==null?void 0:gi.configuration)==null?void 0:ht.dimensions)==null?void 0:Et.find(dr=>dr.alias===He),lt=(ai=jt==null?void 0:jt.parentAlias)==null?void 0:ai.replace("_",".",1);if(He||((Dn=t==null?void 0:t.drillDownSettings)==null?void 0:Dn.drillType)==="table"){const dr=((Tr=t==null?void 0:t.datasetMetricSettings)==null?void 0:Tr.selectedDimensions.length)>Q.length;S(Or=>{var ha;return((ha=t==null?void 0:t.drillDownSettings)==null?void 0:ha.drillType)==="table"?Tt||[]:dr?[...Or,{columnName:He,value:We==null?void 0:We.name}]:[]}),(eM=t==null?void 0:t.drillDownSettings)!=null&&eM.isEnableCrossFilter&&(u==null||u(Or=>dr?[...Or,{columnName:jt==null?void 0:jt.columnName,datatype:"string",isAddOnMetrics:!0,name:"cross-filter",options:[We==null?void 0:We.name],tableName:r==="DATABASE"?`${n}.${lt==null?void 0:lt.split(".").slice(1).join(".")}`:lt,value:[We==null?void 0:We.name]}]:[]))}else u==null||u([]),S([])},[d,t==null?void 0:t.datasetMetricSettings,t==null?void 0:t.drillDownSettings]),Ve=De.useCallback(We=>{var Tt;if(We>0&&Q.length){const He=Q.slice(0,-1);S(He),(Tt=t==null?void 0:t.drillDownSettings)!=null&&Tt.isEnableCrossFilter&&(u==null||u(jt=>jt.slice(0,-1)))}else u==null||u([]),S([])},[Q]);De.useEffect(()=>{d!=null&&d.length&&b.length?R(!0):R(!1)},[d,b.length,t==null?void 0:t.integrationName,t.query]);const{metricFilters:Ee,leftPositionedMetricFilters:Te,rightPositionedMetricFilters:fe}=De.useMemo(()=>{const We=y.filter(lt=>!lt.isAppFilter),Tt=We.filter(lt=>lt.isAddOnMetrics),He=[],jt=[];return Tt.forEach(lt=>{lt.position==="top-right"?jt.push(lt):He.push(lt)}),{metricFilters:We,leftPositionedMetricFilters:He,rightPositionedMetricFilters:jt}},[y]),Qe=De.useMemo(()=>{var Tt;const We=((Tt=t==null?void 0:t.dataSecuritySettings)==null?void 0:Tt.csvColumns)||[];return d!=null&&d.length?d.map(He=>{const jt={};for(const lt in He)We!=null&&We.includes(lt)||(jt[lt]=He[lt]);return jt}):[]},[d,t==null?void 0:t.dataSecuritySettings]);De.useEffect(()=>{var We,Tt;G(t==null?void 0:t.chartOptions),l({limit:parseInt(((Tt=(We=t==null?void 0:t.chartOptions)==null?void 0:We.tableSettings)==null?void 0:Tt.defaultRowSize)||"10",10),offset:0})},[t]),De.useEffect(()=>{var We,Tt,He,jt,lt;F.isDynamicSeries&&((We=F.seriesOptions)!=null&&We.includes("ungrouped")?F.ungroupedAlias?X((Tt=F.seriesOptions)==null?void 0:Tt.map(kt=>({value:kt,label:F.ungroupedAlias}))):X((He=F.seriesOptions)==null?void 0:He.map(kt=>({value:kt,label:kt}))):F.ungroupedAlias?X([{value:"ungrouped",label:F.ungroupedAlias},...((jt=F.seriesOptions)==null?void 0:jt.map(kt=>({value:kt,label:kt})))??[]]):X([{value:"ungrouped",label:"ungrouped"},...((lt=F.seriesOptions)==null?void 0:lt.map(kt=>({value:kt,label:kt})))??[]]))},[F.seriesOptions,F.isDynamicSeries,F.ungroupedAlias]);const[ot,rt]=De.useState(!1),ke=We=>{We.key==="Control"&&rt(!0)},et=We=>{We.key==="Control"&&rt(!1)};De.useEffect(()=>{var We,Tt;return(Tt=(We=F.customSettings)==null?void 0:We.chartZoom)!=null&&Tt.isZoomEnabled&&(window.addEventListener("keydown",ke),window.addEventListener("keyup",et)),()=>{window.removeEventListener("keydown",ke),window.removeEventListener("keyup",et)}},[]);const xe=De.useMemo(()=>{let We=!1;if(d!=null&&d.length){const Tt=F.singleValue;We=d[0][Tt]===null&&F.chartType==="singleValue"}return We},[d==null?void 0:d.length,F.singleValue,F.chartType==="singleValue"]);return{onDrillLevelClick:Ve,onDrillDown:$e,handleChartClick:Ie,dataDb:d,getUnderlyingData:Oe,onChangeFilterValue:se,isShowChartPopup:A,setShowChartPopup:h,columnName:ye,chartParams:x,isQueryLoading:q||C,setLoading:k,isSingleValueNull:xe,dynamicOptions:B,chartSettings:F,setChartSettings:G,isEnableZoom:ot,filterValues:J,containerRef:D,drilledLevel:Q.length,dimensions:(($t=(Zt=t==null?void 0:t.datasetMetricSettings)==null?void 0:Zt.selectedDimensions)==null?void 0:$t.map(We=>re(We||"none")))||[],rlsConditions:y,setTableLimit:l,isEnableNextBtn:j>(g==null?void 0:g.limit)+(g==null?void 0:g.offset),isEnablePrevBtn:(g==null?void 0:g.offset)!==0,paginationInfo:{limit:g==null?void 0:g.limit,offset:g==null?void 0:g.offset,totalRecords:j},onChangePage:(We,Tt)=>{l(Tt?{limit:Tt,offset:0}:He=>({limit:He.limit,offset:We?He.offset>He.limit?He.offset-He.limit:0:He.offset+He.limit}))},isExternalChart:((Mt=F==null?void 0:F.tableSettings)==null?void 0:Mt.isServerSidePagination)&&(F==null?void 0:F.chartType)===Se.table,isEnablePivotTable:m,groupByList:b,hasNumberKeys:!0,isEnableGauge:!0,updateFilter:We=>{z(Tt=>Tt.map(He=>He.name===We.name&&He.datatype===We.datatype&&He.tableName===We.tableName&&He.columnName===We.columnName?{...He,isAddOnMetrics:!He.isAddOnMetrics}:He))},metricFilters:Ee,leftPositionedMetricFilters:Te,rightPositionedMetricFilters:fe,drillFilters:Q,drillType:(It=t==null?void 0:t.drillDownSettings)==null?void 0:It.drillType,tableResultsDownloadData:Qe,appliedMetricFilters:P}},tle=({dashboardId:t,clientId:i,metricId:e,onSuccess:n})=>{const r=qx(),{mutateAsync:M,isLoading:a}=Ige();return{handleArchiveMetric:De.useCallback(async()=>{!e||!i||await M({id:e,clientId:i},{onSuccess:o=>{o!=null&&o.insert_clientDeletedMetrics_one&&(r.setQueryData([F6,{dashboardId:t}],s=>{var D;const N=(D=s==null?void 0:s.externalMetrics)==null?void 0:D.filter(g=>g.externalMetricId!==e);return{...s,externalMetrics:N}}),n())}})},[M,e,i]),isLoading:a}},ile=({token:t,metricId:i})=>{const[e,n]=De.useState(!0),[r,M]=De.useState({width:"200px",variant:"floating",radius:"6px"}),{data:a,isLoading:u}=kge(t,i),{externalMetric:o,sharingSettingsId:s,adminTheme:N,params:D,companyId:g,clientId:l,errorMsg:j}=De.useMemo(()=>{var h;const A=a;return{externalMetric:A==null?void 0:A.externalMetric,adminTheme:A==null?void 0:A.adminTheme,sharingSettingsId:A==null?void 0:A.sharingSettingsId,errorMsg:(h=A==null?void 0:A.error)==null?void 0:h.message,params:A==null?void 0:A.params,companyId:A==null?void 0:A.companyId,clientId:A==null?void 0:A.clientId}},[a]),T=De.useMemo(()=>{var A;return N?(A=N.chart.palettes.find(h=>h.name===N.chart.selected))==null?void 0:A.colors:null},[N]);De.useEffect(()=>{if(N!=null&&N.dashboard.selectBoxSize)switch(N==null?void 0:N.dashboard.selectBoxSize){case"small":M(A=>({...A,width:"130px"}));break;case"medium":M(A=>({...A,width:"180px"}));break;case"large":M(A=>({...A,width:"250px"}));break;default:M(A=>({...A,width:"200px"}))}N!=null&&N.dashboard.selectBoxVariant&&M(A=>({...A,variant:N.dashboard.selectBoxVariant})),N!=null&&N.dashboard.selectBoxBorderRadius&&M(A=>({...A,radius:N.dashboard.selectBoxBorderRadius}))},[N==null?void 0:N.dashboard]);const{rlsSettings:y,tenancyLevel:z}=De.useMemo(()=>{var h;if(!D)return{rlsSettings:void 0,tenancyLevel:"TABLE"};const A=JSON.parse(D);return{rlsSettings:(h=A.rlsSettings)==null?void 0:h.find(x=>x.metricId===i),tenancyLevel:A.companyTenancyType||"TABLE"}},[D,i]);return X6(N),De.useEffect(()=>{u&&n(!0),(o||j)&&n(!1)},[u,o,j]),{externalMetric:o,sharingSettingsId:s,adminColors:T,companyId:g,clientId:l,rlsSettings:y,tenancyLevel:z,isLoading:e,errorMsg:j,dropdownTheme:r}};var zd={},Ad=a1;if(process.env.NODE_ENV==="production")zd.createRoot=Ad.createRoot,zd.hydrateRoot=Ad.hydrateRoot;else{var Mp=Ad.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;zd.createRoot=function(t,i){Mp.usingClientEntryPoint=!0;try{return Ad.createRoot(t,i)}finally{Mp.usingClientEntryPoint=!1}},zd.hydrateRoot=function(t,i,e){Mp.usingClientEntryPoint=!0;try{return Ad.hydrateRoot(t,i,e)}finally{Mp.usingClientEntryPoint=!1}}}const nle=Z6({active:null,over:null,DragPreviewCreateRoot:null,draggables:[],droppables:[]}),nP=()=>{const[t,i]=fw(nle);return{dndState:t,setActive:a=>{i(u=>({...u,active:a}))},setOver:a=>{i(u=>({...u,over:a}))},setDraggables:a=>{i(u=>{var N;const o=(N=u.draggables)==null?void 0:N.findIndex(D=>(D==null?void 0:D.identifier.id)===(a==null?void 0:a.identifier.id));if(o===-1)return{...u,draggables:[...u.draggables,a]};const s=[...u.draggables];return s[o]=a,{...u,draggables:s}})},setDropables:a=>{i(u=>{var N;const o=(N=u.droppables)==null?void 0:N.findIndex(D=>(D==null?void 0:D.identifier.id)===(a==null?void 0:a.identifier.id));if(o===-1)return{...u,droppables:[...u.droppables,a]};const s=[...u.droppables];return s[o]=a,{...u,droppables:s}})},setDndState:i}},rle=({identifier:t,data:i,modifiers:e,events:n,CustomDragPreview:r})=>{const{dndState:M,setActive:a,setDndState:u,setDraggables:o}=nP(),[s,N]=De.useState(!1),[D,g]=De.useState(!0),[l,j]=De.useState(null),T=De.useRef(null),y=De.useRef(null),z={"data-type":t.type||t.id,id:`draggable-${t.id}`,role:"button",tabindex:"0",draggable:D?"true":"false","aria-grabbed":"false"},A=x=>{Object.entries(z).forEach(([O,d])=>{x.setAttribute(O,d)})},h=()=>{var x;y.current&&((x=M.DragPreviewCreateRoot)==null||x.render(r))};return De.useEffect(()=>{if(r&&(y.current=document.getElementById("CustomDragPreviewContainer"),y.current===null)){y.current=document.createElement("div"),y.current.setAttribute("id","CustomDragPreviewContainer"),document.body.appendChild(y.current);const x=zd.createRoot(y.current);u(O=>({...O,DragPreviewCreateRoot:x}))}},[]),De.useEffect(()=>{if(T.current){const x=T.current.getBoundingClientRect();j(x),o({identifier:t,data:i,modifiers:e,DragNodeRef:T,rect:l,events:n,isDragging:s,isEnableDrag:D})}},[T.current,JSON.stringify(t),JSON.stringify(i),JSON.stringify(e),JSON.stringify(n),JSON.stringify(s)]),De.useEffect(()=>{const x=T.current;if(!x)return;A(x);const O=E=>{var C,k,Q;if(N(!0),a({identifier:t,data:i,modifiers:e,DragNodeRef:T,rect:l,events:n,isDragging:s,isEnableDrag:D}),x.setAttribute("aria-grabbed","true"),(C=E.dataTransfer)==null||C.setData("text/plain",JSON.stringify({data:i})),(k=n==null?void 0:n.onDragStart)==null||k.call(n,E,M),y.current){const S=y.current.getBoundingClientRect();(Q=E.dataTransfer)==null||Q.setDragImage(y.current,S.width/2,S.height/2)}},d=E=>{var C;x.setAttribute("aria-grabbed","false"),N(!1),a(null),(C=n==null?void 0:n.onDragEnd)==null||C.call(n,E,M)};return x.addEventListener("mousedown",()=>{r&&h()}),x.addEventListener("dragstart",O),x.addEventListener("dragend",d),()=>{x.removeEventListener("dragstart",O),x.removeEventListener("dragend",d)}},[T.current,JSON.stringify(t),JSON.stringify(i),M.DragPreviewCreateRoot]),De.useEffect(()=>{const x=T.current;x&&x.setAttribute("draggable",D?"true":"false")},[D]),De.useEffect(()=>{var O,d,E;let x=[];return s&&(a({identifier:t,data:i,modifiers:e,DragNodeRef:T,rect:l,events:n,isDragging:s,isEnableDrag:D}),(O=e==null?void 0:e.highlightDrop)!=null&&O.onDrag&&(x=((d=M.droppables)==null?void 0:d.filter(C=>((C==null?void 0:C.identifier.accepts)??[]).includes(t.type??"")&&(C==null?void 0:C.isEnableDrop)).map(C=>C==null?void 0:C.setDropNodeRef.current))??[],(E=e==null?void 0:e.highlightDrop)!=null&&E.onDrag&&x.forEach(C=>{var k;C.classList.add(((k=e==null?void 0:e.highlightDrop)==null?void 0:k.highlightClass)||"dnd-droppable-highlight")}))),()=>{x.forEach(C=>{var k;C.classList.remove(((k=e==null?void 0:e.highlightDrop)==null?void 0:k.highlightClass)||"dnd-droppable-highlight")})}},[s]),{isDragging:s,isEnableDrag:D,setIsEnableDrag:g,DragNodeRef:T}},rP=({identifier:t,events:i,modifiers:e})=>{var x;const{dndState:n,setOver:r,setDropables:M}=nP(),[a,u]=De.useState(null),[o,s]=De.useState({isDragOver:!1,isDrop:!1}),[N,D]=De.useState({before:-1,after:-1}),[g,l]=De.useState(!0),j=De.useRef(null),T={"data-type":((x=t.accepts)==null?void 0:x.join("-"))??"",id:`droppable-${t.id}`,droppable:g?"true":"false"},y=O=>{Object.entries(T).forEach(([d,E])=>{O.setAttribute(d,E)})},z=(O,d,E)=>{const C=[...E];O=O===-1?C.length-1:O;const[k]=C.splice(O,1);return d===-1?C.push(k):C.splice(d,0,k),C},A=(O,d,E)=>[...O.querySelectorAll('[draggable="true"]:not([aria-grabbed="true"])')].reduce((Q,S,b)=>{const Y=S.getBoundingClientRect(),m=d-Y[E==="horizontal"?"left":"top"]-Y[E==="horizontal"?"width":"height"]/2;return m<0&&m>Q.offset?{offset:m,element:S,index:b}:Q},{offset:Number.NEGATIVE_INFINITY,element:null,index:-1}),h=(O,d,E)=>{const C=[...O.querySelectorAll('[draggable="true"]')],k=O.querySelector('[aria-grabbed="true"]'),{width:Q,height:S}=E,b=(m,R,P)=>{const W=m.x-R/2,B=m.y-P/2;return[{x:W,y:B},{x:W+R,y:B},{x:W,y:B+P},{x:W+R,y:B+P}]};return C.reduce((m,R,P)=>{const W=R.getBoundingClientRect(),B=[{x:W.left,y:W.top},{x:W.left+W.width,y:W.top},{x:W.left,y:W.top+W.height},{x:W.left+W.width,y:W.top+W.height}],X=b(d,Q,S);let F=Number.POSITIVE_INFINITY,G=P,J=Number.POSITIVE_INFINITY,ee=Number.POSITIVE_INFINITY;return B.forEach((q,ie)=>{X.forEach(re=>{let le=Number.POSITIVE_INFINITY;J=Math.sqrt((q.x-re.x)**2+(q.y-re.y)**2),ee=Math.sqrt((q.x-d.x)**2+(q.y-d.y)**2),le=Math.min(J,ee),le<F&&(F=le,ie===1||ie===3?k!==R&&(G=P+1):G=P)})}),F<m.minDistance?{minDistance:F,element:R,index:G,closestBasedOnCorner:J,closestBasedonCursor:ee}:m},{minDistance:Number.POSITIVE_INFINITY,element:null,index:-1,closestBasedOnCorner:0,closestBasedonCursor:0})};return De.useEffect(()=>{const O=j.current;if(!O)return;const d=O.getBoundingClientRect();u(d),M({identifier:t,setDropNodeRef:j,events:i,modifiers:e,rect:a,isEnableDrop:g,dragStatus:o})},[j.current,g,o.isDragOver,o.isDrop,JSON.stringify(t),JSON.stringify(i),JSON.stringify(e)]),De.useEffect(()=>{var S,b;const O=j.current;if(y(O),!O||!g||(S=t.accepts)!=null&&S.length&&!t.accepts.includes(((b=n.active)==null?void 0:b.identifier.type)??""))return;const{sorting:d}=e||{},E=Y=>{var m;Y.preventDefault(),r({identifier:t,setDropNodeRef:j,events:i,modifiers:e,rect:a,isEnableDrop:g,dragStatus:o}),(m=i==null?void 0:i.onDragEnter)==null||m.call(i,Y,n)},C=Y=>{var m,R,P,W,B,X,F,G,J,ee,q,ie;if(Y.preventDefault(),(P=(R=(m=n.active)==null?void 0:m.modifiers)==null?void 0:R.highlightDrop)!=null&&P.onDragOver&&j.current.classList.add(((X=(B=(W=n.active)==null?void 0:W.modifiers)==null?void 0:B.highlightDrop)==null?void 0:X.highlightClass)||"dnd-droppable-highlight"),o.isDragOver||s(re=>({...re,isDragOver:!0})),n.over===null&&r({identifier:t,setDropNodeRef:j,events:i,modifiers:e,rect:a,isEnableDrop:g,dragStatus:o}),d!=null&&d.isEnabled&&((F=d.list)!=null&&F.length)){const re=(ee=(J=(G=n.active)==null?void 0:G.DragNodeRef)==null?void 0:J.current)==null?void 0:ee.getAttribute("data-dbn-sorting-index");let le=null;if((d.sortingType==="vertical"||d.sortingType==="horizontal")&&(le=A(O,(d==null?void 0:d.sortingType)==="horizontal"?Y.clientX:Y.clientY,d==null?void 0:d.sortingType)),d.sortingType==="both-axis"){const se=(q=document.getElementById("CustomDragPreviewContainer"))==null?void 0:q.getBoundingClientRect();le=h(O,{x:Y.clientX,y:Y.clientY},{width:(se==null?void 0:se.width)??0,height:(se==null?void 0:se.height)??0})}const Ne={before:parseInt(re??-1,10),after:le.index};(Ne.before!==N.before||Ne.after!==N.after)&&D(Ne)}(ie=i==null?void 0:i.onDragOver)==null||ie.call(i,Y,n)},k=Y=>{var m,R,P,W,B,X,F;Y.preventDefault(),(P=(R=(m=n.active)==null?void 0:m.modifiers)==null?void 0:R.highlightDrop)!=null&&P.onDragOver&&j.current.classList.remove(((X=(B=(W=n.active)==null?void 0:W.modifiers)==null?void 0:B.highlightDrop)==null?void 0:X.highlightClass)||"dnd-droppable-highlight"),s(G=>({...G,isDragOver:!1})),(F=i==null?void 0:i.onDragLeave)==null||F.call(i,Y,n),r(null)},Q=Y=>{var B,X,F,G,J,ee,q,ie,re,le;Y.preventDefault();const m=j.current.contains((X=(B=n.active)==null?void 0:B.DragNodeRef)==null?void 0:X.current);let R={...n};(J=(G=(F=n.active)==null?void 0:F.modifiers)==null?void 0:G.highlightDrop)!=null&&J.onDragOver&&j.current.classList.remove(((ie=(q=(ee=n.active)==null?void 0:ee.modifiers)==null?void 0:q.highlightDrop)==null?void 0:ie.highlightClass)||"dnd-droppable-highlight");let{before:P,after:W}=N;if(d!=null&&d.isEnabled&&((re=d.list)!=null&&re.length)){let Ne=[...d.list];m?Ne=z(P,W,Ne):P=-1,R={...n,sorting:{sortedList:Ne,isSelfDrop:m,ArrayElementSwap:z,sortingIndexes:{before:P,after:W}}},d.isEnabledAutoSort&&m&&d.setList(Ne)}s(Ne=>({...Ne,isDrop:!0})),(le=i==null?void 0:i.onDrop)==null||le.call(i,Y,R),r(null)};return O.addEventListener("dragenter",E),O.addEventListener("dragover",C),O.addEventListener("dragleave",k),O.addEventListener("drop",Q),()=>{O.removeEventListener("dragenter",E),O.removeEventListener("dragover",C),O.removeEventListener("dragleave",k),O.removeEventListener("drop",Q)}},[j.current,t,g,e,i,N]),De.useEffect(()=>{const O=j.current;O&&O.setAttribute("droppable",g?"true":"false")},[g]),{dragStatus:o,isEnableDrop:g,setIsEnableDrop:l,setDropNodeRef:j}},ap=Ye.memo(({filter:t,onChange:i,selectedOption:e,autoSelected:n=!0,workspaceId:r,filterClause:M,isDisableLabel:a,customTable:u,...o})=>{const[s,N]=De.useState([]),{fetchColumnValues:D}=B6();return De.useEffect(()=>{o.isDisabled||D({wId:r,tableName:u?"":t.tableName,columnName:t.columnName,filter:(M==null?void 0:M.filter(g=>Array.isArray(g.value)?g.value.length&&g.columnName:g.columnName&&g.value))||[],customTable:u},{onSuccess:g=>{if(!(g!=null&&g.data)||!Array.isArray(g.data))return;const l=[];g.data.forEach(T=>{T&&l.push({label:T.label,value:T.value})}),N(l);const j=l==null?void 0:l.find(T=>T.value===(e==null?void 0:e.value));M!=null&&M.length&&e&&i(j||(l==null?void 0:l[0])||{value:"",label:""})}})},[t.tableName,t.columnName,M]),De.useEffect(()=>{s.length&&s[0]&&n&&i(s[0])},[s.length,s[0],n,JSON.stringify(M||[])]),v.jsx(un,{onChange:i,selectedOption:t.defaultValue?{label:t.defaultValue,value:t.defaultValue}:e,isDisabled:!!t.defaultValue||o.isDisabled,options:s,label:a?void 0:t.columnName,...o})}),fd=Ye.memo(({filter:t,autoSelected:i,label:e,workspaceId:n,filterClause:r,onChange:M,selectedOption:a,isDisabled:u,isDisablelabel:o,customTable:s,radius:N,...D})=>{const[g,l]=De.useState([]),{fetchColumnValues:j}=B6();return De.useEffect(()=>{u||j({wId:n,tableName:s?"":t.tableName,columnName:t.columnName,filter:(r==null?void 0:r.filter(T=>Array.isArray(T.value)?T.value.length&&T.columnName:T.columnName&&T.value))||[],customTable:s},{onSuccess:T=>{if(!(T!=null&&T.data)||!Array.isArray(T.data))return;const y=[];T.data.forEach(A=>{A&&y.push({label:A.label,value:A.value})}),l(y);const z=a==null?void 0:a.filter(A=>y.map(h=>h.value).includes(A.value));r!=null&&r.length&&(a!=null&&a.length)&&M(z!=null&&z.length?z:y!=null&&y[0]?[y==null?void 0:y[0]]:[])}})},[t.tableName,t.columnName,JSON.stringify(r||[])]),De.useEffect(()=>{g.length&&g[0]&&i&&M([g[0]])},[g.length,g[0],i,t.columnName]),v.jsx(fl,{onChange:M,selectedOption:t.defaultValue?[{label:t.defaultValue,value:t.defaultValue}]:a,isDisabled:!!t.defaultValue||u,options:g,radius:N,label:o?void 0:e||t.columnName,...D})}),WZe={fullscreen:"_fullscreen_16ns9_1"},qZe={button:"_button_jnm42_1",menu:"_menu_jnm42_7",menuContainer:"_menuContainer_jnm42_13",buttonText:"_buttonText_jnm42_19",buttonIcon:"_buttonIcon_jnm42_25",filterName:"_filterName_jnm42_31",filterDropdown:"_filterDropdown_jnm42_37"},Mle=t=>{const i=document.documentElement;t.colors&&Object.entries(t.colors).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-color-${e}`,`${n}`)}),t.border&&Object.entries(t.border).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-border-${e}`,`${n}`)}),t.shadow&&Object.entries(t.shadow).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-shadow-${e}`,`${n}`)}),t.typography&&Object.entries(t.typography).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-typography-${e}`,`${n}`)}),t.breakpoint&&Object.entries(t.breakpoint).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-breakpoint-${e}`,`${n}`)})},ale=["rgb(56, 72, 211)","rgb(251, 208, 98)","rgb(234 88 12)","rgb(245 158 11)","rgb(234 179 8)","rgb(34 197 94)","rgb(4 120 87)","rgb(15 118 110)","rgb(8 145 178)","rgb(219 234 254)","rgb(30 58 138)","rgb(139 92 246)"],ule=({data:t,measure:i,singleValue:e,step:n,xAxis:r,yAxisList:M,seriesField:a,isTimeSeries:u,selectedFormat:o,fillXAxis:s,isDynamicXaxis:N,isCumulativeBar:D,chartType:g,seriesType:l,isGroupXAxis:j})=>{const T=Array.isArray(t)?N||j?[...new Set(t==null?void 0:t.map(k=>r&&k[r]))]:t==null?void 0:t.map(k=>r&&k[r]):[];let y=M==null?void 0:M.map((k,Q)=>({label:k,data:Array.isArray(t)?N||j?T==null?void 0:T.map(S=>t.filter(Y=>Y[r||""]===S).reduce((Y,m)=>Y+Number(m[M[Q]])||0,0)):t==null?void 0:t.map(S=>S[M[Q]]):[],borderColor:ale[Q]}));D&&(g===Se.bar||g===Se.timeSeries&&l==="bar")&&(y=y==null?void 0:y.map(k=>{var b;let Q=0;const S=(b=k==null?void 0:k.data)==null?void 0:b.map(Y=>(Q+=Y,Q));return{label:k.label,data:S,borderColor:k.borderColor}}));const z=Array.isArray(t)&&n&&i?t==null?void 0:t.map(k=>({value:k[i],name:k[n]})):[],A=Array.isArray(t)&&e?t==null?void 0:t.map(k=>k[e]):[],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],x={yearly:k=>k.getFullYear(),monthly:k=>{const Q=k.getMonth(),S=k.getFullYear();return`${h[Q]} - ${S}`},weekly:k=>{const Q=new Date(k.getTime());return Q.setDate(k.getDate()-k.getDay()),Q.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:k=>`${k.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:k=>{const Q=k.getMonth(),S=Math.floor(Q/3)+1,b=k.getFullYear();return`Q${S} ${b}`}},O=Array.from(new Set(t==null?void 0:t.map(k=>k[a||""])));let d,E=Array.from(new Set(t==null?void 0:t.map(k=>{if(u&&k[r||""]){const Q=new Date(k[r||""]),S=x[o||"monthly"];return S(Q)}return k[r||""]})));if(o===Ns.daily&&(E=E.map(k=>new Date(k)).sort((k,Q)=>k-Q).map(k=>k.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))),d=u&&o===Ns.month?E==null?void 0:E.sort((k,Q)=>{const[S,b]=k==null?void 0:k.toString().split(" - "),[Y,m]=Q==null?void 0:Q.toString().split(" - ");return b!==m?parseInt(b,10)-parseInt(m,10):h.indexOf(S)-h.indexOf(Y)}):E,u&&s&&o===Ns.month){const k=Array.from(new Set(d==null?void 0:d.map(m=>m.split(" - ")[1]))).sort(),Q=h.findIndex(m=>d.some(R=>R.startsWith(`${m} - ${k[0]}`))),S=h.slice().reverse().findIndex(m=>d.some(R=>{const[P,W]=R.split(" - ");return W===k[k.length-1]&&R.endsWith(`${m} - ${W}`)})),b=h.length-S,Y=[];k.length>1?k.forEach(m=>{h.forEach((R,P)=>{const W=`${R} - ${m}`;(m===k[0]&&P>=Q||m===k[k.length-1]&&P<b||m!==k[0]&&m!==k[k.length-1])&&Y.push(W)})}):h.forEach((m,R)=>{const P=`${m} - ${k[0]}`;R>=Q&&R<b&&Y.push(P)}),d=[...Y]}else if(u&&s&&o===Ns.quarter){const k=[];Array.from(new Set(d==null?void 0:d.map(S=>S.split(" ")[0])));const Q=Array.from(new Set(d==null?void 0:d.map(S=>S.split(" ")[1]))).sort();for(let S=0;S<Q.length;S+=1)for(let b=1;b<=4;b+=1){const Y=`Q${b} ${Q[S]}`;k.push(Y)}d=k}let C=O==null?void 0:O.map(k=>{const Q=t==null?void 0:t.filter(b=>b[a||""]===k),S=d==null?void 0:d.map(b=>{var m;if(u&&b){const R=x[o||"monthly"],P=Q==null?void 0:Q.filter(B=>{const X=new Date(B[r||""]);return R(X)===b});return(P==null?void 0:P.reduce((B,X)=>B+(Number(X[(M==null?void 0:M[0])||""])||0),0))||0}return((m=Q==null?void 0:Q.find(R=>R[r||""]===b))==null?void 0:m[(M==null?void 0:M[0])||""])||0});return{name:k,data:S}});return D&&(g===Se.bar||g===Se.timeSeries&&l==="bar")&&(C=C==null?void 0:C.map(k=>{var b;let Q=0;const S=(b=k==null?void 0:k.data)==null?void 0:b.map(Y=>(Q+=Y,Q));return{name:k.name,data:S}})),{labels:T,datasets:y,funnelData:z,singleValueData:A,xAxisData:d,seriesData:C}},ole=({data:t,source:i,target:e,value:n,sankeyColors:r})=>{const M=[],a=[],u=[];t.forEach(g=>{if(g[i]!==g[e]){let l=!0;a==null||a.map(j=>{const[T,y]=j.split("^^^^^^");y===g[i]&&T===g[e]&&(l=!1)}),l&&(a.push(`${g[i]}^^^^^^${g[e]}`),M.push({source:g[i].toString(),target:g[e].toString(),value:g[n]}))}});const o=a==null?void 0:a.map(g=>g.split("^^^^^^")[0]),s=a==null?void 0:a.map(g=>g.split("^^^^^^")[1]);o.forEach(g=>{u.includes(g)||u.push(g)}),s.forEach(g=>{u.includes(g)||u.push(g)});let N=-1;return{nodes:u==null?void 0:u.map(g=>(N===(r==null?void 0:r.length)?N=0:N+=1,{name:g.toString(),...r!=null&&r.length?{itemStyle:{color:r[N]}}:{}})),links:M}},Nle=t=>{const i="data:text/csv;charset=utf-8,";if(!t.length)return i;const e=[],n=t[0],r=Object.keys(n);e.push(`S.NO,${r.join(",").toUpperCase()}`),t.forEach((u,o)=>{const s=Object.values(u).map(N=>{if(typeof N=="number")return N;try{if(typeof N=="string"&&(N.includes(",")||N.includes(`
|
|
972
|
+
}`),i){const T=document.querySelectorAll("dbn-dashboard");T.length&&T.forEach((A,h)=>{if(A&&A.shadowRoot){const x=document.querySelector(`#dbn-dashboard-${h}-admin-styles`);if(x)x.innerHTML=e;else{const O=document.createElement("style");O.setAttribute("id",`dbn-dashboard-${h}-admin-styles`),O.innerHTML=e,A.shadowRoot.appendChild(O)}}});const y=document.querySelectorAll("dbn-metric");y.length&&y.forEach((A,h)=>{if(A.shadowRoot){const x=document.querySelector(`#dbn-metric-${h}-admin-styles`);if(x)x.innerHTML=e;else{const O=document.createElement("style");O.setAttribute("id",`dbn-metric-${h}-admin-styles`),O.innerHTML=e,A.shadowRoot.appendChild(O)}}});const z=document.querySelector("#dbn-portal");if(z&&z.shadowRoot){const A=document.querySelector("#dbn-portal-admin-styles");A&&z.shadowRoot.removeChild(A)}}else{const T=document.querySelector("#dbn-admin-styles")||document.createElement("style");T.setAttribute("id","dbn-admin-styles"),T.innerHTML=e,document.querySelector("#dbn-admin-styles")||document.head.appendChild(T)}},[t])},wge=({token:t,dashboardId:i})=>l1([F6,{dashboardId:i}],()=>{const e=i?`${tD}?dashboardId=${i}`:tD;return Wa(e,{method:"GET",token:t})},{enabled:!!t}),Cge=(t,i)=>l1([$6,{dashboardId:t,clientId:i}],()=>Wa(`${LDe}?id=${t}&clientId=${i}`,{method:"GET"}),{enabled:!!t&&!!i}),Qge=t=>l1(pDe,()=>Wa(xDe,{method:"GET",token:t}),{enabled:!!t}),kge=(t,i)=>l1([hDe,{id:i}],()=>Wa(`${ODe}?metricId=${i}`,{method:"GET",token:t}),{enabled:!!t}),Uge=({externalDashboardId:t,clientId:i})=>{const e=qx(),{data:n,isLoading:r}=Cge(t,i),[M,a]=De.useMemo(()=>{const N=n;return[(N==null?void 0:N.layout)||[],!!(N!=null&&N.isLocked)]},[n]),{mutateAsync:u,isLoading:o}=Mge();return{saveLayout:De.useCallback(async(N,D)=>{await u({clientId:i,externalDashboardId:t,layout:N,isLocked:!!D},{onSuccess:g=>{if(!g)return;const l=g;e.setQueryData([$6,{dashboardId:t,clientId:i}],j=>({...j,...l}))}})},[u,i,t]),layout:M,isLayoutLocked:a,isLoadingLayout:r||o}},mge=(t,i)=>{let e=t.replace(/;([^;]*)$/,"");const n=parseInt(i,10);if(e.toLowerCase().includes("limit")){const r=parseInt(e.toLowerCase().split("limit")[1].trim(),10),M=Math.min(r,n);e=e.replace(`limit ${r}`,`limit ${M}`),e=e.replace(`LIMIT ${r}`,`LIMIT ${M}`)}else e+=` limit ${n}`;return e},Yge=({limit:t,query:i,clientName:e,tenancyType:n,values:r})=>{const M=mge(i,t),a=e?n===lse?M.replace(new RegExp(G7,"g"),e):Number(e)?M.replace(new RegExp(vx,"g"),e):M.replace(new RegExp(H7,"g"),e):M;return r?a.replace(/[^']+_variable/g,o=>`${r[o]}`):a},bge=({clientName:t,tenancyType:i,values:e,query:n,companyId:r,workspaceId:M,metricId:a})=>{const{mutate:u}=jge();return{getUnderlyingData:({columnName:s,value:N,setData:D,setLoading:g,isSingleValueChart:l})=>{const j=Yge({query:n,limit:"5000",clientName:t,tenancyType:i,values:e});D([]),g(!0),u({columnName:l?void 0:s,companyId:r,query:j,value:l||N==null?void 0:N.replace(/'/g,"''"),workspaceId:M,metricId:a},{onSuccess(T){const y=T==null?void 0:T.data;y&&Array.isArray(y)&&y.length?(D(y),g(!1)):(D([]),g(!1))},onError(){D([]),g(!1)}})}}},_ge=({range:t,count:i,time:e,from:n,to:r})=>{const M=new Date;new Date(M).setDate(M.getDate()-1);const u=M.getMonth(),o=M.getFullYear();let s,N;if(t==="This"){switch(e){case"Year":s=new Date(o,0,1),N=new Date(M);break;case"Month":s=new Date(o,u,1),N=new Date(M);break;case"Week":{const D=M.getDate()-M.getDay();s=new Date(M.setDate(D)),N=new Date(M.setDate(D+6));break}case"Day":s=new Date(M),N=new Date(M);break;default:s=new Date(0),N=new Date(M)}return{startDate:s,endDate:N}}if(t==="Last"){switch(e){case"Year":{let D,g;i===1?(D=i,g=o-1):(D=i-1,g=o),s=new Date(o-D,0,1),N=new Date(g,11,31);break}case"Month":{const D=i===1?u-1:u-i+1;s=new Date(o,D,1),N=new Date(o,u,i===1?0:31);break}case"Week":{const D=new Date(M.setDate(M.getDate()-(M.getDay()+1)%7)),g=new Date(D.getFullYear(),D.getMonth(),D.getDate()-6),l=i-1;s=new Date(g.setDate(g.getDate()-7*l)),N=new Date(D.setDate(D.getDate()-7*(l-1))),l===0&&(N=new Date(M));break}case"Day":s=new Date(M),s.setDate(M.getDate()-i),N=new Date(M);break;default:s=new Date(0),N=new Date(M)}return{startDate:s,endDate:N}}return{startDate:n||new Date(0),endDate:r||new Date(M)}},Rge=({data:t,format:i,measureColumn:e,timeColumn:n,dimensionColumn:r,startDate:M})=>t.reduce((u,o)=>{const s=Number(o[e]),N=new Date(o[n]);let D;switch(i){case"Week":{D=`Week ${Math.ceil((N.getDate()+M.getDay())/7)}`;break}case"Quarter":{const l=Math.ceil((N.getMonth()+1)/3),j=N.getFullYear();D=`Q${l} ${j}`;break}case"Month":{D=`${N.toLocaleString("default",{month:"long"})} ${N.getFullYear()}`;break}case"Day":{D=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][N.getDay()];break}default:D=o[n]}const g=u.find(l=>l[r]===D);return g?g[e]+=s:u.push({[r]:D,[e]:s}),u},[]),Pge=({dimensionColumn:t,endDate:i,measureColumn:e,format:n,groupedDataList:r,time:M,count:a,range:u})=>{const o=new Date().getFullYear(),s=o-1;let N=[],D=[];if(a===1&&u==="This"&&(N=Array.from({length:12},(T,y)=>({[t]:`${new Date(2e3,y,1).toLocaleString("default",{month:"long"})} ${o}`,[e]:0})),D=[{[t]:`Q1 ${o}`,[e]:0},{[t]:`Q2 ${o}`,[e]:0},{[t]:`Q3 ${o}`,[e]:0},{[t]:`Q4 ${o}`,[e]:0}]),a===1&&u==="Last"&&(N=Array.from({length:12},(T,y)=>({[t]:`${new Date(2e3,y,1).toLocaleString("default",{month:"long"})} ${s}`,[e]:0})),D=[{[t]:`Q1 ${s}`,[e]:0},{[t]:`Q2 ${s}`,[e]:0},{[t]:`Q3 ${s}`,[e]:0},{[t]:`Q4 ${s}`,[e]:0}]),a>1&&u==="Last"){for(let T=o-a+1;T<=o;T++)for(let y=0;y<12;y++)N.push({[t]:`${new Date(T,y,1).toLocaleString("default",{month:"long"})} ${new Date(T,y,1).getFullYear()}`,[e]:0});for(let T=o-a;T<=o;T++)D.push({[t]:`Q1 ${T}`,[e]:0},{[t]:`Q2 ${T}`,[e]:0},{[t]:`Q3 ${T}`,[e]:0},{[t]:`Q4 ${T}`,[e]:0})}const g=Array.from({length:4},(T,y)=>({[t]:`Week ${y+1}`,[e]:0})),l=[{[t]:"Sunday",[e]:0},{[t]:"Monday",[e]:0},{[t]:"Tuesday",[e]:0},{[t]:"Wednesday",[e]:0},{[t]:"Thursday",[e]:0},{[t]:"Friday",[e]:0},{[t]:"Saturday",[e]:0}];let j=[];switch(`${u}${a>1?` ${a} `:" "}${M} By ${n}`){case"This Year By Month":case"Last Year By Month":case`Last ${a} Year By Month`:{j=N.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Year By Quarter":case"Last Year By Quarter":case`Last ${a} Year By Quarter`:{j=D.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Month By Week":case"Last Month By Week":{j=g.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Week By Day":case"Last Week By Day":{j=l.map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}case"This Quarter By Month":{const y=(Math.ceil((i.getMonth()+1)/3)-1)*3,z=y+2;j=N.slice(y,z+1).map(h=>{const x=r.find(O=>O[t]===h[t]);return x||h});break}case"Last Quarter By Month":{const T=Math.ceil((i.getMonth()+1)/3),z=((T===1?4:T-1)-1)*3,A=z+2;j=N.slice(z,A+1).map(x=>{const O=r.find(d=>d[t]===x[t]);return O||x});break}case`Last ${a} Month By Month`:{j=Array.from({length:a},(T,y)=>{const z=new Date(i.getFullYear(),i.getMonth()-y,1);return{[t]:`${z.toLocaleString("default",{month:"long"})} ${z.getFullYear()}`,[e]:0}}).reverse().map(T=>{const y=r.find(z=>z[t]===T[t]);return y||T});break}default:j=r}return j},Vge=({data:t,dimensionColumn:i,measureColumn:e,timeColumn:n,option:r})=>{const{endDate:M,startDate:a}=_ge({range:r.range,count:r.count,from:r.startDate,to:r.endDate,time:r.time});if(r.time==="Week"&&r.count>1)return t.map(N=>({[i]:N[i],[e]:N[e]}));const u=Rge({data:t,dimensionColumn:i,format:r.format,measureColumn:e,startDate:a,timeColumn:n}),o=Object.values(u);return r.name==="Custom"?o:Pge({dimensionColumn:i,endDate:M,format:r.format,groupedDataList:o,measureColumn:e,time:r.time,count:r.count,range:r.range})},Fge=t=>l1([HDe,t],()=>Wa(BDe,{method:"POST",data:t}),{enabled:!!t.id}),$ge=t=>l1([ZDe,t],()=>Wa(`${GDe}?id=${t}`,{method:"GET"}),{enabled:!!t}),K6=t=>t instanceof Date&&!Number.isNaN(t.getTime()),q6=({isTimeColumn:t,timeColumnName:i,timeCount:e,timeGrain:n,timeRangeIndicator:r,databaseType:M,endDate:a=new Date,startDate:u=new Date,comparsionOperator:o})=>{const s=M==null?void 0:M.toLowerCase();let N="";switch(r){case"last":e===1?n==="day"?s==="bigquery"?N=`EXTRACT(DAYOFYEAR FROM ${i}) = EXTRACT(DAYOFYEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`DAYOFYEAR(${i}) = DAYOFYEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('doy' FROM ${i}) = EXTRACT('doy' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="year"?s==="bigquery"?N=`EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e}`:N=`EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:n==="quarter"?s==="bigquery"?N=`EXTRACT(QUARTER FROM ${i}) = EXTRACT(QUARTER FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`QUARTER(${i}) = QUARTER(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('quarter' FROM ${i}) = EXTRACT('quarter' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="week"?s==="bigquery"?N=`EXTRACT(WEEK FROM ${i}) = EXTRACT(WEEK FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`WEEK(${i}) = WEEK(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('week' FROM ${i}) = EXTRACT('week' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="month"&&(s==="bigquery"?N=`EXTRACT(MONTH FROM ${i}) = EXTRACT(MONTH FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`MONTH(${i}) = MONTH(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('month' FROM ${i}) = EXTRACT('month' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`):n==="day"?s==="bigquery"?N=`EXTRACT(DAYOFYEAR FROM ${i}) >= EXTRACT(DAYOFYEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`DAYOFYEAR(${i}) >= DAYOFYEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('doy' FROM ${i}) >= EXTRACT('doy' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="year"?s==="bigquery"?N=`EXTRACT(YEAR FROM ${i}) >= EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`YEAR(${i}) >= YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e}`:N=`EXTRACT('year' FROM ${i}) >= EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e}`:n==="quarter"?s==="bigquery"?N=`EXTRACT(QUARTER FROM ${i}) >= EXTRACT(QUARTER FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`QUARTER(${i}) >= QUARTER(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('quarter' FROM ${i}) >= EXTRACT('quarter' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="week"?s==="bigquery"?N=`EXTRACT(WEEK FROM ${i}) >= EXTRACT(WEEK FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`WEEK(${i}) >= WEEK(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('week' FROM ${i}) >= EXTRACT('week' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="month"&&(s==="bigquery"?N=`EXTRACT(MONTH FROM ${i}) >= EXTRACT(MONTH FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`MONTH(${i}) >= MONTH(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) - ${e} AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('month' FROM ${i}) >= EXTRACT('month' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) - ${e} AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`);break;case"this":n==="day"?s==="bigquery"?N=`EXTRACT(DAYOFYEAR FROM ${i}) = EXTRACT(DAYOFYEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`DAYOFYEAR(${i}) = DAYOFYEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('doy' FROM ${i}) = EXTRACT('doy' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="year"?s==="bigquery"?N=`EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="quarter"?s==="bigquery"?N=`EXTRACT(QUARTER FROM ${i}) = EXTRACT(QUARTER FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`QUARTER(${i}) = QUARTER(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('quarter' FROM ${i}) = EXTRACT('quarter' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="week"?s==="bigquery"?N=`EXTRACT(WEEK FROM ${i}) = EXTRACT(WEEK FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`WEEK(${i}) = WEEK(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('week' FROM ${i}) = EXTRACT('week' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:n==="month"&&(s==="bigquery"?N=`EXTRACT(MONTH FROM ${i}) = EXTRACT(MONTH FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(YEAR FROM ${i}) = EXTRACT(YEAR FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:s==="mysql"||s==="mongodb"||s==="clickhouse"?N=`MONTH(${i}) = MONTH(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"}) AND YEAR(${i}) = YEAR(${t?"CURRENT_TIMESTAMP()":"CURRENT_DATE()"})`:N=`EXTRACT('month' FROM ${i}) = EXTRACT('month' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT('year' FROM ${i}) = EXTRACT('year' FROM ${t?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`);break;case"custom date":{const g=new Date(u).toISOString().slice(0,10);N=`${i} ${o||"="} '${g}'`;break}default:{const D=new Date(u),g=new Date(a);if(K6(D)&&K6(g)){const l=D.toISOString().slice(0,10),j=g.toISOString().slice(0,10);N=`${i} BETWEEN '${l}' AND '${j}'`}else{const l=new Date().toISOString().slice(0,10),j=new Date().toISOString().slice(0,10);N=`${i} BETWEEN '${l}' AND '${j}'`}break}}return N},Wge=(t,i)=>t.reduce((e,n)=>{const r=n[i];return r&&(e[r]||(e[r]=[]),e[r].push(n)),e},{}),Bge=({query:t,rlsConditions:i,tenancyLevel:e,clientId:n,values:r,isAllClient:M})=>{let a=n?e==="DATABASE"?t.replace(new RegExp(G7,"g"),n):Number(n)?M?t.replace(new RegExp(`=\\s*['"]?${vx}['"]?`,"g"),"IS NOT NULL"):t.replace(new RegExp(vx,"g"),n):M?t.replace(new RegExp(`=\\s*['"]?${vx}['"]?`,"g"),"IS NOT NULL"):t.replace(new RegExp(H7,"g"),n):t;return i.filter(o=>o.isAddOnMetrics&&o.isVariableFilter).forEach(o=>{var s,N,D,g,l,j,T,y,z;if(["string","boolean","default","number"].includes(o.datatype)){const A=o.datatype==="number"?Number((s=o.selectedVariableValue)==null?void 0:s.value)||0:`'${(N=o.selectedVariableValue)==null?void 0:N.value}'`;a=(D=o.variableStrings)!=null&&D[0]?a.replace(new RegExp(o.variableStrings[0],"g"),A):a}else{const A=(g=o.selectedVariableValue)!=null&&g.startDate?new Date((l=o.selectedVariableValue)==null?void 0:l.startDate):new Date(new Date().setFullYear(1,0,1)),h=(j=o.selectedVariableValue)!=null&&j.endDate?new Date((T=o.selectedVariableValue)==null?void 0:T.endDate):new Date,x=`'${A==null?void 0:A.toISOString().slice(0,10)}'`;a=(y=o.variableStrings)!=null&&y[0]?a.replace(new RegExp(o.variableStrings[0],"g"),x):a;const O=`'${h==null?void 0:h.toISOString().slice(0,10)}'`;a=(z=o.variableStrings)!=null&&z[1]?a.replace(new RegExp(o.variableStrings[1],"g"),O):a}}),r&&(a=a.replace(/[^']+_variable/g,o=>`${r[o]}`)),a},Hge=(t,i)=>{switch(i.toLowerCase()){case"postgres":case"redshift":case"snowflake":return`"${t}"`;case"bigquery":case"mysql":case"mongodb":case"databricks":case"clickhouse":return`\`${t}\``;default:return`${t.replace(" ","_")}`}},rp=(t,i,e)=>{const n=e.toLowerCase(),r=i==="number",M=i==="string",a=i==="date";let u="";r?u=n==="mongodb"||n==="mysql"?"AS SIGNED":"AS BIGINT":M?n==="postgres"||n==="redshift"||n==="snowflake"?u="AS VARCHAR":n==="mongodb"||n==="mysql"?u="AS CHAR":u="AS STRING":a&&(u="AS DATE");let o="";return n==="mongodb"?o=`\`${t}\``:n==="bigquery"||n==="mysql"||n==="databricks"?o=`${t}`:o=`"${t}"`,u?`CAST(${o} ${u})`:o},eP=(t,i,e)=>{let n=i;const r=t.tableName.split(/\.(?=[^.]*$)/).map(o=>`${Hge(o,e)}`).join("."),M=t.tableName,a=n.includes(r),u=n.includes(M);if(a||u){const o=a?new RegExp(`${r}\\s*WHERE`,"gi"):new RegExp(`${M}\\s*WHERE`,"gi"),s=`\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*WHERE`,N=a?new RegExp(`${r}${s}`,"gi"):new RegExp(`${M}${s}`,"gi"),D=a?new RegExp(`FROM\\s*${r}\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*`,"gi"):new RegExp(`FROM\\s*${M}\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*`,"gi"),g=a?new RegExp(`FROM\\s*${r}\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*(?:\\s*[^"'\\s]+)?\\s*?JOIN`,"gi"):new RegExp(`FROM\\s*${r}\\s*AS\\s*['"]?[^"'\\s]+['"]?\\s*(?:\\s*[^"'\\s]+)?\\s*?JOIN`,"gi"),l=o.test(n),j=N.test(n),T=D.test(n),y=g.test(n);if(l||j)n=n.replace(j?N:o,z=>`${z} ${t.condition} AND `);else if(y)n=n.replace(u?M:r,z=>`( SELECT * from ${z} WHERE ${t.condition} )`);else{const z=T?D:u?M:r;n=n.replace(z,A=>`${A} WHERE ${t.condition}`)}}return n},Gge=(t,i,e)=>{let n=t;return Object.keys(i).map(M=>{const a=i[M].map(u=>{var o,s,N,D,g,l,j,T;return u.datatype==="date"?`${q6({isTimeColumn:!!u.datatype,timeColumnName:rp(u.columnName,void 0,e),timeCount:((o=u.options.find(y=>y.name===u.value))==null?void 0:o.count)||1,timeGrain:((N=(s=u.options.find(y=>y.name===u.value))==null?void 0:s.time)==null?void 0:N.toLowerCase())||"year",timeRangeIndicator:((g=(D=u.options.find(y=>y.name===u.value))==null?void 0:D.range)==null?void 0:g.toLowerCase())||"last",databaseType:e==null?void 0:e.toLowerCase(),endDate:(l=u.options.find(y=>y.name===u.value))==null?void 0:l.endDate,startDate:(j=u.options.find(y=>y.name===u.value))==null?void 0:j.startDate,comparsionOperator:(T=u.comparisonOperator)==null?void 0:T.value})} ${u.applyOnColumns?`${u.applyOnColumns.map(y=>{var z,A,h,x,O,d,E;return`${y.logicalOperator.value||"AND"} ${q6({isTimeColumn:!!u.datatype,timeColumnName:rp(y.columnName.value,void 0,e),timeCount:((z=u.options.find(C=>C.name===u.value))==null?void 0:z.count)||1,timeGrain:((h=(A=u.options.find(C=>C.name===u.value))==null?void 0:A.time)==null?void 0:h.toLowerCase())||"year",timeRangeIndicator:((O=(x=u.options.find(C=>C.name===u.value))==null?void 0:x.range)==null?void 0:O.toLowerCase())||"last",databaseType:e==null?void 0:e.toLowerCase(),endDate:(d=u.options.find(C=>C.name===u.value))==null?void 0:d.endDate,startDate:(E=u.options.find(C=>C.name===u.value))==null?void 0:E.startDate,comparsionOperator:y.comparisonOperator.value})}`}).join(" ")}`:""}`:`${rp(u.columnName,u.datatype,e)} ${Array.isArray(u.value)?"IN":"="} ${Array.isArray(u.value)?`(${u.value.map(y=>typeof y=="string"?`'${y}'`:y).join(", ")})`:typeof u.value=="string"?`'${u.value}'`:u.value}`});return{tableName:M,condition:a.join(" AND ")}}).forEach(M=>{n=eP(M,n,e)}),n},Zge=({rlsConditions:t,dbName:i,query:e})=>{const n=Wge(t.filter(M=>M.isAddOnMetrics),"tableName");return Gge(e,n,i)},yd=({query:t,clientId:i="",rlsConditions:e,globalFilters:n={filters:[],tableName:""},dbName:r,tenancyLevel:M,values:a,isAllClient:u})=>{var j;const o=Bge({isAllClient:u,query:t,rlsConditions:e,tenancyLevel:M,clientId:i,values:a}),s=e.filter(T=>T.isAddOnMetrics&&!T.isVariableFilter);if(((j=n==null?void 0:n.filters)==null?void 0:j.length)===0&&s.length===0)return o;const N=Zge({rlsConditions:s,dbName:r,query:o}),{filters:D,tableName:g}=n;if(!g||D.length===0)return N;const l=D.map(({column:T,operator:y,value:z,as:A})=>A==="date"&&typeof z=="string"?`${z}`:`${rp(T,A,r)} ${y} ${Array.isArray(z)?`(${z.map(h=>`${h}`).join(", ")})`:A==="date"?`'${z!=null&&z.startDate?new Date(z.startDate).toISOString().slice(0,10):new Date().toISOString().slice(0,10)}' AND '${z!=null&&z.endDate?new Date(z.endDate).toISOString().slice(0,10):new Date().toISOString().slice(0,10)}'`:`${z}`}`).join(" AND ");return eP({tableName:g,condition:l},N,r)},Jge=t=>{const e=t.slice(0,100).flatMap(a=>Object.entries(a)),n={};e.forEach(([a,u])=>{n[a]?n[a][Number(u)||Number(u)===0?"number":"other"]=(n[a][Number(u)||Number(u)===0?"number":"other"]||0)+1:n[a]={[Number(u)||Number(u)===0?"number":"other"]:1}});const r=[],M=[];return Object.entries(n).forEach(([a,u])=>{Object.entries(u).reduce((s,N)=>s[1]>N[1]?s:N)[0]==="number"?r.push(a):M.push(a)}),{numberKeys:r,otherKeys:M}},Xge=t=>{const{numberKeys:i,otherKeys:e}=Jge(t),n=i.length+e.length;if(n===1&&i.length)return[Se.singleValue,Se.table,Se.gauge];if(i.length===0)return[Se.table,Se.singleValue];if(i.length>=1){const r=Object.values(Se);return n<3?r.filter(M=>M!==Se.sankey):r}return[]},Kge=(t,i)=>{var r,M,a,u;const e=(M=(r=i==null?void 0:i[t.name])==null?void 0:r.defaultOption)==null?void 0:M.toString(),n=((u=(a=i==null?void 0:i[t.name])==null?void 0:a.options)==null?void 0:u.filter(o=>{if(o==null)return!1;switch(t.datatype){case"string":{if(typeof o!="string"||!o)return!1;break}case"number":{if(typeof o!="number"||!Number(o))return!1;break}case"date":{if(typeof o!="object"||!o.name||!["Last","This","Custom"].includes(o.range)||o.range!=="Custom"&&!o.time&&!["Day","Week","Month","Quarter","Year"].includes(o.time))return!1;break}}return!0}))||[];return e&&n.length?{value:e,options:n}:void 0},cy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qge=({dataArray:t,timeStampKey:i,type:e,valuekeys:n,groupBy:r,labelSettings:M,customSettings:a,backGroundColor:u,fillXAxis:o,isCumulativeBar:s})=>{const N=n.map(j=>t.sort((y,z)=>new Date(y[i]).getTime()-new Date(z[i]).getTime()).reduce((y,z)=>{const h={yearly:O=>O.getFullYear(),monthly:O=>{const d=O.getMonth(),E=O.getFullYear();return`${cy[d]} - ${E}`},weekly:O=>{const d=new Date(O.getTime());return d.setDate(O.getDate()-O.getDay()),d.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:O=>`${O.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:O=>{const d=O.getMonth(),E=Math.floor(d/3)+1,C=O.getFullYear();return`Q${E} ${C}`}}[r],x=h(new Date(z[i]));return y[x]||(y[x]=0),y[x]+=Number(z[j])||0,y},{})),D=[];if(o){if(r===Ns.month){const j=Array.from(new Set(Object.keys(N[0]).map(z=>z.split(" - ")[1]))).sort(),T=cy.findIndex(z=>N[0][`${z} - ${j[0]}`]!==void 0)+1,y=cy.findIndex(z=>N[0][`${z} - ${j[j.length-1]}`]!==void 0)+1;j.length>1?N.forEach(z=>{const A={};j.forEach(h=>{cy.forEach((x,O)=>{const d=`${x} - ${h}`;cy.includes(x)&&z[d]===void 0?h===j[0]&&O>=T||h===j[j.length-1]&&O<y?A[d]=0:h!==j[0]&&h!==j[j.length-1]&&(A[d]=z[d]||0):A[d]=z[d]||0})}),D.push(A)}):N.forEach(z=>{const A={};cy.forEach((h,x)=>{const O=`${h} - ${j[0]}`;cy.includes(h)&&z[O]===void 0?x>=T&&x<y&&(A[O]=0):A[O]=z[O]||0}),D.push(A)})}else if(r===Ns.quarter){const j=Array.from(new Set(Object.keys(N[0]).map(y=>y.split(" ")[0]))),T=Array.from(new Set(Object.keys(N[0]).map(y=>y.split(" ")[1]))).sort();N.forEach(y=>{const z={};T.forEach(A=>{j.forEach(h=>{const x=`${h} ${A}`;z[x]=y[x]||0})}),D.push(z)})}}const g=j=>{let T=0;return j.map(z=>(T+=z[1],[z[0],T]))};return o&&[Ns.month,Ns.quarter].includes(r)?D.map((j,T)=>({data:s&&e==="bar"?g(Object.entries(j)):Object.entries(j).sort((y,z)=>{const A=new Date(y[0]),h=new Date(z[0]);return A.getFullYear()-h.getFullYear()}),type:e==="area"?"line":e==="stack"?"bar":e,name:n[T],label:{show:M.show,position:M.position},emphasis:{focus:"series"},...e==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...e==="bar"?{barWidth:`${(a==null?void 0:a.barWidth)||0}%`,showBackground:u==null?void 0:u.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:a==null?void 0:a.barRadius}}:{},...e==="stack"?{stack:"total"}:{}})):N.map((j,T)=>({data:s&&e==="bar"?g(Object.entries(j)):Object.entries(j),type:e==="area"?"line":e==="stack"?"bar":e,name:n[T],label:{show:M.show,position:M.position},emphasis:{focus:"series"},...e==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...e==="bar"?{barWidth:`${(a==null?void 0:a.barWidth)||0}%`,showBackground:u==null?void 0:u.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:a==null?void 0:a.barRadius}}:{},...e==="stack"?{stack:"total"}:{}}))},tP=({data:t,timeStampKey:i})=>!Array.isArray(t)||t.length<1?!1:t.every(e=>{const n=new Date(e[i]);return!Number.isNaN(n.getTime())}),ele=t=>{const i=t.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&i.right<=(window.innerWidth||document.documentElement.clientWidth)},dw=(t,i)=>(t==null?void 0:t.length)!==(i==null?void 0:i.length)?!1:t==null?void 0:t.every(e=>i==null?void 0:i.includes(e)),dl=t=>{const i=new Date(t);return i instanceof Date&&!Number.isNaN(i.getTime())?i:null},iP=({metric:t,globalFilters:i={tableName:"",filters:[]},rlsFilters:e,clientId:n,tenancyLevel:r,isInternalApp:M,appFilters:a,setCrossDashboardFilters:u,crossDashboardFilters:o,metricFilterOptions:s,isAllClient:N})=>{var Dt,ve,pt,Ct,dt,Zt,$t,Mt,It;const D=De.useRef(null),[g,l]=De.useState({limit:10,offset:0}),[j,T]=De.useState(0),[y,z]=De.useState((t==null?void 0:t.rlsConditions)||[]),[A,h]=De.useState(!1),[x,O]=De.useState(),[d,E]=De.useState([]),[C,k]=De.useState(!0),[Q,S]=De.useState([]),[b,Y]=De.useState([]),[m,R]=De.useState(!1),[P,W]=De.useState([]),[B,X]=De.useState(null),[F,G]=De.useState(t.chartOptions),J=De.useMemo(()=>{const We={};if(e!=null&&e.values)for(const Tt in e.values){const He=`${Tt}_variable`;We[He]=e.values[Tt]}return We},[e==null?void 0:e.values]),{data:ee,isLoading:q}=Fge({isAllClient:N,id:t.id,drillFilters:(Dt=t==null?void 0:t.drillDownSettings)!=null&&Dt.isEnableGroupBy?Q:[],clientId:n,tenancyLevel:r,rlsConditions:P,globalFilters:i,filterValues:J,limit:(ve=F==null?void 0:F.tableSettings)!=null&&ve.isServerSidePagination&&(F==null?void 0:F.chartType)===Se.table?Math.min(g.limit,1e3):void 0,offset:(pt=F==null?void 0:F.tableSettings)!=null&&pt.isServerSidePagination&&(F==null?void 0:F.chartType)===Se.table?g.offset:void 0});De.useEffect(()=>{var We;z(((We=t==null?void 0:t.rlsConditions)==null?void 0:We.map(Tt=>{var jt,lt,kt,ii;let He=Tt;if(s){const gi=Kge(He,s);gi&&(He={...He,value:gi.value?He.datatype==="string"?[gi.value]:gi.value:He.value,options:He.datatype==="date"?gi.options.map(ht=>({...ht,startDate:dl(ht.fromDate)??ht.startDate,endDate:dl(ht.toDate)??ht.endDate,minDate:dl(ht.minDate)??void 0,maxDate:dl(ht.maxDate)??void 0,fromDate:dl(ht.fromDate)??void 0,toDate:dl(ht.toDate)??void 0})):gi.options,variableOptions:He.datatype==="date"?gi.options.map(ht=>({startDate:dl(ht.fromDate)??ht.startDate,endDate:dl(ht.toDate)??ht.endDate,value:ht.name,label:ht.name})):gi.options.map(ht=>({value:ht,label:ht})),selectedVariableValue:gi.value?He.datatype==="string"?{value:gi.value,label:gi.value}:{startDate:dl((lt=(jt=gi.options)==null?void 0:jt.find(ht=>ht.name===gi.value))==null?void 0:lt.fromDate),endDate:dl((ii=(kt=gi.options)==null?void 0:kt.find(ht=>ht.name===gi.value))==null?void 0:ii.toDate),value:gi.value,label:gi.value}:He.selectedVariableValue})}return r==="DATABASE"?{...He,tableName:`${n}.${Tt.tableName.split(".").slice(1).join(".")}`}:He}))||[])},[t==null?void 0:t.rlsConditions,s,r]);const ie=De.useMemo(()=>{var We,Tt;return!!y.length&&((Tt=(We=y.find(He=>He.isAddOnMetrics&&He.datatype==="date"&&He.columnName===F.xAxis))==null?void 0:We.options)==null?void 0:Tt.every(He=>He.format))},[y,F]),re=We=>We.includes("____")?We.split("____")[1]:We.includes("^^^^^^")?We.split("^^^^^^")[1]:We,le=De.useMemo(()=>{var We,Tt,He,jt;return re(((jt=(We=t==null?void 0:t.datasetMetricSettings)==null?void 0:We.selectedDimensions)==null?void 0:jt[Q.length<((He=(Tt=t==null?void 0:t.datasetMetricSettings)==null?void 0:Tt.selectedDimensions)==null?void 0:He.length)?Q.length:0])||"")},[t==null?void 0:t.datasetMetricSettings,Q]);De.useEffect(()=>{var He,jt;const Tt=((He=t==null?void 0:t.drillDownSettings)==null?void 0:He.isEnableGroupBy)?y||[]:y!=null&&y.length?[...y,...o||[]]:[...o||[]];(jt=Tt==null?void 0:Tt.filter(lt=>lt.isAddOnMetrics))!=null&&jt.length?W(Tt.filter(lt=>lt.isAddOnMetrics).map(lt=>{var kt,ii,gi,ht,Et,ai;return M?{...lt,dimensionColumn:F.xAxis||"",measureColumn:((kt=F.yAxisList)==null?void 0:kt[0])||""}:{...lt,dimensionColumn:F.xAxis||"",measureColumn:((ii=F.yAxisList)==null?void 0:ii[0])||"",value:lt.isAppFilter?lt.datatype==="date"?(gi=lt==null?void 0:lt.options)==null?void 0:gi.find(Dn=>{var Tr;return Dn.name===((Tr=a==null?void 0:a.values)==null?void 0:Tr[lt.name])}):lt.datatype==="string"&&typeof((ht=a==null?void 0:a.values)==null?void 0:ht[lt.name])=="string"?[(Et=a==null?void 0:a.values)==null?void 0:Et[lt.name]]:(ai=a==null?void 0:a.values)==null?void 0:ai[lt.name]:lt.value}})):W([])},[y,a,o,(Ct=t==null?void 0:t.drillDownSettings)==null?void 0:Ct.isEnableGroupBy,r,M,n]);const Ne=De.useMemo(()=>{var We,Tt,He,jt,lt;return(F==null?void 0:F.chartType)===Se.singleValue&&!!((We=F==null?void 0:F.customSettings)!=null&&We.comparisonValueShow)&&!!((Tt=F==null?void 0:F.customSettings)!=null&&Tt.comparisonTimeColumn)&&!!((He=F==null?void 0:F.customSettings)!=null&&He.comparisonTimeGrain)&&!!((jt=F==null?void 0:F.customSettings)!=null&&jt.comparisonTimePeriod)&&!!((lt=F==null?void 0:F.customSettings)!=null&<.comparisonTableName)&&!!(F!=null&&F.singleValue)},[F]);De.useEffect(()=>{var jt;const We=ee,Tt=We!=null&&We.data&&typeof We.data=="string"?JSON.parse(We.data):[];if((F==null?void 0:F.chartType)===Se.table&&T((We==null?void 0:We.totalRecords)||0),ie){const lt=y.find(kt=>kt.isAddOnMetrics&&kt.datatype==="date");if(lt){const kt=Vge({data:Tt||[],dimensionColumn:lt.columnName,measureColumn:((jt=F.yAxisList)==null?void 0:jt[0])||"",option:lt.options.find(ii=>ii.name===lt.value),timeColumn:F.xAxis||lt.columnName});E(kt)}else E(Tt??[])}else E(Tt??[]);const He=We==null?void 0:We.metaData;Y((He==null?void 0:He.groupbyColumnList)||[])},[ee,ie,Ne]),De.useEffect(()=>{var We,Tt,He,jt,lt,kt,ii,gi;if((We=t==null?void 0:t.drillDownSettings)!=null&&We.isEnableGroupBy&&d.length){const ht=(jt=(He=(Tt=t==null?void 0:t.drillDownSettings)==null?void 0:Tt.drilldownChartSettings)==null?void 0:He.find(Et=>Et.name===le))==null?void 0:jt.chartSettings;ht&&((kt=(lt=t==null?void 0:t.datasetMetricSettings)==null?void 0:lt.selectedDimensions)!=null&&kt.length)&&((gi=(ii=t==null?void 0:t.datasetMetricSettings)==null?void 0:ii.selectedDimensions)==null?void 0:gi.length)>(Q==null?void 0:Q.length)?G(ht):G(Et=>{var ai,Dn,Tr,eM;return{...Et,xAxis:le,yAxisList:F.chartType==="table"?[le,...((Dn=(ai=t==null?void 0:t.datasetMetricSettings)==null?void 0:ai.metrics)==null?void 0:Dn.map(dr=>{var Or;return(Or=dr==null?void 0:dr.as)==null?void 0:Or.replace(/["`]+/g,"")}))||[]]:(eM=(Tr=t==null?void 0:t.datasetMetricSettings)==null?void 0:Tr.metrics)==null?void 0:eM.map(dr=>{var Or;return(Or=dr==null?void 0:dr.as)==null?void 0:Or.replace(/["`]+/g,"")})}})}},[d,t.drillDownSettings,t==null?void 0:t.datasetMetricSettings,Q]),De.useEffect(()=>{q&&k(!0),!d.length&&!q&&setTimeout(()=>{k(!1)},5e3)},[q,d]);const se=De.useCallback((We,Tt,He,jt)=>{z(He?lt=>lt.map(kt=>{var ii;return kt.name===We?{...kt,value:Tt,options:kt.options.map(gi=>Tt===gi.name?{...gi,...He}:gi),variableOptions:(ii=kt.variableOptions)==null?void 0:ii.map(gi=>gi.value===Tt?{...gi,...He}:gi),selectedVariableValue:{value:Tt,label:Tt,endDate:He.endDate,startDate:He.startDate}}:kt}):jt?lt=>lt.map(kt=>kt.name===We?{...kt,value:jt.map(ii=>ii.value)}:kt):lt=>lt.map(kt=>kt.name===We?{...kt,value:Tt,selectedVariableValue:{value:Tt,label:Tt}}:kt))},[]),Ie=De.useCallback(We=>{ie||(We.event&&We.event.event.preventDefault(),O(We))},[y]),{getUnderlyingData:Oe}=bge({clientName:n,tenancyType:r,values:J,companyId:t==null?void 0:t.companyId,query:t==null?void 0:t.query,workspaceId:(dt=t==null?void 0:t.companyIntegration)==null?void 0:dt.workspaceId,metricId:t==null?void 0:t.id}),ye=De.useMemo(()=>Array.isArray(d)&&d.length&&(x!=null&&x.name)?d.map(We=>{const Tt=Object.entries(We).find(([,He])=>He===x.name);return Tt==null?void 0:Tt[0]}).filter(We=>We)[0]:"",[d,x==null?void 0:x.name]),$e=De.useCallback((We,Tt)=>{var kt,ii,gi,ht,Et,ai,Dn,Tr,eM;const He=re(((ii=(kt=t==null?void 0:t.datasetMetricSettings)==null?void 0:kt.selectedDimensions)==null?void 0:ii[Q==null?void 0:Q.length])||""),jt=(Et=(ht=(gi=t==null?void 0:t.datasetMetricSettings)==null?void 0:gi.configuration)==null?void 0:ht.dimensions)==null?void 0:Et.find(dr=>dr.alias===He),lt=(ai=jt==null?void 0:jt.parentAlias)==null?void 0:ai.replace("_",".",1);if(He||((Dn=t==null?void 0:t.drillDownSettings)==null?void 0:Dn.drillType)==="table"){const dr=((Tr=t==null?void 0:t.datasetMetricSettings)==null?void 0:Tr.selectedDimensions.length)>Q.length;S(Or=>{var ha;return((ha=t==null?void 0:t.drillDownSettings)==null?void 0:ha.drillType)==="table"?Tt||[]:dr?[...Or,{columnName:He,value:We==null?void 0:We.name}]:[]}),(eM=t==null?void 0:t.drillDownSettings)!=null&&eM.isEnableCrossFilter&&(u==null||u(Or=>dr?[...Or,{columnName:jt==null?void 0:jt.columnName,datatype:"string",isAddOnMetrics:!0,name:"cross-filter",options:[We==null?void 0:We.name],tableName:r==="DATABASE"?`${n}.${lt==null?void 0:lt.split(".").slice(1).join(".")}`:lt,value:[We==null?void 0:We.name]}]:[]))}else u==null||u([]),S([])},[d,t==null?void 0:t.datasetMetricSettings,t==null?void 0:t.drillDownSettings]),Ve=De.useCallback(We=>{var Tt;if(We>0&&Q.length){const He=Q.slice(0,-1);S(He),(Tt=t==null?void 0:t.drillDownSettings)!=null&&Tt.isEnableCrossFilter&&(u==null||u(jt=>jt.slice(0,-1)))}else u==null||u([]),S([])},[Q]);De.useEffect(()=>{d!=null&&d.length&&b.length?R(!0):R(!1)},[d,b.length,t==null?void 0:t.integrationName,t.query]);const{metricFilters:Ee,leftPositionedMetricFilters:Te,rightPositionedMetricFilters:fe}=De.useMemo(()=>{const We=y.filter(lt=>!lt.isAppFilter),Tt=We.filter(lt=>lt.isAddOnMetrics),He=[],jt=[];return Tt.forEach(lt=>{lt.position==="top-right"?jt.push(lt):He.push(lt)}),{metricFilters:We,leftPositionedMetricFilters:He,rightPositionedMetricFilters:jt}},[y]),Qe=De.useMemo(()=>{var Tt;const We=((Tt=t==null?void 0:t.dataSecuritySettings)==null?void 0:Tt.csvColumns)||[];return d!=null&&d.length?d.map(He=>{const jt={};for(const lt in He)We!=null&&We.includes(lt)||(jt[lt]=He[lt]);return jt}):[]},[d,t==null?void 0:t.dataSecuritySettings]);De.useEffect(()=>{var We,Tt;G(t==null?void 0:t.chartOptions),l({limit:parseInt(((Tt=(We=t==null?void 0:t.chartOptions)==null?void 0:We.tableSettings)==null?void 0:Tt.defaultRowSize)||"10",10),offset:0})},[t]),De.useEffect(()=>{var We,Tt,He,jt,lt;F.isDynamicSeries&&((We=F.seriesOptions)!=null&&We.includes("ungrouped")?F.ungroupedAlias?X((Tt=F.seriesOptions)==null?void 0:Tt.map(kt=>({value:kt,label:F.ungroupedAlias}))):X((He=F.seriesOptions)==null?void 0:He.map(kt=>({value:kt,label:kt}))):F.ungroupedAlias?X([{value:"ungrouped",label:F.ungroupedAlias},...((jt=F.seriesOptions)==null?void 0:jt.map(kt=>({value:kt,label:kt})))??[]]):X([{value:"ungrouped",label:"ungrouped"},...((lt=F.seriesOptions)==null?void 0:lt.map(kt=>({value:kt,label:kt})))??[]]))},[F.seriesOptions,F.isDynamicSeries,F.ungroupedAlias]);const[ot,rt]=De.useState(!1),ke=We=>{We.key==="Control"&&rt(!0)},et=We=>{We.key==="Control"&&rt(!1)};De.useEffect(()=>{var We,Tt;return(Tt=(We=F.customSettings)==null?void 0:We.chartZoom)!=null&&Tt.isZoomEnabled&&(window.addEventListener("keydown",ke),window.addEventListener("keyup",et)),()=>{window.removeEventListener("keydown",ke),window.removeEventListener("keyup",et)}},[]);const xe=De.useMemo(()=>{let We=!1;if(d!=null&&d.length){const Tt=F.singleValue;We=d[0][Tt]===null&&F.chartType==="singleValue"}return We},[d==null?void 0:d.length,F.singleValue,F.chartType==="singleValue"]);return{onDrillLevelClick:Ve,onDrillDown:$e,handleChartClick:Ie,dataDb:d,getUnderlyingData:Oe,onChangeFilterValue:se,isShowChartPopup:A,setShowChartPopup:h,columnName:ye,chartParams:x,isQueryLoading:q||C,setLoading:k,isSingleValueNull:xe,dynamicOptions:B,chartSettings:F,setChartSettings:G,isEnableZoom:ot,filterValues:J,containerRef:D,drilledLevel:Q.length,dimensions:(($t=(Zt=t==null?void 0:t.datasetMetricSettings)==null?void 0:Zt.selectedDimensions)==null?void 0:$t.map(We=>re(We||"none")))||[],rlsConditions:y,setTableLimit:l,isEnableNextBtn:j>(g==null?void 0:g.limit)+(g==null?void 0:g.offset),isEnablePrevBtn:(g==null?void 0:g.offset)!==0,paginationInfo:{limit:g==null?void 0:g.limit,offset:g==null?void 0:g.offset,totalRecords:j},onChangePage:(We,Tt)=>{l(Tt?{limit:Tt,offset:0}:He=>({limit:He.limit,offset:We?He.offset>He.limit?He.offset-He.limit:0:He.offset+He.limit}))},isExternalChart:((Mt=F==null?void 0:F.tableSettings)==null?void 0:Mt.isServerSidePagination)&&(F==null?void 0:F.chartType)===Se.table,isEnablePivotTable:m,groupByList:b,hasNumberKeys:!0,isEnableGauge:!0,updateFilter:We=>{z(Tt=>Tt.map(He=>He.name===We.name&&He.datatype===We.datatype&&He.tableName===We.tableName&&He.columnName===We.columnName?{...He,isAddOnMetrics:!He.isAddOnMetrics}:He))},metricFilters:Ee,leftPositionedMetricFilters:Te,rightPositionedMetricFilters:fe,drillFilters:Q,drillType:(It=t==null?void 0:t.drillDownSettings)==null?void 0:It.drillType,tableResultsDownloadData:Qe,appliedMetricFilters:P}},tle=({dashboardId:t,clientId:i,metricId:e,onSuccess:n})=>{const r=qx(),{mutateAsync:M,isLoading:a}=Ige();return{handleArchiveMetric:De.useCallback(async()=>{!e||!i||await M({id:e,clientId:i},{onSuccess:o=>{o!=null&&o.insert_clientDeletedMetrics_one&&(r.setQueryData([F6,{dashboardId:t}],s=>{var D;const N=(D=s==null?void 0:s.externalMetrics)==null?void 0:D.filter(g=>g.externalMetricId!==e);return{...s,externalMetrics:N}}),n())}})},[M,e,i]),isLoading:a}},ile=({token:t,metricId:i})=>{const[e,n]=De.useState(!0),[r,M]=De.useState({width:"200px",variant:"floating",radius:"6px"}),{data:a,isLoading:u}=kge(t,i),{externalMetric:o,sharingSettingsId:s,adminTheme:N,params:D,companyId:g,clientId:l,errorMsg:j}=De.useMemo(()=>{var h;const A=a;return{externalMetric:A==null?void 0:A.externalMetric,adminTheme:A==null?void 0:A.adminTheme,sharingSettingsId:A==null?void 0:A.sharingSettingsId,errorMsg:(h=A==null?void 0:A.error)==null?void 0:h.message,params:A==null?void 0:A.params,companyId:A==null?void 0:A.companyId,clientId:A==null?void 0:A.clientId}},[a]),T=De.useMemo(()=>{var A;return N?(A=N.chart.palettes.find(h=>h.name===N.chart.selected))==null?void 0:A.colors:null},[N]);De.useEffect(()=>{if(N!=null&&N.dashboard.selectBoxSize)switch(N==null?void 0:N.dashboard.selectBoxSize){case"small":M(A=>({...A,width:"130px"}));break;case"medium":M(A=>({...A,width:"180px"}));break;case"large":M(A=>({...A,width:"250px"}));break;default:M(A=>({...A,width:"200px"}))}N!=null&&N.dashboard.selectBoxVariant&&M(A=>({...A,variant:N.dashboard.selectBoxVariant})),N!=null&&N.dashboard.selectBoxBorderRadius&&M(A=>({...A,radius:N.dashboard.selectBoxBorderRadius}))},[N==null?void 0:N.dashboard]);const{rlsSettings:y,tenancyLevel:z}=De.useMemo(()=>{var h;if(!D)return{rlsSettings:void 0,tenancyLevel:"TABLE"};const A=JSON.parse(D);return{rlsSettings:(h=A.rlsSettings)==null?void 0:h.find(x=>x.metricId===i),tenancyLevel:A.companyTenancyType||"TABLE"}},[D,i]);return X6(N),De.useEffect(()=>{u&&n(!0),(o||j)&&n(!1)},[u,o,j]),{externalMetric:o,sharingSettingsId:s,adminColors:T,companyId:g,clientId:l,rlsSettings:y,tenancyLevel:z,isLoading:e,errorMsg:j,dropdownTheme:r}};var zd={},Ad=a1;if(process.env.NODE_ENV==="production")zd.createRoot=Ad.createRoot,zd.hydrateRoot=Ad.hydrateRoot;else{var Mp=Ad.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;zd.createRoot=function(t,i){Mp.usingClientEntryPoint=!0;try{return Ad.createRoot(t,i)}finally{Mp.usingClientEntryPoint=!1}},zd.hydrateRoot=function(t,i,e){Mp.usingClientEntryPoint=!0;try{return Ad.hydrateRoot(t,i,e)}finally{Mp.usingClientEntryPoint=!1}}}const nle=Z6({active:null,over:null,DragPreviewCreateRoot:null,draggables:[],droppables:[]}),nP=()=>{const[t,i]=fw(nle);return{dndState:t,setActive:a=>{i(u=>({...u,active:a}))},setOver:a=>{i(u=>({...u,over:a}))},setDraggables:a=>{i(u=>{var N;const o=(N=u.draggables)==null?void 0:N.findIndex(D=>(D==null?void 0:D.identifier.id)===(a==null?void 0:a.identifier.id));if(o===-1)return{...u,draggables:[...u.draggables,a]};const s=[...u.draggables];return s[o]=a,{...u,draggables:s}})},setDropables:a=>{i(u=>{var N;const o=(N=u.droppables)==null?void 0:N.findIndex(D=>(D==null?void 0:D.identifier.id)===(a==null?void 0:a.identifier.id));if(o===-1)return{...u,droppables:[...u.droppables,a]};const s=[...u.droppables];return s[o]=a,{...u,droppables:s}})},setDndState:i}},rle=({identifier:t,data:i,modifiers:e,events:n,CustomDragPreview:r})=>{const{dndState:M,setActive:a,setDndState:u,setDraggables:o}=nP(),[s,N]=De.useState(!1),[D,g]=De.useState(!0),[l,j]=De.useState(null),T=De.useRef(null),y=De.useRef(null),z={"data-type":t.type||t.id,id:`draggable-${t.id}`,role:"button",tabindex:"0",draggable:D?"true":"false","aria-grabbed":"false"},A=x=>{Object.entries(z).forEach(([O,d])=>{x.setAttribute(O,d)})},h=()=>{var x;y.current&&((x=M.DragPreviewCreateRoot)==null||x.render(r))};return De.useEffect(()=>{if(r&&(y.current=document.getElementById("CustomDragPreviewContainer"),y.current===null)){y.current=document.createElement("div"),y.current.setAttribute("id","CustomDragPreviewContainer"),document.body.appendChild(y.current);const x=zd.createRoot(y.current);u(O=>({...O,DragPreviewCreateRoot:x}))}},[]),De.useEffect(()=>{if(T.current){const x=T.current.getBoundingClientRect();j(x),o({identifier:t,data:i,modifiers:e,DragNodeRef:T,rect:l,events:n,isDragging:s,isEnableDrag:D})}},[T.current,JSON.stringify(t),JSON.stringify(i),JSON.stringify(e),JSON.stringify(n),JSON.stringify(s)]),De.useEffect(()=>{const x=T.current;if(!x)return;A(x);const O=E=>{var C,k,Q;if(N(!0),a({identifier:t,data:i,modifiers:e,DragNodeRef:T,rect:l,events:n,isDragging:s,isEnableDrag:D}),x.setAttribute("aria-grabbed","true"),(C=E.dataTransfer)==null||C.setData("text/plain",JSON.stringify({data:i})),(k=n==null?void 0:n.onDragStart)==null||k.call(n,E,M),y.current){const S=y.current.getBoundingClientRect();(Q=E.dataTransfer)==null||Q.setDragImage(y.current,S.width/2,S.height/2)}},d=E=>{var C;x.setAttribute("aria-grabbed","false"),N(!1),a(null),(C=n==null?void 0:n.onDragEnd)==null||C.call(n,E,M)};return x.addEventListener("mousedown",()=>{r&&h()}),x.addEventListener("dragstart",O),x.addEventListener("dragend",d),()=>{x.removeEventListener("dragstart",O),x.removeEventListener("dragend",d)}},[T.current,JSON.stringify(t),JSON.stringify(i),M.DragPreviewCreateRoot]),De.useEffect(()=>{const x=T.current;x&&x.setAttribute("draggable",D?"true":"false")},[D]),De.useEffect(()=>{var O,d,E;let x=[];return s&&(a({identifier:t,data:i,modifiers:e,DragNodeRef:T,rect:l,events:n,isDragging:s,isEnableDrag:D}),(O=e==null?void 0:e.highlightDrop)!=null&&O.onDrag&&(x=((d=M.droppables)==null?void 0:d.filter(C=>((C==null?void 0:C.identifier.accepts)??[]).includes(t.type??"")&&(C==null?void 0:C.isEnableDrop)).map(C=>C==null?void 0:C.setDropNodeRef.current))??[],(E=e==null?void 0:e.highlightDrop)!=null&&E.onDrag&&x.forEach(C=>{var k;C.classList.add(((k=e==null?void 0:e.highlightDrop)==null?void 0:k.highlightClass)||"dnd-droppable-highlight")}))),()=>{x.forEach(C=>{var k;C.classList.remove(((k=e==null?void 0:e.highlightDrop)==null?void 0:k.highlightClass)||"dnd-droppable-highlight")})}},[s]),{isDragging:s,isEnableDrag:D,setIsEnableDrag:g,DragNodeRef:T}},rP=({identifier:t,events:i,modifiers:e})=>{var x;const{dndState:n,setOver:r,setDropables:M}=nP(),[a,u]=De.useState(null),[o,s]=De.useState({isDragOver:!1,isDrop:!1}),[N,D]=De.useState({before:-1,after:-1}),[g,l]=De.useState(!0),j=De.useRef(null),T={"data-type":((x=t.accepts)==null?void 0:x.join("-"))??"",id:`droppable-${t.id}`,droppable:g?"true":"false"},y=O=>{Object.entries(T).forEach(([d,E])=>{O.setAttribute(d,E)})},z=(O,d,E)=>{const C=[...E];O=O===-1?C.length-1:O;const[k]=C.splice(O,1);return d===-1?C.push(k):C.splice(d,0,k),C},A=(O,d,E)=>[...O.querySelectorAll('[draggable="true"]:not([aria-grabbed="true"])')].reduce((Q,S,b)=>{const Y=S.getBoundingClientRect(),m=d-Y[E==="horizontal"?"left":"top"]-Y[E==="horizontal"?"width":"height"]/2;return m<0&&m>Q.offset?{offset:m,element:S,index:b}:Q},{offset:Number.NEGATIVE_INFINITY,element:null,index:-1}),h=(O,d,E)=>{const C=[...O.querySelectorAll('[draggable="true"]')],k=O.querySelector('[aria-grabbed="true"]'),{width:Q,height:S}=E,b=(m,R,P)=>{const W=m.x-R/2,B=m.y-P/2;return[{x:W,y:B},{x:W+R,y:B},{x:W,y:B+P},{x:W+R,y:B+P}]};return C.reduce((m,R,P)=>{const W=R.getBoundingClientRect(),B=[{x:W.left,y:W.top},{x:W.left+W.width,y:W.top},{x:W.left,y:W.top+W.height},{x:W.left+W.width,y:W.top+W.height}],X=b(d,Q,S);let F=Number.POSITIVE_INFINITY,G=P,J=Number.POSITIVE_INFINITY,ee=Number.POSITIVE_INFINITY;return B.forEach((q,ie)=>{X.forEach(re=>{let le=Number.POSITIVE_INFINITY;J=Math.sqrt((q.x-re.x)**2+(q.y-re.y)**2),ee=Math.sqrt((q.x-d.x)**2+(q.y-d.y)**2),le=Math.min(J,ee),le<F&&(F=le,ie===1||ie===3?k!==R&&(G=P+1):G=P)})}),F<m.minDistance?{minDistance:F,element:R,index:G,closestBasedOnCorner:J,closestBasedonCursor:ee}:m},{minDistance:Number.POSITIVE_INFINITY,element:null,index:-1,closestBasedOnCorner:0,closestBasedonCursor:0})};return De.useEffect(()=>{const O=j.current;if(!O)return;const d=O.getBoundingClientRect();u(d),M({identifier:t,setDropNodeRef:j,events:i,modifiers:e,rect:a,isEnableDrop:g,dragStatus:o})},[j.current,g,o.isDragOver,o.isDrop,JSON.stringify(t),JSON.stringify(i),JSON.stringify(e)]),De.useEffect(()=>{var S,b;const O=j.current;if(y(O),!O||!g||(S=t.accepts)!=null&&S.length&&!t.accepts.includes(((b=n.active)==null?void 0:b.identifier.type)??""))return;const{sorting:d}=e||{},E=Y=>{var m;Y.preventDefault(),r({identifier:t,setDropNodeRef:j,events:i,modifiers:e,rect:a,isEnableDrop:g,dragStatus:o}),(m=i==null?void 0:i.onDragEnter)==null||m.call(i,Y,n)},C=Y=>{var m,R,P,W,B,X,F,G,J,ee,q,ie;if(Y.preventDefault(),(P=(R=(m=n.active)==null?void 0:m.modifiers)==null?void 0:R.highlightDrop)!=null&&P.onDragOver&&j.current.classList.add(((X=(B=(W=n.active)==null?void 0:W.modifiers)==null?void 0:B.highlightDrop)==null?void 0:X.highlightClass)||"dnd-droppable-highlight"),o.isDragOver||s(re=>({...re,isDragOver:!0})),n.over===null&&r({identifier:t,setDropNodeRef:j,events:i,modifiers:e,rect:a,isEnableDrop:g,dragStatus:o}),d!=null&&d.isEnabled&&((F=d.list)!=null&&F.length)){const re=(ee=(J=(G=n.active)==null?void 0:G.DragNodeRef)==null?void 0:J.current)==null?void 0:ee.getAttribute("data-dbn-sorting-index");let le=null;if((d.sortingType==="vertical"||d.sortingType==="horizontal")&&(le=A(O,(d==null?void 0:d.sortingType)==="horizontal"?Y.clientX:Y.clientY,d==null?void 0:d.sortingType)),d.sortingType==="both-axis"){const se=(q=document.getElementById("CustomDragPreviewContainer"))==null?void 0:q.getBoundingClientRect();le=h(O,{x:Y.clientX,y:Y.clientY},{width:(se==null?void 0:se.width)??0,height:(se==null?void 0:se.height)??0})}const Ne={before:parseInt(re??-1,10),after:le.index};(Ne.before!==N.before||Ne.after!==N.after)&&D(Ne)}(ie=i==null?void 0:i.onDragOver)==null||ie.call(i,Y,n)},k=Y=>{var m,R,P,W,B,X,F;Y.preventDefault(),(P=(R=(m=n.active)==null?void 0:m.modifiers)==null?void 0:R.highlightDrop)!=null&&P.onDragOver&&j.current.classList.remove(((X=(B=(W=n.active)==null?void 0:W.modifiers)==null?void 0:B.highlightDrop)==null?void 0:X.highlightClass)||"dnd-droppable-highlight"),s(G=>({...G,isDragOver:!1})),(F=i==null?void 0:i.onDragLeave)==null||F.call(i,Y,n),r(null)},Q=Y=>{var B,X,F,G,J,ee,q,ie,re,le;Y.preventDefault();const m=j.current.contains((X=(B=n.active)==null?void 0:B.DragNodeRef)==null?void 0:X.current);let R={...n};(J=(G=(F=n.active)==null?void 0:F.modifiers)==null?void 0:G.highlightDrop)!=null&&J.onDragOver&&j.current.classList.remove(((ie=(q=(ee=n.active)==null?void 0:ee.modifiers)==null?void 0:q.highlightDrop)==null?void 0:ie.highlightClass)||"dnd-droppable-highlight");let{before:P,after:W}=N;if(d!=null&&d.isEnabled&&((re=d.list)!=null&&re.length)){let Ne=[...d.list];m?Ne=z(P,W,Ne):P=-1,R={...n,sorting:{sortedList:Ne,isSelfDrop:m,ArrayElementSwap:z,sortingIndexes:{before:P,after:W}}},d.isEnabledAutoSort&&m&&d.setList(Ne)}s(Ne=>({...Ne,isDrop:!0})),(le=i==null?void 0:i.onDrop)==null||le.call(i,Y,R),r(null)};return O.addEventListener("dragenter",E),O.addEventListener("dragover",C),O.addEventListener("dragleave",k),O.addEventListener("drop",Q),()=>{O.removeEventListener("dragenter",E),O.removeEventListener("dragover",C),O.removeEventListener("dragleave",k),O.removeEventListener("drop",Q)}},[j.current,t,g,e,i,N]),De.useEffect(()=>{const O=j.current;O&&O.setAttribute("droppable",g?"true":"false")},[g]),{dragStatus:o,isEnableDrop:g,setIsEnableDrop:l,setDropNodeRef:j}},ap=Ye.memo(({filter:t,onChange:i,selectedOption:e,autoSelected:n=!0,workspaceId:r,filterClause:M,isDisableLabel:a,customTable:u,...o})=>{const[s,N]=De.useState([]),{fetchColumnValues:D}=B6();return De.useEffect(()=>{o.isDisabled||D({wId:r,tableName:u?"":t.tableName,columnName:t.columnName,filter:(M==null?void 0:M.filter(g=>Array.isArray(g.value)?g.value.length&&g.columnName:g.columnName&&g.value))||[],customTable:u},{onSuccess:g=>{if(!(g!=null&&g.data)||!Array.isArray(g.data))return;const l=[];g.data.forEach(T=>{T&&l.push({label:T.label,value:T.value})}),N(l);const j=l==null?void 0:l.find(T=>T.value===(e==null?void 0:e.value));M!=null&&M.length&&e&&i(j||(l==null?void 0:l[0])||{value:"",label:""})}})},[t.tableName,t.columnName,M]),De.useEffect(()=>{s.length&&s[0]&&n&&i(s[0])},[s.length,s[0],n,JSON.stringify(M||[])]),v.jsx(un,{onChange:i,selectedOption:t.defaultValue?{label:t.defaultValue,value:t.defaultValue}:e,isDisabled:!!t.defaultValue||o.isDisabled,options:s,label:a?void 0:t.columnName,...o})}),fd=Ye.memo(({filter:t,autoSelected:i,label:e,workspaceId:n,filterClause:r,onChange:M,selectedOption:a,isDisabled:u,isDisablelabel:o,customTable:s,radius:N,...D})=>{const[g,l]=De.useState([]),{fetchColumnValues:j}=B6();return De.useEffect(()=>{u||j({wId:n,tableName:s?"":t.tableName,columnName:t.columnName,filter:(r==null?void 0:r.filter(T=>Array.isArray(T.value)?T.value.length&&T.columnName:T.columnName&&T.value))||[],customTable:s},{onSuccess:T=>{if(!(T!=null&&T.data)||!Array.isArray(T.data))return;const y=[];T.data.forEach(A=>{A&&y.push({label:A.label,value:A.value})}),l(y);const z=a==null?void 0:a.filter(A=>y.map(h=>h.value).includes(A.value));r!=null&&r.length&&(a!=null&&a.length)&&M(z!=null&&z.length?z:y!=null&&y[0]?[y==null?void 0:y[0]]:[])}})},[t.tableName,t.columnName,JSON.stringify(r||[])]),De.useEffect(()=>{g.length&&g[0]&&i&&M([g[0]])},[g.length,g[0],i,t.columnName]),v.jsx(fl,{onChange:M,selectedOption:t.defaultValue?[{label:t.defaultValue,value:t.defaultValue}]:a,isDisabled:!!t.defaultValue||u,options:g,radius:N,label:o?void 0:e||t.columnName,...D})}),WZe={fullscreen:"_fullscreen_16ns9_1"},qZe={button:"_button_jnm42_1",menu:"_menu_jnm42_7",menuContainer:"_menuContainer_jnm42_13",buttonText:"_buttonText_jnm42_19",buttonIcon:"_buttonIcon_jnm42_25",filterName:"_filterName_jnm42_31",filterDropdown:"_filterDropdown_jnm42_37"},Mle=t=>{const i=document.documentElement;t.colors&&Object.entries(t.colors).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-color-${e}`,`${n}`)}),t.border&&Object.entries(t.border).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-border-${e}`,`${n}`)}),t.shadow&&Object.entries(t.shadow).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-shadow-${e}`,`${n}`)}),t.typography&&Object.entries(t.typography).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-typography-${e}`,`${n}`)}),t.breakpoint&&Object.entries(t.breakpoint).forEach(([e,n])=>{e&&n&&i.style.setProperty(`--dbn-breakpoint-${e}`,`${n}`)})},ale=["rgb(56, 72, 211)","rgb(251, 208, 98)","rgb(234 88 12)","rgb(245 158 11)","rgb(234 179 8)","rgb(34 197 94)","rgb(4 120 87)","rgb(15 118 110)","rgb(8 145 178)","rgb(219 234 254)","rgb(30 58 138)","rgb(139 92 246)"],ule=({data:t,measure:i,singleValue:e,step:n,xAxis:r,yAxisList:M,seriesField:a,isTimeSeries:u,selectedFormat:o,fillXAxis:s,isDynamicXaxis:N,isCumulativeBar:D,chartType:g,seriesType:l,isGroupXAxis:j})=>{const T=Array.isArray(t)?N||j?[...new Set(t==null?void 0:t.map(k=>r&&k[r]))]:t==null?void 0:t.map(k=>r&&k[r]):[];let y=M==null?void 0:M.map((k,Q)=>({label:k,data:Array.isArray(t)?N||j?T==null?void 0:T.map(S=>t.filter(Y=>Y[r||""]===S).reduce((Y,m)=>Y+Number(m[M[Q]])||0,0)):t==null?void 0:t.map(S=>S[M[Q]]):[],borderColor:ale[Q]}));D&&(g===Se.bar||g===Se.timeSeries&&l==="bar")&&(y=y==null?void 0:y.map(k=>{var b;let Q=0;const S=(b=k==null?void 0:k.data)==null?void 0:b.map(Y=>(Q+=Y,Q));return{label:k.label,data:S,borderColor:k.borderColor}}));const z=Array.isArray(t)&&n&&i?t==null?void 0:t.map(k=>({value:k[i],name:k[n]})):[],A=Array.isArray(t)&&e?t==null?void 0:t.map(k=>k[e]):[],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],x={yearly:k=>k.getFullYear(),monthly:k=>{const Q=k.getMonth(),S=k.getFullYear();return`${h[Q]} - ${S}`},weekly:k=>{const Q=new Date(k.getTime());return Q.setDate(k.getDate()-k.getDay()),Q.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:k=>`${k.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:k=>{const Q=k.getMonth(),S=Math.floor(Q/3)+1,b=k.getFullYear();return`Q${S} ${b}`}},O=Array.from(new Set(t==null?void 0:t.map(k=>k[a||""])));let d,E=Array.from(new Set(t==null?void 0:t.map(k=>{if(u&&k[r||""]){const Q=new Date(k[r||""]),S=x[o||"monthly"];return S(Q)}return k[r||""]})));if(o===Ns.daily&&(E=E.map(k=>new Date(k)).sort((k,Q)=>k-Q).map(k=>k.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))),d=u&&o===Ns.month?E==null?void 0:E.sort((k,Q)=>{const[S,b]=k==null?void 0:k.toString().split(" - "),[Y,m]=Q==null?void 0:Q.toString().split(" - ");return b!==m?parseInt(b,10)-parseInt(m,10):h.indexOf(S)-h.indexOf(Y)}):E,u&&s&&o===Ns.month){const k=Array.from(new Set(d==null?void 0:d.map(m=>m.split(" - ")[1]))).sort(),Q=h.findIndex(m=>d.some(R=>R.startsWith(`${m} - ${k[0]}`))),S=h.slice().reverse().findIndex(m=>d.some(R=>{const[P,W]=R.split(" - ");return W===k[k.length-1]&&R.endsWith(`${m} - ${W}`)})),b=h.length-S,Y=[];k.length>1?k.forEach(m=>{h.forEach((R,P)=>{const W=`${R} - ${m}`;(m===k[0]&&P>=Q||m===k[k.length-1]&&P<b||m!==k[0]&&m!==k[k.length-1])&&Y.push(W)})}):h.forEach((m,R)=>{const P=`${m} - ${k[0]}`;R>=Q&&R<b&&Y.push(P)}),d=[...Y]}else if(u&&s&&o===Ns.quarter){const k=[];Array.from(new Set(d==null?void 0:d.map(S=>S.split(" ")[0])));const Q=Array.from(new Set(d==null?void 0:d.map(S=>S.split(" ")[1]))).sort();for(let S=0;S<Q.length;S+=1)for(let b=1;b<=4;b+=1){const Y=`Q${b} ${Q[S]}`;k.push(Y)}d=k}let C=O==null?void 0:O.map(k=>{const Q=t==null?void 0:t.filter(b=>b[a||""]===k),S=d==null?void 0:d.map(b=>{var m;if(u&&b){const R=x[o||"monthly"],P=Q==null?void 0:Q.filter(B=>{const X=new Date(B[r||""]);return R(X)===b});return(P==null?void 0:P.reduce((B,X)=>B+(Number(X[(M==null?void 0:M[0])||""])||0),0))||0}return((m=Q==null?void 0:Q.find(R=>R[r||""]===b))==null?void 0:m[(M==null?void 0:M[0])||""])||0});return{name:k,data:S}});return D&&(g===Se.bar||g===Se.timeSeries&&l==="bar")&&(C=C==null?void 0:C.map(k=>{var b;let Q=0;const S=(b=k==null?void 0:k.data)==null?void 0:b.map(Y=>(Q+=Y,Q));return{name:k.name,data:S}})),{labels:T,datasets:y,funnelData:z,singleValueData:A,xAxisData:d,seriesData:C}},ole=({data:t,source:i,target:e,value:n,sankeyColors:r})=>{const M=[],a=[],u=[];t.forEach(g=>{if(g[i]!==g[e]){let l=!0;a==null||a.map(j=>{const[T,y]=j.split("^^^^^^");y===g[i]&&T===g[e]&&(l=!1)}),l&&(a.push(`${g[i]}^^^^^^${g[e]}`),M.push({source:g[i].toString(),target:g[e].toString(),value:g[n]}))}});const o=a==null?void 0:a.map(g=>g.split("^^^^^^")[0]),s=a==null?void 0:a.map(g=>g.split("^^^^^^")[1]);o.forEach(g=>{u.includes(g)||u.push(g)}),s.forEach(g=>{u.includes(g)||u.push(g)});let N=-1;return{nodes:u==null?void 0:u.map(g=>(N===(r==null?void 0:r.length)?N=0:N+=1,{name:g.toString(),...r!=null&&r.length?{itemStyle:{color:r[N]}}:{}})),links:M}},Nle=t=>{const i="data:text/csv;charset=utf-8,";if(!t.length)return i;const e=[],n=t[0],r=Object.keys(n);e.push(`S.NO,${r.join(",").toUpperCase()}`),t.forEach((u,o)=>{const s=Object.values(u).map(N=>{if(typeof N=="number")return N;try{if(typeof N=="string"&&(N.includes(",")||N.includes(`
|
|
973
973
|
`)||N.includes("\r")||N.includes('"')))return`"${N.replace(/"/g,'""')}"`}catch{return N}return N});e.push(`${o+1},${s.join(",")}`)});const M=e.join(`
|
|
974
974
|
`);return encodeURI(i+M)},sle=(t,i,e)=>{const n=t.clientX-i.left+5,r=t.clientY-i.top-50,M=i.width-e.width,a=i.height-e.height,u=Math.max(0,Math.min(n,M)),o=Math.max(0,Math.min(r,a));return[u,o]},Dle=(t,i,e)=>{t.style.left=`${i}px`,t.style.top=`${e}px`},gle=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return{}}else return typeof t=="object"?t:{}};/*! *****************************************************************************
|
|
975
975
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1079,7 +1079,86 @@ echarts.use([`+b+"]);":"Unknown series "+S))}return}if(D==="tooltip"){if(h){proc
|
|
|
1079
1079
|
</span>
|
|
1080
1080
|
</div>
|
|
1081
1081
|
`).join("")}`,u},uN=t=>[{type:"inside",xAxisIndex:(t==null?void 0:t.zoomAxis)==="x"||(t==null?void 0:t.zoomAxis)==="xy"?[0]:"none",start:0,disabled:!(t!=null&&t.isZoomEnabled),filterMode:"none",zoomOnMouseWheel:(t==null?void 0:t.zoomOnMouseWheel)||"ctrl"},{type:"inside",yAxisIndex:(t==null?void 0:t.zoomAxis)==="y"||(t==null?void 0:t.zoomAxis)==="xy"?[0]:"none",start:0,disabled:!(t!=null&&t.isZoomEnabled),filterMode:"none",zoomOnMouseWheel:(t==null?void 0:t.zoomOnMouseWheel)||"ctrl"}],zv=({chartOptions:t,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,Wr,so,jI,T0,Fj,$j,I0,Wj,y0,oM,TI,Bj,Uu,IN,Hj,Vs,II,yI,Fs,XM,Gt,AM,Da,zI,z0,XN,$s,AI,kM,KN,Ws,Gj,fI,Bs,GD,A0,dI,Zj,f0,d0,O0,Jj,Zg,Xj,h0,L0,Jg,x0,zc,Fo,Ac,Xg,ZD,OI,Hs,bi,En,Pi,NM,Do,Kj,qj,hI,JD,Br,At,Fn,Fi,yN,mu,XD,Hr,KD,Gs,qD,go,au,eg,fc,dc,e4,t4,i4,n4,r4,M4,a4,u4,tg,o4,ig,qN,N4,Oc,s4,D4,LI,Kg,g4,qg,Zs,uu,sf,wr,l4,c4,el,hc,p0,j4,Df,gf,xI,tl,Lc,T4,lf,E0,xc,v0,pI,EI,cf,LM,UM,Js,I4,ou,ng,cn,il,vI,S0,w0,y4,rg,SI,wI,CI,nl,jf,QI,z4,kI,Sa,ga,es,pc,Mg,lo,mM,Ec,wa,Tf,UI,vc,YM,C0,ci,rl,Sc,Q0,k0,wc,Cc,mI,YI,U0,A4,Ml,zN,nM;const n=(t==null?void 0:t.chartType)===Se.timeSeries?tP({data:i,timeStampKey:t.xAxis||""}):!1;let r;e!=null&&e.length?r=[[.3,e[0]],[.7,e[1]],[1,e[2]]]:r=[[.3,"#37a2da"],[.7,"#67e0e3"],[1,"#fd666d"]];const M=je=>{switch(je){case"top-left":return{top:"0",left:"0"};case"top-center":return{top:"0",left:"center"};case"top-right":return{top:"0",right:"0"};case"left-center":return{top:"50%",left:"0"};case"right-center":return{top:"50%",right:"0"};case"bottom-left":return{bottom:"0",left:"0"};case"bottom-center":return{bottom:"0",left:"center"};case"bottom-right":return{bottom:"0",right:"0"};default:return{top:"0",left:"0"}}},a=M((R=t.legendSettings)==null?void 0:R.fixedPosition),u=M((P=t.customSettings)==null?void 0:P.titlePosition),o=je=>/^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/.test(je),s=((B=(W=t.customSettings)==null?void 0:W.gradients)==null?void 0:B.map(je=>{const Be=[{offset:je.offset1>1?je.offset1/100:je.offset1,color:je.startColor},{offset:je.offset2>1?je.offset2/100:je.offset2,color:je.endColor}];switch(je.direction){case"left":return new Ia(1,0,0,0,Be);case"right":return new Ia(0,0,1,0,Be);case"top":return new Ia(0,1,0,0,Be);case"bottom":return new Ia(0,0,0,1,Be);default:return new Ia(0,0,1,0,Be)}}))||[];let N="";if((X=t.customSettings)!=null&&X.isShowBarGradient&&((F=t.customSettings.barGradient)==null?void 0:F.offset1)!==void 0&&((G=t.customSettings.barGradient)==null?void 0:G.offset2)!==void 0&&o(t.customSettings.barGradient.startColor)&&o(t.customSettings.barGradient.endColor)){const je=[{offset:((J=t.customSettings.barGradient)==null?void 0:J.offset1)>1?((ee=t.customSettings)==null?void 0:ee.barGradient.offset1)/100:(q=t.customSettings.barGradient)==null?void 0:q.offset1,color:t.customSettings.barGradient.startColor||"#FF0000"},{offset:((ie=t.customSettings.barGradient)==null?void 0:ie.offset2)>1?((re=t.customSettings)==null?void 0:re.barGradient.offset2)/100:(le=t.customSettings.barGradient)==null?void 0:le.offset2,color:t.customSettings.barGradient.endColor||"#000000"}];switch(t.customSettings.barGradient.direction){case"left":N=new Ia(1,0,0,0,je);break;case"right":N=new Ia(0,0,1,0,je);break;case"top":N=new Ia(0,1,0,0,je);break;case"bottom":N=new Ia(0,0,0,1,je);break;default:N=new Ia(0,0,1,0,je)}}let D="";if((Ne=t.customSettings)!=null&&Ne.enableBackgroundGradient&&((se=t.customSettings.backgroundGradient)==null?void 0:se.offset1)!==void 0&&((Ie=t.customSettings.backgroundGradient)==null?void 0:Ie.offset2)!==void 0&&o(t.customSettings.backgroundGradient.startColor)&&o(t.customSettings.backgroundGradient.endColor)){const je=[{offset:((Oe=t.customSettings.backgroundGradient)==null?void 0:Oe.offset1)>1?((ye=t.customSettings)==null?void 0:ye.backgroundGradient.offset1)/100:($e=t.customSettings.backgroundGradient)==null?void 0:$e.offset1,color:t.customSettings.backgroundGradient.startColor||"#FF0000"},{offset:((Ve=t.customSettings.backgroundGradient)==null?void 0:Ve.offset2)>1?((Ee=t.customSettings)==null?void 0:Ee.backgroundGradient.offset2)/100:(Te=t.customSettings.backgroundGradient)==null?void 0:Te.offset2,color:t.customSettings.backgroundGradient.endColor||"#000000"}];switch(t.customSettings.backgroundGradient.direction){case"left":D=new Ia(1,0,0,0,je);break;case"right":D=new Ia(0,0,1,0,je);break;case"top":D=new Ia(0,1,0,0,je);break;case"bottom":D=new Ia(0,0,0,1,je);break;default:D=new Ia(0,0,1,0,je)}}const{labels:g,datasets:l,funnelData:j,singleValueData:T,seriesData:y,xAxisData:z}=ule({data:i,measure:t.measure,step:t.step,xAxis:t.xAxis,yAxisList:t.yAxisList,singleValue:t.singleValue,seriesField:t.seriesField,seriesType:((ot=(Qe=(fe=t.timeSeriesSettings)==null?void 0:fe.seriesType)==null?void 0:Qe[0])==null?void 0:ot.type)||"bar",isTimeSeries:n,fillXAxis:((rt=t.timeSeriesSettings)==null?void 0:rt.groupBySettings.fillXAxis)||!1,selectedFormat:(et=(ke=t.timeSeriesSettings)==null?void 0:ke.groupBySettings)!=null&&et.value.split("____").length?(Dt=(xe=t.timeSeriesSettings)==null?void 0:xe.groupBySettings)==null?void 0:Dt.value.split("____")[0].toLowerCase():((pt=(ve=t.timeSeriesSettings)==null?void 0:ve.groupBySettings)==null?void 0:pt.value.toLowerCase())||"monthly",isDynamicXaxis:!!((Ct=t==null?void 0:t.dynamicXAxis)!=null&&Ct.isEnabled),isCumulativeBar:((dt=t.customSettings)==null?void 0:dt.cumulativeBar)||!1,chartType:t.chartType,isGroupXAxis:!!(t!=null&&t.isGroupXAxis)}),A=oQe(i,((Zt=t.pivotTableSettings)==null?void 0:Zt.rows)||[],(($t=t.pivotTableSettings)==null?void 0:$t.columns)||[]),h=(Mt=t.customSettings)!=null&&Mt.showSelectLegend?y.filter(je=>{var Be;return(Be=t==null?void 0:t.selectedSeries)==null?void 0:Be.includes(je.name)}):[],x={...ss.margins,...t.margins},O={...ss.labelSettings,...t.labelSettings},d={...ss.legendSettings,...t.legendSettings},E={...ss.customSettings,...t.customSettings},C={...ss.tableSettings,...t.tableSettings},k={...ss.axisSettings,...t.axisSettings},Q={...ss.backGroundColor,...t.backGroundColor},S={...ss.timeSeriesSettings,seriesType:((It=t.yAxisList)==null?void 0:It.map(je=>({column:je,type:"bar"})))||[],...t.timeSeriesSettings},b={...ss.pivotTableSettings,...t.pivotTableSettings},Y={...e!=null&&e.length||s.length?{color:[...s||[],...e||[]]}:{}},m=E==null?void 0:E.chartZoom;switch(t.chartType){case Se.line:{Object.assign(Y,{...Y,title:(We=t.customSettings)!=null&&We.enableTitleDesc?{text:(Tt=t.customSettings)==null?void 0:Tt.chartTitle,subtext:(He=t.customSettings)==null?void 0:He.chartDesc,...u}:{},tooltip:{width:"200px",trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"line",lineStyle:{color:"rgba(0,0,0,0.2)",width:1,type:"solid"}},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>{const Be=di(je,E.numberFormatter);return hi(Be,E.labelPrefix,E.labelSuffix)},formatter:je=>pD(je,t)},dataZoom:uN(m),grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},backgroundColor:(jt=t.customSettings)!=null&&jt.enableBackgroundGradient?D:"",toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},xAxis:{type:"category",boundaryGap:!1,data:t.isMultiDimension&&t.seriesField!=="ungrouped"?z||[]:g,splitLine:{show:!((lt=t.customSettings)!=null&<.hideXSplitLines)},axisLine:{show:!((kt=t.customSettings)!=null&&kt.hideXAxisLines)},axisLabel:{show:!((ii=t.customSettings)!=null&&ii.hideXAxisLabels),color:((ht=(gi=t.labelSettings)==null?void 0:gi.XAxisStyle)==null?void 0:ht.color)||"#000000",fontSize:((ai=(Et=t.labelSettings)==null?void 0:Et.XAxisStyle)==null?void 0:ai.size)||14,fontWeight:((Tr=(Dn=t.labelSettings)==null?void 0:Dn.XAxisStyle)==null?void 0:Tr.weight)||400,fontFamily:(dr=(eM=t.labelSettings)==null?void 0:eM.XAxisStyle)==null?void 0:dr.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((Or=t.customSettings)!=null&&Or.hideYSplitLines)},axisLine:{show:!((ha=t.customSettings)!=null&&ha.hideYAxisLines)},axisLabel:{show:!((WM=t.customSettings)!=null&&WM.hideYAxisLabels),color:((BM=(Ya=t.labelSettings)==null?void 0:Ya.YAxisStyle)==null?void 0:BM.color)||"#000000",fontSize:((TM=(ba=t.labelSettings)==null?void 0:ba.YAxisStyle)==null?void 0:TM.size)||14,fontWeight:((IM=(OM=t.labelSettings)==null?void 0:OM.YAxisStyle)==null?void 0:IM.weight)||400,fontFamily:(Lt=(Le=t.labelSettings)==null?void 0:Le.YAxisStyle)==null?void 0:Lt.family,formatter:je=>{const Be=di(je,E.numberFormatter);return hi(Be,E.labelPrefix,E.labelSuffix)}}},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}},data:t.isMultiDimension&&t.seriesField!=="ungrouped"?y==null?void 0:y.map(je=>`${je.name}`||"line"):l==null?void 0:l.map(je=>je.label)},series:t.isMultiDimension&&t.seriesField!=="ungrouped"?h!=null&&h.length?h.map(je=>{var Be;return{data:je.data,type:"line",showSymbol:!((Be=t.customSettings)!=null&&Be.showDynamicBehaviour),name:je.name||"line",label:{show:O.show,position:O.position,formatter(ut){const st=di(ut.data,E.numberFormatter);return hi(st,E.labelPrefix,E.labelSuffix)}},emphasis:{focus:"series"}}}):y==null?void 0:y.map(je=>{var Be;return{data:je.data,type:"line",showSymbol:!((Be=t.customSettings)!=null&&Be.showDynamicBehaviour),name:je.name||"line",label:{show:O.show,position:O.position,formatter(ut){const st=di(ut.data,E.numberFormatter);return hi(st,E.labelPrefix,E.labelSuffix)}},emphasis:{focus:"series"}}}):l==null?void 0:l.map(je=>{var Be;return{data:je.data,type:"line",showSymbol:!((Be=t.customSettings)!=null&&Be.showDynamicBehaviour),name:je.label,label:{show:O.show,position:O.position,formatter(ut){const st=di(ut.data,E.numberFormatter);return hi(st,E.labelPrefix,E.labelSuffix)}},emphasis:{focus:"series"}}})});break}case Se.bar:{Object.assign(Y,{...Y,title:(Wt=t.customSettings)!=null&&Wt.enableTitleDesc?{text:(Xt=t.customSettings)==null?void 0:Xt.chartTitle,subtext:(Ji=t.customSettings)==null?void 0:Ji.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},backgroundColor:(Ki=t.customSettings)!=null&&Ki.enableBackgroundGradient?D:"",dataZoom:uN(m),grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:t.isMultiDimension&&t.seriesField!=="ungrouped"?z||[]:g,axisTick:{alignWithLabel:!0},axisLabel:{show:!((qi=t.customSettings)!=null&&qi.hideXAxisLabels),interval:0,rotate:E.customRotation||E.xRotation,hideOverlap:!0,color:((Vr=(Si=t.labelSettings)==null?void 0:Si.XAxisStyle)==null?void 0:Vr.color)||"#000000",fontSize:((ar=(Mr=t.labelSettings)==null?void 0:Mr.XAxisStyle)==null?void 0:ar.size)||14,fontWeight:((_a=(hr=t.labelSettings)==null?void 0:hr.XAxisStyle)==null?void 0:_a.weight)||400,fontFamily:(xn=(ko=t.labelSettings)==null?void 0:ko.XAxisStyle)==null?void 0:xn.family,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}},splitLine:{show:!((ws=t.customSettings)!=null&&ws.hideXSplitLines)},axisLine:{show:!((La=t.customSettings)!=null&&La.hideXAxisLines)}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((nn=t.customSettings)!=null&&nn.hideYSplitLines)},axisLine:{show:!((Ra=t.customSettings)!=null&&Ra.hideYAxisLines)},axisLabel:{show:!((Lu=t.customSettings)!=null&&Lu.hideYAxisLabels),color:((xu=(HM=t.labelSettings)==null?void 0:HM.YAxisStyle)==null?void 0:xu.color)||"#000000",fontSize:((NN=(wM=t.labelSettings)==null?void 0:wM.YAxisStyle)==null?void 0:NN.size)||14,fontWeight:((sN=(hM=t.labelSettings)==null?void 0:hM.YAxisStyle)==null?void 0:sN.weight)||400,fontFamily:(Ku=(DN=t.labelSettings)==null?void 0:DN.YAxisStyle)==null?void 0:Ku.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},legend:{data:t.isMultiDimension&&t.seriesField!=="ungrouped"?y==null?void 0:y.map(je=>`${je.name}`||"series-bar"):l==null?void 0:l.map(je=>je.label),show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:t.isMultiDimension&&t.seriesField!=="ungrouped"?h!=null&&h.length?h.map(je=>{var Be;return{data:je.data,type:"bar",showSymbol:!((Be=t.customSettings)!=null&&Be.showDynamicBehaviour),name:je.name||"line",label:{show:O.show,position:O.position,formatter(ut){const st=di(ut.data,E.numberFormatter);return hi(st,E.labelPrefix,E.labelSuffix)}},itemStyle:{...E.coloredBars?{color:ut=>e==null?void 0:e[ut.dataIndex%e.length]}:{}},emphasis:{focus:"series"}}}):y==null?void 0:y.map(je=>{var Be;return{data:je.data,type:"bar",name:je.name||"",barWidth:`${E.barWidth||0}%`,label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius,...E.coloredBars?{color:ut=>e==null?void 0:e[ut.dataIndex%e.length]}:{}}}}):l==null?void 0:l.map(je=>{var Be;return{data:je.data,type:"bar",name:je.label,barWidth:`${E.barWidth||0}%`,label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius,...E.coloredBars?{color:ut=>e==null?void 0:e[ut.dataIndex%e.length]}:{}}}})});break}case Se.stack:{const je=(()=>{if(!l||!E.showFullStacked)return;const Be={};return l.forEach(ut=>{var vt;const st=(vt=ut==null?void 0:ut.data)==null?void 0:vt.map((Pt,Kt)=>{const Ai=l.reduce((wi,$n)=>wi+$n.data[Kt],0);return(Pt/Ai*100).toFixed(2)});Be[ut.label]=st}),Be})();Object.assign(Y,{...Y,title:(Uo=t.customSettings)!=null&&Uo.enableTitleDesc?{text:(aa=t.customSettings)==null?void 0:aa.chartTitle,subtext:(ua=t.customSettings)==null?void 0:ua.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},backgroundColor:(yM=t.customSettings)!=null&&yM.enableBackgroundGradient?D:"",tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip"},dataZoom:uN(m),xAxis:{type:"category",data:t.isMultiDimension&&t.seriesField!=="ungrouped"?z||[]:g,splitLine:{show:!((pu=t.customSettings)!=null&&pu.hideXSplitLines)},axisLine:{show:!((Eu=t.customSettings)!=null&&Eu.hideXAxisLines)},axisLabel:{show:!((vu=t.customSettings)!=null&&vu.hideXAxisLabels),color:((qu=(mo=t.labelSettings)==null?void 0:mo.XAxisStyle)==null?void 0:qu.color)||"#000000",fontSize:((Cs=(Xa=t.labelSettings)==null?void 0:Xa.XAxisStyle)==null?void 0:Cs.size)||14,fontWeight:((An=(xa=t.labelSettings)==null?void 0:xa.XAxisStyle)==null?void 0:An.weight)||400,fontFamily:(eo=(pa=t.labelSettings)==null?void 0:pa.XAxisStyle)==null?void 0:eo.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(Be){return ir(Be,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",max:E.showFullStacked?100:void 0,position:k.axis,splitLine:{show:!((Yo=t.customSettings)!=null&&Yo.hideYSplitLines)},axisLine:{show:!((Mn=t.customSettings)!=null&&Mn.hideYAxisLines)},axisLabel:{show:!((bo=t.customSettings)!=null&&bo.hideYAxisLabels),color:((Vi=(_o=t.labelSettings)==null?void 0:_o.YAxisStyle)==null?void 0:Vi.color)||"#000000",fontSize:((Lr=(to=t.labelSettings)==null?void 0:to.YAxisStyle)==null?void 0:Lr.size)||14,fontWeight:((zM=(Fr=t.labelSettings)==null?void 0:Fr.YAxisStyle)==null?void 0:zM.weight)||400,fontFamily:(gr=(Su=t.labelSettings)==null?void 0:Su.YAxisStyle)==null?void 0:gr.family,formatter:Be=>Be===null||Be===0?"0":hi(di(Be,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:t.isMultiDimension&&t.seriesField!=="ungrouped"?y==null?void 0:y.map(Be=>`${Be.name}`||"series-stack"):l==null?void 0:l.map(Be=>Be.label),formatter(Be){return`{a|${ir(Be,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(Be){return Be.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:t.isMultiDimension&&t.seriesField!=="ungrouped"?h!=null&&h.length?h.map(Be=>{var ut;return{data:Be.data,type:"bar",stack:"total",name:Be.name||"",barWidth:`${E.barWidth||0}%`,label:{show:O.show,position:O.position,formatter(st){return hi(di(st.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(ut=t.customSettings)!=null&&ut.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius},emphasis:{focus:"series"}}}):y==null?void 0:y.map(Be=>{var ut;return{data:Be.data,type:"bar",stack:"total",name:Be.name||"",barWidth:`${E.barWidth||0}%`,label:{show:O.show,position:O.position,formatter(st){return hi(di(st.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(ut=t.customSettings)!=null&&ut.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius},emphasis:{focus:"series"}}}):l==null?void 0:l.map(Be=>{var ut;return{data:E.showFullStacked?je[Be.label]:Be.data,type:"bar",name:Be.label,stack:"x",barWidth:`${E.barWidth}%`,emphasis:{focus:"series"},label:{show:O.show,position:O.position,formatter(st){return hi(di(st.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(ut=t.customSettings)!=null&&ut.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius}}})});break}case Se.area:{l==null||l.map(je=>Object.assign(je,{fill:!0})),Object.assign(Y,{...Y,title:(Pn=t.customSettings)!=null&&Pn.enableTitleDesc?{text:(Ro=t.customSettings)==null?void 0:Ro.chartTitle,subtext:(CM=t.customSettings)==null?void 0:CM.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(tM=t.customSettings)!=null&&tM.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:g,splitLine:{show:!((Ea=t.customSettings)!=null&&Ea.hideXSplitLines)},axisLine:{show:!((gN=t.customSettings)!=null&&gN.hideXAxisLines)},axisLabel:{show:!((GM=t.customSettings)!=null&&GM.hideXAxisLabels),color:((VN=(Ka=t.labelSettings)==null?void 0:Ka.XAxisStyle)==null?void 0:VN.color)||"#000000",fontSize:((wu=(oa=t.labelSettings)==null?void 0:oa.XAxisStyle)==null?void 0:wu.size)||14,fontWeight:((Ue=(Ae=t.labelSettings)==null?void 0:Ae.XAxisStyle)==null?void 0:Ue.weight)||400,fontFamily:(Ht=(ft=t.labelSettings)==null?void 0:ft.XAxisStyle)==null?void 0:Ht.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}}],yAxis:[{type:"value",position:k.axis,splitLine:{show:!((Qn=t.customSettings)!=null&&Qn.hideYSplitLines)},axisLine:{show:!((Ri=t.customSettings)!=null&&Ri.hideYAxisLines)},axisLabel:{show:!((Jn=t.customSettings)!=null&&Jn.hideYAxisLabels),color:((Xn=(vr=t.labelSettings)==null?void 0:vr.YAxisStyle)==null?void 0:Xn.color)||"#000000",fontSize:((de=(ae=t.labelSettings)==null?void 0:ae.YAxisStyle)==null?void 0:de.size)||14,fontWeight:((Ke=(Ge=t.labelSettings)==null?void 0:Ge.YAxisStyle)==null?void 0:Ke.weight)||400,fontFamily:(ri=(xt=t.labelSettings)==null?void 0:xt.YAxisStyle)==null?void 0:ri.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}}],series:l==null?void 0:l.map(je=>{var Be;return{data:je.data,type:"line",name:je.label,areaStyle:{},emphasis:{focus:"series"},label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})});break}case Se.stackedArea:{l==null||l.map(je=>Object.assign(je,{fill:!0})),Object.assign(Y,{...Y,title:(_t=t.customSettings)!=null&&_t.enableTitleDesc?{text:(li=t.customSettings)==null?void 0:li.chartTitle,subtext:(Hi=t.customSettings)==null?void 0:Hi.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(fn=t.customSettings)!=null&&fn.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:g,splitLine:{show:!((Vn=t.customSettings)!=null&&Vn.hideXSplitLines)},axisLine:{show:!((kn=t.customSettings)!=null&&kn.hideXAxisLines)},axisLabel:{show:!((lr=t.customSettings)!=null&&lr.hideXAxisLabels),color:((pn=(Ir=t.labelSettings)==null?void 0:Ir.XAxisStyle)==null?void 0:pn.color)||"#000000",fontSize:((FN=(io=t.labelSettings)==null?void 0:io.XAxisStyle)==null?void 0:FN.size)||14,fontWeight:((_g=(Qs=t.labelSettings)==null?void 0:Qs.XAxisStyle)==null?void 0:_g.weight)||400,fontFamily:(ks=(qa=t.labelSettings)==null?void 0:qa.XAxisStyle)==null?void 0:ks.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}}],yAxis:[{type:"value",position:k.axis,splitLine:{show:!((Us=t.customSettings)!=null&&Us.hideYSplitLines)},axisLine:{show:!((Rg=t.customSettings)!=null&&Rg.hideYAxisLines)},axisLabel:{show:!((Sj=t.customSettings)!=null&&Sj.hideYAxisLabels),color:((Pg=(wj=t.labelSettings)==null?void 0:wj.YAxisStyle)==null?void 0:Pg.color)||"#000000",fontSize:((ec=(Vg=t.labelSettings)==null?void 0:Vg.YAxisStyle)==null?void 0:ec.size)||14,fontWeight:((ic=(tc=t.labelSettings)==null?void 0:tc.YAxisStyle)==null?void 0:ic.weight)||400,fontFamily:(no=(Fg=t.labelSettings)==null?void 0:Fg.YAxisStyle)==null?void 0:no.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}}],series:l==null?void 0:l.map(je=>{var Be;return{data:je.data,type:"line",name:je.label,stack:"Total",smooth:!0,showSymbol:!1,areaStyle:{},emphasis:{focus:"series"},label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})});break}case Se.boxplot:{const je=[],Be=[];l==null||l.map(ut=>{je.push(ut.data),Be.push(ut.label)}),Object.assign(Y,{...Y,title:(Cj=t.customSettings)!=null&&Cj.enableTitleDesc?{text:($g=t.customSettings)==null?void 0:$g.chartTitle,subtext:(bD=t.customSettings)==null?void 0:bD.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(Wg=t.customSettings)!=null&&Wg.enableBackgroundGradient?D:"",legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(ut=>ut.label),formatter(ut){return`{a|${ir(ut,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(ut){return ut.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},dataset:[{source:je},{transform:{type:"boxplot",config:{itemNameFormatter:"expr {value}"}}},{fromDatasetIndex:1,fromTransformResult:1}],tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",valueFormatter:ut=>hi(di(ut,E.numberFormatter),E.labelPrefix,E.labelSuffix)},dataZoom:uN(m),grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"category",boundaryGap:!0,nameGap:30,splitArea:{show:!1},splitLine:{show:!((Qj=t.customSettings)!=null&&Qj.hideXSplitLines)},axisLine:{show:!((_D=t.customSettings)!=null&&_D.hideXAxisLines)},axisLabel:{show:!((nc=t.customSettings)!=null&&nc.hideXAxisLabels),color:((ro=(Na=t.labelSettings)==null?void 0:Na.XAxisStyle)==null?void 0:ro.color)||"#000000",fontSize:((eu=(uM=t.labelSettings)==null?void 0:uM.XAxisStyle)==null?void 0:eu.size)||14,fontWeight:((RD=(lN=t.labelSettings)==null?void 0:lN.XAxisStyle)==null?void 0:RD.weight)||400,fontFamily:($N=(rc=t.labelSettings)==null?void 0:rc.XAxisStyle)==null?void 0:$N.family,rotate:E.customRotation||E.xRotation}},yAxis:{type:"value",position:k.axis,splitArea:{show:!0},splitLine:{show:!((Mc=t.customSettings)!=null&&Mc.hideYSplitLines)},axisLine:{show:!((ac=t.customSettings)!=null&&ac.hideYAxisLines)},axisLabel:{show:!((Me=t.customSettings)!=null&&Me.hideYAxisLabels),color:((Nt=(ue=t.labelSettings)==null?void 0:ue.YAxisStyle)==null?void 0:Nt.color)||"#000000",fontSize:((dn=(zi=t.labelSettings)==null?void 0:zi.YAxisStyle)==null?void 0:dn.size)||14,fontWeight:((gM=(Nn=t.labelSettings)==null?void 0:Nn.YAxisStyle)==null?void 0:gM.weight)||400,fontFamily:(Pa=(QM=t.labelSettings)==null?void 0:QM.YAxisStyle)==null?void 0:Pa.family,formatter:ut=>ut===null||ut===0?"0":hi(di(ut,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},series:[{name:"boxplot",type:"boxplot",datasetIndex:1},{name:"outlier",type:"scatter",datasetIndex:2}]});break}case Se.bubble:{Object.assign(Y,{...Y,title:(WN=t.customSettings)!=null&&WN.enableTitleDesc?{text:(cN=t.customSettings)==null?void 0:cN.chartTitle,subtext:(Xz=t.customSettings)==null?void 0:Xz.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(ZT=t.customSettings)!=null&&ZT.enableBackgroundGradient?D:"",grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",enterable:!0,formatter:je=>pD(je,t)},dataZoom:uN(m),xAxis:{type:"category",data:g,splitLine:{show:!((JT=t.customSettings)!=null&&JT.hideXSplitLines)},axisLine:{show:!((XT=t.customSettings)!=null&&XT.hideXAxisLines)},axisLabel:{show:!((Kz=t.customSettings)!=null&&Kz.hideXAxisLabels),color:((e0=(qz=t.labelSettings)==null?void 0:qz.XAxisStyle)==null?void 0:e0.color)||"#000000",fontSize:((tf=(ef=t.labelSettings)==null?void 0:ef.XAxisStyle)==null?void 0:tf.size)||14,fontWeight:((t0=(nf=t.labelSettings)==null?void 0:nf.XAxisStyle)==null?void 0:t0.weight)||400,fontFamily:(Mo=(rf=t.labelSettings)==null?void 0:rf.XAxisStyle)==null?void 0:Mo.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((uc=t.customSettings)!=null&&uc.hideYSplitLines)},axisLine:{show:!((i0=t.customSettings)!=null&&i0.hideYAxisLines)},axisLabel:{show:!((n0=t.customSettings)!=null&&n0.hideYAxisLabels),color:((kj=(r0=t.labelSettings)==null?void 0:r0.YAxisStyle)==null?void 0:kj.color)||"#000000",fontSize:((Uj=(BN=t.labelSettings)==null?void 0:BN.YAxisStyle)==null?void 0:Uj.size)||14,fontWeight:((Po=(M0=t.labelSettings)==null?void 0:M0.YAxisStyle)==null?void 0:Po.weight)||400,fontFamily:(oc=(KT=t.labelSettings)==null?void 0:KT.YAxisStyle)==null?void 0:oc.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:l==null?void 0:l.map(je=>{var st;const ut=je.data.reduce((vt,Pt)=>vt+Pt,0)/je.data.length;return{symbolSize:vt=>vt/ut*(t.percentageSize||20),data:je.data,type:"scatter",name:je.label,label:{show:O.show,position:O.position,formatter(vt){return hi(di(vt.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(st=t.customSettings)!=null&&st.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})});break}case Se.combo:{let je;const Be=((qT=t.yAxisList)==null?void 0:qT.filter(st=>{var vt;return!((vt=t==null?void 0:t.comboBarList)!=null&&vt.includes(st))}))||[];let ut;E!=null&&E.isStackBar&&((a0=t.comboBarList)!=null&&a0.length)?(je=[{show:!0,type:"value",name:((mj=E.comboStackAxisSymbols)==null?void 0:mj.name)||"stack",min:0,splitLine:{show:!((PD=t.customSettings)!=null&&PD.hideXSplitLines)},axisLine:{show:!((eI=t.customSettings)!=null&&eI.hideYAxisLines)},axisLabel:{show:!((tI=t.customSettings)!=null&&tI.hideYAxisLabels),color:((iI=(ZM=t.labelSettings)==null?void 0:ZM.YAxisStyle)==null?void 0:iI.color)||"#000000",fontSize:((o0=(u0=t.labelSettings)==null?void 0:u0.YAxisStyle)==null?void 0:o0.size)||14,fontWeight:((s0=(N0=t.labelSettings)==null?void 0:N0.YAxisStyle)==null?void 0:s0.weight)||400,fontFamily:(HN=(D0=t.labelSettings)==null?void 0:D0.YAxisStyle)==null?void 0:HN.family,formatter:st=>{var vt,Pt;return st===null||st===0?"0":hi(di(st,E.numberFormatter),((vt=E.comboStackAxisSymbols)==null?void 0:vt.prefix)||"",((Pt=E.comboStackAxisSymbols)==null?void 0:Pt.suffix)||"")}}}],ut=(Nc=t.comboBarList)==null?void 0:Nc.map((st,vt)=>{var Pt;return{type:"bar",...E.isStackBar?{stack:"x"}:{},data:i==null?void 0:i.map(Kt=>Kt[st]),name:st,label:{show:O.show,position:O.position,...E.isStackBar?{formatter(Kt){var Ai,wi;return hi(di(Kt.data,E.numberFormatter),(Ai=E.comboStackAxisSymbols)==null?void 0:Ai.prefix,(wi=E.comboStackAxisSymbols)==null?void 0:wi.suffix)}}:{formatter(Kt){var Ai,wi;return hi(di(Kt.data,E.numberFormatter),(Ai=E.comboAxisSymbols[vt])==null?void 0:Ai.prefix,(wi=E.comboAxisSymbols[vt])==null?void 0:wi.suffix)}}},showBackground:Q.show,backgroundStyle:{color:(Pt=t.customSettings)!=null&&Pt.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}}),Be.length&&(je.push(...Be.map((st,vt)=>{var Kt,Ai,wi,$n,bn,Ur,Ca,Nu,AN,bM,On;const Pt=E.comboAxisSymbols.filter(Kn=>Kn.name===st);return{show:!0,type:"value",name:st,min:0,position:vt>1?"left":"right",offset:vt>0?60:0,splitLine:{show:!((Kt=t.customSettings)!=null&&Kt.hideYSplitLines)},axisLine:{show:!((Ai=t.customSettings)!=null&&Ai.hideYAxisLines),lineStyle:{color:e==null?void 0:e[t.comboBarList.length+vt]}},axisLabel:{show:!((wi=t.customSettings)!=null&&wi.hideYAxisLabels),color:((bn=($n=t.labelSettings)==null?void 0:$n.YAxisStyle)==null?void 0:bn.color)||"#000000",fontSize:((Ca=(Ur=t.labelSettings)==null?void 0:Ur.YAxisStyle)==null?void 0:Ca.size)||14,fontWeight:((AN=(Nu=t.labelSettings)==null?void 0:Nu.YAxisStyle)==null?void 0:AN.weight)||400,fontFamily:(On=(bM=t.labelSettings)==null?void 0:bM.YAxisStyle)==null?void 0:On.family,formatter:Kn=>{var Gr,fM;return Kn===null||Kn===0?"0":hi(di(Kn,E.numberFormatter),((Gr=Pt[0])==null?void 0:Gr.prefix)||"",((fM=Pt[0])==null?void 0:fM.suffix)||"")}}}})),ut.push(...Be.map((st,vt)=>{var Pt;return{type:"line",yAxisIndex:vt+1,data:i==null?void 0:i.map(Kt=>Kt[st]),name:st,label:{show:O.show,position:O.position,formatter(Kt){var Ai,wi;return hi(di(Kt.data,E.numberFormatter),(Ai=E.comboAxisSymbols[vt])==null?void 0:Ai.prefix,(wi=E.comboAxisSymbols[vt])==null?void 0:wi.suffix)}},showBackground:Q.show,backgroundStyle:{color:(Pt=t.customSettings)!=null&&Pt.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})))):(je=(VD=t.yAxisList)==null?void 0:VD.map((st,vt)=>{var Kt,Ai,wi,$n,bn,Ur,Ca,Nu,AN,bM,On;const Pt=E.comboAxisSymbols.filter(Kn=>Kn.name===st);return{show:!0,type:"value",name:st,min:0,position:vt>2?"left":"",offset:vt>1?60:0,splitLine:{show:!((Kt=t.customSettings)!=null&&Kt.hideYSplitLines)},axisLine:{show:!((Ai=t.customSettings)!=null&&Ai.hideYAxisLines),lineStyle:{color:e==null?void 0:e[vt]}},axisLabel:{show:!((wi=t.customSettings)!=null&&wi.hideYAxisLabels),color:((bn=($n=t.labelSettings)==null?void 0:$n.YAxisStyle)==null?void 0:bn.color)||"#000000",fontSize:((Ca=(Ur=t.labelSettings)==null?void 0:Ur.YAxisStyle)==null?void 0:Ca.size)||14,fontWeight:((AN=(Nu=t.labelSettings)==null?void 0:Nu.YAxisStyle)==null?void 0:AN.weight)||400,fontFamily:(On=(bM=t.labelSettings)==null?void 0:bM.YAxisStyle)==null?void 0:On.family,formatter:Kn=>{var Gr,fM;return Kn===null||Kn===0?"0":hi(di(Kn,E.numberFormatter),((Gr=Pt[0])==null?void 0:Gr.prefix)||"",((fM=Pt[0])==null?void 0:fM.suffix)||"")}}}}),ut=(Mf=t.yAxisList)==null?void 0:Mf.map((st,vt)=>{var Pt,Kt,Ai;return{type:(Pt=t==null?void 0:t.comboBarList)!=null&&Pt.includes(st)?"bar":"line",...E.isStackBar&&((Kt=t==null?void 0:t.comboBarList)!=null&&Kt.includes(st))?{stack:"x"}:{yAxisIndex:vt},data:i==null?void 0:i.map(wi=>wi[st]),name:st,label:{show:O.show,position:O.position,formatter(wi){var $n,bn;return hi(di(wi.data,E.numberFormatter),($n=E.comboAxisSymbols[vt])==null?void 0:$n.prefix,(bn=E.comboAxisSymbols[vt])==null?void 0:bn.suffix)}},showBackground:Q.show,backgroundStyle:{color:(Ai=t.customSettings)!=null&&Ai.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})),Object.assign(Y,{...Y,title:(sc=t.customSettings)!=null&&sc.enableTitleDesc?{text:(Dc=t.customSettings)==null?void 0:Dc.chartTitle,subtext:(af=t.customSettings)==null?void 0:af.chartDesc,...u}:{},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},backgroundColor:(g0=t.customSettings)!=null&&g0.enableBackgroundGradient?D:"",toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip",enterable:!0,formatter:st=>pD(st,t),axisPointer:{type:"cross",crossStyle:{color:"#999"}}},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(st=>st.label),formatter(st){return`{a|${ir(st,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(st){return st.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},xAxis:[{type:"category",data:g,axisPointer:{type:"shadow"},splitLine:{show:!((Yj=t.customSettings)!=null&&Yj.hideXSplitLines)},axisLine:{show:!((Sr=t.customSettings)!=null&&Sr.hideXAxisLines)},axisLabel:{show:!((ms=t.customSettings)!=null&&ms.hideXAxisLabels),color:((Bg=(GN=t.labelSettings)==null?void 0:GN.XAxisStyle)==null?void 0:Bg.color)||"#000000",fontSize:((bj=(l0=t.labelSettings)==null?void 0:l0.XAxisStyle)==null?void 0:bj.size)||14,fontWeight:((lc=(gc=t.labelSettings)==null?void 0:gc.XAxisStyle)==null?void 0:lc.weight)||400,fontFamily:(nI=(FD=t.labelSettings)==null?void 0:FD.XAxisStyle)==null?void 0:nI.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(st){return ir(st,O.truncateLabelValue||22)}}:{}}}],yAxis:je,series:ut});break}case Se.pie:{const je=()=>{var vt,Pt,Kt;return{type:"pie",radius:"80%",data:(l==null?void 0:l.map((Ai,wi)=>{var $n;return{value:Ai.data,name:(($n=g==null?void 0:g[wi])==null?void 0:$n.toString())||"undefined"}}))||[],selectedMode:(vt=t.customSettings)==null?void 0:vt.selectedMode,selectedOffset:(Pt=t.customSettings)==null?void 0:Pt.selectedOffset,label:{show:O.show},labelLine:{show:(Kt=t.labelSettings)==null?void 0:Kt.showLabelLine,smooth:.2,length:10,length2:20}}},Be=()=>{let st=100;const vt=[];return l==null||l.map(Pt=>{var wi;const Kt=[];let Ai=0;(wi=Pt==null?void 0:Pt.data)==null||wi.map($n=>{var Ur;const bn={value:$n,name:(Ur=g==null?void 0:g[Ai])==null?void 0:Ur.toString()};Kt.push(bn),Ai+=1}),vt.push([Pt.label,Kt])}),vt==null?void 0:vt.map(Pt=>{var Kt,Ai,wi;return st-=20,{name:Pt[0],type:"pie",radius:`${st}%`,data:Pt[1],selectedMode:(Kt=t.customSettings)==null?void 0:Kt.selectedMode,selectedOffset:(Ai=t.customSettings)==null?void 0:Ai.selectedOffset,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{show:O.show,position:O.position,formatter($n){return hi(di($n.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},labelLine:{show:(wi=t.labelSettings)==null?void 0:wi.showLabelLine,smooth:.2,length:10,length2:20}}})},ut=l!=null&&l.length&&((uf=(rI=l[0])==null?void 0:rI.data)==null?void 0:uf.length)>1?Be():je();Object.assign(Y,{...Y,title:(MI=t.customSettings)!=null&&MI.enableTitleDesc?{text:(_j=t.customSettings)==null?void 0:_j.chartTitle,subtext:(Rj=t.customSettings)==null?void 0:Rj.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(aI=t.customSettings)!=null&&aI.enableBackgroundGradient?D:"",tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip",valueFormatter:st=>hi(di(st,E.numberFormatter),E.labelPrefix,E.labelSuffix)},legend:{data:l!=null&&l.length&&((cc=($D=l[0])==null?void 0:$D.data)==null?void 0:cc.length)>1||l==null?void 0:l[0],show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(st){return`{a|${ir(st,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(st){return st.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:ut});break}case Se.rose:{const je=()=>{var vt,Pt,Kt,Ai;return{type:"pie",radius:"80%",data:(l==null?void 0:l.map((wi,$n)=>{var bn;return{value:wi.data,name:((bn=g==null?void 0:g[$n])==null?void 0:bn.toString())||"undefined"}}))||[],roseType:((vt=t.customSettings)==null?void 0:vt.roseType)||"radius",selectedMode:(Pt=t.customSettings)==null?void 0:Pt.selectedMode,selectedOffset:(Kt=t.customSettings)==null?void 0:Kt.selectedOffset,label:{show:O.show},labelLine:{show:(Ai=t.labelSettings)==null?void 0:Ai.showLabelLine,smooth:.2,length:10,length2:20}}},Be=()=>{let st=100;const vt=[];return l==null||l.map(Pt=>{var wi;const Kt=[];let Ai=0;(wi=Pt==null?void 0:Pt.data)==null||wi.map($n=>{var Ur;const bn={value:$n,name:(Ur=g==null?void 0:g[Ai])==null?void 0:Ur.toString()};Kt.push(bn),Ai+=1}),vt.push([Pt.label,Kt])}),vt==null?void 0:vt.map(Pt=>{var Kt,Ai,wi,$n;return st-=20,{name:Pt[0],type:"pie",radius:`${st}%`,data:Pt[1],selectedMode:(Kt=t.customSettings)==null?void 0:Kt.selectedMode,selectedOffset:(Ai=t.customSettings)==null?void 0:Ai.selectedOffset,roseType:((wi=t.customSettings)==null?void 0:wi.roseType)||"radius",emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{show:O.show,position:O.position,formatter(bn){return`${bn.name}: ${hi(di(bn.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}`}},labelLine:{show:($n=t.labelSettings)==null?void 0:$n.showLabelLine,smooth:.2,length:10,length2:20}}})},ut=l!=null&&l.length&&((c0=(WD=l[0])==null?void 0:WD.data)==null?void 0:c0.length)>1?Be():je();Object.assign(Y,{...Y,title:(uI=t.customSettings)!=null&&uI.enableTitleDesc?{text:(oI=t.customSettings)==null?void 0:oI.chartTitle,subtext:(of=t.customSettings)==null?void 0:of.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(Ys=t.customSettings)!=null&&Ys.enableBackgroundGradient?D:"",tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip",valueFormatter:st=>hi(di(st,E.numberFormatter),E.labelPrefix,E.labelSuffix)},legend:{data:l!=null&&l.length&&((jc=(Vo=l[0])==null?void 0:Vo.data)==null?void 0:jc.length)>1||l==null?void 0:l[0],show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(st){return`{a|${ir(st,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(st){return st.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:ut});break}case Se.doughnut:{const je=()=>{var vt;const st=l==null?void 0:l.map((Pt,Kt)=>{var Ai;return{value:Pt.data,name:((Ai=g==null?void 0:g[Kt])==null?void 0:Ai.toString())||"undefined"}});return{type:"pie",radius:["30%","70%"],avoidLabelOverlap:!1,label:{show:O.show,position:O.position,formatter(Pt){return hi(di(Pt.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},data:st||[],labelLine:{show:(vt=t.labelSettings)==null?void 0:vt.showLabelLine,smooth:.2,length:10,length2:20}}},Be=()=>{const st=[];let vt=70,Pt=100;return l==null||l.map(Kt=>{var $n;const Ai=[];let wi=0;($n=Kt==null?void 0:Kt.data)==null||$n.map(bn=>{var Ca;const Ur={value:bn,name:(Ca=g==null?void 0:g[wi])==null?void 0:Ca.toString()};Ai.push(Ur),wi+=1}),st.push([Kt.label,Ai])}),st==null?void 0:st.map(Kt=>{var Ai;return vt-=20,Pt-=20,{name:Kt[0],type:"pie",radius:[`${vt}%`,`${Pt}%`],avoidLabelOverlap:!1,label:{show:O.show,position:O.position,formatter(wi){return hi(di(wi.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},data:Kt[1],labelLine:{show:(Ai=t.labelSettings)==null?void 0:Ai.showLabelLine,smooth:.2,length:10,length2:20}}})},ut=g.length>1?Be():je();Object.assign(Y,{toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip",valueFormatter:st=>hi(di(st,E.numberFormatter),E.labelPrefix,E.labelSuffix)},backgroundColor:(bs=t.customSettings)!=null&&bs.enableBackgroundGradient?D:"",legend:{data:g.length>1||l==null?void 0:l[0],show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(st){return`{a|${ir(st,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(st){return st.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:ut});break}case Se.row:{Object.assign(Y,{...Y,title:(jN=t.customSettings)!=null&&jN.enableTitleDesc?{text:(BD=t.customSettings)==null?void 0:BD.chartTitle,subtext:(ZN=t.customSettings)==null?void 0:ZN.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(NI=t.customSettings)!=null&&NI.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"value",boundaryGap:[0,.01],splitLine:{show:!((Nf=t.customSettings)!=null&&Nf.hideXSplitLines)},axisLine:{show:!((sI=t.customSettings)!=null&&sI.hideXAxisLines)},axisLabel:{show:!((ao=t.customSettings)!=null&&ao.hideXAxisLabels),color:((Hg=(Tc=t.labelSettings)==null?void 0:Tc.XAxisStyle)==null?void 0:Hg.color)||"#000000",fontSize:((_s=(mi=t.labelSettings)==null?void 0:mi.XAxisStyle)==null?void 0:_s.size)||14,fontWeight:((ln=($r=t.labelSettings)==null?void 0:$r.XAxisStyle)==null?void 0:ln.weight)||400,fontFamily:(cr=(ur=t.labelSettings)==null?void 0:ur.XAxisStyle)==null?void 0:cr.family,rotate:E.customRotation||E.xRotation,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},yAxis:{type:"category",data:g,position:k.axis,splitLine:{show:!((TN=t.customSettings)!=null&&TN.hideYSplitLines)},axisLine:{show:!((en=t.customSettings)!=null&&en.hideYAxisLines)},axisLabel:{show:!((lM=t.customSettings)!=null&&lM.hideYAxisLabels),color:((uo=(tu=t.labelSettings)==null?void 0:tu.YAxisStyle)==null?void 0:uo.color)||"#000000",fontSize:((oo=(iM=t.labelSettings)==null?void 0:iM.YAxisStyle)==null?void 0:oo.size)||14,fontWeight:((Ic=(Rs=t.labelSettings)==null?void 0:Rs.YAxisStyle)==null?void 0:Ic.weight)||400,fontFamily:(j0=(Pj=t.labelSettings)==null?void 0:Pj.YAxisStyle)==null?void 0:j0.family,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}},series:l==null?void 0:l.map(je=>{var Be;return{data:je.data,type:"bar",name:je.label,barWidth:`${E.barWidth}%`,emphasis:{focus:"series"},label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius,...E.coloredBars?{color:ut=>e==null?void 0:e[ut.dataIndex%e.length]}:{}}}})});break}case Se.histogram:{Object.assign(Y,{...Y,title:(Cu=t.customSettings)!=null&&Cu.enableTitleDesc?{text:(JM=t.customSettings)==null?void 0:JM.chartTitle,subtext:(yc=t.customSettings)==null?void 0:yc.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(DI=t.customSettings)!=null&&DI.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},xAxis:[{type:"category",data:g,axisTick:{alignWithLabel:!0},splitLine:{show:!((gI=t.customSettings)!=null&&gI.hideXSplitLines)},axisLine:{show:!((iu=t.customSettings)!=null&&iu.hideXAxisLines)},axisLabel:{show:!((Ps=t.customSettings)!=null&&Ps.hideXAxisLabels),color:((HD=(nu=t.labelSettings)==null?void 0:nu.XAxisStyle)==null?void 0:HD.color)||"#000000",fontSize:((ru=(Gg=t.labelSettings)==null?void 0:Gg.XAxisStyle)==null?void 0:ru.size)||14,fontWeight:((No=(va=t.labelSettings)==null?void 0:va.XAxisStyle)==null?void 0:No.weight)||400,fontFamily:(JN=(sa=t.labelSettings)==null?void 0:sa.XAxisStyle)==null?void 0:JN.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}}],yAxis:[{type:"value",position:k.axis,splitLine:{show:!((Qu=t.customSettings)!=null&&Qu.hideYSplitLines)},axisLine:{show:!((lI=t.customSettings)!=null&&lI.hideYAxisLines)},axisLabel:{show:!((Vj=t.customSettings)!=null&&Vj.hideYAxisLabels),color:((ku=(cI=t.labelSettings)==null?void 0:cI.YAxisStyle)==null?void 0:ku.color)||"#000000",fontSize:((Wr=(Mu=t.labelSettings)==null?void 0:Mu.YAxisStyle)==null?void 0:Wr.size)||14,fontWeight:((jI=(so=t.labelSettings)==null?void 0:so.YAxisStyle)==null?void 0:jI.weight)||400,fontFamily:(Fj=(T0=t.labelSettings)==null?void 0:T0.YAxisStyle)==null?void 0:Fj.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}}],series:[{name:($j=l==null?void 0:l[0])==null?void 0:$j.label,type:"bar",barWidth:"100%",data:(I0=l==null?void 0:l[0])==null?void 0:I0.data,label:{show:O.show,position:O.position,formatter(je){return di(je.data,E.numberFormatter)}},showBackground:Q.show,backgroundStyle:{color:(Wj=t.customSettings)!=null&&Wj.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{...E.coloredBars?{color:je=>e==null?void 0:e[je.dataIndex%e.length]}:{}}}]});break}case Se.funnel:{let je=0;if(j.length>=1&&typeof j[0].value=="number")for(let Be=0;Be<j.length;Be+=1)j[Be].value>je&&(je=j[Be].value);Object.assign(Y,{...Y,title:(y0=t.customSettings)!=null&&y0.enableTitleDesc?{text:(oM=t.customSettings)==null?void 0:oM.chartTitle,subtext:(TI=t.customSettings)==null?void 0:TI.chartDesc,...u}:{},tooltip:{trigger:"item",className:"getChartOptions-tooltip",formatter:E.showConversionRate?Be=>{var st,vt;let ut=100;return Be.dataIndex>0&&(ut=(((st=j[Be.dataIndex])==null?void 0:st.value)||0)/(((vt=j[Be.dataIndex-1])==null?void 0:vt.value)||1)*100),`${Be.name}: ${ut.toFixed(0)}%`}:E.showLabelValues?"{b}: {c}":E.labelFormat||"{b}",backgroundColor:"black",textStyle:{color:"white"}},backgroundColor:(Bj=t.customSettings)!=null&&Bj.enableBackgroundGradient?D:"",legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:j,formatter(Be){return`{a|${ir(Be,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(Be){return Be.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:[{name:"Funnel",type:"funnel",left:"10%",progressive:1e3,progressiveThreshold:3e3,top:60,bottom:60,width:"80%",height:"70%",min:0,max:je,sort:"descending",gap:((Uu=t.customSettings)==null?void 0:Uu.stepPadding)||10,itemStyle:(IN=t.customSettings)!=null&&IN.showFunnelShadow?{borderColor:"#fff",borderWidth:1,shadowBlur:20,shadowColor:"rgba(0, 0, 0, 0.3)",shadowOffsetY:10}:{},emphasis:{itemStyle:{shadowBlur:30,shadowColor:"rgba(0, 0, 0, 0.5)",shadowOffsetY:15}},label:{show:O.show,position:O.position,formatter:E.showConversionRate?Be=>{var st,vt;let ut=100;return Be.dataIndex>0&&(ut=(((st=j[Be.dataIndex])==null?void 0:st.value)||0)/(((vt=j[Be.dataIndex-1])==null?void 0:vt.value)||1)*100),`${Be.name}: ${ut.toFixed(0)}%`}:E.showLabelValues?"{b}: {c}":E.labelFormat||"{b}"},labelLine:{length:10,lineStyle:{width:1,type:"solid"}},data:(j==null?void 0:j.length)>20?j.slice(0,20):j}]});break}case Se.gauge:{const je=((Hj=t==null?void 0:t.gaugeSettings)==null?void 0:Hj.metric)||"",Be=((Vs=t.gaugeSettings)==null?void 0:Vs.dimensions)||[],ut=[],st=[];let vt,Pt=0,Kt=!1;if(i.length===1&&(vt=i[0],Kt=Object.keys(vt).every(Ai=>typeof vt[Ai]=="number"),Kt&&(Pt=vt[je],ut.push({value:vt[je],name:je,title:{show:!1},detail:{show:!1}}))),i.length!==1&&je.length&&!Be.length){const Ai=(II=i==null?void 0:i[0])==null?void 0:II[je];Kt=!0,Pt=Ai,ut.push({value:Ai,name:je,title:{show:!1},detail:{show:!1}})}if(je.length&&Be.length){const wi=tb(i,Be,[je])[je],$n=wi.length;for(let bn=0;bn<$n;bn+=1)if(st.includes(wi[bn].name)){for(let Ur=0;Ur<ut.length;Ur+=1)if(ut[Ur].value===wi[bn].name){ut[Ur].name+=`, (${wi[bn].parent.replaceAll("/",",")})`;break}}else{st.push(wi[bn].name);const Ur={value:wi[bn].name,name:`(${(Fs=(yI=wi[bn])==null?void 0:yI.parent)==null?void 0:Fs.replaceAll("/",",")})`,title:{show:!1},detail:{show:!1}};ut.push(Ur)}Kt=!1}Object.assign(Y,{...Y,title:(XM=t.customSettings)!=null&&XM.enableTitleDesc?{text:(Gt=t.customSettings)==null?void 0:Gt.chartTitle,subtext:(AM=t.customSettings)==null?void 0:AM.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(Da=t.customSettings)!=null&&Da.enableBackgroundGradient?D:"",legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(Ai){return`{a|${ir(Ai,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(Ai){return Ai.name},backgroundColor:"black",textStyle:{color:"white"}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},tooltip:{show:!0,backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip"},series:[{type:"gauge",startAngle:190,endAngle:-10,center:["50%","75%"],radius:"100%",anchor:{show:!0,showAbove:!0,size:12,itemStyle:{color:"#FAC858"}},pointer:{length:"100%",width:ut.length===1?10:4},axisLine:{lineStyle:{width:30,color:r}},axisTick:{show:!0,distance:-30,length:8,lineStyle:{color:"#fff",width:2}},splitLine:{distance:-30,length:30,lineStyle:{color:"#fff",width:4}},axisLabel:{distance:-20,color:"#999",rotate:5,fontSize:10,formatter(Ai){return hi(di(Ai,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},data:ut,title:{fontSize:14},min:0,max:Kt?Pt+Pt/2:Math.max(...st)+Math.min(...st),detail:{width:40,height:14,fontSize:14,color:"#fff",backgroundColor:"inherit",borderRadius:3,formatter:"{value}%"}}]});break}case Se.sankey:{if((zI=t.sankeyValues)!=null&&zI.length){const[je,Be,ut]=t.sankeyValues,{links:st,nodes:vt}=ole({data:i,source:je,target:Be,value:ut,sankeyColors:e});Object.assign(Y,{...Y,title:(z0=t.customSettings)!=null&&z0.enableTitleDesc?{text:(XN=t.customSettings)==null?void 0:XN.chartTitle,subtext:($s=t.customSettings)==null?void 0:$s.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(AI=t.customSettings)!=null&&AI.enableBackgroundGradient?D:"",tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip",formatter:Pt=>{if(Pt.dataType==="edge")return`${je}: ${Pt.data.source}<br />${Be}: ${Pt.data.target}<br />
|
|
1082
|
-
${ut}: ${hi(di(Pt.data.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}`;if(Pt.dataType==="node")return Pt.data.name},valueFormatter:Pt=>hi(di(Pt,E.numberFormatter),E.labelPrefix,E.labelSuffix)},series:{type:"sankey",layout:"none",emphasis:{focus:"adjacency"},data:vt,links:st,label:{show:O.show,position:O.position,formatter:O.truncateLabel?Pt=>ir(Pt.data.name,O.truncateLabelValue||22):void 0}}})}break}case Se.singleValue:{const je=T[0]&&hi(di(T[0],E.numberFormatter),E.labelPrefix,E.labelSuffix),Be=(kM=i==null?void 0:i[E.comparisonTimePeriod||0])==null?void 0:kM[(t==null?void 0:t.singleValue)||""],ut=T!=null&&T[0]?`${(((T==null?void 0:T[0])-Be)/Be*100).toFixed(2)} %`:null,st=E.comparisonValueShow&&E.comparisonTimePeriod&&E.comparisonTimePeriod>0&&E.comparisonTimeGrain!=="NONE"&&(t==null?void 0:t.singleValue)&&((KN=i==null?void 0:i[0])==null?void 0:KN._timestamp);Object.assign(Y,{settings:{fontSize:E.fontSize||30,subHeaderFontSize:E.subHeaderFontSize||14,subHeaderShow:E.subHeaderShow||!1,displayText:E.displayText||"",comparisonTimePeriod:E.comparisonTimePeriod||30,comparisonTimeColumn:E.comparisonTimeColumn||"",comparisonValueShow:E.comparisonValueShow||!1,comparisonValueFontSize:E.comparisonValueFontSize||12,comparisonTimeGrain:E.comparisonTimeGrain||"",comparisonSuffix:E.comparisonSuffix||"",fontColor:E.singleValueFontColor||"#000000",suffix:E.singleValueSuffix||"",prefix:E.singleValuePrefix||""},value:je,comparisonValue:st?ut:void 0,trendLineOptions:ut&&E.isShowTrendLine?{...Y,title:(Ws=t.customSettings)!=null&&Ws.enableTitleDesc?{text:(Gj=t.customSettings)==null?void 0:Gj.chartTitle,subtext:(fI=t.customSettings)==null?void 0:fI.chartDesc,...u}:{},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"line",lineStyle:{color:"rgba(0,0,0,0.2)",width:1,type:"solid"}},className:"getChartOptions-tooltip"},grid:{left:"0%",bottom:"0%",top:"0%",right:"0%",containLabel:!0},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLine:{show:!1},axisLabel:{show:!1}},yAxis:{type:"value",position:k.axis,splitLine:{show:!1},axisLine:{show:!1},axisLabel:{show:!1}},...e!=null&&e.length?{color:[...e]}:{},legend:{show:!1},series:[{data:i==null?void 0:i.map(vt=>[vt==null?void 0:vt._timestamp,vt==null?void 0:vt[t.singleValue||""]]),type:"line",smooth:.6,symbol:"none",lineStyle:{width:2},areaStyle:{},name:(t==null?void 0:t.singleValue)||"total",label:{show:!1}}]}:void 0});break}case Se.waterfall:{let je;if(l!=null&&l.length){const Be=(Bs=l[0])==null?void 0:Bs.data,ut=[Be[0]];if(Be.length)for(let st=1;st<Be.length-1;st++)ut.push(ut[st-1]-Be[st]);ut.push(Be[Be.length-1]),je={labels:g,datasets:[Be,ut],legend:l[0].label}}Object.assign(Y,{...Y,title:(GD=t.customSettings)!=null&&GD.enableTitleDesc?{text:(A0=t.customSettings)==null?void 0:A0.chartTitle,subtext:(dI=t.customSettings)==null?void 0:dI.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(Zj=t.customSettings)!=null&&Zj.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",formatter(Be){const ut=Be[1];return`${ut.name}<br/>${hi(di(ut.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}`}},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(Be){return`{a|${ir(Be,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(Be){return Be.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:je==null?void 0:je.labels,splitLine:{show:!((f0=t.customSettings)!=null&&f0.hideXSplitLines)},axisLine:{show:!((d0=t.customSettings)!=null&&d0.hideXAxisLines)},axisLabel:{show:!((O0=t.customSettings)!=null&&O0.hideXAxisLabels),color:((Zg=(Jj=t.labelSettings)==null?void 0:Jj.XAxisStyle)==null?void 0:Zg.color)||"#000000",fontSize:((h0=(Xj=t.labelSettings)==null?void 0:Xj.XAxisStyle)==null?void 0:h0.size)||14,fontWeight:((Jg=(L0=t.labelSettings)==null?void 0:L0.XAxisStyle)==null?void 0:Jg.weight)||400,fontFamily:(zc=(x0=t.labelSettings)==null?void 0:x0.XAxisStyle)==null?void 0:zc.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(Be){return ir(Be,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((Fo=t.customSettings)!=null&&Fo.hideYSplitLines)},axisLine:{show:!((Ac=t.customSettings)!=null&&Ac.hideYAxisLines)},axisLabel:{show:!((Xg=t.customSettings)!=null&&Xg.hideYAxisLabels),color:((OI=(ZD=t.labelSettings)==null?void 0:ZD.YAxisStyle)==null?void 0:OI.color)||"#000000",fontSize:((bi=(Hs=t.labelSettings)==null?void 0:Hs.YAxisStyle)==null?void 0:bi.size)||14,fontWeight:((Pi=(En=t.labelSettings)==null?void 0:En.YAxisStyle)==null?void 0:Pi.weight)||400,fontFamily:(Do=(NM=t.labelSettings)==null?void 0:NM.YAxisStyle)==null?void 0:Do.family,formatter:Be=>Be===null||Be===0?"0":hi(di(Be,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},series:[{name:"Placeholder",type:"bar",stack:"Total",itemStyle:{borderColor:"transparent",color:"transparent"},emphasis:{itemStyle:{borderColor:"transparent",color:"transparent"}},data:je==null?void 0:je.datasets[1],showBackground:Q.show,backgroundStyle:{color:(Kj=t.customSettings)!=null&&Kj.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}},{name:je==null?void 0:je.legend,type:"bar",stack:"Total",label:{show:O.show,position:O.position,formatter(Be){return hi(di(Be.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},data:je==null?void 0:je.datasets[0]}]});break}case Se.horizontalStack:{Object.assign(Y,{...Y,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(qj=t.customSettings)!=null&&qj.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"value",boundaryGap:[0,.01],splitLine:{show:!((hI=t.customSettings)!=null&&hI.hideXSplitLines)},axisLine:{show:!((JD=t.customSettings)!=null&&JD.hideXAxisLines)},axisLabel:{show:!((Br=t.customSettings)!=null&&Br.hideXAxisLabels),color:((Fn=(At=t.labelSettings)==null?void 0:At.XAxisStyle)==null?void 0:Fn.color)||"#000000",fontSize:((yN=(Fi=t.labelSettings)==null?void 0:Fi.XAxisStyle)==null?void 0:yN.size)||14,fontWeight:((XD=(mu=t.labelSettings)==null?void 0:mu.XAxisStyle)==null?void 0:XD.weight)||400,fontFamily:(KD=(Hr=t.labelSettings)==null?void 0:Hr.XAxisStyle)==null?void 0:KD.family,rotate:E.customRotation||E.xRotation,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},yAxis:{type:"category",data:g,splitLine:{show:!((Gs=t.customSettings)!=null&&Gs.hideYSplitLines)},axisLine:{show:!((qD=t.customSettings)!=null&&qD.hideYAxisLines)},position:k.axis,axisLabel:{show:!((go=t.customSettings)!=null&&go.hideYAxisLabels),color:((eg=(au=t.labelSettings)==null?void 0:au.YAxisStyle)==null?void 0:eg.color)||"#000000",fontSize:((dc=(fc=t.labelSettings)==null?void 0:fc.YAxisStyle)==null?void 0:dc.size)||14,fontWeight:((t4=(e4=t.labelSettings)==null?void 0:e4.YAxisStyle)==null?void 0:t4.weight)||400,fontFamily:(n4=(i4=t.labelSettings)==null?void 0:i4.YAxisStyle)==null?void 0:n4.family,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}},series:l==null?void 0:l.map(je=>{var Be;return{data:je.data,type:"bar",stack:"x",name:je.label,barWidth:`${E.barWidth}%`,emphasis:{focus:"series"},label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius}}})});break}case Se.table:{const je=[];if(l){const Be=[],ut=[];l==null||l.map(st=>{Be.push(st.label),ut.push(st.data)});for(let st=0;st<((r4=ut[0])==null?void 0:r4.length);st+=1){const vt={};for(let Pt=0;Pt<Be.length;Pt+=1)vt[Be[Pt]]=ut[Pt][st];je.push(vt)}}Object.assign(Y,{data:je,tableSettings:C});break}case Se.horizontalStackTable:{const je=[];if(l){const Be=[],ut=[];l==null||l.map(st=>{Be.push(st.label),ut.push(st.data)});for(let st=0;st<((M4=ut[0])==null?void 0:M4.length);st+=1){const vt={};for(let Pt=0;Pt<Be.length;Pt+=1)vt[Be[Pt]]=ut[Pt][st];je.push(vt)}}Object.assign(Y,{data:je,tableSettings:C,colors:e});break}case Se.pivot:{Object.assign(Y,{pivotTableSettings:b});break}case Se.treeMap:{const je=YH;Object.assign(Y,{...Y,tooltip:{backgroundColor:"black",textStyle:{color:"white"},formatter(ut){const st=ut.value,vt=ut.treePathInfo,Pt=[];for(let Kt=1;Kt<vt.length;Kt++)Pt.push(vt[Kt].name);return[`<div>${je.encodeHTML(Pt.join("-"))}</div>`,`value: ${je.addCommas(st)}`].join("")}},series:[{type:"treemap",visibleMin:600,label:{show:!0,formatter:"{b}"},upperLabel:{show:!0,height:30},itemStyle:{borderColor:"#fff"},levels:(()=>[{itemStyle:{borderWidth:0,gapWidth:5}},{itemStyle:{gapWidth:1}},{colorSaturation:[.35,.5],itemStyle:{gapWidth:1,borderColorSaturation:.6}}])(),data:A}]});break}case Se.stepped:{const je=["start","middle","end"];let Be=2;Object.assign(Y,{...Y,title:(a4=t.customSettings)!=null&&a4.enableTitleDesc?{text:(u4=t.customSettings)==null?void 0:u4.chartTitle,subtext:(tg=t.customSettings)==null?void 0:tg.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(o4=t.customSettings)!=null&&o4.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:ut=>hi(di(ut,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:ut=>pD(ut,t)},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(ut=>ut.label),formatter(ut){return`{a|${ir(ut,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(ut){return ut.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:g,splitLine:{show:!((ig=t.customSettings)!=null&&ig.hideXSplitLines)},axisLine:{show:!((qN=t.customSettings)!=null&&qN.hideXAxisLines)},axisLabel:{show:!((N4=t.customSettings)!=null&&N4.hideXAxisLabels),color:((s4=(Oc=t.labelSettings)==null?void 0:Oc.XAxisStyle)==null?void 0:s4.color)||"#000000",fontSize:((LI=(D4=t.labelSettings)==null?void 0:D4.XAxisStyle)==null?void 0:LI.size)||14,fontWeight:((g4=(Kg=t.labelSettings)==null?void 0:Kg.XAxisStyle)==null?void 0:g4.weight)||400,fontFamily:(Zs=(qg=t.labelSettings)==null?void 0:qg.XAxisStyle)==null?void 0:Zs.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(ut){return ir(ut,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((uu=t.customSettings)!=null&&uu.hideYSplitLines)},axisLine:{show:!((sf=t.customSettings)!=null&&sf.hideYAxisLines)},axisLabel:{show:!((wr=t.customSettings)!=null&&wr.hideYAxisLabels),color:((c4=(l4=t.labelSettings)==null?void 0:l4.YAxisStyle)==null?void 0:c4.color)||"#000000",fontSize:((hc=(el=t.labelSettings)==null?void 0:el.YAxisStyle)==null?void 0:hc.size)||14,fontWeight:((j4=(p0=t.labelSettings)==null?void 0:p0.YAxisStyle)==null?void 0:j4.weight)||400,fontFamily:(gf=(Df=t.labelSettings)==null?void 0:Df.YAxisStyle)==null?void 0:gf.family,formatter:ut=>ut===null||ut===0?"0":hi(di(ut,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},series:l==null?void 0:l.map(ut=>{var st;return Be===0?Be=1:Be===1?Be=2:Be=0,{name:ut.label,type:"line",step:je[Be],data:ut.data,areaStyle:{},label:{show:O.show,position:O.position,formatter(vt){return hi(di(vt.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(st=t.customSettings)!=null&&st.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})});break}case Se.scatter:{Object.assign(Y,{...Y,title:(xI=t.customSettings)!=null&&xI.enableTitleDesc?{text:(tl=t.customSettings)==null?void 0:tl.chartTitle,subtext:(Lc=t.customSettings)==null?void 0:Lc.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(T4=t.customSettings)!=null&&T4.enableBackgroundGradient?D:"",grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",enterable:!0,formatter:je=>pD(je,t)},dataZoom:uN(m),xAxis:{type:"category",data:g,splitLine:{show:!((lf=t.customSettings)!=null&&lf.hideXSplitLines)},axisLine:{show:!((E0=t.customSettings)!=null&&E0.hideXAxisLines)},axisLabel:{show:!((xc=t.customSettings)!=null&&xc.hideXAxisLabels),color:((pI=(v0=t.labelSettings)==null?void 0:v0.XAxisStyle)==null?void 0:pI.color)||"#000000",fontSize:((cf=(EI=t.labelSettings)==null?void 0:EI.XAxisStyle)==null?void 0:cf.size)||14,fontWeight:((UM=(LM=t.labelSettings)==null?void 0:LM.XAxisStyle)==null?void 0:UM.weight)||400,fontFamily:(I4=(Js=t.labelSettings)==null?void 0:Js.XAxisStyle)==null?void 0:I4.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((ou=t.customSettings)!=null&&ou.hideYSplitLines)},axisLine:{show:!((ng=t.customSettings)!=null&&ng.hideYAxisLines)},axisLabel:{show:!((cn=t.customSettings)!=null&&cn.hideYAxisLabels),color:((vI=(il=t.labelSettings)==null?void 0:il.YAxisStyle)==null?void 0:vI.color)||"#000000",fontSize:((w0=(S0=t.labelSettings)==null?void 0:S0.YAxisStyle)==null?void 0:w0.size)||14,fontWeight:((rg=(y4=t.labelSettings)==null?void 0:y4.YAxisStyle)==null?void 0:rg.weight)||400,fontFamily:(wI=(SI=t.labelSettings)==null?void 0:SI.YAxisStyle)==null?void 0:wI.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:l==null?void 0:l.map(je=>{var Be;return{symbolSize:10,data:je.data,type:"scatter",name:je.label,label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})});break}case Se.timeSeries:{if(!n)break;Object.assign(Y,{...Y,title:(CI=t.customSettings)!=null&&CI.enableTitleDesc?{text:(nl=t.customSettings)==null?void 0:nl.chartTitle,subtext:(jf=t.customSettings)==null?void 0:jf.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(QI=t.customSettings)!=null&&QI.enableBackgroundGradient?D:"",grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},axisLine:{show:(z4=t.customSettings)==null?void 0:z4.hideXAxisLines},axisLabel:{show:(kI=t.customSettings)==null?void 0:kI.hideXAxisLabels},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),xAxis:{type:"category",axisTick:{alignWithLabel:!0},axisLabel:{show:!((Sa=t.customSettings)!=null&&Sa.hideXAxisLabels),color:((es=(ga=t.labelSettings)==null?void 0:ga.XAxisStyle)==null?void 0:es.color)||"#000000",fontSize:((Mg=(pc=t.labelSettings)==null?void 0:pc.XAxisStyle)==null?void 0:Mg.size)||14,fontWeight:((mM=(lo=t.labelSettings)==null?void 0:lo.XAxisStyle)==null?void 0:mM.weight)||400,fontFamily:(wa=(Ec=t.labelSettings)==null?void 0:Ec.XAxisStyle)==null?void 0:wa.family,interval:0,rotate:E.customRotation||E.xRotation,hideOverlap:!0,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}},splitLine:{show:!((Tf=t.customSettings)!=null&&Tf.hideXSplitLines)},axisLine:{show:!((UI=t.customSettings)!=null&&UI.hideXAxisLines)},data:z||[]},yAxis:{type:"value",position:k.axis,splitLine:{show:!((vc=t.customSettings)!=null&&vc.hideYSplitLines)},axisLine:{show:!((YM=t.customSettings)!=null&&YM.hideYAxisLines)},axisLabel:{show:!((C0=t.customSettings)!=null&&C0.hideYAxisLabels),color:((rl=(ci=t.labelSettings)==null?void 0:ci.YAxisStyle)==null?void 0:rl.color)||"#000000",fontSize:((Q0=(Sc=t.labelSettings)==null?void 0:Sc.YAxisStyle)==null?void 0:Q0.size)||14,fontWeight:((wc=(k0=t.labelSettings)==null?void 0:k0.YAxisStyle)==null?void 0:wc.weight)||400,fontFamily:(mI=(Cc=t.labelSettings)==null?void 0:Cc.YAxisStyle)==null?void 0:mI.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:t.isMultiDimension&&t.seriesField!=="ungrouped"?y==null?void 0:y.map(je=>`${je.name}`||"series-bar"):t.yAxisList,formatter(je){return`{a|${ir(je||"",d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:t.isMultiDimension&&t.seriesField!=="ungrouped"?h!=null&&h.length?h.map(je=>{var Be,ut,st,vt,Pt,Kt,Ai,wi,$n,bn,Ur,Ca,Nu;return{data:(je==null?void 0:je.data)||[],type:((ut=(Be=S==null?void 0:S.seriesType)==null?void 0:Be[0])==null?void 0:ut.type)==="area"?"line":((vt=(st=S==null?void 0:S.seriesType)==null?void 0:st[0])==null?void 0:vt.type)==="stack"?"bar":((Kt=(Pt=S==null?void 0:S.seriesType)==null?void 0:Pt[0])==null?void 0:Kt.type)||"bar",name:(je==null?void 0:je.name)||"series",...((wi=(Ai=S==null?void 0:S.seriesType)==null?void 0:Ai[0])==null?void 0:wi.type)==="stack"?{stack:"total"}:{},label:{show:O.show,position:O.position,formatter(AN){return hi(di(AN.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},emphasis:{focus:"series"},...((bn=($n=S==null?void 0:S.seriesType)==null?void 0:$n[0])==null?void 0:bn.type)==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...((Ca=(Ur=S==null?void 0:S.seriesType)==null?void 0:Ur[0])==null?void 0:Ca.type)==="bar"?{barWidth:`${(E==null?void 0:E.barWidth)||0}%`,showBackground:Q==null?void 0:Q.show,backgroundStyle:{color:(Nu=t.customSettings)!=null&&Nu.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E==null?void 0:E.barRadius}}:{}}}):y==null?void 0:y.map(je=>{var Be,ut,st,vt,Pt,Kt,Ai,wi,$n,bn,Ur,Ca,Nu;return{data:(je==null?void 0:je.data)||[],type:((ut=(Be=S==null?void 0:S.seriesType)==null?void 0:Be[0])==null?void 0:ut.type)==="area"?"line":((vt=(st=S==null?void 0:S.seriesType)==null?void 0:st[0])==null?void 0:vt.type)==="stack"?"bar":((Kt=(Pt=S==null?void 0:S.seriesType)==null?void 0:Pt[0])==null?void 0:Kt.type)||"bar",name:(je==null?void 0:je.name)||"series",...((wi=(Ai=S==null?void 0:S.seriesType)==null?void 0:Ai[0])==null?void 0:wi.type)==="stack"?{stack:"total"}:{},label:{show:O.show,position:O.position,formatter(AN){return hi(di(AN.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},emphasis:{focus:"series"},...((bn=($n=S==null?void 0:S.seriesType)==null?void 0:$n[0])==null?void 0:bn.type)==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...((Ca=(Ur=S==null?void 0:S.seriesType)==null?void 0:Ur[0])==null?void 0:Ca.type)==="bar"?{barWidth:`${(E==null?void 0:E.barWidth)||0}%`,showBackground:Q==null?void 0:Q.show,backgroundStyle:{color:(Nu=t.customSettings)!=null&&Nu.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E==null?void 0:E.barRadius}}:{}}}):qge({dataArray:i,timeStampKey:t.xAxis||"",valuekeys:t.yAxisList||[],type:((YI=S.seriesType[0])==null?void 0:YI.type)||"bar",groupBy:(U0=S.groupBySettings)!=null&&U0.value.split("____").length?(A4=S.groupBySettings)==null?void 0:A4.value.split("____")[0].toLowerCase():((Ml=S.groupBySettings)==null?void 0:Ml.value.toLowerCase())||"monthly",labelSettings:O,backGroundColor:Q,customSettings:E,fillXAxis:((zN=S.groupBySettings)==null?void 0:zN.fillXAxis)||!1,isCumulativeBar:((nM=t.customSettings)==null?void 0:nM.cumulativeBar)||!1})});break}}return Y},sQe=t=>["IN","NOT IN"].includes(t),DQe=t=>["IS NULL","IS NOT NULL"].includes(t),aM={container:"_container_13yjv_1",form:"_form_13yjv_7",filterHeader:"_filterHeader_13yjv_23",titleContent:"_titleContent_13yjv_29",title:"_title_13yjv_29",buttons:"_buttons_13yjv_41",apply:"_apply_13yjv_47",applyIcon:"_applyIcon_13yjv_53",reset:"_reset_13yjv_59",filterFieldsContainer:"_filterFieldsContainer_13yjv_67",filterFields:"_filterFields_13yjv_67",filterContainer:"_filterContainer_13yjv_91",AddFilter:"_AddFilter_13yjv_97",filterDropdown:"_filterDropdown_13yjv_103",filterDropdowns:"_filterDropdowns_13yjv_111",noFilters:"_noFilters_13yjv_111",gridColAndRow:"_gridColAndRow_13yjv_127",gridCol1:"_gridCol1_13yjv_135",gridCol2:"_gridCol2_13yjv_143",gridCol3:"_gridCol3_13yjv_151",filters:"_filters_13yjv_159",filterItem:"_filterItem_13yjv_165",filterItemOperator:"_filterItemOperator_13yjv_171",remove:"_remove_13yjv_177",filterCol:"_filterCol_13yjv_183",filterText:"_filterText_13yjv_189",smallText:"_smallText_13yjv_195",numberFieldPopup:"_numberFieldPopup_13yjv_203",numberField:"_numberField_13yjv_203",numberFieldWrapper:"_numberFieldWrapper_13yjv_219",numberFieldLabel:"_numberFieldLabel_13yjv_227",selectedLabel:"_selectedLabel_13yjv_235",numberFieldLabelText:"_numberFieldLabelText_13yjv_243",numberFieldLabelSelectText:"_numberFieldLabelSelectText_13yjv_259",numberFieldButtonClass:"_numberFieldButtonClass_13yjv_267",numberFieldLabelMenuClass:"_numberFieldLabelMenuClass_13yjv_275",numberFieldClearButton:"_numberFieldClearButton_13yjv_283",numberFieldFooter:"_numberFieldFooter_13yjv_291",checkedOption:"_checkedOption_13yjv_299",option:"_option_13yjv_307",addFilterMenu:"_addFilterMenu_13yjv_315",appliedFilterTag:"_appliedFilterTag_13yjv_323",appliedfilters:"_appliedfilters_13yjv_331",textBold:"_textBold_13yjv_339",filterButton:"_filterButton_13yjv_347",filterBtnText:"_filterBtnText_13yjv_355",filterLength:"_filterLength_13yjv_363",addfilter:"_addfilter_13yjv_371",alertContainer:"_alertContainer_13yjv_379"},Tte=({setAppliedFilters:t,column:i,defaultValues:e,className:n="",onChange:r,label:M,variant:a="static",buttonWidth:u="auto",radius:o})=>{const[s,N]=De.useState(e||{min:null,max:null}),D=(e==null?void 0:e.min)===null||(e==null?void 0:e.max)===null,g=De.useRef(null),[l,j]=De.useState(""),[T,y]=De.useState(""),z=()=>{var h;N({min:null,max:null}),j(""),y(""),(h=g.current)==null||h.click(),t(x=>x.filter(O=>O.column!==(i==null?void 0:i.name)))},A=()=>{var h;if(s.min===null||s.max===null){y("Invalid value");return}i&&t&&t(x=>{const O={column:i.name,operator:"BETWEEN",value:`${s.min} AND ${s.max}`,as:i.as,defaultValues:s,filterType:i.isShowHorizontal?"horizontal":"global",isFilterApplied:!!i.isShowHorizontal},d=x.findIndex(C=>C.column===i.name);if(d===-1)return[...x,O];const E=[...x];return E[d]=O,E}),j(`Between ${s.min} to ${s.max}`),y(""),(h=g.current)==null||h.click()};return De.useEffect(()=>{N(e||{min:null,max:null}),j(e&&!D?`${e.min} AND ${e.max}`:"")},[e==null?void 0:e.max,e==null?void 0:e.min,D]),v.jsx(v.Fragment,{children:v.jsx(CD,{position:"bottom-start",buttonWidth:u,menuWidth:"200px",buttonContent:v.jsxs(v.Fragment,{children:[a==="static"&&v.jsx(Pe,{variant:"label",children:M||(i==null?void 0:i.label)||(i==null?void 0:i.name)}),v.jsxs("div",{className:aM.numberField,style:{borderRadius:o||"4px"},ref:g,children:[v.jsxs("div",{className:aM.numberFieldLabelText,children:[a==="floating"&&v.jsx("span",{className:[aM.numberFieldLabel,aM.selectedLabel].join(" "),children:M||(i==null?void 0:i.label)||(i==null?void 0:i.name)}),v.jsx(Pe,{variant:"body-text-sm",children:l||"Select a value"})]}),v.jsx("span",{children:v.jsx(Yt,{name:"caret-down-fill",size:"xs"})})]})]}),children:v.jsxs("div",{className:aM.numberFieldWrapper,children:[v.jsx(yi,{label:"minimum",type:"number",defaultValue:s.min,onChange:({target:{value:h}})=>{N(x=>({...x,min:Number(h)})),r==null||r({min:Number(h),max:s.max})}}),v.jsx(yi,{label:"maximum",type:"number",defaultValue:s.max,onChange:({target:{value:h}})=>{N(x=>({...x,max:Number(h)})),r==null||r({min:s.min,max:Number(h)})}}),T&&v.jsx(Pe,{variant:"body-text-sm",color:"alert",children:T}),v.jsxs("div",{className:aM.numberFieldFooter,children:[v.jsx(Bt,{type:"button",variant:"tertiary",onClick:z,children:"Clear"}),v.jsx(Bt,{variant:"primary",type:"button",onClick:A,children:"Save"})]})]})})})},gQe=({columnList:t,filterList:i,setFilterList:e})=>v.jsx(v.Fragment,{children:!!t.length&&v.jsx(CD,{buttonContent:v.jsx(Bt,{variant:"tertiary",type:"button",leftIcon:v.jsx(Yt,{name:"plus"})}),position:"bottom-start",children:v.jsx("div",{className:aM.addFilterMenu,children:t.map(n=>{const r=!!i.find(M=>M.name===n.name);return v.jsx("div",{children:v.jsx(Bt,{variant:"tertiary",onClick:()=>{const M=r?i.filter(a=>a.name!==n.name):[...i,n];e(M)},children:v.jsxs(Bt,{variant:"tertiary",onClick:()=>{const M=r?i.filter(a=>a.name!==n.name):[...i,n];e(M)},children:[v.jsx(lL,{checked:r,onClick:()=>{const M=r?i.filter(a=>a.name!==n.name):[...i,n];e(M)}}),n.label||n.name]})},n.name)})})})})}),lQe=({filterList:t,setFilterList:i,appliedfilters:e,setAppliedFilters:n,filters:r,internal:M,clientId:a,isAllClient:u,theme:o})=>{const s=De.useCallback((g,l)=>{var T;const j=((T=e==null?void 0:e.find(y=>y.column===g))==null?void 0:T.value)||"";return l==="string"?Array.isArray(j)?j.map(y=>({label:y,value:y})):[]:{label:j,value:j}},[e]),N=De.useMemo(()=>{var g;return(g=e==null?void 0:e.find(l=>{var j;return l.column===((j=t.find(T=>T.as==="date"))==null?void 0:j.name)}))==null?void 0:g.defaultValues},[t,e]),D=De.useCallback(g=>{var l,j;return g.clientColumn&&g.isClientScoped&&g.clientColumnType&&!u?[{columnName:g.clientColumn,value:a,as:g.clientColumnType},...((l=e==null?void 0:e.filter(T=>{var y;return(y=g.dependOn)==null?void 0:y.map(z=>z.value).includes(T.column||"")}))==null?void 0:l.map(T=>({as:"string",columnName:T.column,value:wh({operator:T.operator,value:T.value})})))||[]]:((j=e==null?void 0:e.filter(T=>{var y;return(y=g.dependOn)==null?void 0:y.map(z=>z.value).includes(T.column||"")}))==null?void 0:j.map(T=>({as:"string",columnName:T.column,value:wh({operator:T.operator,value:T.value})})))||[]},[e,a,u]);return v.jsx("div",{className:aM.filterFieldsContainer,children:v.jsxs("div",{className:aM.filterFields,children:[t.length?v.jsx("div",{className:Ua(aM.filterDropdowns,{[aM.gridCol1]:t.length===1,[aM.gridCol2]:t.length===2,[aM.gridCol3]:t.length===3,[aM.gridColAndRow]:t.length>3}),children:t.map(g=>{var l,j,T,y,z;return v.jsxs("div",{className:aM.filterDropdown,style:{borderRadius:o.radius},children:[g.as==="date"&&v.jsx(v.Fragment,{children:v.jsx(HT,{buttonWidth:o.width,label:g.label||g.name,defaultValues:N,variant:o.variant==="static"?"static":"floatingLabel",radius:o.radius,onChange:A=>{A&&n(h=>{var E;const x={column:g.name,operator:"BETWEEN",value:A,as:g.as,defaultValues:A,filterType:g.isShowHorizontal?"horizontal":"global",isFilterApplied:((E=h==null?void 0:h.find(C=>C.as==="date"))==null?void 0:E.isFilterApplied)&&JSON.stringify(A)===JSON.stringify(N)},O=h.findIndex(C=>C.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d})}})}),g.as==="number"&&v.jsx(v.Fragment,{children:v.jsx(Tte,{buttonWidth:o.width,radius:o.radius,variant:o.variant,setAppliedFilters:n,column:g,defaultValues:(l=e.find(A=>A.column===g.name))==null?void 0:l.defaultValues})}),g.as==="string"&&(M!=null&&M.isInternal&&!g.isManualOptions?v.jsx(fd,{labelVariant:o.variant,radius:o.radius,filter:{columnName:g.name,tableName:(j=r==null?void 0:r[0])==null?void 0:j.tableName},workspaceId:M==null?void 0:M.workspaceId,selectedOption:s(g.name,"string")||[],onChange:A=>{if(!A.length){n(h=>h.filter(x=>x.column!==g.name));return}n(h=>{const x={column:g.name,operator:"IN",value:A.map(E=>E.value),as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d})},isSearchEnabled:!0,label:g.label||g.name,filterClause:D(g)}):v.jsx(fl,{buttonWidth:o.width,menuWidth:o.width,radius:o.radius,options:g.isManualOptions?((T=g.manualOptions)==null?void 0:T.map(A=>({value:A,label:A})))||[]:g.options||[],labelVariant:o.variant,selectedOption:s(g.name,"string")||[],onChange:A=>{if(!A.length){n(h=>h.filter(x=>x.column!==g.name));return}n(h=>{const x={column:g.name,operator:"IN",value:A.map(E=>E.value),as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d})},isSearchEnabled:!0,label:g.label||g.name})),g.as==="default"||g.as==="boolean"?M!=null&&M.isInternal&&!g.isManualOptions?v.jsx(ap,{buttonWidth:o.width,menuWidth:o.width,radius:o.radius,filter:{columnName:g.name,tableName:(y=r==null?void 0:r[0])==null?void 0:y.tableName},workspaceId:M==null?void 0:M.workspaceId,labelVariant:o.variant,autoSelected:!1,selectedOption:s(g.name,"boolean"),onChange:A=>n(h=>{const x={column:g.name,operator:"=",value:A.value,as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d}),isSearchEnabled:!0,label:g.label||g.name,filterClause:D(g)}):v.jsx(un,{buttonWidth:o.width,menuWidth:o.width,radius:o.radius,options:g.isManualOptions?((z=g.manualOptions)==null?void 0:z.map(A=>({value:A,label:A})))||[]:g.options||[],labelVariant:o.variant,selectedOption:s(g.name,"boolean"),onChange:A=>n(h=>{const x={column:g.name,operator:"=",value:A.value,as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d}),isSearchEnabled:!0,label:g.label||g.name}):null]},g.name)})}):v.jsx("div",{className:aM.filterDropdowns,children:v.jsx(Pe,{variant:"label",children:"No filter added!"})}),v.jsx("div",{className:aM.AddFilter,children:v.jsx(gQe,{columnList:r[0].columns.filter(g=>!g.isDefault&&!g.isShowHorizontal),setFilterList:i,filterList:t})})]})})},cQe=({appliedfilters:t,setAppliedFilters:i,filters:e,internal:n,clientId:r,isAllClient:M,theme:a})=>{const u=De.useCallback((N,D)=>{var l;const g=((l=t.find(j=>j.column===N))==null?void 0:l.value)||"";return D==="string"?Array.isArray(g)?g.map(j=>({label:j,value:j})):[]:{label:g,value:g}},[t]),o=De.useCallback(N=>{var D,g;return N.clientColumn&&N.isClientScoped&&N.clientColumnType&&!M?[{columnName:N.clientColumn,value:r,as:N.clientColumnType},...((D=t==null?void 0:t.filter(l=>{var j;return(j=N.dependOn)==null?void 0:j.map(T=>T.value).includes(l.column||"")}))==null?void 0:D.map(l=>({as:"string",columnName:l.column,value:wh({operator:l.operator,value:l.value})})))||[]]:((g=t==null?void 0:t.filter(l=>{var j;return(j=N.dependOn)==null?void 0:j.map(T=>T.value).includes(l.column||"")}))==null?void 0:g.map(l=>({as:"string",columnName:l.column,value:wh({operator:l.operator,value:l.value})})))||[]},[t,r,M]),s=(N,D)=>{N&&i(g=>{const l={column:D.name,operator:"BETWEEN",value:N,as:D.as,defaultValues:N,filterType:D.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},j=g.findIndex(y=>y.column===D.name);if(j===-1)return[...g,l];const T=[...g];return T[j]=l,T})};return v.jsx(v.Fragment,{children:e[0].columns.filter(N=>N.isShowHorizontal).map(N=>{var D,g,l,j,T,y;return v.jsxs("div",{className:aM.filterDropdown,style:{borderRadius:a.radius},children:[N.as==="date"&&v.jsx(v.Fragment,{children:v.jsx(HT,{label:N.label||N.name,variant:a.variant==="static"?"static":"floatingLabel",buttonWidth:a.width,radius:a.radius,defaultValues:(D=t.find(z=>z.column===N.name))==null?void 0:D.defaultValues,isDateReset:!t.filter(z=>z.as==="date").length,onChange:z=>s(z,N)})}),N.as==="number"&&v.jsx(Tte,{variant:a.variant,buttonWidth:a.width,radius:a.radius,setAppliedFilters:i,column:N,defaultValues:(g=t.find(z=>z.column===N.name))==null?void 0:g.defaultValues}),N.as==="string"&&(n!=null&&n.isInternal&&!N.isManualOptions?v.jsx(fd,{filter:{columnName:N.name,tableName:(l=e==null?void 0:e[0])==null?void 0:l.tableName},buttonWidth:a.width,menuWidth:a.width,radius:a.radius,workspaceId:n==null?void 0:n.workspaceId,labelVariant:a.variant,selectedOption:u(N.name,"string")||[],autoSelected:!1,onChange:z=>{if(!z.length){i(A=>A.filter(h=>h.column!==N.name));return}i(A=>{const h={column:N.name,operator:"IN",value:z.map(d=>d.value),as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name,filterClause:o(N)}):v.jsx(fl,{buttonWidth:a.width,menuWidth:a.width,options:N.isManualOptions?((j=N.manualOptions)==null?void 0:j.map(z=>({value:z,label:z})))||[]:N.options||[],labelVariant:a.variant,radius:a.radius,selectedOption:u(N.name,"string")||[],onChange:z=>{if(!z.length){i(A=>A.filter(h=>h.column!==N.name));return}i(A=>{const h={column:N.name,operator:"IN",value:z.map(d=>d.value),as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name})),N.as==="default"||N.as==="boolean"?n!=null&&n.isInternal&&!N.isManualOptions?v.jsx(ap,{buttonWidth:a.width,menuWidth:a.width,filter:{columnName:N.name,tableName:(T=e==null?void 0:e[0])==null?void 0:T.tableName},workspaceId:n==null?void 0:n.workspaceId,labelVariant:a.variant,radius:a.radius,autoSelected:!1,selectedOption:u(N.name,"boolean"),onChange:z=>{i(A=>{const h={column:N.name,operator:"=",value:z.value,as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name,filterClause:o(N)}):v.jsx(un,{buttonWidth:a.width,menuWidth:a.width,options:N.isManualOptions?((y=N.manualOptions)==null?void 0:y.map(z=>({value:z,label:z})))||[]:N.options||[],labelVariant:a.variant,radius:a.radius,selectedOption:u(N.name,"boolean"),onChange:z=>{i(A=>{const h={column:N.name,operator:"=",value:z.value,as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name}):null]},N.name)})})},wh=t=>sQe(t.operator)?t.value.map(i=>["true","false"].includes(i)?i==="true":!Number.isNaN(i)&&Number(i)?Number(i):`'${i}'`):DQe(t.operator)?null:["true","false"].includes(t.value)?t.value==="true":!Number.isNaN(t.value)&&Number(t.value)?Number(t.value):`'${t.value}'`,jQe=({filters:t,onApply:i,renderAdditionalHeaderContent:e,internal:n,clientId:r,isAllClient:M,theme:a})=>{const[u,o]=De.useState([]),s=De.useRef(null),[N,D]=De.useState([]),g=t[0].columns.filter(y=>!y.isDefault&&!y.isShowHorizontal).length,l=()=>{var y;o([]),i({tableName:"",filters:[]}),(y=s.current)==null||y.click()},j=y=>{const z=y.map(A=>{const h={column:A.column,operator:A.operator,as:A.as},x=A.as==="date"||A.as==="number"?A.value:wh({operator:A.operator,value:A.value});return x!=null&&Object.assign(h,{...h,value:x}),h});i({tableName:t[0].tableName,filters:z})},T=y=>{var z;y.preventDefault(),o(A=>A.map(h=>({...h,isFilterApplied:!0}))),(z=s.current)==null||z.click()};return De.useEffect(()=>{j(u.filter(y=>y.filterType==="horizontal"||y.isFilterApplied))},[u]),De.useEffect(()=>{var y,z,A,h;if(t[0].columns.length===0){D([]),o([]);return}if(t[0].columns.length&&D(t[0].columns.filter(x=>x.isDefault&&!x.isShowHorizontal)),t.length&&t[0].columns.length){const x=((h=(A=(z=(y=t==null?void 0:t[0])==null?void 0:y.columns)==null?void 0:z.filter(O=>O.isShowHorizontal))==null?void 0:A.map(O=>{var d,E;if(O.defaultValue){let C;switch(O.as){case"string":C={column:O.name,operator:"IN",value:O.defaultValue,as:O.as,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!0};break;case"number":C={column:O.name,operator:"BETWEEN",value:`${(d=O.defaultValue)==null?void 0:d.min} AND ${(E=O.defaultValue)==null?void 0:E.max}`,as:O.as,defaultValues:O.defaultValue,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!!O.isShowHorizontal};break;case"date":{const k=O.defaultValue,Q=k!=null&&k.endDate&&(k!=null&&k.startDate)&&(k!=null&&k.timeGrainValue)?{startDate:new Date(k.startDate),endDate:new Date(k.endDate),timeGrainValue:k.timeGrainValue}:void 0,S=k;C={column:O.name,operator:"BETWEEN",value:S,as:O.as,defaultValues:Q,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!0};break}default:C={column:O.name,operator:"=",value:O.defaultValue,as:O.as,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!0};break}return C}return{column:"none",operator:"=",value:void 0,as:O.as,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!1}}))==null?void 0:h.filter(O=>O.column!=="none"&&O.value!==void 0))||[];o(x)}},[t]),v.jsxs(v.Fragment,{children:[v.jsx(v.Fragment,{children:v.jsxs("div",{className:aM.filterContainer,children:[N.length?v.jsx(Ite,{globalFilterRef:s,appliedfilters:u,setAppliedFilters:o,handleSubmit:T,resetFilters:l,renderAdditionalHeaderContent:e,filters:t,setFilterList:D,filterList:N,internal:n,clientId:r,isAllClient:M,theme:a}):g?v.jsx(Ite,{globalFilterRef:s,appliedfilters:u,setAppliedFilters:o,handleSubmit:T,resetFilters:l,renderAdditionalHeaderContent:e,filters:t,setFilterList:D,filterList:N,internal:n,clientId:r,isAllClient:M,theme:a}):null,t.length&&v.jsx(cQe,{appliedfilters:u,setAppliedFilters:o,filters:t,internal:n,clientId:r,isAllClient:M,theme:a})]})}),u!=null&&u.find(y=>y.filterType==="global"&&!y.isFilterApplied)?v.jsx("div",{className:aM.alertContainer,children:v.jsx(v9,{text:"Global filter selected. Click apply to see the changes."})}):null]})},Ite=({globalFilterRef:t,appliedfilters:i,setAppliedFilters:e,handleSubmit:n,resetFilters:r,renderAdditionalHeaderContent:M,filterList:a,filters:u,setFilterList:o,internal:s,clientId:N,isAllClient:D,theme:g})=>v.jsx(v.Fragment,{children:v.jsx(CD,{position:"bottom",tabMenu:!0,menuWidth:"auto",buttonContent:v.jsxs("div",{className:aM.filterButton,ref:t,children:[v.jsxs("div",{className:aM.filterBtnText,children:[v.jsx(Yt,{name:"funnel"})," Filters"]}),(i==null?void 0:i.length)===0?null:v.jsx("span",{className:aM.filterLength,children:i==null?void 0:i.length})]}),children:v.jsx("div",{className:aM.container,children:v.jsxs("form",{className:aM.form,onSubmit:n,onReset:r,children:[v.jsx("div",{className:aM.filterHeader,children:v.jsxs("div",{className:aM.titleContent,children:[v.jsx(Pe,{children:"Filters"}),M?M():null]})}),v.jsx(lQe,{filterList:a,appliedfilters:i,filters:u,setFilterList:o,setAppliedFilters:e,internal:s,clientId:N,isAllClient:D,theme:g}),v.jsxs("div",{className:aM.buttons,children:[v.jsx(Bt,{type:"reset",variant:"tertiary",leftIcon:v.jsx(Yt,{name:"delete",color:"alert"}),color:"alert",children:v.jsx(Pe,{color:"alert",children:"Reset"})}),v.jsx(Bt,{type:"submit",variant:"primary",children:"Apply"})]})]})})})}),ib={container:"_container_1skzs_1",tooltip:"_tooltip_1skzs_9",top:"_top_1skzs_37",bottom:"_bottom_1skzs_55",left:"_left_1skzs_73",right:"_right_1skzs_91","left-top-end":"_left-top-end_1skzs_109","right-top-end":"_right-top-end_1skzs_127","left-bottom-end":"_left-bottom-end_1skzs_145","right-bottom-end":"_right-bottom-end_1skzs_163","top-left":"_top-left_1skzs_181","top-right":"_top-right_1skzs_199","bottom-left":"_bottom-left_1skzs_217","bottom-right":"_bottom-right_1skzs_235","left-top":"_left-top_1skzs_109","left-bottom":"_left-bottom_1skzs_145","right-top":"_right-top_1skzs_127","right-bottom":"_right-bottom_1skzs_163"},fs=({children:t,text:i,className:e,position:n="bottom",tooltipClass:r=""})=>v.jsxs("div",{className:`${ib.container} ${e}`,children:[t,v.jsx("span",{className:`${ib.tooltip} ${r} ${ib[n]}`,children:i})]}),nb=({children:t,className:i,iconConfig:e,position:n,tooltipClass:r,text:M})=>v.jsx(fs,{className:i,position:n,tooltipClass:r,text:M,children:v.jsx(Yt,{name:"info",size:e==null?void 0:e.size,color:e==null?void 0:e.color})}),Aj={label:"_label_o3uvq_1","inputField-container":"_inputField-container_o3uvq_7",upperContainer:"_upperContainer_o3uvq_13",input:"_input_o3uvq_7",inputWrapper:"_inputWrapper_o3uvq_25",supportText:"_supportText_o3uvq_31",error:"_error_o3uvq_37",noError:"_noError_o3uvq_43",inputContainer:"_inputContainer_o3uvq_49",errorIcon:"_errorIcon_o3uvq_55",floatingLabel:"_floatingLabel_o3uvq_63"},yi=({type:t="text",register:i,label:e,isDisabled:n,id:r,elementRef:M,error:a,supportingText:u,leftIcon:o,rightIcon:s,labelVariant:N="static",...D})=>v.jsxs("div",{className:Aj["inputField-container"],children:[v.jsxs("div",{className:Aj.upperContainer,children:[e?v.jsx("label",{htmlFor:r,className:N==="static"?Aj.label:Aj.floatingLabel,children:e}):null,v.jsxs("div",{className:Aj.inputContainer,children:[o,v.jsx("input",{...D,ref:M,id:r,type:t,className:`${Aj.input} ${D.className||""} ${a?Aj.error:Aj.noError}`,...i,disabled:n}),s]})]}),u&&v.jsx("div",{className:Aj.supportText,children:u}),a&&v.jsx(Pe,{variant:"body-text-sm",color:"alert",children:a})]}),rb={csvlink:"_csvlink_11u8o_1",noChart:"_noChart_11u8o_7"},TQe=t=>{var n;const i=(n=t.current)==null?void 0:n.getEchartsInstance();return i?i.getConnectedDataURL({type:"png",pixelRatio:2,excludeComponents:["toolbox"],backgroundColor:"#fff"}):"#"},IQe=({className:t,iconClass:i,fileName:e="chart",text:n,chartRef:r})=>v.jsxs("a",{href:TQe(r),download:`${e}.png`,className:t??rb.csvlink,target:"_self",children:[v.jsx(Yt,{name:"image"}),n]}),yQe=(t,i)=>{const e=[];if(t!=null&&t.pivotTableSettings){const n=t.pivotTableSettings.rows||[],r=t.pivotTableSettings.columns||[],M=tb(i,r,n),a=[],u=[],o=M[n[0]];o.map(s=>{const N=s.parent;if(N.includes("/")){const D=N.lastIndexOf("/"),g=[N.substring(0,D),N.substring(D+1)];a.includes(g[1])||a.push(g[1]),u.includes(g[0])||u.push(g[0])}else u.push(N),a.push(N)}),u.forEach(s=>{const N={};N.keys=s,a.forEach(D=>{N[`${n[0]} - ${D}`]=null}),e.push(N)});for(let s=0;s<e.length;s+=1){const N=e[s];Object.keys(N).map(D=>{const g=D.split(" - ");o.map(l=>{l.parent.includes("/")?l.parent===`${N.keys}/${g[1]}`&&g[0]===n[0]&&(N[D]=l.name):l.parent===g[1]&&g[0]===n[0]&&(N[D]=l.name)})})}if(n.length>1)for(let s=1;s<n.length;s+=1){const N=[],D=M[n[s]];D.map(g=>{const l=g.parent;if(l.includes("/")){const j=l.lastIndexOf("/"),T=[l.substring(0,j),l.substring(j+1)];N.includes(T[0])||N.push(T[0])}else N.push(l)}),N.forEach(g=>{e.map(l=>{l.keys===g&&a.forEach(j=>{l[`${n[s]} - ${j}`]=null})})});for(let g=0;g<e.length;g+=1){const l=e[g];Object.keys(l).map(j=>{const T=j.split(" - ");D.map(y=>{y.parent.includes("/")?y.parent===`${l.keys}/${T[1]}`&&T[0]===n[s]&&(l[j]=y.name):y.parent===T[1]&&T[0]===n[s]&&(l[j]=y.name)})})}}if(r.length>2)for(let s=0;s<e.length;s+=1){const N=e[s],D=N.keys.replace(/\//g,",");N.keys=`(${D})`.replace(/\b(\w+)\b/g,"'$1'")}else if(r.length===1){const s="keys";e.forEach(N=>{delete N[s]}),e.splice(1)}}return e},zQe=({data:t=[],fileName:i="export",className:e,text:n="",chartOptions:r})=>{const M=yQe(r,t);return v.jsxs("a",{href:Nle(M),download:`${i}.csv`,className:e??rb.csvlink,target:"_self",children:[v.jsx(Yt,{name:"task-done-file"}),n]})},yte=({fileName:t,companyIntegrationId:i,integrationName:e,query:n,className:r,children:M})=>{const[a,u]=De.useState(!1),o=De.useCallback(async()=>{try{u(!0);const s=await fetch(rge,{method:"POST",body:JSON.stringify({companyIntegrationId:i,integrationName:e,query:n,name:t}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error("Network response was not ok");const N=await s.blob(),D=URL.createObjectURL(N),g=document.createElement("a");g.href=D,g.download=`${t}.zip`,g.style.display="none",document.body.appendChild(g),u(!1),g.click(),URL.revokeObjectURL(D),document.body.removeChild(g)}catch{u(!1),alert("Error downloading the file. Please try later.")}},[i,e,n,t]);return v.jsx("button",{type:"button",className:r??rb.csvlink,onClick:o,disabled:a,children:a?v.jsx(XA,{}):M})},zte={"header-container":"_header-container_r1zlv_1",headingText:"_headingText_r1zlv_13","btn-container":"_btn-container_r1zlv_17","back-btn":"_back-btn_r1zlv_21","save-btn":"_save-btn_r1zlv_25"},AQe=({setShowMetricCreateModal:t,isDisableSaveBtn:i,heading:e,setShowSaveMetricModal:n})=>{const[r,M]=De.useState(!1);return v.jsxs("div",{className:zte["header-container"],children:[v.jsxs("div",{className:zte["btn-container"],children:[v.jsx(Bt,{type:"button",variant:"tab",onClick:()=>t(!1),leftIcon:v.jsx(Yt,{name:"arrow-left"})}),v.jsx("div",{children:r&&e==="Update Metric"?v.jsxs("div",{className:"dbn-relative",children:[v.jsx(yi,{defaultValue:e,placeholder:"Edit Title",required:!0}),v.jsx("span",{className:"dbn-absolute -dbn-right-6 -dbn-top-1 dbn-cursor-pointer",onClick:()=>M(a=>!a),children:v.jsx(Yt,{name:"pencil-simple",size:"xs"})})]}):v.jsx("div",{className:"dbn-relative",children:v.jsxs("div",{className:"dbn-flex dbn-gap-2 dbn-items-center",children:[v.jsx(Bt,{type:"button",variant:"popover",isDisabled:!e,children:e||"Untitled metric"}),e==="Update Metric"?v.jsx("span",{className:"dbn-cursor-pointer",onClick:()=>M(a=>!a),children:v.jsx(Yt,{name:"pencil-simple",size:"xs"})}):null]})})})]}),v.jsx(Bt,{type:"submit",variant:"tab",isDisabled:i,onClick:()=>n(!0),leftIcon:v.jsx(Yt,{name:"save"}),children:"Save"})]})},Av={"create-btn":"_create-btn_170wz_1",metricCreateModalHeader:"_metricCreateModalHeader_170wz_5",metricCreateModalContent:"_metricCreateModalContent_170wz_9",isShowMetricCreateModal:"_isShowMetricCreateModal_170wz_13","query-modal":"_query-modal_170wz_17"},fj={container:"_container_14ypl_1",header:"_header_14ypl_5",wrapper:"_wrapper_14ypl_9","col-container":"_col-container_14ypl_13",column:"_column_14ypl_17",columnText:"_columnText_14ypl_21",heading:"_heading_14ypl_25",customButton:"_customButton_14ypl_29",listVal:"_listVal_14ypl_33",handleIcon:"_handleIcon_14ypl_37"},Mb=({identifier:t,data:i,renderItem:e,CustomDragPreview:n,modifiers:r,events:M})=>{const{DragNodeRef:a,isDragging:u}=rle({identifier:t,data:i,CustomDragPreview:n,modifiers:r,events:M});return e(a,u)},fQe=({setselectTable:t,selectTable:i,tableList:e,columnList:n,onChangeTableSelection:r})=>{const[M,a]=De.useState("");return v.jsxs("div",{className:fj.container,children:[v.jsxs("div",{className:fj.heading,children:[v.jsx(Yt,{name:"database",size:"xl"}),v.jsx(Pe,{variant:"heading-lg",children:"Data"})]}),v.jsxs("div",{className:fj.header,children:[v.jsx(GS,{setSearchKeyword:a}),v.jsx("div",{className:"dbn-w-full",children:v.jsx(un,{onChange:u=>{t(u),r(u.value)},selectedOption:i,options:e,customButton:v.jsxs("div",{className:fj.customButton,children:[v.jsx(Yt,{name:"table"})," ",i.label?i.label:"Select table from dropdown"]}),labelVariant:"static",buttonWidth:"100%",menuWidth:"100%"})})]}),v.jsx("div",{className:fj.wrapper,children:v.jsx("div",{className:fj["col-container"],children:n.filter(u=>u.label.includes(M)).map(u=>{var N;const[,o,s]=(N=u==null?void 0:u.value)==null?void 0:N.split("____");return v.jsx(Mb,{data:u,identifier:{id:u.value,type:"column"},CustomDragPreview:v.jsx("span",{className:fj.listVal,children:u.label}),modifiers:{highlightDrop:{onDrag:!0}},renderItem:D=>v.jsxs("div",{className:fj.column,ref:D,children:[v.jsxs("span",{className:fj.handleIcon,children:[v.jsx(Yt,{name:"kebab-menu-vertical",size:"xs"}),v.jsx(Yt,{name:"kebab-menu-vertical",size:"xs"})]}),v.jsxs("span",{className:"dbn-flex dbn-items-end dbn-gap-2 dbn-truncate",children:[v.jsx("span",{children:v.jsx(Ese,{datatype:s})}),v.jsx(Pe,{variant:"body-text-sm",children:o})]})]},o)})})})})]})},ED={searchCommand:"_searchCommand_11joi_1","chartTab-container":"_chartTab-container_11joi_9",chartText:"_chartText_11joi_17",chartSettingButton:"_chartSettingButton_11joi_25",chartSettingMenu:"_chartSettingMenu_11joi_33",charts:"_charts_11joi_41",metricChart:"_metricChart_11joi_49",metricChartHeader:"_metricChartHeader_11joi_57",metricChartEmpty:"_metricChartEmpty_11joi_65","chartTab-wrapper":"_chartTab-wrapper_11joi_73","chartTab-wrapper-head":"_chartTab-wrapper-head_11joi_81",fullQuery:"_fullQuery_11joi_89",fullQueryIcon:"_fullQueryIcon_11joi_97",noQuery:"_noQuery_11joi_105","tableTab-header":"_tableTab-header_11joi_113","chartButton-header":"_chartButton-header_11joi_121",chartButtonContainer:"_chartButtonContainer_11joi_129",searchWrapper:"_searchWrapper_11joi_137",searchIcon:"_searchIcon_11joi_145",chartConfigure:"_chartConfigure_11joi_153",chartSettings:"_chartSettings_11joi_161",labels:"_labels_11joi_169",chartButtons:"_chartButtons_11joi_177",chartButton:"_chartButton_11joi_121","loader-container":"_loader-container_11joi_193"},UN={listbox:"_listbox_hfzpa_1","listBox-label":"_listBox-label_hfzpa_5","listBox-labelFloating":"_listBox-labelFloating_hfzpa_9","listBoxButton-container":"_listBoxButton-container_hfzpa_13","listBoxButton-containerFloating":"_listBoxButton-containerFloating_hfzpa_17",listBoxButton:"_listBoxButton_hfzpa_13","listBox-options":"_listBox-options_hfzpa_25",selectedOptionText:"_selectedOptionText_hfzpa_29",transitionDiv:"_transitionDiv_hfzpa_33",listboxButtonWrapper:"_listboxButtonWrapper_hfzpa_37",arrowicon:"_arrowicon_hfzpa_40",leave:"_leave_hfzpa_43",leaveFrom:"_leaveFrom_hfzpa_46",leaveTo:"_leaveTo_hfzpa_49",notAvailable:"_notAvailable_hfzpa_52",option:"_option_hfzpa_55",activeOption:"_activeOption_hfzpa_58",optionSelected:"_optionSelected_hfzpa_61",inactiveOption:"_inactiveOption_hfzpa_64",optionLabel:"_optionLabel_hfzpa_67",optionSubLabel:"_optionSubLabel_hfzpa_70",selectedLabel:"_selectedLabel_hfzpa_73",nonselectedLabel:"_nonselectedLabel_hfzpa_76",check:"_check_hfzpa_79",checkActive:"_checkActive_hfzpa_82",checkInactive:"_checkInactive_hfzpa_85",checkIcon:"_checkIcon_hfzpa_88",checkIconSelected:"_checkIconSelected_hfzpa_91",checkIconUnselected:"_checkIconUnselected_hfzpa_94",loadMore:"_loadMore_hfzpa_97",loadMoreIcon:"_loadMoreIcon_hfzpa_100",selectedList:"_selectedList_hfzpa_103",selectedListItem:"_selectedListItem_hfzpa_106",label:"_label_hfzpa_109",search:"_search_hfzpa_112",searchDiv:"_searchDiv_hfzpa_116"},dQe=({options:t,defaultValue:i,value:e,onChange:n,label:r,name:M,className:a="",children:u,placeHolder:o,onClick:s,isSearchEnabled:N,containerClass:D="",labelVariant:g="static",icon:l,isDisableShowSelectedTag:j})=>{const[T,y]=De.useState(""),[z,A]=De.useState(20),[h,x]=De.useState(!1),O=De.useRef(),d=De.useMemo(()=>T?t.filter(E=>E.label.toLowerCase().includes(T)).slice(0,z):t.slice(0,z),[T,t,z]);return J6({wrapRef:O,onOutsideClick:()=>x(!1)}),De.useEffect(()=>{i&&i.length&&(n==null||n(i))},[]),v.jsx(v.Fragment,{children:v.jsxs("div",{ref:O,className:`${UN.listbox} ${D}`,children:[l,r?v.jsx("label",{className:`${UN["listBox-label"]} ${g==="floating"?UN["listBox-labelFloating"]:""}`,children:r}):null,v.jsxs("div",{className:UN.listboxButtonWrapper,children:[v.jsx("div",{className:`${UN["listBoxButton-container"]} ${a} ${g==="floating"?UN["listBoxButton-containerFloating"]:""}`,children:v.jsxs(Bt,{variant:"tertiary",type:"button",onClick:()=>x(E=>!E),name:M,children:[v.jsx("span",{className:UN.selectedOptionText,children:o||"Choose options from list"}),v.jsx("span",{className:UN.listBoxButton,children:v.jsx(Yt,{name:"chevron-down"})})]})}),h&&v.jsxs("div",{className:UN["listBox-options"],children:[N&&v.jsx(GS,{className:UN.search,setSearchKeyword:y}),d.length===0?v.jsx("div",{className:UN.notAvailable,children:"Not Available."}):d.map(E=>v.jsx("div",{className:Ua(e!=null&&e.includes(E.value)?UN.optionSelected:"",UN.option),onClick:()=>{e!=null&&e.find(C=>C===E.value)?n==null||n(e.filter(C=>C!==E.value)):n==null||n([...e||[],E.value]),s==null||s()},children:v.jsxs(Bt,{type:"button",variant:"tertiary",onClick:()=>{e!=null&&e.find(C=>C===E.value)?n==null||n(e.filter(C=>C!==E.value)):n==null||n([...e||[],E.value]),s==null||s()},children:[v.jsx(lL,{checked:e==null?void 0:e.includes(E.value),onClick:()=>{e!=null&&e.find(C=>C===E.value)?n==null||n(e.filter(C=>C!==E.value)):n==null||n([...e||[],E.value]),s==null||s()}}),E.label]},E.value)})),z<=t.length&&v.jsx(Bt,{variant:"tertiary",type:"button",onClick:()=>A(z+30),rightIcon:v.jsx(Yt,{name:"chevron-down"}),children:"Load More"}),u]})]}),e!=null&&e.length&&!j?v.jsx("div",{className:UN.selectedList,children:e.map(E=>{var C;return v.jsx(Pe,{variant:"body-text-sm",children:(C=t.find(k=>k.value===E))==null?void 0:C.label},E)})}):null]})})},Ch="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjY0IiBoZWlnaHQ9IjIwNiIgdmlld0JveD0iMCAwIDI2NCAyMDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTQyLjkyNSAwQzExOC43ODQgMCA5Ni41OTU5IDguMzY4MjggNzkuMDc1OCAyMi4zNjkxSDUwLjc2QzQ3LjA4MTIgMjIuMzY5MSA0NC4wNzEzIDI1LjM4ODkgNDQuMDcxMyAyOS4wNzk4QzQ0LjA3MTMgMzIuNzcwNyA0Ny4wODEyIDM1Ljc5MDYgNTAuNzYgMzUuNzkwNkg2NS4xNzA3SDY5LjM5MzZDNzMuMDcyNCAzNS43OTA2IDc2LjA4MjMgMzguODEwNCA3Ni4wODIzIDQyLjUwMTNDNzYuMDgyMyA0NC4zNDQ1IDc1LjMyODcgNDYuMDI2NyA3NC4xMTU4IDQ3LjIzOTFDNzIuOTA3NCA0OC40NTU5IDcxLjIzMDggNDkuMjEyIDY5LjM5MzYgNDkuMjEySDYwLjM4NDNINTUuNDA5NkgzMS4xMzk3QzI3LjQ2MDkgNDkuMjEyIDI0LjQ1MDkgNTIuMjMxOCAyNC40NTA5IDU1LjkyMjdDMjQuNDUwOSA1OS42MTM2IDI3LjQ2MDkgNjIuNjMzNSAzMS4xMzk3IDYyLjYzMzVINDguNTE0NEM0My4yNjk1IDc1IDQwLjM2NDQgODguNjA3MSA0MC4zNjQ0IDEwMi44OThDNDAuMzY0NCAxMDguMDgzIDQwLjc0NzkgMTEzLjE3OSA0MS40ODM2IDExOC4xNThDNDEuNzkxMy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bGlwMF80MzJfNTA5NyI+CjxyZWN0IHg9IjkwLjk5OTgiIHk9IjUwIiB3aWR0aD0iMTExIiBoZWlnaHQ9Ijg2IiByeD0iMTAiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjxjbGlwUGF0aCBpZD0iY2xpcDFfNDMyXzUwOTciPgo8cmVjdCB4PSI2Ny45OTk4IiB5PSI3NiIgd2lkdGg9IjExMSIgaGVpZ2h0PSI4NiIgcng9IjEwIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=",OQe=({data:t,isLoading:i,headerChild:e,chartSettings:n,setChartSettings:r,chartColors:M,handleChartRightClick:a,chartClickConfig:u,chartPopupChild:o,isEnablePivotTable:s,groupbyList:N,hasNumberKeys:D,isEnableGauge:g,error:l})=>{var y,z,A,h,x,O;const j=De.useRef(null),T=De.useMemo(()=>zv({chartOptions:n,data:t||[],colors:M}),[t,n,M]);return v.jsxs("div",{className:ED["chartTab-container"],children:[v.jsxs("div",{className:ED.metricChartHeader,children:[e,(y=n.customSettings)!=null&&y.showSelectLegend?v.jsx(dQe,{name:"legend",options:(A=(z=T==null?void 0:T.legend)==null?void 0:z.data)!=null&&A.length?(h=T.legend.data)==null?void 0:h.map(d=>({value:d,label:d})):[],onChange:d=>{r(E=>({...E,selectedSeries:d}))},value:n.selectedSeries,isDisableShowSelectedTag:!0,isSearchEnabled:!0}):null]}),i&&v.jsx("div",{className:ED["loader-container"],children:v.jsx(XA,{})}),!l&&!n.xAxis&&!((x=n.yAxisList)!=null&&x.length)&&!i&&v.jsxs("div",{className:ED.metricChartEmpty,children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx(Pe,{variant:"heading-lg",children:"Choose a table to create your metric"}),v.jsx("div",{className:ED.chartButton,children:v.jsx(Pe,{variant:"body-text-sm",children:"Drag and Drop columns to visualize the chart"})})]}),t!=null&&t.length&&!i&&(n.xAxis||(O=n.yAxisList)!=null&&O.length)?v.jsx("div",{className:ED.metricChart,children:v.jsx("div",{className:ED["chartTab-wrapper"],children:t.length?v.jsxs("div",{className:ED.labels,children:[v.jsx(NL,{chartOptions:n,data:t,filterValues:[],onMaximize:()=>{},colors:M,events:{click:d=>{a&&a(d)},contextmenu:d=>{a&&a(d)}},config:{chartClickConfig:u,ref:j,onColumnSizingChange:d=>r(E=>({...E,tableSettings:{...E.tableSettings,columnSizing:d}}))}}),o]}):v.jsxs("div",{className:ED.metricChartEmpty,children:[v.jsx("div",{className:ED.searchWrapper,children:v.jsx(Yt,{name:"magnifying-glass"})}),v.jsx("div",{className:ED.message,children:v.jsx(Pe,{variant:"body-text-sm",children:"Uh-oh, Nothing to display"})}),v.jsx("div",{className:ED.chartButton,children:v.jsx(Pe,{variant:"body-text-sm",children:"Choose an appropriate chart type and start visulaizing your data"})})]})})}):null,l&&!i?v.jsx("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center",children:v.jsx(Pe,{variant:"heading-lg",color:"alert",children:l})}):null]})},fv={container:"_container_zgdws_1",header:"_header_zgdws_5","text-container":"_text-container_zgdws_9","btn-container":"_btn-container_zgdws_13",tabButton:"_tabButton_zgdws_16",selectedTab:"_selectedTab_zgdws_19",activeTab:"_activeTab_zgdws_23",metricChartEmpty:"_metricChartEmpty_zgdws_26",table:"_table_zgdws_30","sql-btn":"_sql-btn_zgdws_34","sql-btn-disabled":"_sql-btn-disabled_zgdws_38","save-btn-icon":"_save-btn-icon_zgdws_42"},hQe=({outpuTableData:t,outputError:i,isOutputLoading:e,isUpdateMetric:n,isDisableSqlBtn:r,setShowSqlModal:M})=>v.jsx("div",{className:fv.container,children:t!=null&&t.length&&!i?v.jsx("div",{className:fv.table,children:v.jsx(Wv,{data:t,filterValues:[],onMaximize:()=>{},isLoading:e,error:i,tableSettings:{showTableTitle:!1,hideVerticalDivider:!1,showRowHover:!1,enableStripedRows:!1,enableTableSearch:!1,contentAlignment:"left",enableFilter:!1,enableSorting:!0,lineGap:"",showTableDesc:!1},headerAlignment:"left"})}):v.jsx(v.Fragment,{children:i?v.jsx("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center",children:v.jsx(Pe,{variant:"heading-lg",color:"alert",children:i})}):v.jsxs("div",{className:fv.metricChartEmpty,children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx(Pe,{variant:"heading-lg",children:"Choose a table to create your metric"}),v.jsx("div",{className:fv.chartButton,children:v.jsx(Pe,{variant:"body-text-sm",children:"Drag and Drop columns to visualize the chart"})})]})})}),Aa={"main-container":"_main-container_i1qa3_1",mainContainerUpdate:"_mainContainerUpdate_i1qa3_4","outputTab-header":"_outputTab-header_i1qa3_8",selection:"_selection_i1qa3_12",selectionContainer:"_selectionContainer_i1qa3_16",listContainer:"_listContainer_i1qa3_20",listVal:"_listVal_i1qa3_24",removeColumn:"_removeColumn_i1qa3_28",columnContainer:"_columnContainer_i1qa3_36",selectedCol:"_selectedCol_i1qa3_40",wrapper:"_wrapper_i1qa3_44",visualization:"_visualization_i1qa3_48",visualizationTabCollapsed:"_visualizationTabCollapsed_i1qa3_52",tableTab:"_tableTab_i1qa3_56",noCursor:"_noCursor_i1qa3_60",tableTabExpanded:"_tableTabExpanded_i1qa3_64",searchCommand:"_searchCommand_i1qa3_67",tabButton:"_tabButton_i1qa3_70",tabActive:"_tabActive_i1qa3_73",dynamicGroupFormat:"_dynamicGroupFormat_i1qa3_76",wrapperHead:"_wrapperHead_i1qa3_80",features:"_features_i1qa3_84"},LQe=({name:t,styles:i,placeholder:e,enabled:n})=>v.jsxs("label",{htmlFor:t,className:`${i.button}`,children:[typeof e=="string"&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:` ${i.switch} ${n?i.enabled:i.notenabled}`}),v.jsx("span",{className:i.label,children:e})]}),!Array.isArray(e)&&typeof e!="string"&&v.jsx("span",{className:` ${i.switch} ${n?i.enabled:i.notenabled}`})]}),ab={group:"_group_1y2gh_1",button:"_button_1y2gh_5",checkbox:"_checkbox_1y2gh_9",switch:"_switch_1y2gh_13",enabled:"_enabled_1y2gh_22",notenabled:"_notenabled_1y2gh_30",label:"_label_1y2gh_38"},zn=({enabled:t,onChange:i,placeholder:e,defaultEnabled:n,name:r=`toggle-${Date.now()}`,isDisabled:M})=>v.jsxs("div",{className:ab.group,children:[v.jsx("input",{type:"checkbox",id:r,checked:n,onChange:({target:a})=>i==null?void 0:i(a.checked),className:ab.checkbox,disabled:M}),v.jsx(LQe,{name:r,styles:ab,placeholder:e,enabled:t})]});var Ate=De.createContext(),fte=De.createContext();function xQe(t){var i=t.children,e=De.useState(null),n=e[0],r=e[1],M=De.useRef(!1);De.useEffect(function(){return function(){M.current=!0}},[]);var a=De.useCallback(function(u){M.current||r(u)},[]);return De.createElement(Ate.Provider,{value:n},De.createElement(fte.Provider,{value:a},i))}var dte=function(i){return Array.isArray(i)?i[0]:i},Ote=function(i){if(typeof i=="function"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return i.apply(void 0,n)}},ub=function(i,e){if(typeof i=="function")return Ote(i,e);i!=null&&(i.current=e)},hte=function(i){return i.reduce(function(e,n){var r=n[0],M=n[1];return e[r]=M,e},{})},Lte=typeof window<"u"&&window.document&&window.document.createElement?De.useLayoutEffect:De.useEffect,mN="top",vD="bottom",SD="right",YN="left",ob="auto",Qh=[mN,vD,SD,YN],LA="start",kh="end",pQe="clippingParents",xte="viewport",Uh="popper",EQe="reference",pte=Qh.reduce(function(t,i){return t.concat([i+"-"+LA,i+"-"+kh])},[]),Ete=[].concat(Qh,[ob]).reduce(function(t,i){return t.concat([i,i+"-"+LA,i+"-"+kh])},[]),vQe="beforeRead",SQe="read",wQe="afterRead",CQe="beforeMain",QQe="main",kQe="afterMain",UQe="beforeWrite",mQe="write",YQe="afterWrite",bQe=[vQe,SQe,wQe,CQe,QQe,kQe,UQe,mQe,YQe];function $l(t){return t?(t.nodeName||"").toLowerCase():null}function ds(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var i=t.ownerDocument;return i&&i.defaultView||window}return t}function vz(t){var i=ds(t).Element;return t instanceof i||t instanceof Element}function wD(t){var i=ds(t).HTMLElement;return t instanceof i||t instanceof HTMLElement}function Nb(t){if(typeof ShadowRoot>"u")return!1;var i=ds(t).ShadowRoot;return t instanceof i||t instanceof ShadowRoot}function _Qe(t){var i=t.state;Object.keys(i.elements).forEach(function(e){var n=i.styles[e]||{},r=i.attributes[e]||{},M=i.elements[e];!wD(M)||!$l(M)||(Object.assign(M.style,n),Object.keys(r).forEach(function(a){var u=r[a];u===!1?M.removeAttribute(a):M.setAttribute(a,u===!0?"":u)}))})}function RQe(t){var i=t.state,e={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(i.elements.popper.style,e.popper),i.styles=e,i.elements.arrow&&Object.assign(i.elements.arrow.style,e.arrow),function(){Object.keys(i.elements).forEach(function(n){var r=i.elements[n],M=i.attributes[n]||{},a=Object.keys(i.styles.hasOwnProperty(n)?i.styles[n]:e[n]),u=a.reduce(function(o,s){return o[s]="",o},{});!wD(r)||!$l(r)||(Object.assign(r.style,u),Object.keys(M).forEach(function(o){r.removeAttribute(o)}))})}}const PQe={name:"applyStyles",enabled:!0,phase:"write",fn:_Qe,effect:RQe,requires:["computeStyles"]};function Wl(t){return t.split("-")[0]}var Sz=Math.max,dv=Math.min,xA=Math.round;function sb(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(i){return i.brand+"/"+i.version}).join(" "):navigator.userAgent}function vte(){return!/^((?!chrome|android).)*safari/i.test(sb())}function pA(t,i,e){i===void 0&&(i=!1),e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,M=1;i&&wD(t)&&(r=t.offsetWidth>0&&xA(n.width)/t.offsetWidth||1,M=t.offsetHeight>0&&xA(n.height)/t.offsetHeight||1);var a=vz(t)?ds(t):window,u=a.visualViewport,o=!vte()&&e,s=(n.left+(o&&u?u.offsetLeft:0))/r,N=(n.top+(o&&u?u.offsetTop:0))/M,D=n.width/r,g=n.height/M;return{width:D,height:g,top:N,right:s+D,bottom:N+g,left:s,x:s,y:N}}function Db(t){var i=pA(t),e=t.offsetWidth,n=t.offsetHeight;return Math.abs(i.width-e)<=1&&(e=i.width),Math.abs(i.height-n)<=1&&(n=i.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:n}}function Ste(t,i){var e=i.getRootNode&&i.getRootNode();if(t.contains(i))return!0;if(e&&Nb(e)){var n=i;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function dj(t){return ds(t).getComputedStyle(t)}function VQe(t){return["table","td","th"].indexOf($l(t))>=0}function CT(t){return((vz(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ov(t){return $l(t)==="html"?t:t.assignedSlot||t.parentNode||(Nb(t)?t.host:null)||CT(t)}function wte(t){return!wD(t)||dj(t).position==="fixed"?null:t.offsetParent}function FQe(t){var i=/firefox/i.test(sb()),e=/Trident/i.test(sb());if(e&&wD(t)){var n=dj(t);if(n.position==="fixed")return null}var r=Ov(t);for(Nb(r)&&(r=r.host);wD(r)&&["html","body"].indexOf($l(r))<0;){var M=dj(r);if(M.transform!=="none"||M.perspective!=="none"||M.contain==="paint"||["transform","perspective"].indexOf(M.willChange)!==-1||i&&M.willChange==="filter"||i&&M.filter&&M.filter!=="none")return r;r=r.parentNode}return null}function mh(t){for(var i=ds(t),e=wte(t);e&&VQe(e)&&dj(e).position==="static";)e=wte(e);return e&&($l(e)==="html"||$l(e)==="body"&&dj(e).position==="static")?i:e||FQe(t)||i}function gb(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Yh(t,i,e){return Sz(t,dv(i,e))}function $Qe(t,i,e){var n=Yh(t,i,e);return n>e?e:n}function Cte(){return{top:0,right:0,bottom:0,left:0}}function Qte(t){return Object.assign({},Cte(),t)}function kte(t,i){return i.reduce(function(e,n){return e[n]=t,e},{})}var WQe=function(i,e){return i=typeof i=="function"?i(Object.assign({},e.rects,{placement:e.placement})):i,Qte(typeof i!="number"?i:kte(i,Qh))};function BQe(t){var i,e=t.state,n=t.name,r=t.options,M=e.elements.arrow,a=e.modifiersData.popperOffsets,u=Wl(e.placement),o=gb(u),s=[YN,SD].indexOf(u)>=0,N=s?"height":"width";if(!(!M||!a)){var D=WQe(r.padding,e),g=Db(M),l=o==="y"?mN:YN,j=o==="y"?vD:SD,T=e.rects.reference[N]+e.rects.reference[o]-a[o]-e.rects.popper[N],y=a[o]-e.rects.reference[o],z=mh(M),A=z?o==="y"?z.clientHeight||0:z.clientWidth||0:0,h=T/2-y/2,x=D[l],O=A-g[N]-D[j],d=A/2-g[N]/2+h,E=Yh(x,d,O),C=o;e.modifiersData[n]=(i={},i[C]=E,i.centerOffset=E-d,i)}}function HQe(t){var i=t.state,e=t.options,n=e.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=i.elements.popper.querySelector(r),!r)||Ste(i.elements.popper,r)&&(i.elements.arrow=r))}const GQe={name:"arrow",enabled:!0,phase:"main",fn:BQe,effect:HQe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function EA(t){return t.split("-")[1]}var ZQe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function JQe(t,i){var e=t.x,n=t.y,r=i.devicePixelRatio||1;return{x:xA(e*r)/r||0,y:xA(n*r)/r||0}}function Ute(t){var i,e=t.popper,n=t.popperRect,r=t.placement,M=t.variation,a=t.offsets,u=t.position,o=t.gpuAcceleration,s=t.adaptive,N=t.roundOffsets,D=t.isFixed,g=a.x,l=g===void 0?0:g,j=a.y,T=j===void 0?0:j,y=typeof N=="function"?N({x:l,y:T}):{x:l,y:T};l=y.x,T=y.y;var z=a.hasOwnProperty("x"),A=a.hasOwnProperty("y"),h=YN,x=mN,O=window;if(s){var d=mh(e),E="clientHeight",C="clientWidth";if(d===ds(e)&&(d=CT(e),dj(d).position!=="static"&&u==="absolute"&&(E="scrollHeight",C="scrollWidth")),d=d,r===mN||(r===YN||r===SD)&&M===kh){x=vD;var k=D&&d===O&&O.visualViewport?O.visualViewport.height:d[E];T-=k-n.height,T*=o?1:-1}if(r===YN||(r===mN||r===vD)&&M===kh){h=SD;var Q=D&&d===O&&O.visualViewport?O.visualViewport.width:d[C];l-=Q-n.width,l*=o?1:-1}}var S=Object.assign({position:u},s&&ZQe),b=N===!0?JQe({x:l,y:T},ds(e)):{x:l,y:T};if(l=b.x,T=b.y,o){var Y;return Object.assign({},S,(Y={},Y[x]=A?"0":"",Y[h]=z?"0":"",Y.transform=(O.devicePixelRatio||1)<=1?"translate("+l+"px, "+T+"px)":"translate3d("+l+"px, "+T+"px, 0)",Y))}return Object.assign({},S,(i={},i[x]=A?T+"px":"",i[h]=z?l+"px":"",i.transform="",i))}function XQe(t){var i=t.state,e=t.options,n=e.gpuAcceleration,r=n===void 0?!0:n,M=e.adaptive,a=M===void 0?!0:M,u=e.roundOffsets,o=u===void 0?!0:u,s={placement:Wl(i.placement),variation:EA(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:r,isFixed:i.options.strategy==="fixed"};i.modifiersData.popperOffsets!=null&&(i.styles.popper=Object.assign({},i.styles.popper,Ute(Object.assign({},s,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:a,roundOffsets:o})))),i.modifiersData.arrow!=null&&(i.styles.arrow=Object.assign({},i.styles.arrow,Ute(Object.assign({},s,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})}const KQe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:XQe,data:{}};var hv={passive:!0};function qQe(t){var i=t.state,e=t.instance,n=t.options,r=n.scroll,M=r===void 0?!0:r,a=n.resize,u=a===void 0?!0:a,o=ds(i.elements.popper),s=[].concat(i.scrollParents.reference,i.scrollParents.popper);return M&&s.forEach(function(N){N.addEventListener("scroll",e.update,hv)}),u&&o.addEventListener("resize",e.update,hv),function(){M&&s.forEach(function(N){N.removeEventListener("scroll",e.update,hv)}),u&&o.removeEventListener("resize",e.update,hv)}}const eke={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:qQe,data:{}};var tke={left:"right",right:"left",bottom:"top",top:"bottom"};function Lv(t){return t.replace(/left|right|bottom|top/g,function(i){return tke[i]})}var ike={start:"end",end:"start"};function mte(t){return t.replace(/start|end/g,function(i){return ike[i]})}function lb(t){var i=ds(t),e=i.pageXOffset,n=i.pageYOffset;return{scrollLeft:e,scrollTop:n}}function cb(t){return pA(CT(t)).left+lb(t).scrollLeft}function nke(t,i){var e=ds(t),n=CT(t),r=e.visualViewport,M=n.clientWidth,a=n.clientHeight,u=0,o=0;if(r){M=r.width,a=r.height;var s=vte();(s||!s&&i==="fixed")&&(u=r.offsetLeft,o=r.offsetTop)}return{width:M,height:a,x:u+cb(t),y:o}}function rke(t){var i,e=CT(t),n=lb(t),r=(i=t.ownerDocument)==null?void 0:i.body,M=Sz(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Sz(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-n.scrollLeft+cb(t),o=-n.scrollTop;return dj(r||e).direction==="rtl"&&(u+=Sz(e.clientWidth,r?r.clientWidth:0)-M),{width:M,height:a,x:u,y:o}}function jb(t){var i=dj(t),e=i.overflow,n=i.overflowX,r=i.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+n)}function Yte(t){return["html","body","#document"].indexOf($l(t))>=0?t.ownerDocument.body:wD(t)&&jb(t)?t:Yte(Ov(t))}function bh(t,i){var e;i===void 0&&(i=[]);var n=Yte(t),r=n===((e=t.ownerDocument)==null?void 0:e.body),M=ds(n),a=r?[M].concat(M.visualViewport||[],jb(n)?n:[]):n,u=i.concat(a);return r?u:u.concat(bh(Ov(a)))}function Tb(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Mke(t,i){var e=pA(t,!1,i==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function bte(t,i,e){return i===xte?Tb(nke(t,e)):vz(i)?Mke(i,e):Tb(rke(CT(t)))}function ake(t){var i=bh(Ov(t)),e=["absolute","fixed"].indexOf(dj(t).position)>=0,n=e&&wD(t)?mh(t):t;return vz(n)?i.filter(function(r){return vz(r)&&Ste(r,n)&&$l(r)!=="body"}):[]}function uke(t,i,e,n){var r=i==="clippingParents"?ake(t):[].concat(i),M=[].concat(r,[e]),a=M[0],u=M.reduce(function(o,s){var N=bte(t,s,n);return o.top=Sz(N.top,o.top),o.right=dv(N.right,o.right),o.bottom=dv(N.bottom,o.bottom),o.left=Sz(N.left,o.left),o},bte(t,a,n));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function _te(t){var i=t.reference,e=t.element,n=t.placement,r=n?Wl(n):null,M=n?EA(n):null,a=i.x+i.width/2-e.width/2,u=i.y+i.height/2-e.height/2,o;switch(r){case mN:o={x:a,y:i.y-e.height};break;case vD:o={x:a,y:i.y+i.height};break;case SD:o={x:i.x+i.width,y:u};break;case YN:o={x:i.x-e.width,y:u};break;default:o={x:i.x,y:i.y}}var s=r?gb(r):null;if(s!=null){var N=s==="y"?"height":"width";switch(M){case LA:o[s]=o[s]-(i[N]/2-e[N]/2);break;case kh:o[s]=o[s]+(i[N]/2-e[N]/2);break}}return o}function _h(t,i){i===void 0&&(i={});var e=i,n=e.placement,r=n===void 0?t.placement:n,M=e.strategy,a=M===void 0?t.strategy:M,u=e.boundary,o=u===void 0?pQe:u,s=e.rootBoundary,N=s===void 0?xte:s,D=e.elementContext,g=D===void 0?Uh:D,l=e.altBoundary,j=l===void 0?!1:l,T=e.padding,y=T===void 0?0:T,z=Qte(typeof y!="number"?y:kte(y,Qh)),A=g===Uh?EQe:Uh,h=t.rects.popper,x=t.elements[j?A:g],O=uke(vz(x)?x:x.contextElement||CT(t.elements.popper),o,N,a),d=pA(t.elements.reference),E=_te({reference:d,element:h,strategy:"absolute",placement:r}),C=Tb(Object.assign({},h,E)),k=g===Uh?C:d,Q={top:O.top-k.top+z.top,bottom:k.bottom-O.bottom+z.bottom,left:O.left-k.left+z.left,right:k.right-O.right+z.right},S=t.modifiersData.offset;if(g===Uh&&S){var b=S[r];Object.keys(Q).forEach(function(Y){var m=[SD,vD].indexOf(Y)>=0?1:-1,R=[mN,vD].indexOf(Y)>=0?"y":"x";Q[Y]+=b[R]*m})}return Q}function oke(t,i){i===void 0&&(i={});var e=i,n=e.placement,r=e.boundary,M=e.rootBoundary,a=e.padding,u=e.flipVariations,o=e.allowedAutoPlacements,s=o===void 0?Ete:o,N=EA(n),D=N?u?pte:pte.filter(function(j){return EA(j)===N}):Qh,g=D.filter(function(j){return s.indexOf(j)>=0});g.length===0&&(g=D);var l=g.reduce(function(j,T){return j[T]=_h(t,{placement:T,boundary:r,rootBoundary:M,padding:a})[Wl(T)],j},{});return Object.keys(l).sort(function(j,T){return l[j]-l[T]})}function Nke(t){if(Wl(t)===ob)return[];var i=Lv(t);return[mte(t),i,mte(i)]}function ske(t){var i=t.state,e=t.options,n=t.name;if(!i.modifiersData[n]._skip){for(var r=e.mainAxis,M=r===void 0?!0:r,a=e.altAxis,u=a===void 0?!0:a,o=e.fallbackPlacements,s=e.padding,N=e.boundary,D=e.rootBoundary,g=e.altBoundary,l=e.flipVariations,j=l===void 0?!0:l,T=e.allowedAutoPlacements,y=i.options.placement,z=Wl(y),A=z===y,h=o||(A||!j?[Lv(y)]:Nke(y)),x=[y].concat(h).reduce(function(q,ie){return q.concat(Wl(ie)===ob?oke(i,{placement:ie,boundary:N,rootBoundary:D,padding:s,flipVariations:j,allowedAutoPlacements:T}):ie)},[]),O=i.rects.reference,d=i.rects.popper,E=new Map,C=!0,k=x[0],Q=0;Q<x.length;Q++){var S=x[Q],b=Wl(S),Y=EA(S)===LA,m=[mN,vD].indexOf(b)>=0,R=m?"width":"height",P=_h(i,{placement:S,boundary:N,rootBoundary:D,altBoundary:g,padding:s}),W=m?Y?SD:YN:Y?vD:mN;O[R]>d[R]&&(W=Lv(W));var B=Lv(W),X=[];if(M&&X.push(P[b]<=0),u&&X.push(P[W]<=0,P[B]<=0),X.every(function(q){return q})){k=S,C=!1;break}E.set(S,X)}if(C)for(var F=j?3:1,G=function(ie){var re=x.find(function(le){var Ne=E.get(le);if(Ne)return Ne.slice(0,ie).every(function(se){return se})});if(re)return k=re,"break"},J=F;J>0;J--){var ee=G(J);if(ee==="break")break}i.placement!==k&&(i.modifiersData[n]._skip=!0,i.placement=k,i.reset=!0)}}const Dke={name:"flip",enabled:!0,phase:"main",fn:ske,requiresIfExists:["offset"],data:{_skip:!1}};function Rte(t,i,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-i.height-e.y,right:t.right-i.width+e.x,bottom:t.bottom-i.height+e.y,left:t.left-i.width-e.x}}function Pte(t){return[mN,SD,vD,YN].some(function(i){return t[i]>=0})}function gke(t){var i=t.state,e=t.name,n=i.rects.reference,r=i.rects.popper,M=i.modifiersData.preventOverflow,a=_h(i,{elementContext:"reference"}),u=_h(i,{altBoundary:!0}),o=Rte(a,n),s=Rte(u,r,M),N=Pte(o),D=Pte(s);i.modifiersData[e]={referenceClippingOffsets:o,popperEscapeOffsets:s,isReferenceHidden:N,hasPopperEscaped:D},i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-reference-hidden":N,"data-popper-escaped":D})}const lke={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gke};function cke(t,i,e){var n=Wl(t),r=[YN,mN].indexOf(n)>=0?-1:1,M=typeof e=="function"?e(Object.assign({},i,{placement:t})):e,a=M[0],u=M[1];return a=a||0,u=(u||0)*r,[YN,SD].indexOf(n)>=0?{x:u,y:a}:{x:a,y:u}}function jke(t){var i=t.state,e=t.options,n=t.name,r=e.offset,M=r===void 0?[0,0]:r,a=Ete.reduce(function(N,D){return N[D]=cke(D,i.rects,M),N},{}),u=a[i.placement],o=u.x,s=u.y;i.modifiersData.popperOffsets!=null&&(i.modifiersData.popperOffsets.x+=o,i.modifiersData.popperOffsets.y+=s),i.modifiersData[n]=a}const Tke={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jke};function Ike(t){var i=t.state,e=t.name;i.modifiersData[e]=_te({reference:i.rects.reference,element:i.rects.popper,strategy:"absolute",placement:i.placement})}const yke={name:"popperOffsets",enabled:!0,phase:"read",fn:Ike,data:{}};function zke(t){return t==="x"?"y":"x"}function Ake(t){var i=t.state,e=t.options,n=t.name,r=e.mainAxis,M=r===void 0?!0:r,a=e.altAxis,u=a===void 0?!1:a,o=e.boundary,s=e.rootBoundary,N=e.altBoundary,D=e.padding,g=e.tether,l=g===void 0?!0:g,j=e.tetherOffset,T=j===void 0?0:j,y=_h(i,{boundary:o,rootBoundary:s,padding:D,altBoundary:N}),z=Wl(i.placement),A=EA(i.placement),h=!A,x=gb(z),O=zke(x),d=i.modifiersData.popperOffsets,E=i.rects.reference,C=i.rects.popper,k=typeof T=="function"?T(Object.assign({},i.rects,{placement:i.placement})):T,Q=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),S=i.modifiersData.offset?i.modifiersData.offset[i.placement]:null,b={x:0,y:0};if(d){if(M){var Y,m=x==="y"?mN:YN,R=x==="y"?vD:SD,P=x==="y"?"height":"width",W=d[x],B=W+y[m],X=W-y[R],F=l?-C[P]/2:0,G=A===LA?E[P]:C[P],J=A===LA?-C[P]:-E[P],ee=i.elements.arrow,q=l&&ee?Db(ee):{width:0,height:0},ie=i.modifiersData["arrow#persistent"]?i.modifiersData["arrow#persistent"].padding:Cte(),re=ie[m],le=ie[R],Ne=Yh(0,E[P],q[P]),se=h?E[P]/2-F-Ne-re-Q.mainAxis:G-Ne-re-Q.mainAxis,Ie=h?-E[P]/2+F+Ne+le+Q.mainAxis:J+Ne+le+Q.mainAxis,Oe=i.elements.arrow&&mh(i.elements.arrow),ye=Oe?x==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,$e=(Y=S==null?void 0:S[x])!=null?Y:0,Ve=W+se-$e-ye,Ee=W+Ie-$e,Te=Yh(l?dv(B,Ve):B,W,l?Sz(X,Ee):X);d[x]=Te,b[x]=Te-W}if(u){var fe,Qe=x==="x"?mN:YN,ot=x==="x"?vD:SD,rt=d[O],ke=O==="y"?"height":"width",et=rt+y[Qe],xe=rt-y[ot],Dt=[mN,YN].indexOf(z)!==-1,ve=(fe=S==null?void 0:S[O])!=null?fe:0,pt=Dt?et:rt-E[ke]-C[ke]-ve+Q.altAxis,Ct=Dt?rt+E[ke]+C[ke]-ve-Q.altAxis:xe,dt=l&&Dt?$Qe(pt,rt,Ct):Yh(l?pt:et,rt,l?Ct:xe);d[O]=dt,b[O]=dt-rt}i.modifiersData[n]=b}}const fke={name:"preventOverflow",enabled:!0,phase:"main",fn:Ake,requiresIfExists:["offset"]};function dke(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Oke(t){return t===ds(t)||!wD(t)?lb(t):dke(t)}function hke(t){var i=t.getBoundingClientRect(),e=xA(i.width)/t.offsetWidth||1,n=xA(i.height)/t.offsetHeight||1;return e!==1||n!==1}function Lke(t,i,e){e===void 0&&(e=!1);var n=wD(i),r=wD(i)&&hke(i),M=CT(i),a=pA(t,r,e),u={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(n||!n&&!e)&&(($l(i)!=="body"||jb(M))&&(u=Oke(i)),wD(i)?(o=pA(i,!0),o.x+=i.clientLeft,o.y+=i.clientTop):M&&(o.x=cb(M))),{x:a.left+u.scrollLeft-o.x,y:a.top+u.scrollTop-o.y,width:a.width,height:a.height}}function xke(t){var i=new Map,e=new Set,n=[];t.forEach(function(M){i.set(M.name,M)});function r(M){e.add(M.name);var a=[].concat(M.requires||[],M.requiresIfExists||[]);a.forEach(function(u){if(!e.has(u)){var o=i.get(u);o&&r(o)}}),n.push(M)}return t.forEach(function(M){e.has(M.name)||r(M)}),n}function pke(t){var i=xke(t);return bQe.reduce(function(e,n){return e.concat(i.filter(function(r){return r.phase===n}))},[])}function Eke(t){var i;return function(){return i||(i=new Promise(function(e){Promise.resolve().then(function(){i=void 0,e(t())})})),i}}function vke(t){var i=t.reduce(function(e,n){var r=e[n.name];return e[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,e},{});return Object.keys(i).map(function(e){return i[e]})}var Vte={placement:"bottom",modifiers:[],strategy:"absolute"};function Fte(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return!i.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function Ske(t){t===void 0&&(t={});var i=t,e=i.defaultModifiers,n=e===void 0?[]:e,r=i.defaultOptions,M=r===void 0?Vte:r;return function(u,o,s){s===void 0&&(s=M);var N={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vte,M),modifiersData:{},elements:{reference:u,popper:o},attributes:{},styles:{}},D=[],g=!1,l={state:N,setOptions:function(z){var A=typeof z=="function"?z(N.options):z;T(),N.options=Object.assign({},M,N.options,A),N.scrollParents={reference:vz(u)?bh(u):u.contextElement?bh(u.contextElement):[],popper:bh(o)};var h=pke(vke([].concat(n,N.options.modifiers)));return N.orderedModifiers=h.filter(function(x){return x.enabled}),j(),l.update()},forceUpdate:function(){if(!g){var z=N.elements,A=z.reference,h=z.popper;if(Fte(A,h)){N.rects={reference:Lke(A,mh(h),N.options.strategy==="fixed"),popper:Db(h)},N.reset=!1,N.placement=N.options.placement,N.orderedModifiers.forEach(function(Q){return N.modifiersData[Q.name]=Object.assign({},Q.data)});for(var x=0;x<N.orderedModifiers.length;x++){if(N.reset===!0){N.reset=!1,x=-1;continue}var O=N.orderedModifiers[x],d=O.fn,E=O.options,C=E===void 0?{}:E,k=O.name;typeof d=="function"&&(N=d({state:N,options:C,name:k,instance:l})||N)}}}},update:Eke(function(){return new Promise(function(y){l.forceUpdate(),y(N)})}),destroy:function(){T(),g=!0}};if(!Fte(u,o))return l;l.setOptions(s).then(function(y){!g&&s.onFirstUpdate&&s.onFirstUpdate(y)});function j(){N.orderedModifiers.forEach(function(y){var z=y.name,A=y.options,h=A===void 0?{}:A,x=y.effect;if(typeof x=="function"){var O=x({state:N,name:z,instance:l,options:h}),d=function(){};D.push(O||d)}})}function T(){D.forEach(function(y){return y()}),D=[]}return l}}var wke=[eke,yke,KQe,PQe,Tke,Dke,fke,GQe,lke],Cke=Ske({defaultModifiers:wke}),Qke=typeof Element<"u",kke=typeof Map=="function",Uke=typeof Set=="function",mke=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function xv(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var e,n,r;if(Array.isArray(t)){if(e=t.length,e!=i.length)return!1;for(n=e;n--!==0;)if(!xv(t[n],i[n]))return!1;return!0}var M;if(kke&&t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(M=t.entries();!(n=M.next()).done;)if(!i.has(n.value[0]))return!1;for(M=t.entries();!(n=M.next()).done;)if(!xv(n.value[1],i.get(n.value[0])))return!1;return!0}if(Uke&&t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(M=t.entries();!(n=M.next()).done;)if(!i.has(n.value[0]))return!1;return!0}if(mke&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if(e=t.length,e!=i.length)return!1;for(n=e;n--!==0;)if(t[n]!==i[n])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof i.valueOf=="function")return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof i.toString=="function")return t.toString()===i.toString();if(r=Object.keys(t),e=r.length,e!==Object.keys(i).length)return!1;for(n=e;n--!==0;)if(!Object.prototype.hasOwnProperty.call(i,r[n]))return!1;if(Qke&&t instanceof Element)return!1;for(n=e;n--!==0;)if(!((r[n]==="_owner"||r[n]==="__v"||r[n]==="__o")&&t.$$typeof)&&!xv(t[r[n]],i[r[n]]))return!1;return!0}return t!==t&&i!==i}var Yke=function(i,e){try{return xv(i,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const bke=sy(Yke);var _ke=[],$te=function(i,e,n){n===void 0&&(n={});var r=De.useRef(null),M={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||_ke},a=De.useState({styles:{popper:{position:M.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),u=a[0],o=a[1],s=De.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(l){var j=l.state,T=Object.keys(j.elements);a1.flushSync(function(){o({styles:hte(T.map(function(y){return[y,j.styles[y]||{}]})),attributes:hte(T.map(function(y){return[y,j.attributes[y]]}))})})},requires:["computeStyles"]}},[]),N=De.useMemo(function(){var g={onFirstUpdate:M.onFirstUpdate,placement:M.placement,strategy:M.strategy,modifiers:[].concat(M.modifiers,[s,{name:"applyStyles",enabled:!1}])};return bke(r.current,g)?r.current||g:(r.current=g,g)},[M.onFirstUpdate,M.placement,M.strategy,M.modifiers,s]),D=De.useRef();return Lte(function(){D.current&&D.current.setOptions(N)},[N]),Lte(function(){if(!(i==null||e==null)){var g=n.createPopper||Cke,l=g(i,e,N);return D.current=l,function(){l.destroy(),D.current=null}}},[i,e,n.createPopper]),{state:D.current?D.current.state:null,styles:u.styles,attributes:u.attributes,update:D.current?D.current.update:null,forceUpdate:D.current?D.current.forceUpdate:null}},Rke=function(){},Pke=function(){return Promise.resolve(null)},Vke=[];function Fke(t){var i=t.placement,e=i===void 0?"bottom":i,n=t.strategy,r=n===void 0?"absolute":n,M=t.modifiers,a=M===void 0?Vke:M,u=t.referenceElement,o=t.onFirstUpdate,s=t.innerRef,N=t.children,D=De.useContext(Ate),g=De.useState(null),l=g[0],j=g[1],T=De.useState(null),y=T[0],z=T[1];De.useEffect(function(){ub(s,l)},[s,l]);var A=De.useMemo(function(){return{placement:e,strategy:r,onFirstUpdate:o,modifiers:[].concat(a,[{name:"arrow",enabled:y!=null,options:{element:y}}])}},[e,r,o,a,y]),h=$te(u||D,l,A),x=h.state,O=h.styles,d=h.forceUpdate,E=h.update,C=De.useMemo(function(){return{ref:j,style:O.popper,placement:x?x.placement:e,hasPopperEscaped:x&&x.modifiersData.hide?x.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:x&&x.modifiersData.hide?x.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:O.arrow,ref:z},forceUpdate:d||Rke,update:E||Pke}},[j,z,e,x,O,E,d]);return dte(N)(C)}var $ke=process.env.NODE_ENV!=="production",Wte=function(){};if($ke){var Wke=function(i,e){var n=arguments.length;e=new Array(n>1?n-1:0);for(var r=1;r<n;r++)e[r-1]=arguments[r];var M=0,a="Warning: "+i.replace(/%s/g,function(){return e[M++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}};Wte=function(t,i,e){var n=arguments.length;e=new Array(n>2?n-2:0);for(var r=2;r<n;r++)e[r-2]=arguments[r];if(i===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");t||Wke.apply(null,[i].concat(e))}}var Bke=Wte;const Hke=sy(Bke);function Gke(t){var i=t.children,e=t.innerRef,n=De.useContext(fte),r=De.useCallback(function(M){ub(e,M),Ote(n,M)},[e,n]);return De.useEffect(function(){return function(){return ub(e,null)}},[]),De.useEffect(function(){Hke(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),dte(i)({ref:r})}const wz={primary:"_primary_1nk48_1","primary-dark":"_primary-dark_1nk48_1",secondary:"_secondary_1nk48_1","secondary-dark":"_secondary-dark_1nk48_1",infoAlert:"_infoAlert_1nk48_1",white:"_white_1nk48_1",gray:"_gray_1nk48_1","gray-dark":"_gray-dark_1nk48_1",alert:"_alert_1nk48_1","alert-light":"_alert-light_1nk48_1","alert-dark":"_alert-dark_1nk48_1",success:"_success_1nk48_1","success-dark":"_success-dark_1nk48_1","success-light":"_success-light_1nk48_1",warning:"_warning_1nk48_1","warning-dark":"_warning-dark_1nk48_1",info:"_info_1nk48_1","info-light":"_info-light_1nk48_1","bg-primary":"_bg-primary_1nk48_1","bg-primary-dark":"_bg-primary-dark_1nk48_1","bg-secondary":"_bg-secondary_1nk48_1","bg-secondary-dark":"_bg-secondary-dark_1nk48_1","bg-white":"_bg-white_1nk48_1","bg-gray":"_bg-gray_1nk48_1","bg-gray-dark":"_bg-gray-dark_1nk48_1","bg-alert":"_bg-alert_1nk48_1","bg-alert-light":"_bg-alert-light_1nk48_1","bg-alert-dark":"_bg-alert-dark_1nk48_1","bg-success":"_bg-success_1nk48_1","bg-success-dark":"_bg-success-dark_1nk48_1","bg-success-light":"_bg-success-light_1nk48_1","bg-warning":"_bg-warning_1nk48_1","bg-warning-dark":"_bg-warning-dark_1nk48_1","bg-info":"_bg-info_1nk48_1","bg-info-light":"_bg-info-light_1nk48_1",container:"_container_1nk48_5",popover:"_popover_1nk48_13",button:"_button_1nk48_21",buttonOpen:"_buttonOpen_1nk48_29",menu:"_menu_1nk48_37",barButtonContainer:"_barButtonContainer_1nk48_47",barButtonWrapper:"_barButtonWrapper_1nk48_55",searchDiv:"_searchDiv_1nk48_63",popButton:"_popButton_1nk48_71",popButton2:"_popButton2_1nk48_79",popContainer:"_popContainer_1nk48_87",popOption:"_popOption_1nk48_95",popOption2:"_popOption2_1nk48_103",tabsContainer:"_tabsContainer_1nk48_111",popperMenu:"_popperMenu_1nk48_1"},Bte=Z6([]),CD=({children:t,buttonContent:i,position:e="auto",isDisabled:n,menuWidth:r="208px",offset:M=[0,10],overFlowDetection:a=!0,tabMenu:u=!1,bgColor:o="white",autoCloseParent:s=!1,buttonWidth:N="auto",getIsOpen:D})=>{const[g,l]=De.useState(!1),j=De.useRef(null),[T,y]=De.useState(),[z,A]=De.useState(),[h,x]=De.useState(e),[,O]=fw(Bte),[d]=De.useState(Math.random().toString(36).substring(7)),[E,C]=De.useState(r),{styles:k,attributes:Q}=$te(T,z,{placement:h,modifiers:[{name:"offset",options:{offset:M}},a?{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","auto"]}}:{},{name:"preventOverflow",options:{altAxis:!0,tether:!1,padding:10}}]});De.useEffect(()=>(z&&(ele(z)||x("auto")),g&&O(Y=>Y.find(R=>R.id===d)?Y.map(R=>R.id===d?{...R,isOpen:g,setOpen:l,popperElement:z,referenceElement:T}:R):[...Y,{id:d,isOpen:g,setOpen:l,popperElement:z,referenceElement:T}]),()=>{O(Y=>Y.filter(m=>m.id!==d))}),[g,d,z,T]),De.useEffect(()=>{r==="100%"&&C(`${T==null?void 0:T.clientWidth}px`)},[T==null?void 0:T.clientWidth]),De.useEffect(()=>{D&&D(g)},[g]);const S={width:E,...k.popper};Sge({wrapRef:j,portalRef:z,autoCloseParent:s});const b=[wz[`bg-${o}`],wz.menu].join(" ");return v.jsx(v.Fragment,{children:v.jsxs("div",{className:wz.container,tabIndex:-1,ref:j,children:[v.jsx("div",{role:"button",tabIndex:0,onKeyDown:()=>{},className:`${g?wz.buttonOpen:""} ${wz.button}`,style:{width:N},onClick:()=>!n&&l(Y=>!Y),ref:y,children:i}),!n&&g?v.jsx(DL,{children:v.jsx("div",{role:"button",id:wz.popperMenu,tabIndex:0,onKeyDown:()=>{},className:wz.popover,style:S,ref:A,...Q.popper,children:v.jsx("div",{role:"button",tabIndex:0,onKeyDown:()=>{},className:b,onClick:Y=>{var R,P,W,B;const m=(W=(P=(R=Y.target.closest("[data-closepopover]"))==null?void 0:R.attributes)==null?void 0:P["data-closepopover"])==null?void 0:W.value;((B=Y.target)==null?void 0:B.tagName)!=="INPUT"&&!u&&l(!1),m&&l(!1),m==="remainOpen"&&l(!0)},children:t})})}):null]})})},Zke=({data:t,error:i,isLoading:e,previewTableDataList:n,moreTabs:r,chartColors:M,chartSettings:a,setChartSettings:u,isUpdateMetric:o=!1,isDisableSqlBtn:s,setShowSqlModal:N,isEnablePivotTable:D,groupbyList:g,hasNumberKeys:l,isEnableGauge:j,outputHeaderProps:T,metrics:y,dimensions:z,onGenerateChart:A,setMetrics:h,setColumn:x,isEnableSingleDimension:O,isEnableSingleMetrics:d,functionOptions:E,configuration:C})=>{var m;const[k,Q]=De.useState(!1),{setDropNodeRef:S,setIsEnableDrop:b}=rP({identifier:{id:"Dimensions",accepts:["column","metrics","dimensions","dimension_aggregate"]},events:{onDrop:(R,P)=>{var ee,q;const W=(ee=P.active)==null?void 0:ee.data;W.labelType=W.labelType??"dimensions",x(ie=>ie.findIndex(re=>re.value===W.value)===-1?[...ie,W]:ie);const[B,X,F,G,J]=(q=W==null?void 0:W.value)==null?void 0:q.split("____");C.dimensions.findIndex(ie=>ie.alias===W.label&&ie.labelType!=="metrics")===-1&&!W.aggregate?A({param:{...C,dimensions:[...C.dimensions,{columnName:X,alias:X,dataType:F,parentAlias:B,type:"default",timeGrain:void 0,helperFunction:void 0,labelType:W.labelType}]},metricParams:y,dimensionParams:z.findIndex(ie=>ie.value===W.value)===-1?[...z,W]:z}):A({param:{...C},metricParams:y,dimensionParams:z.findIndex(ie=>ie.value===W.value)===-1?[...z,W]:z})}},modifiers:{sorting:{isEnabled:!0,isEnabledAutoSort:!0,sortingType:"horizontal",list:z,setList:x}}}),{setDropNodeRef:Y}=rP({identifier:{id:"Metrics",accepts:["column","dimensions","metrics","metric_aggregate"]},events:{onDrop:(R,P)=>{var ee,q;const W=(ee=P.active)==null?void 0:ee.data;W.labelType=W.labelType??"metrics",h(ie=>ie.findIndex(re=>re.value===W.value)===-1?[...ie,W]:ie);const[B,X,F,G,J]=(q=W==null?void 0:W.value)==null?void 0:q.split("____");C.dimensions.findIndex(ie=>ie.alias===W.label&&ie.labelType==="metrics")===-1&&!W.aggregate?A({param:{...C,dimensions:[...C.dimensions,{columnName:X,alias:X,dataType:F,parentAlias:B,type:"default",timeGrain:void 0,helperFunction:void 0,labelType:W.labelType}]},metricParams:y.findIndex(ie=>ie.value===W.value)===-1?[...y,W]:y,dimensionParams:z}):A({param:{...C},metricParams:y.findIndex(ie=>ie.value===W.value)===-1?[...y,W]:y,dimensionParams:z})}},modifiers:{sorting:{isEnabled:!0,isEnabledAutoSort:!0,sortingType:"horizontal",list:y,setList:h}}});return v.jsxs("div",{className:`${Aa["main-container"]}`,children:[v.jsxs("div",{className:Aa.selection,children:[v.jsxs("div",{className:Aa.selectionContainer,children:[v.jsx("span",{className:Aa.selectedCol,children:v.jsx(Pe,{variant:"btn",children:"Dimensions"})}),v.jsx("div",{className:Aa.columnContainer,ref:S,children:z!=null&&z.length?v.jsx("div",{className:Aa.listContainer,children:z==null?void 0:z.map((R,P)=>{const B=E(R).filter(G=>!G5.includes(G.value)),X=R.labelType==="dimension_aggregate"?R.alias:R.label,F=R.labelType==="dimension_aggregate";return v.jsx(Mb,{modifiers:{highlightDrop:{onDrag:!0}},identifier:{id:R.value,type:R.labelType},data:R,CustomDragPreview:v.jsx("span",{className:Aa.listVal,children:X}),renderItem:G=>v.jsxs("div",{className:`${Aa.listVal} `,"data-dbn-sorting-index":P,ref:G,children:[X,v.jsx(CD,{buttonContent:v.jsx(Yt,{name:"caret-down-fill",size:"xs"}),position:"bottom-start",offset:[0,5],children:v.jsx("div",{className:"dbn-p-2",children:B==null?void 0:B.map(J=>v.jsx(Bt,{variant:"popover",className:"dbn-justify-start dbn-w-full hover:dbn-bg-gray-3 dbn-px-2 dbn-py-1",onClick:()=>{var Ne;x(se=>se.map(Ie=>Ie.value===R.value?{...Ie,labelType:"dimension_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:Ie));const[ee,q,ie,re,le]=(Ne=R==null?void 0:R.value)==null?void 0:Ne.split("____");A({param:{...C,dimensions:C.dimensions.map(se=>se.alias===(F?R.alias:R.label)?{columnName:q,alias:`${J.value.toLowerCase()} of ${R.label}`||q,dataType:ie,parentAlias:ee,type:"default",timeGrain:void 0,helperFunction:J.value,labelType:"dimension_aggregate"}:se)},metricParams:y,dimensionParams:z.map(se=>se.value===R.value?{...se,labelType:"dimension_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:se)})},children:v.jsx("span",{children:J.label})}))})}),v.jsx("span",{className:Aa.removeColumn,role:"button",tabIndex:0,onKeyDown:()=>{},onClick:()=>{x(J=>J.filter(ee=>ee.value!==R.value)),A({param:{...C,dimensions:C.dimensions.filter(J=>J.alias!==(F?R.alias:R.label))},metricParams:y,dimensionParams:z.filter(J=>J.value!==R.value)})},children:v.jsx(Yt,{name:"cross",size:"xxs"})})]})})})}):v.jsx(Pe,{variant:"body-text-sm",color:"secondary",children:"Drag and Drop your Rows here"})})]}),v.jsxs("div",{className:Aa.selectionContainer,children:[v.jsx("span",{className:Aa.selectedCol,children:v.jsx(Pe,{variant:"btn",children:"Metrics"})}),v.jsx("div",{className:Aa.columnContainer,ref:Y,children:y!=null&&y.length?v.jsx("div",{className:Aa.listContainer,children:y==null?void 0:y.map((R,P)=>{const B=E(R).filter(G=>G5.includes(G.value)),X=R.labelType==="metric_aggregate"?R.alias:R.label,F=R.labelType==="metric_aggregate";return v.jsx(Mb,{modifiers:{highlightDrop:{onDrag:!0}},identifier:{id:R.value,type:R.labelType},data:R,CustomDragPreview:v.jsx("span",{className:Aa.listVal,children:X}),renderItem:G=>v.jsxs("div",{className:Aa.listVal,"data-dbn-sorting-index":P,ref:G,children:[X,v.jsx(CD,{buttonContent:v.jsx(Yt,{name:"caret-down-fill",size:"xs"}),position:"bottom-start",offset:[0,5],children:v.jsx("div",{className:"dbn-p-2",children:B==null?void 0:B.map(J=>v.jsx(Bt,{variant:"popover",className:"dbn-justify-start dbn-w-full hover:dbn-bg-gray-3 dbn-px-2 dbn-py-1",onClick:()=>{var Ne;h(se=>se.map(Ie=>Ie.value===R.value?{value:R.value,label:R.label,labelType:"metric_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:Ie));const[ee,q,ie,re,le]=(Ne=R==null?void 0:R.value)==null?void 0:Ne.split("____");A({param:{...C,dimensions:C.dimensions.filter(se=>se.alias!==(F?R.alias:R.label)),aggregates:[...C.aggregates,{columnName:q,alias:`${J.value.toLowerCase()} of ${R.label}`||q,dataType:ie,parentAlias:ee,type:"default",method:J.value}]},metricParams:y.map((se,Ie)=>P===Ie?{...se,labelType:"metric_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:se),dimensionParams:z})},children:v.jsx("span",{children:J.label})}))})}),v.jsx("span",{className:Aa.removeColumn,role:"button",tabIndex:0,onKeyDown:()=>{},onClick:()=>{h(J=>J.filter(ee=>ee.value!==R.value)),A({param:F?{...C,aggregates:C.aggregates.filter(J=>J.alias!==R.alias)}:{...C,dimensions:C.dimensions.filter(J=>J.alias!==R.label)},metricParams:y.filter(J=>J.value!==R.value),dimensionParams:z})},children:v.jsx(Yt,{name:"cross",size:"xxs"})})]})})})}):v.jsx(Pe,{variant:"body-text-sm",color:"secondary",children:"Drag and Drop your Columns here"})})]})]}),v.jsxs("div",{className:`${Aa.wrapper}`,children:[v.jsxs("div",{className:Aa.wrapperHead,children:[v.jsx("div",{className:"dbn-flex dbn-gap-4 dbn-justify-center",children:v.jsx(zn,{enabled:k,placeholder:"Table View",onChange:()=>Q(!k)})}),v.jsxs("div",{className:Aa.features,children:[v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Chart Type",children:v.jsx(Yt,{name:"bar-chart-2",size:"lg"})}),onClick:()=>T.setShowChartType(!0)}),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Filters",children:v.jsx("span",{className:t?"":"hover:dbn-cursor-not-allowed",children:v.jsx(Yt,{name:"funnel",size:"lg"})})}),onClick:()=>T.setShowFilters(!0),isDisabled:!t}),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Sort",children:v.jsx("span",{className:t?"":"hover:dbn-cursor-not-allowed",children:v.jsx(Yt,{name:"funnel-simple",size:"lg"})})}),onClick:()=>T.setShowSortPanel(!0),isDisabled:!t}),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Chart Appearance",position:"left",children:v.jsx("span",{className:t?"":"hover:dbn-cursor-not-allowed",children:v.jsx(Yt,{name:"color-palette",size:"lg"})})}),onClick:()=>T.setShowChartCustomProperties(!0),isDisabled:!t})]})]}),k?v.jsx("div",{className:Aa.tableTab,children:v.jsx(hQe,{outpuTableData:t,isOutputLoading:e,outputError:i,isUpdateMetric:o,isDisableSqlBtn:s,setShowSqlModal:N})}):v.jsx("div",{className:Aa.visualization,children:v.jsx(OQe,{chartSettings:a,setChartSettings:u,data:t,error:i,isLoading:e,chartColors:(a==null?void 0:a.chartColors)||M,isEnablePivotTable:D,groupbyList:g,hasNumberKeys:l,isEnableGauge:j,headerChild:(m=a.timeSeriesSettings)!=null&&m.groupBySettings.isDynamic?v.jsx(un,{options:a.timeSeriesSettings.groupBySettings.options.map(R=>({label:R.split("____").length>1?R.split("____")[1]:R,value:R})),onChange:R=>{var W;const P={groupBySettings:{isDynamic:!1,options:[],value:"monthly"},seriesType:((W=a.yAxisList)==null?void 0:W.map(B=>({column:B,type:"bar"})))||[]};u(B=>{var X;return{...B,timeSeriesSettings:{...B.timeSeriesSettings||P,groupBySettings:{...((X=B.timeSeriesSettings)==null?void 0:X.groupBySettings)||P.groupBySettings,value:R.value,fillXAxis:!1}}}})},selectedOption:{label:a.timeSeriesSettings.groupBySettings.value.split("____").length>1?a.timeSeriesSettings.groupBySettings.value.split("____")[1]:a.timeSeriesSettings.groupBySettings.value.toString().substring(0,1).toUpperCase()+a.timeSeriesSettings.groupBySettings.value.toString().substring(1,a.timeSeriesSettings.groupBySettings.value.length),value:a.timeSeriesSettings.groupBySettings.value},label:"group"}):void 0})})]})]})},Ib={chartPropertiesPanel:"_chartPropertiesPanel_19qfx_1",imgDiv:"_imgDiv_19qfx_5",chartContainer:"_chartContainer_19qfx_9",chartOptions:"_chartOptions_19qfx_13",chartOption:"_chartOption_19qfx_13",chartOptionBtn:"_chartOptionBtn_19qfx_21",chartOptionText:"_chartOptionText_19qfx_24",chartOptionBtnSelected:"_chartOptionBtnSelected_19qfx_27",popOption:"_popOption_19qfx_30"},Re={container:"_container_fgw0o_1","container-wrapper":"_container-wrapper_fgw0o_7",wrapper:"_wrapper_fgw0o_13",marginContainer:"_marginContainer_fgw0o_19",chartDemo:"_chartDemo_fgw0o_25",chartDemoContainer:"_chartDemoContainer_fgw0o_31",marginWrapper:"_marginWrapper_fgw0o_37",chartColors:"_chartColors_fgw0o_43",prefixSuffixContainer:"_prefixSuffixContainer_fgw0o_49",header:"_header_fgw0o_55",tabContainer:"_tabContainer_fgw0o_61",tab:"_tab_fgw0o_61",tabText:"_tabText_fgw0o_73",tabHeading:"_tabHeading_fgw0o_79",form:"_form_fgw0o_85",inputWrapper:"_inputWrapper_fgw0o_91",positionContainer:"_positionContainer_fgw0o_97",positionWrapper:"_positionWrapper_fgw0o_103",input:"_input_fgw0o_91",labelFormatTooltip:"_labelFormatTooltip_fgw0o_115",checkboxTooltip:"_checkboxTooltip_fgw0o_121",checkboxTooltipWrapper:"_checkboxTooltipWrapper_fgw0o_127",series:"_series_fgw0o_133",legendWrapper:"_legendWrapper_fgw0o_139",badgeDiv:"_badgeDiv_fgw0o_145",checkboxWrapper:"_checkboxWrapper_fgw0o_151",seriesWrapper:"_seriesWrapper_fgw0o_157",valueLabelWrapper:"_valueLabelWrapper_fgw0o_163",singleCheckBox:"_singleCheckBox_fgw0o_169",seriesCheck:"_seriesCheck_fgw0o_175",seriesCheckContainer:"_seriesCheckContainer_fgw0o_181",fieldDescription:"_fieldDescription_fgw0o_189",xSmallFont:"_xSmallFont_fgw0o_197",addNewRuleBtn:"_addNewRuleBtn_fgw0o_205",formattingContainer:"_formattingContainer_fgw0o_213",condtionRule:"_condtionRule_fgw0o_221",ruleContainer:"_ruleContainer_fgw0o_229",gradientContainer:"_gradientContainer_fgw0o_237",labelStyle:"_labelStyle_fgw0o_245",accordionHeader:"_accordionHeader_fgw0o_253",comparisonValueWrapper:"_comparisonValueWrapper_fgw0o_261",comparisonValueContainer:"_comparisonValueContainer_fgw0o_269",positionButtonContainer:"_positionButtonContainer_fgw0o_279",positionButtonAlt:"_positionButtonAlt_fgw0o_285",positionButtonWrapper:"_positionButtonWrapper_fgw0o_291",positionButton:"_positionButton_fgw0o_279"},Hte=({val:t,onClick:i})=>v.jsx("div",{className:Re.positionButtonContainer,children:v.jsxs("div",{className:Re.positionButtonAlt,children:[v.jsxs("div",{className:Re.positionButtonWrapper,children:[v.jsx("span",{className:`${Re.positionButton} ${t==="top-left"?"dbn-bg-black":""}`,onClick:()=>i("top-left")}),v.jsx("span",{className:`${Re.positionButton} ${t==="top-center"?"dbn-bg-black":""}`,onClick:()=>i("top-center")}),v.jsx("span",{className:`${Re.positionButton} ${t==="top-right"?"dbn-bg-black":""}`,onClick:()=>i("top-right")})]}),v.jsxs("div",{className:Re.positionButtonWrapper,children:[v.jsx("span",{className:`${Re.positionButton} ${t==="left-center"?"dbn-bg-black":""}`,onClick:()=>i("left-center")}),v.jsx("span",{className:`${Re.positionButton} ${t==="right-center"?"dbn-bg-black":""}`,onClick:()=>i("right-center")})]}),v.jsxs("div",{className:Re.positionButtonWrapper,children:[v.jsx("span",{className:`${Re.positionButton} ${t==="bottom-left"?"dbn-bg-black":""}`,onClick:()=>i("bottom-left")}),v.jsx("span",{className:`${Re.positionButton} ${t==="bottom-center"?"dbn-bg-black":""}`,onClick:()=>i("bottom-center")}),v.jsx("span",{className:`${Re.positionButton} ${t==="bottom-right"?"dbn-bg-black":""}`,onClick:()=>i("bottom-right")})]})]})}),Cz={timeSeriesSettingsContainer:"_timeSeriesSettingsContainer_117pu_1",timeSeriesSettingsType:"_timeSeriesSettingsType_117pu_5",label:"_label_117pu_9",dynamicFormat:"_dynamicFormat_117pu_13",wrapper:"_wrapper_117pu_16",inputWrapper:"_inputWrapper_117pu_19"},Jke=[{value:"line",label:"line"},{value:"bar",label:"bar"},{value:"area",label:"area"},{value:"stack",label:"stack"}],pv=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"yearly",label:"Yearly"},{value:"quarterly",label:"Quarterly"}],Xke=({onChange:t,settings:{groupBySettings:i,seriesType:e},yAxisList:n})=>{var M,a;const r=(u,o)=>{i.options[u].split("____").length?(i.options[u]=`${i.options[u].split("____")[0]}____${o}`,i.value=`${i.options[u].split("____")[0]}____${o}`):(i.options[u]=`${i.options[u]}____${o}`,i.value=`${i.options[u]}____${o}`)};return De.useEffect(()=>{(i.isDynamic||[Ns.daily,Ns.weekly,Ns.yearly].includes(i.value))&&t(u=>({...u,groupBySettings:{...u.groupBySettings,fillXAxis:!1}}))}),v.jsxs("div",{className:Cz.timeSeriesSettingsContainer,children:[v.jsxs("div",{className:Cz.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Series type"}),v.jsx(un,{options:Jke,selectedOption:{value:((M=e==null?void 0:e[0])==null?void 0:M.type)||"bar",label:((a=e==null?void 0:e[0])==null?void 0:a.type)||"bar"},onChange:u=>{t(o=>({...o,seriesType:n.map(s=>({column:s,type:u.value}))}))}})]}),v.jsx(Pe,{variant:"label",children:"Group format"}),v.jsxs("div",{className:Cz.timeSeriesSettingsType,children:[v.jsx(QMe,{type:"radio",onChange:({target:{checked:u}})=>u&&t(o=>({...o,groupBySettings:{...o.groupBySettings,value:"monthly",isDynamic:!1,options:pv.map(s=>s.value)}})),name:"isDynamic",label:"default",defaultChecked:!i.isDynamic}),v.jsx(QMe,{type:"radio",name:"isDynamic",label:"dynamic",checked:i.isDynamic,defaultChecked:i.isDynamic,onChange:({target:{checked:u}})=>u&&t(o=>({...o,groupBySettings:{...o.groupBySettings,value:"monthly",isDynamic:!0,options:pv.map(s=>s.value)}}))})]}),i.isDynamic?v.jsxs("div",{className:Cz.dynamicFormat,children:[v.jsx(fl,{buttonWidth:"100%",menuWidth:"100%",options:pv,selectedOption:i.options.map(u=>u.split("____").length?{value:u.split("____")[0],label:u.split("____")[0]}:{value:u,label:u}),label:"Dynamic options",onChange:u=>t(o=>({...o,groupBySettings:{...o.groupBySettings,value:Array.isArray(u)&&u.length?u[0].value:"monthly",options:u.map(s=>s.value)||["monthly"]}})),isShowSelectedOptions:!0}),i.options.map((u,o)=>v.jsxs("div",{className:"dbn-flex dbn-flex-row dbn-justify-between",children:[v.jsx(Pe,{variant:"heading",children:u.split("____").length>1?u.split("____")[0]:u}),v.jsx("div",{className:Cz.inputWrapper,children:v.jsx(yi,{type:"text",value:u.split("____").length>1?u.split("____")[1]:u,placeholder:"Save as",onChange:s=>{r(o,s.target.value)}})})]}))]}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Cz.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Format type"}),v.jsx(un,{options:pv,selectedOption:{value:i.value||"",label:i.value||""},onChange:u=>t(o=>({...o,groupBySettings:{...o.groupBySettings,value:u.value}}))})]}),[Ns.month,Ns.quarter].includes(i.value)&&v.jsxs("div",{className:Cz.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Fill X-axis"}),v.jsx(zn,{name:"fill axis",enabled:i.fillXAxis,onChange:()=>t(u=>({...u,groupBySettings:{...u.groupBySettings,fillXAxis:!u.groupBySettings.fillXAxis}}))})]})]})]})},Kke=t=>{const i=[Se.pie,Se.doughnut,Se.rose,Se.funnel,Se.sankey].includes(t)?[{label:"Outside",value:"outside"},{label:"Inside",value:"inside"},{label:"Hidden",value:"hidden"}]:[{label:"Hidden",value:"hidden"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"},{label:"Right",value:"right"},{label:"Left",value:"left"},{label:"Inside",value:"inside"}];return t===Se.sankey&&i.push({label:"Right",value:"right"},{label:"Left",value:"left"}),i},qke=({chartSettings:t,setChartSettings:i,setBarRadius:e,comparisonLagProps:n,setResetPallete:r})=>{var Q,S,b,Y,m,R,P,W,B,X,F,G,J,ee,q,ie,re,le,Ne,se,Ie,Oe,ye,$e,Ve,Ee,Te,fe,Qe,ot,rt,ke,et,xe,Dt,ve,pt,Ct,dt,Zt,$t,Mt,It,We,Tt,He,jt,lt,kt,ii,gi,ht,Et,ai,Dn,Tr,eM,dr,Or,ha,WM,Ya,BM,ba,TM,OM,IM,Le,Lt,Wt,Xt,Ji,Ki,qi,Si,Vr,Mr,ar,hr,_a,ko,xn,ws,La,nn,Ra,Lu,HM,xu,wM,NN,hM,sN,DN,Ku,Uo,aa,ua,yM,pu,Eu,vu,mo,qu,Xa,Cs,xa,An,pa,eo,Yo,Mn,bo,_o,Vi,to,Lr,Fr,zM,Su,gr,Pn,Ro,CM,tM,Ea,gN,GM,Ka,VN,oa,wu,Ae,Ue,ft,Ht,Qn,Ri,Jn,vr,Xn,ae,de,Ge,Ke,xt,ri,_t,li,Hi,fn,Vn,kn,lr,Ir,pn,io,FN,Qs,_g,qa,ks,Us,Rg,Sj,wj,Pg,Vg,ec,tc,ic,Fg,no,Cj,$g,bD,Wg,Qj,_D,nc,Na,ro,uM,eu,lN,RD,rc,$N,Mc,ac;const M=()=>{const Me=[...t.chartColors||[]];for(let ue=Me.length-1;ue>0;ue--){const Nt=Math.floor(Math.random()*(ue+1));[Me[ue],Me[Nt]]=[Me[Nt],Me[ue]]}i(ue=>({...ue,chartColors:Me}))},[a,u]=De.useState(!1),[o,s]=De.useState(!1),[N,D]=De.useState(""),[g,l]=De.useState({backgrounColor:"#FFFFFF",color:"#000000",columnName:((Q=t.yAxisList)==null?void 0:Q[0])||"",operator:Qx[0].value,value:""}),[j,T]=De.useState({startColor:"#FFFFFF",endColor:"#000000",offset1:.5,offset2:.05,direction:"left",isRadial:!1}),y=De.useMemo(()=>{var Me;return(Me=t==null?void 0:t.yAxisList)==null?void 0:Me.filter(ue=>{var Nt,zi;return!((zi=(Nt=t.tableSettings)==null?void 0:Nt.listColumns)!=null&&zi.includes(ue))})},[(S=t.tableSettings)==null?void 0:S.listColumns,t.yAxisList]),z=De.useMemo(()=>(y==null?void 0:y.map(Me=>({value:Me,label:Me})))||[],[y]),A=De.useMemo(()=>{var Me;return(Me=t==null?void 0:t.yAxisList)==null?void 0:Me.filter(ue=>{var Nt,zi;return!((zi=(Nt=t.tableSettings)==null?void 0:Nt.badgeColumns)!=null&&zi.includes(ue))})},[(b=t.tableSettings)==null?void 0:b.badgeColumns,t.yAxisList]),h=De.useMemo(()=>(A==null?void 0:A.map(Me=>({value:Me,label:Me})))||[],[A]);De.useEffect(()=>{if(t.yAxisList!==void 0){const Me=t.yAxisList.map((ue,Nt)=>{var zi,dn,Nn,gM,QM,Pa;return{name:ue,prefix:((Nn=(dn=(zi=t.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn[Nt])==null?void 0:Nn.prefix)||"",suffix:((Pa=(QM=(gM=t.customSettings)==null?void 0:gM.comboAxisSymbols)==null?void 0:QM[Nt])==null?void 0:Pa.suffix)||""}});i(ue=>({...ue,customSettings:{...ue.customSettings,comboAxisSymbols:Me}}))}},[t.yAxisList]);const x=()=>{var Me;if(j.startColor&&j.endColor&&j.offset1&&j.offset2&&j.direction){const ue=((Me=t.customSettings)==null?void 0:Me.gradients)||[];i(Nt=>({...Nt,customSettings:{...t.customSettings,gradients:[...ue,{startColor:j.startColor,endColor:j.endColor,offset1:j.offset1,offset2:j.offset2,direction:j.direction,isRadial:j.isRadial}]}})),s(!1)}},O=()=>{var Me;D(""),g.backgrounColor&&g.color&&g.columnName&&g.operator&&g.value?(i(ue=>{var QM,Pa,WN;const{tableSettings:Nt}=ue,zi=((QM=Nt==null?void 0:Nt.conditionalFormatting)==null?void 0:QM.filter(cN=>cN.columnName!==g.columnName))||[],Nn=[...((WN=(Pa=Nt==null?void 0:Nt.conditionalFormatting)==null?void 0:Pa.find(cN=>cN.columnName===g.columnName))==null?void 0:WN.rules)||[],{operator:g.operator,styles:{backgroundColor:g.backgrounColor,color:g.color},value:g.value}],gM=[...zi,{columnName:g.columnName,rules:Nn}];return{...ue,tableSettings:{...Nt,conditionalFormatting:gM}}}),l({backgrounColor:"#FFFFFF",color:"#000000",columnName:((Me=t.yAxisList)==null?void 0:Me[0])||"",operator:Qx[0].value,value:""}),u(!1)):D("please add valid values for rule")},d=De.useCallback(Me=>{const ue=(z==null?void 0:z.map(Nt=>Nt.value))||[];i(Nt=>({...Nt,tableSettings:{...t.tableSettings,badgeColumns:Me.filter(zi=>zi&&zi!=="NONE"&&ue.includes(zi))}}))},[z,t.tableSettings,i]),E=De.useCallback(Me=>{const ue=(h==null?void 0:h.map(Nt=>Nt.value))||[];i(Nt=>({...Nt,tableSettings:{...t.tableSettings,listColumns:Me.filter(zi=>zi&&zi!=="NONE"&&ue.includes(zi))}}))},[h,t.tableSettings,i]),C=Me=>{i(ue=>{var dn;const{customSettings:Nt}=ue,zi=(dn=Nt==null?void 0:Nt.gradients)==null?void 0:dn.filter(Nn=>Nn.startColor!==Me.startColor||Nn.endColor!==Me.endColor||Nn.offset1!==Me.offset1||Nn.offset2!==Me.offset2||Nn.direction!==Me.direction);return{...ue,customSettings:{...Nt,gradients:zi}}})},k=(Me,ue)=>{i(Nt=>{var Nn;const{tableSettings:zi}=Nt,dn=(Nn=zi==null?void 0:zi.conditionalFormatting)==null?void 0:Nn.map(gM=>{if(gM.columnName===Me){const QM=gM.rules.filter(Pa=>!(Pa.operator===ue.operator&&Pa.value===ue.value));return{...gM,rules:QM}}return gM});return{...Nt,tableSettings:{...zi,conditionalFormatting:dn==null?void 0:dn.filter(gM=>gM.rules.length>0)}}})};return t.chartType===Se.singleValue?v.jsxs("div",{className:Re.container,children:[v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Single Value Chart Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,fontSize:parseInt(Me.target.value,10)}})),value:(Y=t.customSettings)==null?void 0:Y.fontSize})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Single Value Suffix"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,singleValueSuffix:Me.target.value}})),value:(m=t.customSettings)==null?void 0:m.singleValueSuffix})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Single value prefix"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,singleValuePrefix:Me.target.value}})),value:(R=t.customSettings)==null?void 0:R.singleValuePrefix})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Customise Sub-Header"}),v.jsx(zn,{name:"show sub header",enabled:(P=t.customSettings)==null?void 0:P.subHeaderShow,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,subHeaderShow:!((ue=Me.customSettings)!=null&&ue.subHeaderShow)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Font Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"color",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,singleValueFontColor:Me}})),defaultValue:"#000000",value:((W=t.customSettings)==null?void 0:W.singleValueFontColor)||"#000000"})})]}),((B=t.customSettings)==null?void 0:B.subHeaderShow)&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Sub-Header Display Text"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",placeholder:"Enter the text here",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,displayText:Me.target.value}})),value:t.customSettings.displayText})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Sub-Header Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,subHeaderFontSize:parseInt(Me.target.value,10)}})),value:t.customSettings.subHeaderFontSize})})]})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Number Formatting"}),v.jsx(un,{selectedOption:{value:((X=t.customSettings)==null?void 0:X.numberFormatter)||"original",label:((F=t.customSettings)==null?void 0:F.numberFormatter)||"original"},options:J7,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,numberFormatter:Me.value}})),buttonWidth:"150px",menuWidth:"250px"})]})]}),n&&v.jsx(vs,{header:v.jsxs("div",{className:Re.accordionHeader,children:[v.jsx(Pe,{variant:"heading",children:"Comparison Value"}),v.jsx(nb,{text:"Comparison Value",position:"top",tooltipClass:"dbn-w-[200px]"})]}),headerButton:v.jsx("div",{className:Re.wrapper,children:v.jsx(zn,{name:"Comparison value",enabled:(G=t.customSettings)==null?void 0:G.comparisonValueShow,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,comparisonValueShow:!((ue=Me.customSettings)!=null&&ue.comparisonValueShow)}}})})}),content:v.jsx("div",{className:Re.comparisonValueWrapper,children:v.jsxs("div",{className:Re.comparisonValueContainer,children:[v.jsx(un,{onChange:Me=>{n.setComparisonLagSettings(ue=>({...ue,column:Me}))},selectedOption:n.comparisonLagSettings.column,options:n.dateTimeColumnList,isDisabled:!n.dateTimeColumnList.length,labelVariant:"static",buttonWidth:"320px",menuWidth:"320px",label:"Time Column"}),v.jsx(un,{onChange:Me=>{n.setComparisonLagSettings(ue=>({...ue,timeGrain:Me}))},selectedOption:n.comparisonLagSettings.timeGrain,options:zse,isDisabled:!n.comparisonLagSettings.column,labelVariant:"static",label:"Time Grain",buttonWidth:"320px",menuWidth:"320px"}),v.jsx(yi,{label:"Comparison Period lag",min:1,type:"number",placeholder:"period lag",onChange:({target:{value:Me}})=>n.setComparisonLagSettings(ue=>({...ue,periodLag:parseInt(Me,10)})),value:n.comparisonLagSettings.periodLag}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Comparison suffix"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",placeholder:"enter comparison suffix",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,comparisonSuffix:Me.target.value}})),value:(J=t.customSettings)==null?void 0:J.comparisonSuffix})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Comparison Value Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,comparisonValueFontSize:parseInt(Me.target.value,10)}})),value:(ee=t.customSettings)==null?void 0:ee.comparisonValueFontSize})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show Trendline"}),v.jsx(zn,{name:"show trendline",enabled:(q=t.customSettings)==null?void 0:q.isShowTrendLine,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,isShowTrendLine:!((ue=Me.customSettings)!=null&&ue.isShowTrendLine)}}})})]}),v.jsx(Bt,{variant:"primary",isDisabled:!n.dateTimeColumnList.length||!n.comparisonLagSettings.column.value||n.comparisonLagSettings.periodLag<=0||!n.comparisonLagSettings.timeGrain.value,onClick:()=>n.onSaveComparisonLag(),children:"save"})]})})})]}):t.chartType===Se.table||t.chartType===Se.horizontalStackTable?v.jsxs("div",{className:Re.container,children:[v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Table content Alignment"}),v.jsx(un,{selectedOption:{value:((ie=t.tableSettings)==null?void 0:ie.contentAlignment)||"",label:((re=t.tableSettings)==null?void 0:re.contentAlignment)||""},options:[{label:"Left Aligned",value:"left"},{label:"Right Aligned",value:"right"},{label:"Center Aligned",value:"center"}],onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,contentAlignment:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Table line gap"}),v.jsx(un,{selectedOption:{value:((le=t.tableSettings)==null?void 0:le.lineGap)||"small",label:((Ne=t.tableSettings)==null?void 0:Ne.lineGap)||"small"},options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,lineGap:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Table Title"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,tableTitle:Me.target.value}})),value:(se=t.tableSettings)==null?void 0:se.tableTitle,placeholder:"Enter the title here"})})]}),t.chartType===Se.horizontalStackTable?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Stacked column alias"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,stackColAlias:Me.target.value}})),value:(Ie=t.tableSettings)==null?void 0:Ie.stackColAlias,placeholder:"Enter the title here"})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show labels"}),v.jsx(zn,{name:"show stack labels",enabled:(Oe=t.customSettings)==null?void 0:Oe.showStackLabels,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showStackLabels:!((ue=Me.customSettings)!=null&&ue.showStackLabels)}}})})]})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"List Columns"}),v.jsx("div",{className:"dbn-w-[200px] dbn-flex dbn-justify-end",children:v.jsx(fl,{buttonWidth:"150px",menuWidth:"150px",options:h,onChange:Me=>E(Me.map(ue=>ue.value)),selectedOption:(($e=(ye=t.tableSettings)==null?void 0:ye.listColumns)==null?void 0:$e.map(Me=>({value:Me,label:Me})))||[]})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"List separator"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,listSeparator:Me.target.value}})),value:(Ve=t.tableSettings)==null?void 0:Ve.listSeparator,placeholder:"Enter a separator for list"})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Badge Columns"}),v.jsx("div",{className:"dbn-w-[200px] dbn-flex dbn-justify-end",children:v.jsx(fl,{buttonWidth:"150px",menuWidth:"150px",options:z,onChange:Me=>{d(Me.map(ue=>ue.value))},selectedOption:((Te=(Ee=t.tableSettings)==null?void 0:Ee.badgeColumns)==null?void 0:Te.map(Me=>({value:Me,label:Me})))||[]})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Badge separator"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,badgeSeparator:Me.target.value}})),value:(fe=t.tableSettings)==null?void 0:fe.badgeSeparator,placeholder:"Enter a separator for badges"})})]}),(ot=(Qe=t.tableSettings)==null?void 0:Qe.badgeColumns)==null?void 0:ot.map(Me=>{var ue,Nt,zi,dn;return v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"heading",children:Me}),v.jsxs("div",{className:Re.badgeDiv,children:[v.jsx(Ss,{name:"Badge color",onChange:Nn=>i(gM=>{var QM;return{...gM,tableSettings:{...gM.tableSettings,badgeColors:{...(QM=gM.tableSettings)==null?void 0:QM.badgeColors,[Me]:Nn}}}}),defaultValue:"#f3f4f6",value:((Nt=(ue=t.tableSettings)==null?void 0:ue.badgeColors)==null?void 0:Nt[Me])||"#f3f4f6",label:"Badge color"}),v.jsx(Ss,{name:"Text color",onChange:Nn=>i(gM=>{var QM;return{...gM,tableSettings:{...gM.tableSettings,badgeTextColors:{...(QM=gM.tableSettings)==null?void 0:QM.badgeTextColors,[Me]:Nn}}}}),defaultValue:"#000000",value:((dn=(zi=t.tableSettings)==null?void 0:zi.badgeTextColors)==null?void 0:dn[Me])||"#000000",label:"Text color"})]})]})}),t.chartType===Se.table?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Default Row Size"}),v.jsx(un,{selectedOption:{value:((rt=t.tableSettings)==null?void 0:rt.defaultRowSize)||"",label:((ke=t.tableSettings)==null?void 0:ke.defaultRowSize)||""},options:sd,onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,defaultRowSize:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Server Side Pagination"}),v.jsx(zn,{name:"pagination",enabled:(et=t.tableSettings)==null?void 0:et.isServerSidePagination,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,isServerSidePagination:!((ue=Me.tableSettings)!=null&&ue.isServerSidePagination)}}})})]})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Vertical Divider"}),v.jsx(zn,{name:"vertical divider",enabled:(xe=t.tableSettings)==null?void 0:xe.hideVerticalDivider,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,hideVerticalDivider:!((ue=Me.tableSettings)!=null&&ue.hideVerticalDivider)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Horizontal Divider"}),v.jsx(zn,{name:"horizontal divider",enabled:(Dt=t.tableSettings)==null?void 0:Dt.hideHorizontalDivider,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,hideHorizontalDivider:!((ue=Me.tableSettings)!=null&&ue.hideHorizontalDivider)}}})})]}),t.chartType===Se.horizontalStackTable?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Table Search"}),v.jsx(zn,{name:"table search",enabled:(ve=t.tableSettings)==null?void 0:ve.enableTableSearch,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableTableSearch:!((ue=Me.tableSettings)!=null&&ue.enableTableSearch)}}})})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Striped Rows"}),v.jsx(zn,{name:"striped rows",enabled:(pt=t.tableSettings)==null?void 0:pt.enableStripedRows,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableStripedRows:!((ue=Me.tableSettings)!=null&&ue.enableStripedRows)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Show Row Hover"}),v.jsx(zn,{name:"row hover",enabled:(Ct=t.tableSettings)==null?void 0:Ct.showRowHover,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,showRowHover:!((ue=Me.tableSettings)!=null&&ue.showRowHover)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Header Font Bold"}),v.jsx(zn,{name:"header font bold",enabled:(dt=t.tableSettings)==null?void 0:dt.headerFontBold,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,headerFontBold:!((ue=Me.tableSettings)!=null&&ue.headerFontBold)}}})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"UI Style"}),headerButton:null}),t.chartType===Se.table?v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Show Table Title"}),v.jsx(zn,{name:"table title",enabled:(Zt=t.tableSettings)==null?void 0:Zt.showTableTitle,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,showTableTitle:!((ue=Me.tableSettings)!=null&&ue.showTableTitle)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Table Header"}),v.jsx(zn,{name:"hide table header",enabled:($t=t.tableSettings)==null?void 0:$t.hideTableHeader,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,hideTableHeader:!((ue=Me.tableSettings)!=null&&ue.hideTableHeader)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Table Search"}),v.jsx(zn,{name:"table search",enabled:(Mt=t.tableSettings)==null?void 0:Mt.enableTableSearch,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableTableSearch:!((ue=Me.tableSettings)!=null&&ue.enableTableSearch)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Sorting"}),v.jsx(zn,{name:"sorting",enabled:(It=t.tableSettings)==null?void 0:It.enableSorting,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableSorting:!((ue=Me.tableSettings)!=null&&ue.enableSorting)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Disable Pagination"}),v.jsx(zn,{name:"disable pagination",enabled:(We=t.tableSettings)==null?void 0:We.disablePagination,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,disablePagination:!((ue=Me.tableSettings)!=null&&ue.disablePagination)}}})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Features"}),headerButton:null}):null,v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsx(Pe,{variant:"label",children:"You can add rules to make the cells in this table change color if they meet certain conditions."}),!a&&v.jsx(Bt,{variant:"secondary",onClick:()=>u(!0),leftIcon:v.jsx(Yt,{name:"plus"}),fitContainer:!0,children:"Add New Rule"}),a&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Columns"}),v.jsx(un,{options:((Tt=t.yAxisList)==null?void 0:Tt.map(Me=>({value:Me,label:Me})))||[],selectedOption:{value:g.columnName||"",label:g.columnName||""},onChange:Me=>l(ue=>({...ue,columnName:Me.value}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Condition"}),v.jsx(un,{options:Qx,selectedOption:{value:g.operator||"",label:g.operator||""},onChange:Me=>l(ue=>({...ue,operator:Me.value}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Value"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:({target:{value:Me}})=>l(ue=>({...ue,value:Number(Me)||Number(Me)===0?Number(Me):Me}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Background color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"background color",onChange:Me=>l(ue=>({...ue,backgrounColor:Me})),defaultValue:"#FFFFFF",value:g.backgrounColor})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Text color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"text color",onChange:Me=>l(ue=>({...ue,color:Me})),defaultValue:"#000000",value:g.color})})]}),N&&v.jsx(v9,{text:N,variant:"error"}),v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-justify-between",children:[v.jsx(Bt,{variant:"secondary",onClick:()=>u(!1),children:"Cancel"}),v.jsx(Bt,{variant:"primary",type:"button",onClick:()=>O(),children:"Save Rule"})]})]}),(jt=(He=t.tableSettings)==null?void 0:He.conditionalFormatting)==null?void 0:jt.map(Me=>v.jsx("div",{className:Re.formattingContainer,children:v.jsx("div",{className:Re.ruleContainer,children:Me.rules.map(ue=>{var Nt;return v.jsxs("div",{className:"dbn-flex dbn-gap-1 dbn-justify-between",children:[v.jsxs("div",{className:"dbn-flex dbn-gap-1",children:[v.jsx(Pe,{variant:"body-text-sm",children:Me.columnName}),v.jsx(Pe,{variant:"body-text-sm",children:(Nt=Qx.find(zi=>zi.value===ue.operator))==null?void 0:Nt.label}),v.jsx(Pe,{variant:"body-text-sm",children:v.jsx("span",{style:{backgroundColor:ue.styles.backgroundColor,color:ue.styles.color},className:"dbn-px-1",children:ue.value})})]}),v.jsx(Bt,{variant:"popover",className:"dbn-flex dbn-gap-1",onClick:()=>k(Me.columnName,ue),rightIcon:v.jsx(Yt,{name:"cross"})},ue.value)]})})})},Me.columnName))]}),header:v.jsx(Pe,{variant:"heading",children:"Conditional Formatting"}),headerButton:null})]}):v.jsx(v.Fragment,{children:v.jsxs("div",{className:Re.container,children:[![Se.pie,Se.doughnut,Se.rose,Se.gauge,Se.sankey].includes(t.chartType)&&v.jsxs(v.Fragment,{children:[v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Line"}),v.jsx(zn,{name:"X-axis line",enabled:(lt=t.customSettings)==null?void 0:lt.hideXAxisLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideXAxisLines:!((ue=Me.customSettings)!=null&&ue.hideXAxisLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Splitlines"}),v.jsx(zn,{name:"X-axis splitlines",enabled:(kt=t.customSettings)==null?void 0:kt.hideXSplitLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideXSplitLines:!((ue=Me.customSettings)!=null&&ue.hideXSplitLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Labels"}),v.jsx(zn,{name:"X-axis labels",enabled:(ii=t.customSettings)==null?void 0:ii.hideXAxisLabels,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideXAxisLabels:!((ue=Me.customSettings)!=null&&ue.hideXAxisLabels)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Truncate Label"}),v.jsx(zn,{name:"truncate label",enabled:(gi=t.labelSettings)==null?void 0:gi.truncateLabel,onChange:()=>i(Me=>{var ue;return{...Me,labelSettings:{...Me.labelSettings,truncateLabel:!((ue=Me.labelSettings)!=null&&ue.truncateLabel)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Rotation"}),v.jsx(un,{buttonWidth:"150px",isSearchEnabled:!0,menuWidth:"150px",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,xRotation:parseInt(Me.value,10)}})),options:[{icon:"text-rotation-none",label:"0",value:"0"},{icon:"text-rotation-angle-up",label:"45",value:"45"},{icon:"text-rotation-up",label:"90",value:"90"}],searchPlaceholder:"0",selectedOption:{icon:"text-rotation-none",label:((Et=(ht=t.customSettings)==null?void 0:ht.xRotation)==null?void 0:Et.toString())||"0",value:((Dn=(ai=t.customSettings)==null?void 0:ai.xRotation)==null?void 0:Dn.toString())||"0"}})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Custom label rotation"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",value:(Tr=t.customSettings)==null?void 0:Tr.customRotation,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,customRotation:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Truncate Label Value"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",value:(eM=t.labelSettings)==null?void 0:eM.truncateLabelValue,isDisabled:!((dr=t.labelSettings)!=null&&dr.truncateLabel),onChange:Me=>i(ue=>({...ue,labelSettings:{...ue.labelSettings,truncateLabelValue:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(ha=(Or=t.labelSettings)==null?void 0:Or.XAxisStyle)==null?void 0:ha.size,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,size:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Family"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",value:(Ya=(WM=t.labelSettings)==null?void 0:WM.XAxisStyle)==null?void 0:Ya.family,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,family:Me.target.value}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Weight"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(ba=(BM=t.labelSettings)==null?void 0:BM.XAxisStyle)==null?void 0:ba.weight,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,weight:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"color",onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,color:Me}}}})},defaultValue:"#000000",value:((OM=(TM=t.labelSettings)==null?void 0:TM.XAxisStyle)==null?void 0:OM.color)||"#000000"})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Horizontal Axis"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Line"}),v.jsx(zn,{name:"Y-axis line",enabled:(IM=t.customSettings)==null?void 0:IM.hideYAxisLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideYAxisLines:!((ue=Me.customSettings)!=null&&ue.hideYAxisLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Splitlines"}),v.jsx(zn,{name:"Y-axis splitlines",enabled:(Le=t.customSettings)==null?void 0:Le.hideYSplitLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideYSplitLines:!((ue=Me.customSettings)!=null&&ue.hideYSplitLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Labels"}),v.jsx(zn,{name:"Y-axis labels",enabled:(Lt=t.customSettings)==null?void 0:Lt.hideYAxisLabels,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideYAxisLabels:!((ue=Me.customSettings)!=null&&ue.hideYAxisLabels)}}})})]}),![Se.pie,Se.doughnut,Se.funnel,Se.gauge,Se.sankey,Se.singleValue,Se.table].includes(t.chartType)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Axis Position"}),v.jsx(un,{selectedOption:{value:((Wt=t.axisSettings)==null?void 0:Wt.axis)||"left",label:((Xt=t.axisSettings)==null?void 0:Xt.axis)||"left"},options:[{label:"left",value:"left"},{label:"right",value:"right"}],onChange:Me=>i(ue=>({...ue,axisSettings:{...ue.axisSettings,axis:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(Ki=(Ji=t.labelSettings)==null?void 0:Ji.YAxisStyle)==null?void 0:Ki.size,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,size:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Family"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",value:(Si=(qi=t.labelSettings)==null?void 0:qi.YAxisStyle)==null?void 0:Si.family,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,family:Me.target.value}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Weight"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(Mr=(Vr=t.labelSettings)==null?void 0:Vr.YAxisStyle)==null?void 0:Mr.weight,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,weight:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"color",onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,color:Me}}}})},defaultValue:"#000000",value:((hr=(ar=t.labelSettings)==null?void 0:ar.YAxisStyle)==null?void 0:hr.color)||"#000000"})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Vertical Axis"}),headerButton:null})]}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsx(Hte,{val:(_a=t.legendSettings)==null?void 0:_a.fixedPosition,onClick:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,fixedPosition:Me}}))}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Customize legend"}),v.jsx(zn,{name:"customise",enabled:(ko=t.legendSettings)==null?void 0:ko.customise,onChange:()=>i(Me=>{var ue;return{...Me,legendSettings:{...Me.legendSettings,customise:!((ue=Me.legendSettings)!=null&&ue.customise)}}})})]}),(xn=t.legendSettings)!=null&&xn.customise?v.jsxs("div",{className:Re.positionContainer,children:[v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-top",size:"xl"}),v.jsx(yi,{type:"number",value:(ws=t.legendSettings)==null?void 0:ws.top,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,top:parseInt(Me.target.value,10)}}))})]}),v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-bottom",size:"xl"}),v.jsx(yi,{type:"number",value:(La=t.legendSettings)==null?void 0:La.bottom,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,bottom:parseInt(Me.target.value,10)}}))})]}),v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-left",size:"xl"}),v.jsx(yi,{type:"number",value:(nn=t.legendSettings)==null?void 0:nn.left,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,left:parseInt(Me.target.value,10)}}))})]}),v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-right",size:"xl"}),v.jsx(yi,{type:"number",value:(Ra=t.legendSettings)==null?void 0:Ra.right,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,right:parseInt(Me.target.value,10)}}))})]})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Legend Appearance"}),v.jsx(un,{selectedOption:{value:((Lu=t.legendSettings)==null?void 0:Lu.position)||"horizontal",label:((HM=t.legendSettings)==null?void 0:HM.position)||"horizontal"},options:[{label:"horizontal",value:"horizontal"},{label:"vertical",value:"vertical"}],onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,position:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Truncate Legend"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",value:(xu=t.legendSettings)==null?void 0:xu.truncateLegendValue,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,truncateLegendValue:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Legend Shape"}),v.jsx(un,{selectedOption:{value:((wM=t.legendSettings)==null?void 0:wM.legendShape)||"rectangle",label:((NN=t.legendSettings)==null?void 0:NN.legendShape)||"rectangle"},options:[{label:"Circle",value:"circle"},{label:"Rectangle",value:"rect"},{label:"Rounded rectangle",value:"roundRect"},{label:"Triangle",value:"triangle"},{label:"Diamond",value:"diamond"},{label:"Arrow",value:"arrow"},{label:"none",value:"none"}],onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,legendShape:Me.value}})),buttonWidth:"150px",menuWidth:"200px"})]}),[Se.bar,Se.line,Se.stack,Se.timeSeries].includes(t.chartType)&&t.isMultiDimension&&((hM=t.timeSeriesSettings)==null?void 0:hM.groupBySettings.value)!=="ungrouped"?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable legend selection"}),v.jsx(zn,{name:"legend selection",enabled:(sN=t.customSettings)==null?void 0:sN.showSelectLegend,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showSelectLegend:!((ue=Me.customSettings)!=null&&ue.showSelectLegend)}}})})]}):null]}),header:v.jsx(Pe,{variant:"heading",children:"Chart Legend"}),headerButton:v.jsx(zn,{name:"show legend",defaultEnabled:!0,enabled:(DN=t.legendSettings)==null?void 0:DN.show,onChange:()=>i(Me=>{var ue;return{...Me,legendSettings:{...Me.legendSettings,show:!((ue=Me.legendSettings)!=null&&ue.show)}}})})}),![Se.pie,Se.doughnut,Se.rose,Se.gauge,Se.sankey].includes(t.chartType)&&v.jsx(vs,{width:"100%",content:v.jsx("div",{className:Re["container-wrapper"],children:v.jsxs("div",{className:Re.marginContainer,children:[v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(Ku=t.margins)==null?void 0:Ku.marginTop,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginTop:parseInt(Me.target.value,10)}}))})}),v.jsxs("div",{className:Re.chartDemoContainer,children:[v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(Uo=t.margins)==null?void 0:Uo.marginLeft,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginLeft:parseInt(Me.target.value,10)}}))})}),v.jsx("div",{className:Re.chartDemo}),v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(aa=t.margins)==null?void 0:aa.marginRight,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginRight:parseInt(Me.target.value,10)}}))})})]}),v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(ua=t.margins)==null?void 0:ua.marginBottom,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginBottom:parseInt(Me.target.value,10)}}))})})]})}),header:v.jsx(Pe,{variant:"heading",children:"Chart Margin"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsx("div",{className:Re["container-wrapper"],children:v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Position"}),v.jsx(un,{selectedOption:{value:((yM=t.labelSettings)==null?void 0:yM.position)||"hidden",label:((pu=t.labelSettings)==null?void 0:pu.position)||"hidden"},options:Kke(t.chartType),onChange:Me=>i(ue=>({...ue,labelSettings:{...ue,show:Me.value!=="hidden",position:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]})}),header:v.jsx(Pe,{variant:"heading",children:"Chart Label"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.chartColors,children:[v.jsx("div",{className:"dbn-flex dbn-items-center",children:(Eu=t.chartColors)==null?void 0:Eu.map(Me=>v.jsx("span",{className:"dbn-h-6 dbn-w-6 dbn-inline-block",style:{backgroundColor:Me},title:Me},Me))}),v.jsxs("div",{className:"dbn-flex dbn-gap-2",children:[v.jsx(fs,{text:"Reset",children:v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"delete",size:"sm"}),onClick:()=>r==null?void 0:r(!0)})}),v.jsx("div",{className:"dbn-border dbn-border-secondary"}),v.jsx(fs,{text:"Shuffle",children:v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"shuffle",size:"sm"}),onClick:M})})]})]}),[Se.bar,Se.row,Se.histogram].includes(t.chartType)?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show different colored bars"}),v.jsx(zn,{name:"different colored",enabled:(vu=t.customSettings)==null?void 0:vu.coloredBars,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,coloredBars:!((ue=Me.customSettings)!=null&&ue.coloredBars)}}})})]}):null,v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-flex-col dbn-gap-4",children:[v.jsx(Pe,{variant:"heading",children:"Gradients for charts"}),t.chartType!==Se.gauge&&v.jsxs(v.Fragment,{children:[!o&&v.jsxs("div",{className:"dbn-flex dbn-flex-row dbn-justify-between dbn-items-center",children:[v.jsx(Pe,{variant:"label",children:"Chart gradient"}),v.jsx(Bt,{variant:"secondary",onClick:()=>s(!0),leftIcon:v.jsx(Yt,{name:"plus"}),children:"Add New Gradient"})]}),o&&v.jsxs("div",{className:Re.formattingContainer,children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Start Color"}),v.jsx(Ss,{name:"start",onChange:Me=>T(ue=>({...ue,startColor:Me})),defaultValue:"#FFFFFF",value:j.startColor})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"End Color"}),v.jsx(Ss,{name:"end",onChange:Me=>T(ue=>({...ue,endColor:Me})),defaultValue:"#000000",value:j.endColor})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for start color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:Me=>T(ue=>({...ue,offset1:Number(Me.target.value)}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for end color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:({target:{value:Me}})=>T(ue=>({...ue,offset2:Number(Me)}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Direction"}),v.jsx(un,{selectedOption:{value:j.direction,label:j.direction},options:[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}],onChange:Me=>T(ue=>({...ue,direction:Me.value})),buttonWidth:"220px",menuWidth:"220px"})]}),v.jsx(Bt,{variant:"primary",type:"button",onClick:()=>x(),fitContainer:!0,children:"Save Gradient"})]}),!o&&((qu=(mo=t.customSettings)==null?void 0:mo.gradients)==null?void 0:qu.map(Me=>v.jsxs("div",{className:Re.gradientContainer,children:[v.jsx(Pe,{variant:"label",children:`${Me.startColor} - ${Me.endColor}`}),v.jsx(Bt,{variant:"tertiary",onClick:()=>C(Me),leftIcon:v.jsx(Yt,{name:"cross",size:"xs"})})]},`${Me.startColor}-${Me.endColor}`)))]}),!o&&([Se.bar,Se.row,Se.stack,Se.histogram].includes(t.chartType)||t.chartType===Se.timeSeries&&((Cs=(Xa=t.timeSeriesSettings)==null?void 0:Xa.seriesType[0])==null?void 0:Cs.type)==="bar")?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Add bar background gradient"}),v.jsx(zn,{name:"show bar background gradient",enabled:(xa=t.customSettings)==null?void 0:xa.isShowBarGradient,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,isShowBarGradient:!((ue=Me.customSettings)!=null&&ue.isShowBarGradient)}}})})]}),((An=t.customSettings)==null?void 0:An.isShowBarGradient)&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Start Color"}),v.jsx(Ss,{name:"startColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,startColor:Me}}}}),defaultValue:"#FFFFFF",value:((eo=(pa=t.customSettings)==null?void 0:pa.barGradient)==null?void 0:eo.startColor)||"#FFFFFF"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"End Color"}),v.jsx(Ss,{name:"endColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,endColor:Me}}}}),defaultValue:"#000000",value:((Mn=(Yo=t.customSettings)==null?void 0:Yo.barGradient)==null?void 0:Mn.endColor)||"#000000"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for Start Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,offset1:Number(Me.target.value)}}}}),value:(_o=(bo=t.customSettings)==null?void 0:bo.barGradient)==null?void 0:_o.offset1})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for End Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:({target:{value:Me}})=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,offset2:Number(Me)}}}}),value:(to=(Vi=t.customSettings)==null?void 0:Vi.barGradient)==null?void 0:to.offset2})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Direction"}),v.jsx(un,{selectedOption:{value:((Fr=(Lr=t.customSettings)==null?void 0:Lr.barGradient)==null?void 0:Fr.direction)||"",label:((Su=(zM=t.customSettings)==null?void 0:zM.barGradient)==null?void 0:Su.direction)||""},options:[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}],onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,direction:Me.value}}}})})]})]})]}):null,!o&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Add background gradient"}),v.jsx(zn,{name:"show background gradient",enabled:(gr=t.customSettings)==null?void 0:gr.enableBackgroundGradient,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,enableBackgroundGradient:!((ue=Me.customSettings)!=null&&ue.enableBackgroundGradient)}}})})]}),(Pn=t.customSettings)!=null&&Pn.enableBackgroundGradient?v.jsxs("div",{className:Re.formattingContainer,children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Start Color"}),v.jsx(Ss,{name:"startBackColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,startColor:Me}}}}),defaultValue:"#FFFFFF",value:((CM=(Ro=t.customSettings)==null?void 0:Ro.backgroundGradient)==null?void 0:CM.startColor)||"#FFFFFF"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"End Color"}),v.jsx(Ss,{name:"endBackColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,endColor:Me}}}}),defaultValue:"#000000",value:((Ea=(tM=t.customSettings)==null?void 0:tM.backgroundGradient)==null?void 0:Ea.endColor)||"#000000"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for Start Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,offset1:Number(Me.target.value)}}}}),value:(GM=(gN=t.customSettings)==null?void 0:gN.backgroundGradient)==null?void 0:GM.offset1})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for End Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:({target:{value:Me}})=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,offset2:Number(Me)}}}}),value:(VN=(Ka=t.customSettings)==null?void 0:Ka.backgroundGradient)==null?void 0:VN.offset2})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Direction"}),v.jsx(un,{selectedOption:{value:((wu=(oa=t.customSettings)==null?void 0:oa.backgroundGradient)==null?void 0:wu.direction)||"",label:((Ue=(Ae=t.customSettings)==null?void 0:Ae.backgroundGradient)==null?void 0:Ue.direction)||""},label:"Direction",options:[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}],onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,direction:Me.value}}}})})]})]}):null]})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Chart Colors"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsx(yi,{type:"text",label:"Chart Title",value:(ft=t.customSettings)==null?void 0:ft.chartTitle,onChange:Me=>{i(ue=>({...ue,customSettings:{...ue.customSettings,chartTitle:Me.target.value}}))}}),v.jsx(yi,{type:"text",label:"Chart Description",value:(Ht=t.customSettings)==null?void 0:Ht.chartDesc,onChange:Me=>{i(ue=>({...ue,customSettings:{...ue.customSettings,chartDesc:Me.target.value}}))}}),v.jsx(Pe,{variant:"body-text-sm",children:"Position"}),v.jsx(Hte,{val:(Qn=t.customSettings)==null?void 0:Qn.titlePosition,onClick:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,titlePosition:Me}}))})]}),header:v.jsx(Pe,{variant:"heading",children:"Chart Title & Description"}),headerButton:v.jsx(zn,{name:"chart title & desc",defaultEnabled:!0,enabled:(Ri=t.customSettings)==null?void 0:Ri.enableTitleDesc,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,enableTitleDesc:!((ue=Me.customSettings)!=null&&ue.enableTitleDesc)}}})})}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[t.chartType!==Se.table&&t.chartType!==Se.pivot&&t.chartType!==Se.funnel&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Number Formatting"}),v.jsx(un,{selectedOption:{value:((Jn=t.customSettings)==null?void 0:Jn.numberFormatter)||"original",label:((vr=t.customSettings)==null?void 0:vr.numberFormatter)||"original"},options:J7,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,numberFormatter:Me.value}})),buttonWidth:"150px",menuWidth:"250px"})]}),t.chartType!==Se.table&&t.chartType!==Se.pivot&&t.chartType!==Se.funnel&&v.jsx(v.Fragment,{children:t.chartType!==Se.combo&&v.jsx(v.Fragment,{children:v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add prefix to labels",value:(Xn=t.customSettings)==null?void 0:Xn.labelPrefix,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,labelPrefix:Me.target.value}}))}),v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add suffix to labels",value:(ae=t.customSettings)==null?void 0:ae.labelSuffix,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,labelSuffix:Me.target.value}}))})]})})}),t.chartType===Se.combo&&v.jsxs(v.Fragment,{children:[(de=t.customSettings)!=null&&de.isStackBar?t.customSettings.comboAxisSymbols.filter(Me=>!t.comboBarList.includes(Me.name)).map(Me=>v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"body-text-sm",children:`${Me.name} axis`}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add prefix to labels",value:Me.prefix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,prefix:ue.target.value}:Nn)}}})}),v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add suffix to labels",value:Me.suffix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,suffix:ue.target.value}:Nn)}}})})]})]})):(Ke=(Ge=t.customSettings)==null?void 0:Ge.comboAxisSymbols)==null?void 0:Ke.map(Me=>v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"body-text-sm",children:`${Me.name} axis`}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add prefix to labels",value:Me.prefix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,prefix:ue.target.value}:Nn)}}})}),v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add suffix to labels",value:Me.suffix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,suffix:ue.target.value}:Nn)}}})})]})]})),((xt=t.customSettings)==null?void 0:xt.isStackBar)&&v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"body-text-sm",children:"Stack axis"}),v.jsx("div",{className:Re.wrapper,children:v.jsx(yi,{type:"text",label:"Name",placeholder:"Add axis name",value:(_t=(ri=t==null?void 0:t.customSettings)==null?void 0:ri.comboStackAxisSymbols)==null?void 0:_t.name,onChange:({target:{value:Me}})=>i(ue=>{var Nt,zi,dn,Nn;return{...ue,customSettings:{...ue.customSettings,comboStackAxisSymbols:{prefix:((zi=(Nt=ue.customSettings)==null?void 0:Nt.comboStackAxisSymbols)==null?void 0:zi.prefix)||"",name:Me,suffix:((Nn=(dn=ue.customSettings)==null?void 0:dn.comboStackAxisSymbols)==null?void 0:Nn.suffix)||""}}}})})}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add Suffix to labels",value:(Hi=(li=t==null?void 0:t.customSettings)==null?void 0:li.comboStackAxisSymbols)==null?void 0:Hi.suffix,onChange:({target:{value:Me}})=>i(ue=>{var Nt,zi,dn,Nn;return{...ue,customSettings:{...ue.customSettings,comboStackAxisSymbols:{suffix:Me,name:((zi=(Nt=ue.customSettings)==null?void 0:Nt.comboStackAxisSymbols)==null?void 0:zi.name)||"",prefix:((Nn=(dn=ue.customSettings)==null?void 0:dn.comboStackAxisSymbols)==null?void 0:Nn.prefix)||""}}}})}),v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add Prefix to labels",value:(Vn=(fn=t==null?void 0:t.customSettings)==null?void 0:fn.comboStackAxisSymbols)==null?void 0:Vn.prefix,onChange:({target:{value:Me}})=>i(ue=>{var Nt,zi,dn,Nn;return{...ue,customSettings:{...ue.customSettings,comboStackAxisSymbols:{prefix:Me,name:((zi=(Nt=ue.customSettings)==null?void 0:Nt.comboStackAxisSymbols)==null?void 0:zi.name)||"",suffix:((Nn=(dn=ue.customSettings)==null?void 0:dn.comboStackAxisSymbols)==null?void 0:Nn.suffix)||""}}}})})]})]})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Formatting"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[t.chartType===Se.sankey&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Interchange the source and target"}),v.jsx(zn,{name:"show background",enabled:(kn=t.backGroundColor)==null?void 0:kn.show,onChange:()=>i(Me=>{var ue,Nt,zi;return{...Me,sankeyValues:[((ue=Me==null?void 0:Me.sankeyValues)==null?void 0:ue[1])||"",((Nt=Me==null?void 0:Me.sankeyValues)==null?void 0:Nt[0])||"",((zi=Me==null?void 0:Me.sankeyValues)==null?void 0:zi[2])||""]}})})]}),[Se.bar,Se.row,Se.stack,Se.histogram,Se.combo,Se.timeSeries].includes(t.chartType)||t.chartType===Se.timeSeries&&((Ir=(lr=t.timeSeriesSettings)==null?void 0:lr.seriesType[0])==null?void 0:Ir.type)==="bar"?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Show bar background"}),v.jsx(zn,{name:"show background",enabled:(pn=t.backGroundColor)==null?void 0:pn.show,onChange:()=>i(Me=>{var ue;return{...Me,backGroundColor:{show:!((ue=Me.backGroundColor)!=null&&ue.show)}}})})]}):null,t.chartType===Se.combo&&v.jsx(fl,{selectedOption:((FN=(io=t.comboBarList)==null?void 0:io.filter(Me=>{var ue;return(ue=t.yAxisList)==null?void 0:ue.includes(Me)}))==null?void 0:FN.map(Me=>({value:Me,label:Me})))||[],label:"Combo Bar",options:((Qs=t.yAxisList)==null?void 0:Qs.map(Me=>({value:Me,label:Me})))||[],onChange:Me=>i(ue=>{var Nt;return{...ue,comboBarList:((Nt=Me==null?void 0:Me.filter(zi=>{var dn;return(dn=t.yAxisList)==null?void 0:dn.includes(zi.value)}))==null?void 0:Nt.map(zi=>zi.value))||[]}}),menuWidth:"100%",buttonWidth:"100%"}),t.chartType===Se.bubble?v.jsx(yi,{type:"number",label:"Constant for bubble size",min:0,onChange:Me=>i(ue=>({...ue,percentageSize:Number(Me.target.value)})),value:t.percentageSize}):null,t.chartType===Se.bar||t.chartType===Se.timeSeries&&((ks=(qa=(_g=t.timeSeriesSettings)==null?void 0:_g.seriesType)==null?void 0:qa[0])==null?void 0:ks.type)==="bar"?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Enable cumulative bar"}),v.jsx(zn,{name:"cumulative",enabled:(Us=t.customSettings)==null?void 0:Us.cumulativeBar,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,cumulativeBar:!((ue=Me.customSettings)!=null&&ue.cumulativeBar)}}})})]}):null,t.chartType===Se.combo&&v.jsx(v.Fragment,{children:((Rg=t==null?void 0:t.comboBarList)==null?void 0:Rg.length)>0&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Enable Stack bar"}),v.jsx(zn,{name:"enable stack bar",enabled:(Sj=t.customSettings)==null?void 0:Sj.isStackBar,onChange:()=>{i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,isStackBar:!((ue=Me.customSettings)!=null&&ue.isStackBar)}}})}})]})}),[Se.bar,Se.row,Se.stack].includes(t.chartType)||t.chartType===Se.timeSeries&&((Pg=(wj=t.timeSeriesSettings)==null?void 0:wj.seriesType[0])==null?void 0:Pg.type)==="bar"?v.jsxs(v.Fragment,{children:[v.jsx(yi,{type:"number",label:"Modify Bar width",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,barWidth:parseInt(Me.target.value,10)}})),value:(Vg=t.customSettings)==null?void 0:Vg.barWidth}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"number",label:"Modify Top Bar radius",min:0,onChange:Me=>e(ue=>({...ue,topRadius:parseInt(Me.target.value,10)})),value:((tc=(ec=t.customSettings)==null?void 0:ec.barRadius)==null?void 0:tc[1])||0}),v.jsx(yi,{type:"number",label:"Modify Bottom Bar radius",min:0,onChange:Me=>e(ue=>({...ue,bottomRadius:parseInt(Me.target.value,10)})),value:((Fg=(ic=t.customSettings)==null?void 0:ic.barRadius)==null?void 0:Fg[3])||0})]})]}):null,[Se.line,Se.bar,Se.row,Se.area,Se.combo,Se.histogram,Se.stepped,Se.scatter,Se.timeSeries,Se.stackedArea].includes(t.chartType)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsxs("span",{className:"dbn-flex dbn-gap-1 dbn-items-center",children:[v.jsx(Pe,{variant:"heading",children:"Hide 0/null values"}),v.jsxs(nb,{position:"center",children:["Hide 0, undefined, null, N/A,",v.jsx("br",{})," values from the tooltip"]})]}),v.jsx(zn,{name:"hide null values",enabled:(no=t.customSettings)==null?void 0:no.hideNullValues,onChange:()=>{i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideNullValues:!((ue=Me.customSettings)!=null&&ue.hideNullValues)}}})}})]}),[Se.bar,Se.line,Se.area,Se.stackedArea,Se.timeSeries].includes(t.chartType)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Enable Dynamic behavior"}),v.jsx(zn,{name:"dynamic",enabled:(Cj=t.customSettings)==null?void 0:Cj.showDynamicBehaviour,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showDynamicBehaviour:!((ue=Me.customSettings)!=null&&ue.showDynamicBehaviour)}}})})]}),![Se.gauge,Se.pie,Se.table,Se.singleValue,Se.doughnut,Se.funnel,Se.sankey,Se.rose].includes(t.chartType)&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsxs("span",{className:"dbn-flex dbn-gap-1 dbn-items-center",children:[v.jsx(Pe,{variant:"heading",children:"Enable chart zoom"}),v.jsx(nb,{position:"center",children:"Enable zooming and panning for the chart"})]}),v.jsx(zn,{name:"chart zoom",enabled:(bD=($g=t.customSettings)==null?void 0:$g.chartZoom)==null?void 0:bD.isZoomEnabled,onChange:()=>{i(Me=>{var ue,Nt,zi;return{...Me,customSettings:{...Me.customSettings,chartZoom:{...(ue=Me.customSettings)==null?void 0:ue.chartZoom,isZoomEnabled:!((zi=(Nt=Me.customSettings)==null?void 0:Nt.chartZoom)!=null&&zi.isZoomEnabled),zoomAxis:"x",zoomOnMouseWheel:!0}}}})}})]}),((Qj=(Wg=t.customSettings)==null?void 0:Wg.chartZoom)==null?void 0:Qj.isZoomEnabled)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Select zoom axis"}),v.jsx(un,{selectedOption:{value:t.customSettings.chartZoom.zoomAxis||"x",label:t.customSettings.chartZoom.zoomAxis||"x"},options:[{label:"x",value:"x"},{label:"y",value:"y"},{label:"xy",value:"xy"}],onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,chartZoom:{...(Nt=ue.customSettings)==null?void 0:Nt.chartZoom,zoomAxis:Me.value}}}}),buttonWidth:"150px",menuWidth:"150px"})]})]}),[Se.rose].includes(t.chartType)&&v.jsxs(v.Fragment,{children:[t.chartType==="rose"&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Rose type"}),v.jsx(un,{selectedOption:{value:((_D=t.customSettings)==null?void 0:_D.roseType)||"",label:((nc=t.customSettings)==null?void 0:nc.roseType)||""},options:[{label:"Radius",value:"radius"},{label:"Area",value:"area"}],onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,roseType:Me.value}}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Mode"}),v.jsx(un,{selectedOption:{value:((Na=t.customSettings)==null?void 0:Na.selectedMode)||"",label:((ro=t.customSettings)==null?void 0:ro.selectedMode)||""},options:[{label:"Single",value:"single"},{label:"Multiple",value:"multiple"},{label:"Series",value:"series"}],onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,selectedMode:Me.value}}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Offset"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",label:"Offset",min:0,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,selectedOffset:parseInt(Me.target.value,10)}})),value:(uM=t.customSettings)==null?void 0:uM.selectedOffset})})]})]}),t.chartType===Se.stack&&v.jsxs("div",{children:[v.jsx(Pe,{variant:"heading",children:"Show 100% stacked bar"}),v.jsx(zn,{name:"full stacked",enabled:(eu=t.customSettings)==null?void 0:eu.showFullStacked,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showFullStacked:!((ue=Me.customSettings)!=null&&ue.showFullStacked)}}})})]}),t.chartType===Se.funnel&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show Funnel shadow"}),v.jsx(zn,{name:"funnel 3",enabled:(lN=t.customSettings)==null?void 0:lN.showFunnelShadow,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showFunnelShadow:!((ue=Me.customSettings)!=null&&ue.showFunnelShadow)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Padding between steps"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:30,value:((RD=t.customSettings)==null?void 0:RD.stepPadding)||10,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,stepPadding:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show label with values"}),v.jsx(zn,{name:"funnel 1",enabled:(rc=t.customSettings)==null?void 0:rc.showLabelValues,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showLabelValues:!((ue=Me.customSettings)!=null&&ue.showLabelValues)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show Conversion Rate"}),v.jsx(zn,{name:"funnel 2",enabled:($N=t.customSettings)==null?void 0:$N.showConversionRate,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showConversionRate:!((ue=Me.customSettings)!=null&&ue.showConversionRate)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Label Format"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",placeholder:"{b}",value:(Mc=t.customSettings)==null?void 0:Mc.labelFormat,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,labelFormat:Me.target.value}}))})})]})]}),[Se.pie,Se.doughnut,Se.rose].includes(t.chartType)?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show label line"}),v.jsx(zn,{name:"label line",enabled:(ac=t.labelSettings)==null?void 0:ac.showLabelLine,onChange:()=>i(Me=>{var ue;return{...Me,labelSettings:{...Me.labelSettings,showLabelLine:!((ue=Me.labelSettings)!=null&&ue.showLabelLine)}}})})]}):null,t.chartType===Se.timeSeries&&v.jsx(Xke,{onChange:Me=>i(ue=>({...ue,timeSeriesSettings:{...ue.timeSeriesSettings,...Me instanceof Function?Me(ue.timeSeriesSettings||{}):Me}})),yAxisList:t.yAxisList||[],settings:t.timeSeriesSettings})]}),header:v.jsx(Pe,{variant:"heading",children:"Other customizations"}),headerButton:null})]})})},Wet={chartButtonContainer:"_chartButtonContainer_a2qou_1","settingsTab-header-control":"_settingsTab-header-control_a2qou_9",tabContainer:"_tabContainer_a2qou_17",tab:"_tab_a2qou_17",tabText:"_tabText_a2qou_33",chartButtons:"_chartButtons_a2qou_41",chartButton:"_chartButton_a2qou_1",chartButtonSelected:"_chartButtonSelected_a2qou_73",chartTypesButton:"_chartTypesButton_a2qou_81",button:"_button_a2qou_89",propertyButton:"_propertyButton_a2qou_97",settings:"_settings_a2qou_9",disable:"_disable_a2qou_111"},QT={backdrop:"_backdrop_1x4lb_1",panel:"_panel_1x4lb_5",left:"_left_1x4lb_9",right:"_right_1x4lb_12",small:"_small_1x4lb_15",medium:"_medium_1x4lb_18",large:"_large_1x4lb_21",header:"_header_1x4lb_25",headerTitle:"_headerTitle_1x4lb_29",content:"_content_1x4lb_33",footer:"_footer_1x4lb_37",panelStory:"_panelStory_1x4lb_41",panelStoryHeader:"_panelStoryHeader_1x4lb_45",panelStoryHeaderRight:"_panelStoryHeaderRight_1x4lb_49",panelStoryContent:"_panelStoryContent_1x4lb_53",panelStoryFooter:"_panelStoryFooter_1x4lb_57",panelStoryFooterLeft:"_panelStoryFooterLeft_1x4lb_61",panelStoryFooterLeftWrapper:"_panelStoryFooterLeftWrapper_1x4lb_65"},Ev=({children:t,isOpen:i,onClose:e,headerTitle:n,icon:r,hideHeader:M,hideFooter:a,primaryActionText:u="Apply",onPrimaryAction:o,side:s="left",size:N="small",zIndex:D})=>v.jsx(DL,{children:i?v.jsx("div",{className:QT.backdrop,style:{zIndex:D},onClick:e,children:v.jsxs("div",{className:`${QT.panel} ${QT[s]} ${QT[N]}`,onClick:g=>{g.stopPropagation()},children:[!M&&v.jsxs("section",{className:QT.header,children:[v.jsxs("span",{className:QT.headerTitle,children:[r,n]}),v.jsx(Bt,{variant:"tertiary",type:"button",onClick:e,leftIcon:v.jsx(Yt,{name:"cross"})})]}),v.jsx("section",{className:QT.content,children:t}),!a&&v.jsxs("section",{className:QT.footer,children:[v.jsx(Bt,{type:"button",variant:"tab",onClick:e,children:"Cancel"}),v.jsx(Bt,{type:"button",variant:"primary",onClick:o,children:u})]})]})}):null}),eUe=({ChartAppearancePanelProps:{chartSettings:t,isOpen:i,onClose:e,setChartSettings:n,setBarRadius:r,comparisonLagProps:M,setResetPallete:a}})=>v.jsx(Ev,{isOpen:i,onClose:e,size:"small",side:"right",hideFooter:!0,headerTitle:"Appearance",children:v.jsx("div",{className:Ib.chartPropertiesPanel,children:v.jsx(qke,{chartSettings:t,setChartSettings:n,setBarRadius:r,comparisonLagProps:M,setResetPallete:a})})}),tUe=({SortPanelProps:{isOpen:t,onClose:i,createdSorts:e,setCreatedSorts:n,columnOptions:r,onApplySort:M,selectedTable:a}})=>v.jsx(Ev,{isOpen:t,onClose:i,size:"medium",side:"right",hideFooter:!0,headerTitle:"Sorts",children:e.length?v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-flex-col dbn-justify-between dbn-p-5",children:[v.jsxs("div",{className:"dbn-flex dbn-flex-col dbn-gap-4",children:[v.jsx("div",{className:"dbn-w-full dbn-flex dbn-justify-end dbn-items-center",children:v.jsx(Bt,{variant:"popover",onClick:()=>{n([]),M(()=>n([]),!0)},children:"Clear all"})}),e.map((u,o)=>v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-gap-3 dbn-items-center",children:[v.jsx(un,{onChange:s=>n(N=>N.map((D,g)=>g===o?{...D,columnName:s}:D)),options:r,selectedOption:u.columnName,buttonWidth:"300px",menuWidth:"300px"}),v.jsx(un,{onChange:s=>n(N=>N.map((D,g)=>g===o?{...D,method:s}:D)),options:H5,selectedOption:u.method,buttonWidth:"200px",menuWidth:"200px"}),v.jsx(Bt,{variant:"popover",onClick:()=>{n(s=>s.filter((N,D)=>D!==o)),M(()=>n(e.filter((s,N)=>N!==o)),!1,o)},children:v.jsx(Yt,{name:"delete"})})]},`${u.columnName.value}_${u.tableName.value}_${u.method.value}_${o==null?void 0:o.toString()}`)),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"plus"}),onClick:()=>n(u=>[...u,{columnName:{label:"",value:""},method:H5[0],tableName:a}]),children:"Add Sort"})]}),v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-h-[50px] dbn-items-end dbn-justify-end dbn-gap-5",children:[v.jsx(Bt,{variant:"secondary",onClick:()=>i(),children:"Cancel"}),v.jsx(Bt,{variant:"primary",onClick:()=>M(i),children:"Apply Sort"})]})]}):v.jsx(v.Fragment,{children:v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center dbn-flex-col dbn-gap-4",children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx(Bt,{variant:"secondary",leftIcon:v.jsx(Yt,{name:"plus"}),onClick:()=>n(u=>[...u,{columnName:{label:"",value:""},method:H5[0],tableName:a}]),children:"Add Sort"})]})})}),iUe={button:"_button_lhx47_1",menu:"_menu_lhx47_7",inputLabel:"_inputLabel_lhx47_13",input:"_input_lhx47_13",label:"_label_lhx47_25",menuContainer:"_menuContainer_lhx47_31",icon:"_icon_lhx47_37",container:"_container_lhx47_43"},nUe=[{label:"Last Week",value:"Last Week"},{label:"This Week",value:"This Week"},{label:"Last Month",value:"Last Month"},{label:"This Month",value:"This Month"},{label:"Last Year",value:"Last Year"},{label:"This Year",value:"This Year"},{label:"Yesterday",value:"Yesterday"},{label:"Today",value:"Today"},{label:"Custom",value:"Custom"}],yb={value:"",from:"",to:""},rUe=t=>{if(!t)return yb;if(t.includes(" - ")){const[i,e]=t.split(" - ");return{...yb,value:t,from:i,to:e}}return{...yb,value:t}},MUe=({isShowlabel:t,timeGrainValue:i="",setTimeGrainValue:e,register:n,className:r="",isDisabled:M,containerClass:a="",onChange:u,labelVariant:o,label:s})=>{const[N,D]=De.useState(rUe(i));return De.useEffect(()=>{N.value&&N.value!=="Custom"?e(N.value):N.from&&N.to&&e(`${N.from} - ${N.to}`)},[N]),De.useEffect(()=>{u==null||u(N.value)},[N]),v.jsx(v.Fragment,{children:v.jsxs("div",{className:a,children:[t?v.jsx(Pe,{variant:"body-text-sm",children:s||"Time Filter"}):null,v.jsxs("div",{className:iUe.container,children:[v.jsx(un,{options:nUe,selectedOption:{value:N.value,label:N.value},onChange:g=>D(l=>({...l,value:g.value}))}),N.value==="Custom"?v.jsxs(v.Fragment,{children:[v.jsx(yi,{label:"From Date",type:"date",value:N.from,onChange:({target:{value:g}})=>D(l=>({...l,from:g}))}),v.jsx(yi,{label:"To Date",type:"date",value:N.to,onChange:({target:{value:g}})=>D(l=>({...l,to:g}))})]}):null]})]})})},aUe=({filtersPanelProps:{isOpen:t,onClose:i,filters:e,setCreatedFilters:n,columnOptions:r,getFilterDropDownType:M,editorRef:a,workspaceId:u,onApplyFilter:o,savedFilterListOptions:s,currentSelectedTable:N}})=>(De.useState(!0),v.jsx(Ev,{isOpen:t,onClose:i,size:"medium",side:"right",hideFooter:!0,headerTitle:"Filters",children:e.length?v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-p-5 dbn-flex dbn-flex-col dbn-justify-between",children:[v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-flex-col dbn-gap-5",children:[v.jsx("div",{className:"dbn-w-full dbn-flex dbn-justify-end dbn-items-center",children:v.jsx(Bt,{variant:"popover",onClick:()=>{n([]),o(()=>n([]),!0)},children:"Clear all"})}),e.map((D,g)=>{var h,x,O,d,E;const[l,j,T,y,z]=(h=D.columnName.value)==null?void 0:h.split("____"),A=M({datatype:T,operator:D.operator.value});return((x=D==null?void 0:D.tableName)==null?void 0:x.value)!==N.value?v.jsx(v.Fragment,{}):v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-gap-3 dbn-flex-wrap dbn-items-center",children:[g>0&&v.jsx(un,{options:K7,selectedOption:D.relationOperator||K7[0],labelVariant:"floating",onChange:C=>{n(k=>k.map((Q,S)=>g===S?{...Q,relationOperator:C}:Q))},buttonWidth:"100px",menuWidth:"100%"}),v.jsxs(v.Fragment,{children:[v.jsx(un,{options:r,selectedOption:D.columnName,labelVariant:"floating",onChange:C=>{n(k=>k.map((Q,S)=>g===S?{...Q,columnName:C}:Q))},isSearchEnabled:!0,isDisabled:!r,buttonWidth:"250px",menuWidth:"250px"}),D.type==="default"&&v.jsxs(v.Fragment,{children:[" ",v.jsx(un,{options:Cx.includes(T==null?void 0:T.toLowerCase())?dse:Sx.includes(T==null?void 0:T.toLowerCase())?fse:W5.includes(T==null?void 0:T.toLowerCase())||(O=T==null?void 0:T.toLowerCase())!=null&&O.includes("char")?Ase:X7,selectedOption:D.operator||X7[0],labelVariant:"floating",onChange:C=>{n(k=>k.map((Q,S)=>g===S?{...Q,operator:C}:Q))},isSearchEnabled:!0,isDisabled:!T,buttonWidth:"250px",menuWidth:"250px"}),A==="MULTI_FILTER_DROPDOWN"&&v.jsx(fd,{filter:{tableName:`${y}.${z}`,columnName:`${j}`},workspaceId:u,selectedOption:((d=D.value.stringArray)==null?void 0:d.map(C=>({value:C,label:C})))||[],onChange:C=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{stringArray:(C==null?void 0:C.map(b=>b.value))||[]}}:Q)),isSearchEnabled:!0,autoSelected:!1,isDisabled:!j,isDisablelabel:!0,buttonWidth:"250px",menuWidth:"250px"}),A==="FILTER_DROPDOWN"&&v.jsx(ap,{isDisableLabel:!0,filter:{tableName:`${y}.${z}`,columnName:`${j}`},workspaceId:u,selectedOption:{label:D.value.stringValue||"",value:D.value.stringValue||""},onChange:C=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{stringValue:C.value}}:Q)),isSearchEnabled:!0,autoSelected:!1,isDisabled:!j}),A==="TIME_FILTER"&&v.jsx(MUe,{isDisabled:!j||!T,timeGrainValue:((E=D.value.timeValue)==null?void 0:E.timeFilter)||"Last Year",setTimeGrainValue:C=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{timeValue:{endDate:"",startDate:"",timeFilter:C}}}:Q))}),A==="INPUT_NUMBER_FIELD"&&v.jsx(yi,{type:"number",onChange:({target:{value:C}})=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{numberValue:Number(C)}}:Q)),value:(D==null?void 0:D.value.numberValue)||0})]})]}),v.jsx(Bt,{variant:"popover",onClick:()=>{o(()=>n(C=>C.filter((k,Q)=>Q!==g)),!1,g)},children:v.jsx(Yt,{name:"delete"})})]})}),v.jsx("div",{className:"dbn-w-fit",children:v.jsx(CD,{buttonContent:v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"plus"}),children:"Add Filter"}),position:"bottom-start",children:v.jsx("div",{children:v.jsx(Bt,{variant:"popover",onClick:()=>n(D=>[...D,{columnName:{value:"",label:""},operator:{label:"",value:""},value:{stringValue:""},sql:"",name:"",type:"default",tableName:N}]),className:Ib.popOption,children:"Simple Filter"})})})})]}),v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-h-[50px] dbn-items-end dbn-justify-end dbn-gap-5",children:[v.jsx(Bt,{variant:"secondary",onClick:()=>i(),children:"Cancel"}),v.jsx(Bt,{variant:"primary",onClick:()=>o(i),children:"Apply Filter"})]})]}):v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center dbn-flex-col dbn-gap-4",children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx("div",{className:"dbn-p-5",children:v.jsx(CD,{buttonContent:v.jsx(Bt,{variant:"secondary",leftIcon:v.jsx(Yt,{name:"plus"}),children:"Add Filter"}),position:"bottom",menuWidth:"120px",offset:[0,10],children:v.jsx("div",{className:"dbn-p-2",children:v.jsx(Bt,{variant:"popover",onClick:()=>n(D=>[...D,{columnName:{value:"",label:""},operator:{label:"",value:""},value:{stringValue:""},name:"",sql:"",type:"default",tableName:N}]),className:Ib.popOption,children:"Simple Filter"})})})})]})})),uUe=({...t})=>{var It,We,Tt,He;const{clientId:i,companyId:e,isLiveMode:n,externalDashboardId:r,userProvidedDashboardId:M,setShowMetricCreateModal:a,metric:u,metricData:o,chartColors:s}=t,[N,D]=De.useState(!1),[g,l]=De.useState(""),[j,T]=De.useState(),[y,z]=De.useState(ss),[A,h]=De.useState(!1),[x,O]=De.useState(!1),[d,E]=De.useState(""),[C,k]=De.useState(),[Q,S]=De.useState(!1),[b,Y]=De.useState(!1),[m,R]=De.useState({value:"",label:""}),[P,W]=De.useState([]),[B,X]=De.useState(),[F]=De.useState(),[G,J]=De.useState(!1),[ee,q]=De.useState(!1),[ie,re]=De.useState(),[le,Ne]=De.useState(!1),[se,Ie]=De.useState({topRadius:((We=(It=y.customSettings)==null?void 0:It.barRadius)==null?void 0:We[1])||0,bottomRadius:((He=(Tt=y.customSettings)==null?void 0:Tt.barRadius)==null?void 0:He[3])||0}),[Oe,ye]=De.useState(!1),[$e,Ve]=De.useState(!1),[Ee,Te]=De.useState(!1),[fe,Qe]=De.useState(!1),[ot,rt]=De.useState(!0),[ke,et]=De.useState(!1),{createExternalMetric:xe,error:Dt,updateExternalMetric:ve,clientSubsetData:pt,previewTable:Ct,token:dt,dashboardOptions:Zt,isLoading:$t}=W6({query:d,chartSettings:y,companyIntegrationId:B==null?void 0:B.id,integrationName:B==null?void 0:B.name,metricQuery:F,datasetMetricSettings:C,outputColumns:void 0,selectedColumns:void 0,clientId:i,isEmbedded:!0,companyId:e,isLiveMode:n,dashboardIds:[r],userProvidedDashboardId:M,isEnableGroupBy:!1,groupBy:void 0,selectedGroupBy:[],metric:u,onSuccess:()=>{var jt,lt;Y(!1),a(!1),(lt=(jt=window==null?void 0:window.location)==null?void 0:jt.reload)==null||lt.call(jt)}});De.useEffect(()=>{var kt;const jt=pt==null?void 0:pt.error,lt=pt;jt||!pt?l(jt==null?void 0:jt.message):(kt=lt==null?void 0:lt.tableList)!=null&&kt.length&&X({id:lt==null?void 0:lt.companyIntegrationId,name:lt==null?void 0:lt.dbName})},[pt]),De.useEffect(()=>{m.value&&Ct({data:{integrationId:B==null?void 0:B.id,integrationName:B==null?void 0:B.name,tableName:m.value,limit:10},token:dt},{onSuccess(jt){var kt;const lt=(kt=jt==null?void 0:jt.previewTable)==null?void 0:kt.data;re(lt?[lt]:void 0)}})},[m]),De.useEffect(()=>{[Se.table,Se.horizontalStackTable,Se.treeMap,Se.pivot,Se.gauge,Se.sankey].includes(y.chartType)?rt(!1):rt(!0),[Se.waterfall,Se.funnel,Se.gauge,Se.singleValue,Se.sankey].includes(y.chartType)?et(!0):et(!1)},[y.chartType]);const Mt=De.useMemo(()=>{const jt=Xge(j||[]),lt=tP({data:j||[],timeStampKey:y.xAxis||""});return P.length&<?[...jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries),Se.pivot,Se.timeSeries]:P.length?[...jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries),Se.pivot]:lt?[...jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries),Se.timeSeries]:jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries)},[j,P,y.xAxis]);return De.useEffect(()=>{j!=null&&j.length&&P.length?J(!0):J(!1)},[j,P.length,d]),De.useEffect(()=>{P.length&&y.chartType===Se.pivot&&(j!=null&&j.length)&&z(jt=>({...jt,pivotTableSettings:{...y.pivotTableSettings,columns:Object.keys(j[0]).filter(lt=>P.includes(lt)),rows:Object.keys(j[0]).filter(lt=>!P.includes(lt))}}))},[j,P.length,y.chartType]),De.useEffect(()=>{A&&(z(jt=>({...jt,chartColors:s})),h(!1))},[A]),De.useEffect(()=>{var jt;(!((jt=y.chartColors)!=null&&jt.length)||dw(s,y.chartColors))&&(s!=null&&s.length)&&z(lt=>({...lt,chartColors:s}))},[s,y.chartColors]),De.useEffect(()=>{y.chartType===Se.row?z(jt=>({...jt,customSettings:{...jt.customSettings,barRadius:[se.bottomRadius,se.topRadius,se.topRadius,se.bottomRadius]}})):z(jt=>({...jt,customSettings:{...jt.customSettings,barRadius:[se.topRadius,se.topRadius,se.bottomRadius,se.bottomRadius]}}))},[se.topRadius,se.bottomRadius,z,y.chartType]),De.useEffect(()=>{u&&(z(u.chartOptions),X(u.companyIntegration))},[u]),De.useEffect(()=>{if(!o)return;const jt=Array.isArray(o)?o:[];T(jt)},[o]),De.useEffect(()=>{y.chartType!==Se.timeSeries&&z(jt=>{var lt;return{...jt,timeSeriesSettings:{...jt.timeSeriesSettings,groupBySettings:{isDynamic:!1,options:[],value:"monthly",fillXAxis:!1},seriesType:((lt=jt.yAxisList)==null?void 0:lt.map(kt=>({column:kt,type:"bar"})))||[]}}})},[y.chartType]),{isLoading:N,chartSettings:y,setShowSaveMetricModal:Y,setSelectTable:R,selectTable:m,data:j,error:g,previewTableData:ie,query:d,isShowSqlModal:Q,setShowSqlModal:S,isEnablePivotTable:G,isEnableGauge:ee,groupByList:P,hasNumberKeys:x,setShowChartCustomProperties:Ne,isShowFullScreen:Oe,setShowFullScreen:ye,isShowChartType:$e,setShowChartType:Ve,isShowSaveMetricModal:b,updateExternalMetric:ve,createExternalMetric:xe,dashboardOptions:Zt,saveError:Dt,setChartSettings:z,isShowChartCustomProperties:le,setBarRadius:Ie,setError:l,setLoading:D,setData:T,setQuery:E,setGroupByList:W,clientSubsetData:pt,isShowSortPanel:Ee,setShowSortPanel:Te,isShowFilters:fe,setShowFilters:Qe,isCreatingMetric:$t,isEnableSingleDimension:ot,isEnableSingleMetrics:ke,enabledCharts:Mt,setResetPallete:h}},oUe=({...t})=>{var le;const{clientId:i,setError:e,setLoading:n,setData:r,setQuery:M,setGroupByList:a,clientSubsetData:u,chart:o,setChartSettings:s}=t,[N,D]=De.useState([]),[g,l]=De.useState([]),[j,T]=De.useState([]),[y,z]=De.useState([]),[A,h]=De.useState({value:"",label:""}),[x,O]=De.useState([]),[d,E]=De.useState(B5),[C,k]=De.useState([]),[Q,S]=De.useState([]),{mutate:b,error:Y,isLoading:m}=gge(),{data:R,token:P}=Vx(),W=De.useRef();De.useEffect(()=>{var Ie;const Ne=u==null?void 0:u.error,se=u;Ne||!u?e(Ne==null?void 0:Ne.message):(Ie=se==null?void 0:se.tableList)!=null&&Ie.length&&S((se==null?void 0:se.tableList)||[])},[u]);const B=De.useMemo(()=>Q.map(Ne=>({value:Ne.tableName,label:Ne.tableName})),[Q]),X=({chartType:Ne,metricParams:se,dimensionParams:Ie})=>{var Oe,ye;if(Ne===Se.singleValue)s($e=>{var Ee;return{...$e,singleValue:((Ee=[...Ie||N,...se||x][0])==null?void 0:Ee.label)||""}});else if(Ne===Se.table){const $e=[...(Oe=Ie||N)==null?void 0:Oe.map(Ve=>Ve.alias||Ve.label||""),...(ye=se||x)==null?void 0:ye.map(Ve=>Ve.alias||Ve.label||"")];s(Ve=>{var Ee,Te,fe,Qe;return{...Ve,xAxis:((Te=(Ee=Ie||N)==null?void 0:Ee[0])==null?void 0:Te.alias)||((Qe=(fe=Ie||N)==null?void 0:fe[0])==null?void 0:Qe.label)||"",yAxisList:$e||[]}})}else if(Ne===Se.waterfall)s($e=>{var Ve,Ee,Te,fe,Qe,ot,rt,ke;return{...$e,xAxis:((Ee=(Ve=Ie||N)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=Ie||N)==null?void 0:Te[0])==null?void 0:fe.label)||"",yAxisList:[((ot=(Qe=se||x)==null?void 0:Qe[0])==null?void 0:ot.alias)||((ke=(rt=se||x)==null?void 0:rt[0])==null?void 0:ke.label)]}});else if(Ne===Se.sankey){const $e=[...(Ie||N).map(Ve=>Ve.alias||Ve.label||"")];s(Ve=>{var Ee,Te,fe,Qe;return{...Ve,sankeyValues:[$e[0]||"",$e[1]||"",((Te=(Ee=se||x)==null?void 0:Ee[0])==null?void 0:Te.alias)||((Qe=(fe=se||x)==null?void 0:fe[0])==null?void 0:Qe.label)||""]}})}else Ne===Se.funnel||Ne===Se.boxplot?s($e=>{var Ve,Ee,Te,fe,Qe,ot,rt,ke;return{...$e,step:((Ee=(Ve=Ie||N)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=Ie||N)==null?void 0:Te[0])==null?void 0:fe.label),measure:((ot=(Qe=se||x)==null?void 0:Qe[0])==null?void 0:ot.alias)||((ke=(rt=se||x)==null?void 0:rt[0])==null?void 0:ke.label)}}):Ne===Se.gauge?s($e=>{var Ve,Ee,Te,fe,Qe,ot;return{...$e,gaugeSettings:{metric:((Ee=(Ve=se||x)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=se||x)==null?void 0:Te[0])==null?void 0:fe.label),dimensions:(ot=(Qe=(Ie||N).filter(rt=>rt.labelType==="dimension_aggregate"))==null?void 0:Qe[0])!=null&&ot.aggregate?(Ie||N).map(rt=>rt.alias||rt.label):[]}}}):Ne===Se.horizontalStackTable?s($e=>{var Ve,Ee;return{...$e,stackTableCols:[...(Ve=se||x)==null?void 0:Ve.map(Te=>Te.alias||Te.label)],yAxisList:[...(Ee=Ie||N)==null?void 0:Ee.map(Te=>Te.alias||Te.label)]}}):s($e=>{var Ve,Ee,Te,fe,Qe;return{...$e,xAxis:((Ee=(Ve=Ie||N)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=Ie||N)==null?void 0:Te[0])==null?void 0:fe.label)||"",yAxisList:[...(Qe=se||x)==null?void 0:Qe.map(ot=>ot.alias||ot.label)]}})},F=({prevConfiguration:Ne,metricParams:se,dimensionParams:Ie})=>{var Oe;Ne&&E(Ne),e(""),n(!0),r([]),M(""),b({data:{cId:i,configuration:Ne||d,id:(Oe=R==null?void 0:R.workspace)==null?void 0:Oe.id},token:P},{onSuccess(ye){const $e=ye==null?void 0:ye.error,Ve=ye==null?void 0:ye.data,Ee=ye==null?void 0:ye.query;ye==null||ye.timeTaken;const Te=ye==null?void 0:ye.metaData;$e||Y?(e(($e==null?void 0:$e.message)||os),n(!1),r([]),M(""),a([])):Ve&&Ee?(e(""),n(!1),r(Array.isArray(Ve)?Ve:[]),X({chartType:o,metricParams:se,dimensionParams:Ie}),M(Ee),a==null||a((Te==null?void 0:Te.groupbyColumnList)||[])):(e(os),n(!1),r([]),M(""),a([]))},onError(){e(os),n(!1),r([]),M(""),a([])}})},G=Ne=>{var $e,Ve;const[se,Ie]=Ne.split("."),Oe={value:`${se}____${Ie}`,label:`${se}.${Ie}`,icon:"table"};h(Oe);const ye=((Ve=($e=Q.find(Ee=>Ee.tableName===Ne))==null?void 0:$e.columns)==null?void 0:Ve.map(Ee=>({value:`${se}_${Ie}____${Ee.name}____${Ee.datatype}____${se}____${Ie}`,label:Ee.name})))||[];ye!=null&&ye.length&&!m&&(l(ye),T([]),z([]),D([]),O([]),E({...B5,dimensions:[],limit:"100",table:{...B5.table,alias:`${se}_${Ie}`,schema:se,name:Ie},aggregates:[]}))},J=({param:Ne,metricParams:se,dimensionParams:Ie})=>{F({prevConfiguration:Ne||d,metricParams:se,dimensionParams:Ie})},ee=(Ne,se,Ie)=>{if(se){F({prevConfiguration:{...d,orders:[]}}),Ne();return}const Oe=y.filter((ye,$e)=>$e!==Ie).map(ye=>{var fe,Qe;const $e=(fe=ye.columnName.badge)==null?void 0:fe.toLowerCase(),Ve=ye.method.value;if(!ye.columnName.value)return{method:"",name:""};if($e==="custom"||$e==="new")return{method:Ve,name:ye.columnName.label};const[Ee,Te]=(Qe=ye.columnName.value)==null?void 0:Qe.split("____");return{method:ye.method.value,name:`${Ee}.${Te}`}});E(ye=>({...ye,orders:Oe.filter($e=>$e.name)})),F({prevConfiguration:{...d,orders:Oe.filter(ye=>ye.name)}}),Ne()},q=(Ne,se,Ie)=>{if(se){F({prevConfiguration:{...d,filters:[]}}),Ne();return}const Oe=j.filter((ye,$e)=>$e!==Ie).map(ye=>{var fe,Qe;const[$e,Ve,Ee]=(fe=ye.columnName.value)==null?void 0:fe.split("____"),Te=ye.operator.value||"=";return{alias:"",columnName:Ve,dataType:ye.value.timeValue?"TIME_COLUMN":Ee,method:Te,parentAlias:$e,type:ye.value.timeValue?"time":"default",value:ye.value.stringValue||ye.value.stringArray||ye.value.timeValue||ye.value.numberArray||ye.value.numberValue||"",relationOperator:(Qe=ye.relationOperator)==null?void 0:Qe.value}});E(ye=>({...ye,filters:Oe})),F({prevConfiguration:{...d,filters:Oe}}),Ne()};De.useEffect(()=>{const Ne=[];[...N,...x].forEach(se=>{const[Ie,Oe,ye,$e,Ve]=se.value.split("____");G5.includes(se.aggregate??"")||Ne.push({columnName:Oe,alias:se.alias||Oe,dataType:ye,parentAlias:Ie,type:"default",timeGrain:void 0,helperFunction:se.aggregate||void 0})}),E(se=>({...se,dimensions:Ne}))},[N,x]),De.useEffect(()=>{const Ne=[];x.filter(se=>se.labelType==="metric_aggregate").forEach(se=>{const[Ie,Oe,ye,$e,Ve]=se.value.split("____");Ne.push({columnName:Oe,alias:se.alias||Oe,dataType:ye,parentAlias:Ie,type:"default",method:se.aggregate||"COUNT"})}),E(se=>({...se,aggregates:Ne}))},[x.length]);const ie=Ne=>{const se=Ne.value;if(se){const[Ie,Oe,ye]=se==null?void 0:se.split("____");if(Cx.includes(ye.toLowerCase()))return Ose;if(Sx.includes(ye.toLowerCase()))return Lse;if(W5.includes(ye.toLowerCase())||ye.toLowerCase().includes("char"))return hse}return xse},re=({datatype:Ne,operator:se})=>{const Ie=se==="IS NULL"||se==="IS NOT NULL",Oe=se==="IN"||se==="NOT IN";return Cx.includes(Ne==null?void 0:Ne.toLowerCase())&&!Ie&&!Oe?"TIME_FILTER":Sx.includes(Ne==null?void 0:Ne.toLowerCase())&&!Ie?Oe?"MULTI_FILTER_DROPDOWN":"INPUT_NUMBER_FIELD":Ie?"FILTER_DROPDOWN":Oe?"MULTI_FILTER_DROPDOWN":"FILTER_DROPDOWN"};return De.useEffect(()=>{X({chartType:o,metricParams:x,dimensionParams:N})},[o,x,N]),{configuration:d,setConfiguration:E,selectedDimensions:N,setSelectedDimensions:D,metrics:x,setMetrics:O,columnList:g,onChangeTableSelection:G,tableList:B,onGenerateChart:J,createdSorts:y,setCreatedSorts:z,onApplySort:ee,createdFilters:j,setCreatedFilters:T,getFilterDropDownType:re,workspaceId:(le=R==null?void 0:R.workspace)==null?void 0:le.id,editorRef:W,savedFilterListOptions:C==null?void 0:C.map((Ne,se)=>({label:Ne.as,value:`${Ne.value}____${se}____${Ne.as}`,key:`${Ne.as}_${Ne.value}`})),onApplyFilter:q,functionOptions:ie}},NUe=({clientId:t,companyId:i,isLiveMode:e,externalDashboardId:n,userProvidedDashboardId:r,chartColors:M,isShowMetricCreateModal:a,setShowMetricCreateModal:u,metric:o,metricData:s})=>{var lt,kt,ii;const N={clientId:t,companyId:i,isLiveMode:e,externalDashboardId:n,userProvidedDashboardId:r,chartColors:M,isShowMetricCreateModal:a,setShowMetricCreateModal:u,metric:o,metricData:s},{isLoading:D,chartSettings:g,setShowSaveMetricModal:l,data:j,error:T,previewTableData:y,query:z,isShowSqlModal:A,setShowSqlModal:h,isEnablePivotTable:x,isEnableGauge:O,groupByList:d,hasNumberKeys:E,setShowChartCustomProperties:C,selectTable:k,setSelectTable:Q,isShowChartType:S,setShowChartType:b,isShowSaveMetricModal:Y,updateExternalMetric:m,createExternalMetric:R,dashboardOptions:P,saveError:W,setChartSettings:B,isShowChartCustomProperties:X,setBarRadius:F,setError:G,setLoading:J,setData:ee,setQuery:q,setGroupByList:ie,clientSubsetData:re,isShowSortPanel:le,setShowSortPanel:Ne,isShowFilters:se,setShowFilters:Ie,isCreatingMetric:Oe,isEnableSingleDimension:ye,isEnableSingleMetrics:$e,enabledCharts:Ve,setResetPallete:Ee}=uUe(N),Te={clientSubsetData:re,clientId:t,setError:G,setLoading:J,setData:ee,setQuery:q,setGroupByList:ie,chart:g.chartType,setChartSettings:B},{selectedDimensions:fe,setSelectedDimensions:Qe,metrics:ot,setMetrics:rt,onChangeTableSelection:ke,columnList:et,tableList:xe,configuration:Dt,onGenerateChart:ve,createdSorts:pt,setCreatedSorts:Ct,onApplySort:dt,createdFilters:Zt,setCreatedFilters:$t,getFilterDropDownType:Mt,workspaceId:It,editorRef:We,savedFilterListOptions:Tt,onApplyFilter:He,functionOptions:jt}=oUe(Te);return v.jsxs(v.Fragment,{children:[a&&v.jsxs("div",{className:Av.isShowMetricCreateModal,children:[v.jsx("div",{className:Av.metricCreateModalHeader,children:v.jsx(AQe,{heading:o?"Update Metric":"Create Metric",setShowMetricCreateModal:u,isDisableSaveBtn:!((lt=g.measure)!=null&<.length)&&!((ii=(kt=g.yAxisList)==null?void 0:kt.filter(gi=>gi))!=null&&ii.length)&&!g.singleValue,setShowSaveMetricModal:l})}),v.jsxs("div",{className:Av.metricCreateModalContent,children:[!o&&v.jsx(v.Fragment,{children:v.jsx(fQe,{setselectTable:Q,selectTable:k,tableList:xe,columnList:et,column:(fe==null?void 0:fe[0])||{value:"",label:""},setColumn:Qe,metrics:ot,setMetrics:rt,onChangeTableSelection:ke})}),v.jsx(Zke,{data:j,isUpdateMetric:!!o,error:T,isLoading:D,previewTableDataList:y,chartColors:M,chartSettings:g,setChartSettings:B,isDisableSqlBtn:!z,setShowSqlModal:h,isEnablePivotTable:x,groupbyList:d,hasNumberKeys:E,isEnableGauge:O,outputHeaderProps:{setShowChartCustomProperties:C,setShowChartType:b,setShowSortPanel:Ne,setShowFilters:Ie},metrics:ot,dimensions:fe,onGenerateChart:ve,setMetrics:rt,setColumn:Qe,isEnableSingleDimension:ye,isEnableSingleMetrics:$e,functionOptions:jt,configuration:Dt})]})]}),v.jsx(Fz,{headerTitle:"Generated Query",isOpen:A,onClose:()=>h(!1),children:v.jsx("div",{className:Av["query-modal"],children:z})}),v.jsx(Fz,{isOpen:Y,onClose:()=>l(!1),headerTitle:"Save To Dashboard",children:v.jsx(d6,{onCancel:()=>l(!1),onSubmit:o?m:R,error:W,defaultValues:o?{name:o.name,description:o.description,isLive:o.isLive,metricId:o.isCreatedByClient?o.metricId:`update_${o.metricId}_by_${t}_${Date.now()}`}:void 0,isCreatingMetric:Oe})}),v.jsx(aUe,{filtersPanelProps:{isOpen:se,onClose:()=>Ie(!1),filters:Zt,setCreatedFilters:$t,columnOptions:et,getFilterDropDownType:Mt,editorRef:We,workspaceId:It,onApplyFilter:He,savedFilterListOptions:Tt,currentSelectedTable:k}}),v.jsx(tUe,{SortPanelProps:{isOpen:le,onClose:()=>Ne(!1),createdSorts:pt,setCreatedSorts:Ct,columnOptions:et,onApplySort:dt,selectedTable:k}}),v.jsx(SMe,{chartTypePanelProps:{isOpen:S,onClose:()=>b(!1),enabledCharts:Ve,onChartChange:gi=>{B(ht=>({...ht,chartType:gi}))},selectedChart:g.chartType}}),v.jsx(eUe,{ChartAppearancePanelProps:{setChartSettings:B,chartSettings:g,isOpen:X,onClose:()=>C(!1),setBarRadius:F,setResetPallete:Ee}})]})},Stt={"form-container":"_form-container_aaw5c_1","field-container":"_field-container_aaw5c_5","field-label":"_field-label_aaw5c_9","field-wrapper":"_field-wrapper_aaw5c_13","field-inner-container":"_field-inner-container_aaw5c_17","field-value":"_field-value_aaw5c_21",fieldValueIcon:"_fieldValueIcon_aaw5c_25","field-add-btn":"_field-add-btn_aaw5c_29",fieldAddBtnIcon:"_fieldAddBtnIcon_aaw5c_33","field-value-container":"_field-value-container_aaw5c_37","field-prompt":"_field-prompt_aaw5c_41","dbn-group":"_dbn-group_aaw5c_1",tooltipWrapper:"_tooltipWrapper_aaw5c_45",tooltip:"_tooltip_aaw5c_45",dropdown:"_dropdown_aaw5c_57",filterDropdown:"_filterDropdown_aaw5c_61",filterValues:"_filterValues_aaw5c_65",columnText:"_columnText_aaw5c_69",disabled:"_disabled_aaw5c_73",checkIcon:"_checkIcon_aaw5c_77",generateButtonContainer:"_generateButtonContainer_aaw5c_80",generateButton:"_generateButton_aaw5c_80","modal-container":"_modal-container_aaw5c_87","filter-dropdown":"_filter-dropdown_aaw5c_91","editor-field":"_editor-field_aaw5c_95","tab-border":"_tab-border_aaw5c_99"};var vA={},zb={},Gte={exports:{}};(function(t,i){(function(){var e="ace",n=function(){return this}();!n&&typeof window<"u"&&(n=window);var r=function(N,D,g){if(typeof N!="string"){r.original?r.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(g=D),r.modules[N]||(r.payloads[N]=g,r.modules[N]=null)};r.modules={},r.payloads={};var M=function(N,D,g){if(typeof D=="string"){var l=o(N,D);if(l!=null)return g&&g(),l}else if(Object.prototype.toString.call(D)==="[object Array]"){for(var j=[],T=0,y=D.length;T<y;++T){var z=o(N,D[T]);if(z==null&&a.original)return;j.push(z)}return g&&g.apply(null,j)||!0}},a=function(N,D){var g=M("",N,D);return g==null&&a.original?a.original.apply(this,arguments):g},u=function(N,D){if(D.indexOf("!")!==-1){var g=D.split("!");return u(N,g[0])+"!"+u(N,g[1])}if(D.charAt(0)=="."){var l=N.split("/").slice(0,-1).join("/");for(D=l+"/"+D;D.indexOf(".")!==-1&&j!=D;){var j=D;D=D.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return D},o=function(N,D){D=u(N,D);var g=r.modules[D];if(!g){if(g=r.payloads[D],typeof g=="function"){var l={},j={id:D,uri:"",exports:l,packaged:!0},T=function(z,A){return M(D,z,A)},y=g(T,l,j);l=y||j.exports,r.modules[D]=l,delete r.payloads[D]}g=r.modules[D]=l||g}return g};function s(N){var D=n;N&&(n[N]||(n[N]={}),D=n[N]),(!D.define||!D.define.packaged)&&(r.original=D.define,D.define=r,D.define.packaged=!0),(!D.require||!D.require.packaged)&&(a.original=D.require,D.require=a,D.require.packaged=!0)}s(e)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(e,n,r){function M(a,u,o){Object.defineProperty(a,u,{value:o,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||M(String.prototype,"startsWith",function(a,u){return u=u||0,this.lastIndexOf(a,u)===u}),String.prototype.endsWith||M(String.prototype,"endsWith",function(a,u){var o=this;(u===void 0||u>o.length)&&(u=o.length),u-=a.length;var s=o.indexOf(a,u);return s!==-1&&s===u}),String.prototype.repeat||M(String.prototype,"repeat",function(a){for(var u="",o=this;a>0;)a&1&&(u+=o),(a>>=1)&&(o+=o);return u}),String.prototype.includes||M(String.prototype,"includes",function(a,u){return this.indexOf(a,u)!=-1}),Object.assign||(Object.assign=function(a){if(a==null)throw new TypeError("Cannot convert undefined or null to object");for(var u=Object(a),o=1;o<arguments.length;o++){var s=arguments[o];s!=null&&Object.keys(s).forEach(function(N){u[N]=s[N]})}return u}),Object.values||(Object.values=function(a){return Object.keys(a).map(function(u){return a[u]})}),Array.prototype.find||M(Array.prototype,"find",function(a){for(var u=this.length,o=arguments[1],s=0;s<u;s++){var N=this[s];if(a.call(o,N,s,this))return N}}),Array.prototype.findIndex||M(Array.prototype,"findIndex",function(a){for(var u=this.length,o=arguments[1],s=0;s<u;s++){var N=this[s];if(a.call(o,N,s,this))return s}}),Array.prototype.includes||M(Array.prototype,"includes",function(a,u){return this.indexOf(a,u)!=-1}),Array.prototype.fill||M(Array.prototype,"fill",function(a){for(var u=this,o=u.length>>>0,s=arguments[1],N=s>>0,D=N<0?Math.max(o+N,0):Math.min(N,o),g=arguments[2],l=g===void 0?o:g>>0,j=l<0?Math.max(o+l,0):Math.min(l,o);D<j;)u[D]=a,D++;return u}),Array.of||M(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(e,n,r){e("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(e,n,r){n.last=function(u){return u[u.length-1]},n.stringReverse=function(u){return u.split("").reverse().join("")},n.stringRepeat=function(u,o){for(var s="";o>0;)o&1&&(s+=u),(o>>=1)&&(u+=u);return s};var M=/^\s\s*/,a=/\s\s*$/;n.stringTrimLeft=function(u){return u.replace(M,"")},n.stringTrimRight=function(u){return u.replace(a,"")},n.copyObject=function(u){var o={};for(var s in u)o[s]=u[s];return o},n.copyArray=function(u){for(var o=[],s=0,N=u.length;s<N;s++)u[s]&&typeof u[s]=="object"?o[s]=this.copyObject(u[s]):o[s]=u[s];return o},n.deepCopy=function u(o){if(typeof o!="object"||!o)return o;var s;if(Array.isArray(o)){s=[];for(var N=0;N<o.length;N++)s[N]=u(o[N]);return s}if(Object.prototype.toString.call(o)!=="[object Object]")return o;s={};for(var N in o)s[N]=u(o[N]);return s},n.arrayToMap=function(u){for(var o={},s=0;s<u.length;s++)o[u[s]]=1;return o},n.createMap=function(u){var o=Object.create(null);for(var s in u)o[s]=u[s];return o},n.arrayRemove=function(u,o){for(var s=0;s<=u.length;s++)o===u[s]&&u.splice(s,1)},n.escapeRegExp=function(u){return u.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(u){return(""+u).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},n.getMatchOffsets=function(u,o){var s=[];return u.replace(o,function(N){s.push({offset:arguments[arguments.length-2],length:N.length})}),s},n.deferredCall=function(u){var o=null,s=function(){o=null,u()},N=function(D){return N.cancel(),o=setTimeout(s,D||0),N};return N.schedule=N,N.call=function(){return this.cancel(),u(),N},N.cancel=function(){return clearTimeout(o),o=null,N},N.isPending=function(){return o},N},n.delayedCall=function(u,o){var s=null,N=function(){s=null,u()},D=function(g){s==null&&(s=setTimeout(N,g||o))};return D.delay=function(g){s&&clearTimeout(s),s=setTimeout(N,g||o)},D.schedule=D,D.call=function(){this.cancel(),u()},D.cancel=function(){s&&clearTimeout(s),s=null},D.isPending=function(){return s},D}}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,n,r){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var M=typeof navigator=="object"?navigator:{},a=(/mac|win|linux/i.exec(M.platform)||["other"])[0].toLowerCase(),u=M.userAgent||"",o=M.appName||"";n.isWin=a=="win",n.isMac=a=="mac",n.isLinux=a=="linux",n.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((u.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((u.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=u.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(u.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(u.split(" Chrome/")[1])||void 0,n.isEdge=parseFloat(u.split(" Edge/")[1])||void 0,n.isAIR=u.indexOf("AdobeAIR")>=0,n.isAndroid=u.indexOf("Android")>=0,n.isChromeOS=u.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(u)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,n,r){var M=e("./useragent"),a="http://www.w3.org/1999/xhtml";n.buildDom=function g(l,j,T){if(typeof l=="string"&&l){var y=document.createTextNode(l);return j&&j.appendChild(y),y}if(!Array.isArray(l))return l&&l.appendChild&&j&&j.appendChild(l),l;if(typeof l[0]!="string"||!l[0]){for(var z=[],A=0;A<l.length;A++){var h=g(l[A],j,T);h&&z.push(h)}return z}var x=document.createElement(l[0]),O=l[1],d=1;O&&typeof O=="object"&&!Array.isArray(O)&&(d=2);for(var A=d;A<l.length;A++)g(l[A],x,T);return d==2&&Object.keys(O).forEach(function(E){var C=O[E];E==="class"?x.className=Array.isArray(C)?C.join(" "):C:typeof C=="function"||E=="value"||E[0]=="$"?x[E]=C:E==="ref"?T&&(T[C]=x):E==="style"?typeof C=="string"&&(x.style.cssText=C):C!=null&&x.setAttribute(E,C)}),j&&j.appendChild(x),x},n.getDocumentHead=function(g){return g||(g=document),g.head||g.getElementsByTagName("head")[0]||g.documentElement},n.createElement=function(g,l){return document.createElementNS?document.createElementNS(l||a,g):document.createElement(g)},n.removeChildren=function(g){g.innerHTML=""},n.createTextNode=function(g,l){var j=l?l.ownerDocument:document;return j.createTextNode(g)},n.createFragment=function(g){var l=g?g.ownerDocument:document;return l.createDocumentFragment()},n.hasCssClass=function(g,l){var j=(g.className+"").split(/\s+/g);return j.indexOf(l)!==-1},n.addCssClass=function(g,l){n.hasCssClass(g,l)||(g.className+=" "+l)},n.removeCssClass=function(g,l){for(var j=g.className.split(/\s+/g);;){var T=j.indexOf(l);if(T==-1)break;j.splice(T,1)}g.className=j.join(" ")},n.toggleCssClass=function(g,l){for(var j=g.className.split(/\s+/g),T=!0;;){var y=j.indexOf(l);if(y==-1)break;T=!1,j.splice(y,1)}return T&&j.push(l),g.className=j.join(" "),T},n.setCssClass=function(g,l,j){j?n.addCssClass(g,l):n.removeCssClass(g,l)},n.hasCssString=function(g,l){var j=0,T;if(l=l||document,T=l.querySelectorAll("style")){for(;j<T.length;)if(T[j++].id===g)return!0}},n.removeElementById=function(g,l){l=l||document,l.getElementById(g)&&l.getElementById(g).remove()};var u,o=[];n.useStrictCSP=function(g){u=g,g==!1?s():o||(o=[])};function s(){var g=o;o=null,g&&g.forEach(function(l){N(l[0],l[1])})}function N(g,l,j){if(!(typeof document>"u")){if(o){if(j)s();else if(j===!1)return o.push([g,l])}if(!u){var T=j;!j||!j.getRootNode?T=document:(T=j.getRootNode(),(!T||T==j)&&(T=document));var y=T.ownerDocument||T;if(l&&n.hasCssString(l,T))return null;l&&(g+=`
|
|
1082
|
+
${ut}: ${hi(di(Pt.data.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}`;if(Pt.dataType==="node")return Pt.data.name},valueFormatter:Pt=>hi(di(Pt,E.numberFormatter),E.labelPrefix,E.labelSuffix)},series:{type:"sankey",layout:"none",emphasis:{focus:"adjacency"},data:vt,links:st,label:{show:O.show,position:O.position,formatter:O.truncateLabel?Pt=>ir(Pt.data.name,O.truncateLabelValue||22):void 0}}})}break}case Se.singleValue:{const je=T[0]&&hi(di(T[0],E.numberFormatter),E.labelPrefix,E.labelSuffix),Be=(kM=i==null?void 0:i[E.comparisonTimePeriod||0])==null?void 0:kM[(t==null?void 0:t.singleValue)||""],ut=T!=null&&T[0]?`${(((T==null?void 0:T[0])-Be)/Be*100).toFixed(2)} %`:null,st=E.comparisonValueShow&&E.comparisonTimePeriod&&E.comparisonTimePeriod>0&&E.comparisonTimeGrain!=="NONE"&&(t==null?void 0:t.singleValue)&&((KN=i==null?void 0:i[0])==null?void 0:KN._timestamp);Object.assign(Y,{settings:{fontSize:E.fontSize||30,subHeaderFontSize:E.subHeaderFontSize||14,subHeaderShow:E.subHeaderShow||!1,displayText:E.displayText||"",comparisonTimePeriod:E.comparisonTimePeriod||30,comparisonTimeColumn:E.comparisonTimeColumn||"",comparisonValueShow:E.comparisonValueShow||!1,comparisonValueFontSize:E.comparisonValueFontSize||12,comparisonTimeGrain:E.comparisonTimeGrain||"",comparisonSuffix:E.comparisonSuffix||"",fontColor:E.singleValueFontColor||"#000000",suffix:E.singleValueSuffix||"",prefix:E.singleValuePrefix||""},value:je,comparisonValue:st?ut:void 0,trendLineOptions:ut&&E.isShowTrendLine?{...Y,title:(Ws=t.customSettings)!=null&&Ws.enableTitleDesc?{text:(Gj=t.customSettings)==null?void 0:Gj.chartTitle,subtext:(fI=t.customSettings)==null?void 0:fI.chartDesc,...u}:{},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"line",lineStyle:{color:"rgba(0,0,0,0.2)",width:1,type:"solid"}},className:"getChartOptions-tooltip"},grid:{left:"0%",bottom:"0%",top:"0%",right:"0%",containLabel:!0},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLine:{show:!1},axisLabel:{show:!1}},yAxis:{type:"value",position:k.axis,splitLine:{show:!1},axisLine:{show:!1},axisLabel:{show:!1}},...e!=null&&e.length?{color:[...e]}:{},legend:{show:!1},series:[{data:i==null?void 0:i.map(vt=>[vt==null?void 0:vt._timestamp,vt==null?void 0:vt[t.singleValue||""]]),type:"line",smooth:.6,symbol:"none",lineStyle:{width:2},areaStyle:{},name:(t==null?void 0:t.singleValue)||"total",label:{show:!1}}]}:void 0});break}case Se.waterfall:{let je;if(l!=null&&l.length){const Be=(Bs=l[0])==null?void 0:Bs.data,ut=[Be[0]];if(Be.length)for(let st=1;st<Be.length-1;st++)ut.push(ut[st-1]-Be[st]);ut.push(Be[Be.length-1]),je={labels:g,datasets:[Be,ut],legend:l[0].label}}Object.assign(Y,{...Y,title:(GD=t.customSettings)!=null&&GD.enableTitleDesc?{text:(A0=t.customSettings)==null?void 0:A0.chartTitle,subtext:(dI=t.customSettings)==null?void 0:dI.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(Zj=t.customSettings)!=null&&Zj.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",formatter(Be){const ut=Be[1];return`${ut.name}<br/>${hi(di(ut.value,E.numberFormatter),E.labelPrefix,E.labelSuffix)}`}},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",formatter(Be){return`{a|${ir(Be,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(Be){return Be.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:je==null?void 0:je.labels,splitLine:{show:!((f0=t.customSettings)!=null&&f0.hideXSplitLines)},axisLine:{show:!((d0=t.customSettings)!=null&&d0.hideXAxisLines)},axisLabel:{show:!((O0=t.customSettings)!=null&&O0.hideXAxisLabels),color:((Zg=(Jj=t.labelSettings)==null?void 0:Jj.XAxisStyle)==null?void 0:Zg.color)||"#000000",fontSize:((h0=(Xj=t.labelSettings)==null?void 0:Xj.XAxisStyle)==null?void 0:h0.size)||14,fontWeight:((Jg=(L0=t.labelSettings)==null?void 0:L0.XAxisStyle)==null?void 0:Jg.weight)||400,fontFamily:(zc=(x0=t.labelSettings)==null?void 0:x0.XAxisStyle)==null?void 0:zc.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(Be){return ir(Be,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((Fo=t.customSettings)!=null&&Fo.hideYSplitLines)},axisLine:{show:!((Ac=t.customSettings)!=null&&Ac.hideYAxisLines)},axisLabel:{show:!((Xg=t.customSettings)!=null&&Xg.hideYAxisLabels),color:((OI=(ZD=t.labelSettings)==null?void 0:ZD.YAxisStyle)==null?void 0:OI.color)||"#000000",fontSize:((bi=(Hs=t.labelSettings)==null?void 0:Hs.YAxisStyle)==null?void 0:bi.size)||14,fontWeight:((Pi=(En=t.labelSettings)==null?void 0:En.YAxisStyle)==null?void 0:Pi.weight)||400,fontFamily:(Do=(NM=t.labelSettings)==null?void 0:NM.YAxisStyle)==null?void 0:Do.family,formatter:Be=>Be===null||Be===0?"0":hi(di(Be,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},series:[{name:"Placeholder",type:"bar",stack:"Total",itemStyle:{borderColor:"transparent",color:"transparent"},emphasis:{itemStyle:{borderColor:"transparent",color:"transparent"}},data:je==null?void 0:je.datasets[1],showBackground:Q.show,backgroundStyle:{color:(Kj=t.customSettings)!=null&&Kj.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}},{name:je==null?void 0:je.legend,type:"bar",stack:"Total",label:{show:O.show,position:O.position,formatter(Be){return hi(di(Be.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},data:je==null?void 0:je.datasets[0]}]});break}case Se.horizontalStack:{Object.assign(Y,{...Y,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(qj=t.customSettings)!=null&&qj.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"value",boundaryGap:[0,.01],splitLine:{show:!((hI=t.customSettings)!=null&&hI.hideXSplitLines)},axisLine:{show:!((JD=t.customSettings)!=null&&JD.hideXAxisLines)},axisLabel:{show:!((Br=t.customSettings)!=null&&Br.hideXAxisLabels),color:((Fn=(At=t.labelSettings)==null?void 0:At.XAxisStyle)==null?void 0:Fn.color)||"#000000",fontSize:((yN=(Fi=t.labelSettings)==null?void 0:Fi.XAxisStyle)==null?void 0:yN.size)||14,fontWeight:((XD=(mu=t.labelSettings)==null?void 0:mu.XAxisStyle)==null?void 0:XD.weight)||400,fontFamily:(KD=(Hr=t.labelSettings)==null?void 0:Hr.XAxisStyle)==null?void 0:KD.family,rotate:E.customRotation||E.xRotation,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},yAxis:{type:"category",data:g,splitLine:{show:!((Gs=t.customSettings)!=null&&Gs.hideYSplitLines)},axisLine:{show:!((qD=t.customSettings)!=null&&qD.hideYAxisLines)},position:k.axis,axisLabel:{show:!((go=t.customSettings)!=null&&go.hideYAxisLabels),color:((eg=(au=t.labelSettings)==null?void 0:au.YAxisStyle)==null?void 0:eg.color)||"#000000",fontSize:((dc=(fc=t.labelSettings)==null?void 0:fc.YAxisStyle)==null?void 0:dc.size)||14,fontWeight:((t4=(e4=t.labelSettings)==null?void 0:e4.YAxisStyle)==null?void 0:t4.weight)||400,fontFamily:(n4=(i4=t.labelSettings)==null?void 0:i4.YAxisStyle)==null?void 0:n4.family,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}},series:l==null?void 0:l.map(je=>{var Be;return{data:je.data,type:"bar",stack:"x",name:je.label,barWidth:`${E.barWidth}%`,emphasis:{focus:"series"},label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E.barRadius}}})});break}case Se.table:{const je=[];if(l){const Be=[],ut=[];l==null||l.map(st=>{Be.push(st.label),ut.push(st.data)});for(let st=0;st<((r4=ut[0])==null?void 0:r4.length);st+=1){const vt={};for(let Pt=0;Pt<Be.length;Pt+=1)vt[Be[Pt]]=ut[Pt][st];je.push(vt)}}Object.assign(Y,{data:je,tableSettings:C});break}case Se.horizontalStackTable:{const je=[];if(l){const Be=[],ut=[];l==null||l.map(st=>{Be.push(st.label),ut.push(st.data)});for(let st=0;st<((M4=ut[0])==null?void 0:M4.length);st+=1){const vt={};for(let Pt=0;Pt<Be.length;Pt+=1)vt[Be[Pt]]=ut[Pt][st];je.push(vt)}}Object.assign(Y,{data:je,tableSettings:C,colors:e});break}case Se.pivot:{Object.assign(Y,{pivotTableSettings:b});break}case Se.treeMap:{const je=YH;Object.assign(Y,{...Y,tooltip:{backgroundColor:"black",textStyle:{color:"white"},formatter(ut){const st=ut.value,vt=ut.treePathInfo,Pt=[];for(let Kt=1;Kt<vt.length;Kt++)Pt.push(vt[Kt].name);return[`<div>${je.encodeHTML(Pt.join("-"))}</div>`,`value: ${je.addCommas(st)}`].join("")}},series:[{type:"treemap",visibleMin:600,label:{show:!0,formatter:"{b}"},upperLabel:{show:!0,height:30},itemStyle:{borderColor:"#fff"},levels:(()=>[{itemStyle:{borderWidth:0,gapWidth:5}},{itemStyle:{gapWidth:1}},{colorSaturation:[.35,.5],itemStyle:{gapWidth:1,borderColorSaturation:.6}}])(),data:A}]});break}case Se.stepped:{const je=["start","middle","end"];let Be=2;Object.assign(Y,{...Y,title:(a4=t.customSettings)!=null&&a4.enableTitleDesc?{text:(u4=t.customSettings)==null?void 0:u4.chartTitle,subtext:(tg=t.customSettings)==null?void 0:tg.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(o4=t.customSettings)!=null&&o4.enableBackgroundGradient?D:"",tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:ut=>hi(di(ut,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:ut=>pD(ut,t)},dataZoom:uN(m),legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(ut=>ut.label),formatter(ut){return`{a|${ir(ut,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(ut){return ut.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:g,splitLine:{show:!((ig=t.customSettings)!=null&&ig.hideXSplitLines)},axisLine:{show:!((qN=t.customSettings)!=null&&qN.hideXAxisLines)},axisLabel:{show:!((N4=t.customSettings)!=null&&N4.hideXAxisLabels),color:((s4=(Oc=t.labelSettings)==null?void 0:Oc.XAxisStyle)==null?void 0:s4.color)||"#000000",fontSize:((LI=(D4=t.labelSettings)==null?void 0:D4.XAxisStyle)==null?void 0:LI.size)||14,fontWeight:((g4=(Kg=t.labelSettings)==null?void 0:Kg.XAxisStyle)==null?void 0:g4.weight)||400,fontFamily:(Zs=(qg=t.labelSettings)==null?void 0:qg.XAxisStyle)==null?void 0:Zs.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(ut){return ir(ut,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((uu=t.customSettings)!=null&&uu.hideYSplitLines)},axisLine:{show:!((sf=t.customSettings)!=null&&sf.hideYAxisLines)},axisLabel:{show:!((wr=t.customSettings)!=null&&wr.hideYAxisLabels),color:((c4=(l4=t.labelSettings)==null?void 0:l4.YAxisStyle)==null?void 0:c4.color)||"#000000",fontSize:((hc=(el=t.labelSettings)==null?void 0:el.YAxisStyle)==null?void 0:hc.size)||14,fontWeight:((j4=(p0=t.labelSettings)==null?void 0:p0.YAxisStyle)==null?void 0:j4.weight)||400,fontFamily:(gf=(Df=t.labelSettings)==null?void 0:Df.YAxisStyle)==null?void 0:gf.family,formatter:ut=>ut===null||ut===0?"0":hi(di(ut,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},series:l==null?void 0:l.map(ut=>{var st;return Be===0?Be=1:Be===1?Be=2:Be=0,{name:ut.label,type:"line",step:je[Be],data:ut.data,areaStyle:{},label:{show:O.show,position:O.position,formatter(vt){return hi(di(vt.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(st=t.customSettings)!=null&&st.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})});break}case Se.scatter:{Object.assign(Y,{...Y,title:(xI=t.customSettings)!=null&&xI.enableTitleDesc?{text:(tl=t.customSettings)==null?void 0:tl.chartTitle,subtext:(Lc=t.customSettings)==null?void 0:Lc.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(T4=t.customSettings)!=null&&T4.enableBackgroundGradient?D:"",grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",enterable:!0,formatter:je=>pD(je,t)},dataZoom:uN(m),xAxis:{type:"category",data:g,splitLine:{show:!((lf=t.customSettings)!=null&&lf.hideXSplitLines)},axisLine:{show:!((E0=t.customSettings)!=null&&E0.hideXAxisLines)},axisLabel:{show:!((xc=t.customSettings)!=null&&xc.hideXAxisLabels),color:((pI=(v0=t.labelSettings)==null?void 0:v0.XAxisStyle)==null?void 0:pI.color)||"#000000",fontSize:((cf=(EI=t.labelSettings)==null?void 0:EI.XAxisStyle)==null?void 0:cf.size)||14,fontWeight:((UM=(LM=t.labelSettings)==null?void 0:LM.XAxisStyle)==null?void 0:UM.weight)||400,fontFamily:(I4=(Js=t.labelSettings)==null?void 0:Js.XAxisStyle)==null?void 0:I4.family,rotate:E.customRotation||E.xRotation,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}}},yAxis:{type:"value",position:k.axis,splitLine:{show:!((ou=t.customSettings)!=null&&ou.hideYSplitLines)},axisLine:{show:!((ng=t.customSettings)!=null&&ng.hideYAxisLines)},axisLabel:{show:!((cn=t.customSettings)!=null&&cn.hideYAxisLabels),color:((vI=(il=t.labelSettings)==null?void 0:il.YAxisStyle)==null?void 0:vI.color)||"#000000",fontSize:((w0=(S0=t.labelSettings)==null?void 0:S0.YAxisStyle)==null?void 0:w0.size)||14,fontWeight:((rg=(y4=t.labelSettings)==null?void 0:y4.YAxisStyle)==null?void 0:rg.weight)||400,fontFamily:(wI=(SI=t.labelSettings)==null?void 0:SI.YAxisStyle)==null?void 0:wI.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:l==null?void 0:l.map(je=>je.label),formatter(je){return`{a|${ir(je,d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:l==null?void 0:l.map(je=>{var Be;return{symbolSize:10,data:je.data,type:"scatter",name:je.label,label:{show:O.show,position:O.position,formatter(ut){return hi(di(ut.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},showBackground:Q.show,backgroundStyle:{color:(Be=t.customSettings)!=null&&Be.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"}}})});break}case Se.timeSeries:{if(!n)break;Object.assign(Y,{...Y,title:(CI=t.customSettings)!=null&&CI.enableTitleDesc?{text:(nl=t.customSettings)==null?void 0:nl.chartTitle,subtext:(jf=t.customSettings)==null?void 0:jf.chartDesc,...u}:{},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},backgroundColor:(QI=t.customSettings)!=null&&QI.enableBackgroundGradient?D:"",grid:{left:`${x.marginLeft}%`,bottom:`${x.marginBottom}%`,top:`${x.marginTop}%`,right:`${x.marginRight}%`,containLabel:!0},axisLine:{show:(z4=t.customSettings)==null?void 0:z4.hideXAxisLines},axisLabel:{show:(kI=t.customSettings)==null?void 0:kI.hideXAxisLabels},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},className:"getChartOptions-tooltip",enterable:!0,valueFormatter:je=>hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix),formatter:je=>pD(je,t)},dataZoom:uN(m),xAxis:{type:"category",axisTick:{alignWithLabel:!0},axisLabel:{show:!((Sa=t.customSettings)!=null&&Sa.hideXAxisLabels),color:((es=(ga=t.labelSettings)==null?void 0:ga.XAxisStyle)==null?void 0:es.color)||"#000000",fontSize:((Mg=(pc=t.labelSettings)==null?void 0:pc.XAxisStyle)==null?void 0:Mg.size)||14,fontWeight:((mM=(lo=t.labelSettings)==null?void 0:lo.XAxisStyle)==null?void 0:mM.weight)||400,fontFamily:(wa=(Ec=t.labelSettings)==null?void 0:Ec.XAxisStyle)==null?void 0:wa.family,interval:0,rotate:E.customRotation||E.xRotation,hideOverlap:!0,...O!=null&&O.truncateLabel?{formatter(je){return ir(je,O.truncateLabelValue||22)}}:{}},splitLine:{show:!((Tf=t.customSettings)!=null&&Tf.hideXSplitLines)},axisLine:{show:!((UI=t.customSettings)!=null&&UI.hideXAxisLines)},data:z||[]},yAxis:{type:"value",position:k.axis,splitLine:{show:!((vc=t.customSettings)!=null&&vc.hideYSplitLines)},axisLine:{show:!((YM=t.customSettings)!=null&&YM.hideYAxisLines)},axisLabel:{show:!((C0=t.customSettings)!=null&&C0.hideYAxisLabels),color:((rl=(ci=t.labelSettings)==null?void 0:ci.YAxisStyle)==null?void 0:rl.color)||"#000000",fontSize:((Q0=(Sc=t.labelSettings)==null?void 0:Sc.YAxisStyle)==null?void 0:Q0.size)||14,fontWeight:((wc=(k0=t.labelSettings)==null?void 0:k0.YAxisStyle)==null?void 0:wc.weight)||400,fontFamily:(mI=(Cc=t.labelSettings)==null?void 0:Cc.YAxisStyle)==null?void 0:mI.family,formatter:je=>je===null||je===0?"0":hi(di(je,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},legend:{show:d.show,...d.customise?{top:d.top,left:d.left,right:d.right,bottom:d.bottom}:{...a},orient:d.position,icon:d.legendShape,type:"scroll",data:t.isMultiDimension&&t.seriesField!=="ungrouped"?y==null?void 0:y.map(je=>`${je.name}`||"series-bar"):t.yAxisList,formatter(je){return`{a|${ir(je||"",d.truncateLegendValue||22)}}`},tooltip:{show:!0,formatter(je){return je.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:t.isMultiDimension&&t.seriesField!=="ungrouped"?h!=null&&h.length?h.map(je=>{var Be,ut,st,vt,Pt,Kt,Ai,wi,$n,bn,Ur,Ca,Nu;return{data:(je==null?void 0:je.data)||[],type:((ut=(Be=S==null?void 0:S.seriesType)==null?void 0:Be[0])==null?void 0:ut.type)==="area"?"line":((vt=(st=S==null?void 0:S.seriesType)==null?void 0:st[0])==null?void 0:vt.type)==="stack"?"bar":((Kt=(Pt=S==null?void 0:S.seriesType)==null?void 0:Pt[0])==null?void 0:Kt.type)||"bar",name:(je==null?void 0:je.name)||"series",...((wi=(Ai=S==null?void 0:S.seriesType)==null?void 0:Ai[0])==null?void 0:wi.type)==="stack"?{stack:"total"}:{},label:{show:O.show,position:O.position,formatter(AN){return hi(di(AN.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},emphasis:{focus:"series"},...((bn=($n=S==null?void 0:S.seriesType)==null?void 0:$n[0])==null?void 0:bn.type)==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...((Ca=(Ur=S==null?void 0:S.seriesType)==null?void 0:Ur[0])==null?void 0:Ca.type)==="bar"?{barWidth:`${(E==null?void 0:E.barWidth)||0}%`,showBackground:Q==null?void 0:Q.show,backgroundStyle:{color:(Nu=t.customSettings)!=null&&Nu.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E==null?void 0:E.barRadius}}:{}}}):y==null?void 0:y.map(je=>{var Be,ut,st,vt,Pt,Kt,Ai,wi,$n,bn,Ur,Ca,Nu;return{data:(je==null?void 0:je.data)||[],type:((ut=(Be=S==null?void 0:S.seriesType)==null?void 0:Be[0])==null?void 0:ut.type)==="area"?"line":((vt=(st=S==null?void 0:S.seriesType)==null?void 0:st[0])==null?void 0:vt.type)==="stack"?"bar":((Kt=(Pt=S==null?void 0:S.seriesType)==null?void 0:Pt[0])==null?void 0:Kt.type)||"bar",name:(je==null?void 0:je.name)||"series",...((wi=(Ai=S==null?void 0:S.seriesType)==null?void 0:Ai[0])==null?void 0:wi.type)==="stack"?{stack:"total"}:{},label:{show:O.show,position:O.position,formatter(AN){return hi(di(AN.data,E.numberFormatter),E.labelPrefix,E.labelSuffix)}},emphasis:{focus:"series"},...((bn=($n=S==null?void 0:S.seriesType)==null?void 0:$n[0])==null?void 0:bn.type)==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...((Ca=(Ur=S==null?void 0:S.seriesType)==null?void 0:Ur[0])==null?void 0:Ca.type)==="bar"?{barWidth:`${(E==null?void 0:E.barWidth)||0}%`,showBackground:Q==null?void 0:Q.show,backgroundStyle:{color:(Nu=t.customSettings)!=null&&Nu.isShowBarGradient?N:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:E==null?void 0:E.barRadius}}:{}}}):qge({dataArray:i,timeStampKey:t.xAxis||"",valuekeys:t.yAxisList||[],type:((YI=S.seriesType[0])==null?void 0:YI.type)||"bar",groupBy:(U0=S.groupBySettings)!=null&&U0.value.split("____").length?(A4=S.groupBySettings)==null?void 0:A4.value.split("____")[0].toLowerCase():((Ml=S.groupBySettings)==null?void 0:Ml.value.toLowerCase())||"monthly",labelSettings:O,backGroundColor:Q,customSettings:E,fillXAxis:((zN=S.groupBySettings)==null?void 0:zN.fillXAxis)||!1,isCumulativeBar:((nM=t.customSettings)==null?void 0:nM.cumulativeBar)||!1})});break}}return Y},sQe=t=>["IN","NOT IN"].includes(t),DQe=t=>["IS NULL","IS NOT NULL"].includes(t),aM={container:"_container_13yjv_1",form:"_form_13yjv_7",filterHeader:"_filterHeader_13yjv_23",titleContent:"_titleContent_13yjv_29",title:"_title_13yjv_29",buttons:"_buttons_13yjv_41",apply:"_apply_13yjv_47",applyIcon:"_applyIcon_13yjv_53",reset:"_reset_13yjv_59",filterFieldsContainer:"_filterFieldsContainer_13yjv_67",filterFields:"_filterFields_13yjv_67",filterContainer:"_filterContainer_13yjv_91",AddFilter:"_AddFilter_13yjv_97",filterDropdown:"_filterDropdown_13yjv_103",filterDropdowns:"_filterDropdowns_13yjv_111",noFilters:"_noFilters_13yjv_111",gridColAndRow:"_gridColAndRow_13yjv_127",gridCol1:"_gridCol1_13yjv_135",gridCol2:"_gridCol2_13yjv_143",gridCol3:"_gridCol3_13yjv_151",filters:"_filters_13yjv_159",filterItem:"_filterItem_13yjv_165",filterItemOperator:"_filterItemOperator_13yjv_171",remove:"_remove_13yjv_177",filterCol:"_filterCol_13yjv_183",filterText:"_filterText_13yjv_189",smallText:"_smallText_13yjv_195",numberFieldPopup:"_numberFieldPopup_13yjv_203",numberField:"_numberField_13yjv_203",numberFieldWrapper:"_numberFieldWrapper_13yjv_219",numberFieldLabel:"_numberFieldLabel_13yjv_227",selectedLabel:"_selectedLabel_13yjv_235",numberFieldLabelText:"_numberFieldLabelText_13yjv_243",numberFieldLabelSelectText:"_numberFieldLabelSelectText_13yjv_259",numberFieldButtonClass:"_numberFieldButtonClass_13yjv_267",numberFieldLabelMenuClass:"_numberFieldLabelMenuClass_13yjv_275",numberFieldClearButton:"_numberFieldClearButton_13yjv_283",numberFieldFooter:"_numberFieldFooter_13yjv_291",checkedOption:"_checkedOption_13yjv_299",option:"_option_13yjv_307",addFilterMenu:"_addFilterMenu_13yjv_315",appliedFilterTag:"_appliedFilterTag_13yjv_323",appliedfilters:"_appliedfilters_13yjv_331",textBold:"_textBold_13yjv_339",filterButton:"_filterButton_13yjv_347",filterBtnText:"_filterBtnText_13yjv_355",filterLength:"_filterLength_13yjv_363",addfilter:"_addfilter_13yjv_371",alertContainer:"_alertContainer_13yjv_379"},Tte=({setAppliedFilters:t,column:i,defaultValues:e,className:n="",onChange:r,label:M,variant:a="static",buttonWidth:u="auto",radius:o})=>{const[s,N]=De.useState(e||{min:null,max:null}),D=(e==null?void 0:e.min)===null||(e==null?void 0:e.max)===null,g=De.useRef(null),[l,j]=De.useState(""),[T,y]=De.useState(""),z=()=>{var h;N({min:null,max:null}),j(""),y(""),(h=g.current)==null||h.click(),t(x=>x.filter(O=>O.column!==(i==null?void 0:i.name)))},A=()=>{var h;if(s.min===null||s.max===null){y("Invalid value");return}i&&t&&t(x=>{const O={column:i.name,operator:"BETWEEN",value:`${s.min} AND ${s.max}`,as:i.as,defaultValues:s,filterType:i.isShowHorizontal?"horizontal":"global",isFilterApplied:!!i.isShowHorizontal},d=x.findIndex(C=>C.column===i.name);if(d===-1)return[...x,O];const E=[...x];return E[d]=O,E}),j(`Between ${s.min} to ${s.max}`),y(""),(h=g.current)==null||h.click()};return De.useEffect(()=>{N(e||{min:null,max:null}),j(e&&!D?`${e.min} AND ${e.max}`:"")},[e==null?void 0:e.max,e==null?void 0:e.min,D]),v.jsx(v.Fragment,{children:v.jsx(CD,{position:"bottom-start",buttonWidth:u,menuWidth:"200px",buttonContent:v.jsxs(v.Fragment,{children:[a==="static"&&v.jsx(Pe,{variant:"label",children:M||(i==null?void 0:i.label)||(i==null?void 0:i.name)}),v.jsxs("div",{className:aM.numberField,style:{borderRadius:o||"4px"},ref:g,children:[v.jsxs("div",{className:aM.numberFieldLabelText,children:[a==="floating"&&v.jsx("span",{className:[aM.numberFieldLabel,aM.selectedLabel].join(" "),children:M||(i==null?void 0:i.label)||(i==null?void 0:i.name)}),v.jsx(Pe,{variant:"body-text-sm",children:l||"Select a value"})]}),v.jsx("span",{children:v.jsx(Yt,{name:"caret-down-fill",size:"xs"})})]})]}),children:v.jsxs("div",{className:aM.numberFieldWrapper,children:[v.jsx(yi,{label:"minimum",type:"number",defaultValue:s.min,onChange:({target:{value:h}})=>{N(x=>({...x,min:Number(h)})),r==null||r({min:Number(h),max:s.max})}}),v.jsx(yi,{label:"maximum",type:"number",defaultValue:s.max,onChange:({target:{value:h}})=>{N(x=>({...x,max:Number(h)})),r==null||r({min:s.min,max:Number(h)})}}),T&&v.jsx(Pe,{variant:"body-text-sm",color:"alert",children:T}),v.jsxs("div",{className:aM.numberFieldFooter,children:[v.jsx(Bt,{type:"button",variant:"tertiary",onClick:z,children:"Clear"}),v.jsx(Bt,{variant:"primary",type:"button",onClick:A,children:"Save"})]})]})})})},gQe=({columnList:t,filterList:i,setFilterList:e})=>v.jsx(v.Fragment,{children:!!t.length&&v.jsx(CD,{buttonContent:v.jsx(Bt,{variant:"tertiary",type:"button",leftIcon:v.jsx(Yt,{name:"plus"})}),position:"bottom-start",children:v.jsx("div",{className:aM.addFilterMenu,children:t.map(n=>{const r=!!i.find(M=>M.name===n.name);return v.jsx("div",{children:v.jsx(Bt,{variant:"tertiary",onClick:()=>{const M=r?i.filter(a=>a.name!==n.name):[...i,n];e(M)},children:v.jsxs(Bt,{variant:"tertiary",onClick:()=>{const M=r?i.filter(a=>a.name!==n.name):[...i,n];e(M)},children:[v.jsx(lL,{checked:r,onClick:()=>{const M=r?i.filter(a=>a.name!==n.name):[...i,n];e(M)}}),n.label||n.name]})},n.name)})})})})}),lQe=({filterList:t,setFilterList:i,appliedfilters:e,setAppliedFilters:n,filters:r,internal:M,clientId:a,isAllClient:u,theme:o})=>{const s=De.useCallback((g,l)=>{var T;const j=((T=e==null?void 0:e.find(y=>y.column===g))==null?void 0:T.value)||"";return l==="string"?Array.isArray(j)?j.map(y=>({label:y,value:y})):[]:{label:j,value:j}},[e]),N=De.useMemo(()=>{var g;return(g=e==null?void 0:e.find(l=>{var j;return l.column===((j=t.find(T=>T.as==="date"))==null?void 0:j.name)}))==null?void 0:g.defaultValues},[t,e]),D=De.useCallback(g=>{var l,j;return g.clientColumn&&g.isClientScoped&&g.clientColumnType&&!u?[{columnName:g.clientColumn,value:a,as:g.clientColumnType},...((l=e==null?void 0:e.filter(T=>{var y;return(y=g.dependOn)==null?void 0:y.map(z=>z.value).includes(T.column||"")}))==null?void 0:l.map(T=>({as:"string",columnName:T.column,value:wh({operator:T.operator,value:T.value})})))||[]]:((j=e==null?void 0:e.filter(T=>{var y;return(y=g.dependOn)==null?void 0:y.map(z=>z.value).includes(T.column||"")}))==null?void 0:j.map(T=>({as:"string",columnName:T.column,value:wh({operator:T.operator,value:T.value})})))||[]},[e,a,u]);return v.jsx("div",{className:aM.filterFieldsContainer,children:v.jsxs("div",{className:aM.filterFields,children:[t.length?v.jsx("div",{className:Ua(aM.filterDropdowns,{[aM.gridCol1]:t.length===1,[aM.gridCol2]:t.length===2,[aM.gridCol3]:t.length===3,[aM.gridColAndRow]:t.length>3}),children:t.map(g=>{var l,j,T,y,z;return v.jsxs("div",{className:aM.filterDropdown,style:{borderRadius:o.radius},children:[g.as==="date"&&v.jsx(v.Fragment,{children:v.jsx(HT,{buttonWidth:o.width,label:g.label||g.name,defaultValues:N,variant:o.variant==="static"?"static":"floatingLabel",radius:o.radius,onChange:A=>{A&&n(h=>{var E;const x={column:g.name,operator:"BETWEEN",value:A,as:g.as,defaultValues:A,filterType:g.isShowHorizontal?"horizontal":"global",isFilterApplied:((E=h==null?void 0:h.find(C=>C.as==="date"))==null?void 0:E.isFilterApplied)&&JSON.stringify(A)===JSON.stringify(N)},O=h.findIndex(C=>C.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d})}})}),g.as==="number"&&v.jsx(v.Fragment,{children:v.jsx(Tte,{buttonWidth:o.width,radius:o.radius,variant:o.variant,setAppliedFilters:n,column:g,defaultValues:(l=e.find(A=>A.column===g.name))==null?void 0:l.defaultValues})}),g.as==="string"&&(M!=null&&M.isInternal&&!g.isManualOptions?v.jsx(fd,{labelVariant:o.variant,radius:o.radius,filter:{columnName:g.name,tableName:(j=r==null?void 0:r[0])==null?void 0:j.tableName},workspaceId:M==null?void 0:M.workspaceId,selectedOption:s(g.name,"string")||[],onChange:A=>{if(!A.length){n(h=>h.filter(x=>x.column!==g.name));return}n(h=>{const x={column:g.name,operator:"IN",value:A.map(E=>E.value),as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d})},isSearchEnabled:!0,label:g.label||g.name,filterClause:D(g)}):v.jsx(fl,{buttonWidth:o.width,menuWidth:o.width,radius:o.radius,options:g.isManualOptions?((T=g.manualOptions)==null?void 0:T.map(A=>({value:A,label:A})))||[]:g.options||[],labelVariant:o.variant,selectedOption:s(g.name,"string")||[],onChange:A=>{if(!A.length){n(h=>h.filter(x=>x.column!==g.name));return}n(h=>{const x={column:g.name,operator:"IN",value:A.map(E=>E.value),as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d})},isSearchEnabled:!0,label:g.label||g.name})),g.as==="default"||g.as==="boolean"?M!=null&&M.isInternal&&!g.isManualOptions?v.jsx(ap,{buttonWidth:o.width,menuWidth:o.width,radius:o.radius,filter:{columnName:g.name,tableName:(y=r==null?void 0:r[0])==null?void 0:y.tableName},workspaceId:M==null?void 0:M.workspaceId,labelVariant:o.variant,autoSelected:!1,selectedOption:s(g.name,"boolean"),onChange:A=>n(h=>{const x={column:g.name,operator:"=",value:A.value,as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d}),isSearchEnabled:!0,label:g.label||g.name,filterClause:D(g)}):v.jsx(un,{buttonWidth:o.width,menuWidth:o.width,radius:o.radius,options:g.isManualOptions?((z=g.manualOptions)==null?void 0:z.map(A=>({value:A,label:A})))||[]:g.options||[],labelVariant:o.variant,selectedOption:s(g.name,"boolean"),onChange:A=>n(h=>{const x={column:g.name,operator:"=",value:A.value,as:g.as,filterType:g.isShowHorizontal?"horizontal":"global"},O=h.findIndex(E=>E.column===g.name);if(O===-1)return[...h,x];const d=[...h];return d[O]=x,d}),isSearchEnabled:!0,label:g.label||g.name}):null]},g.name)})}):v.jsx("div",{className:aM.filterDropdowns,children:v.jsx(Pe,{variant:"label",children:"No filter added!"})}),v.jsx("div",{className:aM.AddFilter,children:v.jsx(gQe,{columnList:r[0].columns.filter(g=>!g.isDefault&&!g.isShowHorizontal),setFilterList:i,filterList:t})})]})})},cQe=({appliedfilters:t,setAppliedFilters:i,filters:e,internal:n,clientId:r,isAllClient:M,theme:a})=>{const u=De.useCallback((N,D)=>{var l;const g=((l=t.find(j=>j.column===N))==null?void 0:l.value)||"";return D==="string"?Array.isArray(g)?g.map(j=>({label:j,value:j})):[]:{label:g,value:g}},[t]),o=De.useCallback(N=>{var D,g;return N.clientColumn&&N.isClientScoped&&N.clientColumnType&&!M?[{columnName:N.clientColumn,value:r,as:N.clientColumnType},...((D=t==null?void 0:t.filter(l=>{var j;return(j=N.dependOn)==null?void 0:j.map(T=>T.value).includes(l.column||"")}))==null?void 0:D.map(l=>({as:"string",columnName:l.column,value:wh({operator:l.operator,value:l.value})})))||[]]:((g=t==null?void 0:t.filter(l=>{var j;return(j=N.dependOn)==null?void 0:j.map(T=>T.value).includes(l.column||"")}))==null?void 0:g.map(l=>({as:"string",columnName:l.column,value:wh({operator:l.operator,value:l.value})})))||[]},[t,r,M]),s=(N,D)=>{N&&i(g=>{const l={column:D.name,operator:"BETWEEN",value:N,as:D.as,defaultValues:N,filterType:D.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},j=g.findIndex(y=>y.column===D.name);if(j===-1)return[...g,l];const T=[...g];return T[j]=l,T})};return v.jsx(v.Fragment,{children:e[0].columns.filter(N=>N.isShowHorizontal).map(N=>{var D,g,l,j,T,y;return v.jsxs("div",{className:aM.filterDropdown,style:{borderRadius:a.radius},children:[N.as==="date"&&v.jsx(v.Fragment,{children:v.jsx(HT,{label:N.label||N.name,variant:a.variant==="static"?"static":"floatingLabel",buttonWidth:a.width,radius:a.radius,defaultValues:(D=t.find(z=>z.column===N.name))==null?void 0:D.defaultValues,isDateReset:!t.filter(z=>z.as==="date").length,onChange:z=>s(z,N)})}),N.as==="number"&&v.jsx(Tte,{variant:a.variant,buttonWidth:a.width,radius:a.radius,setAppliedFilters:i,column:N,defaultValues:(g=t.find(z=>z.column===N.name))==null?void 0:g.defaultValues}),N.as==="string"&&(n!=null&&n.isInternal&&!N.isManualOptions?v.jsx(fd,{filter:{columnName:N.name,tableName:(l=e==null?void 0:e[0])==null?void 0:l.tableName},buttonWidth:a.width,menuWidth:a.width,radius:a.radius,workspaceId:n==null?void 0:n.workspaceId,labelVariant:a.variant,selectedOption:u(N.name,"string")||[],autoSelected:!1,onChange:z=>{if(!z.length){i(A=>A.filter(h=>h.column!==N.name));return}i(A=>{const h={column:N.name,operator:"IN",value:z.map(d=>d.value),as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name,filterClause:o(N)}):v.jsx(fl,{buttonWidth:a.width,menuWidth:a.width,options:N.isManualOptions?((j=N.manualOptions)==null?void 0:j.map(z=>({value:z,label:z})))||[]:N.options||[],labelVariant:a.variant,radius:a.radius,selectedOption:u(N.name,"string")||[],onChange:z=>{if(!z.length){i(A=>A.filter(h=>h.column!==N.name));return}i(A=>{const h={column:N.name,operator:"IN",value:z.map(d=>d.value),as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name})),N.as==="default"||N.as==="boolean"?n!=null&&n.isInternal&&!N.isManualOptions?v.jsx(ap,{buttonWidth:a.width,menuWidth:a.width,filter:{columnName:N.name,tableName:(T=e==null?void 0:e[0])==null?void 0:T.tableName},workspaceId:n==null?void 0:n.workspaceId,labelVariant:a.variant,radius:a.radius,autoSelected:!1,selectedOption:u(N.name,"boolean"),onChange:z=>{i(A=>{const h={column:N.name,operator:"=",value:z.value,as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name,filterClause:o(N)}):v.jsx(un,{buttonWidth:a.width,menuWidth:a.width,options:N.isManualOptions?((y=N.manualOptions)==null?void 0:y.map(z=>({value:z,label:z})))||[]:N.options||[],labelVariant:a.variant,radius:a.radius,selectedOption:u(N.name,"boolean"),onChange:z=>{i(A=>{const h={column:N.name,operator:"=",value:z.value,as:N.as,filterType:N.isShowHorizontal?"horizontal":"global",isFilterApplied:!0},x=A.findIndex(d=>d.column===N.name);if(x===-1)return[...A,h];const O=[...A];return O[x]=h,O})},isSearchEnabled:!0,label:N.label||N.name}):null]},N.name)})})},wh=t=>sQe(t.operator)?t.value.map(i=>["true","false"].includes(i)?i==="true":!Number.isNaN(i)&&Number(i)?Number(i):`'${i}'`):DQe(t.operator)?null:["true","false"].includes(t.value)?t.value==="true":!Number.isNaN(t.value)&&Number(t.value)?Number(t.value):`'${t.value}'`,jQe=({filters:t,onApply:i,renderAdditionalHeaderContent:e,internal:n,clientId:r,isAllClient:M,theme:a})=>{const[u,o]=De.useState([]),s=De.useRef(null),[N,D]=De.useState([]),g=t[0].columns.filter(y=>!y.isDefault&&!y.isShowHorizontal).length,l=()=>{var y;o([]),i({tableName:"",filters:[]}),(y=s.current)==null||y.click()},j=y=>{const z=y.map(A=>{const h={column:A.column,operator:A.operator,as:A.as},x=A.as==="date"||A.as==="number"?A.value:wh({operator:A.operator,value:A.value});return x!=null&&Object.assign(h,{...h,value:x}),h});i({tableName:t[0].tableName,filters:z})},T=y=>{var z;y.preventDefault(),o(A=>A.map(h=>({...h,isFilterApplied:!0}))),(z=s.current)==null||z.click()};return De.useEffect(()=>{j(u.filter(y=>y.filterType==="horizontal"||y.isFilterApplied))},[u]),De.useEffect(()=>{var y,z,A,h;if(t[0].columns.length===0){D([]),o([]);return}if(t[0].columns.length&&D(t[0].columns.filter(x=>x.isDefault&&!x.isShowHorizontal)),t.length&&t[0].columns.length){const x=((h=(A=(z=(y=t==null?void 0:t[0])==null?void 0:y.columns)==null?void 0:z.filter(O=>O.isShowHorizontal))==null?void 0:A.map(O=>{var d,E;if(O.defaultValue){let C;switch(O.as){case"string":C={column:O.name,operator:"IN",value:O.defaultValue,as:O.as,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!0};break;case"number":C={column:O.name,operator:"BETWEEN",value:`${(d=O.defaultValue)==null?void 0:d.min} AND ${(E=O.defaultValue)==null?void 0:E.max}`,as:O.as,defaultValues:O.defaultValue,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!!O.isShowHorizontal};break;case"date":{const k=O.defaultValue,Q=k!=null&&k.endDate&&(k!=null&&k.startDate)&&(k!=null&&k.timeGrainValue)?{startDate:new Date(k.startDate),endDate:new Date(k.endDate),timeGrainValue:k.timeGrainValue}:void 0,S=k;C={column:O.name,operator:"BETWEEN",value:S,as:O.as,defaultValues:Q,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!0};break}default:C={column:O.name,operator:"=",value:O.defaultValue,as:O.as,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!0};break}return C}return{column:"none",operator:"=",value:void 0,as:O.as,filterType:O.isShowHorizontal?"horizontal":"global",isFilterApplied:!1}}))==null?void 0:h.filter(O=>O.column!=="none"&&O.value!==void 0))||[];o(x)}},[t]),v.jsxs(v.Fragment,{children:[v.jsx(v.Fragment,{children:v.jsxs("div",{className:aM.filterContainer,children:[N.length?v.jsx(Ite,{globalFilterRef:s,appliedfilters:u,setAppliedFilters:o,handleSubmit:T,resetFilters:l,renderAdditionalHeaderContent:e,filters:t,setFilterList:D,filterList:N,internal:n,clientId:r,isAllClient:M,theme:a}):g?v.jsx(Ite,{globalFilterRef:s,appliedfilters:u,setAppliedFilters:o,handleSubmit:T,resetFilters:l,renderAdditionalHeaderContent:e,filters:t,setFilterList:D,filterList:N,internal:n,clientId:r,isAllClient:M,theme:a}):null,t.length&&v.jsx(cQe,{appliedfilters:u,setAppliedFilters:o,filters:t,internal:n,clientId:r,isAllClient:M,theme:a})]})}),u!=null&&u.find(y=>y.filterType==="global"&&!y.isFilterApplied)?v.jsx("div",{className:aM.alertContainer,children:v.jsx(v9,{text:"Global filter selected. Click apply to see the changes."})}):null]})},Ite=({globalFilterRef:t,appliedfilters:i,setAppliedFilters:e,handleSubmit:n,resetFilters:r,renderAdditionalHeaderContent:M,filterList:a,filters:u,setFilterList:o,internal:s,clientId:N,isAllClient:D,theme:g})=>v.jsx(v.Fragment,{children:v.jsx(CD,{position:"bottom",tabMenu:!0,menuWidth:"auto",buttonContent:v.jsxs("div",{className:aM.filterButton,ref:t,children:[v.jsxs("div",{className:aM.filterBtnText,children:[v.jsx(Yt,{name:"funnel"})," Filters"]}),(i==null?void 0:i.length)===0?null:v.jsx("span",{className:aM.filterLength,children:i==null?void 0:i.length})]}),children:v.jsx("div",{className:aM.container,children:v.jsxs("form",{className:aM.form,onSubmit:n,onReset:r,children:[v.jsx("div",{className:aM.filterHeader,children:v.jsxs("div",{className:aM.titleContent,children:[v.jsx(Pe,{children:"Filters"}),M?M():null]})}),v.jsx(lQe,{filterList:a,appliedfilters:i,filters:u,setFilterList:o,setAppliedFilters:e,internal:s,clientId:N,isAllClient:D,theme:g}),v.jsxs("div",{className:aM.buttons,children:[v.jsx(Bt,{type:"reset",variant:"tertiary",leftIcon:v.jsx(Yt,{name:"delete",color:"alert"}),color:"alert",children:v.jsx(Pe,{color:"alert",children:"Reset"})}),v.jsx(Bt,{type:"submit",variant:"primary",children:"Apply"})]})]})})})}),ib={container:"_container_1skzs_1",tooltip:"_tooltip_1skzs_9",top:"_top_1skzs_37",bottom:"_bottom_1skzs_55",left:"_left_1skzs_73",right:"_right_1skzs_91","left-top-end":"_left-top-end_1skzs_109","right-top-end":"_right-top-end_1skzs_127","left-bottom-end":"_left-bottom-end_1skzs_145","right-bottom-end":"_right-bottom-end_1skzs_163","top-left":"_top-left_1skzs_181","top-right":"_top-right_1skzs_199","bottom-left":"_bottom-left_1skzs_217","bottom-right":"_bottom-right_1skzs_235","left-top":"_left-top_1skzs_109","left-bottom":"_left-bottom_1skzs_145","right-top":"_right-top_1skzs_127","right-bottom":"_right-bottom_1skzs_163"},fs=({children:t,text:i,className:e,position:n="bottom",tooltipClass:r=""})=>v.jsxs("div",{className:`${ib.container} ${e}`,children:[t,v.jsx("span",{className:`${ib.tooltip} ${r} ${ib[n]}`,children:i})]}),nb=({children:t,className:i,iconConfig:e,position:n,tooltipClass:r,text:M})=>v.jsx(fs,{className:i,position:n,tooltipClass:r,text:M,children:v.jsx(Yt,{name:"info",size:e==null?void 0:e.size,color:e==null?void 0:e.color})}),Aj={label:"_label_o3uvq_1","inputField-container":"_inputField-container_o3uvq_7",upperContainer:"_upperContainer_o3uvq_13",input:"_input_o3uvq_7",inputWrapper:"_inputWrapper_o3uvq_25",supportText:"_supportText_o3uvq_31",error:"_error_o3uvq_37",noError:"_noError_o3uvq_43",inputContainer:"_inputContainer_o3uvq_49",errorIcon:"_errorIcon_o3uvq_55",floatingLabel:"_floatingLabel_o3uvq_63"},yi=({type:t="text",register:i,label:e,isDisabled:n,id:r,elementRef:M,error:a,supportingText:u,leftIcon:o,rightIcon:s,labelVariant:N="static",...D})=>v.jsxs("div",{className:Aj["inputField-container"],children:[v.jsxs("div",{className:Aj.upperContainer,children:[e?v.jsx("label",{htmlFor:r,className:N==="static"?Aj.label:Aj.floatingLabel,children:e}):null,v.jsxs("div",{className:Aj.inputContainer,children:[o,v.jsx("input",{...D,ref:M,id:r,type:t,className:`${Aj.input} ${D.className||""} ${a?Aj.error:Aj.noError}`,...i,disabled:n}),s]})]}),u&&v.jsx("div",{className:Aj.supportText,children:u}),a&&v.jsx(Pe,{variant:"body-text-sm",color:"alert",children:a})]}),rb={csvlink:"_csvlink_11u8o_1",noChart:"_noChart_11u8o_7"},TQe=t=>{var n;const i=(n=t.current)==null?void 0:n.getEchartsInstance();return i?i.getConnectedDataURL({type:"png",pixelRatio:2,excludeComponents:["toolbox"],backgroundColor:"#fff"}):"#"},IQe=({className:t,iconClass:i,fileName:e="chart",text:n,chartRef:r})=>v.jsxs("a",{href:TQe(r),download:`${e}.png`,className:t??rb.csvlink,target:"_self",children:[v.jsx(Yt,{name:"image"}),n]}),yQe=(t,i)=>{const e=[];if(t!=null&&t.pivotTableSettings){const n=t.pivotTableSettings.rows||[],r=t.pivotTableSettings.columns||[],M=tb(i,r,n),a=[],u=[],o=M[n[0]];o.map(s=>{const N=s.parent;if(N.includes("/")){const D=N.lastIndexOf("/"),g=[N.substring(0,D),N.substring(D+1)];a.includes(g[1])||a.push(g[1]),u.includes(g[0])||u.push(g[0])}else u.push(N),a.push(N)}),u.forEach(s=>{const N={};N.keys=s,a.forEach(D=>{N[`${n[0]} - ${D}`]=null}),e.push(N)});for(let s=0;s<e.length;s+=1){const N=e[s];Object.keys(N).map(D=>{const g=D.split(" - ");o.map(l=>{l.parent.includes("/")?l.parent===`${N.keys}/${g[1]}`&&g[0]===n[0]&&(N[D]=l.name):l.parent===g[1]&&g[0]===n[0]&&(N[D]=l.name)})})}if(n.length>1)for(let s=1;s<n.length;s+=1){const N=[],D=M[n[s]];D.map(g=>{const l=g.parent;if(l.includes("/")){const j=l.lastIndexOf("/"),T=[l.substring(0,j),l.substring(j+1)];N.includes(T[0])||N.push(T[0])}else N.push(l)}),N.forEach(g=>{e.map(l=>{l.keys===g&&a.forEach(j=>{l[`${n[s]} - ${j}`]=null})})});for(let g=0;g<e.length;g+=1){const l=e[g];Object.keys(l).map(j=>{const T=j.split(" - ");D.map(y=>{y.parent.includes("/")?y.parent===`${l.keys}/${T[1]}`&&T[0]===n[s]&&(l[j]=y.name):y.parent===T[1]&&T[0]===n[s]&&(l[j]=y.name)})})}}if(r.length>2)for(let s=0;s<e.length;s+=1){const N=e[s],D=N.keys.replace(/\//g,",");N.keys=`(${D})`.replace(/\b(\w+)\b/g,"'$1'")}else if(r.length===1){const s="keys";e.forEach(N=>{delete N[s]}),e.splice(1)}}return e},zQe=({data:t=[],fileName:i="export",className:e,text:n="",chartOptions:r})=>{const M=yQe(r,t);return v.jsxs("a",{href:Nle(M),download:`${i}.csv`,className:e??rb.csvlink,target:"_self",children:[v.jsx(Yt,{name:"task-done-file"}),n]})},yte=({fileName:t,companyIntegrationId:i,integrationName:e,query:n,className:r,children:M})=>{const[a,u]=De.useState(!1),o=De.useCallback(async()=>{try{u(!0);const s=window.open("","_blank");if(s){s.document.write(`<html>
|
|
1083
|
+
<body>
|
|
1084
|
+
|
|
1085
|
+
<p id="progress-text">Downloading...</p>
|
|
1086
|
+
|
|
1087
|
+
</body></html>`);const N=s.document.createElement("script");N.innerHTML=`
|
|
1088
|
+
async function downloadCsv() {
|
|
1089
|
+
try {
|
|
1090
|
+
// Add the code for downloading the CSV file here
|
|
1091
|
+
const res = await fetch(\`${rge}\`, {
|
|
1092
|
+
method: 'POST',
|
|
1093
|
+
body: JSON.stringify({
|
|
1094
|
+
companyIntegrationId: \`${i}\`,
|
|
1095
|
+
integrationName: \`${e}\`,
|
|
1096
|
+
query: \`${n}\`,
|
|
1097
|
+
name: \`${t}\`,
|
|
1098
|
+
}),
|
|
1099
|
+
headers: {
|
|
1100
|
+
'Content-Type': 'application/json',
|
|
1101
|
+
},
|
|
1102
|
+
});
|
|
1103
|
+
|
|
1104
|
+
if (!res.ok) {
|
|
1105
|
+
throw new Error('Network response was not ok');
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
// Read the response body as a Blob (binary data)
|
|
1109
|
+
const zipData = await res.blob();
|
|
1110
|
+
|
|
1111
|
+
// Create a temporary URL for the Blob
|
|
1112
|
+
const zipUrl = URL.createObjectURL(zipData);
|
|
1113
|
+
|
|
1114
|
+
// Create a link element to trigger the download
|
|
1115
|
+
const downloadLink = document.createElement('a');
|
|
1116
|
+
downloadLink.href = zipUrl;
|
|
1117
|
+
downloadLink.download = \`${t}.zip\`; // Specify the filename here
|
|
1118
|
+
downloadLink.style.display = 'none';
|
|
1119
|
+
|
|
1120
|
+
// Append the link to the document and trigger the click event
|
|
1121
|
+
document.body.appendChild(downloadLink);
|
|
1122
|
+
downloadLink.click();
|
|
1123
|
+
|
|
1124
|
+
// Clean up the temporary URL
|
|
1125
|
+
URL.revokeObjectURL(zipUrl);
|
|
1126
|
+
|
|
1127
|
+
document.getElementById('progress-text').textContent = 'Download complete';
|
|
1128
|
+
|
|
1129
|
+
// Remove the link from the document
|
|
1130
|
+
document.body.removeChild(downloadLink);
|
|
1131
|
+
// Close the new tab/window
|
|
1132
|
+
window.close();
|
|
1133
|
+
|
|
1134
|
+
} catch (error) {
|
|
1135
|
+
// Handle errors as needed
|
|
1136
|
+
// eslint-disable-next-line no-alert
|
|
1137
|
+
alert('Error downloading the file. Please try later.');
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
// Create a button in the new tab's HTML
|
|
1141
|
+
const button = document.createElement('button');
|
|
1142
|
+
button.textContent = 'Download CSV';
|
|
1143
|
+
button.id = 'downcsv_button';
|
|
1144
|
+
button.style.display = 'none'
|
|
1145
|
+
|
|
1146
|
+
// Attach the event listener within the script
|
|
1147
|
+
button.addEventListener('click', () => {
|
|
1148
|
+
// Call the downloadCsv function when the button is clicked
|
|
1149
|
+
downloadCsv();
|
|
1150
|
+
});
|
|
1151
|
+
|
|
1152
|
+
// Append the button to the document
|
|
1153
|
+
document.body.appendChild(button);
|
|
1154
|
+
|
|
1155
|
+
button.click();
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
`,s.document.body.appendChild(N)}u(!1)}catch{u(!1),alert("Error downloading the file. Please try later.")}},[i,e,n,t]);return v.jsx("button",{type:"button",className:r??rb.csvlink,onClick:o,disabled:a,children:a?v.jsx(XA,{}):M})},zte={"header-container":"_header-container_r1zlv_1",headingText:"_headingText_r1zlv_13","btn-container":"_btn-container_r1zlv_17","back-btn":"_back-btn_r1zlv_21","save-btn":"_save-btn_r1zlv_25"},AQe=({setShowMetricCreateModal:t,isDisableSaveBtn:i,heading:e,setShowSaveMetricModal:n})=>{const[r,M]=De.useState(!1);return v.jsxs("div",{className:zte["header-container"],children:[v.jsxs("div",{className:zte["btn-container"],children:[v.jsx(Bt,{type:"button",variant:"tab",onClick:()=>t(!1),leftIcon:v.jsx(Yt,{name:"arrow-left"})}),v.jsx("div",{children:r&&e==="Update Metric"?v.jsxs("div",{className:"dbn-relative",children:[v.jsx(yi,{defaultValue:e,placeholder:"Edit Title",required:!0}),v.jsx("span",{className:"dbn-absolute -dbn-right-6 -dbn-top-1 dbn-cursor-pointer",onClick:()=>M(a=>!a),children:v.jsx(Yt,{name:"pencil-simple",size:"xs"})})]}):v.jsx("div",{className:"dbn-relative",children:v.jsxs("div",{className:"dbn-flex dbn-gap-2 dbn-items-center",children:[v.jsx(Bt,{type:"button",variant:"popover",isDisabled:!e,children:e||"Untitled metric"}),e==="Update Metric"?v.jsx("span",{className:"dbn-cursor-pointer",onClick:()=>M(a=>!a),children:v.jsx(Yt,{name:"pencil-simple",size:"xs"})}):null]})})})]}),v.jsx(Bt,{type:"submit",variant:"tab",isDisabled:i,onClick:()=>n(!0),leftIcon:v.jsx(Yt,{name:"save"}),children:"Save"})]})},Av={"create-btn":"_create-btn_170wz_1",metricCreateModalHeader:"_metricCreateModalHeader_170wz_5",metricCreateModalContent:"_metricCreateModalContent_170wz_9",isShowMetricCreateModal:"_isShowMetricCreateModal_170wz_13","query-modal":"_query-modal_170wz_17"},fj={container:"_container_14ypl_1",header:"_header_14ypl_5",wrapper:"_wrapper_14ypl_9","col-container":"_col-container_14ypl_13",column:"_column_14ypl_17",columnText:"_columnText_14ypl_21",heading:"_heading_14ypl_25",customButton:"_customButton_14ypl_29",listVal:"_listVal_14ypl_33",handleIcon:"_handleIcon_14ypl_37"},Mb=({identifier:t,data:i,renderItem:e,CustomDragPreview:n,modifiers:r,events:M})=>{const{DragNodeRef:a,isDragging:u}=rle({identifier:t,data:i,CustomDragPreview:n,modifiers:r,events:M});return e(a,u)},fQe=({setselectTable:t,selectTable:i,tableList:e,columnList:n,onChangeTableSelection:r})=>{const[M,a]=De.useState("");return v.jsxs("div",{className:fj.container,children:[v.jsxs("div",{className:fj.heading,children:[v.jsx(Yt,{name:"database",size:"xl"}),v.jsx(Pe,{variant:"heading-lg",children:"Data"})]}),v.jsxs("div",{className:fj.header,children:[v.jsx(GS,{setSearchKeyword:a}),v.jsx("div",{className:"dbn-w-full",children:v.jsx(un,{onChange:u=>{t(u),r(u.value)},selectedOption:i,options:e,customButton:v.jsxs("div",{className:fj.customButton,children:[v.jsx(Yt,{name:"table"})," ",i.label?i.label:"Select table from dropdown"]}),labelVariant:"static",buttonWidth:"100%",menuWidth:"100%"})})]}),v.jsx("div",{className:fj.wrapper,children:v.jsx("div",{className:fj["col-container"],children:n.filter(u=>u.label.includes(M)).map(u=>{var N;const[,o,s]=(N=u==null?void 0:u.value)==null?void 0:N.split("____");return v.jsx(Mb,{data:u,identifier:{id:u.value,type:"column"},CustomDragPreview:v.jsx("span",{className:fj.listVal,children:u.label}),modifiers:{highlightDrop:{onDrag:!0}},renderItem:D=>v.jsxs("div",{className:fj.column,ref:D,children:[v.jsxs("span",{className:fj.handleIcon,children:[v.jsx(Yt,{name:"kebab-menu-vertical",size:"xs"}),v.jsx(Yt,{name:"kebab-menu-vertical",size:"xs"})]}),v.jsxs("span",{className:"dbn-flex dbn-items-end dbn-gap-2 dbn-truncate",children:[v.jsx("span",{children:v.jsx(Ese,{datatype:s})}),v.jsx(Pe,{variant:"body-text-sm",children:o})]})]},o)})})})})]})},ED={searchCommand:"_searchCommand_11joi_1","chartTab-container":"_chartTab-container_11joi_9",chartText:"_chartText_11joi_17",chartSettingButton:"_chartSettingButton_11joi_25",chartSettingMenu:"_chartSettingMenu_11joi_33",charts:"_charts_11joi_41",metricChart:"_metricChart_11joi_49",metricChartHeader:"_metricChartHeader_11joi_57",metricChartEmpty:"_metricChartEmpty_11joi_65","chartTab-wrapper":"_chartTab-wrapper_11joi_73","chartTab-wrapper-head":"_chartTab-wrapper-head_11joi_81",fullQuery:"_fullQuery_11joi_89",fullQueryIcon:"_fullQueryIcon_11joi_97",noQuery:"_noQuery_11joi_105","tableTab-header":"_tableTab-header_11joi_113","chartButton-header":"_chartButton-header_11joi_121",chartButtonContainer:"_chartButtonContainer_11joi_129",searchWrapper:"_searchWrapper_11joi_137",searchIcon:"_searchIcon_11joi_145",chartConfigure:"_chartConfigure_11joi_153",chartSettings:"_chartSettings_11joi_161",labels:"_labels_11joi_169",chartButtons:"_chartButtons_11joi_177",chartButton:"_chartButton_11joi_121","loader-container":"_loader-container_11joi_193"},UN={listbox:"_listbox_hfzpa_1","listBox-label":"_listBox-label_hfzpa_5","listBox-labelFloating":"_listBox-labelFloating_hfzpa_9","listBoxButton-container":"_listBoxButton-container_hfzpa_13","listBoxButton-containerFloating":"_listBoxButton-containerFloating_hfzpa_17",listBoxButton:"_listBoxButton_hfzpa_13","listBox-options":"_listBox-options_hfzpa_25",selectedOptionText:"_selectedOptionText_hfzpa_29",transitionDiv:"_transitionDiv_hfzpa_33",listboxButtonWrapper:"_listboxButtonWrapper_hfzpa_37",arrowicon:"_arrowicon_hfzpa_40",leave:"_leave_hfzpa_43",leaveFrom:"_leaveFrom_hfzpa_46",leaveTo:"_leaveTo_hfzpa_49",notAvailable:"_notAvailable_hfzpa_52",option:"_option_hfzpa_55",activeOption:"_activeOption_hfzpa_58",optionSelected:"_optionSelected_hfzpa_61",inactiveOption:"_inactiveOption_hfzpa_64",optionLabel:"_optionLabel_hfzpa_67",optionSubLabel:"_optionSubLabel_hfzpa_70",selectedLabel:"_selectedLabel_hfzpa_73",nonselectedLabel:"_nonselectedLabel_hfzpa_76",check:"_check_hfzpa_79",checkActive:"_checkActive_hfzpa_82",checkInactive:"_checkInactive_hfzpa_85",checkIcon:"_checkIcon_hfzpa_88",checkIconSelected:"_checkIconSelected_hfzpa_91",checkIconUnselected:"_checkIconUnselected_hfzpa_94",loadMore:"_loadMore_hfzpa_97",loadMoreIcon:"_loadMoreIcon_hfzpa_100",selectedList:"_selectedList_hfzpa_103",selectedListItem:"_selectedListItem_hfzpa_106",label:"_label_hfzpa_109",search:"_search_hfzpa_112",searchDiv:"_searchDiv_hfzpa_116"},dQe=({options:t,defaultValue:i,value:e,onChange:n,label:r,name:M,className:a="",children:u,placeHolder:o,onClick:s,isSearchEnabled:N,containerClass:D="",labelVariant:g="static",icon:l,isDisableShowSelectedTag:j})=>{const[T,y]=De.useState(""),[z,A]=De.useState(20),[h,x]=De.useState(!1),O=De.useRef(),d=De.useMemo(()=>T?t.filter(E=>E.label.toLowerCase().includes(T)).slice(0,z):t.slice(0,z),[T,t,z]);return J6({wrapRef:O,onOutsideClick:()=>x(!1)}),De.useEffect(()=>{i&&i.length&&(n==null||n(i))},[]),v.jsx(v.Fragment,{children:v.jsxs("div",{ref:O,className:`${UN.listbox} ${D}`,children:[l,r?v.jsx("label",{className:`${UN["listBox-label"]} ${g==="floating"?UN["listBox-labelFloating"]:""}`,children:r}):null,v.jsxs("div",{className:UN.listboxButtonWrapper,children:[v.jsx("div",{className:`${UN["listBoxButton-container"]} ${a} ${g==="floating"?UN["listBoxButton-containerFloating"]:""}`,children:v.jsxs(Bt,{variant:"tertiary",type:"button",onClick:()=>x(E=>!E),name:M,children:[v.jsx("span",{className:UN.selectedOptionText,children:o||"Choose options from list"}),v.jsx("span",{className:UN.listBoxButton,children:v.jsx(Yt,{name:"chevron-down"})})]})}),h&&v.jsxs("div",{className:UN["listBox-options"],children:[N&&v.jsx(GS,{className:UN.search,setSearchKeyword:y}),d.length===0?v.jsx("div",{className:UN.notAvailable,children:"Not Available."}):d.map(E=>v.jsx("div",{className:Ua(e!=null&&e.includes(E.value)?UN.optionSelected:"",UN.option),onClick:()=>{e!=null&&e.find(C=>C===E.value)?n==null||n(e.filter(C=>C!==E.value)):n==null||n([...e||[],E.value]),s==null||s()},children:v.jsxs(Bt,{type:"button",variant:"tertiary",onClick:()=>{e!=null&&e.find(C=>C===E.value)?n==null||n(e.filter(C=>C!==E.value)):n==null||n([...e||[],E.value]),s==null||s()},children:[v.jsx(lL,{checked:e==null?void 0:e.includes(E.value),onClick:()=>{e!=null&&e.find(C=>C===E.value)?n==null||n(e.filter(C=>C!==E.value)):n==null||n([...e||[],E.value]),s==null||s()}}),E.label]},E.value)})),z<=t.length&&v.jsx(Bt,{variant:"tertiary",type:"button",onClick:()=>A(z+30),rightIcon:v.jsx(Yt,{name:"chevron-down"}),children:"Load More"}),u]})]}),e!=null&&e.length&&!j?v.jsx("div",{className:UN.selectedList,children:e.map(E=>{var C;return v.jsx(Pe,{variant:"body-text-sm",children:(C=t.find(k=>k.value===E))==null?void 0:C.label},E)})}):null]})})},Ch="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjY0IiBoZWlnaHQ9IjIwNiIgdmlld0JveD0iMCAwIDI2NCAyMDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTQyLjkyNSAwQzExOC43ODQgMCA5Ni41OTU5IDguMzY4MjggNzkuMDc1OCAyMi4zNjkxSDUwLjc2QzQ3LjA4MTIgMjIuMzY5MSA0NC4wNzEzIDI1LjM4ODkgNDQuMDcxMyAyOS4wNzk4QzQ0LjA3MTMgMzIuNzcwNyA0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C4zNzhIMTc1Ljc0MVYxNDQuOTE2SDE0NC4yNDRWMTM0LjM3OFpNNzYuNTggNzkuMzE3OUgxNzAuNDJDMTczLjM1NCA3OS4zMTc5IDE3NS43NDEgODEuNjgxOSAxNzUuNzQxIDg0LjU4NzNWODkuODU2N0g3MS4yNTgxVjg0LjU4NzNDNzEuMjU4MSA4MS42ODE5IDczLjY0NTUgNzkuMzE3OSA3Ni41OCA3OS4zMTc5Wk03MS4yNTgxIDE1My40MTJWMTQ4LjE0MkgxMDIuNzU1VjE1OC42ODFINzYuNThDNzMuNjQ1NSAxNTguNjgxIDcxLjI1ODEgMTU2LjMxNyA3MS4yNTgxIDE1My40MTJaTTE3MC40MiAxNTguNjgxSDE0NC4yNDRWMTQ4LjE0MkgxNzUuNzQxVjE1My40MTJDMTc1Ljc0MSAxNTYuMzE3IDE3My4zNTQgMTU4LjY4MSAxNzAuNDIgMTU4LjY4MVoiIGZpbGw9IiNEMEQ0REEiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF80MzJfNTA5NyI+CjxyZWN0IHg9IjkwLjk5OTgiIHk9IjUwIiB3aWR0aD0iMTExIiBoZWlnaHQ9Ijg2IiByeD0iMTAiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjxjbGlwUGF0aCBpZD0iY2xpcDFfNDMyXzUwOTciPgo8cmVjdCB4PSI2Ny45OTk4IiB5PSI3NiIgd2lkdGg9IjExMSIgaGVpZ2h0PSI4NiIgcng9IjEwIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=",OQe=({data:t,isLoading:i,headerChild:e,chartSettings:n,setChartSettings:r,chartColors:M,handleChartRightClick:a,chartClickConfig:u,chartPopupChild:o,isEnablePivotTable:s,groupbyList:N,hasNumberKeys:D,isEnableGauge:g,error:l})=>{var y,z,A,h,x,O;const j=De.useRef(null),T=De.useMemo(()=>zv({chartOptions:n,data:t||[],colors:M}),[t,n,M]);return v.jsxs("div",{className:ED["chartTab-container"],children:[v.jsxs("div",{className:ED.metricChartHeader,children:[e,(y=n.customSettings)!=null&&y.showSelectLegend?v.jsx(dQe,{name:"legend",options:(A=(z=T==null?void 0:T.legend)==null?void 0:z.data)!=null&&A.length?(h=T.legend.data)==null?void 0:h.map(d=>({value:d,label:d})):[],onChange:d=>{r(E=>({...E,selectedSeries:d}))},value:n.selectedSeries,isDisableShowSelectedTag:!0,isSearchEnabled:!0}):null]}),i&&v.jsx("div",{className:ED["loader-container"],children:v.jsx(XA,{})}),!l&&!n.xAxis&&!((x=n.yAxisList)!=null&&x.length)&&!i&&v.jsxs("div",{className:ED.metricChartEmpty,children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx(Pe,{variant:"heading-lg",children:"Choose a table to create your metric"}),v.jsx("div",{className:ED.chartButton,children:v.jsx(Pe,{variant:"body-text-sm",children:"Drag and Drop columns to visualize the chart"})})]}),t!=null&&t.length&&!i&&(n.xAxis||(O=n.yAxisList)!=null&&O.length)?v.jsx("div",{className:ED.metricChart,children:v.jsx("div",{className:ED["chartTab-wrapper"],children:t.length?v.jsxs("div",{className:ED.labels,children:[v.jsx(NL,{chartOptions:n,data:t,filterValues:[],onMaximize:()=>{},colors:M,events:{click:d=>{a&&a(d)},contextmenu:d=>{a&&a(d)}},config:{chartClickConfig:u,ref:j,onColumnSizingChange:d=>r(E=>({...E,tableSettings:{...E.tableSettings,columnSizing:d}}))}}),o]}):v.jsxs("div",{className:ED.metricChartEmpty,children:[v.jsx("div",{className:ED.searchWrapper,children:v.jsx(Yt,{name:"magnifying-glass"})}),v.jsx("div",{className:ED.message,children:v.jsx(Pe,{variant:"body-text-sm",children:"Uh-oh, Nothing to display"})}),v.jsx("div",{className:ED.chartButton,children:v.jsx(Pe,{variant:"body-text-sm",children:"Choose an appropriate chart type and start visulaizing your data"})})]})})}):null,l&&!i?v.jsx("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center",children:v.jsx(Pe,{variant:"heading-lg",color:"alert",children:l})}):null]})},fv={container:"_container_zgdws_1",header:"_header_zgdws_5","text-container":"_text-container_zgdws_9","btn-container":"_btn-container_zgdws_13",tabButton:"_tabButton_zgdws_16",selectedTab:"_selectedTab_zgdws_19",activeTab:"_activeTab_zgdws_23",metricChartEmpty:"_metricChartEmpty_zgdws_26",table:"_table_zgdws_30","sql-btn":"_sql-btn_zgdws_34","sql-btn-disabled":"_sql-btn-disabled_zgdws_38","save-btn-icon":"_save-btn-icon_zgdws_42"},hQe=({outpuTableData:t,outputError:i,isOutputLoading:e,isUpdateMetric:n,isDisableSqlBtn:r,setShowSqlModal:M})=>v.jsx("div",{className:fv.container,children:t!=null&&t.length&&!i?v.jsx("div",{className:fv.table,children:v.jsx(Wv,{data:t,filterValues:[],onMaximize:()=>{},isLoading:e,error:i,tableSettings:{showTableTitle:!1,hideVerticalDivider:!1,showRowHover:!1,enableStripedRows:!1,enableTableSearch:!1,contentAlignment:"left",enableFilter:!1,enableSorting:!0,lineGap:"",showTableDesc:!1},headerAlignment:"left"})}):v.jsx(v.Fragment,{children:i?v.jsx("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center",children:v.jsx(Pe,{variant:"heading-lg",color:"alert",children:i})}):v.jsxs("div",{className:fv.metricChartEmpty,children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx(Pe,{variant:"heading-lg",children:"Choose a table to create your metric"}),v.jsx("div",{className:fv.chartButton,children:v.jsx(Pe,{variant:"body-text-sm",children:"Drag and Drop columns to visualize the chart"})})]})})}),Aa={"main-container":"_main-container_i1qa3_1",mainContainerUpdate:"_mainContainerUpdate_i1qa3_4","outputTab-header":"_outputTab-header_i1qa3_8",selection:"_selection_i1qa3_12",selectionContainer:"_selectionContainer_i1qa3_16",listContainer:"_listContainer_i1qa3_20",listVal:"_listVal_i1qa3_24",removeColumn:"_removeColumn_i1qa3_28",columnContainer:"_columnContainer_i1qa3_36",selectedCol:"_selectedCol_i1qa3_40",wrapper:"_wrapper_i1qa3_44",visualization:"_visualization_i1qa3_48",visualizationTabCollapsed:"_visualizationTabCollapsed_i1qa3_52",tableTab:"_tableTab_i1qa3_56",noCursor:"_noCursor_i1qa3_60",tableTabExpanded:"_tableTabExpanded_i1qa3_64",searchCommand:"_searchCommand_i1qa3_67",tabButton:"_tabButton_i1qa3_70",tabActive:"_tabActive_i1qa3_73",dynamicGroupFormat:"_dynamicGroupFormat_i1qa3_76",wrapperHead:"_wrapperHead_i1qa3_80",features:"_features_i1qa3_84"},LQe=({name:t,styles:i,placeholder:e,enabled:n})=>v.jsxs("label",{htmlFor:t,className:`${i.button}`,children:[typeof e=="string"&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:` ${i.switch} ${n?i.enabled:i.notenabled}`}),v.jsx("span",{className:i.label,children:e})]}),!Array.isArray(e)&&typeof e!="string"&&v.jsx("span",{className:` ${i.switch} ${n?i.enabled:i.notenabled}`})]}),ab={group:"_group_1y2gh_1",button:"_button_1y2gh_5",checkbox:"_checkbox_1y2gh_9",switch:"_switch_1y2gh_13",enabled:"_enabled_1y2gh_22",notenabled:"_notenabled_1y2gh_30",label:"_label_1y2gh_38"},zn=({enabled:t,onChange:i,placeholder:e,defaultEnabled:n,name:r=`toggle-${Date.now()}`,isDisabled:M})=>v.jsxs("div",{className:ab.group,children:[v.jsx("input",{type:"checkbox",id:r,checked:n,onChange:({target:a})=>i==null?void 0:i(a.checked),className:ab.checkbox,disabled:M}),v.jsx(LQe,{name:r,styles:ab,placeholder:e,enabled:t})]});var Ate=De.createContext(),fte=De.createContext();function xQe(t){var i=t.children,e=De.useState(null),n=e[0],r=e[1],M=De.useRef(!1);De.useEffect(function(){return function(){M.current=!0}},[]);var a=De.useCallback(function(u){M.current||r(u)},[]);return De.createElement(Ate.Provider,{value:n},De.createElement(fte.Provider,{value:a},i))}var dte=function(i){return Array.isArray(i)?i[0]:i},Ote=function(i){if(typeof i=="function"){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return i.apply(void 0,n)}},ub=function(i,e){if(typeof i=="function")return Ote(i,e);i!=null&&(i.current=e)},hte=function(i){return i.reduce(function(e,n){var r=n[0],M=n[1];return e[r]=M,e},{})},Lte=typeof window<"u"&&window.document&&window.document.createElement?De.useLayoutEffect:De.useEffect,mN="top",vD="bottom",SD="right",YN="left",ob="auto",Qh=[mN,vD,SD,YN],LA="start",kh="end",pQe="clippingParents",xte="viewport",Uh="popper",EQe="reference",pte=Qh.reduce(function(t,i){return t.concat([i+"-"+LA,i+"-"+kh])},[]),Ete=[].concat(Qh,[ob]).reduce(function(t,i){return t.concat([i,i+"-"+LA,i+"-"+kh])},[]),vQe="beforeRead",SQe="read",wQe="afterRead",CQe="beforeMain",QQe="main",kQe="afterMain",UQe="beforeWrite",mQe="write",YQe="afterWrite",bQe=[vQe,SQe,wQe,CQe,QQe,kQe,UQe,mQe,YQe];function $l(t){return t?(t.nodeName||"").toLowerCase():null}function ds(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var i=t.ownerDocument;return i&&i.defaultView||window}return t}function vz(t){var i=ds(t).Element;return t instanceof i||t instanceof Element}function wD(t){var i=ds(t).HTMLElement;return t instanceof i||t instanceof HTMLElement}function Nb(t){if(typeof ShadowRoot>"u")return!1;var i=ds(t).ShadowRoot;return t instanceof i||t instanceof ShadowRoot}function _Qe(t){var i=t.state;Object.keys(i.elements).forEach(function(e){var n=i.styles[e]||{},r=i.attributes[e]||{},M=i.elements[e];!wD(M)||!$l(M)||(Object.assign(M.style,n),Object.keys(r).forEach(function(a){var u=r[a];u===!1?M.removeAttribute(a):M.setAttribute(a,u===!0?"":u)}))})}function RQe(t){var i=t.state,e={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(i.elements.popper.style,e.popper),i.styles=e,i.elements.arrow&&Object.assign(i.elements.arrow.style,e.arrow),function(){Object.keys(i.elements).forEach(function(n){var r=i.elements[n],M=i.attributes[n]||{},a=Object.keys(i.styles.hasOwnProperty(n)?i.styles[n]:e[n]),u=a.reduce(function(o,s){return o[s]="",o},{});!wD(r)||!$l(r)||(Object.assign(r.style,u),Object.keys(M).forEach(function(o){r.removeAttribute(o)}))})}}const PQe={name:"applyStyles",enabled:!0,phase:"write",fn:_Qe,effect:RQe,requires:["computeStyles"]};function Wl(t){return t.split("-")[0]}var Sz=Math.max,dv=Math.min,xA=Math.round;function sb(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(i){return i.brand+"/"+i.version}).join(" "):navigator.userAgent}function vte(){return!/^((?!chrome|android).)*safari/i.test(sb())}function pA(t,i,e){i===void 0&&(i=!1),e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,M=1;i&&wD(t)&&(r=t.offsetWidth>0&&xA(n.width)/t.offsetWidth||1,M=t.offsetHeight>0&&xA(n.height)/t.offsetHeight||1);var a=vz(t)?ds(t):window,u=a.visualViewport,o=!vte()&&e,s=(n.left+(o&&u?u.offsetLeft:0))/r,N=(n.top+(o&&u?u.offsetTop:0))/M,D=n.width/r,g=n.height/M;return{width:D,height:g,top:N,right:s+D,bottom:N+g,left:s,x:s,y:N}}function Db(t){var i=pA(t),e=t.offsetWidth,n=t.offsetHeight;return Math.abs(i.width-e)<=1&&(e=i.width),Math.abs(i.height-n)<=1&&(n=i.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:n}}function Ste(t,i){var e=i.getRootNode&&i.getRootNode();if(t.contains(i))return!0;if(e&&Nb(e)){var n=i;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function dj(t){return ds(t).getComputedStyle(t)}function VQe(t){return["table","td","th"].indexOf($l(t))>=0}function CT(t){return((vz(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ov(t){return $l(t)==="html"?t:t.assignedSlot||t.parentNode||(Nb(t)?t.host:null)||CT(t)}function wte(t){return!wD(t)||dj(t).position==="fixed"?null:t.offsetParent}function FQe(t){var i=/firefox/i.test(sb()),e=/Trident/i.test(sb());if(e&&wD(t)){var n=dj(t);if(n.position==="fixed")return null}var r=Ov(t);for(Nb(r)&&(r=r.host);wD(r)&&["html","body"].indexOf($l(r))<0;){var M=dj(r);if(M.transform!=="none"||M.perspective!=="none"||M.contain==="paint"||["transform","perspective"].indexOf(M.willChange)!==-1||i&&M.willChange==="filter"||i&&M.filter&&M.filter!=="none")return r;r=r.parentNode}return null}function mh(t){for(var i=ds(t),e=wte(t);e&&VQe(e)&&dj(e).position==="static";)e=wte(e);return e&&($l(e)==="html"||$l(e)==="body"&&dj(e).position==="static")?i:e||FQe(t)||i}function gb(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Yh(t,i,e){return Sz(t,dv(i,e))}function $Qe(t,i,e){var n=Yh(t,i,e);return n>e?e:n}function Cte(){return{top:0,right:0,bottom:0,left:0}}function Qte(t){return Object.assign({},Cte(),t)}function kte(t,i){return i.reduce(function(e,n){return e[n]=t,e},{})}var WQe=function(i,e){return i=typeof i=="function"?i(Object.assign({},e.rects,{placement:e.placement})):i,Qte(typeof i!="number"?i:kte(i,Qh))};function BQe(t){var i,e=t.state,n=t.name,r=t.options,M=e.elements.arrow,a=e.modifiersData.popperOffsets,u=Wl(e.placement),o=gb(u),s=[YN,SD].indexOf(u)>=0,N=s?"height":"width";if(!(!M||!a)){var D=WQe(r.padding,e),g=Db(M),l=o==="y"?mN:YN,j=o==="y"?vD:SD,T=e.rects.reference[N]+e.rects.reference[o]-a[o]-e.rects.popper[N],y=a[o]-e.rects.reference[o],z=mh(M),A=z?o==="y"?z.clientHeight||0:z.clientWidth||0:0,h=T/2-y/2,x=D[l],O=A-g[N]-D[j],d=A/2-g[N]/2+h,E=Yh(x,d,O),C=o;e.modifiersData[n]=(i={},i[C]=E,i.centerOffset=E-d,i)}}function HQe(t){var i=t.state,e=t.options,n=e.element,r=n===void 0?"[data-popper-arrow]":n;r!=null&&(typeof r=="string"&&(r=i.elements.popper.querySelector(r),!r)||Ste(i.elements.popper,r)&&(i.elements.arrow=r))}const GQe={name:"arrow",enabled:!0,phase:"main",fn:BQe,effect:HQe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function EA(t){return t.split("-")[1]}var ZQe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function JQe(t,i){var e=t.x,n=t.y,r=i.devicePixelRatio||1;return{x:xA(e*r)/r||0,y:xA(n*r)/r||0}}function Ute(t){var i,e=t.popper,n=t.popperRect,r=t.placement,M=t.variation,a=t.offsets,u=t.position,o=t.gpuAcceleration,s=t.adaptive,N=t.roundOffsets,D=t.isFixed,g=a.x,l=g===void 0?0:g,j=a.y,T=j===void 0?0:j,y=typeof N=="function"?N({x:l,y:T}):{x:l,y:T};l=y.x,T=y.y;var z=a.hasOwnProperty("x"),A=a.hasOwnProperty("y"),h=YN,x=mN,O=window;if(s){var d=mh(e),E="clientHeight",C="clientWidth";if(d===ds(e)&&(d=CT(e),dj(d).position!=="static"&&u==="absolute"&&(E="scrollHeight",C="scrollWidth")),d=d,r===mN||(r===YN||r===SD)&&M===kh){x=vD;var k=D&&d===O&&O.visualViewport?O.visualViewport.height:d[E];T-=k-n.height,T*=o?1:-1}if(r===YN||(r===mN||r===vD)&&M===kh){h=SD;var Q=D&&d===O&&O.visualViewport?O.visualViewport.width:d[C];l-=Q-n.width,l*=o?1:-1}}var S=Object.assign({position:u},s&&ZQe),b=N===!0?JQe({x:l,y:T},ds(e)):{x:l,y:T};if(l=b.x,T=b.y,o){var Y;return Object.assign({},S,(Y={},Y[x]=A?"0":"",Y[h]=z?"0":"",Y.transform=(O.devicePixelRatio||1)<=1?"translate("+l+"px, "+T+"px)":"translate3d("+l+"px, "+T+"px, 0)",Y))}return Object.assign({},S,(i={},i[x]=A?T+"px":"",i[h]=z?l+"px":"",i.transform="",i))}function XQe(t){var i=t.state,e=t.options,n=e.gpuAcceleration,r=n===void 0?!0:n,M=e.adaptive,a=M===void 0?!0:M,u=e.roundOffsets,o=u===void 0?!0:u,s={placement:Wl(i.placement),variation:EA(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:r,isFixed:i.options.strategy==="fixed"};i.modifiersData.popperOffsets!=null&&(i.styles.popper=Object.assign({},i.styles.popper,Ute(Object.assign({},s,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:a,roundOffsets:o})))),i.modifiersData.arrow!=null&&(i.styles.arrow=Object.assign({},i.styles.arrow,Ute(Object.assign({},s,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})}const KQe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:XQe,data:{}};var hv={passive:!0};function qQe(t){var i=t.state,e=t.instance,n=t.options,r=n.scroll,M=r===void 0?!0:r,a=n.resize,u=a===void 0?!0:a,o=ds(i.elements.popper),s=[].concat(i.scrollParents.reference,i.scrollParents.popper);return M&&s.forEach(function(N){N.addEventListener("scroll",e.update,hv)}),u&&o.addEventListener("resize",e.update,hv),function(){M&&s.forEach(function(N){N.removeEventListener("scroll",e.update,hv)}),u&&o.removeEventListener("resize",e.update,hv)}}const eke={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:qQe,data:{}};var tke={left:"right",right:"left",bottom:"top",top:"bottom"};function Lv(t){return t.replace(/left|right|bottom|top/g,function(i){return tke[i]})}var ike={start:"end",end:"start"};function mte(t){return t.replace(/start|end/g,function(i){return ike[i]})}function lb(t){var i=ds(t),e=i.pageXOffset,n=i.pageYOffset;return{scrollLeft:e,scrollTop:n}}function cb(t){return pA(CT(t)).left+lb(t).scrollLeft}function nke(t,i){var e=ds(t),n=CT(t),r=e.visualViewport,M=n.clientWidth,a=n.clientHeight,u=0,o=0;if(r){M=r.width,a=r.height;var s=vte();(s||!s&&i==="fixed")&&(u=r.offsetLeft,o=r.offsetTop)}return{width:M,height:a,x:u+cb(t),y:o}}function rke(t){var i,e=CT(t),n=lb(t),r=(i=t.ownerDocument)==null?void 0:i.body,M=Sz(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Sz(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-n.scrollLeft+cb(t),o=-n.scrollTop;return dj(r||e).direction==="rtl"&&(u+=Sz(e.clientWidth,r?r.clientWidth:0)-M),{width:M,height:a,x:u,y:o}}function jb(t){var i=dj(t),e=i.overflow,n=i.overflowX,r=i.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+n)}function Yte(t){return["html","body","#document"].indexOf($l(t))>=0?t.ownerDocument.body:wD(t)&&jb(t)?t:Yte(Ov(t))}function bh(t,i){var e;i===void 0&&(i=[]);var n=Yte(t),r=n===((e=t.ownerDocument)==null?void 0:e.body),M=ds(n),a=r?[M].concat(M.visualViewport||[],jb(n)?n:[]):n,u=i.concat(a);return r?u:u.concat(bh(Ov(a)))}function Tb(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Mke(t,i){var e=pA(t,!1,i==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function bte(t,i,e){return i===xte?Tb(nke(t,e)):vz(i)?Mke(i,e):Tb(rke(CT(t)))}function ake(t){var i=bh(Ov(t)),e=["absolute","fixed"].indexOf(dj(t).position)>=0,n=e&&wD(t)?mh(t):t;return vz(n)?i.filter(function(r){return vz(r)&&Ste(r,n)&&$l(r)!=="body"}):[]}function uke(t,i,e,n){var r=i==="clippingParents"?ake(t):[].concat(i),M=[].concat(r,[e]),a=M[0],u=M.reduce(function(o,s){var N=bte(t,s,n);return o.top=Sz(N.top,o.top),o.right=dv(N.right,o.right),o.bottom=dv(N.bottom,o.bottom),o.left=Sz(N.left,o.left),o},bte(t,a,n));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function _te(t){var i=t.reference,e=t.element,n=t.placement,r=n?Wl(n):null,M=n?EA(n):null,a=i.x+i.width/2-e.width/2,u=i.y+i.height/2-e.height/2,o;switch(r){case mN:o={x:a,y:i.y-e.height};break;case vD:o={x:a,y:i.y+i.height};break;case SD:o={x:i.x+i.width,y:u};break;case YN:o={x:i.x-e.width,y:u};break;default:o={x:i.x,y:i.y}}var s=r?gb(r):null;if(s!=null){var N=s==="y"?"height":"width";switch(M){case LA:o[s]=o[s]-(i[N]/2-e[N]/2);break;case kh:o[s]=o[s]+(i[N]/2-e[N]/2);break}}return o}function _h(t,i){i===void 0&&(i={});var e=i,n=e.placement,r=n===void 0?t.placement:n,M=e.strategy,a=M===void 0?t.strategy:M,u=e.boundary,o=u===void 0?pQe:u,s=e.rootBoundary,N=s===void 0?xte:s,D=e.elementContext,g=D===void 0?Uh:D,l=e.altBoundary,j=l===void 0?!1:l,T=e.padding,y=T===void 0?0:T,z=Qte(typeof y!="number"?y:kte(y,Qh)),A=g===Uh?EQe:Uh,h=t.rects.popper,x=t.elements[j?A:g],O=uke(vz(x)?x:x.contextElement||CT(t.elements.popper),o,N,a),d=pA(t.elements.reference),E=_te({reference:d,element:h,strategy:"absolute",placement:r}),C=Tb(Object.assign({},h,E)),k=g===Uh?C:d,Q={top:O.top-k.top+z.top,bottom:k.bottom-O.bottom+z.bottom,left:O.left-k.left+z.left,right:k.right-O.right+z.right},S=t.modifiersData.offset;if(g===Uh&&S){var b=S[r];Object.keys(Q).forEach(function(Y){var m=[SD,vD].indexOf(Y)>=0?1:-1,R=[mN,vD].indexOf(Y)>=0?"y":"x";Q[Y]+=b[R]*m})}return Q}function oke(t,i){i===void 0&&(i={});var e=i,n=e.placement,r=e.boundary,M=e.rootBoundary,a=e.padding,u=e.flipVariations,o=e.allowedAutoPlacements,s=o===void 0?Ete:o,N=EA(n),D=N?u?pte:pte.filter(function(j){return EA(j)===N}):Qh,g=D.filter(function(j){return s.indexOf(j)>=0});g.length===0&&(g=D);var l=g.reduce(function(j,T){return j[T]=_h(t,{placement:T,boundary:r,rootBoundary:M,padding:a})[Wl(T)],j},{});return Object.keys(l).sort(function(j,T){return l[j]-l[T]})}function Nke(t){if(Wl(t)===ob)return[];var i=Lv(t);return[mte(t),i,mte(i)]}function ske(t){var i=t.state,e=t.options,n=t.name;if(!i.modifiersData[n]._skip){for(var r=e.mainAxis,M=r===void 0?!0:r,a=e.altAxis,u=a===void 0?!0:a,o=e.fallbackPlacements,s=e.padding,N=e.boundary,D=e.rootBoundary,g=e.altBoundary,l=e.flipVariations,j=l===void 0?!0:l,T=e.allowedAutoPlacements,y=i.options.placement,z=Wl(y),A=z===y,h=o||(A||!j?[Lv(y)]:Nke(y)),x=[y].concat(h).reduce(function(q,ie){return q.concat(Wl(ie)===ob?oke(i,{placement:ie,boundary:N,rootBoundary:D,padding:s,flipVariations:j,allowedAutoPlacements:T}):ie)},[]),O=i.rects.reference,d=i.rects.popper,E=new Map,C=!0,k=x[0],Q=0;Q<x.length;Q++){var S=x[Q],b=Wl(S),Y=EA(S)===LA,m=[mN,vD].indexOf(b)>=0,R=m?"width":"height",P=_h(i,{placement:S,boundary:N,rootBoundary:D,altBoundary:g,padding:s}),W=m?Y?SD:YN:Y?vD:mN;O[R]>d[R]&&(W=Lv(W));var B=Lv(W),X=[];if(M&&X.push(P[b]<=0),u&&X.push(P[W]<=0,P[B]<=0),X.every(function(q){return q})){k=S,C=!1;break}E.set(S,X)}if(C)for(var F=j?3:1,G=function(ie){var re=x.find(function(le){var Ne=E.get(le);if(Ne)return Ne.slice(0,ie).every(function(se){return se})});if(re)return k=re,"break"},J=F;J>0;J--){var ee=G(J);if(ee==="break")break}i.placement!==k&&(i.modifiersData[n]._skip=!0,i.placement=k,i.reset=!0)}}const Dke={name:"flip",enabled:!0,phase:"main",fn:ske,requiresIfExists:["offset"],data:{_skip:!1}};function Rte(t,i,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-i.height-e.y,right:t.right-i.width+e.x,bottom:t.bottom-i.height+e.y,left:t.left-i.width-e.x}}function Pte(t){return[mN,SD,vD,YN].some(function(i){return t[i]>=0})}function gke(t){var i=t.state,e=t.name,n=i.rects.reference,r=i.rects.popper,M=i.modifiersData.preventOverflow,a=_h(i,{elementContext:"reference"}),u=_h(i,{altBoundary:!0}),o=Rte(a,n),s=Rte(u,r,M),N=Pte(o),D=Pte(s);i.modifiersData[e]={referenceClippingOffsets:o,popperEscapeOffsets:s,isReferenceHidden:N,hasPopperEscaped:D},i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-reference-hidden":N,"data-popper-escaped":D})}const lke={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gke};function cke(t,i,e){var n=Wl(t),r=[YN,mN].indexOf(n)>=0?-1:1,M=typeof e=="function"?e(Object.assign({},i,{placement:t})):e,a=M[0],u=M[1];return a=a||0,u=(u||0)*r,[YN,SD].indexOf(n)>=0?{x:u,y:a}:{x:a,y:u}}function jke(t){var i=t.state,e=t.options,n=t.name,r=e.offset,M=r===void 0?[0,0]:r,a=Ete.reduce(function(N,D){return N[D]=cke(D,i.rects,M),N},{}),u=a[i.placement],o=u.x,s=u.y;i.modifiersData.popperOffsets!=null&&(i.modifiersData.popperOffsets.x+=o,i.modifiersData.popperOffsets.y+=s),i.modifiersData[n]=a}const Tke={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jke};function Ike(t){var i=t.state,e=t.name;i.modifiersData[e]=_te({reference:i.rects.reference,element:i.rects.popper,strategy:"absolute",placement:i.placement})}const yke={name:"popperOffsets",enabled:!0,phase:"read",fn:Ike,data:{}};function zke(t){return t==="x"?"y":"x"}function Ake(t){var i=t.state,e=t.options,n=t.name,r=e.mainAxis,M=r===void 0?!0:r,a=e.altAxis,u=a===void 0?!1:a,o=e.boundary,s=e.rootBoundary,N=e.altBoundary,D=e.padding,g=e.tether,l=g===void 0?!0:g,j=e.tetherOffset,T=j===void 0?0:j,y=_h(i,{boundary:o,rootBoundary:s,padding:D,altBoundary:N}),z=Wl(i.placement),A=EA(i.placement),h=!A,x=gb(z),O=zke(x),d=i.modifiersData.popperOffsets,E=i.rects.reference,C=i.rects.popper,k=typeof T=="function"?T(Object.assign({},i.rects,{placement:i.placement})):T,Q=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),S=i.modifiersData.offset?i.modifiersData.offset[i.placement]:null,b={x:0,y:0};if(d){if(M){var Y,m=x==="y"?mN:YN,R=x==="y"?vD:SD,P=x==="y"?"height":"width",W=d[x],B=W+y[m],X=W-y[R],F=l?-C[P]/2:0,G=A===LA?E[P]:C[P],J=A===LA?-C[P]:-E[P],ee=i.elements.arrow,q=l&&ee?Db(ee):{width:0,height:0},ie=i.modifiersData["arrow#persistent"]?i.modifiersData["arrow#persistent"].padding:Cte(),re=ie[m],le=ie[R],Ne=Yh(0,E[P],q[P]),se=h?E[P]/2-F-Ne-re-Q.mainAxis:G-Ne-re-Q.mainAxis,Ie=h?-E[P]/2+F+Ne+le+Q.mainAxis:J+Ne+le+Q.mainAxis,Oe=i.elements.arrow&&mh(i.elements.arrow),ye=Oe?x==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,$e=(Y=S==null?void 0:S[x])!=null?Y:0,Ve=W+se-$e-ye,Ee=W+Ie-$e,Te=Yh(l?dv(B,Ve):B,W,l?Sz(X,Ee):X);d[x]=Te,b[x]=Te-W}if(u){var fe,Qe=x==="x"?mN:YN,ot=x==="x"?vD:SD,rt=d[O],ke=O==="y"?"height":"width",et=rt+y[Qe],xe=rt-y[ot],Dt=[mN,YN].indexOf(z)!==-1,ve=(fe=S==null?void 0:S[O])!=null?fe:0,pt=Dt?et:rt-E[ke]-C[ke]-ve+Q.altAxis,Ct=Dt?rt+E[ke]+C[ke]-ve-Q.altAxis:xe,dt=l&&Dt?$Qe(pt,rt,Ct):Yh(l?pt:et,rt,l?Ct:xe);d[O]=dt,b[O]=dt-rt}i.modifiersData[n]=b}}const fke={name:"preventOverflow",enabled:!0,phase:"main",fn:Ake,requiresIfExists:["offset"]};function dke(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Oke(t){return t===ds(t)||!wD(t)?lb(t):dke(t)}function hke(t){var i=t.getBoundingClientRect(),e=xA(i.width)/t.offsetWidth||1,n=xA(i.height)/t.offsetHeight||1;return e!==1||n!==1}function Lke(t,i,e){e===void 0&&(e=!1);var n=wD(i),r=wD(i)&&hke(i),M=CT(i),a=pA(t,r,e),u={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(n||!n&&!e)&&(($l(i)!=="body"||jb(M))&&(u=Oke(i)),wD(i)?(o=pA(i,!0),o.x+=i.clientLeft,o.y+=i.clientTop):M&&(o.x=cb(M))),{x:a.left+u.scrollLeft-o.x,y:a.top+u.scrollTop-o.y,width:a.width,height:a.height}}function xke(t){var i=new Map,e=new Set,n=[];t.forEach(function(M){i.set(M.name,M)});function r(M){e.add(M.name);var a=[].concat(M.requires||[],M.requiresIfExists||[]);a.forEach(function(u){if(!e.has(u)){var o=i.get(u);o&&r(o)}}),n.push(M)}return t.forEach(function(M){e.has(M.name)||r(M)}),n}function pke(t){var i=xke(t);return bQe.reduce(function(e,n){return e.concat(i.filter(function(r){return r.phase===n}))},[])}function Eke(t){var i;return function(){return i||(i=new Promise(function(e){Promise.resolve().then(function(){i=void 0,e(t())})})),i}}function vke(t){var i=t.reduce(function(e,n){var r=e[n.name];return e[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,e},{});return Object.keys(i).map(function(e){return i[e]})}var Vte={placement:"bottom",modifiers:[],strategy:"absolute"};function Fte(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return!i.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function Ske(t){t===void 0&&(t={});var i=t,e=i.defaultModifiers,n=e===void 0?[]:e,r=i.defaultOptions,M=r===void 0?Vte:r;return function(u,o,s){s===void 0&&(s=M);var N={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vte,M),modifiersData:{},elements:{reference:u,popper:o},attributes:{},styles:{}},D=[],g=!1,l={state:N,setOptions:function(z){var A=typeof z=="function"?z(N.options):z;T(),N.options=Object.assign({},M,N.options,A),N.scrollParents={reference:vz(u)?bh(u):u.contextElement?bh(u.contextElement):[],popper:bh(o)};var h=pke(vke([].concat(n,N.options.modifiers)));return N.orderedModifiers=h.filter(function(x){return x.enabled}),j(),l.update()},forceUpdate:function(){if(!g){var z=N.elements,A=z.reference,h=z.popper;if(Fte(A,h)){N.rects={reference:Lke(A,mh(h),N.options.strategy==="fixed"),popper:Db(h)},N.reset=!1,N.placement=N.options.placement,N.orderedModifiers.forEach(function(Q){return N.modifiersData[Q.name]=Object.assign({},Q.data)});for(var x=0;x<N.orderedModifiers.length;x++){if(N.reset===!0){N.reset=!1,x=-1;continue}var O=N.orderedModifiers[x],d=O.fn,E=O.options,C=E===void 0?{}:E,k=O.name;typeof d=="function"&&(N=d({state:N,options:C,name:k,instance:l})||N)}}}},update:Eke(function(){return new Promise(function(y){l.forceUpdate(),y(N)})}),destroy:function(){T(),g=!0}};if(!Fte(u,o))return l;l.setOptions(s).then(function(y){!g&&s.onFirstUpdate&&s.onFirstUpdate(y)});function j(){N.orderedModifiers.forEach(function(y){var z=y.name,A=y.options,h=A===void 0?{}:A,x=y.effect;if(typeof x=="function"){var O=x({state:N,name:z,instance:l,options:h}),d=function(){};D.push(O||d)}})}function T(){D.forEach(function(y){return y()}),D=[]}return l}}var wke=[eke,yke,KQe,PQe,Tke,Dke,fke,GQe,lke],Cke=Ske({defaultModifiers:wke}),Qke=typeof Element<"u",kke=typeof Map=="function",Uke=typeof Set=="function",mke=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function xv(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;var e,n,r;if(Array.isArray(t)){if(e=t.length,e!=i.length)return!1;for(n=e;n--!==0;)if(!xv(t[n],i[n]))return!1;return!0}var M;if(kke&&t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(M=t.entries();!(n=M.next()).done;)if(!i.has(n.value[0]))return!1;for(M=t.entries();!(n=M.next()).done;)if(!xv(n.value[1],i.get(n.value[0])))return!1;return!0}if(Uke&&t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(M=t.entries();!(n=M.next()).done;)if(!i.has(n.value[0]))return!1;return!0}if(mke&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(i)){if(e=t.length,e!=i.length)return!1;for(n=e;n--!==0;)if(t[n]!==i[n])return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof i.valueOf=="function")return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof i.toString=="function")return t.toString()===i.toString();if(r=Object.keys(t),e=r.length,e!==Object.keys(i).length)return!1;for(n=e;n--!==0;)if(!Object.prototype.hasOwnProperty.call(i,r[n]))return!1;if(Qke&&t instanceof Element)return!1;for(n=e;n--!==0;)if(!((r[n]==="_owner"||r[n]==="__v"||r[n]==="__o")&&t.$$typeof)&&!xv(t[r[n]],i[r[n]]))return!1;return!0}return t!==t&&i!==i}var Yke=function(i,e){try{return xv(i,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const bke=sy(Yke);var _ke=[],$te=function(i,e,n){n===void 0&&(n={});var r=De.useRef(null),M={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||_ke},a=De.useState({styles:{popper:{position:M.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),u=a[0],o=a[1],s=De.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(l){var j=l.state,T=Object.keys(j.elements);a1.flushSync(function(){o({styles:hte(T.map(function(y){return[y,j.styles[y]||{}]})),attributes:hte(T.map(function(y){return[y,j.attributes[y]]}))})})},requires:["computeStyles"]}},[]),N=De.useMemo(function(){var g={onFirstUpdate:M.onFirstUpdate,placement:M.placement,strategy:M.strategy,modifiers:[].concat(M.modifiers,[s,{name:"applyStyles",enabled:!1}])};return bke(r.current,g)?r.current||g:(r.current=g,g)},[M.onFirstUpdate,M.placement,M.strategy,M.modifiers,s]),D=De.useRef();return Lte(function(){D.current&&D.current.setOptions(N)},[N]),Lte(function(){if(!(i==null||e==null)){var g=n.createPopper||Cke,l=g(i,e,N);return D.current=l,function(){l.destroy(),D.current=null}}},[i,e,n.createPopper]),{state:D.current?D.current.state:null,styles:u.styles,attributes:u.attributes,update:D.current?D.current.update:null,forceUpdate:D.current?D.current.forceUpdate:null}},Rke=function(){},Pke=function(){return Promise.resolve(null)},Vke=[];function Fke(t){var i=t.placement,e=i===void 0?"bottom":i,n=t.strategy,r=n===void 0?"absolute":n,M=t.modifiers,a=M===void 0?Vke:M,u=t.referenceElement,o=t.onFirstUpdate,s=t.innerRef,N=t.children,D=De.useContext(Ate),g=De.useState(null),l=g[0],j=g[1],T=De.useState(null),y=T[0],z=T[1];De.useEffect(function(){ub(s,l)},[s,l]);var A=De.useMemo(function(){return{placement:e,strategy:r,onFirstUpdate:o,modifiers:[].concat(a,[{name:"arrow",enabled:y!=null,options:{element:y}}])}},[e,r,o,a,y]),h=$te(u||D,l,A),x=h.state,O=h.styles,d=h.forceUpdate,E=h.update,C=De.useMemo(function(){return{ref:j,style:O.popper,placement:x?x.placement:e,hasPopperEscaped:x&&x.modifiersData.hide?x.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:x&&x.modifiersData.hide?x.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:O.arrow,ref:z},forceUpdate:d||Rke,update:E||Pke}},[j,z,e,x,O,E,d]);return dte(N)(C)}var $ke=process.env.NODE_ENV!=="production",Wte=function(){};if($ke){var Wke=function(i,e){var n=arguments.length;e=new Array(n>1?n-1:0);for(var r=1;r<n;r++)e[r-1]=arguments[r];var M=0,a="Warning: "+i.replace(/%s/g,function(){return e[M++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}};Wte=function(t,i,e){var n=arguments.length;e=new Array(n>2?n-2:0);for(var r=2;r<n;r++)e[r-2]=arguments[r];if(i===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");t||Wke.apply(null,[i].concat(e))}}var Bke=Wte;const Hke=sy(Bke);function Gke(t){var i=t.children,e=t.innerRef,n=De.useContext(fte),r=De.useCallback(function(M){ub(e,M),Ote(n,M)},[e,n]);return De.useEffect(function(){return function(){return ub(e,null)}},[]),De.useEffect(function(){Hke(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),dte(i)({ref:r})}const wz={primary:"_primary_1nk48_1","primary-dark":"_primary-dark_1nk48_1",secondary:"_secondary_1nk48_1","secondary-dark":"_secondary-dark_1nk48_1",infoAlert:"_infoAlert_1nk48_1",white:"_white_1nk48_1",gray:"_gray_1nk48_1","gray-dark":"_gray-dark_1nk48_1",alert:"_alert_1nk48_1","alert-light":"_alert-light_1nk48_1","alert-dark":"_alert-dark_1nk48_1",success:"_success_1nk48_1","success-dark":"_success-dark_1nk48_1","success-light":"_success-light_1nk48_1",warning:"_warning_1nk48_1","warning-dark":"_warning-dark_1nk48_1",info:"_info_1nk48_1","info-light":"_info-light_1nk48_1","bg-primary":"_bg-primary_1nk48_1","bg-primary-dark":"_bg-primary-dark_1nk48_1","bg-secondary":"_bg-secondary_1nk48_1","bg-secondary-dark":"_bg-secondary-dark_1nk48_1","bg-white":"_bg-white_1nk48_1","bg-gray":"_bg-gray_1nk48_1","bg-gray-dark":"_bg-gray-dark_1nk48_1","bg-alert":"_bg-alert_1nk48_1","bg-alert-light":"_bg-alert-light_1nk48_1","bg-alert-dark":"_bg-alert-dark_1nk48_1","bg-success":"_bg-success_1nk48_1","bg-success-dark":"_bg-success-dark_1nk48_1","bg-success-light":"_bg-success-light_1nk48_1","bg-warning":"_bg-warning_1nk48_1","bg-warning-dark":"_bg-warning-dark_1nk48_1","bg-info":"_bg-info_1nk48_1","bg-info-light":"_bg-info-light_1nk48_1",container:"_container_1nk48_5",popover:"_popover_1nk48_13",button:"_button_1nk48_21",buttonOpen:"_buttonOpen_1nk48_29",menu:"_menu_1nk48_37",barButtonContainer:"_barButtonContainer_1nk48_47",barButtonWrapper:"_barButtonWrapper_1nk48_55",searchDiv:"_searchDiv_1nk48_63",popButton:"_popButton_1nk48_71",popButton2:"_popButton2_1nk48_79",popContainer:"_popContainer_1nk48_87",popOption:"_popOption_1nk48_95",popOption2:"_popOption2_1nk48_103",tabsContainer:"_tabsContainer_1nk48_111",popperMenu:"_popperMenu_1nk48_1"},Bte=Z6([]),CD=({children:t,buttonContent:i,position:e="auto",isDisabled:n,menuWidth:r="208px",offset:M=[0,10],overFlowDetection:a=!0,tabMenu:u=!1,bgColor:o="white",autoCloseParent:s=!1,buttonWidth:N="auto",getIsOpen:D})=>{const[g,l]=De.useState(!1),j=De.useRef(null),[T,y]=De.useState(),[z,A]=De.useState(),[h,x]=De.useState(e),[,O]=fw(Bte),[d]=De.useState(Math.random().toString(36).substring(7)),[E,C]=De.useState(r),{styles:k,attributes:Q}=$te(T,z,{placement:h,modifiers:[{name:"offset",options:{offset:M}},a?{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","auto"]}}:{},{name:"preventOverflow",options:{altAxis:!0,tether:!1,padding:10}}]});De.useEffect(()=>(z&&(ele(z)||x("auto")),g&&O(Y=>Y.find(R=>R.id===d)?Y.map(R=>R.id===d?{...R,isOpen:g,setOpen:l,popperElement:z,referenceElement:T}:R):[...Y,{id:d,isOpen:g,setOpen:l,popperElement:z,referenceElement:T}]),()=>{O(Y=>Y.filter(m=>m.id!==d))}),[g,d,z,T]),De.useEffect(()=>{r==="100%"&&C(`${T==null?void 0:T.clientWidth}px`)},[T==null?void 0:T.clientWidth]),De.useEffect(()=>{D&&D(g)},[g]);const S={width:E,...k.popper};Sge({wrapRef:j,portalRef:z,autoCloseParent:s});const b=[wz[`bg-${o}`],wz.menu].join(" ");return v.jsx(v.Fragment,{children:v.jsxs("div",{className:wz.container,tabIndex:-1,ref:j,children:[v.jsx("div",{role:"button",tabIndex:0,onKeyDown:()=>{},className:`${g?wz.buttonOpen:""} ${wz.button}`,style:{width:N},onClick:()=>!n&&l(Y=>!Y),ref:y,children:i}),!n&&g?v.jsx(DL,{children:v.jsx("div",{role:"button",id:wz.popperMenu,tabIndex:0,onKeyDown:()=>{},className:wz.popover,style:S,ref:A,...Q.popper,children:v.jsx("div",{role:"button",tabIndex:0,onKeyDown:()=>{},className:b,onClick:Y=>{var R,P,W,B;const m=(W=(P=(R=Y.target.closest("[data-closepopover]"))==null?void 0:R.attributes)==null?void 0:P["data-closepopover"])==null?void 0:W.value;((B=Y.target)==null?void 0:B.tagName)!=="INPUT"&&!u&&l(!1),m&&l(!1),m==="remainOpen"&&l(!0)},children:t})})}):null]})})},Zke=({data:t,error:i,isLoading:e,previewTableDataList:n,moreTabs:r,chartColors:M,chartSettings:a,setChartSettings:u,isUpdateMetric:o=!1,isDisableSqlBtn:s,setShowSqlModal:N,isEnablePivotTable:D,groupbyList:g,hasNumberKeys:l,isEnableGauge:j,outputHeaderProps:T,metrics:y,dimensions:z,onGenerateChart:A,setMetrics:h,setColumn:x,isEnableSingleDimension:O,isEnableSingleMetrics:d,functionOptions:E,configuration:C})=>{var m;const[k,Q]=De.useState(!1),{setDropNodeRef:S,setIsEnableDrop:b}=rP({identifier:{id:"Dimensions",accepts:["column","metrics","dimensions","dimension_aggregate"]},events:{onDrop:(R,P)=>{var ee,q;const W=(ee=P.active)==null?void 0:ee.data;W.labelType=W.labelType??"dimensions",x(ie=>ie.findIndex(re=>re.value===W.value)===-1?[...ie,W]:ie);const[B,X,F,G,J]=(q=W==null?void 0:W.value)==null?void 0:q.split("____");C.dimensions.findIndex(ie=>ie.alias===W.label&&ie.labelType!=="metrics")===-1&&!W.aggregate?A({param:{...C,dimensions:[...C.dimensions,{columnName:X,alias:X,dataType:F,parentAlias:B,type:"default",timeGrain:void 0,helperFunction:void 0,labelType:W.labelType}]},metricParams:y,dimensionParams:z.findIndex(ie=>ie.value===W.value)===-1?[...z,W]:z}):A({param:{...C},metricParams:y,dimensionParams:z.findIndex(ie=>ie.value===W.value)===-1?[...z,W]:z})}},modifiers:{sorting:{isEnabled:!0,isEnabledAutoSort:!0,sortingType:"horizontal",list:z,setList:x}}}),{setDropNodeRef:Y}=rP({identifier:{id:"Metrics",accepts:["column","dimensions","metrics","metric_aggregate"]},events:{onDrop:(R,P)=>{var ee,q;const W=(ee=P.active)==null?void 0:ee.data;W.labelType=W.labelType??"metrics",h(ie=>ie.findIndex(re=>re.value===W.value)===-1?[...ie,W]:ie);const[B,X,F,G,J]=(q=W==null?void 0:W.value)==null?void 0:q.split("____");C.dimensions.findIndex(ie=>ie.alias===W.label&&ie.labelType==="metrics")===-1&&!W.aggregate?A({param:{...C,dimensions:[...C.dimensions,{columnName:X,alias:X,dataType:F,parentAlias:B,type:"default",timeGrain:void 0,helperFunction:void 0,labelType:W.labelType}]},metricParams:y.findIndex(ie=>ie.value===W.value)===-1?[...y,W]:y,dimensionParams:z}):A({param:{...C},metricParams:y.findIndex(ie=>ie.value===W.value)===-1?[...y,W]:y,dimensionParams:z})}},modifiers:{sorting:{isEnabled:!0,isEnabledAutoSort:!0,sortingType:"horizontal",list:y,setList:h}}});return v.jsxs("div",{className:`${Aa["main-container"]}`,children:[v.jsxs("div",{className:Aa.selection,children:[v.jsxs("div",{className:Aa.selectionContainer,children:[v.jsx("span",{className:Aa.selectedCol,children:v.jsx(Pe,{variant:"btn",children:"Dimensions"})}),v.jsx("div",{className:Aa.columnContainer,ref:S,children:z!=null&&z.length?v.jsx("div",{className:Aa.listContainer,children:z==null?void 0:z.map((R,P)=>{const B=E(R).filter(G=>!G5.includes(G.value)),X=R.labelType==="dimension_aggregate"?R.alias:R.label,F=R.labelType==="dimension_aggregate";return v.jsx(Mb,{modifiers:{highlightDrop:{onDrag:!0}},identifier:{id:R.value,type:R.labelType},data:R,CustomDragPreview:v.jsx("span",{className:Aa.listVal,children:X}),renderItem:G=>v.jsxs("div",{className:`${Aa.listVal} `,"data-dbn-sorting-index":P,ref:G,children:[X,v.jsx(CD,{buttonContent:v.jsx(Yt,{name:"caret-down-fill",size:"xs"}),position:"bottom-start",offset:[0,5],children:v.jsx("div",{className:"dbn-p-2",children:B==null?void 0:B.map(J=>v.jsx(Bt,{variant:"popover",className:"dbn-justify-start dbn-w-full hover:dbn-bg-gray-3 dbn-px-2 dbn-py-1",onClick:()=>{var Ne;x(se=>se.map(Ie=>Ie.value===R.value?{...Ie,labelType:"dimension_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:Ie));const[ee,q,ie,re,le]=(Ne=R==null?void 0:R.value)==null?void 0:Ne.split("____");A({param:{...C,dimensions:C.dimensions.map(se=>se.alias===(F?R.alias:R.label)?{columnName:q,alias:`${J.value.toLowerCase()} of ${R.label}`||q,dataType:ie,parentAlias:ee,type:"default",timeGrain:void 0,helperFunction:J.value,labelType:"dimension_aggregate"}:se)},metricParams:y,dimensionParams:z.map(se=>se.value===R.value?{...se,labelType:"dimension_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:se)})},children:v.jsx("span",{children:J.label})}))})}),v.jsx("span",{className:Aa.removeColumn,role:"button",tabIndex:0,onKeyDown:()=>{},onClick:()=>{x(J=>J.filter(ee=>ee.value!==R.value)),A({param:{...C,dimensions:C.dimensions.filter(J=>J.alias!==(F?R.alias:R.label))},metricParams:y,dimensionParams:z.filter(J=>J.value!==R.value)})},children:v.jsx(Yt,{name:"cross",size:"xxs"})})]})})})}):v.jsx(Pe,{variant:"body-text-sm",color:"secondary",children:"Drag and Drop your Rows here"})})]}),v.jsxs("div",{className:Aa.selectionContainer,children:[v.jsx("span",{className:Aa.selectedCol,children:v.jsx(Pe,{variant:"btn",children:"Metrics"})}),v.jsx("div",{className:Aa.columnContainer,ref:Y,children:y!=null&&y.length?v.jsx("div",{className:Aa.listContainer,children:y==null?void 0:y.map((R,P)=>{const B=E(R).filter(G=>G5.includes(G.value)),X=R.labelType==="metric_aggregate"?R.alias:R.label,F=R.labelType==="metric_aggregate";return v.jsx(Mb,{modifiers:{highlightDrop:{onDrag:!0}},identifier:{id:R.value,type:R.labelType},data:R,CustomDragPreview:v.jsx("span",{className:Aa.listVal,children:X}),renderItem:G=>v.jsxs("div",{className:Aa.listVal,"data-dbn-sorting-index":P,ref:G,children:[X,v.jsx(CD,{buttonContent:v.jsx(Yt,{name:"caret-down-fill",size:"xs"}),position:"bottom-start",offset:[0,5],children:v.jsx("div",{className:"dbn-p-2",children:B==null?void 0:B.map(J=>v.jsx(Bt,{variant:"popover",className:"dbn-justify-start dbn-w-full hover:dbn-bg-gray-3 dbn-px-2 dbn-py-1",onClick:()=>{var Ne;h(se=>se.map(Ie=>Ie.value===R.value?{value:R.value,label:R.label,labelType:"metric_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:Ie));const[ee,q,ie,re,le]=(Ne=R==null?void 0:R.value)==null?void 0:Ne.split("____");A({param:{...C,dimensions:C.dimensions.filter(se=>se.alias!==(F?R.alias:R.label)),aggregates:[...C.aggregates,{columnName:q,alias:`${J.value.toLowerCase()} of ${R.label}`||q,dataType:ie,parentAlias:ee,type:"default",method:J.value}]},metricParams:y.map((se,Ie)=>P===Ie?{...se,labelType:"metric_aggregate",aggregate:J.value,alias:`${J.value.toLowerCase()} of ${R.label}`}:se),dimensionParams:z})},children:v.jsx("span",{children:J.label})}))})}),v.jsx("span",{className:Aa.removeColumn,role:"button",tabIndex:0,onKeyDown:()=>{},onClick:()=>{h(J=>J.filter(ee=>ee.value!==R.value)),A({param:F?{...C,aggregates:C.aggregates.filter(J=>J.alias!==R.alias)}:{...C,dimensions:C.dimensions.filter(J=>J.alias!==R.label)},metricParams:y.filter(J=>J.value!==R.value),dimensionParams:z})},children:v.jsx(Yt,{name:"cross",size:"xxs"})})]})})})}):v.jsx(Pe,{variant:"body-text-sm",color:"secondary",children:"Drag and Drop your Columns here"})})]})]}),v.jsxs("div",{className:`${Aa.wrapper}`,children:[v.jsxs("div",{className:Aa.wrapperHead,children:[v.jsx("div",{className:"dbn-flex dbn-gap-4 dbn-justify-center",children:v.jsx(zn,{enabled:k,placeholder:"Table View",onChange:()=>Q(!k)})}),v.jsxs("div",{className:Aa.features,children:[v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Chart Type",children:v.jsx(Yt,{name:"bar-chart-2",size:"lg"})}),onClick:()=>T.setShowChartType(!0)}),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Filters",children:v.jsx("span",{className:t?"":"hover:dbn-cursor-not-allowed",children:v.jsx(Yt,{name:"funnel",size:"lg"})})}),onClick:()=>T.setShowFilters(!0),isDisabled:!t}),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Sort",children:v.jsx("span",{className:t?"":"hover:dbn-cursor-not-allowed",children:v.jsx(Yt,{name:"funnel-simple",size:"lg"})})}),onClick:()=>T.setShowSortPanel(!0),isDisabled:!t}),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(fs,{text:"Chart Appearance",position:"left",children:v.jsx("span",{className:t?"":"hover:dbn-cursor-not-allowed",children:v.jsx(Yt,{name:"color-palette",size:"lg"})})}),onClick:()=>T.setShowChartCustomProperties(!0),isDisabled:!t})]})]}),k?v.jsx("div",{className:Aa.tableTab,children:v.jsx(hQe,{outpuTableData:t,isOutputLoading:e,outputError:i,isUpdateMetric:o,isDisableSqlBtn:s,setShowSqlModal:N})}):v.jsx("div",{className:Aa.visualization,children:v.jsx(OQe,{chartSettings:a,setChartSettings:u,data:t,error:i,isLoading:e,chartColors:(a==null?void 0:a.chartColors)||M,isEnablePivotTable:D,groupbyList:g,hasNumberKeys:l,isEnableGauge:j,headerChild:(m=a.timeSeriesSettings)!=null&&m.groupBySettings.isDynamic?v.jsx(un,{options:a.timeSeriesSettings.groupBySettings.options.map(R=>({label:R.split("____").length>1?R.split("____")[1]:R,value:R})),onChange:R=>{var W;const P={groupBySettings:{isDynamic:!1,options:[],value:"monthly"},seriesType:((W=a.yAxisList)==null?void 0:W.map(B=>({column:B,type:"bar"})))||[]};u(B=>{var X;return{...B,timeSeriesSettings:{...B.timeSeriesSettings||P,groupBySettings:{...((X=B.timeSeriesSettings)==null?void 0:X.groupBySettings)||P.groupBySettings,value:R.value,fillXAxis:!1}}}})},selectedOption:{label:a.timeSeriesSettings.groupBySettings.value.split("____").length>1?a.timeSeriesSettings.groupBySettings.value.split("____")[1]:a.timeSeriesSettings.groupBySettings.value.toString().substring(0,1).toUpperCase()+a.timeSeriesSettings.groupBySettings.value.toString().substring(1,a.timeSeriesSettings.groupBySettings.value.length),value:a.timeSeriesSettings.groupBySettings.value},label:"group"}):void 0})})]})]})},Ib={chartPropertiesPanel:"_chartPropertiesPanel_19qfx_1",imgDiv:"_imgDiv_19qfx_5",chartContainer:"_chartContainer_19qfx_9",chartOptions:"_chartOptions_19qfx_13",chartOption:"_chartOption_19qfx_13",chartOptionBtn:"_chartOptionBtn_19qfx_21",chartOptionText:"_chartOptionText_19qfx_24",chartOptionBtnSelected:"_chartOptionBtnSelected_19qfx_27",popOption:"_popOption_19qfx_30"},Re={container:"_container_fgw0o_1","container-wrapper":"_container-wrapper_fgw0o_7",wrapper:"_wrapper_fgw0o_13",marginContainer:"_marginContainer_fgw0o_19",chartDemo:"_chartDemo_fgw0o_25",chartDemoContainer:"_chartDemoContainer_fgw0o_31",marginWrapper:"_marginWrapper_fgw0o_37",chartColors:"_chartColors_fgw0o_43",prefixSuffixContainer:"_prefixSuffixContainer_fgw0o_49",header:"_header_fgw0o_55",tabContainer:"_tabContainer_fgw0o_61",tab:"_tab_fgw0o_61",tabText:"_tabText_fgw0o_73",tabHeading:"_tabHeading_fgw0o_79",form:"_form_fgw0o_85",inputWrapper:"_inputWrapper_fgw0o_91",positionContainer:"_positionContainer_fgw0o_97",positionWrapper:"_positionWrapper_fgw0o_103",input:"_input_fgw0o_91",labelFormatTooltip:"_labelFormatTooltip_fgw0o_115",checkboxTooltip:"_checkboxTooltip_fgw0o_121",checkboxTooltipWrapper:"_checkboxTooltipWrapper_fgw0o_127",series:"_series_fgw0o_133",legendWrapper:"_legendWrapper_fgw0o_139",badgeDiv:"_badgeDiv_fgw0o_145",checkboxWrapper:"_checkboxWrapper_fgw0o_151",seriesWrapper:"_seriesWrapper_fgw0o_157",valueLabelWrapper:"_valueLabelWrapper_fgw0o_163",singleCheckBox:"_singleCheckBox_fgw0o_169",seriesCheck:"_seriesCheck_fgw0o_175",seriesCheckContainer:"_seriesCheckContainer_fgw0o_181",fieldDescription:"_fieldDescription_fgw0o_189",xSmallFont:"_xSmallFont_fgw0o_197",addNewRuleBtn:"_addNewRuleBtn_fgw0o_205",formattingContainer:"_formattingContainer_fgw0o_213",condtionRule:"_condtionRule_fgw0o_221",ruleContainer:"_ruleContainer_fgw0o_229",gradientContainer:"_gradientContainer_fgw0o_237",labelStyle:"_labelStyle_fgw0o_245",accordionHeader:"_accordionHeader_fgw0o_253",comparisonValueWrapper:"_comparisonValueWrapper_fgw0o_261",comparisonValueContainer:"_comparisonValueContainer_fgw0o_269",positionButtonContainer:"_positionButtonContainer_fgw0o_279",positionButtonAlt:"_positionButtonAlt_fgw0o_285",positionButtonWrapper:"_positionButtonWrapper_fgw0o_291",positionButton:"_positionButton_fgw0o_279"},Hte=({val:t,onClick:i})=>v.jsx("div",{className:Re.positionButtonContainer,children:v.jsxs("div",{className:Re.positionButtonAlt,children:[v.jsxs("div",{className:Re.positionButtonWrapper,children:[v.jsx("span",{className:`${Re.positionButton} ${t==="top-left"?"dbn-bg-black":""}`,onClick:()=>i("top-left")}),v.jsx("span",{className:`${Re.positionButton} ${t==="top-center"?"dbn-bg-black":""}`,onClick:()=>i("top-center")}),v.jsx("span",{className:`${Re.positionButton} ${t==="top-right"?"dbn-bg-black":""}`,onClick:()=>i("top-right")})]}),v.jsxs("div",{className:Re.positionButtonWrapper,children:[v.jsx("span",{className:`${Re.positionButton} ${t==="left-center"?"dbn-bg-black":""}`,onClick:()=>i("left-center")}),v.jsx("span",{className:`${Re.positionButton} ${t==="right-center"?"dbn-bg-black":""}`,onClick:()=>i("right-center")})]}),v.jsxs("div",{className:Re.positionButtonWrapper,children:[v.jsx("span",{className:`${Re.positionButton} ${t==="bottom-left"?"dbn-bg-black":""}`,onClick:()=>i("bottom-left")}),v.jsx("span",{className:`${Re.positionButton} ${t==="bottom-center"?"dbn-bg-black":""}`,onClick:()=>i("bottom-center")}),v.jsx("span",{className:`${Re.positionButton} ${t==="bottom-right"?"dbn-bg-black":""}`,onClick:()=>i("bottom-right")})]})]})}),Cz={timeSeriesSettingsContainer:"_timeSeriesSettingsContainer_117pu_1",timeSeriesSettingsType:"_timeSeriesSettingsType_117pu_5",label:"_label_117pu_9",dynamicFormat:"_dynamicFormat_117pu_13",wrapper:"_wrapper_117pu_16",inputWrapper:"_inputWrapper_117pu_19"},Jke=[{value:"line",label:"line"},{value:"bar",label:"bar"},{value:"area",label:"area"},{value:"stack",label:"stack"}],pv=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"yearly",label:"Yearly"},{value:"quarterly",label:"Quarterly"}],Xke=({onChange:t,settings:{groupBySettings:i,seriesType:e},yAxisList:n})=>{var M,a;const r=(u,o)=>{i.options[u].split("____").length?(i.options[u]=`${i.options[u].split("____")[0]}____${o}`,i.value=`${i.options[u].split("____")[0]}____${o}`):(i.options[u]=`${i.options[u]}____${o}`,i.value=`${i.options[u]}____${o}`)};return De.useEffect(()=>{(i.isDynamic||[Ns.daily,Ns.weekly,Ns.yearly].includes(i.value))&&t(u=>({...u,groupBySettings:{...u.groupBySettings,fillXAxis:!1}}))}),v.jsxs("div",{className:Cz.timeSeriesSettingsContainer,children:[v.jsxs("div",{className:Cz.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Series type"}),v.jsx(un,{options:Jke,selectedOption:{value:((M=e==null?void 0:e[0])==null?void 0:M.type)||"bar",label:((a=e==null?void 0:e[0])==null?void 0:a.type)||"bar"},onChange:u=>{t(o=>({...o,seriesType:n.map(s=>({column:s,type:u.value}))}))}})]}),v.jsx(Pe,{variant:"label",children:"Group format"}),v.jsxs("div",{className:Cz.timeSeriesSettingsType,children:[v.jsx(QMe,{type:"radio",onChange:({target:{checked:u}})=>u&&t(o=>({...o,groupBySettings:{...o.groupBySettings,value:"monthly",isDynamic:!1,options:pv.map(s=>s.value)}})),name:"isDynamic",label:"default",defaultChecked:!i.isDynamic}),v.jsx(QMe,{type:"radio",name:"isDynamic",label:"dynamic",checked:i.isDynamic,defaultChecked:i.isDynamic,onChange:({target:{checked:u}})=>u&&t(o=>({...o,groupBySettings:{...o.groupBySettings,value:"monthly",isDynamic:!0,options:pv.map(s=>s.value)}}))})]}),i.isDynamic?v.jsxs("div",{className:Cz.dynamicFormat,children:[v.jsx(fl,{buttonWidth:"100%",menuWidth:"100%",options:pv,selectedOption:i.options.map(u=>u.split("____").length?{value:u.split("____")[0],label:u.split("____")[0]}:{value:u,label:u}),label:"Dynamic options",onChange:u=>t(o=>({...o,groupBySettings:{...o.groupBySettings,value:Array.isArray(u)&&u.length?u[0].value:"monthly",options:u.map(s=>s.value)||["monthly"]}})),isShowSelectedOptions:!0}),i.options.map((u,o)=>v.jsxs("div",{className:"dbn-flex dbn-flex-row dbn-justify-between",children:[v.jsx(Pe,{variant:"heading",children:u.split("____").length>1?u.split("____")[0]:u}),v.jsx("div",{className:Cz.inputWrapper,children:v.jsx(yi,{type:"text",value:u.split("____").length>1?u.split("____")[1]:u,placeholder:"Save as",onChange:s=>{r(o,s.target.value)}})})]}))]}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Cz.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Format type"}),v.jsx(un,{options:pv,selectedOption:{value:i.value||"",label:i.value||""},onChange:u=>t(o=>({...o,groupBySettings:{...o.groupBySettings,value:u.value}}))})]}),[Ns.month,Ns.quarter].includes(i.value)&&v.jsxs("div",{className:Cz.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Fill X-axis"}),v.jsx(zn,{name:"fill axis",enabled:i.fillXAxis,onChange:()=>t(u=>({...u,groupBySettings:{...u.groupBySettings,fillXAxis:!u.groupBySettings.fillXAxis}}))})]})]})]})},Kke=t=>{const i=[Se.pie,Se.doughnut,Se.rose,Se.funnel,Se.sankey].includes(t)?[{label:"Outside",value:"outside"},{label:"Inside",value:"inside"},{label:"Hidden",value:"hidden"}]:[{label:"Hidden",value:"hidden"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"},{label:"Right",value:"right"},{label:"Left",value:"left"},{label:"Inside",value:"inside"}];return t===Se.sankey&&i.push({label:"Right",value:"right"},{label:"Left",value:"left"}),i},qke=({chartSettings:t,setChartSettings:i,setBarRadius:e,comparisonLagProps:n,setResetPallete:r})=>{var Q,S,b,Y,m,R,P,W,B,X,F,G,J,ee,q,ie,re,le,Ne,se,Ie,Oe,ye,$e,Ve,Ee,Te,fe,Qe,ot,rt,ke,et,xe,Dt,ve,pt,Ct,dt,Zt,$t,Mt,It,We,Tt,He,jt,lt,kt,ii,gi,ht,Et,ai,Dn,Tr,eM,dr,Or,ha,WM,Ya,BM,ba,TM,OM,IM,Le,Lt,Wt,Xt,Ji,Ki,qi,Si,Vr,Mr,ar,hr,_a,ko,xn,ws,La,nn,Ra,Lu,HM,xu,wM,NN,hM,sN,DN,Ku,Uo,aa,ua,yM,pu,Eu,vu,mo,qu,Xa,Cs,xa,An,pa,eo,Yo,Mn,bo,_o,Vi,to,Lr,Fr,zM,Su,gr,Pn,Ro,CM,tM,Ea,gN,GM,Ka,VN,oa,wu,Ae,Ue,ft,Ht,Qn,Ri,Jn,vr,Xn,ae,de,Ge,Ke,xt,ri,_t,li,Hi,fn,Vn,kn,lr,Ir,pn,io,FN,Qs,_g,qa,ks,Us,Rg,Sj,wj,Pg,Vg,ec,tc,ic,Fg,no,Cj,$g,bD,Wg,Qj,_D,nc,Na,ro,uM,eu,lN,RD,rc,$N,Mc,ac;const M=()=>{const Me=[...t.chartColors||[]];for(let ue=Me.length-1;ue>0;ue--){const Nt=Math.floor(Math.random()*(ue+1));[Me[ue],Me[Nt]]=[Me[Nt],Me[ue]]}i(ue=>({...ue,chartColors:Me}))},[a,u]=De.useState(!1),[o,s]=De.useState(!1),[N,D]=De.useState(""),[g,l]=De.useState({backgrounColor:"#FFFFFF",color:"#000000",columnName:((Q=t.yAxisList)==null?void 0:Q[0])||"",operator:Qx[0].value,value:""}),[j,T]=De.useState({startColor:"#FFFFFF",endColor:"#000000",offset1:.5,offset2:.05,direction:"left",isRadial:!1}),y=De.useMemo(()=>{var Me;return(Me=t==null?void 0:t.yAxisList)==null?void 0:Me.filter(ue=>{var Nt,zi;return!((zi=(Nt=t.tableSettings)==null?void 0:Nt.listColumns)!=null&&zi.includes(ue))})},[(S=t.tableSettings)==null?void 0:S.listColumns,t.yAxisList]),z=De.useMemo(()=>(y==null?void 0:y.map(Me=>({value:Me,label:Me})))||[],[y]),A=De.useMemo(()=>{var Me;return(Me=t==null?void 0:t.yAxisList)==null?void 0:Me.filter(ue=>{var Nt,zi;return!((zi=(Nt=t.tableSettings)==null?void 0:Nt.badgeColumns)!=null&&zi.includes(ue))})},[(b=t.tableSettings)==null?void 0:b.badgeColumns,t.yAxisList]),h=De.useMemo(()=>(A==null?void 0:A.map(Me=>({value:Me,label:Me})))||[],[A]);De.useEffect(()=>{if(t.yAxisList!==void 0){const Me=t.yAxisList.map((ue,Nt)=>{var zi,dn,Nn,gM,QM,Pa;return{name:ue,prefix:((Nn=(dn=(zi=t.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn[Nt])==null?void 0:Nn.prefix)||"",suffix:((Pa=(QM=(gM=t.customSettings)==null?void 0:gM.comboAxisSymbols)==null?void 0:QM[Nt])==null?void 0:Pa.suffix)||""}});i(ue=>({...ue,customSettings:{...ue.customSettings,comboAxisSymbols:Me}}))}},[t.yAxisList]);const x=()=>{var Me;if(j.startColor&&j.endColor&&j.offset1&&j.offset2&&j.direction){const ue=((Me=t.customSettings)==null?void 0:Me.gradients)||[];i(Nt=>({...Nt,customSettings:{...t.customSettings,gradients:[...ue,{startColor:j.startColor,endColor:j.endColor,offset1:j.offset1,offset2:j.offset2,direction:j.direction,isRadial:j.isRadial}]}})),s(!1)}},O=()=>{var Me;D(""),g.backgrounColor&&g.color&&g.columnName&&g.operator&&g.value?(i(ue=>{var QM,Pa,WN;const{tableSettings:Nt}=ue,zi=((QM=Nt==null?void 0:Nt.conditionalFormatting)==null?void 0:QM.filter(cN=>cN.columnName!==g.columnName))||[],Nn=[...((WN=(Pa=Nt==null?void 0:Nt.conditionalFormatting)==null?void 0:Pa.find(cN=>cN.columnName===g.columnName))==null?void 0:WN.rules)||[],{operator:g.operator,styles:{backgroundColor:g.backgrounColor,color:g.color},value:g.value}],gM=[...zi,{columnName:g.columnName,rules:Nn}];return{...ue,tableSettings:{...Nt,conditionalFormatting:gM}}}),l({backgrounColor:"#FFFFFF",color:"#000000",columnName:((Me=t.yAxisList)==null?void 0:Me[0])||"",operator:Qx[0].value,value:""}),u(!1)):D("please add valid values for rule")},d=De.useCallback(Me=>{const ue=(z==null?void 0:z.map(Nt=>Nt.value))||[];i(Nt=>({...Nt,tableSettings:{...t.tableSettings,badgeColumns:Me.filter(zi=>zi&&zi!=="NONE"&&ue.includes(zi))}}))},[z,t.tableSettings,i]),E=De.useCallback(Me=>{const ue=(h==null?void 0:h.map(Nt=>Nt.value))||[];i(Nt=>({...Nt,tableSettings:{...t.tableSettings,listColumns:Me.filter(zi=>zi&&zi!=="NONE"&&ue.includes(zi))}}))},[h,t.tableSettings,i]),C=Me=>{i(ue=>{var dn;const{customSettings:Nt}=ue,zi=(dn=Nt==null?void 0:Nt.gradients)==null?void 0:dn.filter(Nn=>Nn.startColor!==Me.startColor||Nn.endColor!==Me.endColor||Nn.offset1!==Me.offset1||Nn.offset2!==Me.offset2||Nn.direction!==Me.direction);return{...ue,customSettings:{...Nt,gradients:zi}}})},k=(Me,ue)=>{i(Nt=>{var Nn;const{tableSettings:zi}=Nt,dn=(Nn=zi==null?void 0:zi.conditionalFormatting)==null?void 0:Nn.map(gM=>{if(gM.columnName===Me){const QM=gM.rules.filter(Pa=>!(Pa.operator===ue.operator&&Pa.value===ue.value));return{...gM,rules:QM}}return gM});return{...Nt,tableSettings:{...zi,conditionalFormatting:dn==null?void 0:dn.filter(gM=>gM.rules.length>0)}}})};return t.chartType===Se.singleValue?v.jsxs("div",{className:Re.container,children:[v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Single Value Chart Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,fontSize:parseInt(Me.target.value,10)}})),value:(Y=t.customSettings)==null?void 0:Y.fontSize})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Single Value Suffix"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,singleValueSuffix:Me.target.value}})),value:(m=t.customSettings)==null?void 0:m.singleValueSuffix})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Single value prefix"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,singleValuePrefix:Me.target.value}})),value:(R=t.customSettings)==null?void 0:R.singleValuePrefix})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Customise Sub-Header"}),v.jsx(zn,{name:"show sub header",enabled:(P=t.customSettings)==null?void 0:P.subHeaderShow,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,subHeaderShow:!((ue=Me.customSettings)!=null&&ue.subHeaderShow)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Font Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"color",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,singleValueFontColor:Me}})),defaultValue:"#000000",value:((W=t.customSettings)==null?void 0:W.singleValueFontColor)||"#000000"})})]}),((B=t.customSettings)==null?void 0:B.subHeaderShow)&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Sub-Header Display Text"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",placeholder:"Enter the text here",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,displayText:Me.target.value}})),value:t.customSettings.displayText})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Sub-Header Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,subHeaderFontSize:parseInt(Me.target.value,10)}})),value:t.customSettings.subHeaderFontSize})})]})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Number Formatting"}),v.jsx(un,{selectedOption:{value:((X=t.customSettings)==null?void 0:X.numberFormatter)||"original",label:((F=t.customSettings)==null?void 0:F.numberFormatter)||"original"},options:J7,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,numberFormatter:Me.value}})),buttonWidth:"150px",menuWidth:"250px"})]})]}),n&&v.jsx(vs,{header:v.jsxs("div",{className:Re.accordionHeader,children:[v.jsx(Pe,{variant:"heading",children:"Comparison Value"}),v.jsx(nb,{text:"Comparison Value",position:"top",tooltipClass:"dbn-w-[200px]"})]}),headerButton:v.jsx("div",{className:Re.wrapper,children:v.jsx(zn,{name:"Comparison value",enabled:(G=t.customSettings)==null?void 0:G.comparisonValueShow,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,comparisonValueShow:!((ue=Me.customSettings)!=null&&ue.comparisonValueShow)}}})})}),content:v.jsx("div",{className:Re.comparisonValueWrapper,children:v.jsxs("div",{className:Re.comparisonValueContainer,children:[v.jsx(un,{onChange:Me=>{n.setComparisonLagSettings(ue=>({...ue,column:Me}))},selectedOption:n.comparisonLagSettings.column,options:n.dateTimeColumnList,isDisabled:!n.dateTimeColumnList.length,labelVariant:"static",buttonWidth:"320px",menuWidth:"320px",label:"Time Column"}),v.jsx(un,{onChange:Me=>{n.setComparisonLagSettings(ue=>({...ue,timeGrain:Me}))},selectedOption:n.comparisonLagSettings.timeGrain,options:zse,isDisabled:!n.comparisonLagSettings.column,labelVariant:"static",label:"Time Grain",buttonWidth:"320px",menuWidth:"320px"}),v.jsx(yi,{label:"Comparison Period lag",min:1,type:"number",placeholder:"period lag",onChange:({target:{value:Me}})=>n.setComparisonLagSettings(ue=>({...ue,periodLag:parseInt(Me,10)})),value:n.comparisonLagSettings.periodLag}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Comparison suffix"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",placeholder:"enter comparison suffix",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,comparisonSuffix:Me.target.value}})),value:(J=t.customSettings)==null?void 0:J.comparisonSuffix})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Comparison Value Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,comparisonValueFontSize:parseInt(Me.target.value,10)}})),value:(ee=t.customSettings)==null?void 0:ee.comparisonValueFontSize})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show Trendline"}),v.jsx(zn,{name:"show trendline",enabled:(q=t.customSettings)==null?void 0:q.isShowTrendLine,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,isShowTrendLine:!((ue=Me.customSettings)!=null&&ue.isShowTrendLine)}}})})]}),v.jsx(Bt,{variant:"primary",isDisabled:!n.dateTimeColumnList.length||!n.comparisonLagSettings.column.value||n.comparisonLagSettings.periodLag<=0||!n.comparisonLagSettings.timeGrain.value,onClick:()=>n.onSaveComparisonLag(),children:"save"})]})})})]}):t.chartType===Se.table||t.chartType===Se.horizontalStackTable?v.jsxs("div",{className:Re.container,children:[v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Table content Alignment"}),v.jsx(un,{selectedOption:{value:((ie=t.tableSettings)==null?void 0:ie.contentAlignment)||"",label:((re=t.tableSettings)==null?void 0:re.contentAlignment)||""},options:[{label:"Left Aligned",value:"left"},{label:"Right Aligned",value:"right"},{label:"Center Aligned",value:"center"}],onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,contentAlignment:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Table line gap"}),v.jsx(un,{selectedOption:{value:((le=t.tableSettings)==null?void 0:le.lineGap)||"small",label:((Ne=t.tableSettings)==null?void 0:Ne.lineGap)||"small"},options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,lineGap:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Table Title"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,tableTitle:Me.target.value}})),value:(se=t.tableSettings)==null?void 0:se.tableTitle,placeholder:"Enter the title here"})})]}),t.chartType===Se.horizontalStackTable?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Stacked column alias"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,stackColAlias:Me.target.value}})),value:(Ie=t.tableSettings)==null?void 0:Ie.stackColAlias,placeholder:"Enter the title here"})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show labels"}),v.jsx(zn,{name:"show stack labels",enabled:(Oe=t.customSettings)==null?void 0:Oe.showStackLabels,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showStackLabels:!((ue=Me.customSettings)!=null&&ue.showStackLabels)}}})})]})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"List Columns"}),v.jsx("div",{className:"dbn-w-[200px] dbn-flex dbn-justify-end",children:v.jsx(fl,{buttonWidth:"150px",menuWidth:"150px",options:h,onChange:Me=>E(Me.map(ue=>ue.value)),selectedOption:(($e=(ye=t.tableSettings)==null?void 0:ye.listColumns)==null?void 0:$e.map(Me=>({value:Me,label:Me})))||[]})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"List separator"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,listSeparator:Me.target.value}})),value:(Ve=t.tableSettings)==null?void 0:Ve.listSeparator,placeholder:"Enter a separator for list"})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Badge Columns"}),v.jsx("div",{className:"dbn-w-[200px] dbn-flex dbn-justify-end",children:v.jsx(fl,{buttonWidth:"150px",menuWidth:"150px",options:z,onChange:Me=>{d(Me.map(ue=>ue.value))},selectedOption:((Te=(Ee=t.tableSettings)==null?void 0:Ee.badgeColumns)==null?void 0:Te.map(Me=>({value:Me,label:Me})))||[]})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Badge separator"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,badgeSeparator:Me.target.value}})),value:(fe=t.tableSettings)==null?void 0:fe.badgeSeparator,placeholder:"Enter a separator for badges"})})]}),(ot=(Qe=t.tableSettings)==null?void 0:Qe.badgeColumns)==null?void 0:ot.map(Me=>{var ue,Nt,zi,dn;return v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"heading",children:Me}),v.jsxs("div",{className:Re.badgeDiv,children:[v.jsx(Ss,{name:"Badge color",onChange:Nn=>i(gM=>{var QM;return{...gM,tableSettings:{...gM.tableSettings,badgeColors:{...(QM=gM.tableSettings)==null?void 0:QM.badgeColors,[Me]:Nn}}}}),defaultValue:"#f3f4f6",value:((Nt=(ue=t.tableSettings)==null?void 0:ue.badgeColors)==null?void 0:Nt[Me])||"#f3f4f6",label:"Badge color"}),v.jsx(Ss,{name:"Text color",onChange:Nn=>i(gM=>{var QM;return{...gM,tableSettings:{...gM.tableSettings,badgeTextColors:{...(QM=gM.tableSettings)==null?void 0:QM.badgeTextColors,[Me]:Nn}}}}),defaultValue:"#000000",value:((dn=(zi=t.tableSettings)==null?void 0:zi.badgeTextColors)==null?void 0:dn[Me])||"#000000",label:"Text color"})]})]})}),t.chartType===Se.table?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Default Row Size"}),v.jsx(un,{selectedOption:{value:((rt=t.tableSettings)==null?void 0:rt.defaultRowSize)||"",label:((ke=t.tableSettings)==null?void 0:ke.defaultRowSize)||""},options:sd,onChange:Me=>i(ue=>({...ue,tableSettings:{...ue.tableSettings,defaultRowSize:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Server Side Pagination"}),v.jsx(zn,{name:"pagination",enabled:(et=t.tableSettings)==null?void 0:et.isServerSidePagination,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,isServerSidePagination:!((ue=Me.tableSettings)!=null&&ue.isServerSidePagination)}}})})]})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Vertical Divider"}),v.jsx(zn,{name:"vertical divider",enabled:(xe=t.tableSettings)==null?void 0:xe.hideVerticalDivider,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,hideVerticalDivider:!((ue=Me.tableSettings)!=null&&ue.hideVerticalDivider)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Horizontal Divider"}),v.jsx(zn,{name:"horizontal divider",enabled:(Dt=t.tableSettings)==null?void 0:Dt.hideHorizontalDivider,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,hideHorizontalDivider:!((ue=Me.tableSettings)!=null&&ue.hideHorizontalDivider)}}})})]}),t.chartType===Se.horizontalStackTable?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Table Search"}),v.jsx(zn,{name:"table search",enabled:(ve=t.tableSettings)==null?void 0:ve.enableTableSearch,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableTableSearch:!((ue=Me.tableSettings)!=null&&ue.enableTableSearch)}}})})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Striped Rows"}),v.jsx(zn,{name:"striped rows",enabled:(pt=t.tableSettings)==null?void 0:pt.enableStripedRows,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableStripedRows:!((ue=Me.tableSettings)!=null&&ue.enableStripedRows)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Show Row Hover"}),v.jsx(zn,{name:"row hover",enabled:(Ct=t.tableSettings)==null?void 0:Ct.showRowHover,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,showRowHover:!((ue=Me.tableSettings)!=null&&ue.showRowHover)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Header Font Bold"}),v.jsx(zn,{name:"header font bold",enabled:(dt=t.tableSettings)==null?void 0:dt.headerFontBold,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,headerFontBold:!((ue=Me.tableSettings)!=null&&ue.headerFontBold)}}})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"UI Style"}),headerButton:null}),t.chartType===Se.table?v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Show Table Title"}),v.jsx(zn,{name:"table title",enabled:(Zt=t.tableSettings)==null?void 0:Zt.showTableTitle,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,showTableTitle:!((ue=Me.tableSettings)!=null&&ue.showTableTitle)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Table Header"}),v.jsx(zn,{name:"hide table header",enabled:($t=t.tableSettings)==null?void 0:$t.hideTableHeader,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,hideTableHeader:!((ue=Me.tableSettings)!=null&&ue.hideTableHeader)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Table Search"}),v.jsx(zn,{name:"table search",enabled:(Mt=t.tableSettings)==null?void 0:Mt.enableTableSearch,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableTableSearch:!((ue=Me.tableSettings)!=null&&ue.enableTableSearch)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable Sorting"}),v.jsx(zn,{name:"sorting",enabled:(It=t.tableSettings)==null?void 0:It.enableSorting,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,enableSorting:!((ue=Me.tableSettings)!=null&&ue.enableSorting)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Disable Pagination"}),v.jsx(zn,{name:"disable pagination",enabled:(We=t.tableSettings)==null?void 0:We.disablePagination,onChange:()=>i(Me=>{var ue;return{...Me,tableSettings:{...Me.tableSettings,disablePagination:!((ue=Me.tableSettings)!=null&&ue.disablePagination)}}})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Features"}),headerButton:null}):null,v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsx(Pe,{variant:"label",children:"You can add rules to make the cells in this table change color if they meet certain conditions."}),!a&&v.jsx(Bt,{variant:"secondary",onClick:()=>u(!0),leftIcon:v.jsx(Yt,{name:"plus"}),fitContainer:!0,children:"Add New Rule"}),a&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Columns"}),v.jsx(un,{options:((Tt=t.yAxisList)==null?void 0:Tt.map(Me=>({value:Me,label:Me})))||[],selectedOption:{value:g.columnName||"",label:g.columnName||""},onChange:Me=>l(ue=>({...ue,columnName:Me.value}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Condition"}),v.jsx(un,{options:Qx,selectedOption:{value:g.operator||"",label:g.operator||""},onChange:Me=>l(ue=>({...ue,operator:Me.value}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Value"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",onChange:({target:{value:Me}})=>l(ue=>({...ue,value:Number(Me)||Number(Me)===0?Number(Me):Me}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Background color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"background color",onChange:Me=>l(ue=>({...ue,backgrounColor:Me})),defaultValue:"#FFFFFF",value:g.backgrounColor})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Text color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"text color",onChange:Me=>l(ue=>({...ue,color:Me})),defaultValue:"#000000",value:g.color})})]}),N&&v.jsx(v9,{text:N,variant:"error"}),v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-justify-between",children:[v.jsx(Bt,{variant:"secondary",onClick:()=>u(!1),children:"Cancel"}),v.jsx(Bt,{variant:"primary",type:"button",onClick:()=>O(),children:"Save Rule"})]})]}),(jt=(He=t.tableSettings)==null?void 0:He.conditionalFormatting)==null?void 0:jt.map(Me=>v.jsx("div",{className:Re.formattingContainer,children:v.jsx("div",{className:Re.ruleContainer,children:Me.rules.map(ue=>{var Nt;return v.jsxs("div",{className:"dbn-flex dbn-gap-1 dbn-justify-between",children:[v.jsxs("div",{className:"dbn-flex dbn-gap-1",children:[v.jsx(Pe,{variant:"body-text-sm",children:Me.columnName}),v.jsx(Pe,{variant:"body-text-sm",children:(Nt=Qx.find(zi=>zi.value===ue.operator))==null?void 0:Nt.label}),v.jsx(Pe,{variant:"body-text-sm",children:v.jsx("span",{style:{backgroundColor:ue.styles.backgroundColor,color:ue.styles.color},className:"dbn-px-1",children:ue.value})})]}),v.jsx(Bt,{variant:"popover",className:"dbn-flex dbn-gap-1",onClick:()=>k(Me.columnName,ue),rightIcon:v.jsx(Yt,{name:"cross"})},ue.value)]})})})},Me.columnName))]}),header:v.jsx(Pe,{variant:"heading",children:"Conditional Formatting"}),headerButton:null})]}):v.jsx(v.Fragment,{children:v.jsxs("div",{className:Re.container,children:[![Se.pie,Se.doughnut,Se.rose,Se.gauge,Se.sankey].includes(t.chartType)&&v.jsxs(v.Fragment,{children:[v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Line"}),v.jsx(zn,{name:"X-axis line",enabled:(lt=t.customSettings)==null?void 0:lt.hideXAxisLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideXAxisLines:!((ue=Me.customSettings)!=null&&ue.hideXAxisLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Splitlines"}),v.jsx(zn,{name:"X-axis splitlines",enabled:(kt=t.customSettings)==null?void 0:kt.hideXSplitLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideXSplitLines:!((ue=Me.customSettings)!=null&&ue.hideXSplitLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Labels"}),v.jsx(zn,{name:"X-axis labels",enabled:(ii=t.customSettings)==null?void 0:ii.hideXAxisLabels,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideXAxisLabels:!((ue=Me.customSettings)!=null&&ue.hideXAxisLabels)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Truncate Label"}),v.jsx(zn,{name:"truncate label",enabled:(gi=t.labelSettings)==null?void 0:gi.truncateLabel,onChange:()=>i(Me=>{var ue;return{...Me,labelSettings:{...Me.labelSettings,truncateLabel:!((ue=Me.labelSettings)!=null&&ue.truncateLabel)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Rotation"}),v.jsx(un,{buttonWidth:"150px",isSearchEnabled:!0,menuWidth:"150px",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,xRotation:parseInt(Me.value,10)}})),options:[{icon:"text-rotation-none",label:"0",value:"0"},{icon:"text-rotation-angle-up",label:"45",value:"45"},{icon:"text-rotation-up",label:"90",value:"90"}],searchPlaceholder:"0",selectedOption:{icon:"text-rotation-none",label:((Et=(ht=t.customSettings)==null?void 0:ht.xRotation)==null?void 0:Et.toString())||"0",value:((Dn=(ai=t.customSettings)==null?void 0:ai.xRotation)==null?void 0:Dn.toString())||"0"}})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Custom label rotation"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",value:(Tr=t.customSettings)==null?void 0:Tr.customRotation,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,customRotation:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Truncate Label Value"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",value:(eM=t.labelSettings)==null?void 0:eM.truncateLabelValue,isDisabled:!((dr=t.labelSettings)!=null&&dr.truncateLabel),onChange:Me=>i(ue=>({...ue,labelSettings:{...ue.labelSettings,truncateLabelValue:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(ha=(Or=t.labelSettings)==null?void 0:Or.XAxisStyle)==null?void 0:ha.size,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,size:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Family"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",value:(Ya=(WM=t.labelSettings)==null?void 0:WM.XAxisStyle)==null?void 0:Ya.family,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,family:Me.target.value}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Weight"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(ba=(BM=t.labelSettings)==null?void 0:BM.XAxisStyle)==null?void 0:ba.weight,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,weight:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"color",onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,XAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.XAxisStyle,color:Me}}}})},defaultValue:"#000000",value:((OM=(TM=t.labelSettings)==null?void 0:TM.XAxisStyle)==null?void 0:OM.color)||"#000000"})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Horizontal Axis"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Line"}),v.jsx(zn,{name:"Y-axis line",enabled:(IM=t.customSettings)==null?void 0:IM.hideYAxisLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideYAxisLines:!((ue=Me.customSettings)!=null&&ue.hideYAxisLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Splitlines"}),v.jsx(zn,{name:"Y-axis splitlines",enabled:(Le=t.customSettings)==null?void 0:Le.hideYSplitLines,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideYSplitLines:!((ue=Me.customSettings)!=null&&ue.hideYSplitLines)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Hide Axis Labels"}),v.jsx(zn,{name:"Y-axis labels",enabled:(Lt=t.customSettings)==null?void 0:Lt.hideYAxisLabels,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideYAxisLabels:!((ue=Me.customSettings)!=null&&ue.hideYAxisLabels)}}})})]}),![Se.pie,Se.doughnut,Se.funnel,Se.gauge,Se.sankey,Se.singleValue,Se.table].includes(t.chartType)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Axis Position"}),v.jsx(un,{selectedOption:{value:((Wt=t.axisSettings)==null?void 0:Wt.axis)||"left",label:((Xt=t.axisSettings)==null?void 0:Xt.axis)||"left"},options:[{label:"left",value:"left"},{label:"right",value:"right"}],onChange:Me=>i(ue=>({...ue,axisSettings:{...ue.axisSettings,axis:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Size"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(Ki=(Ji=t.labelSettings)==null?void 0:Ji.YAxisStyle)==null?void 0:Ki.size,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,size:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Family"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",value:(Si=(qi=t.labelSettings)==null?void 0:qi.YAxisStyle)==null?void 0:Si.family,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,family:Me.target.value}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Font Weight"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,value:(Mr=(Vr=t.labelSettings)==null?void 0:Vr.YAxisStyle)==null?void 0:Mr.weight,onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,weight:parseInt(Me.target.value,10)}}}})}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(Ss,{name:"color",onChange:Me=>{i(ue=>{var Nt;return{...ue,labelSettings:{...ue.labelSettings,YAxisStyle:{...(Nt=t.labelSettings)==null?void 0:Nt.YAxisStyle,color:Me}}}})},defaultValue:"#000000",value:((hr=(ar=t.labelSettings)==null?void 0:ar.YAxisStyle)==null?void 0:hr.color)||"#000000"})})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Vertical Axis"}),headerButton:null})]}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsx(Hte,{val:(_a=t.legendSettings)==null?void 0:_a.fixedPosition,onClick:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,fixedPosition:Me}}))}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Customize legend"}),v.jsx(zn,{name:"customise",enabled:(ko=t.legendSettings)==null?void 0:ko.customise,onChange:()=>i(Me=>{var ue;return{...Me,legendSettings:{...Me.legendSettings,customise:!((ue=Me.legendSettings)!=null&&ue.customise)}}})})]}),(xn=t.legendSettings)!=null&&xn.customise?v.jsxs("div",{className:Re.positionContainer,children:[v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-top",size:"xl"}),v.jsx(yi,{type:"number",value:(ws=t.legendSettings)==null?void 0:ws.top,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,top:parseInt(Me.target.value,10)}}))})]}),v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-bottom",size:"xl"}),v.jsx(yi,{type:"number",value:(La=t.legendSettings)==null?void 0:La.bottom,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,bottom:parseInt(Me.target.value,10)}}))})]}),v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-left",size:"xl"}),v.jsx(yi,{type:"number",value:(nn=t.legendSettings)==null?void 0:nn.left,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,left:parseInt(Me.target.value,10)}}))})]}),v.jsxs("div",{className:Re.positionWrapper,children:[v.jsx(Yt,{name:"align-right",size:"xl"}),v.jsx(yi,{type:"number",value:(Ra=t.legendSettings)==null?void 0:Ra.right,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,right:parseInt(Me.target.value,10)}}))})]})]}):null,v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Legend Appearance"}),v.jsx(un,{selectedOption:{value:((Lu=t.legendSettings)==null?void 0:Lu.position)||"horizontal",label:((HM=t.legendSettings)==null?void 0:HM.position)||"horizontal"},options:[{label:"horizontal",value:"horizontal"},{label:"vertical",value:"vertical"}],onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,position:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Truncate Legend"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",value:(xu=t.legendSettings)==null?void 0:xu.truncateLegendValue,onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,truncateLegendValue:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Legend Shape"}),v.jsx(un,{selectedOption:{value:((wM=t.legendSettings)==null?void 0:wM.legendShape)||"rectangle",label:((NN=t.legendSettings)==null?void 0:NN.legendShape)||"rectangle"},options:[{label:"Circle",value:"circle"},{label:"Rectangle",value:"rect"},{label:"Rounded rectangle",value:"roundRect"},{label:"Triangle",value:"triangle"},{label:"Diamond",value:"diamond"},{label:"Arrow",value:"arrow"},{label:"none",value:"none"}],onChange:Me=>i(ue=>({...ue,legendSettings:{...ue.legendSettings,legendShape:Me.value}})),buttonWidth:"150px",menuWidth:"200px"})]}),[Se.bar,Se.line,Se.stack,Se.timeSeries].includes(t.chartType)&&t.isMultiDimension&&((hM=t.timeSeriesSettings)==null?void 0:hM.groupBySettings.value)!=="ungrouped"?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Enable legend selection"}),v.jsx(zn,{name:"legend selection",enabled:(sN=t.customSettings)==null?void 0:sN.showSelectLegend,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showSelectLegend:!((ue=Me.customSettings)!=null&&ue.showSelectLegend)}}})})]}):null]}),header:v.jsx(Pe,{variant:"heading",children:"Chart Legend"}),headerButton:v.jsx(zn,{name:"show legend",defaultEnabled:!0,enabled:(DN=t.legendSettings)==null?void 0:DN.show,onChange:()=>i(Me=>{var ue;return{...Me,legendSettings:{...Me.legendSettings,show:!((ue=Me.legendSettings)!=null&&ue.show)}}})})}),![Se.pie,Se.doughnut,Se.rose,Se.gauge,Se.sankey].includes(t.chartType)&&v.jsx(vs,{width:"100%",content:v.jsx("div",{className:Re["container-wrapper"],children:v.jsxs("div",{className:Re.marginContainer,children:[v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(Ku=t.margins)==null?void 0:Ku.marginTop,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginTop:parseInt(Me.target.value,10)}}))})}),v.jsxs("div",{className:Re.chartDemoContainer,children:[v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(Uo=t.margins)==null?void 0:Uo.marginLeft,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginLeft:parseInt(Me.target.value,10)}}))})}),v.jsx("div",{className:Re.chartDemo}),v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(aa=t.margins)==null?void 0:aa.marginRight,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginRight:parseInt(Me.target.value,10)}}))})})]}),v.jsx("div",{className:Re.marginWrapper,children:v.jsx(yi,{type:"number",value:(ua=t.margins)==null?void 0:ua.marginBottom,onChange:Me=>i(ue=>({...ue,margins:{...ue.margins,marginBottom:parseInt(Me.target.value,10)}}))})})]})}),header:v.jsx(Pe,{variant:"heading",children:"Chart Margin"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsx("div",{className:Re["container-wrapper"],children:v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Label Position"}),v.jsx(un,{selectedOption:{value:((yM=t.labelSettings)==null?void 0:yM.position)||"hidden",label:((pu=t.labelSettings)==null?void 0:pu.position)||"hidden"},options:Kke(t.chartType),onChange:Me=>i(ue=>({...ue,labelSettings:{...ue,show:Me.value!=="hidden",position:Me.value}})),buttonWidth:"150px",menuWidth:"150px"})]})}),header:v.jsx(Pe,{variant:"heading",children:"Chart Label"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsxs("div",{className:Re.chartColors,children:[v.jsx("div",{className:"dbn-flex dbn-items-center",children:(Eu=t.chartColors)==null?void 0:Eu.map(Me=>v.jsx("span",{className:"dbn-h-6 dbn-w-6 dbn-inline-block",style:{backgroundColor:Me},title:Me},Me))}),v.jsxs("div",{className:"dbn-flex dbn-gap-2",children:[v.jsx(fs,{text:"Reset",children:v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"delete",size:"sm"}),onClick:()=>r==null?void 0:r(!0)})}),v.jsx("div",{className:"dbn-border dbn-border-secondary"}),v.jsx(fs,{text:"Shuffle",children:v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"shuffle",size:"sm"}),onClick:M})})]})]}),[Se.bar,Se.row,Se.histogram].includes(t.chartType)?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show different colored bars"}),v.jsx(zn,{name:"different colored",enabled:(vu=t.customSettings)==null?void 0:vu.coloredBars,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,coloredBars:!((ue=Me.customSettings)!=null&&ue.coloredBars)}}})})]}):null,v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-flex-col dbn-gap-4",children:[v.jsx(Pe,{variant:"heading",children:"Gradients for charts"}),t.chartType!==Se.gauge&&v.jsxs(v.Fragment,{children:[!o&&v.jsxs("div",{className:"dbn-flex dbn-flex-row dbn-justify-between dbn-items-center",children:[v.jsx(Pe,{variant:"label",children:"Chart gradient"}),v.jsx(Bt,{variant:"secondary",onClick:()=>s(!0),leftIcon:v.jsx(Yt,{name:"plus"}),children:"Add New Gradient"})]}),o&&v.jsxs("div",{className:Re.formattingContainer,children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Start Color"}),v.jsx(Ss,{name:"start",onChange:Me=>T(ue=>({...ue,startColor:Me})),defaultValue:"#FFFFFF",value:j.startColor})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"End Color"}),v.jsx(Ss,{name:"end",onChange:Me=>T(ue=>({...ue,endColor:Me})),defaultValue:"#000000",value:j.endColor})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for start color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:Me=>T(ue=>({...ue,offset1:Number(Me.target.value)}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for end color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:({target:{value:Me}})=>T(ue=>({...ue,offset2:Number(Me)}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Direction"}),v.jsx(un,{selectedOption:{value:j.direction,label:j.direction},options:[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}],onChange:Me=>T(ue=>({...ue,direction:Me.value})),buttonWidth:"220px",menuWidth:"220px"})]}),v.jsx(Bt,{variant:"primary",type:"button",onClick:()=>x(),fitContainer:!0,children:"Save Gradient"})]}),!o&&((qu=(mo=t.customSettings)==null?void 0:mo.gradients)==null?void 0:qu.map(Me=>v.jsxs("div",{className:Re.gradientContainer,children:[v.jsx(Pe,{variant:"label",children:`${Me.startColor} - ${Me.endColor}`}),v.jsx(Bt,{variant:"tertiary",onClick:()=>C(Me),leftIcon:v.jsx(Yt,{name:"cross",size:"xs"})})]},`${Me.startColor}-${Me.endColor}`)))]}),!o&&([Se.bar,Se.row,Se.stack,Se.histogram].includes(t.chartType)||t.chartType===Se.timeSeries&&((Cs=(Xa=t.timeSeriesSettings)==null?void 0:Xa.seriesType[0])==null?void 0:Cs.type)==="bar")?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Add bar background gradient"}),v.jsx(zn,{name:"show bar background gradient",enabled:(xa=t.customSettings)==null?void 0:xa.isShowBarGradient,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,isShowBarGradient:!((ue=Me.customSettings)!=null&&ue.isShowBarGradient)}}})})]}),((An=t.customSettings)==null?void 0:An.isShowBarGradient)&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Start Color"}),v.jsx(Ss,{name:"startColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,startColor:Me}}}}),defaultValue:"#FFFFFF",value:((eo=(pa=t.customSettings)==null?void 0:pa.barGradient)==null?void 0:eo.startColor)||"#FFFFFF"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"End Color"}),v.jsx(Ss,{name:"endColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,endColor:Me}}}}),defaultValue:"#000000",value:((Mn=(Yo=t.customSettings)==null?void 0:Yo.barGradient)==null?void 0:Mn.endColor)||"#000000"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for Start Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,offset1:Number(Me.target.value)}}}}),value:(_o=(bo=t.customSettings)==null?void 0:bo.barGradient)==null?void 0:_o.offset1})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for End Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:({target:{value:Me}})=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,offset2:Number(Me)}}}}),value:(to=(Vi=t.customSettings)==null?void 0:Vi.barGradient)==null?void 0:to.offset2})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Direction"}),v.jsx(un,{selectedOption:{value:((Fr=(Lr=t.customSettings)==null?void 0:Lr.barGradient)==null?void 0:Fr.direction)||"",label:((Su=(zM=t.customSettings)==null?void 0:zM.barGradient)==null?void 0:Su.direction)||""},options:[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}],onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,barGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.barGradient,direction:Me.value}}}})})]})]})]}):null,!o&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Add background gradient"}),v.jsx(zn,{name:"show background gradient",enabled:(gr=t.customSettings)==null?void 0:gr.enableBackgroundGradient,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,enableBackgroundGradient:!((ue=Me.customSettings)!=null&&ue.enableBackgroundGradient)}}})})]}),(Pn=t.customSettings)!=null&&Pn.enableBackgroundGradient?v.jsxs("div",{className:Re.formattingContainer,children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Start Color"}),v.jsx(Ss,{name:"startBackColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,startColor:Me}}}}),defaultValue:"#FFFFFF",value:((CM=(Ro=t.customSettings)==null?void 0:Ro.backgroundGradient)==null?void 0:CM.startColor)||"#FFFFFF"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"End Color"}),v.jsx(Ss,{name:"endBackColor",onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,endColor:Me}}}}),defaultValue:"#000000",value:((Ea=(tM=t.customSettings)==null?void 0:tM.backgroundGradient)==null?void 0:Ea.endColor)||"#000000"})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for Start Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,offset1:Number(Me.target.value)}}}}),value:(GM=(gN=t.customSettings)==null?void 0:gN.backgroundGradient)==null?void 0:GM.offset1})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Offset for End Color"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:1,onChange:({target:{value:Me}})=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,offset2:Number(Me)}}}}),value:(VN=(Ka=t.customSettings)==null?void 0:Ka.backgroundGradient)==null?void 0:VN.offset2})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Direction"}),v.jsx(un,{selectedOption:{value:((wu=(oa=t.customSettings)==null?void 0:oa.backgroundGradient)==null?void 0:wu.direction)||"",label:((Ue=(Ae=t.customSettings)==null?void 0:Ae.backgroundGradient)==null?void 0:Ue.direction)||""},label:"Direction",options:[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}],onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,backgroundGradient:{...(Nt=ue.customSettings)==null?void 0:Nt.backgroundGradient,direction:Me.value}}}})})]})]}):null]})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Chart Colors"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[v.jsx(yi,{type:"text",label:"Chart Title",value:(ft=t.customSettings)==null?void 0:ft.chartTitle,onChange:Me=>{i(ue=>({...ue,customSettings:{...ue.customSettings,chartTitle:Me.target.value}}))}}),v.jsx(yi,{type:"text",label:"Chart Description",value:(Ht=t.customSettings)==null?void 0:Ht.chartDesc,onChange:Me=>{i(ue=>({...ue,customSettings:{...ue.customSettings,chartDesc:Me.target.value}}))}}),v.jsx(Pe,{variant:"body-text-sm",children:"Position"}),v.jsx(Hte,{val:(Qn=t.customSettings)==null?void 0:Qn.titlePosition,onClick:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,titlePosition:Me}}))})]}),header:v.jsx(Pe,{variant:"heading",children:"Chart Title & Description"}),headerButton:v.jsx(zn,{name:"chart title & desc",defaultEnabled:!0,enabled:(Ri=t.customSettings)==null?void 0:Ri.enableTitleDesc,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,enableTitleDesc:!((ue=Me.customSettings)!=null&&ue.enableTitleDesc)}}})})}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[t.chartType!==Se.table&&t.chartType!==Se.pivot&&t.chartType!==Se.funnel&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Number Formatting"}),v.jsx(un,{selectedOption:{value:((Jn=t.customSettings)==null?void 0:Jn.numberFormatter)||"original",label:((vr=t.customSettings)==null?void 0:vr.numberFormatter)||"original"},options:J7,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,numberFormatter:Me.value}})),buttonWidth:"150px",menuWidth:"250px"})]}),t.chartType!==Se.table&&t.chartType!==Se.pivot&&t.chartType!==Se.funnel&&v.jsx(v.Fragment,{children:t.chartType!==Se.combo&&v.jsx(v.Fragment,{children:v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add prefix to labels",value:(Xn=t.customSettings)==null?void 0:Xn.labelPrefix,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,labelPrefix:Me.target.value}}))}),v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add suffix to labels",value:(ae=t.customSettings)==null?void 0:ae.labelSuffix,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,labelSuffix:Me.target.value}}))})]})})}),t.chartType===Se.combo&&v.jsxs(v.Fragment,{children:[(de=t.customSettings)!=null&&de.isStackBar?t.customSettings.comboAxisSymbols.filter(Me=>!t.comboBarList.includes(Me.name)).map(Me=>v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"body-text-sm",children:`${Me.name} axis`}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add prefix to labels",value:Me.prefix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,prefix:ue.target.value}:Nn)}}})}),v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add suffix to labels",value:Me.suffix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,suffix:ue.target.value}:Nn)}}})})]})]})):(Ke=(Ge=t.customSettings)==null?void 0:Ge.comboAxisSymbols)==null?void 0:Ke.map(Me=>v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"body-text-sm",children:`${Me.name} axis`}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add prefix to labels",value:Me.prefix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,prefix:ue.target.value}:Nn)}}})}),v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add suffix to labels",value:Me.suffix,onChange:ue=>i(Nt=>{var zi,dn;return{...Nt,customSettings:{...Nt.customSettings,comboAxisSymbols:(dn=(zi=Nt.customSettings)==null?void 0:zi.comboAxisSymbols)==null?void 0:dn.map(Nn=>Nn.name===Me.name?{...Nn,suffix:ue.target.value}:Nn)}}})})]})]})),((xt=t.customSettings)==null?void 0:xt.isStackBar)&&v.jsxs(v.Fragment,{children:[v.jsx(Pe,{variant:"body-text-sm",children:"Stack axis"}),v.jsx("div",{className:Re.wrapper,children:v.jsx(yi,{type:"text",label:"Name",placeholder:"Add axis name",value:(_t=(ri=t==null?void 0:t.customSettings)==null?void 0:ri.comboStackAxisSymbols)==null?void 0:_t.name,onChange:({target:{value:Me}})=>i(ue=>{var Nt,zi,dn,Nn;return{...ue,customSettings:{...ue.customSettings,comboStackAxisSymbols:{prefix:((zi=(Nt=ue.customSettings)==null?void 0:Nt.comboStackAxisSymbols)==null?void 0:zi.prefix)||"",name:Me,suffix:((Nn=(dn=ue.customSettings)==null?void 0:dn.comboStackAxisSymbols)==null?void 0:Nn.suffix)||""}}}})})}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"text",label:"Suffix",placeholder:"Add Suffix to labels",value:(Hi=(li=t==null?void 0:t.customSettings)==null?void 0:li.comboStackAxisSymbols)==null?void 0:Hi.suffix,onChange:({target:{value:Me}})=>i(ue=>{var Nt,zi,dn,Nn;return{...ue,customSettings:{...ue.customSettings,comboStackAxisSymbols:{suffix:Me,name:((zi=(Nt=ue.customSettings)==null?void 0:Nt.comboStackAxisSymbols)==null?void 0:zi.name)||"",prefix:((Nn=(dn=ue.customSettings)==null?void 0:dn.comboStackAxisSymbols)==null?void 0:Nn.prefix)||""}}}})}),v.jsx(yi,{type:"text",label:"Prefix",placeholder:"Add Prefix to labels",value:(Vn=(fn=t==null?void 0:t.customSettings)==null?void 0:fn.comboStackAxisSymbols)==null?void 0:Vn.prefix,onChange:({target:{value:Me}})=>i(ue=>{var Nt,zi,dn,Nn;return{...ue,customSettings:{...ue.customSettings,comboStackAxisSymbols:{prefix:Me,name:((zi=(Nt=ue.customSettings)==null?void 0:Nt.comboStackAxisSymbols)==null?void 0:zi.name)||"",suffix:((Nn=(dn=ue.customSettings)==null?void 0:dn.comboStackAxisSymbols)==null?void 0:Nn.suffix)||""}}}})})]})]})]})]}),header:v.jsx(Pe,{variant:"heading",children:"Formatting"}),headerButton:null}),v.jsx(vs,{width:"100%",content:v.jsxs("div",{className:Re["container-wrapper"],children:[t.chartType===Se.sankey&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Interchange the source and target"}),v.jsx(zn,{name:"show background",enabled:(kn=t.backGroundColor)==null?void 0:kn.show,onChange:()=>i(Me=>{var ue,Nt,zi;return{...Me,sankeyValues:[((ue=Me==null?void 0:Me.sankeyValues)==null?void 0:ue[1])||"",((Nt=Me==null?void 0:Me.sankeyValues)==null?void 0:Nt[0])||"",((zi=Me==null?void 0:Me.sankeyValues)==null?void 0:zi[2])||""]}})})]}),[Se.bar,Se.row,Se.stack,Se.histogram,Se.combo,Se.timeSeries].includes(t.chartType)||t.chartType===Se.timeSeries&&((Ir=(lr=t.timeSeriesSettings)==null?void 0:lr.seriesType[0])==null?void 0:Ir.type)==="bar"?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"body-text-sm",children:"Show bar background"}),v.jsx(zn,{name:"show background",enabled:(pn=t.backGroundColor)==null?void 0:pn.show,onChange:()=>i(Me=>{var ue;return{...Me,backGroundColor:{show:!((ue=Me.backGroundColor)!=null&&ue.show)}}})})]}):null,t.chartType===Se.combo&&v.jsx(fl,{selectedOption:((FN=(io=t.comboBarList)==null?void 0:io.filter(Me=>{var ue;return(ue=t.yAxisList)==null?void 0:ue.includes(Me)}))==null?void 0:FN.map(Me=>({value:Me,label:Me})))||[],label:"Combo Bar",options:((Qs=t.yAxisList)==null?void 0:Qs.map(Me=>({value:Me,label:Me})))||[],onChange:Me=>i(ue=>{var Nt;return{...ue,comboBarList:((Nt=Me==null?void 0:Me.filter(zi=>{var dn;return(dn=t.yAxisList)==null?void 0:dn.includes(zi.value)}))==null?void 0:Nt.map(zi=>zi.value))||[]}}),menuWidth:"100%",buttonWidth:"100%"}),t.chartType===Se.bubble?v.jsx(yi,{type:"number",label:"Constant for bubble size",min:0,onChange:Me=>i(ue=>({...ue,percentageSize:Number(Me.target.value)})),value:t.percentageSize}):null,t.chartType===Se.bar||t.chartType===Se.timeSeries&&((ks=(qa=(_g=t.timeSeriesSettings)==null?void 0:_g.seriesType)==null?void 0:qa[0])==null?void 0:ks.type)==="bar"?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Enable cumulative bar"}),v.jsx(zn,{name:"cumulative",enabled:(Us=t.customSettings)==null?void 0:Us.cumulativeBar,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,cumulativeBar:!((ue=Me.customSettings)!=null&&ue.cumulativeBar)}}})})]}):null,t.chartType===Se.combo&&v.jsx(v.Fragment,{children:((Rg=t==null?void 0:t.comboBarList)==null?void 0:Rg.length)>0&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Enable Stack bar"}),v.jsx(zn,{name:"enable stack bar",enabled:(Sj=t.customSettings)==null?void 0:Sj.isStackBar,onChange:()=>{i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,isStackBar:!((ue=Me.customSettings)!=null&&ue.isStackBar)}}})}})]})}),[Se.bar,Se.row,Se.stack].includes(t.chartType)||t.chartType===Se.timeSeries&&((Pg=(wj=t.timeSeriesSettings)==null?void 0:wj.seriesType[0])==null?void 0:Pg.type)==="bar"?v.jsxs(v.Fragment,{children:[v.jsx(yi,{type:"number",label:"Modify Bar width",onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,barWidth:parseInt(Me.target.value,10)}})),value:(Vg=t.customSettings)==null?void 0:Vg.barWidth}),v.jsxs("div",{className:Re.prefixSuffixContainer,children:[v.jsx(yi,{type:"number",label:"Modify Top Bar radius",min:0,onChange:Me=>e(ue=>({...ue,topRadius:parseInt(Me.target.value,10)})),value:((tc=(ec=t.customSettings)==null?void 0:ec.barRadius)==null?void 0:tc[1])||0}),v.jsx(yi,{type:"number",label:"Modify Bottom Bar radius",min:0,onChange:Me=>e(ue=>({...ue,bottomRadius:parseInt(Me.target.value,10)})),value:((Fg=(ic=t.customSettings)==null?void 0:ic.barRadius)==null?void 0:Fg[3])||0})]})]}):null,[Se.line,Se.bar,Se.row,Se.area,Se.combo,Se.histogram,Se.stepped,Se.scatter,Se.timeSeries,Se.stackedArea].includes(t.chartType)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsxs("span",{className:"dbn-flex dbn-gap-1 dbn-items-center",children:[v.jsx(Pe,{variant:"heading",children:"Hide 0/null values"}),v.jsxs(nb,{position:"center",children:["Hide 0, undefined, null, N/A,",v.jsx("br",{})," values from the tooltip"]})]}),v.jsx(zn,{name:"hide null values",enabled:(no=t.customSettings)==null?void 0:no.hideNullValues,onChange:()=>{i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,hideNullValues:!((ue=Me.customSettings)!=null&&ue.hideNullValues)}}})}})]}),[Se.bar,Se.line,Se.area,Se.stackedArea,Se.timeSeries].includes(t.chartType)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Enable Dynamic behavior"}),v.jsx(zn,{name:"dynamic",enabled:(Cj=t.customSettings)==null?void 0:Cj.showDynamicBehaviour,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showDynamicBehaviour:!((ue=Me.customSettings)!=null&&ue.showDynamicBehaviour)}}})})]}),![Se.gauge,Se.pie,Se.table,Se.singleValue,Se.doughnut,Se.funnel,Se.sankey,Se.rose].includes(t.chartType)&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsxs("span",{className:"dbn-flex dbn-gap-1 dbn-items-center",children:[v.jsx(Pe,{variant:"heading",children:"Enable chart zoom"}),v.jsx(nb,{position:"center",children:"Enable zooming and panning for the chart"})]}),v.jsx(zn,{name:"chart zoom",enabled:(bD=($g=t.customSettings)==null?void 0:$g.chartZoom)==null?void 0:bD.isZoomEnabled,onChange:()=>{i(Me=>{var ue,Nt,zi;return{...Me,customSettings:{...Me.customSettings,chartZoom:{...(ue=Me.customSettings)==null?void 0:ue.chartZoom,isZoomEnabled:!((zi=(Nt=Me.customSettings)==null?void 0:Nt.chartZoom)!=null&&zi.isZoomEnabled),zoomAxis:"x",zoomOnMouseWheel:!0}}}})}})]}),((Qj=(Wg=t.customSettings)==null?void 0:Wg.chartZoom)==null?void 0:Qj.isZoomEnabled)&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Select zoom axis"}),v.jsx(un,{selectedOption:{value:t.customSettings.chartZoom.zoomAxis||"x",label:t.customSettings.chartZoom.zoomAxis||"x"},options:[{label:"x",value:"x"},{label:"y",value:"y"},{label:"xy",value:"xy"}],onChange:Me=>i(ue=>{var Nt;return{...ue,customSettings:{...ue.customSettings,chartZoom:{...(Nt=ue.customSettings)==null?void 0:Nt.chartZoom,zoomAxis:Me.value}}}}),buttonWidth:"150px",menuWidth:"150px"})]})]}),[Se.rose].includes(t.chartType)&&v.jsxs(v.Fragment,{children:[t.chartType==="rose"&&v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Rose type"}),v.jsx(un,{selectedOption:{value:((_D=t.customSettings)==null?void 0:_D.roseType)||"",label:((nc=t.customSettings)==null?void 0:nc.roseType)||""},options:[{label:"Radius",value:"radius"},{label:"Area",value:"area"}],onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,roseType:Me.value}}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Mode"}),v.jsx(un,{selectedOption:{value:((Na=t.customSettings)==null?void 0:Na.selectedMode)||"",label:((ro=t.customSettings)==null?void 0:ro.selectedMode)||""},options:[{label:"Single",value:"single"},{label:"Multiple",value:"multiple"},{label:"Series",value:"series"}],onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,selectedMode:Me.value}}))})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Offset"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",label:"Offset",min:0,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,selectedOffset:parseInt(Me.target.value,10)}})),value:(uM=t.customSettings)==null?void 0:uM.selectedOffset})})]})]}),t.chartType===Se.stack&&v.jsxs("div",{children:[v.jsx(Pe,{variant:"heading",children:"Show 100% stacked bar"}),v.jsx(zn,{name:"full stacked",enabled:(eu=t.customSettings)==null?void 0:eu.showFullStacked,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showFullStacked:!((ue=Me.customSettings)!=null&&ue.showFullStacked)}}})})]}),t.chartType===Se.funnel&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show Funnel shadow"}),v.jsx(zn,{name:"funnel 3",enabled:(lN=t.customSettings)==null?void 0:lN.showFunnelShadow,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showFunnelShadow:!((ue=Me.customSettings)!=null&&ue.showFunnelShadow)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Padding between steps"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"number",min:0,max:30,value:((RD=t.customSettings)==null?void 0:RD.stepPadding)||10,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,stepPadding:parseInt(Me.target.value,10)}}))})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show label with values"}),v.jsx(zn,{name:"funnel 1",enabled:(rc=t.customSettings)==null?void 0:rc.showLabelValues,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showLabelValues:!((ue=Me.customSettings)!=null&&ue.showLabelValues)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show Conversion Rate"}),v.jsx(zn,{name:"funnel 2",enabled:($N=t.customSettings)==null?void 0:$N.showConversionRate,onChange:()=>i(Me=>{var ue;return{...Me,customSettings:{...Me.customSettings,showConversionRate:!((ue=Me.customSettings)!=null&&ue.showConversionRate)}}})})]}),v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Label Format"}),v.jsx("div",{className:Re.inputWrapper,children:v.jsx(yi,{type:"text",placeholder:"{b}",value:(Mc=t.customSettings)==null?void 0:Mc.labelFormat,onChange:Me=>i(ue=>({...ue,customSettings:{...ue.customSettings,labelFormat:Me.target.value}}))})})]})]}),[Se.pie,Se.doughnut,Se.rose].includes(t.chartType)?v.jsxs("div",{className:Re.wrapper,children:[v.jsx(Pe,{variant:"heading",children:"Show label line"}),v.jsx(zn,{name:"label line",enabled:(ac=t.labelSettings)==null?void 0:ac.showLabelLine,onChange:()=>i(Me=>{var ue;return{...Me,labelSettings:{...Me.labelSettings,showLabelLine:!((ue=Me.labelSettings)!=null&&ue.showLabelLine)}}})})]}):null,t.chartType===Se.timeSeries&&v.jsx(Xke,{onChange:Me=>i(ue=>({...ue,timeSeriesSettings:{...ue.timeSeriesSettings,...Me instanceof Function?Me(ue.timeSeriesSettings||{}):Me}})),yAxisList:t.yAxisList||[],settings:t.timeSeriesSettings})]}),header:v.jsx(Pe,{variant:"heading",children:"Other customizations"}),headerButton:null})]})})},Wet={chartButtonContainer:"_chartButtonContainer_a2qou_1","settingsTab-header-control":"_settingsTab-header-control_a2qou_9",tabContainer:"_tabContainer_a2qou_17",tab:"_tab_a2qou_17",tabText:"_tabText_a2qou_33",chartButtons:"_chartButtons_a2qou_41",chartButton:"_chartButton_a2qou_1",chartButtonSelected:"_chartButtonSelected_a2qou_73",chartTypesButton:"_chartTypesButton_a2qou_81",button:"_button_a2qou_89",propertyButton:"_propertyButton_a2qou_97",settings:"_settings_a2qou_9",disable:"_disable_a2qou_111"},QT={backdrop:"_backdrop_1x4lb_1",panel:"_panel_1x4lb_5",left:"_left_1x4lb_9",right:"_right_1x4lb_12",small:"_small_1x4lb_15",medium:"_medium_1x4lb_18",large:"_large_1x4lb_21",header:"_header_1x4lb_25",headerTitle:"_headerTitle_1x4lb_29",content:"_content_1x4lb_33",footer:"_footer_1x4lb_37",panelStory:"_panelStory_1x4lb_41",panelStoryHeader:"_panelStoryHeader_1x4lb_45",panelStoryHeaderRight:"_panelStoryHeaderRight_1x4lb_49",panelStoryContent:"_panelStoryContent_1x4lb_53",panelStoryFooter:"_panelStoryFooter_1x4lb_57",panelStoryFooterLeft:"_panelStoryFooterLeft_1x4lb_61",panelStoryFooterLeftWrapper:"_panelStoryFooterLeftWrapper_1x4lb_65"},Ev=({children:t,isOpen:i,onClose:e,headerTitle:n,icon:r,hideHeader:M,hideFooter:a,primaryActionText:u="Apply",onPrimaryAction:o,side:s="left",size:N="small",zIndex:D})=>v.jsx(DL,{children:i?v.jsx("div",{className:QT.backdrop,style:{zIndex:D},onClick:e,children:v.jsxs("div",{className:`${QT.panel} ${QT[s]} ${QT[N]}`,onClick:g=>{g.stopPropagation()},children:[!M&&v.jsxs("section",{className:QT.header,children:[v.jsxs("span",{className:QT.headerTitle,children:[r,n]}),v.jsx(Bt,{variant:"tertiary",type:"button",onClick:e,leftIcon:v.jsx(Yt,{name:"cross"})})]}),v.jsx("section",{className:QT.content,children:t}),!a&&v.jsxs("section",{className:QT.footer,children:[v.jsx(Bt,{type:"button",variant:"tab",onClick:e,children:"Cancel"}),v.jsx(Bt,{type:"button",variant:"primary",onClick:o,children:u})]})]})}):null}),eUe=({ChartAppearancePanelProps:{chartSettings:t,isOpen:i,onClose:e,setChartSettings:n,setBarRadius:r,comparisonLagProps:M,setResetPallete:a}})=>v.jsx(Ev,{isOpen:i,onClose:e,size:"small",side:"right",hideFooter:!0,headerTitle:"Appearance",children:v.jsx("div",{className:Ib.chartPropertiesPanel,children:v.jsx(qke,{chartSettings:t,setChartSettings:n,setBarRadius:r,comparisonLagProps:M,setResetPallete:a})})}),tUe=({SortPanelProps:{isOpen:t,onClose:i,createdSorts:e,setCreatedSorts:n,columnOptions:r,onApplySort:M,selectedTable:a}})=>v.jsx(Ev,{isOpen:t,onClose:i,size:"medium",side:"right",hideFooter:!0,headerTitle:"Sorts",children:e.length?v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-flex-col dbn-justify-between dbn-p-5",children:[v.jsxs("div",{className:"dbn-flex dbn-flex-col dbn-gap-4",children:[v.jsx("div",{className:"dbn-w-full dbn-flex dbn-justify-end dbn-items-center",children:v.jsx(Bt,{variant:"popover",onClick:()=>{n([]),M(()=>n([]),!0)},children:"Clear all"})}),e.map((u,o)=>v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-gap-3 dbn-items-center",children:[v.jsx(un,{onChange:s=>n(N=>N.map((D,g)=>g===o?{...D,columnName:s}:D)),options:r,selectedOption:u.columnName,buttonWidth:"300px",menuWidth:"300px"}),v.jsx(un,{onChange:s=>n(N=>N.map((D,g)=>g===o?{...D,method:s}:D)),options:H5,selectedOption:u.method,buttonWidth:"200px",menuWidth:"200px"}),v.jsx(Bt,{variant:"popover",onClick:()=>{n(s=>s.filter((N,D)=>D!==o)),M(()=>n(e.filter((s,N)=>N!==o)),!1,o)},children:v.jsx(Yt,{name:"delete"})})]},`${u.columnName.value}_${u.tableName.value}_${u.method.value}_${o==null?void 0:o.toString()}`)),v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"plus"}),onClick:()=>n(u=>[...u,{columnName:{label:"",value:""},method:H5[0],tableName:a}]),children:"Add Sort"})]}),v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-h-[50px] dbn-items-end dbn-justify-end dbn-gap-5",children:[v.jsx(Bt,{variant:"secondary",onClick:()=>i(),children:"Cancel"}),v.jsx(Bt,{variant:"primary",onClick:()=>M(i),children:"Apply Sort"})]})]}):v.jsx(v.Fragment,{children:v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center dbn-flex-col dbn-gap-4",children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx(Bt,{variant:"secondary",leftIcon:v.jsx(Yt,{name:"plus"}),onClick:()=>n(u=>[...u,{columnName:{label:"",value:""},method:H5[0],tableName:a}]),children:"Add Sort"})]})})}),iUe={button:"_button_lhx47_1",menu:"_menu_lhx47_7",inputLabel:"_inputLabel_lhx47_13",input:"_input_lhx47_13",label:"_label_lhx47_25",menuContainer:"_menuContainer_lhx47_31",icon:"_icon_lhx47_37",container:"_container_lhx47_43"},nUe=[{label:"Last Week",value:"Last Week"},{label:"This Week",value:"This Week"},{label:"Last Month",value:"Last Month"},{label:"This Month",value:"This Month"},{label:"Last Year",value:"Last Year"},{label:"This Year",value:"This Year"},{label:"Yesterday",value:"Yesterday"},{label:"Today",value:"Today"},{label:"Custom",value:"Custom"}],yb={value:"",from:"",to:""},rUe=t=>{if(!t)return yb;if(t.includes(" - ")){const[i,e]=t.split(" - ");return{...yb,value:t,from:i,to:e}}return{...yb,value:t}},MUe=({isShowlabel:t,timeGrainValue:i="",setTimeGrainValue:e,register:n,className:r="",isDisabled:M,containerClass:a="",onChange:u,labelVariant:o,label:s})=>{const[N,D]=De.useState(rUe(i));return De.useEffect(()=>{N.value&&N.value!=="Custom"?e(N.value):N.from&&N.to&&e(`${N.from} - ${N.to}`)},[N]),De.useEffect(()=>{u==null||u(N.value)},[N]),v.jsx(v.Fragment,{children:v.jsxs("div",{className:a,children:[t?v.jsx(Pe,{variant:"body-text-sm",children:s||"Time Filter"}):null,v.jsxs("div",{className:iUe.container,children:[v.jsx(un,{options:nUe,selectedOption:{value:N.value,label:N.value},onChange:g=>D(l=>({...l,value:g.value}))}),N.value==="Custom"?v.jsxs(v.Fragment,{children:[v.jsx(yi,{label:"From Date",type:"date",value:N.from,onChange:({target:{value:g}})=>D(l=>({...l,from:g}))}),v.jsx(yi,{label:"To Date",type:"date",value:N.to,onChange:({target:{value:g}})=>D(l=>({...l,to:g}))})]}):null]})]})})},aUe=({filtersPanelProps:{isOpen:t,onClose:i,filters:e,setCreatedFilters:n,columnOptions:r,getFilterDropDownType:M,editorRef:a,workspaceId:u,onApplyFilter:o,savedFilterListOptions:s,currentSelectedTable:N}})=>(De.useState(!0),v.jsx(Ev,{isOpen:t,onClose:i,size:"medium",side:"right",hideFooter:!0,headerTitle:"Filters",children:e.length?v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-p-5 dbn-flex dbn-flex-col dbn-justify-between",children:[v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-flex-col dbn-gap-5",children:[v.jsx("div",{className:"dbn-w-full dbn-flex dbn-justify-end dbn-items-center",children:v.jsx(Bt,{variant:"popover",onClick:()=>{n([]),o(()=>n([]),!0)},children:"Clear all"})}),e.map((D,g)=>{var h,x,O,d,E;const[l,j,T,y,z]=(h=D.columnName.value)==null?void 0:h.split("____"),A=M({datatype:T,operator:D.operator.value});return((x=D==null?void 0:D.tableName)==null?void 0:x.value)!==N.value?v.jsx(v.Fragment,{}):v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-gap-3 dbn-flex-wrap dbn-items-center",children:[g>0&&v.jsx(un,{options:K7,selectedOption:D.relationOperator||K7[0],labelVariant:"floating",onChange:C=>{n(k=>k.map((Q,S)=>g===S?{...Q,relationOperator:C}:Q))},buttonWidth:"100px",menuWidth:"100%"}),v.jsxs(v.Fragment,{children:[v.jsx(un,{options:r,selectedOption:D.columnName,labelVariant:"floating",onChange:C=>{n(k=>k.map((Q,S)=>g===S?{...Q,columnName:C}:Q))},isSearchEnabled:!0,isDisabled:!r,buttonWidth:"250px",menuWidth:"250px"}),D.type==="default"&&v.jsxs(v.Fragment,{children:[" ",v.jsx(un,{options:Cx.includes(T==null?void 0:T.toLowerCase())?dse:Sx.includes(T==null?void 0:T.toLowerCase())?fse:W5.includes(T==null?void 0:T.toLowerCase())||(O=T==null?void 0:T.toLowerCase())!=null&&O.includes("char")?Ase:X7,selectedOption:D.operator||X7[0],labelVariant:"floating",onChange:C=>{n(k=>k.map((Q,S)=>g===S?{...Q,operator:C}:Q))},isSearchEnabled:!0,isDisabled:!T,buttonWidth:"250px",menuWidth:"250px"}),A==="MULTI_FILTER_DROPDOWN"&&v.jsx(fd,{filter:{tableName:`${y}.${z}`,columnName:`${j}`},workspaceId:u,selectedOption:((d=D.value.stringArray)==null?void 0:d.map(C=>({value:C,label:C})))||[],onChange:C=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{stringArray:(C==null?void 0:C.map(b=>b.value))||[]}}:Q)),isSearchEnabled:!0,autoSelected:!1,isDisabled:!j,isDisablelabel:!0,buttonWidth:"250px",menuWidth:"250px"}),A==="FILTER_DROPDOWN"&&v.jsx(ap,{isDisableLabel:!0,filter:{tableName:`${y}.${z}`,columnName:`${j}`},workspaceId:u,selectedOption:{label:D.value.stringValue||"",value:D.value.stringValue||""},onChange:C=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{stringValue:C.value}}:Q)),isSearchEnabled:!0,autoSelected:!1,isDisabled:!j}),A==="TIME_FILTER"&&v.jsx(MUe,{isDisabled:!j||!T,timeGrainValue:((E=D.value.timeValue)==null?void 0:E.timeFilter)||"Last Year",setTimeGrainValue:C=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{timeValue:{endDate:"",startDate:"",timeFilter:C}}}:Q))}),A==="INPUT_NUMBER_FIELD"&&v.jsx(yi,{type:"number",onChange:({target:{value:C}})=>n(k=>k.map((Q,S)=>g===S?{...Q,value:{numberValue:Number(C)}}:Q)),value:(D==null?void 0:D.value.numberValue)||0})]})]}),v.jsx(Bt,{variant:"popover",onClick:()=>{o(()=>n(C=>C.filter((k,Q)=>Q!==g)),!1,g)},children:v.jsx(Yt,{name:"delete"})})]})}),v.jsx("div",{className:"dbn-w-fit",children:v.jsx(CD,{buttonContent:v.jsx(Bt,{variant:"popover",leftIcon:v.jsx(Yt,{name:"plus"}),children:"Add Filter"}),position:"bottom-start",children:v.jsx("div",{children:v.jsx(Bt,{variant:"popover",onClick:()=>n(D=>[...D,{columnName:{value:"",label:""},operator:{label:"",value:""},value:{stringValue:""},sql:"",name:"",type:"default",tableName:N}]),className:Ib.popOption,children:"Simple Filter"})})})})]}),v.jsxs("div",{className:"dbn-w-full dbn-flex dbn-h-[50px] dbn-items-end dbn-justify-end dbn-gap-5",children:[v.jsx(Bt,{variant:"secondary",onClick:()=>i(),children:"Cancel"}),v.jsx(Bt,{variant:"primary",onClick:()=>o(i),children:"Apply Filter"})]})]}):v.jsxs("div",{className:"dbn-w-full dbn-h-full dbn-flex dbn-items-center dbn-justify-center dbn-flex-col dbn-gap-4",children:[v.jsx("img",{src:Ch,alt:"no data",style:{width:"300px",height:"300px"}}),v.jsx("div",{className:"dbn-p-5",children:v.jsx(CD,{buttonContent:v.jsx(Bt,{variant:"secondary",leftIcon:v.jsx(Yt,{name:"plus"}),children:"Add Filter"}),position:"bottom",menuWidth:"120px",offset:[0,10],children:v.jsx("div",{className:"dbn-p-2",children:v.jsx(Bt,{variant:"popover",onClick:()=>n(D=>[...D,{columnName:{value:"",label:""},operator:{label:"",value:""},value:{stringValue:""},name:"",sql:"",type:"default",tableName:N}]),className:Ib.popOption,children:"Simple Filter"})})})})]})})),uUe=({...t})=>{var It,We,Tt,He;const{clientId:i,companyId:e,isLiveMode:n,externalDashboardId:r,userProvidedDashboardId:M,setShowMetricCreateModal:a,metric:u,metricData:o,chartColors:s}=t,[N,D]=De.useState(!1),[g,l]=De.useState(""),[j,T]=De.useState(),[y,z]=De.useState(ss),[A,h]=De.useState(!1),[x,O]=De.useState(!1),[d,E]=De.useState(""),[C,k]=De.useState(),[Q,S]=De.useState(!1),[b,Y]=De.useState(!1),[m,R]=De.useState({value:"",label:""}),[P,W]=De.useState([]),[B,X]=De.useState(),[F]=De.useState(),[G,J]=De.useState(!1),[ee,q]=De.useState(!1),[ie,re]=De.useState(),[le,Ne]=De.useState(!1),[se,Ie]=De.useState({topRadius:((We=(It=y.customSettings)==null?void 0:It.barRadius)==null?void 0:We[1])||0,bottomRadius:((He=(Tt=y.customSettings)==null?void 0:Tt.barRadius)==null?void 0:He[3])||0}),[Oe,ye]=De.useState(!1),[$e,Ve]=De.useState(!1),[Ee,Te]=De.useState(!1),[fe,Qe]=De.useState(!1),[ot,rt]=De.useState(!0),[ke,et]=De.useState(!1),{createExternalMetric:xe,error:Dt,updateExternalMetric:ve,clientSubsetData:pt,previewTable:Ct,token:dt,dashboardOptions:Zt,isLoading:$t}=W6({query:d,chartSettings:y,companyIntegrationId:B==null?void 0:B.id,integrationName:B==null?void 0:B.name,metricQuery:F,datasetMetricSettings:C,outputColumns:void 0,selectedColumns:void 0,clientId:i,isEmbedded:!0,companyId:e,isLiveMode:n,dashboardIds:[r],userProvidedDashboardId:M,isEnableGroupBy:!1,groupBy:void 0,selectedGroupBy:[],metric:u,onSuccess:()=>{var jt,lt;Y(!1),a(!1),(lt=(jt=window==null?void 0:window.location)==null?void 0:jt.reload)==null||lt.call(jt)}});De.useEffect(()=>{var kt;const jt=pt==null?void 0:pt.error,lt=pt;jt||!pt?l(jt==null?void 0:jt.message):(kt=lt==null?void 0:lt.tableList)!=null&&kt.length&&X({id:lt==null?void 0:lt.companyIntegrationId,name:lt==null?void 0:lt.dbName})},[pt]),De.useEffect(()=>{m.value&&Ct({data:{integrationId:B==null?void 0:B.id,integrationName:B==null?void 0:B.name,tableName:m.value,limit:10},token:dt},{onSuccess(jt){var kt;const lt=(kt=jt==null?void 0:jt.previewTable)==null?void 0:kt.data;re(lt?[lt]:void 0)}})},[m]),De.useEffect(()=>{[Se.table,Se.horizontalStackTable,Se.treeMap,Se.pivot,Se.gauge,Se.sankey].includes(y.chartType)?rt(!1):rt(!0),[Se.waterfall,Se.funnel,Se.gauge,Se.singleValue,Se.sankey].includes(y.chartType)?et(!0):et(!1)},[y.chartType]);const Mt=De.useMemo(()=>{const jt=Xge(j||[]),lt=tP({data:j||[],timeStampKey:y.xAxis||""});return P.length&<?[...jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries),Se.pivot,Se.timeSeries]:P.length?[...jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries),Se.pivot]:lt?[...jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries),Se.timeSeries]:jt.filter(kt=>kt!==Se.pivot&&kt!==Se.timeSeries)},[j,P,y.xAxis]);return De.useEffect(()=>{j!=null&&j.length&&P.length?J(!0):J(!1)},[j,P.length,d]),De.useEffect(()=>{P.length&&y.chartType===Se.pivot&&(j!=null&&j.length)&&z(jt=>({...jt,pivotTableSettings:{...y.pivotTableSettings,columns:Object.keys(j[0]).filter(lt=>P.includes(lt)),rows:Object.keys(j[0]).filter(lt=>!P.includes(lt))}}))},[j,P.length,y.chartType]),De.useEffect(()=>{A&&(z(jt=>({...jt,chartColors:s})),h(!1))},[A]),De.useEffect(()=>{var jt;(!((jt=y.chartColors)!=null&&jt.length)||dw(s,y.chartColors))&&(s!=null&&s.length)&&z(lt=>({...lt,chartColors:s}))},[s,y.chartColors]),De.useEffect(()=>{y.chartType===Se.row?z(jt=>({...jt,customSettings:{...jt.customSettings,barRadius:[se.bottomRadius,se.topRadius,se.topRadius,se.bottomRadius]}})):z(jt=>({...jt,customSettings:{...jt.customSettings,barRadius:[se.topRadius,se.topRadius,se.bottomRadius,se.bottomRadius]}}))},[se.topRadius,se.bottomRadius,z,y.chartType]),De.useEffect(()=>{u&&(z(u.chartOptions),X(u.companyIntegration))},[u]),De.useEffect(()=>{if(!o)return;const jt=Array.isArray(o)?o:[];T(jt)},[o]),De.useEffect(()=>{y.chartType!==Se.timeSeries&&z(jt=>{var lt;return{...jt,timeSeriesSettings:{...jt.timeSeriesSettings,groupBySettings:{isDynamic:!1,options:[],value:"monthly",fillXAxis:!1},seriesType:((lt=jt.yAxisList)==null?void 0:lt.map(kt=>({column:kt,type:"bar"})))||[]}}})},[y.chartType]),{isLoading:N,chartSettings:y,setShowSaveMetricModal:Y,setSelectTable:R,selectTable:m,data:j,error:g,previewTableData:ie,query:d,isShowSqlModal:Q,setShowSqlModal:S,isEnablePivotTable:G,isEnableGauge:ee,groupByList:P,hasNumberKeys:x,setShowChartCustomProperties:Ne,isShowFullScreen:Oe,setShowFullScreen:ye,isShowChartType:$e,setShowChartType:Ve,isShowSaveMetricModal:b,updateExternalMetric:ve,createExternalMetric:xe,dashboardOptions:Zt,saveError:Dt,setChartSettings:z,isShowChartCustomProperties:le,setBarRadius:Ie,setError:l,setLoading:D,setData:T,setQuery:E,setGroupByList:W,clientSubsetData:pt,isShowSortPanel:Ee,setShowSortPanel:Te,isShowFilters:fe,setShowFilters:Qe,isCreatingMetric:$t,isEnableSingleDimension:ot,isEnableSingleMetrics:ke,enabledCharts:Mt,setResetPallete:h}},oUe=({...t})=>{var le;const{clientId:i,setError:e,setLoading:n,setData:r,setQuery:M,setGroupByList:a,clientSubsetData:u,chart:o,setChartSettings:s}=t,[N,D]=De.useState([]),[g,l]=De.useState([]),[j,T]=De.useState([]),[y,z]=De.useState([]),[A,h]=De.useState({value:"",label:""}),[x,O]=De.useState([]),[d,E]=De.useState(B5),[C,k]=De.useState([]),[Q,S]=De.useState([]),{mutate:b,error:Y,isLoading:m}=gge(),{data:R,token:P}=Vx(),W=De.useRef();De.useEffect(()=>{var Ie;const Ne=u==null?void 0:u.error,se=u;Ne||!u?e(Ne==null?void 0:Ne.message):(Ie=se==null?void 0:se.tableList)!=null&&Ie.length&&S((se==null?void 0:se.tableList)||[])},[u]);const B=De.useMemo(()=>Q.map(Ne=>({value:Ne.tableName,label:Ne.tableName})),[Q]),X=({chartType:Ne,metricParams:se,dimensionParams:Ie})=>{var Oe,ye;if(Ne===Se.singleValue)s($e=>{var Ee;return{...$e,singleValue:((Ee=[...Ie||N,...se||x][0])==null?void 0:Ee.label)||""}});else if(Ne===Se.table){const $e=[...(Oe=Ie||N)==null?void 0:Oe.map(Ve=>Ve.alias||Ve.label||""),...(ye=se||x)==null?void 0:ye.map(Ve=>Ve.alias||Ve.label||"")];s(Ve=>{var Ee,Te,fe,Qe;return{...Ve,xAxis:((Te=(Ee=Ie||N)==null?void 0:Ee[0])==null?void 0:Te.alias)||((Qe=(fe=Ie||N)==null?void 0:fe[0])==null?void 0:Qe.label)||"",yAxisList:$e||[]}})}else if(Ne===Se.waterfall)s($e=>{var Ve,Ee,Te,fe,Qe,ot,rt,ke;return{...$e,xAxis:((Ee=(Ve=Ie||N)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=Ie||N)==null?void 0:Te[0])==null?void 0:fe.label)||"",yAxisList:[((ot=(Qe=se||x)==null?void 0:Qe[0])==null?void 0:ot.alias)||((ke=(rt=se||x)==null?void 0:rt[0])==null?void 0:ke.label)]}});else if(Ne===Se.sankey){const $e=[...(Ie||N).map(Ve=>Ve.alias||Ve.label||"")];s(Ve=>{var Ee,Te,fe,Qe;return{...Ve,sankeyValues:[$e[0]||"",$e[1]||"",((Te=(Ee=se||x)==null?void 0:Ee[0])==null?void 0:Te.alias)||((Qe=(fe=se||x)==null?void 0:fe[0])==null?void 0:Qe.label)||""]}})}else Ne===Se.funnel||Ne===Se.boxplot?s($e=>{var Ve,Ee,Te,fe,Qe,ot,rt,ke;return{...$e,step:((Ee=(Ve=Ie||N)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=Ie||N)==null?void 0:Te[0])==null?void 0:fe.label),measure:((ot=(Qe=se||x)==null?void 0:Qe[0])==null?void 0:ot.alias)||((ke=(rt=se||x)==null?void 0:rt[0])==null?void 0:ke.label)}}):Ne===Se.gauge?s($e=>{var Ve,Ee,Te,fe,Qe,ot;return{...$e,gaugeSettings:{metric:((Ee=(Ve=se||x)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=se||x)==null?void 0:Te[0])==null?void 0:fe.label),dimensions:(ot=(Qe=(Ie||N).filter(rt=>rt.labelType==="dimension_aggregate"))==null?void 0:Qe[0])!=null&&ot.aggregate?(Ie||N).map(rt=>rt.alias||rt.label):[]}}}):Ne===Se.horizontalStackTable?s($e=>{var Ve,Ee;return{...$e,stackTableCols:[...(Ve=se||x)==null?void 0:Ve.map(Te=>Te.alias||Te.label)],yAxisList:[...(Ee=Ie||N)==null?void 0:Ee.map(Te=>Te.alias||Te.label)]}}):s($e=>{var Ve,Ee,Te,fe,Qe;return{...$e,xAxis:((Ee=(Ve=Ie||N)==null?void 0:Ve[0])==null?void 0:Ee.alias)||((fe=(Te=Ie||N)==null?void 0:Te[0])==null?void 0:fe.label)||"",yAxisList:[...(Qe=se||x)==null?void 0:Qe.map(ot=>ot.alias||ot.label)]}})},F=({prevConfiguration:Ne,metricParams:se,dimensionParams:Ie})=>{var Oe;Ne&&E(Ne),e(""),n(!0),r([]),M(""),b({data:{cId:i,configuration:Ne||d,id:(Oe=R==null?void 0:R.workspace)==null?void 0:Oe.id},token:P},{onSuccess(ye){const $e=ye==null?void 0:ye.error,Ve=ye==null?void 0:ye.data,Ee=ye==null?void 0:ye.query;ye==null||ye.timeTaken;const Te=ye==null?void 0:ye.metaData;$e||Y?(e(($e==null?void 0:$e.message)||os),n(!1),r([]),M(""),a([])):Ve&&Ee?(e(""),n(!1),r(Array.isArray(Ve)?Ve:[]),X({chartType:o,metricParams:se,dimensionParams:Ie}),M(Ee),a==null||a((Te==null?void 0:Te.groupbyColumnList)||[])):(e(os),n(!1),r([]),M(""),a([]))},onError(){e(os),n(!1),r([]),M(""),a([])}})},G=Ne=>{var $e,Ve;const[se,Ie]=Ne.split("."),Oe={value:`${se}____${Ie}`,label:`${se}.${Ie}`,icon:"table"};h(Oe);const ye=((Ve=($e=Q.find(Ee=>Ee.tableName===Ne))==null?void 0:$e.columns)==null?void 0:Ve.map(Ee=>({value:`${se}_${Ie}____${Ee.name}____${Ee.datatype}____${se}____${Ie}`,label:Ee.name})))||[];ye!=null&&ye.length&&!m&&(l(ye),T([]),z([]),D([]),O([]),E({...B5,dimensions:[],limit:"100",table:{...B5.table,alias:`${se}_${Ie}`,schema:se,name:Ie},aggregates:[]}))},J=({param:Ne,metricParams:se,dimensionParams:Ie})=>{F({prevConfiguration:Ne||d,metricParams:se,dimensionParams:Ie})},ee=(Ne,se,Ie)=>{if(se){F({prevConfiguration:{...d,orders:[]}}),Ne();return}const Oe=y.filter((ye,$e)=>$e!==Ie).map(ye=>{var fe,Qe;const $e=(fe=ye.columnName.badge)==null?void 0:fe.toLowerCase(),Ve=ye.method.value;if(!ye.columnName.value)return{method:"",name:""};if($e==="custom"||$e==="new")return{method:Ve,name:ye.columnName.label};const[Ee,Te]=(Qe=ye.columnName.value)==null?void 0:Qe.split("____");return{method:ye.method.value,name:`${Ee}.${Te}`}});E(ye=>({...ye,orders:Oe.filter($e=>$e.name)})),F({prevConfiguration:{...d,orders:Oe.filter(ye=>ye.name)}}),Ne()},q=(Ne,se,Ie)=>{if(se){F({prevConfiguration:{...d,filters:[]}}),Ne();return}const Oe=j.filter((ye,$e)=>$e!==Ie).map(ye=>{var fe,Qe;const[$e,Ve,Ee]=(fe=ye.columnName.value)==null?void 0:fe.split("____"),Te=ye.operator.value||"=";return{alias:"",columnName:Ve,dataType:ye.value.timeValue?"TIME_COLUMN":Ee,method:Te,parentAlias:$e,type:ye.value.timeValue?"time":"default",value:ye.value.stringValue||ye.value.stringArray||ye.value.timeValue||ye.value.numberArray||ye.value.numberValue||"",relationOperator:(Qe=ye.relationOperator)==null?void 0:Qe.value}});E(ye=>({...ye,filters:Oe})),F({prevConfiguration:{...d,filters:Oe}}),Ne()};De.useEffect(()=>{const Ne=[];[...N,...x].forEach(se=>{const[Ie,Oe,ye,$e,Ve]=se.value.split("____");G5.includes(se.aggregate??"")||Ne.push({columnName:Oe,alias:se.alias||Oe,dataType:ye,parentAlias:Ie,type:"default",timeGrain:void 0,helperFunction:se.aggregate||void 0})}),E(se=>({...se,dimensions:Ne}))},[N,x]),De.useEffect(()=>{const Ne=[];x.filter(se=>se.labelType==="metric_aggregate").forEach(se=>{const[Ie,Oe,ye,$e,Ve]=se.value.split("____");Ne.push({columnName:Oe,alias:se.alias||Oe,dataType:ye,parentAlias:Ie,type:"default",method:se.aggregate||"COUNT"})}),E(se=>({...se,aggregates:Ne}))},[x.length]);const ie=Ne=>{const se=Ne.value;if(se){const[Ie,Oe,ye]=se==null?void 0:se.split("____");if(Cx.includes(ye.toLowerCase()))return Ose;if(Sx.includes(ye.toLowerCase()))return Lse;if(W5.includes(ye.toLowerCase())||ye.toLowerCase().includes("char"))return hse}return xse},re=({datatype:Ne,operator:se})=>{const Ie=se==="IS NULL"||se==="IS NOT NULL",Oe=se==="IN"||se==="NOT IN";return Cx.includes(Ne==null?void 0:Ne.toLowerCase())&&!Ie&&!Oe?"TIME_FILTER":Sx.includes(Ne==null?void 0:Ne.toLowerCase())&&!Ie?Oe?"MULTI_FILTER_DROPDOWN":"INPUT_NUMBER_FIELD":Ie?"FILTER_DROPDOWN":Oe?"MULTI_FILTER_DROPDOWN":"FILTER_DROPDOWN"};return De.useEffect(()=>{X({chartType:o,metricParams:x,dimensionParams:N})},[o,x,N]),{configuration:d,setConfiguration:E,selectedDimensions:N,setSelectedDimensions:D,metrics:x,setMetrics:O,columnList:g,onChangeTableSelection:G,tableList:B,onGenerateChart:J,createdSorts:y,setCreatedSorts:z,onApplySort:ee,createdFilters:j,setCreatedFilters:T,getFilterDropDownType:re,workspaceId:(le=R==null?void 0:R.workspace)==null?void 0:le.id,editorRef:W,savedFilterListOptions:C==null?void 0:C.map((Ne,se)=>({label:Ne.as,value:`${Ne.value}____${se}____${Ne.as}`,key:`${Ne.as}_${Ne.value}`})),onApplyFilter:q,functionOptions:ie}},NUe=({clientId:t,companyId:i,isLiveMode:e,externalDashboardId:n,userProvidedDashboardId:r,chartColors:M,isShowMetricCreateModal:a,setShowMetricCreateModal:u,metric:o,metricData:s})=>{var lt,kt,ii;const N={clientId:t,companyId:i,isLiveMode:e,externalDashboardId:n,userProvidedDashboardId:r,chartColors:M,isShowMetricCreateModal:a,setShowMetricCreateModal:u,metric:o,metricData:s},{isLoading:D,chartSettings:g,setShowSaveMetricModal:l,data:j,error:T,previewTableData:y,query:z,isShowSqlModal:A,setShowSqlModal:h,isEnablePivotTable:x,isEnableGauge:O,groupByList:d,hasNumberKeys:E,setShowChartCustomProperties:C,selectTable:k,setSelectTable:Q,isShowChartType:S,setShowChartType:b,isShowSaveMetricModal:Y,updateExternalMetric:m,createExternalMetric:R,dashboardOptions:P,saveError:W,setChartSettings:B,isShowChartCustomProperties:X,setBarRadius:F,setError:G,setLoading:J,setData:ee,setQuery:q,setGroupByList:ie,clientSubsetData:re,isShowSortPanel:le,setShowSortPanel:Ne,isShowFilters:se,setShowFilters:Ie,isCreatingMetric:Oe,isEnableSingleDimension:ye,isEnableSingleMetrics:$e,enabledCharts:Ve,setResetPallete:Ee}=uUe(N),Te={clientSubsetData:re,clientId:t,setError:G,setLoading:J,setData:ee,setQuery:q,setGroupByList:ie,chart:g.chartType,setChartSettings:B},{selectedDimensions:fe,setSelectedDimensions:Qe,metrics:ot,setMetrics:rt,onChangeTableSelection:ke,columnList:et,tableList:xe,configuration:Dt,onGenerateChart:ve,createdSorts:pt,setCreatedSorts:Ct,onApplySort:dt,createdFilters:Zt,setCreatedFilters:$t,getFilterDropDownType:Mt,workspaceId:It,editorRef:We,savedFilterListOptions:Tt,onApplyFilter:He,functionOptions:jt}=oUe(Te);return v.jsxs(v.Fragment,{children:[a&&v.jsxs("div",{className:Av.isShowMetricCreateModal,children:[v.jsx("div",{className:Av.metricCreateModalHeader,children:v.jsx(AQe,{heading:o?"Update Metric":"Create Metric",setShowMetricCreateModal:u,isDisableSaveBtn:!((lt=g.measure)!=null&<.length)&&!((ii=(kt=g.yAxisList)==null?void 0:kt.filter(gi=>gi))!=null&&ii.length)&&!g.singleValue,setShowSaveMetricModal:l})}),v.jsxs("div",{className:Av.metricCreateModalContent,children:[!o&&v.jsx(v.Fragment,{children:v.jsx(fQe,{setselectTable:Q,selectTable:k,tableList:xe,columnList:et,column:(fe==null?void 0:fe[0])||{value:"",label:""},setColumn:Qe,metrics:ot,setMetrics:rt,onChangeTableSelection:ke})}),v.jsx(Zke,{data:j,isUpdateMetric:!!o,error:T,isLoading:D,previewTableDataList:y,chartColors:M,chartSettings:g,setChartSettings:B,isDisableSqlBtn:!z,setShowSqlModal:h,isEnablePivotTable:x,groupbyList:d,hasNumberKeys:E,isEnableGauge:O,outputHeaderProps:{setShowChartCustomProperties:C,setShowChartType:b,setShowSortPanel:Ne,setShowFilters:Ie},metrics:ot,dimensions:fe,onGenerateChart:ve,setMetrics:rt,setColumn:Qe,isEnableSingleDimension:ye,isEnableSingleMetrics:$e,functionOptions:jt,configuration:Dt})]})]}),v.jsx(Fz,{headerTitle:"Generated Query",isOpen:A,onClose:()=>h(!1),children:v.jsx("div",{className:Av["query-modal"],children:z})}),v.jsx(Fz,{isOpen:Y,onClose:()=>l(!1),headerTitle:"Save To Dashboard",children:v.jsx(d6,{onCancel:()=>l(!1),onSubmit:o?m:R,error:W,defaultValues:o?{name:o.name,description:o.description,isLive:o.isLive,metricId:o.isCreatedByClient?o.metricId:`update_${o.metricId}_by_${t}_${Date.now()}`}:void 0,isCreatingMetric:Oe})}),v.jsx(aUe,{filtersPanelProps:{isOpen:se,onClose:()=>Ie(!1),filters:Zt,setCreatedFilters:$t,columnOptions:et,getFilterDropDownType:Mt,editorRef:We,workspaceId:It,onApplyFilter:He,savedFilterListOptions:Tt,currentSelectedTable:k}}),v.jsx(tUe,{SortPanelProps:{isOpen:le,onClose:()=>Ne(!1),createdSorts:pt,setCreatedSorts:Ct,columnOptions:et,onApplySort:dt,selectedTable:k}}),v.jsx(SMe,{chartTypePanelProps:{isOpen:S,onClose:()=>b(!1),enabledCharts:Ve,onChartChange:gi=>{B(ht=>({...ht,chartType:gi}))},selectedChart:g.chartType}}),v.jsx(eUe,{ChartAppearancePanelProps:{setChartSettings:B,chartSettings:g,isOpen:X,onClose:()=>C(!1),setBarRadius:F,setResetPallete:Ee}})]})},Stt={"form-container":"_form-container_aaw5c_1","field-container":"_field-container_aaw5c_5","field-label":"_field-label_aaw5c_9","field-wrapper":"_field-wrapper_aaw5c_13","field-inner-container":"_field-inner-container_aaw5c_17","field-value":"_field-value_aaw5c_21",fieldValueIcon:"_fieldValueIcon_aaw5c_25","field-add-btn":"_field-add-btn_aaw5c_29",fieldAddBtnIcon:"_fieldAddBtnIcon_aaw5c_33","field-value-container":"_field-value-container_aaw5c_37","field-prompt":"_field-prompt_aaw5c_41","dbn-group":"_dbn-group_aaw5c_1",tooltipWrapper:"_tooltipWrapper_aaw5c_45",tooltip:"_tooltip_aaw5c_45",dropdown:"_dropdown_aaw5c_57",filterDropdown:"_filterDropdown_aaw5c_61",filterValues:"_filterValues_aaw5c_65",columnText:"_columnText_aaw5c_69",disabled:"_disabled_aaw5c_73",checkIcon:"_checkIcon_aaw5c_77",generateButtonContainer:"_generateButtonContainer_aaw5c_80",generateButton:"_generateButton_aaw5c_80","modal-container":"_modal-container_aaw5c_87","filter-dropdown":"_filter-dropdown_aaw5c_91","editor-field":"_editor-field_aaw5c_95","tab-border":"_tab-border_aaw5c_99"};var vA={},zb={},Gte={exports:{}};(function(t,i){(function(){var e="ace",n=function(){return this}();!n&&typeof window<"u"&&(n=window);var r=function(N,D,g){if(typeof N!="string"){r.original?r.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(g=D),r.modules[N]||(r.payloads[N]=g,r.modules[N]=null)};r.modules={},r.payloads={};var M=function(N,D,g){if(typeof D=="string"){var l=o(N,D);if(l!=null)return g&&g(),l}else if(Object.prototype.toString.call(D)==="[object Array]"){for(var j=[],T=0,y=D.length;T<y;++T){var z=o(N,D[T]);if(z==null&&a.original)return;j.push(z)}return g&&g.apply(null,j)||!0}},a=function(N,D){var g=M("",N,D);return g==null&&a.original?a.original.apply(this,arguments):g},u=function(N,D){if(D.indexOf("!")!==-1){var g=D.split("!");return u(N,g[0])+"!"+u(N,g[1])}if(D.charAt(0)=="."){var l=N.split("/").slice(0,-1).join("/");for(D=l+"/"+D;D.indexOf(".")!==-1&&j!=D;){var j=D;D=D.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return D},o=function(N,D){D=u(N,D);var g=r.modules[D];if(!g){if(g=r.payloads[D],typeof g=="function"){var l={},j={id:D,uri:"",exports:l,packaged:!0},T=function(z,A){return M(D,z,A)},y=g(T,l,j);l=y||j.exports,r.modules[D]=l,delete r.payloads[D]}g=r.modules[D]=l||g}return g};function s(N){var D=n;N&&(n[N]||(n[N]={}),D=n[N]),(!D.define||!D.define.packaged)&&(r.original=D.define,D.define=r,D.define.packaged=!0),(!D.require||!D.require.packaged)&&(a.original=D.require,D.require=a,D.require.packaged=!0)}s(e)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(e,n,r){function M(a,u,o){Object.defineProperty(a,u,{value:o,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||M(String.prototype,"startsWith",function(a,u){return u=u||0,this.lastIndexOf(a,u)===u}),String.prototype.endsWith||M(String.prototype,"endsWith",function(a,u){var o=this;(u===void 0||u>o.length)&&(u=o.length),u-=a.length;var s=o.indexOf(a,u);return s!==-1&&s===u}),String.prototype.repeat||M(String.prototype,"repeat",function(a){for(var u="",o=this;a>0;)a&1&&(u+=o),(a>>=1)&&(o+=o);return u}),String.prototype.includes||M(String.prototype,"includes",function(a,u){return this.indexOf(a,u)!=-1}),Object.assign||(Object.assign=function(a){if(a==null)throw new TypeError("Cannot convert undefined or null to object");for(var u=Object(a),o=1;o<arguments.length;o++){var s=arguments[o];s!=null&&Object.keys(s).forEach(function(N){u[N]=s[N]})}return u}),Object.values||(Object.values=function(a){return Object.keys(a).map(function(u){return a[u]})}),Array.prototype.find||M(Array.prototype,"find",function(a){for(var u=this.length,o=arguments[1],s=0;s<u;s++){var N=this[s];if(a.call(o,N,s,this))return N}}),Array.prototype.findIndex||M(Array.prototype,"findIndex",function(a){for(var u=this.length,o=arguments[1],s=0;s<u;s++){var N=this[s];if(a.call(o,N,s,this))return s}}),Array.prototype.includes||M(Array.prototype,"includes",function(a,u){return this.indexOf(a,u)!=-1}),Array.prototype.fill||M(Array.prototype,"fill",function(a){for(var u=this,o=u.length>>>0,s=arguments[1],N=s>>0,D=N<0?Math.max(o+N,0):Math.min(N,o),g=arguments[2],l=g===void 0?o:g>>0,j=l<0?Math.max(o+l,0):Math.min(l,o);D<j;)u[D]=a,D++;return u}),Array.of||M(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(e,n,r){e("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(e,n,r){n.last=function(u){return u[u.length-1]},n.stringReverse=function(u){return u.split("").reverse().join("")},n.stringRepeat=function(u,o){for(var s="";o>0;)o&1&&(s+=u),(o>>=1)&&(u+=u);return s};var M=/^\s\s*/,a=/\s\s*$/;n.stringTrimLeft=function(u){return u.replace(M,"")},n.stringTrimRight=function(u){return u.replace(a,"")},n.copyObject=function(u){var o={};for(var s in u)o[s]=u[s];return o},n.copyArray=function(u){for(var o=[],s=0,N=u.length;s<N;s++)u[s]&&typeof u[s]=="object"?o[s]=this.copyObject(u[s]):o[s]=u[s];return o},n.deepCopy=function u(o){if(typeof o!="object"||!o)return o;var s;if(Array.isArray(o)){s=[];for(var N=0;N<o.length;N++)s[N]=u(o[N]);return s}if(Object.prototype.toString.call(o)!=="[object Object]")return o;s={};for(var N in o)s[N]=u(o[N]);return s},n.arrayToMap=function(u){for(var o={},s=0;s<u.length;s++)o[u[s]]=1;return o},n.createMap=function(u){var o=Object.create(null);for(var s in u)o[s]=u[s];return o},n.arrayRemove=function(u,o){for(var s=0;s<=u.length;s++)o===u[s]&&u.splice(s,1)},n.escapeRegExp=function(u){return u.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(u){return(""+u).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},n.getMatchOffsets=function(u,o){var s=[];return u.replace(o,function(N){s.push({offset:arguments[arguments.length-2],length:N.length})}),s},n.deferredCall=function(u){var o=null,s=function(){o=null,u()},N=function(D){return N.cancel(),o=setTimeout(s,D||0),N};return N.schedule=N,N.call=function(){return this.cancel(),u(),N},N.cancel=function(){return clearTimeout(o),o=null,N},N.isPending=function(){return o},N},n.delayedCall=function(u,o){var s=null,N=function(){s=null,u()},D=function(g){s==null&&(s=setTimeout(N,g||o))};return D.delay=function(g){s&&clearTimeout(s),s=setTimeout(N,g||o)},D.schedule=D,D.call=function(){this.cancel(),u()},D.cancel=function(){s&&clearTimeout(s),s=null},D.isPending=function(){return s},D}}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,n,r){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var M=typeof navigator=="object"?navigator:{},a=(/mac|win|linux/i.exec(M.platform)||["other"])[0].toLowerCase(),u=M.userAgent||"",o=M.appName||"";n.isWin=a=="win",n.isMac=a=="mac",n.isLinux=a=="linux",n.isIE=o=="Microsoft Internet Explorer"||o.indexOf("MSAppHost")>=0?parseFloat((u.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((u.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=u.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(u.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(u.split(" Chrome/")[1])||void 0,n.isEdge=parseFloat(u.split(" Edge/")[1])||void 0,n.isAIR=u.indexOf("AdobeAIR")>=0,n.isAndroid=u.indexOf("Android")>=0,n.isChromeOS=u.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(u)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,n,r){var M=e("./useragent"),a="http://www.w3.org/1999/xhtml";n.buildDom=function g(l,j,T){if(typeof l=="string"&&l){var y=document.createTextNode(l);return j&&j.appendChild(y),y}if(!Array.isArray(l))return l&&l.appendChild&&j&&j.appendChild(l),l;if(typeof l[0]!="string"||!l[0]){for(var z=[],A=0;A<l.length;A++){var h=g(l[A],j,T);h&&z.push(h)}return z}var x=document.createElement(l[0]),O=l[1],d=1;O&&typeof O=="object"&&!Array.isArray(O)&&(d=2);for(var A=d;A<l.length;A++)g(l[A],x,T);return d==2&&Object.keys(O).forEach(function(E){var C=O[E];E==="class"?x.className=Array.isArray(C)?C.join(" "):C:typeof C=="function"||E=="value"||E[0]=="$"?x[E]=C:E==="ref"?T&&(T[C]=x):E==="style"?typeof C=="string"&&(x.style.cssText=C):C!=null&&x.setAttribute(E,C)}),j&&j.appendChild(x),x},n.getDocumentHead=function(g){return g||(g=document),g.head||g.getElementsByTagName("head")[0]||g.documentElement},n.createElement=function(g,l){return document.createElementNS?document.createElementNS(l||a,g):document.createElement(g)},n.removeChildren=function(g){g.innerHTML=""},n.createTextNode=function(g,l){var j=l?l.ownerDocument:document;return j.createTextNode(g)},n.createFragment=function(g){var l=g?g.ownerDocument:document;return l.createDocumentFragment()},n.hasCssClass=function(g,l){var j=(g.className+"").split(/\s+/g);return j.indexOf(l)!==-1},n.addCssClass=function(g,l){n.hasCssClass(g,l)||(g.className+=" "+l)},n.removeCssClass=function(g,l){for(var j=g.className.split(/\s+/g);;){var T=j.indexOf(l);if(T==-1)break;j.splice(T,1)}g.className=j.join(" ")},n.toggleCssClass=function(g,l){for(var j=g.className.split(/\s+/g),T=!0;;){var y=j.indexOf(l);if(y==-1)break;T=!1,j.splice(y,1)}return T&&j.push(l),g.className=j.join(" "),T},n.setCssClass=function(g,l,j){j?n.addCssClass(g,l):n.removeCssClass(g,l)},n.hasCssString=function(g,l){var j=0,T;if(l=l||document,T=l.querySelectorAll("style")){for(;j<T.length;)if(T[j++].id===g)return!0}},n.removeElementById=function(g,l){l=l||document,l.getElementById(g)&&l.getElementById(g).remove()};var u,o=[];n.useStrictCSP=function(g){u=g,g==!1?s():o||(o=[])};function s(){var g=o;o=null,g&&g.forEach(function(l){N(l[0],l[1])})}function N(g,l,j){if(!(typeof document>"u")){if(o){if(j)s();else if(j===!1)return o.push([g,l])}if(!u){var T=j;!j||!j.getRootNode?T=document:(T=j.getRootNode(),(!T||T==j)&&(T=document));var y=T.ownerDocument||T;if(l&&n.hasCssString(l,T))return null;l&&(g+=`
|
|
1083
1162
|
/*# sourceURL=ace/css/`+l+" */");var z=n.createElement("style");z.appendChild(y.createTextNode(g)),l&&(z.id=l),T==y&&(T=n.getDocumentHead(y)),T.insertBefore(z,T.firstChild)}}}if(n.importCssString=N,n.importCssStylsheet=function(g,l){n.buildDom(["link",{rel:"stylesheet",href:g}],n.getDocumentHead(l))},n.scrollbarWidth=function(g){var l=n.createElement("ace_inner");l.style.width="100%",l.style.minWidth="0px",l.style.height="200px",l.style.display="block";var j=n.createElement("ace_outer"),T=j.style;T.position="absolute",T.left="-10000px",T.overflow="hidden",T.width="200px",T.minWidth="0px",T.height="150px",T.display="block",j.appendChild(l);var y=g&&g.documentElement||document&&document.documentElement;if(!y)return 0;y.appendChild(j);var z=l.offsetWidth;T.overflow="scroll";var A=l.offsetWidth;return z===A&&(A=j.clientWidth),y.removeChild(j),z-A},n.computedStyle=function(g,l){return window.getComputedStyle(g,"")||{}},n.setStyle=function(g,l,j){g[l]!==j&&(g[l]=j)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=M.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,M.isChromeOS&&(n.HI_DPI=!1),typeof document<"u"){var D=document.createElement("div");n.HI_DPI&&D.style.transform!==void 0&&(n.HAS_CSS_TRANSFORMS=!0),!M.isEdge&&typeof D.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),D=null}n.HAS_CSS_TRANSFORMS?n.translate=function(g,l,j){g.style.transform="translate("+Math.round(l)+"px, "+Math.round(j)+"px)"}:n.translate=function(g,l,j){g.style.top=Math.round(j)+"px",g.style.left=Math.round(l)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,n,r){/*
|
|
1084
1163
|
* based on code from:
|
|
1085
1164
|
*
|