@riab/cpm-archiving 1.0.14-beta.7 → 1.0.14-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cpm-archiving.js +1 -1
- package/package.json +1 -1
package/dist/cpm-archiving.js
CHANGED
|
@@ -587,7 +587,7 @@ See the full list of free and premium components here: ${OG}`),console.groupEnd(
|
|
|
587
587
|
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
588
588
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
589
589
|
*-------------------------------------------------------------------------------------------
|
|
590
|
-
*/const cm=class extends N.Component{constructor(t){super(t),this.context=0,this.titleId=this.generateTitleId(),this.contentId=this.generateContentId(),this.activeElement=null,this.onCloseDialog=n=>{n.preventDefault(),Ya(this.props.onClose,n,this,void 0)},this.onKeyDown=n=>{n.keyCode===Bn.esc&&this.props.onClose&&(n.preventDefault(),this.onCloseDialog(n)),nG(n,this.element)},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:ZK:this.state.zIndex>(this.context?this.context+zC:0)?this.state.zIndex:this.context+zC,this.getDocument=()=>{const n=pd?document:null;return this.props.appendTo?this.props.appendTo.ownerDocument:n},pd&&(this.activeElement=ku(document))}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){if(this.element){if(this.props.autoFocus&&!this.props.autoFocusedElement)this.element.focus();else if(this.props.autoFocus&&this.props.autoFocusedElement)this.element.focus();else if(!this.props.autoFocus&&this.props.autoFocusedElement){const t=this.element.querySelector(this.props.autoFocusedElement);t&&t.focus()}else{const t=[...C0].map(n=>n+":not(.k-dialog-titlebar *)");tG(this.element,t)}this.setState({zIndex:JK(this.getCurrentZIndex(),this.getDocument(),this._id)})}}componentWillUnmount(){setTimeout(()=>{var t;!this.element&&this.activeElement&&pd&&(document.contains(this.activeElement)?this.activeElement.focus():this.activeElement.id&&((t=document.getElementById(this.activeElement.id))==null||t.focus()))})}render(){const t=this.props.id!==void 0?this.props.id:this.titleId,{title:n,width:r,height:i,children:s,minWidth:o,dir:u,style:c,contentStyle:m,modal:v=!0}=this.props,g=N.Children.toArray(s),b=this.getContent(g),y=this.getActionBar(g),x=n?{"aria-labelledby":t}:null,A=this.props.closeIcon!==void 0?this.props.closeIcon:!0,w=this.getCurrentZIndex(),C=N.createElement($d.Provider,{value:w},N.createElement("div",{[J8]:this._id,className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:u,style:{zIndex:w,...c},ref:T=>{this.element=T}},v&&N.createElement("div",{className:"k-overlay",style:this.props.overlayStyle}),N.createElement("div",{...x,className:$n("k-window k-dialog",{[`k-window-${this.props.themeColor}`]:this.props.themeColor}),role:"dialog","aria-labelledby":t,"aria-modal":!0,"aria-describedby":this.contentId,style:{width:r,height:i,minWidth:o}},this.props.title&&N.createElement(XK,{closeIcon:A,onCloseButtonClick:this.onCloseDialog,id:t},n),N.createElement("div",{className:"k-window-content k-dialog-content",style:m,id:this.contentId},b),y)));return pd?this.props.appendTo!==null?p0.createPortal(C,this.props.appendTo||document.body):C:null}getActionBar(t){return t.filter(n=>n&&n.type===qC)}getContent(t){return t.filter(n=>n&&n.type!==qC)}generateTitleId(){return"dialog-title-"+this._id}generateContentId(){return"dialog-content-"+this._id}};cm.displayName="Dialog",cm.propTypes={title:ue.any,id:ue.string,dir:ue.string,style:ue.object,closeIcon:ue.bool,width:ue.oneOfType([ue.number,ue.string]),height:ue.oneOfType([ue.number,ue.string]),minWidth:ue.oneOfType([ue.number,ue.string]),autoFocus:ue.bool},cm.defaultProps={autoFocus:!1},cm.contextType=$d;let $K=cm;const eJ=n8(),Yd=R0(r8(eJ,$K));Yd.displayName="KendoReactDialog";const Mn=e=>d.jsx(Yd,{...e,appendTo:null}),tj=e=>/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e),JR=e=>/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/.test(e),T0=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),_0=e=>{if(e.includes("/email"))return"email";if(e.includes("/social_media"))return"social_media";if(e.includes("/website"))return"website"},tJ=(e,t)=>{const r=`\\b${(s=>s==null?void 0:s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},nj=(e,t)=>{const r=`\\b${(s=>s==null?void 0:s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},$8=(e,t,n)=>{const r=eL(tL(e));return r?t==null?void 0:t.filter(i=>{if(!i)return!1;const s=i.keyword.trim();if(!nj(r,s))return!1;if(!n||n.length<1)return!0;const o=n==null?void 0:n.filter(c=>{var m,v;return(v=(m=c==null?void 0:c.item)==null?void 0:m.toLowerCase())==null?void 0:v.includes(s==null?void 0:s.toLowerCase())});return(o==null?void 0:o.length)===0?!0:!(o==null?void 0:o.some(c=>nj(r,c==null?void 0:c.item)))}):[]},nJ=(e,t)=>{const n=eL(tL(e));return n?t==null?void 0:t.filter(r=>{var i;return!!tJ(n,(i=r==null?void 0:r.item)==null?void 0:i.toLowerCase())}):[]},eL=e=>e&&e.replace(/[\r?\n!@#&*()\-\–—+=\[\]{}|:;'\"‘’“”,.<>\?/]/g," "),tL=e=>e&&e.replace(/<[^>]*>/g,""),rJ=e=>{if(!e)return e;const t=e.match(/@(.+)$/);return t?t[1]:null},iJ=e=>/^(?!\.)(?!.*\.\.)[A-Za-z0-9._+-]+(?<!\.)$/.test(e),aJ=e=>{if(!e)return"N/A";const t={month:"long",day:"numeric",year:"numeric"},r=new Intl.DateTimeFormat("en-US",t).formatToParts(e);let i=r.find(m=>m.type==="day").value;const s=r.find(m=>m.type==="month").value,o=r.find(m=>m.type==="year").value,u=parseInt(i,10);let c="th";return u%10===1&&u!==11?c="st":u%10===2&&u!==12?c="nd":u%10===3&&u!==13&&(c="rd"),`${s} ${u}${c}, ${o}`},nL=e=>{if(!e)return!1;const t=e.replace(/\D/g,"");return!(t.length<8||t.length>15)},sJ=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=N.useState(!1),[s,o]=N.useState(""),[u,c]=N.useState(!1),[m,v]=N.useState(),g=er();rn();const b=N.useRef(null),y=[g.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:I})=>A===I.original.id?d.jsx("input",{onClick:D=>D.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:I.original.item,ref:b}):I.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:I})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:O=>{O.stopPropagation(),c(!0),v(I.original)}})})],x=[{label:"Add",icon:Gn,onClick:()=>{i(!0)}}];bo();const[A,w]=N.useState(),C=tf();function T(I){I&&C.mutate(I==null?void 0:I.id,{onSuccess:()=>{c(!1)}})}const M=ef();function P(){if(!T0(s))return Ie.error("Please enter a valid email!",{id:"new-excluded-email"});M.mutate({itemType:"sender",filterType:"internal",item:s,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const E=rr({data:e,columns:y,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:I=>I.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${n}`,children:[d.jsx(Or,{table:E,onRowClick:I=>{I.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Associated Contacts",rowSelectedCheck:I=>I.original.checked===1,collapseSearchAndFilters:!0}),r&&d.jsx(Mn,{title:"",width:700,onClose:()=>i(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:I=>o(I.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:P,disabled:M.isPending,children:M.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),u&&d.jsx(Mn,{title:"",width:700,onClose:()=>c(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>c(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Associated Contact"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this associated contact?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>c(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>T(m),disabled:C.isPending,children:C.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},oJ=({data:e=[],isLoading:t=!1})=>{const[n,r]=N.useState(!1),[i,s]=N.useState(""),[o,u]=N.useState(!1),[c,m]=N.useState(),v=er();rn();const g=N.useRef(null),b=[v.accessor("item",{header:"Email Domains",size:"unset",cell:({row:E})=>x===E.original.id?d.jsx("input",{onClick:O=>O.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:E.original.item,ref:g}):E.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:E})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:I=>{I.stopPropagation(),u(!0),m(E.original)}})})],y=[{label:"Add Domain",icon:Gn,onClick:()=>{r(!0)}}];bo();const[x,A]=N.useState(),w=tf();function C(E){E&&w.mutate(E==null?void 0:E.id,{onSuccess:()=>{u(!1)}})}const T=ef();function M(){if(!JR(i))return Ie.error("Please enter a valid domain!",{id:"new-email-domain"});T.mutate({itemType:"domain",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{s(""),r(!1)}})}const P=rr({data:e,columns:b,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:E=>E.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:"relative",children:[d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Domains"})}),d.jsx(Or,{table:P,onRowClick:E=>{E.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:E=>E.original.checked===1}),n&&d.jsx(Mn,{title:"",width:700,onClose:()=>r(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:E=>s(E.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:M,disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),o&&d.jsx(Mn,{title:"",width:700,onClose:()=>u(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(c),disabled:w.isPending,children:w.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},lJ=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=N.useState(!1),[s,o]=N.useState(""),[u,c]=N.useState(!1),[m,v]=N.useState(),g=er();rn();const b=N.useRef(null),y=[g.accessor("item",{header:"Email Prefixes",size:"unset",cell:({row:O})=>A===O.original.id?d.jsx("input",{onClick:j=>j.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:O.original.item,ref:b}):O.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:O})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:D=>{D.stopPropagation(),c(!0),v(O.original)}})})],x=[{label:"Add",icon:Gn,onClick:()=>{i(!0)}}];bo();const[A,w]=N.useState(),C=UX(),T=tf();function M(O){O&&((O==null?void 0:O.addedType)=="added"?T.mutate(O==null?void 0:O.id,{onSuccess:()=>{c(!1)}}):C.mutate(O==null?void 0:O.id,{onSuccess:()=>{c(!1)}}))}const P=ef();function E(){if(e.find(O=>O.item==s))return i(!1),Ie.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!s||(s==null?void 0:s.trim())==""||!iJ(s))return Ie.error("Please enter a valid email prefix!",{id:"new-email-prefix"});P.mutate({itemType:"username",filterType:"spam_email",item:s,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const I=rr({data:e,columns:y,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:O=>O.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${n}`,children:[d.jsx(Or,{table:I,onRowClick:O=>{O.toggleSelected()},emptyMessage:t?"Loading...":"No items found",bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search or add new prefixes",itemsLabel:"Email Prefixes",rowSelectedCheck:O=>O.original.checked===1,collapseSearchAndFilters:!0}),r&&d.jsx(Mn,{title:"",width:700,onClose:()=>i(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Prefix"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:O=>o(O.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:E,disabled:P.isPending,children:P.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),u&&d.jsx(Mn,{title:"",width:700,onClose:()=>c(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>c(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>c(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>M(m),disabled:C.isPending,children:C.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},uJ=({data:e=[],isLoading:t=!1})=>{const[n,r]=N.useState(!1),[i,s]=N.useState(""),[o,u]=N.useState(!1),[c,m]=N.useState(),v=er();rn();const g=N.useRef(null),b=[v.accessor("item",{header:"Recipients",size:"unset",cell:({row:E})=>x===E.original.id?d.jsx("input",{onClick:O=>O.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:E.original.item,ref:g}):E.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:E})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:I=>{I.stopPropagation(),u(!0),m(E.original)}})})],y=[{label:"Add Email",icon:Gn,onClick:()=>{r(!0)}}];bo();const[x,A]=N.useState(),w=tf();function C(E){E&&w.mutate(E==null?void 0:E.id,{onSuccess:()=>{u(!1)}})}const T=ef();function M(){if(!T0(i))return Ie.error("Please enter a valid email!",{id:"new-excluded-email"});T.mutate({itemType:"recipient",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{s(""),r(!1)}})}const P=rr({data:e,columns:b,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:E=>E.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:"relative",children:[d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Recipients"})}),d.jsx(Or,{table:P,onRowClick:E=>{E.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Recipients",rowSelectedCheck:E=>E.original.checked===1}),n&&d.jsx(Mn,{title:"",width:700,onClose:()=>r(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:E=>s(E.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:M,disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),o&&d.jsx(Mn,{title:"",width:700,onClose:()=>u(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Recipient"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this recipient?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(c),disabled:w.isPending,children:w.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},cJ=({data:e=[],isLoading:t=!1})=>{const[n,r]=N.useState(!1),[i,s]=N.useState(""),[o,u]=N.useState(!1),[c,m]=N.useState(),v=er();rn();const g=N.useRef(null),b=[v.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:E})=>x===E.original.id?d.jsx("input",{onClick:O=>O.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:E.original.item,ref:g}):E.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:E})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:I=>{I.stopPropagation(),u(!0),m(E.original)}})})],y=[{label:"Add Email",icon:Gn,onClick:()=>{r(!0)}}];bo();const[x,A]=N.useState(),w=tf();function C(E){E&&w.mutate(E==null?void 0:E.id,{onSuccess:()=>{u(!1)}})}const T=ef();function M(){if(!T0(i))return Ie.error("Please enter a valid email!",{id:"new-excluded-email"});T.mutate({itemType:"sender",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{s(""),r(!1)}})}const P=rr({data:e,columns:b,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:E=>E.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:"relative",children:[d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Senders"})}),d.jsx(Or,{table:P,onRowClick:E=>{E.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Senders",rowSelectedCheck:E=>E.original.checked===1}),n&&d.jsx(Mn,{title:"",width:700,onClose:()=>r(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:E=>s(E.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:M,disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),o&&d.jsx(Mn,{title:"",width:700,onClose:()=>u(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Sender"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this sender?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(c),disabled:w.isPending,children:w.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},dJ=({classList:e=""})=>{var O;const{data:t,isLoading:n}=Ht(XX()),r=(O=t==null?void 0:t.payload)!=null?O:[],[i,s]=N.useState(!1),[o,u]=N.useState(""),[c,m]=N.useState(!1),[v,g]=N.useState(),b=er();rn();const y=N.useRef(null),x=[b.accessor("item",{header:"Phrase",size:"unset",cell:({row:D})=>w===D.original.id?d.jsx("input",{onClick:_=>_.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:D.original.item,ref:y}):D.original.item}),b.display({size:65,id:"delete",header:()=>null,cell:({row:D})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:j=>{j.stopPropagation(),m(!0),g(D.original)}})})],A=[{label:"Add",icon:Gn,onClick:()=>{s(!0)}}];bo();const[w,C]=N.useState(),T=WX();function M(D){D&&T.mutate({archivingType:"email",filterType:"spam_phrase",multipleType:!1,itemId:D.id,itemType:D.itemType},{onSuccess:()=>{m(!1)}})}const P=P0();function E(){if(r.find(D=>D.item==o))return s(!1),Ie.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!o||(o==null?void 0:o.trim())=="")return Ie.error("Please enter a valid phrase!",{id:"new-spam-phrase"});P.mutate({archivingType:"email",filterType:"spam_phrase",item:o},{onSuccess:()=>{u(""),s(!1)}})}const I=rr({data:r,columns:x,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:D=>D.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${e}`,children:[d.jsx(Or,{table:I,onRowClick:D=>{D.toggleSelected()},emptyMessage:n?"Loading...":"No items found",bordered:!1,filterButtons:A,hasGlobalFilter:!0,searchPlaceholder:"Search or add new phrases",itemsLabel:"Phrases",rowSelectedCheck:D=>D.original.checked===1,collapseSearchAndFilters:!0}),i&&d.jsx(Mn,{title:"",width:700,onClose:()=>s(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>s(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Phrase"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:D=>u(D.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:E,disabled:P.isPending,children:P.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),c&&d.jsx(Mn,{title:"",width:700,onClose:()=>m(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>m(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>m(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>M(v),disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},fJ=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=N.useState(!1),[s,o]=N.useState(""),[u,c]=N.useState(!1),[m,v]=N.useState(),g=er();rn();const b=N.useRef(null);N.useRef(null);const y=[g.accessor("item",{header:"Email Domains",size:"unset",cell:({row:I})=>A===I.original.id?d.jsx("input",{onClick:D=>D.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:I.original.item,ref:b}):I.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:I})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:O=>{O.stopPropagation(),c(!0),v(I.original)}})})],x=[{label:"Add",icon:Gn,onClick:()=>{i(!0)}}];bo();const[A,w]=N.useState(),C=tf();function T(I){I&&C.mutate(I==null?void 0:I.id,{onSuccess:()=>{c(!1)}})}const M=ef();function P(){if(!JR(s))return Ie.error("Please enter a valid domain!",{id:"new-email-domain"});M.mutate({itemType:"domain",filterType:"internal",item:s,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const E=rr({data:e,columns:y,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:I=>I.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${n}`,children:[d.jsx(Or,{table:E,onRowClick:I=>{I.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:I=>I.original.checked===1,collapseSearchAndFilters:!0}),r&&d.jsx(Mn,{title:"",width:700,onClose:()=>i(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:I=>o(I.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:P,disabled:M.isPending,children:M.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),u&&d.jsx(Mn,{title:"",width:700,onClose:()=>c(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>c(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>c(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>T(m),disabled:C.isPending,children:C.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},hJ=()=>{var m,v,g,b,y,x;const{data:e,isLoading:t,isSuccess:n}=Ht(ZX()),r=(m=e==null?void 0:e.blacklist)==null?void 0:m.recipients,i=(v=e==null?void 0:e.blacklist)==null?void 0:v.sender,s=(g=e==null?void 0:e.blacklist)==null?void 0:g.domains,o=(b=e==null?void 0:e.spam_email)==null?void 0:b.usernames,u=(y=e==null?void 0:e.internal)==null?void 0:y.domains,c=(x=e==null?void 0:e.internal)==null?void 0:x.sender;return d.jsx("section",{className:"flex flex-col w-full !mb-3",children:d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9 mb-10",children:"Excluded Emails"}),d.jsxs(D0,{children:[d.jsxs(hi,{label:"Recipients",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Exclude specific recipients from your email review. Changes to review settings will go into effect in your next review period."}),d.jsx(uJ,{isLoading:t,data:r})]}),d.jsxs(hi,{label:"Senders",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Exclude specific senders from your email review. Changes to review settings will go into effect in your next review period."}),d.jsx(cJ,{isLoading:t,data:i})]}),d.jsxs(hi,{label:"Domains",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Exclude specific email domains from your email review. Changes to review settings will go into effect in your next review period."}),d.jsx(oJ,{isLoading:t,data:s})]}),d.jsxs(hi,{label:"Spam",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Below are the email domains that are excluded from your review."}),d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Excluded Spam"})}),d.jsxs(XP,{children:[d.jsx(hi,{label:"Email Prefixes",onActive:()=>{},children:d.jsx(lJ,{data:o,isLoading:t,classList:"mt-[-1px]"})}),d.jsx(hi,{label:"Phrases",onActive:()=>{},children:d.jsx(dJ,{classList:"mt-[-1px]"})})]})]}),d.jsxs(hi,{label:"Advanced",onActive:()=>{},children:[d.jsx("p",{className:"mb-10"}),d.jsx(KX,{data:u}),d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Additional Exclusions"})}),d.jsxs(XP,{children:[d.jsx(hi,{label:"Internal Domains",onActive:()=>{},children:d.jsx(fJ,{data:u,isLoading:t,classList:"mt-[-1px]"})}),d.jsx(hi,{label:"Associated Contacts",onActive:()=>{},children:d.jsx(sJ,{data:c,isLoading:t,classList:"mt-[-1px]"})})]})]})]})]})})},mJ=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/instagram?url=${e}`,"GET"),onError:()=>Ie.error("Error occured while trying to connect to Instagram account."),onSuccess:(t,n)=>{}}),gJ=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/instagram/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ie.error("Error occured while trying to connect to Instagram account."),onSuccess:(t,n)=>{window.location.href=`${t}&encryptedUser=${yt.getUser()}`}}),rL=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/linkedin/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ie.error("Error occured while trying to connect to LinkedIn account."),onSuccess:(t,n)=>{window.location.href=`${t}&encryptedUser=${yt.getUser()}`}}),pJ=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/facebook/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ie.error("Error occured while trying to connect to Facebook account."),onSuccess:(t,n)=>{window.location.href=t}}),vJ=(e,t)=>At({mutationFn:n=>yt.executeRequest(`/socialmedia/firm?type=${n}&firmURL=${e}&employeeURL=${t}`,"GET"),onError:()=>Ie.error("Error occured while trying to connect to Facebook account."),onSuccess:(n,r)=>{window.location.href=n==null?void 0:n.firmURL}}),iL=()=>{const e=rn();return At({mutationFn:({accountType:t,screenName:n,isTodoReconnect:r})=>yt.executeRequest("/socialmedia/twitter/response","POST",{accountType:t,screenName:n,isTodoReconnect:r}),onSettled:(t,n)=>{e.invalidateQueries({queryKey:zm().queryKey}),e.invalidateQueries({queryKey:wi().queryKey})}})},aL=()=>{const e=rn();return At({mutationFn:({type:t,accountType:n})=>yt.executeRequest("/socialmedia/disconnect","POST",{type:t,accountType:n}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:zm().queryKey}),e.invalidateQueries({queryKey:wi().queryKey})}})},sL=()=>At({mutationFn:e=>yt.executeRequest("/accountsettings/approved","PUT",{approved:e}),onSuccess:(e,t)=>{}}),bJ=()=>{const e=rn();return At({mutationFn:({archivingType:t,itemId:n,itemType:r,filterType:i})=>yt.executeRequest("/Archiving/readd_archiving_keyword_and_added_item","POST",{archivingType:t,itemId:n,itemType:r,filterType:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["deleteKeywords"]}),e.invalidateQueries({queryKey:["keywordsAndPhrases"]})}})},yJ=(e="social_media")=>({queryKey:["deleteKeywords",e],queryFn:()=>yt.executeRequest(`/Popups/archiving_view_previously_removed_keywords/${e}`,"POST")}),wi=()=>({queryKey:["socialMediaStatuses"],queryFn:()=>yt.executeRequest("/socialmedia/check/statuses","GET")}),Wd=()=>({queryKey:["heightenedSupervisionUsers"],queryFn:async()=>{const e=await yt.executeRequest("/heightenedsupervisionusers/users","GET");if(!e||e.error)throw new Error("Error occurred while fetching users");return e},onError:()=>{Ie.error("Error occurred while fetching users")}}),oL=()=>At({mutationFn:({types:e,employees:t})=>yt.executeRequest("/employeerequests","POST",{types:e,employees:t})}),xJ=()=>({queryKey:["socialmediatypes"],queryFn:()=>yt.executeRequest("/socialmedia/types","GET"),retry:!1}),zm=()=>({queryKey:["employeeaccounts"],queryFn:()=>yt.executeRequest("/socialmedia/employee/accounts?url=mrc","GET")}),Ci=({status:e})=>{if(!e)return"";const t={facebook_active:"text-[#008E28]",linkedin_active:"text-[#008E28]",instagram_active:"text-[#008E28]",twitter_active:"text-[#008E28]",active:"text-[#008E28]",facebook_inactive:"text-[#AA2400]",linkedin_inactive:"text-[#AA2400]",instagram_inactive:"text-[#AA2400]",twitter_inactive:"text-[#AA2400]",inactive:"text-[#AA2400]",facebook_pending:"text-[#C68900]",instagram_pending:"text-[#C68900]",linkedin_pending:"text-[#C68900]",twitter_pending:"text-[#C68900]",pending:"text-[#C68900]",facebook_unavailable:"text-[#012330]",linkedin_unavailable:"text-[#012330]",instagram_unavailable:"text-[#012330]",twitter_unavailable:"text-[#012330]",unavailable:"text-[#012330]",facebook_connect:"text-[#005DEC]",linkedin_connect:"text-[#005DEC]",instagram_connect:"text-[#005DEC]",twitter_connect:"text-[#005DEC]",connect:"text-[#005DEC]"};let n=ca,r="";switch(e.status){case"facebook_active":case"linkedin_active":case"instagram_active":case"twitter_active":case"active":n=nX,r="Active";break;case"facebook_inactive":case"linkedin_inactive":case"instagram_inactive":case"twitter_inactive":case"inactive":n=ca,r="Inactive";break;case"facebook_pending":case"linkedin_pending":case"instagram_pending":case"twitter_pending":case"pending":n=UG,r="Pending";break;case"facebook_connect":case"linkedin_connect":case"instagram_connect":case"twitter_connect":case"connect":n=eX,r="Connect";break;default:n=ca,r="N/A"}return d.jsxs("div",{className:`inline-flex gap-1 w-22.5 h-6 items-center px-1.5 py-1 rounded-sm text-sm font-medium ${t[e.status]}`,children:[d.jsx(xe,{icon:n,size:"small",className:"fill-current"}),d.jsx("div",{className:"capitalize flex-grow text-center",children:r})]})},wp={status:"unavailable",statusTitle:"Unavailable",ts:null,active:!1},AJ=({showName:e,hasRowSelection:t=!1,description:n=null,isSettings:r=!1})=>{const i=oL(),{data:s,isLoading:o,isSuccess:u}=Ht(zm()),{data:c,isLoading:m,isSuccess:v}=Ht(Wd()),{data:g,isLoading:b,isSuccess:y}=Ht(wi()),x={iMessage:1,WhatsApp:2},A=rn();N.useEffect(()=>{v&&y&&A.setQueryData(wi().queryKey,K=>{if(!K)return{};const $={...K};return c.forEach(le=>{$[le.id]||($[le.id]={}),Object.values(x).forEach(q=>{$[le.id][q]||($[le.id][q]={...wp})})}),$})},[v,y,g]);const w=g&&c&&Array.from(new Set(Object.entries(g).filter(([K,$])=>Object.values($).some(le=>le.active===1)).map(([K])=>parseInt(K)))),C=g&&c&&Array.from(new Set(Object.values(g).flatMap(K=>Object.entries(K).filter(([$,le])=>le.active===1).map(([$])=>parseInt($))))),T=er(),M=[T.accessor("name",{cell:K=>K.getValue(),header:()=>e?"Name":"",size:300}),T.accessor("imessage",{cell:K=>{const $=K.getValue();return d.jsxs("label",{htmlFor:`imessage-check-${K.row.id}-${x==null?void 0:x.iMessage}`,className:"flex items-center cursor-pointer",children:[!r&&d.jsx("input",{type:"checkbox",id:`imessage-check-${K.row.id}-${x==null?void 0:x.iMessage}`,checked:!!$.active,onChange:le=>E(K.row.id,x==null?void 0:x.iMessage,le.target.checked)}),d.jsx(Ci,{status:$})]})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),T.accessor("whatsapp",{cell:K=>{const $=K.getValue();return d.jsxs("label",{htmlFor:`whatsapp-check-${K.row.id}-${x==null?void 0:x.WhatsApp}`,className:"flex items-center cursor-pointer",children:[!r&&d.jsx("input",{type:"checkbox",id:`whatsapp-check-${K.row.id}-${x==null?void 0:x.WhatsApp}`,checked:!!$.active,onChange:le=>E(K.row.id,x==null?void 0:x.WhatsApp,le.target.checked)}),d.jsx(Ci,{status:$})]})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})];t&&M.unshift(T.accessor("id",{header:({table:K})=>d.jsx("input",{type:"checkbox",checked:g&&Object.values(g).every($=>Object.values($).every(le=>le.active===1)),onChange:$=>I($.target.checked)}),cell:({row:K})=>{var le;let $=!1;return K.id!="firm_accounts"&&K.id!="your_accounts"&&($=Object.values((le=g==null?void 0:g[K.original.id])!=null?le:{}).every(q=>q.active===1)),d.jsx("input",{type:"checkbox",checked:$,onChange:q=>{O(parseInt(K.original.id),q.target.checked)}})},maxSize:55}));const P=[{label:i.isPending?d.jsx(zt,{colorClass:"text-white"}):"Send Request",active:t,onClick:()=>{if(w.length<1)return Ie.error("Please select at least one employee!");i.isPending||i.mutate({types:C,employees:w},{onSuccess:()=>{A.invalidateQueries({queryKey:Wd().queryKey}),A.invalidateQueries({queryKey:wi().queryKey}),Ie.success("To do list items have been sent for mobile setup.")}})},icon:d8}],E=(K,$,le)=>{const q=le?1:0;A.setQueryData(wi().queryKey,H=>{var W;return H&&((W=H==null?void 0:H[K])!=null&&W[$]?{...H,[K]:{...H==null?void 0:H[K],[$]:{...H[K][$],active:q}}}:{...H,[K]:{...H==null?void 0:H[K],[$]:{...wp,active:le}}})})},I=K=>{A.setQueryData(wi().queryKey,$=>$&&Object.fromEntries(Object.entries($).map(([q,H])=>[q,Object.fromEntries(Object.entries(H).map(([W,G])=>[W,{...G,active:K?1:0}]))])))},O=(K,$)=>{if(isNaN(K))return Ie.error("You cannot send a request for 'Firm Accounts' and 'Your Accounts'.");A.setQueryData(wi().queryKey,le=>{if(!(le!=null&&le[K]))return le;const q=Object.fromEntries(Object.entries(le[K]).map(([H,W])=>[H,{...W,active:$?1:0}]));return{...le,[K]:q}})},D=s==null?void 0:s.find(K=>(K==null?void 0:K.accountType)==(x==null?void 0:x.iMessage)),j=s==null?void 0:s.find(K=>(K==null?void 0:K.accountType)==(x==null?void 0:x.WhatsApp)),_={name:"Your Accounts",id:"your_accounts",imessage:{status:D?"active":"inactive",statusTitle:D?"Active":"Inactive",ts:null,active:!!D},whatsapp:{status:j?"active":"inactive",statusTitle:j?"Active":"Inactive",ts:null,active:!!j}},k=g==null?void 0:g.firm,F=k==null?void 0:k[x==null?void 0:x.iMessage],z=k==null?void 0:k[x==null?void 0:x.WhatsApp],Q={name:"Firm Accounts",id:"firm_accounts",imessage:{status:F?"active":"inactive",statusTitle:F?"Active":"Inactive",ts:null,active:!!F},whatsapp:{status:z?"active":"inactive",statusTitle:z?"Active":"Inactive",ts:null,active:!!z}},te=N.useMemo(()=>{if(!c||!g)return[];const K=c.map($=>{var le,q;return{id:$.id,name:`${$.firstName} ${$.lastName}`,imessage:((le=g==null?void 0:g[$.id])==null?void 0:le[x==null?void 0:x.iMessage])||{...wp},whatsapp:((q=g==null?void 0:g[$.id])==null?void 0:q[x==null?void 0:x.WhatsApp])||{...wp}}});return r&&(K.unshift({..._}),K.unshift({...Q})),K},[c,g]),Y=rr({data:te,columns:M,getCoreRowModel:tr(),getPaginationRowModel:nr(),getFilteredRowModel:ur(),getRowId:K=>K.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return d.jsxs("div",{children:[d.jsxs("div",{children:[d.jsx("h5",{className:"text-brand text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"}),n&&d.jsx("p",{className:"mb-5",children:"A list of all the connected social media accounts in your firm. Send employee requests to connect additional accounts. Sending a request will generate a To-Do List item."})]}),d.jsx(Or,{table:Y,hasGlobalFilter:t,filterButtons:P,searchPlaceholder:"Search Accounts",itemsLabel:"Accounts",bordered:!0,emptyMessage:m||b?"Loading...":"No accounts found"})]})},wJ=()=>d.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 2 of 5: Connect Firm Text Messaging Accounts"}),d.jsx("p",{className:"mb-10",children:"Search or select an employee below to set up their archived mobile data. By sending a request, they will get an email as well as a ToDo List item prompting them to connect their device."})]}),d.jsx(AJ,{hasRowSelection:!0}),d.jsx(vr,{prevLink:"/setup/mobile",prevProgress:6,nextLink:"/setup/mobile/review-frequency-and-size",nextProgress:7})]}),Xy={PENDING:1,CONNECTED:2,DISCONNECTED:3},rj=e=>{switch(e){case Xy.PENDING:return{status:"pending",statusTitle:"Pending"};case Xy.CONNECTED:return{status:"active",statusTitle:"Active"};case Xy.DISCONNECTED:default:return{status:"inactive",statusTitle:"N/A"}}},N0=()=>({queryKey:["accountconnections"],queryFn:()=>yt.executeRequest("/mobilechannelconnections/connection","GET")}),EJ=()=>At({mutationFn:e=>yt.executeRequest("/imessages","POST",e),onSuccess:(e,t)=>{}}),SJ=()=>At({mutationFn:e=>yt.executeRequest("/whatsapp","POST",e),onSuccess:(e,t)=>{}});function Al(e){return typeof e=="string"||e instanceof String}function ij(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function lL(e,t){return Array.isArray(t)?lL(e,(n,r)=>t.includes(r)):Object.entries(e).reduce((n,r)=>{let[i,s]=r;return t(s,i)&&(n[i]=s),n},{})}const Qt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function CJ(e){switch(e){case Qt.LEFT:return Qt.FORCE_LEFT;case Qt.RIGHT:return Qt.FORCE_RIGHT;default:return e}}function Zy(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function n0(e,t){if(t===e)return!0;const n=Array.isArray(t),r=Array.isArray(e);let i;if(n&&r){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!n0(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){const s=t instanceof Date,o=e instanceof Date;if(s&&o)return t.getTime()==e.getTime();if(s!=o)return!1;const u=t instanceof RegExp,c=e instanceof RegExp;if(u&&c)return t.toString()==e.toString();if(u!=c)return!1;const m=Object.keys(t);for(i=0;i<m.length;i++)if(!Object.prototype.hasOwnProperty.call(e,m[i]))return!1;for(i=0;i<m.length;i++)if(!n0(e[m[i]],t[m[i]]))return!1;return!0}else if(t&&e&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();return!1}class RJ{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Qt.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Qt.RIGHT:Qt.LEFT}}function sn(e,t){return new sn.InputMask(e,t)}function uL(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?sn.MaskedRegExp:Al(e)?sn.MaskedPattern:e===Date?sn.MaskedDate:e===Number?sn.MaskedNumber:Array.isArray(e)||e===Array?sn.MaskedDynamic:sn.Masked&&e.prototype instanceof sn.Masked?e:sn.Masked&&e instanceof sn.Masked?e.constructor:e instanceof Function?sn.MaskedFunction:(console.warn("Mask not found for mask",e),sn.Masked)}function Sm(e){if(!e)throw new Error("Options in not defined");if(sn.Masked){if(e.prototype instanceof sn.Masked)return{mask:e};const{mask:t=void 0,...n}=e instanceof sn.Masked?{mask:e}:ij(e)&&e.mask instanceof sn.Masked?e:{};if(t){const r=t.mask;return{...lL(t,(i,s)=>!s.startsWith("_")),mask:t.constructor,_mask:r,...n}}}return ij(e)?{...e}:{mask:e}}function vo(e){if(sn.Masked&&e instanceof sn.Masked)return e;const t=Sm(e),n=uL(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}sn.createMask=vo;class $R{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch(n){}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch(n){}return t!=null?t:this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch(r){}}get isActive(){return!1}}sn.MaskElement=$R;const aj=90,OJ=89;class B0 extends $R{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,n,r;return(t=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===aj&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===OJ&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===aj&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}sn.HTMLMaskElement=B0;class MJ extends B0{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}sn.HTMLMaskElement=B0;class cL extends B0{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,s=i.getSelection&&i.getSelection();s&&(s.removeAllRanges(),s.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}sn.HTMLContenteditableMaskElement=cL;class k0{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>k0.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}k0.MAX_LENGTH=100;class DJ{constructor(t,n){this.el=t instanceof $R?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new cL(t):new MJ(t),this.masked=vo(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new k0,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof sn.Masked)&&this.masked.constructor===uL(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof sn.Masked?t:vo({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,n){const r=this._listeners[t];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,r=this.masked.value,i=this.masked.rawInputValue,s=this.displayValue,o=this.unmaskedValue!==n||this.value!==r||this._rawInputValue!==i;this._unmaskedValue=n,this._value=r,this._rawInputValue=i,this.el.value!==s&&(this.el.value=s),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...r}=t,i=!this.maskEquals(n),s=this.masked.optionsIsChanged(r);i&&(this.mask=n),s&&this.masked.updateOptions(r),(i||s)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Qt.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(n);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new RJ({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,s=r===this.masked.rawInputValue?n.removeDirection:Qt.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,s);s!==Qt.NONE&&(o=this.masked.nearestInputPos(o,Qt.NONE)),this.updateControl(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}sn.InputMask=DJ;class mn{static normalize(t){return Array.isArray(t)?t:[t,new mn]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}sn.ChangeDetails=mn;class ps{constructor(t,n,r){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Ri{constructor(t){this._value="",this._update({...Ri.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ps(this.extractInput(t,n),t)}appendTail(t){return Al(t)&&(t=new ps(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new mn({inserted:t,rawInserted:t})):new mn}_appendChar(t,n,r){n===void 0&&(n={});const i=this.state;let s;if([t,s]=this.doPrepareChar(t,n),t&&(s=s.aggregate(this._appendCharRaw(t,n)),!s.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=i;let u=this.pad(n);const c=this._appendCharRaw(t,n);u=u.aggregate(c),c.rawInserted||u.equals(s)?s=u:this.state=o}if(s.inserted){let o,u=this.doValidate(n)!==!1;if(u&&r!=null){const c=this.state;if(this.overwrite===!0){o=r.state;for(let v=0;v<s.rawInserted.length;++v)r.unshift(this.displayValue.length-s.tailShift)}let m=this.appendTail(r);if(u=m.rawInserted.length===r.toString().length,!(u&&m.inserted)&&this.overwrite==="shift"){this.state=c,o=r.state;for(let v=0;v<s.rawInserted.length;++v)r.shift();m=this.appendTail(r),u=m.rawInserted.length===r.toString().length}u&&m.inserted&&(this.state=c)}u||(s=new mn,this.state=i,r&&o&&(r.state=o))}return s}_appendPlaceholder(){return new mn}_appendEager(){return new mn}append(t,n,r){if(!Al(t))throw new Error("value should be string");const i=Al(r)?new ps(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let s;[t,s]=this.doPrepare(t,n);for(let o=0;o<t.length;++o){const u=this._appendChar(t[o],n,i);if(!u.rawInserted&&!this.doSkipInvalid(t[o],n,i))break;s.aggregate(u)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&s.aggregate(this._appendEager()),i!=null&&(s.tailShift+=this.appendTail(i).tailShift),s}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new mn}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=t();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,r=t(this);return this.state=n,delete this._isolated,r}doSkipInvalid(t,n,r){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),mn.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),mn.normalize(this.prepareChar?this.prepareChar(t,this,n):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,n,r,i,s){r===void 0&&(r=""),i===void 0&&(i=Qt.NONE),s===void 0&&(s={input:!0});const o=t+n,u=this.extractTail(o),c=this.eager===!0||this.eager==="remove";let m;c&&(i=CJ(i),m=this.extractInput(0,o,{raw:!0}));let v=t;const g=new mn;if(i!==Qt.NONE&&(v=this.nearestInputPos(t,n>1&&t!==0&&!c?Qt.NONE:i),g.tailShift=v-t),g.aggregate(this.remove(v)),c&&i!==Qt.NONE&&m===this.rawInputValue)if(i===Qt.FORCE_LEFT){let b;for(;m===this.rawInputValue&&(b=this.displayValue.length);)g.aggregate(new mn({tailShift:-1})).aggregate(this.remove(b-1))}else i===Qt.FORCE_RIGHT&&u.unshift();return g.aggregate(this.append(r,s,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!n0(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||Ri.EMPTY_VALUES.includes(t)&&Ri.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new mn}}Ri.DEFAULTS={skipInvalid:!0};Ri.EMPTY_VALUES=[void 0,null,""];sn.Masked=Ri;class Cu{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Al(t)?new ps(String(t)):t;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof ps)r?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof Cu){if(t.stop==null){let i;for(;t.chunks.length&&t.chunks[0].stop==null;)i=t.chunks.shift(),i.from+=t.from,this.extend(i)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof sn.MaskedPattern))return new ps(this.toString()).appendTo(t);const n=new mn;for(let r=0;r<this.chunks.length;++r){const i=this.chunks[r],s=t._mapPosToBlock(t.displayValue.length),o=i.stop;let u;if(o!=null&&(!s||s.index<=o)&&((i instanceof Cu||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),u=i instanceof Cu&&t._blocks[o]),u){const c=u.appendTail(i);n.aggregate(c);const m=i.toString().slice(c.rawInserted.length);m&&n.aggregate(t.append(m,{tail:!0}))}else n.aggregate(t.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...r}=t;Object.assign(this,r),this.chunks=n.map(i=>{const s="chunks"in i?new Cu:new ps;return s.state=i,s})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],s=i.unshift(n);if(i.toString()){if(!s)break;++r}else this.chunks.splice(r,1);if(s)return s}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],r=n.shift();if(n.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class IJ{constructor(t,n){this.masked=t,this._log=[];const{offset:r,index:i}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Qt.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Qt.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Qt.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Qt.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Qt.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Qt.NONE),!0})}}class dL{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new mn}nearestInputPos(t,n){n===void 0&&(n=Qt.NONE);const r=0,i=this._value.length;switch(n){case Qt.LEFT:case Qt.FORCE_LEFT:return r;case Qt.NONE:case Qt.RIGHT:case Qt.FORCE_RIGHT:default:return i}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new mn;const r=this.eager===!0||this.eager==="append",s=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!r)&&!n.tail,o=new mn({inserted:this.char,rawInserted:s?this.char:""});return this._value=this.char,this._isRawInput=s&&(n.raw||n.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new mn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new ps("")}appendTail(t){return Al(t)&&(t=new ps(String(t))),t.appendTo(this)}append(t,n,r){const i=this._appendChar(t[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class r0{constructor(t){const{parent:n,isOptional:r,placeholderChar:i,displayChar:s,lazy:o,eager:u,...c}=t;this.masked=vo(c),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:s,lazy:o,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new mn}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new mn;const r=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new mn,this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(t,n,r){return this.masked.append(t,this.currentMaskFlags(n),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new mn:(this.isFilled=!0,new mn({inserted:this.placeholderChar}))}_appendEager(){return new mn}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,r)}nearestInputPos(t,n){n===void 0&&(n=Qt.NONE);const r=0,i=this.value.length,s=Math.min(Math.max(t,r),i);switch(n){case Qt.LEFT:case Qt.FORCE_LEFT:return this.isComplete?s:r;case Qt.RIGHT:case Qt.FORCE_RIGHT:return this.isComplete?s:i;case Qt.NONE:default:return s}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new mn}}r0.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class PJ extends Ri{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=r=>r.search(n)>=0),super._update(t)}}sn.MaskedRegExp=PJ;class Oi extends Ri{constructor(t){super({...Oi.DEFAULTS,...t,definitions:Object.assign({},r0.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let r=!1,i=!1;for(let s=0;s<n.length;++s){if(this.blocks){const m=n.slice(s),v=Object.keys(this.blocks).filter(b=>m.indexOf(b)===0);v.sort((b,y)=>y.length-b.length);const g=v[0];if(g){const{expose:b,repeat:y,...x}=Sm(this.blocks[g]),A={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...x,repeat:y,parent:this},w=y!=null?new sn.RepeatBlock(A):vo(A);w&&(this._blocks.push(w),b&&(this.exposeBlock=w),this._maskedBlocks[g]||(this._maskedBlocks[g]=[]),this._maskedBlocks[g].push(this._blocks.length-1)),s+=g.length-1;continue}}let o=n[s],u=o in t;if(o===Oi.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===Oi.ESCAPE_CHAR){if(++s,o=n[s],!o)break;u=!1}const c=u?new r0({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Sm(t[o]),parent:this}):new dL({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...r}=t;this._blocks.forEach((i,s)=>i.state=n[s]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new mn;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const s=this._blocks[i]._appendEager();if(!s.inserted)break;n.aggregate(s)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new mn;if(!r)return i;for(let o=r.index,u;u=this._blocks[o];++o){var s;const c=u._appendChar(t,{...n,_beforeTailState:(s=n._beforeTailState)==null||(s=s._blocks)==null?void 0:s[o]});if(i.aggregate(c),c.consumed)break}return i}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=new Cu;return t===n||this._forEachBlocksInRange(t,n,(i,s,o,u)=>{const c=i.extractTail(o,u);c.stop=this._findStopBefore(s),c.from=this._blockStartPos(s),c instanceof Cu&&(c.blockIndex=s),r.extend(c)}),r}extractInput(t,n,r){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),t===n)return"";let i="";return this._forEachBlocksInRange(t,n,(s,o,u,c)=>{i+=s.extractInput(u,c,r)}),i}_findStopBefore(t){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=t)n=i;else break}return n}_appendPlaceholder(t){const n=new mn;if(this.lazy&&t==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,s=t!=null?t:this._blocks.length;return this._blocks.slice(i,s).forEach(o=>{if(!o.lazy||t!=null){var u;n.aggregate(o._appendPlaceholder((u=o._blocks)==null?void 0:u.length))}}),n}_mapPosToBlock(t){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],s=n.length;if(n+=i.displayValue,t<=n.length)return{index:r,offset:t-s}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(t,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(t);if(i){const s=this._mapPosToBlock(n),o=s&&i.index===s.index,u=i.offset,c=s&&o?s.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,u,c),s&&!o){for(let m=i.index+1;m<s.index;++m)r(this._blocks[m],m,0,this._blocks[m].displayValue.length);r(this._blocks[s.index],s.index,0,s.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._forEachBlocksInRange(t,n,(i,s,o,u)=>{r.aggregate(i.remove(o,u))}),r}nearestInputPos(t,n){if(n===void 0&&(n=Qt.NONE),!this._blocks.length)return 0;const r=new IJ(this,t);if(n===Qt.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Qt.LEFT||n===Qt.FORCE_LEFT){if(n===Qt.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Qt.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t||(r.popState(),r.ok&&r.pos<=t))return r.pos;r.popState()}return r.ok?r.pos:n===Qt.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Qt.RIGHT||n===Qt.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Qt.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,Qt.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,n,(i,s,o,u)=>{r+=i.totalInputPositions(o,u)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(r=>this._blocks[r]):[]}pad(t){const n=new mn;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(t))),n}}Oi.DEFAULTS={...Ri.DEFAULTS,lazy:!0,placeholderChar:"_"};Oi.STOP_CHAR="`";Oi.ESCAPE_CHAR="\\";Oi.InputDefinition=r0;Oi.FixedDefinition=dL;sn.MaskedPattern=Oi;class Lv extends Oi{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:s=this.autofix,...o}=t;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=s;const u=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let m=0;for(;m<c.length&&c[m]===u[m];)++m;o.mask=c.slice(0,m).replace(/0/g,"\\0")+"0".repeat(this.maxLength-m),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",r="";const[,i,s]=t.match(/^(\D*)(\d*)(\D*)/)||[];return s&&(n="0".repeat(i.length)+s,r="9".repeat(i.length)+s),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(t,n){n===void 0&&(n={});let r;return[t,r]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const r=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[s,o]=this.boundaries(this.value+t);return Number(o)<this.from?super._appendCharRaw(r[this.value.length],n):Number(s)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(i[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,s]=this.boundaries(n);return this.from<=Number(s)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const n=new mn;if(this.value.length===this.maxLength)return n;const r=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let s=0;s<i;++s)n.aggregate(super._appendCharRaw("0",t));r.split("").forEach(s=>this._appendCharRaw(s))}return n}}sn.MaskedRange=Lv;const jJ="d{.}`m{.}`Y";class lo extends Oi{static extractPatternOptions(t){const{mask:n,pattern:r,...i}=t;return{...i,mask:Al(n)?n:r}}constructor(t){super(lo.extractPatternOptions({...lo.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:r,blocks:i,...s}={...lo.DEFAULTS,...t},o=Object.assign({},lo.GET_DEFAULT_BLOCKS());t.min&&(o.Y.from=t.min.getFullYear()),t.max&&(o.Y.to=t.max.getFullYear()),t.min&&t.max&&o.Y.from===o.Y.to&&(o.m.from=t.min.getMonth()+1,o.m.to=t.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=t.min.getDate(),o.d.to=t.max.getDate())),Object.assign(o,this.blocks,i),super._update({...s,mask:Al(n)?n:r,blocks:o})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(lo.extractPatternOptions(t))}}lo.GET_DEFAULT_BLOCKS=()=>({d:{mask:Lv,from:1,to:31,maxLength:2},m:{mask:Lv,from:1,to:12,maxLength:2},Y:{mask:Lv,from:1900,to:9999}});lo.DEFAULTS={...Oi.DEFAULTS,mask:Date,pattern:jJ,format:(e,t)=>{if(!e)return"";const n=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0"),i=e.getFullYear();return[n,r,i].join(".")},parse:(e,t)=>{const[n,r,i]=e.split(".").map(Number);return new Date(i,r-1,n)}};sn.MaskedDate=lo;class L0 extends Ri{constructor(t){super({...L0.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(n=>{const{expose:r,...i}=Sm(n),s=vo({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=s),s}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._applyDispatch(t,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),r}_applyDispatch(t,n,r){t===void 0&&(t=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,s=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:s,u=s.slice(o.length),c=this.currentMask,m=new mn,v=c==null?void 0:c.state;return this.currentMask=this.doDispatch(t,{...n},r),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),m.tailShift=this.currentMask.value.length-i.length),u&&(m.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):v&&(this.currentMask.state=v)),m}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new mn;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,r;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(t,this,n,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[r,i]=super.doPrepare(t,n);if(this.currentMask){let s;[r,s]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(s)}return[r,i]}doPrepareChar(t,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(t,n);if(this.currentMask){let s;[r,s]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(s)}return[r,i]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,n){const r=new mn;return this.currentMask&&r.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...s}=t;n&&this.compiledMasks.forEach((o,u)=>o.state=n[u]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=s}extractInput(t,n,r){return this.currentMask?this.currentMask.extractInput(t,n,r):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((n,r)=>{if(!t[r])return;const{mask:i,...s}=t[r];return n0(n,s)&&n.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}L0.DEFAULTS={...Ri.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,s=t.compiledMasks.map((o,u)=>{const c=t.currentMask===o,m=c?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Qt.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):c||o.remove(m),o.append(e,t.currentMaskFlags(n)),o.appendTail(r),{index:u,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(m,o.nearestInputPos(o.displayValue.length,Qt.FORCE_LEFT)))}});return s.sort((o,u)=>u.weight-o.weight||u.totalInputPositions-o.totalInputPositions),t.compiledMasks[s[0].index]}};sn.MaskedDynamic=L0;class F0 extends Oi{constructor(t){super({...F0.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...r}=t;if(n){const i=n.map(u=>u.length),s=Math.min(...i),o=Math.max(...i)-s;r.mask="*".repeat(s),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}_appendCharRaw(t,n){n===void 0&&(n={});const r=Math.min(this.nearestInputPos(0,Qt.FORCE_RIGHT),this.value.length),i=this.enum.filter(s=>this.matchValue(s,this.unmaskedValue+t,r));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,u)=>{const c=i[0][u];u>=this.value.length||c===o.value||(o.reset(),o._appendChar(c,n))});const s=super._appendCharRaw(i[0][this.value.length],n);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(o=>s.aggregate(super._appendCharRaw(o))),s}return new mn({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ps("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new mn;const r=Math.min(super.nearestInputPos(0,Qt.FORCE_RIGHT),this.value.length);let i;for(i=t;i>=0&&!(this.enum.filter(u=>this.matchValue(u,this.value.slice(r,i),r)).length>1);--i);const s=super.remove(i,n);return s.tailShift+=i-t,s}get isComplete(){return this.enum.indexOf(this.value)>=0}}F0.DEFAULTS={...Oi.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n};sn.MaskedEnum=F0;class TJ extends Ri{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}sn.MaskedFunction=TJ;var fL;class ua extends Ri{constructor(t){super({...ua.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+Zy(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Zy).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Zy(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(t,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,r))}_appendCharRaw(t,n){n===void 0&&(n={});const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const s=this._value;this._value+=t;const o=this.number;let u=!isNaN(o),c=!1;if(u){let b;this.min!=null&&this.min<0&&this.number<this.min&&(b=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(b=this.max),b!=null&&(this.autofix?(this._value=this.format(b,this).replace(ua.UNMASKED_RADIX,this.radix),c||(c=s===this._value&&!n.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let m;u?m=new mn({inserted:this._value.slice(s.length),rawInserted:c?"":t,skip:c}):(this._value=s,m=new mn),this._value=this._insertThousandsSeparators(this._value);const v=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,g=this._separatorsCountFromSlice(v);return m.tailShift+=(g-i)*this.thousandsSeparator.length,m}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,n){const r=this._findSeparatorAround(t);r>=0&&(t=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const r=this.value.slice(0,t),i=this.value.slice(n),s=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new mn({tailShift:(o-s)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case Qt.NONE:case Qt.LEFT:case Qt.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(t<i||this.value.length<=i||n===Qt.FORCE_LEFT)return r}break}case Qt.RIGHT:case Qt.FORCE_RIGHT:{const r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,s,o)=>i+o),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,r){n===void 0&&(n={});const i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ua.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ua.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ua.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ua.EMPTY_VALUES.includes(t)&&ua.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}fL=ua;ua.UNMASKED_RADIX=".";ua.EMPTY_VALUES=[...Ri.EMPTY_VALUES,0];ua.DEFAULTS={...Ri.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[fL.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};sn.MaskedNumber=ua;const QC={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function hL(e,t,n){t===void 0&&(t=QC.MASKED),n===void 0&&(n=QC.MASKED);const r=vo(e);return i=>r.runIsolated(s=>(s[t]=i,s[n]))}function _J(e,t,n,r){return hL(t,n,r)(e)}sn.PIPE_TYPE=QC;sn.createPipe=hL;sn.pipe=_J;class NJ extends Oi{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var n,r,i;const{repeat:s,...o}=Sm(t);this._blockOpts=Object.assign({},this._blockOpts,o);const u=vo(this._blockOpts);this.repeat=(n=(r=s!=null?s:u.repeat)!=null?r:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(vo(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const r=new mn;for(let c=(i=(s=this._mapPosToBlock(this.displayValue.length))==null?void 0:s.index)!=null?i:Math.max(this._blocks.length-1,0),m,v;m=(o=this._blocks[c])!=null?o:v=!v&&this._allocateBlock(c);++c){var i,s,o,u;const g=m._appendChar(t,{...n,_beforeTailState:(u=n._beforeTailState)==null||(u=u._blocks)==null?void 0:u[c]});if(g.skip&&v){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(g),g.consumed)break}return r}_trimEmptyTail(t,n){var r,i;t===void 0&&(t=0);const s=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let o;n!=null&&(o=(i=this._mapPosToBlock(n))==null?void 0:i.index),o==null&&(o=this._blocks.length-1);let u=0;for(let c=o;s<=c&&!this._blocks[c].unmaskedValue;--c,++u);u&&(this._blocks.splice(o-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._trimEmptyTail(t,n),r}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}sn.RepeatBlock=NJ;try{globalThis.IMask=sn}catch(e){}const mL={mask:ue.oneOfType([ue.array,ue.func,ue.string,ue.instanceOf(RegExp),ue.oneOf([Date,Number,sn.Masked]),ue.instanceOf(sn.Masked)]),value:ue.any,unmask:ue.oneOfType([ue.bool,ue.oneOf(["typed"])]),prepare:ue.func,prepareChar:ue.func,validate:ue.func,commit:ue.func,overwrite:ue.oneOfType([ue.bool,ue.oneOf(["shift"])]),eager:ue.oneOfType([ue.bool,ue.oneOf(["append","remove"])]),skipInvalid:ue.bool,onAccept:ue.func,onComplete:ue.func,placeholderChar:ue.string,displayChar:ue.string,lazy:ue.bool,definitions:ue.object,blocks:ue.object,enum:ue.arrayOf(ue.string),maxLength:ue.number,from:ue.number,to:ue.number,pattern:ue.string,format:ue.func,parse:ue.func,autofix:ue.oneOfType([ue.bool,ue.oneOf(["pad"])]),radix:ue.string,thousandsSeparator:ue.string,mapToRadix:ue.arrayOf(ue.string),scale:ue.number,normalizeZeros:ue.bool,padFractionalZeros:ue.bool,min:ue.oneOfType([ue.number,ue.instanceOf(Date)]),max:ue.oneOfType([ue.number,ue.instanceOf(Date)]),dispatch:ue.func,inputRef:ue.oneOfType([ue.func,ue.shape({current:ue.object})])},gL=Object.keys(mL).filter(e=>e!=="value"),BJ=["value","unmask","onAccept","onComplete","inputRef"],kJ=gL.filter(e=>BJ.indexOf(e)<0);function LJ(e){var t;const n=(t=class extends tt.Component{constructor(s){super(s),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const s=this.props,o=this._extractMaskOptionsFromProps(s);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in s&&s.value!==void 0&&(this.maskValue=s.value)):this.initMask(o);else if(this.destroyMask(),"value"in s&&s.value!==void 0){var u;(u=this.element)!=null&&u.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=s.value:this.element.value=s.value}}componentWillUnmount(){this.destroyMask()}_inputRef(s){this.element=s,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=s:this.props.inputRef(s))}initMask(s){s===void 0&&(s=this._extractMaskOptionsFromProps(this.props)),this.maskRef=sn(this.element,s).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(s){const{...o}=s;return Object.keys(o).filter(u=>kJ.indexOf(u)<0).forEach(u=>{delete o[u]}),o}_extractNonMaskProps(s){const{...o}=s;return gL.forEach(u=>{u!=="maxLength"&&delete o[u]}),"defaultValue"in o||(o.defaultValue=s.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(s){this.maskRef&&(s=s==null&&this.props.unmask!=="typed"?"":s,this.props.unmask==="typed"?this.maskRef.typedValue=s:this.props.unmask?this.maskRef.unmaskedValue=s:this.maskRef.value=s)}_onAccept(s){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,s)}_onComplete(s){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,s)}render(){return tt.createElement(e,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},t.displayName=void 0,t.propTypes=void 0,t),r=e.displayName||e.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=mL,tt.forwardRef((i,s)=>tt.createElement(n,{...i,ref:s}))}const FJ=LJ(e=>{let{inputRef:t,...n}=e;return tt.createElement("input",{...n,ref:t})}),qJ=(e,t)=>tt.createElement(FJ,{...e,ref:t}),pL=tt.forwardRef(qJ),zJ=({setShowWhatsappDialog:e})=>{const[t,n]=N.useState(null),r=SJ(),i=rn(),s=()=>{if(!nL(t))return Ie.error("Please enter a valid phone number.",{id:"invalid-phone"});r.mutate({email:null,phoneNumber:t},{onSuccess:()=>{i.invalidateQueries(N0()),Ie.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"whatsapp-success"}),e(!1)},onError:o=>{Ie.error(`There was an error processing your request: ${(o==null?void 0:o.message)||"Unknown error"}`,{id:"whatsapp-error"})}})};return d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Connect Your WhatsApp Account"}),d.jsx("div",{className:"text-md text-brand",children:"Enter the number associated with your WhatsApp account below."}),d.jsx("label",{htmlFor:"",className:"text-brand block mt-5 !mb-0",children:"Phone Number with Country Code"}),d.jsx(pL,{onAccept:(o,u)=>{n(u.unmaskedValue)},mask:[{mask:"+1 (000) 000-0000",startsWith:"+1",country:"US"},{mask:"+{0}000000000000000",startsWith:"+",country:"INTL"}],dispatch:(o,u)=>(u.value+o).replace(/\D/g,"").startsWith("1")?u.compiledMasks.find(m=>m.country==="US"):u.compiledMasks.find(m=>m.country==="INTL"),placeholder:"XX - (XXX) - XXX - XXXX",className:"!mb-10 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none"}),d.jsxs("div",{className:"flex justify-end",children:[d.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue",onClick:()=>s(),disabled:r.isPending,children:r.isPending?d.jsx(zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},QJ=({setShowMessageDialog:e})=>{const[t,n]=N.useState(null),r=N.useRef(null),i=EJ(),s=rn(),o=()=>{var u,c;if(!T0((u=r==null?void 0:r.current)==null?void 0:u.value))return Ie.error("Please enter a valid email.",{id:"invalid-icloud-email"});if(!nL(t))return Ie.error("Please enter a valid phone number.",{id:"invalid-phone"});i.mutate({email:(c=r==null?void 0:r.current)==null?void 0:c.value,phoneNumber:t},{onSuccess:()=>{s.invalidateQueries(N0()),Ie.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"imessage-success"}),e(!1)},onError:m=>{Ie.error(`There was an error processing your request: ${(m==null?void 0:m.message)||"Unknown error"}`,{id:"imessage-error"})}})};return d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Connect Your iMessage Account"}),d.jsx("div",{className:"text-md text-brand",children:"Please use the email that is associated with your iCloud account."}),d.jsx("label",{htmlFor:"",className:"text-brand block mt-5 !mb-0",children:"iCloud Email"}),d.jsx("input",{type:"text",ref:r,className:"w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("label",{htmlFor:"",className:"text-brand block mt-5 !mb-0",children:"Phone Number with Country Code"}),d.jsx(pL,{onAccept:(u,c)=>{n(c.unmaskedValue)},mask:[{mask:"+1 (000) 000-0000",startsWith:"+1",country:"US"},{mask:"+{0}000000000000000",startsWith:"+",country:"INTL"}],dispatch:(u,c)=>(c.value+u).replace(/\D/g,"").startsWith("1")?c.compiledMasks.find(v=>v.country==="US"):c.compiledMasks.find(v=>v.country==="INTL"),placeholder:"XX - (XXX) - XXX - XXXX",className:"!mb-10 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsxs("div",{className:"flex justify-end",children:[d.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue",onClick:()=>o(),disabled:i.isPending,children:i.isPending?d.jsx(zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},HJ="data:image/png;base64,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",VJ=({classList:e=""})=>{var m,v,g,b,y,x;const[t,n]=N.useState(!1),[r,i]=N.useState(!1),{data:s,isLoading:o}=Ht(N0()),u=((m=s==null?void 0:s.iMessage)==null?void 0:m.status)&&((v=s==null?void 0:s.iMessage)==null?void 0:v.status)!=3&&((g=s==null?void 0:s.iMessage)==null?void 0:g.id)!=0,c=((b=s==null?void 0:s.whatsApp)==null?void 0:b.status)&&((y=s==null?void 0:s.whatsApp)==null?void 0:y.status)!=3&&((x=s==null?void 0:s.whatsApp)==null?void 0:x.id)!=0;return d.jsxs("div",{className:`${e}`,children:[d.jsx(Ka,{title:"",children:o?d.jsx(zt,{size:"md"}):d.jsxs(d.Fragment,{children:[d.jsxs("a",{className:`flex items-center gap-2 mb-5 cursor-pointer font-semibold ${u?"text-light-gray":"text-link-color"}`,onClick:()=>u?null:n(!0),children:[d.jsx("img",{src:HJ,className:"w-[24px] h-[24px]",alt:""}),"Connect iMessage",d.jsx(xe,{icon:u?Sn:FP,className:`${u?"text-light-gray":"text-link-color"}`,size:"small"})]}),d.jsxs("a",{className:`flex items-center gap-2 cursor-pointer font-semibold ${c?"text-light-gray":"text-link-color"}`,onClick:()=>c?null:i(!0),children:[d.jsx(xe,{icon:JG,className:"text-green-800",size:"xlarge"}),"Connect WhatsApp",d.jsx(xe,{icon:c?Sn:FP,className:`${c?"text-light-gray":"text-link-color"}`,size:"small"})]})]})}),t&&d.jsx(Yd,{title:"",width:700,onClose:()=>n(!1),children:d.jsx(QJ,{setShowMessageDialog:n})}),r&&d.jsx(Yd,{title:"",width:700,onClose:()=>i(!1),children:d.jsx(zJ,{setShowWhatsappDialog:i})})]})},YJ=({className:e=""})=>{var g,b,y,x;const{data:t,isLoading:n,isSuccess:r}=Ht(N0());Ft(A=>A.platforms);const i=er(),s=[i.accessor("name",{cell:A=>A.getValue(),header:()=>"Name",size:300}),i.accessor("imessage",{cell:A=>{const w=A.getValue();return d.jsx(Ci,{status:w})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),i.accessor("whatsapp",{cell:A=>{const w=A.getValue();return d.jsx(Ci,{status:w})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})],o=[],u=((g=t==null?void 0:t.whatsApp)==null?void 0:g.id)==0?{status:"n/a",statusTitle:"N/A"}:rj((b=t==null?void 0:t.whatsApp)==null?void 0:b.status),c=((y=t==null?void 0:t.iMessage)==null?void 0:y.id)==0?{status:"n/a",statusTitle:"N/A"}:rj((x=t==null?void 0:t.iMessage)==null?void 0:x.status),m=N.useMemo(()=>[{name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:c,whatsapp:u}],[t]),v=rr({data:m,columns:s,getCoreRowModel:tr(),getPaginationRowModel:nr(),getFilteredRowModel:ur(),getRowId:A=>A.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return d.jsxs("div",{className:`${e}`,children:[d.jsx("div",{children:d.jsx("h5",{className:"text-dark text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"})}),n?d.jsx(zt,{}):d.jsx(Or,{table:v,hasGlobalFilter:!1,filterButtons:o,searchPlaceholder:"Search Accounts",itemsLabel:"Account",bordered:!0,emptyMessage:n?"Loading...":"No accounts found"})]})},WJ=()=>d.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 1 of 5: Connect Your Text Messaging Accounts"}),d.jsx("p",{className:"mb-10",children:"COMPLY has partnered with LeapExpert to provide comprehensive text messaging archiving. Your firm will have the option to tailor how your firm would like to handle the archived records. Click on the link below to access LeapExpert and continue the setup."})]}),d.jsx(VJ,{}),d.jsx(YJ,{className:"mt-10"}),d.jsx(vr,{prevLink:"/setup/hierarchy/website-reviewers",prevProgress:5,nextLink:"/setup/mobile/firm-accounts",nextProgress:6})]}),Zo={blue:{padding:"px-5 py-2",textColor:"text-blue-900",activeTextColor:"text-white",background:"",activeBackground:"bg-blue-900",border:"border-[#b4c8d0]",horizontalBorders:!1},gray:{padding:"px-5 py-3",textColor:"",activeTextColor:"",background:"",activeBackground:"bg-[#E9E9E9]",border:"border-[#D0D5DD]",horizontalBorders:!0}},Ja=({activeChoiceId:e,choices:t,onChange:n,mode:r="blue"})=>{const i=s=>{n&&n(s)};return d.jsx("div",{className:`border ${Zo[r].border} rounded-sm flex w-fit max-w-full gap-0 overflow-clip`,children:t.map((s,o)=>d.jsx("span",{onClick:()=>i(s),className:`whitespace-nowrap ${Zo[r].padding} cursor-pointer ${Zo[r].horizontalBorders&&t.length>o+1?`border-r ${Zo[r].border}`:""} ${s.id==e?`${Zo[r].activeBackground} ${Zo[r].activeTextColor}`:`${Zo[r].background} ${Zo[r].textColor}`}`,children:s.title},o))})},UJ=[{id:50,title:"50"},{id:100,title:"100"},{id:250,title:"250"},{id:375,title:"375"},{id:500,title:"500"},{id:1e3,title:"1000"},{id:0,title:"No Limit"}],GJ=({description:e=null})=>{const t=Ft(s=>s.setAccountSettings),n=Ft(s=>s.accountSettings),r=gi(),i=At({mutationKey:["updateReviewPeriodLimit"],mutationFn:async s=>{const o=await r.executeRequest("/accountsettings/limit","PUT",{limit:s});if(!o||o.error)throw new Error("Error updating review period limit");return s},onSuccess:s=>{t({...n,limit:s}),Ie.success("Review period limit updated successfully")},onError:s=>{console.error("Mutation error:",s),Ie.error("Error updating review period limit")}});return d.jsxs(Ka,{title:"Set Maximum Review Period Size",children:[e&&d.jsxs("div",{children:[d.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),d.jsx("div",{className:"h-[50px]"})]}),d.jsx("h6",{className:"underlined-subtitle",children:"NUMBER OF ITEMS"}),d.jsx(Ja,{activeChoiceId:n==null?void 0:n.limit,onChange:s=>{},choices:UJ,disabled:i.isLoading})]})};function XJ(e,t,n,r){const i=N.useRef(null),s=N.useRef(0),o=N.useRef(0),u=N.useRef(null),c=N.useRef([]),m=N.useRef(),v=N.useRef(),g=N.useRef(e),b=N.useRef(!0);g.current=e;const y=typeof window!="undefined",x=!t&&t!==0&&y;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;const A=!!(n=n||{}).leading,w=!("trailing"in n)||!!n.trailing,C="maxWait"in n,T="debounceOnServer"in n&&!!n.debounceOnServer,M=C?Math.max(+n.maxWait||0,t):null;return N.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),N.useMemo(()=>{const E=F=>{const z=c.current,Q=m.current;return c.current=m.current=null,s.current=F,o.current=o.current||F,v.current=g.current.apply(Q,z)},I=(F,z)=>{x&&cancelAnimationFrame(u.current),u.current=x?requestAnimationFrame(F):setTimeout(F,z)},O=F=>{if(!b.current)return!1;const z=F-i.current;return!i.current||z>=t||z<0||C&&F-s.current>=M},D=F=>(u.current=null,w&&c.current?E(F):(c.current=m.current=null,v.current)),j=()=>{const F=Date.now();if(A&&o.current===s.current&&_(),O(F))return D(F);if(!b.current)return;const z=t-(F-i.current),Q=C?Math.min(z,M-(F-s.current)):z;I(j,Q)},_=()=>{r&&r({})},k=(...F)=>{if(!y&&!T)return;const z=Date.now(),Q=O(z);if(c.current=F,m.current=this,i.current=z,Q){if(!u.current&&b.current)return s.current=i.current,I(j,t),A?E(i.current):v.current;if(C)return I(j,t),E(i.current)}return u.current||I(j,t),v.current};return k.cancel=()=>{u.current&&(x?cancelAnimationFrame(u.current):clearTimeout(u.current)),s.current=0,c.current=i.current=m.current=u.current=null},k.isPending=()=>!!u.current,k.flush=()=>u.current?D(Date.now()):v.current,k},[A,C,t,M,w,x,y,T,r])}function ZJ(e,t){return e===t}function vL(e,t,n){const r=ZJ,i=N.useRef(e),[,s]=N.useState({}),o=XJ(N.useCallback(c=>{i.current=c,s({})},[s]),t,n,s),u=N.useRef(e);return r(u.current,e)||(o(e),u.current=e),[i.current,o]}const sj=[{id:0,title:"0%"},{id:1,title:"1%"},{id:2,title:"2%"},{id:3,title:"3%"},{id:4,title:"4%"},{id:5,title:"5%"},{id:10,title:"10%"},{id:15,title:"15%"},{id:20,title:"20%"},{id:25,title:"25%"}],KJ=({description:e=null})=>{const t=Ft(v=>v.setAccountSettings),n=Ft(v=>v.accountSettings),r=gi(),[i,s]=N.useState(""),[o]=vL(i,500),u=N.useRef(null),c=At({mutationFn:async v=>{const g=await r.executeRequest("/accountsettings/sampling","PUT",{sampling:v});if(!g||g.error)throw new Error("Error updating sample percentage");return v},onSuccess:v=>{t({...n,sampling:v}),Ie.success("Sample percentage updated successfully")},onError:()=>{Ie.error("Error updating sample percentage")}});N.useEffect(()=>{o!==""&&!isNaN(o)&&o>=0&&o<=100&&c.mutate(Number(o))},[o]),N.useEffect(()=>{sj.find(v=>v.id==(n==null?void 0:n.sampling))||(u.current.value=n==null?void 0:n.sampling)},[n==null?void 0:n.sampling]);const m=v=>{const g=Math.floor(v.target.value);if(g<0){u.current.value=0,s(0);return}if(g>100){u.current.value=100,s(100);return}s(g)};return d.jsxs(Ka,{title:"Set Mobile Sample Percentage",children:[e&&d.jsxs("div",{children:[d.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),d.jsx("div",{className:"h-[50px]"})]}),d.jsx("h6",{className:"underlined-subtitle",children:"SAMPLE PERCENTAGE RATE"}),d.jsx(Ja,{activeChoiceId:n==null?void 0:n.sampling,onChange:v=>{u.current.value="",c.mutate(v.id)},choices:sj}),d.jsx("div",{className:"h-[50px]"}),d.jsx("h6",{className:"underlined-subtitle",children:"CUSTOM PERCENTAGE RATE"}),d.jsxs("div",{children:[d.jsx("input",{className:"text-right !mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full",type:"number",min:0,max:100,inputMode:"numeric",pattern:"[0-9]*",placeholder:"Custom Value",defaultValue:i,onChange:m,ref:u}),d.jsx("p",{className:"text-sm",children:"Enter a number or percentage"})]})]})},JJ=e=>({queryKey:["account",e],queryFn:()=>yt.executeRequest(`/accounts/${e}`,"GET")}),eO={queryKey:["settings"],queryFn:()=>yt.executeRequest("/accountsettings","GET"),retry:!1},Qm=({archivingType:e,pageType:t})=>{const n=rn();return At({mutationFn:r=>{const i={archivingType:e,pageType:t,frequency:r};return yt.executeRequest("/accountsettings","PUT",i)},onSuccess:()=>{n.invalidateQueries(eO),Ie.success("Review frequency updated!")},onError:()=>{Ie.error("Error occurred while setting review frequency")}})},$J=({description:e=null})=>{const t=Ft(r=>r.accountSettings),{mutate:n}=Qm({archivingType:"mobile",pageType:"setup"});return d.jsx("section",{className:"",children:d.jsx(Ka,{title:"Set Mobile Review Frequency",children:d.jsxs("div",{className:"",children:[e&&d.jsxs("div",{children:[d.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),d.jsx("div",{className:"h-[50px]"})]}),d.jsx("h6",{className:"underlined-subtitle uppercase",children:"REVIEW FREQUENCY"}),d.jsx(Ja,{activeChoiceId:t==null?void 0:t.mobileFrequency,onChange:r=>{},choices:w8})]})})})},e$=()=>d.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 3 of 5: Set Review Frequency and Size"}),d.jsx("p",{className:"mb-10",children:"Search or select an employee below to set up their archived mobile data. By sending a request, they will get an email as well as a ToDo List item prompting them to connect their device."})]}),d.jsx($J,{description:`<p>The review frequency is the frequency which you will be prompted to review your firm’s mobile messages.</p>
|
|
590
|
+
*/const cm=class extends N.Component{constructor(t){super(t),this.context=0,this.titleId=this.generateTitleId(),this.contentId=this.generateContentId(),this.activeElement=null,this.onCloseDialog=n=>{n.preventDefault(),Ya(this.props.onClose,n,this,void 0)},this.onKeyDown=n=>{n.keyCode===Bn.esc&&this.props.onClose&&(n.preventDefault(),this.onCloseDialog(n)),nG(n,this.element)},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:ZK:this.state.zIndex>(this.context?this.context+zC:0)?this.state.zIndex:this.context+zC,this.getDocument=()=>{const n=pd?document:null;return this.props.appendTo?this.props.appendTo.ownerDocument:n},pd&&(this.activeElement=ku(document))}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){if(this.element){if(this.props.autoFocus&&!this.props.autoFocusedElement)this.element.focus();else if(this.props.autoFocus&&this.props.autoFocusedElement)this.element.focus();else if(!this.props.autoFocus&&this.props.autoFocusedElement){const t=this.element.querySelector(this.props.autoFocusedElement);t&&t.focus()}else{const t=[...C0].map(n=>n+":not(.k-dialog-titlebar *)");tG(this.element,t)}this.setState({zIndex:JK(this.getCurrentZIndex(),this.getDocument(),this._id)})}}componentWillUnmount(){setTimeout(()=>{var t;!this.element&&this.activeElement&&pd&&(document.contains(this.activeElement)?this.activeElement.focus():this.activeElement.id&&((t=document.getElementById(this.activeElement.id))==null||t.focus()))})}render(){const t=this.props.id!==void 0?this.props.id:this.titleId,{title:n,width:r,height:i,children:s,minWidth:o,dir:u,style:c,contentStyle:m,modal:v=!0}=this.props,g=N.Children.toArray(s),b=this.getContent(g),y=this.getActionBar(g),x=n?{"aria-labelledby":t}:null,A=this.props.closeIcon!==void 0?this.props.closeIcon:!0,w=this.getCurrentZIndex(),C=N.createElement($d.Provider,{value:w},N.createElement("div",{[J8]:this._id,className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:u,style:{zIndex:w,...c},ref:T=>{this.element=T}},v&&N.createElement("div",{className:"k-overlay",style:this.props.overlayStyle}),N.createElement("div",{...x,className:$n("k-window k-dialog",{[`k-window-${this.props.themeColor}`]:this.props.themeColor}),role:"dialog","aria-labelledby":t,"aria-modal":!0,"aria-describedby":this.contentId,style:{width:r,height:i,minWidth:o}},this.props.title&&N.createElement(XK,{closeIcon:A,onCloseButtonClick:this.onCloseDialog,id:t},n),N.createElement("div",{className:"k-window-content k-dialog-content",style:m,id:this.contentId},b),y)));return pd?this.props.appendTo!==null?p0.createPortal(C,this.props.appendTo||document.body):C:null}getActionBar(t){return t.filter(n=>n&&n.type===qC)}getContent(t){return t.filter(n=>n&&n.type!==qC)}generateTitleId(){return"dialog-title-"+this._id}generateContentId(){return"dialog-content-"+this._id}};cm.displayName="Dialog",cm.propTypes={title:ue.any,id:ue.string,dir:ue.string,style:ue.object,closeIcon:ue.bool,width:ue.oneOfType([ue.number,ue.string]),height:ue.oneOfType([ue.number,ue.string]),minWidth:ue.oneOfType([ue.number,ue.string]),autoFocus:ue.bool},cm.defaultProps={autoFocus:!1},cm.contextType=$d;let $K=cm;const eJ=n8(),Yd=R0(r8(eJ,$K));Yd.displayName="KendoReactDialog";const Mn=e=>d.jsx(Yd,{...e,appendTo:null}),tj=e=>/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e),JR=e=>/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/.test(e),T0=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),_0=e=>{if(e.includes("/email"))return"email";if(e.includes("/social_media"))return"social_media";if(e.includes("/website"))return"website"},tJ=(e,t)=>{const r=`\\b${(s=>s==null?void 0:s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},nj=(e,t)=>{const r=`\\b${(s=>s==null?void 0:s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},$8=(e,t,n)=>{const r=eL(tL(e));return r?t==null?void 0:t.filter(i=>{if(!i)return!1;const s=i.keyword.trim();if(!nj(r,s))return!1;if(!n||n.length<1)return!0;const o=n==null?void 0:n.filter(c=>{var m,v;return(v=(m=c==null?void 0:c.item)==null?void 0:m.toLowerCase())==null?void 0:v.includes(s==null?void 0:s.toLowerCase())});return(o==null?void 0:o.length)===0?!0:!(o==null?void 0:o.some(c=>nj(r,c==null?void 0:c.item)))}):[]},nJ=(e,t)=>{const n=eL(tL(e));return n?t==null?void 0:t.filter(r=>{var i;return!!tJ(n,(i=r==null?void 0:r.item)==null?void 0:i.toLowerCase())}):[]},eL=e=>e&&e.replace(/[\r?\n!@#&*()\-\–—+=\[\]{}|:;'\"‘’“”,.<>\?/]/g," "),tL=e=>e&&e.replace(/<[^>]*>/g,""),rJ=e=>{if(!e)return e;const t=e.match(/@(.+)$/);return t?t[1]:null},iJ=e=>/^(?!\.)(?!.*\.\.)[A-Za-z0-9._+-]+(?<!\.)$/.test(e),aJ=e=>{if(!e)return"N/A";const t={month:"long",day:"numeric",year:"numeric"},r=new Intl.DateTimeFormat("en-US",t).formatToParts(e);let i=r.find(m=>m.type==="day").value;const s=r.find(m=>m.type==="month").value,o=r.find(m=>m.type==="year").value,u=parseInt(i,10);let c="th";return u%10===1&&u!==11?c="st":u%10===2&&u!==12?c="nd":u%10===3&&u!==13&&(c="rd"),`${s} ${u}${c}, ${o}`},nL=e=>{if(!e)return!1;const t=e.replace(/\D/g,"");return!(t.length<8||t.length>15)},sJ=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=N.useState(!1),[s,o]=N.useState(""),[u,c]=N.useState(!1),[m,v]=N.useState(),g=er();rn();const b=N.useRef(null),y=[g.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:I})=>A===I.original.id?d.jsx("input",{onClick:D=>D.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:I.original.item,ref:b}):I.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:I})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:O=>{O.stopPropagation(),c(!0),v(I.original)}})})],x=[{label:"Add",icon:Gn,onClick:()=>{i(!0)}}];bo();const[A,w]=N.useState(),C=tf();function T(I){I&&C.mutate(I==null?void 0:I.id,{onSuccess:()=>{c(!1)}})}const M=ef();function P(){if(!T0(s))return Ie.error("Please enter a valid email!",{id:"new-excluded-email"});M.mutate({itemType:"sender",filterType:"internal",item:s,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const E=rr({data:e,columns:y,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:I=>I.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${n}`,children:[d.jsx(Or,{table:E,onRowClick:I=>{I.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Associated Contacts",rowSelectedCheck:I=>I.original.checked===1,collapseSearchAndFilters:!0}),r&&d.jsx(Mn,{title:"",width:700,onClose:()=>i(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:I=>o(I.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:P,disabled:M.isPending,children:M.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),u&&d.jsx(Mn,{title:"",width:700,onClose:()=>c(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>c(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Associated Contact"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this associated contact?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>c(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>T(m),disabled:C.isPending,children:C.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},oJ=({data:e=[],isLoading:t=!1})=>{const[n,r]=N.useState(!1),[i,s]=N.useState(""),[o,u]=N.useState(!1),[c,m]=N.useState(),v=er();rn();const g=N.useRef(null),b=[v.accessor("item",{header:"Email Domains",size:"unset",cell:({row:E})=>x===E.original.id?d.jsx("input",{onClick:O=>O.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:E.original.item,ref:g}):E.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:E})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:I=>{I.stopPropagation(),u(!0),m(E.original)}})})],y=[{label:"Add Domain",icon:Gn,onClick:()=>{r(!0)}}];bo();const[x,A]=N.useState(),w=tf();function C(E){E&&w.mutate(E==null?void 0:E.id,{onSuccess:()=>{u(!1)}})}const T=ef();function M(){if(!JR(i))return Ie.error("Please enter a valid domain!",{id:"new-email-domain"});T.mutate({itemType:"domain",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{s(""),r(!1)}})}const P=rr({data:e,columns:b,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:E=>E.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:"relative",children:[d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Domains"})}),d.jsx(Or,{table:P,onRowClick:E=>{E.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:E=>E.original.checked===1}),n&&d.jsx(Mn,{title:"",width:700,onClose:()=>r(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:E=>s(E.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:M,disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),o&&d.jsx(Mn,{title:"",width:700,onClose:()=>u(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(c),disabled:w.isPending,children:w.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},lJ=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=N.useState(!1),[s,o]=N.useState(""),[u,c]=N.useState(!1),[m,v]=N.useState(),g=er();rn();const b=N.useRef(null),y=[g.accessor("item",{header:"Email Prefixes",size:"unset",cell:({row:O})=>A===O.original.id?d.jsx("input",{onClick:j=>j.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:O.original.item,ref:b}):O.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:O})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:D=>{D.stopPropagation(),c(!0),v(O.original)}})})],x=[{label:"Add",icon:Gn,onClick:()=>{i(!0)}}];bo();const[A,w]=N.useState(),C=UX(),T=tf();function M(O){O&&((O==null?void 0:O.addedType)=="added"?T.mutate(O==null?void 0:O.id,{onSuccess:()=>{c(!1)}}):C.mutate(O==null?void 0:O.id,{onSuccess:()=>{c(!1)}}))}const P=ef();function E(){if(e.find(O=>O.item==s))return i(!1),Ie.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!s||(s==null?void 0:s.trim())==""||!iJ(s))return Ie.error("Please enter a valid email prefix!",{id:"new-email-prefix"});P.mutate({itemType:"username",filterType:"spam_email",item:s,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const I=rr({data:e,columns:y,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:O=>O.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${n}`,children:[d.jsx(Or,{table:I,onRowClick:O=>{O.toggleSelected()},emptyMessage:t?"Loading...":"No items found",bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search or add new prefixes",itemsLabel:"Email Prefixes",rowSelectedCheck:O=>O.original.checked===1,collapseSearchAndFilters:!0}),r&&d.jsx(Mn,{title:"",width:700,onClose:()=>i(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Prefix"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:O=>o(O.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:E,disabled:P.isPending,children:P.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),u&&d.jsx(Mn,{title:"",width:700,onClose:()=>c(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>c(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>c(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>M(m),disabled:C.isPending,children:C.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},uJ=({data:e=[],isLoading:t=!1})=>{const[n,r]=N.useState(!1),[i,s]=N.useState(""),[o,u]=N.useState(!1),[c,m]=N.useState(),v=er();rn();const g=N.useRef(null),b=[v.accessor("item",{header:"Recipients",size:"unset",cell:({row:E})=>x===E.original.id?d.jsx("input",{onClick:O=>O.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:E.original.item,ref:g}):E.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:E})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:I=>{I.stopPropagation(),u(!0),m(E.original)}})})],y=[{label:"Add Email",icon:Gn,onClick:()=>{r(!0)}}];bo();const[x,A]=N.useState(),w=tf();function C(E){E&&w.mutate(E==null?void 0:E.id,{onSuccess:()=>{u(!1)}})}const T=ef();function M(){if(!T0(i))return Ie.error("Please enter a valid email!",{id:"new-excluded-email"});T.mutate({itemType:"recipient",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{s(""),r(!1)}})}const P=rr({data:e,columns:b,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:E=>E.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:"relative",children:[d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Recipients"})}),d.jsx(Or,{table:P,onRowClick:E=>{E.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Recipients",rowSelectedCheck:E=>E.original.checked===1}),n&&d.jsx(Mn,{title:"",width:700,onClose:()=>r(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:E=>s(E.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:M,disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),o&&d.jsx(Mn,{title:"",width:700,onClose:()=>u(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Recipient"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this recipient?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(c),disabled:w.isPending,children:w.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},cJ=({data:e=[],isLoading:t=!1})=>{const[n,r]=N.useState(!1),[i,s]=N.useState(""),[o,u]=N.useState(!1),[c,m]=N.useState(),v=er();rn();const g=N.useRef(null),b=[v.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:E})=>x===E.original.id?d.jsx("input",{onClick:O=>O.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:E.original.item,ref:g}):E.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:E})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:I=>{I.stopPropagation(),u(!0),m(E.original)}})})],y=[{label:"Add Email",icon:Gn,onClick:()=>{r(!0)}}];bo();const[x,A]=N.useState(),w=tf();function C(E){E&&w.mutate(E==null?void 0:E.id,{onSuccess:()=>{u(!1)}})}const T=ef();function M(){if(!T0(i))return Ie.error("Please enter a valid email!",{id:"new-excluded-email"});T.mutate({itemType:"sender",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{s(""),r(!1)}})}const P=rr({data:e,columns:b,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:E=>E.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:"relative",children:[d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Senders"})}),d.jsx(Or,{table:P,onRowClick:E=>{E.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Senders",rowSelectedCheck:E=>E.original.checked===1}),n&&d.jsx(Mn,{title:"",width:700,onClose:()=>r(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:E=>s(E.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:M,disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),o&&d.jsx(Mn,{title:"",width:700,onClose:()=>u(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Sender"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this sender?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(c),disabled:w.isPending,children:w.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},dJ=({classList:e=""})=>{var O;const{data:t,isLoading:n}=Ht(XX()),r=(O=t==null?void 0:t.payload)!=null?O:[],[i,s]=N.useState(!1),[o,u]=N.useState(""),[c,m]=N.useState(!1),[v,g]=N.useState(),b=er();rn();const y=N.useRef(null),x=[b.accessor("item",{header:"Phrase",size:"unset",cell:({row:D})=>w===D.original.id?d.jsx("input",{onClick:_=>_.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:D.original.item,ref:y}):D.original.item}),b.display({size:65,id:"delete",header:()=>null,cell:({row:D})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:j=>{j.stopPropagation(),m(!0),g(D.original)}})})],A=[{label:"Add",icon:Gn,onClick:()=>{s(!0)}}];bo();const[w,C]=N.useState(),T=WX();function M(D){D&&T.mutate({archivingType:"email",filterType:"spam_phrase",multipleType:!1,itemId:D.id,itemType:D.itemType},{onSuccess:()=>{m(!1)}})}const P=P0();function E(){if(r.find(D=>D.item==o))return s(!1),Ie.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!o||(o==null?void 0:o.trim())=="")return Ie.error("Please enter a valid phrase!",{id:"new-spam-phrase"});P.mutate({archivingType:"email",filterType:"spam_phrase",item:o},{onSuccess:()=>{u(""),s(!1)}})}const I=rr({data:r,columns:x,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:D=>D.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${e}`,children:[d.jsx(Or,{table:I,onRowClick:D=>{D.toggleSelected()},emptyMessage:n?"Loading...":"No items found",bordered:!1,filterButtons:A,hasGlobalFilter:!0,searchPlaceholder:"Search or add new phrases",itemsLabel:"Phrases",rowSelectedCheck:D=>D.original.checked===1,collapseSearchAndFilters:!0}),i&&d.jsx(Mn,{title:"",width:700,onClose:()=>s(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>s(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Phrase"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:D=>u(D.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:E,disabled:P.isPending,children:P.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),c&&d.jsx(Mn,{title:"",width:700,onClose:()=>m(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>m(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>m(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>M(v),disabled:T.isPending,children:T.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},fJ=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=N.useState(!1),[s,o]=N.useState(""),[u,c]=N.useState(!1),[m,v]=N.useState(),g=er();rn();const b=N.useRef(null);N.useRef(null);const y=[g.accessor("item",{header:"Email Domains",size:"unset",cell:({row:I})=>A===I.original.id?d.jsx("input",{onClick:D=>D.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:I.original.item,ref:b}):I.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:I})=>d.jsx(xe,{className:"",icon:Ji,size:"large",onClick:O=>{O.stopPropagation(),c(!0),v(I.original)}})})],x=[{label:"Add",icon:Gn,onClick:()=>{i(!0)}}];bo();const[A,w]=N.useState(),C=tf();function T(I){I&&C.mutate(I==null?void 0:I.id,{onSuccess:()=>{c(!1)}})}const M=ef();function P(){if(!JR(s))return Ie.error("Please enter a valid domain!",{id:"new-email-domain"});M.mutate({itemType:"domain",filterType:"internal",item:s,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const E=rr({data:e,columns:y,getCoreRowModel:tr(),getPaginationRowModel:nr(),getRowId:I=>I.id.toString(),getFilteredRowModel:ur(),globalFilterFn:"includesString",autoResetPageIndex:!1});return d.jsxs("section",{className:`relative ${n}`,children:[d.jsx(Or,{table:E,onRowClick:I=>{I.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:I=>I.original.checked===1,collapseSearchAndFilters:!0}),r&&d.jsx(Mn,{title:"",width:700,onClose:()=>i(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{type:"text",onChange:I=>o(I.target.value),className:"!mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("button",{className:"uppercase btn-blue ml-3",onClick:P,disabled:M.isPending,children:M.isPending?d.jsx(zt,{colorClass:"text-white"}):d.jsxs(d.Fragment,{children:[d.jsx(xe,{className:"mr-2",icon:Gn,size:"medium"})," Add"]})})]})]})}),u&&d.jsx(Mn,{title:"",width:700,onClose:()=>c(!1),children:d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>c(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),d.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),d.jsxs("div",{className:"mt-5 flex justify-end",children:[d.jsx("button",{className:"btn-transparent uppercase",onClick:()=>c(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue uppercase",onClick:()=>T(m),disabled:C.isPending,children:C.isPending?d.jsx(zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},hJ=()=>{var m,v,g,b,y,x;const{data:e,isLoading:t,isSuccess:n}=Ht(ZX()),r=(m=e==null?void 0:e.blacklist)==null?void 0:m.recipients,i=(v=e==null?void 0:e.blacklist)==null?void 0:v.sender,s=(g=e==null?void 0:e.blacklist)==null?void 0:g.domains,o=(b=e==null?void 0:e.spam_email)==null?void 0:b.usernames,u=(y=e==null?void 0:e.internal)==null?void 0:y.domains,c=(x=e==null?void 0:e.internal)==null?void 0:x.sender;return d.jsx("section",{className:"flex flex-col w-full !mb-3",children:d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9 mb-10",children:"Excluded Emails"}),d.jsxs(D0,{children:[d.jsxs(hi,{label:"Recipients",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Exclude specific recipients from your email review. Changes to review settings will go into effect in your next review period."}),d.jsx(uJ,{isLoading:t,data:r})]}),d.jsxs(hi,{label:"Senders",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Exclude specific senders from your email review. Changes to review settings will go into effect in your next review period."}),d.jsx(cJ,{isLoading:t,data:i})]}),d.jsxs(hi,{label:"Domains",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Exclude specific email domains from your email review. Changes to review settings will go into effect in your next review period."}),d.jsx(oJ,{isLoading:t,data:s})]}),d.jsxs(hi,{label:"Spam",onActive:()=>{},children:[d.jsx("p",{className:"mb-10",children:"Below are the email domains that are excluded from your review."}),d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Excluded Spam"})}),d.jsxs(XP,{children:[d.jsx(hi,{label:"Email Prefixes",onActive:()=>{},children:d.jsx(lJ,{data:o,isLoading:t,classList:"mt-[-1px]"})}),d.jsx(hi,{label:"Phrases",onActive:()=>{},children:d.jsx(dJ,{classList:"mt-[-1px]"})})]})]}),d.jsxs(hi,{label:"Advanced",onActive:()=>{},children:[d.jsx("p",{className:"mb-10"}),d.jsx(KX,{data:u}),d.jsx("div",{children:d.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Additional Exclusions"})}),d.jsxs(XP,{children:[d.jsx(hi,{label:"Internal Domains",onActive:()=>{},children:d.jsx(fJ,{data:u,isLoading:t,classList:"mt-[-1px]"})}),d.jsx(hi,{label:"Associated Contacts",onActive:()=>{},children:d.jsx(sJ,{data:c,isLoading:t,classList:"mt-[-1px]"})})]})]})]})]})})},mJ=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/instagram?url=${e}`,"GET"),onError:()=>Ie.error("Error occured while trying to connect to Instagram account."),onSuccess:(t,n)=>{}}),gJ=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/instagram/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ie.error("Error occured while trying to connect to Instagram account."),onSuccess:(t,n)=>{window.location.href=`${t}&encryptedUser=${yt.getUser()}`}}),rL=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/linkedin/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ie.error("Error occured while trying to connect to LinkedIn account."),onSuccess:(t,n)=>{window.location.href=`${t}&encryptedUser=${yt.getUser()}`}}),pJ=e=>At({mutationFn:()=>yt.executeRequest(`/socialmedia/facebook/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ie.error("Error occured while trying to connect to Facebook account."),onSuccess:(t,n)=>{window.location.href=t}}),vJ=(e,t)=>At({mutationFn:n=>yt.executeRequest(`/socialmedia/firm?type=${n}&firmURL=${e}&employeeURL=${t}`,"GET"),onError:()=>Ie.error("Error occured while trying to connect to Facebook account."),onSuccess:(n,r)=>{window.location.href=n==null?void 0:n.firmURL}}),iL=()=>{const e=rn();return At({mutationFn:({accountType:t,screenName:n,isTodoReconnect:r})=>yt.executeRequest("/socialmedia/twitter/response","POST",{accountType:t,screenName:n,isTodoReconnect:r}),onSettled:(t,n)=>{e.invalidateQueries({queryKey:zm().queryKey}),e.invalidateQueries({queryKey:wi().queryKey})}})},aL=()=>{const e=rn();return At({mutationFn:({type:t,accountType:n})=>yt.executeRequest("/socialmedia/disconnect","POST",{type:t,accountType:n}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:zm().queryKey}),e.invalidateQueries({queryKey:wi().queryKey})}})},sL=()=>At({mutationFn:e=>yt.executeRequest("/accountsettings/approved","PUT",{approved:e}),onSuccess:(e,t)=>{}}),bJ=()=>{const e=rn();return At({mutationFn:({archivingType:t,itemId:n,itemType:r,filterType:i})=>yt.executeRequest("/Archiving/readd_archiving_keyword_and_added_item","POST",{archivingType:t,itemId:n,itemType:r,filterType:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["deleteKeywords"]}),e.invalidateQueries({queryKey:["keywordsAndPhrases"]})}})},yJ=(e="social_media")=>({queryKey:["deleteKeywords",e],queryFn:()=>yt.executeRequest(`/Popups/archiving_view_previously_removed_keywords/${e}`,"POST")}),wi=()=>({queryKey:["socialMediaStatuses"],queryFn:()=>yt.executeRequest("/socialmedia/check/statuses","GET")}),Wd=()=>({queryKey:["heightenedSupervisionUsers"],queryFn:async()=>{const e=await yt.executeRequest("/heightenedsupervisionusers/users","GET");if(!e||e.error)throw new Error("Error occurred while fetching users");return e},onError:()=>{Ie.error("Error occurred while fetching users")}}),oL=()=>At({mutationFn:({types:e,employees:t})=>yt.executeRequest("/employeerequests","POST",{types:e,employees:t})}),xJ=()=>({queryKey:["socialmediatypes"],queryFn:()=>yt.executeRequest("/socialmedia/types","GET"),retry:!1}),zm=()=>({queryKey:["employeeaccounts"],queryFn:()=>yt.executeRequest("/socialmedia/employee/accounts?url=mrc","GET")}),Ci=({status:e})=>{if(!e)return"";const t={facebook_active:"text-[#008E28]",linkedin_active:"text-[#008E28]",instagram_active:"text-[#008E28]",twitter_active:"text-[#008E28]",active:"text-[#008E28]",facebook_inactive:"text-[#AA2400]",linkedin_inactive:"text-[#AA2400]",instagram_inactive:"text-[#AA2400]",twitter_inactive:"text-[#AA2400]",inactive:"text-[#AA2400]",facebook_pending:"text-[#C68900]",instagram_pending:"text-[#C68900]",linkedin_pending:"text-[#C68900]",twitter_pending:"text-[#C68900]",pending:"text-[#C68900]",facebook_unavailable:"text-[#012330]",linkedin_unavailable:"text-[#012330]",instagram_unavailable:"text-[#012330]",twitter_unavailable:"text-[#012330]",unavailable:"text-[#012330]",facebook_connect:"text-[#005DEC]",linkedin_connect:"text-[#005DEC]",instagram_connect:"text-[#005DEC]",twitter_connect:"text-[#005DEC]",connect:"text-[#005DEC]"};let n=ca,r="";switch(e.status){case"facebook_active":case"linkedin_active":case"instagram_active":case"twitter_active":case"active":n=nX,r="Active";break;case"facebook_inactive":case"linkedin_inactive":case"instagram_inactive":case"twitter_inactive":case"inactive":n=ca,r="Inactive";break;case"facebook_pending":case"linkedin_pending":case"instagram_pending":case"twitter_pending":case"pending":n=UG,r="Pending";break;case"facebook_connect":case"linkedin_connect":case"instagram_connect":case"twitter_connect":case"connect":n=eX,r="Connect";break;default:n=ca,r="N/A"}return d.jsxs("div",{className:`inline-flex gap-1 w-22.5 h-6 items-center px-1.5 py-1 rounded-sm text-sm font-medium ${t[e.status]}`,children:[d.jsx(xe,{icon:n,size:"small",className:"fill-current"}),d.jsx("div",{className:"capitalize flex-grow text-center",children:r})]})},wp={status:"unavailable",statusTitle:"Unavailable",ts:null,active:!1},AJ=({showName:e,hasRowSelection:t=!1,description:n=null,isSettings:r=!1})=>{const i=oL(),{data:s,isLoading:o,isSuccess:u}=Ht(zm()),{data:c,isLoading:m,isSuccess:v}=Ht(Wd()),{data:g,isLoading:b,isSuccess:y}=Ht(wi()),x={iMessage:1,WhatsApp:2},A=rn();N.useEffect(()=>{v&&y&&A.setQueryData(wi().queryKey,K=>{if(!K)return{};const $={...K};return c.forEach(le=>{$[le.id]||($[le.id]={}),Object.values(x).forEach(q=>{$[le.id][q]||($[le.id][q]={...wp})})}),$})},[v,y,g]);const w=g&&c&&Array.from(new Set(Object.entries(g).filter(([K,$])=>Object.values($).some(le=>le.active===1)).map(([K])=>parseInt(K)))),C=g&&c&&Array.from(new Set(Object.values(g).flatMap(K=>Object.entries(K).filter(([$,le])=>le.active===1).map(([$])=>parseInt($))))),T=er(),M=[T.accessor("name",{cell:K=>K.getValue(),header:()=>e?"Name":"",size:300}),T.accessor("imessage",{cell:K=>{const $=K.getValue();return d.jsxs("label",{htmlFor:`imessage-check-${K.row.id}-${x==null?void 0:x.iMessage}`,className:"flex items-center cursor-pointer",children:[!r&&d.jsx("input",{type:"checkbox",id:`imessage-check-${K.row.id}-${x==null?void 0:x.iMessage}`,checked:!!$.active,onChange:le=>E(K.row.id,x==null?void 0:x.iMessage,le.target.checked)}),d.jsx(Ci,{status:$})]})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),T.accessor("whatsapp",{cell:K=>{const $=K.getValue();return d.jsxs("label",{htmlFor:`whatsapp-check-${K.row.id}-${x==null?void 0:x.WhatsApp}`,className:"flex items-center cursor-pointer",children:[!r&&d.jsx("input",{type:"checkbox",id:`whatsapp-check-${K.row.id}-${x==null?void 0:x.WhatsApp}`,checked:!!$.active,onChange:le=>E(K.row.id,x==null?void 0:x.WhatsApp,le.target.checked)}),d.jsx(Ci,{status:$})]})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})];t&&M.unshift(T.accessor("id",{header:({table:K})=>d.jsx("input",{type:"checkbox",checked:g&&Object.values(g).every($=>Object.values($).every(le=>le.active===1)),onChange:$=>I($.target.checked)}),cell:({row:K})=>{var le;let $=!1;return K.id!="firm_accounts"&&K.id!="your_accounts"&&($=Object.values((le=g==null?void 0:g[K.original.id])!=null?le:{}).every(q=>q.active===1)),d.jsx("input",{type:"checkbox",checked:$,onChange:q=>{O(parseInt(K.original.id),q.target.checked)}})},maxSize:55}));const P=[{label:i.isPending?d.jsx(zt,{colorClass:"text-white"}):"Send Request",active:t,onClick:()=>{if(w.length<1)return Ie.error("Please select at least one employee!");i.isPending||i.mutate({types:C,employees:w},{onSuccess:()=>{A.invalidateQueries({queryKey:Wd().queryKey}),A.invalidateQueries({queryKey:wi().queryKey}),Ie.success("To do list items have been sent for mobile setup.")}})},icon:d8}],E=(K,$,le)=>{const q=le?1:0;A.setQueryData(wi().queryKey,H=>{var W;return H&&((W=H==null?void 0:H[K])!=null&&W[$]?{...H,[K]:{...H==null?void 0:H[K],[$]:{...H[K][$],active:q}}}:{...H,[K]:{...H==null?void 0:H[K],[$]:{...wp,active:le}}})})},I=K=>{A.setQueryData(wi().queryKey,$=>$&&Object.fromEntries(Object.entries($).map(([q,H])=>[q,Object.fromEntries(Object.entries(H).map(([W,G])=>[W,{...G,active:K?1:0}]))])))},O=(K,$)=>{if(isNaN(K))return Ie.error("You cannot send a request for 'Firm Accounts' and 'Your Accounts'.");A.setQueryData(wi().queryKey,le=>{if(!(le!=null&&le[K]))return le;const q=Object.fromEntries(Object.entries(le[K]).map(([H,W])=>[H,{...W,active:$?1:0}]));return{...le,[K]:q}})},D=s==null?void 0:s.find(K=>(K==null?void 0:K.accountType)==(x==null?void 0:x.iMessage)),j=s==null?void 0:s.find(K=>(K==null?void 0:K.accountType)==(x==null?void 0:x.WhatsApp)),_={name:"Your Accounts",id:"your_accounts",imessage:{status:D?"active":"inactive",statusTitle:D?"Active":"Inactive",ts:null,active:!!D},whatsapp:{status:j?"active":"inactive",statusTitle:j?"Active":"Inactive",ts:null,active:!!j}},k=g==null?void 0:g.firm,F=k==null?void 0:k[x==null?void 0:x.iMessage],z=k==null?void 0:k[x==null?void 0:x.WhatsApp],Q={name:"Firm Accounts",id:"firm_accounts",imessage:{status:F?"active":"inactive",statusTitle:F?"Active":"Inactive",ts:null,active:!!F},whatsapp:{status:z?"active":"inactive",statusTitle:z?"Active":"Inactive",ts:null,active:!!z}},te=N.useMemo(()=>{if(!c||!g)return[];const K=c.map($=>{var le,q;return{id:$.id,name:`${$.firstName} ${$.lastName}`,imessage:((le=g==null?void 0:g[$.id])==null?void 0:le[x==null?void 0:x.iMessage])||{...wp},whatsapp:((q=g==null?void 0:g[$.id])==null?void 0:q[x==null?void 0:x.WhatsApp])||{...wp}}});return r&&(K.unshift({..._}),K.unshift({...Q})),K},[c,g]),Y=rr({data:te,columns:M,getCoreRowModel:tr(),getPaginationRowModel:nr(),getFilteredRowModel:ur(),getRowId:K=>K.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return d.jsxs("div",{children:[d.jsxs("div",{children:[d.jsx("h5",{className:"text-brand text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"}),n&&d.jsx("p",{className:"mb-5",children:"A list of all the connected social media accounts in your firm. Send employee requests to connect additional accounts. Sending a request will generate a To-Do List item."})]}),d.jsx(Or,{table:Y,hasGlobalFilter:t,filterButtons:P,searchPlaceholder:"Search Accounts",itemsLabel:"Accounts",bordered:!0,emptyMessage:m||b?"Loading...":"No accounts found"})]})},wJ=()=>d.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 2 of 5: Connect Firm Text Messaging Accounts"}),d.jsx("p",{className:"mb-10",children:"Search or select an employee below to set up their archived mobile data. By sending a request, they will get an email as well as a ToDo List item prompting them to connect their device."})]}),d.jsx(AJ,{hasRowSelection:!0}),d.jsx(vr,{prevLink:"/setup/mobile",prevProgress:6,nextLink:"/setup/mobile/review-frequency-and-size",nextProgress:7})]}),Xy={PENDING:1,CONNECTED:2,DISCONNECTED:3},rj=e=>{switch(e){case Xy.PENDING:return{status:"pending",statusTitle:"Pending"};case Xy.CONNECTED:return{status:"active",statusTitle:"Active"};case Xy.DISCONNECTED:default:return{status:"inactive",statusTitle:"N/A"}}},N0=()=>({queryKey:["accountconnections"],queryFn:()=>yt.executeRequest("/mobilechannelconnections/connection","GET")}),EJ=()=>At({mutationFn:e=>yt.executeRequest("/imessages","POST",e),onSuccess:(e,t)=>{}}),SJ=()=>At({mutationFn:e=>yt.executeRequest("/whatsapp","POST",e),onSuccess:(e,t)=>{}});function Al(e){return typeof e=="string"||e instanceof String}function ij(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function lL(e,t){return Array.isArray(t)?lL(e,(n,r)=>t.includes(r)):Object.entries(e).reduce((n,r)=>{let[i,s]=r;return t(s,i)&&(n[i]=s),n},{})}const Qt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function CJ(e){switch(e){case Qt.LEFT:return Qt.FORCE_LEFT;case Qt.RIGHT:return Qt.FORCE_RIGHT;default:return e}}function Zy(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function n0(e,t){if(t===e)return!0;const n=Array.isArray(t),r=Array.isArray(e);let i;if(n&&r){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!n0(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){const s=t instanceof Date,o=e instanceof Date;if(s&&o)return t.getTime()==e.getTime();if(s!=o)return!1;const u=t instanceof RegExp,c=e instanceof RegExp;if(u&&c)return t.toString()==e.toString();if(u!=c)return!1;const m=Object.keys(t);for(i=0;i<m.length;i++)if(!Object.prototype.hasOwnProperty.call(e,m[i]))return!1;for(i=0;i<m.length;i++)if(!n0(e[m[i]],t[m[i]]))return!1;return!0}else if(t&&e&&typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();return!1}class RJ{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Qt.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Qt.RIGHT:Qt.LEFT}}function sn(e,t){return new sn.InputMask(e,t)}function uL(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?sn.MaskedRegExp:Al(e)?sn.MaskedPattern:e===Date?sn.MaskedDate:e===Number?sn.MaskedNumber:Array.isArray(e)||e===Array?sn.MaskedDynamic:sn.Masked&&e.prototype instanceof sn.Masked?e:sn.Masked&&e instanceof sn.Masked?e.constructor:e instanceof Function?sn.MaskedFunction:(console.warn("Mask not found for mask",e),sn.Masked)}function Sm(e){if(!e)throw new Error("Options in not defined");if(sn.Masked){if(e.prototype instanceof sn.Masked)return{mask:e};const{mask:t=void 0,...n}=e instanceof sn.Masked?{mask:e}:ij(e)&&e.mask instanceof sn.Masked?e:{};if(t){const r=t.mask;return{...lL(t,(i,s)=>!s.startsWith("_")),mask:t.constructor,_mask:r,...n}}}return ij(e)?{...e}:{mask:e}}function vo(e){if(sn.Masked&&e instanceof sn.Masked)return e;const t=Sm(e),n=uL(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}sn.createMask=vo;class $R{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch(n){}return t!=null?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch(n){}return t!=null?t:this.value.length}select(t,n){if(!(t==null||n==null||t===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(t,n)}catch(r){}}get isActive(){return!1}}sn.MaskElement=$R;const aj=90,OJ=89;class B0 extends $R{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,n,r;return(t=(n=(r=this.input).getRootNode)==null?void 0:n.call(r))!=null?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){if(this._handlers.redo&&(t.keyCode===aj&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===OJ&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===aj&&(t.metaKey||t.ctrlKey))return t.preventDefault(),this._handlers.undo(t);t.isComposing||this._handlers.selectionChange(t)}_onBeforeinput(t){if(t.inputType==="historyUndo"&&this._handlers.undo)return t.preventDefault(),this._handlers.undo(t);if(t.inputType==="historyRedo"&&this._handlers.redo)return t.preventDefault(),this._handlers.redo(t)}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}sn.HTMLMaskElement=B0;class MJ extends B0{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,n){this.input.setSelectionRange(t,n)}get value(){return this.input.value}set value(t){this.input.value=t}}sn.HTMLMaskElement=B0;class cL extends B0{get _unsafeSelectionStart(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r<i?r:i}get _unsafeSelectionEnd(){const t=this.rootElement,n=t.getSelection&&t.getSelection(),r=n&&n.anchorOffset,i=n&&n.focusOffset;return i==null||r==null||r>i?r:i}_unsafeSelect(t,n){if(!this.rootElement.createRange)return;const r=this.rootElement.createRange();r.setStart(this.input.firstChild||this.input,t),r.setEnd(this.input.lastChild||this.input,n);const i=this.rootElement,s=i.getSelection&&i.getSelection();s&&(s.removeAllRanges(),s.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}sn.HTMLContenteditableMaskElement=cL;class k0{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>k0.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}k0.MAX_LENGTH=100;class DJ{constructor(t,n){this.el=t instanceof $R?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new cL(t):new MJ(t),this.masked=vo(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new k0,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var n;return t==null||((n=this.masked)==null?void 0:n.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof sn.Masked)&&this.masked.constructor===uL(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof sn.Masked?t:vo({mask:t});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,n){const r=this._listeners[t];r&&r.forEach(i=>i(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){!this.el||!this.el.isActive||(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const n=this.masked.unmaskedValue,r=this.masked.value,i=this.masked.rawInputValue,s=this.displayValue,o=this.unmaskedValue!==n||this.value!==r||this._rawInputValue!==i;this._unmaskedValue=n,this._value=r,this._rawInputValue=i,this.el.value!==s&&(this.el.value=s),t==="auto"?this.alignCursor():t!=null&&(this.cursorPos=t),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:n,...r}=t,i=!this.maskEquals(n),s=this.masked.optionsIsChanged(r);i&&(this.mask=n),s&&this.masked.updateOptions(r),(i||s)&&this.updateControl()}updateCursor(t){t!=null&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Qt.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,n){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(n),this}off(t,n){if(!this._listeners[t])return this;if(!n)return delete this._listeners[t],this;const r=this._listeners[t].indexOf(n);return r>=0&&this._listeners[t].splice(r,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const n=new RJ({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),r=this.masked.rawInputValue,i=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,s=r===this.masked.rawInputValue?n.removeDirection:Qt.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,s);s!==Qt.NONE&&(o=this.masked.nearestInputPos(o,Qt.NONE)),this.updateControl(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}sn.InputMask=DJ;class mn{static normalize(t){return Array.isArray(t)?t:[t,new mn]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}sn.ChangeDetails=mn;class ps{constructor(t,n,r){t===void 0&&(t=""),n===void 0&&(n=0),this.value=t,this.from=n,this.stop=r}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||t!=null&&this.from>=t)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class Ri{constructor(t){this._value="",this._update({...Ri.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,n){n===void 0&&(n={input:!0}),this.reset(),this.append(t,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,n){return t}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(t,n)}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ps(this.extractInput(t,n),t)}appendTail(t){return Al(t)&&(t=new ps(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new mn({inserted:t,rawInserted:t})):new mn}_appendChar(t,n,r){n===void 0&&(n={});const i=this.state;let s;if([t,s]=this.doPrepareChar(t,n),t&&(s=s.aggregate(this._appendCharRaw(t,n)),!s.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=i;let u=this.pad(n);const c=this._appendCharRaw(t,n);u=u.aggregate(c),c.rawInserted||u.equals(s)?s=u:this.state=o}if(s.inserted){let o,u=this.doValidate(n)!==!1;if(u&&r!=null){const c=this.state;if(this.overwrite===!0){o=r.state;for(let v=0;v<s.rawInserted.length;++v)r.unshift(this.displayValue.length-s.tailShift)}let m=this.appendTail(r);if(u=m.rawInserted.length===r.toString().length,!(u&&m.inserted)&&this.overwrite==="shift"){this.state=c,o=r.state;for(let v=0;v<s.rawInserted.length;++v)r.shift();m=this.appendTail(r),u=m.rawInserted.length===r.toString().length}u&&m.inserted&&(this.state=c)}u||(s=new mn,this.state=i,r&&o&&(r.state=o))}return s}_appendPlaceholder(){return new mn}_appendEager(){return new mn}append(t,n,r){if(!Al(t))throw new Error("value should be string");const i=Al(r)?new ps(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let s;[t,s]=this.doPrepare(t,n);for(let o=0;o<t.length;++o){const u=this._appendChar(t[o],n,i);if(!u.rawInserted&&!this.doSkipInvalid(t[o],n,i))break;s.aggregate(u)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&s.aggregate(this._appendEager()),i!=null&&(s.tailShift+=this.appendTail(i).tailShift),s}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(n),new mn}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const n=this.rawInputValue,r=this.value,i=t();return this.rawInputValue=n,this.value&&this.value!==r&&r.indexOf(this.value)===0&&(this.append(r.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const n=this.state,r=t(this);return this.state=n,delete this._isolated,r}doSkipInvalid(t,n,r){return!!this.skipInvalid}doPrepare(t,n){return n===void 0&&(n={}),mn.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),mn.normalize(this.prepareChar?this.prepareChar(t,this,n):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,n,r,i,s){r===void 0&&(r=""),i===void 0&&(i=Qt.NONE),s===void 0&&(s={input:!0});const o=t+n,u=this.extractTail(o),c=this.eager===!0||this.eager==="remove";let m;c&&(i=CJ(i),m=this.extractInput(0,o,{raw:!0}));let v=t;const g=new mn;if(i!==Qt.NONE&&(v=this.nearestInputPos(t,n>1&&t!==0&&!c?Qt.NONE:i),g.tailShift=v-t),g.aggregate(this.remove(v)),c&&i!==Qt.NONE&&m===this.rawInputValue)if(i===Qt.FORCE_LEFT){let b;for(;m===this.rawInputValue&&(b=this.displayValue.length);)g.aggregate(new mn({tailShift:-1})).aggregate(this.remove(b-1))}else i===Qt.FORCE_RIGHT&&u.unshift();return g.aggregate(this.append(r,s,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!n0(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||Ri.EMPTY_VALUES.includes(t)&&Ri.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new mn}}Ri.DEFAULTS={skipInvalid:!0};Ri.EMPTY_VALUES=[void 0,null,""];sn.Masked=Ri;class Cu{constructor(t,n){t===void 0&&(t=[]),n===void 0&&(n=0),this.chunks=t,this.from=n}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=Al(t)?new ps(String(t)):t;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof ps)r?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof Cu){if(t.stop==null){let i;for(;t.chunks.length&&t.chunks[0].stop==null;)i=t.chunks.shift(),i.from+=t.from,this.extend(i)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof sn.MaskedPattern))return new ps(this.toString()).appendTo(t);const n=new mn;for(let r=0;r<this.chunks.length;++r){const i=this.chunks[r],s=t._mapPosToBlock(t.displayValue.length),o=i.stop;let u;if(o!=null&&(!s||s.index<=o)&&((i instanceof Cu||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),u=i instanceof Cu&&t._blocks[o]),u){const c=u.appendTail(i);n.aggregate(c);const m=i.toString().slice(c.rawInserted.length);m&&n.aggregate(t.append(m,{tail:!0}))}else n.aggregate(t.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:n,...r}=t;Object.assign(this,r),this.chunks=n.map(i=>{const s="chunks"in i?new Cu:new ps;return s.state=i,s})}unshift(t){if(!this.chunks.length||t!=null&&this.from>=t)return"";const n=t!=null?t-this.from:t;let r=0;for(;r<this.chunks.length;){const i=this.chunks[r],s=i.unshift(n);if(i.toString()){if(!s)break;++r}else this.chunks.splice(r,1);if(s)return s}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const n=this.chunks[t],r=n.shift();if(n.toString()){if(!r)break;--t}else this.chunks.splice(t,1);if(r)return r}return""}}class IJ{constructor(t,n){this.masked=t,this._log=[];const{offset:r,index:i}=t._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=r,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Qt.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Qt.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Qt.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Qt.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Qt.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Qt.NONE),!0})}}class dL{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(n),this._value||(this._isRawInput=!1),new mn}nearestInputPos(t,n){n===void 0&&(n=Qt.NONE);const r=0,i=this._value.length;switch(n){case Qt.LEFT:case Qt.FORCE_LEFT:return r;case Qt.NONE:case Qt.RIGHT:case Qt.FORCE_RIGHT:default:return i}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),this._isRawInput?n-t:0}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this._value.length),r===void 0&&(r={}),r.raw&&this._isRawInput&&this._value.slice(t,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new mn;const r=this.eager===!0||this.eager==="append",s=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!r)&&!n.tail,o=new mn({inserted:this.char,rawInserted:s?this.char:""});return this._value=this.char,this._isRawInput=s&&(n.raw||n.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new mn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new ps("")}appendTail(t){return Al(t)&&(t=new ps(String(t))),t.appendTo(this)}append(t,n,r){const i=this._appendChar(t[0],n);return r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=!!t._rawInputValue}pad(t){return this._appendPlaceholder()}}class r0{constructor(t){const{parent:n,isOptional:r,placeholderChar:i,displayChar:s,lazy:o,eager:u,...c}=t;this.masked=vo(c),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:s,lazy:o,eager:u})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),t===0&&n>=1?(this.isFilled=!1,this.masked.remove(t,n)):new mn}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(t,n){if(n===void 0&&(n={}),this.isFilled)return new mn;const r=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new mn,this.masked.state=r),!i.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(t,n,r){return this.masked.append(t,this.currentMaskFlags(n),r)}_appendPlaceholder(){return this.isFilled||this.isOptional?new mn:(this.isFilled=!0,new mn({inserted:this.placeholderChar}))}_appendEager(){return new mn}extractTail(t,n){return this.masked.extractTail(t,n)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.masked.extractInput(t,n,r)}nearestInputPos(t,n){n===void 0&&(n=Qt.NONE);const r=0,i=this.value.length,s=Math.min(Math.max(t,r),i);switch(n){case Qt.LEFT:case Qt.FORCE_LEFT:return this.isComplete?s:r;case Qt.RIGHT:case Qt.FORCE_RIGHT:return this.isComplete?s:i;case Qt.NONE:default:return s}}totalInputPositions(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.value.length),this.value.slice(t,n).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var n;return{...t,_beforeTailState:(t==null||(n=t._beforeTailState)==null?void 0:n.masked)||(t==null?void 0:t._beforeTailState)}}pad(t){return new mn}}r0.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class PJ extends Ri{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=r=>r.search(n)>=0),super._update(t)}}sn.MaskedRegExp=PJ;class Oi extends Ri{constructor(t){super({...Oi.DEFAULTS,...t,definitions:Object.assign({},r0.DEFAULT_DEFINITIONS,t==null?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!t)return;let r=!1,i=!1;for(let s=0;s<n.length;++s){if(this.blocks){const m=n.slice(s),v=Object.keys(this.blocks).filter(b=>m.indexOf(b)===0);v.sort((b,y)=>y.length-b.length);const g=v[0];if(g){const{expose:b,repeat:y,...x}=Sm(this.blocks[g]),A={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...x,repeat:y,parent:this},w=y!=null?new sn.RepeatBlock(A):vo(A);w&&(this._blocks.push(w),b&&(this.exposeBlock=w),this._maskedBlocks[g]||(this._maskedBlocks[g]=[]),this._maskedBlocks[g].push(this._blocks.length-1)),s+=g.length-1;continue}}let o=n[s],u=o in t;if(o===Oi.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===Oi.ESCAPE_CHAR){if(++s,o=n[s],!o)break;u=!1}const c=u?new r0({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Sm(t[o]),parent:this}):new dL({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t){this.reset();return}const{_blocks:n,...r}=t;this._blocks.forEach((i,s)=>i.state=n[s]),super.state=r}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,n)=>t+=n.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(n),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,n)=>t+=n.value,"")}set value(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(n),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(n),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,n)=>t+=n.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const n=new mn;let r=(t=this._mapPosToBlock(this.displayValue.length))==null?void 0:t.index;if(r==null)return n;this._blocks[r].isFilled&&++r;for(let i=r;i<this._blocks.length;++i){const s=this._blocks[i]._appendEager();if(!s.inserted)break;n.aggregate(s)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new mn;if(!r)return i;for(let o=r.index,u;u=this._blocks[o];++o){var s;const c=u._appendChar(t,{...n,_beforeTailState:(s=n._beforeTailState)==null||(s=s._blocks)==null?void 0:s[o]});if(i.aggregate(c),c.consumed)break}return i}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=new Cu;return t===n||this._forEachBlocksInRange(t,n,(i,s,o,u)=>{const c=i.extractTail(o,u);c.stop=this._findStopBefore(s),c.from=this._blockStartPos(s),c instanceof Cu&&(c.blockIndex=s),r.extend(c)}),r}extractInput(t,n,r){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),r===void 0&&(r={}),t===n)return"";let i="";return this._forEachBlocksInRange(t,n,(s,o,u,c)=>{i+=s.extractInput(u,c,r)}),i}_findStopBefore(t){let n;for(let r=0;r<this._stops.length;++r){const i=this._stops[r];if(i<=t)n=i;else break}return n}_appendPlaceholder(t){const n=new mn;if(this.lazy&&t==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,s=t!=null?t:this._blocks.length;return this._blocks.slice(i,s).forEach(o=>{if(!o.lazy||t!=null){var u;n.aggregate(o._appendPlaceholder((u=o._blocks)==null?void 0:u.length))}}),n}_mapPosToBlock(t){let n="";for(let r=0;r<this._blocks.length;++r){const i=this._blocks[r],s=n.length;if(n+=i.displayValue,t<=n.length)return{index:r,offset:t-s}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((n,r)=>n+=r.displayValue.length,0)}_forEachBlocksInRange(t,n,r){n===void 0&&(n=this.displayValue.length);const i=this._mapPosToBlock(t);if(i){const s=this._mapPosToBlock(n),o=s&&i.index===s.index,u=i.offset,c=s&&o?s.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,u,c),s&&!o){for(let m=i.index+1;m<s.index;++m)r(this._blocks[m],m,0,this._blocks[m].displayValue.length);r(this._blocks[s.index],s.index,0,s.offset)}}}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._forEachBlocksInRange(t,n,(i,s,o,u)=>{r.aggregate(i.remove(o,u))}),r}nearestInputPos(t,n){if(n===void 0&&(n=Qt.NONE),!this._blocks.length)return 0;const r=new IJ(this,t);if(n===Qt.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Qt.LEFT||n===Qt.FORCE_LEFT){if(n===Qt.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Qt.LEFT){if(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.ok&&r.pos<=t||(r.popState(),r.ok&&r.pos<=t))return r.pos;r.popState()}return r.ok?r.pos:n===Qt.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Qt.RIGHT||n===Qt.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Qt.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,Qt.LEFT))):t}totalInputPositions(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);let r=0;return this._forEachBlocksInRange(t,n,(i,s,o,u)=>{r+=i.totalInputPositions(o,u)}),r}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const n=this._maskedBlocks[t];return n?n.map(r=>this._blocks[r]):[]}pad(t){const n=new mn;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(t))),n}}Oi.DEFAULTS={...Ri.DEFAULTS,lazy:!0,placeholderChar:"_"};Oi.STOP_CHAR="`";Oi.ESCAPE_CHAR="\\";Oi.InputDefinition=r0;Oi.FixedDefinition=dL;sn.MaskedPattern=Oi;class Lv extends Oi{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:n=this.to||0,from:r=this.from||0,maxLength:i=this.maxLength||0,autofix:s=this.autofix,...o}=t;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=s;const u=String(this.from).padStart(this.maxLength,"0"),c=String(this.to).padStart(this.maxLength,"0");let m=0;for(;m<c.length&&c[m]===u[m];)++m;o.mask=c.slice(0,m).replace(/0/g,"\\0")+"0".repeat(this.maxLength-m),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(t){let n="",r="";const[,i,s]=t.match(/^(\D*)(\d*)(\D*)/)||[];return s&&(n="0".repeat(i.length)+s,r="9".repeat(i.length)+s),n=n.padEnd(this.maxLength,"0"),r=r.padEnd(this.maxLength,"9"),[n,r]}doPrepareChar(t,n){n===void 0&&(n={});let r;return[t,r]=super.doPrepareChar(t.replace(/\D/g,""),n),t||(r.skip=!this.isComplete),[t,r]}_appendCharRaw(t,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,n);const r=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[s,o]=this.boundaries(this.value+t);return Number(o)<this.from?super._appendCharRaw(r[this.value.length],n):Number(s)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(r[this.value.length],n).aggregate(this._appendCharRaw(t,n)):super._appendCharRaw(i[this.value.length],n):super._appendCharRaw(t,n)}doValidate(t){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,s]=this.boundaries(n);return this.from<=Number(s)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const n=new mn;if(this.value.length===this.maxLength)return n;const r=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let s=0;s<i;++s)n.aggregate(super._appendCharRaw("0",t));r.split("").forEach(s=>this._appendCharRaw(s))}return n}}sn.MaskedRange=Lv;const jJ="d{.}`m{.}`Y";class lo extends Oi{static extractPatternOptions(t){const{mask:n,pattern:r,...i}=t;return{...i,mask:Al(n)?n:r}}constructor(t){super(lo.extractPatternOptions({...lo.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:r,blocks:i,...s}={...lo.DEFAULTS,...t},o=Object.assign({},lo.GET_DEFAULT_BLOCKS());t.min&&(o.Y.from=t.min.getFullYear()),t.max&&(o.Y.to=t.max.getFullYear()),t.min&&t.max&&o.Y.from===o.Y.to&&(o.m.from=t.min.getMonth()+1,o.m.to=t.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=t.min.getDate(),o.d.to=t.max.getDate())),Object.assign(o,this.blocks,i),super._update({...s,mask:Al(n)?n:r,blocks:o})}doValidate(t){const n=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(lo.extractPatternOptions(t))}}lo.GET_DEFAULT_BLOCKS=()=>({d:{mask:Lv,from:1,to:31,maxLength:2},m:{mask:Lv,from:1,to:12,maxLength:2},Y:{mask:Lv,from:1900,to:9999}});lo.DEFAULTS={...Oi.DEFAULTS,mask:Date,pattern:jJ,format:(e,t)=>{if(!e)return"";const n=String(e.getDate()).padStart(2,"0"),r=String(e.getMonth()+1).padStart(2,"0"),i=e.getFullYear();return[n,r,i].join(".")},parse:(e,t)=>{const[n,r,i]=e.split(".").map(Number);return new Date(i,r-1,n)}};sn.MaskedDate=lo;class L0 extends Ri{constructor(t){super({...L0.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(n=>{const{expose:r,...i}=Sm(n),s=vo({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=s),s}):[])}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._applyDispatch(t,n);return this.currentMask&&r.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(n))),r}_applyDispatch(t,n,r){t===void 0&&(t=""),n===void 0&&(n={}),r===void 0&&(r="");const i=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,s=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:s,u=s.slice(o.length),c=this.currentMask,m=new mn,v=c==null?void 0:c.state;return this.currentMask=this.doDispatch(t,{...n},r),this.currentMask&&(this.currentMask!==c?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),m.tailShift=this.currentMask.value.length-i.length),u&&(m.tailShift+=this.currentMask.append(u,{raw:!0,tail:!0}).tailShift)):v&&(this.currentMask.state=v)),m}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const n=new mn;return t&&n.aggregate(this._applyDispatch("",{},t)),n.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var n,r;return{...t,_beforeTailState:((n=t._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((r=t._beforeTailState)==null?void 0:r.currentMask)||t._beforeTailState}}doDispatch(t,n,r){return n===void 0&&(n={}),r===void 0&&(r=""),this.dispatch(t,this,n,r)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,n){n===void 0&&(n={});let[r,i]=super.doPrepare(t,n);if(this.currentMask){let s;[r,s]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(s)}return[r,i]}doPrepareChar(t,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(t,n);if(this.currentMask){let s;[r,s]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(s)}return[r,i]}reset(){var t;(t=this.currentMask)==null||t.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask){this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(t);this.currentMask&&(this.currentMask.typedValue=t,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return!!((t=this.currentMask)!=null&&t.isComplete)}get isFilled(){var t;return!!((t=this.currentMask)!=null&&t.isFilled)}remove(t,n){const r=new mn;return this.currentMask&&r.aggregate(this.currentMask.remove(t,n)).aggregate(this._applyDispatch()),r}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(t=this.currentMask)==null?void 0:t.state}}set state(t){const{compiledMasks:n,currentMaskRef:r,currentMask:i,...s}=t;n&&this.compiledMasks.forEach((o,u)=>o.state=n[u]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=s}extractInput(t,n,r){return this.currentMask?this.currentMask.extractInput(t,n,r):""}extractTail(t,n){return this.currentMask?this.currentMask.extractTail(t,n):super.extractTail(t,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,n){return this.currentMask?this.currentMask.nearestInputPos(t,n):super.nearestInputPos(t,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((n,r)=>{if(!t[r])return;const{mask:i,...s}=t[r];return n0(n,s)&&n.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}L0.DEFAULTS={...Ri.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,s=t.compiledMasks.map((o,u)=>{const c=t.currentMask===o,m=c?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Qt.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):c||o.remove(m),o.append(e,t.currentMaskFlags(n)),o.appendTail(r),{index:u,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(m,o.nearestInputPos(o.displayValue.length,Qt.FORCE_LEFT)))}});return s.sort((o,u)=>u.weight-o.weight||u.totalInputPositions-o.totalInputPositions),t.compiledMasks[s[0].index]}};sn.MaskedDynamic=L0;class F0 extends Oi{constructor(t){super({...F0.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...r}=t;if(n){const i=n.map(u=>u.length),s=Math.min(...i),o=Math.max(...i)-s;r.mask="*".repeat(s),o&&(r.mask+="["+"*".repeat(o)+"]"),this.enum=n}super._update(r)}_appendCharRaw(t,n){n===void 0&&(n={});const r=Math.min(this.nearestInputPos(0,Qt.FORCE_RIGHT),this.value.length),i=this.enum.filter(s=>this.matchValue(s,this.unmaskedValue+t,r));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,u)=>{const c=i[0][u];u>=this.value.length||c===o.value||(o.reset(),o._appendChar(c,n))});const s=super._appendCharRaw(i[0][this.value.length],n);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(o=>s.aggregate(super._appendCharRaw(o))),s}return new mn({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new ps("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new mn;const r=Math.min(super.nearestInputPos(0,Qt.FORCE_RIGHT),this.value.length);let i;for(i=t;i>=0&&!(this.enum.filter(u=>this.matchValue(u,this.value.slice(r,i),r)).length>1);--i);const s=super.remove(i,n);return s.tailShift+=i-t,s}get isComplete(){return this.enum.indexOf(this.value)>=0}}F0.DEFAULTS={...Oi.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n};sn.MaskedEnum=F0;class TJ extends Ri{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}sn.MaskedFunction=TJ;var fL;class ua extends Ri{constructor(t){super({...ua.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+Zy(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Zy).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Zy(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const n=t.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(t,n){n===void 0&&(n={});const[r,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),n);return t&&!r&&(i.skip=!0),r&&!this.allowPositive&&!this.value&&r!=="-"&&i.aggregate(this._appendChar("-")),[r,i]}_separatorsCount(t,n){n===void 0&&(n=!1);let r=0;for(let i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++r,n&&(t+=this.thousandsSeparator.length));return r}_separatorsCountFromSlice(t){return t===void 0&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,n,r){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n),this._removeThousandsSeparators(super.extractInput(t,n,r))}_appendCharRaw(t,n){n===void 0&&(n={});const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);const s=this._value;this._value+=t;const o=this.number;let u=!isNaN(o),c=!1;if(u){let b;this.min!=null&&this.min<0&&this.number<this.min&&(b=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(b=this.max),b!=null&&(this.autofix?(this._value=this.format(b,this).replace(ua.UNMASKED_RADIX,this.radix),c||(c=s===this._value&&!n.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let m;u?m=new mn({inserted:this._value.slice(s.length),rawInserted:c?"":t,skip:c}):(this._value=s,m=new mn),this._value=this._insertThousandsSeparators(this._value);const v=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,g=this._separatorsCountFromSlice(v);return m.tailShift+=(g-i)*this.thousandsSeparator.length,m}_findSeparatorAround(t){if(this.thousandsSeparator){const n=t-this.thousandsSeparator.length+1,r=this.value.indexOf(this.thousandsSeparator,n);if(r<=t)return r}return-1}_adjustRangeWithSeparators(t,n){const r=this._findSeparatorAround(t);r>=0&&(t=r);const i=this._findSeparatorAround(n);return i>=0&&(n=i+this.thousandsSeparator.length),[t,n]}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),[t,n]=this._adjustRangeWithSeparators(t,n);const r=this.value.slice(0,t),i=this.value.slice(n),s=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new mn({tailShift:(o-s)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case Qt.NONE:case Qt.LEFT:case Qt.FORCE_LEFT:{const r=this._findSeparatorAround(t-1);if(r>=0){const i=r+this.thousandsSeparator.length;if(t<i||this.value.length<=i||n===Qt.FORCE_LEFT)return r}break}case Qt.RIGHT:case Qt.FORCE_RIGHT:{const r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let n=t;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==t&&(this.unmaskedValue=this.format(n,this));let r=this.value;this.normalizeZeros&&(r=this._normalizeZeros(r)),this.padFractionalZeros&&this.scale>0&&(r=this._padFractionalZeros(r)),this._value=r}super.doCommit()}_normalizeZeros(t){const n=this._removeThousandsSeparators(t).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(r,i,s,o)=>i+o),t.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const n=t.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(t,n,r){n===void 0&&(n={});const i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===ua.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ua.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ua.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ua.EMPTY_VALUES.includes(t)&&ua.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}fL=ua;ua.UNMASKED_RADIX=".";ua.EMPTY_VALUES=[...Ri.EMPTY_VALUES,0];ua.DEFAULTS={...Ri.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[fL.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};sn.MaskedNumber=ua;const QC={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function hL(e,t,n){t===void 0&&(t=QC.MASKED),n===void 0&&(n=QC.MASKED);const r=vo(e);return i=>r.runIsolated(s=>(s[t]=i,s[n]))}function _J(e,t,n,r){return hL(t,n,r)(e)}sn.PIPE_TYPE=QC;sn.createPipe=hL;sn.pipe=_J;class NJ extends Oi{get repeatFrom(){var t;return(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?t:0}get repeatTo(){var t;return(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var n,r,i;const{repeat:s,...o}=Sm(t);this._blockOpts=Object.assign({},this._blockOpts,o);const u=vo(this._blockOpts);this.repeat=(n=(r=s!=null?s:u.repeat)!=null?r:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:u},eager:u.eager,overwrite:u.overwrite,skipInvalid:u.skipInvalid,lazy:u.lazy,placeholderChar:u.placeholderChar,displayChar:u.displayChar})}_allocateBlock(t){if(t<this._blocks.length)return this._blocks[t];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(vo(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const r=new mn;for(let c=(i=(s=this._mapPosToBlock(this.displayValue.length))==null?void 0:s.index)!=null?i:Math.max(this._blocks.length-1,0),m,v;m=(o=this._blocks[c])!=null?o:v=!v&&this._allocateBlock(c);++c){var i,s,o,u;const g=m._appendChar(t,{...n,_beforeTailState:(u=n._beforeTailState)==null||(u=u._blocks)==null?void 0:u[c]});if(g.skip&&v){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(r.aggregate(g),g.consumed)break}return r}_trimEmptyTail(t,n){var r,i;t===void 0&&(t=0);const s=Math.max(((r=this._mapPosToBlock(t))==null?void 0:r.index)||0,this.repeatFrom,0);let o;n!=null&&(o=(i=this._mapPosToBlock(n))==null?void 0:i.index),o==null&&(o=this._blocks.length-1);let u=0;for(let c=o;s<=c&&!this._blocks[c].unmaskedValue;--c,++u);u&&(this._blocks.splice(o-u+1,u),this.mask=this.mask.slice(u))}reset(){super.reset(),this._trimEmptyTail()}remove(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=super.remove(t,n);return this._trimEmptyTail(t,n),r}totalInputPositions(t,n){return t===void 0&&(t=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,n)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}}sn.RepeatBlock=NJ;try{globalThis.IMask=sn}catch(e){}const mL={mask:ue.oneOfType([ue.array,ue.func,ue.string,ue.instanceOf(RegExp),ue.oneOf([Date,Number,sn.Masked]),ue.instanceOf(sn.Masked)]),value:ue.any,unmask:ue.oneOfType([ue.bool,ue.oneOf(["typed"])]),prepare:ue.func,prepareChar:ue.func,validate:ue.func,commit:ue.func,overwrite:ue.oneOfType([ue.bool,ue.oneOf(["shift"])]),eager:ue.oneOfType([ue.bool,ue.oneOf(["append","remove"])]),skipInvalid:ue.bool,onAccept:ue.func,onComplete:ue.func,placeholderChar:ue.string,displayChar:ue.string,lazy:ue.bool,definitions:ue.object,blocks:ue.object,enum:ue.arrayOf(ue.string),maxLength:ue.number,from:ue.number,to:ue.number,pattern:ue.string,format:ue.func,parse:ue.func,autofix:ue.oneOfType([ue.bool,ue.oneOf(["pad"])]),radix:ue.string,thousandsSeparator:ue.string,mapToRadix:ue.arrayOf(ue.string),scale:ue.number,normalizeZeros:ue.bool,padFractionalZeros:ue.bool,min:ue.oneOfType([ue.number,ue.instanceOf(Date)]),max:ue.oneOfType([ue.number,ue.instanceOf(Date)]),dispatch:ue.func,inputRef:ue.oneOfType([ue.func,ue.shape({current:ue.object})])},gL=Object.keys(mL).filter(e=>e!=="value"),BJ=["value","unmask","onAccept","onComplete","inputRef"],kJ=gL.filter(e=>BJ.indexOf(e)<0);function LJ(e){var t;const n=(t=class extends tt.Component{constructor(s){super(s),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const s=this.props,o=this._extractMaskOptionsFromProps(s);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in s&&s.value!==void 0&&(this.maskValue=s.value)):this.initMask(o);else if(this.destroyMask(),"value"in s&&s.value!==void 0){var u;(u=this.element)!=null&&u.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=s.value:this.element.value=s.value}}componentWillUnmount(){this.destroyMask()}_inputRef(s){this.element=s,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=s:this.props.inputRef(s))}initMask(s){s===void 0&&(s=this._extractMaskOptionsFromProps(this.props)),this.maskRef=sn(this.element,s).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(s){const{...o}=s;return Object.keys(o).filter(u=>kJ.indexOf(u)<0).forEach(u=>{delete o[u]}),o}_extractNonMaskProps(s){const{...o}=s;return gL.forEach(u=>{u!=="maxLength"&&delete o[u]}),"defaultValue"in o||(o.defaultValue=s.mask?"":o.value),delete o.value,o}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(s){this.maskRef&&(s=s==null&&this.props.unmask!=="typed"?"":s,this.props.unmask==="typed"?this.maskRef.typedValue=s:this.props.unmask?this.maskRef.unmaskedValue=s:this.maskRef.value=s)}_onAccept(s){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,s)}_onComplete(s){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,s)}render(){return tt.createElement(e,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},t.displayName=void 0,t.propTypes=void 0,t),r=e.displayName||e.name||"Component";return n.displayName="IMask("+r+")",n.propTypes=mL,tt.forwardRef((i,s)=>tt.createElement(n,{...i,ref:s}))}const FJ=LJ(e=>{let{inputRef:t,...n}=e;return tt.createElement("input",{...n,ref:t})}),qJ=(e,t)=>tt.createElement(FJ,{...e,ref:t}),pL=tt.forwardRef(qJ),zJ=({setShowWhatsappDialog:e})=>{const[t,n]=N.useState(null),r=SJ(),i=rn(),s=()=>{if(!nL(t))return Ie.error("Please enter a valid phone number.",{id:"invalid-phone"});r.mutate({email:null,phoneNumber:t},{onSuccess:()=>{i.invalidateQueries(N0()),Ie.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"whatsapp-success"}),e(!1)},onError:o=>{Ie.error(`There was an error processing your request: ${(o==null?void 0:o.message)||"Unknown error"}`,{id:"whatsapp-error"})}})};return d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Connect Your WhatsApp Account"}),d.jsx("div",{className:"text-md text-brand",children:"Enter the number associated with your WhatsApp account below."}),d.jsx("label",{htmlFor:"",className:"text-brand block mt-5 !mb-0",children:"Phone Number with Country Code"}),d.jsx(pL,{onAccept:(o,u)=>{n(u.unmaskedValue)},mask:[{mask:"+1 (000) 000-0000",startsWith:"+1",country:"US"},{mask:"+{0}000000000000000",startsWith:"+",country:"INTL"}],dispatch:(o,u)=>(u.value+o).replace(/\D/g,"").startsWith("1")?u.compiledMasks.find(m=>m.country==="US"):u.compiledMasks.find(m=>m.country==="INTL"),placeholder:"XX - (XXX) - XXX - XXXX",className:"!mb-10 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none"}),d.jsxs("div",{className:"flex justify-end",children:[d.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue",onClick:()=>s(),disabled:r.isPending,children:r.isPending?d.jsx(zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},QJ=({setShowMessageDialog:e})=>{const[t,n]=N.useState(null),r=N.useRef(null),i=EJ(),s=rn(),o=()=>{var u,c;if(!T0((u=r==null?void 0:r.current)==null?void 0:u.value))return Ie.error("Please enter a valid email.",{id:"invalid-icloud-email"});if(!nL(t))return Ie.error("Please enter a valid phone number.",{id:"invalid-phone"});i.mutate({email:(c=r==null?void 0:r.current)==null?void 0:c.value,phoneNumber:t},{onSuccess:()=>{s.invalidateQueries(N0()),Ie.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"imessage-success"}),e(!1)},onError:m=>{Ie.error(`There was an error processing your request: ${(m==null?void 0:m.message)||"Unknown error"}`,{id:"imessage-error"})}})};return d.jsxs("div",{className:"p-3",children:[d.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[d.jsx(xe,{size:"medium",className:"mr-1",icon:gn})," Close"]}),d.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Connect Your iMessage Account"}),d.jsx("div",{className:"text-md text-brand",children:"Please use the email that is associated with your iCloud account."}),d.jsx("label",{htmlFor:"",className:"text-brand block mt-5 !mb-0",children:"iCloud Email"}),d.jsx("input",{type:"text",ref:r,className:"w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsx("label",{htmlFor:"",className:"text-brand block mt-5 !mb-0",children:"Phone Number with Country Code"}),d.jsx(pL,{onAccept:(u,c)=>{n(c.unmaskedValue)},mask:[{mask:"+1 (000) 000-0000",startsWith:"+1",country:"US"},{mask:"+{0}000000000000000",startsWith:"+",country:"INTL"}],dispatch:(u,c)=>(c.value+u).replace(/\D/g,"").startsWith("1")?c.compiledMasks.find(v=>v.country==="US"):c.compiledMasks.find(v=>v.country==="INTL"),placeholder:"XX - (XXX) - XXX - XXXX",className:"!mb-10 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full"}),d.jsxs("div",{className:"flex justify-end",children:[d.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),d.jsx("button",{className:"btn-blue",onClick:()=>o(),disabled:i.isPending,children:i.isPending?d.jsx(zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},HJ="data:image/png;base64,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",VJ=({classList:e=""})=>{var m,v,g,b,y,x;const[t,n]=N.useState(!1),[r,i]=N.useState(!1),{data:s,isLoading:o}=Ht(N0()),u=((m=s==null?void 0:s.iMessage)==null?void 0:m.status)&&((v=s==null?void 0:s.iMessage)==null?void 0:v.status)!=3&&((g=s==null?void 0:s.iMessage)==null?void 0:g.id)!=0,c=((b=s==null?void 0:s.whatsApp)==null?void 0:b.status)&&((y=s==null?void 0:s.whatsApp)==null?void 0:y.status)!=3&&((x=s==null?void 0:s.whatsApp)==null?void 0:x.id)!=0;return d.jsxs("div",{className:`${e}`,children:[d.jsx(Ka,{title:"",children:o?d.jsx(zt,{size:"md"}):d.jsxs(d.Fragment,{children:[d.jsxs("a",{className:`flex items-center gap-2 mb-5 cursor-pointer font-semibold ${u?"text-light-gray":"text-link-color"}`,onClick:()=>u?null:n(!0),children:[d.jsx("img",{src:HJ,className:"w-[24px] h-[24px]",alt:""}),"Connect iMessage",d.jsx(xe,{icon:u?Sn:FP,className:`${u?"text-light-gray":"text-link-color"}`,size:"small"})]}),d.jsxs("a",{className:`flex items-center gap-2 cursor-pointer font-semibold ${c?"text-light-gray":"text-link-color"}`,onClick:()=>c?null:i(!0),children:[d.jsx(xe,{icon:JG,className:"text-green-800",size:"xlarge"}),"Connect WhatsApp",d.jsx(xe,{icon:c?Sn:FP,className:`${c?"text-light-gray":"text-link-color"}`,size:"small"})]})]})}),t&&d.jsx(Yd,{title:"",width:700,onClose:()=>n(!1),children:d.jsx(QJ,{setShowMessageDialog:n})}),r&&d.jsx(Yd,{title:"",width:700,onClose:()=>i(!1),children:d.jsx(zJ,{setShowWhatsappDialog:i})})]})},YJ=({className:e=""})=>{var g,b,y,x;const{data:t,isLoading:n,isSuccess:r}=Ht(N0());Ft(A=>A.platforms);const i=er(),s=[i.accessor("name",{cell:A=>A.getValue(),header:()=>"Name",size:300}),i.accessor("imessage",{cell:A=>{const w=A.getValue();return d.jsx(Ci,{status:w})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),i.accessor("whatsapp",{cell:A=>{const w=A.getValue();return d.jsx(Ci,{status:w})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})],o=[],u=((g=t==null?void 0:t.whatsApp)==null?void 0:g.id)==0?{status:"n/a",statusTitle:"N/A"}:rj((b=t==null?void 0:t.whatsApp)==null?void 0:b.status),c=((y=t==null?void 0:t.iMessage)==null?void 0:y.id)==0?{status:"n/a",statusTitle:"N/A"}:rj((x=t==null?void 0:t.iMessage)==null?void 0:x.status),m=N.useMemo(()=>[{name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:c,whatsapp:u}],[t]),v=rr({data:m,columns:s,getCoreRowModel:tr(),getPaginationRowModel:nr(),getFilteredRowModel:ur(),getRowId:A=>A.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return d.jsxs("div",{className:`${e}`,children:[d.jsx("div",{children:d.jsx("h5",{className:"text-dark text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"})}),n?d.jsx(zt,{}):d.jsx(Or,{table:v,hasGlobalFilter:!1,filterButtons:o,searchPlaceholder:"Search Accounts",itemsLabel:"Account",bordered:!0,emptyMessage:n?"Loading...":"No accounts found"})]})},WJ=()=>d.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 1 of 5: Connect Your Text Messaging Accounts"}),d.jsx("p",{className:"mb-10",children:"COMPLY has partnered with LeapExpert to provide comprehensive text messaging archiving. Your firm will have the option to tailor how your firm would like to handle the archived records. Click on the link below to access LeapExpert and continue the setup."})]}),d.jsx(VJ,{}),d.jsx(YJ,{className:"mt-10"}),d.jsx(vr,{prevLink:"/setup/hierarchy/website-reviewers",prevProgress:5,nextLink:"/setup/mobile/firm-accounts",nextProgress:6})]}),Zo={blue:{padding:"px-5 py-2",textColor:"text-blue-900",activeTextColor:"text-white",background:"",activeBackground:"bg-blue-900",border:"border-[#b4c8d0]",horizontalBorders:!1},gray:{padding:"px-5 py-3",textColor:"",activeTextColor:"",background:"",activeBackground:"bg-[#E9E9E9]",border:"border-[#D0D5DD]",horizontalBorders:!0}},Ja=({activeChoiceId:e,choices:t,onChange:n,mode:r="blue"})=>{const i=s=>{n&&n(s)};return d.jsx("div",{className:`border ${Zo[r].border} rounded-sm flex w-fit max-w-full gap-0 overflow-clip`,children:t.map((s,o)=>d.jsx("span",{onClick:()=>i(s),className:`whitespace-nowrap ${Zo[r].padding} cursor-pointer ${Zo[r].horizontalBorders&&t.length>o+1?`border-r ${Zo[r].border}`:""} ${s.id==e?`${Zo[r].activeBackground} ${Zo[r].activeTextColor}`:`${Zo[r].background} ${Zo[r].textColor}`}`,children:s.title},o))})},UJ=[{id:50,title:"50"},{id:100,title:"100"},{id:250,title:"250"},{id:375,title:"375"},{id:500,title:"500"},{id:1e3,title:"1000"},{id:0,title:"No Limit"}],GJ=({description:e=null})=>{const t=Ft(s=>s.setAccountSettings),n=Ft(s=>s.accountSettings),r=gi(),i=At({mutationKey:["updateReviewPeriodLimit"],mutationFn:async s=>{console.log(s);const o=await r.executeRequest("/accountsettings/mobilelimit","PUT",{limit:s});if(!o||o.error)throw new Error("Error updating review period limit");return s},onSuccess:s=>{t({...n,mobileLimit:s}),Ie.success("Review period limit updated successfully")},onError:s=>{console.error("Mutation error:",s),Ie.error("Error updating review period limit")}});return d.jsxs(Ka,{title:"Set Maximum Review Period Size",children:[e&&d.jsxs("div",{children:[d.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),d.jsx("div",{className:"h-[50px]"})]}),d.jsx("h6",{className:"underlined-subtitle",children:"NUMBER OF ITEMS"}),d.jsx(Ja,{activeChoiceId:n==null?void 0:n.mobileLimit,onChange:s=>{i.mutate(s.id)},choices:UJ,disabled:i.isLoading})]})};function XJ(e,t,n,r){const i=N.useRef(null),s=N.useRef(0),o=N.useRef(0),u=N.useRef(null),c=N.useRef([]),m=N.useRef(),v=N.useRef(),g=N.useRef(e),b=N.useRef(!0);g.current=e;const y=typeof window!="undefined",x=!t&&t!==0&&y;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;const A=!!(n=n||{}).leading,w=!("trailing"in n)||!!n.trailing,C="maxWait"in n,T="debounceOnServer"in n&&!!n.debounceOnServer,M=C?Math.max(+n.maxWait||0,t):null;return N.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),N.useMemo(()=>{const E=F=>{const z=c.current,Q=m.current;return c.current=m.current=null,s.current=F,o.current=o.current||F,v.current=g.current.apply(Q,z)},I=(F,z)=>{x&&cancelAnimationFrame(u.current),u.current=x?requestAnimationFrame(F):setTimeout(F,z)},O=F=>{if(!b.current)return!1;const z=F-i.current;return!i.current||z>=t||z<0||C&&F-s.current>=M},D=F=>(u.current=null,w&&c.current?E(F):(c.current=m.current=null,v.current)),j=()=>{const F=Date.now();if(A&&o.current===s.current&&_(),O(F))return D(F);if(!b.current)return;const z=t-(F-i.current),Q=C?Math.min(z,M-(F-s.current)):z;I(j,Q)},_=()=>{r&&r({})},k=(...F)=>{if(!y&&!T)return;const z=Date.now(),Q=O(z);if(c.current=F,m.current=this,i.current=z,Q){if(!u.current&&b.current)return s.current=i.current,I(j,t),A?E(i.current):v.current;if(C)return I(j,t),E(i.current)}return u.current||I(j,t),v.current};return k.cancel=()=>{u.current&&(x?cancelAnimationFrame(u.current):clearTimeout(u.current)),s.current=0,c.current=i.current=m.current=u.current=null},k.isPending=()=>!!u.current,k.flush=()=>u.current?D(Date.now()):v.current,k},[A,C,t,M,w,x,y,T,r])}function ZJ(e,t){return e===t}function vL(e,t,n){const r=ZJ,i=N.useRef(e),[,s]=N.useState({}),o=XJ(N.useCallback(c=>{i.current=c,s({})},[s]),t,n,s),u=N.useRef(e);return r(u.current,e)||(o(e),u.current=e),[i.current,o]}const sj=[{id:0,title:"0%"},{id:1,title:"1%"},{id:2,title:"2%"},{id:3,title:"3%"},{id:4,title:"4%"},{id:5,title:"5%"},{id:10,title:"10%"},{id:15,title:"15%"},{id:20,title:"20%"},{id:25,title:"25%"}],KJ=({description:e=null})=>{const t=Ft(v=>v.setAccountSettings),n=Ft(v=>v.accountSettings),r=gi(),[i,s]=N.useState(""),[o]=vL(i,500),u=N.useRef(null),c=At({mutationFn:async v=>{const g=await r.executeRequest("/accountsettings/mobilesampling","PUT",{sampling:v});if(!g||g.error)throw new Error("Error updating sample percentage");return v},onSuccess:v=>{t({...n,mobileSampling:v}),Ie.success("Sample percentage updated successfully")},onError:()=>{Ie.error("Error updating sample percentage")}});N.useEffect(()=>{o!==""&&!isNaN(o)&&o>=0&&o<=100&&c.mutate(Number(o))},[o]),N.useEffect(()=>{sj.find(v=>v.id==(n==null?void 0:n.mobileSampling))||(u.current.value=n==null?void 0:n.mobileSampling)},[n==null?void 0:n.mobileSampling]);const m=v=>{const g=Math.floor(v.target.value);if(g<0){u.current.value=0,s(0);return}if(g>100){u.current.value=100,s(100);return}s(g)};return d.jsxs(Ka,{title:"Set Mobile Sample Percentage",children:[e&&d.jsxs("div",{children:[d.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),d.jsx("div",{className:"h-[50px]"})]}),d.jsx("h6",{className:"underlined-subtitle",children:"SAMPLE PERCENTAGE RATE"}),d.jsx(Ja,{activeChoiceId:n==null?void 0:n.mobileSampling,onChange:v=>{u.current.value="",c.mutate(v.id)},choices:sj}),d.jsx("div",{className:"h-[50px]"}),d.jsx("h6",{className:"underlined-subtitle",children:"CUSTOM PERCENTAGE RATE"}),d.jsxs("div",{children:[d.jsx("input",{className:"text-right !mb-0 w-full px-4 py-3 border !border-gray-300 rounded-md bg-white !text-blue-900 focus:outline-none w-full",type:"number",min:0,max:100,inputMode:"numeric",pattern:"[0-9]*",placeholder:"Custom Value",defaultValue:i,onChange:m,ref:u}),d.jsx("p",{className:"text-sm",children:"Enter a number or percentage"})]})]})},JJ=e=>({queryKey:["account",e],queryFn:()=>yt.executeRequest(`/accounts/${e}`,"GET")}),eO={queryKey:["settings"],queryFn:()=>yt.executeRequest("/accountsettings","GET"),retry:!1},Qm=({archivingType:e,pageType:t})=>{const n=rn();return At({mutationFn:r=>{const i={archivingType:e,pageType:t,frequency:r};return yt.executeRequest("/accountsettings","PUT",i)},onSuccess:()=>{n.invalidateQueries(eO),Ie.success("Review frequency updated!")},onError:()=>{Ie.error("Error occurred while setting review frequency")}})},$J=({description:e=null})=>{const t=Ft(r=>r.accountSettings),{mutate:n}=Qm({archivingType:"mobile",pageType:"setup"});return d.jsx("section",{className:"",children:d.jsx(Ka,{title:"Set Mobile Review Frequency",children:d.jsxs("div",{className:"",children:[e&&d.jsxs("div",{children:[d.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),d.jsx("div",{className:"h-[50px]"})]}),d.jsx("h6",{className:"underlined-subtitle uppercase",children:"REVIEW FREQUENCY"}),d.jsx(Ja,{activeChoiceId:t==null?void 0:t.mobileFrequency,onChange:r=>{n(r.id)},choices:w8})]})})})},e$=()=>d.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 3 of 5: Set Review Frequency and Size"}),d.jsx("p",{className:"mb-10",children:"Search or select an employee below to set up their archived mobile data. By sending a request, they will get an email as well as a ToDo List item prompting them to connect their device."})]}),d.jsx($J,{description:`<p>The review frequency is the frequency which you will be prompted to review your firm’s mobile messages.</p>
|
|
591
591
|
<br/><p>Your review frequency determines how often you’d like to review your communications. Once selected, your Mobile Review Compliance Calendar activity will also be set to this frequency.</p>`}),d.jsx("div",{className:"mt-10"}),d.jsx(KJ,{description:"Sample percentage determines the amount of randomly selected mobile messages that are added to your review periods. Your sample percentage rate does not include texts flagged due to keywords or by employees under heightened supervision. You can select a preset percentage or enter a specific number or percentage below."}),d.jsx("div",{className:"mt-10"}),d.jsx(GJ,{description:`<p>Use this setting to choose the maximum number of items you’d like to see in your review periods.</p>
|
|
592
592
|
<br/>
|
|
593
593
|
<p>
|