(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[665],{45578:(e,t,a)=>{var l=a(67206),r=a(45652);e.exports=function(e,t){return e&&e.length?r(e,l(t,2)):[]}},51794:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var l=a(67294);const r=(e,t)=>{var a,r;const[n,s]=(0,l.useState)(0),[i,o]=(0,l.useState)(!1),d=(0,l.useRef)({scrollWidth:0,parentElementWidth:0,plusRefWidth:0});return(0,l.useLayoutEffect)((()=>{var a;const l=e.current,r=null==t?void 0:t.current;if(!l)return;const{scrollWidth:n,clientWidth:i,childNodes:u}=l,c=d.current,p=(null==(a=l.parentElement)?void 0:a.clientWidth)||0,h=(null==r?void 0:r.offsetWidth)||0;if(d.current={scrollWidth:n,parentElementWidth:p,plusRefWidth:h},c.parentElementWidth!==p||c.scrollWidth!==n||c.plusRefWidth!==h)if(n>i){const e=6,t=(null==r?void 0:r.offsetWidth)||0,a=i-e,l=u.length;let n=0,d=0;for(let r=0;r<l;r+=1){const l=u[r].offsetWidth;a-e-n-t<=0&&(d+=1),n+=l}l>1&&d?(o(!0),s(d)):(o(!1),s(1))}else o(!1),s(0)}),[null==(a=e.current)?void 0:a.offsetWidth,null==(r=e.current)?void 0:r.clientWidth,e]),[n,i]}},27989:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var l=a(67294),r=a(51995),n=a(55867),s=a(35932),i=a(74069),o=a(4715),d=a(34858),u=a(60972),c=a(11965);const p=r.iK.div`
  display: block;
  color: ${e=>{let{theme:t}=e;return t.colors.grayscale.base}};
  font-size: ${e=>{let{theme:t}=e;return t.typography.sizes.s}}px;
`,h=r.iK.div`
  padding-bottom: ${e=>{let{theme:t}=e;return 2*t.gridUnit}}px;
  padding-top: ${e=>{let{theme:t}=e;return 2*t.gridUnit}}px;

  & > div {
    margin: ${e=>{let{theme:t}=e;return t.gridUnit}}px 0;
  }

  &.extra-container {
    padding-top: 8px;
  }

  .confirm-overwrite {
    margin-bottom: ${e=>{let{theme:t}=e;return 2*t.gridUnit}}px;
  }

  .input-container {
    display: flex;
    align-items: center;

    label {
      display: flex;
      margin-right: ${e=>{let{theme:t}=e;return 2*t.gridUnit}}px;
    }

    i {
      margin: 0 ${e=>{let{theme:t}=e;return t.gridUnit}}px;
    }
  }

  input,
  textarea {
    flex: 1 1 auto;
  }

  textarea {
    height: 160px;
    resize: none;
  }

  input::placeholder,
  textarea::placeholder {
    color: ${e=>{let{theme:t}=e;return t.colors.grayscale.light1}};
  }

  textarea,
  input[type='text'],
  input[type='number'] {
    padding: ${e=>{let{theme:t}=e;return 1.5*t.gridUnit}}px
      ${e=>{let{theme:t}=e;return 2*t.gridUnit}}px;
    border-style: none;
    border: 1px solid ${e=>{let{theme:t}=e;return t.colors.grayscale.light2}};
    border-radius: ${e=>{let{theme:t}=e;return t.gridUnit}}px;

    &[name='name'] {
      flex: 0 1 auto;
      width: 40%;
    }

    &[name='sqlalchemy_uri'] {
      margin-right: ${e=>{let{theme:t}=e;return 3*t.gridUnit}}px;
    }
  }
`,m=e=>{let{resourceName:t,resourceLabel:a,passwordsNeededMessage:r,confirmOverwriteMessage:m,onModelImport:g,show:y,onHide:b,passwordFields:f=[],setPasswordFields:v=(()=>{}),sshTunnelPasswordFields:Z=[],setSSHTunnelPasswordFields:w=(()=>{}),sshTunnelPrivateKeyFields:_=[],setSSHTunnelPrivateKeyFields:S=(()=>{}),sshTunnelPrivateKeyPasswordFields:x=[],setSSHTunnelPrivateKeyPasswordFields:k=(()=>{})}=e;const[T,C]=(0,l.useState)(!0),[$,N]=(0,l.useState)({}),[E,P]=(0,l.useState)(!1),[F,H]=(0,l.useState)(!1),[A,I]=(0,l.useState)([]),[M,D]=(0,l.useState)(!1),[L,R]=(0,l.useState)(),[W,z]=(0,l.useState)({}),[U,O]=(0,l.useState)({}),[K,B]=(0,l.useState)({}),q=()=>{I([]),v([]),N({}),P(!1),H(!1),D(!1),R(""),w([]),S([]),k([]),z({}),O({}),B({})},{state:{alreadyExists:V,passwordsNeeded:Y,sshPasswordNeeded:j,sshPrivateKeyNeeded:G,sshPrivateKeyPasswordNeeded:X},importResource:J}=(0,d.PW)(t,a,(e=>{R(e)}));(0,l.useEffect)((()=>{v(Y),Y.length>0&&D(!1)}),[Y,v]),(0,l.useEffect)((()=>{P(V.length>0),V.length>0&&D(!1)}),[V,P]),(0,l.useEffect)((()=>{w(j),j.length>0&&D(!1)}),[j,w]),(0,l.useEffect)((()=>{S(G),G.length>0&&D(!1)}),[G,S]),(0,l.useEffect)((()=>{k(X),X.length>0&&D(!1)}),[X,k]);return T&&y&&C(!1),(0,c.tZ)(i.Z,{name:"model",className:"import-model-modal",disablePrimaryButton:0===A.length||E&&!F||M,onHandledPrimaryAction:()=>{var e;(null==(e=A[0])?void 0:e.originFileObj)instanceof File&&(D(!0),J(A[0].originFileObj,$,W,U,K,F).then((e=>{e&&(q(),g())})))},onHide:()=>{C(!0),b(),q()},primaryButtonName:E?(0,n.t)("Overwrite"):(0,n.t)("Import"),primaryButtonType:E?"danger":"primary",width:"750px",show:y,title:(0,c.tZ)("h4",null,(0,n.t)("Import %s",a))},(0,c.tZ)(h,null,(0,c.tZ)(o.gq,{name:"modelFile",id:"modelFile",accept:".yaml,.json,.yml,.zip",fileList:A,onChange:e=>{I([{...e.file,status:"done"}])},onRemove:e=>(I(A.filter((t=>t.uid!==e.uid))),!1),customRequest:()=>{},disabled:M},(0,c.tZ)(s.Z,{loading:M},(0,n.t)("Select file")))),L&&(0,c.tZ)(u.Z,{errorMessage:L,showDbInstallInstructions:f.length>0||Z.length>0||_.length>0||x.length>0}),(()=>{if(0===f.length&&0===Z.length&&0===_.length&&0===x.length)return null;const e=[...new Set([...f,...Z,..._,...x])];return(0,c.tZ)(l.Fragment,null,(0,c.tZ)("h5",null,(0,n.t)("Database passwords")),(0,c.tZ)(p,null,r),e.map((e=>(0,c.tZ)(l.Fragment,null,(null==f?void 0:f.indexOf(e))>=0&&(0,c.tZ)(h,{key:`password-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,n.t)("%s PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("input",{name:`password-${e}`,autoComplete:`password-${e}`,type:"password",value:$[e],onChange:t=>N({...$,[e]:t.target.value})})),(null==Z?void 0:Z.indexOf(e))>=0&&(0,c.tZ)(h,{key:`ssh_tunnel_password-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,n.t)("%s SSH TUNNEL PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("input",{name:`ssh_tunnel_password-${e}`,autoComplete:`ssh_tunnel_password-${e}`,type:"password",value:W[e],onChange:t=>z({...W,[e]:t.target.value})})),(null==_?void 0:_.indexOf(e))>=0&&(0,c.tZ)(h,{key:`ssh_tunnel_private_key-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,n.t)("%s SSH TUNNEL PRIVATE KEY",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("textarea",{name:`ssh_tunnel_private_key-${e}`,autoComplete:`ssh_tunnel_private_key-${e}`,value:U[e],onChange:t=>O({...U,[e]:t.target.value})})),(null==x?void 0:x.indexOf(e))>=0&&(0,c.tZ)(h,{key:`ssh_tunnel_private_key_password-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,n.t)("%s SSH TUNNEL PRIVATE KEY PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("input",{name:`ssh_tunnel_private_key_password-${e}`,autoComplete:`ssh_tunnel_private_key_password-${e}`,type:"password",value:K[e],onChange:t=>B({...K,[e]:t.target.value})}))))))})(),E?(0,c.tZ)(l.Fragment,null,(0,c.tZ)(h,null,(0,c.tZ)("div",{className:"confirm-overwrite"},m),(0,c.tZ)("div",{className:"control-label"},(0,n.t)('Type "%s" to confirm',(0,n.t)("OVERWRITE"))),(0,c.tZ)("input",{id:"overwrite",type:"text",onChange:e=>{var t,a;const l=null!=(t=null==(a=e.currentTarget)?void 0:a.value)?t:"";H(l.toUpperCase()===(0,n.t)("OVERWRITE"))}}))):null)}},83556:(e,t,a)=>{"use strict";a.d(t,{P:()=>c});var l=a(67294),r=a(51995),n=a(59361),s=a(58593),i=a(11965);const o=(0,r.iK)(n.Z)`
  ${e=>{let{theme:t}=e;return`\n  margin-top: ${t.gridUnit}px;\n  margin-bottom: ${t.gridUnit}px;\n  font-size: ${t.typography.sizes.s}px;\n  `}};
`,d=e=>{let{name:t,id:a,index:r,onDelete:n,editable:d=!1,onClick:u}=e;const c=(0,l.useMemo)((()=>t.length>20),[t]),p=(0,i.tZ)(l.Fragment,null,d?(0,i.tZ)(o,{key:a,closable:d,onClose:()=>r?null==n?void 0:n(r):null,color:"blue"},c?`${t.slice(0,20)}...`:t):(0,i.tZ)(o,{role:"link",key:a,onClick:u},a?(0,i.tZ)("a",{href:`/superset/all_entities/?tags=${t}`,target:"_blank",rel:"noreferrer"},c?`${t.slice(0,20)}...`:t):c?`${t.slice(0,20)}...`:t));return c?(0,i.tZ)(s.u,{title:t,key:t},p):p},u=r.iK.div`
  max-width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
`,c=e=>{let{tags:t,editable:a=!1,onDelete:r,maxTags:n}=e;const[s,o]=(0,l.useState)(n),c=e=>{null==r||r(e)},p=(0,l.useMemo)((()=>s?t.length>s:null),[t.length,s]),h=(0,l.useMemo)((()=>"number"==typeof s?t.length-s+1:null),[p,t.length,s]);return(0,i.tZ)(u,{className:"tag-list"},p&&"number"==typeof s?(0,i.tZ)(l.Fragment,null,t.slice(0,s-1).map(((e,t)=>(0,i.tZ)(d,{id:e.id,key:e.id,name:e.name,index:t,onDelete:c,editable:a}))),t.length>s?(0,i.tZ)(d,{name:`+${h}...`,onClick:()=>o(void 0)}):null):(0,i.tZ)(l.Fragment,null,t.map(((e,t)=>(0,i.tZ)(d,{id:e.id,key:e.id,name:e.name,index:t,onDelete:c,editable:a}))),n&&t.length>n?(0,i.tZ)(d,{name:"...",onClick:()=>o(n)}):null))}},33320:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>J});var l=a(45578),r=a.n(l),n=a(51995),s=a(55867),i=a(11064),o=a(31069),d=a(93185),u=a(55786),c=a(67294),p=a(15926),h=a.n(p),m=a(30381),g=a.n(m),y=a(40768),b=a(34858),f=a(32228),v=a(19259),Z=a(83556),w=a(86074),_=a(36674),S=a(16550),x=a(73727),k=a(18782),T=a(51794),C=a(58593),$=a(11965);const N=n.iK.div`
  .link {
    color: ${e=>{let{theme:t}=e;return t.colors.grayscale.light5}};
    display: block;
    text-decoration: underline;
  }
`;function E(e){let{children:t,crossLinks:a=[],moreItems:l,show:r=!1}=e;return(0,$.tZ)(C.u,{placement:"top",title:r&&(0,$.tZ)(N,null,a.map((e=>(0,$.tZ)(x.rU,{className:"link",key:e.to,to:e.to,target:"_blank",rel:"noreferer noopener"},e.title))),l&&(0,$.tZ)("span",null,(0,s.t)("+ %s more",l)))},t)}const P=n.iK.div`
  ${e=>{let{theme:t}=e;return`\n    & > span {\n      width: 100%;\n      display: flex;\n\n      .ant-tooltip-open {\n        display: inline;\n      }\n\n      .truncated {\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        display: inline-block;\n        width: 100%;\n        vertical-align: bottom;\n      }\n\n      .count {\n        cursor: pointer;\n        color: ${t.colors.grayscale.base};\n        font-weight: ${t.typography.weights.bold};\n      }\n    }\n  `}}
`;function F(e){let{crossLinks:t,maxLinks:a=20,linkPrefix:l="/superset/dashboard/"}=e;const r=(0,c.useRef)(null),n=(0,c.useRef)(null),[s,i]=(0,T.Z)(r,n),o=(0,c.useMemo)((()=>t.length>a?t.length-a:void 0),[t,a]),d=(0,c.useMemo)((()=>(0,$.tZ)("span",{className:"truncated",ref:r},t.map(((e,t)=>(0,$.tZ)(x.rU,{key:e.id,to:l+e.id,target:"_blank",rel:"noreferer noopener"},0===t?e.title:`, ${e.title}`))))),[t]),u=(0,c.useMemo)((()=>t.slice(0,a).map((e=>({title:e.title,to:l+e.id})))),[t,a]);return(0,$.tZ)(P,null,(0,$.tZ)(E,{moreItems:o,crossLinks:u,show:!!s},d,i&&(0,$.tZ)("span",{ref:n,className:"count"},"+",s)))}var H=a(38703),A=a(61337),I=a(14114),M=a(83673),D=a(27989),L=a(70163),R=a(1510),W=a(91263),z=a(8272),U=a(79789),O=a(85931),K=a(60718),B=a(8494);const q=n.iK.div`
  align-items: center;
  display: flex;

  a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
  }

  svg {
    margin-right: ${e=>{let{theme:t}=e;return t.gridUnit}}px;
  }
`,V=(0,s.t)('The passwords for the databases below are needed in order to import them together with the charts. Please note that the "Secure Extra" and "Certificate" sections of the database configuration are not present in export files, and should be added manually after the import if they are needed.'),Y=(0,s.t)("You are importing one or more charts that already exist. Overwriting might cause you to lose some of your work. Are you sure you want to overwrite?");(0,W.Z)();const j=(0,i.Z)(),G=async function(e,t,a){var l;void 0===e&&(e="");const n=e?{filters:[{col:"table_name",opr:"sw",value:e}]}:{},s=h().encode({columns:["datasource_name","datasource_id"],keys:["none"],order_column:"table_name",order_direction:"asc",page:t,page_size:a,...n}),{json:i={}}=await o.Z.get({endpoint:`/api/v1/dataset/?q=${s}`}),d=null==i||null==(l=i.result)?void 0:l.map((e=>{let{table_name:t,id:a}=e;return{label:t,value:a}}));return{data:r()(d,"value"),totalCount:null==i?void 0:i.count}},X=n.iK.div`
  color: ${e=>{let{theme:t}=e;return t.colors.grayscale.base}};
`,J=(0,I.ZP)((function(e){const{addDangerToast:t,addSuccessToast:a,user:{userId:l}}=e,n=(0,S.k6)(),{state:{loading:i,resourceCount:p,resourceCollection:m,bulkSelectEnabled:T},setResourceCollection:N,hasPerm:E,fetchData:P,toggleBulkSelect:I,refreshData:W}=(0,b.Yi)("chart",(0,s.t)("chart"),t),J=(0,c.useMemo)((()=>m.map((e=>e.id))),[m]),[Q,ee]=(0,b.NE)("chart",J,t),{sliceCurrentlyEditing:te,handleChartUpdated:ae,openChartEditModal:le,closeChartEditModal:re}=(0,b.fF)(N,m),[ne,se]=(0,c.useState)(!1),[ie,oe]=(0,c.useState)([]),[de,ue]=(0,c.useState)(!1),[ce,pe]=(0,c.useState)([]),[he,me]=(0,c.useState)([]),[ge,ye]=(0,c.useState)([]),be=(0,A.OH)(null==l?void 0:l.toString(),null),fe=E("can_write"),ve=E("can_write"),Ze=E("can_write"),we=E("can_export")&&(0,d.cr)(d.TT.VERSIONED_EXPORT),_e=[{id:"changed_on_delta_humanized",desc:!0}],Se=e=>{const t=e.map((e=>{let{id:t}=e;return t}));(0,f.Z)("chart",t,(()=>{ue(!1)})),ue(!0)},xe=async function(e,a,l){var n,i,d;void 0===e&&(e="");const u=e?{filters:[{col:"dashboard_title",opr:k.p.startsWith,value:e}]}:{},c=h().encode({columns:["dashboard_title","id"],keys:["none"],order_column:"dashboard_title",order_direction:"asc",page:a,page_size:l,...u}),p=await o.Z.get({endpoint:`/api/v1/dashboard/?q=${c}`}).catch((()=>t((0,s.t)("An error occurred while fetching dashboards")))),m=null==p||null==(n=p.json)||null==(i=n.result)?void 0:i.map((e=>{let{dashboard_title:t,id:a}=e;return{label:t,value:a}}));return{data:r()(m,"value"),totalCount:null==p||null==(d=p.json)?void 0:d.count}},ke=(0,c.useMemo)((()=>[{Cell:e=>{let{row:{original:{id:t}}}=e;return l&&(0,$.tZ)(_.Z,{itemId:t,saveFaveStar:Q,isStarred:ee[t]})},Header:"",id:"id",disableSortBy:!0,size:"xs",hidden:!l},{Cell:e=>{let{row:{original:{url:t,slice_name:a,certified_by:l,certification_details:r,description:n}}}=e;return(0,$.tZ)(q,null,(0,$.tZ)(x.rU,{to:t},l&&(0,$.tZ)(c.Fragment,null,(0,$.tZ)(U.Z,{certifiedBy:l,details:r})," "),a),n&&(0,$.tZ)(z.Z,{tooltip:n,viewBox:"0 -1 24 24"}))},Header:(0,s.t)("Chart"),accessor:"slice_name"},{Cell:e=>{var t;let{row:{original:{viz_type:a}}}=e;return(null==(t=j.get(a))?void 0:t.name)||a},Header:(0,s.t)("Visualization type"),accessor:"viz_type",size:"xxl"},{Cell:e=>{let{row:{original:{datasource_name_text:t,datasource_url:a}}}=e;return(0,$.tZ)(O.m,{to:a},t)},Header:(0,s.t)("Dataset"),accessor:"datasource_id",disableSortBy:!0,size:"xl"},{Cell:e=>{let{row:{original:{dashboards:t}}}=e;return(0,$.tZ)(F,{crossLinks:(0,u.Z)(t).map((e=>({title:e.dashboard_title,id:e.id})))})},Header:(0,s.t)("Dashboards added to"),accessor:"dashboards",disableSortBy:!0,size:"xxl",hidden:!0},{Cell:e=>{let{row:{original:{last_saved_by:t}}}=e;return(0,$.tZ)(c.Fragment,null,(e=>null!=e&&e.first_name?`${null==e?void 0:e.first_name} ${null==e?void 0:e.last_name}`:null)(t))},Header:(0,s.t)("Modified by"),accessor:"last_saved_by.first_name",size:"xl"},{Cell:e=>{let{row:{original:{last_saved_at:t}}}=e;return(0,$.tZ)("span",{className:"no-wrap"},t?g().utc(t).fromNow():null)},Header:(0,s.t)("Last modified"),accessor:"last_saved_at",size:"xl"},{accessor:"owners",hidden:!0,disableSortBy:!0},{Cell:e=>{let{row:{original:{created_by:t}}}=e;return t?`${t.first_name} ${t.last_name}`:""},Header:(0,s.t)("Created by"),accessor:"created_by",disableSortBy:!0,size:"xl"},{Cell:e=>{let{row:{original:{tags:t=[]}}}=e;return(0,$.tZ)(Z.P,{tags:t.filter((e=>!e.type||1===e.type||"TagTypes.custom"===e.type)),maxTags:3})},Header:(0,s.t)("Tags"),accessor:"tags",disableSortBy:!0,hidden:!(0,d.cr)(d.TT.TAGGING_SYSTEM)},{Cell:e=>{let{row:{original:l}}=e;return ve||Ze||we?(0,$.tZ)(X,{className:"actions"},Ze&&(0,$.tZ)(v.Z,{title:(0,s.t)("Please confirm"),description:(0,$.tZ)(c.Fragment,null,(0,s.t)("Are you sure you want to delete")," ",(0,$.tZ)("b",null,l.slice_name),"?"),onConfirm:()=>(0,y.Gm)(l,a,t,W)},(e=>(0,$.tZ)(C.u,{id:"delete-action-tooltip",title:(0,s.t)("Delete"),placement:"bottom"},(0,$.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:e},(0,$.tZ)(L.Z.Trash,null))))),we&&(0,$.tZ)(C.u,{id:"export-action-tooltip",title:(0,s.t)("Export"),placement:"bottom"},(0,$.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>Se([l])},(0,$.tZ)(L.Z.Share,null))),ve&&(0,$.tZ)(C.u,{id:"edit-action-tooltip",title:(0,s.t)("Edit"),placement:"bottom"},(0,$.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>le(l)},(0,$.tZ)(L.Z.EditAlt,null)))):null},Header:(0,s.t)("Actions"),id:"actions",disableSortBy:!0,hidden:!ve&&!Ze}]),[l,ve,Ze,we,Q,ee,W,a,t]),Te=(0,c.useMemo)((()=>({Header:(0,s.t)("Favorite"),key:"favorite",id:"id",urlDisplay:"favorite",input:"select",operator:k.p.chartIsFav,unfilteredLabel:(0,s.t)("Any"),selects:[{label:(0,s.t)("Yes"),value:!0},{label:(0,s.t)("No"),value:!1}]})),[]),Ce=(0,c.useMemo)((()=>{const a=[{Header:(0,s.t)("Search"),key:"search",id:"slice_name",input:"search",operator:k.p.chartAllText},{Header:(0,s.t)("Owner"),key:"owner",id:"owners",input:"select",operator:k.p.relationManyMany,unfilteredLabel:(0,s.t)("All"),fetchSelects:(0,y.tm)("chart","owners",(0,y.v$)((e=>t((0,s.t)("An error occurred while fetching chart owners values: %s",e)))),e.user),paginate:!0},{Header:(0,s.t)("Created by"),key:"created_by",id:"created_by",input:"select",operator:k.p.relationOneMany,unfilteredLabel:(0,s.t)("All"),fetchSelects:(0,y.tm)("chart","created_by",(0,y.v$)((e=>t((0,s.t)("An error occurred while fetching chart created by values: %s",e)))),e.user),paginate:!0},{Header:(0,s.t)("Chart type"),key:"viz_type",id:"viz_type",input:"select",operator:k.p.equals,unfilteredLabel:(0,s.t)("All"),selects:j.keys().filter((e=>{var t;return(0,R.X3)((null==(t=j.get(e))?void 0:t.behaviors)||[])})).map((e=>{var t;return{label:(null==(t=j.get(e))?void 0:t.name)||e,value:e}})).sort(((e,t)=>e.label&&t.label?e.label>t.label?1:e.label<t.label?-1:0:0))},{Header:(0,s.t)("Dataset"),key:"dataset",id:"datasource_id",input:"select",operator:k.p.equals,unfilteredLabel:(0,s.t)("All"),fetchSelects:G,paginate:!0},{Header:(0,s.t)("Dashboards"),key:"dashboards",id:"dashboards",input:"select",operator:k.p.relationManyMany,unfilteredLabel:(0,s.t)("All"),fetchSelects:xe,paginate:!0},...l?[Te]:[],{Header:(0,s.t)("Certified"),key:"certified",id:"id",urlDisplay:"certified",input:"select",operator:k.p.chartIsCertified,unfilteredLabel:(0,s.t)("Any"),selects:[{label:(0,s.t)("Yes"),value:!0},{label:(0,s.t)("No"),value:!1}]}];return(0,d.cr)(d.TT.TAGGING_SYSTEM)&&a.push({Header:(0,s.t)("Tags"),key:"tags",id:"tags",input:"select",operator:k.p.chartTags,unfilteredLabel:(0,s.t)("All"),fetchSelects:K.m}),a}),[t,Te,e.user]),$e=[{desc:!1,id:"slice_name",label:(0,s.t)("Alphabetical"),value:"alphabetical"},{desc:!0,id:"changed_on_delta_humanized",label:(0,s.t)("Recently modified"),value:"recently_modified"},{desc:!1,id:"changed_on_delta_humanized",label:(0,s.t)("Least recently modified"),value:"least_recently_modified"}],Ne=(0,c.useCallback)((e=>(0,$.tZ)(B.Z,{chart:e,showThumbnails:be?be.thumbnails:(0,d.cr)(d.TT.THUMBNAILS),hasPerm:E,openChartEditModal:le,bulkSelectEnabled:T,addDangerToast:t,addSuccessToast:a,refreshData:W,userId:l,loading:i,favoriteStatus:ee[e.id],saveFavoriteStatus:Q,handleBulkChartExport:Se})),[t,a,T,ee,E,i]),Ee=[];return(Ze||we)&&Ee.push({name:(0,s.t)("Bulk select"),buttonStyle:"secondary","data-test":"bulk-select",onClick:I}),fe&&(Ee.push({name:(0,$.tZ)(c.Fragment,null,(0,$.tZ)("i",{className:"fa fa-plus"})," ",(0,s.t)("Chart")),buttonStyle:"primary",onClick:()=>{n.push("/chart/add")}}),(0,d.cr)(d.TT.VERSIONED_EXPORT)&&Ee.push({name:(0,$.tZ)(C.u,{id:"import-tooltip",title:(0,s.t)("Import charts"),placement:"bottomRight"},(0,$.tZ)(L.Z.Import,null)),buttonStyle:"link",onClick:()=>{se(!0)}})),(0,$.tZ)(c.Fragment,null,(0,$.tZ)(w.Z,{name:(0,s.t)("Charts"),buttons:Ee}),te&&(0,$.tZ)(M.Z,{onHide:re,onSave:ae,show:!0,slice:te}),(0,$.tZ)(v.Z,{title:(0,s.t)("Please confirm"),description:(0,s.t)("Are you sure you want to delete the selected charts?"),onConfirm:function(e){o.Z.delete({endpoint:`/api/v1/chart/?q=${h().encode(e.map((e=>{let{id:t}=e;return t})))}`}).then((e=>{let{json:t={}}=e;W(),a(t.message)}),(0,y.v$)((e=>t((0,s.t)("There was an issue deleting the selected charts: %s",e)))))}},(e=>{const t=[];return Ze&&t.push({key:"delete",name:(0,s.t)("Delete"),type:"danger",onSelect:e}),we&&t.push({key:"export",name:(0,s.t)("Export"),type:"primary",onSelect:Se}),(0,$.tZ)(k.Z,{bulkActions:t,bulkSelectEnabled:T,cardSortSelectOptions:$e,className:"chart-list-view",columns:ke,count:p,data:m,disableBulkSelect:I,fetchData:P,filters:Ce,initialSort:_e,loading:i,pageSize:25,renderCard:Ne,showThumbnails:be?be.thumbnails:(0,d.cr)(d.TT.THUMBNAILS),defaultViewMode:(0,d.cr)(d.TT.LISTVIEWS_DEFAULT_CARD_VIEW)?"card":"table"})})),(0,$.tZ)(D.Z,{resourceName:"chart",resourceLabel:(0,s.t)("chart"),passwordsNeededMessage:V,confirmOverwriteMessage:Y,addDangerToast:t,addSuccessToast:a,onModelImport:()=>{se(!1),W(),a((0,s.t)("Chart imported"))},show:ne,onHide:()=>{se(!1)},passwordFields:ie,setPasswordFields:oe,sshTunnelPasswordFields:ce,setSSHTunnelPasswordFields:pe,sshTunnelPrivateKeyFields:he,setSSHTunnelPrivateKeyFields:me,sshTunnelPrivateKeyPasswordFields:ge,setSSHTunnelPrivateKeyPasswordFields:ye}),de&&(0,$.tZ)(H.Z,null))}))}}]);
//# sourceMappingURL=21ce0ee60db97048f795.chunk.js.map