diff --git a/dist/assets/index.js b/dist/assets/index.js index a90af17..b90f05e 100644 --- a/dist/assets/index.js +++ b/dist/assets/index.js @@ -1,3 +1,3 @@ -import{r as t,u as hs,l as fs,R as Ae,j as e,T as v,I as $,d as qe,W as Le,e as Pe,L as _e,f as ms,H as Z,g as Y,M as gs,h as xs,i as bs,k as ps,m as Cs,n as ws,o as js,A as Ge,p as pe,q as Qe,s as Ce,t as we,v as ke,B as E,D as Ss,F as T,w as ys,C as Ie,x as Be,y as ks,z as Bs,E as Ye,G as Ds,J as vs,K as Ke,N as Fs,S as Is,V as Rs,O as ze,P as Ns,Q as Je,U as Xe,X as Ts,Y as Ms,Z as As,_ as Ls,$ as Vs,a0 as Oe,a1 as C,a2 as Es,a3 as Ps,a4 as De,a5 as P,a6 as Re,a7 as oe,a8 as ae,a9 as re,aa as te,ab as zs,ac as Ze,ad as X,ae as Os,af as Us,ag as Ws,ah as Ue,ai as je,aj as Hs,ak as Se,al as ie,am as Ne,an as Te,ao as $s,ap as qs,aq as es,ar as _s,as as Gs,at as Qs,au as Ys,av as ss,aw as ts,ax as xe,ay as ns,az as be,aA as Ks,aB as Me,aC as Js,aD as Xs,aE as Zs,aF as et,aG as st,aH as tt,aI as nt,aJ as lt,aK as ot,aL as at,aM as rt,aN as it,aO as ct}from"./vendor.js";import{_ as G}from"./lodash.js";import{A as de}from"./ag-grid-react.js";import"./ag-grid-community.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function a(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=a(r);fetch(r.href,i)}})();const dt="/assets/Titan.png";function ce(s=[]){return(Array.isArray(s)?s:[s]).map(a=>(delete a["Branch Info"],a))}function ve(s,o,a){return`${s==""?"Uncategorised":s} ${o==""?"Unversioned":o} ${String(a).split("\\").at(-1)}`}function ut(s){return String(s).split("\\").at(-1)}const ht="http://localhost:4000",ft="40px";function ge(s,o="info",a=3e3,n=!1){return{position:"top",variant:"solid",title:n?"Server Notification":"Client Notification",description:s,status:o,duration:a,isClosable:!0}}const ls=t.createContext({socket:null,toast:null,config:null,updateConfig:s=>{},isDebug:!1,setIsDebug:s=>{},configurableRowData:[],setConfigurableRowData:s=>{},branchInfos:{},setBranchInfos:s=>{},branchTableGridRef:null,selectedBranches:[],setSelectedBranches:s=>{},showSelectedBranchesLog:!1,setShowSelectedBranchesLog:s=>{},isCommitMode:!1,setIsCommitMode:s=>{},selectedBranchStatuses:[],setSelectedBranchStatuses:s=>{},localChangesGridRef:null,untrackedChangesGridRef:null,showCommitView:!1,setShowCommitView:s=>{},sourceBranch:null,setSourceBranch:s=>{},branchOptions:[],issueNumber:{},setIssueNumber:s=>{},commitMessage:"",setCommitMessage:s=>{},selectedLocalChanges:[],setSelectedLocalChanges:s=>{},selectedUntrackedChanges:[],setSelectedUntrackedChanges:s=>{},socketPayload:null,setSocketPayload:s=>{},postCommitData:{},setPostCommitData:s=>{},logData:[],setLogData:s=>{}}),V=()=>t.useContext(ls),mt=({children:s})=>{const[o,a]=t.useState(null),[n,r]=t.useState(null),i=hs(),[l,c]=t.useState(()=>localStorage.getItem("isDebug")==="true");t.useEffect(()=>{const w=fs(ht);return r(w),w.on("connect",()=>{w.emit("titan-config-get","fetch"),w.once("titan-config-get",A=>{a(A),A||i(ge("Couldn't load data from the server","error",0))})}),w.on("notification",A=>{i(ge(A.description,A.status,A.duration,!0))}),w.on("disconnect",()=>{i(ge("Server Has Been Disconnected","warning",0,!0))}),w.on("reconnect",()=>{i(ge("Server Has Been Reconnected","success",2e3,!0))}),()=>{w.disconnect()}},[]),t.useEffect(()=>{localStorage.setItem("isDebug",String(l))},[l]);const d=t.useCallback(w=>{w!=null&&(console.debug("Saving config:",w),n==null||n.emit("titan-config-set",w))},[n]),u=t.useCallback(w=>{a(A=>{const M=w(A);return G.isEqual(A,M)?A:(d(M),M)})},[a,d]),[h,p]=t.useState([]),[x,F]=t.useState({}),B=t.useRef(null),[g,m]=t.useState([]),[j,k]=t.useState(!1),[b,S]=t.useState(!1),[D,z]=t.useState([]),H=t.useRef(null),L=t.useRef(null),[N,U]=t.useState(!1),[q,I]=t.useState(null),O=t.useMemo(()=>{let w=o&&o.commitOptions&&o.commitOptions.useFolderOnlySource,A=h.filter(M=>M["Branch Folder"]&&M["Branch Version"]&&M["SVN Branch"]&&M["Branch Folder"]!==""&&M["Branch Version"]!==""&&M["SVN Branch"]!=="");return w&&(A=A.reduce((M,me)=>(M.some(Fe=>Fe["Branch Folder"]===me["Branch Folder"])||M.push(me),M),[])),A.map(M=>({value:M.id,label:w?M["Branch Folder"]:ve(M["Branch Folder"],M["Branch Version"],M["SVN Branch"])}))},[o,g,h]),[W,K]=t.useState({}),[J,ee]=t.useState(""),[se,he]=t.useState([]),[y,f]=t.useState([]),[R,Q]=t.useState(null),[fe,Ee]=t.useState({}),[le,_]=Ae.useState([]);return t.useEffect(()=>{z([]),U(!1)},[h]),t.useEffect(()=>{if(!b||!N)return;const w=setTimeout(()=>{var A;(A=document.getElementById("sectionCommit"))==null||A.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100);return()=>clearTimeout(w)},[b,N]),t.useEffect(()=>{if(g.length<1||N){g.length<1&&S(!1);return}z([]),Q(null),ce(g).forEach(w=>{console.debug("Emitting svn-status-single for branch:",w),n==null||n.emit("svn-status-single",{selectedBranch:w})})},[n,g,N]),t.useEffect(()=>{const w=()=>{U(!1)};return n==null||n.on("branch-refresh-unseen",w),()=>n==null?void 0:n.off("branch-refresh-unseen",w)},[n]),t.useEffect(()=>{const w=A=>{l&&console.debug("Received branch status data:",A),z(M=>[...M,A])};return n==null||n.on("branch-status-single",w),()=>n==null?void 0:n.off("branch-status-single",w)},[n]),t.useEffect(()=>{_([])},[g]),t.useEffect(()=>{le.length===0&&n&&m(w=>(w.length>0&&n.emit("svn-log-selected",{selectedBranches:g}),w))},[le,n]),t.useEffect(()=>{const w=A=>{console.debug("Received svn-log-result from socket in SectionBranchLog component in background"),_(M=>M.some(Fe=>Fe.id===A.id)?M:[...M,A])};return n==null||n.on("svn-log-result",w),()=>n==null?void 0:n.off("svn-log-result",w)},[n]),e.jsx(ls.Provider,{value:{socket:n,toast:i,config:o,updateConfig:u,isDebug:l,setIsDebug:c,configurableRowData:h,setConfigurableRowData:p,branchInfos:x,setBranchInfos:F,branchTableGridRef:B,selectedBranches:g,setSelectedBranches:m,showSelectedBranchesLog:j,setShowSelectedBranchesLog:k,isCommitMode:b,setIsCommitMode:S,selectedBranchStatuses:D,setSelectedBranchStatuses:z,localChangesGridRef:H,untrackedChangesGridRef:L,showCommitView:N,setShowCommitView:U,sourceBranch:q,setSourceBranch:I,branchOptions:O,issueNumber:W,setIssueNumber:K,commitMessage:J,setCommitMessage:ee,selectedLocalChanges:se,setSelectedLocalChanges:he,selectedUntrackedChanges:y,setSelectedUntrackedChanges:f,socketPayload:R,setSocketPayload:Q,postCommitData:fe,setPostCommitData:Ee,logData:le,setLogData:_},children:s})};function ue(){const{socket:s}=V(),o=t.useCallback(()=>{s==null||s.emit("titan-config-open",{})},[s]),a=t.useCallback((u,h,p,x)=>{s==null||s.emit("svn-update-single",{id:u,branch:h,version:p,folder:x})},[s]),n=t.useCallback((u,h,p,x)=>{s==null||s.emit("svn-info-single",{id:u,branch:h,version:p,folder:x})},[s]),r=t.useCallback(u=>{s==null||s.emit("svn-commit",u)},[s]),i=t.useCallback(u=>{s==null||s.emit("svn-files-revert",{filesToProcess:u})},[s]),l=t.useCallback(u=>{s==null||s.emit("svn-files-add-remove",{filesToProcess:u})},[s]),c=t.useCallback((u,h,p,x=null)=>{s==null||s.emit("trello-search-names-card",{key:u,token:h,query:p,limit:x})},[s]),d=t.useCallback((u,h,p,x)=>{s==null||s.emit("trello-update-card",{key:u,token:h,trelloData:p,commitResponses:x})},[s]);return{emitOpenConfig:o,emitUpdateSingle:a,emitInfoSingle:n,emitCommitPayload:r,emitFilesRevert:i,emitFilesAddRemove:l,emitTrelloCardNamesSearch:c,emitTrelloCardUpdate:d}}function ne(){const{toast:s}=V(),o=t.useCallback((a="",n="info",r=3e3,i=null)=>{const l=ge(a,n,r);if(s)return s(l);if(i)return i(l)},[s]);return{toast:s,RaiseClientNotificaiton:o}}function os(s){const{icon:o,onClick:a,colorScheme:n,label:r,size:i}=s,l=t.useCallback(()=>{a&&a()},[a]);return e.jsx(v,{label:window.electron?r:"Feature must be used in desktop application",children:e.jsx($,{"aria-label":r,size:i,icon:o,onClick:l,colorScheme:n,isDisabled:!window.electron})})}function ye(s){const{icon:o,onClick:a,colorScheme:n,label:r,size:i,placement:l,isDisabled:c=!1}=s,d=t.useCallback(()=>{a&&a()},[a]);return r&&l?e.jsx(v,{label:r,hasArrow:!0,placement:l,children:e.jsx($,{"aria-label":r,size:i,icon:o,onClick:d,colorScheme:n,isDisabled:c})}):e.jsx($,{"aria-label":r,size:i,icon:o,onClick:d,colorScheme:n,isDisabled:c})}function gt(){const{config:s,isDebug:o,setIsDebug:a}=V(),{emitOpenConfig:n}=ue(),{RaiseClientNotificaiton:r}=ne(),{colorMode:i,toggleColorMode:l}=qe(),c=t.useCallback(()=>{window.electron&&window.electron.getAppVersion().then(x=>{r(`Application Version: v${x}`,"info",2e3)})},[r]),d=t.useCallback(()=>{window.location.reload()},[]),u=t.useCallback(()=>{window.electron.checkForUpdates().then(x=>{console.debug("Check for updates result: ",x)}),window.electron.on("update-not-available",()=>{r("Titan is up to date","info",3e3),window.electron.removeAllListeners("update-not-available")})},[r]),h=t.useCallback(()=>{n()},[n]),p=t.useCallback(()=>{a(x=>!x)},[a]);return e.jsxs(Le,{my:5,spacingY:5,justify:"space-between",children:[e.jsxs(Pe,{alignItems:"center",children:[e.jsx(_e,{onClick:c,children:e.jsx(ms,{src:dt,alt:"Titan Logo",boxSize:"100px",mr:5,borderRadius:"full"})}),e.jsx(Z,{as:"h2",size:"2xl",noOfLines:1,className:"animation-fadein-forward",children:"Welcome back"}),e.jsx(Z,{as:"h2",size:"2xl",noOfLines:1,p:2,className:"animation-handwave",children:"👋"})]}),e.jsxs(Pe,{alignItems:"center",columnGap:2,children:[e.jsx(ye,{icon:e.jsx(Y,{as:i==="light"?gs:xs}),onClick:l,colorScheme:"yellow",label:"Toggle Light/Dark Mode",placement:"bottom-start",size:"md"}),e.jsx(ye,{icon:e.jsx(Y,{as:bs}),onClick:d,colorScheme:"yellow",label:"Reload",placement:"bottom-start",size:"md"}),e.jsx(os,{icon:e.jsx(Y,{as:ps}),onClick:u,colorScheme:"yellow",label:"Check For Updates",size:"md"}),e.jsx(ye,{icon:e.jsx(Y,{as:Cs}),onClick:h,colorScheme:"yellow",label:"Open Config File",placement:"bottom-start",size:"md"}),e.jsx(ye,{icon:o?e.jsx(Y,{as:js}):e.jsx(Y,{as:ws}),onClick:p,colorScheme:"yellow",label:`Current Debug Mode: ${o?"on":"off"}`,placement:"bottom-start",size:"md"})]})]})}function xt({isAlertOpen:s,onCloseAlert:o,cancelRef:a,removeSelectedRows:n}){return e.jsx(Ge,{isOpen:s,leastDestructiveRef:a,onClose:o,children:e.jsx(pe,{children:e.jsxs(Qe,{children:[e.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:"Delete Selected Rows"}),e.jsx(we,{children:"Are you sure you want to delete the selected rows? This action cannot be undone."}),e.jsxs(ke,{children:[e.jsx(E,{ref:a,onClick:o,children:"Cancel"}),e.jsx(E,{colorScheme:"red",onClick:n,ml:3,children:"Delete"})]})]})})})}function We(){const{innerWidth:s,innerHeight:o}=window;return{width:s,height:o}}function bt(){const[s,o]=t.useState(We());return t.useEffect(()=>{function a(){o(We())}return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),s}function pt({rowData:s,onRowValueChanged:o}){const{config:a,branchTableGridRef:n,updateConfig:r,isDebug:i,selectedBranches:l,setSelectedBranches:c,setSelectedBranchStatuses:d,setShowCommitView:u}=V(),h=bt(),[p,x]=t.useState(h.height>768),F=t.useCallback(b=>{const S={...b,id:String(Date.now()),"Branch Info":"Hasn't been refreshed"};r(D=>({...D,branches:ce([...D.branches,S])}))},[r]),B=t.useCallback(b=>{var D,z,H,L;const S=(z=(D=n==null?void 0:n.current)==null?void 0:D.api)==null?void 0:z.getSelectedNodes().map(N=>N.data);if(i&&console.log("SectionBranches.jsx: onSelectionChanged - event",b),i&&console.log("SectionBranches.jsx: onSelectionChanged - selectedBranches",l),(b==null?void 0:b.source)=="rowDataChanged"){const N=l.map(U=>U.id);(L=(H=n==null?void 0:n.current)==null?void 0:H.api)==null||L.forEachNode(U=>{N.includes(U.data.id)&&U.setSelected(!0)});return}else["api"].includes(b==null?void 0:b.source)||(c(S),d([]),u(!1))},[i,n,l,c,u]),g=t.useCallback(b=>{const S=[];b.api.forEachNode(D=>S.push(D.data)),i&&console.debug("SectionBranches.jsx: onRowDragEnd - movedRowData",S),r(D=>({...D,branches:ce(S)}))},[r,i]),m=t.useCallback(b=>{const S=a==null?void 0:a.branchFolderColours[b.data["Branch Folder"]];return{backgroundColor:S?`${S}20`:"transparent"}},[a==null?void 0:a.branchFolderColours]),j=t.useMemo(()=>({resizable:!0,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!0,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),k=t.useMemo(()=>{const b=[{headerCheckboxSelection:!0,checkboxSelection:!0,headerCheckboxSelectionFilteredOnly:!0,width:25,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"Branch Folder",resizable:!1,width:130,valueFormatter:S=>S.value.toUpperCase()},{field:"Branch Version",resizable:!1,width:130},{field:"SVN Branch",flex:2},{field:"Branch Info",editable:!1,resizable:!1,width:125},{headerName:"",resizable:!0,sortable:!1,filter:!1,editable:!1,cellRenderer:S=>e.jsxs(T,{columnGap:1,children:[e.jsx(os,{icon:e.jsx(ys,{}),onClick:()=>console.warn("Unused button"),colorScheme:"yellow",label:"Script file name",size:"sm"}),e.jsx(v,{label:"Copy Row",hasArrow:!0,children:e.jsx($,{colorScheme:"yellow","aria-label":"Copy Row",size:"sm",onClick:()=>F(S.data),icon:e.jsx(Ie,{})})})]})}];return p?[{field:"",rowDrag:!0,resizable:!1,filter:!1,suppressMovable:!1,editable:!1,width:20,cellRenderer:Ss,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},...b]:b},[a,p,F]);return t.useEffect(()=>{x(h.height>768)},[h]),e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:p?"auto":"428px",width:"100%"},children:e.jsx(de,{ref:n,rowData:s,defaultColDef:j,columnDefs:k,stopEditingWhenCellsLoseFocus:!0,getRowStyle:m,onRowDragEnd:g,domLayout:p?"autoHeight":"normal",suppressRowClickSelection:!0,rowSelection:"multiple",rowMultiSelectWithClick:!0,animateRows:!0,rowDragManaged:!0,onSelectionChanged:B,onRowValueChanged:o,columnMenu:"new",editType:"fullRow",deltaRowDataMode:!0,getRowNodeId:b=>b.id,immutableData:!0,suppressFlash:!0,enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!p,paginationAutoPageSize:!1,paginationPageSizeSelector:!1,paginationPageSize:10})})}function Ct(){const{updateConfig:s,isDebug:o,socket:a,configurableRowData:n,setConfigurableRowData:r,branchInfos:i,config:l,setBranchInfos:c,setSelectedBranches:d,setSelectedBranchStatuses:u,showCommitView:h,setShowCommitView:p}=V(),[x,F]=t.useState([]),B=t.useCallback(g=>{o&&console.log("AG Grid: onRowValueChanged - event",g),o&&console.log("AG Grid: onRowValueChanged - rowDataBranches",x),s(m=>({...m,branches:ce(x)}))},[x,s,o]);return t.useEffect(()=>{const g=G.debounce(()=>{const m=n.map(j=>({...j,"Branch Info":i[j.id]||"Hasn't been refreshed"}));F(j=>G.isEqual(m,j)?j:m)},300);return g(),()=>g.cancel()},[n,i]),t.useEffect(()=>{r(g=>l&&l.branches&&!G.isEqual(l.branches,g)?l.branches:g)},[l]),t.useEffect(()=>{const g=m=>{c(j=>{const k={...j,[m.id]:m.info};return console.debug("branch-info-single data received:",m),console.debug("branch-info-single newBranchInfos",k),d(b=>(b.find(D=>D.id===m.id)&&h&&(u([]),p(!1)),b)),k})};return a==null||a.on("branch-info-single",g),()=>a==null?void 0:a.off("branch-info-single")},[a,h]),{rowDataBranches:x,setRowDataBranches:F,onRowValueChanged:B}}function wt(){const{socket:s,updateConfig:o,isDebug:a,setShowSelectedBranchesLog:n,configurableRowData:r,branchTableGridRef:i,selectedBranches:l,setSelectedBranches:c,isCommitMode:d,setIsCommitMode:u,setSelectedBranchStatuses:h,setShowCommitView:p}=V(),{emitUpdateSingle:x,emitInfoSingle:F}=ue(),{RaiseClientNotificaiton:B}=ne(),[g,m]=t.useState(!1),j=t.useRef(),k=()=>m(!1),{rowDataBranches:b,setRowDataBranches:S,onRowValueChanged:D}=Ct(),[z,H]=t.useState(0),[L,N]=t.useState([]),U=t.useCallback(()=>{var y,f;a&&console.log("SectionBranches.jsx: clearSelection: START"),(f=(y=i==null?void 0:i.current)==null?void 0:y.api)==null||f.deselectAll(),c([]),u(!1)},[a,i,c]),q=t.useCallback(()=>{var f,R;const y=(R=(f=i==null?void 0:i.current)==null?void 0:f.api)==null?void 0:R.getSelectedNodes().map(Q=>Q.data);c(y),m(!0)},[i,c]),I=t.useCallback(()=>{const y={id:String(Date.now()),"Branch Folder":"","Branch Version":"","SVN Branch":"","Branch Info":""};o(f=>({...f,branches:ce([...f.branches,y])}))},[o]),O=t.useCallback(()=>{l.forEach(y=>{x(y.id,y["SVN Branch"],y["Branch Version"],y["Branch Folder"])})},[l,x]),W=t.useCallback(()=>{L.forEach(y=>{x(y.id,y["SVN Branch"],y["Branch Version"],y["Branch Folder"])})},[L,x]),K=t.useCallback(()=>{const y=l.map(R=>R.id),f=b.filter(R=>!y.includes(R.id));console.log("SectionBranches.jsx: removeSelectedRows - updatedData",f),o(R=>({...R,branches:ce(f)})),U(),k()},[l,b,o]),J=t.useCallback(()=>{n(!0)},[]),ee=t.useCallback(()=>{S(y=>{const f=[...y];return l.forEach(R=>{const Q=f.findIndex(fe=>fe.id===R.id);f[Q]["Branch Info"]="Refreshing..."}),f}),l.forEach(y=>{F(y.id,y["SVN Branch"],y["Branch Version"],y["Branch Folder"])})},[l,F]),se=t.useCallback(()=>{if(d)return;B("Refreshing all branches. Please wait until this is done!","info",3e3);const y=Date.now();r.forEach(f=>{F(f.id,f["SVN Branch"],f["Branch Version"],f["Branch Folder"])}),H(y)},[r,F,B,d]),he=t.useCallback(()=>{u(y=>!y),p(!1)},[u]);return t.useEffect(()=>{const y=b.filter(f=>String(f["Branch Info"]).toLowerCase().includes("-"));N(y)},[b]),t.useEffect(()=>{const f=Date.now();if(r.length>0){f-z>3e5&&se();const R=setInterval(()=>{se()},3e5);return()=>clearInterval(R)}},[r,z,se]),t.useEffect(()=>{const y=f=>{a&&console.debug("branch-success-single data received:",f),F(f.id,f.branch,f.version,f.folder)};return s==null||s.on("branch-success-single",y),()=>s==null?void 0:s.off("branch-success-single",y)},[a,s,F]),e.jsxs("div",{children:[e.jsxs(Le,{mb:4,justify:"space-between",children:[e.jsxs(T,{columnGap:2,children:[e.jsx(v,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(E,{onClick:ee,leftIcon:e.jsx(Be,{}),colorScheme:"yellow",isDisabled:l.length<1,children:["Refresh ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(v,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(E,{onClick:O,leftIcon:e.jsx(Y,{as:ks}),colorScheme:"yellow",isDisabled:l.length<1,children:["Update ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(v,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsx(E,{onClick:he,leftIcon:e.jsx(Y,{as:d?Bs:Ye}),colorScheme:"yellow",isDisabled:l.length<1,children:d?"Undo Commit":"Commit"})}),e.jsx(v,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsx(E,{onClick:J,leftIcon:e.jsx(Ds,{}),colorScheme:"yellow",isDisabled:l.length<1,children:"View Logs"})})]}),e.jsx(T,{columnGap:2,children:e.jsx(v,{label:"No outdated branches to update",isDisabled:L.length>0,hasArrow:!0,children:e.jsx(E,{onClick:W,leftIcon:e.jsx(vs,{}),colorScheme:"yellow",isDisabled:L.length<1,children:"Update Outdated"})})})]}),e.jsx(pt,{rowData:b,onRowValueChanged:D}),e.jsxs(T,{columnGap:2,mt:4,children:[e.jsx(v,{label:"Please select at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(E,{onClick:U,leftIcon:e.jsx(Ke,{}),colorScheme:"red",isDisabled:l.length<1,children:["Deselect ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(v,{label:"Please select at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(E,{onClick:q,leftIcon:e.jsx(Fs,{}),colorScheme:"red",isDisabled:l.length<1,children:["Delete ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(E,{onClick:I,leftIcon:e.jsx(Is,{boxSize:8}),colorScheme:"green",children:"New Row"})]}),e.jsx(xt,{isAlertOpen:g,onCloseAlert:k,cancelRef:j,removeSelectedRows:K})]})}function as(s){const{data:o,onDiffResult:a}=s,n=t.useCallback(async()=>{try{const r=await window.electron.openTortoiseSVNDiff({fullPath:o["Full Path"],branchFolder:o["Branch Folder"],branchVersion:o["Branch Version"]});a(r)}catch(r){a({success:!1,error:r.message})}},[o,a]);return e.jsx($,{"aria-label":"Diff",size:"sm",icon:e.jsx(Rs,{}),onClick:n,colorScheme:"yellow"})}function rs(){const{config:s}=V(),{emitTrelloCardNamesSearch:o,emitTrelloCardUpdate:a}=ue(),n=s==null?void 0:s.trelloIntegration,r=(n==null?void 0:n.key)||null,i=(n==null?void 0:n.token)||null,l=r&&i&&r.trim()!==""&&i.trim()!==""&&r.toUpperCase()!=="TRELLO_API_KEY"&&i.toUpperCase!=="TRELLO_TOKEN";return{key:r,token:i,isTrelloIntegrationEnabled:l,emitTrelloCardNamesSearch:o,emitTrelloCardUpdate:a}}function jt({isModalOpen:s,closeModal:o}){const{socket:a,setIsCommitMode:n,setSelectedBranchStatuses:r,setShowCommitView:i,socketPayload:l,postCommitData:c,setPostCommitData:d}=V(),{emitUpdateSingle:u,emitCommitPayload:h}=ue(),{key:p,token:x,isTrelloIntegrationEnabled:F,emitTrelloCardUpdate:B}=rs(),{RaiseClientNotificaiton:g}=ne(),[m,j]=t.useState([]),{onCopy:k,value:b,setValue:S,hasCopied:D}=ze(""),{onCopy:z,value:H,setValue:L,hasCopied:N}=ze(""),U=t.useCallback(f=>{f.success?g("TortoiseSVN diff opened successfully","success",3e3):g(`Error opening TortoiseSVN diff: ${JSON.stringify(f.error,null,4)}`,"error",0)},[g]),q=[{title:"Review",description:"Confirm SVN changes"},{title:"Commit",description:"Commit changes"},{title:"Complete",description:"Process Completed"}],{activeStep:I,setActiveStep:O}=Ns({index:1,count:q.length}),W=t.useMemo(()=>({resizable:!1,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),K=t.useMemo(()=>[{field:"Branch Folder"},{field:"Branch Version",sort:"asc"},{field:"File Path",flex:1},{field:"Local Status",headerTooltip:"Working Copy"},{headerName:"Diff",filter:!1,sortable:!1,cellRenderer:as,cellRendererParams:{onDiffResult:U},width:90}],[]),J=t.useCallback((f,R=!0)=>{const Q="​".repeat(7),fe=f.includes("MarkupSupport")?`\r -${Q}`:`\r -`,le=m.sort((_,w)=>_["Branch Version"].localeCompare(w["Branch Version"])).map(_=>{const w=[];f.includes("BranchFolder")&&w.push(_["Branch Folder"]),f.includes("BranchVersion")&&w.push(_["Branch Version"]),f.includes("SVNBranch")&&w.push(_.branchPathFolder);let A=w.join(" ").trim();if(f.includes("IssueNumber")){const me=_.branchIssueNumber;A+=` Issue [${me}]`}const M=_.revision?_.revision:_.errorMessage||"Error";return A+=` Revision [${M}]`,A});return R?le.join(fe):le},[m,l]),ee=t.useCallback(f=>{const R=J(f);S(R)},[J,S]),se=t.useCallback(()=>{O(f=>f-1)},[O]),he=t.useCallback(()=>{if(c.type!=="trello"){g("Trello Autofill is not enabled for this commit","error");return}const f=c.data,R=J(["BranchFolder","BranchVersion","IssueNumber"],!1);B(p,x,f,R),g("Updating Trello card with commit information","info"),d(null)},[c,g,J]),y=t.useCallback(()=>{O(f=>{switch(f){case 1:h(l);case 2:S(""),L("");break;case 3:return k(),g("Updating selected branches! Please wait","info",1500),m.forEach(R=>{u(R.branchId,R["SVN Branch"],R["Branch Version"],R["Branch Folder"])}),n(!1),r([]),i(!1),o(),1}return f+1})},[O,h,l,S,L,k,g,m,u,n,r,i,o]);return t.useEffect(()=>{O(1),j([]),S(""),L("")},[s,j]),t.useEffect(()=>{!s||I!=0||(o(),O(1),j([]),S(""),L(""))},[I,s]),t.useEffect(()=>{!s||I!=3||(g("The commit process has been completed successfully","success",5e3),ee(["BranchFolder","BranchVersion","SVNBranch"]),L(l.commitMessage||""))},[g,I,s,ee]),t.useEffect(()=>{const f=R=>{j(Q=>[...Q,R])};return a==null||a.on("svn-commit-status-live",f),()=>a==null?void 0:a.off("svn-commit-status-live",f)},[a]),t.useEffect(()=>{if(I!=2)return;const f=setTimeout(()=>{m.length>0&&m[0].bulkCommitLength==m.length&&O(3)},3e3);return()=>clearTimeout(f)},[I,m]),t.useEffect(()=>{(D||N)&&g("Copied to Clipboard","success",1500)},[D,N,g]),!s||!l?e.jsx(e.Fragment,{}):e.jsxs(Je,{isOpen:s,onClose:o,isCentered:!0,motionPreset:"slideInBottom",scrollBehavior:"inside",size:"xl",closeOnOverlayClick:I==1,children:[e.jsx(pe,{}),e.jsxs(Xe,{maxH:"85%",maxW:"95%",children:[e.jsxs(Ce,{display:"flex",justifyContent:"space-between",maxWidth:I==1?"94%":"100%",children:[e.jsx(Z,{as:"h2",size:"lg",children:"Commit Selected Files"}),e.jsx(Ts,{index:I-1,mb:0,size:"sm",colorScheme:"yellow",children:q.map((f,R)=>e.jsxs(Ms,{children:[e.jsx(As,{children:e.jsx(Ls,{complete:e.jsx(Vs,{}),incomplete:e.jsx(Oe,{}),active:e.jsx(Oe,{})})}),e.jsx(C,{flexShrink:"0",children:e.jsx(Es,{children:f.title})}),e.jsx(Ps,{})]},R))})]}),I==1?e.jsx(De,{size:"lg",py:6}):e.jsx(e.Fragment,{}),e.jsx(we,{children:e.jsxs(C,{children:[I!=1?e.jsx(e.Fragment,{}):e.jsxs(C,{children:[e.jsxs(C,{mb:4,children:[e.jsx(P,{fontWeight:600,children:"Please confirm that the following information is correct before proceeding to commit your files:"}),e.jsxs(Re,{spacing:3,children:[e.jsxs(oe,{children:[e.jsx(ae,{as:re,color:"yellow.500"}),"Source Branch: ",e.jsx(te,{children:ve(l.sourceBranch["Branch Folder"],l.sourceBranch["Branch Version"],l.sourceBranch["SVN Branch"])})]}),e.jsxs(oe,{children:[e.jsx(ae,{as:re,color:"yellow.500"}),"Issue Numbers: ",e.jsx(te,{children:Object.entries(l.issueNumber).map(f=>`${f[1]} (${f[0]})`).join(", ")})]}),e.jsxs(oe,{children:[e.jsx(ae,{as:re,color:"yellow.500"}),"Commit Message: ",e.jsx(te,{children:l.commitMessage})]}),e.jsxs(oe,{children:[e.jsx(ae,{as:re,color:"yellow.500"}),"Example:"," ",e.jsxs(te,{children:["Issue ",l.issueNumber[l.sourceBranch["Branch Folder"]]," (",l.sourceBranch["Branch Folder"]," ",l.sourceBranch["Branch Version"],"): ",l.commitMessage]})]})]})]}),e.jsx(C,{children:e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"350px",width:"100%"},children:e.jsx(de,{rowData:l.filesToProcess,defaultColDef:W,columnDefs:K,domLayout:"normal",columnMenu:"new",pagination:!0,paginationAutoPageSize:!0})})})]}),I!=2?e.jsx(e.Fragment,{}):e.jsxs(C,{children:[e.jsxs(P,{fontWeight:600,children:["Please wait while the files are being committed to the SVN repository.",e.jsx("br",{}),"Current live status of the commit process:"]}),e.jsx(C,{children:e.jsx(Re,{spacing:3,children:m.map((f,R)=>e.jsxs(oe,{children:[e.jsx(ae,{as:f.errorMessage?zs:re,color:f.errorMessage?"red.500":"yellow.500"}),f.branchString,": ",e.jsx(te,{children:f.errorMessage||f.revision})]},R))})})]}),I!=3?e.jsx(e.Fragment,{}):e.jsxs(C,{children:[e.jsx(C,{mb:4,children:e.jsxs(P,{fontWeight:600,children:["The commit process has been completed successfully.",e.jsx("br",{}),"Please find your revisions here for view and copy:"]})}),e.jsxs(T,{columnGap:10,alignItems:"center",children:[e.jsxs(C,{children:[e.jsx(Z,{as:"h3",size:"md",children:"SVN Revisions"}),e.jsx(C,{children:e.jsx("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word"},children:b})})]}),e.jsx(C,{children:e.jsx(v,{hasArrow:!0,label:"Copy to clipboard",children:e.jsx($,{"aria-label":"Copy To Clipboard",onClick:k,icon:e.jsx(Ie,{}),colorScheme:"yellow"})})})]}),e.jsxs(C,{my:4,children:[e.jsx(P,{fontWeight:600,children:"Modify the clipboard text to include..."}),e.jsx(Ze,{colorScheme:"yellow",defaultValue:["BranchFolder","BranchVersion"],onChange:ee,children:e.jsxs(Le,{children:[e.jsx(X,{value:"BranchFolder",children:"Branch Folder"}),e.jsx(X,{value:"BranchVersion",children:"Branch Version"}),e.jsx(X,{value:"SVNBranch",children:"SVN Branch"}),e.jsx(X,{value:"IssueNumber",children:"Issue Number"}),e.jsx(X,{value:"MarkupSupport",children:"Markup Support"})]})})]}),e.jsxs(T,{columnGap:10,alignItems:"center",children:[e.jsxs(C,{children:[e.jsx(P,{fontWeight:600,children:"Here is your SVN commit message for the source branch:"}),l.sourceBranch&&l.sourceBranch["Branch Folder"]&&l.sourceBranch["Branch Version"]?e.jsx(te,{children:`Issue ${l.issueNumber[l.sourceBranch["Branch Folder"]]} (${l.sourceBranch["Branch Folder"]} ${l.sourceBranch["Branch Version"]}): ${H}`}):e.jsx(te,{children:"Source information is undefined. Please check that you have entered the correct details otherwise contact the developer!"})]}),e.jsx(v,{hasArrow:!0,label:"Copy to clipboard",children:e.jsx($,{"aria-label":"Copy To Clipboard",onClick:z,icon:e.jsx(Ie,{}),colorScheme:"yellow"})})]})]})]})}),e.jsx(ke,{children:e.jsxs(T,{flex:1,justifyContent:"space-between",children:[e.jsx(T,{columnGap:2,children:e.jsx(v,{hasArrow:!0,label:"Cannot undo the commit currently",isDisabled:I<2,children:e.jsx(E,{onClick:se,mr:3,isDisabled:I>=2,children:I==1?"Cancel":"Previous"})})}),e.jsxs(T,{columnGap:2,children:[e.jsx(v,{hasArrow:!0,label:"Requires Trello Autofill",isDisabled:(c==null?void 0:c.type)==="trello"&&F,children:e.jsx(E,{colorScheme:"yellow",leftIcon:e.jsx(Y,{as:Os}),onClick:he,isDisabled:I<3||(c==null?void 0:c.type)!="trello"||!F,children:"Update Card"})}),e.jsx(v,{hasArrow:!0,label:"Cannot undo the commit currently",isDisabled:I!=2,children:e.jsx(E,{colorScheme:"yellow",onClick:y,isDisabled:I==2,children:I==q.length?"Complete":"Next"})})]})]})})]})]})}function St({fileUpdates:s}){return e.jsx(C,{children:Object.keys(s).length>0?e.jsxs(C,{children:[e.jsx(P,{mb:4,children:"Below are the list of files which have been changed on your machine but there exists a newer version of them in the repository:"}),e.jsx(C,{maxHeight:"200px",overflowY:"auto",children:e.jsxs(Us,{children:[e.jsx(Ws,{children:e.jsxs(Ue,{children:[e.jsx(je,{children:"Branch"}),e.jsx(je,{children:"Path"}),e.jsx(je,{children:e.jsx(v,{label:"Working Copy",hasArrow:!0,children:"Local Status"})}),e.jsx(je,{children:e.jsx(v,{label:"Repository",hasArrow:!0,children:"Remote Status"})})]})}),e.jsx(Hs,{children:Object.keys(s).map(o=>e.jsx(Ae.Fragment,{children:s[o].map((a,n)=>e.jsxs(Ue,{children:[e.jsx(Se,{children:o}),e.jsx(Se,{children:a.pathDisplay}),e.jsx(Se,{children:a.wcStatus}),e.jsx(Se,{children:a.reposStatus})]},n))},o))})]})}),e.jsx(P,{mt:4,children:"If you wish to commit these files, please update the associated branches!"})]}):e.jsx(C,{children:e.jsx(P,{children:"Your selected branches do not contain any changed files for which a newer version exists in the repository."})})})}function yt({rowDataLocalChanges:s,setRowDataLocalChanges:o,defaultColDefsCommit:a}){const{localChangesGridRef:n,isDebug:r,selectedBranches:i,showCommitView:l,setSelectedLocalChanges:c,selectedLocalChanges:d}=V(),{emitFilesRevert:u}=ue(),{RaiseClientNotificaiton:h}=ne(),[p,x]=t.useState(""),F=t.useCallback(()=>{u(d)},[u,d]),B=t.useCallback(k=>{x(k.target.value)},[x]),g=t.useCallback(k=>{var D,z,H,L;if(console.debug("PanelLocalChanges.jsx: onFileViewSelectionChanged - event",k),String(k==null?void 0:k.source).toLowerCase().includes("api"))return;let b=(z=(D=n==null?void 0:n.current)==null?void 0:D.api)==null?void 0:z.getSelectedNodes().map(N=>N.data);r&&console.debug("PanelLocalChanges.jsx: onFileViewSelectionChanged - selectedBranches",b);const S=b.filter(N=>N["Local Status"].toLowerCase()==="added");(L=(H=n==null?void 0:n.current)==null?void 0:H.api)==null||L.forEachNode(N=>{S.some(q=>q["File Path"].includes(N.data["File Path"])&&q["File Path"]!==N.data["File Path"])&&N.data["Local Status"].toLowerCase()==="added"&&!N.isSelected()&&(N.setSelected(!0),b.push(N.data),console.debug("PanelLocalChanges.jsx (onFileViewSelectionChanged): Adding ancestor node: ",N))}),c(b)},[n,r,c]),m=t.useCallback(k=>{k.success?h("TortoiseSVN diff opened successfully","success",3e3):h(`Error opening TortoiseSVN diff: ${JSON.stringify(k.error,null,4)}`,"error",0)},[h]),j=t.useMemo(()=>[{headerCheckboxSelection:!0,checkboxSelection:!0,headerCheckboxSelectionFilteredOnly:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"Branch Folder"},{field:"Branch Version",sort:"asc",sortIndex:0},{field:"File Path",flex:1,sort:"asc",sortIndex:2},{field:"Local Status",headerTooltip:"Working Copy",sort:"asc",sortIndex:1},{headerName:"Diff",filter:!1,sortable:!1,resizable:!1,cellRenderer:as,cellRendererParams:{onDiffResult:m},width:90}],[]);return t.useEffect(()=>{i.length<1||l||(x(""),o([]),c([]))},[i,l]),e.jsx(C,{children:s.length>0?e.jsxs(C,{children:[e.jsxs(T,{mb:4,alignItems:"center",children:[e.jsx(P,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(ie,{placeholder:"Type to search...",onInput:B,width:"100%"})]}),e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"480px",width:"100%"},children:e.jsx(de,{ref:n,rowData:s,defaultColDef:a,columnDefs:j,onSelectionChanged:g,quickFilterText:p,domLayout:"normal",rowSelection:"multiple",suppressRowClickSelection:!0,rowMultiSelectWithClick:!0,animateRows:!0,columnMenu:"new",enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!0,paginationAutoPageSize:!0})}),e.jsx(T,{mt:4,columnGap:2,justifyContent:"flex-end",children:e.jsx(v,{label:"Requires you to select at least 1 file",hasArrow:!0,isDisabled:d.length>0,children:e.jsx(E,{onClick:F,colorScheme:"red",isDisabled:d.length<1,children:"Revert Selected"})})})]}):e.jsx(C,{children:e.jsx(P,{children:"Your selected branches do not contain any files to commit."})})})}function kt({rowDataUntrackedChanges:s,setRowDataUntrackedChanges:o,defaultColDefsCommit:a}){const{untrackedChangesGridRef:n,selectedUntrackedChanges:r,setSelectedUntrackedChanges:i,isDebug:l,selectedBranches:c,showCommitView:d}=V(),{emitFilesAddRemove:u,emitFilesRevert:h}=ue(),[p,x]=t.useState(""),F=t.useCallback(k=>{x(k.target.value)},[x]),B=t.useCallback(()=>{var b,S;const k=(S=(b=n==null?void 0:n.current)==null?void 0:b.api)==null?void 0:S.getSelectedNodes().map(D=>D.data);l&&console.debug("PanelUntrackedChanges.jsx (onUnseenFilesSelectionChanged): selectedBranches",k),i(k)},[n,l]),g=t.useCallback(()=>{u(r)},[u,r]),m=t.useCallback(()=>{h(r)},[h,r]),j=t.useMemo(()=>[{headerCheckboxSelection:!0,checkboxSelection:!0,headerCheckboxSelectionFilteredOnly:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"Branch Folder"},{field:"Branch Version",sort:"asc",sortIndex:0},{field:"File Path",flex:1,sort:"asc",sortIndex:1},{field:"Local Status",headerTooltip:"Working Copy"}],[]);return t.useEffect(()=>{c.length<1||d||(x(""),o([]),i([]))},[c,d]),e.jsx(C,{children:s.length>0?e.jsxs(C,{children:[e.jsx(P,{mb:4,children:"Below are the list of files which are either unversioned or missing in the repository:"}),e.jsxs(T,{mb:4,alignItems:"center",children:[e.jsx(P,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(ie,{placeholder:"Type to search...",onInput:F,width:"100%"})]}),e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"390px",width:"100%"},children:e.jsx(de,{ref:n,rowData:s,defaultColDef:a,columnDefs:j,onSelectionChanged:B,quickFilterText:p,domLayout:"normal",rowSelection:"multiple",rowMultiSelectWithClick:!0,animateRows:!0,columnMenu:"new",enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!0,paginationAutoPageSize:!0})}),e.jsxs(T,{mt:4,columnGap:2,justifyContent:"flex-end",children:[e.jsx(v,{label:"Requires you to select at least 1 file",hasArrow:!0,isDisabled:r.length>0,children:e.jsxs(E,{onClick:g,colorScheme:"green",isDisabled:r.length<1,children:["Add/Remove ",r.length," File",r.length>1?"s":""]})}),e.jsx(v,{label:"Requires you to select at least 1 file",hasArrow:!0,isDisabled:r.length>0,children:e.jsxs(E,{onClick:m,colorScheme:"red",isDisabled:r.length<1,children:["Revert ",r.length," File",r.length>1?"s":""]})})]})]}):e.jsx(C,{children:e.jsx(P,{children:"Your selected branches do not contain any unversioned or missing files."})})})}function Ve(){const{config:s}=V();return s&&s.commitOptions?s.commitOptions:null}function He({branchFolder:s}){const{issueNumber:o,setIssueNumber:a,selectedBranches:n}=V(),r=Ve(),i=t.useCallback(d=>{const u=String(d.target.value||"").trim();/^\d*$/.test(u)&&a(h=>({...h,[s]:u}))},[s,a]),l=!s,c=!s||!(r!=null&&r.useIssuePerFolder)?!0:n==null?void 0:n.map(d=>d["Branch Folder"]).includes(s);return t.useEffect(()=>(s&&a(d=>({...d,[s]:""})),()=>{s&&Object.keys(o).includes(s)&&a(d=>G.omit(d,[s]))}),[s,a]),e.jsx(v,{label:"Please select source branch first!",isDisabled:!l,hasArrow:!0,children:e.jsxs(Ne,{isDisabled:l,isRequired:c,children:[e.jsx(Te,{children:s?`Issue Number For ${s}`:"Issue Number"}),e.jsx(ie,{value:o[s]||"",onInput:i,placeholder:"Enter number"})]},s)})}function is(){const{configurableRowData:s,sourceBranch:o,selectedBranches:a}=V(),n=t.useCallback(c=>s&&s.length>0?s.find(d=>d.id==c)["Branch Folder"]:"",[s]),r=t.useMemo(()=>{if(!(o!=null&&o.value))return[];const c=n(o.value);return[...new Set(a.filter(d=>d["Branch Folder"]!==c).map(d=>d["Branch Folder"]))]},[o,a,n]),i=t.useCallback(c=>s&&s.length>0?s.find(d=>d.id==c)["Branch Version"]:"",[s]),l=t.useCallback(c=>s&&s.length>0?s.find(d=>d.id==c)["SVN Branch"]:"",[s]);return{getBranchFolderById:n,selectedBranchFolders:r,getBranchVersionById:i,getSvnBranchById:l}}function Bt({openMessageAutoFillModal:s}){const{sourceBranch:o,setSourceBranch:a,branchOptions:n,setIssueNumber:r,commitMessage:i,setCommitMessage:l,isCommitMode:c,selectedBranches:d}=V(),u=Ve(),{getBranchFolderById:h,selectedBranchFolders:p}=is(),x=t.useCallback(B=>{a(B)},[a]),F=t.useCallback(B=>{l(String(B.target.value).replace(/["`]/g,"'"))},[l]);return t.useEffect(()=>{c&&(a(null),r({}))},[c]),t.useEffect(()=>{u!=null&&u.reusePreviousCommitMessage||l("")},[u==null?void 0:u.reusePreviousCommitMessage,l,c]),t.useEffect(()=>{r(B=>Object.fromEntries(Object.entries(B).filter(([g])=>d.some(m=>m["Branch Folder"]===g))))},[d]),e.jsx(C,{children:e.jsxs(T,{columnGap:3,children:[e.jsxs(C,{flexGrow:1,children:[e.jsxs(T,{columnGap:2,mb:2,children:[e.jsx(C,{width:"50%",children:e.jsxs(Ne,{isRequired:!0,children:[e.jsx(Te,{children:"Source Branch"}),e.jsx($s,{value:o,onChange:x,options:n,placeholder:"SVN Branch you're commiting from",selectedOptionStyle:"check",selectedOptionColorScheme:"yellow",isClearable:!0,classNamePrefix:"chakra-react-select"})]})}),e.jsx(T,{width:"50%",alignItems:"flex-end",columnGap:2,children:e.jsx(He,{branchFolder:o&&o.value?h(o.value):null})})]}),e.jsxs(T,{columnGap:2,height:"auto",children:[e.jsxs(Ne,{width:u!=null&&u.useIssuePerFolder?"50%":"100%",isRequired:!0,children:[e.jsx(Te,{children:"Commit Message"}),e.jsx(qs,{placeholder:"Enter Commit Message",height:"76%",resize:"none",onInput:F,value:i})]}),u!=null&&u.useIssuePerFolder?o!=null&&o.value?e.jsx(T,{width:"50%",flexDir:"column",rowGap:2,children:p.map(B=>e.jsx(He,{branchFolder:B},B))}):e.jsx(C,{width:"50%",textAlign:"center",m:"auto",children:e.jsx(P,{fontSize:"lg",fontWeight:"600",color:"yellow.500",children:"Please select source branch first!"})}):null]})]}),e.jsx(C,{pt:8,children:e.jsx(v,{label:o!=null&&o.value?"Auto Fill Message":"Please select source branch first!",hasArrow:!0,placement:"bottom-end",children:e.jsx($,{colorScheme:"yellow","aria-label":"Auto Fill Message",size:"md",onClick:()=>s(),icon:e.jsx(es,{}),isDisabled:!(o!=null&&o.value)})})})]})})}function Dt({openCommitModal:s}){const{setShowCommitView:o,selectedLocalChanges:a,sourceBranch:n,issueNumber:r,commitMessage:i,setSocketPayload:l,configurableRowData:c,selectedBranches:d}=V(),{RaiseClientNotificaiton:u}=ne(),h=Ve(),{selectedBranchFolders:p}=is(),x=t.useCallback(()=>{o(!1)},[o]),F=t.useCallback(()=>{if(!n||n.value===""){u("Please select the source branch to proceed!","error");return}const B=c.find(j=>j.id==n.value),g=h!=null&&h.useIssuePerFolder?p.every(j=>r[j]&&r[j]!==""):!0,m=h!=null&&h.useIssuePerFolder&&!d.some(j=>j["Branch Folder"]===B["Branch Folder"])||r[B["Branch Folder"]];if(!r||G.isEmpty(r)||!g||!m){u("Please provide the issue number to proceed!","error");return}if(!i||i.trim()===""){u("Please provide the commit message to proceed!","error");return}l({sourceBranch:B,issueNumber:r,commitMessage:i,filesToProcess:a,commitOptions:h}),s()},[u,n,c,h,p,r,d,i,a]);return e.jsx(C,{children:e.jsxs(T,{columnGap:2,justifyContent:"center",children:[e.jsx(E,{onClick:x,leftIcon:e.jsx(Be,{}),colorScheme:"yellow",children:"Refresh Process"}),e.jsx(v,{label:"Select at least 1 file",hasArrow:!0,isDisabled:a.length>0,children:e.jsxs(E,{onClick:F,leftIcon:e.jsx(Y,{as:Ye}),colorScheme:"yellow",isDisabled:a.length<1,children:["Commit ",a.length>0?`${a.length} File`:"",a.length>1?"s":""]})})]})})}function vt(){const{selectedBranches:s,logData:o,setLogData:a}=V(),[n,r]=t.useState([]),[i,l]=t.useState(""),c=t.useCallback(h=>{l(h.target.value)},[l]),d=t.useCallback(()=>{a([])},[a]),u=o.length===s.length;return t.useEffect(()=>{if(o.length===0)return;const h=o.map(p=>p.logs).flat();r(p=>G.isEqual(p,h)?p:h)},[o]),{rowDataLogs:n,quickFilterLogsText:i,setQuickFilterLogsText:l,onQuickFilterLogsInputChanged:c,refreshLogs:d,areLogsFetched:u}}function Ft({rowDataLogs:s,quickFilterLogsText:o,setAutoFillSelection:a=null,isAutofill:n=!1}){const r=t.useMemo(()=>({sortable:!0,resizable:!1,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),i=t.useMemo(()=>{const d=[{field:"revision",headerName:"Revision",sort:"desc",width:130},{field:"date",headerName:"Date",sortable:!1},{field:"branchFolder",headerName:"Branch Folder",width:135},{field:"branchVersion",headerName:"Branch Version",width:125},{field:"author",headerName:"Author"},{field:"message",headerName:"Message",flex:1}];return n?[{checkboxSelection:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},...d]:d},[n]),l=t.useRef(null),c=t.useCallback(()=>{var d,u;if(a){const h=(u=(d=l==null?void 0:l.current)==null?void 0:d.api)==null?void 0:u.getSelectedNodes().map(p=>p.data);a(h[0]||null)}},[a]);return e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:n?"90%":"85%",width:"100%"},children:e.jsx(de,{ref:l,rowData:s,defaultColDef:r,columnDefs:i,onSelectionChanged:c,quickFilterText:o,domLayout:"normal",columnMenu:"new",rowSelection:"single",suppressRowClickSelection:!n,animateRows:!1,immutableData:!0,suppressFlash:!0,enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!0,paginationAutoPageSize:!0})})}function cs({setAutoFillSelection:s=!1,isAutofill:o=!1}){const{selectedBranches:a,logData:n}=V(),{rowDataLogs:r,quickFilterLogsText:i,onQuickFilterLogsInputChanged:l,refreshLogs:c,areLogsFetched:d}=vt();return d?e.jsxs(C,{h:"100%",children:[e.jsxs(T,{mb:4,width:"100%",alignItems:"center",columnGap:4,children:[e.jsxs(T,{alignItems:"center",width:"100%",children:[e.jsx(P,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(ie,{placeholder:"Type to search...",onInput:l,width:"100%"})]}),e.jsx(C,{children:e.jsx(v,{label:"Refresh",hasArrow:!0,children:e.jsx($,{onClick:c,icon:e.jsx(Be,{}),colorScheme:"yellow","aria-label":"Refresh"})})})]}),e.jsx(Ft,{rowDataLogs:r,quickFilterLogsText:i,setAutoFillSelection:s,isAutofill:o})]}):e.jsxs(C,{children:[e.jsxs(C,{mb:4,children:[e.jsx(P,{fontWeight:600,children:"Showing SVN Log for the following branches:"}),e.jsx(Re,{spacing:3,children:a.map(u=>{const h=n.find(p=>p.id===u.id);return e.jsxs(oe,{display:"flex",alignItems:"center",children:[e.jsx(ae,{w:30,h:30,as:h?re:_s,color:"yellow.500"}),ve(u["Branch Folder"],u["Branch Version"],u["SVN Branch"])]},u.branchId)})})]}),e.jsx(T,{justifyContent:"center",children:e.jsx(Gs,{value:n.length/a.length*360,color:"yellow.300",size:"100px",children:e.jsxs(Qs,{children:[n.length," / ",a.length]})})})]})}function It(s){const{data:o}=s,a=async()=>{window.open(o.url,"_blank")};return e.jsx($,{"aria-label":"Diff",size:"sm",icon:e.jsx(Ys,{}),onClick:a,colorScheme:"yellow"})}function Rt({rowDataTrello:s,quickFilterTrelloText:o,setAutoFillSelection:a}){const n=t.useMemo(()=>({sortable:!0,resizable:!1,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),r=t.useMemo(()=>[{checkboxSelection:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"name",headerName:"Name",flex:1},{field:"lastActivityDate",headerName:"Last Activity Date"},{field:"url",headerName:"Goto Trello",filter:!1,sortable:!1,resizable:!1,cellRenderer:It,width:120}],[]),i=t.useRef(null),l=t.useCallback(()=>{var d,u;const c=(u=(d=i==null?void 0:i.current)==null?void 0:d.api)==null?void 0:u.getSelectedNodes().map(h=>h.data);a(c[0]||null)},[a]);return e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"80%",width:"100%"},children:e.jsx(de,{ref:i,rowData:s,defaultColDef:n,columnDefs:r,onSelectionChanged:l,quickFilterText:o,domLayout:"normal",columnMenu:"new",rowSelection:"single",suppressRowClickSelection:!1,animateRows:!1,enableCellTextSelection:!0,pagination:!0,paginationAutoPageSize:!0})})}function Nt({setAutoFillSelection:s}){const{socket:o}=V(),{key:a,token:n,isTrelloIntegrationEnabled:r,emitTrelloCardNamesSearch:i}=rs(),[l,c]=t.useState(""),[d,u]=t.useState(""),[h,p]=t.useState([]),x=t.useCallback(G.debounce(m=>{m.trim()!==""&&i(a,n,m)},400),[a,n,i]),F=t.useCallback(m=>{c(String(m.target.value).trim())},[c]),B=t.useCallback(()=>{l.trim()!==""&&i(a,n,l)},[l,a,n,i]),g=t.useCallback(m=>{u(m.target.value)},[]);return t.useEffect(()=>(x(l),()=>x.cancel()),[l,x]),t.useEffect(()=>{const m=j=>{p(j&&j.length>0?j:[])};return o==null||o.on("trello-result-search-names-card",m),()=>o==null?void 0:o.off("trello-result-search-names-card",m)},[o]),r?e.jsxs(C,{h:"100%",children:[e.jsxs(T,{mb:4,width:"100%",alignItems:"center",columnGap:4,children:[e.jsxs(T,{alignItems:"center",width:"100%",children:[e.jsx(P,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Trello Query:"}),e.jsx(ie,{placeholder:"Type to search...",onInput:F,width:"100%"})]}),e.jsx(C,{children:e.jsx(v,{label:"Resubmit Query",hasArrow:!0,children:e.jsx($,{onClick:B,icon:e.jsx(Be,{}),colorScheme:"yellow","aria-label":"Resubmit"})})})]}),e.jsx(T,{mb:4,width:"100%",alignItems:"center",columnGap:4,children:e.jsxs(T,{alignItems:"center",width:"100%",children:[e.jsx(P,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(ie,{placeholder:"Type to search...",onInput:g,width:"100%"})]})}),e.jsx(Rt,{rowDataTrello:h,quickFilterTrelloText:d,setAutoFillSelection:s})]}):e.jsx(C,{h:"100%",p:4,children:e.jsxs(P,{fontSize:"lg",fontWeight:"600",color:"red.500",children:["You need to"," ",e.jsxs(_e,{href:"https://help.merge.dev/en/articles/8757597-trello-how-do-i-link-my-account",isExternal:!0,color:"yellow.500",children:["set up Trello Integration ",e.jsx(es,{mx:"2px"})]})," ","in the configuration file to use this feature."]})})}function Tt({isModalOpen:s,closeModal:o}){const{setIssueNumber:a,setCommitMessage:n,setPostCommitData:r}=V(),[i,l]=t.useState(0),[c,d]=t.useState([null,null]),[u,h]=t.useState(!0),p=t.useCallback(g=>{l(g),d(g===0?m=>[m[0],null]:m=>[null,m[1]])},[l]),x=t.useCallback(g=>{d(m=>[g,...m.slice(1)])},[d]),F=t.useCallback(g=>{d(m=>[m[0],g])},[d]),B=t.useCallback(()=>{console.debug("Selected tab index:",i),console.debug("Selected autofill selection:",JSON.stringify(c,null,4));let g=c[i];if(i===0){const m=g.message,j=m.match(/\s*(Issue)*\s*(\d+)\s*/),k=j?j[2]:null,b=m.replace(/\s*(Issue)*\s*(\d+)?\s*(\([^\)]+\))*\s?:?\s*/,"");k&&a(S=>Object.fromEntries(Object.keys(S).map(D=>[D,k]))),b.trim()!==""&&n(b)}else{const m=g.name,j=m.match(/\s*(Issue)*\s*(\d+)\s*/),k=j?j[2]:null,b=m.replace(/\s*(Issue)*\s*(\d+)/,"");k&&a(S=>Object.fromEntries(Object.keys(S).map(D=>[D,k]))),b.trim()!==""&&n(b),r({type:"trello",data:g})}o()},[i,c,a,n,r,o]);return t.useEffect(()=>{h(!(c.length==2&&(c[0]||c[1])))},[c]),t.useEffect(()=>{d([null,null]),l(0)},[s]),e.jsxs(Je,{isOpen:s,onClose:o,isCentered:!0,motionPreset:"slideInBottom",scrollBehavior:"inside",size:"xl",closeOnOverlayClick:!0,children:[e.jsx(pe,{}),e.jsxs(Xe,{maxH:"95%",maxW:"95%",children:[e.jsx(Ce,{children:e.jsx(Z,{as:"h2",size:"lg",children:"Autofill Commit Message"})}),e.jsx(De,{size:"lg"}),e.jsx(we,{children:e.jsx(C,{height:"70vh",children:e.jsxs(ss,{variant:"solid-rounded",colorScheme:"yellow",defaultIndex:0,isLazy:!0,h:"100%",onChange:g=>p(g),children:[e.jsxs(ts,{children:[e.jsx(xe,{children:"SVN Logs"}),e.jsx(xe,{children:"Trello"})]}),e.jsxs(ns,{h:"90%",children:[e.jsx(be,{px:0,pb:0,h:"100%",children:e.jsx(cs,{setAutoFillSelection:x,isAutofill:!0})}),e.jsx(be,{px:0,pb:0,h:"100%",children:e.jsx(Nt,{setAutoFillSelection:F})})]})]})})}),e.jsxs(ke,{children:[e.jsx(E,{mr:3,onClick:()=>o(),children:"Cancel"}),e.jsx(v,{hasArrow:!0,label:"Please select exactly one row!",placement:"top-start",isDisabled:!u,children:e.jsx(E,{colorScheme:"yellow",onClick:B,isDisabled:u,children:"Select"})})]})]})]})}function Mt(){const{config:s,updateConfig:o,setSourceBranch:a,setIssueNumber:n}=V(),[r,i]=t.useState({}),l=t.useCallback((c,d)=>{i(u=>({...u,[c]:d}))},[i]);return t.useEffect(()=>{!s||G.isEmpty(s)||(s.commitOptions?i(s.commitOptions):o(c=>({...c,commitOptions:{useFolderOnlySource:!1,useIssuePerFolder:!1,reusePreviousCommitMessage:!1}})))},[s]),t.useEffect(()=>{G.isEmpty(r)||o(c=>G.isEqual(c.commitOptions,r)?c:{...c,commitOptions:r})},[r]),t.useEffect(()=>{a(null)},[r==null?void 0:r.useFolderOnlySource,a]),t.useEffect(()=>{n({})},[r==null?void 0:r.useIssuePerFolder,n]),e.jsxs(C,{mb:4,children:[e.jsx(Z,{as:"h6",size:"sm",children:"Commit Options"}),e.jsx(Ze,{colorScheme:"yellow",children:e.jsxs(Ks,{direction:"row",spacing:4,mt:2,children:[e.jsx(X,{isChecked:r.useFolderOnlySource,onChange:c=>l("useFolderOnlySource",c.target.checked),children:e.jsx(v,{label:"Removes extra branch details from source branch.",hasArrow:!0,placement:"bottom-start",children:"Use Folder Only Source Branch?"})}),e.jsx(X,{isChecked:r.useIssuePerFolder,onChange:c=>l("useIssuePerFolder",c.target.checked),children:e.jsx(v,{label:"Allows users to input issue number for each branch folder.",hasArrow:!0,placement:"bottom-start",children:"Use 1 Issue Per Folder?"})}),e.jsx(X,{isChecked:r.reusePreviousCommitMessage,onChange:c=>l("reusePreviousCommitMessage",c.target.checked),children:e.jsx(v,{label:"Reuses the commit message from the previous commit made in Titan.",hasArrow:!0,children:"Reuse Previous Commit Message?"})})]})})]})}function At(){const{isDebug:s,setIsCommitMode:o,selectedBranchStatuses:a,showCommitView:n,setShowCommitView:r,selectedBranches:i,configurableRowData:l}=V(),[c,d]=t.useState({}),[u,h]=t.useState([]),[p,x]=t.useState([]),{isOpen:F,onOpen:B,onClose:g}=Me(),{isOpen:m,onOpen:j,onClose:k}=Me(),b=t.useMemo(()=>({resizable:!0,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]);t.useEffect(()=>{if(i.length<1||n){i.length<1&&o(!1);return}d({})},[i,n]),t.useEffect(()=>{s&&(console.debug("Branch Status Rows:",a),console.debug("Selected Rows:",i))},[s,a,i]),t.useEffect(()=>{a.length===i.length&&(a.forEach(L=>{let N=L.id,U=L.status.filesToCommit,q=L.status.filesToUpdate;const I=l.find(O=>O.id===N);if(q.length>0){const O=ve(I["Branch Folder"],I["Branch Version"],I["SVN Branch"]);d(W=>({...W,[O]:[...W[O]||[],...q]}))}if(U.length>0){const O=U.map(W=>({branchId:N,"Branch Folder":I["Branch Folder"],"Branch Version":I["Branch Version"],"SVN Branch":I["SVN Branch"],"Full Path":W.path,"File Path":`${ut(L.status.branch)}\\${W.pathDisplay}`,"Local Status":W.wcStatus}));h(W=>[...W,...O.filter(K=>!["unversioned","missing"].includes(K["Local Status"]))]),x(W=>[...W,...O.filter(K=>["unversioned","missing"].includes(K["Local Status"]))])}}),r(!0))},[a,i,l]);const S=Object.keys(c).length>0,D=u.length>0,z=p.length>0,H=S||D||z;return e.jsxs(C,{children:[e.jsx(Mt,{}),e.jsx(C,{mb:6,children:e.jsx(Bt,{openMessageAutoFillModal:j})}),e.jsx(Js,{isLoaded:n&&H,startColor:"yelow.500",endColor:"yellow.500",children:e.jsxs(ss,{variant:"solid-rounded",colorScheme:"yellow",defaultIndex:S?0:D?1:2,isLazy:!1,children:[e.jsxs(ts,{children:[e.jsx(xe,{isDisabled:!S,children:e.jsx(v,{label:"No files to update!",hasArrow:!0,isDisabled:S,children:"Files to Update"})}),e.jsx(xe,{isDisabled:!D,children:e.jsx(v,{label:"No files to commit!",hasArrow:!0,isDisabled:D,children:"Local Changes"})}),e.jsx(xe,{isDisabled:!z,children:e.jsx(v,{label:"No unversioned/missing files!",hasArrow:!0,isDisabled:z,children:"Untracked Changes"})})]}),e.jsxs(ns,{children:[e.jsx(be,{px:0,children:e.jsx(St,{fileUpdates:c})}),e.jsx(be,{px:0,children:e.jsx(yt,{rowDataLocalChanges:u,setRowDataLocalChanges:h,defaultColDefsCommit:b})}),e.jsx(be,{px:0,children:e.jsx(kt,{rowDataUntrackedChanges:p,setRowDataUntrackedChanges:x,defaultColDefsCommit:b})})]})]})}),n&&!H?e.jsxs(P,{mt:4,className:"animation-pulse",fontWeight:600,textAlign:"center",children:["No changes have been spotted!",e.jsx("br",{}),"Please use the refresh button 👇 if you have recently made a change"]}):e.jsx(e.Fragment,{}),e.jsx(C,{mt:6,children:e.jsx(Dt,{openCommitModal:B})}),e.jsx(jt,{isModalOpen:F,closeModal:g}),e.jsx(Tt,{isModalOpen:m,closeModal:k})]})}function Lt(){const{showSelectedBranchesLog:s,setShowSelectedBranchesLog:o}=V();return e.jsxs(Xs,{isOpen:s,onClose:()=>o(!1),placement:"left",size:"full",children:[e.jsx(pe,{}),e.jsxs(Zs,{children:[e.jsx(De,{size:"lg"}),e.jsx(Ce,{children:"Selected Branches: SVN Log"}),e.jsx(we,{children:e.jsx(C,{height:"100%",children:e.jsx(cs,{})})})]})]})}function Vt(){const{toast:s,RaiseClientNotificaiton:o}=ne(),{isOpen:a,onOpen:n,onClose:r}=Me(),i=t.useRef(),[l,c]=t.useState(!1);t.useEffect(()=>{if(!window.electron){o("Electron context is not available. Updates cannot be checked.","warning",5e3);return}return window.electron.on("update-available",()=>{s.closeAll(),n()}),window.electron.on("update-error",h=>{o(`An error occurred while checking for updates: ${h}`,"error",5e3),c(!1)}),()=>{window.electron.removeAllListeners("update-available"),window.electron.removeAllListeners("update-error")}},[s,n]);const d=t.useCallback(()=>{r(),o("You may update the application later by manually triggering an update check or wait until Titan does this","info",5e3)},[r,o]),u=t.useCallback(()=>{if(l){o("Update is already in progress. Please wait.","info",5e3);return}window.electron?(c(!0),window.electron.downloadUpdate().catch(h=>{c(!1),o(`An error occurred while downloading the update: ${h}`,"error",5e3)}),window.electron.on("update-downloaded",()=>{o("Update has been downloaded successfully. Titan will now restart to apply the update.","info",5e3),window.electron.removeAllListeners("update-downloaded"),r()}),window.electron.on("update-not-available",()=>{o("Titan is up to date","info",3e3),window.electron.removeAllListeners("update-not-available"),c(!1),r()})):o("Cannot update Titan in a non-desktop application environment","error",5e3)},[l,o,c,r]);return e.jsx(Ge,{isOpen:a,leastDestructiveRef:i,onClose:r,motionPreset:"slideInBottom",closeOnOverlayClick:!l,children:e.jsx(pe,{children:e.jsxs(Qe,{children:[e.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:"Update Available"}),l?e.jsx(e.Fragment,{}):e.jsx(De,{}),e.jsx(we,{children:"A new version of Titan is available. Would you like to download and install the update?"}),e.jsxs(ke,{children:[e.jsx(E,{colorScheme:"red",ref:i,onClick:d,isDisabled:l,children:"Cancel"}),e.jsx(E,{colorScheme:"yellow",onClick:u,ml:3,isDisabled:l,children:"Confirm"})]})]})})})}function Et(){if(!window.electron)return e.jsx(e.Fragment,{});const{colorMode:s}=qe(),o=t.useCallback(()=>{window.electron.minimizeWindow()},[]),a=t.useCallback(()=>{window.electron.maximizeWindow()},[]),n=t.useCallback(()=>{window.electron.closeWindow()},[]);return e.jsx(et.header,{w:"100%",position:"fixed",bgColor:s==="light"?"white":"#121212",className:"titanHead",zIndex:9999999,top:0,children:e.jsxs(T,{justifyContent:"space-between",alignItems:"center",p:2,position:"static",children:[e.jsx(Z,{as:"h6",size:"sm",noOfLines:1,className:"animation-fadein-left-forward",children:"Titan"}),e.jsxs(T,{alignItems:"center",columnGap:2,flexWrap:"nowrap",wrap:"nowrap",children:[e.jsx($,{"aria-label":"Minimize",size:"xs",icon:e.jsx(st,{}),onClick:o,colorScheme:"gray",_hover:{bg:"#FAF089",color:"#1A202C"}}),e.jsx($,{"aria-label":"Maximize",size:"xs",icon:e.jsx(tt,{}),onClick:a,colorScheme:"gray",_hover:{bg:"#FAF089",color:"#1A202C"}}),e.jsx($,{"aria-label":"Close",size:"xs",icon:e.jsx(Ke,{}),onClick:n,colorScheme:"gray",_hover:{bg:"#FEB2B2",color:"#1A202C"}})]})]})})}function Pt(){const{isCommitMode:s,selectedBranches:o,configurableRowData:a}=V(),{RaiseClientNotificaiton:n}=ne();return t.useEffect(()=>{if(window.electron)return window.electron.onAppClosing(()=>{n("App is closing, performing cleanup...","info",0),window.electron.closeWindow()}),()=>{window.electron.removeAppClosingListener()};console.warn("Electron specific logic is not available in browser mode.")},[]),e.jsxs(C,{className:"titanBody",children:[e.jsx(Et,{}),e.jsxs(C,{p:10,children:[e.jsx(gt,{}),e.jsx(Vt,{}),e.jsxs(T,{rowGap:4,flexDirection:"column",children:[e.jsx(C,{children:e.jsx(wt,{})}),e.jsx(nt,{in:s,animateOpacity:!0,children:e.jsxs(C,{id:"sectionCommit",children:[e.jsxs(Z,{as:"h2",size:"lg",noOfLines:1,mb:4,className:"animation-pulse",lineHeight:"1.4",children:["Committing ",o.length==a.length?"All":`${o.length}/${a.length}`," Branch",o.length==1?"":"es"]}),e.jsx(At,{})]})})]}),e.jsx(Lt,{})]})]})}const{definePartsStyle:ds,defineMultiStyleConfig:us}=it(ct.keys),zt=ds({overlay:{bg:"blackAlpha.900"},dialog:{bg:"gray.900",color:"white",boxShadow:"rgba(255, 255, 255, 0.07) 0px 0px 20px 7px"},header:{bg:"gray.900",color:"white",borderRadius:"20px",p:4},body:{p:4,color:"white"},footer:{bg:"gray.900",p:4,color:"white",borderRadius:"20px"}}),Ot=us({baseStyle:zt}),Ut=ds({overlay:{bg:"blackAlpha.900"},dialog:{mt:ft,bg:"gray.900",color:"white",boxShadow:"rgba(255, 255, 255, 0.07) 0px 0px 20px 7px"},header:{bg:"gray.900",color:"white",borderRadius:"20px",p:4},body:{p:4,color:"white"},footer:{bg:"gray.900",p:2,color:"white",borderRadius:"20px"}}),Wt=us({baseStyle:Ut}),Ht={initialColorMode:"dark",useSystemColorMode:!1},$e=lt({config:Ht,components:{Modal:Ot,Drawer:Wt}});ot.createRoot(document.getElementById("root")).render(e.jsx(Ae.StrictMode,{children:e.jsxs(at,{theme:$e,children:[e.jsx(rt,{initialColorMode:$e.config.initialColorMode}),e.jsx(mt,{children:e.jsx(Pt,{})})]})})); +import{r as t,u as ms,l as gs,R as Ee,j as e,T as I,I as _,d as Ge,W as Pe,e as Oe,L as Qe,f as xs,H as ee,g as Y,M as bs,h as ps,i as Cs,k as ws,m as js,n as Ss,o as ys,A as Ye,p as Ce,q as Ke,s as we,t as je,v as Be,B as z,D as ks,F as N,w as Bs,C as Te,x as De,y as Ds,z as vs,E as Je,G as Fs,J as Is,K as Xe,N as Rs,S as Ns,V as Ts,O as Ue,P as Ms,Q as Ze,U as es,X as As,Y as Ls,Z as Vs,_ as Es,$ as Ps,a0 as We,a1 as p,a2 as zs,a3 as Os,a4 as ve,a5 as U,a6 as Me,a7 as ae,a8 as re,a9 as ie,aa as le,ab as Us,ac as ss,ad as Z,ae as Ws,af as Hs,ag as $s,ah as He,ai as ye,aj as _s,ak as ke,al as de,am as Ae,an as Le,ao as qs,ap as Gs,aq as ts,ar as Qs,as as Ys,at as Ks,au as Js,av as ns,aw as ls,ax as be,ay as os,az as pe,aA as Xs,aB as Ve,aC as Zs,aD as et,aE as st,aF as tt,aG as nt,aH as lt,aI as ot,aJ as at,aK as rt,aL as it,aM as ct,aN as dt,aO as ut}from"./vendor.js";import{_ as G}from"./lodash.js";import{A as he}from"./ag-grid-react.js";import"./ag-grid-community.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function a(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=a(r);fetch(r.href,i)}})();const ht="/assets/Titan.png";function ue(s=[]){return(Array.isArray(s)?s:[s]).map(a=>(delete a["Branch Info"],a))}function Fe(s,o,a){return`${s==""?"Uncategorised":s} ${o==""?"Unversioned":o} ${String(a).split("\\").at(-1)}`}function ft(s){return String(s).split("\\").at(-1)}const mt="http://localhost:4000",gt="40px";function ce(s,o="info",a=3e3,n=!1){return{position:"top",variant:"solid",title:n?"Server Notification":"Client Notification",description:s,status:o,duration:a,isClosable:!0}}const as=t.createContext({socket:null,toast:null,config:null,updateConfig:s=>{},isDebug:!1,setIsDebug:s=>{},configurableRowData:[],setConfigurableRowData:s=>{},branchInfos:{},setBranchInfos:s=>{},branchTableGridRef:null,selectedBranches:[],setSelectedBranches:s=>{},showSelectedBranchesLog:!1,setShowSelectedBranchesLog:s=>{},customScripts:[],setCustomScripts:s=>{},isCommitMode:!1,setIsCommitMode:s=>{},selectedBranchStatuses:[],setSelectedBranchStatuses:s=>{},localChangesGridRef:null,untrackedChangesGridRef:null,showCommitView:!1,setShowCommitView:s=>{},sourceBranch:null,setSourceBranch:s=>{},branchOptions:[],issueNumber:{},setIssueNumber:s=>{},commitMessage:"",setCommitMessage:s=>{},selectedLocalChanges:[],setSelectedLocalChanges:s=>{},selectedUntrackedChanges:[],setSelectedUntrackedChanges:s=>{},socketPayload:null,setSocketPayload:s=>{},postCommitData:{},setPostCommitData:s=>{},logData:[],setLogData:s=>{}}),P=()=>t.useContext(as),xt=({children:s})=>{const[o,a]=t.useState(null),[n,r]=t.useState(null),i=ms(),[l,c]=t.useState(()=>localStorage.getItem("isDebug")==="true");t.useEffect(()=>{const j=gs(mt);return r(j),j.on("connect",()=>{j.emit("titan-config-get","fetch"),j.once("titan-config-get",V=>{a(V),V||i(ce("Couldn't load data from the server","error",0))})}),j.on("notification",V=>{i(ce(V.description,V.status,V.duration,!0))}),j.on("disconnect",()=>{i(ce("Server Has Been Disconnected","warning",0,!0))}),j.on("reconnect",()=>{i(ce("Server Has Been Reconnected","success",2e3,!0))}),()=>{j.disconnect()}},[]),t.useEffect(()=>{localStorage.setItem("isDebug",String(l))},[l]);const d=t.useCallback(j=>{j!=null&&(console.debug("Saving config:",j),n==null||n.emit("titan-config-set",j))},[n]),u=t.useCallback(j=>{a(V=>{const L=j(V);return G.isEqual(V,L)?V:(d(L),L)})},[a,d]),[h,x]=t.useState([]),[b,R]=t.useState({}),B=t.useRef(null),[m,g]=t.useState([]),[w,k]=t.useState(!1),[v,T]=t.useState([]),[C,D]=t.useState(!1),[A,M]=t.useState([]),E=t.useRef(null),$=t.useRef(null),[O,y]=t.useState(!1),[W,H]=t.useState(null),K=t.useMemo(()=>{let j=o&&o.commitOptions&&o.commitOptions.useFolderOnlySource,V=h.filter(L=>L["Branch Folder"]&&L["Branch Version"]&&L["SVN Branch"]&&L["Branch Folder"]!==""&&L["Branch Version"]!==""&&L["SVN Branch"]!=="");return j&&(V=V.reduce((L,Re)=>(L.some(Ne=>Ne["Branch Folder"]===Re["Branch Folder"])||L.push(Re),L),[])),V.map(L=>({value:L.id,label:j?L["Branch Folder"]:Fe(L["Branch Folder"],L["Branch Version"],L["SVN Branch"])}))},[o,m,h]),[X,se]=t.useState({}),[te,me]=t.useState(""),[S,f]=t.useState([]),[F,J]=t.useState([]),[ge,Ie]=t.useState(null),[Se,q]=t.useState({}),[Q,ne]=Ee.useState([]);return t.useEffect(()=>{M([]),y(!1)},[h]),t.useEffect(()=>{window.electron&&window.electron.fetchCustomScripts().then(j=>{if(j.success){T(j.scripts);return}i(ce(j.error,"error",0,!0))})},[h]),t.useEffect(()=>{if(!C||!O)return;const j=setTimeout(()=>{var V;(V=document.getElementById("sectionCommit"))==null||V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},100);return()=>clearTimeout(j)},[C,O]),t.useEffect(()=>{if(m.length<1||O){m.length<1&&D(!1);return}M([]),Ie(null),ue(m).forEach(j=>{console.debug("Emitting svn-status-single for branch:",j),n==null||n.emit("svn-status-single",{selectedBranch:j})})},[n,m,O]),t.useEffect(()=>{const j=()=>{y(!1)};return n==null||n.on("branch-refresh-unseen",j),()=>n==null?void 0:n.off("branch-refresh-unseen",j)},[n]),t.useEffect(()=>{const j=V=>{l&&console.debug("Received branch status data:",V),M(L=>[...L,V])};return n==null||n.on("branch-status-single",j),()=>n==null?void 0:n.off("branch-status-single",j)},[n]),t.useEffect(()=>{ne([])},[m]),t.useEffect(()=>{Q.length===0&&n&&g(j=>(j.length>0&&n.emit("svn-log-selected",{selectedBranches:m}),j))},[Q,n]),t.useEffect(()=>{const j=V=>{console.debug("Received svn-log-result from socket in SectionBranchLog component in background"),ne(L=>L.some(Ne=>Ne.id===V.id)?L:[...L,V])};return n==null||n.on("svn-log-result",j),()=>n==null?void 0:n.off("svn-log-result",j)},[n]),e.jsx(as.Provider,{value:{socket:n,toast:i,config:o,updateConfig:u,isDebug:l,setIsDebug:c,configurableRowData:h,setConfigurableRowData:x,branchInfos:b,setBranchInfos:R,branchTableGridRef:B,selectedBranches:m,setSelectedBranches:g,showSelectedBranchesLog:w,setShowSelectedBranchesLog:k,customScripts:v,setCustomScripts:T,isCommitMode:C,setIsCommitMode:D,selectedBranchStatuses:A,setSelectedBranchStatuses:M,localChangesGridRef:E,untrackedChangesGridRef:$,showCommitView:O,setShowCommitView:y,sourceBranch:W,setSourceBranch:H,branchOptions:K,issueNumber:X,setIssueNumber:se,commitMessage:te,setCommitMessage:me,selectedLocalChanges:S,setSelectedLocalChanges:f,selectedUntrackedChanges:F,setSelectedUntrackedChanges:J,socketPayload:ge,setSocketPayload:Ie,postCommitData:Se,setPostCommitData:q,logData:Q,setLogData:ne},children:s})};function fe(){const{socket:s}=P(),o=t.useCallback(()=>{s==null||s.emit("titan-config-open",{})},[s]),a=t.useCallback((u,h,x,b)=>{s==null||s.emit("svn-update-single",{id:u,branch:h,version:x,folder:b})},[s]),n=t.useCallback((u,h,x,b)=>{s==null||s.emit("svn-info-single",{id:u,branch:h,version:x,folder:b})},[s]),r=t.useCallback(u=>{s==null||s.emit("svn-commit",u)},[s]),i=t.useCallback(u=>{s==null||s.emit("svn-files-revert",{filesToProcess:u})},[s]),l=t.useCallback(u=>{s==null||s.emit("svn-files-add-remove",{filesToProcess:u})},[s]),c=t.useCallback((u,h,x,b=null)=>{s==null||s.emit("trello-search-names-card",{key:u,token:h,query:x,limit:b})},[s]),d=t.useCallback((u,h,x,b)=>{s==null||s.emit("trello-update-card",{key:u,token:h,trelloData:x,commitResponses:b})},[s]);return{emitOpenConfig:o,emitUpdateSingle:a,emitInfoSingle:n,emitCommitPayload:r,emitFilesRevert:i,emitFilesAddRemove:l,emitTrelloCardNamesSearch:c,emitTrelloCardUpdate:d}}function oe(){const{toast:s}=P(),o=t.useCallback((a="",n="info",r=3e3,i=null)=>{const l=ce(a,n,r);if(s)return s(l);if(i)return i(l)},[s]);return{toast:s,RaiseClientNotificaiton:o}}function rs(s){const{icon:o,onClick:a,colorScheme:n,label:r,size:i}=s,l=t.useCallback(()=>{a&&a()},[a]);return e.jsx(I,{label:window.electron?r:"Feature must be used in desktop application",children:e.jsx(_,{"aria-label":r,size:i,icon:o,onClick:l,colorScheme:n,isDisabled:!window.electron})})}function xe(s){const{icon:o,onClick:a,colorScheme:n,label:r,size:i,placement:l,isDisabled:c=!1}=s,d=t.useCallback(()=>{a&&a()},[a]);return r&&l?e.jsx(I,{label:r,hasArrow:!0,placement:l,children:e.jsx(_,{"aria-label":r,size:i,icon:o,onClick:d,colorScheme:n,isDisabled:c})}):e.jsx(_,{"aria-label":r,size:i,icon:o,onClick:d,colorScheme:n,isDisabled:c})}function bt(){const{isDebug:s,setIsDebug:o}=P(),{emitOpenConfig:a}=fe(),{RaiseClientNotificaiton:n}=oe(),{colorMode:r,toggleColorMode:i}=Ge(),l=t.useCallback(()=>{window.electron&&window.electron.getAppVersion().then(x=>{n(`Application Version: v${x}`,"info",2e3)})},[n]),c=t.useCallback(()=>{window.location.reload()},[]),d=t.useCallback(()=>{window.electron.checkForUpdates().then(x=>{console.debug("Check for updates result: ",x)}),window.electron.on("update-not-available",()=>{n("Titan is up to date","info",3e3),window.electron.removeAllListeners("update-not-available")})},[n]),u=t.useCallback(()=>{a()},[a]),h=t.useCallback(()=>{o(x=>!x)},[o]);return e.jsxs(Pe,{my:5,spacingY:5,justify:"space-between",children:[e.jsxs(Oe,{alignItems:"center",children:[e.jsx(Qe,{onClick:l,children:e.jsx(xs,{src:ht,alt:"Titan Logo",boxSize:"100px",mr:5,borderRadius:"full"})}),e.jsx(ee,{as:"h2",size:"2xl",noOfLines:1,className:"animation-fadein-forward",children:"Welcome back"}),e.jsx(ee,{as:"h2",size:"2xl",noOfLines:1,p:2,className:"animation-handwave",children:"👋"})]}),e.jsxs(Oe,{alignItems:"center",columnGap:2,children:[e.jsx(xe,{icon:e.jsx(Y,{as:r==="light"?bs:ps}),onClick:i,colorScheme:"yellow",label:"Toggle Light/Dark Mode",placement:"bottom-start",size:"md"}),e.jsx(xe,{icon:e.jsx(Y,{as:Cs}),onClick:c,colorScheme:"yellow",label:"Reload",placement:"bottom-start",size:"md"}),e.jsx(rs,{icon:e.jsx(Y,{as:ws}),onClick:d,colorScheme:"yellow",label:"Check For Updates",size:"md"}),e.jsx(xe,{icon:e.jsx(Y,{as:js}),onClick:u,colorScheme:"yellow",label:"Open Config File",placement:"bottom-start",size:"md"}),e.jsx(xe,{icon:s?e.jsx(Y,{as:ys}):e.jsx(Y,{as:Ss}),onClick:h,colorScheme:"yellow",label:`Current Debug Mode: ${s?"on":"off"}`,placement:"bottom-start",size:"md"})]})]})}function pt({isAlertOpen:s,onCloseAlert:o,cancelRef:a,removeSelectedRows:n}){return e.jsx(Ye,{isOpen:s,leastDestructiveRef:a,onClose:o,children:e.jsx(Ce,{children:e.jsxs(Ke,{children:[e.jsx(we,{fontSize:"lg",fontWeight:"bold",children:"Delete Selected Rows"}),e.jsx(je,{children:"Are you sure you want to delete the selected rows? This action cannot be undone."}),e.jsxs(Be,{children:[e.jsx(z,{ref:a,onClick:o,children:"Cancel"}),e.jsx(z,{colorScheme:"red",onClick:n,ml:3,children:"Delete"})]})]})})})}function $e(){const{innerWidth:s,innerHeight:o}=window;return{width:s,height:o}}function Ct(){const[s,o]=t.useState($e());return t.useEffect(()=>{function a(){o($e())}return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),s}function wt({rowData:s,onRowValueChanged:o}){const{config:a,branchTableGridRef:n,updateConfig:r,isDebug:i,selectedBranches:l,setSelectedBranches:c,setSelectedBranchStatuses:d,customScripts:u,setShowCommitView:h}=P(),x=Ct(),[b,R]=t.useState(x.height>768),B=t.useCallback((C,D,A)=>{window.electron.runCustomScript({scriptType:C,scriptPath:D,branchData:A}).then(M=>{console.log("Custom Script Result: ",M)})},[]),m=t.useCallback(C=>{const D={...C,id:String(Date.now()),"Branch Info":"Hasn't been refreshed"};r(A=>({...A,branches:ue([...A.branches,D])}))},[r]),g=t.useCallback(C=>{var A,M,E,$;const D=(M=(A=n==null?void 0:n.current)==null?void 0:A.api)==null?void 0:M.getSelectedNodes().map(O=>O.data);if(i&&console.log("SectionBranches.jsx: onSelectionChanged - event",C),i&&console.log("SectionBranches.jsx: onSelectionChanged - selectedBranches",l),(C==null?void 0:C.source)=="rowDataChanged"){const O=l.map(y=>y.id);($=(E=n==null?void 0:n.current)==null?void 0:E.api)==null||$.forEachNode(y=>{O.includes(y.data.id)&&y.setSelected(!0)});return}else["api"].includes(C==null?void 0:C.source)||(c(D),d([]),h(!1))},[i,n,l,c,h]),w=t.useCallback(C=>{const D=[];C.api.forEachNode(A=>D.push(A.data)),i&&console.debug("SectionBranches.jsx: onRowDragEnd - movedRowData",D),r(A=>({...A,branches:ue(D)}))},[r,i]),k=t.useCallback(C=>{const D=a==null?void 0:a.branchFolderColours[C.data["Branch Folder"]];return{backgroundColor:D?`${D}20`:"transparent"}},[a==null?void 0:a.branchFolderColours]),v=t.useMemo(()=>({resizable:!0,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!0,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),T=t.useMemo(()=>{const C=[{headerCheckboxSelection:!0,checkboxSelection:!0,headerCheckboxSelectionFilteredOnly:!0,width:25,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"Branch Folder",resizable:!1,width:130,valueFormatter:D=>D.value.toUpperCase()},{field:"Branch Version",resizable:!1,width:130},{field:"SVN Branch",flex:2},{field:"Branch Info",editable:!1,resizable:!1,width:125},{headerName:"",resizable:!0,sortable:!1,filter:!1,editable:!1,cellRenderer:D=>e.jsxs(N,{columnGap:1,children:[u.map(A=>e.jsx(rs,{icon:e.jsx(Bs,{}),onClick:()=>B(A.type,A.path,D.data),colorScheme:"yellow",label:A.fileName,size:"sm"})),e.jsx(xe,{icon:e.jsx(Te,{}),onClick:()=>m(D.data),colorScheme:"yellow",label:"Copy Row",size:"sm"})]})}];return b?[{field:"",rowDrag:!0,resizable:!1,filter:!1,suppressMovable:!1,editable:!1,width:20,cellRenderer:ks,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},...C]:C},[b,u,m]);return t.useEffect(()=>{R(x.height>768)},[x]),e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:b?"auto":"428px",width:"100%"},children:e.jsx(he,{ref:n,rowData:s,defaultColDef:v,columnDefs:T,stopEditingWhenCellsLoseFocus:!0,getRowStyle:k,onRowDragEnd:w,domLayout:b?"autoHeight":"normal",suppressRowClickSelection:!0,rowSelection:"multiple",rowMultiSelectWithClick:!0,animateRows:!0,rowDragManaged:!0,onSelectionChanged:g,onRowValueChanged:o,columnMenu:"new",editType:"fullRow",deltaRowDataMode:!0,getRowNodeId:C=>C.id,immutableData:!0,suppressFlash:!0,enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!b,paginationAutoPageSize:!1,paginationPageSizeSelector:!1,paginationPageSize:10})})}function jt(){const{updateConfig:s,isDebug:o,socket:a,configurableRowData:n,setConfigurableRowData:r,branchInfos:i,config:l,setBranchInfos:c,setSelectedBranches:d,setSelectedBranchStatuses:u,showCommitView:h,setShowCommitView:x}=P(),[b,R]=t.useState([]),B=t.useCallback(m=>{o&&console.log("AG Grid: onRowValueChanged - event",m),o&&console.log("AG Grid: onRowValueChanged - rowDataBranches",b),s(g=>({...g,branches:ue(b)}))},[b,s,o]);return t.useEffect(()=>{const m=G.debounce(()=>{const g=n.map(w=>({...w,"Branch Info":i[w.id]||"Hasn't been refreshed"}));R(w=>G.isEqual(g,w)?w:g)},300);return m(),()=>m.cancel()},[n,i]),t.useEffect(()=>{r(m=>l&&l.branches&&!G.isEqual(l.branches,m)?l.branches:m)},[l]),t.useEffect(()=>{const m=g=>{c(w=>{const k={...w,[g.id]:g.info};return console.debug("branch-info-single data received:",g),console.debug("branch-info-single newBranchInfos",k),d(v=>(v.find(C=>C.id===g.id)&&h&&(u([]),x(!1)),v)),k})};return a==null||a.on("branch-info-single",m),()=>a==null?void 0:a.off("branch-info-single")},[a,h]),{rowDataBranches:b,setRowDataBranches:R,onRowValueChanged:B}}function St(){const{socket:s,updateConfig:o,isDebug:a,setShowSelectedBranchesLog:n,configurableRowData:r,branchTableGridRef:i,selectedBranches:l,setSelectedBranches:c,isCommitMode:d,setIsCommitMode:u,setSelectedBranchStatuses:h,setShowCommitView:x}=P(),{emitUpdateSingle:b,emitInfoSingle:R}=fe(),{RaiseClientNotificaiton:B}=oe(),[m,g]=t.useState(!1),w=t.useRef(),k=()=>g(!1),{rowDataBranches:v,setRowDataBranches:T,onRowValueChanged:C}=jt(),[D,A]=t.useState(0),[M,E]=t.useState([]),$=t.useCallback(()=>{var S,f;a&&console.log("SectionBranches.jsx: clearSelection: START"),(f=(S=i==null?void 0:i.current)==null?void 0:S.api)==null||f.deselectAll(),c([]),u(!1)},[a,i,c]),O=t.useCallback(()=>{var f,F;const S=(F=(f=i==null?void 0:i.current)==null?void 0:f.api)==null?void 0:F.getSelectedNodes().map(J=>J.data);c(S),g(!0)},[i,c]),y=t.useCallback(()=>{const S={id:String(Date.now()),"Branch Folder":"","Branch Version":"","SVN Branch":"","Branch Info":""};o(f=>({...f,branches:ue([...f.branches,S])}))},[o]),W=t.useCallback(()=>{l.forEach(S=>{b(S.id,S["SVN Branch"],S["Branch Version"],S["Branch Folder"])})},[l,b]),H=t.useCallback(()=>{M.forEach(S=>{b(S.id,S["SVN Branch"],S["Branch Version"],S["Branch Folder"])})},[M,b]),K=t.useCallback(()=>{const S=l.map(F=>F.id),f=v.filter(F=>!S.includes(F.id));console.log("SectionBranches.jsx: removeSelectedRows - updatedData",f),o(F=>({...F,branches:ue(f)})),$(),k()},[l,v,o]),X=t.useCallback(()=>{n(!0)},[]),se=t.useCallback(()=>{T(S=>{const f=[...S];return l.forEach(F=>{const J=f.findIndex(ge=>ge.id===F.id);f[J]["Branch Info"]="Refreshing..."}),f}),l.forEach(S=>{R(S.id,S["SVN Branch"],S["Branch Version"],S["Branch Folder"])})},[l,R]),te=t.useCallback(()=>{if(d)return;B("Refreshing all branches. Please wait until this is done!","info",3e3);const S=Date.now();r.forEach(f=>{R(f.id,f["SVN Branch"],f["Branch Version"],f["Branch Folder"])}),A(S)},[r,R,B,d]),me=t.useCallback(()=>{u(S=>!S),x(!1)},[u]);return t.useEffect(()=>{const S=v.filter(f=>String(f["Branch Info"]).toLowerCase().includes("-"));E(S)},[v]),t.useEffect(()=>{const f=Date.now();if(r.length>0){f-D>3e5&&te();const F=setInterval(()=>{te()},3e5);return()=>clearInterval(F)}},[r,D,te]),t.useEffect(()=>{const S=f=>{a&&console.debug("branch-success-single data received:",f),R(f.id,f.branch,f.version,f.folder)};return s==null||s.on("branch-success-single",S),()=>s==null?void 0:s.off("branch-success-single",S)},[a,s,R]),e.jsxs("div",{children:[e.jsxs(Pe,{mb:4,justify:"space-between",children:[e.jsxs(N,{columnGap:2,children:[e.jsx(I,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(z,{onClick:se,leftIcon:e.jsx(De,{}),colorScheme:"yellow",isDisabled:l.length<1,children:["Refresh ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(I,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(z,{onClick:W,leftIcon:e.jsx(Y,{as:Ds}),colorScheme:"yellow",isDisabled:l.length<1,children:["Update ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(I,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsx(z,{onClick:me,leftIcon:e.jsx(Y,{as:d?vs:Je}),colorScheme:"yellow",isDisabled:l.length<1,children:d?"Undo Commit":"Commit"})}),e.jsx(I,{label:"Requires at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsx(z,{onClick:X,leftIcon:e.jsx(Fs,{}),colorScheme:"yellow",isDisabled:l.length<1,children:"View Logs"})})]}),e.jsx(N,{columnGap:2,children:e.jsx(I,{label:"No outdated branches to update",isDisabled:M.length>0,hasArrow:!0,children:e.jsx(z,{onClick:H,leftIcon:e.jsx(Is,{}),colorScheme:"yellow",isDisabled:M.length<1,children:"Update Outdated"})})})]}),e.jsx(wt,{rowData:v,onRowValueChanged:C}),e.jsxs(N,{columnGap:2,mt:4,children:[e.jsx(I,{label:"Please select at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(z,{onClick:$,leftIcon:e.jsx(Xe,{}),colorScheme:"red",isDisabled:l.length<1,children:["Deselect ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(I,{label:"Please select at least 1 branch",isDisabled:l.length>0,hasArrow:!0,children:e.jsxs(z,{onClick:O,leftIcon:e.jsx(Rs,{}),colorScheme:"red",isDisabled:l.length<1,children:["Delete ",l.length>0?`${l.length} Branch`:"",l.length>1?"es":""]})}),e.jsx(z,{onClick:y,leftIcon:e.jsx(Ns,{boxSize:8}),colorScheme:"green",children:"New Row"})]}),e.jsx(pt,{isAlertOpen:m,onCloseAlert:k,cancelRef:w,removeSelectedRows:K})]})}function is(s){const{data:o,onDiffResult:a}=s,n=t.useCallback(async()=>{try{const r=await window.electron.openTortoiseSVNDiff({fullPath:o["Full Path"],branchFolder:o["Branch Folder"],branchVersion:o["Branch Version"]});a(r)}catch(r){a({success:!1,error:r.message})}},[o,a]);return e.jsx(_,{"aria-label":"Diff",size:"sm",icon:e.jsx(Ts,{}),onClick:n,colorScheme:"yellow"})}function cs(){const{config:s}=P(),{emitTrelloCardNamesSearch:o,emitTrelloCardUpdate:a}=fe(),n=s==null?void 0:s.trelloIntegration,r=(n==null?void 0:n.key)||null,i=(n==null?void 0:n.token)||null,l=r&&i&&r.trim()!==""&&i.trim()!==""&&r.toUpperCase()!=="TRELLO_API_KEY"&&i.toUpperCase!=="TRELLO_TOKEN";return{key:r,token:i,isTrelloIntegrationEnabled:l,emitTrelloCardNamesSearch:o,emitTrelloCardUpdate:a}}function yt({isModalOpen:s,closeModal:o}){const{socket:a,setIsCommitMode:n,setSelectedBranchStatuses:r,setShowCommitView:i,socketPayload:l,postCommitData:c,setPostCommitData:d}=P(),{emitUpdateSingle:u,emitCommitPayload:h}=fe(),{key:x,token:b,isTrelloIntegrationEnabled:R,emitTrelloCardUpdate:B}=cs(),{RaiseClientNotificaiton:m}=oe(),[g,w]=t.useState([]),{onCopy:k,value:v,setValue:T,hasCopied:C}=Ue(""),{onCopy:D,value:A,setValue:M,hasCopied:E}=Ue(""),$=t.useCallback(f=>{f.success?m("TortoiseSVN diff opened successfully","success",3e3):m(`Error opening TortoiseSVN diff: ${JSON.stringify(f.error,null,4)}`,"error",0)},[m]),O=[{title:"Review",description:"Confirm SVN changes"},{title:"Commit",description:"Commit changes"},{title:"Complete",description:"Process Completed"}],{activeStep:y,setActiveStep:W}=Ms({index:1,count:O.length}),H=t.useMemo(()=>({resizable:!1,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),K=t.useMemo(()=>[{field:"Branch Folder"},{field:"Branch Version",sort:"asc"},{field:"File Path",flex:1},{field:"Local Status",headerTooltip:"Working Copy"},{headerName:"Diff",filter:!1,sortable:!1,cellRenderer:is,cellRendererParams:{onDiffResult:$},width:90}],[]),X=t.useCallback((f,F=!0)=>{const J="​".repeat(7),ge=f.includes("MarkupSupport")?`\r +${J}`:`\r +`,Se=g.sort((q,Q)=>q["Branch Version"].localeCompare(Q["Branch Version"])).map(q=>{const Q=[];f.includes("BranchFolder")&&Q.push(q["Branch Folder"]),f.includes("BranchVersion")&&Q.push(q["Branch Version"]),f.includes("SVNBranch")&&Q.push(q.branchPathFolder);let ne=Q.join(" ").trim();if(f.includes("IssueNumber")){const V=q.branchIssueNumber;ne+=` Issue [${V}]`}const j=q.revision?q.revision:q.errorMessage||"Error";return ne+=` Revision [${j}]`,ne});return F?Se.join(ge):Se},[g,l]),se=t.useCallback(f=>{const F=X(f);T(F)},[X,T]),te=t.useCallback(()=>{W(f=>f-1)},[W]),me=t.useCallback(()=>{if(c.type!=="trello"){m("Trello Autofill is not enabled for this commit","error");return}const f=c.data,F=X(["BranchFolder","BranchVersion","IssueNumber"],!1);B(x,b,f,F),m("Updating Trello card with commit information","info"),d(null)},[c,m,X]),S=t.useCallback(()=>{W(f=>{switch(f){case 1:h(l);case 2:T(""),M("");break;case 3:return k(),m("Updating selected branches! Please wait","info",1500),g.forEach(F=>{u(F.branchId,F["SVN Branch"],F["Branch Version"],F["Branch Folder"])}),n(!1),r([]),i(!1),o(),1}return f+1})},[W,h,l,T,M,k,m,g,u,n,r,i,o]);return t.useEffect(()=>{W(1),w([]),T(""),M("")},[s,w]),t.useEffect(()=>{!s||y!=0||(o(),W(1),w([]),T(""),M(""))},[y,s]),t.useEffect(()=>{!s||y!=3||(m("The commit process has been completed successfully","success",5e3),se(["BranchFolder","BranchVersion","SVNBranch"]),M(l.commitMessage||""))},[m,y,s,se]),t.useEffect(()=>{const f=F=>{w(J=>[...J,F])};return a==null||a.on("svn-commit-status-live",f),()=>a==null?void 0:a.off("svn-commit-status-live",f)},[a]),t.useEffect(()=>{if(y!=2)return;const f=setTimeout(()=>{g.length>0&&g[0].bulkCommitLength==g.length&&W(3)},3e3);return()=>clearTimeout(f)},[y,g]),t.useEffect(()=>{(C||E)&&m("Copied to Clipboard","success",1500)},[C,E,m]),!s||!l?e.jsx(e.Fragment,{}):e.jsxs(Ze,{isOpen:s,onClose:o,isCentered:!0,motionPreset:"slideInBottom",scrollBehavior:"inside",size:"xl",closeOnOverlayClick:y==1,children:[e.jsx(Ce,{}),e.jsxs(es,{maxH:"85%",maxW:"95%",children:[e.jsxs(we,{display:"flex",justifyContent:"space-between",maxWidth:y==1?"94%":"100%",children:[e.jsx(ee,{as:"h2",size:"lg",children:"Commit Selected Files"}),e.jsx(As,{index:y-1,mb:0,size:"sm",colorScheme:"yellow",children:O.map((f,F)=>e.jsxs(Ls,{children:[e.jsx(Vs,{children:e.jsx(Es,{complete:e.jsx(Ps,{}),incomplete:e.jsx(We,{}),active:e.jsx(We,{})})}),e.jsx(p,{flexShrink:"0",children:e.jsx(zs,{children:f.title})}),e.jsx(Os,{})]},F))})]}),y==1?e.jsx(ve,{size:"lg",py:6}):e.jsx(e.Fragment,{}),e.jsx(je,{children:e.jsxs(p,{children:[y!=1?e.jsx(e.Fragment,{}):e.jsxs(p,{children:[e.jsxs(p,{mb:4,children:[e.jsx(U,{fontWeight:600,children:"Please confirm that the following information is correct before proceeding to commit your files:"}),e.jsxs(Me,{spacing:3,children:[e.jsxs(ae,{children:[e.jsx(re,{as:ie,color:"yellow.500"}),"Source Branch: ",e.jsx(le,{children:Fe(l.sourceBranch["Branch Folder"],l.sourceBranch["Branch Version"],l.sourceBranch["SVN Branch"])})]}),e.jsxs(ae,{children:[e.jsx(re,{as:ie,color:"yellow.500"}),"Issue Numbers: ",e.jsx(le,{children:Object.entries(l.issueNumber).map(f=>`${f[1]} (${f[0]})`).join(", ")})]}),e.jsxs(ae,{children:[e.jsx(re,{as:ie,color:"yellow.500"}),"Commit Message: ",e.jsx(le,{children:l.commitMessage})]}),e.jsxs(ae,{children:[e.jsx(re,{as:ie,color:"yellow.500"}),"Example:"," ",e.jsxs(le,{children:["Issue ",l.issueNumber[l.sourceBranch["Branch Folder"]]," (",l.sourceBranch["Branch Folder"]," ",l.sourceBranch["Branch Version"],"): ",l.commitMessage]})]})]})]}),e.jsx(p,{children:e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"350px",width:"100%"},children:e.jsx(he,{rowData:l.filesToProcess,defaultColDef:H,columnDefs:K,domLayout:"normal",columnMenu:"new",pagination:!0,paginationAutoPageSize:!0})})})]}),y!=2?e.jsx(e.Fragment,{}):e.jsxs(p,{children:[e.jsxs(U,{fontWeight:600,children:["Please wait while the files are being committed to the SVN repository.",e.jsx("br",{}),"Current live status of the commit process:"]}),e.jsx(p,{children:e.jsx(Me,{spacing:3,children:g.map((f,F)=>e.jsxs(ae,{children:[e.jsx(re,{as:f.errorMessage?Us:ie,color:f.errorMessage?"red.500":"yellow.500"}),f.branchString,": ",e.jsx(le,{children:f.errorMessage||f.revision})]},F))})})]}),y!=3?e.jsx(e.Fragment,{}):e.jsxs(p,{children:[e.jsx(p,{mb:4,children:e.jsxs(U,{fontWeight:600,children:["The commit process has been completed successfully.",e.jsx("br",{}),"Please find your revisions here for view and copy:"]})}),e.jsxs(N,{columnGap:10,alignItems:"center",children:[e.jsxs(p,{children:[e.jsx(ee,{as:"h3",size:"md",children:"SVN Revisions"}),e.jsx(p,{children:e.jsx("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word"},children:v})})]}),e.jsx(p,{children:e.jsx(I,{hasArrow:!0,label:"Copy to clipboard",children:e.jsx(_,{"aria-label":"Copy To Clipboard",onClick:k,icon:e.jsx(Te,{}),colorScheme:"yellow"})})})]}),e.jsxs(p,{my:4,children:[e.jsx(U,{fontWeight:600,children:"Modify the clipboard text to include..."}),e.jsx(ss,{colorScheme:"yellow",defaultValue:["BranchFolder","BranchVersion"],onChange:se,children:e.jsxs(Pe,{children:[e.jsx(Z,{value:"BranchFolder",children:"Branch Folder"}),e.jsx(Z,{value:"BranchVersion",children:"Branch Version"}),e.jsx(Z,{value:"SVNBranch",children:"SVN Branch"}),e.jsx(Z,{value:"IssueNumber",children:"Issue Number"}),e.jsx(Z,{value:"MarkupSupport",children:"Markup Support"})]})})]}),e.jsxs(N,{columnGap:10,alignItems:"center",children:[e.jsxs(p,{children:[e.jsx(U,{fontWeight:600,children:"Here is your SVN commit message for the source branch:"}),l.sourceBranch&&l.sourceBranch["Branch Folder"]&&l.sourceBranch["Branch Version"]?e.jsx(le,{children:`Issue ${l.issueNumber[l.sourceBranch["Branch Folder"]]} (${l.sourceBranch["Branch Folder"]} ${l.sourceBranch["Branch Version"]}): ${A}`}):e.jsx(le,{children:"Source information is undefined. Please check that you have entered the correct details otherwise contact the developer!"})]}),e.jsx(I,{hasArrow:!0,label:"Copy to clipboard",children:e.jsx(_,{"aria-label":"Copy To Clipboard",onClick:D,icon:e.jsx(Te,{}),colorScheme:"yellow"})})]})]})]})}),e.jsx(Be,{children:e.jsxs(N,{flex:1,justifyContent:"space-between",children:[e.jsx(N,{columnGap:2,children:e.jsx(I,{hasArrow:!0,label:"Cannot undo the commit currently",isDisabled:y<2,children:e.jsx(z,{onClick:te,mr:3,isDisabled:y>=2,children:y==1?"Cancel":"Previous"})})}),e.jsxs(N,{columnGap:2,children:[e.jsx(I,{hasArrow:!0,label:"Requires Trello Autofill",isDisabled:(c==null?void 0:c.type)==="trello"&&R,children:e.jsx(z,{colorScheme:"yellow",leftIcon:e.jsx(Y,{as:Ws}),onClick:me,isDisabled:y<3||(c==null?void 0:c.type)!="trello"||!R,children:"Update Card"})}),e.jsx(I,{hasArrow:!0,label:"Cannot undo the commit currently",isDisabled:y!=2,children:e.jsx(z,{colorScheme:"yellow",onClick:S,isDisabled:y==2,children:y==O.length?"Complete":"Next"})})]})]})})]})]})}function kt({fileUpdates:s}){return e.jsx(p,{children:Object.keys(s).length>0?e.jsxs(p,{children:[e.jsx(U,{mb:4,children:"Below are the list of files which have been changed on your machine but there exists a newer version of them in the repository:"}),e.jsx(p,{maxHeight:"200px",overflowY:"auto",children:e.jsxs(Hs,{children:[e.jsx($s,{children:e.jsxs(He,{children:[e.jsx(ye,{children:"Branch"}),e.jsx(ye,{children:"Path"}),e.jsx(ye,{children:e.jsx(I,{label:"Working Copy",hasArrow:!0,children:"Local Status"})}),e.jsx(ye,{children:e.jsx(I,{label:"Repository",hasArrow:!0,children:"Remote Status"})})]})}),e.jsx(_s,{children:Object.keys(s).map(o=>e.jsx(Ee.Fragment,{children:s[o].map((a,n)=>e.jsxs(He,{children:[e.jsx(ke,{children:o}),e.jsx(ke,{children:a.pathDisplay}),e.jsx(ke,{children:a.wcStatus}),e.jsx(ke,{children:a.reposStatus})]},n))},o))})]})}),e.jsx(U,{mt:4,children:"If you wish to commit these files, please update the associated branches!"})]}):e.jsx(p,{children:e.jsx(U,{children:"Your selected branches do not contain any changed files for which a newer version exists in the repository."})})})}function Bt({rowDataLocalChanges:s,setRowDataLocalChanges:o,defaultColDefsCommit:a}){const{localChangesGridRef:n,isDebug:r,selectedBranches:i,showCommitView:l,setSelectedLocalChanges:c,selectedLocalChanges:d}=P(),{emitFilesRevert:u}=fe(),{RaiseClientNotificaiton:h}=oe(),[x,b]=t.useState(""),R=t.useCallback(()=>{u(d)},[u,d]),B=t.useCallback(k=>{b(k.target.value)},[b]),m=t.useCallback(k=>{var C,D,A,M;if(console.debug("PanelLocalChanges.jsx: onFileViewSelectionChanged - event",k),String(k==null?void 0:k.source).toLowerCase().includes("api"))return;let v=(D=(C=n==null?void 0:n.current)==null?void 0:C.api)==null?void 0:D.getSelectedNodes().map(E=>E.data);r&&console.debug("PanelLocalChanges.jsx: onFileViewSelectionChanged - selectedBranches",v);const T=v.filter(E=>E["Local Status"].toLowerCase()==="added");(M=(A=n==null?void 0:n.current)==null?void 0:A.api)==null||M.forEachNode(E=>{T.some(O=>O["File Path"].includes(E.data["File Path"])&&O["File Path"]!==E.data["File Path"])&&E.data["Local Status"].toLowerCase()==="added"&&!E.isSelected()&&(E.setSelected(!0),v.push(E.data),console.debug("PanelLocalChanges.jsx (onFileViewSelectionChanged): Adding ancestor node: ",E))}),c(v)},[n,r,c]),g=t.useCallback(k=>{k.success?h("TortoiseSVN diff opened successfully","success",3e3):h(`Error opening TortoiseSVN diff: ${JSON.stringify(k.error,null,4)}`,"error",0)},[h]),w=t.useMemo(()=>[{headerCheckboxSelection:!0,checkboxSelection:!0,headerCheckboxSelectionFilteredOnly:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"Branch Folder"},{field:"Branch Version",sort:"asc",sortIndex:0},{field:"File Path",flex:1,sort:"asc",sortIndex:2},{field:"Local Status",headerTooltip:"Working Copy",sort:"asc",sortIndex:1},{headerName:"Diff",filter:!1,sortable:!1,resizable:!1,cellRenderer:is,cellRendererParams:{onDiffResult:g},width:90}],[]);return t.useEffect(()=>{i.length<1||l||(b(""),o([]),c([]))},[i,l]),e.jsx(p,{children:s.length>0?e.jsxs(p,{children:[e.jsxs(N,{mb:4,alignItems:"center",children:[e.jsx(U,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(de,{placeholder:"Type to search...",onInput:B,width:"100%"})]}),e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"480px",width:"100%"},children:e.jsx(he,{ref:n,rowData:s,defaultColDef:a,columnDefs:w,onSelectionChanged:m,quickFilterText:x,domLayout:"normal",rowSelection:"multiple",suppressRowClickSelection:!0,rowMultiSelectWithClick:!0,animateRows:!0,columnMenu:"new",enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!0,paginationAutoPageSize:!0})}),e.jsx(N,{mt:4,columnGap:2,justifyContent:"flex-end",children:e.jsx(I,{label:"Requires you to select at least 1 file",hasArrow:!0,isDisabled:d.length>0,children:e.jsx(z,{onClick:R,colorScheme:"red",isDisabled:d.length<1,children:"Revert Selected"})})})]}):e.jsx(p,{children:e.jsx(U,{children:"Your selected branches do not contain any files to commit."})})})}function Dt({rowDataUntrackedChanges:s,setRowDataUntrackedChanges:o,defaultColDefsCommit:a}){const{untrackedChangesGridRef:n,selectedUntrackedChanges:r,setSelectedUntrackedChanges:i,isDebug:l,selectedBranches:c,showCommitView:d}=P(),{emitFilesAddRemove:u,emitFilesRevert:h}=fe(),[x,b]=t.useState(""),R=t.useCallback(k=>{b(k.target.value)},[b]),B=t.useCallback(()=>{var v,T;const k=(T=(v=n==null?void 0:n.current)==null?void 0:v.api)==null?void 0:T.getSelectedNodes().map(C=>C.data);l&&console.debug("PanelUntrackedChanges.jsx (onUnseenFilesSelectionChanged): selectedBranches",k),i(k)},[n,l]),m=t.useCallback(()=>{u(r)},[u,r]),g=t.useCallback(()=>{h(r)},[h,r]),w=t.useMemo(()=>[{headerCheckboxSelection:!0,checkboxSelection:!0,headerCheckboxSelectionFilteredOnly:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"Branch Folder"},{field:"Branch Version",sort:"asc",sortIndex:0},{field:"File Path",flex:1,sort:"asc",sortIndex:1},{field:"Local Status",headerTooltip:"Working Copy"}],[]);return t.useEffect(()=>{c.length<1||d||(b(""),o([]),i([]))},[c,d]),e.jsx(p,{children:s.length>0?e.jsxs(p,{children:[e.jsx(U,{mb:4,children:"Below are the list of files which are either unversioned or missing in the repository:"}),e.jsxs(N,{mb:4,alignItems:"center",children:[e.jsx(U,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(de,{placeholder:"Type to search...",onInput:R,width:"100%"})]}),e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"390px",width:"100%"},children:e.jsx(he,{ref:n,rowData:s,defaultColDef:a,columnDefs:w,onSelectionChanged:B,quickFilterText:x,domLayout:"normal",rowSelection:"multiple",rowMultiSelectWithClick:!0,animateRows:!0,columnMenu:"new",enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!0,paginationAutoPageSize:!0})}),e.jsxs(N,{mt:4,columnGap:2,justifyContent:"flex-end",children:[e.jsx(I,{label:"Requires you to select at least 1 file",hasArrow:!0,isDisabled:r.length>0,children:e.jsxs(z,{onClick:m,colorScheme:"green",isDisabled:r.length<1,children:["Add/Remove ",r.length," File",r.length>1?"s":""]})}),e.jsx(I,{label:"Requires you to select at least 1 file",hasArrow:!0,isDisabled:r.length>0,children:e.jsxs(z,{onClick:g,colorScheme:"red",isDisabled:r.length<1,children:["Revert ",r.length," File",r.length>1?"s":""]})})]})]}):e.jsx(p,{children:e.jsx(U,{children:"Your selected branches do not contain any unversioned or missing files."})})})}function ze(){const{config:s}=P();return s&&s.commitOptions?s.commitOptions:null}function _e({branchFolder:s}){const{issueNumber:o,setIssueNumber:a,selectedBranches:n}=P(),r=ze(),i=t.useCallback(d=>{const u=String(d.target.value||"").trim();/^\d*$/.test(u)&&a(h=>({...h,[s]:u}))},[s,a]),l=!s,c=!s||!(r!=null&&r.useIssuePerFolder)?!0:n==null?void 0:n.map(d=>d["Branch Folder"]).includes(s);return t.useEffect(()=>(s&&a(d=>({...d,[s]:""})),()=>{s&&Object.keys(o).includes(s)&&a(d=>G.omit(d,[s]))}),[s,a]),e.jsx(I,{label:"Please select source branch first!",isDisabled:!l,hasArrow:!0,children:e.jsxs(Ae,{isDisabled:l,isRequired:c,children:[e.jsx(Le,{children:s?`Issue Number For ${s}`:"Issue Number"}),e.jsx(de,{value:o[s]||"",onInput:i,placeholder:"Enter number"})]},s)})}function ds(){const{configurableRowData:s,sourceBranch:o,selectedBranches:a}=P(),n=t.useCallback(c=>s&&s.length>0?s.find(d=>d.id==c)["Branch Folder"]:"",[s]),r=t.useMemo(()=>{if(!(o!=null&&o.value))return[];const c=n(o.value);return[...new Set(a.filter(d=>d["Branch Folder"]!==c).map(d=>d["Branch Folder"]))]},[o,a,n]),i=t.useCallback(c=>s&&s.length>0?s.find(d=>d.id==c)["Branch Version"]:"",[s]),l=t.useCallback(c=>s&&s.length>0?s.find(d=>d.id==c)["SVN Branch"]:"",[s]);return{getBranchFolderById:n,selectedBranchFolders:r,getBranchVersionById:i,getSvnBranchById:l}}function vt({openMessageAutoFillModal:s}){const{sourceBranch:o,setSourceBranch:a,branchOptions:n,setIssueNumber:r,commitMessage:i,setCommitMessage:l,isCommitMode:c,selectedBranches:d}=P(),u=ze(),{getBranchFolderById:h,selectedBranchFolders:x}=ds(),b=t.useCallback(B=>{a(B)},[a]),R=t.useCallback(B=>{l(String(B.target.value).replace(/["`]/g,"'"))},[l]);return t.useEffect(()=>{c&&(a(null),r({}))},[c]),t.useEffect(()=>{u!=null&&u.reusePreviousCommitMessage||l("")},[u==null?void 0:u.reusePreviousCommitMessage,l,c]),t.useEffect(()=>{r(B=>Object.fromEntries(Object.entries(B).filter(([m])=>d.some(g=>g["Branch Folder"]===m))))},[d]),e.jsx(p,{children:e.jsxs(N,{columnGap:3,children:[e.jsxs(p,{flexGrow:1,children:[e.jsxs(N,{columnGap:2,mb:2,children:[e.jsx(p,{width:"50%",children:e.jsxs(Ae,{isRequired:!0,children:[e.jsx(Le,{children:"Source Branch"}),e.jsx(qs,{value:o,onChange:b,options:n,placeholder:"SVN Branch you're commiting from",selectedOptionStyle:"check",selectedOptionColorScheme:"yellow",isClearable:!0,classNamePrefix:"chakra-react-select"})]})}),e.jsx(N,{width:"50%",alignItems:"flex-end",columnGap:2,children:e.jsx(_e,{branchFolder:o&&o.value?h(o.value):null})})]}),e.jsxs(N,{columnGap:2,height:"auto",children:[e.jsxs(Ae,{width:u!=null&&u.useIssuePerFolder?"50%":"100%",isRequired:!0,children:[e.jsx(Le,{children:"Commit Message"}),e.jsx(Gs,{placeholder:"Enter Commit Message",height:"76%",resize:"none",onInput:R,value:i})]}),u!=null&&u.useIssuePerFolder?o!=null&&o.value?e.jsx(N,{width:"50%",flexDir:"column",rowGap:2,children:x.map(B=>e.jsx(_e,{branchFolder:B},B))}):e.jsx(p,{width:"50%",textAlign:"center",m:"auto",children:e.jsx(U,{fontSize:"lg",fontWeight:"600",color:"yellow.500",children:"Please select source branch first!"})}):null]})]}),e.jsx(p,{pt:8,children:e.jsx(I,{label:o!=null&&o.value?"Auto Fill Message":"Please select source branch first!",hasArrow:!0,placement:"bottom-end",children:e.jsx(_,{colorScheme:"yellow","aria-label":"Auto Fill Message",size:"md",onClick:()=>s(),icon:e.jsx(ts,{}),isDisabled:!(o!=null&&o.value)})})})]})})}function Ft({openCommitModal:s}){const{setShowCommitView:o,selectedLocalChanges:a,sourceBranch:n,issueNumber:r,commitMessage:i,setSocketPayload:l,configurableRowData:c,selectedBranches:d}=P(),{RaiseClientNotificaiton:u}=oe(),h=ze(),{selectedBranchFolders:x}=ds(),b=t.useCallback(()=>{o(!1)},[o]),R=t.useCallback(()=>{if(!n||n.value===""){u("Please select the source branch to proceed!","error");return}const B=c.find(w=>w.id==n.value),m=h!=null&&h.useIssuePerFolder?x.every(w=>r[w]&&r[w]!==""):!0,g=h!=null&&h.useIssuePerFolder&&!d.some(w=>w["Branch Folder"]===B["Branch Folder"])||r[B["Branch Folder"]];if(!r||G.isEmpty(r)||!m||!g){u("Please provide the issue number to proceed!","error");return}if(!i||i.trim()===""){u("Please provide the commit message to proceed!","error");return}l({sourceBranch:B,issueNumber:r,commitMessage:i,filesToProcess:a,commitOptions:h}),s()},[u,n,c,h,x,r,d,i,a]);return e.jsx(p,{children:e.jsxs(N,{columnGap:2,justifyContent:"center",children:[e.jsx(z,{onClick:b,leftIcon:e.jsx(De,{}),colorScheme:"yellow",children:"Refresh Process"}),e.jsx(I,{label:"Select at least 1 file",hasArrow:!0,isDisabled:a.length>0,children:e.jsxs(z,{onClick:R,leftIcon:e.jsx(Y,{as:Je}),colorScheme:"yellow",isDisabled:a.length<1,children:["Commit ",a.length>0?`${a.length} File`:"",a.length>1?"s":""]})})]})})}function It(){const{selectedBranches:s,logData:o,setLogData:a}=P(),[n,r]=t.useState([]),[i,l]=t.useState(""),c=t.useCallback(h=>{l(h.target.value)},[l]),d=t.useCallback(()=>{a([])},[a]),u=o.length===s.length;return t.useEffect(()=>{if(o.length===0)return;const h=o.map(x=>x.logs).flat();r(x=>G.isEqual(x,h)?x:h)},[o]),{rowDataLogs:n,quickFilterLogsText:i,setQuickFilterLogsText:l,onQuickFilterLogsInputChanged:c,refreshLogs:d,areLogsFetched:u}}function Rt({rowDataLogs:s,quickFilterLogsText:o,setAutoFillSelection:a=null,isAutofill:n=!1}){const r=t.useMemo(()=>({sortable:!0,resizable:!1,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),i=t.useMemo(()=>{const d=[{field:"revision",headerName:"Revision",sort:"desc",width:130},{field:"date",headerName:"Date",sortable:!1},{field:"branchFolder",headerName:"Branch Folder",width:135},{field:"branchVersion",headerName:"Branch Version",width:125},{field:"author",headerName:"Author"},{field:"message",headerName:"Message",flex:1}];return n?[{checkboxSelection:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},...d]:d},[n]),l=t.useRef(null),c=t.useCallback(()=>{var d,u;if(a){const h=(u=(d=l==null?void 0:l.current)==null?void 0:d.api)==null?void 0:u.getSelectedNodes().map(x=>x.data);a(h[0]||null)}},[a]);return e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:n?"90%":"85%",width:"100%"},children:e.jsx(he,{ref:l,rowData:s,defaultColDef:r,columnDefs:i,onSelectionChanged:c,quickFilterText:o,domLayout:"normal",columnMenu:"new",rowSelection:"single",suppressRowClickSelection:!n,animateRows:!1,immutableData:!0,suppressFlash:!0,enableCellTextSelection:!0,ensureDomOrder:!0,pagination:!0,paginationAutoPageSize:!0})})}function us({setAutoFillSelection:s=!1,isAutofill:o=!1}){const{selectedBranches:a,logData:n}=P(),{rowDataLogs:r,quickFilterLogsText:i,onQuickFilterLogsInputChanged:l,refreshLogs:c,areLogsFetched:d}=It();return d?e.jsxs(p,{h:"100%",children:[e.jsxs(N,{mb:4,width:"100%",alignItems:"center",columnGap:4,children:[e.jsxs(N,{alignItems:"center",width:"100%",children:[e.jsx(U,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(de,{placeholder:"Type to search...",onInput:l,width:"100%"})]}),e.jsx(p,{children:e.jsx(I,{label:"Refresh",hasArrow:!0,children:e.jsx(_,{onClick:c,icon:e.jsx(De,{}),colorScheme:"yellow","aria-label":"Refresh"})})})]}),e.jsx(Rt,{rowDataLogs:r,quickFilterLogsText:i,setAutoFillSelection:s,isAutofill:o})]}):e.jsxs(p,{children:[e.jsxs(p,{mb:4,children:[e.jsx(U,{fontWeight:600,children:"Showing SVN Log for the following branches:"}),e.jsx(Me,{spacing:3,children:a.map(u=>{const h=n.find(x=>x.id===u.id);return e.jsxs(ae,{display:"flex",alignItems:"center",children:[e.jsx(re,{w:30,h:30,as:h?ie:Qs,color:"yellow.500"}),Fe(u["Branch Folder"],u["Branch Version"],u["SVN Branch"])]},u.branchId)})})]}),e.jsx(N,{justifyContent:"center",children:e.jsx(Ys,{value:n.length/a.length*360,color:"yellow.300",size:"100px",children:e.jsxs(Ks,{children:[n.length," / ",a.length]})})})]})}function Nt(s){const{data:o}=s,a=async()=>{window.open(o.url,"_blank")};return e.jsx(_,{"aria-label":"Diff",size:"sm",icon:e.jsx(Js,{}),onClick:a,colorScheme:"yellow"})}function Tt({rowDataTrello:s,quickFilterTrelloText:o,setAutoFillSelection:a}){const n=t.useMemo(()=>({sortable:!0,resizable:!1,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]),r=t.useMemo(()=>[{checkboxSelection:!0,width:20,resizable:!1,suppressMovable:!1,filter:!1,editable:!1,headerClass:"branch-table-header-cell",cellClass:"branch-table-body-cell"},{field:"name",headerName:"Name",flex:1},{field:"lastActivityDate",headerName:"Last Activity Date"},{field:"url",headerName:"Goto Trello",filter:!1,sortable:!1,resizable:!1,cellRenderer:Nt,width:120}],[]),i=t.useRef(null),l=t.useCallback(()=>{var d,u;const c=(u=(d=i==null?void 0:i.current)==null?void 0:d.api)==null?void 0:u.getSelectedNodes().map(h=>h.data);a(c[0]||null)},[a]);return e.jsx("div",{className:"ag-theme-balham-dark compact",style:{height:"80%",width:"100%"},children:e.jsx(he,{ref:i,rowData:s,defaultColDef:n,columnDefs:r,onSelectionChanged:l,quickFilterText:o,domLayout:"normal",columnMenu:"new",rowSelection:"single",suppressRowClickSelection:!1,animateRows:!1,enableCellTextSelection:!0,pagination:!0,paginationAutoPageSize:!0})})}function Mt({setAutoFillSelection:s}){const{socket:o}=P(),{key:a,token:n,isTrelloIntegrationEnabled:r,emitTrelloCardNamesSearch:i}=cs(),[l,c]=t.useState(""),[d,u]=t.useState(""),[h,x]=t.useState([]),b=t.useCallback(G.debounce(g=>{g.trim()!==""&&i(a,n,g)},400),[a,n,i]),R=t.useCallback(g=>{c(String(g.target.value).trim())},[c]),B=t.useCallback(()=>{l.trim()!==""&&i(a,n,l)},[l,a,n,i]),m=t.useCallback(g=>{u(g.target.value)},[]);return t.useEffect(()=>(b(l),()=>b.cancel()),[l,b]),t.useEffect(()=>{const g=w=>{x(w&&w.length>0?w:[])};return o==null||o.on("trello-result-search-names-card",g),()=>o==null?void 0:o.off("trello-result-search-names-card",g)},[o]),r?e.jsxs(p,{h:"100%",children:[e.jsxs(N,{mb:4,width:"100%",alignItems:"center",columnGap:4,children:[e.jsxs(N,{alignItems:"center",width:"100%",children:[e.jsx(U,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Trello Query:"}),e.jsx(de,{placeholder:"Type to search...",onInput:R,width:"100%"})]}),e.jsx(p,{children:e.jsx(I,{label:"Resubmit Query",hasArrow:!0,children:e.jsx(_,{onClick:B,icon:e.jsx(De,{}),colorScheme:"yellow","aria-label":"Resubmit"})})})]}),e.jsx(N,{mb:4,width:"100%",alignItems:"center",columnGap:4,children:e.jsxs(N,{alignItems:"center",width:"100%",children:[e.jsx(U,{mr:2,fontWeight:"600",whiteSpace:"nowrap",children:"Quick Filter:"}),e.jsx(de,{placeholder:"Type to search...",onInput:m,width:"100%"})]})}),e.jsx(Tt,{rowDataTrello:h,quickFilterTrelloText:d,setAutoFillSelection:s})]}):e.jsx(p,{h:"100%",p:4,children:e.jsxs(U,{fontSize:"lg",fontWeight:"600",color:"red.500",children:["You need to"," ",e.jsxs(Qe,{href:"https://help.merge.dev/en/articles/8757597-trello-how-do-i-link-my-account",isExternal:!0,color:"yellow.500",children:["set up Trello Integration ",e.jsx(ts,{mx:"2px"})]})," ","in the configuration file to use this feature."]})})}function At({isModalOpen:s,closeModal:o}){const{setIssueNumber:a,setCommitMessage:n,setPostCommitData:r}=P(),[i,l]=t.useState(0),[c,d]=t.useState([null,null]),[u,h]=t.useState(!0),x=t.useCallback(m=>{l(m),d(m===0?g=>[g[0],null]:g=>[null,g[1]])},[l]),b=t.useCallback(m=>{d(g=>[m,...g.slice(1)])},[d]),R=t.useCallback(m=>{d(g=>[g[0],m])},[d]),B=t.useCallback(()=>{console.debug("Selected tab index:",i),console.debug("Selected autofill selection:",JSON.stringify(c,null,4));let m=c[i];if(i===0){const g=m.message,w=g.match(/\s*(Issue)*\s*(\d+)\s*/),k=w?w[2]:null,v=g.replace(/\s*(Issue)*\s*(\d+)?\s*(\([^\)]+\))*\s?:?\s*/,"");k&&a(T=>Object.fromEntries(Object.keys(T).map(C=>[C,k]))),v.trim()!==""&&n(v)}else{const g=m.name,w=g.match(/\s*(Issue)*\s*(\d+)\s*/),k=w?w[2]:null,v=g.replace(/\s*(Issue)*\s*(\d+)/,"");k&&a(T=>Object.fromEntries(Object.keys(T).map(C=>[C,k]))),v.trim()!==""&&n(v),r({type:"trello",data:m})}o()},[i,c,a,n,r,o]);return t.useEffect(()=>{h(!(c.length==2&&(c[0]||c[1])))},[c]),t.useEffect(()=>{d([null,null]),l(0)},[s]),e.jsxs(Ze,{isOpen:s,onClose:o,isCentered:!0,motionPreset:"slideInBottom",scrollBehavior:"inside",size:"xl",closeOnOverlayClick:!0,children:[e.jsx(Ce,{}),e.jsxs(es,{maxH:"95%",maxW:"95%",children:[e.jsx(we,{children:e.jsx(ee,{as:"h2",size:"lg",children:"Autofill Commit Message"})}),e.jsx(ve,{size:"lg"}),e.jsx(je,{children:e.jsx(p,{height:"70vh",children:e.jsxs(ns,{variant:"solid-rounded",colorScheme:"yellow",defaultIndex:0,isLazy:!0,h:"100%",onChange:m=>x(m),children:[e.jsxs(ls,{children:[e.jsx(be,{children:"SVN Logs"}),e.jsx(be,{children:"Trello"})]}),e.jsxs(os,{h:"90%",children:[e.jsx(pe,{px:0,pb:0,h:"100%",children:e.jsx(us,{setAutoFillSelection:b,isAutofill:!0})}),e.jsx(pe,{px:0,pb:0,h:"100%",children:e.jsx(Mt,{setAutoFillSelection:R})})]})]})})}),e.jsxs(Be,{children:[e.jsx(z,{mr:3,onClick:()=>o(),children:"Cancel"}),e.jsx(I,{hasArrow:!0,label:"Please select exactly one row!",placement:"top-start",isDisabled:!u,children:e.jsx(z,{colorScheme:"yellow",onClick:B,isDisabled:u,children:"Select"})})]})]})]})}function Lt(){const{config:s,updateConfig:o,setSourceBranch:a,setIssueNumber:n}=P(),[r,i]=t.useState({}),l=t.useCallback((c,d)=>{i(u=>({...u,[c]:d}))},[i]);return t.useEffect(()=>{!s||G.isEmpty(s)||(s.commitOptions?i(s.commitOptions):o(c=>({...c,commitOptions:{useFolderOnlySource:!1,useIssuePerFolder:!1,reusePreviousCommitMessage:!1}})))},[s]),t.useEffect(()=>{G.isEmpty(r)||o(c=>G.isEqual(c.commitOptions,r)?c:{...c,commitOptions:r})},[r]),t.useEffect(()=>{a(null)},[r==null?void 0:r.useFolderOnlySource,a]),t.useEffect(()=>{n({})},[r==null?void 0:r.useIssuePerFolder,n]),e.jsxs(p,{mb:4,children:[e.jsx(ee,{as:"h6",size:"sm",children:"Commit Options"}),e.jsx(ss,{colorScheme:"yellow",children:e.jsxs(Xs,{direction:"row",spacing:4,mt:2,children:[e.jsx(Z,{isChecked:r.useFolderOnlySource,onChange:c=>l("useFolderOnlySource",c.target.checked),children:e.jsx(I,{label:"Removes extra branch details from source branch.",hasArrow:!0,placement:"bottom-start",children:"Use Folder Only Source Branch?"})}),e.jsx(Z,{isChecked:r.useIssuePerFolder,onChange:c=>l("useIssuePerFolder",c.target.checked),children:e.jsx(I,{label:"Allows users to input issue number for each branch folder.",hasArrow:!0,placement:"bottom-start",children:"Use 1 Issue Per Folder?"})}),e.jsx(Z,{isChecked:r.reusePreviousCommitMessage,onChange:c=>l("reusePreviousCommitMessage",c.target.checked),children:e.jsx(I,{label:"Reuses the commit message from the previous commit made in Titan.",hasArrow:!0,children:"Reuse Previous Commit Message?"})})]})})]})}function Vt(){const{isDebug:s,setIsCommitMode:o,selectedBranchStatuses:a,showCommitView:n,setShowCommitView:r,selectedBranches:i,configurableRowData:l}=P(),[c,d]=t.useState({}),[u,h]=t.useState([]),[x,b]=t.useState([]),{isOpen:R,onOpen:B,onClose:m}=Ve(),{isOpen:g,onOpen:w,onClose:k}=Ve(),v=t.useMemo(()=>({resizable:!0,wrapText:!0,autoHeight:!0,filter:!0,suppressMovable:!0,editable:!1,wrapHeaderText:!0,autoHeaderHeight:!0}),[]);t.useEffect(()=>{if(i.length<1||n){i.length<1&&o(!1);return}d({})},[i,n]),t.useEffect(()=>{s&&(console.debug("Branch Status Rows:",a),console.debug("Selected Rows:",i))},[s,a,i]),t.useEffect(()=>{a.length===i.length&&(a.forEach(M=>{let E=M.id,$=M.status.filesToCommit,O=M.status.filesToUpdate;const y=l.find(W=>W.id===E);if(O.length>0){const W=Fe(y["Branch Folder"],y["Branch Version"],y["SVN Branch"]);d(H=>({...H,[W]:[...H[W]||[],...O]}))}if($.length>0){const W=$.map(H=>({branchId:E,"Branch Folder":y["Branch Folder"],"Branch Version":y["Branch Version"],"SVN Branch":y["SVN Branch"],"Full Path":H.path,"File Path":`${ft(M.status.branch)}\\${H.pathDisplay}`,"Local Status":H.wcStatus}));h(H=>[...H,...W.filter(K=>!["unversioned","missing"].includes(K["Local Status"]))]),b(H=>[...H,...W.filter(K=>["unversioned","missing"].includes(K["Local Status"]))])}}),r(!0))},[a,i,l]);const T=Object.keys(c).length>0,C=u.length>0,D=x.length>0,A=T||C||D;return e.jsxs(p,{children:[e.jsx(Lt,{}),e.jsx(p,{mb:6,children:e.jsx(vt,{openMessageAutoFillModal:w})}),e.jsx(Zs,{isLoaded:n&&A,startColor:"yelow.500",endColor:"yellow.500",children:e.jsxs(ns,{variant:"solid-rounded",colorScheme:"yellow",defaultIndex:T?0:C?1:2,isLazy:!1,children:[e.jsxs(ls,{children:[e.jsx(be,{isDisabled:!T,children:e.jsx(I,{label:"No files to update!",hasArrow:!0,isDisabled:T,children:"Files to Update"})}),e.jsx(be,{isDisabled:!C,children:e.jsx(I,{label:"No files to commit!",hasArrow:!0,isDisabled:C,children:"Local Changes"})}),e.jsx(be,{isDisabled:!D,children:e.jsx(I,{label:"No unversioned/missing files!",hasArrow:!0,isDisabled:D,children:"Untracked Changes"})})]}),e.jsxs(os,{children:[e.jsx(pe,{px:0,children:e.jsx(kt,{fileUpdates:c})}),e.jsx(pe,{px:0,children:e.jsx(Bt,{rowDataLocalChanges:u,setRowDataLocalChanges:h,defaultColDefsCommit:v})}),e.jsx(pe,{px:0,children:e.jsx(Dt,{rowDataUntrackedChanges:x,setRowDataUntrackedChanges:b,defaultColDefsCommit:v})})]})]})}),n&&!A?e.jsxs(U,{mt:4,className:"animation-pulse",fontWeight:600,textAlign:"center",children:["No changes have been spotted!",e.jsx("br",{}),"Please use the refresh button 👇 if you have recently made a change"]}):e.jsx(e.Fragment,{}),e.jsx(p,{mt:6,children:e.jsx(Ft,{openCommitModal:B})}),e.jsx(yt,{isModalOpen:R,closeModal:m}),e.jsx(At,{isModalOpen:g,closeModal:k})]})}function Et(){const{showSelectedBranchesLog:s,setShowSelectedBranchesLog:o}=P();return e.jsxs(et,{isOpen:s,onClose:()=>o(!1),placement:"left",size:"full",children:[e.jsx(Ce,{}),e.jsxs(st,{children:[e.jsx(ve,{size:"lg"}),e.jsx(we,{children:"Selected Branches: SVN Log"}),e.jsx(je,{children:e.jsx(p,{height:"100%",children:e.jsx(us,{})})})]})]})}function Pt(){const{toast:s,RaiseClientNotificaiton:o}=oe(),{isOpen:a,onOpen:n,onClose:r}=Ve(),i=t.useRef(),[l,c]=t.useState(!1);t.useEffect(()=>{if(!window.electron){o("Electron context is not available. Updates cannot be checked.","warning",5e3);return}return window.electron.on("update-available",()=>{s.closeAll(),n()}),window.electron.on("update-error",h=>{o(`An error occurred while checking for updates: ${h}`,"error",5e3),c(!1)}),()=>{window.electron.removeAllListeners("update-available"),window.electron.removeAllListeners("update-error")}},[s,n]);const d=t.useCallback(()=>{r(),o("You may update the application later by manually triggering an update check or wait until Titan does this","info",5e3)},[r,o]),u=t.useCallback(()=>{if(l){o("Update is already in progress. Please wait.","info",5e3);return}window.electron?(c(!0),window.electron.downloadUpdate().catch(h=>{c(!1),o(`An error occurred while downloading the update: ${h}`,"error",5e3)}),window.electron.on("update-downloaded",()=>{o("Update has been downloaded successfully. Titan will now restart to apply the update.","info",5e3),window.electron.removeAllListeners("update-downloaded"),r()}),window.electron.on("update-not-available",()=>{o("Titan is up to date","info",3e3),window.electron.removeAllListeners("update-not-available"),c(!1),r()})):o("Cannot update Titan in a non-desktop application environment","error",5e3)},[l,o,c,r]);return e.jsx(Ye,{isOpen:a,leastDestructiveRef:i,onClose:r,motionPreset:"slideInBottom",closeOnOverlayClick:!l,children:e.jsx(Ce,{children:e.jsxs(Ke,{children:[e.jsx(we,{fontSize:"lg",fontWeight:"bold",children:"Update Available"}),l?e.jsx(e.Fragment,{}):e.jsx(ve,{}),e.jsx(je,{children:"A new version of Titan is available. Would you like to download and install the update?"}),e.jsxs(Be,{children:[e.jsx(z,{colorScheme:"red",ref:i,onClick:d,isDisabled:l,children:"Cancel"}),e.jsx(z,{colorScheme:"yellow",onClick:u,ml:3,isDisabled:l,children:"Confirm"})]})]})})})}function zt(){if(!window.electron)return e.jsx(e.Fragment,{});const{colorMode:s}=Ge(),o=t.useCallback(()=>{window.electron.minimizeWindow()},[]),a=t.useCallback(()=>{window.electron.maximizeWindow()},[]),n=t.useCallback(()=>{window.electron.closeWindow()},[]);return e.jsx(tt.header,{w:"100%",position:"fixed",bgColor:s==="light"?"white":"#121212",className:"titanHead",zIndex:9999999,top:0,children:e.jsxs(N,{justifyContent:"space-between",alignItems:"center",p:2,position:"static",children:[e.jsx(ee,{as:"h6",size:"sm",noOfLines:1,className:"animation-fadein-left-forward",children:"Titan"}),e.jsxs(N,{alignItems:"center",columnGap:2,flexWrap:"nowrap",wrap:"nowrap",children:[e.jsx(_,{"aria-label":"Minimize",size:"xs",icon:e.jsx(nt,{}),onClick:o,colorScheme:"gray",_hover:{bg:"#FAF089",color:"#1A202C"}}),e.jsx(_,{"aria-label":"Maximize",size:"xs",icon:e.jsx(lt,{}),onClick:a,colorScheme:"gray",_hover:{bg:"#FAF089",color:"#1A202C"}}),e.jsx(_,{"aria-label":"Close",size:"xs",icon:e.jsx(Xe,{}),onClick:n,colorScheme:"gray",_hover:{bg:"#FEB2B2",color:"#1A202C"}})]})]})})}function Ot(){const{isCommitMode:s,selectedBranches:o,configurableRowData:a}=P(),{RaiseClientNotificaiton:n}=oe();return t.useEffect(()=>{if(window.electron)return window.electron.onAppClosing(()=>{n("App is closing, performing cleanup...","info",0),window.electron.closeWindow()}),()=>{window.electron.removeAppClosingListener()};console.warn("Electron specific logic is not available in browser mode.")},[]),e.jsxs(p,{className:"titanBody",children:[e.jsx(zt,{}),e.jsxs(p,{p:10,children:[e.jsx(bt,{}),e.jsx(Pt,{}),e.jsxs(N,{rowGap:4,flexDirection:"column",children:[e.jsx(p,{children:e.jsx(St,{})}),e.jsx(ot,{in:s,animateOpacity:!0,children:e.jsxs(p,{id:"sectionCommit",children:[e.jsxs(ee,{as:"h2",size:"lg",noOfLines:1,mb:4,className:"animation-pulse",lineHeight:"1.4",children:["Committing ",o.length==a.length?"All":`${o.length}/${a.length}`," Branch",o.length==1?"":"es"]}),e.jsx(Vt,{})]})})]}),e.jsx(Et,{})]})]})}const{definePartsStyle:hs,defineMultiStyleConfig:fs}=dt(ut.keys),Ut=hs({overlay:{bg:"blackAlpha.900"},dialog:{bg:"gray.900",color:"white",boxShadow:"rgba(255, 255, 255, 0.07) 0px 0px 20px 7px"},header:{bg:"gray.900",color:"white",borderRadius:"20px",p:4},body:{p:4,color:"white"},footer:{bg:"gray.900",p:4,color:"white",borderRadius:"20px"}}),Wt=fs({baseStyle:Ut}),Ht=hs({overlay:{bg:"blackAlpha.900"},dialog:{mt:gt,bg:"gray.900",color:"white",boxShadow:"rgba(255, 255, 255, 0.07) 0px 0px 20px 7px"},header:{bg:"gray.900",color:"white",borderRadius:"20px",p:4},body:{p:4,color:"white"},footer:{bg:"gray.900",p:2,color:"white",borderRadius:"20px"}}),$t=fs({baseStyle:Ht}),_t={initialColorMode:"dark",useSystemColorMode:!1},qe=at({config:_t,components:{Modal:Wt,Drawer:$t}});rt.createRoot(document.getElementById("root")).render(e.jsx(Ee.StrictMode,{children:e.jsxs(it,{theme:qe,children:[e.jsx(ct,{initialColorMode:qe.config.initialColorMode}),e.jsx(xt,{children:e.jsx(Ot,{})})]})})); diff --git a/dist/assets/vendor.js b/dist/assets/vendor.js index 6687b34..ed72833 100644 --- a/dist/assets/vendor.js +++ b/dist/assets/vendor.js @@ -413,9 +413,9 @@ Error generating stack: `+i.message+` `),dY=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Nw=new Map;function or(e){var t=Nw.get(e);if(t===void 0){if(!dY.test(e))throw Error(se(65,e));t=L("<"+e),Nw.set(e,t)}return t}var fY=L("");function pY(e,t,n,r,o){switch(t){case"select":e.push(or("select"));var i=null,s=null;for(c in n)if(Ht.call(n,c)){var a=n[c];if(a!=null)switch(c){case"children":i=a;break;case"dangerouslySetInnerHTML":s=a;break;case"defaultValue":case"value":break;default:nn(e,r,c,a)}}return e.push(ro),Dc(e,s,i),i;case"option":s=o.selectedValue,e.push(or("option"));var l=a=null,u=null,c=null;for(i in n)if(Ht.call(n,i)){var d=n[i];if(d!=null)switch(i){case"children":a=d;break;case"selected":u=d;break;case"dangerouslySetInnerHTML":c=d;break;case"value":l=d;default:nn(e,r,i,d)}}if(s!=null)if(n=l!==null?""+l:cY(a),Fv(s)){for(r=0;r"),vY=L(''),yY=L(""),bY=L(''),xY=L(""),wY=L(""),kY=L("");function Vw(e,t,n){if(q(e,bY),n===null)throw Error(se(395));return q(e,n),Ie(e,SY)}var TY=L('"),OY=L('"),IY=L('"),FY=L(''),NY=L(""),VY=L(''),BY=L(""),jY=L(''),WY=L(""),UY=L(''),KY=L("");function GY(e,t,n,r){switch(n.insertionMode){case 0:case 1:return q(e,TY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,_Y);case 2:return q(e,OY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,RY);case 3:return q(e,IY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,AY);case 4:return q(e,FY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,LY);case 5:return q(e,VY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,zY);case 6:return q(e,jY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,HY);case 7:return q(e,UY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,qY);default:throw Error(se(397))}}function YY(e,t){switch(t.insertionMode){case 0:case 1:return Ie(e,$Y);case 2:return Ie(e,MY);case 3:return Ie(e,DY);case 4:return Ie(e,NY);case 5:return Ie(e,BY);case 6:return Ie(e,WY);case 7:return Ie(e,KY);default:throw Error(se(397))}}var XY=L('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),QY=L('$RS("'),ZY=L('","'),JY=L('")<\/script>'),eX=L('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),tX=L('$RC("'),nX=L('","'),rX=L('")<\/script>'),oX=L('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),iX=L('$RX("'),sX=L('"'),aX=L(")<\/script>"),_h=L(","),lX=/[<\u2028\u2029]/g;function $h(e){return JSON.stringify(e).replace(lX,function(t){switch(t){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var el=Object.assign,uX=Symbol.for("react.element"),M$=Symbol.for("react.portal"),I$=Symbol.for("react.fragment"),A$=Symbol.for("react.strict_mode"),D$=Symbol.for("react.profiler"),F$=Symbol.for("react.provider"),L$=Symbol.for("react.context"),N$=Symbol.for("react.forward_ref"),V$=Symbol.for("react.suspense"),z$=Symbol.for("react.suspense_list"),B$=Symbol.for("react.memo"),Py=Symbol.for("react.lazy"),cX=Symbol.for("react.scope"),dX=Symbol.for("react.debug_trace_mode"),fX=Symbol.for("react.legacy_hidden"),pX=Symbol.for("react.default_value"),zw=Symbol.iterator;function Lv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I$:return"Fragment";case M$:return"Portal";case D$:return"Profiler";case A$:return"StrictMode";case V$:return"Suspense";case z$:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L$:return(e.displayName||"Context")+".Consumer";case F$:return(e._context.displayName||"Context")+".Provider";case N$:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B$:return t=e.displayName||null,t!==null?t:Lv(e.type)||"Memo";case Py:t=e._payload,e=e._init;try{return Lv(e(t))}catch{}}return null}var j$={};function Bw(e,t){if(e=e.contextTypes,!e)return j$;var n={},r;for(r in e)n[r]=t[r];return n}var ni=null;function Yf(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var n=t.parent;if(e===null){if(n!==null)throw Error(se(401))}else{if(n===null)throw Error(se(401));Yf(e,n)}t.context._currentValue=t.value}}function H$(e){e.context._currentValue=e.parentValue,e=e.parent,e!==null&&H$(e)}function W$(e){var t=e.parent;t!==null&&W$(t),e.context._currentValue=e.value}function U$(e,t){if(e.context._currentValue=e.parentValue,e=e.parent,e===null)throw Error(se(402));e.depth===t.depth?Yf(e,t):U$(e,t)}function q$(e,t){var n=t.parent;if(n===null)throw Error(se(402));e.depth===n.depth?Yf(e,n):q$(e,n),t.context._currentValue=t.value}function Ad(e){var t=ni;t!==e&&(t===null?W$(e):e===null?H$(t):t.depth===e.depth?Yf(t,e):t.depth>e.depth?U$(t,e):q$(t,e),ni=e)}var jw={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function Hw(e,t,n,r){var o=e.state!==void 0?e.state:null;e.updater=jw,e.props=n,e.state=o;var i={queue:[],replace:!1};e._reactInternals=i;var s=t.contextType;if(e.context=typeof s=="object"&&s!==null?s._currentValue:r,s=t.getDerivedStateFromProps,typeof s=="function"&&(s=s(n,o),o=s==null?o:el({},o,s),e.state=o),typeof t.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function"&&(typeof e.UNSAFE_componentWillMount=="function"||typeof e.componentWillMount=="function"))if(t=e.state,typeof e.componentWillMount=="function"&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount=="function"&&e.UNSAFE_componentWillMount(),t!==e.state&&jw.enqueueReplaceState(e,e.state,null),i.queue!==null&&0>=s,o-=s,{id:1<<32-Fc(t)+o|n<>>=0,e===0?32:31-(mX(e)/vX|0)|0}function yX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bX=typeof Object.is=="function"?Object.is:yX,qr=null,Ey=null,Lc=null,_e=null,$a=!1,Dd=!1,Ll=0,ho=null,Xf=0;function Ko(){if(qr===null)throw Error(se(321));return qr}function Ww(){if(0e.progressiveChunkSize)r.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(r),Vw(t,e.responseState,r.id),Wu(e,t,n);else{if(Ie(t,yY),n=r.completedSegments,n.length!==1)throw Error(se(391));Qf(e,t,n[0])}return Ie(t,wY)}function Zw(e,t,n){return GY(t,e.responseState,n.formatContext,n.id),Qf(e,t,n),YY(t,n.formatContext)}function Jw(e,t,n){for(var r=n.completedSegments,o=0;oe.length)&&(t=e.length);for(var n=0,r=Array(t);n"),vY=L(''),yY=L(""),bY=L(''),xY=L(""),wY=L(""),kY=L("");function Vw(e,t,n){if(q(e,bY),n===null)throw Error(se(395));return q(e,n),Ie(e,SY)}var TY=L('"),OY=L('"),IY=L('"),FY=L(''),NY=L(""),VY=L(''),BY=L(""),jY=L(''),WY=L(""),UY=L(''),KY=L("");function GY(e,t,n,r){switch(n.insertionMode){case 0:case 1:return q(e,TY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,_Y);case 2:return q(e,OY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,RY);case 3:return q(e,IY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,AY);case 4:return q(e,FY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,LY);case 5:return q(e,VY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,zY);case 6:return q(e,jY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,HY);case 7:return q(e,UY),q(e,t.segmentPrefix),q(e,le(r.toString(16))),Ie(e,qY);default:throw Error(se(397))}}function YY(e,t){switch(t.insertionMode){case 0:case 1:return Ie(e,$Y);case 2:return Ie(e,MY);case 3:return Ie(e,DY);case 4:return Ie(e,NY);case 5:return Ie(e,BY);case 6:return Ie(e,WY);case 7:return Ie(e,KY);default:throw Error(se(397))}}var XY=L('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),QY=L('$RS("'),ZY=L('","'),JY=L('")<\/script>'),eX=L('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),tX=L('$RC("'),nX=L('","'),rX=L('")<\/script>'),oX=L('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),iX=L('$RX("'),sX=L('"'),aX=L(")<\/script>"),_h=L(","),lX=/[<\u2028\u2029]/g;function $h(e){return JSON.stringify(e).replace(lX,function(t){switch(t){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var el=Object.assign,uX=Symbol.for("react.element"),M$=Symbol.for("react.portal"),I$=Symbol.for("react.fragment"),A$=Symbol.for("react.strict_mode"),D$=Symbol.for("react.profiler"),F$=Symbol.for("react.provider"),L$=Symbol.for("react.context"),N$=Symbol.for("react.forward_ref"),V$=Symbol.for("react.suspense"),z$=Symbol.for("react.suspense_list"),B$=Symbol.for("react.memo"),Py=Symbol.for("react.lazy"),cX=Symbol.for("react.scope"),dX=Symbol.for("react.debug_trace_mode"),fX=Symbol.for("react.legacy_hidden"),pX=Symbol.for("react.default_value"),zw=Symbol.iterator;function Lv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I$:return"Fragment";case M$:return"Portal";case D$:return"Profiler";case A$:return"StrictMode";case V$:return"Suspense";case z$:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case L$:return(e.displayName||"Context")+".Consumer";case F$:return(e._context.displayName||"Context")+".Provider";case N$:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B$:return t=e.displayName||null,t!==null?t:Lv(e.type)||"Memo";case Py:t=e._payload,e=e._init;try{return Lv(e(t))}catch{}}return null}var j$={};function Bw(e,t){if(e=e.contextTypes,!e)return j$;var n={},r;for(r in e)n[r]=t[r];return n}var ni=null;function Yf(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var n=t.parent;if(e===null){if(n!==null)throw Error(se(401))}else{if(n===null)throw Error(se(401));Yf(e,n)}t.context._currentValue=t.value}}function H$(e){e.context._currentValue=e.parentValue,e=e.parent,e!==null&&H$(e)}function W$(e){var t=e.parent;t!==null&&W$(t),e.context._currentValue=e.value}function U$(e,t){if(e.context._currentValue=e.parentValue,e=e.parent,e===null)throw Error(se(402));e.depth===t.depth?Yf(e,t):U$(e,t)}function q$(e,t){var n=t.parent;if(n===null)throw Error(se(402));e.depth===n.depth?Yf(e,n):q$(e,n),t.context._currentValue=t.value}function Ad(e){var t=ni;t!==e&&(t===null?W$(e):e===null?H$(t):t.depth===e.depth?Yf(t,e):t.depth>e.depth?U$(t,e):q$(t,e),ni=e)}var jw={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function Hw(e,t,n,r){var o=e.state!==void 0?e.state:null;e.updater=jw,e.props=n,e.state=o;var i={queue:[],replace:!1};e._reactInternals=i;var s=t.contextType;if(e.context=typeof s=="object"&&s!==null?s._currentValue:r,s=t.getDerivedStateFromProps,typeof s=="function"&&(s=s(n,o),o=s==null?o:el({},o,s),e.state=o),typeof t.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function"&&(typeof e.UNSAFE_componentWillMount=="function"||typeof e.componentWillMount=="function"))if(t=e.state,typeof e.componentWillMount=="function"&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount=="function"&&e.UNSAFE_componentWillMount(),t!==e.state&&jw.enqueueReplaceState(e,e.state,null),i.queue!==null&&0>=s,o-=s,{id:1<<32-Fc(t)+o|n<>>=0,e===0?32:31-(mX(e)/vX|0)|0}function yX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bX=typeof Object.is=="function"?Object.is:yX,qr=null,Ey=null,Lc=null,_e=null,$a=!1,Dd=!1,Ll=0,ho=null,Xf=0;function Ko(){if(qr===null)throw Error(se(321));return qr}function Ww(){if(0e.progressiveChunkSize)r.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(r),Vw(t,e.responseState,r.id),Wu(e,t,n);else{if(Ie(t,yY),n=r.completedSegments,n.length!==1)throw Error(se(391));Qf(e,t,n[0])}return Ie(t,wY)}function Zw(e,t,n){return GY(t,e.responseState,n.formatContext,n.id),Qf(e,t,n),YY(t,n.formatContext)}function Jw(e,t,n){for(var r=n.completedSegments,o=0;oe.length)&&(t=e.length);for(var n=0,r=Array(t);n=0||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var _X=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Zf(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,o=r===void 0?!1:r,i=e.defaultValue,s=i===void 0?null:i,a=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,p=e.value,m=Zn(e,_X),h=g.useState(a!==void 0?a:n),S=st(h,2),v=S[0],y=S[1],b=g.useState(l!==void 0?l:o),x=st(b,2),k=x[0],P=x[1],C=g.useState(p!==void 0?p:s),E=st(C,2),_=E[0],$=E[1],M=g.useCallback(function(O,D){typeof u=="function"&&u(O,D),$(O)},[u]),F=g.useCallback(function(O,D){var V;typeof c=="function"&&(V=c(O,D)),y(V!==void 0?V:O)},[c]),W=g.useCallback(function(){typeof f=="function"&&f(),P(!0)},[f]),re=g.useCallback(function(){typeof d=="function"&&d(),P(!1)},[d]),H=a!==void 0?a:v,N=l!==void 0?l:k,R=p!==void 0?p:_;return G(G({},m),{},{inputValue:H,menuIsOpen:N,onChange:M,onInputChange:F,onMenuClose:re,onMenuOpen:W,value:R})}function $X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nk(e,t){for(var n=0;n({x:e,y:e});function BX(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function t4(e){return r4(e)?(e.nodeName||"").toLowerCase():"#document"}function Kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function n4(e){var t;return(t=(r4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function r4(e){return e instanceof Node||e instanceof Kr(e).Node}function jX(e){return e instanceof Element||e instanceof Kr(e).Element}function Ry(e){return e instanceof HTMLElement||e instanceof Kr(e).HTMLElement}function rk(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kr(e).ShadowRoot}function o4(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=My(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function HX(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function WX(e){return["html","body","#document"].includes(t4(e))}function My(e){return Kr(e).getComputedStyle(e)}function UX(e){if(t4(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rk(e)&&e.host||n4(e);return rk(t)?t.host:t}function i4(e){const t=UX(e);return WX(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ry(t)&&o4(t)?t:i4(t)}function jd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=i4(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Kr(o);return i?t.concat(s,s.visualViewport||[],o4(o)?o:[],s.frameElement&&n?jd(s.frameElement):[]):t.concat(o,jd(o,[],n))}function qX(e){const t=My(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ry(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=zd(n)!==i||zd(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Iy(e){return jX(e)?e:e.contextElement}function ok(e){const t=Iy(e);if(!Ry(t))return Bd(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qX(t);let s=(i?zd(n.width):n.width)/r,a=(i?zd(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const KX=Bd(0);function GX(e){const t=Kr(e);return!HX()||!t.visualViewport?KX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function YX(e,t,n){return!1}function ik(e,t,n,r){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),i=Iy(e);let s=Bd(1);t&&(s=ok(e));const a=YX()?GX(i):Bd(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const f=Kr(i),p=r;let m=f,h=m.frameElement;for(;h&&r&&p!==m;){const S=ok(h),v=h.getBoundingClientRect(),y=My(h),b=v.left+(h.clientLeft+parseFloat(y.paddingLeft))*S.x,x=v.top+(h.clientTop+parseFloat(y.paddingTop))*S.y;l*=S.x,u*=S.y,c*=S.x,d*=S.y,l+=b,u+=x,m=Kr(h),h=m.frameElement}}return BX({width:c,height:d,x:l,y:u})}function XX(e,t){let n=null,r;const o=n4(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p=Uu(c),m=Uu(o.clientWidth-(u+d)),h=Uu(o.clientHeight-(c+f)),S=Uu(u),y={rootMargin:-p+"px "+-m+"px "+-h+"px "+-S+"px",threshold:zX(0,VX(1,l))||1};let b=!0;function x(k){const P=k[0].intersectionRatio;if(P!==l){if(!b)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(x,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(e)}return s(!0),i}function QX(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Iy(e),c=o||i?[...u?jd(u):[],...jd(t)]:[];c.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=u&&a?XX(u,n):null;let f=-1,p=null;s&&(p=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),u&&!l&&p.observe(u),p.observe(t));let m,h=l?ik(e):null;l&&S();function S(){const v=ik(e);h&&(v.x!==h.x||v.y!==h.y||v.width!==h.width||v.height!==h.height)&&n(),h=v,m=requestAnimationFrame(S)}return n(),()=>{var v;c.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(m)}}var jv=g.useLayoutEffect,ZX=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Hd=function(){};function JX(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function eQ(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o-1}function nQ(e){return Jf(e)?window.innerHeight:e.clientHeight}function a4(e){return Jf(e)?window.pageYOffset:e.scrollTop}function Ud(e,t){if(Jf(e)){window.scrollTo(0,t);return}e.scrollTop=t}function rQ(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}function oQ(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function qu(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Hd,o=a4(e),i=t-o,s=10,a=0;function l(){a+=s;var u=oQ(a,o,i,n);Ud(e,u),an.bottom?Ud(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o1?n-1:0),o=1;o=m)return{placement:"bottom",maxHeight:t};if(_>=m&&!s)return i&&qu(l,$,F),{placement:"bottom",maxHeight:t};if(!s&&_>=r||s&&C>=r){i&&qu(l,$,F);var W=s?C-x:_-x;return{placement:"bottom",maxHeight:W}}if(o==="auto"||s){var re=t,H=s?P:E;return H>=r&&(re=Math.min(H-x-a,t)),{placement:"top",maxHeight:re}}if(o==="bottom")return i&&Ud(l,$),{placement:"bottom",maxHeight:t};break;case"top":if(P>=m)return{placement:"top",maxHeight:t};if(E>=m&&!s)return i&&qu(l,M,F),{placement:"top",maxHeight:t};if(!s&&E>=r||s&&P>=r){var N=t;return(!s&&E>=r||s&&P>=r)&&(N=s?P-k:E-k),i&&qu(l,M,F),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return u}function mQ(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var u4=function(t){return t==="auto"?"bottom":t},vQ=function(t,n){var r,o=t.placement,i=t.theme,s=i.borderRadius,a=i.spacing,l=i.colors;return G((r={label:"menu"},ei(r,mQ(o),"100%"),ei(r,"position","absolute"),ei(r,"width","100%"),ei(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},c4=g.createContext(null),gQ=function(t){var n=t.children,r=t.minMenuHeight,o=t.maxMenuHeight,i=t.menuPlacement,s=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,u=g.useContext(c4)||{},c=u.setPortalPlacement,d=g.useRef(null),f=g.useState(o),p=st(f,2),m=p[0],h=p[1],S=g.useState(null),v=st(S,2),y=v[0],b=v[1],x=l.spacing.controlHeight;return jv(function(){var k=d.current;if(k){var P=s==="fixed",C=a&&!P,E=hQ({maxHeight:o,menuEl:k,minHeight:r,placement:i,shouldScroll:C,isFixedPosition:P,controlHeight:x});h(E.maxHeight),b(E.placement),c==null||c(E.placement)}},[o,i,s,a,r,c,x]),n({ref:d,placerProps:G(G({},t),{},{placement:y||u4(i),maxHeight:m})})},yQ=function(t){var n=t.children,r=t.innerRef,o=t.innerProps;return X("div",K({},We(t,"menu",{menu:!0}),{ref:r},o),n)},bQ=yQ,SQ=function(t,n){var r=t.maxHeight,o=t.theme.spacing.baseUnit;return G({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:o,paddingTop:o})},xQ=function(t){var n=t.children,r=t.innerProps,o=t.innerRef,i=t.isMulti;return X("div",K({},We(t,"menuList",{"menu-list":!0,"menu-list--is-multi":i}),{ref:o},r),n)},d4=function(t,n){var r=t.theme,o=r.spacing.baseUnit,i=r.colors;return G({textAlign:"center"},n?{}:{color:i.neutral40,padding:"".concat(o*2,"px ").concat(o*3,"px")})},wQ=d4,kQ=d4,CQ=function(t){var n=t.children,r=n===void 0?"No options":n,o=t.innerProps,i=Zn(t,fQ);return X("div",K({},We(G(G({},i),{},{children:r,innerProps:o}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),o),r)},PQ=function(t){var n=t.children,r=n===void 0?"Loading...":n,o=t.innerProps,i=Zn(t,pQ);return X("div",K({},We(G(G({},i),{},{children:r,innerProps:o}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),o),r)},EQ=function(t){var n=t.rect,r=t.offset,o=t.position;return{left:n.left,position:o,top:r,width:n.width,zIndex:1}},TQ=function(t){var n=t.appendTo,r=t.children,o=t.controlElement,i=t.innerProps,s=t.menuPlacement,a=t.menuPosition,l=g.useRef(null),u=g.useRef(null),c=g.useState(u4(s)),d=st(c,2),f=d[0],p=d[1],m=g.useMemo(function(){return{setPortalPlacement:p}},[]),h=g.useState(null),S=st(h,2),v=S[0],y=S[1],b=g.useCallback(function(){if(o){var C=iQ(o),E=a==="fixed"?0:window.pageYOffset,_=C[f]+E;(_!==(v==null?void 0:v.offset)||C.left!==(v==null?void 0:v.rect.left)||C.width!==(v==null?void 0:v.rect.width))&&y({offset:_,rect:C})}},[o,a,f,v==null?void 0:v.offset,v==null?void 0:v.rect.left,v==null?void 0:v.rect.width]);jv(function(){b()},[b]);var x=g.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),o&&l.current&&(u.current=QX(o,l.current,b,{elementResize:"ResizeObserver"in window}))},[o,b]);jv(function(){x()},[x]);var k=g.useCallback(function(C){l.current=C,x()},[x]);if(!n&&a!=="fixed"||!v)return null;var P=X("div",K({ref:k},We(G(G({},t),{},{offset:v.offset,position:a,rect:v.rect}),"menuPortal",{"menu-portal":!0}),i),r);return X(c4.Provider,{value:m},n?Wl.createPortal(P,n):P)},_Q=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},$Q=function(t){var n=t.children,r=t.innerProps,o=t.isDisabled,i=t.isRtl;return X("div",K({},We(t,"container",{"--is-disabled":o,"--is-rtl":i}),r),n)},OQ=function(t,n){var r=t.theme.spacing,o=t.isMulti,i=t.hasValue,s=t.selectProps.controlShouldRenderValue;return G({alignItems:"center",display:o&&i&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},RQ=function(t){var n=t.children,r=t.innerProps,o=t.isMulti,i=t.hasValue;return X("div",K({},We(t,"valueContainer",{"value-container":!0,"value-container--is-multi":o,"value-container--has-value":i}),r),n)},MQ=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},IQ=function(t){var n=t.children,r=t.innerProps;return X("div",K({},We(t,"indicatorsContainer",{indicators:!0}),r),n)},lk,AQ=["size"],DQ=["innerProps","isRtl","size"],FQ={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},f4=function(t){var n=t.size,r=Zn(t,AQ);return X("svg",K({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:FQ},r))},Ay=function(t){return X(f4,K({size:20},t),X("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},p4=function(t){return X(f4,K({size:20},t),X("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},h4=function(t,n){var r=t.isFocused,o=t.theme,i=o.spacing.baseUnit,s=o.colors;return G({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?s.neutral60:s.neutral20,padding:i*2,":hover":{color:r?s.neutral80:s.neutral40}})},LQ=h4,NQ=function(t){var n=t.children,r=t.innerProps;return X("div",K({},We(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||X(p4,null))},VQ=h4,zQ=function(t){var n=t.children,r=t.innerProps;return X("div",K({},We(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||X(Ay,null))},BQ=function(t,n){var r=t.isDisabled,o=t.theme,i=o.spacing.baseUnit,s=o.colors;return G({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?s.neutral10:s.neutral20,marginBottom:i*2,marginTop:i*2})},jQ=function(t){var n=t.innerProps;return X("span",K({},n,We(t,"indicatorSeparator",{"indicator-separator":!0})))},HQ=Xn(lk||(lk=NX([` 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } -`]))),WQ=function(t,n){var r=t.isFocused,o=t.size,i=t.theme,s=i.colors,a=i.spacing.baseUnit;return G({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:o,lineHeight:1,marginRight:o,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},Rh=function(t){var n=t.delay,r=t.offset;return X("span",{css:Gg({animation:"".concat(HQ," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},UQ=function(t){var n=t.innerProps,r=t.isRtl,o=t.size,i=o===void 0?4:o,s=Zn(t,DQ);return X("div",K({},We(G(G({},s),{},{innerProps:n,isRtl:r,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),X(Rh,{delay:0,offset:r}),X(Rh,{delay:160,offset:!0}),X(Rh,{delay:320,offset:!r}))},qQ=function(t,n){var r=t.isDisabled,o=t.isFocused,i=t.theme,s=i.colors,a=i.borderRadius,l=i.spacing;return G({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:o?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:o?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:o?s.primary:s.neutral30}})},KQ=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,i=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return X("div",K({ref:i},We(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":o,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},GQ=KQ,YQ=["data"],XQ=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},QQ=function(t){var n=t.children,r=t.cx,o=t.getStyles,i=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return X("div",K({},We(t,"group",{group:!0}),l),X(s,K({},a,{selectProps:d,theme:c,getStyles:o,getClassNames:i,cx:r}),u),X("div",null,n))},ZQ=function(t,n){var r=t.theme,o=r.colors,i=r.spacing;return G({label:"group",cursor:"default",display:"block"},n?{}:{color:o.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:"uppercase"})},JQ=function(t){var n=s4(t);n.data;var r=Zn(n,YQ);return X("div",K({},We(t,"groupHeading",{"group-heading":!0}),r))},eZ=QQ,tZ=["innerRef","isDisabled","isHidden","inputClassName"],nZ=function(t,n){var r=t.isDisabled,o=t.value,i=t.theme,s=i.spacing,a=i.colors;return G(G({visibility:r?"hidden":"visible",transform:o?"translateZ(0)":""},rZ),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},m4={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},rZ={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":G({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},m4)},oZ=function(t){return G({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},m4)},iZ=function(t){var n=t.cx,r=t.value,o=s4(t),i=o.innerRef,s=o.isDisabled,a=o.isHidden,l=o.inputClassName,u=Zn(o,tZ);return X("div",K({},We(t,"input",{"input-container":!0}),{"data-value":r||""}),X("input",K({className:n({input:!0},l),ref:i,style:oZ(a),disabled:s},u)))},sZ=iZ,aZ=function(t,n){var r=t.theme,o=r.spacing,i=r.borderRadius,s=r.colors;return G({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:i/2,margin:o.baseUnit/2})},lZ=function(t,n){var r=t.theme,o=r.borderRadius,i=r.colors,s=t.cropWithEllipsis;return G({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:o/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},uZ=function(t,n){var r=t.theme,o=r.spacing,i=r.borderRadius,s=r.colors,a=t.isFocused;return G({alignItems:"center",display:"flex"},n?{}:{borderRadius:i/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:o.baseUnit,paddingRight:o.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},v4=function(t){var n=t.children,r=t.innerProps;return X("div",r,n)},cZ=v4,dZ=v4;function fZ(e){var t=e.children,n=e.innerProps;return X("div",K({role:"button"},n),t||X(Ay,{size:14}))}var pZ=function(t){var n=t.children,r=t.components,o=t.data,i=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return X(u,{data:o,innerProps:G(G({},We(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),i),selectProps:l},X(c,{data:o,innerProps:G({},We(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),X(d,{data:o,innerProps:G(G({},We(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},hZ=pZ,mZ=function(t,n){var r=t.isDisabled,o=t.isFocused,i=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return G({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:i?l.primary:o?l.primary25:"transparent",color:r?l.neutral20:i?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:i?l.primary:l.primary50}})},vZ=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,i=t.isSelected,s=t.innerRef,a=t.innerProps;return X("div",K({},We(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":o,"option--is-selected":i}),{ref:s,"aria-disabled":r},a),n)},gZ=vZ,yZ=function(t,n){var r=t.theme,o=r.spacing,i=r.colors;return G({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:i.neutral50,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},bZ=function(t){var n=t.children,r=t.innerProps;return X("div",K({},We(t,"placeholder",{placeholder:!0}),r),n)},SZ=bZ,xZ=function(t,n){var r=t.isDisabled,o=t.theme,i=o.spacing,s=o.colors;return G({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},wZ=function(t){var n=t.children,r=t.isDisabled,o=t.innerProps;return X("div",K({},We(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),o),n)},kZ=wZ,CZ={ClearIndicator:zQ,Control:GQ,DropdownIndicator:NQ,DownChevron:p4,CrossIcon:Ay,Group:eZ,GroupHeading:JQ,IndicatorsContainer:IQ,IndicatorSeparator:jQ,Input:sZ,LoadingIndicator:UQ,Menu:bQ,MenuList:xQ,MenuPortal:TQ,LoadingMessage:PQ,NoOptionsMessage:CQ,MultiValue:hZ,MultiValueContainer:cZ,MultiValueLabel:dZ,MultiValueRemove:fZ,Option:gZ,Placeholder:SZ,SelectContainer:$Q,SingleValue:kZ,ValueContainer:RQ},PZ=function(t){return G(G({},CZ),t.components)},uk=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function EZ(e,t){return!!(e===t||uk(e)&&uk(t))}function TZ(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return s?"option ".concat(o," is disabled. Select another option."):"option ".concat(o,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,o=t.options,i=t.label,s=i===void 0?"":i,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(h,S){return h&&h.length?"".concat(h.indexOf(S)+1," of ").concat(h.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var f=l?" disabled":"",p="".concat(u?" selected":"").concat(f);return"".concat(s).concat(p,", ").concat(d(o,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},MZ=function(t){var n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,p=l.inputValue,m=l.isMulti,h=l.isOptionDisabled,S=l.isSearchable,v=l.menuIsOpen,y=l.options,b=l.screenReaderStatus,x=l.tabSelectsValue,k=l.isLoading,P=l["aria-label"],C=l["aria-live"],E=g.useMemo(function(){return G(G({},RZ),d||{})},[d]),_=g.useMemo(function(){var H="";if(n&&E.onChange){var N=n.option,R=n.options,O=n.removedValue,D=n.removedValues,V=n.value,oe=function(Se){return Array.isArray(Se)?null:Se},B=O||N||oe(V),ee=B?f(B):"",j=R||D||void 0,te=j?j.map(f):[],ae=G({isDisabled:B&&h(B,a),label:ee,labels:te},n);H=E.onChange(ae)}return H},[n,E,h,a,f]),$=g.useMemo(function(){var H="",N=r||o,R=!!(r&&a&&a.includes(r));if(N&&E.onFocus){var O={focused:N,label:f(N),isDisabled:h(N,a),isSelected:R,options:i,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};H=E.onFocus(O)}return H},[r,o,f,h,E,i,a,c]),M=g.useMemo(function(){var H="";if(v&&y.length&&!k&&E.onFilter){var N=b({count:i.length});H=E.onFilter({inputValue:p,resultsMessage:N})}return H},[i,p,v,E,y,b,k]),F=(n==null?void 0:n.action)==="initial-input-focus",W=g.useMemo(function(){var H="";if(E.guidance){var N=o?"value":v?"menu":"input";H=E.guidance({"aria-label":P,context:N,isDisabled:r&&h(r,a),isMulti:m,isSearchable:S,tabSelectsValue:x,isInitialFocus:F})}return H},[P,r,o,m,h,S,v,E,a,x,F]),re=X(g.Fragment,null,X("span",{id:"aria-selection"},_),X("span",{id:"aria-focused"},$),X("span",{id:"aria-results"},M),X("span",{id:"aria-guidance"},W));return X(g.Fragment,null,X(ck,{id:u},F&&re),X(ck,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!F&&re))},IZ=MZ,Hv=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],AZ=new RegExp("["+Hv.map(function(e){return e.letters}).join("")+"]","g"),g4={};for(var Mh=0;Mh-1}},NZ=["innerRef"];function VZ(e){var t=e.innerRef,n=Zn(e,NZ),r=dQ(n,"onExited","in","enter","exit","appear");return X("input",K({ref:t},r,{css:Gg({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var zZ=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function BZ(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,s=g.useRef(!1),a=g.useRef(!1),l=g.useRef(0),u=g.useRef(null),c=g.useCallback(function(S,v){if(u.current!==null){var y=u.current,b=y.scrollTop,x=y.scrollHeight,k=y.clientHeight,P=u.current,C=v>0,E=x-k-b,_=!1;E>v&&s.current&&(r&&r(S),s.current=!1),C&&a.current&&(i&&i(S),a.current=!1),C&&v>E?(n&&!s.current&&n(S),P.scrollTop=x,_=!0,s.current=!0):!C&&-v>b&&(o&&!a.current&&o(S),P.scrollTop=0,_=!0,a.current=!0),_&&zZ(S)}},[n,r,o,i]),d=g.useCallback(function(S){c(S,S.deltaY)},[c]),f=g.useCallback(function(S){l.current=S.changedTouches[0].clientY},[]),p=g.useCallback(function(S){var v=l.current-S.changedTouches[0].clientY;c(S,v)},[c]),m=g.useCallback(function(S){if(S){var v=lQ?{passive:!1}:!1;S.addEventListener("wheel",d,v),S.addEventListener("touchstart",f,v),S.addEventListener("touchmove",p,v)}},[p,f,d]),h=g.useCallback(function(S){S&&(S.removeEventListener("wheel",d,!1),S.removeEventListener("touchstart",f,!1),S.removeEventListener("touchmove",p,!1))},[p,f,d]);return g.useEffect(function(){if(t){var S=u.current;return m(S),function(){h(S)}}},[t,m,h]),function(S){u.current=S}}var fk=["boxSizing","height","overflow","paddingRight","position"],pk={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function hk(e){e.preventDefault()}function mk(e){e.stopPropagation()}function vk(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function gk(){return"ontouchstart"in window||navigator.maxTouchPoints}var yk=!!(typeof window<"u"&&window.document&&window.document.createElement),pa=0,Di={capture:!1,passive:!1};function jZ(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=g.useRef({}),i=g.useRef(null),s=g.useCallback(function(l){if(yk){var u=document.body,c=u&&u.style;if(r&&fk.forEach(function(m){var h=c&&c[m];o.current[m]=h}),r&&pa<1){var d=parseInt(o.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,p=window.innerWidth-f+d||0;Object.keys(pk).forEach(function(m){var h=pk[m];c&&(c[m]=h)}),c&&(c.paddingRight="".concat(p,"px"))}u&&gk()&&(u.addEventListener("touchmove",hk,Di),l&&(l.addEventListener("touchstart",vk,Di),l.addEventListener("touchmove",mk,Di))),pa+=1}},[r]),a=g.useCallback(function(l){if(yk){var u=document.body,c=u&&u.style;pa=Math.max(pa-1,0),r&&pa<1&&fk.forEach(function(d){var f=o.current[d];c&&(c[d]=f)}),u&&gk()&&(u.removeEventListener("touchmove",hk,Di),l&&(l.removeEventListener("touchstart",vk,Di),l.removeEventListener("touchmove",mk,Di)))}},[r]);return g.useEffect(function(){if(t){var l=i.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){i.current=l}}var HZ=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},WZ={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function UZ(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=BZ({isEnabled:o,onBottomArrive:i,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=jZ({isEnabled:n}),d=function(p){u(p),c(p)};return X(g.Fragment,null,n&&X("div",{onClick:HZ,css:WZ}),t(d))}var qZ={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},KZ=function(t){var n=t.name,r=t.onFocus;return X("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:qZ,value:"",onChange:function(){}})},GZ=KZ;function Dy(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function YZ(){return Dy(/^iPhone/i)}function b4(){return Dy(/^Mac/i)}function XZ(){return Dy(/^iPad/i)||b4()&&navigator.maxTouchPoints>1}function QZ(){return YZ()||XZ()}function ZZ(){return b4()||QZ()}var JZ=function(t){return t.label},S4=function(t){return t.label},x4=function(t){return t.value},eJ=function(t){return!!t.isDisabled},tJ={clearIndicator:VQ,container:_Q,control:qQ,dropdownIndicator:LQ,group:XQ,groupHeading:ZQ,indicatorsContainer:MQ,indicatorSeparator:BQ,input:nZ,loadingIndicator:WQ,loadingMessage:kQ,menu:vQ,menuList:SQ,menuPortal:EQ,multiValue:aZ,multiValueLabel:lZ,multiValueRemove:uZ,noOptionsMessage:wQ,option:mZ,placeholder:yZ,singleValue:xZ,valueContainer:OQ},nJ={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},rJ=4,w4=4,oJ=38,iJ=w4*2,sJ={baseUnit:w4,controlHeight:oJ,menuGutter:iJ},Dh={borderRadius:rJ,colors:nJ,spacing:sJ},aJ={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ak(),captureMenuScroll:!ak(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:LZ(),formatGroupLabel:JZ,getOptionLabel:S4,getOptionValue:x4,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:eJ,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!sQ(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function bk(e,t,n,r){var o=P4(e,t,n),i=E4(e,t,n),s=C4(e,t),a=qd(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:s,value:a,index:r}}function Vc(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(s,a){return bk(e,s,t,a)}).filter(function(s){return xk(e,s)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=bk(e,n,t,r);return xk(e,i)?i:void 0}).filter(uQ)}function k4(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,xs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Sk(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,xs(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function lJ(e,t){return k4(Vc(e,t))}function xk(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,s=t.label,a=t.value;return(!_4(e)||!i)&&T4(e,{label:s,value:a,data:o},r)}function uJ(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o-1?n:t[0]}var Fh=function(t,n){var r,o=(r=t.find(function(i){return i.data===n}))===null||r===void 0?void 0:r.id;return o||null},C4=function(t,n){return t.getOptionLabel(n)},qd=function(t,n){return t.getOptionValue(n)};function P4(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function E4(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=qd(e,t);return n.some(function(o){return qd(e,o)===r})}function T4(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var _4=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},dJ=1,nu=function(e){RX(n,e);var t=AX(n);function n(r){var o;if($X(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.isAppleDevice=ZZ(),o.controlRef=null,o.getControlRef=function(l){o.controlRef=l},o.focusedOptionRef=null,o.getFocusedOptionRef=function(l){o.focusedOptionRef=l},o.menuListRef=null,o.getMenuListRef=function(l){o.menuListRef=l},o.inputRef=null,o.getInputRef=function(l){o.inputRef=l},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(l,u){var c=o.props,d=c.onChange,f=c.name;u.name=f,o.ariaOnChange(l,u),d(l,u)},o.setValue=function(l,u,c){var d=o.props,f=d.closeMenuOnSelect,p=d.isMulti,m=d.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(o.setState({inputIsHiddenAfterUpdate:!p}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(l,{action:u,option:c})},o.selectOption=function(l){var u=o.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,p=o.state.selectValue,m=d&&o.isOptionSelected(l,p),h=o.isOptionDisabled(l,p);if(m){var S=o.getOptionValue(l);o.setValue(p.filter(function(v){return o.getOptionValue(v)!==S}),"deselect-option",l)}else if(!h)d?o.setValue([].concat(xs(p),[l]),"select-option",l):o.setValue(l,"select-option");else{o.ariaOnChange(l,{action:"select-option",option:l,name:f});return}c&&o.blurInput()},o.removeValue=function(l){var u=o.props.isMulti,c=o.state.selectValue,d=o.getOptionValue(l),f=c.filter(function(m){return o.getOptionValue(m)!==d}),p=Ra(u,f,f[0]||null);o.onChange(p,{action:"remove-value",removedValue:l}),o.focusInput()},o.clearValue=function(){var l=o.state.selectValue;o.onChange(Ra(o.props.isMulti,[],null),{action:"clear",removedValues:l})},o.popValue=function(){var l=o.props.isMulti,u=o.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=Ra(l,d,d[0]||null);o.onChange(f,{action:"pop-value",removedValue:c})},o.getFocusedOptionId=function(l){return Fh(o.state.focusableOptionsWithIds,l)},o.getFocusableOptionsWithIds=function(){return Sk(Vc(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;cp||f>p}},o.onTouchEnd=function(l){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(l.target)&&o.menuListRef&&!o.menuListRef.contains(l.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(l){o.userIsDragging||o.onControlMouseDown(l)},o.onClearIndicatorTouchEnd=function(l){o.userIsDragging||o.onClearIndicatorMouseDown(l)},o.onDropdownIndicatorTouchEnd=function(l){o.userIsDragging||o.onDropdownIndicatorMouseDown(l)},o.handleInputChange=function(l){var u=o.props.inputValue,c=l.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(c,{action:"input-change",prevInputValue:u}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(l){o.props.onFocus&&o.props.onFocus(l),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(l){var u=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(l),o.onInputChange("",{action:"input-blur",prevInputValue:u}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(l){if(!(o.blockOptionHover||o.state.focusedOption===l)){var u=o.getFocusableOptions(),c=u.indexOf(l);o.setState({focusedOption:l,focusedOptionId:c>-1?o.getFocusedOptionId(l):null})}},o.shouldHideSelectedOptions=function(){return _4(o.props)},o.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),o.focus()},o.onKeyDown=function(l){var u=o.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,p=u.inputValue,m=u.isClearable,h=u.isDisabled,S=u.menuIsOpen,v=u.onKeyDown,y=u.tabSelectsValue,b=u.openMenuOnFocus,x=o.state,k=x.focusedOption,P=x.focusedValue,C=x.selectValue;if(!h&&!(typeof v=="function"&&(v(l),l.defaultPrevented))){switch(o.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||p)return;o.focusValue("previous");break;case"ArrowRight":if(!c||p)return;o.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(P)o.removeValue(P);else{if(!d)return;c?o.popValue():m&&o.clearValue()}break;case"Tab":if(o.isComposing||l.shiftKey||!S||!y||!k||b&&o.isOptionSelected(k,C))return;o.selectOption(k);break;case"Enter":if(l.keyCode===229)break;if(S){if(!k||o.isComposing)return;o.selectOption(k);break}return;case"Escape":S?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:p}),o.onMenuClose()):m&&f&&o.clearValue();break;case" ":if(p)return;if(!S){o.openMenu("first");break}if(!k)return;o.selectOption(k);break;case"ArrowUp":S?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":S?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!S)return;o.focusOption("pageup");break;case"PageDown":if(!S)return;o.focusOption("pagedown");break;case"Home":if(!S)return;o.focusOption("first");break;case"End":if(!S)return;o.focusOption("last");break;default:return}l.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++dJ),o.state.selectValue=Wd(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),s=o.buildFocusableOptions(),a=s.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=s[a],o.state.focusedOptionId=Fh(i,s[a])}return o}return OX(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&sk(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(o){var i=this.props,s=i.isDisabled,a=i.menuIsOpen,l=this.state.isFocused;(l&&!s&&o.isDisabled||l&&a&&!o.menuIsOpen)&&this.focusInput(),l&&s&&!o.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&o.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(sk(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(o,i){this.props.onInputChange(o,i)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(o){var i=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=o==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return i.onMenuOpen()})}},{key:"focusValue",value:function(o){var i=this.state,s=i.selectValue,a=i.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(o){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l0&&arguments[0]!==void 0?arguments[0]:"first",i=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),o==="up"?l=u>0?u-1:a.length-1:o==="down"?l=(u+1)%a.length:o==="pageup"?(l=u-i,l<0&&(l=0)):o==="pagedown"?(l=u+i,l>a.length-1&&(l=a.length-1)):o==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Dh):G(G({},Dh),this.props.theme):Dh}},{key:"getCommonProps",value:function(){var o=this.clearValue,i=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,p=d.isRtl,m=d.options,h=this.hasValue();return{clearValue:o,cx:i,getStyles:s,getClassNames:a,getValue:l,hasValue:h,isMulti:f,isRtl:p,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var o=this.state.selectValue;return o.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var o=this.props,i=o.isClearable,s=o.isMulti;return i===void 0?s:i}},{key:"isOptionDisabled",value:function(o,i){return P4(this.props,o,i)}},{key:"isOptionSelected",value:function(o,i){return E4(this.props,o,i)}},{key:"filterOption",value:function(o,i){return T4(this.props,o,i)}},{key:"formatOptionLabel",value:function(o,i){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(o,{context:i,inputValue:s,selectValue:a})}else return this.getOptionLabel(o)}},{key:"formatGroupLabel",value:function(o){return this.props.formatGroupLabel(o)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var o=this.props,i=o.isDisabled,s=o.isSearchable,a=o.inputId,l=o.inputValue,u=o.tabIndex,c=o.form,d=o.menuIsOpen,f=o.required,p=this.getComponents(),m=p.Input,h=this.state,S=h.inputIsHidden,v=h.ariaSelection,y=this.commonProps,b=a||this.getElementId("input"),x=G(G(G({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?(v==null?void 0:v.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?g.createElement(m,K({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:b,innerRef:this.getInputRef,isDisabled:i,isHidden:S,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},x)):g.createElement(VZ,K({id:b,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Hd,onFocus:this.onInputFocus,disabled:i,tabIndex:u,inputMode:"none",form:c,value:""},x))}},{key:"renderPlaceholderOrValue",value:function(){var o=this,i=this.getComponents(),s=i.MultiValue,a=i.MultiValueContainer,l=i.MultiValueLabel,u=i.MultiValueRemove,c=i.SingleValue,d=i.Placeholder,f=this.commonProps,p=this.props,m=p.controlShouldRenderValue,h=p.isDisabled,S=p.isMulti,v=p.inputValue,y=p.placeholder,b=this.state,x=b.selectValue,k=b.focusedValue,P=b.isFocused;if(!this.hasValue()||!m)return v?null:g.createElement(d,K({},f,{key:"placeholder",isDisabled:h,isFocused:P,innerProps:{id:this.getElementId("placeholder")}}),y);if(S)return x.map(function(E,_){var $=E===k,M="".concat(o.getOptionLabel(E),"-").concat(o.getOptionValue(E));return g.createElement(s,K({},f,{components:{Container:a,Label:l,Remove:u},isFocused:$,isDisabled:h,key:M,index:_,removeProps:{onClick:function(){return o.removeValue(E)},onTouchEnd:function(){return o.removeValue(E)},onMouseDown:function(W){W.preventDefault()}},data:E}),o.formatOptionLabel(E,"value"))});if(v)return null;var C=x[0];return g.createElement(c,K({},f,{data:C,isDisabled:h}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var o=this.getComponents(),i=o.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!i||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(i,K({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var o=this.getComponents(),i=o.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!i||!u)return null;var d={"aria-hidden":"true"};return g.createElement(i,K({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var o=this.getComponents(),i=o.DropdownIndicator,s=o.IndicatorSeparator;if(!i||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return g.createElement(s,K({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var o=this.getComponents(),i=o.DropdownIndicator;if(!i)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(i,K({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var o=this,i=this.getComponents(),s=i.Group,a=i.GroupHeading,l=i.Menu,u=i.MenuList,c=i.MenuPortal,d=i.LoadingMessage,f=i.NoOptionsMessage,p=i.Option,m=this.commonProps,h=this.state.focusedOption,S=this.props,v=S.captureMenuScroll,y=S.inputValue,b=S.isLoading,x=S.loadingMessage,k=S.minMenuHeight,P=S.maxMenuHeight,C=S.menuIsOpen,E=S.menuPlacement,_=S.menuPosition,$=S.menuPortalTarget,M=S.menuShouldBlockScroll,F=S.menuShouldScrollIntoView,W=S.noOptionsMessage,re=S.onMenuScrollToTop,H=S.onMenuScrollToBottom;if(!C)return null;var N=function(ee,j){var te=ee.type,ae=ee.data,we=ee.isDisabled,Se=ee.isSelected,xt=ee.label,Ln=ee.value,Bt=h===ae,pe=we?void 0:function(){return o.onOptionHover(ae)},tt=we?void 0:function(){return o.selectOption(ae)},Sn="".concat(o.getElementId("option"),"-").concat(j),ne={id:Sn,onClick:tt,onMouseMove:pe,onMouseOver:pe,tabIndex:-1,role:"option","aria-selected":o.isAppleDevice?void 0:Se};return g.createElement(p,K({},m,{innerProps:ne,data:ae,isDisabled:we,isSelected:Se,key:Sn,label:xt,type:te,value:Ln,isFocused:Bt,innerRef:Bt?o.getFocusedOptionRef:void 0}),o.formatOptionLabel(ee.data,"menu"))},R;if(this.hasOptions())R=this.getCategorizedOptions().map(function(B){if(B.type==="group"){var ee=B.data,j=B.options,te=B.index,ae="".concat(o.getElementId("group"),"-").concat(te),we="".concat(ae,"-heading");return g.createElement(s,K({},m,{key:ae,data:ee,options:j,Heading:a,headingProps:{id:we,data:B.data},label:o.formatGroupLabel(B.data)}),B.options.map(function(Se){return N(Se,"".concat(te,"-").concat(Se.index))}))}else if(B.type==="option")return N(B,"".concat(B.index))});else if(b){var O=x({inputValue:y});if(O===null)return null;R=g.createElement(d,m,O)}else{var D=W({inputValue:y});if(D===null)return null;R=g.createElement(f,m,D)}var V={minMenuHeight:k,maxMenuHeight:P,menuPlacement:E,menuPosition:_,menuShouldScrollIntoView:F},oe=g.createElement(gQ,K({},m,V),function(B){var ee=B.ref,j=B.placerProps,te=j.placement,ae=j.maxHeight;return g.createElement(l,K({},m,V,{innerRef:ee,innerProps:{onMouseDown:o.onMenuMouseDown,onMouseMove:o.onMenuMouseMove},isLoading:b,placement:te}),g.createElement(UZ,{captureEnabled:v,onTopArrive:re,onBottomArrive:H,lockEnabled:M},function(we){return g.createElement(u,K({},m,{innerRef:function(xt){o.getMenuListRef(xt),we(xt)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:o.getElementId("listbox")},isLoading:b,maxHeight:ae,focusedOption:h}),R)}))});return $||_==="fixed"?g.createElement(c,K({},m,{appendTo:$,controlElement:this.controlRef,menuPlacement:E,menuPosition:_}),oe):oe}},{key:"renderFormField",value:function(){var o=this,i=this.props,s=i.delimiter,a=i.isDisabled,l=i.isMulti,u=i.name,c=i.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return g.createElement(GZ,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var f=d.map(function(h){return o.getOptionValue(h)}).join(s);return g.createElement("input",{name:u,type:"hidden",value:f})}else{var p=d.length>0?d.map(function(h,S){return g.createElement("input",{key:"i-".concat(S),name:u,type:"hidden",value:o.getOptionValue(h)})}):g.createElement("input",{name:u,type:"hidden",value:""});return g.createElement("div",null,p)}else{var m=d[0]?this.getOptionValue(d[0]):"";return g.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var o=this.commonProps,i=this.state,s=i.ariaSelection,a=i.focusedOption,l=i.focusedValue,u=i.isFocused,c=i.selectValue,d=this.getFocusableOptions();return g.createElement(IZ,K({},o,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var o=this.getComponents(),i=o.Control,s=o.IndicatorsContainer,a=o.SelectContainer,l=o.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,p=u.menuIsOpen,m=this.state.isFocused,h=this.commonProps=this.getCommonProps();return g.createElement(a,K({},h,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),g.createElement(i,K({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:p}),g.createElement(l,K({},h,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),g.createElement(s,K({},h,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(o,i){var s=i.prevProps,a=i.clearFocusValueOnUpdate,l=i.inputIsHiddenAfterUpdate,u=i.ariaSelection,c=i.isFocused,d=i.prevWasFocused,f=i.instancePrefix,p=o.options,m=o.value,h=o.menuIsOpen,S=o.inputValue,v=o.isMulti,y=Wd(m),b={};if(s&&(m!==s.value||p!==s.options||h!==s.menuIsOpen||S!==s.inputValue)){var x=h?lJ(o,y):[],k=h?Sk(Vc(o,y),"".concat(f,"-option")):[],P=a?uJ(i,y):null,C=cJ(i,x),E=Fh(k,C);b={selectValue:y,focusedOption:C,focusedOptionId:E,focusableOptionsWithIds:k,focusedValue:P,clearFocusValueOnUpdate:!1}}var _=l!=null&&o!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},$=u,M=c&&d;return c&&!M&&($={value:Ra(v,y,y[0]||null),options:y,action:"initial-input-focus"},M=!d),(u==null?void 0:u.action)==="initial-input-focus"&&($=null),G(G(G({},b),_),{},{prevProps:o,ariaSelection:$,prevWasFocused:M})}}]),n}(g.Component);nu.defaultProps=aJ;var fJ=g.forwardRef(function(e,t){var n=Zf(e);return g.createElement(nu,K({ref:t},n))}),pJ=fJ,hJ=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],wk=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=String(t).toLowerCase(),i=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return i===o||s===o},Lh={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,o){return!(!t||n.some(function(i){return wk(t,i,o)})||r.some(function(i){return wk(t,i,o)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function $4(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,i=e.formatCreateLabel,s=i===void 0?Lh.formatCreateLabel:i,a=e.isValidNewOption,l=a===void 0?Lh.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?Lh.getNewOptionData:u,d=e.onCreateOption,f=e.options,p=f===void 0?[]:f,m=e.onChange,h=Zn(e,hJ),S=h.getOptionValue,v=S===void 0?x4:S,y=h.getOptionLabel,b=y===void 0?S4:y,x=h.inputValue,k=h.isLoading,P=h.isMulti,C=h.value,E=h.name,_=g.useMemo(function(){return l(x,Wd(C),p,{getOptionValue:v,getOptionLabel:b})?c(x,s(x)):void 0},[s,c,b,v,x,l,p,C]),$=g.useMemo(function(){return(n||!k)&&_?o==="first"?[_].concat(xs(p)):[].concat(xs(p),[_]):p},[n,o,k,_,p]),M=g.useCallback(function(F,W){if(W.action!=="select-option")return m(F,W);var re=Array.isArray(F)?F:[F];if(re[re.length-1]===_){if(d)d(x);else{var H=c(x,x),N={action:"create-option",name:E,option:H};m(Ra(P,[].concat(xs(Wd(C)),[H]),H),N)}return}m(F,W)},[c,x,P,E,_,d,m,C]);return G(G({},h),{},{options:$,onChange:M})}var mJ=g.forwardRef(function(e,t){var n=Zf(e),r=$4(n);return g.createElement(nu,K({ref:t},r))}),vJ=mJ,gJ=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function O4(e){var t=e.defaultOptions,n=t===void 0?!1:t,r=e.cacheOptions,o=r===void 0?!1:r,i=e.loadOptions;e.options;var s=e.isLoading,a=s===void 0?!1:s,l=e.onInputChange,u=e.filterOption,c=u===void 0?null:u,d=Zn(e,gJ),f=d.inputValue,p=g.useRef(void 0),m=g.useRef(!1),h=g.useState(Array.isArray(n)?n:void 0),S=st(h,2),v=S[0],y=S[1],b=g.useState(typeof f<"u"?f:""),x=st(b,2),k=x[0],P=x[1],C=g.useState(n===!0),E=st(C,2),_=E[0],$=E[1],M=g.useState(void 0),F=st(M,2),W=F[0],re=F[1],H=g.useState([]),N=st(H,2),R=N[0],O=N[1],D=g.useState(!1),V=st(D,2),oe=V[0],B=V[1],ee=g.useState({}),j=st(ee,2),te=j[0],ae=j[1],we=g.useState(void 0),Se=st(we,2),xt=Se[0],Ln=Se[1],Bt=g.useState(void 0),pe=st(Bt,2),tt=pe[0],Sn=pe[1];o!==tt&&(ae({}),Sn(o)),n!==xt&&(y(Array.isArray(n)?n:void 0),Ln(n)),g.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var ne=g.useCallback(function(nt,wt){if(!i)return wt();var De=i(nt,wt);De&&typeof De.then=="function"&&De.then(wt,function(){return wt()})},[i]);g.useEffect(function(){n===!0&&ne(k,function(nt){m.current&&(y(nt||[]),$(!!p.current))})},[]);var Pe=g.useCallback(function(nt,wt){var De=tQ(nt,wt,l);if(!De){p.current=void 0,P(""),re(""),O([]),$(!1),B(!1);return}if(o&&te[De])P(De),re(De),O(te[De]),$(!1),B(!1);else{var Ei=p.current={};P(De),$(!0),B(!W),ne(De,function(Ti){m&&Ei===p.current&&(p.current=void 0,$(!1),re(De),O(Ti||[]),B(!1),ae(Ti?G(G({},te),{},ei({},De,Ti)):te))})}},[o,ne,W,te,l]),Be=oe?[]:k&&W?R:v||[];return G(G({},d),{},{options:Be,isLoading:_||a,onInputChange:Pe,filterOption:c})}var yJ=g.forwardRef(function(e,t){var n=O4(e),r=Zf(n);return g.createElement(nu,K({ref:t},r))}),bJ=yJ,SJ=g.forwardRef(function(e,t){var n=O4(e),r=Zf(n),o=$4(r);return g.createElement(nu,K({ref:t},o))}),xJ=SJ,R4=e=>{let{className:t,clearValue:n,cx:r,getStyles:o,getClassNames:i,getValue:s,hasValue:a,isMulti:l,isRtl:u,options:c,selectOption:d,selectProps:f,setValue:p,theme:m,...h}=e;return{...h}},wJ=e=>typeof e=="string"&&["sm","md","lg"].includes(e),kJ=e=>wJ(e)?e:e==="xs"?"sm":e==="xl"?"lg":"md",Jn=e=>{let t=Yr(),n=kJ(t.components.Input.defaultProps.size),r=e??n;return qH(typeof r=="string"?[r]:r,{fallback:"md"})||n},CJ=e=>{let{children:t,className:n,cx:r,innerProps:o,isDisabled:i,isRtl:s,hasValue:a,selectProps:{chakraStyles:l}}=e,u={position:"relative",direction:s?"rtl":void 0,...i?{cursor:"not-allowed"}:{}},c=l!=null&&l.container?l.container(u,e):u;return w.jsx(et,{...o,className:r({"--is-disabled":i,"--is-rtl":s,"--has-value":a},n),sx:c,children:t})},PJ=e=>{let{children:t,className:n,cx:r,isMulti:o,hasValue:i,innerProps:s,selectProps:{chakraStyles:a,size:l,variant:u,focusBorderColor:c,errorBorderColor:d,controlShouldRenderValue:f}}=e,p=Jn(l),m=ut("Input",{size:p,variant:u,focusBorderColor:c,errorBorderColor:d}),h={display:o&&i&&f?"flex":"grid",alignItems:"center",flex:1,paddingY:"2px",paddingX:m.field.px,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},S=a!=null&&a.valueContainer?a.valueContainer(h,e):h;return w.jsx(et,{...s,className:r({"value-container":!0,"value-container--is-multi":o,"value-container--has-value":i},n),sx:S,children:t})},EJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i}}=e,s={display:"flex",alignItems:"center",alignSelf:"stretch",flexShrink:0},a=i!=null&&i.indicatorsContainer?i.indicatorsContainer(s,e):s;return w.jsx(et,{...o,className:r({indicators:!0},n),sx:a,children:t})},TJ=e=>{let{className:t,cx:n,children:r,innerRef:o,innerProps:i,isDisabled:s,isFocused:a,menuIsOpen:l,selectProps:{chakraStyles:u,size:c,variant:d,focusBorderColor:f,errorBorderColor:p,isInvalid:m,isReadOnly:h}}=e,S=Jn(c),{field:{height:v,h:y,...b}}=ut("Input",{size:S,variant:d,focusBorderColor:f,errorBorderColor:p}),x={...b,position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",padding:0,overflow:"hidden",height:"auto",minH:v||y,...s?{pointerEvents:"none"}:{}},k=u!=null&&u.control?u.control(x,e):x;return w.jsx(et,{ref:o,className:n({control:!0,"control--is-disabled":s,"control--is-focused":a,"control--menu-is-open":l},t),sx:k,...i,"data-focus":a?!0:void 0,"data-focus-visible":a?!0:void 0,"data-invalid":m?!0:void 0,"data-disabled":s?!0:void 0,"data-readonly":h?!0:void 0,children:r})},_J=e=>{let{className:t,cx:n,selectProps:{chakraStyles:r,useBasicStyles:o,variant:i}}=e,s={opacity:1,...o||i!=="outline"?{display:"none"}:{}},a=r!=null&&r.indicatorSeparator?r.indicatorSeparator(s,e):s;return w.jsx(f_,{className:n({"indicator-separator":!0},t),sx:a,orientation:"vertical"})},$J=e=>w.jsx(Qn,{role:"presentation",focusable:"false","aria-hidden":"true",...e,children:w.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),OJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,useBasicStyles:s,size:a,focusBorderColor:l,errorBorderColor:u,variant:c}}=e,d=Jn(a),f=ut("Input",{size:d,variant:c,focusBorderColor:l,errorBorderColor:u}),p={sm:"16px",md:"20px",lg:"24px"}[d],m={...f.addon,display:"flex",alignItems:"center",justifyContent:"center",height:"100%",borderRadius:0,borderWidth:0,fontSize:p,...s&&{background:"transparent",padding:0,width:6,marginRight:2,marginLeft:1,cursor:"inherit"}},h=i!=null&&i.dropdownIndicator?i.dropdownIndicator(m,e):m,S={height:"1em",width:"1em"},v=i!=null&&i.downChevron?i.downChevron(S,e):S;return w.jsx(et,{...o,className:r({indicator:!0,"dropdown-indicator":!0},n),sx:h,children:t||w.jsx($J,{sx:v})})},RJ=e=>w.jsx(Qn,{focusable:"false","aria-hidden":!0,...e,children:w.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})}),MJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,size:s}}=e,a=Jn(s),l={...en("CloseButton",{size:a}),marginX:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,cursor:"pointer"},u=i!=null&&i.clearIndicator?i.clearIndicator(l,e):l,c={width:"1em",height:"1em"},d=i!=null&&i.crossIcon?i.crossIcon(c,e):c;return w.jsx(et,{role:"button",className:r({indicator:!0,"clear-indicator":!0},n),sx:u,"aria-label":"Clear selected options",...o,children:t||w.jsx(RJ,{sx:d})})},IJ=e=>{let{className:t,cx:n,innerProps:r,selectProps:{chakraStyles:o,size:i},color:s,emptyColor:a,speed:l,thickness:u,spinnerSize:c}=e,d=Jn(i),f={sm:"xs",md:"sm",lg:"md"}[d],p={marginRight:3},m=o!=null&&o.loadingIndicator?o.loadingIndicator(p,e):p;return w.jsx(Vf,{className:n({indicator:!0,"loading-indicator":!0},t),sx:m,...r,size:c||f,color:s,emptyColor:a,speed:l,thickness:u})},AJ=TJ,DJ=e=>{let{className:t,cx:n,value:r,selectProps:{chakraStyles:o,isReadOnly:i}}=e,{innerRef:s,isDisabled:a,isHidden:l,inputClassName:u,...c}=R4(e),d={gridArea:"1 / 2",minW:"2px",border:0,margin:0,outline:0,padding:0},f={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content",color:"inherit",marginX:"0.125rem",paddingY:"0.125rem",visibility:a?"hidden":"visible",transform:r?"translateZ(0)":"",_after:{content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre",padding:0,...d}},p=o!=null&&o.inputContainer?o.inputContainer(f,e):f,m={background:0,opacity:l?0:1,width:"100%",...d},h=o!=null&&o.input?o.input(m,e):m;return w.jsx(et,{className:n({"input-container":!0},t),"data-value":r||"",sx:p,children:w.jsx(A.input,{className:n({input:!0},u),ref:s,sx:h,disabled:a,readOnly:i?!0:void 0,...c})})},FJ=DJ,LJ=e=>e?{bottom:"top",top:"bottom"}[e]:"top",NJ=e=>{let{className:t,cx:n,children:r,innerProps:o,innerRef:i,placement:s,selectProps:{chakraStyles:a}}=e,l={position:"absolute",[LJ(s)]:"100%",marginY:"8px",width:"100%",zIndex:1},u=a!=null&&a.menu?a.menu(l,e):l;return w.jsx(P_,{children:w.jsx(et,{...o,ref:i,className:n({menu:!0},t),sx:u,children:r})})},VJ=NJ,zJ=e=>{var t;let{className:n,cx:r,innerRef:o,children:i,maxHeight:s,isMulti:a,innerProps:l,selectProps:{chakraStyles:u,size:c,variant:d,focusBorderColor:f,errorBorderColor:p}}=e,m=ut("Menu"),h=Jn(c),S=ut("Input",{size:h,variant:d,focusBorderColor:f,errorBorderColor:p}).field,v={...m.list,minW:"100%",maxHeight:`${s}px`,overflowY:"auto","--input-border-radius":S==null?void 0:S["--input-border-radius"],borderRadius:(S==null?void 0:S.borderRadius)||((t=m.list)==null?void 0:t.borderRadius),position:"relative",WebkitOverflowScrolling:"touch"},y=u!=null&&u.menuList?u.menuList(v,e):v;return w.jsx(et,{...l,className:r({"menu-list":!0,"menu-list--is-multi":a},n),sx:y,ref:o,children:i})},BJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,size:s}}=e,a=Jn(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[a],fontSize:a},u=i!=null&&i.loadingMessage?i.loadingMessage(l,e):l;return w.jsx(et,{...o,className:r({"menu-notice":!0,"menu-notice--loading":!0},n),sx:u,children:t})},jJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,size:s}}=e,a=Jn(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[a],fontSize:a},u=i!=null&&i.noOptionsMessage?i.noOptionsMessage(l,e):l;return w.jsx(et,{...o,className:r({"menu-notice":!0,"menu-notice--no-options":!0},n),sx:u,children:t})},HJ=e=>{let{children:t,className:n,cx:r,theme:o,getStyles:i,Heading:s,headingProps:a,label:l,selectProps:u,innerProps:c,getClassNames:d}=e,{chakraStyles:f}=u,p={},m=f!=null&&f.group?f.group(p,e):p;return w.jsxs(et,{...c,className:r({group:!0},n),sx:m,children:[w.jsx(s,{...a,selectProps:u,cx:r,theme:o,getStyles:i,getClassNames:d,children:l}),w.jsx(et,{children:t})]})},WJ=e=>{let{cx:t,className:n,selectProps:{chakraStyles:r,size:o,hasStickyGroupHeaders:i}}=e,{data:s,...a}=R4(e),l=ut("Menu"),u=Jn(o),c={sm:"xs",md:"sm",lg:"md"},d={sm:"0.4rem 0.8rem",md:"0.5rem 1rem",lg:"0.6rem 1.2rem"},f={...l.groupTitle,fontSize:c[u],padding:d[u],margin:0,borderBottomWidth:i?"1px":0,position:i?"sticky":"static",top:-2,bg:l.list.bg,zIndex:1},p=r!=null&&r.groupHeading?r.groupHeading(f,e):f;return w.jsx(et,{...a,className:t({"group-heading":!0},n),sx:p})},UJ=e=>w.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:w.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),qJ=e=>{let{className:t,cx:n,innerRef:r,innerProps:o,children:i,isFocused:s,isDisabled:a,isSelected:l,selectProps:{chakraStyles:u,size:c,isMulti:d,hideSelectedOptions:f,selectedOptionStyle:p,selectedOptionColorScheme:m}}=e,h=ut("Menu").item,S=Jn(c),v={sm:"0.6rem",md:"0.8rem",lg:"1rem"},y={sm:"0.3rem",md:"0.4rem",lg:"0.5rem"},b=sb(`${m}.500`,`${m}.300`),x=sb("white","black"),k=p==="check"&&(!d||f===!1),P=p==="color",C={...h,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",textAlign:"start",fontSize:S,paddingX:v[S],paddingY:y[S],...P&&{_selected:{bg:b,color:x,_active:{bg:b}}}},E=u!=null&&u.option?u.option(C,e):C;return w.jsxs(et,{...o,className:n({option:!0,"option--is-disabled":a,"option--is-focused":s,"option--is-selected":l},t),sx:E,ref:r,"data-focus":s?!0:void 0,"aria-disabled":a?!0:void 0,"aria-selected":l,children:[k&&w.jsx(E_,{fontSize:"0.8em",marginEnd:"0.75rem",opacity:l?1:0,children:w.jsx(UJ,{})}),i]})},KJ=e=>typeof e=="object"&&e!==null&&"colorScheme"in e&&typeof e.colorScheme=="string",GJ=e=>typeof e=="object"&&e!==null&&"variant"in e&&typeof e.variant=="string",M4=e=>typeof e=="object"&&e!==null&&"isFixed"in e&&typeof e.isFixed=="boolean",YJ=e=>{let{children:t,className:n,components:r,cx:o,data:i,innerProps:s,isDisabled:a,isFocused:l,removeProps:u,selectProps:c,cropWithEllipsis:d}=e,{Container:f,Label:p,Remove:m}=r,{chakraStyles:h,colorScheme:S,tagVariant:v,size:y}=c,b=Jn(y),x="",k="",P=!1;KJ(i)&&(x=i.colorScheme),GJ(i)&&(k=i.variant),M4(i)&&(P=i.isFixed);let C=ut("Tag",{size:b,colorScheme:x||S,variant:k||v||(P?"solid":"subtle")}),E={...C.container,display:"flex",alignItems:"center",minWidth:0,margin:"0.125rem"},_=h!=null&&h.multiValue?h.multiValue(E,e):E,$={...C.label,overflow:"hidden",textOverflow:d||d===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},M=h!=null&&h.multiValueLabel?h.multiValueLabel($,e):$,F={...C.closeButton,display:"flex",alignItems:"center",justifyContent:"center"},W=h!=null&&h.multiValueRemove?h.multiValueRemove(F,e):F;return w.jsxs(f,{data:i,innerProps:{className:o({"multi-value":!0,"multi-value--is-disabled":a},n),...s},sx:_,selectProps:c,children:[w.jsx(p,{data:i,innerProps:{className:o({"multi-value__label":!0},n)},sx:M,selectProps:c,children:t}),w.jsx(m,{data:i,innerProps:{className:o({"multi-value__remove":!0},n),"aria-label":`Remove ${t||"option"}`,...u},sx:W,selectProps:c,isFocused:l})]})},XJ=e=>{let{children:t,innerProps:n,sx:r}=e;return w.jsx(A.span,{...n,sx:r,children:t})},QJ=e=>{let{children:t,innerProps:n,sx:r}=e;return w.jsx(A.span,{...n,sx:r,children:t})},ZJ=e=>w.jsx(Qn,{verticalAlign:"inherit",viewBox:"0 0 512 512",...e,children:w.jsx("path",{fill:"currentColor",d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})}),JJ=e=>{let{children:t,innerProps:n,isFocused:r,data:o,sx:i}=e;return M4(o)&&o.isFixed?null:w.jsx(et,{...n,role:"button",sx:i,"data-focus":r?!0:void 0,"data-focus-visible":r?!0:void 0,children:t||w.jsx(ZJ,{})})},eee=YJ,tee=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i}}=e,s={gridArea:"1 / 1 / 2 / 3",color:"chakra-placeholder-color",mx:"0.125rem",userSelect:"none"},a=i!=null&&i.placeholder?i.placeholder(s,e):s;return w.jsx(et,{...o,className:r({placeholder:!0},n),sx:a,children:t})},nee=tee,ree=e=>{let{children:t,className:n,cx:r,isDisabled:o,innerProps:i,selectProps:{chakraStyles:s}}=e,a={gridArea:"1 / 1 / 2 / 3",mx:"0.125rem",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},l=s!=null&&s.singleValue?s.singleValue(a,e):a;return w.jsx(et,{className:r({"single-value":!0,"single-value--is-disabled":o},n),sx:l,...i,children:t})},oee=ree,iee={ClearIndicator:MJ,Control:AJ,DropdownIndicator:OJ,Group:HJ,GroupHeading:WJ,IndicatorSeparator:_J,IndicatorsContainer:EJ,Input:FJ,LoadingIndicator:IJ,LoadingMessage:BJ,Menu:VJ,MenuList:zJ,MultiValue:eee,MultiValueContainer:XJ,MultiValueLabel:QJ,MultiValueRemove:JJ,NoOptionsMessage:jJ,Option:qJ,Placeholder:nee,SelectContainer:CJ,SingleValue:oee,ValueContainer:PJ},see=iee,aee=({components:e={},theme:t,size:n,colorScheme:r="gray",isDisabled:o,isInvalid:i,isReadOnly:s,required:a,isRequired:l,inputId:u,tagVariant:c,selectedOptionStyle:d="color",selectedOptionColorScheme:f,selectedOptionColor:p,variant:m,focusBorderColor:h,errorBorderColor:S,chakraStyles:v={},onFocus:y,onBlur:b,menuIsOpen:x,...k})=>{var P;let C=Yr(),{variant:E}=C.components.Input.defaultProps,_=L0({id:u,isDisabled:o,isInvalid:i,isRequired:l,isReadOnly:s,onFocus:y,onBlur:b}),$=x??(_.readOnly?!1:void 0),M=d;["color","check"].includes(d)||(M="color");let F=f||p||"blue";return typeof F!="string"&&(F="blue"),{components:{...see,...e},colorScheme:r,size:n,tagVariant:c,selectedOptionStyle:M,selectedOptionColorScheme:F,variant:m??E,chakraStyles:v,focusBorderColor:h,errorBorderColor:S,onFocus:_.onFocus,onBlur:_.onBlur,isDisabled:_.disabled,isInvalid:!!_["aria-invalid"],inputId:_.id,isReadOnly:_.readOnly,required:a??_.required,menuIsOpen:$,...k,"aria-invalid":(P=k["aria-invalid"])!=null?P:_["aria-invalid"]}},ep=aee,lee=g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(pJ,{ref:t,...n})}),mte=lee;g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(vJ,{ref:t,...n})});g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(bJ,{ref:t,...n})});g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(xJ,{ref:t,...n})});export{Ree as $,kee as A,bT as B,ote as C,ite as D,qee as E,jH as F,Jee as G,VH as H,c8 as I,Xee as J,rte as K,TH as L,Gee as M,lte as N,bee as O,$ee as P,sy as Q,Un as R,tte as S,SK as T,L_ as U,cte as V,FH as W,_ee as X,Tee as Y,Iee as Z,Oee as _,cee as a,Mee as a0,et as a1,Eee as a2,Aee as a3,$q as a4,DH as a5,Z0 as a6,RH as a7,MH as a8,zee as a9,NH as aA,yee as aB,Bq as aC,Pee as aD,kq as aE,A as aF,fte as aG,pte as aH,Xj as aI,fee as aJ,Uy as aK,vee as aL,dee as aM,Oe as aN,_I as aO,BH as aa,Hee as ab,h8 as ac,H8 as ad,dte as ae,qq as af,Dee as ag,Fee as ah,Vee as ai,Lee as aj,Nee as ak,s_ as al,w8 as am,C8 as an,mte as ao,pK as ap,nte as aq,Yee as ar,Dq as as,Oq as at,ste as au,sK as av,aK as aw,cK as ax,uK as ay,lK as az,Wl as b,ute as c,Ef as d,u_ as e,a8 as f,Qn as g,Wee as h,Qee as i,w as j,Kee as k,xh as l,Zee as m,Bee as n,jee as o,Tq as p,Cee as q,g as r,Pq as s,_q as t,mee as u,Cq as v,hte as w,ete as x,Uee as y,ate as z}; +`]))),WQ=function(t,n){var r=t.isFocused,o=t.size,i=t.theme,s=i.colors,a=i.spacing.baseUnit;return G({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:o,lineHeight:1,marginRight:o,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},Rh=function(t){var n=t.delay,r=t.offset;return X("span",{css:Gg({animation:"".concat(HQ," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},UQ=function(t){var n=t.innerProps,r=t.isRtl,o=t.size,i=o===void 0?4:o,s=Zn(t,DQ);return X("div",K({},We(G(G({},s),{},{innerProps:n,isRtl:r,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),X(Rh,{delay:0,offset:r}),X(Rh,{delay:160,offset:!0}),X(Rh,{delay:320,offset:!r}))},qQ=function(t,n){var r=t.isDisabled,o=t.isFocused,i=t.theme,s=i.colors,a=i.borderRadius,l=i.spacing;return G({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:o?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:o?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:o?s.primary:s.neutral30}})},KQ=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,i=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return X("div",K({ref:i},We(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":o,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},GQ=KQ,YQ=["data"],XQ=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},QQ=function(t){var n=t.children,r=t.cx,o=t.getStyles,i=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return X("div",K({},We(t,"group",{group:!0}),l),X(s,K({},a,{selectProps:d,theme:c,getStyles:o,getClassNames:i,cx:r}),u),X("div",null,n))},ZQ=function(t,n){var r=t.theme,o=r.colors,i=r.spacing;return G({label:"group",cursor:"default",display:"block"},n?{}:{color:o.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:"uppercase"})},JQ=function(t){var n=s4(t);n.data;var r=Zn(n,YQ);return X("div",K({},We(t,"groupHeading",{"group-heading":!0}),r))},eZ=QQ,tZ=["innerRef","isDisabled","isHidden","inputClassName"],nZ=function(t,n){var r=t.isDisabled,o=t.value,i=t.theme,s=i.spacing,a=i.colors;return G(G({visibility:r?"hidden":"visible",transform:o?"translateZ(0)":""},rZ),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},m4={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},rZ={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":G({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},m4)},oZ=function(t){return G({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},m4)},iZ=function(t){var n=t.cx,r=t.value,o=s4(t),i=o.innerRef,s=o.isDisabled,a=o.isHidden,l=o.inputClassName,u=Zn(o,tZ);return X("div",K({},We(t,"input",{"input-container":!0}),{"data-value":r||""}),X("input",K({className:n({input:!0},l),ref:i,style:oZ(a),disabled:s},u)))},sZ=iZ,aZ=function(t,n){var r=t.theme,o=r.spacing,i=r.borderRadius,s=r.colors;return G({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:i/2,margin:o.baseUnit/2})},lZ=function(t,n){var r=t.theme,o=r.borderRadius,i=r.colors,s=t.cropWithEllipsis;return G({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:o/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},uZ=function(t,n){var r=t.theme,o=r.spacing,i=r.borderRadius,s=r.colors,a=t.isFocused;return G({alignItems:"center",display:"flex"},n?{}:{borderRadius:i/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:o.baseUnit,paddingRight:o.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},v4=function(t){var n=t.children,r=t.innerProps;return X("div",r,n)},cZ=v4,dZ=v4;function fZ(e){var t=e.children,n=e.innerProps;return X("div",K({role:"button"},n),t||X(Ay,{size:14}))}var pZ=function(t){var n=t.children,r=t.components,o=t.data,i=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return X(u,{data:o,innerProps:G(G({},We(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),i),selectProps:l},X(c,{data:o,innerProps:G({},We(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),X(d,{data:o,innerProps:G(G({},We(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},hZ=pZ,mZ=function(t,n){var r=t.isDisabled,o=t.isFocused,i=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return G({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:i?l.primary:o?l.primary25:"transparent",color:r?l.neutral20:i?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:i?l.primary:l.primary50}})},vZ=function(t){var n=t.children,r=t.isDisabled,o=t.isFocused,i=t.isSelected,s=t.innerRef,a=t.innerProps;return X("div",K({},We(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":o,"option--is-selected":i}),{ref:s,"aria-disabled":r},a),n)},gZ=vZ,yZ=function(t,n){var r=t.theme,o=r.spacing,i=r.colors;return G({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:i.neutral50,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},bZ=function(t){var n=t.children,r=t.innerProps;return X("div",K({},We(t,"placeholder",{placeholder:!0}),r),n)},SZ=bZ,xZ=function(t,n){var r=t.isDisabled,o=t.theme,i=o.spacing,s=o.colors;return G({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},wZ=function(t){var n=t.children,r=t.isDisabled,o=t.innerProps;return X("div",K({},We(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),o),n)},kZ=wZ,CZ={ClearIndicator:zQ,Control:GQ,DropdownIndicator:NQ,DownChevron:p4,CrossIcon:Ay,Group:eZ,GroupHeading:JQ,IndicatorsContainer:IQ,IndicatorSeparator:jQ,Input:sZ,LoadingIndicator:UQ,Menu:bQ,MenuList:xQ,MenuPortal:TQ,LoadingMessage:PQ,NoOptionsMessage:CQ,MultiValue:hZ,MultiValueContainer:cZ,MultiValueLabel:dZ,MultiValueRemove:fZ,Option:gZ,Placeholder:SZ,SelectContainer:$Q,SingleValue:kZ,ValueContainer:RQ},PZ=function(t){return G(G({},CZ),t.components)},uk=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function EZ(e,t){return!!(e===t||uk(e)&&uk(t))}function TZ(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return s?"option ".concat(o," is disabled. Select another option."):"option ".concat(o,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,o=t.options,i=t.label,s=i===void 0?"":i,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(h,S){return h&&h.length?"".concat(h.indexOf(S)+1," of ").concat(h.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var f=l?" disabled":"",p="".concat(u?" selected":"").concat(f);return"".concat(s).concat(p,", ").concat(d(o,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},MZ=function(t){var n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,p=l.inputValue,m=l.isMulti,h=l.isOptionDisabled,S=l.isSearchable,v=l.menuIsOpen,y=l.options,b=l.screenReaderStatus,x=l.tabSelectsValue,k=l.isLoading,P=l["aria-label"],C=l["aria-live"],E=g.useMemo(function(){return G(G({},RZ),d||{})},[d]),_=g.useMemo(function(){var H="";if(n&&E.onChange){var N=n.option,R=n.options,O=n.removedValue,D=n.removedValues,V=n.value,oe=function(Se){return Array.isArray(Se)?null:Se},B=O||N||oe(V),ee=B?f(B):"",j=R||D||void 0,te=j?j.map(f):[],ae=G({isDisabled:B&&h(B,a),label:ee,labels:te},n);H=E.onChange(ae)}return H},[n,E,h,a,f]),$=g.useMemo(function(){var H="",N=r||o,R=!!(r&&a&&a.includes(r));if(N&&E.onFocus){var O={focused:N,label:f(N),isDisabled:h(N,a),isSelected:R,options:i,context:N===r?"menu":"value",selectValue:a,isAppleDevice:c};H=E.onFocus(O)}return H},[r,o,f,h,E,i,a,c]),M=g.useMemo(function(){var H="";if(v&&y.length&&!k&&E.onFilter){var N=b({count:i.length});H=E.onFilter({inputValue:p,resultsMessage:N})}return H},[i,p,v,E,y,b,k]),F=(n==null?void 0:n.action)==="initial-input-focus",W=g.useMemo(function(){var H="";if(E.guidance){var N=o?"value":v?"menu":"input";H=E.guidance({"aria-label":P,context:N,isDisabled:r&&h(r,a),isMulti:m,isSearchable:S,tabSelectsValue:x,isInitialFocus:F})}return H},[P,r,o,m,h,S,v,E,a,x,F]),re=X(g.Fragment,null,X("span",{id:"aria-selection"},_),X("span",{id:"aria-focused"},$),X("span",{id:"aria-results"},M),X("span",{id:"aria-guidance"},W));return X(g.Fragment,null,X(ck,{id:u},F&&re),X(ck,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!F&&re))},IZ=MZ,Hv=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],AZ=new RegExp("["+Hv.map(function(e){return e.letters}).join("")+"]","g"),g4={};for(var Mh=0;Mh-1}},NZ=["innerRef"];function VZ(e){var t=e.innerRef,n=Zn(e,NZ),r=dQ(n,"onExited","in","enter","exit","appear");return X("input",K({ref:t},r,{css:Gg({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var zZ=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function BZ(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,s=g.useRef(!1),a=g.useRef(!1),l=g.useRef(0),u=g.useRef(null),c=g.useCallback(function(S,v){if(u.current!==null){var y=u.current,b=y.scrollTop,x=y.scrollHeight,k=y.clientHeight,P=u.current,C=v>0,E=x-k-b,_=!1;E>v&&s.current&&(r&&r(S),s.current=!1),C&&a.current&&(i&&i(S),a.current=!1),C&&v>E?(n&&!s.current&&n(S),P.scrollTop=x,_=!0,s.current=!0):!C&&-v>b&&(o&&!a.current&&o(S),P.scrollTop=0,_=!0,a.current=!0),_&&zZ(S)}},[n,r,o,i]),d=g.useCallback(function(S){c(S,S.deltaY)},[c]),f=g.useCallback(function(S){l.current=S.changedTouches[0].clientY},[]),p=g.useCallback(function(S){var v=l.current-S.changedTouches[0].clientY;c(S,v)},[c]),m=g.useCallback(function(S){if(S){var v=lQ?{passive:!1}:!1;S.addEventListener("wheel",d,v),S.addEventListener("touchstart",f,v),S.addEventListener("touchmove",p,v)}},[p,f,d]),h=g.useCallback(function(S){S&&(S.removeEventListener("wheel",d,!1),S.removeEventListener("touchstart",f,!1),S.removeEventListener("touchmove",p,!1))},[p,f,d]);return g.useEffect(function(){if(t){var S=u.current;return m(S),function(){h(S)}}},[t,m,h]),function(S){u.current=S}}var fk=["boxSizing","height","overflow","paddingRight","position"],pk={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function hk(e){e.preventDefault()}function mk(e){e.stopPropagation()}function vk(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function gk(){return"ontouchstart"in window||navigator.maxTouchPoints}var yk=!!(typeof window<"u"&&window.document&&window.document.createElement),pa=0,Di={capture:!1,passive:!1};function jZ(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=g.useRef({}),i=g.useRef(null),s=g.useCallback(function(l){if(yk){var u=document.body,c=u&&u.style;if(r&&fk.forEach(function(m){var h=c&&c[m];o.current[m]=h}),r&&pa<1){var d=parseInt(o.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,p=window.innerWidth-f+d||0;Object.keys(pk).forEach(function(m){var h=pk[m];c&&(c[m]=h)}),c&&(c.paddingRight="".concat(p,"px"))}u&&gk()&&(u.addEventListener("touchmove",hk,Di),l&&(l.addEventListener("touchstart",vk,Di),l.addEventListener("touchmove",mk,Di))),pa+=1}},[r]),a=g.useCallback(function(l){if(yk){var u=document.body,c=u&&u.style;pa=Math.max(pa-1,0),r&&pa<1&&fk.forEach(function(d){var f=o.current[d];c&&(c[d]=f)}),u&&gk()&&(u.removeEventListener("touchmove",hk,Di),l&&(l.removeEventListener("touchstart",vk,Di),l.removeEventListener("touchmove",mk,Di)))}},[r]);return g.useEffect(function(){if(t){var l=i.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){i.current=l}}var HZ=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},WZ={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function UZ(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=BZ({isEnabled:o,onBottomArrive:i,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=jZ({isEnabled:n}),d=function(p){u(p),c(p)};return X(g.Fragment,null,n&&X("div",{onClick:HZ,css:WZ}),t(d))}var qZ={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},KZ=function(t){var n=t.name,r=t.onFocus;return X("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:qZ,value:"",onChange:function(){}})},GZ=KZ;function Dy(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function YZ(){return Dy(/^iPhone/i)}function b4(){return Dy(/^Mac/i)}function XZ(){return Dy(/^iPad/i)||b4()&&navigator.maxTouchPoints>1}function QZ(){return YZ()||XZ()}function ZZ(){return b4()||QZ()}var JZ=function(t){return t.label},S4=function(t){return t.label},x4=function(t){return t.value},eJ=function(t){return!!t.isDisabled},tJ={clearIndicator:VQ,container:_Q,control:qQ,dropdownIndicator:LQ,group:XQ,groupHeading:ZQ,indicatorsContainer:MQ,indicatorSeparator:BQ,input:nZ,loadingIndicator:WQ,loadingMessage:kQ,menu:vQ,menuList:SQ,menuPortal:EQ,multiValue:aZ,multiValueLabel:lZ,multiValueRemove:uZ,noOptionsMessage:wQ,option:mZ,placeholder:yZ,singleValue:xZ,valueContainer:OQ},nJ={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},rJ=4,w4=4,oJ=38,iJ=w4*2,sJ={baseUnit:w4,controlHeight:oJ,menuGutter:iJ},Dh={borderRadius:rJ,colors:nJ,spacing:sJ},aJ={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ak(),captureMenuScroll:!ak(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:LZ(),formatGroupLabel:JZ,getOptionLabel:S4,getOptionValue:x4,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:eJ,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!sQ(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function bk(e,t,n,r){var o=P4(e,t,n),i=E4(e,t,n),s=C4(e,t),a=qd(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:s,value:a,index:r}}function Vc(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(s,a){return bk(e,s,t,a)}).filter(function(s){return xk(e,s)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=bk(e,n,t,r);return xk(e,i)?i:void 0}).filter(uQ)}function k4(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,xs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Sk(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,xs(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function lJ(e,t){return k4(Vc(e,t))}function xk(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,s=t.label,a=t.value;return(!_4(e)||!i)&&T4(e,{label:s,value:a,data:o},r)}function uJ(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o-1?n:t[0]}var Fh=function(t,n){var r,o=(r=t.find(function(i){return i.data===n}))===null||r===void 0?void 0:r.id;return o||null},C4=function(t,n){return t.getOptionLabel(n)},qd=function(t,n){return t.getOptionValue(n)};function P4(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function E4(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=qd(e,t);return n.some(function(o){return qd(e,o)===r})}function T4(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var _4=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},dJ=1,nu=function(e){RX(n,e);var t=AX(n);function n(r){var o;if($X(this,n),o=t.call(this,r),o.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.isAppleDevice=ZZ(),o.controlRef=null,o.getControlRef=function(l){o.controlRef=l},o.focusedOptionRef=null,o.getFocusedOptionRef=function(l){o.focusedOptionRef=l},o.menuListRef=null,o.getMenuListRef=function(l){o.menuListRef=l},o.inputRef=null,o.getInputRef=function(l){o.inputRef=l},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(l,u){var c=o.props,d=c.onChange,f=c.name;u.name=f,o.ariaOnChange(l,u),d(l,u)},o.setValue=function(l,u,c){var d=o.props,f=d.closeMenuOnSelect,p=d.isMulti,m=d.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(o.setState({inputIsHiddenAfterUpdate:!p}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(l,{action:u,option:c})},o.selectOption=function(l){var u=o.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,p=o.state.selectValue,m=d&&o.isOptionSelected(l,p),h=o.isOptionDisabled(l,p);if(m){var S=o.getOptionValue(l);o.setValue(p.filter(function(v){return o.getOptionValue(v)!==S}),"deselect-option",l)}else if(!h)d?o.setValue([].concat(xs(p),[l]),"select-option",l):o.setValue(l,"select-option");else{o.ariaOnChange(l,{action:"select-option",option:l,name:f});return}c&&o.blurInput()},o.removeValue=function(l){var u=o.props.isMulti,c=o.state.selectValue,d=o.getOptionValue(l),f=c.filter(function(m){return o.getOptionValue(m)!==d}),p=Ra(u,f,f[0]||null);o.onChange(p,{action:"remove-value",removedValue:l}),o.focusInput()},o.clearValue=function(){var l=o.state.selectValue;o.onChange(Ra(o.props.isMulti,[],null),{action:"clear",removedValues:l})},o.popValue=function(){var l=o.props.isMulti,u=o.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=Ra(l,d,d[0]||null);o.onChange(f,{action:"pop-value",removedValue:c})},o.getFocusedOptionId=function(l){return Fh(o.state.focusableOptionsWithIds,l)},o.getFocusableOptionsWithIds=function(){return Sk(Vc(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;cp||f>p}},o.onTouchEnd=function(l){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(l.target)&&o.menuListRef&&!o.menuListRef.contains(l.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(l){o.userIsDragging||o.onControlMouseDown(l)},o.onClearIndicatorTouchEnd=function(l){o.userIsDragging||o.onClearIndicatorMouseDown(l)},o.onDropdownIndicatorTouchEnd=function(l){o.userIsDragging||o.onDropdownIndicatorMouseDown(l)},o.handleInputChange=function(l){var u=o.props.inputValue,c=l.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(c,{action:"input-change",prevInputValue:u}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(l){o.props.onFocus&&o.props.onFocus(l),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(l){var u=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(l),o.onInputChange("",{action:"input-blur",prevInputValue:u}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(l){if(!(o.blockOptionHover||o.state.focusedOption===l)){var u=o.getFocusableOptions(),c=u.indexOf(l);o.setState({focusedOption:l,focusedOptionId:c>-1?o.getFocusedOptionId(l):null})}},o.shouldHideSelectedOptions=function(){return _4(o.props)},o.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),o.focus()},o.onKeyDown=function(l){var u=o.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,p=u.inputValue,m=u.isClearable,h=u.isDisabled,S=u.menuIsOpen,v=u.onKeyDown,y=u.tabSelectsValue,b=u.openMenuOnFocus,x=o.state,k=x.focusedOption,P=x.focusedValue,C=x.selectValue;if(!h&&!(typeof v=="function"&&(v(l),l.defaultPrevented))){switch(o.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||p)return;o.focusValue("previous");break;case"ArrowRight":if(!c||p)return;o.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(P)o.removeValue(P);else{if(!d)return;c?o.popValue():m&&o.clearValue()}break;case"Tab":if(o.isComposing||l.shiftKey||!S||!y||!k||b&&o.isOptionSelected(k,C))return;o.selectOption(k);break;case"Enter":if(l.keyCode===229)break;if(S){if(!k||o.isComposing)return;o.selectOption(k);break}return;case"Escape":S?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:p}),o.onMenuClose()):m&&f&&o.clearValue();break;case" ":if(p)return;if(!S){o.openMenu("first");break}if(!k)return;o.selectOption(k);break;case"ArrowUp":S?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":S?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!S)return;o.focusOption("pageup");break;case"PageDown":if(!S)return;o.focusOption("pagedown");break;case"Home":if(!S)return;o.focusOption("first");break;case"End":if(!S)return;o.focusOption("last");break;default:return}l.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++dJ),o.state.selectValue=Wd(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),s=o.buildFocusableOptions(),a=s.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=s[a],o.state.focusedOptionId=Fh(i,s[a])}return o}return OX(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&sk(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(o){var i=this.props,s=i.isDisabled,a=i.menuIsOpen,l=this.state.isFocused;(l&&!s&&o.isDisabled||l&&a&&!o.menuIsOpen)&&this.focusInput(),l&&s&&!o.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&o.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(sk(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(o,i){this.props.onInputChange(o,i)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(o){var i=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=o==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return i.onMenuOpen()})}},{key:"focusValue",value:function(o){var i=this.state,s=i.selectValue,a=i.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(o){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l0&&arguments[0]!==void 0?arguments[0]:"first",i=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),o==="up"?l=u>0?u-1:a.length-1:o==="down"?l=(u+1)%a.length:o==="pageup"?(l=u-i,l<0&&(l=0)):o==="pagedown"?(l=u+i,l>a.length-1&&(l=a.length-1)):o==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Dh):G(G({},Dh),this.props.theme):Dh}},{key:"getCommonProps",value:function(){var o=this.clearValue,i=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,p=d.isRtl,m=d.options,h=this.hasValue();return{clearValue:o,cx:i,getStyles:s,getClassNames:a,getValue:l,hasValue:h,isMulti:f,isRtl:p,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var o=this.state.selectValue;return o.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var o=this.props,i=o.isClearable,s=o.isMulti;return i===void 0?s:i}},{key:"isOptionDisabled",value:function(o,i){return P4(this.props,o,i)}},{key:"isOptionSelected",value:function(o,i){return E4(this.props,o,i)}},{key:"filterOption",value:function(o,i){return T4(this.props,o,i)}},{key:"formatOptionLabel",value:function(o,i){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(o,{context:i,inputValue:s,selectValue:a})}else return this.getOptionLabel(o)}},{key:"formatGroupLabel",value:function(o){return this.props.formatGroupLabel(o)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var o=this.props,i=o.isDisabled,s=o.isSearchable,a=o.inputId,l=o.inputValue,u=o.tabIndex,c=o.form,d=o.menuIsOpen,f=o.required,p=this.getComponents(),m=p.Input,h=this.state,S=h.inputIsHidden,v=h.ariaSelection,y=this.commonProps,b=a||this.getElementId("input"),x=G(G(G({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?(v==null?void 0:v.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?g.createElement(m,K({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:b,innerRef:this.getInputRef,isDisabled:i,isHidden:S,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},x)):g.createElement(VZ,K({id:b,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Hd,onFocus:this.onInputFocus,disabled:i,tabIndex:u,inputMode:"none",form:c,value:""},x))}},{key:"renderPlaceholderOrValue",value:function(){var o=this,i=this.getComponents(),s=i.MultiValue,a=i.MultiValueContainer,l=i.MultiValueLabel,u=i.MultiValueRemove,c=i.SingleValue,d=i.Placeholder,f=this.commonProps,p=this.props,m=p.controlShouldRenderValue,h=p.isDisabled,S=p.isMulti,v=p.inputValue,y=p.placeholder,b=this.state,x=b.selectValue,k=b.focusedValue,P=b.isFocused;if(!this.hasValue()||!m)return v?null:g.createElement(d,K({},f,{key:"placeholder",isDisabled:h,isFocused:P,innerProps:{id:this.getElementId("placeholder")}}),y);if(S)return x.map(function(E,_){var $=E===k,M="".concat(o.getOptionLabel(E),"-").concat(o.getOptionValue(E));return g.createElement(s,K({},f,{components:{Container:a,Label:l,Remove:u},isFocused:$,isDisabled:h,key:M,index:_,removeProps:{onClick:function(){return o.removeValue(E)},onTouchEnd:function(){return o.removeValue(E)},onMouseDown:function(W){W.preventDefault()}},data:E}),o.formatOptionLabel(E,"value"))});if(v)return null;var C=x[0];return g.createElement(c,K({},f,{data:C,isDisabled:h}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var o=this.getComponents(),i=o.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!i||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(i,K({},s,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var o=this.getComponents(),i=o.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!i||!u)return null;var d={"aria-hidden":"true"};return g.createElement(i,K({},s,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var o=this.getComponents(),i=o.DropdownIndicator,s=o.IndicatorSeparator;if(!i||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return g.createElement(s,K({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var o=this.getComponents(),i=o.DropdownIndicator;if(!i)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(i,K({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var o=this,i=this.getComponents(),s=i.Group,a=i.GroupHeading,l=i.Menu,u=i.MenuList,c=i.MenuPortal,d=i.LoadingMessage,f=i.NoOptionsMessage,p=i.Option,m=this.commonProps,h=this.state.focusedOption,S=this.props,v=S.captureMenuScroll,y=S.inputValue,b=S.isLoading,x=S.loadingMessage,k=S.minMenuHeight,P=S.maxMenuHeight,C=S.menuIsOpen,E=S.menuPlacement,_=S.menuPosition,$=S.menuPortalTarget,M=S.menuShouldBlockScroll,F=S.menuShouldScrollIntoView,W=S.noOptionsMessage,re=S.onMenuScrollToTop,H=S.onMenuScrollToBottom;if(!C)return null;var N=function(ee,j){var te=ee.type,ae=ee.data,we=ee.isDisabled,Se=ee.isSelected,xt=ee.label,Ln=ee.value,Bt=h===ae,pe=we?void 0:function(){return o.onOptionHover(ae)},tt=we?void 0:function(){return o.selectOption(ae)},Sn="".concat(o.getElementId("option"),"-").concat(j),ne={id:Sn,onClick:tt,onMouseMove:pe,onMouseOver:pe,tabIndex:-1,role:"option","aria-selected":o.isAppleDevice?void 0:Se};return g.createElement(p,K({},m,{innerProps:ne,data:ae,isDisabled:we,isSelected:Se,key:Sn,label:xt,type:te,value:Ln,isFocused:Bt,innerRef:Bt?o.getFocusedOptionRef:void 0}),o.formatOptionLabel(ee.data,"menu"))},R;if(this.hasOptions())R=this.getCategorizedOptions().map(function(B){if(B.type==="group"){var ee=B.data,j=B.options,te=B.index,ae="".concat(o.getElementId("group"),"-").concat(te),we="".concat(ae,"-heading");return g.createElement(s,K({},m,{key:ae,data:ee,options:j,Heading:a,headingProps:{id:we,data:B.data},label:o.formatGroupLabel(B.data)}),B.options.map(function(Se){return N(Se,"".concat(te,"-").concat(Se.index))}))}else if(B.type==="option")return N(B,"".concat(B.index))});else if(b){var O=x({inputValue:y});if(O===null)return null;R=g.createElement(d,m,O)}else{var D=W({inputValue:y});if(D===null)return null;R=g.createElement(f,m,D)}var V={minMenuHeight:k,maxMenuHeight:P,menuPlacement:E,menuPosition:_,menuShouldScrollIntoView:F},oe=g.createElement(gQ,K({},m,V),function(B){var ee=B.ref,j=B.placerProps,te=j.placement,ae=j.maxHeight;return g.createElement(l,K({},m,V,{innerRef:ee,innerProps:{onMouseDown:o.onMenuMouseDown,onMouseMove:o.onMenuMouseMove},isLoading:b,placement:te}),g.createElement(UZ,{captureEnabled:v,onTopArrive:re,onBottomArrive:H,lockEnabled:M},function(we){return g.createElement(u,K({},m,{innerRef:function(xt){o.getMenuListRef(xt),we(xt)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:o.getElementId("listbox")},isLoading:b,maxHeight:ae,focusedOption:h}),R)}))});return $||_==="fixed"?g.createElement(c,K({},m,{appendTo:$,controlElement:this.controlRef,menuPlacement:E,menuPosition:_}),oe):oe}},{key:"renderFormField",value:function(){var o=this,i=this.props,s=i.delimiter,a=i.isDisabled,l=i.isMulti,u=i.name,c=i.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return g.createElement(GZ,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var f=d.map(function(h){return o.getOptionValue(h)}).join(s);return g.createElement("input",{name:u,type:"hidden",value:f})}else{var p=d.length>0?d.map(function(h,S){return g.createElement("input",{key:"i-".concat(S),name:u,type:"hidden",value:o.getOptionValue(h)})}):g.createElement("input",{name:u,type:"hidden",value:""});return g.createElement("div",null,p)}else{var m=d[0]?this.getOptionValue(d[0]):"";return g.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var o=this.commonProps,i=this.state,s=i.ariaSelection,a=i.focusedOption,l=i.focusedValue,u=i.isFocused,c=i.selectValue,d=this.getFocusableOptions();return g.createElement(IZ,K({},o,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var o=this.getComponents(),i=o.Control,s=o.IndicatorsContainer,a=o.SelectContainer,l=o.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,p=u.menuIsOpen,m=this.state.isFocused,h=this.commonProps=this.getCommonProps();return g.createElement(a,K({},h,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),g.createElement(i,K({},h,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:p}),g.createElement(l,K({},h,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),g.createElement(s,K({},h,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(o,i){var s=i.prevProps,a=i.clearFocusValueOnUpdate,l=i.inputIsHiddenAfterUpdate,u=i.ariaSelection,c=i.isFocused,d=i.prevWasFocused,f=i.instancePrefix,p=o.options,m=o.value,h=o.menuIsOpen,S=o.inputValue,v=o.isMulti,y=Wd(m),b={};if(s&&(m!==s.value||p!==s.options||h!==s.menuIsOpen||S!==s.inputValue)){var x=h?lJ(o,y):[],k=h?Sk(Vc(o,y),"".concat(f,"-option")):[],P=a?uJ(i,y):null,C=cJ(i,x),E=Fh(k,C);b={selectValue:y,focusedOption:C,focusedOptionId:E,focusableOptionsWithIds:k,focusedValue:P,clearFocusValueOnUpdate:!1}}var _=l!=null&&o!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},$=u,M=c&&d;return c&&!M&&($={value:Ra(v,y,y[0]||null),options:y,action:"initial-input-focus"},M=!d),(u==null?void 0:u.action)==="initial-input-focus"&&($=null),G(G(G({},b),_),{},{prevProps:o,ariaSelection:$,prevWasFocused:M})}}]),n}(g.Component);nu.defaultProps=aJ;var fJ=g.forwardRef(function(e,t){var n=Zf(e);return g.createElement(nu,K({ref:t},n))}),pJ=fJ,hJ=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],wk=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=String(t).toLowerCase(),i=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return i===o||s===o},Lh={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,o){return!(!t||n.some(function(i){return wk(t,i,o)})||r.some(function(i){return wk(t,i,o)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function $4(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,o=r===void 0?"last":r,i=e.formatCreateLabel,s=i===void 0?Lh.formatCreateLabel:i,a=e.isValidNewOption,l=a===void 0?Lh.isValidNewOption:a,u=e.getNewOptionData,c=u===void 0?Lh.getNewOptionData:u,d=e.onCreateOption,f=e.options,p=f===void 0?[]:f,m=e.onChange,h=Zn(e,hJ),S=h.getOptionValue,v=S===void 0?x4:S,y=h.getOptionLabel,b=y===void 0?S4:y,x=h.inputValue,k=h.isLoading,P=h.isMulti,C=h.value,E=h.name,_=g.useMemo(function(){return l(x,Wd(C),p,{getOptionValue:v,getOptionLabel:b})?c(x,s(x)):void 0},[s,c,b,v,x,l,p,C]),$=g.useMemo(function(){return(n||!k)&&_?o==="first"?[_].concat(xs(p)):[].concat(xs(p),[_]):p},[n,o,k,_,p]),M=g.useCallback(function(F,W){if(W.action!=="select-option")return m(F,W);var re=Array.isArray(F)?F:[F];if(re[re.length-1]===_){if(d)d(x);else{var H=c(x,x),N={action:"create-option",name:E,option:H};m(Ra(P,[].concat(xs(Wd(C)),[H]),H),N)}return}m(F,W)},[c,x,P,E,_,d,m,C]);return G(G({},h),{},{options:$,onChange:M})}var mJ=g.forwardRef(function(e,t){var n=Zf(e),r=$4(n);return g.createElement(nu,K({ref:t},r))}),vJ=mJ,gJ=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function O4(e){var t=e.defaultOptions,n=t===void 0?!1:t,r=e.cacheOptions,o=r===void 0?!1:r,i=e.loadOptions;e.options;var s=e.isLoading,a=s===void 0?!1:s,l=e.onInputChange,u=e.filterOption,c=u===void 0?null:u,d=Zn(e,gJ),f=d.inputValue,p=g.useRef(void 0),m=g.useRef(!1),h=g.useState(Array.isArray(n)?n:void 0),S=st(h,2),v=S[0],y=S[1],b=g.useState(typeof f<"u"?f:""),x=st(b,2),k=x[0],P=x[1],C=g.useState(n===!0),E=st(C,2),_=E[0],$=E[1],M=g.useState(void 0),F=st(M,2),W=F[0],re=F[1],H=g.useState([]),N=st(H,2),R=N[0],O=N[1],D=g.useState(!1),V=st(D,2),oe=V[0],B=V[1],ee=g.useState({}),j=st(ee,2),te=j[0],ae=j[1],we=g.useState(void 0),Se=st(we,2),xt=Se[0],Ln=Se[1],Bt=g.useState(void 0),pe=st(Bt,2),tt=pe[0],Sn=pe[1];o!==tt&&(ae({}),Sn(o)),n!==xt&&(y(Array.isArray(n)?n:void 0),Ln(n)),g.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var ne=g.useCallback(function(nt,wt){if(!i)return wt();var De=i(nt,wt);De&&typeof De.then=="function"&&De.then(wt,function(){return wt()})},[i]);g.useEffect(function(){n===!0&&ne(k,function(nt){m.current&&(y(nt||[]),$(!!p.current))})},[]);var Pe=g.useCallback(function(nt,wt){var De=tQ(nt,wt,l);if(!De){p.current=void 0,P(""),re(""),O([]),$(!1),B(!1);return}if(o&&te[De])P(De),re(De),O(te[De]),$(!1),B(!1);else{var Ei=p.current={};P(De),$(!0),B(!W),ne(De,function(Ti){m&&Ei===p.current&&(p.current=void 0,$(!1),re(De),O(Ti||[]),B(!1),ae(Ti?G(G({},te),{},ei({},De,Ti)):te))})}},[o,ne,W,te,l]),Be=oe?[]:k&&W?R:v||[];return G(G({},d),{},{options:Be,isLoading:_||a,onInputChange:Pe,filterOption:c})}var yJ=g.forwardRef(function(e,t){var n=O4(e),r=Zf(n);return g.createElement(nu,K({ref:t},r))}),bJ=yJ,SJ=g.forwardRef(function(e,t){var n=O4(e),r=Zf(n),o=$4(r);return g.createElement(nu,K({ref:t},o))}),xJ=SJ,R4=e=>{let{className:t,clearValue:n,cx:r,getStyles:o,getClassNames:i,getValue:s,hasValue:a,isMulti:l,isRtl:u,options:c,selectOption:d,selectProps:f,setValue:p,theme:m,...h}=e;return{...h}},wJ=e=>typeof e=="string"&&["sm","md","lg"].includes(e),kJ=e=>wJ(e)?e:e==="xs"?"sm":e==="xl"?"lg":"md",Jn=e=>{let t=Yr(),n=kJ(t.components.Input.defaultProps.size),r=e??n;return qH(typeof r=="string"?[r]:r,{fallback:"md"})||n},CJ=e=>{let{children:t,className:n,cx:r,innerProps:o,isDisabled:i,isRtl:s,hasValue:a,selectProps:{chakraStyles:l}}=e,u={position:"relative",direction:s?"rtl":void 0,...i?{cursor:"not-allowed"}:{}},c=l!=null&&l.container?l.container(u,e):u;return w.jsx(et,{...o,className:r({"--is-disabled":i,"--is-rtl":s,"--has-value":a},n),sx:c,children:t})},PJ=e=>{let{children:t,className:n,cx:r,isMulti:o,hasValue:i,innerProps:s,selectProps:{chakraStyles:a,size:l,variant:u,focusBorderColor:c,errorBorderColor:d,controlShouldRenderValue:f}}=e,p=Jn(l),m=ut("Input",{size:p,variant:u,focusBorderColor:c,errorBorderColor:d}),h={display:o&&i&&f?"flex":"grid",alignItems:"center",flex:1,paddingY:"2px",paddingX:m.field.px,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},S=a!=null&&a.valueContainer?a.valueContainer(h,e):h;return w.jsx(et,{...s,className:r({"value-container":!0,"value-container--is-multi":o,"value-container--has-value":i},n),sx:S,children:t})},EJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i}}=e,s={display:"flex",alignItems:"center",alignSelf:"stretch",flexShrink:0},a=i!=null&&i.indicatorsContainer?i.indicatorsContainer(s,e):s;return w.jsx(et,{...o,className:r({indicators:!0},n),sx:a,children:t})},TJ=e=>{let{className:t,cx:n,children:r,innerRef:o,innerProps:i,isDisabled:s,isFocused:a,menuIsOpen:l,selectProps:{chakraStyles:u,size:c,variant:d,focusBorderColor:f,errorBorderColor:p,isInvalid:m,isReadOnly:h}}=e,S=Jn(c),{field:{height:v,h:y,...b}}=ut("Input",{size:S,variant:d,focusBorderColor:f,errorBorderColor:p}),x={...b,position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",padding:0,overflow:"hidden",height:"auto",minH:v||y,...s?{pointerEvents:"none"}:{}},k=u!=null&&u.control?u.control(x,e):x;return w.jsx(et,{ref:o,className:n({control:!0,"control--is-disabled":s,"control--is-focused":a,"control--menu-is-open":l},t),sx:k,...i,"data-focus":a?!0:void 0,"data-focus-visible":a?!0:void 0,"data-invalid":m?!0:void 0,"data-disabled":s?!0:void 0,"data-readonly":h?!0:void 0,children:r})},_J=e=>{let{className:t,cx:n,selectProps:{chakraStyles:r,useBasicStyles:o,variant:i}}=e,s={opacity:1,...o||i!=="outline"?{display:"none"}:{}},a=r!=null&&r.indicatorSeparator?r.indicatorSeparator(s,e):s;return w.jsx(f_,{className:n({"indicator-separator":!0},t),sx:a,orientation:"vertical"})},$J=e=>w.jsx(Qn,{role:"presentation",focusable:"false","aria-hidden":"true",...e,children:w.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),OJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,useBasicStyles:s,size:a,focusBorderColor:l,errorBorderColor:u,variant:c}}=e,d=Jn(a),f=ut("Input",{size:d,variant:c,focusBorderColor:l,errorBorderColor:u}),p={sm:"16px",md:"20px",lg:"24px"}[d],m={...f.addon,display:"flex",alignItems:"center",justifyContent:"center",height:"100%",borderRadius:0,borderWidth:0,fontSize:p,...s&&{background:"transparent",padding:0,width:6,marginRight:2,marginLeft:1,cursor:"inherit"}},h=i!=null&&i.dropdownIndicator?i.dropdownIndicator(m,e):m,S={height:"1em",width:"1em"},v=i!=null&&i.downChevron?i.downChevron(S,e):S;return w.jsx(et,{...o,className:r({indicator:!0,"dropdown-indicator":!0},n),sx:h,children:t||w.jsx($J,{sx:v})})},RJ=e=>w.jsx(Qn,{focusable:"false","aria-hidden":!0,...e,children:w.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})}),MJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,size:s}}=e,a=Jn(s),l={...en("CloseButton",{size:a}),marginX:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,cursor:"pointer"},u=i!=null&&i.clearIndicator?i.clearIndicator(l,e):l,c={width:"1em",height:"1em"},d=i!=null&&i.crossIcon?i.crossIcon(c,e):c;return w.jsx(et,{role:"button",className:r({indicator:!0,"clear-indicator":!0},n),sx:u,"aria-label":"Clear selected options",...o,children:t||w.jsx(RJ,{sx:d})})},IJ=e=>{let{className:t,cx:n,innerProps:r,selectProps:{chakraStyles:o,size:i},color:s,emptyColor:a,speed:l,thickness:u,spinnerSize:c}=e,d=Jn(i),f={sm:"xs",md:"sm",lg:"md"}[d],p={marginRight:3},m=o!=null&&o.loadingIndicator?o.loadingIndicator(p,e):p;return w.jsx(Vf,{className:n({indicator:!0,"loading-indicator":!0},t),sx:m,...r,size:c||f,color:s,emptyColor:a,speed:l,thickness:u})},AJ=TJ,DJ=e=>{let{className:t,cx:n,value:r,selectProps:{chakraStyles:o,isReadOnly:i}}=e,{innerRef:s,isDisabled:a,isHidden:l,inputClassName:u,...c}=R4(e),d={gridArea:"1 / 2",minW:"2px",border:0,margin:0,outline:0,padding:0},f={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content",color:"inherit",marginX:"0.125rem",paddingY:"0.125rem",visibility:a?"hidden":"visible",transform:r?"translateZ(0)":"",_after:{content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre",padding:0,...d}},p=o!=null&&o.inputContainer?o.inputContainer(f,e):f,m={background:0,opacity:l?0:1,width:"100%",...d},h=o!=null&&o.input?o.input(m,e):m;return w.jsx(et,{className:n({"input-container":!0},t),"data-value":r||"",sx:p,children:w.jsx(A.input,{className:n({input:!0},u),ref:s,sx:h,disabled:a,readOnly:i?!0:void 0,...c})})},FJ=DJ,LJ=e=>e?{bottom:"top",top:"bottom"}[e]:"top",NJ=e=>{let{className:t,cx:n,children:r,innerProps:o,innerRef:i,placement:s,selectProps:{chakraStyles:a}}=e,l={position:"absolute",[LJ(s)]:"100%",marginY:"8px",width:"100%",zIndex:1},u=a!=null&&a.menu?a.menu(l,e):l;return w.jsx(P_,{children:w.jsx(et,{...o,ref:i,className:n({menu:!0},t),sx:u,children:r})})},VJ=NJ,zJ=e=>{var t;let{className:n,cx:r,innerRef:o,children:i,maxHeight:s,isMulti:a,innerProps:l,selectProps:{chakraStyles:u,size:c,variant:d,focusBorderColor:f,errorBorderColor:p}}=e,m=ut("Menu"),h=Jn(c),S=ut("Input",{size:h,variant:d,focusBorderColor:f,errorBorderColor:p}).field,v={...m.list,minW:"100%",maxHeight:`${s}px`,overflowY:"auto","--input-border-radius":S==null?void 0:S["--input-border-radius"],borderRadius:(S==null?void 0:S.borderRadius)||((t=m.list)==null?void 0:t.borderRadius),position:"relative",WebkitOverflowScrolling:"touch"},y=u!=null&&u.menuList?u.menuList(v,e):v;return w.jsx(et,{...l,className:r({"menu-list":!0,"menu-list--is-multi":a},n),sx:y,ref:o,children:i})},BJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,size:s}}=e,a=Jn(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[a],fontSize:a},u=i!=null&&i.loadingMessage?i.loadingMessage(l,e):l;return w.jsx(et,{...o,className:r({"menu-notice":!0,"menu-notice--loading":!0},n),sx:u,children:t})},jJ=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i,size:s}}=e,a=Jn(s),l={color:"chakra-subtle-text",textAlign:"center",paddingY:{sm:"6px",md:"8px",lg:"10px"}[a],fontSize:a},u=i!=null&&i.noOptionsMessage?i.noOptionsMessage(l,e):l;return w.jsx(et,{...o,className:r({"menu-notice":!0,"menu-notice--no-options":!0},n),sx:u,children:t})},HJ=e=>{let{children:t,className:n,cx:r,theme:o,getStyles:i,Heading:s,headingProps:a,label:l,selectProps:u,innerProps:c,getClassNames:d}=e,{chakraStyles:f}=u,p={},m=f!=null&&f.group?f.group(p,e):p;return w.jsxs(et,{...c,className:r({group:!0},n),sx:m,children:[w.jsx(s,{...a,selectProps:u,cx:r,theme:o,getStyles:i,getClassNames:d,children:l}),w.jsx(et,{children:t})]})},WJ=e=>{let{cx:t,className:n,selectProps:{chakraStyles:r,size:o,hasStickyGroupHeaders:i}}=e,{data:s,...a}=R4(e),l=ut("Menu"),u=Jn(o),c={sm:"xs",md:"sm",lg:"md"},d={sm:"0.4rem 0.8rem",md:"0.5rem 1rem",lg:"0.6rem 1.2rem"},f={...l.groupTitle,fontSize:c[u],padding:d[u],margin:0,borderBottomWidth:i?"1px":0,position:i?"sticky":"static",top:-2,bg:l.list.bg,zIndex:1},p=r!=null&&r.groupHeading?r.groupHeading(f,e):f;return w.jsx(et,{...a,className:t({"group-heading":!0},n),sx:p})},UJ=e=>w.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:w.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),qJ=e=>{let{className:t,cx:n,innerRef:r,innerProps:o,children:i,isFocused:s,isDisabled:a,isSelected:l,selectProps:{chakraStyles:u,size:c,isMulti:d,hideSelectedOptions:f,selectedOptionStyle:p,selectedOptionColorScheme:m}}=e,h=ut("Menu").item,S=Jn(c),v={sm:"0.6rem",md:"0.8rem",lg:"1rem"},y={sm:"0.3rem",md:"0.4rem",lg:"0.5rem"},b=sb(`${m}.500`,`${m}.300`),x=sb("white","black"),k=p==="check"&&(!d||f===!1),P=p==="color",C={...h,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",textAlign:"start",fontSize:S,paddingX:v[S],paddingY:y[S],...P&&{_selected:{bg:b,color:x,_active:{bg:b}}}},E=u!=null&&u.option?u.option(C,e):C;return w.jsxs(et,{...o,className:n({option:!0,"option--is-disabled":a,"option--is-focused":s,"option--is-selected":l},t),sx:E,ref:r,"data-focus":s?!0:void 0,"aria-disabled":a?!0:void 0,"aria-selected":l,children:[k&&w.jsx(E_,{fontSize:"0.8em",marginEnd:"0.75rem",opacity:l?1:0,children:w.jsx(UJ,{})}),i]})},KJ=e=>typeof e=="object"&&e!==null&&"colorScheme"in e&&typeof e.colorScheme=="string",GJ=e=>typeof e=="object"&&e!==null&&"variant"in e&&typeof e.variant=="string",M4=e=>typeof e=="object"&&e!==null&&"isFixed"in e&&typeof e.isFixed=="boolean",YJ=e=>{let{children:t,className:n,components:r,cx:o,data:i,innerProps:s,isDisabled:a,isFocused:l,removeProps:u,selectProps:c,cropWithEllipsis:d}=e,{Container:f,Label:p,Remove:m}=r,{chakraStyles:h,colorScheme:S,tagVariant:v,size:y}=c,b=Jn(y),x="",k="",P=!1;KJ(i)&&(x=i.colorScheme),GJ(i)&&(k=i.variant),M4(i)&&(P=i.isFixed);let C=ut("Tag",{size:b,colorScheme:x||S,variant:k||v||(P?"solid":"subtle")}),E={...C.container,display:"flex",alignItems:"center",minWidth:0,margin:"0.125rem"},_=h!=null&&h.multiValue?h.multiValue(E,e):E,$={...C.label,overflow:"hidden",textOverflow:d||d===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},M=h!=null&&h.multiValueLabel?h.multiValueLabel($,e):$,F={...C.closeButton,display:"flex",alignItems:"center",justifyContent:"center"},W=h!=null&&h.multiValueRemove?h.multiValueRemove(F,e):F;return w.jsxs(f,{data:i,innerProps:{className:o({"multi-value":!0,"multi-value--is-disabled":a},n),...s},sx:_,selectProps:c,children:[w.jsx(p,{data:i,innerProps:{className:o({"multi-value__label":!0},n)},sx:M,selectProps:c,children:t}),w.jsx(m,{data:i,innerProps:{className:o({"multi-value__remove":!0},n),"aria-label":`Remove ${t||"option"}`,...u},sx:W,selectProps:c,isFocused:l})]})},XJ=e=>{let{children:t,innerProps:n,sx:r}=e;return w.jsx(A.span,{...n,sx:r,children:t})},QJ=e=>{let{children:t,innerProps:n,sx:r}=e;return w.jsx(A.span,{...n,sx:r,children:t})},ZJ=e=>w.jsx(Qn,{verticalAlign:"inherit",viewBox:"0 0 512 512",...e,children:w.jsx("path",{fill:"currentColor",d:"M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z"})}),JJ=e=>{let{children:t,innerProps:n,isFocused:r,data:o,sx:i}=e;return M4(o)&&o.isFixed?null:w.jsx(et,{...n,role:"button",sx:i,"data-focus":r?!0:void 0,"data-focus-visible":r?!0:void 0,children:t||w.jsx(ZJ,{})})},eee=YJ,tee=e=>{let{children:t,className:n,cx:r,innerProps:o,selectProps:{chakraStyles:i}}=e,s={gridArea:"1 / 1 / 2 / 3",color:"chakra-placeholder-color",mx:"0.125rem",userSelect:"none"},a=i!=null&&i.placeholder?i.placeholder(s,e):s;return w.jsx(et,{...o,className:r({placeholder:!0},n),sx:a,children:t})},nee=tee,ree=e=>{let{children:t,className:n,cx:r,isDisabled:o,innerProps:i,selectProps:{chakraStyles:s}}=e,a={gridArea:"1 / 1 / 2 / 3",mx:"0.125rem",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},l=s!=null&&s.singleValue?s.singleValue(a,e):a;return w.jsx(et,{className:r({"single-value":!0,"single-value--is-disabled":o},n),sx:l,...i,children:t})},oee=ree,iee={ClearIndicator:MJ,Control:AJ,DropdownIndicator:OJ,Group:HJ,GroupHeading:WJ,IndicatorSeparator:_J,IndicatorsContainer:EJ,Input:FJ,LoadingIndicator:IJ,LoadingMessage:BJ,Menu:VJ,MenuList:zJ,MultiValue:eee,MultiValueContainer:XJ,MultiValueLabel:QJ,MultiValueRemove:JJ,NoOptionsMessage:jJ,Option:qJ,Placeholder:nee,SelectContainer:CJ,SingleValue:oee,ValueContainer:PJ},see=iee,aee=({components:e={},theme:t,size:n,colorScheme:r="gray",isDisabled:o,isInvalid:i,isReadOnly:s,required:a,isRequired:l,inputId:u,tagVariant:c,selectedOptionStyle:d="color",selectedOptionColorScheme:f,selectedOptionColor:p,variant:m,focusBorderColor:h,errorBorderColor:S,chakraStyles:v={},onFocus:y,onBlur:b,menuIsOpen:x,...k})=>{var P;let C=Yr(),{variant:E}=C.components.Input.defaultProps,_=L0({id:u,isDisabled:o,isInvalid:i,isRequired:l,isReadOnly:s,onFocus:y,onBlur:b}),$=x??(_.readOnly?!1:void 0),M=d;["color","check"].includes(d)||(M="color");let F=f||p||"blue";return typeof F!="string"&&(F="blue"),{components:{...see,...e},colorScheme:r,size:n,tagVariant:c,selectedOptionStyle:M,selectedOptionColorScheme:F,variant:m??E,chakraStyles:v,focusBorderColor:h,errorBorderColor:S,onFocus:_.onFocus,onBlur:_.onBlur,isDisabled:_.disabled,isInvalid:!!_["aria-invalid"],inputId:_.id,isReadOnly:_.readOnly,required:a??_.required,menuIsOpen:$,...k,"aria-invalid":(P=k["aria-invalid"])!=null?P:_["aria-invalid"]}},ep=aee,lee=g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(pJ,{ref:t,...n})}),mte=lee;g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(vJ,{ref:t,...n})});g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(bJ,{ref:t,...n})});g.forwardRef((e,t)=>{let n=ep(e);return w.jsx(xJ,{ref:t,...n})});export{Ree as $,kee as A,bT as B,ote as C,ite as D,qee as E,jH as F,Jee as G,VH as H,c8 as I,Xee as J,rte as K,TH as L,Gee as M,lte as N,bee as O,$ee as P,sy as Q,Un as R,tte as S,SK as T,L_ as U,dte as V,FH as W,_ee as X,Tee as Y,Iee as Z,Oee as _,cee as a,Mee as a0,et as a1,Eee as a2,Aee as a3,$q as a4,DH as a5,Z0 as a6,RH as a7,MH as a8,zee as a9,NH as aA,yee as aB,Bq as aC,Pee as aD,kq as aE,A as aF,pte as aG,hte as aH,Xj as aI,fee as aJ,Uy as aK,vee as aL,dee as aM,Oe as aN,_I as aO,BH as aa,Hee as ab,h8 as ac,H8 as ad,fte as ae,qq as af,Dee as ag,Fee as ah,Vee as ai,Lee as aj,Nee as ak,s_ as al,w8 as am,C8 as an,mte as ao,pK as ap,nte as aq,Yee as ar,Dq as as,Oq as at,ste as au,sK as av,aK as aw,cK as ax,uK as ay,lK as az,Wl as b,ute as c,Ef as d,u_ as e,a8 as f,Qn as g,Wee as h,Qee as i,w as j,Kee as k,xh as l,Zee as m,Bee as n,jee as o,Tq as p,Cee as q,g as r,Pq as s,_q as t,mee as u,Cq as v,cte as w,ete as x,Uee as y,ate as z}; diff --git a/main.js b/main.js index 14a5be6..d4f42bf 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,6 @@ import { app, BrowserWindow, screen, ipcMain, dialog, session, shell, Menu } from "electron"; import electronUpdaterPkg from "electron-updater"; +import fs from "fs"; import path from "path"; import { fork } from "child_process"; import { fileURLToPath } from "url"; @@ -390,7 +391,63 @@ ipcMain.handle("open-tortoisesvn-diff", async (event, data) => { }); }); -// Custom command IPCS +ipcMain.handle("fetch-custom-scripts", async () => { + const { configFolderPath } = packageJson; + const scripts = []; + + try { + const files = fs.readdirSync(configFolderPath); + + files.forEach((file) => { + const ext = path.extname(file); + if ([".bat", ".ps1"].includes(ext.toLowerCase())) { + const fullPath = path.join(configFolderPath, file); + scripts.push({ + fileName: path.parse(file).name, + path: fullPath, + type: ext.toLowerCase() === ".bat" ? "batch" : "powershell", + }); + } + }); + } catch (error) { + logger.error(`Error reading the config folder: ${error.message}`); + return { success: false, error: error.message }; + } + + // Return the list of scripts found + return { success: true, scripts }; +}); + +ipcMain.handle("run-custom-script", async (event, data) => { + const { scriptType, scriptPath, branchData } = data; + logger.info(`Running custom script: ${scriptPath} (${scriptType}) with branch data: ${JSON.stringify(branchData)}`); + + return new Promise((resolve, reject) => { + let command = ""; + const { id, "Branch Folder": branchFolder, "Branch Version": branchVersion, "SVN Branch": svnBranch } = branchData; + + const args = `"${id}" "${branchFolder}" "${branchVersion}" "${svnBranch}"`; + + if (scriptType === "batch") { + command = `start cmd /k "${scriptPath}" ${args}`; + } else if (scriptType === "powershell") { + command = `start powershell -NoExit -ExecutionPolicy Bypass -File "${scriptPath}" -id "${id}" -branchFolder "${branchFolder}" -branchVersion "${branchVersion}" -svnBranch "${svnBranch}"`; + } + + exec(command, (error, stdout, stderr) => { + if (error) { + console.error(`Error: ${error.message}`); + reject({ success: false, error: error.message }); + } else if (stderr) { + console.error(`Stderr: ${stderr}`); + reject({ success: false, error: stderr }); + } else { + console.log(`Stdout: ${stdout}`); + resolve({ success: true }); + } + }); + }); +}); ipcMain.handle("download-update", () => { return autoUpdater.downloadUpdate(); diff --git a/preload.js b/preload.js index cdfaf22..c9bbc1a 100644 --- a/preload.js +++ b/preload.js @@ -3,6 +3,8 @@ const { contextBridge, ipcRenderer } = require("electron"); contextBridge.exposeInMainWorld("electron", { getAppVersion: () => ipcRenderer.invoke("app-version"), openTortoiseSVNDiff: (data) => ipcRenderer.invoke("open-tortoisesvn-diff", data), + fetchCustomScripts: () => ipcRenderer.invoke("fetch-custom-scripts"), + runCustomScript: (data) => ipcRenderer.invoke("run-custom-script", data), onAppClosing: (callback) => ipcRenderer.on("app-closing", callback), removeAppClosingListener: () => ipcRenderer.removeAllListeners("app-closing"), downloadUpdate: () => ipcRenderer.invoke("download-update"), diff --git a/src/AppContext.jsx b/src/AppContext.jsx index 3937d10..c3babe1 100644 --- a/src/AppContext.jsx +++ b/src/AppContext.jsx @@ -21,6 +21,8 @@ const AppContext = createContext({ setSelectedBranches: (_) => {}, showSelectedBranchesLog: false, setShowSelectedBranchesLog: (_) => {}, + customScripts: [], + setCustomScripts: (_) => {}, isCommitMode: false, setIsCommitMode: (_) => {}, selectedBranchStatuses: [], @@ -118,6 +120,7 @@ export const AppProvider = ({ children }) => { const branchTableGridRef = useRef(null); const [selectedBranches, setSelectedBranches] = useState([]); const [showSelectedBranchesLog, setShowSelectedBranchesLog] = useState(false); + const [customScripts, setCustomScripts] = useState([]); // Props used in SectionCommit const [isCommitMode, setIsCommitMode] = useState(false); @@ -173,6 +176,17 @@ export const AppProvider = ({ children }) => { setShowCommitView(false); }, [configurableRowData]); + useEffect(() => { + if (!window.electron) return; + window.electron.fetchCustomScripts().then((data) => { + if (data.success) { + setCustomScripts(data.scripts); + return; + } + toast(createToastConfig(data.error, "error", 0, true)); + }); + }, [configurableRowData]); + /**** SectionCommit ****/ // Scroll to the commit region when it is in commit mode useEffect(() => { @@ -263,6 +277,8 @@ export const AppProvider = ({ children }) => { setSelectedBranches, showSelectedBranchesLog, setShowSelectedBranchesLog, + customScripts, + setCustomScripts, isCommitMode, setIsCommitMode, selectedBranchStatuses, diff --git a/src/components/ButtonIconTooltip.jsx b/src/components/ButtonIconTooltip.jsx index 69e62ed..23ed1d7 100644 --- a/src/components/ButtonIconTooltip.jsx +++ b/src/components/ButtonIconTooltip.jsx @@ -5,7 +5,6 @@ import { useCallback } from "react"; export default function ButtonIconTooltip(props) { const { icon, onClick, colorScheme, label, size, placement, isDisabled = false } = props; - const handleClick = useCallback(() => { if (onClick) onClick(); }, [onClick]); diff --git a/src/components/Header.jsx b/src/components/Header.jsx index 87d84ee..482b680 100644 --- a/src/components/Header.jsx +++ b/src/components/Header.jsx @@ -1,4 +1,4 @@ -import { Heading, Icon, IconButton, Image, Link, Tooltip, useColorMode, Wrap, WrapItem } from "@chakra-ui/react"; +import { Heading, Icon, Image, Link, useColorMode, Wrap, WrapItem } from "@chakra-ui/react"; import React, { useCallback } from "react"; import Logo from "../assets/Titan.png"; import { useApp } from "../AppContext"; @@ -11,7 +11,7 @@ import ButtonElectron from "./ButtonElectron"; import ButtonIconTooltip from "./ButtonIconTooltip"; export default function Header() { - const { config, isDebug, setIsDebug } = useApp(); + const { isDebug, setIsDebug } = useApp(); const { emitOpenConfig } = useSocketEmits(); const { RaiseClientNotificaiton } = useNotifications(); const { colorMode, toggleColorMode } = useColorMode(); diff --git a/src/components/TableBranches.jsx b/src/components/TableBranches.jsx index 0dbbb14..15c7aa9 100644 --- a/src/components/TableBranches.jsx +++ b/src/components/TableBranches.jsx @@ -2,19 +2,24 @@ import { CopyIcon, DragHandleIcon } from "@chakra-ui/icons"; import { AgGridReact } from "ag-grid-react"; import React, { useCallback, useEffect, useMemo, useState } from "react"; import { useApp } from "../AppContext"; -import { Flex, IconButton, Tooltip } from "@chakra-ui/react"; +import { Flex } from "@chakra-ui/react"; import { stripBranchInfo } from "../utils/CommonConfig"; import useWindowDimensions from "../hooks/useWindowDimensions"; -import { VscVscode } from "react-icons/vsc"; -import { FaTerminal } from "react-icons/fa6"; import { RiFilePaper2Fill } from "react-icons/ri"; import ButtonElectron from "./ButtonElectron"; +import ButtonIconTooltip from "./ButtonIconTooltip"; export default function TableBranches({ rowData, onRowValueChanged }) { - const { config, branchTableGridRef, updateConfig, isDebug, selectedBranches, setSelectedBranches, setSelectedBranchStatuses, setShowCommitView } = useApp(); + const { config, branchTableGridRef, updateConfig, isDebug, selectedBranches, setSelectedBranches, setSelectedBranchStatuses, customScripts, setShowCommitView } = useApp(); const windowDimensions = useWindowDimensions(); const [isTallScreen, setIsTallScreen] = useState(windowDimensions.height > 768); + const executeCustomScript = useCallback((scriptType, scriptPath, branchData) => { + window.electron.runCustomScript({ scriptType, scriptPath, branchData }).then((result) => { + console.log("Custom Script Result: ", result); + }); + }, []); + const copyRow = useCallback( (currentRowData) => { const newRow = { @@ -102,18 +107,17 @@ export default function TableBranches({ rowData, onRowValueChanged }) { editable: false, cellRenderer: (params) => ( - {/* Custom commands which is dynamic in size */} - } onClick={() => console.warn("Unused button")} colorScheme={"yellow"} label="Script file name" size="sm" /> - - copyRow(params.data)} icon={} /> - + {customScripts.map((script) => ( + } onClick={() => executeCustomScript(script.type, script.path, params.data)} colorScheme={"yellow"} label={script.fileName} size="sm" /> + ))} + } onClick={() => copyRow(params.data)} colorScheme={"yellow"} label="Copy Row" size="sm" /> ), }, ]; return isTallScreen ? [{ field: "", rowDrag: true, resizable: false, filter: false, suppressMovable: false, editable: false, width: 20, cellRenderer: DragHandleIcon, headerClass: "branch-table-header-cell", cellClass: "branch-table-body-cell" }, ...commonColDefs] : commonColDefs; - }, [config, isTallScreen, copyRow]); + }, [isTallScreen, customScripts, copyRow]); useEffect(() => { setIsTallScreen(windowDimensions.height > 768);