"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[9918],{40104:(t,e,i)=>{i.d(e,{Kg:()=>u,J8:()=>h,Pz:()=>$,tg:()=>p,pY:()=>m,px:()=>g});var n=i(96627),o=i(58863),a=i(95579),r=i(88488);const l=t=>null!=t&&"function"==typeof t[Symbol.iterator];var c=i(49588),s=i(38708);const d=()=>{var t,e;const i=(0,s.A)();return(null==i||null==(t=i.common)||null==(e=t.conf)?void 0:e.NATIVE_FILTER_DEFAULT_ROW_LIMIT)||1e3},p=({datasetId:t,dependencies:e={},groupby:i,defaultDataMask:n,controlValues:o,filterType:a,sortMetric:l,adhoc_filters:c,time_range:s,granularity_sqla:p,type:m,dashboardId:h,id:g})=>{var u;const $={};return t&&($.datasource=`${t}__table`),i&&($.groupby=[i]),l&&($.sortMetric=l),{...o,...$,adhoc_filters:null!=c?c:[],extra_filters:[],extra_form_data:e,granularity_sqla:p,metrics:["count"],row_limit:d(),showSearch:!0,defaultValue:null==n||null==(u=n.filterState)?void 0:u.value,time_range:s,url_params:(0,r.A)("regular"),inView:!0,viz_type:a,type:m,dashboardId:h,native_filter_id:g}};function m(t={},e={}){const i={};return n.t1.forEach((n=>{const o=t[n],a=e[n],r=[...l(o)?o:[],...l(a)?a:[]];r.length&&(i[n]=r)})),n.zk.forEach((n=>{const o=t[n];void 0!==o&&(i[n]=o);const a=e[n];void 0!==a&&(i[n]=a)})),i}function h(t,e){let i={};return e.forEach((e=>{var n,o;i=m(i,null!=(n=null==(o=t[e])?void 0:o.extraFormData)?n:{})})),i}function g(t){return!t.includes(o.nS.NativeFilter)||t.includes(o.nS.InteractiveChart)}const u=(t,e)=>new Set(e.map((e=>{var i,n;return null==(i=t.find((t=>{var i;return(null==t||null==(i=t.meta)?void 0:i.chartId)===e})))||null==(n=i.parents)?void 0:n.filter((t=>t.startsWith(`${c.B8}-`)))})).filter((t=>void 0!==t)).flat()),$=t=>null==t?"":"string"==typeof t||"number"==typeof t?`${t}`:Array.isArray(t)?t.join(", "):"object"==typeof t?JSON.stringify(t):(0,a.t)("Unknown value")},64829:(t,e,i)=>{i.d(e,{$:()=>h});var n=i(19129),o=i(96453),a=i(95579),r=i(2445);const l=o.I4.div`
  ${({theme:t})=>`\n    .tooltip-header {\n      font-size: ${t.typography.sizes.m}px;\n      font-weight: ${t.typography.weights.bold};\n    }\n\n    .tooltip-description {\n      margin-top: ${2*t.gridUnit}px;\n      display: -webkit-box;\n      -webkit-line-clamp: 20;\n      -webkit-box-orient: vertical;\n      overflow: hidden;\n      text-overflow: ellipsis;\n    }\n  `}
`,c=o.I4.div`
  ${({theme:t})=>`\n    left: ${3*t.gridUnit}px;\n    right: ${3*t.gridUnit}px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    display: block;\n  `}
`,s=o.I4.span`
  ${({theme:t})=>`\n    left: ${3*t.gridUnit}px;\n    right: ${3*t.gridUnit}px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    display: block;\n  `}
`,d=o.I4.div`
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  width: 100%;
`,p=o.I4.span`
  ${({theme:{typography:{sizes:t,weights:e}}})=>`\n    overflow: hidden;\n    text-overflow: ellipsis;\n    font-size: ${t.s}px;\n    font-weight: ${e.light};\n    line-height: 1.6;\n  `}
`,m=t=>!["null","none"].includes(t.toLowerCase())&&""!==t.trim(),h=t=>(0,r.Y)(n.m,{mouseEnterDelay:.2,placement:"right",title:(0,r.FD)(l,{children:[(0,r.Y)("div",{className:"tooltip-header",children:t.table_name&&m(t.table_name)?t.table_name:(0,a.t)("Not defined")}),(0,r.FD)("div",{className:"tooltip-description",children:[(0,r.FD)("div",{children:[(0,a.t)("Database"),": ",t.database.database_name]}),(0,r.FD)("div",{children:[(0,a.t)("Schema"),":"," ",t.schema&&m(t.schema)?t.schema:(0,a.t)("Not defined")]})]})]}),children:(0,r.FD)(c,{children:[(0,r.Y)(s,{children:t.table_name&&m(t.table_name)?t.table_name:t.database.database_name}),(0,r.FD)(d,{children:[(0,r.Y)(p,{children:t.database.database_name}),t.schema&&m(t.schema)&&(0,r.FD)(p,{children:[" - ",t.schema]})]})]})})},45530:(t,e,i)=>{i.r(e),i.d(e,{ChartCreation:()=>$t,default:()=>bt});var n=i(96540),o=i(58561),a=i.n(o),r=i(86663),l=i(96453),c=i(95579),s=i(13270),d=i(35742),p=i(32132),m=i(27023),h=i(71519),g=i(61574),u=i(46920),$=i(15595),b=i(77906),f=i(55886),v=i(46942),S=i.n(v),y=i(58168),x=i(89379),z=i(64467),C=i(80045),w=i(16928),I=["className","prefixCls","style","active","status","iconPrefix","icon","wrapperStyle","stepNumber","disabled","description","title","subTitle","progressDot","stepIcon","tailContent","icons","stepIndex","onStepClick","onClick","render"];function A(t){return"string"==typeof t}const T=function(t){var e,i=t.className,o=t.prefixCls,a=t.style,r=t.active,l=t.status,c=t.iconPrefix,s=t.icon,d=(t.wrapperStyle,t.stepNumber),p=t.disabled,m=t.description,h=t.title,g=t.subTitle,u=t.progressDot,$=t.stepIcon,b=t.tailContent,f=t.icons,v=t.stepIndex,T=t.onStepClick,D=t.onClick,k=t.render,q=(0,C.A)(t,I),E={};T&&!p&&(E.role="button",E.tabIndex=0,E.onClick=function(t){null==D||D(t),T(v)},E.onKeyDown=function(t){var e=t.which;e!==w.A.ENTER&&e!==w.A.SPACE||T(v)});var N,_,H,O,j=l||"wait",W=S()("".concat(o,"-item"),"".concat(o,"-item-").concat(j),i,(e={},(0,z.A)(e,"".concat(o,"-item-custom"),s),(0,z.A)(e,"".concat(o,"-item-active"),r),(0,z.A)(e,"".concat(o,"-item-disabled"),!0===p),e)),M=(0,x.A)({},a),B=n.createElement("div",(0,y.A)({},q,{className:W,style:M}),n.createElement("div",(0,y.A)({onClick:D},E,{className:"".concat(o,"-item-container")}),n.createElement("div",{className:"".concat(o,"-item-tail")},b),n.createElement("div",{className:"".concat(o,"-item-icon")},(H=S()("".concat(o,"-icon"),"".concat(c,"icon"),(N={},(0,z.A)(N,"".concat(c,"icon-").concat(s),s&&A(s)),(0,z.A)(N,"".concat(c,"icon-check"),!s&&"finish"===l&&(f&&!f.finish||!f)),(0,z.A)(N,"".concat(c,"icon-cross"),!s&&"error"===l&&(f&&!f.error||!f)),N)),O=n.createElement("span",{className:"".concat(o,"-icon-dot")}),_=u?"function"==typeof u?n.createElement("span",{className:"".concat(o,"-icon")},u(O,{index:d-1,status:l,title:h,description:m})):n.createElement("span",{className:"".concat(o,"-icon")},O):s&&!A(s)?n.createElement("span",{className:"".concat(o,"-icon")},s):f&&f.finish&&"finish"===l?n.createElement("span",{className:"".concat(o,"-icon")},f.finish):f&&f.error&&"error"===l?n.createElement("span",{className:"".concat(o,"-icon")},f.error):s||"finish"===l||"error"===l?n.createElement("span",{className:H}):n.createElement("span",{className:"".concat(o,"-icon")},d),$&&(_=$({index:d-1,status:l,title:h,description:m,node:_})),_)),n.createElement("div",{className:"".concat(o,"-item-content")},n.createElement("div",{className:"".concat(o,"-item-title")},h,g&&n.createElement("div",{title:"string"==typeof g?g:void 0,className:"".concat(o,"-item-subtitle")},g)),m&&n.createElement("div",{className:"".concat(o,"-item-description")},m))));return k&&(B=k(B)||null),B};var D=["prefixCls","style","className","children","direction","type","labelPlacement","iconPrefix","status","size","current","progressDot","stepIcon","initial","icons","onChange","itemRender","items"];function k(t){var e,i=t.prefixCls,o=void 0===i?"rc-steps":i,a=t.style,r=void 0===a?{}:a,l=t.className,c=(t.children,t.direction),s=void 0===c?"horizontal":c,d=t.type,p=void 0===d?"default":d,m=t.labelPlacement,h=void 0===m?"horizontal":m,g=t.iconPrefix,u=void 0===g?"rc":g,$=t.status,b=void 0===$?"process":$,f=t.size,v=t.current,w=void 0===v?0:v,I=t.progressDot,A=void 0!==I&&I,k=t.stepIcon,q=t.initial,E=void 0===q?0:q,N=t.icons,_=t.onChange,H=t.itemRender,O=t.items,j=void 0===O?[]:O,W=(0,C.A)(t,D),M="navigation"===p,B="inline"===p,X=B||A,F=B?"horizontal":s,U=B?void 0:f,L=X?"vertical":h,P=S()(o,"".concat(o,"-").concat(F),l,(e={},(0,z.A)(e,"".concat(o,"-").concat(U),U),(0,z.A)(e,"".concat(o,"-label-").concat(L),"horizontal"===F),(0,z.A)(e,"".concat(o,"-dot"),!!X),(0,z.A)(e,"".concat(o,"-navigation"),M),(0,z.A)(e,"".concat(o,"-inline"),B),e)),Y=function(t){_&&w!==t&&_(t)};return n.createElement("div",(0,y.A)({className:P,style:r},W),j.filter((function(t){return t})).map((function(t,e){var i=(0,x.A)({},t),a=E+e;return"error"===b&&e===w-1&&(i.className="".concat(o,"-next-error")),i.status||(i.status=a===w?b:a<w?"finish":"wait"),B&&(i.icon=void 0,i.subTitle=void 0),!i.render&&H&&(i.render=function(t){return H(i,t)}),n.createElement(T,(0,y.A)({},i,{active:a===w,stepNumber:a+1,stepIndex:a,key:a,prefixCls:o,iconPrefix:u,wrapperStyle:r,progressDot:X,stepIcon:k,icons:N,onStepClick:_&&Y}))})))}k.Step=T;const q=k;var E=i(22553),N=i(13147),_=i(21496),H=i(96484),O=i(27583),j=i(77132),W=i(1051),M=i(96424),B=i(14277);const X=t=>{const{componentCls:e,customIconTop:i,customIconSize:n,customIconFontSize:o}=t;return{[`${e}-item-custom`]:{[`> ${e}-item-container > ${e}-item-icon`]:{height:"auto",background:"none",border:0,[`> ${e}-icon`]:{top:i,width:n,height:n,fontSize:o,lineHeight:(0,j.zA)(n)}}},[`&:not(${e}-vertical)`]:{[`${e}-item-custom`]:{[`${e}-item-icon`]:{width:"auto",background:"none"}}}}},F=t=>{const{componentCls:e}=t,i=`${e}-item`;return{[`${e}-horizontal`]:{[`${i}-tail`]:{transform:"translateY(-50%)"}}}},U=t=>{const{componentCls:e,inlineDotSize:i,inlineTitleColor:n,inlineTailColor:o}=t,a=t.calc(t.paddingXS).add(t.lineWidth).equal(),r={[`${e}-item-container ${e}-item-content ${e}-item-title`]:{color:n}};return{[`&${e}-inline`]:{width:"auto",display:"inline-flex",[`${e}-item`]:{flex:"none","&-container":{padding:`${(0,j.zA)(a)} ${(0,j.zA)(t.paddingXXS)} 0`,margin:`0 ${(0,j.zA)(t.calc(t.marginXXS).div(2).equal())}`,borderRadius:t.borderRadiusSM,cursor:"pointer",transition:`background-color ${t.motionDurationMid}`,"&:hover":{background:t.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:i,height:i,marginInlineStart:`calc(50% - ${(0,j.zA)(t.calc(i).div(2).equal())})`,[`> ${e}-icon`]:{top:0},[`${e}-icon-dot`]:{borderRadius:t.calc(t.fontSizeSM).div(4).equal(),"&::after":{display:"none"}}},"&-content":{width:"auto",marginTop:t.calc(t.marginXS).sub(t.lineWidth).equal()},"&-title":{color:n,fontSize:t.fontSizeSM,lineHeight:t.lineHeightSM,fontWeight:"normal",marginBottom:t.calc(t.marginXXS).div(2).equal()},"&-description":{display:"none"},"&-tail":{marginInlineStart:0,top:t.calc(i).div(2).add(a).equal(),transform:"translateY(-50%)","&:after":{width:"100%",height:t.lineWidth,borderRadius:0,marginInlineStart:0,background:o}},[`&:first-child ${e}-item-tail`]:{width:"50%",marginInlineStart:"50%"},[`&:last-child ${e}-item-tail`]:{display:"block",width:"50%"},"&-wait":Object.assign({[`${e}-item-icon ${e}-icon ${e}-icon-dot`]:{backgroundColor:t.colorBorderBg,border:`${(0,j.zA)(t.lineWidth)} ${t.lineType} ${o}`}},r),"&-finish":Object.assign({[`${e}-item-tail::after`]:{backgroundColor:o},[`${e}-item-icon ${e}-icon ${e}-icon-dot`]:{backgroundColor:o,border:`${(0,j.zA)(t.lineWidth)} ${t.lineType} ${o}`}},r),"&-error":r,"&-active, &-process":Object.assign({[`${e}-item-icon`]:{width:i,height:i,marginInlineStart:`calc(50% - ${(0,j.zA)(t.calc(i).div(2).equal())})`,top:0}},r),[`&:not(${e}-item-active) > ${e}-item-container[role='button']:hover`]:{[`${e}-item-title`]:{color:n}}}}}},L=t=>{const{componentCls:e,iconSize:i,lineHeight:n,iconSizeSM:o}=t;return{[`&${e}-label-vertical`]:{[`${e}-item`]:{overflow:"visible","&-tail":{marginInlineStart:t.calc(i).div(2).add(t.controlHeightLG).equal(),padding:`0 ${(0,j.zA)(t.paddingLG)}`},"&-content":{display:"block",width:t.calc(i).div(2).add(t.controlHeightLG).mul(2).equal(),marginTop:t.marginSM,textAlign:"center"},"&-icon":{display:"inline-block",marginInlineStart:t.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:"none"}},"&-subtitle":{display:"block",marginBottom:t.marginXXS,marginInlineStart:0,lineHeight:n}},[`&${e}-small:not(${e}-dot)`]:{[`${e}-item`]:{"&-icon":{marginInlineStart:t.calc(i).sub(o).div(2).add(t.controlHeightLG).equal()}}}}}},P=t=>{const{componentCls:e,navContentMaxWidth:i,navArrowColor:n,stepsNavActiveColor:o,motionDurationSlow:a}=t;return{[`&${e}-navigation`]:{paddingTop:t.paddingSM,[`&${e}-small`]:{[`${e}-item`]:{"&-container":{marginInlineStart:t.calc(t.marginSM).mul(-1).equal()}}},[`${e}-item`]:{overflow:"visible",textAlign:"center","&-container":{display:"inline-block",height:"100%",marginInlineStart:t.calc(t.margin).mul(-1).equal(),paddingBottom:t.paddingSM,textAlign:"start",transition:`opacity ${a}`,[`${e}-item-content`]:{maxWidth:i},[`${e}-item-title`]:Object.assign(Object.assign({maxWidth:"100%",paddingInlineEnd:0},W.L9),{"&::after":{display:"none"}})},[`&:not(${e}-item-active)`]:{[`${e}-item-container[role='button']`]:{cursor:"pointer","&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:"none"}},"&::after":{position:"absolute",top:`calc(50% - ${(0,j.zA)(t.calc(t.paddingSM).div(2).equal())})`,insetInlineStart:"100%",display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,borderTop:`${(0,j.zA)(t.lineWidth)} ${t.lineType} ${n}`,borderBottom:"none",borderInlineStart:"none",borderInlineEnd:`${(0,j.zA)(t.lineWidth)} ${t.lineType} ${n}`,transform:"translateY(-50%) translateX(-50%) rotate(45deg)",content:'""'},"&::before":{position:"absolute",bottom:0,insetInlineStart:"50%",display:"inline-block",width:0,height:t.lineWidthBold,backgroundColor:o,transition:`width ${a}, inset-inline-start ${a}`,transitionTimingFunction:"ease-out",content:'""'}},[`${e}-item${e}-item-active::before`]:{insetInlineStart:0,width:"100%"}},[`&${e}-navigation${e}-vertical`]:{[`> ${e}-item`]:{marginInlineEnd:0,"&::before":{display:"none"},[`&${e}-item-active::before`]:{top:0,insetInlineEnd:0,insetInlineStart:"unset",display:"block",width:t.calc(t.lineWidth).mul(3).equal(),height:`calc(100% - ${(0,j.zA)(t.marginLG)})`},"&::after":{position:"relative",insetInlineStart:"50%",display:"block",width:t.calc(t.controlHeight).mul(.25).equal(),height:t.calc(t.controlHeight).mul(.25).equal(),marginBottom:t.marginXS,textAlign:"center",transform:"translateY(-50%) translateX(-50%) rotate(135deg)"},"&:last-child":{"&::after":{display:"none"}},[`> ${e}-item-container > ${e}-item-tail`]:{visibility:"hidden"}}},[`&${e}-navigation${e}-horizontal`]:{[`> ${e}-item > ${e}-item-container > ${e}-item-tail`]:{visibility:"hidden"}}}},Y=t=>{const{antCls:e,componentCls:i,iconSize:n,iconSizeSM:o,processIconColor:a,marginXXS:r,lineWidthBold:l,lineWidth:c,paddingXXS:s}=t,d=t.calc(n).add(t.calc(l).mul(4).equal()).equal(),p=t.calc(o).add(t.calc(t.lineWidth).mul(4).equal()).equal();return{[`&${i}-with-progress`]:{[`${i}-item`]:{paddingTop:s,[`&-process ${i}-item-container ${i}-item-icon ${i}-icon`]:{color:a}},[`&${i}-vertical > ${i}-item `]:{paddingInlineStart:s,[`> ${i}-item-container > ${i}-item-tail`]:{top:r,insetInlineStart:t.calc(n).div(2).sub(c).add(s).equal()}},[`&, &${i}-small`]:{[`&${i}-horizontal ${i}-item:first-child`]:{paddingBottom:s,paddingInlineStart:s}},[`&${i}-small${i}-vertical > ${i}-item > ${i}-item-container > ${i}-item-tail`]:{insetInlineStart:t.calc(o).div(2).sub(c).add(s).equal()},[`&${i}-label-vertical ${i}-item ${i}-item-tail`]:{top:t.calc(n).div(2).add(s).equal()},[`${i}-item-icon`]:{position:"relative",[`${e}-progress`]:{position:"absolute",insetInlineStart:"50%",top:"50%",transform:"translate(-50%, -50%)","&-inner":{width:`${(0,j.zA)(d)} !important`,height:`${(0,j.zA)(d)} !important`}}},[`&${i}-small`]:{[`&${i}-label-vertical ${i}-item ${i}-item-tail`]:{top:t.calc(o).div(2).add(s).equal()},[`${i}-item-icon ${e}-progress-inner`]:{width:`${(0,j.zA)(p)} !important`,height:`${(0,j.zA)(p)} !important`}}}}},R=t=>{const{componentCls:e,descriptionMaxWidth:i,lineHeight:n,dotCurrentSize:o,dotSize:a,motionDurationSlow:r}=t;return{[`&${e}-dot, &${e}-dot${e}-small`]:{[`${e}-item`]:{"&-title":{lineHeight:n},"&-tail":{top:t.calc(t.dotSize).sub(t.calc(t.lineWidth).mul(3).equal()).div(2).equal(),width:"100%",marginTop:0,marginBottom:0,marginInline:`${(0,j.zA)(t.calc(i).div(2).equal())} 0`,padding:0,"&::after":{width:`calc(100% - ${(0,j.zA)(t.calc(t.marginSM).mul(2).equal())})`,height:t.calc(t.lineWidth).mul(3).equal(),marginInlineStart:t.marginSM}},"&-icon":{width:a,height:a,marginInlineStart:t.calc(t.descriptionMaxWidth).sub(a).div(2).equal(),paddingInlineEnd:0,lineHeight:(0,j.zA)(a),background:"transparent",border:0,[`${e}-icon-dot`]:{position:"relative",float:"left",width:"100%",height:"100%",borderRadius:100,transition:`all ${r}`,"&::after":{position:"absolute",top:t.calc(t.marginSM).mul(-1).equal(),insetInlineStart:t.calc(a).sub(t.calc(t.controlHeightLG).mul(1.5).equal()).div(2).equal(),width:t.calc(t.controlHeightLG).mul(1.5).equal(),height:t.controlHeight,background:"transparent",content:'""'}}},"&-content":{width:i},[`&-process ${e}-item-icon`]:{position:"relative",top:t.calc(a).sub(o).div(2).equal(),width:o,height:o,lineHeight:(0,j.zA)(o),background:"none",marginInlineStart:t.calc(t.descriptionMaxWidth).sub(o).div(2).equal()},[`&-process ${e}-icon`]:{[`&:first-child ${e}-icon-dot`]:{insetInlineStart:0}}}},[`&${e}-vertical${e}-dot`]:{[`${e}-item-icon`]:{marginTop:t.calc(t.controlHeight).sub(a).div(2).equal(),marginInlineStart:0,background:"none"},[`${e}-item-process ${e}-item-icon`]:{marginTop:t.calc(t.controlHeight).sub(o).div(2).equal(),top:0,insetInlineStart:t.calc(a).sub(o).div(2).equal(),marginInlineStart:0},[`${e}-item > ${e}-item-container > ${e}-item-tail`]:{top:t.calc(t.controlHeight).sub(a).div(2).equal(),insetInlineStart:0,margin:0,padding:`${(0,j.zA)(t.calc(a).add(t.paddingXS).equal())} 0 ${(0,j.zA)(t.paddingXS)}`,"&::after":{marginInlineStart:t.calc(a).sub(t.lineWidth).div(2).equal()}},[`&${e}-small`]:{[`${e}-item-icon`]:{marginTop:t.calc(t.controlHeightSM).sub(a).div(2).equal()},[`${e}-item-process ${e}-item-icon`]:{marginTop:t.calc(t.controlHeightSM).sub(o).div(2).equal()},[`${e}-item > ${e}-item-container > ${e}-item-tail`]:{top:t.calc(t.controlHeightSM).sub(a).div(2).equal()}},[`${e}-item:first-child ${e}-icon-dot`]:{insetInlineStart:0},[`${e}-item-content`]:{width:"inherit"}}}},V=t=>{const{componentCls:e}=t;return{[`&${e}-rtl`]:{direction:"rtl",[`${e}-item`]:{"&-subtitle":{float:"left"}},[`&${e}-navigation`]:{[`${e}-item::after`]:{transform:"rotate(-45deg)"}},[`&${e}-vertical`]:{[`> ${e}-item`]:{"&::after":{transform:"rotate(225deg)"},[`${e}-item-icon`]:{float:"right"}}},[`&${e}-dot`]:{[`${e}-item-icon ${e}-icon-dot, &${e}-small ${e}-item-icon ${e}-icon-dot`]:{float:"right"}}}}},G=t=>{const{componentCls:e,iconSizeSM:i,fontSizeSM:n,fontSize:o,colorTextDescription:a}=t;return{[`&${e}-small`]:{[`&${e}-horizontal:not(${e}-label-vertical) ${e}-item`]:{paddingInlineStart:t.paddingSM,"&:first-child":{paddingInlineStart:0}},[`${e}-item-icon`]:{width:i,height:i,marginTop:0,marginBottom:0,marginInline:`0 ${(0,j.zA)(t.marginXS)}`,fontSize:n,lineHeight:(0,j.zA)(i),textAlign:"center",borderRadius:i},[`${e}-item-title`]:{paddingInlineEnd:t.paddingSM,fontSize:o,lineHeight:(0,j.zA)(i),"&::after":{top:t.calc(i).div(2).equal()}},[`${e}-item-description`]:{color:a,fontSize:o},[`${e}-item-tail`]:{top:t.calc(i).div(2).sub(t.paddingXXS).equal()},[`${e}-item-custom ${e}-item-icon`]:{width:"inherit",height:"inherit",lineHeight:"inherit",background:"none",border:0,borderRadius:0,[`> ${e}-icon`]:{fontSize:i,lineHeight:(0,j.zA)(i),transform:"none"}}}}},J=t=>{const{componentCls:e,iconSizeSM:i,iconSize:n}=t;return{[`&${e}-vertical`]:{display:"flex",flexDirection:"column",[`> ${e}-item`]:{display:"block",flex:"1 0 auto",paddingInlineStart:0,overflow:"visible",[`${e}-item-icon`]:{float:"left",marginInlineEnd:t.margin},[`${e}-item-content`]:{display:"block",minHeight:t.calc(t.controlHeight).mul(1.5).equal(),overflow:"hidden"},[`${e}-item-title`]:{lineHeight:(0,j.zA)(n)},[`${e}-item-description`]:{paddingBottom:t.paddingSM}},[`> ${e}-item > ${e}-item-container > ${e}-item-tail`]:{position:"absolute",top:0,insetInlineStart:t.calc(n).div(2).sub(t.lineWidth).equal(),width:t.lineWidth,height:"100%",padding:`${(0,j.zA)(t.calc(t.marginXXS).mul(1.5).add(n).equal())} 0 ${(0,j.zA)(t.calc(t.marginXXS).mul(1.5).equal())}`,"&::after":{width:t.lineWidth,height:"100%"}},[`> ${e}-item:not(:last-child) > ${e}-item-container > ${e}-item-tail`]:{display:"block"},[` > ${e}-item > ${e}-item-container > ${e}-item-content > ${e}-item-title`]:{"&::after":{display:"none"}},[`&${e}-small ${e}-item-container`]:{[`${e}-item-tail`]:{position:"absolute",top:0,insetInlineStart:t.calc(i).div(2).sub(t.lineWidth).equal(),padding:`${(0,j.zA)(t.calc(t.marginXXS).mul(1.5).add(i).equal())} 0 ${(0,j.zA)(t.calc(t.marginXXS).mul(1.5).equal())}`},[`${e}-item-title`]:{lineHeight:(0,j.zA)(i)}}}}},K=(t,e)=>{const i=`${e.componentCls}-item`,n=`${t}IconColor`,o=`${t}TitleColor`,a=`${t}DescriptionColor`,r=`${t}TailColor`,l=`${t}IconBgColor`,c=`${t}IconBorderColor`,s=`${t}DotColor`;return{[`${i}-${t} ${i}-icon`]:{backgroundColor:e[l],borderColor:e[c],[`> ${e.componentCls}-icon`]:{color:e[n],[`${e.componentCls}-icon-dot`]:{background:e[s]}}},[`${i}-${t}${i}-custom ${i}-icon`]:{[`> ${e.componentCls}-icon`]:{color:e[s]}},[`${i}-${t} > ${i}-container > ${i}-content > ${i}-title`]:{color:e[o],"&::after":{backgroundColor:e[r]}},[`${i}-${t} > ${i}-container > ${i}-content > ${i}-description`]:{color:e[a]},[`${i}-${t} > ${i}-container > ${i}-tail::after`]:{backgroundColor:e[r]}}},Q=t=>{const{componentCls:e,motionDurationSlow:i}=t,n=`${e}-item`,o=`${n}-icon`;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:{position:"relative",display:"inline-block",flex:1,overflow:"hidden",verticalAlign:"top","&:last-child":{flex:"none",[`> ${n}-container > ${n}-tail, > ${n}-container >  ${n}-content > ${n}-title::after`]:{display:"none"}}},[`${n}-container`]:{outline:"none","&:focus-visible":{[o]:Object.assign({},(0,W.jk)(t))}},[`${o}, ${n}-content`]:{display:"inline-block",verticalAlign:"top"},[o]:{width:t.iconSize,height:t.iconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:t.marginXS,fontSize:t.iconFontSize,fontFamily:t.fontFamily,lineHeight:(0,j.zA)(t.iconSize),textAlign:"center",borderRadius:t.iconSize,border:`${(0,j.zA)(t.lineWidth)} ${t.lineType} transparent`,transition:`background-color ${i}, border-color ${i}`,[`${e}-icon`]:{position:"relative",top:t.iconTop,color:t.colorPrimary,lineHeight:1}},[`${n}-tail`]:{position:"absolute",top:t.calc(t.iconSize).div(2).equal(),insetInlineStart:0,width:"100%","&::after":{display:"inline-block",width:"100%",height:t.lineWidth,background:t.colorSplit,borderRadius:t.lineWidth,transition:`background ${i}`,content:'""'}},[`${n}-title`]:{position:"relative",display:"inline-block",paddingInlineEnd:t.padding,color:t.colorText,fontSize:t.fontSizeLG,lineHeight:(0,j.zA)(t.titleLineHeight),"&::after":{position:"absolute",top:t.calc(t.titleLineHeight).div(2).equal(),insetInlineStart:"100%",display:"block",width:9999,height:t.lineWidth,background:t.processTailColor,content:'""'}},[`${n}-subtitle`]:{display:"inline",marginInlineStart:t.marginXS,color:t.colorTextDescription,fontWeight:"normal",fontSize:t.fontSize},[`${n}-description`]:{color:t.colorTextDescription,fontSize:t.fontSize}},K("wait",t)),K("process",t)),{[`${n}-process > ${n}-container > ${n}-title`]:{fontWeight:t.fontWeightStrong}}),K("finish",t)),K("error",t)),{[`${n}${e}-next-error > ${e}-item-title::after`]:{background:t.colorError},[`${n}-disabled`]:{cursor:"not-allowed"}})},Z=t=>{const{componentCls:e,motionDurationSlow:i}=t;return{[`& ${e}-item`]:{[`&:not(${e}-item-active)`]:{[`& > ${e}-item-container[role='button']`]:{cursor:"pointer",[`${e}-item`]:{[`&-title, &-subtitle, &-description, &-icon ${e}-icon`]:{transition:`color ${i}`}},"&:hover":{[`${e}-item`]:{"&-title, &-subtitle, &-description":{color:t.colorPrimary}}}},[`&:not(${e}-item-process)`]:{[`& > ${e}-item-container[role='button']:hover`]:{[`${e}-item`]:{"&-icon":{borderColor:t.colorPrimary,[`${e}-icon`]:{color:t.colorPrimary}}}}}}},[`&${e}-horizontal:not(${e}-label-vertical)`]:{[`${e}-item`]:{paddingInlineStart:t.padding,whiteSpace:"nowrap","&:first-child":{paddingInlineStart:0},[`&:last-child ${e}-item-title`]:{paddingInlineEnd:0},"&-tail":{display:"none"},"&-description":{maxWidth:t.descriptionMaxWidth,whiteSpace:"normal"}}}}},tt=t=>{const{componentCls:e}=t;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,W.dF)(t)),{display:"flex",width:"100%",fontSize:0,textAlign:"initial"}),Q(t)),Z(t)),X(t)),G(t)),J(t)),F(t)),L(t)),R(t)),P(t)),V(t)),Y(t)),U(t))}},et=(0,M.OF)("Steps",(t=>{const{colorTextDisabled:e,controlHeightLG:i,colorTextLightSolid:n,colorText:o,colorPrimary:a,colorTextDescription:r,colorTextQuaternary:l,colorError:c,colorBorderSecondary:s,colorSplit:d}=t,p=(0,B.oX)(t,{processIconColor:n,processTitleColor:o,processDescriptionColor:o,processIconBgColor:a,processIconBorderColor:a,processDotColor:a,processTailColor:d,waitTitleColor:r,waitDescriptionColor:r,waitTailColor:d,waitDotColor:e,finishIconColor:a,finishTitleColor:o,finishDescriptionColor:r,finishTailColor:a,finishDotColor:a,errorIconColor:n,errorTitleColor:c,errorDescriptionColor:c,errorTailColor:d,errorIconBgColor:c,errorIconBorderColor:c,errorDotColor:c,stepsNavActiveColor:a,stepsProgressSize:i,inlineDotSize:6,inlineTitleColor:l,inlineTailColor:s});return[tt(p)]}),(t=>({titleLineHeight:t.controlHeight,customIconSize:t.controlHeight,customIconTop:0,customIconFontSize:t.controlHeightSM,iconSize:t.controlHeight,iconTop:-.5,iconFontSize:t.fontSize,iconSizeSM:t.fontSizeHeading3,dotSize:t.controlHeight/4,dotCurrentSize:t.controlHeightLG/4,navArrowColor:t.colorTextDisabled,navContentMaxWidth:"auto",descriptionMaxWidth:140,waitIconColor:t.wireframe?t.colorTextDisabled:t.colorTextLabel,waitIconBgColor:t.wireframe?t.colorBgContainer:t.colorFillContent,waitIconBorderColor:t.wireframe?t.colorTextDisabled:"transparent",finishIconBgColor:t.wireframe?t.colorBgContainer:t.controlItemBgActive,finishIconBorderColor:t.wireframe?t.colorPrimary:t.controlItemBgActive})));var it=i(82546);const nt=t=>{const{percent:e,size:i,className:o,rootClassName:a,direction:r,items:l,responsive:c=!0,current:s=0,children:d,style:p}=t,m=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i}(t,["percent","size","className","rootClassName","direction","items","responsive","current","children","style"]),{xs:h}=(0,_.A)(c),{getPrefixCls:g,direction:u,steps:$}=n.useContext(E.QO),v=n.useMemo((()=>c&&h?"vertical":r),[h,r]),y=(0,N.A)(i),x=g("steps",t.prefixCls),[z,C,w]=et(x),I="inline"===t.type,A=g("",t.iconPrefix),T=function(t,e){return t||function(t){return t.filter((t=>t))}((0,it.A)(e).map((t=>{if(n.isValidElement(t)){const{props:e}=t;return Object.assign({},e)}return null})))}(l,d),D=I?void 0:e,k=Object.assign(Object.assign({},null==$?void 0:$.style),p),j=S()(null==$?void 0:$.className,{[`${x}-rtl`]:"rtl"===u,[`${x}-with-progress`]:void 0!==D},o,a,C,w),W={finish:n.createElement(b.A,{className:`${x}-finish-icon`}),error:n.createElement(f.A,{className:`${x}-error-icon`})};return z(n.createElement(q,Object.assign({icons:W},m,{style:k,current:s,size:y,items:T,itemRender:I?(t,e)=>t.description?n.createElement(O.A,{title:t.description},e):e:void 0,stepIcon:t=>{let{node:e,status:i}=t;if("process"===i&&void 0!==D){const t="small"===y?32:40;return n.createElement("div",{className:`${x}-progress-icon`},n.createElement(H.A,{type:"circle",percent:D,size:t,strokeWidth:4,format:()=>null}),e)}return e},direction:v,prefixCls:x,iconPrefix:A,className:j})))};nt.Step=q.Step;const ot=nt,at=Object.assign(ot,{Step:ot.Step});var rt=i(5261),lt=i(32416),ct=i(84666),st=i(38708),dt=i(64829),pt=i(2445);const mt=((0,st.A)().common.conf.VIZ_TYPE_DENYLIST||[]).concat(Object.values(m.fJ)),ht=l.I4.div`
  ${({theme:t})=>`\n    flex: 1 1 auto;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n    width: 100%;\n    max-width: ${lt.rE}px;\n    max-height: calc(100vh - 56px);\n    border-radius: ${t.gridUnit}px;\n    background-color: ${t.colors.grayscale.light5};\n    margin-left: auto;\n    margin-right: auto;\n    padding-left: ${4*t.gridUnit}px;\n    padding-right: ${4*t.gridUnit}px;\n    padding-bottom: ${4*t.gridUnit}px;\n\n    h3 {\n      padding-bottom: ${3*t.gridUnit}px;\n    }\n\n    & .dataset {\n      display: flex;\n      flex-direction: row;\n      align-items: center;\n      margin-bottom: ${5*t.gridUnit}px;\n\n      & > div {\n        min-width: 200px;\n        width: 300px;\n      }\n\n      & > span {\n        color: ${t.colors.grayscale.light1};\n        margin-left: ${4*t.gridUnit}px;\n      }\n    }\n\n    & .viz-gallery {\n      border: 1px solid ${t.colors.grayscale.light2};\n      border-radius: ${t.gridUnit}px;\n      margin: ${t.gridUnit}px 0px;\n      max-height: calc(100vh - 306px);\n      flex: 1;\n    }\n\n    & .footer {\n      flex: 1;\n      display: flex;\n      flex-direction: row;\n      justify-content: flex-end;\n      align-items: center;\n\n      & > span {\n        color: ${t.colors.grayscale.light1};\n        margin-right: ${4*t.gridUnit}px;\n      }\n    }\n\n    /* The following extra ampersands (&&&&) are used to boost selector specificity */\n\n    &&&& .antd5-steps-item-tail {\n      display: none;\n    }\n\n    &&&& .antd5-steps-item-icon {\n      margin-right: ${2*t.gridUnit}px;\n      width: ${5*t.gridUnit}px;\n      height: ${5*t.gridUnit}px;\n      line-height: ${5*t.gridUnit}px;\n    }\n\n    &&&& .antd5-steps-item-title {\n      line-height: ${5*t.gridUnit}px;\n    }\n\n    &&&& .antd5-steps-item-content {\n      overflow: unset;\n\n      .antd5-steps-item-description {\n        margin-top: ${t.gridUnit}px;\n        padding-bottom: ${t.gridUnit}px;\n      }\n    }\n\n    &&&& .antd5-tooltip-open {\n      display: inline;\n    }\n\n    &&&& .ant-select-selector {\n      padding: 0;\n    }\n\n    &&&& .ant-select-selection-placeholder {\n      padding-left: ${3*t.gridUnit}px;\n    }\n\n    &&&& .ant-select-selection-item {\n      padding-left: ${3*t.gridUnit}px;\n    }\n  `}
`,gt=l.I4.span`
  ${({theme:{typography:{sizes:t,weights:e}}})=>`\n      font-size: ${t.m}px;\n      font-weight: ${e.bold};\n    `}
`,ut=l.I4.div`
  ${({theme:{gridUnit:t}})=>`\n    margin-top: ${4*t}px;\n    margin-bottom: ${3*t}px;\n  `}
`;class $t extends n.PureComponent{constructor(t){super(t),this.state={vizType:null,canCreateDataset:(0,ct.L)("can_write","Dataset",t.user.roles)},this.changeDatasource=this.changeDatasource.bind(this),this.changeVizType=this.changeVizType.bind(this),this.gotoSlice=this.gotoSlice.bind(this),this.loadDatasources=this.loadDatasources.bind(this),this.onVizTypeDoubleClick=this.onVizTypeDoubleClick.bind(this)}componentDidMount(){var t;const e=null==(t=r.parse(window.location.search))?void 0:t.dataset;e&&(this.loadDatasources(e,0,1).then((t=>{const e=t.data[0];e.label=e.customLabel,this.setState({datasource:e})})),this.props.addSuccessToast((0,c.t)("The dataset has been saved")))}exploreUrl(){var t;const e=(0,p.P3)(m.vX.dashboardId);let i=`/explore/?viz_type=${this.state.vizType}&datasource=${null==(t=this.state.datasource)?void 0:t.value}`;return(0,s.A)(e)&&(i+=`&dashboard_id=${e}`),i}gotoSlice(){this.props.history.push(this.exploreUrl())}changeDatasource(t){this.setState({datasource:t})}changeVizType(t){this.setState({vizType:t})}isBtnDisabled(){var t;return!(null!=(t=this.state.datasource)&&t.value&&this.state.vizType)}onVizTypeDoubleClick(){this.isBtnDisabled()||this.gotoSlice()}loadDatasources(t,e,i){const n=a().encode({columns:["id","table_name","datasource_type","database.database_name","schema"],filters:[{col:"table_name",opr:"ct",value:t}],page:e,page_size:i,order_column:"table_name",order_direction:"asc"});return d.A.get({endpoint:`/api/v1/dataset/?q=${n}`}).then((t=>({data:t.json.result.map((t=>({id:t.id,value:`${t.id}__${t.datasource_type}`,customLabel:(0,dt.$)(t),label:t.table_name}))),totalCount:t.json.count})))}render(){var t;const e=this.isBtnDisabled(),i=(0,c.t)("view instructions"),n=this.state.canCreateDataset?(0,pt.FD)("span",{children:[(0,pt.FD)(h.N_,{to:"/dataset/add/",children:[(0,c.t)("Add a dataset")," "]}),(0,c.t)("or")," ",(0,pt.FD)("a",{href:"https://superset.apache.org/docs/creating-charts-dashboards/creating-your-first-dashboard/#registering-a-new-table",rel:"noopener noreferrer",target:"_blank",children:[`${i} `,(0,pt.Y)("i",{className:"fa fa-external-link"})]}),"."]}):(0,pt.FD)("span",{children:[(0,pt.FD)("a",{href:"https://superset.apache.org/docs/creating-charts-dashboards/creating-your-first-dashboard/#registering-a-new-table",rel:"noopener noreferrer",target:"_blank",children:[`${i} `,(0,pt.Y)("i",{className:"fa fa-external-link"})]}),"."]});return(0,pt.FD)(ht,{children:[(0,pt.Y)("h3",{children:(0,c.t)("Create a new chart")}),(0,pt.FD)(at,{direction:"vertical",size:"small",children:[(0,pt.Y)(at.Step,{title:(0,pt.Y)(gt,{children:(0,c.t)("Choose a dataset")}),status:null!=(t=this.state.datasource)&&t.value?"finish":"process",description:(0,pt.FD)(ut,{className:"dataset",children:[(0,pt.Y)($.DW,{autoFocus:!0,ariaLabel:(0,c.t)("Dataset"),name:"select-datasource",onChange:this.changeDatasource,options:this.loadDatasources,optionFilterProps:["id","label"],placeholder:(0,c.t)("Choose a dataset"),showSearch:!0,value:this.state.datasource}),n]})}),(0,pt.Y)(at.Step,{title:(0,pt.Y)(gt,{children:(0,c.t)("Choose chart type")}),status:this.state.vizType?"finish":"process",description:(0,pt.Y)(ut,{children:(0,pt.Y)(lt.Ay,{denyList:mt,className:"viz-gallery",onChange:this.changeVizType,onDoubleClick:this.onVizTypeDoubleClick,selectedViz:this.state.vizType})})})]}),(0,pt.FD)("div",{className:"footer",children:[e&&(0,pt.Y)("span",{children:(0,c.t)("Please select both a Dataset and a Chart type to proceed")}),(0,pt.Y)(u.A,{buttonStyle:"primary",disabled:e,onClick:this.gotoSlice,children:(0,c.t)("Create new chart")})]})]})}}const bt=(0,g.y)((0,rt.Ay)($t))}}]);