"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[8774],{452630:(e,t,a)=>{t.iB=t.YM=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},n=l(a(667294)),i=l(a(45697)),s=a(402371);function l(e){return e&&e.__esModule?e:{default:e}}t.YM=function(e){var t=e.itemTypeToComponent,a=e.WrapperComponent,l=void 0===a?"div":a,o=function(e){var a=e.currentPage,i=e.totalPages,o=e.boundaryPagesRange,d=e.siblingPagesRange,u=e.hideEllipsis,c=e.hidePreviousAndNextPageLinks,h=e.hideFirstAndLastPageLinks,g=e.onChange,p=e.disabled,b=function(e,t){var a={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(a[r]=e[r]);return a}(e,["currentPage","totalPages","boundaryPagesRange","siblingPagesRange","hideEllipsis","hidePreviousAndNextPageLinks","hideFirstAndLastPageLinks","onChange","disabled"]),m=(0,s.getPaginationModel)({currentPage:a,totalPages:i,boundaryPagesRange:o,siblingPagesRange:d,hideEllipsis:u,hidePreviousAndNextPageLinks:c,hideFirstAndLastPageLinks:h}),P=function(e,t,a){return function(i){var s,l,o,d=e[i.type],u=(l=(s=i).value,o=s.isDisabled,function(){!o&&a&&t!==l&&a(l)});return n.default.createElement(d,r({onClick:u},i))}}(t,a,g);return n.default.createElement(l,b,m.map((function(e){return P(r({},e,{isDisabled:!!p}))})))};return o.propTypes={currentPage:i.default.number.isRequired,totalPages:i.default.number.isRequired,boundaryPagesRange:i.default.number,siblingPagesRange:i.default.number,hideEllipsis:i.default.bool,hidePreviousAndNextPageLinks:i.default.bool,hideFirstAndLastPageLinks:i.default.bool,onChange:i.default.func,disabled:i.default.bool},o},t.iB=s.ITEM_TYPES},554070:(e,t,a)=>{a.d(t,{w:()=>l});var r=a(358593),n=a(83379),i=a(61988),s=a(135944);const l=({user:e,date:t})=>{const a=(0,s.tZ)("span",{className:"no-wrap",children:t});if(e){const t=(0,n.Z)(e),l=(0,i.t)("Modified by: %s",t);return(0,s.tZ)(r.u,{title:l,placement:"bottom",children:a})}return a}},727989:(e,t,a)=>{a.d(t,{Z:()=>p});var r=a(667294),n=a(751995),i=a(61988),s=a(835932),l=a(774069),o=a(104715),d=a(34858),u=a(762921),c=a(135944);const h=n.iK.div`
  display: block;
  color: ${({theme:e})=>e.colors.grayscale.base};
  font-size: ${({theme:e})=>e.typography.sizes.s}px;
`,g=n.iK.div`
  padding-bottom: ${({theme:e})=>2*e.gridUnit}px;
  padding-top: ${({theme:e})=>2*e.gridUnit}px;

  & > div {
    margin: ${({theme:e})=>e.gridUnit}px 0;
  }

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

  .confirm-overwrite {
    margin-bottom: ${({theme:e})=>2*e.gridUnit}px;
  }

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

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

    i {
      margin: 0 ${({theme:e})=>e.gridUnit}px;
    }
  }

  input,
  textarea {
    flex: 1 1 auto;
  }

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

  input::placeholder,
  textarea::placeholder {
    color: ${({theme:e})=>e.colors.grayscale.light1};
  }

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

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

    &[name='sqlalchemy_uri'] {
      margin-right: ${({theme:e})=>3*e.gridUnit}px;
    }
  }
`,p=({resourceName:e,resourceLabel:t,passwordsNeededMessage:a,confirmOverwriteMessage:n,onModelImport:p,show:b,onHide:m,passwordFields:P=[],setPasswordFields:_=(()=>{}),sshTunnelPasswordFields:f=[],setSSHTunnelPasswordFields:v=(()=>{}),sshTunnelPrivateKeyFields:y=[],setSSHTunnelPrivateKeyFields:S=(()=>{}),sshTunnelPrivateKeyPasswordFields:E=[],setSSHTunnelPrivateKeyPasswordFields:w=(()=>{})})=>{const[T,I]=(0,r.useState)(!0),[N,L]=(0,r.useState)({}),[Z,A]=(0,r.useState)(!1),[k,x]=(0,r.useState)(!1),[M,R]=(0,r.useState)([]),[C,F]=(0,r.useState)(!1),[K,B]=(0,r.useState)(),[H,Y]=(0,r.useState)({}),[D,O]=(0,r.useState)({}),[$,X]=(0,r.useState)({}),G=()=>{R([]),_([]),L({}),A(!1),x(!1),F(!1),B(""),v([]),S([]),w([]),Y({}),O({}),X({})},{state:{alreadyExists:U,passwordsNeeded:z,sshPasswordNeeded:j,sshPrivateKeyNeeded:q,sshPrivateKeyPasswordNeeded:V},importResource:W}=(0,d.PW)(e,t,(e=>{B(e)}));(0,r.useEffect)((()=>{_(z),z.length>0&&F(!1)}),[z,_]),(0,r.useEffect)((()=>{A(U.length>0),U.length>0&&F(!1)}),[U,A]),(0,r.useEffect)((()=>{v(j),j.length>0&&F(!1)}),[j,v]),(0,r.useEffect)((()=>{S(q),q.length>0&&F(!1)}),[q,S]),(0,r.useEffect)((()=>{w(V),V.length>0&&F(!1)}),[V,w]);return T&&b&&I(!1),(0,c.BX)(l.default,{name:"model",className:"import-model-modal",disablePrimaryButton:0===M.length||Z&&!k||C,onHandledPrimaryAction:()=>{var e;(null==(e=M[0])?void 0:e.originFileObj)instanceof File&&(F(!0),W(M[0].originFileObj,N,H,D,$,k).then((e=>{e&&(G(),p())})))},onHide:()=>{I(!0),m(),G()},primaryButtonName:Z?(0,i.t)("Overwrite"):(0,i.t)("Import"),primaryButtonType:Z?"danger":"primary",width:"750px",show:b,title:(0,c.tZ)("h4",{children:(0,i.t)("Import %s",t)}),children:[(0,c.tZ)(g,{children:(0,c.tZ)(o.gq,{name:"modelFile",id:"modelFile",accept:".yaml,.json,.yml,.zip",fileList:M,onChange:e=>{R([{...e.file,status:"done"}])},onRemove:e=>(R(M.filter((t=>t.uid!==e.uid))),!1),customRequest:()=>{},disabled:C,children:(0,c.tZ)(s.Z,{loading:C,children:(0,i.t)("Select file")})})}),K&&(0,c.tZ)(u.Z,{errorMessage:K,showDbInstallInstructions:P.length>0||f.length>0||y.length>0||E.length>0}),(()=>{if(0===P.length&&0===f.length&&0===y.length&&0===E.length)return null;const e=[...new Set([...P,...f,...y,...E])];return(0,c.BX)(c.HY,{children:[(0,c.tZ)("h5",{children:(0,i.t)("Database passwords")}),(0,c.tZ)(h,{children:a}),e.map((e=>(0,c.BX)(c.HY,{children:[(null==P?void 0:P.indexOf(e))>=0&&(0,c.BX)(g,{children:[(0,c.BX)("div",{className:"control-label",children:[(0,i.t)("%s PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required",children:"*"})]}),(0,c.tZ)("input",{name:`password-${e}`,autoComplete:`password-${e}`,type:"password",value:N[e],onChange:t=>L({...N,[e]:t.target.value})})]},`password-for-${e}`),(null==f?void 0:f.indexOf(e))>=0&&(0,c.BX)(g,{children:[(0,c.BX)("div",{className:"control-label",children:[(0,i.t)("%s SSH TUNNEL PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required",children:"*"})]}),(0,c.tZ)("input",{name:`ssh_tunnel_password-${e}`,autoComplete:`ssh_tunnel_password-${e}`,type:"password",value:H[e],onChange:t=>Y({...H,[e]:t.target.value})})]},`ssh_tunnel_password-for-${e}`),(null==y?void 0:y.indexOf(e))>=0&&(0,c.BX)(g,{children:[(0,c.BX)("div",{className:"control-label",children:[(0,i.t)("%s SSH TUNNEL PRIVATE KEY",e.slice(10)),(0,c.tZ)("span",{className:"required",children:"*"})]}),(0,c.tZ)("textarea",{name:`ssh_tunnel_private_key-${e}`,autoComplete:`ssh_tunnel_private_key-${e}`,value:D[e],onChange:t=>O({...D,[e]:t.target.value})})]},`ssh_tunnel_private_key-for-${e}`),(null==E?void 0:E.indexOf(e))>=0&&(0,c.BX)(g,{children:[(0,c.BX)("div",{className:"control-label",children:[(0,i.t)("%s SSH TUNNEL PRIVATE KEY PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required",children:"*"})]}),(0,c.tZ)("input",{name:`ssh_tunnel_private_key_password-${e}`,autoComplete:`ssh_tunnel_private_key_password-${e}`,type:"password",value:$[e],onChange:t=>X({...$,[e]:t.target.value})})]},`ssh_tunnel_private_key_password-for-${e}`)]})))]})})(),Z?(0,c.tZ)(c.HY,{children:(0,c.BX)(g,{children:[(0,c.tZ)("div",{className:"confirm-overwrite",children:n}),(0,c.tZ)("div",{className:"control-label",children:(0,i.t)('Type "%s" to confirm',(0,i.t)("OVERWRITE"))}),(0,c.tZ)("input",{id:"overwrite",type:"text",onChange:e=>{var t,a;const r=null!=(t=null==(a=e.currentTarget)?void 0:a.value)?t:"";x(r.toUpperCase()===(0,i.t)("OVERWRITE"))}})]})}):null]})}},25772:(e,t,a)=>{a.d(t,{P:()=>r.Z});var r=a(465477);a(908420)},18510:(e,t,a)=>{a.r(t),a.d(t,{default:()=>D});var r,n=a(61988),i=a(751995),s=a(431069),l=a(593185),o=a(828216),d=a(667294),u=a(473727),c=a(115926),h=a.n(c),g=a(440768),p=a(34858),b=a(419259),m=a(25772),P=a(232228),_=a(838703),f=a(586074),v=a(593139),y=a(961337),S=a(414114),E=a(222545),w=a(313322),T=a(217198),I=a(236674),N=a(720818),L=a(358593),Z=a(727989),A=a(400012),k=a(679789),x=a(860718),M=a(565043);!function(e){e.PUBLISHED="published",e.DRAFT="draft"}(r||(r={}));var R=a(212617),C=a(554070),F=a(135944);const K=(0,n.t)('The passwords for the databases below are needed in order to import them together with the dashboards. 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.'),B=(0,n.t)("You are importing one or more dashboards that already exist. Overwriting might cause you to lose some of your work. Are you sure you want to overwrite?"),H=i.iK.div`
  color: ${({theme:e})=>e.colors.grayscale.base};
`,Y=["id","dashboard_title","published","url","slug","changed_by","changed_on_delta_humanized","owners.id","owners.first_name","owners.last_name","owners","tags.id","tags.name","tags.type","status","certified_by","certification_details","changed_on"],D=(0,S.ZP)((function(e){var t;const{addDangerToast:a,addSuccessToast:i,user:c}=e,{roles:S}=(0,o.v9)((e=>e.user)),D=(0,R.R)("can_read","Tag",S),{state:{loading:O,resourceCount:$,resourceCollection:X,bulkSelectEnabled:G},setResourceCollection:U,hasPerm:z,fetchData:j,toggleBulkSelect:q,refreshData:V}=(0,p.Yi)("dashboard",(0,n.t)("dashboard"),a,void 0,void 0,void 0,void 0,Y),W=(0,d.useMemo)((()=>X.map((e=>e.id))),[X]),[J,Q]=(0,p.NE)("dashboard",W,a),[ee,te]=(0,d.useState)(null),[ae,re]=(0,d.useState)(null),[ne,ie]=(0,d.useState)(!1),[se,le]=(0,d.useState)([]),[oe,de]=(0,d.useState)(!1),[ue,ce]=(0,d.useState)([]),[he,ge]=(0,d.useState)([]),[pe,be]=(0,d.useState)([]),me=(0,y.OH)(null==c||null==(t=c.userId)?void 0:t.toString(),null),Pe=z("can_write"),_e=z("can_write"),fe=z("can_write"),ve=z("can_export"),ye=[{id:"changed_on_delta_humanized",desc:!0}];function Se(e){te(e)}function Ee(e){return s.Z.get({endpoint:`/api/v1/dashboard/${e.id}`}).then((({json:e={}})=>{U(X.map((t=>{var a;if(t.id===(null==e||null==(a=e.result)?void 0:a.id)){const{changed_by_name:a,changed_by:r,dashboard_title:n="",slug:i="",json_metadata:s="",changed_on_delta_humanized:l,url:o="",certified_by:d="",certification_details:u="",owners:c,tags:h}=e.result;return{...t,changed_by_name:a,changed_by:r,dashboard_title:n,slug:i,json_metadata:s,changed_on_delta_humanized:l,url:o,certified_by:d,certification_details:u,owners:c,tags:h}}return t})))}),(0,g.v$)((e=>a((0,n.t)("An error occurred while fetching dashboards: %s",e)))))}const we=e=>{const t=e.map((({id:e})=>e));(0,P.Z)("dashboard",t,(()=>{de(!1)})),de(!0)},Te=(0,d.useMemo)((()=>[{Cell:({row:{original:{id:e}}})=>(null==c?void 0:c.userId)&&(0,F.tZ)(I.Z,{itemId:e,saveFaveStar:J,isStarred:Q[e]}),Header:"",id:"id",disableSortBy:!0,size:"xs",hidden:!(null!=c&&c.userId)},{Cell:({row:{original:{url:e,dashboard_title:t,certified_by:a,certification_details:r}}})=>(0,F.BX)(u.rU,{to:e,children:[a&&(0,F.BX)(F.HY,{children:[(0,F.tZ)(k.Z,{certifiedBy:a,details:r})," "]}),t]}),Header:(0,n.t)("Name"),accessor:"dashboard_title"},{Cell:({row:{original:{status:e}}})=>e===r.PUBLISHED?(0,n.t)("Published"):(0,n.t)("Draft"),Header:(0,n.t)("Status"),accessor:"published",size:"xl"},{Cell:({row:{original:{tags:e=[]}}})=>(0,F.tZ)(m.P,{tags:e.filter((e=>"TagTypes.custom"===e.type||1===e.type)),maxTags:3}),Header:(0,n.t)("Tags"),accessor:"tags",disableSortBy:!0,hidden:!(0,l.cr)(l.TT.TaggingSystem)},{Cell:({row:{original:{owners:e=[]}}})=>(0,F.tZ)(E.Z,{users:e}),Header:(0,n.t)("Owners"),accessor:"owners",disableSortBy:!0,size:"xl"},{Cell:({row:{original:{changed_on_delta_humanized:e,changed_by:t}}})=>(0,F.tZ)(C.w,{date:e,user:t}),Header:(0,n.t)("Last modified"),accessor:"changed_on_delta_humanized",size:"xl"},{Cell:({row:{original:e}})=>(0,F.BX)(H,{className:"actions",children:[fe&&(0,F.tZ)(b.Z,{title:(0,n.t)("Please confirm"),description:(0,F.BX)(F.HY,{children:[(0,n.t)("Are you sure you want to delete")," ",(0,F.tZ)("b",{children:e.dashboard_title}),"?"]}),onConfirm:()=>(0,g.Iu)(e,V,i,a),children:e=>(0,F.tZ)(L.u,{id:"delete-action-tooltip",title:(0,n.t)("Delete"),placement:"bottom",children:(0,F.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:e,children:(0,F.tZ)(w.Z.Trash,{})})})}),ve&&(0,F.tZ)(L.u,{id:"export-action-tooltip",title:(0,n.t)("Export"),placement:"bottom",children:(0,F.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>we([e]),children:(0,F.tZ)(w.Z.Share,{})})}),_e&&(0,F.tZ)(L.u,{id:"edit-action-tooltip",title:(0,n.t)("Edit"),placement:"bottom",children:(0,F.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>Se(e),children:(0,F.tZ)(w.Z.EditAlt,{})})})]}),Header:(0,n.t)("Actions"),id:"actions",hidden:!_e&&!fe&&!ve,disableSortBy:!0},{accessor:A.J.ChangedBy,hidden:!0}]),[null==c?void 0:c.userId,_e,fe,ve,J,Q,V,i,a]),Ie=(0,d.useMemo)((()=>({Header:(0,n.t)("Favorite"),key:"favorite",id:"id",urlDisplay:"favorite",input:"select",operator:v.p.DashboardIsFav,unfilteredLabel:(0,n.t)("Any"),selects:[{label:(0,n.t)("Yes"),value:!0},{label:(0,n.t)("No"),value:!1}]})),[]),Ne=(0,d.useMemo)((()=>[{Header:(0,n.t)("Name"),key:"search",id:"dashboard_title",input:"search",operator:v.p.TitleOrSlug},{Header:(0,n.t)("Status"),key:"published",id:"published",input:"select",operator:v.p.Equals,unfilteredLabel:(0,n.t)("Any"),selects:[{label:(0,n.t)("Published"),value:!0},{label:(0,n.t)("Draft"),value:!1}]},...(0,l.cr)(l.TT.TaggingSystem)&&D?[{Header:(0,n.t)("Tag"),key:"tags",id:"tags",input:"select",operator:v.p.DashboardTagById,unfilteredLabel:(0,n.t)("All"),fetchSelects:x.m}]:[],{Header:(0,n.t)("Owner"),key:"owner",id:"owners",input:"select",operator:v.p.RelationManyMany,unfilteredLabel:(0,n.t)("All"),fetchSelects:(0,g.tm)("dashboard","owners",(0,g.v$)((e=>a((0,n.t)("An error occurred while fetching dashboard owner values: %s",e)))),e.user),paginate:!0},...null!=c&&c.userId?[Ie]:[],{Header:(0,n.t)("Certified"),key:"certified",id:"id",urlDisplay:"certified",input:"select",operator:v.p.DashboardIsCertified,unfilteredLabel:(0,n.t)("Any"),selects:[{label:(0,n.t)("Yes"),value:!0},{label:(0,n.t)("No"),value:!1}]},{Header:(0,n.t)("Modified by"),key:"changed_by",id:"changed_by",input:"select",operator:v.p.RelationOneMany,unfilteredLabel:(0,n.t)("All"),fetchSelects:(0,g.tm)("dashboard","changed_by",(0,g.v$)((e=>(0,n.t)("An error occurred while fetching dataset datasource values: %s",e))),c),paginate:!0}]),[a,Ie,e.user]),Le=[{desc:!1,id:"dashboard_title",label:(0,n.t)("Alphabetical"),value:"alphabetical"},{desc:!0,id:"changed_on_delta_humanized",label:(0,n.t)("Recently modified"),value:"recently_modified"},{desc:!1,id:"changed_on_delta_humanized",label:(0,n.t)("Least recently modified"),value:"least_recently_modified"}],Ze=(0,d.useCallback)((e=>(0,F.tZ)(M.Z,{dashboard:e,hasPerm:z,bulkSelectEnabled:G,showThumbnails:me?me.thumbnails:(0,l.cr)(l.TT.Thumbnails),userId:null==c?void 0:c.userId,loading:O,openDashboardEditModal:Se,saveFavoriteStatus:J,favoriteStatus:Q[e.id],handleBulkDashboardExport:we,onDelete:e=>re(e)})),[G,Q,z,O,null==c?void 0:c.userId,J,me]),Ae=[];return(fe||ve)&&Ae.push({name:(0,n.t)("Bulk select"),buttonStyle:"secondary",onClick:q}),Pe&&(Ae.push({name:(0,F.BX)(F.HY,{children:[(0,F.tZ)("i",{className:"fa fa-plus"})," ",(0,n.t)("Dashboard")]}),buttonStyle:"primary",onClick:()=>{window.location.assign("/dashboard/new")}}),Ae.push({name:(0,F.tZ)(L.u,{id:"import-tooltip",title:(0,n.t)("Import dashboards"),placement:"bottomRight",children:(0,F.tZ)(w.Z.Import,{})}),buttonStyle:"link",onClick:()=>{ie(!0)}})),(0,F.BX)(F.HY,{children:[(0,F.tZ)(f.Z,{name:(0,n.t)("Dashboards"),buttons:Ae}),(0,F.tZ)(b.Z,{title:(0,n.t)("Please confirm"),description:(0,n.t)("Are you sure you want to delete the selected dashboards?"),onConfirm:function(e){return s.Z.delete({endpoint:`/api/v1/dashboard/?q=${h().encode(e.map((({id:e})=>e)))}`}).then((({json:e={}})=>{V(),i(e.message)}),(0,g.v$)((e=>a((0,n.t)("There was an issue deleting the selected dashboards: ",e)))))},children:e=>{const t=[];return fe&&t.push({key:"delete",name:(0,n.t)("Delete"),type:"danger",onSelect:e}),ve&&t.push({key:"export",name:(0,n.t)("Export"),type:"primary",onSelect:we}),(0,F.BX)(F.HY,{children:[ee&&(0,F.tZ)(N.Z,{dashboardId:ee.id,show:!0,onHide:()=>te(null),onSubmit:Ee}),ae&&(0,F.tZ)(T.Z,{description:(0,F.BX)(F.HY,{children:[(0,n.t)("Are you sure you want to delete")," ",(0,F.tZ)("b",{children:ae.dashboard_title}),"?"]}),onConfirm:()=>{(0,g.Iu)(ae,V,i,a,void 0,null==c?void 0:c.userId),re(null)},onHide:()=>re(null),open:!!ae,title:(0,n.t)("Please confirm")}),(0,F.tZ)(v.Z,{bulkActions:t,bulkSelectEnabled:G,cardSortSelectOptions:Le,className:"dashboard-list-view",columns:Te,count:$,data:X,disableBulkSelect:q,fetchData:j,refreshData:V,filters:Ne,initialSort:ye,loading:O,pageSize:25,addSuccessToast:i,addDangerToast:a,showThumbnails:me?me.thumbnails:(0,l.cr)(l.TT.Thumbnails),renderCard:Ze,defaultViewMode:(0,l.cr)(l.TT.ListviewsDefaultCardView)?"card":"table",enableBulkTag:!0,bulkTagResourceName:"dashboard"})]})}}),(0,F.tZ)(Z.Z,{resourceName:"dashboard",resourceLabel:(0,n.t)("dashboard"),passwordsNeededMessage:K,confirmOverwriteMessage:B,addDangerToast:a,addSuccessToast:i,onModelImport:()=>{ie(!1),V(),i((0,n.t)("Dashboard imported"))},show:ne,onHide:()=>{ie(!1)},passwordFields:se,setPasswordFields:le,sshTunnelPasswordFields:ue,setSSHTunnelPasswordFields:ce,sshTunnelPrivateKeyFields:he,setSSHTunnelPrivateKeyFields:ge,sshTunnelPrivateKeyPasswordFields:pe,setSSHTunnelPrivateKeyPasswordFields:be}),oe&&(0,F.tZ)(_.Z,{})]})}))},656590:(e,t)=>{t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOUS_PAGE_LINK:"PREVIOUS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},653804:(e,t,a)=>{var r=a(656590);t.createFirstEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.FIRST_PAGE_LINK,key:r.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:r.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.NEXT_PAGE_LINK,key:r.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(a,t+1),isActive:t===a}},t.createLastPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.LAST_PAGE_LINK,key:r.ITEM_KEYS.LAST_PAGE_LINK,value:a,isActive:t===a}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:r.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},1158:(e,t)=>{t.createRange=function(e,t){for(var a=[],r=e;r<=t;r++)a.push(r);return a}},402371:(e,t,a)=>{var r=a(1158),n=a(653804);t.getPaginationModel=function(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var t=Number(e.totalPages);if(isNaN(t))throw new Error("getPaginationModel(): totalPages should be a number");if(t<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var a=Number(e.currentPage);if(isNaN(a))throw new Error("getPaginationModel(): currentPage should be a number");if(a<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(a>t)throw new Error("getPaginationModel(): currentPage shouldn't be greater than totalPages");var i=null==e.boundaryPagesRange?1:Number(e.boundaryPagesRange);if(isNaN(i))throw new Error("getPaginationModel(): boundaryPagesRange should be a number");if(i<0)throw new Error("getPaginationModel(): boundaryPagesRange shouldn't be a negative number");var s=null==e.siblingPagesRange?1:Number(e.siblingPagesRange);if(isNaN(s))throw new Error("getPaginationModel(): siblingPagesRange should be a number");if(s<0)throw new Error("getPaginationModel(): siblingPagesRange shouldn't be a negative number");var l=Boolean(e.hidePreviousAndNextPageLinks),o=Boolean(e.hideFirstAndLastPageLinks),d=Boolean(e.hideEllipsis),u=d?0:1,c=[],h=n.createPageFunctionFactory(e);if(o||c.push(n.createFirstPageLink(e)),l||c.push(n.createPreviousPageLink(e)),1+2*u+2*s+2*i>=t){var g=r.createRange(1,t).map(h);c.push.apply(c,g)}else{var p=i,b=r.createRange(1,p).map(h),m=t+1-i,P=t,_=r.createRange(m,P).map(h),f=Math.min(Math.max(a-s,p+u+1),m-u-2*s-1),v=f+2*s,y=r.createRange(f,v).map(h);if(c.push.apply(c,b),!d){var S=f-1,E=(S===p+1?h:n.createFirstEllipsis)(S);c.push(E)}if(c.push.apply(c,y),!d){var w=v+1,T=(w===m-1?h:n.createSecondEllipsis)(w);c.push(T)}c.push.apply(c,_)}return l||c.push(n.createNextPageLink(e)),o||c.push(n.createLastPageLink(e)),c};var i=a(656590);t.ITEM_TYPES=i.ITEM_TYPES,t.ITEM_KEYS=i.ITEM_KEYS}}]);
//# sourceMappingURL=b76e6f570536fabf460a.chunk.js.map