(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6461],{13184:function(e,n,t){Promise.resolve().then(t.bind(t,3530))},3530:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eT}});var i,o,r=t(63137),a=t(15572),l=t(50960),s=t(37720),d=t(44545),c=t(52321),u=t(74826),h=t(59359),p=t(11140),x=t(99951),m=t(77595),v=t(10274),g=t(73334),f=t(21181),Z=t(40313),j=t(20144),b=t(14761),w=t(28680),C=t(22457),S=t(35363),I=t(69209),T=t(74571),E=t(47141),y=t(27102),P=t(13577),A=t(60105),_=t(18831),k=t(35562),D=t(59893),R=t(63062),O=t(31314),M=t(80683),z=t(89423),L=t(87119);function N(e){let{dataSource:n,checked:t=!1,enableChecked:i=!1,onClick:o=()=>{},onDelete:d}=e,u=(0,x.useTranslations)("charts"),h=(0,x.useFormatter)(),m=(0,y.Z)(),v=new Date,{id:g,name:f,updateTime:Z,owner:j}=n,b=new Date(Z),w=(0,p.Dv)(O.L),C=(0,R.o_)({variant:"popover",popupId:"chart-list-item-menu"}),S=[{items:[{label:(0,r.jsx)(a.Z,{component:"span",sx:{color:(null==w?void 0:w.id)!==j?"action.disabled":"error.main"},children:u("button.navDelete")}),icon:(0,r.jsx)(c.Z,{component:_.Z,sx:{fontSize:20,color:(null==w?void 0:w.id)!==j?"action.disabled":"error.main"}}),onClick:e=>{e.stopPropagation(),e.preventDefault(),(null==w?void 0:w.id)===j&&(null==d||d(g))},menuItemProps:{sx:{"&:hover":{background:(null==w?void 0:w.id)!==j?m.palette.background.paper:m.palette.action.hover,cursor:(null==w?void 0:w.id)!==j?"default":"pointer"}}}}]}];return(0,r.jsx)(L.Z,{size:"large",children:(0,r.jsxs)(l.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{"&:hover":{"& .MuiIconButton-root":{visibility:"visible"}}},onMouseLeave:()=>{C.close()},onClick:o,children:[(0,r.jsxs)(a.Z,{flex:1,minWidth:0,children:[(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",gap:1,mb:1,children:[(0,r.jsx)(c.Z,{component:D.Z}),(0,r.jsx)(M.Z,{variant:"regular-500",text:f,component:"p"})]}),(0,r.jsx)(s.Z,{variant:"sm-400",color:"text.secondary",component:"p",children:u("lastUpdated",{time:h.relativeTime(b,v)})})]}),i?(0,r.jsx)(P.Z,{checked:t}):(0,r.jsx)(A.Z,{...(0,R.vW)(C),sx:{visibility:"hidden",alignSelf:"flex-start"},onClick:e=>{e.stopPropagation(),(0,R.vW)(C).onClick(e)},children:(0,r.jsx)(c.Z,{component:k.Z,fontSize:"small"})}),(0,r.jsx)(z.Z,{popupState:C,menuLists:S,paperSx:{mt:-2.5,ml:3},menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}})]})})}function F(){let e=(0,x.useTranslations)("charts"),n=(0,C.useRouter)(),[t,{toggle:i}]=(0,j.Z)(),[o,l]=(0,m.useState)(),[s,c]=(0,m.useState)(""),{data:u,loading:h,refresh:p}=(0,b.Z)(E.Mn,{defaultParams:[{pageSize:99999}]}),{runAsync:v,loading:y}=(0,b.Z)(E.uf,{manual:!0}),P=e=>()=>{n.push("/charts/".concat(e))},A=e=>{l(e),i()},_=()=>{l(void 0),i()},k=async()=>{o&&(await v(o),_(),p())};return(0,w.Z)(null==u?void 0:u.records)&&!h?(0,r.jsx)(I.Z,{sx:{px:3,pt:12,width:"100%"},type:"no-data",title:e("noDisplayTitle"),subTitle:e("noDisplayDesc"),footer:(0,r.jsx)(d.Z,{size:"large",variant:"contained",onClick:()=>{n.push("/?startwith=sql-aa")},children:e("button.startWithAA")})}):(0,r.jsxs)(g.Z,{maxWidth:"lg",sx:{p:3,height:"calc(100% - 105px)",display:"flex",flexDirection:"column"},children:[(0,r.jsx)(S.Z,{value:s,onChange:e=>c(e.target.value)}),(0,r.jsxs)(a.Z,{flex:1,minHeight:0,mt:3,sx:{overflowY:"auto"},children:[h?(0,r.jsx)(f.ZP,{container:!0,spacing:2,children:Array.from({length:11},(e,n)=>n+1).map(e=>(0,r.jsx)(f.ZP,{item:!0,xs:12,lg:4,md:6,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:"100%"})},e))}):(0,r.jsx)(f.ZP,{container:!0,spacing:2,children:null==u?void 0:u.records.filter(e=>{var n;return null==e?void 0:null===(n=e.name)||void 0===n?void 0:n.includes(s)}).map(e=>(0,r.jsx)(f.ZP,{item:!0,xs:12,lg:4,md:6,children:(0,r.jsx)(N,{dataSource:e,onClick:P(e.id),onDelete:A})},e.id))}),(0,r.jsx)(T.default,{title:e("deleteTitle"),confirmText:e("button.delete"),loading:y,isOpen:t,handleConfirm:k,description:e("deleteDesc"),handleClose:_})]})]})}var W=t(17500),H=t(85838),U=t(91935),G=t(60275),B=t(16069),V=t(90475),q=t(80246),K=t(69496),Y=t(33650),J=t(90781),X=t(42406),Q=t(96886),$=t(66837),ee=t(43942);function en(e){let{open:n,onClose:t,onSuccess:i}=e,o=(0,x.useTranslations)("dashboard"),a=(0,p.Dv)(v.Dx),l=(0,y.Z)(),s=(0,Q.cI)({defaultValues:{name:"",description:""}}),{handleSubmit:c,watch:u}=s,h=u("name"),g=u("description"),f=(0,m.useMemo)(()=>a?a.name===h&&a.description===g:!h,[a,g,h]),{runAsync:Z,loading:j}=(0,b.Z)(K.JR,{manual:!0}),{runAsync:C,loading:S}=(0,b.Z)(K.Y,{manual:!0}),{runAsync:I,loading:T}=(0,b.Z)(K.AK,{manual:!0}),E=async e=>{if((0,w.Z)(a)){let n=await Z({...e,layouts:""});i((await I(n.data)).data)}else await C(null==a?void 0:a.id,e),i()};return(0,m.useEffect)(()=>{n&&s.reset({name:(null==a?void 0:a.name)||"",description:(null==a?void 0:a.description)||""})},[n,s,a]),(0,r.jsx)($.Z,{onClose:()=>{t()},open:n,title:o(a?"button.navRename":"createDashboard"),width:640,contentSx:{pt:"".concat(l.spacing(2),"!important")},children:(0,r.jsx)(Q.RV,{...s,children:(0,r.jsxs)("form",{className:"flex flex-col gap-6",onSubmit:e=>{e.stopPropagation(),c(E)(e)},children:[(0,r.jsx)(ee.Z,{size:"medium",label:o("nameTitle"),labelSX:{mb:1,py:0,fontWeight:500,fontSize:"0.875rem",lineHeight:"20px"},params:"name",data:h,placeholder:o("namePlaceholder"),maxLength:50,validate:{required:{value:!0,message:o("nameRequired")}}}),(0,r.jsx)(ee.Z,{size:"medium",label:o("descTitle"),labelSX:{mb:1,py:0,fontWeight:500,fontSize:"0.875rem",lineHeight:"20px"},params:"description",data:g,placeholder:o("descPlaceholder"),maxLength:120}),(0,r.jsxs)(X.Z,{className:"col-span-2",sx:{pt:.5,px:0},children:[(0,r.jsx)(d.Z,{autoFocus:!0,variant:"text",onClick:t,children:o("button.cancel")}),(0,r.jsx)(J.Z,{variant:"contained",type:"submit",loading:j||S||T,disabled:f,children:o(a?"button.navRename":"button.create")})]})]})})})}var et=t(60433),ei=t(9002),eo=t(67324);function er(e){let{modified:n,saving:t,refreshing:i,onEdit:o,onSave:s,onCancel:h,onRefresh:m,onAddChart:g,onRename:f,onDelete:Z}=e,j=(0,x.useTranslations)("dashboard"),b=(0,y.Z)(),w=(0,p.Dv)(O.L),[C,S]=(0,p.KO)(v.vb),I=(0,p.Dv)(v.Ht),T=(0,R.o_)({variant:"popover",popupId:"dashboard-edit-menu"}),E=[{items:[{label:(0,r.jsx)(a.Z,{component:"span",sx:{color:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?"action.disabled":"text.primary"},children:j("button.navRename")}),icon:(0,r.jsx)(c.Z,{component:ei.Z,sx:{fontSize:20,color:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?"action.disabled":"text.primary"}}),onClick:e=>{e.stopPropagation(),e.preventDefault(),(null==w?void 0:w.id)===(null==I?void 0:I.owner)&&f(I)},menuItemProps:{sx:{"&:hover":{background:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?b.palette.white.main:b.palette.action.hover,cursor:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?"default":"pointer"}}}},{label:(0,r.jsx)(a.Z,{component:"span",sx:{color:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?"action.disabled":"error.main"},children:j("button.navDelete")}),icon:(0,r.jsx)(c.Z,{component:_.Z,sx:{fontSize:20,color:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?"action.disabled":"error.main"}}),onClick:e=>{e.stopPropagation(),e.preventDefault(),(null==w?void 0:w.id)===(null==I?void 0:I.owner)&&Z(I)},menuItemProps:{sx:{"&:hover":{background:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?b.palette.white.main:b.palette.action.hover,cursor:(null==w?void 0:w.id)!==(null==I?void 0:I.owner)?"default":"pointer"}}}}]}];return(0,r.jsxs)(l.Z,{mb:3,direction:"row",justifyContent:"space-between",alignItems:"center",onMouseLeave:()=>{T.close()},children:[(0,r.jsxs)(a.Z,{flex:1,minWidth:0,children:[(0,r.jsx)(M.Z,{variant:"lg-500",text:null==I?void 0:I.name}),(0,r.jsx)(M.Z,{mt:.5,variant:"sm-400",text:null==I?void 0:I.description})]}),(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",alignSelf:"flex-start",spacing:1,children:[!C&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{...(0,R.vW)(T),onClick:e=>{e.stopPropagation(),(0,R.vW)(T).onClick(e)},children:(0,r.jsx)(c.Z,{component:k.Z,fontSize:"small"})}),(0,r.jsx)(H.Z,{placement:"top",title:j("tooltip.refreshDashboard"),children:(0,r.jsx)(A.Z,{onClick:m,sx:{"@keyframes rotate":{"0%":{transform:"rotate(0deg)"},"50%":{transform:"rotate(180deg)"},"100%":{transform:"rotate(360deg)"}},animation:i?"rotate 1s infinite":"none"},children:(0,r.jsx)(c.Z,{component:eo.Z})})})]}),C?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{variant:"contained",color:"ghost",size:"large",startIcon:(0,r.jsx)(c.Z,{component:et.C}),onClick:g,children:j("button.chart")}),(0,r.jsx)(u.Z,{orientation:"vertical",flexItem:!0,sx:{height:20,mt:"".concat(b.spacing(.5),"!important"),ml:"".concat(b.spacing(1.5),"!important")}}),(0,r.jsx)(d.Z,{variant:"contained",color:"ghost",size:"large",sx:{ml:"".concat(b.spacing(1.5),"!important")},onClick:()=>{h()},children:j("button.cancel")}),(0,r.jsx)(J.Z,{variant:"contained",color:"black",size:"large",disabled:!n,loading:t,onClick:s,children:j("button.save")})]}):(0,r.jsx)(d.Z,{variant:"contained",color:"ghost",size:"large",onClick:()=>{T.close(),S(!0),o()},children:j("button.edit")})]}),(0,r.jsx)(z.Z,{popupState:T,menuLists:E,paperSx:{mt:-2.5,ml:3},menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}})]})}var ea=t(38969),el=t(36608),es=t(68948);(i=o||(o={})).Dashboard="Dashboard",i.Charts="Charts";let ed={Dashboard:(0,r.jsx)(c.Z,{component:es.Z}),Charts:(0,r.jsx)(c.Z,{component:D.Z})};function ec(e){let{value:n,disabled:t,onChange:i}=e,a=(0,x.useTranslations)("dashboard.pageTabs");return(0,r.jsx)(ea.Z,{sx:{px:3,"& .MuiTab-root":{minHeight:0},bgcolor:"background.paper"},value:n,onChange:(e,n)=>{i(n)},children:Object.entries(o).map(e=>{let[n,i]=e;return(0,r.jsx)(el.Z,{disabled:t,sx:{textTransform:"none"},value:n,icon:ed[n],iconPosition:"start",label:a("".concat(i))},n)})})}var eu=t(34785),eh=t(22330);function ep(e){let{open:n,currentCharts:t,dataSource:i,onClose:o,onSubmit:a}=e,s=(0,x.useTranslations)("dashboard"),[c,h]=(0,m.useState)(""),[p,v]=(0,m.useState)([]),g=(0,m.useMemo)(()=>i.filter(e=>!t.find(n=>n.id===e.id)),[i,t]),Z=e=>()=>{p.find(n=>n.id===e.id)?v(p.filter(n=>n.id!==e.id)):v([...p,e])},j=()=>{v([]),o()};return(0,r.jsxs)(eh.Z,{title:s("selectCharts"),open:n,handleClose:j,width:800,overflow:"hidden",customBtn:(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(d.Z,{size:"large",color:"ghost",onClick:()=>{p.length===g.length?v([]):v(g||[])},children:s(p.length===g.length?"button.revokeAll":"button.selectAll")}),(0,r.jsx)(d.Z,{size:"large",variant:"contained",disabled:!p.length,onClick:()=>{a(p),j()},children:s("button.submit",{count:p.length})})]}),children:[(0,r.jsx)(S.Z,{sx:{mx:3},variant:"standard",value:c,onChange:e=>h((0,eu.Z)(e.target.value))}),(0,r.jsx)(u.Z,{}),(0,r.jsx)(f.ZP,{container:!0,spacing:2,p:3,children:g.filter(e=>{var n;return null==e?void 0:null===(n=e.name)||void 0===n?void 0:n.includes(c)}).map(e=>(0,r.jsx)(f.ZP,{item:!0,xs:6,children:(0,r.jsx)(N,{enableChecked:!0,dataSource:e,checked:!!p.find(n=>n.id===e.id),onClick:Z(e)})},e.id))})]})}var ex=t(37269),em=t(3947),ev=t.n(em),eg=t(16066);function ef(e){let{id:n,name:t,children:i,selected:o,enableDelete:s=!1,onClick:d,onDelete:h}=e,p=(0,y.Z)(),m=(0,x.useTranslations)("dashboard"),v=(0,R.o_)({variant:"popover",popupId:"dashboard-chart--menu-".concat(n)}),g=[{items:[{label:(0,r.jsx)(a.Z,{component:"span",sx:{color:"error.main"},children:m("button.navDelete")}),icon:(0,r.jsx)(c.Z,{component:_.Z,sx:{fontSize:20,color:"error.main"}}),onClick:e=>{e.stopPropagation(),e.preventDefault(),null==h||h(n)},menuItemProps:{sx:{"&:hover":{background:p.palette.action.hover,cursor:"pointer"}}}}]}];return(0,r.jsxs)(l.Z,{sx:e=>({width:"100%",height:"100%",borderRadius:1.5,border:"1px solid ".concat(e.palette.divider),cursor:s?"move":"default",...s&&{"&:hover":{boxShadow:e.shadows[2]}},...o&&{border:"1px solid #8165FC",boxShadow:e.shadows[2]}}),onMouseLeave:()=>{v.close()},onClick:d,children:[(0,r.jsxs)(l.Z,{px:1.5,py:1,height:36,direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,r.jsx)(M.Z,{variant:"sm-500",text:t}),(0,r.jsx)(A.Z,{...(0,R.vW)(v),sx:{display:s?"block":"none"},size:"small",onClick:e=>{e.stopPropagation(),(0,R.vW)(v).onClick(e)},children:(0,r.jsx)(c.Z,{component:k.Z,fontSize:"small"})})]}),(0,r.jsx)(u.Z,{}),(0,r.jsx)(a.Z,{flex:1,minHeight:0,p:1,overflow:"hidden",children:i}),(0,r.jsx)(z.Z,{popupState:v,menuLists:g,paperSx:{mt:-2.5,ml:3},menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}})]},n)}function eZ(e){var n;let{id:t,dataSource:i,loading:o,layouts:l,currentChartId:s,onAddChart:u,onRemoveChart:g,onChartClick:j,onLayoutChange:b}=e,C=(0,x.useTranslations)("dashboard"),S=(0,m.useRef)(null),T=(0,ex.Z)(S),E=(0,p.Dv)(v.vb),y=e=>{E&&j(e)};return(0,w.Z)(i)&&!o?(0,r.jsx)(I.Z,{sx:{px:3,pt:12,width:"100%"},type:"no-data",title:C("noDisplayTitle"),footer:E?(0,r.jsx)(d.Z,{size:"large",variant:"contained",startIcon:(0,r.jsx)(c.Z,{component:h.v}),onClick:u,children:C("button.chart")}):null}):(0,r.jsx)(a.Z,{ref:S,flex:1,sx:{overflowY:"auto"},children:o?(0,r.jsxs)(f.ZP,{container:!0,spacing:2,children:[(0,r.jsx)(f.ZP,{item:!0,xs:8,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:4,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:4,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:8,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:6,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:6,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})})]}):(0,r.jsx)(ev(),{className:"layout",style:{height:E?"10000px":"100%"},containerPadding:[2,2],margin:[24,24],cols:12,rowHeight:100,width:null!==(n=(null==T?void 0:T.width)||-48)&&void 0!==n?n:1e3,layout:l,onLayoutChange:e=>{b(e)},children:i.map(e=>{let n=l.find(n=>n.i===e.id);return n?(0,r.jsx)("div",{"data-grid":n,children:(0,r.jsx)(ef,{id:e.id,name:e.name,enableDelete:E,selected:s===e.id&&E,onClick:()=>y(e.id),onDelete:()=>g(e.id),children:(0,r.jsx)(eg.Z,{id:e.id,chartType:e.config.chartType,chartConfig:e.config})})},n.i):null})})},"dashboard-layout-".concat(t))}function ej(e){let{dashboard:n,selected:t,onSelect:i,onDelete:o,onEdit:s}=e,d=(0,y.Z)(),u=(0,x.useTranslations)("dashboard"),h=(0,p.Dv)(O.L),m=(0,x.useFormatter)(),v=new Date,g=m.relativeTime(n.updateTime,v),f=(0,R.o_)({variant:"popover",popupId:"dashboard-card-menu"}),Z=[{items:[{label:(0,r.jsx)(a.Z,{component:"span",sx:{color:(null==h?void 0:h.id)!==n.owner?"action.disabled":"text.primary"},children:u("button.navRename")}),icon:(0,r.jsx)(c.Z,{component:ei.Z,sx:{fontSize:20,color:(null==h?void 0:h.id)!==n.owner?"action.disabled":"text.primary"}}),onClick:e=>{e.stopPropagation(),e.preventDefault(),(null==h?void 0:h.id)===n.owner&&s()},menuItemProps:{sx:{"&:hover":{background:(null==h?void 0:h.id)!==n.owner?d.palette.white.main:d.palette.action.hover,cursor:(null==h?void 0:h.id)!==n.owner?"default":"pointer"}}}},{label:(0,r.jsx)(a.Z,{component:"span",sx:{color:(null==h?void 0:h.id)!==n.owner?"action.disabled":"error.main"},children:u("button.navDelete")}),icon:(0,r.jsx)(c.Z,{component:_.Z,sx:{fontSize:20,color:(null==h?void 0:h.id)!==n.owner?"action.disabled":"error.main"}}),onClick:e=>{e.stopPropagation(),e.preventDefault(),(null==h?void 0:h.id)===n.owner&&o()},menuItemProps:{sx:{"&:hover":{background:(null==h?void 0:h.id)!==n.owner?d.palette.white.main:d.palette.action.hover,cursor:(null==h?void 0:h.id)!==n.owner?"default":"pointer"}}}}]}];return(0,r.jsx)(L.Z,{selected:t,color:"grey",children:(0,r.jsxs)(a.Z,{sx:{width:"336px","&:hover":{"& .MuiIconButton-root":{visibility:"visible"}}},onMouseLeave:()=>{f.close()},onClick:i,children:[(0,r.jsxs)(l.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[(0,r.jsx)(c.Z,{component:es.Z}),(0,r.jsx)(M.Z,{line:1,variant:"regular-500",text:n.name,placement:"left"}),(0,r.jsx)(A.Z,{...(0,R.vW)(f),sx:{visibility:"hidden"},onClick:e=>{e.stopPropagation(),(0,R.vW)(f).onClick(e)},children:(0,r.jsx)(c.Z,{component:k.Z,fontSize:"small"})})]}),(0,r.jsx)(M.Z,{line:1,variant:"sm-400",text:u("updateTime",{time:g}),placement:"left",textSx:{mt:1,color:"text.secondary"}}),(0,r.jsx)(z.Z,{popupState:f,menuLists:Z,paperSx:{mt:-2.5,ml:3},menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}})]})})}function eb(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",height:84,width:300})]})}function ew(e){let{loading:n,selected:t,dataSource:i,onSelect:o,onDelete:s}=e,d=(0,p.b9)(v.Dx),c=(0,p.b9)(v.ID),u=e=>()=>{o(e)},h=e=>()=>{d(e),c(!0)};return(0,r.jsx)(a.Z,{id:"datasource-id",overflow:"auto",px:3,pb:3,sx:{height:"calc(100% - 78px)"},children:(0,r.jsxs)(l.Z,{gap:2,children:[(0,w.Z)(i)&&n&&(0,r.jsx)(eb,{}),i.map(e=>(0,r.jsx)(ej,{dashboard:e,selected:(null==t?void 0:t.id)===e.id,onSelect:u(e),onDelete:()=>s(e),onEdit:h(e)},e.id))]})})}function eC(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.Z,{spacing:.5,mb:3,children:[(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:28}),(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:20})]}),(0,r.jsxs)(f.ZP,{container:!0,spacing:2,children:[(0,r.jsx)(f.ZP,{item:!0,xs:8,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:4,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:4,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:8,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:6,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})}),(0,r.jsx)(f.ZP,{item:!0,xs:6,children:(0,r.jsx)(Z.Z,{variant:"rounded",animation:"wave",width:"100%",height:200})})]})]})}function eS(){let e=(0,C.useRouter)(),n=(0,x.useTranslations)("dashboard"),[t,{toggle:i,setLeft:o}]=(0,j.Z)(!0),[h,{toggle:g}]=(0,j.Z)(),[f,{toggle:Z}]=(0,j.Z)(),[S,{toggle:y,setLeft:P}]=(0,j.Z)(),[_,k]=(0,m.useState)([]),[D,R]=(0,m.useState)([]),[O,M]=(0,m.useState)(),[z,L]=(0,m.useState)(),N=(0,p.b9)(v.Dx),[F,J]=(0,p.KO)(v.vb),[X,Q]=(0,p.KO)(v.Ht),[$,ee]=(0,p.KO)(v.ID),et=D.find(e=>e.id===O),{data:ei,loading:eo,refresh:ea}=(0,b.Z)(K.j2,{defaultParams:[{pageSize:99999}],onSuccess:e=>{if(e.records.length>0){let n=X?e.records.find(e=>e.id===X.id):e.records[0];n&&eT(n)}}}),{data:el,runAsync:es,loading:ed}=(0,b.Z)(K.JW,{manual:!0,onBefore:()=>{R([])},onSuccess:e=>{R(e.records||[])}}),{data:ec}=(0,b.Z)(E.Mn,{defaultParams:[{pageSize:99999}]}),{runAsync:eu,loading:eh}=(0,b.Z)(K.Y,{manual:!0}),{runAsync:ex,loading:em}=(0,b.Z)(K.b7,{manual:!0}),{runAsync:ev,loading:eg}=(0,b.Z)(K.dG,{manual:!0}),{runAsync:ef,loading:ej}=(0,b.Z)(E.Ll,{manual:!0}),{runAsync:eb,loading:eS}=(0,b.Z)(K.fG,{manual:!0,onSuccess:(e,n)=>{n[0]===(null==X?void 0:X.id)&&Q(null),ea()}}),eI=(0,m.useMemo)(()=>{var e;let n=_.map(e=>{let{i:n,x:t,y:i,w:o,h:r}=e;return{i:n,x:t,y:i,w:o,h:r}}),t=(null==X?void 0:null===(e=X.layouts)||void 0===e?void 0:e.map(e=>{let{i:n,x:t,y:i,w:o,h:r}=e;return{i:n,x:t,y:i,w:o,h:r}}))||[];return!(0,B.Z)((0,V.Z)(D,"i"),(0,V.Z)(null==el?void 0:el.records,"i"))||!(0,B.Z)((0,V.Z)(n,"i"),(0,V.Z)(t,"i"))},[el,X,D,_]),eT=e=>{var n;let t=(null==e?void 0:null===(n=e.layouts)||void 0===n?void 0:n.map(e=>({...e,y:e.y||0,static:!0})))||[];J(!1),k(t),Q(e),es(e.id,{pageSize:99999})},eE=()=>{var e;let n=(null==X?void 0:null===(e=X.layouts)||void 0===e?void 0:e.map(e=>({...e,static:!0})))||[];J(!1),k(n),M(void 0),R((null==el?void 0:el.records)||[]),P()},ey=e=>{g(),L(e.id)},eP=async()=>{await eb(z),g()},eA=async()=>{let e=_.map(e=>({...e,static:!0}));await eu(X.id,{layouts:JSON.stringify(e)});let t=(null==el?void 0:el.records)||[],i=D.filter(e=>!t.find(n=>n.id===e.id)),o=t.filter(e=>!D.find(n=>n.id===e.id));i.length>0&&await ex(X.id,{chartIds:i.map(e=>e.id)}),o.length>0&&await ev(X.id,{chartIds:o.map(e=>e.id)}),D.forEach(async e=>{var n;let t=null==ec?void 0:null===(n=ec.records)||void 0===n?void 0:n.find(n=>n.id===e.id);(0,B.Z)(null==t?void 0:t.config,e.config)||await ef(e.id,{name:e.config.chartTitle,config:JSON.stringify(e.config)})}),J(!1),ea(),q.Z.success(n("notistack.saved"))},e_=e=>F&&eI?(e.preventDefault(),n("notistack.leaveConfirm")):"";return(0,G.Z)("beforeunload",e=>{let n=e_(e);return n?(e.returnValue=n,n):""}),(0,m.useEffect)(()=>()=>{Q(null),J(!1)},[Q,J]),(0,m.useEffect)(()=>{F&&o()},[F,o]),(0,r.jsxs)(r.Fragment,{children:[(0,w.Z)(null==ei?void 0:ei.records)&&!eo?(0,r.jsx)(I.Z,{sx:{px:3,pt:12,width:"100%"},type:"no-data",title:n("noDisplayTitle"),subTitle:n("noDisplayDesc"),footer:(0,r.jsx)(d.Z,{size:"large",variant:"contained",onClick:()=>{e.push("/?startwith=sql-aa")},children:n("button.startWithAA")})}):(0,r.jsxs)(l.Z,{direction:"row",overflow:"hidden",height:"100%",children:[(0,r.jsx)(W.Z,{in:t,orientation:"horizontal",sx:{height:"calc(100vh - 150px)",overflow:"hidden"},children:F?(0,r.jsx)(l.Z,{height:"100%",children:et?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{flex:1,minHeight:0,children:(0,r.jsx)(Y.Z,{chartType:et.config.chartType,config:et.config,onConfigChange:e=>{R(D.map(n=>n.id===O?{...n,config:{...n.config,...e}}:n))}})}),(0,r.jsx)(d.Z,{sx:{m:3},color:"ghost",size:"large",onClick:()=>{e.push("/charts/".concat(O))},children:n("button.goToDetails")})]}):(0,r.jsx)(s.Z,{width:348,component:"p",variant:"regular-400",color:"text.secondary",textAlign:"center",pt:9,children:n("noChartsSelected")})}):(0,r.jsxs)(a.Z,{height:"100%",children:[(0,r.jsxs)(l.Z,{direction:"row",gap:1,p:3,children:[(0,r.jsx)(s.Z,{variant:"lg-500",component:"div",sx:{flex:1,whiteSpace:"nowrap"},children:n("title")}),(0,r.jsx)(H.Z,{title:"Hide",children:(0,r.jsx)(A.Z,{color:"outlined",onClick:i,children:(0,r.jsx)(c.Z,{component:U.$})})})]}),(0,r.jsx)(ew,{loading:eo,selected:X,dataSource:(null==ei?void 0:ei.records)||[],onSelect:eT,onDelete:ey})]})}),t?(0,r.jsx)(u.Z,{orientation:"vertical",flexItem:!0}):(0,r.jsx)(a.Z,{p:3,children:(0,r.jsx)(H.Z,{title:n("tooltip.expand"),children:(0,r.jsx)(A.Z,{color:"outlined",onClick:i,children:(0,r.jsx)(c.Z,{component:U.V})})})}),(0,r.jsx)(l.Z,{flex:1,minWidth:0,p:3,children:(0,w.Z)(X)?(0,r.jsx)(eC,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{saving:eh||em||eg||ej,modified:eI,refreshing:ed,onRefresh:()=>es(X.id,{pageSize:99999}),onAddChart:Z,onEdit:()=>{k(_.map(e=>({...e,static:!1})))},onCancel:()=>{eI?y():eE()},onSave:eA,onDelete:ey,onRename:e=>{N(e),ee(!0)}}),(0,r.jsx)(eZ,{id:X.id,layouts:_,loading:ed,dataSource:D,currentChartId:O,onAddChart:Z,onRemoveChart:e=>{R(D.filter(n=>n.id!==e)),k(_.filter(n=>n.i!==e)),e===O&&M(void 0)},onLayoutChange:k,onChartClick:M})]})})]}),(0,r.jsx)(en,{open:$,onClose:()=>ee(!1),onSuccess:e=>{if(ee(!1),!(0,w.Z)(e)){var n;eT(e),(null==ec?void 0:null===(n=ec.records)||void 0===n?void 0:n.length)&&Z()}ea()}}),(0,r.jsx)(T.default,{title:n("deleteTitle"),confirmText:n("button.delete"),loading:eS,isOpen:h,handleConfirm:eP,description:n("deleteDesc"),handleClose:g}),(0,r.jsx)(ep,{open:f,currentCharts:D,dataSource:(null==ec?void 0:ec.records)||[],onClose:Z,onSubmit:e=>{F||J(!0),R([...D,...e]);let n=e.map((e,n)=>({i:e.id,x:n%2==0?0:6,y:4*Math.floor(n/2),w:6,h:4})),t=4*Math.ceil(e.length/2);k([..._.map(e=>({...e,y:e.y+t})),...n])}}),(0,r.jsx)(T.default,{title:n("quitTitle"),loading:!1,isOpen:S,handleConfirm:eE,confirmText:n("button.quit"),description:n("quitDesc"),handleClose:y})]})}var eI=t(22962);function eT(){let e=(0,x.useTranslations)("dashboard"),{sendGTMEvent:n}=(0,eI.Z)(),[t,i]=(0,p.KO)(v.S4),[o,g]=(0,p.KO)(v.vb),f=(0,p.b9)(v.Dx),Z=(0,p.b9)(v.ID);return(0,m.useEffect)(()=>{n({event:"Nav_Dashboards_view"})},[]),(0,r.jsxs)(a.Z,{component:"main",id:"dashboard-page",sx:{width:"100%",flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:[(0,r.jsxs)(a.Z,{component:"header",sx:{backgroundColor:"background.paper",display:"flex",alignItems:"center",justifyContent:"space-between",px:3,py:2.5,flexWrap:"wrap"},children:[(0,r.jsx)(l.Z,{direction:"row",gap:2,alignItems:"center",children:(0,r.jsx)(s.Z,{variant:"lg-500",component:"h1",children:e("title")})}),(0,r.jsx)(a.Z,{children:(0,r.jsx)(d.Z,{variant:"contained",size:"large",startIcon:(0,r.jsx)(c.Z,{component:h.v}),disabled:o,onClick:()=>{"Dashboard"!==t&&i("Dashboard"),f(null),Z(!0)},children:e("button.add")})})]}),(0,r.jsx)(ec,{disabled:o,value:t,onChange:e=>{i(e),"Charts"===e&&g(!1)}}),(0,r.jsx)(u.Z,{}),"Dashboard"===t&&(0,r.jsx)(eS,{}),"Charts"===t&&(0,r.jsx)(F,{})]})}},31314:function(e,n,t){"use strict";t.d(n,{L:function(){return r},t:function(){return o}});var i=t(91252);let o=(0,t(89455).O4)("auth-token","",void 0,{getOnInit:!0}),r=(0,i.cn)(null)},10274:function(e,n,t){"use strict";t.d(n,{Dx:function(){return l},Ht:function(){return s},ID:function(){return r},S4:function(){return o},vb:function(){return a}});var i=t(91252);let o=(0,i.cn)("Dashboard"),r=(0,i.cn)(!1),a=(0,i.cn)(!1),l=(0,i.cn)(null),s=(0,i.cn)(null)},18337:function(e,n,t){"use strict";t.d(n,{EM:function(){return p},Jc:function(){return x},M6:function(){return w},NH:function(){return u},Wj:function(){return h},Zc:function(){return g},_T:function(){return o},bM:function(){return C},dq:function(){return m},hD:function(){return s},hu:function(){return S},j5:function(){return d},mY:function(){return T},mr:function(){return I},o5:function(){return j},vS:function(){return b},w7:function(){return c},yu:function(){return Z}});var i,o,r=t(91252),a=t(89455),l=t(87709);let s=(0,r.cn)([]),d=(0,r.cn)([]),c=(0,r.cn)([]),u=(0,r.cn)(null),h=(0,r.cn)(null),p=(0,r.cn)([]),x=(0,r.cn)(!1),m=(0,r.cn)(!1);(i=o||(o={})).PERIOD="period",i.CONVERSATION="conversation",i.DATABASE="database",i.DATABASE_LIMIT="database_limit",i.DATASET="dataset",i.DATASET_LIMIT="dataset_limit",i.APP="app",i.APP_LIMIT="app_limit",i.PPT="ppt",i.REPORT="report";let v={show:!1,descLineOne:"conversation",upgradePlan:l.k9.PLUS,quotaType:l.Eq.DATASET_SIZE},g=(0,r.cn)(v),f={show:!1,subscribeId:"",isUnfinished:!1,upgradePlan:l.k9.BASIC},Z=(0,a.rw)(f),j=(0,r.cn)(!1),b=(0,r.cn)(null),w=(0,r.cn)(!1),C=(0,r.cn)(!1),S=(0,r.cn)(!1),I=(0,r.cn)(!1),T=(0,r.cn)(!1)},16066:function(e,n,t){"use strict";t.d(n,{Z:function(){return p}});var i=t(63137),o=t(40313),r=t(14761),a=t(28680),l=t(77595),s=t(15298),d=t(46246),c=e=>{let{options:n={},style:t={},onChartReady:o,onChartFinished:r=()=>{}}=e,a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=d.init(a.current);return null==o||o(e),e.on("finished",function(){null==r||r()}),e.setOption(n),()=>{e.dispose()}},[]),(0,i.jsx)("div",{ref:a,style:t||{width:"600px",height:"400px"}})},u=t(47141),h=t(53671);function p(e){let{id:n,chartType:t,chartConfig:d,externalResource:p,onChartReady:x,onChartFinished:m,style:v,renderInOrigin:g=!1}=e,{data:f,loading:Z}=(0,r.Z)(()=>(0,u.Hr)(n),{ready:!!n}),j=(0,l.useMemo)(()=>{if(n||!(0,a.Z)(p)){let e=Object.keys((null==d?void 0:d.yFields)||{}).filter(e=>{var n;return null==d?void 0:null===(n=d.yFields)||void 0===n?void 0:n[e]});return(0,s._u)(f||p||[],d.xField||"",e,t,d)}return{}},[n,p,f,t,d]),b=(0,l.useMemo)(()=>{let{columns:e=[],excludeColumns:n=[]}=d;return e.filter(e=>!n.includes(e))},[d]);return Z?(0,i.jsx)(o.Z,{variant:"rounded",animation:"wave",height:"100%",width:"100%"}):"table"===t?(0,i.jsx)(h.Z,{dataSource:(n?f:p)||[],columns:b,enableRowNumbers:null==d?void 0:d.showRowNumbers,enableColumnFilters:null==d?void 0:d.showColumnFilters},"".concat(n,"-").concat(d.showRowNumbers,"-").concat(d.showColumnFilters)):g?(0,i.jsx)(c,{style:v,options:j,onChartReady:x,onChartFinished:m}):(0,i.jsx)(s.ZP,{style:v,options:j,type:t,loading:Z,onChartReady:x,onChartFinished:m})}},66837:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(63137),o=t(33620),r=t(13551),a=t(60105),l=t(52321),s=t(8975),d=t(46298);function c(e){let{onClose:n,open:t,title:c,children:u,width:h=640,action:p,contentSx:x={},titleSx:m={},...v}=e;return(0,i.jsxs)(o.Z,{id:"custom-dialog",onClose:(e,t)=>{"backdropClick"!==t&&(null==n||n())},open:t,maxWidth:"md",...v,children:[(0,i.jsxs)(r.Z,{sx:{display:"flex",...m},justifyContent:"space-between",children:[c,n&&(0,i.jsx)(a.Z,{"aria-label":"close",onClick:n,children:(0,i.jsx)(l.Z,{component:d.X,color:"action"})})]}),(0,i.jsx)(s.Z,{sx:{width:h,maxWidth:"100%",p:2,...x},children:u}),p]})}},22330:function(e,n,t){"use strict";t.d(n,{J:function(){return o},Z:function(){return p}});var i,o,r=t(63137),a=t(67708),l=t(15572),s=t(50960),d=t(60105),c=t(52321),u=t(37720),h=t(46298);function p(e){let{open:n,handleClose:t,footerSX:i,title:o,children:p,width:x=650,footer:m,customBtn:v,subSx:g,drawerSx:f,titleContainerSx:Z={},titleRowSx:j={},closeIconPlacement:b="left",...w}=e;return(0,r.jsx)(a.ZP,{id:"custom-drawer",open:n,anchor:"right",onClose:t,variant:"temporary",ModalProps:{keepMounted:!1,sx:{"& .MuiDrawer-paper":{width:x,...f}}},...w,children:n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.Z,{sx:{width:x,height:"100%",pb:2,position:"relative",...g},children:[(0,r.jsx)(l.Z,{sx:[e=>({py:2,background:e.palette.background.paper,position:"sticky",zIndex:e.zIndex.drawer,top:0}),Z],children:(0,r.jsx)(s.Z,{direction:"row",alignItems:"center",gap:1,px:3,sx:j,children:"left"===b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{onClick:t,children:(0,r.jsx)(c.Z,{component:h.X})}),(0,r.jsx)(u.Z,{variant:"lg-500",sx:{flex:1},children:o}),v&&v]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{variant:"lg-500",sx:{flex:1},children:o}),(0,r.jsx)(d.Z,{onClick:t,children:(0,r.jsx)(c.Z,{component:h.X})}),v&&v]})})}),p]}),m&&(0,r.jsx)(l.Z,{sx:{position:"absolute",bottom:0,width:"100%",...i},children:m})]}):null})}(i=o||(o={})).LEFT="left",i.RIGHT="right"},80683:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var i=t(63137),o=t(37720),r=t(77595),a=t(85838);function l(e){let{children:n,title:t=null,sx:o={},...r}=e;return(0,i.jsx)(a.Z,{title:t,sx:{px:1,py:.5,...o},...r,children:n})}function s(e){let{text:n="",line:t=1,sx:a={},textSx:s={},hasTip:d=!0,placement:c="top-start",...u}=e,[h,p]=(0,r.useState)(!1),x=(0,r.useRef)(null),m=(0,i.jsx)(o.Z,{onMouseEnter:()=>{x.current&&p(1===t?x.current.scrollWidth>x.current.clientWidth:x.current.scrollHeight>x.current.clientHeight)},ref:x,className:"block",noWrap:1===t,variant:"lg-500",sx:{mb:0,...t>1&&{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:t,WebkitBoxOrient:"vertical"},width:"100%",...s},mb:.5,...u,children:n});return h&&d?(0,i.jsx)(l,{arrow:!0,title:n,placement:c,id:"no-translate",sx:{...a},children:m}):m}},89423:function(e,n,t){"use strict";t.d(n,{Z:function(){return b}});var i,o=t(63137),r=t(77595),a=t(59506),l=t(39923),s=t(2796),d=t(47817),c=t(52321),u=t(58987),h=t(63062),p=t(82480),x=t(30853);function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(null,arguments)}var v=function(e){return x.createElement("svg",m({width:24,height:24},e),i||(i=x.createElement("path",{fillRule:"evenodd",d:"M14.3 12 7.58 5.28l1.06-1.06L16.42 12l-7.78 7.78-1.06-1.06z",clipRule:"evenodd"})))};let g=(0,r.createContext)({parentPopupState:null,rootPopupState:null});function f(e){let{popupState:n,children:t,width:i,menuProps:l,paperSx:s={}}=e,{rootPopupState:d}=r.useContext(g),c=r.useMemo(()=>({rootPopupState:d||n,parentPopupState:n}),[d,n]);return(0,o.jsx)(g.Provider,{value:c,children:(0,o.jsx)(p.Z,{PaperProps:{sx:{backgroundColor:"transparent",boxShadow:"none",p:3,...s}},MenuListProps:{sx:e=>({p:0,zIndex:e.zIndex.tooltip,"& .MuiModal-backdrop":{backgroundColor:"transparent"}})},sx:e=>({zIndex:e.zIndex.tooltip,"& .MuiModal-backdrop":{backgroundColor:"transparent"}}),...(0,h.wK)(n),onClose:n.close,...l,children:(0,o.jsx)(a.Z,{id:"hover-menu",sx:{borderRadius:2,backgroundColor:"background.paper",boxShadow:"0px 2px 16px 0px rgba(0, 0, 0, 0.10)",width:i||"auto"},children:t})})})}function Z(e){let{item:n,subIndex:t}=e,{rootPopupState:i}=(0,r.useContext)(g);if(!i)throw Error("must be used inside a CascadingMenu");return(0,o.jsxs)(l.Z,{disabled:n.isHide,onClick:e=>{var t;e.stopPropagation(),i.close(),null===(t=n.onClick)||void 0===t||t.call(n,e)},...n.menuItemProps,children:[(null==n?void 0:n.icon)&&(0,o.jsx)(s.Z,{children:n.icon}),(0,o.jsx)(d.Z,{sx:{ml:n.icon?1:0},primary:n.label,primaryTypographyProps:{variant:"sm-400",color:"inherit",noWrap:!0,...null==n?void 0:n.primaryTypographyProps}}),n.hasChevron&&(0,o.jsx)(c.Z,{component:v,sx:{color:"text.secondary"}})]},Number(t))}function j(e){var n,t;let{item:i,popupId:a}=e,{parentPopupState:p}=r.useContext(g),x=(0,h.o_)({popupId:a,variant:"popover",parentPopupState:p});return(0,o.jsxs)(o.Fragment,{children:[(0,r.createElement)(l.Z,{...(0,h.b8)(x),disabled:i.isHide,key:a,...i.menuItemProps,selected:x.isOpen||(null===(n=i.menuItemProps)||void 0===n?void 0:n.selected),children:[(null==i?void 0:i.icon)&&(0,o.jsx)(s.Z,{children:i.icon}),(0,o.jsx)(d.Z,{sx:{ml:i.icon?1:0},primary:i.label,primaryTypographyProps:{variant:"sm-400",color:"inherit",noWrap:!0,...null==i?void 0:i.primaryTypographyProps}}),(0,r.isValidElement)(i.hasChevron)&&i.hasChevron,!(0,r.isValidElement)(i.hasChevron)&&i.hasChevron&&(0,o.jsx)(c.Z,{component:v,sx:{ml:1,color:"text.secondary"}})]}),(0,o.jsx)(f,{menuProps:{anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...null==i?void 0:i.menuProps},popupState:x,children:i.node?i.node:null==i?void 0:null===(t=i.child)||void 0===t?void 0:t.map((e,n)=>{let{items:t,menuListProps:i}=e;return(0,o.jsx)(u.Z,{...i,children:t.map((e,n)=>(null==e?void 0:e.child)&&(null==e?void 0:e.popupId)?(0,o.jsx)(j,{item:e,popupId:a},Number(n)):(0,o.jsx)(Z,{item:e,subIndex:n},Number(n)))},Number(n))})})]})}function b(e){let{menuLists:n,menuProps:t,popupState:i,width:r,paperSx:a}=e;return(0,o.jsx)(f,{popupState:i,menuProps:t,width:r,paperSx:a,children:n.map((e,n)=>{let{items:t,menuListProps:i}=e;return(0,o.jsx)(u.Z,{...i,children:t.map((e,n)=>((null==e?void 0:e.child)||e.node)&&(null==e?void 0:e.popupId)?(0,o.jsx)(j,{item:e,subIndex:n,popupId:null==e?void 0:e.popupId},null==e?void 0:e.popupId):(0,o.jsx)(Z,{item:e,subIndex:n},Number(n)))},Number(n))})})}},35363:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var i=t(63137),o=t(2205),r=t(93119),a=t(52321),l=t(8426),s=t(99951);function d(e){let n={fullWidth:!0,size:"small",placeholder:(0,s.useTranslations)("custom.searchInput")("placeholder"),...e};return(0,i.jsx)(o.Z,{InputProps:{sx:{pl:1.5,backgroundColor:"background.paper"},startAdornment:(0,i.jsx)(r.Z,{position:"start",sx:{mr:1},children:(0,i.jsx)(a.Z,{component:l.l})})},...n})}},43942:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var i=t(63137),o=t(7075),r=t(84344),a=t(50960),l=t(15572),s=t(2205),d=t(72535),c=t(28680),u=t(43248),h=t(99951),p=t(77595),x=t(96886),m=t(5223),v=t(80246);function g(e){var n;let{label:t="",params:g="",validate:f,helpText:Z,beforeInput:j,data:b="",rules:w=[],className:C="",labelSX:S={},onBlur:I=()=>{},onChange:T=()=>{},sx:E={},size:y="small",maxLength:P=999999,...A}=e,_=(0,h.useTranslations)("custom.NestedInput"),{register:k,trigger:D,getFieldState:R,formState:O,watch:M,setValue:z}=(0,x.Gc)(),{isTouched:L}=R(g,O),[N,F]=(0,p.useState)(!1),W=M(g)||"",H=P-W.length,U=!(0,c.Z)(w)||H>=-1&&H<=10,G=null===(n=(0,u.Z)(O.errors,g))||void 0===n?void 0:n.message;return(0,p.useEffect)(()=>{N&&L&&D(g,{shouldFocus:!0})},[N,L,g,D]),(0,i.jsxs)(o.Z,{className:C,error:!!G&&!N,children:[t&&(0,i.jsx)(r.Z,{sx:{mb:2,...S},children:t}),Z,(0,i.jsxs)(a.Z,{direction:"row",alignItems:"center",gap:2,children:[j,(0,i.jsxs)(l.Z,{sx:{position:"relative",flex:1},children:[(0,i.jsx)(s.Z,{size:y,fullWidth:!0,error:!!G&&!N,onFocus:()=>F(!0),inputProps:{maxLength:P+1},...k(g,{...f,onChange:e=>{e.target.value.length>P?(e.target.value=e.target.value.slice(0,P),v.Z.warning(_("characterLimit")),z(g,e.target.value)):T(e)}}),sx:{"& .MuiOutlinedInput-root":{"&.Mui-focused":{borderRadius:U?"0 0 0.25rem 0.25rem ":"0.25rem"}},...E},...A,onBlur:e=>{F(!1),f&&!f.validate&&D(g),I(e)}}),N&&U?(0,i.jsx)(m.Z,{size:y,data:b,rules:w,remained:P-W.length}):null,G&&!N?(0,i.jsx)(d.Z,{error:!0,children:G}):null]})]})]})}},5223:function(e,n,t){"use strict";t.d(n,{Z:function(){return h}});var i=t(63137),o=t(50960),r=t(52321),a=t(37720),l=t(27102),s=t(38688),d=t(48230),c=t(28680),u=t(99951);function h(e){let{data:n,rules:t,remained:h=1e5,sx:p={},size:x}=e,m=(0,u.useTranslations)("custom.inputRules"),v=(0,l.Z)(),g=h<0?0:h;return(0,i.jsxs)(o.Z,{py:v.spacing(1),px:v.spacing(1.5),sx:{zIndex:v.zIndex.modal+1,position:"absolute",width:"100%",bottom:"small"===x?"28px":"36px",backgroundColor:v.palette.grey[900],color:v.palette.primary.contrastText,borderRadius:"6px 6px 0 0",...p},gap:.5,children:[!(0,c.Z)(t)&&t.map(e=>(0,i.jsxs)(o.Z,{direction:"row",sx:{opacity:e.reg.test(n)?1:.75},children:[e.reg.test(n)?(0,i.jsx)(r.Z,{component:s.Z,color:"inherit",sx:{fontSize:"14px",mr:1}}):(0,i.jsx)(r.Z,{component:d.Z,color:"inherit",sx:{fontSize:"14px",mr:1}}),(0,i.jsx)(a.Z,{component:"div",variant:"caption",children:e.ruleText})]},e.ruleText)),g>=0&&g<=10?(0,i.jsx)(a.Z,{component:"div",variant:"caption",children:m("remainInput",{remainedFmt:g})}):null]})}},69209:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var i=t(63137),o=t(50960),r=t(37720),a=t(37524);t(77595);let l={404:"/pics/404.svg","no-data":"/pics/no-data.svg","no-query":"/pics/no-query.svg","invalid-link":"/pics/invalid-link.svg",terminate:"/pics/share-terminate.svg"};function s(e){let{title:n,subTitle:t,footer:s,type:d,sx:c}=e;return(0,i.jsxs)(o.Z,{sx:{height:"100%",pt:9,...c},direction:"column",alignItems:"center",spacing:2,className:"translate-content",children:[(0,i.jsx)(a.default,{alt:"icon",src:l[d],width:120,height:120}),(0,i.jsxs)(o.Z,{direction:"column",justifyContent:"center",alignItems:"center",children:[(0,i.jsx)(r.Z,{variant:"regular-500",children:n}),(0,i.jsx)(r.Z,{variant:"sm-400",color:"text.secondary",textAlign:"center",children:t})]}),s]})}},87119:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var i,o,r=t(63137),a=t(27102),l=t(15572);(i=o||(o={})).small="small",i.medium="medium",i.large="large";let s={small:{px:1.5,py:1},medium:{px:2,py:1.5},large:{p:2}};function d(e){let{size:n="medium",color:t="white",disabled:i,selected:o,children:d,containerProps:c}=e,u=(0,a.Z)();return(0,r.jsx)(l.Z,{...c,sx:{borderRadius:2,border:"1px solid ".concat(u.palette.divider),cursor:"pointer",overflow:"hidden",backgroundColor:"white"===t?u.palette.background.paper:u.palette.background.grey,...s[n],"&:hover":{boxShadow:u.shadows[2]},...o&&{borderColor:u.palette.primary.main,boxShadow:u.shadows[2]},...i&&{"&:hover":{boxShadow:"none"},cursor:"default"},...null==c?void 0:c.sx},children:d})}},22962:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var i=t(79114),o=t(11140),r=t(28680),a=t(31314),l=t(18337);function s(){let e=(0,o.Dv)(a.L),n=(0,o.Dv)(l.NH);return{sendGTMEvent:t=>{var o;(0,r.Z)(t)||(0,i.sendGTMEvent)({UserId:null==e?void 0:e.id,ProductPlan:null==n?void 0:null===(o=n.subscriptionProduct)||void 0===o?void 0:o.code,...t})}}}},59359:function(e,n,t){"use strict";t.d(n,{v:function(){return i.C}});var i=t(60433)},91935:function(e,n,t){"use strict";t.d(n,{$:function(){return o.Z},V:function(){return i.Z}});var i=t(10969),o=t(1764)},8426:function(e,n,t){"use strict";t.d(n,{l:function(){return i.Z}});var i=t(37930)},69496:function(e,n,t){"use strict";t.d(n,{AK:function(){return l},JR:function(){return s},JW:function(){return p},Y:function(){return d},b7:function(){return u},dG:function(){return h},fG:function(){return c},j2:function(){return a}});var i=t(47141),o=t(95686);let r=e=>{try{return{...e,layouts:JSON.parse(e.layouts)}}catch(n){return{...e,layouts:[]}}},a=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=await o.Z.get("/dashboard",{params:e}),{records:t=[]}=n.data,i=t.map(e=>r(e));return Promise.resolve({...n.data,records:i})},l=async e=>{let n=await o.Z.get("/dashboard/".concat(e));return Promise.resolve({...n,data:r(n.data)})},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o.Z.post("/dashboard",e)},d=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.Z.patch("/dashboard/".concat(e),n)},c=e=>o.Z.delete("/dashboard/".concat(e)),u=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.Z.post("/dashboard/".concat(e,"/chart"),n)},h=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.Z.delete("/dashboard/".concat(e,"/chart"),{data:n})},p=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=await o.Z.get("/dashboard/".concat(e,"/chart"),{params:n}),{records:r=[]}=t.data,a=r.map(e=>(0,i.RS)(e));return Promise.resolve({...t.data,records:a})}},87709:function(e,n,t){"use strict";t.d(n,{$s:function(){return x},EO:function(){return E},EZ:function(){return w},Eq:function(){return h},Fg:function(){return R},HL:function(){return C},HU:function(){return _},KW:function(){return P},LB:function(){return f},OD:function(){return O},QW:function(){return A},Vj:function(){return v},W9:function(){return b},ZS:function(){return L},au:function(){return y},ck:function(){return g},d5:function(){return D},dP:function(){return I},h:function(){return S},iz:function(){return T},k9:function(){return u},oK:function(){return z},uq:function(){return k},xG:function(){return M}});var i,o,r,a,l,s,d,c,u,h,p,x,m,v,g,f,Z=t(95686);(i=u||(u={})).FREE="FREE",i.BASIC="BASIC",i.PLUS="PLUS",i.PRO="PRO";let j={FREE:0,BASIC:1,PLUS:2,PRO:3};function b(e,n){return j[e]-j[n]}(o=h||(h={})).DATASET_SIZE="DATA_SET_TOTAL_SIZE",o.APP_NUM="USER_APP_NUM",o.MESSAGE_CREDITS="MESSAGE_CREDIT",o.SHARE_LINKS="CHAT_SHARE_NUM",o.AA_MESSAGE_CREDIT="AA_MESSAGE_CREDIT",o.VISION_TRIAL_CREDIT="VISION_TRIAL_CREDIT",o.MULTI_MEDIA_TRIAL_CREDIT="MULTI_MEDIA_TRIAL_CREDIT",o.MULTI_MEDIA_CREDIT="MULTI_MEDIA_CREDIT",o.VISION_CREDIT="VISION_CREDIT",o.DATABASE_DATASOURCE_NUM="DATABASE_DATASOURCE_NUM",o.SQL_AA_CHAT_TIMES="SQL_AA_CHAT_TIMES",o.TRIAL_SQL_AA_CHAT_TIMES="TRIAL_SQL_AA_CHAT_TIMES",o.REPORT_PPT_GENERATE_TIMES="REPORT_PPT_GENERATE_TIMES",o.REPORT_DATA_FACT_GENERATE_TIMES="REPORT_DATA_FACT_GENERATE_TIMES",(r=p||(p={})).PROCESSING="PROCESSING",r.ACTIVE="ACTIVE",r.INCOMPLETE="INCOMPLETE",(a=x||(x={})).STRIPE="STRIPE",a.PAYPAL="PAYPAL",(l=m||(m={})).CREATE="subscription_create",l.UPGRADE="subscription_upgrade",(s=v||(v={})).SUBSCRIPTION="SUBSCRIPTION",s.PAYMENT="PAYMENT",(d=g||(g={})).RECURRING="RECURRING",d.ONE_OFF="ONE_OFF",(c=f||(f={})).INCOMPLETE="incomplete",c.INCOMPLETE_CHECKOUT="incomplete_checkout",c.INCOMPLETE_EXPIRED="incomplete_expired",c.ACTIVE="active",c.CANCELED="canceled",c.PAST_DUE="past_due";let w=()=>Z.Z.get("/products"),C=()=>Z.Z.get("/user/me/subscription/list-upgrade-able"),S=e=>Z.Z.post("/v2/subscription",e),I=e=>Z.Z.post("/user/me/subscription/upgrade",e),T=()=>Z.Z.delete("/user/me/subscription"),E=e=>Z.Z.post("/v2/subscription/".concat(e,"/discard_operation")),y=()=>Z.Z.get("/user/me/subscription/unfinished\n"),P=e=>Z.Z.get("/v2/subscription/channels",{params:{category:e}}),A=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Z.Z.post("/v2/subscription/".concat(e,"/checkout_operation\n"),n)},_=e=>Z.Z.get("/v2/subscription/".concat(e)),k=()=>Z.Z.get("/user/me/subscription/prev"),D=e=>{var n;let{invoiceId:t}=e;return Z.Z.get("/billing/invoice/".concat(t),{params:{returnUrl:null===(n=window)||void 0===n?void 0:n.location.href}})},R=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Z.Z.get("/user/me/invoice_list",{params:{pageNumber:1,pageSize:500,...e}})},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Z.Z.post("/user/me/subscription_version/search",{pageNumber:1,pageSize:500,...e})},M=()=>Z.Z.post("/user/me/subscription/renewal\n"),z=()=>Z.Z.get("/user/me/subscription"),L=()=>Z.Z.post("/user/me/quota_items/search",{codeList:[]})}},function(e){e.O(0,[8962,6363,37,7894,1744],function(){return e(e.s=13184)}),_N_E=e.O()}]);
//# sourceMappingURL=page-7a52e1bb074f3756.js.map