@databrainhq/plugin 0.10.11 → 0.10.12
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/index.es.js +2 -2
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -55471,7 +55471,7 @@ const H_e = "_tableData_tdj5v_7", W_e = "_tableScroll_tdj5v_13", U_e = "_tableHe
|
|
|
55471
55471
|
}
|
|
55472
55472
|
) }),
|
|
55473
55473
|
c ? /* @__PURE__ */ I.jsxs("span", { className: kt.pageStyle, children: [
|
|
55474
|
-
f.offset,
|
|
55474
|
+
f.offset + 1,
|
|
55475
55475
|
"-",
|
|
55476
55476
|
f.offset + r.length,
|
|
55477
55477
|
" of",
|
|
@@ -55492,7 +55492,7 @@ const H_e = "_tableData_tdj5v_7", W_e = "_tableScroll_tdj5v_13", U_e = "_tableHe
|
|
|
55492
55492
|
type: "button",
|
|
55493
55493
|
className: kt.button,
|
|
55494
55494
|
onClick: () => {
|
|
55495
|
-
c ? l == null || l(!0) : E.
|
|
55495
|
+
c ? l == null || l(!0) : E.previousPage();
|
|
55496
55496
|
},
|
|
55497
55497
|
isDisabled: c ? !h : k.from <= 1,
|
|
55498
55498
|
children: "Prev"
|
package/dist/index.umd.js
CHANGED
|
@@ -604,7 +604,7 @@ echarts.use([`+M+"]);":"Unknown series "+S))}return}if(h==="tooltip"){if(b){proc
|
|
|
604
604
|
* @license MIT license.
|
|
605
605
|
* @copyright (c) 2099 Kent C. Dodds
|
|
606
606
|
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
|
|
607
|
-
*/const hi={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function e0e(r,t,e){var n;if(e=e||{},e.threshold=(n=e.threshold)!=null?n:hi.MATCHES,!e.accessors){const o=T5(r,t,e);return{rankedValue:r,rank:o,accessorIndex:-1,accessorThreshold:e.threshold,passed:o>=e.threshold}}const i=i0e(r,e.accessors),a={rankedValue:r,rank:hi.NO_MATCH,accessorIndex:-1,accessorThreshold:e.threshold,passed:!1};for(let o=0;o<i.length;o++){const s=i[o];let l=T5(s.itemValue,t,e);const{minRanking:c,maxRanking:u,threshold:h=e.threshold}=s.attributes;l<c&&l>=hi.MATCHES?l=c:l>u&&(l=u),l=Math.min(l,u),l>=h&&l>a.rank&&(a.rank=l,a.passed=!0,a.accessorIndex=o,a.accessorThreshold=h,a.rankedValue=s.itemValue)}return a}function T5(r,t,e){return r=I5(r,e),t=I5(t,e),t.length>r.length?hi.NO_MATCH:r===t?hi.CASE_SENSITIVE_EQUAL:(r=r.toLowerCase(),t=t.toLowerCase(),r===t?hi.EQUAL:r.startsWith(t)?hi.STARTS_WITH:r.includes(` ${t}`)?hi.WORD_STARTS_WITH:r.includes(t)?hi.CONTAINS:t.length===1?hi.NO_MATCH:t0e(r).includes(t)?hi.ACRONYM:r0e(r,t))}function t0e(r){let t="";return r.split(" ").forEach(n=>{n.split("-").forEach(a=>{t+=a.substr(0,1)})}),t}function r0e(r,t){let e=0,n=0;function i(l,c,u){for(let h=u,f=c.length;h<f;h++)if(c[h]===l)return e+=1,h+1;return-1}function a(l){const c=1/l,u=e/t.length;return hi.MATCHES+u*c}const o=i(t[0],r,0);if(o<0)return hi.NO_MATCH;n=o;for(let l=1,c=t.length;l<c;l++){const u=t[l];if(n=i(u,r,n),!(n>-1))return hi.NO_MATCH}const s=n-o;return a(s)}function I5(r,t){let{keepDiacritics:e}=t;return r=`${r}`,e||(r=Jye(r)),r}function n0e(r,t){let e=t;typeof t=="object"&&(e=t.accessor);const n=e(r);return n==null?[]:Array.isArray(n)?n:[String(n)]}function i0e(r,t){const e=[];for(let n=0,i=t.length;n<i;n++){const a=t[n],o=a0e(a),s=n0e(r,a);for(let l=0,c=s.length;l<c;l++)e.push({itemValue:s[l],attributes:o})}return e}const A5={maxRanking:1/0,minRanking:-1/0};function a0e(r){return typeof r=="function"?A5:{...A5,...r}}const It={"table-loader-container":"_table-loader-container_tdj5v_1",tableData:"_tableData_tdj5v_7",tableScroll:"_tableScroll_tdj5v_13",tableHeadCol:"_tableHeadCol_tdj5v_19",resizer:"_resizer_tdj5v_25",resizing:"_resizing_tdj5v_37",tableRow:"_tableRow_tdj5v_43",tableRowCol:"_tableRowCol_tdj5v_49",truncateText:"_truncateText_tdj5v_57",row:"_row_tdj5v_65",container:"_container_tdj5v_71",table:"_table_tdj5v_1",previewTable:"_previewTable_tdj5v_83",preview:"_preview_tdj5v_83",searchButton:"_searchButton_tdj5v_95",previewText:"_previewText_tdj5v_101",noData:"_noData_tdj5v_107",error:"_error_tdj5v_113",errorMsg:"_errorMsg_tdj5v_119",tableIcon:"_tableIcon_tdj5v_125",stripedRow:"_stripedRow_tdj5v_131",rowHover:"_rowHover_tdj5v_137",rightBorder:"_rightBorder_tdj5v_143",searchContainer:"_searchContainer_tdj5v_149",sortButton:"_sortButton_tdj5v_155",searchTab:"_searchTab_tdj5v_161",searchTabInput:"_searchTabInput_tdj5v_167",searchTabIcon:"_searchTabIcon_tdj5v_173",noDataHead:"_noDataHead_tdj5v_179",noDataBody:"_noDataBody_tdj5v_185",showSort:"_showSort_tdj5v_191",noSort:"_noSort_tdj5v_197",pagination:"_pagination_tdj5v_203",rowStyle:"_rowStyle_tdj5v_209",rowText:"_rowText_tdj5v_215",rowsDropdown:"_rowsDropdown_tdj5v_221",pageStyle:"_pageStyle_tdj5v_227",buttonContainer:"_buttonContainer_tdj5v_233",button:"_button_tdj5v_233",paginationWrapper:"_paginationWrapper_tdj5v_251",current:"_current_tdj5v_257",textTruncate:"_textTruncate_tdj5v_263"},o0e=({value:r,onChange:t,debounce:e=500,...n})=>{const[i,a]=$.useState(r);return $.useEffect(()=>{a(r)},[r]),$.useEffect(()=>{const o=setTimeout(()=>{t(i)},e);return()=>clearTimeout(o)},[e,t,i]),A.jsxs("div",{className:`${It.searchTab} ${n.className||""}`,children:[A.jsx("input",{...n,value:i,onChange:o=>a(o.target.value),className:It.searchTabInput}),i.toString().length?"":A.jsx(lL,{className:It.searchTabIcon,color:"#C7C7C7",width:"30px",height:"30px"})]})},s0e="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDAgNTAwIj48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZTojMTgyYzYwO30uY2xzLTEsLmNscy0ye2ZpbGw6bm9uZTtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7fS5jbHMtM3tmaWxsOiM1ODY1ZjY7b3BhY2l0eTouMTt9LmNscy00e2ZpbGw6I2YyZjNmNDt9LmNscy01e2ZpbGw6I2MxYzdjOTt9LmNscy02e2ZpbGw6IzE4MmM2MDt9LmNscy0ye3N0cm9rZTojNTg2NWY2O3N0cm9rZS13aWR0aDo0cHg7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0ibTI3MS4xMSwxNzkuNzJsLS4wOSwyMC4zM3MuMTksNC4wNS4zOCw0LjUyLjc1LDEuODgsMS40MSwyLjM1LDEuMjcuOTksMi4yMSwxLjMyLDEuMTguNjEsMi42NC42MSwyMi42OC4wNSwyMi42OC4wNWwtMjkuMjItMjkuMThaIi8+PGxpbmUgY2xhc3M9ImNscy0xIiB4MT0iMjAzLjcxIiB5MT0iMjA4LjAxIiB4Mj0iMjM0LjkyIiB5Mj0iMjA4LjAxIi8+PGxpbmUgY2xhc3M9ImNscy0yIiB4MT0iMjAzLjcxIiB5MT0iMTk3LjM0IiB4Mj0iMjQ4LjA0IiB5Mj0iMTk3LjM0Ii8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIyMDIuMyIg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laWdodD0iNCIvPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iMjQyLjY5IiB5PSIyNzcuOTYiIHdpZHRoPSI4LjQ3IiBoZWlnaHQ9IjQiLz48cmVjdCBjbGFzcz0iY2xzLTQiIHg9IjI2MC42MiIgeT0iMjc3Ljk2IiB3aWR0aD0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyNzguODMiIHk9IjI3Ny45NiIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjwvZz48Zz48cmVjdCBjbGFzcz0iY2xzLTQiIHg9IjIwNi4xNyIgeT0iMjg2LjQzIiB3aWR0aD0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyMjQuMjMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iMjQyLjY5IiB5PSIyODYuNDMiIHdpZHRoPSI4LjQ3IiBoZWlnaHQ9IjQiLz48cmVjdCBjbGFzcz0iY2xzLTQiIHg9IjI2MC42MiIgeT0iMjg2LjQzIiB3aWR0aD0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyNzguODMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjwvZz48L3N2Zz4=",cl=r=>A.jsxs("svg",{viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...r,children:[A.jsx("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:.5}),A.jsx("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z",children:A.jsx("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})})]}),l0e=r=>A.jsx("svg",{viewBox:"0 0 32 32",width:"1.2em",height:"1.2em",...r,children:A.jsx("path",{fill:"currentColor",d:"m16 28l-7-7l1.41-1.41L16 25.17l5.59-5.58L23 21l-7 7zm0-24l7 7l-1.41 1.41L16 6.83l-5.59 5.58L9 11l7-7z"})}),u0e=r=>A.jsx("svg",{viewBox:"0 0 32 32",width:"1.2em",height:"1.2em",...r,children:A.jsx("path",{fill:"currentColor",d:"m16 4l7 7l-1.4 1.4L16 6.8l-5.6 5.6L9 11z"})}),c0e=r=>A.jsx("svg",{viewBox:"0 0 32 32",width:"1.2em",height:"1.2em",...r,children:A.jsx("path",{fill:"currentColor",d:"m16 28l-7-7l1.4-1.4l5.6 5.6l5.6-5.6L23 21z"})}),h0e=Fye(),as=({data:r,isLoading:t,error:e,tableSettings:n,tableName:i,className:a="",onColumnSizingChange:o,onChartReady:s,onChangePage:l,isExternalChart:c,isEnableNextBtn:u,isEnablePrevBtn:h,paginationInfo:f={limit:10,offset:0,totalRecords:10},setChartSettings:d})=>{var O,R;const{divStyle:p,headerStyle:v}=$.useMemo(()=>{const j={width:"100%",height:(n==null?void 0:n.lineGap)==="small"?"1.5rem":"2.5rem",fontSize:(n==null?void 0:n.lineGap)==="small"?"0.7rem":"1rem",display:"flex",alignItems:"center",justifyContent:n!=null&&n.contentAlignment?`${n.contentAlignment}`:""},z={width:"100%",color:"#182c60",fontSize:(n==null?void 0:n.lineGap)==="small"?"0.7rem":"1rem",height:(n==null?void 0:n.lineGap)==="small"?"1.5rem":"2.5rem",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"500"};return{divStyle:j,headerStyle:z}},[n==null?void 0:n.lineGap,n==null?void 0:n.contentAlignment]),[g,m]=$.useState([]),[y,b]=$.useState({}),[x,w]=$.useState({label:((O=ni.tableSettings)==null?void 0:O.defaultRowSize)||"10",value:((R=ni.tableSettings)==null?void 0:R.defaultRowSize)||"10"}),[_,D]=$.useState(n==null?void 0:n.columnSizing),[I,C]=$.useState(""),T=(j,z,U,P)=>{const B=e0e(j.getValue(z),U);return P({itemRank:B}),B.passed},[S,M]=$.useState({pageIndex:0,pageSize:10});$.useEffect(()=>{o==null||o(_)},[_]),$.useEffect(()=>{var U,P;if(!(n!=null&&n.defaultRowSize))return;const j=Jv.find(B=>B.value===n.defaultRowSize),z={label:((U=ni.tableSettings)==null?void 0:U.defaultRowSize)||"10",value:((P=ni.tableSettings)==null?void 0:P.defaultRowSize)||"10"};w(j||z)},[n==null?void 0:n.defaultRowSize]);const L=$.useMemo(()=>{if(!r||!Array.isArray(r))return[];const{pageIndex:j,pageSize:z}=S;return r.slice(j*z,(j+1)*z)},[S,r,I]),E=$.useMemo(()=>Object.keys((r==null?void 0:r[0])||{}).map(j=>h0e.accessor(j,{header:()=>j,cell:z=>{const U=z.row.original[j];return typeof U=="object"?JSON.stringify(U):typeof U=="boolean"?U?"true":"false":U}})),[r==null?void 0:r[0]]),N=qye({data:I?Array.isArray(r)?r:[]:L,columns:E,filterFns:{fuzzy:T},state:{sorting:g,globalFilter:I,pagination:S,..._?{columnSizing:_}:{}},enableGlobalFilter:!0,onRowSelectionChange:b,onSortingChange:m,globalFilterFn:T,getCoreRowModel:Bye(),getFilteredRowModel:Uye(),getSortedRowModel:Gye(),onGlobalFilterChange:C,onPaginationChange:M,manualPagination:!0,debugTable:!1,enableColumnResizing:!0,columnResizeMode:"onChange",onColumnSizingChange:D});$.useEffect(()=>{N.setPageSize(Number(x.value))},[x,N]);const k=$.useMemo(()=>{const{pageIndex:j,pageSize:z}=N.getState().pagination,U=I?N.getRowModel().rows.length:(r==null?void 0:r.length)||0,P=U===0?0:z*j+1,B=U<=z*(j+1)?U:z*(j+1);return{from:P,to:B,total:U}},[I,r,N.getState().pagination,N.getRowModel().rows.length]);return $.useEffect(()=>{N.getIsSomeColumnsVisible()&&(s==null||s())},[N.getIsSomeColumnsVisible()]),A.jsx("div",{className:`${It.container} ${a}`,children:A.jsxs("div",{className:It.previewTable,children:[n!=null&&n.enableTableSearch||n!=null&&n.showTableTitle?A.jsxs("div",{className:n.showTableTitle?It.preview:It.searchButton,children:[n.showTableTitle&&A.jsx(ye,{styleClass:"font-14c",variant:"h1",className:It.previewText,children:i}),n.enableTableSearch&&A.jsx(o0e,{value:I,onChange:j=>C(String(j)),placeholder:"Search"})]}):null,A.jsxs("div",{className:It.tableData,children:[t&&!(r!=null&&r.length)&&A.jsx("div",{className:It["table-loader-container"],children:A.jsx(cl,{style:{width:"50px",height:"50px",color:"blue"}})}),!!(r!=null&&r.length)&&!t&&A.jsx("div",{className:It.tableScroll,children:A.jsxs("table",{className:It.table,children:[A.jsx("thead",{children:N.getHeaderGroups().map(j=>A.jsx("tr",{className:It.row,children:j.headers.map(z=>A.jsxs("th",{className:It.tableHeadCol,colSpan:z.colSpan,style:{width:z.getSize()},children:[A.jsx("button",{onMouseDown:z.getResizeHandler(),onTouchStart:z.getResizeHandler(),onDoubleClick:z.column.resetSize,className:`${It.resizer} ${z.column.getIsResizing()?It.resizing:""}`,type:"button",title:"Resize Column"}),n!=null&&n.enableSorting?A.jsxs("div",{className:z.column.getCanSort()?It.sortButton:"",onClick:z.column.getToggleSortingHandler(),children:[z.isPlaceholder?null:A.jsx("div",{style:v,children:$0(z.column.columnDef.header,z.getContext())}),{asc:A.jsx(u0e,{color:"#182c60"}),desc:A.jsx(c0e,{color:"#182c60"})}[z.column.getIsSorted()]??A.jsx(l0e,{color:"#182c60"})]}):A.jsx(A.Fragment,{children:z.isPlaceholder?null:A.jsx("div",{style:v,children:A.jsx(ye,{variant:"p",styleClass:"custom",className:It.truncateText,children:$0(z.column.columnDef.header,z.getContext())})})})]},z.id))},j.id))}),A.jsx("tbody",{children:(I?N.getRowModel().rows.slice(S.pageSize*S.pageIndex,S.pageSize*(1+S.pageIndex)):N.getRowModel().rows).map((j,z)=>A.jsx("tr",{className:`${It.tableRow} ${n!=null&&n.showRowHover?It.rowHover:""} ${n!=null&&n.enableStripedRows&&Number(z)%2!==0?It.stripedRow:""}`,children:j.getVisibleCells().map(U=>A.jsxs("td",{className:`${It.tableRowCol} ${n!=null&&n.hideVerticalDivider?"":It.rightBorder}`,title:typeof U.getValue()=="object"?JSON.stringify(U.getValue()):U.getValue(),children:[!!n&&A.jsx("div",{style:p,children:A.jsx(ye,{variant:"p",styleClass:"custom",className:It.truncateText,children:$0(U.column.columnDef.cell,U.getContext())})}),!n&&A.jsx("div",{style:{textAlign:"center",width:"100%"},children:$0(U.column.columnDef.cell,U.getContext())})]},U.id))},j.id))})]})}),!(r!=null&&r.length)&&!t&&!e.length&&A.jsxs("div",{className:It.noData,children:[A.jsx("img",{src:s0e,alt:"no-data",width:"400px",height:"400px"}),A.jsx(ye,{styleClass:"font-14c",variant:"h1",className:It.noDataHead,children:"No data tables queried"}),A.jsx(ye,{styleClass:"font-14",variant:"p",className:It.noDataBody,children:"Type your query and input fields beside to generate results and explore data"})]}),e&&A.jsx("div",{className:It.error,children:A.jsx(ye,{styleClass:"primary",className:It.errorMsg,variant:"p",children:e})})]}),r&&!(n!=null&&n.disablePagination)&&A.jsxs("div",{className:It.pagination,children:[A.jsx("div",{className:It.rowStyle,children:A.jsx(Pr,{onChange:j=>{w(j),c&&(l==null||l(!1,parseInt(j.value,10)),d==null||d(z=>({...z,tableSettings:{...z.tableSettings,defaultRowSize:j.value}})))},selectedOption:x,options:Jv,labelVariant:"static",dropdownAbove:!0,buttonClass:It.rowsDropdown})}),c?A.jsxs("span",{className:It.pageStyle,children:[f.offset,"-",f.offset+r.length," of"," ",f.totalRecords]}):A.jsxs("span",{className:It.pageStyle,children:[k.from,"-",k.to," of ",k.total]}),A.jsxs("div",{className:It.buttonContainer,children:[A.jsx(Me,{variant:"custom",type:"button",className:It.button,onClick:()=>{c?l==null||l(!0):N.nextPage()},isDisabled:c?!h:k.from<=1,children:"Prev"}),A.jsx(Me,{variant:"custom",type:"button",className:It.button,onClick:()=>{c?l==null||l(!1):N.nextPage()},isDisabled:c?!u:k.to>=k.total,children:"Next"})]})]})]})})},L5=["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)"],E5=({data:r,measure:t,sankeyValues:e,singleValue:n,step:i,xAxis:a,yAxisList:o,seriesField:s,isTimeSeries:l,selectedFormat:c})=>{const u=Array.isArray(r)?r.map(x=>a&&x[a]):[],h=o==null?void 0:o.map((x,w)=>({label:x,data:Array.isArray(r)?r.map(_=>_[o[w]]):[],borderColor:L5[w]})),f=Array.isArray(r)&&i&&t?r.map(x=>({value:x[t],name:x[i]})):[],d=e==null?void 0:e.map((x,w)=>Array.isArray(r)?r.map(_=>_[e[w]]):[]),p=Array.isArray(r)&&n?r.map(x=>x[n]):[],v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g={yearly:x=>x.getFullYear(),monthly:x=>{const w=x.getMonth(),_=x.getFullYear();return`${v[w]} - ${_}`},weekly:x=>{const w=new Date(x.getTime());return w.setDate(x.getDate()-x.getDay()),w.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:x=>`${x.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:x=>{const w=x.getMonth(),_=Math.floor(w/3)+1,D=x.getFullYear();return`Q${_} ${D}`}},m=Array.from(new Set(r==null?void 0:r.map(x=>x[s||""]))),y=Array.from(new Set(r==null?void 0:r.map(x=>{if(l&&x[a||""]){const w=new Date(x[a||""]),_=g[c||"monthly"];return _(w)}return x[a||""]}))),b=m.map(x=>{const w=r==null?void 0:r.filter(D=>D[s||""]===x),_=y.map(D=>{var C;if(l&&D){const T=g[c||"monthly"],S=w==null?void 0:w.filter(L=>{const E=new Date(L[a||""]);return T(E)===D});return(S==null?void 0:S.reduce((L,E)=>L+(E[(o==null?void 0:o[0])||""]||0),0))||0}return((C=w==null?void 0:w.find(T=>T[a||""]===D))==null?void 0:C[(o==null?void 0:o[0])||""])||0});return{name:x,data:_}});return{labels:u,datasets:h,funnelData:f,sankeyData:d,singleValueData:p,xAxisData:y,seriesData:b}},f0e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],N5=({dataArray:r,timeStampKey:t,type:e,valuekeys:n,groupBy:i,labelSettings:a,customSettings:o,backGroundColor:s})=>n.map(u=>r.sort((f,d)=>new Date(f[t]).getTime()-new Date(d[t]).getTime()).reduce((f,d)=>{const v={yearly:m=>m.getFullYear(),monthly:m=>{const y=m.getMonth(),b=m.getFullYear();return`${f0e[y]} - ${b}`},weekly:m=>{const y=new Date(m.getTime());return y.setDate(m.getDate()-m.getDay()),y.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:m=>`${m.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:m=>{const y=m.getMonth(),b=Math.floor(y/3)+1,x=m.getFullYear();return`Q${b} ${x}`}}[i],g=v(new Date(d[t]));return f[g]||(f[g]=0),f[g]+=d[u],f},{})).map((u,h)=>({data:Object.entries(u),type:e==="area"?"line":e==="stack"?"bar":e,name:n[h],label:{show:a.show,position:a.position},emphasis:{focus:"series"},...e==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...e==="bar"?{barWidth:`${(o==null?void 0:o.barWidth)||0}%`,showBackground:s==null?void 0:s.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:o==null?void 0:o.barRadius}}:{},...e==="stack"?{stack:"total"}:{}})),JC=({data:r,timeStampKey:t,valuekeys:e})=>!Array.isArray(r)||r.length<2?!1:r.every(n=>{const i=new Date(n[t]);return!Number.isNaN(i.getTime())&&e.every(a=>typeof n[a]=="number")}),or=(r,t)=>r.length>t?`${r.slice(0,t)}...`:r,k5=(r,t)=>{let e="";if(t)switch(parseInt(r,10).toString().length){case 1:case 2:case 3:e=r;break;case 4:e=`${r.toString().slice(0,1)}.${r.toString().slice(1,3)}k`;break;case 5:e=`${r.toString().slice(0,2)}.${r.toString().slice(2,4)}k`;break;case 6:e=`${r.toString().slice(0,3)}.${r.toString().slice(3,5)}k`;break;case 7:e=`${r.toString().slice(0,1)}.${r.toString().slice(1,3)}M`;break;case 8:e=`${r.toString().slice(0,2)}.${r.toString().slice(2,4)}M`;break;case 9:e=`${r.toString().slice(0,3)}.${r.toString().slice(3,5)}M`;break;case 10:e=`${r.toString().slice(0,1)}.${r.toString().slice(1,3)}B`;break}else switch(parseInt(r,10).toString().length){case 1:case 2:case 3:e=r;break;case 4:e=`${r.toString().slice(0,1)}k`;break;case 5:e=`${r.toString().slice(0,2)}k`;break;case 6:e=`${r.toString().slice(0,3)}k`;break;case 7:e=`${r.toString().slice(0,1)}M`;break;case 8:e=`${r.toString().slice(0,2)}M`;break;case 9:e=`${r.toString().slice(0,3)}M`;break;case 10:e=`${r.toString().slice(0,1)}B`;break}return e},d0e=(r,t)=>{const e=new Intl.NumberFormat;switch(t){case"original":return r;case"3s":case"adaptive":return k5(r,!0);case"percent":return`${r}%`;case"d":return parseInt(r,10).toLocaleString();case"1s":{let n=r.toString().slice(0,1);const i=Math.floor(Number(r));for(let o=1;o<i.toString().length;o+=1)n+=0;return k5(n,!1)}case"1f":{const n=Number(r).toFixed(1),i=e.format(n);return r.toString().includes(".")?i:`${i}.${Array(2).join("0")}`}case"2f":{const n=Number(r).toFixed(2),i=e.format(n);return r.toString().includes(".")?r.toString().split(".")[1].length>1?i:`${i}${Array(2).join("0")}`:`${i}.${Array(3).join("0")}`}case"3f":{const n=Number(r).toFixed(3),i=e.format(n);if(r.toString().includes(".")){const a=r.toString().split(".");return a[1].length>2?i:a[1].length===2?`${i}${Array(2).join("0")}`:`${i}${Array(3).join("0")}`}return`${i}.${Array(4).join("0")}`}case"+":return`+${e.format(r)}`;case"$":{const n=Number(r).toFixed(2),i=e.format(n);return r.toString().includes(".")?r.toString().split(".")[1].length>1?`$${i}`:`$${i}${Array(2).join("0")}`:`$${i}.${Array(3).join("0")}`}case"1%":{const n=Number(r)*100,i=Number(n).toFixed(1),a=e.format(i);return n.toString().includes(".")?`${a}%`:`${a}.${Array(2).join("0")}%`}case"2%":{const n=Number(r)*100,i=Number(n).toFixed(2),a=e.format(i);return n.toString().includes(".")?r.toString().split(".")[1].length>1?`${a}%`:`${a}.${Array(2).join("0")}`:`${a}.${Array(3).join("0")}%`}case"3%":{const n=r*100,i=Number(n).toFixed(3),a=e.format(i);return n.toString().includes(".")?r.toString().split(".")[1].length>1?`${a}%`:`${a}.${Array(3).join("0")}`:`${a}.${Array(4).join("0")}%`}case"ms1":{const n=Math.floor(Number(r)/1e3),i=Number(r)%1e3;return`${n}.${i.toString().slice(0,1)}s`}case"ms2":{const n=Math.floor(Number(r)/1e3),i=Math.floor(Number(r)%1e3),a=Number(r)-Math.floor(Number(r)),o=Math.floor(a*1e3),s=a*1e3-o,l=Math.floor(s*1e3);let c="";return n&&(c+=`${n}s `),i&&(c+=`${i}ms `),o&&(c+=`${o}µs`),l&&(c+=`${l}ns`),c}case"4r":return Math.floor(Math.round(Number(r)));default:return r}},p0e=({chartOptions:r,data:t=[],colors:e})=>{var x,w,_,D,I,C,T,S,M,L,E,N,k,O,R,j,z,U;const n=(r==null?void 0:r.chartType)===pe.timeSeries?JC({data:t,timeStampKey:r.xAxis||"",valuekeys:r.yAxisList||[]}):!1,{labels:i,datasets:a,funnelData:o,sankeyData:s,singleValueData:l,seriesData:c,xAxisData:u}=E5({data:t,measure:r.measure,step:r.step,xAxis:r.xAxis,yAxisList:r.yAxisList,singleValue:r.singleValue,sankeyValues:r.sankeyValues,seriesField:r.seriesField,isTimeSeries:n,selectedFormat:((w=(x=r.timeSeriesSettings)==null?void 0:x.groupBySettings)==null?void 0:w.value)||"monthly"}),h={...ni.margins,...r.margins},f={...ni.labelSettings,...r.labelSettings},d={...ni.legendSettings,...r.legendSettings},p={...ni.customSettings,...r.customSettings},v={...ni.tableSettings,...r.tableSettings},g={...ni.axisSettings,...r.axisSettings},m={...ni.backGroundColor,...r.backGroundColor},y={...ni.timeSeriesSettings,seriesType:((_=r.yAxisList)==null?void 0:_.map(P=>({column:P,type:"bar"})))||[],...r.timeSeriesSettings},b={...e!=null&&e.length?{color:e}:{}};switch(r.chartType){case pe.line:{Object.assign(b,{...b,tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"line",lineStyle:{color:"rgba(0,0,0,0.2)",width:1,type:"solid"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},xAxis:{type:"category",boundaryGap:!1,data:r.isMultiDimension?u||[]:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}},data:r.isMultiDimension?c==null?void 0:c.map(P=>P.name||"line"):a==null?void 0:a.map(P=>P.label)},series:r.isMultiDimension?c.map(P=>({data:P.data,type:"line",name:P.name||"line",label:{show:f.show,position:f.position},emphasis:{focus:"series"}})):a==null?void 0:a.map(P=>({data:P.data,type:"line",name:P.label,label:{show:f.show,position:f.position},emphasis:{focus:"series"}}))});break}case pe.bar:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:r.isMultiDimension?u||[]:i,axisTick:{alignWithLabel:!0},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",interval:0,rotate:p.xRotation,hideOverlap:!0,formatter(P){return or(P,f.truncateLabelValue||14)}},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{data:r.isMultiDimension?c==null?void 0:c.map(P=>P.name||"series-bar"):a==null?void 0:a.map(P=>P.label),show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:r.isMultiDimension?c.map(P=>({data:P.data,type:"bar",name:P.name||"",barWidth:`${p.barWidth||0}%`,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}})):a==null?void 0:a.map(P=>({data:P.data,type:"bar",name:P.label,barWidth:`${p.barWidth||0}%`,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}}))});break}case pe.stack:{const P=(()=>{if(!a||!p.showFullStacked)return;const B={};return a.forEach(H=>{const V=H.data.map((G,Y)=>{const q=a.reduce((K,W)=>K+W.data[Y],0);return(G/q*100).toFixed(2)});B[H.label]=V}),B})();Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},formatter:B=>`${B.map(H=>`${H.seriesName}: ${H.value}<br />`).join("")}`},xAxis:{type:"category",data:r.isMultiDimension?u||[]:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}},yAxis:{type:"value",max:p.showFullStacked?100:void 0,position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none",formatter:"{value} %"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:r.isMultiDimension?c==null?void 0:c.map(B=>B.name||"series-stack"):a==null?void 0:a.map(B=>B.label),formatter(B){return`{a|${or(B,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(B){return B.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:r.isMultiDimension?c.map(B=>({data:B.data,type:"bar",stack:"total",name:B.name||"",barWidth:`${p.barWidth||0}%`,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius},emphasis:{focus:"series"}})):a==null?void 0:a.map(B=>({data:p.showFullStacked?P[B.label]:B.data,type:"bar",name:B.label,stack:"x",barWidth:`${p.barWidth}%`,emphasis:{focus:"series"},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}}))});break}case pe.area:{a==null||a.map(P=>Object.assign(P,{fill:!0})),Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:r.isMultiDimension?[]:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}}],yAxis:[{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}}],series:a==null?void 0:a.map(P=>({data:P.data,type:"line",name:P.label,stack:"Total",areaStyle:{},emphasis:{focus:"series"},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}))});break}case pe.boxplot:{const P=[],B=[];a==null||a.map(H=>{P.push(H.data),B.push(H.label)}),Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},title:[{text:"Box Plot",left:"center"}],legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(H=>H.label),formatter(H){return`{a|${or(H,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(H){return H.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},dataset:[{source:P},{transform:{type:"boxplot",config:{itemNameFormatter:"expr {value}"}}},{fromDatasetIndex:1,fromTransformResult:1}],tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",boundaryGap:!0,nameGap:30,splitArea:{show:!1},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none"}},yAxis:{type:"value",position:g.axis,splitArea:{show:!0},splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:[{name:"boxplot",type:"boxplot",datasetIndex:1},{name:"outlier",type:"scatter",datasetIndex:2}]});break}case pe.bubble:{const P=[],B=()=>{const V="0123456789ABCDEF";let G="#";for(let Y=0;Y<6;Y+=1)G+=V[Math.floor(Math.random()*16)];return G};let H=8;a==null||a.map(V=>{const G=[];let Y=0;const q=V.label;V.data.map(K=>{G.push([i[Y],K,q]),Y+=1}),P.push(G)}),Object.assign(b,{...b,tooltip:{backgroundColor:"black",textStyle:{color:"white"}},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:P.map(V=>V[0][2]),formatter(V){return`{a|${or(V,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(V){return V.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none",lineStyle:{type:"dashed"}},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(V){return or(V,f.truncateLabelValue||14)}}},yAxis:{position:g.axis,scale:!0,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none",lineStyle:{type:"dashed"}},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:P.map(V=>{H+=3;const G=B();return{name:V[0][2],data:V.map(Y=>({name:Y[0],value:Y[1]})),type:"scatter",symbolSize:H,emphasis:{focus:"series"},itemStyle:{color:G},label:{show:f.show,position:f.position}}})});break}case pe.combo:{const P=(D=r.yAxisList)==null?void 0:D.map((B,H)=>({type:H===0?"line":"bar",data:t.map(V=>V[B]),name:B,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}));Object.assign(b,{...b,grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(B=>B.label),formatter(B){return`{a|${or(B,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(B){return B.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},xAxis:[{type:"category",data:i,axisPointer:{type:"shadow"},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}}],yAxis:[{type:"value",interval:0,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},{type:"value",interval:0,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}}],series:P});break}case pe.pie:{const P=()=>({type:"pie",radius:"80%",data:(a==null?void 0:a.map((G,Y)=>({value:G.data,name:i[Y]||"undefined"})))||[],label:{show:!1},labelLine:{show:!1}}),B=()=>{let V=100;const G=[];return a==null||a.map(Y=>{const q=[];let K=0;Y.data.map(W=>{const Q={value:W,name:i[K]};q.push(Q),K+=1}),G.push([Y.label,q])}),G.map(Y=>(V-=20,{name:Y[0],type:"pie",radius:`${V}%`,data:Y[1],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{show:f.show,position:f.position},labelLine:{show:!1}}))},H=a!=null&&a.length&&((C=(I=a[0])==null?void 0:I.data)==null?void 0:C.length)>1?B():P();Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"}},legend:{data:a!=null&&a.length&&((S=(T=a[0])==null?void 0:T.data)==null?void 0:S.length)>1||a==null?void 0:a[0],show:d.show,top:d.position==="horizontal"?"420px":d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,type:"scroll",formatter(V){return`{a|${or(V,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(V){return V.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:H});break}case pe.doughnut:{const P=()=>{const V=a==null?void 0:a.map((G,Y)=>({value:G.data,name:i[Y]||"undefined"}));return{type:"pie",radius:["30%","70%"],avoidLabelOverlap:!1,label:{show:f.show,position:f.position},data:V||[],labelLine:{show:!1}}},B=()=>{const V=[];let G=70,Y=100;return a==null||a.map(q=>{const K=[];let W=0;q.data.map(Q=>{const Z={value:Q,name:i[W]};K.push(Z),W+=1}),V.push([q.label,K])}),V.map(q=>(G-=20,Y-=20,{name:q[0],type:"pie",radius:[`${G}%`,`${Y}%`],avoidLabelOverlap:!1,label:{show:f.show,position:f.position},data:q[1],labelLine:{show:!1}}))},H=i.length>1?B():P();Object.assign(b,{toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"}},legend:{data:i.length>1||a==null?void 0:a[0],show:d.show,top:d.position==="horizontal"?"420px":d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,type:"scroll",formatter(V){return`{a|${or(V,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(V){return V.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:H});break}case pe.row:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"value",boundaryGap:[0,.01],splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none"}},yAxis:{type:"category",data:i,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}},series:a==null?void 0:a.map(P=>({data:P.data,type:"bar",name:P.label,barWidth:`${p.barWidth}%`,emphasis:{focus:"series"},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}}))});break}case pe.histogram:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},xAxis:[{type:"category",data:i,axisTick:{alignWithLabel:!0},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}}],yAxis:[{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}}],series:[{name:(M=a==null?void 0:a[0])==null?void 0:M.label,type:"bar",barWidth:"100%",data:(L=a==null?void 0:a[0])==null?void 0:L.data,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}]});break}case pe.funnel:{Object.assign(b,{...b,tooltip:{trigger:"item",formatter:p.showConversionRate?P=>{var H,V;let B=100;return P.dataIndex>0&&(B=(((H=o[P.dataIndex])==null?void 0:H.value)||0)/(((V=o[P.dataIndex-1])==null?void 0:V.value)||1)*100),`${P.name}: ${B.toFixed(0)}%`}:p.showLabelValues?"{b}: {c}":p.labelFormat||"{b}",backgroundColor:"black",textStyle:{color:"white"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:o,formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:[{name:"Funnel",type:"funnel",left:"10%",top:60,bottom:60,width:"80%",height:"60%",min:0,max:100,minSize:"0%",maxSize:"100%",sort:"none",gap:3,label:{show:f.show,position:f.position,formatter:p.showConversionRate?P=>{var H,V;let B=100;return P.dataIndex>0&&(B=(((H=o[P.dataIndex])==null?void 0:H.value)||0)/(((V=o[P.dataIndex-1])==null?void 0:V.value)||1)*100),`${P.name}: ${B.toFixed(0)}%`}:p.showLabelValues?"{b}: {c}":p.labelFormat||"{b}"},labelLine:{length:10,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{fontSize:20}},data:o}]});break}case pe.gauge:{let P={};if(a!=null&&a.length){const G=(E=a[0])==null?void 0:E.data,Y=[G[0]];if(G.length)for(let q=1;q<G.length-1;q++)Y.push(Y[q-1]-G[q]);Y.push(G[G.length-1]),P={labels:i,datasets:[G,Y]}}const B=Array.isArray(P)?P:[],H=B.reduce((G,Y)=>G+Y.value,0),V=Math.floor(H/B.length);Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,formatter(G){return`{a|${or(G,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(G){return G.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:[{type:"gauge",center:["50%","60%"],startAngle:200,endAngle:-20,min:0,max:V+100,splitNumber:12,itemStyle:{color:"blue"},progress:{show:!0,width:20},pointer:{show:!0},axisLine:{lineStyle:{width:30}},axisTick:{distance:-45,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:-52,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{distance:-8,color:"black",fontSize:10},anchor:{show:!1},data:[{value:V}]}]});break}case pe.sankey:{const P=[],B=[];if(s!=null&&s.length&&((N=s[0])==null?void 0:N[0])!==((k=s[1])==null?void 0:k[0])){[s[0],s[1]].map(V=>{V.map(G=>{P.includes(G)||P.push(G)})});for(let V=0;V<((O=s[0])==null?void 0:O.length);V+=1)B.push({source:s[0][V],target:s[1][V],value:s[2][V]})}Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:"black",textStyle:{color:"white"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:{type:"sankey",layout:"none",emphasis:{focus:"adjacency"},data:P.map(H=>({name:H})),links:B,showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}});break}case pe.singleValue:{const P=l[0]&&d0e(l[0],p.numberFormatter);Object.assign(b,{settings:{fontSize:p.fontSize||30,subHeaderFontSize:p.subHeaderFontSize||14,subHeaderShow:p.subHeaderShow||!1,displayText:p.displayText||"",comparisonTimePeriod:p.comparisonTimePeriod||30,comparisonTimeColumn:p.comparisonTimeColumn||"",comparisonValueShow:p.comparisonValueShow||!1,comparisonValueFontSize:p.comparisonValueFontSize||12},value:P});break}case pe.waterfall:{let P;if(a!=null&&a.length){const B=(R=a[0])==null?void 0:R.data,H=[B[0]];if(B.length)for(let V=1;V<B.length-1;V++)H.push(H[V-1]-B[V]);H.push(B[B.length-1]),P={labels:i,datasets:[B,H]}}Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},formatter(B){const H=B[1];return`${H.name}<br/>${H.value}`}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:P==null?void 0:P.labels,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:[{name:"Placeholder",type:"bar",stack:"Total",itemStyle:{borderColor:"transparent",color:"transparent"},emphasis:{itemStyle:{borderColor:"transparent",color:"transparent"}},data:P==null?void 0:P.datasets[1],showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}},{name:"Life Cost",type:"bar",stack:"Total",label:{show:f.show,position:f.position},data:P==null?void 0:P.datasets[0]}]});break}case pe.table:{const P=[];if(a){const B=[],H=[];a.map(V=>{B.push(V.label),H.push(V.data)});for(let V=0;V<((j=H[0])==null?void 0:j.length);V+=1){const G={};for(let Y=0;Y<B.length;Y+=1)G[B[Y]]=H[Y][V];P.push(G)}}Object.assign(b,{data:P,tableSettings:v});break}case pe.stepped:{const P=["start","middle","end"];let B=2;Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(H=>H.label),formatter(H){return`{a|${or(H,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(H){return H.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(H){return or(H,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:a==null?void 0:a.map(H=>(B===0?B=1:B===1?B=2:B=0,{name:H.label,type:"line",step:P[B],data:H.data,areaStyle:{},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}))});break}case pe.scatter:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},formatter:P=>`${P.map(B=>`${B.seriesName}: ${B.value}<br />`).join("")}`},xAxis:{type:"category",data:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:a==null?void 0:a.map(P=>({symbolSize:10,data:P.data,type:"scatter",name:P.label,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}))});break}case pe.timeSeries:{if(!n)break;Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none"},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},xAxis:{type:"category",axisTick:{alignWithLabel:!0},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",interval:0,rotate:p.xRotation,hideOverlap:!0,formatter(P){return or(P||"",f.truncateLabelValue||14)}},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},...r.isMultiDimension?{data:u||[]}:{}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:r.isMultiDimension?c==null?void 0:c.map(P=>P.name||"series-bar"):r.yAxisList,formatter(P){return`{a|${or(P||"",d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:r.isMultiDimension?c.map(P=>{var B,H,V,G,Y,q,K,W,Q,Z,oe,se;return{data:(P==null?void 0:P.data)||[],type:((H=(B=y==null?void 0:y.seriesType)==null?void 0:B[0])==null?void 0:H.type)==="area"?"line":((G=(V=y==null?void 0:y.seriesType)==null?void 0:V[0])==null?void 0:G.type)==="stack"?"bar":((q=(Y=y==null?void 0:y.seriesType)==null?void 0:Y[0])==null?void 0:q.type)||"bar",name:(P==null?void 0:P.name)||"series",...((W=(K=y==null?void 0:y.seriesType)==null?void 0:K[0])==null?void 0:W.type)==="stack"?{stack:"total"}:{},label:{show:f.show,position:f.position},emphasis:{focus:"series"},...((Z=(Q=y==null?void 0:y.seriesType)==null?void 0:Q[0])==null?void 0:Z.type)==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...((se=(oe=y==null?void 0:y.seriesType)==null?void 0:oe[0])==null?void 0:se.type)==="bar"?{barWidth:`${(p==null?void 0:p.barWidth)||0}%`,showBackground:m==null?void 0:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p==null?void 0:p.barRadius}}:{}}}):N5({dataArray:t,timeStampKey:r.xAxis||"",valuekeys:r.yAxisList||[],type:((z=y.seriesType[0])==null?void 0:z.type)||"bar",groupBy:((U=y.groupBySettings)==null?void 0:U.value)||"monthly",labelSettings:f,backGroundColor:m,customSettings:p})});break}}return b},Jp=$.memo(({chartOptions:r,data:t,events:e,colors:n,config:i,className:a})=>{const o=$.useMemo(()=>p0e({chartOptions:r,data:t,colors:n}),[t,r,n]),[s,l]=$.useState(!0);return $.useEffect(()=>{l(!1)},[]),r.chartType===pe.singleValue?A.jsx(yye,{...i,value:o.value,settings:o.settings,className:a,comparisonValue:i==null?void 0:i.comparisonValue}):r.chartType===pe.table?A.jsx(as,{...i,data:o.data,error:"",isLoading:!1,tableSettings:o.tableSettings,className:a,isExternalChart:i==null?void 0:i.isExternalChart,onChangePage:i==null?void 0:i.onChangePage,isEnableNextBtn:i==null?void 0:i.isEnableNextBtn,isEnablePrevBtn:i==null?void 0:i.isEnablePrevBtn,paginationInfo:i==null?void 0:i.paginationInfo,setChartSettings:i==null?void 0:i.setChartSettings}):A.jsx(Fr,{style:{width:"100%",height:"100%"},...i,option:{...o,animation:s},className:a,onEvents:e,notMerge:!0})}),O5=({isShow:r,onCancel:t,...e})=>A.jsx(ji,{isOpen:r,onClose:t,headerTitle:"Chart Preview",children:A.jsx("div",{className:X8.fullscreen,children:A.jsx(Jp,{...e})})}),os={button:"_button_1ecv1_1",menu:"_menu_1ecv1_7",menuContainer:"_menuContainer_1ecv1_13",buttonText:"_buttonText_1ecv1_19",buttonIcon:"_buttonIcon_1ecv1_25",filterName:"_filterName_1ecv1_31",filterDropdown:"_filterDropdown_1ecv1_37"},R5=r=>{const t=document.documentElement;r.colors&&Object.entries(r.colors).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-color-${e}`,`${n}`)}),r.border&&Object.entries(r.border).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-border-${e}`,`${n}`)}),r.shadow&&Object.entries(r.shadow).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-shadow-${e}`,`${n}`)}),r.typography&&Object.entries(r.typography).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-typography-${e}`,`${n}`)}),r.breakpoint&&Object.entries(r.breakpoint).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-breakpoint-${e}`,`${n}`)})},P5=r=>Fw.includes(r.toLowerCase())?"number":Bw.includes(r.toLowerCase())||r.toLowerCase().includes("char")?"text":Hw.includes(r.toLowerCase())?"boolean":"text",$5=r=>{const t="data:text/csv;charset=utf-8,";if(!r.length)return t;const e=[],n=r[0],i=Object.keys(n);e.push(`S.NO,${i.join(",").toUpperCase()}`),r.forEach((s,l)=>{const c=Object.values(s).map(u=>{if(typeof u=="number")return u;try{if(u!=null&&u.includes(","))return`"${u}"`}catch{return u}return u});e.push(`${l+1},${c.join(",")}`)});const a=e.join(`
|
|
607
|
+
*/const hi={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function e0e(r,t,e){var n;if(e=e||{},e.threshold=(n=e.threshold)!=null?n:hi.MATCHES,!e.accessors){const o=T5(r,t,e);return{rankedValue:r,rank:o,accessorIndex:-1,accessorThreshold:e.threshold,passed:o>=e.threshold}}const i=i0e(r,e.accessors),a={rankedValue:r,rank:hi.NO_MATCH,accessorIndex:-1,accessorThreshold:e.threshold,passed:!1};for(let o=0;o<i.length;o++){const s=i[o];let l=T5(s.itemValue,t,e);const{minRanking:c,maxRanking:u,threshold:h=e.threshold}=s.attributes;l<c&&l>=hi.MATCHES?l=c:l>u&&(l=u),l=Math.min(l,u),l>=h&&l>a.rank&&(a.rank=l,a.passed=!0,a.accessorIndex=o,a.accessorThreshold=h,a.rankedValue=s.itemValue)}return a}function T5(r,t,e){return r=I5(r,e),t=I5(t,e),t.length>r.length?hi.NO_MATCH:r===t?hi.CASE_SENSITIVE_EQUAL:(r=r.toLowerCase(),t=t.toLowerCase(),r===t?hi.EQUAL:r.startsWith(t)?hi.STARTS_WITH:r.includes(` ${t}`)?hi.WORD_STARTS_WITH:r.includes(t)?hi.CONTAINS:t.length===1?hi.NO_MATCH:t0e(r).includes(t)?hi.ACRONYM:r0e(r,t))}function t0e(r){let t="";return r.split(" ").forEach(n=>{n.split("-").forEach(a=>{t+=a.substr(0,1)})}),t}function r0e(r,t){let e=0,n=0;function i(l,c,u){for(let h=u,f=c.length;h<f;h++)if(c[h]===l)return e+=1,h+1;return-1}function a(l){const c=1/l,u=e/t.length;return hi.MATCHES+u*c}const o=i(t[0],r,0);if(o<0)return hi.NO_MATCH;n=o;for(let l=1,c=t.length;l<c;l++){const u=t[l];if(n=i(u,r,n),!(n>-1))return hi.NO_MATCH}const s=n-o;return a(s)}function I5(r,t){let{keepDiacritics:e}=t;return r=`${r}`,e||(r=Jye(r)),r}function n0e(r,t){let e=t;typeof t=="object"&&(e=t.accessor);const n=e(r);return n==null?[]:Array.isArray(n)?n:[String(n)]}function i0e(r,t){const e=[];for(let n=0,i=t.length;n<i;n++){const a=t[n],o=a0e(a),s=n0e(r,a);for(let l=0,c=s.length;l<c;l++)e.push({itemValue:s[l],attributes:o})}return e}const A5={maxRanking:1/0,minRanking:-1/0};function a0e(r){return typeof r=="function"?A5:{...A5,...r}}const It={"table-loader-container":"_table-loader-container_tdj5v_1",tableData:"_tableData_tdj5v_7",tableScroll:"_tableScroll_tdj5v_13",tableHeadCol:"_tableHeadCol_tdj5v_19",resizer:"_resizer_tdj5v_25",resizing:"_resizing_tdj5v_37",tableRow:"_tableRow_tdj5v_43",tableRowCol:"_tableRowCol_tdj5v_49",truncateText:"_truncateText_tdj5v_57",row:"_row_tdj5v_65",container:"_container_tdj5v_71",table:"_table_tdj5v_1",previewTable:"_previewTable_tdj5v_83",preview:"_preview_tdj5v_83",searchButton:"_searchButton_tdj5v_95",previewText:"_previewText_tdj5v_101",noData:"_noData_tdj5v_107",error:"_error_tdj5v_113",errorMsg:"_errorMsg_tdj5v_119",tableIcon:"_tableIcon_tdj5v_125",stripedRow:"_stripedRow_tdj5v_131",rowHover:"_rowHover_tdj5v_137",rightBorder:"_rightBorder_tdj5v_143",searchContainer:"_searchContainer_tdj5v_149",sortButton:"_sortButton_tdj5v_155",searchTab:"_searchTab_tdj5v_161",searchTabInput:"_searchTabInput_tdj5v_167",searchTabIcon:"_searchTabIcon_tdj5v_173",noDataHead:"_noDataHead_tdj5v_179",noDataBody:"_noDataBody_tdj5v_185",showSort:"_showSort_tdj5v_191",noSort:"_noSort_tdj5v_197",pagination:"_pagination_tdj5v_203",rowStyle:"_rowStyle_tdj5v_209",rowText:"_rowText_tdj5v_215",rowsDropdown:"_rowsDropdown_tdj5v_221",pageStyle:"_pageStyle_tdj5v_227",buttonContainer:"_buttonContainer_tdj5v_233",button:"_button_tdj5v_233",paginationWrapper:"_paginationWrapper_tdj5v_251",current:"_current_tdj5v_257",textTruncate:"_textTruncate_tdj5v_263"},o0e=({value:r,onChange:t,debounce:e=500,...n})=>{const[i,a]=$.useState(r);return $.useEffect(()=>{a(r)},[r]),$.useEffect(()=>{const o=setTimeout(()=>{t(i)},e);return()=>clearTimeout(o)},[e,t,i]),A.jsxs("div",{className:`${It.searchTab} ${n.className||""}`,children:[A.jsx("input",{...n,value:i,onChange:o=>a(o.target.value),className:It.searchTabInput}),i.toString().length?"":A.jsx(lL,{className:It.searchTabIcon,color:"#C7C7C7",width:"30px",height:"30px"})]})},s0e="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDAgNTAwIj48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZTojMTgyYzYwO30uY2xzLTEsLmNscy0ye2ZpbGw6bm9uZTtzdHJva2UtbGluZWNhcDpyb3VuZDt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2xhc3M9ImNscy00IiB4PSIyMjQuMjMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iMjQyLjY5IiB5PSIyODYuNDMiIHdpZHRoPSI4LjQ3IiBoZWlnaHQ9IjQiLz48cmVjdCBjbGFzcz0iY2xzLTQiIHg9IjI2MC42MiIgeT0iMjg2LjQzIiB3aWR0aD0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyNzguODMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjwvZz48L3N2Zz4=",cl=r=>A.jsxs("svg",{viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...r,children:[A.jsx("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:.5}),A.jsx("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z",children:A.jsx("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})})]}),l0e=r=>A.jsx("svg",{viewBox:"0 0 32 32",width:"1.2em",height:"1.2em",...r,children:A.jsx("path",{fill:"currentColor",d:"m16 28l-7-7l1.41-1.41L16 25.17l5.59-5.58L23 21l-7 7zm0-24l7 7l-1.41 1.41L16 6.83l-5.59 5.58L9 11l7-7z"})}),u0e=r=>A.jsx("svg",{viewBox:"0 0 32 32",width:"1.2em",height:"1.2em",...r,children:A.jsx("path",{fill:"currentColor",d:"m16 4l7 7l-1.4 1.4L16 6.8l-5.6 5.6L9 11z"})}),c0e=r=>A.jsx("svg",{viewBox:"0 0 32 32",width:"1.2em",height:"1.2em",...r,children:A.jsx("path",{fill:"currentColor",d:"m16 28l-7-7l1.4-1.4l5.6 5.6l5.6-5.6L23 21z"})}),h0e=Fye(),as=({data:r,isLoading:t,error:e,tableSettings:n,tableName:i,className:a="",onColumnSizingChange:o,onChartReady:s,onChangePage:l,isExternalChart:c,isEnableNextBtn:u,isEnablePrevBtn:h,paginationInfo:f={limit:10,offset:0,totalRecords:10},setChartSettings:d})=>{var O,R;const{divStyle:p,headerStyle:v}=$.useMemo(()=>{const j={width:"100%",height:(n==null?void 0:n.lineGap)==="small"?"1.5rem":"2.5rem",fontSize:(n==null?void 0:n.lineGap)==="small"?"0.7rem":"1rem",display:"flex",alignItems:"center",justifyContent:n!=null&&n.contentAlignment?`${n.contentAlignment}`:""},z={width:"100%",color:"#182c60",fontSize:(n==null?void 0:n.lineGap)==="small"?"0.7rem":"1rem",height:(n==null?void 0:n.lineGap)==="small"?"1.5rem":"2.5rem",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"500"};return{divStyle:j,headerStyle:z}},[n==null?void 0:n.lineGap,n==null?void 0:n.contentAlignment]),[g,m]=$.useState([]),[y,b]=$.useState({}),[x,w]=$.useState({label:((O=ni.tableSettings)==null?void 0:O.defaultRowSize)||"10",value:((R=ni.tableSettings)==null?void 0:R.defaultRowSize)||"10"}),[_,D]=$.useState(n==null?void 0:n.columnSizing),[I,C]=$.useState(""),T=(j,z,U,P)=>{const B=e0e(j.getValue(z),U);return P({itemRank:B}),B.passed},[S,M]=$.useState({pageIndex:0,pageSize:10});$.useEffect(()=>{o==null||o(_)},[_]),$.useEffect(()=>{var U,P;if(!(n!=null&&n.defaultRowSize))return;const j=Jv.find(B=>B.value===n.defaultRowSize),z={label:((U=ni.tableSettings)==null?void 0:U.defaultRowSize)||"10",value:((P=ni.tableSettings)==null?void 0:P.defaultRowSize)||"10"};w(j||z)},[n==null?void 0:n.defaultRowSize]);const L=$.useMemo(()=>{if(!r||!Array.isArray(r))return[];const{pageIndex:j,pageSize:z}=S;return r.slice(j*z,(j+1)*z)},[S,r,I]),E=$.useMemo(()=>Object.keys((r==null?void 0:r[0])||{}).map(j=>h0e.accessor(j,{header:()=>j,cell:z=>{const U=z.row.original[j];return typeof U=="object"?JSON.stringify(U):typeof U=="boolean"?U?"true":"false":U}})),[r==null?void 0:r[0]]),N=qye({data:I?Array.isArray(r)?r:[]:L,columns:E,filterFns:{fuzzy:T},state:{sorting:g,globalFilter:I,pagination:S,..._?{columnSizing:_}:{}},enableGlobalFilter:!0,onRowSelectionChange:b,onSortingChange:m,globalFilterFn:T,getCoreRowModel:Bye(),getFilteredRowModel:Uye(),getSortedRowModel:Gye(),onGlobalFilterChange:C,onPaginationChange:M,manualPagination:!0,debugTable:!1,enableColumnResizing:!0,columnResizeMode:"onChange",onColumnSizingChange:D});$.useEffect(()=>{N.setPageSize(Number(x.value))},[x,N]);const k=$.useMemo(()=>{const{pageIndex:j,pageSize:z}=N.getState().pagination,U=I?N.getRowModel().rows.length:(r==null?void 0:r.length)||0,P=U===0?0:z*j+1,B=U<=z*(j+1)?U:z*(j+1);return{from:P,to:B,total:U}},[I,r,N.getState().pagination,N.getRowModel().rows.length]);return $.useEffect(()=>{N.getIsSomeColumnsVisible()&&(s==null||s())},[N.getIsSomeColumnsVisible()]),A.jsx("div",{className:`${It.container} ${a}`,children:A.jsxs("div",{className:It.previewTable,children:[n!=null&&n.enableTableSearch||n!=null&&n.showTableTitle?A.jsxs("div",{className:n.showTableTitle?It.preview:It.searchButton,children:[n.showTableTitle&&A.jsx(ye,{styleClass:"font-14c",variant:"h1",className:It.previewText,children:i}),n.enableTableSearch&&A.jsx(o0e,{value:I,onChange:j=>C(String(j)),placeholder:"Search"})]}):null,A.jsxs("div",{className:It.tableData,children:[t&&!(r!=null&&r.length)&&A.jsx("div",{className:It["table-loader-container"],children:A.jsx(cl,{style:{width:"50px",height:"50px",color:"blue"}})}),!!(r!=null&&r.length)&&!t&&A.jsx("div",{className:It.tableScroll,children:A.jsxs("table",{className:It.table,children:[A.jsx("thead",{children:N.getHeaderGroups().map(j=>A.jsx("tr",{className:It.row,children:j.headers.map(z=>A.jsxs("th",{className:It.tableHeadCol,colSpan:z.colSpan,style:{width:z.getSize()},children:[A.jsx("button",{onMouseDown:z.getResizeHandler(),onTouchStart:z.getResizeHandler(),onDoubleClick:z.column.resetSize,className:`${It.resizer} ${z.column.getIsResizing()?It.resizing:""}`,type:"button",title:"Resize Column"}),n!=null&&n.enableSorting?A.jsxs("div",{className:z.column.getCanSort()?It.sortButton:"",onClick:z.column.getToggleSortingHandler(),children:[z.isPlaceholder?null:A.jsx("div",{style:v,children:$0(z.column.columnDef.header,z.getContext())}),{asc:A.jsx(u0e,{color:"#182c60"}),desc:A.jsx(c0e,{color:"#182c60"})}[z.column.getIsSorted()]??A.jsx(l0e,{color:"#182c60"})]}):A.jsx(A.Fragment,{children:z.isPlaceholder?null:A.jsx("div",{style:v,children:A.jsx(ye,{variant:"p",styleClass:"custom",className:It.truncateText,children:$0(z.column.columnDef.header,z.getContext())})})})]},z.id))},j.id))}),A.jsx("tbody",{children:(I?N.getRowModel().rows.slice(S.pageSize*S.pageIndex,S.pageSize*(1+S.pageIndex)):N.getRowModel().rows).map((j,z)=>A.jsx("tr",{className:`${It.tableRow} ${n!=null&&n.showRowHover?It.rowHover:""} ${n!=null&&n.enableStripedRows&&Number(z)%2!==0?It.stripedRow:""}`,children:j.getVisibleCells().map(U=>A.jsxs("td",{className:`${It.tableRowCol} ${n!=null&&n.hideVerticalDivider?"":It.rightBorder}`,title:typeof U.getValue()=="object"?JSON.stringify(U.getValue()):U.getValue(),children:[!!n&&A.jsx("div",{style:p,children:A.jsx(ye,{variant:"p",styleClass:"custom",className:It.truncateText,children:$0(U.column.columnDef.cell,U.getContext())})}),!n&&A.jsx("div",{style:{textAlign:"center",width:"100%"},children:$0(U.column.columnDef.cell,U.getContext())})]},U.id))},j.id))})]})}),!(r!=null&&r.length)&&!t&&!e.length&&A.jsxs("div",{className:It.noData,children:[A.jsx("img",{src:s0e,alt:"no-data",width:"400px",height:"400px"}),A.jsx(ye,{styleClass:"font-14c",variant:"h1",className:It.noDataHead,children:"No data tables queried"}),A.jsx(ye,{styleClass:"font-14",variant:"p",className:It.noDataBody,children:"Type your query and input fields beside to generate results and explore data"})]}),e&&A.jsx("div",{className:It.error,children:A.jsx(ye,{styleClass:"primary",className:It.errorMsg,variant:"p",children:e})})]}),r&&!(n!=null&&n.disablePagination)&&A.jsxs("div",{className:It.pagination,children:[A.jsx("div",{className:It.rowStyle,children:A.jsx(Pr,{onChange:j=>{w(j),c&&(l==null||l(!1,parseInt(j.value,10)),d==null||d(z=>({...z,tableSettings:{...z.tableSettings,defaultRowSize:j.value}})))},selectedOption:x,options:Jv,labelVariant:"static",dropdownAbove:!0,buttonClass:It.rowsDropdown})}),c?A.jsxs("span",{className:It.pageStyle,children:[f.offset+1,"-",f.offset+r.length," of"," ",f.totalRecords]}):A.jsxs("span",{className:It.pageStyle,children:[k.from,"-",k.to," of ",k.total]}),A.jsxs("div",{className:It.buttonContainer,children:[A.jsx(Me,{variant:"custom",type:"button",className:It.button,onClick:()=>{c?l==null||l(!0):N.previousPage()},isDisabled:c?!h:k.from<=1,children:"Prev"}),A.jsx(Me,{variant:"custom",type:"button",className:It.button,onClick:()=>{c?l==null||l(!1):N.nextPage()},isDisabled:c?!u:k.to>=k.total,children:"Next"})]})]})]})})},L5=["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)"],E5=({data:r,measure:t,sankeyValues:e,singleValue:n,step:i,xAxis:a,yAxisList:o,seriesField:s,isTimeSeries:l,selectedFormat:c})=>{const u=Array.isArray(r)?r.map(x=>a&&x[a]):[],h=o==null?void 0:o.map((x,w)=>({label:x,data:Array.isArray(r)?r.map(_=>_[o[w]]):[],borderColor:L5[w]})),f=Array.isArray(r)&&i&&t?r.map(x=>({value:x[t],name:x[i]})):[],d=e==null?void 0:e.map((x,w)=>Array.isArray(r)?r.map(_=>_[e[w]]):[]),p=Array.isArray(r)&&n?r.map(x=>x[n]):[],v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g={yearly:x=>x.getFullYear(),monthly:x=>{const w=x.getMonth(),_=x.getFullYear();return`${v[w]} - ${_}`},weekly:x=>{const w=new Date(x.getTime());return w.setDate(x.getDate()-x.getDay()),w.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:x=>`${x.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:x=>{const w=x.getMonth(),_=Math.floor(w/3)+1,D=x.getFullYear();return`Q${_} ${D}`}},m=Array.from(new Set(r==null?void 0:r.map(x=>x[s||""]))),y=Array.from(new Set(r==null?void 0:r.map(x=>{if(l&&x[a||""]){const w=new Date(x[a||""]),_=g[c||"monthly"];return _(w)}return x[a||""]}))),b=m.map(x=>{const w=r==null?void 0:r.filter(D=>D[s||""]===x),_=y.map(D=>{var C;if(l&&D){const T=g[c||"monthly"],S=w==null?void 0:w.filter(L=>{const E=new Date(L[a||""]);return T(E)===D});return(S==null?void 0:S.reduce((L,E)=>L+(E[(o==null?void 0:o[0])||""]||0),0))||0}return((C=w==null?void 0:w.find(T=>T[a||""]===D))==null?void 0:C[(o==null?void 0:o[0])||""])||0});return{name:x,data:_}});return{labels:u,datasets:h,funnelData:f,sankeyData:d,singleValueData:p,xAxisData:y,seriesData:b}},f0e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],N5=({dataArray:r,timeStampKey:t,type:e,valuekeys:n,groupBy:i,labelSettings:a,customSettings:o,backGroundColor:s})=>n.map(u=>r.sort((f,d)=>new Date(f[t]).getTime()-new Date(d[t]).getTime()).reduce((f,d)=>{const v={yearly:m=>m.getFullYear(),monthly:m=>{const y=m.getMonth(),b=m.getFullYear();return`${f0e[y]} - ${b}`},weekly:m=>{const y=new Date(m.getTime());return y.setDate(m.getDate()-m.getDay()),y.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},daily:m=>`${m.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,quarterly:m=>{const y=m.getMonth(),b=Math.floor(y/3)+1,x=m.getFullYear();return`Q${b} ${x}`}}[i],g=v(new Date(d[t]));return f[g]||(f[g]=0),f[g]+=d[u],f},{})).map((u,h)=>({data:Object.entries(u),type:e==="area"?"line":e==="stack"?"bar":e,name:n[h],label:{show:a.show,position:a.position},emphasis:{focus:"series"},...e==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...e==="bar"?{barWidth:`${(o==null?void 0:o.barWidth)||0}%`,showBackground:s==null?void 0:s.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:o==null?void 0:o.barRadius}}:{},...e==="stack"?{stack:"total"}:{}})),JC=({data:r,timeStampKey:t,valuekeys:e})=>!Array.isArray(r)||r.length<2?!1:r.every(n=>{const i=new Date(n[t]);return!Number.isNaN(i.getTime())&&e.every(a=>typeof n[a]=="number")}),or=(r,t)=>r.length>t?`${r.slice(0,t)}...`:r,k5=(r,t)=>{let e="";if(t)switch(parseInt(r,10).toString().length){case 1:case 2:case 3:e=r;break;case 4:e=`${r.toString().slice(0,1)}.${r.toString().slice(1,3)}k`;break;case 5:e=`${r.toString().slice(0,2)}.${r.toString().slice(2,4)}k`;break;case 6:e=`${r.toString().slice(0,3)}.${r.toString().slice(3,5)}k`;break;case 7:e=`${r.toString().slice(0,1)}.${r.toString().slice(1,3)}M`;break;case 8:e=`${r.toString().slice(0,2)}.${r.toString().slice(2,4)}M`;break;case 9:e=`${r.toString().slice(0,3)}.${r.toString().slice(3,5)}M`;break;case 10:e=`${r.toString().slice(0,1)}.${r.toString().slice(1,3)}B`;break}else switch(parseInt(r,10).toString().length){case 1:case 2:case 3:e=r;break;case 4:e=`${r.toString().slice(0,1)}k`;break;case 5:e=`${r.toString().slice(0,2)}k`;break;case 6:e=`${r.toString().slice(0,3)}k`;break;case 7:e=`${r.toString().slice(0,1)}M`;break;case 8:e=`${r.toString().slice(0,2)}M`;break;case 9:e=`${r.toString().slice(0,3)}M`;break;case 10:e=`${r.toString().slice(0,1)}B`;break}return e},d0e=(r,t)=>{const e=new Intl.NumberFormat;switch(t){case"original":return r;case"3s":case"adaptive":return k5(r,!0);case"percent":return`${r}%`;case"d":return parseInt(r,10).toLocaleString();case"1s":{let n=r.toString().slice(0,1);const i=Math.floor(Number(r));for(let o=1;o<i.toString().length;o+=1)n+=0;return k5(n,!1)}case"1f":{const n=Number(r).toFixed(1),i=e.format(n);return r.toString().includes(".")?i:`${i}.${Array(2).join("0")}`}case"2f":{const n=Number(r).toFixed(2),i=e.format(n);return r.toString().includes(".")?r.toString().split(".")[1].length>1?i:`${i}${Array(2).join("0")}`:`${i}.${Array(3).join("0")}`}case"3f":{const n=Number(r).toFixed(3),i=e.format(n);if(r.toString().includes(".")){const a=r.toString().split(".");return a[1].length>2?i:a[1].length===2?`${i}${Array(2).join("0")}`:`${i}${Array(3).join("0")}`}return`${i}.${Array(4).join("0")}`}case"+":return`+${e.format(r)}`;case"$":{const n=Number(r).toFixed(2),i=e.format(n);return r.toString().includes(".")?r.toString().split(".")[1].length>1?`$${i}`:`$${i}${Array(2).join("0")}`:`$${i}.${Array(3).join("0")}`}case"1%":{const n=Number(r)*100,i=Number(n).toFixed(1),a=e.format(i);return n.toString().includes(".")?`${a}%`:`${a}.${Array(2).join("0")}%`}case"2%":{const n=Number(r)*100,i=Number(n).toFixed(2),a=e.format(i);return n.toString().includes(".")?r.toString().split(".")[1].length>1?`${a}%`:`${a}.${Array(2).join("0")}`:`${a}.${Array(3).join("0")}%`}case"3%":{const n=r*100,i=Number(n).toFixed(3),a=e.format(i);return n.toString().includes(".")?r.toString().split(".")[1].length>1?`${a}%`:`${a}.${Array(3).join("0")}`:`${a}.${Array(4).join("0")}%`}case"ms1":{const n=Math.floor(Number(r)/1e3),i=Number(r)%1e3;return`${n}.${i.toString().slice(0,1)}s`}case"ms2":{const n=Math.floor(Number(r)/1e3),i=Math.floor(Number(r)%1e3),a=Number(r)-Math.floor(Number(r)),o=Math.floor(a*1e3),s=a*1e3-o,l=Math.floor(s*1e3);let c="";return n&&(c+=`${n}s `),i&&(c+=`${i}ms `),o&&(c+=`${o}µs`),l&&(c+=`${l}ns`),c}case"4r":return Math.floor(Math.round(Number(r)));default:return r}},p0e=({chartOptions:r,data:t=[],colors:e})=>{var x,w,_,D,I,C,T,S,M,L,E,N,k,O,R,j,z,U;const n=(r==null?void 0:r.chartType)===pe.timeSeries?JC({data:t,timeStampKey:r.xAxis||"",valuekeys:r.yAxisList||[]}):!1,{labels:i,datasets:a,funnelData:o,sankeyData:s,singleValueData:l,seriesData:c,xAxisData:u}=E5({data:t,measure:r.measure,step:r.step,xAxis:r.xAxis,yAxisList:r.yAxisList,singleValue:r.singleValue,sankeyValues:r.sankeyValues,seriesField:r.seriesField,isTimeSeries:n,selectedFormat:((w=(x=r.timeSeriesSettings)==null?void 0:x.groupBySettings)==null?void 0:w.value)||"monthly"}),h={...ni.margins,...r.margins},f={...ni.labelSettings,...r.labelSettings},d={...ni.legendSettings,...r.legendSettings},p={...ni.customSettings,...r.customSettings},v={...ni.tableSettings,...r.tableSettings},g={...ni.axisSettings,...r.axisSettings},m={...ni.backGroundColor,...r.backGroundColor},y={...ni.timeSeriesSettings,seriesType:((_=r.yAxisList)==null?void 0:_.map(P=>({column:P,type:"bar"})))||[],...r.timeSeriesSettings},b={...e!=null&&e.length?{color:e}:{}};switch(r.chartType){case pe.line:{Object.assign(b,{...b,tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"line",lineStyle:{color:"rgba(0,0,0,0.2)",width:1,type:"solid"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},xAxis:{type:"category",boundaryGap:!1,data:r.isMultiDimension?u||[]:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}},data:r.isMultiDimension?c==null?void 0:c.map(P=>P.name||"line"):a==null?void 0:a.map(P=>P.label)},series:r.isMultiDimension?c.map(P=>({data:P.data,type:"line",name:P.name||"line",label:{show:f.show,position:f.position},emphasis:{focus:"series"}})):a==null?void 0:a.map(P=>({data:P.data,type:"line",name:P.label,label:{show:f.show,position:f.position},emphasis:{focus:"series"}}))});break}case pe.bar:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:r.isMultiDimension?u||[]:i,axisTick:{alignWithLabel:!0},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",interval:0,rotate:p.xRotation,hideOverlap:!0,formatter(P){return or(P,f.truncateLabelValue||14)}},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{data:r.isMultiDimension?c==null?void 0:c.map(P=>P.name||"series-bar"):a==null?void 0:a.map(P=>P.label),show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:r.isMultiDimension?c.map(P=>({data:P.data,type:"bar",name:P.name||"",barWidth:`${p.barWidth||0}%`,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}})):a==null?void 0:a.map(P=>({data:P.data,type:"bar",name:P.label,barWidth:`${p.barWidth||0}%`,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}}))});break}case pe.stack:{const P=(()=>{if(!a||!p.showFullStacked)return;const B={};return a.forEach(H=>{const V=H.data.map((G,Y)=>{const q=a.reduce((K,W)=>K+W.data[Y],0);return(G/q*100).toFixed(2)});B[H.label]=V}),B})();Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},formatter:B=>`${B.map(H=>`${H.seriesName}: ${H.value}<br />`).join("")}`},xAxis:{type:"category",data:r.isMultiDimension?u||[]:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}},yAxis:{type:"value",max:p.showFullStacked?100:void 0,position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none",formatter:"{value} %"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:r.isMultiDimension?c==null?void 0:c.map(B=>B.name||"series-stack"):a==null?void 0:a.map(B=>B.label),formatter(B){return`{a|${or(B,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(B){return B.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:r.isMultiDimension?c.map(B=>({data:B.data,type:"bar",stack:"total",name:B.name||"",barWidth:`${p.barWidth||0}%`,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius},emphasis:{focus:"series"}})):a==null?void 0:a.map(B=>({data:p.showFullStacked?P[B.label]:B.data,type:"bar",name:B.label,stack:"x",barWidth:`${p.barWidth}%`,emphasis:{focus:"series"},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}}))});break}case pe.area:{a==null||a.map(P=>Object.assign(P,{fill:!0})),Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:r.isMultiDimension?[]:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}}],yAxis:[{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}}],series:a==null?void 0:a.map(P=>({data:P.data,type:"line",name:P.label,stack:"Total",areaStyle:{},emphasis:{focus:"series"},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}))});break}case pe.boxplot:{const P=[],B=[];a==null||a.map(H=>{P.push(H.data),B.push(H.label)}),Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},title:[{text:"Box Plot",left:"center"}],legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(H=>H.label),formatter(H){return`{a|${or(H,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(H){return H.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},dataset:[{source:P},{transform:{type:"boxplot",config:{itemNameFormatter:"expr {value}"}}},{fromDatasetIndex:1,fromTransformResult:1}],tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",boundaryGap:!0,nameGap:30,splitArea:{show:!1},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none"}},yAxis:{type:"value",position:g.axis,splitArea:{show:!0},splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:[{name:"boxplot",type:"boxplot",datasetIndex:1},{name:"outlier",type:"scatter",datasetIndex:2}]});break}case pe.bubble:{const P=[],B=()=>{const V="0123456789ABCDEF";let G="#";for(let Y=0;Y<6;Y+=1)G+=V[Math.floor(Math.random()*16)];return G};let H=8;a==null||a.map(V=>{const G=[];let Y=0;const q=V.label;V.data.map(K=>{G.push([i[Y],K,q]),Y+=1}),P.push(G)}),Object.assign(b,{...b,tooltip:{backgroundColor:"black",textStyle:{color:"white"}},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:P.map(V=>V[0][2]),formatter(V){return`{a|${or(V,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(V){return V.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none",lineStyle:{type:"dashed"}},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(V){return or(V,f.truncateLabelValue||14)}}},yAxis:{position:g.axis,scale:!0,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none",lineStyle:{type:"dashed"}},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:P.map(V=>{H+=3;const G=B();return{name:V[0][2],data:V.map(Y=>({name:Y[0],value:Y[1]})),type:"scatter",symbolSize:H,emphasis:{focus:"series"},itemStyle:{color:G},label:{show:f.show,position:f.position}}})});break}case pe.combo:{const P=(D=r.yAxisList)==null?void 0:D.map((B,H)=>({type:H===0?"line":"bar",data:t.map(V=>V[B]),name:B,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}));Object.assign(b,{...b,grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",crossStyle:{color:"#999"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(B=>B.label),formatter(B){return`{a|${or(B,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(B){return B.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},xAxis:[{type:"category",data:i,axisPointer:{type:"shadow"},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}}],yAxis:[{type:"value",interval:0,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},{type:"value",interval:0,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}}],series:P});break}case pe.pie:{const P=()=>({type:"pie",radius:"80%",data:(a==null?void 0:a.map((G,Y)=>({value:G.data,name:i[Y]||"undefined"})))||[],label:{show:!1},labelLine:{show:!1}}),B=()=>{let V=100;const G=[];return a==null||a.map(Y=>{const q=[];let K=0;Y.data.map(W=>{const Q={value:W,name:i[K]};q.push(Q),K+=1}),G.push([Y.label,q])}),G.map(Y=>(V-=20,{name:Y[0],type:"pie",radius:`${V}%`,data:Y[1],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{show:f.show,position:f.position},labelLine:{show:!1}}))},H=a!=null&&a.length&&((C=(I=a[0])==null?void 0:I.data)==null?void 0:C.length)>1?B():P();Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"}},legend:{data:a!=null&&a.length&&((S=(T=a[0])==null?void 0:T.data)==null?void 0:S.length)>1||a==null?void 0:a[0],show:d.show,top:d.position==="horizontal"?"420px":d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,type:"scroll",formatter(V){return`{a|${or(V,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(V){return V.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:H});break}case pe.doughnut:{const P=()=>{const V=a==null?void 0:a.map((G,Y)=>({value:G.data,name:i[Y]||"undefined"}));return{type:"pie",radius:["30%","70%"],avoidLabelOverlap:!1,label:{show:f.show,position:f.position},data:V||[],labelLine:{show:!1}}},B=()=>{const V=[];let G=70,Y=100;return a==null||a.map(q=>{const K=[];let W=0;q.data.map(Q=>{const Z={value:Q,name:i[W]};K.push(Z),W+=1}),V.push([q.label,K])}),V.map(q=>(G-=20,Y-=20,{name:q[0],type:"pie",radius:[`${G}%`,`${Y}%`],avoidLabelOverlap:!1,label:{show:f.show,position:f.position},data:q[1],labelLine:{show:!1}}))},H=i.length>1?B():P();Object.assign(b,{toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"item",backgroundColor:"black",textStyle:{color:"white"}},legend:{data:i.length>1||a==null?void 0:a[0],show:d.show,top:d.position==="horizontal"?"420px":d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,type:"scroll",formatter(V){return`{a|${or(V,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(V){return V.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:H});break}case pe.row:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"value",boundaryGap:[0,.01],splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none"}},yAxis:{type:"category",data:i,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}},series:a==null?void 0:a.map(P=>({data:P.data,type:"bar",name:P.label,barWidth:`${p.barWidth}%`,emphasis:{focus:"series"},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p.barRadius}}))});break}case pe.histogram:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},xAxis:[{type:"category",data:i,axisTick:{alignWithLabel:!0},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}}],yAxis:[{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}}],series:[{name:(M=a==null?void 0:a[0])==null?void 0:M.label,type:"bar",barWidth:"100%",data:(L=a==null?void 0:a[0])==null?void 0:L.data,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}]});break}case pe.funnel:{Object.assign(b,{...b,tooltip:{trigger:"item",formatter:p.showConversionRate?P=>{var H,V;let B=100;return P.dataIndex>0&&(B=(((H=o[P.dataIndex])==null?void 0:H.value)||0)/(((V=o[P.dataIndex-1])==null?void 0:V.value)||1)*100),`${P.name}: ${B.toFixed(0)}%`}:p.showLabelValues?"{b}: {c}":p.labelFormat||"{b}",backgroundColor:"black",textStyle:{color:"white"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:o,formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:[{name:"Funnel",type:"funnel",left:"10%",top:60,bottom:60,width:"80%",height:"60%",min:0,max:100,minSize:"0%",maxSize:"100%",sort:"none",gap:3,label:{show:f.show,position:f.position,formatter:p.showConversionRate?P=>{var H,V;let B=100;return P.dataIndex>0&&(B=(((H=o[P.dataIndex])==null?void 0:H.value)||0)/(((V=o[P.dataIndex-1])==null?void 0:V.value)||1)*100),`${P.name}: ${B.toFixed(0)}%`}:p.showLabelValues?"{b}: {c}":p.labelFormat||"{b}"},labelLine:{length:10,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{fontSize:20}},data:o}]});break}case pe.gauge:{let P={};if(a!=null&&a.length){const G=(E=a[0])==null?void 0:E.data,Y=[G[0]];if(G.length)for(let q=1;q<G.length-1;q++)Y.push(Y[q-1]-G[q]);Y.push(G[G.length-1]),P={labels:i,datasets:[G,Y]}}const B=Array.isArray(P)?P:[],H=B.reduce((G,Y)=>G+Y.value,0),V=Math.floor(H/B.length);Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,formatter(G){return`{a|${or(G,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(G){return G.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:[{type:"gauge",center:["50%","60%"],startAngle:200,endAngle:-20,min:0,max:V+100,splitNumber:12,itemStyle:{color:"blue"},progress:{show:!0,width:20},pointer:{show:!0},axisLine:{lineStyle:{width:30}},axisTick:{distance:-45,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:-52,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{distance:-8,color:"black",fontSize:10},anchor:{show:!1},data:[{value:V}]}]});break}case pe.sankey:{const P=[],B=[];if(s!=null&&s.length&&((N=s[0])==null?void 0:N[0])!==((k=s[1])==null?void 0:k[0])){[s[0],s[1]].map(V=>{V.map(G=>{P.includes(G)||P.push(G)})});for(let V=0;V<((O=s[0])==null?void 0:O.length);V+=1)B.push({source:s[0][V],target:s[1][V],value:s[2][V]})}Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:"black",textStyle:{color:"white"}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},series:{type:"sankey",layout:"none",emphasis:{focus:"adjacency"},data:P.map(H=>({name:H})),links:B,showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}});break}case pe.singleValue:{const P=l[0]&&d0e(l[0],p.numberFormatter);Object.assign(b,{settings:{fontSize:p.fontSize||30,subHeaderFontSize:p.subHeaderFontSize||14,subHeaderShow:p.subHeaderShow||!1,displayText:p.displayText||"",comparisonTimePeriod:p.comparisonTimePeriod||30,comparisonTimeColumn:p.comparisonTimeColumn||"",comparisonValueShow:p.comparisonValueShow||!1,comparisonValueFontSize:p.comparisonValueFontSize||12},value:P});break}case pe.waterfall:{let P;if(a!=null&&a.length){const B=(R=a[0])==null?void 0:R.data,H=[B[0]];if(B.length)for(let V=1;V<B.length-1;V++)H.push(H[V-1]-B[V]);H.push(B[B.length-1]),P={labels:i,datasets:[B,H]}}Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},formatter(B){const H=B[1];return`${H.name}<br/>${H.value}`}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:P==null?void 0:P.labels,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(B){return or(B,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:[{name:"Placeholder",type:"bar",stack:"Total",itemStyle:{borderColor:"transparent",color:"transparent"},emphasis:{itemStyle:{borderColor:"transparent",color:"transparent"}},data:P==null?void 0:P.datasets[1],showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}},{name:"Life Cost",type:"bar",stack:"Total",label:{show:f.show,position:f.position},data:P==null?void 0:P.datasets[0]}]});break}case pe.table:{const P=[];if(a){const B=[],H=[];a.map(V=>{B.push(V.label),H.push(V.data)});for(let V=0;V<((j=H[0])==null?void 0:j.length);V+=1){const G={};for(let Y=0;Y<B.length;Y+=1)G[B[Y]]=H[Y][V];P.push(G)}}Object.assign(b,{data:P,tableSettings:v});break}case pe.stepped:{const P=["start","middle","end"];let B=2;Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(H=>H.label),formatter(H){return`{a|${or(H,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(H){return H.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},xAxis:{type:"category",data:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(H){return or(H,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},series:a==null?void 0:a.map(H=>(B===0?B=1:B===1?B=2:B=0,{name:H.label,type:"line",step:P[B],data:H.data,areaStyle:{},label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}))});break}case pe.scatter:{Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"},formatter:P=>`${P.map(B=>`${B.seriesName}: ${B.value}<br />`).join("")}`},xAxis:{type:"category",data:i,splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",formatter(P){return or(P,f.truncateLabelValue||14)}}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:a==null?void 0:a.map(P=>P.label),formatter(P){return`{a|${or(P,d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:a==null?void 0:a.map(P=>({symbolSize:10,data:P.data,type:"scatter",name:P.label,label:{show:f.show,position:f.position},showBackground:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"}}))});break}case pe.timeSeries:{if(!n)break;Object.assign(b,{...b,toolbox:{emphasis:{iconStyle:{borderColor:"#5865F6"}}},grid:{left:`${h.marginLeft}%`,bottom:`${h.marginBottom}%`,top:`${h.marginTop}%`,right:`${h.marginRight}%`,containLabel:!0},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none"},tooltip:{trigger:"axis",backgroundColor:"black",textStyle:{color:"white"},axisPointer:{type:"shadow"}},xAxis:{type:"category",axisTick:{alignWithLabel:!0},axisLabel:{show:p.axisLabels==="y"||p.axisLabels==="none",interval:0,rotate:p.xRotation,hideOverlap:!0,formatter(P){return or(P||"",f.truncateLabelValue||14)}},splitLine:{show:p.hideSplitLines==="horizontal"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="y"||p.hideAxisLines==="none"},...r.isMultiDimension?{data:u||[]}:{}},yAxis:{type:"value",position:g.axis,splitLine:{show:p.hideSplitLines==="vertical"||p.hideSplitLines==="none"},axisLine:{show:p.hideAxisLines==="x"||p.hideAxisLines==="none"},axisLabel:{show:p.axisLabels==="x"||p.axisLabels==="none"}},legend:{show:d.show,top:d.top,left:d.left,right:d.right,bottom:d.bottom,orient:d.position,data:r.isMultiDimension?c==null?void 0:c.map(P=>P.name||"series-bar"):r.yAxisList,formatter(P){return`{a|${or(P||"",d.truncateLegendValue||14)}}`},tooltip:{show:!0,formatter(P){return P.name}},textStyle:{rich:{a:{fontSize:12,lineHeight:20}}}},series:r.isMultiDimension?c.map(P=>{var B,H,V,G,Y,q,K,W,Q,Z,oe,se;return{data:(P==null?void 0:P.data)||[],type:((H=(B=y==null?void 0:y.seriesType)==null?void 0:B[0])==null?void 0:H.type)==="area"?"line":((G=(V=y==null?void 0:y.seriesType)==null?void 0:V[0])==null?void 0:G.type)==="stack"?"bar":((q=(Y=y==null?void 0:y.seriesType)==null?void 0:Y[0])==null?void 0:q.type)||"bar",name:(P==null?void 0:P.name)||"series",...((W=(K=y==null?void 0:y.seriesType)==null?void 0:K[0])==null?void 0:W.type)==="stack"?{stack:"total"}:{},label:{show:f.show,position:f.position},emphasis:{focus:"series"},...((Z=(Q=y==null?void 0:y.seriesType)==null?void 0:Q[0])==null?void 0:Z.type)==="area"?{areaStyle:{}}:{areaStyle:{opacity:0}},...((se=(oe=y==null?void 0:y.seriesType)==null?void 0:oe[0])==null?void 0:se.type)==="bar"?{barWidth:`${(p==null?void 0:p.barWidth)||0}%`,showBackground:m==null?void 0:m.show,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},itemStyle:{borderRadius:p==null?void 0:p.barRadius}}:{}}}):N5({dataArray:t,timeStampKey:r.xAxis||"",valuekeys:r.yAxisList||[],type:((z=y.seriesType[0])==null?void 0:z.type)||"bar",groupBy:((U=y.groupBySettings)==null?void 0:U.value)||"monthly",labelSettings:f,backGroundColor:m,customSettings:p})});break}}return b},Jp=$.memo(({chartOptions:r,data:t,events:e,colors:n,config:i,className:a})=>{const o=$.useMemo(()=>p0e({chartOptions:r,data:t,colors:n}),[t,r,n]),[s,l]=$.useState(!0);return $.useEffect(()=>{l(!1)},[]),r.chartType===pe.singleValue?A.jsx(yye,{...i,value:o.value,settings:o.settings,className:a,comparisonValue:i==null?void 0:i.comparisonValue}):r.chartType===pe.table?A.jsx(as,{...i,data:o.data,error:"",isLoading:!1,tableSettings:o.tableSettings,className:a,isExternalChart:i==null?void 0:i.isExternalChart,onChangePage:i==null?void 0:i.onChangePage,isEnableNextBtn:i==null?void 0:i.isEnableNextBtn,isEnablePrevBtn:i==null?void 0:i.isEnablePrevBtn,paginationInfo:i==null?void 0:i.paginationInfo,setChartSettings:i==null?void 0:i.setChartSettings}):A.jsx(Fr,{style:{width:"100%",height:"100%"},...i,option:{...o,animation:s},className:a,onEvents:e,notMerge:!0})}),O5=({isShow:r,onCancel:t,...e})=>A.jsx(ji,{isOpen:r,onClose:t,headerTitle:"Chart Preview",children:A.jsx("div",{className:X8.fullscreen,children:A.jsx(Jp,{...e})})}),os={button:"_button_1ecv1_1",menu:"_menu_1ecv1_7",menuContainer:"_menuContainer_1ecv1_13",buttonText:"_buttonText_1ecv1_19",buttonIcon:"_buttonIcon_1ecv1_25",filterName:"_filterName_1ecv1_31",filterDropdown:"_filterDropdown_1ecv1_37"},R5=r=>{const t=document.documentElement;r.colors&&Object.entries(r.colors).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-color-${e}`,`${n}`)}),r.border&&Object.entries(r.border).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-border-${e}`,`${n}`)}),r.shadow&&Object.entries(r.shadow).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-shadow-${e}`,`${n}`)}),r.typography&&Object.entries(r.typography).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-typography-${e}`,`${n}`)}),r.breakpoint&&Object.entries(r.breakpoint).forEach(([e,n])=>{e&&n&&t.style.setProperty(`--databrainhq-plugin-breakpoint-${e}`,`${n}`)})},P5=r=>Fw.includes(r.toLowerCase())?"number":Bw.includes(r.toLowerCase())||r.toLowerCase().includes("char")?"text":Hw.includes(r.toLowerCase())?"boolean":"text",$5=r=>{const t="data:text/csv;charset=utf-8,";if(!r.length)return t;const e=[],n=r[0],i=Object.keys(n);e.push(`S.NO,${i.join(",").toUpperCase()}`),r.forEach((s,l)=>{const c=Object.values(s).map(u=>{if(typeof u=="number")return u;try{if(u!=null&&u.includes(","))return`"${u}"`}catch{return u}return u});e.push(`${l+1},${c.join(",")}`)});const a=e.join(`
|
|
608
608
|
`);return encodeURI(t+a)},j5=(r,t,e)=>{const n=r.clientX-t.left+5,i=r.clientY-t.top-100,a=t.width-e.width,o=t.height-e.height,s=Math.max(0,Math.min(n,a)),l=Math.max(0,Math.min(i,o));return[s,l]},z5=(r,t,e)=>{r.style.left=`${t}px`,r.style.top=`${e}px`},v0e=Object.freeze(Object.defineProperty({__proto__:null,applyTheme:R5,colors:L5,getChartAttributes:E5,getFormattedDataType:P5,getPopoverPosition:j5,objectArrayToCsvString:$5,setPopoverPosition:z5},Symbol.toStringTag,{value:"Module"})),ha={container:"_container_1qflp_1",popover:"_popover_1qflp_9",button:"_button_1qflp_17",buttonOpen:"_buttonOpen_1qflp_25",menu:"_menu_1qflp_33",enter:"_enter_1qflp_41",enterFrom:"_enterFrom_1qflp_49",enterTo:"_enterTo_1qflp_57",leave:"_leave_1qflp_65",leaveFrom:"_leaveFrom_1qflp_73",leaveTo:"_leaveTo_1qflp_81",center:"_center_1qflp_89",top:"_top_1qflp_97",bottom:"_bottom_1qflp_105",left:"_left_1qflp_113",right:"_right_1qflp_121","left-top-end":"_left-top-end_1qflp_129","right-top-end":"_right-top-end_1qflp_137","left-bottom-end":"_left-bottom-end_1qflp_145","right-bottom-end":"_right-bottom-end_1qflp_153","top-left":"_top-left_1qflp_161","top-right":"_top-right_1qflp_169","bottom-left":"_bottom-left_1qflp_177","bottom-right":"_bottom-right_1qflp_185","left-top":"_left-top_1qflp_129","left-bottom":"_left-bottom_1qflp_145","right-top":"_right-top_1qflp_137","right-bottom":"_right-bottom_1qflp_153"},Fa=({className:r="",menuClass:t="",menuContainerClass:e="",buttonClass:n="",children:i,button:a,position:o="bottom",isDisabled:s})=>{const[l,c]=$.useState(!1),u=$.useRef(null);return $f({wrapRef:u,onOutsideClick:()=>c(!1)}),A.jsx(A.Fragment,{children:A.jsxs("div",{className:`${ha.container} ${r}`,ref:u,children:[A.jsx(Me,{className:`${n} ${l?ha.buttonOpen:""} ${ha.button}`,type:"button",variant:"custom",onClick:()=>!s&&c(h=>!h),children:a}),s?null:A.jsx("div",{className:`${ha.popover} ${ha[o]} ${e}`,children:A.jsx(Lf,{as:"div",className:`${ha.menu} ${t}`,show:l,enter:ha.enter,enterFrom:ha.enterFrom,enterTo:ha.enterTo,leave:ha.leave,leaveFrom:ha.leaveFrom,leaveTo:ha.leaveTo,children:i})})]})})},eT=r=>["IN","NOT IN"].includes(r),j0=r=>["IS NULL","IS NOT NULL"].includes(r),g0e=({filter:r,onChange:t,isResetted:e,companyId:n,tableName:i,integrationId:a,integrationName:o})=>{const[s,l]=$.useState({value:"=",label:"Equal to (=)"}),[c,u]=$.useState({value:"",label:""}),[h,f]=$.useState([]),d=$.useMemo(()=>P5(r.dataType),[r.dataType]);return $.useEffect(()=>{!s.value||c.value!==""&&h.length||t({column:r.name,operator:s.value,value:j0(s.value)?null:c.value||h.map(p=>p.value)})},[s,c.value,h]),$.useEffect(()=>{e&&(l({label:"",value:""}),u({label:"",value:""}),f([]))},[e]),A.jsx(A.Fragment,{children:A.jsxs(Fa,{buttonClass:os.button,menuClass:os.menu,position:"bottom-left",menuContainerClass:os.menuContainer,button:A.jsxs(A.Fragment,{children:[A.jsxs("span",{className:os.buttonText,children:[A.jsx(Uw,{datatype:r.as||d}),r.name]}),A.jsx("span",{className:os.buttonIcon,children:A.jsx(Lc,{})})]}),children:[A.jsx(ye,{variant:"p",styleClass:"font-14",className:os.filterName,children:r.name}),A.jsx(Pr,{label:"Operator",labelVariant:"static",selectedOption:s,onChange:p=>l(p),options:jw}),s.value&&!j0(s.value)?A.jsx(A.Fragment,{children:d==="boolean"?A.jsx(Pr,{options:[{value:"true",label:"TRUE"},{value:"false",label:"FALSE"}],selectedOption:c,onChange:u,label:"Filter Value",labelVariant:"static",className:os.filterDropdown}):A.jsx(A.Fragment,{children:eT(s.value)?A.jsx(zf,{selectedOptions:h,onChange:f,filter:{tableName:i,columnName:r.name},companyId:n,isSearchEnabled:!0,label:"Filter Value",labelVariant:"static",className:os.filterDropdown,autoSelected:!1,integrationId:a,integrationName:o}):A.jsx(vg,{selectedOption:c,onChange:u,filter:{tableName:i,columnName:r.name},companyId:n,isSearchEnabled:!0,label:"Filter Value",labelVariant:"static",className:os.filterDropdown,autoSelected:!1,integrationId:a,integrationName:o})})}):null]})})},rt={container:"_container_uxvi9_1",form:"_form_uxvi9_7",filterHeader:"_filterHeader_uxvi9_23",titleContent:"_titleContent_uxvi9_29",title:"_title_uxvi9_29",buttons:"_buttons_uxvi9_41",apply:"_apply_uxvi9_47",applyIcon:"_applyIcon_uxvi9_53",reset:"_reset_uxvi9_59",filterFieldsContainer:"_filterFieldsContainer_uxvi9_67",filterFields:"_filterFields_uxvi9_67",filterContainer:"_filterContainer_uxvi9_91",AddFilter:"_AddFilter_uxvi9_97",filterDropdown:"_filterDropdown_uxvi9_103",filterDropdowns:"_filterDropdowns_uxvi9_111",noFilters:"_noFilters_uxvi9_111",gridColAndRow:"_gridColAndRow_uxvi9_127",gridCol1:"_gridCol1_uxvi9_135",gridCol2:"_gridCol2_uxvi9_143",gridCol3:"_gridCol3_uxvi9_151",filters:"_filters_uxvi9_159",filterItem:"_filterItem_uxvi9_165",filterItemOperator:"_filterItemOperator_uxvi9_171",remove:"_remove_uxvi9_177",filterCol:"_filterCol_uxvi9_183",filterText:"_filterText_uxvi9_189",smallText:"_smallText_uxvi9_195",numberFieldPopup:"_numberFieldPopup_uxvi9_203",numberField:"_numberField_uxvi9_203",numberFieldWrapper:"_numberFieldWrapper_uxvi9_219",numberFieldLabel:"_numberFieldLabel_uxvi9_227",selectedLabel:"_selectedLabel_uxvi9_235",numberFieldLabelText:"_numberFieldLabelText_uxvi9_243",numberFieldLabelSelectText:"_numberFieldLabelSelectText_uxvi9_251",numberFieldButtonClass:"_numberFieldButtonClass_uxvi9_259",numberFieldLabelMenuClass:"_numberFieldLabelMenuClass_uxvi9_267",numberFieldClearButton:"_numberFieldClearButton_uxvi9_275",numberFieldFooter:"_numberFieldFooter_uxvi9_283",checkedOption:"_checkedOption_uxvi9_291",option:"_option_uxvi9_299",addFilterMenu:"_addFilterMenu_uxvi9_307",appliedFilterTag:"_appliedFilterTag_uxvi9_315",appliedfilters:"_appliedfilters_uxvi9_323",textBold:"_textBold_uxvi9_331",filterButton:"_filterButton_uxvi9_339",filterBtnText:"_filterBtnText_uxvi9_347",filterLength:"_filterLength_uxvi9_355",addfilter:"_addfilter_uxvi9_363",alertContainer:"_alertContainer_uxvi9_371"},tT=({setAppliedFilters:r,column:t,defaultValues:e,className:n="",onChange:i,label:a})=>{const[o,s]=$.useState(e||{min:0,max:1e6}),l=$.useRef(null),[c,u]=$.useState(e?`${o.min} AND ${o.max}`:"");$.useEffect(()=>{i==null||i(o)},[o]);const h=()=>{var d;s({min:0,max:1e6}),u(""),(d=l.current)==null||d.click(),r(p=>p.filter(v=>v.column!==(t==null?void 0:t.name)))},f=()=>{var d;t&&r&&r(p=>{const v={column:t.name,operator:"BETWEEN",value:`${o.min} AND ${o.max}`,as:t.as,defaultValues:o,filterType:t.isShowHorizontal?"horizontal":"global",isFilterApplied:!!t.isShowHorizontal},g=p.findIndex(y=>y.column===t.name);if(g===-1)return[...p,v];const m=[...p];return m[g]=v,m}),u(`Between ${o.min} to ${o.max}`),(d=l.current)==null||d.click()};return A.jsx(A.Fragment,{children:A.jsx(Fa,{menuClass:rt.numberFieldLabelMenuClass,button:A.jsxs("div",{className:rt.numberField,ref:l,children:[!c&&A.jsx("div",{className:"mr-2",children:A.jsx(ye,{variant:"span",styleClass:"custom",className:"text-sm",children:A.jsx(Je,{name:"number-icon"})})}),A.jsxs("div",{className:rt.numberFieldLabelText,children:[A.jsx(ye,{variant:"p",styleClass:"font-14",className:nr(rt.numberFieldLabel,{[rt.selectedLabel]:!!c}),children:a||(t==null?void 0:t.label)||(t==null?void 0:t.name)}),A.jsx(ye,{variant:"p",styleClass:"font-14c",className:rt.numberFieldLabelSelectText,children:c})]}),A.jsx(Lc,{})]}),className:`${rt.numberFieldPopup} ${n}`,buttonClass:rt.numberFieldButtonClass,children:A.jsxs("div",{className:rt.numberFieldWrapper,children:[A.jsx(He,{label:"minimum",type:"number",defaultValue:o.min,onChange:({target:{value:d}})=>{s(p=>({...p,min:Number(d)}))}}),A.jsx(He,{label:"maximum",type:"number",defaultValue:o.max,onChange:({target:{value:d}})=>{s(p=>({...p,max:Number(d)}))}}),A.jsxs("div",{className:rt.numberFieldFooter,children:[A.jsx(Me,{type:"button",variant:"custom",className:rt.numberFieldClearButton,onClick:h,children:"Clear"}),A.jsx(Me,{variant:"primary",type:"button",size:"xs",onClick:f,children:"Save"})]})]})})})},m0e=({columnList:r,filterList:t,setFilterList:e})=>A.jsx(A.Fragment,{children:!!r.length&&A.jsx(Fa,{button:A.jsx(Me,{variant:"custom",type:"button",size:"small",className:rt.addfilter,children:A.jsx(Je,{name:"plus-icon-2"})}),position:"bottom-left",children:A.jsx("div",{className:rt.addFilterMenu,children:r.map(n=>{const i=!!t.find(a=>a.name===n.name);return A.jsxs(Me,{variant:"secondary",onClick:()=>{const a=i?t.filter(o=>o.name!==n.name):[...t,n];e(a)},className:i?rt.checkedOption:rt.option,children:[i?A.jsx(ZL,{}):A.jsx(pg,{}),n.label||n.name]})})})})}),y0e=({isTimeColumn:r,timeColumnName:t,timeCount:e,timeGrain:n,timeRangeIndicator:i,databaseType:a,endDate:o,startDate:s})=>{let l="";const c=a==="snowflake"||a==="redshift"||a==="bigquery"||a==="postgres";switch(i){case"last":if(c){const u=`INTERVAL '${e} ${n}s'`;l=`${t} >= ${r?"CURRENT_TIMESTAMP":"CURRENT_DATE"} - ${u}`}else{const u=`${e} ${n}`;l=`${t} >= ${r?"CURRENT_TIMESTAMP()":"CURDATE()"} - INTERVAL ${u}`}break;case"this":n==="day"?c?l=`${t} >= ${r?"DATE_TRUNC":"CURRENT_DATE"}('day', ${r?t:"CURRENT_TIMESTAMP"}) AND ${t} < ${r?"DATE_TRUNC":"CURRENT_DATE"}('day', ${r?t:"CURRENT_TIMESTAMP"}) + INTERVAL '1 day'`:l=`${t} >= ${r?"DATE(timeColumnName)":"CURDATE()"} AND ${t} < ${r?"DATE(timeColumnName)":"CURDATE()"} + INTERVAL 1 DAY`:n==="year"?c?l=`EXTRACT(year FROM ${t}) = EXTRACT(year FROM ${r?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:l=`YEAR(${t}) = YEAR(${r?"CURRENT_TIMESTAMP()":"CURDATE()"})`:n==="quarter"?c?l=`EXTRACT(quarter FROM ${t}) = EXTRACT(quarter FROM ${r?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:l=`QUARTER(${t}) = QUARTER(${r?"CURRENT_TIMESTAMP()":"CURDATE()"})`:n==="week"?c?l=`${t} >= ${r?"DATE_TRUNC":"CURRENT_DATE"}('week', ${r?t:"CURRENT_TIMESTAMP"}) AND ${t} < ${r?"DATE_TRUNC":"CURRENT_DATE"}('week', ${r?t:"CURRENT_TIMESTAMP"}) + INTERVAL '1 week'`:l=`${t} >= ${r?"DATE(timeColumnName)":"CURDATE()"} - INTERVAL WEEKDAY(${r?"DATE(timeColumnName)":"CURDATE()"}) DAY AND ${t} < ${r?"DATE(timeColumnName)":"CURDATE()"} - INTERVAL WEEKDAY(${r?"DATE(timeColumnName)":"CURDATE()"}) DAY + INTERVAL 1 WEEK`:n==="month"&&(c?l=`EXTRACT(year FROM ${t}) = EXTRACT(year FROM ${r?"CURRENT_TIMESTAMP":"CURRENT_DATE"}) AND EXTRACT(month FROM ${t}) = EXTRACT(month FROM ${r?"CURRENT_TIMESTAMP":"CURRENT_DATE"})`:l=`YEAR(${t}) = YEAR(${r?"CURRENT_TIMESTAMP()":"CURDATE()"}) AND MONTH(${t}) = MONTH(${r?"CURRENT_TIMESTAMP()":"CURDATE()"})`);break;default:if(s&&o){const u=s.toISOString().slice(0,10),h=o.toISOString().slice(0,10);l=`${t} = BETWEEN'${u}' AND '${h}'`}break}return l},F5=(r,t)=>r.reduce((e,n)=>{const i=n[t];return i&&(e[i]||(e[i]=[]),e[i].push(n)),e},{}),B5=(r,t,e)=>{const n=e.toLowerCase(),i=t==="number",a=t==="string",o=t==="date";let s="";i?s=n==="mongodb"||n==="mysql"?"AS SIGNED":"AS BIGINT":a?n==="postgres"||n==="redshift"||n==="snowflake"?s="AS VARCHAR":n==="mongodb"||n==="mysql"?s="AS CHAR":s="AS STRING":o&&(s="AS DATE");let l="";return n==="mongodb"?l=`\`${r}\``:n==="bigquery"||n==="mysql"?l=`${r}`:l=`"${r}"`,s?`CAST(${l} ${s})`:l},b0e=(r,t,e)=>{const n=Object.keys(t).map(s=>`${t[s][0].tableName.split(".").join("_")}_filter`),i=Object.keys(t).map((s,l)=>`${n[l]} AS (
|
|
609
609
|
SELECT * FROM ${t[s][0].tableName} WHERE ${t[s].map(c=>{var u,h,f,d,p,v,g;return c.datatype==="date"?`${y0e({isTimeColumn:!!c.datatype,timeColumnName:B5(c.columnName,void 0,e),timeCount:((u=c.options.find(m=>m.name===c.value))==null?void 0:u.count)||1,timeGrain:((f=(h=c.options.find(m=>m.name===c.value))==null?void 0:h.time)==null?void 0:f.toLowerCase())||"year",timeRangeIndicator:((p=(d=c.options.find(m=>m.name===c.value))==null?void 0:d.range)==null?void 0:p.toLowerCase())||"last",databaseType:e==null?void 0:e.toLowerCase(),endDate:(v=c.options.find(m=>m.name===c.value))==null?void 0:v.endDate,startDate:(g=c.options.find(m=>m.name===c.value))==null?void 0:g.startDate})}`:`${B5(c.columnName,c.datatype,e)} ${Array.isArray(c.value)?"IN":"="} ${Array.isArray(c.value)?`(${c.value.map(m=>typeof m=="string"?`'${m}'`:m).join(", ")})`:typeof c.value=="string"?`'${c.value}'`:c.value}`}).join(" AND ")}
|
|
610
610
|
)`);let a=r;for(let s=0;s<n.length;s++)a=a.replace(new RegExp(t[Object.keys(t)[s]][0].tableName,"g"),n[s]);return`WITH ${i.join(`,
|