@riab/cpm-archiving 1.1.1-beta-0 → 1.1.2-beta-0
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: ${SX}`),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 Sm=class extends _.Component{constructor(t){super(t),this.context=0,this.titleId=this.generateTitleId(),this.contentId=this.generateContentId(),this.activeElement=null,this.onCloseDialog=n=>{n.preventDefault(),es(this.props.onClose,n,this,void 0)},this.onKeyDown=n=>{n.keyCode===Ln.esc&&this.props.onClose&&(n.preventDefault(),this.onCloseDialog(n)),$G(n,this.element)},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:HJ:this.state.zIndex>(this.context?this.context+mR:0)?this.state.zIndex:this.context+mR,this.getDocument=()=>{const n=Sd?document:null;return this.props.appendTo?this.props.appendTo.ownerDocument:n},Sd&&(this.activeElement=Wu(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=[...W0].map(n=>n+":not(.k-dialog-titlebar *)");JG(this.element,t)}this.setState({zIndex:YJ(this.getCurrentZIndex(),this.getDocument(),this._id)})}}componentWillUnmount(){setTimeout(()=>{var t;!this.element&&this.activeElement&&Sd&&(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:a,minWidth:o,dir:u,style:d,contentStyle:m,modal:v=!0}=this.props,g=_.Children.toArray(a),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=_.createElement(of.Provider,{value:w},_.createElement("div",{[QL]:this._id,className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:u,style:{zIndex:w,...d},ref:j=>{this.element=j}},v&&_.createElement("div",{className:"k-overlay",style:this.props.overlayStyle}),_.createElement("div",{...x,className:nr("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&&_.createElement(QJ,{closeIcon:A,onCloseButtonClick:this.onCloseDialog,id:t},n),_.createElement("div",{className:"k-window-content k-dialog-content",style:m,id:this.contentId},b),y)));return Sd?this.props.appendTo!==null?L0.createPortal(C,this.props.appendTo||document.body):C:null}getActionBar(t){return t.filter(n=>n&&n.type===hR)}getContent(t){return t.filter(n=>n&&n.type!==hR)}generateTitleId(){return"dialog-title-"+this._id}generateContentId(){return"dialog-content-"+this._id}};Sm.displayName="Dialog",Sm.propTypes={title:ce.any,id:ce.string,dir:ce.string,style:ce.object,closeIcon:ce.bool,width:ce.oneOfType([ce.number,ce.string]),height:ce.oneOfType([ce.number,ce.string]),minWidth:ce.oneOfType([ce.number,ce.string]),autoFocus:ce.bool},Sm.defaultProps={autoFocus:!1},Sm.contextType=of;let UJ=Sm;const WJ=W8(),Lm=G0(G8(WJ,UJ));Lm.displayName="KendoReactDialog";const jn=e=>c.jsx(Lm,{...e,appendTo:null}),Nj=["Facebook","Instagram","Twitter","LinkedIn"],GJ=e=>[...e].sort((t,n)=>{const r=Nj.indexOf(t.platform),i=Nj.indexOf(n.platform);return r!==-1&&i!==-1?r-i:r!==-1?-1:i!==-1?1:t.platform.localeCompare(n.platform)}),Bj=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),PO=e=>/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/.test(e),rg=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),eb=e=>{if(e.includes("/email"))return"email";if(e.includes("/social_media"))return"social_media";if(e.includes("/website"))return"website"},XJ=(e,t)=>{const r=`\\b${(a=>a==null?void 0:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},kj=(e,t)=>{const r=`\\b${(a=>a==null?void 0:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},HL=(e,t,n)=>{const r=VL(YL(e));return r?t==null?void 0:t.filter(i=>{if(!i)return!1;const a=i.keyword.trim();if(!kj(r,a))return!1;if(!n||n.length<1)return!0;const o=n==null?void 0:n.filter(d=>{var m,v;return(v=(m=d==null?void 0:d.item)==null?void 0:m.toLowerCase())==null?void 0:v.includes(a==null?void 0:a.toLowerCase())});return(o==null?void 0:o.length)===0?!0:!(o==null?void 0:o.some(d=>kj(r,d==null?void 0:d.item)))}):[]},ZJ=(e,t)=>{const n=VL(YL(e));return n?t==null?void 0:t.filter(r=>{var i;return!!XJ(n,(i=r==null?void 0:r.item)==null?void 0:i.toLowerCase())}):[]},VL=e=>e&&e.replace(/[\r?\n!@#&*()\-\–—+=\[\]{}|:;'\"‘’“”,.<>\?/]/g," "),YL=e=>e&&e.replace(/<[^>]*>/g,""),KJ=e=>{if(!e)return e;const t=e.match(/@(.+)$/);return t?t[1]:null},JJ=e=>/^(?!\.)(?!.*\.\.)[A-Za-z0-9._+-]+(?<!\.)$/.test(e),$J=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 a=r.find(m=>m.type==="month").value,o=r.find(m=>m.type==="year").value,u=parseInt(i,10);let d="th";return u%10===1&&u!==11?d="st":u%10===2&&u!==12?d="nd":u%10===3&&u!==13&&(d="rd"),`${a} ${u}${d}, ${o}`},A0=e=>{if(!e)return!1;const t=e.replace(/\D/g,"");return!(t.length<8||t.length>15)},e$=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=_.useState(!1),[a,o]=_.useState(""),[u,d]=_.useState(!1),[m,v]=_.useState(),g=ir();ln();const b=_.useRef(null),y=[g.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:T})=>A===T.original.id?c.jsx("input",{onClick:M=>M.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:T.original.item,ref:b}):T.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:T})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:O=>{O.stopPropagation(),d(!0),v(T.original)}})})],x=[{label:"Add",icon:cr,onClick:()=>{i(!0)}}];Mo();const[A,w]=_.useState(),C=cf();function j(T){T&&C.mutate(T==null?void 0:T.id,{onSuccess:()=>{d(!1)}})}const D=uf();function I(){if(!rg(a))return Ce.error("Please enter a valid email!",{id:"new-excluded-email"});D.mutate({itemType:"sender",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const S=or({data:e,columns:y,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:T=>T.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Dr,{table:S,onRowClick:T=>{T.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Associated Contacts",rowSelectedCheck:T=>T.original.checked===1,collapseSearchAndFilters:!0}),r&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:T=>o(T.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:I,disabled:D.isPending,children:D.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),u&&c.jsx(jn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Associated Contact"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this associated contact?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>j(m),disabled:C.isPending,children:C.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},t$=({data:e=[],isLoading:t=!1})=>{const[n,r]=_.useState(!1),[i,a]=_.useState(""),[o,u]=_.useState(!1),[d,m]=_.useState(),v=ir();ln();const g=_.useRef(null),b=[v.accessor("item",{header:"Email Domains",size:"unset",cell:({row:S})=>x===S.original.id?c.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:S.original.item,ref:g}):S.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:S})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:T=>{T.stopPropagation(),u(!0),m(S.original)}})})],y=[{label:"Add Domain",icon:cr,onClick:()=>{r(!0)}}];Mo();const[x,A]=_.useState(),w=cf();function C(S){S&&w.mutate(S==null?void 0:S.id,{onSuccess:()=>{u(!1)}})}const j=uf();function D(){if(!PO(i))return Ce.error("Please enter a valid domain!",{id:"new-email-domain"});j.mutate({itemType:"domain",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const I=or({data:e,columns:b,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:S=>S.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Domains"})}),c.jsx(Dr,{table:I,onRowClick:S=>{S.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:S=>S.original.checked===1}),n&&c.jsx(jn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:S=>a(S.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:D,disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),o&&c.jsx(jn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(d),disabled:w.isPending,children:w.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},n$=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=_.useState(!1),[a,o]=_.useState(""),[u,d]=_.useState(!1),[m,v]=_.useState(),g=ir();ln();const b=_.useRef(null),y=[g.accessor("item",{header:"Email Prefixes",size:"unset",cell:({row:O})=>A===O.original.id?c.jsx("input",{onClick:P=>P.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})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:M=>{M.stopPropagation(),d(!0),v(O.original)}})})],x=[{label:"Add",icon:cr,onClick:()=>{i(!0)}}];Mo();const[A,w]=_.useState(),C=qZ(),j=cf();function D(O){O&&((O==null?void 0:O.addedType)=="added"?j.mutate(O==null?void 0:O.id,{onSuccess:()=>{d(!1)}}):C.mutate(O==null?void 0:O.id,{onSuccess:()=>{d(!1)}}))}const I=uf();function S(){if(e.find(O=>O.item==a))return i(!1),Ce.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!a||(a==null?void 0:a.trim())==""||!JJ(a))return Ce.error("Please enter a valid email prefix!",{id:"new-email-prefix"});I.mutate({itemType:"username",filterType:"spam_email",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const T=or({data:e,columns:y,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:O=>O.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Dr,{table:T,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&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Prefix"}),c.jsxs("div",{className:"flex items-center",children:[c.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:S,disabled:I.isPending,children:I.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),u&&c.jsx(jn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>D(m),disabled:C.isPending,children:C.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},r$=({data:e=[],isLoading:t=!1})=>{const[n,r]=_.useState(!1),[i,a]=_.useState(""),[o,u]=_.useState(!1),[d,m]=_.useState(),v=ir();ln();const g=_.useRef(null),b=[v.accessor("item",{header:"Recipients",size:"unset",cell:({row:S})=>x===S.original.id?c.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:S.original.item,ref:g}):S.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:S})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:T=>{T.stopPropagation(),u(!0),m(S.original)}})})],y=[{label:"Add Email",icon:cr,onClick:()=>{r(!0)}}];Mo();const[x,A]=_.useState(),w=cf();function C(S){S&&w.mutate(S==null?void 0:S.id,{onSuccess:()=>{u(!1)}})}const j=uf();function D(){if(!rg(i))return Ce.error("Please enter a valid email!",{id:"new-excluded-email"});j.mutate({itemType:"recipient",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const I=or({data:e,columns:b,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:S=>S.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Recipients"})}),c.jsx(Dr,{table:I,onRowClick:S=>{S.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Recipients",rowSelectedCheck:S=>S.original.checked===1}),n&&c.jsx(jn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:S=>a(S.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:D,disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),o&&c.jsx(jn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Recipient"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this recipient?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(d),disabled:w.isPending,children:w.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},i$=({data:e=[],isLoading:t=!1})=>{const[n,r]=_.useState(!1),[i,a]=_.useState(""),[o,u]=_.useState(!1),[d,m]=_.useState(),v=ir();ln();const g=_.useRef(null),b=[v.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:S})=>x===S.original.id?c.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:S.original.item,ref:g}):S.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:S})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:T=>{T.stopPropagation(),u(!0),m(S.original)}})})],y=[{label:"Add Email",icon:cr,onClick:()=>{r(!0)}}];Mo();const[x,A]=_.useState(),w=cf();function C(S){S&&w.mutate(S==null?void 0:S.id,{onSuccess:()=>{u(!1)}})}const j=uf();function D(){if(!rg(i))return Ce.error("Please enter a valid email!",{id:"new-excluded-email"});j.mutate({itemType:"sender",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const I=or({data:e,columns:b,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:S=>S.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Senders"})}),c.jsx(Dr,{table:I,onRowClick:S=>{S.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Senders",rowSelectedCheck:S=>S.original.checked===1}),n&&c.jsx(jn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:S=>a(S.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:D,disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),o&&c.jsx(jn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Sender"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this sender?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(d),disabled:w.isPending,children:w.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},a$=({classList:e=""})=>{var O;const{data:t,isLoading:n}=Gt(QZ()),r=(O=t==null?void 0:t.payload)!=null?O:[],[i,a]=_.useState(!1),[o,u]=_.useState(""),[d,m]=_.useState(!1),[v,g]=_.useState(),b=ir();ln();const y=_.useRef(null),x=[b.accessor("item",{header:"Phrase",size:"unset",cell:({row:M})=>w===M.original.id?c.jsx("input",{onClick:N=>N.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:M.original.item,ref:y}):M.original.item}),b.display({size:65,id:"delete",header:()=>null,cell:({row:M})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:P=>{P.stopPropagation(),m(!0),g(M.original)}})})],A=[{label:"Add",icon:cr,onClick:()=>{a(!0)}}];Mo();const[w,C]=_.useState(),j=FZ();function D(M){M&&j.mutate({archivingType:"email",filterType:"spam_phrase",multipleType:!1,itemId:M.id,itemType:M.itemType},{onSuccess:()=>{m(!1)}})}const I=RO();function S(){if(r.find(M=>M.item==o))return a(!1),Ce.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!o||(o==null?void 0:o.trim())=="")return Ce.error("Please enter a valid phrase!",{id:"new-spam-phrase"});I.mutate({archivingType:"email",filterType:"spam_phrase",item:o},{onSuccess:()=>{u(""),a(!1)}})}const T=or({data:r,columns:x,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:M=>M.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${e}`,children:[c.jsx(Dr,{table:T,onRowClick:M=>{M.toggleSelected()},emptyMessage:n?"Loading...":"No items found",bordered:!1,filterButtons:A,hasGlobalFilter:!0,searchPlaceholder:"Search or add new phrases",itemsLabel:"Phrases",rowSelectedCheck:M=>M.original.checked===1,collapseSearchAndFilters:!0}),i&&c.jsx(jn,{title:"",width:700,onClose:()=>a(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>a(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Phrase"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:M=>u(M.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:S,disabled:I.isPending,children:I.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),d&&c.jsx(jn,{title:"",width:700,onClose:()=>m(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>m(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>m(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>D(v),disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},s$=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=_.useState(!1),[a,o]=_.useState(""),[u,d]=_.useState(!1),[m,v]=_.useState(),g=ir();ln();const b=_.useRef(null);_.useRef(null);const y=[g.accessor("item",{header:"Email Domains",size:"unset",cell:({row:T})=>A===T.original.id?c.jsx("input",{onClick:M=>M.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:T.original.item,ref:b}):T.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:T})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:O=>{O.stopPropagation(),d(!0),v(T.original)}})})],x=[{label:"Add",icon:cr,onClick:()=>{i(!0)}}];Mo();const[A,w]=_.useState(),C=cf();function j(T){T&&C.mutate(T==null?void 0:T.id,{onSuccess:()=>{d(!1)}})}const D=uf();function I(){if(!PO(a))return Ce.error("Please enter a valid domain!",{id:"new-email-domain"});D.mutate({itemType:"domain",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const S=or({data:e,columns:y,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:T=>T.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Dr,{table:S,onRowClick:T=>{T.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:T=>T.original.checked===1,collapseSearchAndFilters:!0}),r&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:T=>o(T.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:I,disabled:D.isPending,children:D.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),u&&c.jsx(jn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>j(m),disabled:C.isPending,children:C.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},o$=()=>{var m,v,g,b,y,x;const{data:e,isLoading:t,isSuccess:n}=Gt(HZ()),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,a=(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,d=(x=e==null?void 0:e.internal)==null?void 0:x.sender;return c.jsx("section",{className:"flex flex-col w-full !mb-3",children:c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9 mb-10",children:"Excluded Emails"}),c.jsxs(tg,{children:[c.jsxs(Zr,{label:"Recipients",onActive:()=>{},children:[c.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."}),c.jsx(r$,{isLoading:t,data:r})]}),c.jsxs(Zr,{label:"Senders",onActive:()=>{},children:[c.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."}),c.jsx(i$,{isLoading:t,data:i})]}),c.jsxs(Zr,{label:"Domains",onActive:()=>{},children:[c.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."}),c.jsx(t$,{isLoading:t,data:a})]}),c.jsxs(Zr,{label:"Spam",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Below are the email domains that are excluded from your review."}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Excluded Spam"})}),c.jsxs(Dj,{children:[c.jsx(Zr,{label:"Email Prefixes",onActive:()=>{},children:c.jsx(n$,{data:o,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(Zr,{label:"Phrases",onActive:()=>{},children:c.jsx(a$,{classList:"mt-[-1px]"})})]})]}),c.jsxs(Zr,{label:"Advanced",onActive:()=>{},children:[c.jsx("p",{className:"mb-10"}),c.jsx(VZ,{data:u}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Additional Exclusions"})}),c.jsxs(Dj,{children:[c.jsx(Zr,{label:"Internal Domains",onActive:()=>{},children:c.jsx(s$,{data:u,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(Zr,{label:"Associated Contacts",onActive:()=>{},children:c.jsx(e$,{data:d,isLoading:t,classList:"mt-[-1px]"})})]})]})]})]})})},l$=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/instagram?url=${e}`,"GET"),onError:()=>Ce.error("Error occurred while trying to connect to Instagram account.")}),u$=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/instagram/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ce.error("Error occurred while trying to connect to Instagram account."),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${wt.getUser()}`}}),UL=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/linkedin/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ce.error("Error occurred while trying to connect to LinkedIn account."),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${wt.getUser()}`}}),c$=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/facebook/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ce.error("Error occurred while trying to connect to Facebook account."),onSuccess:t=>{window.location.href=t}}),d$=(e,t)=>Dt({mutationFn:n=>wt.executeRequest(`/socialmedia/firm?type=${n}&firmURL=${e}&employeeURL=${t}`,"GET"),onError:()=>Ce.error("Error occurred while trying to connect to Facebook account."),onSuccess:n=>{window.location.href=n==null?void 0:n.firmURL}}),WL=()=>{const e=ln();return Dt({mutationFn:({accountType:t,screenName:n,isTodoReconnect:r})=>wt.executeRequest("/socialmedia/twitter/response","POST",{accountType:t,screenName:n,isTodoReconnect:r}),onSettled:t=>{e.invalidateQueries({queryKey:tb().queryKey}),e.invalidateQueries({queryKey:ZL.queryKey}),e.invalidateQueries({queryKey:ys().queryKey})}})},f$=()=>{const e=ln();return Dt({mutationFn:({type:t,accountType:n})=>wt.executeRequest("/socialmedia/disconnect","POST",{type:t,accountType:n}),onSuccess:()=>{e.invalidateQueries({queryKey:tb().queryKey}),e.invalidateQueries({queryKey:ys().queryKey})}})},GL=()=>Dt({mutationFn:e=>wt.executeRequest("/accountsettings/approved","PUT",{approved:e}),onSuccess:()=>{}}),h$=()=>{const e=ln();return Dt({mutationFn:({archivingType:t,itemId:n,itemType:r,filterType:i})=>wt.executeRequest("/Archiving/readd_archiving_keyword_and_added_item","POST",{archivingType:t,itemId:n,itemType:r,filterType:i}),onSuccess:()=>{e.invalidateQueries({queryKey:["deleteKeywords"]}),e.invalidateQueries({queryKey:["keywordsAndPhrases"]})}})},m$=(e="social_media")=>({queryKey:["deleteKeywords",e],queryFn:()=>wt.executeRequest(`/Popups/archiving_view_previously_removed_keywords/${e}`,"POST")}),ys=()=>({queryKey:["socialMediaStatuses"],queryFn:()=>wt.executeRequest("/socialmedia/check/statuses","GET")}),$d=()=>({queryKey:["heightenedSupervisionUsers"],queryFn:async()=>{const e=await wt.executeRequest("/heightenedsupervisionusers/users","GET");if(!e||e.error)throw new Error("Error occurred while fetching users");return e}}),g$=()=>Dt({mutationFn:({types:e,employees:t})=>wt.executeRequest("/employeerequests","POST",{types:e,employees:t})}),XL=()=>({queryKey:["socialmediatypes"],queryFn:()=>wt.executeRequest("/socialmedia/types","GET"),retry:!1}),tb=()=>({queryKey:["employeeaccounts"],queryFn:()=>wt.executeRequest("/socialmedia/employee/accounts?url=mrc","GET")}),ZL={queryKey:["employeeAccountsStatus"],queryFn:()=>wt.executeRequest("/socialmedia/employee/statuses","GET")},bi=({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-[#AA2400]",linkedin_unavailable:"text-[#AA2400]",instagram_unavailable:"text-[#AA2400]",twitter_unavailable:"text-[#AA2400]",unavailable:"text-[#AA2400]",facebook_connect:"text-[#005DEC]",linkedin_connect:"text-[#005DEC]",instagram_connect:"text-[#005DEC]",twitter_connect:"text-[#005DEC]",connect:"text-[#005DEC]",facebook_connected:"text-[#005DEC]",linkedin_connected:"text-[#005DEC]",instagram_connected:"text-[#005DEC]",twitter_connected:"text-[#005DEC]",connected:"text-[#005DEC]"};let n=ta,r="";switch(e.status){case"facebook_active":case"linkedin_active":case"instagram_active":case"twitter_active":case"active":n=tL,r="Active";break;case"facebook_inactive":case"linkedin_inactive":case"instagram_inactive":case"twitter_inactive":case"inactive":n=ta,r="Inactive";break;case"facebook_pending":case"linkedin_pending":case"instagram_pending":case"twitter_pending":case"pending":n=VX,r="Pending";break;case"facebook_connect":case"linkedin_connect":case"instagram_connect":case"twitter_connect":case"connect":n=XX,r="Connect";break;default:n=ta,r="N/A"}return c.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:[c.jsx(Ae,{icon:n,size:"small",className:"fill-current"}),c.jsx("div",{className:"capitalize flex-grow text-center",children:r})]})},px={PENDING:1,CONNECTED:2,DISCONNECTED:3},mr={iMessage:32,WhatsApp:33},w0=e=>{switch(e){case px.PENDING:return{status:"pending",statusTitle:"Pending"};case px.CONNECTED:return{status:"active",statusTitle:"Active"};case px.DISCONNECTED:default:return{status:"unavailable",statusTitle:"N/A"}}},ig=()=>({queryKey:["accountconnections"],queryFn:()=>wt.executeRequest("/mobilechannelconnections/connection","GET")}),fd=()=>({queryKey:["mobileuserstatuses"],queryFn:()=>wt.executeRequest("/mobilechannelconnections/check/statuses","GET")}),p$=()=>Dt({mutationFn:e=>wt.executeRequest("/imessages","POST",e),onSuccess:(e,t)=>{}}),v$=()=>Dt({mutationFn:e=>wt.executeRequest("/whatsapp","POST",e),onSuccess:(e,t)=>{}}),b$=()=>Dt({mutationFn:e=>wt.executeRequest("/mobilechannelconnections/connection_request","POST",{requests:e}),onSuccess:(e,t)=>{}}),Fp={status:"unavailable",statusTitle:"Unavailable",ts:null,active:!1},KL=({showName:e,hasRowSelection:t=!1,description:n=null,isSettings:r=!1})=>{var B,L,F,V;const i=b$(),{data:a,isLoading:o,isSuccess:u}=Gt(ig()),{data:d,isLoading:m,isSuccess:v}=Gt($d()),{data:g,isLoading:b,isSuccess:y}=Gt(fd()),x=ln();_.useEffect(()=>{v&&y&&x.setQueryData(fd().queryKey,W=>{if(!W)return{};const Q={...W};return d.forEach(X=>{Q[X.id]||(Q[X.id]={}),Object.values(mr).forEach($=>{Q[X.id][$]||(Q[X.id][$]={...Fp})})}),Q})},[v,y,g,d,x]);const A=g&&d?Object.entries(g).flatMap(([W,Q])=>Object.entries(Q).filter(([X,$])=>$.active===1).map(([X])=>({userId:parseInt(W),integrationId:parseInt(X)})).filter(X=>!isNaN(X.userId)&&!isNaN(X.integrationId))):[],w=ir(),C=(W,Q,X)=>{const $=X?1:0;x.setQueryData(fd().queryKey,re=>{var z;return re&&((z=re==null?void 0:re[W])!=null&&z[Q]?{...re,[W]:{...re==null?void 0:re[W],[Q]:{...re[W][Q],active:$}}}:{...re,[W]:{...re==null?void 0:re[W],[Q]:{...Fp,active:X}}})})},j=W=>{x.setQueryData(fd().queryKey,Q=>Q&&Object.fromEntries(Object.entries(Q).map(([$,re])=>[$,Object.fromEntries(Object.entries(re).map(([z,H])=>[z,{...H,active:W?1:0}]))])))},D=(W,Q)=>{if(isNaN(W))return Ce.error("You cannot send a request for 'Your Mobile Accounts'.");x.setQueryData(fd().queryKey,X=>{if(!(X!=null&&X[W]))return X;const $=Object.fromEntries(Object.entries(X[W]).map(([re,z])=>[re,{...z,active:Q?1:0}]));return{...X,[W]:$}})},I=((B=a==null?void 0:a.whatsApp)==null?void 0:B.id)==0?{status:"unavailable",statusTitle:"N/A"}:w0((L=a==null?void 0:a.whatsApp)==null?void 0:L.status),T={name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:((F=a==null?void 0:a.iMessage)==null?void 0:F.id)==0?{status:"unavailable",statusTitle:"N/A"}:w0((V=a==null?void 0:a.iMessage)==null?void 0:V.status),whatsapp:I},O=_.useMemo(()=>{if(!d||!g)return[];const W=d.map(Q=>{var re,z;const X=((re=g==null?void 0:g[Q.id])==null?void 0:re[mr==null?void 0:mr.iMessage])||Fp,$=((z=g==null?void 0:g[Q.id])==null?void 0:z[mr==null?void 0:mr.WhatsApp])||Fp;return(X==null?void 0:X.status)==="connected"&&(X.status="active",X.statusTitle="Active"),($==null?void 0:$.status)==="connected"&&($.status="active",$.statusTitle="Active"),{id:Q.id,name:`${Q.firstName} ${Q.lastName}`,imessage:X,whatsapp:$}});return W.unshift({...T}),W},[d,g,r]),M=[w.accessor("name",{cell:W=>W.getValue(),header:()=>e?"Name":"",size:300}),w.accessor("imessage",{cell:W=>{const Q=W.getValue();return c.jsxs("label",{htmlFor:`imessage-check-${W.row.id}-${mr==null?void 0:mr.iMessage}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`imessage-check-${W.row.id}-${mr==null?void 0:mr.iMessage}`,checked:!!Q.active,onChange:X=>C(W.row.id,mr==null?void 0:mr.iMessage,X.target.checked)}),c.jsx(bi,{status:Q})]})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),w.accessor("whatsapp",{cell:W=>{const Q=W.getValue();return c.jsxs("label",{htmlFor:`whatsapp-check-${W.row.id}-${mr==null?void 0:mr.WhatsApp}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`whatsapp-check-${W.row.id}-${mr==null?void 0:mr.WhatsApp}`,checked:!!Q.active,onChange:X=>C(W.row.id,mr==null?void 0:mr.WhatsApp,X.target.checked)}),c.jsx(bi,{status:Q})]})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})];t&&M.unshift(w.accessor("id",{header:({table:W})=>c.jsx("input",{type:"checkbox",checked:g&&A.length>0&&Object.values(g).every(Q=>Object.values(Q).every(X=>X.active===1)),onChange:Q=>j(Q.target.checked)}),cell:({row:W})=>{var X;let Q=!1;if(W.id!="firm_mobile_accounts"&&W.id!="your_mobile_accounts"){const $=parseInt(W.original.id);Q=A.filter(z=>z.userId===$).length>0&&Object.values((X=g==null?void 0:g[W.original.id])!=null?X:{}).every(z=>z.active===1)}return c.jsx("input",{type:"checkbox",checked:Q,onChange:$=>{D(parseInt(W.original.id),$.target.checked)}})},maxSize:55}));const P=[{label:i.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Send Request",active:t,onClick:()=>{if(!i.isPending){if(A.length<1)return Ce.error("Please select at least one integration!",{id:"no-selection-error",duration:5e3});i.mutate(A,{onSuccess:()=>{x.invalidateQueries({queryKey:$d().queryKey}),x.invalidateQueries({queryKey:fd().queryKey}),Ce.success("To do list items have been sent for mobile setup.",{id:"mobile-request-success",duration:5e3})}})}},icon:rL}],N=or({data:O,columns:M,getCoreRowModel:ar(),getPaginationRowModel:sr(),getFilteredRowModel:gr(),getRowId:W=>W.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx("h5",{className:"text-brand text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"}),n&&c.jsx("p",{className:"mb-5"})]}),c.jsx(Dr,{table:N,hasGlobalFilter:t,filterButtons:P,searchPlaceholder:"Search Accounts",itemsLabel:"Accounts",bordered:!0,emptyMessage:m||b?"Loading...":"No accounts found"})]})},y$=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 2 of 5: Connect Firm Text Messaging Accounts"}),c.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."})]}),c.jsx(KL,{showName:!0,hasRowSelection:!0}),c.jsx(rr,{prevLink:"/setup/mobile",prevProgress:6,nextLink:"/setup/mobile/review-frequency-and-size",nextProgress:7})]});function Il(e){return typeof e=="string"||e instanceof String}function Lj(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function JL(e,t){return Array.isArray(t)?JL(e,(n,r)=>t.includes(r)):Object.entries(e).reduce((n,r)=>{let[i,a]=r;return t(a,i)&&(n[i]=a),n},{})}const Wt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function x$(e){switch(e){case Wt.LEFT:return Wt.FORCE_LEFT;case Wt.RIGHT:return Wt.FORCE_RIGHT;default:return e}}function vx(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function E0(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(!E0(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){const a=t instanceof Date,o=e instanceof Date;if(a&&o)return t.getTime()==e.getTime();if(a!=o)return!1;const u=t instanceof RegExp,d=e instanceof RegExp;if(u&&d)return t.toString()==e.toString();if(u!=d)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(!E0(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 A${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?Wt.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Wt.RIGHT:Wt.LEFT}}function un(e,t){return new un.InputMask(e,t)}function $L(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?un.MaskedRegExp:Il(e)?un.MaskedPattern:e===Date?un.MaskedDate:e===Number?un.MaskedNumber:Array.isArray(e)||e===Array?un.MaskedDynamic:un.Masked&&e.prototype instanceof un.Masked?e:un.Masked&&e instanceof un.Masked?e.constructor:e instanceof Function?un.MaskedFunction:(console.warn("Mask not found for mask",e),un.Masked)}function Fm(e){if(!e)throw new Error("Options in not defined");if(un.Masked){if(e.prototype instanceof un.Masked)return{mask:e};const{mask:t=void 0,...n}=e instanceof un.Masked?{mask:e}:Lj(e)&&e.mask instanceof un.Masked?e:{};if(t){const r=t.mask;return{...JL(t,(i,a)=>!a.startsWith("_")),mask:t.constructor,_mask:r,...n}}}return Lj(e)?{...e}:{mask:e}}function Oo(e){if(un.Masked&&e instanceof un.Masked)return e;const t=Fm(e),n=$L(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)}un.createMask=Oo;class jO{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}}un.MaskElement=jO;const Fj=90,w$=89;class nb extends jO{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===Fj&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===w$&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Fj&&(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={}}}un.HTMLMaskElement=nb;class E$ extends nb{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}}un.HTMLMaskElement=nb;class eF extends nb{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,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}un.HTMLContenteditableMaskElement=eF;class rb{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>rb.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}}rb.MAX_LENGTH=100;class S${constructor(t,n){this.el=t instanceof jO?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new eF(t):new E$(t),this.masked=Oo(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new rb,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 un.Masked)&&this.masked.constructor===$L(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof un.Masked?t:Oo({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,a=this.displayValue,o=this.unmaskedValue!==n||this.value!==r||this._rawInputValue!==i;this._unmaskedValue=n,this._value=r,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),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),a=this.masked.optionsIsChanged(r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&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,Wt.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 A$({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,a=r===this.masked.rawInputValue?n.removeDirection:Wt.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==Wt.NONE&&(o=this.masked.nearestInputPos(o,Wt.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}}un.InputMask=S$;class xn{static normalize(t){return Array.isArray(t)?t:[t,new xn]}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}}un.ChangeDetails=xn;class Cs{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 Di{constructor(t){this._value="",this._update({...Di.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 Cs(this.extractInput(t,n),t)}appendTail(t){return Il(t)&&(t=new Cs(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new xn({inserted:t,rawInserted:t})):new xn}_appendChar(t,n,r){n===void 0&&(n={});const i=this.state;let a;if([t,a]=this.doPrepareChar(t,n),t&&(a=a.aggregate(this._appendCharRaw(t,n)),!a.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=i;let u=this.pad(n);const d=this._appendCharRaw(t,n);u=u.aggregate(d),d.rawInserted||u.equals(a)?a=u:this.state=o}if(a.inserted){let o,u=this.doValidate(n)!==!1;if(u&&r!=null){const d=this.state;if(this.overwrite===!0){o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.unshift(this.displayValue.length-a.tailShift)}let m=this.appendTail(r);if(u=m.rawInserted.length===r.toString().length,!(u&&m.inserted)&&this.overwrite==="shift"){this.state=d,o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.shift();m=this.appendTail(r),u=m.rawInserted.length===r.toString().length}u&&m.inserted&&(this.state=d)}u||(a=new xn,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new xn}_appendEager(){return new xn}append(t,n,r){if(!Il(t))throw new Error("value should be string");const i=Il(r)?new Cs(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[t,a]=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;a.aggregate(u)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}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 xn}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={}),xn.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),xn.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,a){r===void 0&&(r=""),i===void 0&&(i=Wt.NONE),a===void 0&&(a={input:!0});const o=t+n,u=this.extractTail(o),d=this.eager===!0||this.eager==="remove";let m;d&&(i=x$(i),m=this.extractInput(0,o,{raw:!0}));let v=t;const g=new xn;if(i!==Wt.NONE&&(v=this.nearestInputPos(t,n>1&&t!==0&&!d?Wt.NONE:i),g.tailShift=v-t),g.aggregate(this.remove(v)),d&&i!==Wt.NONE&&m===this.rawInputValue)if(i===Wt.FORCE_LEFT){let b;for(;m===this.rawInputValue&&(b=this.displayValue.length);)g.aggregate(new xn({tailShift:-1})).aggregate(this.remove(b-1))}else i===Wt.FORCE_RIGHT&&u.unshift();return g.aggregate(this.append(r,a,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!E0(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||Di.EMPTY_VALUES.includes(t)&&Di.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new xn}}Di.DEFAULTS={skipInvalid:!0};Di.EMPTY_VALUES=[void 0,null,""];un.Masked=Di;class Nu{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=Il(t)?new Cs(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 Cs)r?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof Nu){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 un.MaskedPattern))return new Cs(this.toString()).appendTo(t);const n=new xn;for(let r=0;r<this.chunks.length;++r){const i=this.chunks[r],a=t._mapPosToBlock(t.displayValue.length),o=i.stop;let u;if(o!=null&&(!a||a.index<=o)&&((i instanceof Nu||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),u=i instanceof Nu&&t._blocks[o]),u){const d=u.appendTail(i);n.aggregate(d);const m=i.toString().slice(d.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 a="chunks"in i?new Nu:new Cs;return a.state=i,a})}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],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}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 C${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,Wt.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Wt.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,Wt.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.NONE),!0})}}class tF{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 xn}nearestInputPos(t,n){n===void 0&&(n=Wt.NONE);const r=0,i=this._value.length;switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return r;case Wt.NONE:case Wt.RIGHT:case Wt.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 xn;const r=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!r)&&!n.tail,o=new xn({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(n.raw||n.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new xn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Cs("")}appendTail(t){return Il(t)&&(t=new Cs(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 S0{constructor(t){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:u,...d}=t;this.masked=Oo(d),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,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 xn}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 xn;const r=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new xn,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 xn:(this.isFilled=!0,new xn({inserted:this.placeholderChar}))}_appendEager(){return new xn}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=Wt.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(t,r),i);switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return this.isComplete?a:r;case Wt.RIGHT:case Wt.FORCE_RIGHT:return this.isComplete?a:i;case Wt.NONE:default:return a}}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 xn}}S0.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 R$ extends Di{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=r=>r.search(n)>=0),super._update(t)}}un.MaskedRegExp=R$;class Ii extends Di{constructor(t){super({...Ii.DEFAULTS,...t,definitions:Object.assign({},S0.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 a=0;a<n.length;++a){if(this.blocks){const m=n.slice(a),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}=Fm(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 un.RepeatBlock(A):Oo(A);w&&(this._blocks.push(w),b&&(this.exposeBlock=w),this._maskedBlocks[g]||(this._maskedBlocks[g]=[]),this._maskedBlocks[g].push(this._blocks.length-1)),a+=g.length-1;continue}}let o=n[a],u=o in t;if(o===Ii.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===Ii.ESCAPE_CHAR){if(++a,o=n[a],!o)break;u=!1}const d=u?new S0({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Fm(t[o]),parent:this}):new tF({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(d)}}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,a)=>i.state=n[a]),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 xn;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 a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new xn;if(!r)return i;for(let o=r.index,u;u=this._blocks[o];++o){var a;const d=u._appendChar(t,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]});if(i.aggregate(d),d.consumed)break}return i}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=new Nu;return t===n||this._forEachBlocksInRange(t,n,(i,a,o,u)=>{const d=i.extractTail(o,u);d.stop=this._findStopBefore(a),d.from=this._blockStartPos(a),d instanceof Nu&&(d.blockIndex=a),r.extend(d)}),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,(a,o,u,d)=>{i+=a.extractInput(u,d,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 xn;if(this.lazy&&t==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=t!=null?t:this._blocks.length;return this._blocks.slice(i,a).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],a=n.length;if(n+=i.displayValue,t<=n.length)return{index:r,offset:t-a}}}_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 a=this._mapPosToBlock(n),o=a&&i.index===a.index,u=i.offset,d=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,u,d),a&&!o){for(let m=i.index+1;m<a.index;++m)r(this._blocks[m],m,0,this._blocks[m].displayValue.length);r(this._blocks[a.index],a.index,0,a.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,a,o,u)=>{r.aggregate(i.remove(o,u))}),r}nearestInputPos(t,n){if(n===void 0&&(n=Wt.NONE),!this._blocks.length)return 0;const r=new C$(this,t);if(n===Wt.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Wt.LEFT||n===Wt.FORCE_LEFT){if(n===Wt.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Wt.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===Wt.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Wt.RIGHT||n===Wt.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Wt.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,Wt.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,a,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 xn;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(t))),n}}Ii.DEFAULTS={...Di.DEFAULTS,lazy:!0,placeholderChar:"_"};Ii.STOP_CHAR="`";Ii.ESCAPE_CHAR="\\";Ii.InputDefinition=S0;Ii.FixedDefinition=tF;un.MaskedPattern=Ii;class n0 extends Ii{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:a=this.autofix,...o}=t;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const u=String(this.from).padStart(this.maxLength,"0"),d=String(this.to).padStart(this.maxLength,"0");let m=0;for(;m<d.length&&d[m]===u[m];)++m;o.mask=d.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,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),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"),[a,o]=this.boundaries(this.value+t);return Number(o)<this.from?super._appendCharRaw(r[this.value.length],n):Number(a)>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,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const n=new xn;if(this.value.length===this.maxLength)return n;const r=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let a=0;a<i;++a)n.aggregate(super._appendCharRaw("0",t));r.split("").forEach(a=>this._appendCharRaw(a))}return n}}un.MaskedRange=n0;const O$="d{.}`m{.}`Y";class yo extends Ii{static extractPatternOptions(t){const{mask:n,pattern:r,...i}=t;return{...i,mask:Il(n)?n:r}}constructor(t){super(yo.extractPatternOptions({...yo.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:r,blocks:i,...a}={...yo.DEFAULTS,...t},o=Object.assign({},yo.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({...a,mask:Il(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(yo.extractPatternOptions(t))}}yo.GET_DEFAULT_BLOCKS=()=>({d:{mask:n0,from:1,to:31,maxLength:2},m:{mask:n0,from:1,to:12,maxLength:2},Y:{mask:n0,from:1900,to:9999}});yo.DEFAULTS={...Ii.DEFAULTS,mask:Date,pattern:O$,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)}};un.MaskedDate=yo;class ib extends Di{constructor(t){super({...ib.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}=Fm(n),a=Oo({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_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,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,u=a.slice(o.length),d=this.currentMask,m=new xn,v=d==null?void 0:d.state;return this.currentMask=this.doDispatch(t,{...n},r),this.currentMask&&(this.currentMask!==d?(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 xn;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 a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(t,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(t,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}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 xn;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,...a}=t;n&&this.compiledMasks.forEach((o,u)=>o.state=n[u]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}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,...a}=t[r];return E0(n,a)&&n.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}ib.DEFAULTS={...Di.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,a=t.compiledMasks.map((o,u)=>{const d=t.currentMask===o,m=d?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Wt.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):d||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,Wt.FORCE_LEFT)))}});return a.sort((o,u)=>u.weight-o.weight||u.totalInputPositions-o.totalInputPositions),t.compiledMasks[a[0].index]}};un.MaskedDynamic=ib;class ab extends Ii{constructor(t){super({...ab.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...r}=t;if(n){const i=n.map(u=>u.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),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,Wt.FORCE_RIGHT),this.value.length),i=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,r));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,u)=>{const d=i[0][u];u>=this.value.length||d===o.value||(o.reset(),o._appendChar(d,n))});const a=super._appendCharRaw(i[0][this.value.length],n);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(o=>a.aggregate(super._appendCharRaw(o))),a}return new xn({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new Cs("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new xn;const r=Math.min(super.nearestInputPos(0,Wt.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 a=super.remove(i,n);return a.tailShift+=i-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}ab.DEFAULTS={...Ii.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n};un.MaskedEnum=ab;class M$ extends Di{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}un.MaskedFunction=M$;var nF;class ga extends Di{constructor(t){super({...ga.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+vx(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(vx).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(vx(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 a=this._value;this._value+=t;const o=this.number;let u=!isNaN(o),d=!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(ga.UNMASKED_RADIX,this.radix),d||(d=a===this._value&&!n.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let m;u?m=new xn({inserted:this._value.slice(a.length),rawInserted:d?"":t,skip:d}):(this._value=a,m=new xn),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),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new xn({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case Wt.NONE:case Wt.LEFT:case Wt.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===Wt.FORCE_LEFT)return r}break}case Wt.RIGHT:case Wt.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,a,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===ga.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,ga.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(ga.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)||ga.EMPTY_VALUES.includes(t)&&ga.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}nF=ga;ga.UNMASKED_RADIX=".";ga.EMPTY_VALUES=[...Di.EMPTY_VALUES,0];ga.DEFAULTS={...Di.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[nF.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})};un.MaskedNumber=ga;const gR={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function rF(e,t,n){t===void 0&&(t=gR.MASKED),n===void 0&&(n=gR.MASKED);const r=Oo(e);return i=>r.runIsolated(a=>(a[t]=i,a[n]))}function D$(e,t,n,r){return rF(t,n,r)(e)}un.PIPE_TYPE=gR;un.createPipe=rF;un.pipe=D$;class I$ extends Ii{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:a,...o}=Fm(t);this._blockOpts=Object.assign({},this._blockOpts,o);const u=Oo(this._blockOpts);this.repeat=(n=(r=a!=null?a: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(Oo(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const r=new xn;for(let d=(i=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?i:Math.max(this._blocks.length-1,0),m,v;m=(o=this._blocks[d])!=null?o:v=!v&&this._allocateBlock(d);++d){var i,a,o,u;const g=m._appendChar(t,{...n,_beforeTailState:(u=n._beforeTailState)==null||(u=u._blocks)==null?void 0:u[d]});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 a=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 d=o;a<=d&&!this._blocks[d].unmaskedValue;--d,++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}}un.RepeatBlock=I$;try{globalThis.IMask=un}catch(e){}const iF={mask:ce.oneOfType([ce.array,ce.func,ce.string,ce.instanceOf(RegExp),ce.oneOf([Date,Number,un.Masked]),ce.instanceOf(un.Masked)]),value:ce.any,unmask:ce.oneOfType([ce.bool,ce.oneOf(["typed"])]),prepare:ce.func,prepareChar:ce.func,validate:ce.func,commit:ce.func,overwrite:ce.oneOfType([ce.bool,ce.oneOf(["shift"])]),eager:ce.oneOfType([ce.bool,ce.oneOf(["append","remove"])]),skipInvalid:ce.bool,onAccept:ce.func,onComplete:ce.func,placeholderChar:ce.string,displayChar:ce.string,lazy:ce.bool,definitions:ce.object,blocks:ce.object,enum:ce.arrayOf(ce.string),maxLength:ce.number,from:ce.number,to:ce.number,pattern:ce.string,format:ce.func,parse:ce.func,autofix:ce.oneOfType([ce.bool,ce.oneOf(["pad"])]),radix:ce.string,thousandsSeparator:ce.string,mapToRadix:ce.arrayOf(ce.string),scale:ce.number,normalizeZeros:ce.bool,padFractionalZeros:ce.bool,min:ce.oneOfType([ce.number,ce.instanceOf(Date)]),max:ce.oneOfType([ce.number,ce.instanceOf(Date)]),dispatch:ce.func,inputRef:ce.oneOfType([ce.func,ce.shape({current:ce.object})])},aF=Object.keys(iF).filter(e=>e!=="value"),P$=["value","unmask","onAccept","onComplete","inputRef"],j$=aF.filter(e=>P$.indexOf(e)<0);function T$(e){var t;const n=(t=class extends st.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var u;(u=this.element)!=null&&u.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=un(this.element,a).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(a){const{...o}=a;return Object.keys(o).filter(u=>j$.indexOf(u)<0).forEach(u=>{delete o[u]}),o}_extractNonMaskProps(a){const{...o}=a;return aF.forEach(u=>{u!=="maxLength"&&delete o[u]}),"defaultValue"in o||(o.defaultValue=a.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(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return st.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=iF,st.forwardRef((i,a)=>st.createElement(n,{...i,ref:a}))}const _$=T$(e=>{let{inputRef:t,...n}=e;return st.createElement("input",{...n,ref:t})}),N$=(e,t)=>st.createElement(_$,{...e,ref:t}),C0=st.forwardRef(N$),B$=({setShowWhatsappDialog:e})=>{const[t,n]=_.useState(null),r=v$(),i=ln(),a=()=>{if(!A0(t))return Ce.error("Please enter a valid phone number.",{id:"invalid-phone"});r.mutate({email:null,phoneNumber:t},{onSuccess:()=>{i.invalidateQueries(ig()),Ce.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"whatsapp-success"}),e(!1)},onError:o=>{Ce.error(`There was an error processing your request: ${(o==null?void 0:o.message)||"Unknown error"}`,{id:"whatsapp-error",duration:5e3})}})};return c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.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"}),c.jsx("div",{className:"text-md text-brand",children:"Enter the number associated with your WhatsApp account below."}),c.jsx("label",{htmlFor:"",className:"!text-brand !block !mt-5 !mb-0",children:"Phone Number with Country Code"}),c.jsx(C0,{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"}),c.jsxs("div",{className:"flex justify-end",children:[c.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue",onClick:()=>a(),disabled:r.isPending,children:r.isPending?c.jsx(Zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},k$=({setShowMessageDialog:e})=>{const[t,n]=_.useState(null),r=_.useRef(null),i=p$(),a=ln(),o=()=>{var u,d;if(!rg((u=r==null?void 0:r.current)==null?void 0:u.value))return Ce.error("Please enter a valid email.",{id:"invalid-icloud-email"});if(!A0(t))return Ce.error("Please enter a valid phone number.",{id:"invalid-phone"});i.mutate({email:(d=r==null?void 0:r.current)==null?void 0:d.value,phoneNumber:t},{onSuccess:()=>{a.invalidateQueries(ig()),Ce.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"imessage-success"}),e(!1)},onError:m=>{Ce.error(`There was an error processing your request: ${(m==null?void 0:m.message)||"Unknown error"}`,{id:"imessage-error",duration:5e3})}})};return c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.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"}),c.jsx("div",{className:"text-md text-brand",children:"Please use the email that is associated with your iCloud account."}),c.jsx("label",{htmlFor:"",className:"!text-brand !block !mt-5 !mb-0",children:"iCloud Email"}),c.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"}),c.jsx("label",{htmlFor:"",className:"!text-brand !block !mt-5 !mb-0",children:"Phone Number with Country Code"}),c.jsx(C0,{onAccept:(u,d)=>{n(d.unmaskedValue)},mask:[{mask:"+1 (000) 000-0000",startsWith:"+1",country:"US"},{mask:"+{0}000000000000000",startsWith:"+",country:"INTL"}],dispatch:(u,d)=>(d.value+u).replace(/\D/g,"").startsWith("1")?d.compiledMasks.find(v=>v.country==="US"):d.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"}),c.jsxs("div",{className:"flex justify-end",children:[c.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue",onClick:()=>o(),disabled:i.isPending,children:i.isPending?c.jsx(Zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},sF="data:image/png;base64,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",L$=({classList:e=""})=>{var m,v,g,b,y,x;const[t,n]=_.useState(!1),[r,i]=_.useState(!1),{data:a,isLoading:o}=Gt(ig()),u=((m=a==null?void 0:a.iMessage)==null?void 0:m.status)&&((v=a==null?void 0:a.iMessage)==null?void 0:v.status)!=3&&((g=a==null?void 0:a.iMessage)==null?void 0:g.id)!=0,d=((b=a==null?void 0:a.whatsApp)==null?void 0:b.status)&&((y=a==null?void 0:a.whatsApp)==null?void 0:y.status)!=3&&((x=a==null?void 0:a.whatsApp)==null?void 0:x.id)!=0;return c.jsxs("div",{className:`${e}`,children:[c.jsx(Ba,{title:"",children:o?c.jsx(Zt,{size:"md"}):c.jsxs(c.Fragment,{children:[c.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:[c.jsx("img",{src:sF,className:"w-[24px] h-[24px]",alt:""}),"Connect iMessage",c.jsx(Ae,{icon:u?Dn:yj,className:`${u?"text-light-gray":"text-link-color"}`,size:"small"})]}),c.jsxs("a",{className:`flex items-center gap-2 cursor-pointer font-semibold ${d?"text-light-gray":"text-link-color"}`,onClick:()=>d?null:i(!0),children:[c.jsx(Ae,{icon:eL,className:"text-green-800",size:"xlarge"}),"Connect WhatsApp",c.jsx(Ae,{icon:d?Dn:yj,className:`${d?"text-light-gray":"text-link-color"}`,size:"small"})]})]})}),t&&c.jsx(jn,{title:"",width:700,onClose:()=>n(!1),children:c.jsx(k$,{setShowMessageDialog:n})}),r&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsx(B$,{setShowWhatsappDialog:i})})]})},F$=({className:e=""})=>{var g,b,y,x;const{data:t,isLoading:n,isSuccess:r}=Gt(ig()),i=ir(),a=[i.accessor("name",{cell:A=>A.getValue(),header:()=>"Name",size:300}),i.accessor("imessage",{cell:A=>{const w=A.getValue();return c.jsx(bi,{status:w})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),i.accessor("whatsapp",{cell:A=>{const w=A.getValue();return c.jsx(bi,{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:"unavailable",statusTitle:"N/A"}:w0((b=t==null?void 0:t.whatsApp)==null?void 0:b.status),d=((y=t==null?void 0:t.iMessage)==null?void 0:y.id)==0?{status:"unavailable",statusTitle:"N/A"}:w0((x=t==null?void 0:t.iMessage)==null?void 0:x.status),m=_.useMemo(()=>[{name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:d,whatsapp:u}],[t]),v=or({data:m,columns:a,getCoreRowModel:ar(),getPaginationRowModel:sr(),getFilteredRowModel:gr(),getRowId:A=>A.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return c.jsxs("div",{className:`${e}`,children:[c.jsx("div",{children:c.jsx("h5",{className:"text-dark text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"})}),n?c.jsx(Zt,{}):c.jsx(Dr,{table:v,hasGlobalFilter:!1,filterButtons:o,searchPlaceholder:"Search Accounts",itemsLabel:"Account",bordered:!0,emptyMessage:n?"Loading...":"No accounts found"})]})},q$=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 1 of 5: Connect Your Text Messaging Accounts"}),c.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."})]}),c.jsx(L$,{}),c.jsx(F$,{className:"mt-10"}),c.jsx(rr,{prevLink:"/setup/hierarchy/website-reviewers",prevProgress:5,nextLink:"/setup/mobile/firm-accounts",nextProgress:6})]}),al={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}},ss=({activeChoiceId:e,choices:t,onChange:n,mode:r="blue"})=>{const i=a=>{n&&n(a)};return c.jsx("div",{className:`border ${al[r].border} rounded-sm flex w-fit max-w-full gap-0 overflow-clip`,children:t.map((a,o)=>c.jsx("span",{onClick:()=>i(a),className:`whitespace-nowrap ${al[r].padding} cursor-pointer ${al[r].horizontalBorders&&t.length>o+1?`border-r ${al[r].border}`:""} ${a.id==e?`${al[r].activeBackground} ${al[r].activeTextColor}`:`${al[r].background} ${al[r].textColor}`}`,children:a.title},o))})},z$=[{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"}],oF=({description:e=null,isSettings:t=!1})=>{const n=Xt(o=>o.setAccountSettings),r=Xt(o=>o.accountSettings),i=xi(),a=Dt({mutationKey:["updateReviewPeriodLimit"],mutationFn:async o=>{console.log(o);const u=await i.executeRequest("/accountsettings/mobilelimit","PUT",{limit:o});if(!u||u.error)throw new Error("Error updating review period limit");return o},onSuccess:o=>{n({...r,mobileLimit:o}),Ce.success("Review period limit updated successfully")},onError:o=>{console.error("Mutation error:",o),Ce.error("Error updating review period limit")}});return c.jsxs(Ba,{title:t?"Maximum Review Period Size":"Set Maximum Review Period Size",children:[e&&c.jsxs("div",{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),c.jsx("div",{className:"h-[50px]"})]}),c.jsx("h6",{className:"underlined-subtitle",children:"NUMBER OF ITEMS"}),c.jsx(ss,{activeChoiceId:r==null?void 0:r.mobileLimit,onChange:o=>{a.mutate(o.id)},choices:z$,disabled:a.isLoading})]})};function Q$(e,t,n,r){const i=_.useRef(null),a=_.useRef(0),o=_.useRef(0),u=_.useRef(null),d=_.useRef([]),m=_.useRef(),v=_.useRef(),g=_.useRef(e),b=_.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,j="debounceOnServer"in n&&!!n.debounceOnServer,D=C?Math.max(+n.maxWait||0,t):null;return _.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),_.useMemo(()=>{const S=L=>{const F=d.current,V=m.current;return d.current=m.current=null,a.current=L,o.current=o.current||L,v.current=g.current.apply(V,F)},T=(L,F)=>{x&&cancelAnimationFrame(u.current),u.current=x?requestAnimationFrame(L):setTimeout(L,F)},O=L=>{if(!b.current)return!1;const F=L-i.current;return!i.current||F>=t||F<0||C&&L-a.current>=D},M=L=>(u.current=null,w&&d.current?S(L):(d.current=m.current=null,v.current)),P=()=>{const L=Date.now();if(A&&o.current===a.current&&N(),O(L))return M(L);if(!b.current)return;const F=t-(L-i.current),V=C?Math.min(F,D-(L-a.current)):F;T(P,V)},N=()=>{r&&r({})},B=(...L)=>{if(!y&&!j)return;const F=Date.now(),V=O(F);if(d.current=L,m.current=this,i.current=F,V){if(!u.current&&b.current)return a.current=i.current,T(P,t),A?S(i.current):v.current;if(C)return T(P,t),S(i.current)}return u.current||T(P,t),v.current};return B.cancel=()=>{u.current&&(x?cancelAnimationFrame(u.current):clearTimeout(u.current)),a.current=0,d.current=i.current=m.current=u.current=null},B.isPending=()=>!!u.current,B.flush=()=>u.current?M(Date.now()):v.current,B},[A,C,t,D,w,x,y,j,r])}function H$(e,t){return e===t}function lF(e,t,n){const r=H$,i=_.useRef(e),[,a]=_.useState({}),o=Q$(_.useCallback(d=>{i.current=d,a({})},[a]),t,n,a),u=_.useRef(e);return r(u.current,e)||(o(e),u.current=e),[i.current,o]}const qj=[{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%"}],uF=({description:e=null,isSettings:t=!1})=>{const n=Xt(g=>g.setAccountSettings),r=Xt(g=>g.accountSettings),i=xi(),[a,o]=_.useState(""),[u]=lF(a,500),d=_.useRef(null),m=Dt({mutationFn:async g=>{const b=await i.executeRequest("/accountsettings/mobilesampling","PUT",{sampling:g});if(!b||b.error)throw new Error("Error updating sample percentage");return g},onSuccess:g=>{n({...r,mobileSampling:g}),Ce.success("Sample percentage updated successfully")},onError:()=>{Ce.error("Error updating sample percentage")}});_.useEffect(()=>{u!==""&&!isNaN(u)&&u>=0&&u<=100&&m.mutate(Number(u))},[u]),_.useEffect(()=>{qj.find(g=>g.id==(r==null?void 0:r.mobileSampling))||(d.current.value=r==null?void 0:r.mobileSampling)},[r==null?void 0:r.mobileSampling]);const v=g=>{const b=Math.floor(g.target.value);if(b<0){d.current.value=0,o(0);return}if(b>100){d.current.value=100,o(100);return}o(b)};return c.jsxs(Ba,{title:t?"Mobile Sample Percentage":"Set Mobile Sample Percentage",children:[e&&c.jsxs("div",{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),c.jsx("div",{className:"h-[50px]"})]}),c.jsx("h6",{className:"underlined-subtitle",children:"SAMPLE PERCENTAGE RATE"}),c.jsx(ss,{activeChoiceId:r==null?void 0:r.mobileSampling,onChange:g=>{d.current.value="",m.mutate(g.id)},choices:qj}),c.jsx("div",{className:"h-[50px]"}),c.jsx("h6",{className:"underlined-subtitle",children:"CUSTOM PERCENTAGE RATE"}),c.jsxs("div",{children:[c.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:a,onChange:v,ref:d}),c.jsx("p",{className:"text-sm",children:"Enter a number or percentage"})]})]})},V$=e=>({queryKey:["account",e],queryFn:()=>wt.executeRequest(`/accounts/${e}`,"GET")}),TO={queryKey:["settings"],queryFn:()=>wt.executeRequest("/accountsettings","GET"),retry:!1},ag=({archivingType:e,pageType:t})=>{const n=ln();return Dt({mutationFn:r=>{const i={archivingType:e,pageType:t,frequency:r};return wt.executeRequest("/accountsettings","PUT",i)},onSuccess:()=>{n.invalidateQueries(TO),Ce.success("Review frequency updated!")},onError:()=>{Ce.error("Error occurred while setting review frequency")}})},cF=({description:e=null,isSettings:t=!1})=>{const n=Xt(i=>i.accountSettings),{mutate:r}=ag({archivingType:"mobile",pageType:"setup"});return c.jsx("section",{className:"",children:c.jsx(Ba,{title:t?"Mobile Review Frequency":"Set Mobile Review Frequency",children:c.jsxs("div",{className:"",children:[e&&c.jsxs("div",{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),c.jsx("div",{className:"h-[50px]"})]}),c.jsx("h6",{className:"underlined-subtitle uppercase",children:"REVIEW FREQUENCY"}),c.jsx(ss,{activeChoiceId:n==null?void 0:n.mobileFrequency,onChange:i=>{r(i.id)},choices:fL})]})})})},Y$=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 3 of 5: Set Review Frequency and Size"}),c.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."})]}),c.jsx(cF,{description:`<p>The review frequency is the frequency which you will be prompted to review your firm’s mobile messages.</p>
|
|
590
|
+
*/const Sm=class extends _.Component{constructor(t){super(t),this.context=0,this.titleId=this.generateTitleId(),this.contentId=this.generateContentId(),this.activeElement=null,this.onCloseDialog=n=>{n.preventDefault(),es(this.props.onClose,n,this,void 0)},this.onKeyDown=n=>{n.keyCode===Ln.esc&&this.props.onClose&&(n.preventDefault(),this.onCloseDialog(n)),$G(n,this.element)},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:HJ:this.state.zIndex>(this.context?this.context+mR:0)?this.state.zIndex:this.context+mR,this.getDocument=()=>{const n=Sd?document:null;return this.props.appendTo?this.props.appendTo.ownerDocument:n},Sd&&(this.activeElement=Wu(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=[...W0].map(n=>n+":not(.k-dialog-titlebar *)");JG(this.element,t)}this.setState({zIndex:YJ(this.getCurrentZIndex(),this.getDocument(),this._id)})}}componentWillUnmount(){setTimeout(()=>{var t;!this.element&&this.activeElement&&Sd&&(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:a,minWidth:o,dir:u,style:d,contentStyle:m,modal:v=!0}=this.props,g=_.Children.toArray(a),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=_.createElement(of.Provider,{value:w},_.createElement("div",{[QL]:this._id,className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:u,style:{zIndex:w,...d},ref:j=>{this.element=j}},v&&_.createElement("div",{className:"k-overlay",style:this.props.overlayStyle}),_.createElement("div",{...x,className:nr("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&&_.createElement(QJ,{closeIcon:A,onCloseButtonClick:this.onCloseDialog,id:t},n),_.createElement("div",{className:"k-window-content k-dialog-content",style:m,id:this.contentId},b),y)));return Sd?this.props.appendTo!==null?L0.createPortal(C,this.props.appendTo||document.body):C:null}getActionBar(t){return t.filter(n=>n&&n.type===hR)}getContent(t){return t.filter(n=>n&&n.type!==hR)}generateTitleId(){return"dialog-title-"+this._id}generateContentId(){return"dialog-content-"+this._id}};Sm.displayName="Dialog",Sm.propTypes={title:ce.any,id:ce.string,dir:ce.string,style:ce.object,closeIcon:ce.bool,width:ce.oneOfType([ce.number,ce.string]),height:ce.oneOfType([ce.number,ce.string]),minWidth:ce.oneOfType([ce.number,ce.string]),autoFocus:ce.bool},Sm.defaultProps={autoFocus:!1},Sm.contextType=of;let UJ=Sm;const WJ=W8(),Lm=G0(G8(WJ,UJ));Lm.displayName="KendoReactDialog";const jn=e=>c.jsx(Lm,{...e,appendTo:null}),Nj=["Facebook","Instagram","Twitter","LinkedIn"],GJ=e=>[...e].sort((t,n)=>{const r=Nj.indexOf(t.platform),i=Nj.indexOf(n.platform);return r!==-1&&i!==-1?r-i:r!==-1?-1:i!==-1?1:t.platform.localeCompare(n.platform)}),Bj=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),PO=e=>/^(?!:\/\/)([a-zA-Z0-9-_]+\.)+[a-zA-Z]{2,}$/.test(e),rg=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),eb=e=>{if(e.includes("/email"))return"email";if(e.includes("/social_media"))return"social_media";if(e.includes("/website"))return"website"},XJ=(e,t)=>{const r=`\\b${(a=>a==null?void 0:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},kj=(e,t)=>{const r=`\\b${(a=>a==null?void 0:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)}\\b`;return new RegExp(r,"i").test(e)},HL=(e,t,n)=>{const r=VL(YL(e));return r?t==null?void 0:t.filter(i=>{if(!i)return!1;const a=i.keyword.trim();if(!kj(r,a))return!1;if(!n||n.length<1)return!0;const o=n==null?void 0:n.filter(d=>{var m,v;return(v=(m=d==null?void 0:d.item)==null?void 0:m.toLowerCase())==null?void 0:v.includes(a==null?void 0:a.toLowerCase())});return(o==null?void 0:o.length)===0?!0:!(o==null?void 0:o.some(d=>kj(r,d==null?void 0:d.item)))}):[]},ZJ=(e,t)=>{const n=VL(YL(e));return n?t==null?void 0:t.filter(r=>{var i;return!!XJ(n,(i=r==null?void 0:r.item)==null?void 0:i.toLowerCase())}):[]},VL=e=>e&&e.replace(/[\r?\n!@#&*()\-\–—+=\[\]{}|:;'\"‘’“”,.<>\?/]/g," "),YL=e=>e&&e.replace(/<[^>]*>/g,""),KJ=e=>{if(!e)return e;const t=e.match(/@(.+)$/);return t?t[1]:null},JJ=e=>/^(?!\.)(?!.*\.\.)[A-Za-z0-9._+-]+(?<!\.)$/.test(e),$J=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 a=r.find(m=>m.type==="month").value,o=r.find(m=>m.type==="year").value,u=parseInt(i,10);let d="th";return u%10===1&&u!==11?d="st":u%10===2&&u!==12?d="nd":u%10===3&&u!==13&&(d="rd"),`${a} ${u}${d}, ${o}`},A0=e=>{if(!e)return!1;const t=e.replace(/\D/g,"");return!(t.length<8||t.length>15)},e$=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=_.useState(!1),[a,o]=_.useState(""),[u,d]=_.useState(!1),[m,v]=_.useState(),g=ir();ln();const b=_.useRef(null),y=[g.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:T})=>A===T.original.id?c.jsx("input",{onClick:M=>M.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:T.original.item,ref:b}):T.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:T})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:O=>{O.stopPropagation(),d(!0),v(T.original)}})})],x=[{label:"Add",icon:cr,onClick:()=>{i(!0)}}];Mo();const[A,w]=_.useState(),C=cf();function j(T){T&&C.mutate(T==null?void 0:T.id,{onSuccess:()=>{d(!1)}})}const D=uf();function I(){if(!rg(a))return Ce.error("Please enter a valid email!",{id:"new-excluded-email"});D.mutate({itemType:"sender",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const S=or({data:e,columns:y,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:T=>T.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Dr,{table:S,onRowClick:T=>{T.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Associated Contacts",rowSelectedCheck:T=>T.original.checked===1,collapseSearchAndFilters:!0}),r&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:T=>o(T.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:I,disabled:D.isPending,children:D.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),u&&c.jsx(jn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Associated Contact"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this associated contact?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>j(m),disabled:C.isPending,children:C.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},t$=({data:e=[],isLoading:t=!1})=>{const[n,r]=_.useState(!1),[i,a]=_.useState(""),[o,u]=_.useState(!1),[d,m]=_.useState(),v=ir();ln();const g=_.useRef(null),b=[v.accessor("item",{header:"Email Domains",size:"unset",cell:({row:S})=>x===S.original.id?c.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:S.original.item,ref:g}):S.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:S})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:T=>{T.stopPropagation(),u(!0),m(S.original)}})})],y=[{label:"Add Domain",icon:cr,onClick:()=>{r(!0)}}];Mo();const[x,A]=_.useState(),w=cf();function C(S){S&&w.mutate(S==null?void 0:S.id,{onSuccess:()=>{u(!1)}})}const j=uf();function D(){if(!PO(i))return Ce.error("Please enter a valid domain!",{id:"new-email-domain"});j.mutate({itemType:"domain",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const I=or({data:e,columns:b,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:S=>S.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Domains"})}),c.jsx(Dr,{table:I,onRowClick:S=>{S.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:S=>S.original.checked===1}),n&&c.jsx(jn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:S=>a(S.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:D,disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),o&&c.jsx(jn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(d),disabled:w.isPending,children:w.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},n$=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=_.useState(!1),[a,o]=_.useState(""),[u,d]=_.useState(!1),[m,v]=_.useState(),g=ir();ln();const b=_.useRef(null),y=[g.accessor("item",{header:"Email Prefixes",size:"unset",cell:({row:O})=>A===O.original.id?c.jsx("input",{onClick:P=>P.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})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:M=>{M.stopPropagation(),d(!0),v(O.original)}})})],x=[{label:"Add",icon:cr,onClick:()=>{i(!0)}}];Mo();const[A,w]=_.useState(),C=qZ(),j=cf();function D(O){O&&((O==null?void 0:O.addedType)=="added"?j.mutate(O==null?void 0:O.id,{onSuccess:()=>{d(!1)}}):C.mutate(O==null?void 0:O.id,{onSuccess:()=>{d(!1)}}))}const I=uf();function S(){if(e.find(O=>O.item==a))return i(!1),Ce.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!a||(a==null?void 0:a.trim())==""||!JJ(a))return Ce.error("Please enter a valid email prefix!",{id:"new-email-prefix"});I.mutate({itemType:"username",filterType:"spam_email",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const T=or({data:e,columns:y,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:O=>O.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Dr,{table:T,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&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Prefix"}),c.jsxs("div",{className:"flex items-center",children:[c.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:S,disabled:I.isPending,children:I.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),u&&c.jsx(jn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>D(m),disabled:C.isPending,children:C.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},r$=({data:e=[],isLoading:t=!1})=>{const[n,r]=_.useState(!1),[i,a]=_.useState(""),[o,u]=_.useState(!1),[d,m]=_.useState(),v=ir();ln();const g=_.useRef(null),b=[v.accessor("item",{header:"Recipients",size:"unset",cell:({row:S})=>x===S.original.id?c.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:S.original.item,ref:g}):S.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:S})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:T=>{T.stopPropagation(),u(!0),m(S.original)}})})],y=[{label:"Add Email",icon:cr,onClick:()=>{r(!0)}}];Mo();const[x,A]=_.useState(),w=cf();function C(S){S&&w.mutate(S==null?void 0:S.id,{onSuccess:()=>{u(!1)}})}const j=uf();function D(){if(!rg(i))return Ce.error("Please enter a valid email!",{id:"new-excluded-email"});j.mutate({itemType:"recipient",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const I=or({data:e,columns:b,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:S=>S.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Recipients"})}),c.jsx(Dr,{table:I,onRowClick:S=>{S.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Recipients",rowSelectedCheck:S=>S.original.checked===1}),n&&c.jsx(jn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:S=>a(S.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:D,disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),o&&c.jsx(jn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Recipient"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this recipient?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(d),disabled:w.isPending,children:w.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},i$=({data:e=[],isLoading:t=!1})=>{const[n,r]=_.useState(!1),[i,a]=_.useState(""),[o,u]=_.useState(!1),[d,m]=_.useState(),v=ir();ln();const g=_.useRef(null),b=[v.accessor("item",{header:"Email Addresses",size:"unset",cell:({row:S})=>x===S.original.id?c.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:S.original.item,ref:g}):S.original.item}),v.display({size:65,id:"delete",header:()=>null,cell:({row:S})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:T=>{T.stopPropagation(),u(!0),m(S.original)}})})],y=[{label:"Add Email",icon:cr,onClick:()=>{r(!0)}}];Mo();const[x,A]=_.useState(),w=cf();function C(S){S&&w.mutate(S==null?void 0:S.id,{onSuccess:()=>{u(!1)}})}const j=uf();function D(){if(!rg(i))return Ce.error("Please enter a valid email!",{id:"new-excluded-email"});j.mutate({itemType:"sender",filterType:"blacklist",item:i,advancedSetting:!1},{onSuccess:()=>{a(""),r(!1)}})}const I=or({data:e,columns:b,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:S=>S.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:"relative",children:[c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-2",children:"Excluded Senders"})}),c.jsx(Dr,{table:I,onRowClick:S=>{S.toggleSelected()},bordered:!1,filterButtons:y,hasGlobalFilter:!0,searchPlaceholder:"Search Email Addresses",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Senders",rowSelectedCheck:S=>S.original.checked===1}),n&&c.jsx(jn,{title:"",width:700,onClose:()=>r(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>r(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:S=>a(S.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:D,disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),o&&c.jsx(jn,{title:"",width:700,onClose:()=>u(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>u(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Sender"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this sender?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>u(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>C(d),disabled:w.isPending,children:w.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},a$=({classList:e=""})=>{var O;const{data:t,isLoading:n}=Gt(QZ()),r=(O=t==null?void 0:t.payload)!=null?O:[],[i,a]=_.useState(!1),[o,u]=_.useState(""),[d,m]=_.useState(!1),[v,g]=_.useState(),b=ir();ln();const y=_.useRef(null),x=[b.accessor("item",{header:"Phrase",size:"unset",cell:({row:M})=>w===M.original.id?c.jsx("input",{onClick:N=>N.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:M.original.item,ref:y}):M.original.item}),b.display({size:65,id:"delete",header:()=>null,cell:({row:M})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:P=>{P.stopPropagation(),m(!0),g(M.original)}})})],A=[{label:"Add",icon:cr,onClick:()=>{a(!0)}}];Mo();const[w,C]=_.useState(),j=FZ();function D(M){M&&j.mutate({archivingType:"email",filterType:"spam_phrase",multipleType:!1,itemId:M.id,itemType:M.itemType},{onSuccess:()=>{m(!1)}})}const I=RO();function S(){if(r.find(M=>M.item==o))return a(!1),Ce.error("Whoops! The item you entered already exists in this list.",{id:"new-email-prefix"});if(!o||(o==null?void 0:o.trim())=="")return Ce.error("Please enter a valid phrase!",{id:"new-spam-phrase"});I.mutate({archivingType:"email",filterType:"spam_phrase",item:o},{onSuccess:()=>{u(""),a(!1)}})}const T=or({data:r,columns:x,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:M=>M.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${e}`,children:[c.jsx(Dr,{table:T,onRowClick:M=>{M.toggleSelected()},emptyMessage:n?"Loading...":"No items found",bordered:!1,filterButtons:A,hasGlobalFilter:!0,searchPlaceholder:"Search or add new phrases",itemsLabel:"Phrases",rowSelectedCheck:M=>M.original.checked===1,collapseSearchAndFilters:!0}),i&&c.jsx(jn,{title:"",width:700,onClose:()=>a(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>a(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Phrase"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:M=>u(M.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:S,disabled:I.isPending,children:I.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),d&&c.jsx(jn,{title:"",width:700,onClose:()=>m(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>m(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Phrase"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this phrase?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>m(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>D(v),disabled:j.isPending,children:j.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},s$=({data:e=[],isLoading:t=!1,classList:n=""})=>{const[r,i]=_.useState(!1),[a,o]=_.useState(""),[u,d]=_.useState(!1),[m,v]=_.useState(),g=ir();ln();const b=_.useRef(null);_.useRef(null);const y=[g.accessor("item",{header:"Email Domains",size:"unset",cell:({row:T})=>A===T.original.id?c.jsx("input",{onClick:M=>M.stopPropagation(),className:"w-full px-4 py-2 border border-gray-300 rounded-md bg-white text-blue-900 focus:outline-none",defaultValue:T.original.item,ref:b}):T.original.item}),g.display({size:65,id:"delete",header:()=>null,cell:({row:T})=>c.jsx(Ae,{className:"",icon:ba,size:"large",onClick:O=>{O.stopPropagation(),d(!0),v(T.original)}})})],x=[{label:"Add",icon:cr,onClick:()=>{i(!0)}}];Mo();const[A,w]=_.useState(),C=cf();function j(T){T&&C.mutate(T==null?void 0:T.id,{onSuccess:()=>{d(!1)}})}const D=uf();function I(){if(!PO(a))return Ce.error("Please enter a valid domain!",{id:"new-email-domain"});D.mutate({itemType:"domain",filterType:"internal",item:a,advancedSetting:!0},{onSuccess:()=>{o(""),i(!1)}})}const S=or({data:e,columns:y,getCoreRowModel:ar(),getPaginationRowModel:sr(),getRowId:T=>T.id.toString(),getFilteredRowModel:gr(),globalFilterFn:"includesString",autoResetPageIndex:!1});return c.jsxs("section",{className:`relative ${n}`,children:[c.jsx(Dr,{table:S,onRowClick:T=>{T.toggleSelected()},bordered:!1,filterButtons:x,hasGlobalFilter:!0,searchPlaceholder:"Search Email Domains",emptyMessage:t?"Loading...":"No items found",itemsLabel:"Domains",rowSelectedCheck:T=>T.original.checked===1,collapseSearchAndFilters:!0}),r&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>i(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"text-blue-900 border-b-6 border-blue-900 mb-10 text-xl font-semibold pb-2",children:"Add New Email"}),c.jsxs("div",{className:"flex items-center",children:[c.jsx("input",{type:"text",onChange:T=>o(T.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"}),c.jsx("button",{className:"uppercase btn-blue ml-3",onClick:I,disabled:D.isPending,children:D.isPending?c.jsx(Zt,{colorClass:"text-white"}):c.jsxs(c.Fragment,{children:[c.jsx(Ae,{className:"mr-2",icon:cr,size:"medium"})," Add"]})})]})]})}),u&&c.jsx(jn,{title:"",width:700,onClose:()=>d(!1),children:c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>d(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.jsx("h2",{className:"border-b border-b-6 border-blue-900 !mb-5 text-xl font-semibold pb-2",children:"Delete Domain"}),c.jsx("p",{className:"font-semibold text-lg mb-2",children:"Are you sure you would like to remove this domain?"}),c.jsxs("div",{className:"mt-5 flex justify-end",children:[c.jsx("button",{className:"btn-transparent uppercase",onClick:()=>d(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue uppercase",onClick:()=>j(m),disabled:C.isPending,children:C.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Remove"})]})]})})]})},o$=()=>{var m,v,g,b,y,x;const{data:e,isLoading:t,isSuccess:n}=Gt(HZ()),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,a=(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,d=(x=e==null?void 0:e.internal)==null?void 0:x.sender;return c.jsx("section",{className:"flex flex-col w-full !mb-3",children:c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9 mb-10",children:"Excluded Emails"}),c.jsxs(tg,{children:[c.jsxs(Zr,{label:"Recipients",onActive:()=>{},children:[c.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."}),c.jsx(r$,{isLoading:t,data:r})]}),c.jsxs(Zr,{label:"Senders",onActive:()=>{},children:[c.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."}),c.jsx(i$,{isLoading:t,data:i})]}),c.jsxs(Zr,{label:"Domains",onActive:()=>{},children:[c.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."}),c.jsx(t$,{isLoading:t,data:a})]}),c.jsxs(Zr,{label:"Spam",onActive:()=>{},children:[c.jsx("p",{className:"mb-10",children:"Below are the email domains that are excluded from your review."}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Excluded Spam"})}),c.jsxs(Dj,{children:[c.jsx(Zr,{label:"Email Prefixes",onActive:()=>{},children:c.jsx(n$,{data:o,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(Zr,{label:"Phrases",onActive:()=>{},children:c.jsx(a$,{classList:"mt-[-1px]"})})]})]}),c.jsxs(Zr,{label:"Advanced",onActive:()=>{},children:[c.jsx("p",{className:"mb-10"}),c.jsx(VZ,{data:u}),c.jsx("div",{children:c.jsx("h4",{className:"font-semibold text-2xl mb-5",children:"Additional Exclusions"})}),c.jsxs(Dj,{children:[c.jsx(Zr,{label:"Internal Domains",onActive:()=>{},children:c.jsx(s$,{data:u,isLoading:t,classList:"mt-[-1px]"})}),c.jsx(Zr,{label:"Associated Contacts",onActive:()=>{},children:c.jsx(e$,{data:d,isLoading:t,classList:"mt-[-1px]"})})]})]})]})]})})},l$=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/instagram?url=${e}`,"GET"),onError:()=>Ce.error("Error occurred while trying to connect to Instagram account.")}),u$=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/instagram/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ce.error("Error occurred while trying to connect to Instagram account."),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${wt.getUser()}`}}),UL=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/linkedin/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ce.error("Error occurred while trying to connect to LinkedIn account."),onSuccess:t=>{window.location.href=`${t}&encryptedUser=${wt.getUser()}`}}),c$=e=>Dt({mutationFn:()=>wt.executeRequest(`/socialmedia/facebook/employee?url=${e}`,"GET",null,null,!1,!0),onError:()=>Ce.error("Error occurred while trying to connect to Facebook account."),onSuccess:t=>{window.location.href=t}}),d$=(e,t)=>Dt({mutationFn:n=>wt.executeRequest(`/socialmedia/firm?type=${n}&firmURL=${e}&employeeURL=${t}`,"GET"),onError:()=>Ce.error("Error occurred while trying to connect to Facebook account."),onSuccess:n=>{window.location.href=n==null?void 0:n.firmURL}}),WL=()=>{const e=ln();return Dt({mutationFn:({accountType:t,screenName:n,isTodoReconnect:r})=>wt.executeRequest("/socialmedia/twitter/response","POST",{accountType:t,screenName:n,isTodoReconnect:r}),onSettled:t=>{e.invalidateQueries({queryKey:tb().queryKey}),e.invalidateQueries({queryKey:ZL.queryKey}),e.invalidateQueries({queryKey:ys().queryKey})}})},f$=()=>{const e=ln();return Dt({mutationFn:({type:t,accountType:n})=>wt.executeRequest("/socialmedia/disconnect","POST",{type:t,accountType:n}),onSuccess:()=>{e.invalidateQueries({queryKey:tb().queryKey}),e.invalidateQueries({queryKey:ys().queryKey})}})},GL=()=>Dt({mutationFn:e=>wt.executeRequest("/accountsettings/approved","PUT",{approved:e}),onSuccess:()=>{}}),h$=()=>{const e=ln();return Dt({mutationFn:({archivingType:t,itemId:n,itemType:r,filterType:i})=>wt.executeRequest("/Archiving/readd_archiving_keyword_and_added_item","POST",{archivingType:t,itemId:n,itemType:r,filterType:i}),onSuccess:()=>{e.invalidateQueries({queryKey:["deleteKeywords"]}),e.invalidateQueries({queryKey:["keywordsAndPhrases"]})}})},m$=(e="social_media")=>({queryKey:["deleteKeywords",e],queryFn:()=>wt.executeRequest(`/Popups/archiving_view_previously_removed_keywords/${e}`,"POST")}),ys=()=>({queryKey:["socialMediaStatuses"],queryFn:()=>wt.executeRequest("/socialmedia/check/statuses","GET")}),$d=()=>({queryKey:["heightenedSupervisionUsers"],queryFn:async()=>{const e=await wt.executeRequest("/heightenedsupervisionusers/users","GET");if(!e||e.error)throw new Error("Error occurred while fetching users");return e}}),g$=()=>Dt({mutationFn:({types:e,employees:t})=>wt.executeRequest("/employeerequests","POST",{types:e,employees:t})}),XL=()=>({queryKey:["socialmediatypes"],queryFn:()=>wt.executeRequest("/socialmedia/types","GET"),retry:!1}),tb=()=>({queryKey:["employeeaccounts"],queryFn:()=>wt.executeRequest("/socialmedia/employee/accounts?url=mrc","GET")}),ZL={queryKey:["employeeAccountsStatus"],queryFn:()=>wt.executeRequest("/socialmedia/employee/statuses","GET")},bi=({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_connected:"text-[#008E28]",linkedin_connected:"text-[#008E28]",instagram_connected:"text-[#008E28]",twitter_connected:"text-[#008E28]",connected:"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-[#AA2400]",linkedin_unavailable:"text-[#AA2400]",instagram_unavailable:"text-[#AA2400]",twitter_unavailable:"text-[#AA2400]",unavailable:"text-[#AA2400]",facebook_connect:"text-[#005DEC]",linkedin_connect:"text-[#005DEC]",instagram_connect:"text-[#005DEC]",twitter_connect:"text-[#005DEC]",connect:"text-[#005DEC]"};let n=ta,r="";switch(e.status){case"facebook_active":case"linkedin_active":case"instagram_active":case"twitter_active":case"active":case"facebook_connected":case"linkedin_connected":case"instagram_connected":case"twitter_connected":case"connected":n=tL,r="Active";break;case"facebook_inactive":case"linkedin_inactive":case"instagram_inactive":case"twitter_inactive":case"inactive":n=ta,r="Inactive";break;case"facebook_pending":case"linkedin_pending":case"instagram_pending":case"twitter_pending":case"pending":n=VX,r="Pending";break;case"facebook_connect":case"linkedin_connect":case"instagram_connect":case"twitter_connect":case"connect":n=XX,r="Connect";break;default:n=ta,r="N/A"}return c.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:[c.jsx(Ae,{icon:n,size:"small",className:"fill-current"}),c.jsx("div",{className:"capitalize flex-grow text-center",children:r})]})},px={PENDING:1,CONNECTED:2,DISCONNECTED:3},mr={iMessage:32,WhatsApp:33},w0=e=>{switch(e){case px.PENDING:return{status:"pending",statusTitle:"Pending"};case px.CONNECTED:return{status:"active",statusTitle:"Active"};case px.DISCONNECTED:default:return{status:"unavailable",statusTitle:"N/A"}}},ig=()=>({queryKey:["accountconnections"],queryFn:()=>wt.executeRequest("/mobilechannelconnections/connection","GET")}),fd=()=>({queryKey:["mobileuserstatuses"],queryFn:()=>wt.executeRequest("/mobilechannelconnections/check/statuses","GET")}),p$=()=>Dt({mutationFn:e=>wt.executeRequest("/imessages","POST",e),onSuccess:(e,t)=>{}}),v$=()=>Dt({mutationFn:e=>wt.executeRequest("/whatsapp","POST",e),onSuccess:(e,t)=>{}}),b$=()=>Dt({mutationFn:e=>wt.executeRequest("/mobilechannelconnections/connection_request","POST",{requests:e}),onSuccess:(e,t)=>{}}),Fp={status:"unavailable",statusTitle:"Unavailable",ts:null,active:!1},KL=({showName:e,hasRowSelection:t=!1,description:n=null,isSettings:r=!1})=>{var B,L,F,V;const i=b$(),{data:a,isLoading:o,isSuccess:u}=Gt(ig()),{data:d,isLoading:m,isSuccess:v}=Gt($d()),{data:g,isLoading:b,isSuccess:y}=Gt(fd()),x=ln();_.useEffect(()=>{v&&y&&x.setQueryData(fd().queryKey,W=>{if(!W)return{};const Q={...W};return d.forEach(X=>{Q[X.id]||(Q[X.id]={}),Object.values(mr).forEach($=>{Q[X.id][$]||(Q[X.id][$]={...Fp})})}),Q})},[v,y,g,d,x]);const A=g&&d?Object.entries(g).flatMap(([W,Q])=>Object.entries(Q).filter(([X,$])=>$.active===1).map(([X])=>({userId:parseInt(W),integrationId:parseInt(X)})).filter(X=>!isNaN(X.userId)&&!isNaN(X.integrationId))):[],w=ir(),C=(W,Q,X)=>{const $=X?1:0;x.setQueryData(fd().queryKey,re=>{var z;return re&&((z=re==null?void 0:re[W])!=null&&z[Q]?{...re,[W]:{...re==null?void 0:re[W],[Q]:{...re[W][Q],active:$}}}:{...re,[W]:{...re==null?void 0:re[W],[Q]:{...Fp,active:X}}})})},j=W=>{x.setQueryData(fd().queryKey,Q=>Q&&Object.fromEntries(Object.entries(Q).map(([$,re])=>[$,Object.fromEntries(Object.entries(re).map(([z,H])=>[z,{...H,active:W?1:0}]))])))},D=(W,Q)=>{if(isNaN(W))return Ce.error("You cannot send a request for 'Your Mobile Accounts'.");x.setQueryData(fd().queryKey,X=>{if(!(X!=null&&X[W]))return X;const $=Object.fromEntries(Object.entries(X[W]).map(([re,z])=>[re,{...z,active:Q?1:0}]));return{...X,[W]:$}})},I=((B=a==null?void 0:a.whatsApp)==null?void 0:B.id)==0?{status:"unavailable",statusTitle:"N/A"}:w0((L=a==null?void 0:a.whatsApp)==null?void 0:L.status),T={name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:((F=a==null?void 0:a.iMessage)==null?void 0:F.id)==0?{status:"unavailable",statusTitle:"N/A"}:w0((V=a==null?void 0:a.iMessage)==null?void 0:V.status),whatsapp:I},O=_.useMemo(()=>{if(!d||!g)return[];const W=d.map(Q=>{var X,$;return{id:Q.id,name:`${Q.firstName} ${Q.lastName}`,imessage:((X=g==null?void 0:g[Q.id])==null?void 0:X[mr==null?void 0:mr.iMessage])||Fp,whatsapp:(($=g==null?void 0:g[Q.id])==null?void 0:$[mr==null?void 0:mr.WhatsApp])||Fp}});return W.unshift({...T}),W},[d,g,r]),M=[w.accessor("name",{cell:W=>W.getValue(),header:()=>e?"Name":"",size:300}),w.accessor("imessage",{cell:W=>{const Q=W.getValue();return c.jsxs("label",{htmlFor:`imessage-check-${W.row.id}-${mr==null?void 0:mr.iMessage}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`imessage-check-${W.row.id}-${mr==null?void 0:mr.iMessage}`,checked:!!Q.active,onChange:X=>C(W.row.id,mr==null?void 0:mr.iMessage,X.target.checked)}),c.jsx(bi,{status:Q})]})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),w.accessor("whatsapp",{cell:W=>{const Q=W.getValue();return c.jsxs("label",{htmlFor:`whatsapp-check-${W.row.id}-${mr==null?void 0:mr.WhatsApp}`,className:"flex items-center cursor-pointer",children:[c.jsx("input",{type:"checkbox",id:`whatsapp-check-${W.row.id}-${mr==null?void 0:mr.WhatsApp}`,checked:!!Q.active,onChange:X=>C(W.row.id,mr==null?void 0:mr.WhatsApp,X.target.checked)}),c.jsx(bi,{status:Q})]})},header:"WhatsApp",size:130,maxSize:160,enableGlobalFilter:!1})];t&&M.unshift(w.accessor("id",{header:({table:W})=>c.jsx("input",{type:"checkbox",checked:g&&A.length>0&&Object.values(g).every(Q=>Object.values(Q).every(X=>X.active===1)),onChange:Q=>j(Q.target.checked)}),cell:({row:W})=>{var X;let Q=!1;if(W.id!="firm_mobile_accounts"&&W.id!="your_mobile_accounts"){const $=parseInt(W.original.id);Q=A.filter(z=>z.userId===$).length>0&&Object.values((X=g==null?void 0:g[W.original.id])!=null?X:{}).every(z=>z.active===1)}return c.jsx("input",{type:"checkbox",checked:Q,onChange:$=>{D(parseInt(W.original.id),$.target.checked)}})},maxSize:55}));const P=[{label:i.isPending?c.jsx(Zt,{colorClass:"text-white"}):"Send Request",active:t,onClick:()=>{if(!i.isPending){if(A.length<1)return Ce.error("Please select at least one integration!",{id:"no-selection-error",duration:5e3});i.mutate(A,{onSuccess:()=>{x.invalidateQueries({queryKey:$d().queryKey}),x.invalidateQueries({queryKey:fd().queryKey}),Ce.success("To do list items have been sent for mobile setup.",{id:"mobile-request-success",duration:5e3})}})}},icon:rL}],N=or({data:O,columns:M,getCoreRowModel:ar(),getPaginationRowModel:sr(),getFilteredRowModel:gr(),getRowId:W=>W.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return c.jsxs("div",{children:[c.jsxs("div",{children:[c.jsx("h5",{className:"text-brand text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"}),n&&c.jsx("p",{className:"mb-5"})]}),c.jsx(Dr,{table:N,hasGlobalFilter:t,filterButtons:P,searchPlaceholder:"Search Accounts",itemsLabel:"Accounts",bordered:!0,emptyMessage:m||b?"Loading...":"No accounts found"})]})},y$=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 2 of 5: Connect Firm Text Messaging Accounts"}),c.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."})]}),c.jsx(KL,{showName:!0,hasRowSelection:!0}),c.jsx(rr,{prevLink:"/setup/mobile",prevProgress:6,nextLink:"/setup/mobile/review-frequency-and-size",nextProgress:7})]});function Il(e){return typeof e=="string"||e instanceof String}function Lj(e){var t;return typeof e=="object"&&e!=null&&(e==null||(t=e.constructor)==null?void 0:t.name)==="Object"}function JL(e,t){return Array.isArray(t)?JL(e,(n,r)=>t.includes(r)):Object.entries(e).reduce((n,r)=>{let[i,a]=r;return t(a,i)&&(n[i]=a),n},{})}const Wt={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function x$(e){switch(e){case Wt.LEFT:return Wt.FORCE_LEFT;case Wt.RIGHT:return Wt.FORCE_RIGHT;default:return e}}function vx(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function E0(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(!E0(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){const a=t instanceof Date,o=e instanceof Date;if(a&&o)return t.getTime()==e.getTime();if(a!=o)return!1;const u=t instanceof RegExp,d=e instanceof RegExp;if(u&&d)return t.toString()==e.toString();if(u!=d)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(!E0(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 A${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?Wt.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Wt.RIGHT:Wt.LEFT}}function un(e,t){return new un.InputMask(e,t)}function $L(e){if(e==null)throw new Error("mask property should be defined");return e instanceof RegExp?un.MaskedRegExp:Il(e)?un.MaskedPattern:e===Date?un.MaskedDate:e===Number?un.MaskedNumber:Array.isArray(e)||e===Array?un.MaskedDynamic:un.Masked&&e.prototype instanceof un.Masked?e:un.Masked&&e instanceof un.Masked?e.constructor:e instanceof Function?un.MaskedFunction:(console.warn("Mask not found for mask",e),un.Masked)}function Fm(e){if(!e)throw new Error("Options in not defined");if(un.Masked){if(e.prototype instanceof un.Masked)return{mask:e};const{mask:t=void 0,...n}=e instanceof un.Masked?{mask:e}:Lj(e)&&e.mask instanceof un.Masked?e:{};if(t){const r=t.mask;return{...JL(t,(i,a)=>!a.startsWith("_")),mask:t.constructor,_mask:r,...n}}}return Lj(e)?{...e}:{mask:e}}function Oo(e){if(un.Masked&&e instanceof un.Masked)return e;const t=Fm(e),n=$L(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)}un.createMask=Oo;class jO{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}}un.MaskElement=jO;const Fj=90,w$=89;class nb extends jO{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===Fj&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.keyCode===w$&&t.ctrlKey))return t.preventDefault(),this._handlers.redo(t);if(this._handlers.undo&&t.keyCode===Fj&&(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={}}}un.HTMLMaskElement=nb;class E$ extends nb{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}}un.HTMLMaskElement=nb;class eF extends nb{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,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(r))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}un.HTMLContenteditableMaskElement=eF;class rb{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>rb.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}}rb.MAX_LENGTH=100;class S${constructor(t,n){this.el=t instanceof jO?t:t.isContentEditable&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"?new eF(t):new E$(t),this.masked=Oo(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new rb,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 un.Masked)&&this.masked.constructor===$L(t)){this.masked.updateOptions({mask:t});return}const n=t instanceof un.Masked?t:Oo({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,a=this.displayValue,o=this.unmaskedValue!==n||this.value!==r||this._rawInputValue!==i;this._unmaskedValue=n,this._value=r,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),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),a=this.masked.optionsIsChanged(r);i&&(this.mask=n),a&&this.masked.updateOptions(r),(i||a)&&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,Wt.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 A$({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,a=r===this.masked.rawInputValue?n.removeDirection:Wt.NONE;let o=this.masked.nearestInputPos(n.startChangePos+i,a);a!==Wt.NONE&&(o=this.masked.nearestInputPos(o,Wt.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}}un.InputMask=S$;class xn{static normalize(t){return Array.isArray(t)?t:[t,new xn]}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}}un.ChangeDetails=xn;class Cs{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 Di{constructor(t){this._value="",this._update({...Di.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 Cs(this.extractInput(t,n),t)}appendTail(t){return Il(t)&&(t=new Cs(String(t))),t.appendTo(this)}_appendCharRaw(t,n){return t?(this._value+=t,new xn({inserted:t,rawInserted:t})):new xn}_appendChar(t,n,r){n===void 0&&(n={});const i=this.state;let a;if([t,a]=this.doPrepareChar(t,n),t&&(a=a.aggregate(this._appendCharRaw(t,n)),!a.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=i;let u=this.pad(n);const d=this._appendCharRaw(t,n);u=u.aggregate(d),d.rawInserted||u.equals(a)?a=u:this.state=o}if(a.inserted){let o,u=this.doValidate(n)!==!1;if(u&&r!=null){const d=this.state;if(this.overwrite===!0){o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.unshift(this.displayValue.length-a.tailShift)}let m=this.appendTail(r);if(u=m.rawInserted.length===r.toString().length,!(u&&m.inserted)&&this.overwrite==="shift"){this.state=d,o=r.state;for(let v=0;v<a.rawInserted.length;++v)r.shift();m=this.appendTail(r),u=m.rawInserted.length===r.toString().length}u&&m.inserted&&(this.state=d)}u||(a=new xn,this.state=i,r&&o&&(r.state=o))}return a}_appendPlaceholder(){return new xn}_appendEager(){return new xn}append(t,n,r){if(!Il(t))throw new Error("value should be string");const i=Il(r)?new Cs(String(r)):r;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[t,a]=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;a.aggregate(u)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&t&&a.aggregate(this._appendEager()),i!=null&&(a.tailShift+=this.appendTail(i).tailShift),a}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 xn}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={}),xn.normalize(this.prepare?this.prepare(t,this,n):t)}doPrepareChar(t,n){return n===void 0&&(n={}),xn.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,a){r===void 0&&(r=""),i===void 0&&(i=Wt.NONE),a===void 0&&(a={input:!0});const o=t+n,u=this.extractTail(o),d=this.eager===!0||this.eager==="remove";let m;d&&(i=x$(i),m=this.extractInput(0,o,{raw:!0}));let v=t;const g=new xn;if(i!==Wt.NONE&&(v=this.nearestInputPos(t,n>1&&t!==0&&!d?Wt.NONE:i),g.tailShift=v-t),g.aggregate(this.remove(v)),d&&i!==Wt.NONE&&m===this.rawInputValue)if(i===Wt.FORCE_LEFT){let b;for(;m===this.rawInputValue&&(b=this.displayValue.length);)g.aggregate(new xn({tailShift:-1})).aggregate(this.remove(b-1))}else i===Wt.FORCE_RIGHT&&u.unshift();return g.aggregate(this.append(r,a,u))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!E0(this,t)}typedValueEquals(t){const n=this.typedValue;return t===n||Di.EMPTY_VALUES.includes(t)&&Di.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(t){return new xn}}Di.DEFAULTS={skipInvalid:!0};Di.EMPTY_VALUES=[void 0,null,""];un.Masked=Di;class Nu{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=Il(t)?new Cs(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 Cs)r?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof Nu){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 un.MaskedPattern))return new Cs(this.toString()).appendTo(t);const n=new xn;for(let r=0;r<this.chunks.length;++r){const i=this.chunks[r],a=t._mapPosToBlock(t.displayValue.length),o=i.stop;let u;if(o!=null&&(!a||a.index<=o)&&((i instanceof Nu||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),u=i instanceof Nu&&t._blocks[o]),u){const d=u.appendTail(i);n.aggregate(d);const m=i.toString().slice(d.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 a="chunks"in i?new Nu:new Cs;return a.state=i,a})}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],a=i.unshift(n);if(i.toString()){if(!a)break;++r}else this.chunks.splice(r,1);if(a)return a}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 C${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,Wt.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,Wt.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,Wt.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Wt.NONE),!0})}}class tF{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 xn}nearestInputPos(t,n){n===void 0&&(n=Wt.NONE);const r=0,i=this._value.length;switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return r;case Wt.NONE:case Wt.RIGHT:case Wt.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 xn;const r=this.eager===!0||this.eager==="append",a=this.char===t&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!r)&&!n.tail,o=new xn({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(n.raw||n.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new xn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Cs("")}appendTail(t){return Il(t)&&(t=new Cs(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 S0{constructor(t){const{parent:n,isOptional:r,placeholderChar:i,displayChar:a,lazy:o,eager:u,...d}=t;this.masked=Oo(d),Object.assign(this,{parent:n,isOptional:r,placeholderChar:i,displayChar:a,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 xn}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 xn;const r=this.masked.state;let i=this.masked._appendChar(t,this.currentMaskFlags(n));return i.inserted&&this.doValidate(n)===!1&&(i=new xn,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 xn:(this.isFilled=!0,new xn({inserted:this.placeholderChar}))}_appendEager(){return new xn}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=Wt.NONE);const r=0,i=this.value.length,a=Math.min(Math.max(t,r),i);switch(n){case Wt.LEFT:case Wt.FORCE_LEFT:return this.isComplete?a:r;case Wt.RIGHT:case Wt.FORCE_RIGHT:return this.isComplete?a:i;case Wt.NONE:default:return a}}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 xn}}S0.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 R$ extends Di{updateOptions(t){super.updateOptions(t)}_update(t){const n=t.mask;n&&(t.validate=r=>r.search(n)>=0),super._update(t)}}un.MaskedRegExp=R$;class Ii extends Di{constructor(t){super({...Ii.DEFAULTS,...t,definitions:Object.assign({},S0.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 a=0;a<n.length;++a){if(this.blocks){const m=n.slice(a),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}=Fm(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 un.RepeatBlock(A):Oo(A);w&&(this._blocks.push(w),b&&(this.exposeBlock=w),this._maskedBlocks[g]||(this._maskedBlocks[g]=[]),this._maskedBlocks[g].push(this._blocks.length-1)),a+=g.length-1;continue}}let o=n[a],u=o in t;if(o===Ii.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){r=!r;continue}if(o==="["||o==="]"){i=!i;continue}if(o===Ii.ESCAPE_CHAR){if(++a,o=n[a],!o)break;u=!1}const d=u?new S0({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Fm(t[o]),parent:this}):new tF({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(d)}}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,a)=>i.state=n[a]),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 xn;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 a=this._blocks[i]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(t,n){n===void 0&&(n={});const r=this._mapPosToBlock(this.displayValue.length),i=new xn;if(!r)return i;for(let o=r.index,u;u=this._blocks[o];++o){var a;const d=u._appendChar(t,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[o]});if(i.aggregate(d),d.consumed)break}return i}extractTail(t,n){t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length);const r=new Nu;return t===n||this._forEachBlocksInRange(t,n,(i,a,o,u)=>{const d=i.extractTail(o,u);d.stop=this._findStopBefore(a),d.from=this._blockStartPos(a),d instanceof Nu&&(d.blockIndex=a),r.extend(d)}),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,(a,o,u,d)=>{i+=a.extractInput(u,d,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 xn;if(this.lazy&&t==null)return n;const r=this._mapPosToBlock(this.displayValue.length);if(!r)return n;const i=r.index,a=t!=null?t:this._blocks.length;return this._blocks.slice(i,a).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],a=n.length;if(n+=i.displayValue,t<=n.length)return{index:r,offset:t-a}}}_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 a=this._mapPosToBlock(n),o=a&&i.index===a.index,u=i.offset,d=a&&o?a.offset:this._blocks[i.index].displayValue.length;if(r(this._blocks[i.index],i.index,u,d),a&&!o){for(let m=i.index+1;m<a.index;++m)r(this._blocks[m],m,0,this._blocks[m].displayValue.length);r(this._blocks[a.index],a.index,0,a.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,a,o,u)=>{r.aggregate(i.remove(o,u))}),r}nearestInputPos(t,n){if(n===void 0&&(n=Wt.NONE),!this._blocks.length)return 0;const r=new C$(this,t);if(n===Wt.NONE)return r.pushRightBeforeInput()||(r.popState(),r.pushLeftBeforeInput())?r.pos:this.displayValue.length;if(n===Wt.LEFT||n===Wt.FORCE_LEFT){if(n===Wt.LEFT){if(r.pushRightBeforeFilled(),r.ok&&r.pos===t)return t;r.popState()}if(r.pushLeftBeforeInput(),r.pushLeftBeforeRequired(),r.pushLeftBeforeFilled(),n===Wt.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===Wt.FORCE_LEFT?0:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:0)}return n===Wt.RIGHT||n===Wt.FORCE_RIGHT?(r.pushRightBeforeInput(),r.pushRightBeforeRequired(),r.pushRightBeforeFilled()?r.pos:n===Wt.FORCE_RIGHT?this.displayValue.length:(r.popState(),r.ok||(r.popState(),r.ok)?r.pos:this.nearestInputPos(t,Wt.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,a,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 xn;return this._forEachBlocksInRange(0,this.displayValue.length,r=>n.aggregate(r.pad(t))),n}}Ii.DEFAULTS={...Di.DEFAULTS,lazy:!0,placeholderChar:"_"};Ii.STOP_CHAR="`";Ii.ESCAPE_CHAR="\\";Ii.InputDefinition=S0;Ii.FixedDefinition=tF;un.MaskedPattern=Ii;class n0 extends Ii{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:a=this.autofix,...o}=t;this.to=n,this.from=r,this.maxLength=Math.max(String(n).length,i),this.autofix=a;const u=String(this.from).padStart(this.maxLength,"0"),d=String(this.to).padStart(this.maxLength,"0");let m=0;for(;m<d.length&&d[m]===u[m];)++m;o.mask=d.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,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(i.length)+a,r="9".repeat(i.length)+a),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"),[a,o]=this.boundaries(this.value+t);return Number(o)<this.from?super._appendCharRaw(r[this.value.length],n):Number(a)>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,a]=this.boundaries(n);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const n=new xn;if(this.value.length===this.maxLength)return n;const r=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let a=0;a<i;++a)n.aggregate(super._appendCharRaw("0",t));r.split("").forEach(a=>this._appendCharRaw(a))}return n}}un.MaskedRange=n0;const O$="d{.}`m{.}`Y";class yo extends Ii{static extractPatternOptions(t){const{mask:n,pattern:r,...i}=t;return{...i,mask:Il(n)?n:r}}constructor(t){super(yo.extractPatternOptions({...yo.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:n,pattern:r,blocks:i,...a}={...yo.DEFAULTS,...t},o=Object.assign({},yo.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({...a,mask:Il(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(yo.extractPatternOptions(t))}}yo.GET_DEFAULT_BLOCKS=()=>({d:{mask:n0,from:1,to:31,maxLength:2},m:{mask:n0,from:1,to:12,maxLength:2},Y:{mask:n0,from:1900,to:9999}});yo.DEFAULTS={...Ii.DEFAULTS,mask:Date,pattern:O$,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)}};un.MaskedDate=yo;class ib extends Di{constructor(t){super({...ib.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}=Fm(n),a=Oo({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return r&&(this.exposeMask=a),a}):[])}_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,a=this.rawInputValue,o=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,u=a.slice(o.length),d=this.currentMask,m=new xn,v=d==null?void 0:d.state;return this.currentMask=this.doDispatch(t,{...n},r),this.currentMask&&(this.currentMask!==d?(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 xn;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 a;[r,a]=super.doPrepare(r,this.currentMaskFlags(n)),i=i.aggregate(a)}return[r,i]}doPrepareChar(t,n){n===void 0&&(n={});let[r,i]=super.doPrepareChar(t,n);if(this.currentMask){let a;[r,a]=super.doPrepareChar(r,this.currentMaskFlags(n)),i=i.aggregate(a)}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 xn;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,...a}=t;n&&this.compiledMasks.forEach((o,u)=>o.state=n[u]),r!=null&&(this.currentMask=r,this.currentMask.state=i),super.state=a}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,...a}=t[r];return E0(n,a)&&n.maskEquals(i)}):super.maskEquals(t)}typedValueEquals(t){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(t))}}ib.DEFAULTS={...Di.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const i=t.rawInputValue,a=t.compiledMasks.map((o,u)=>{const d=t.currentMask===o,m=d?o.displayValue.length:o.nearestInputPos(o.displayValue.length,Wt.FORCE_LEFT);return o.rawInputValue!==i?(o.reset(),o.append(i,{raw:!0})):d||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,Wt.FORCE_LEFT)))}});return a.sort((o,u)=>u.weight-o.weight||u.totalInputPositions-o.totalInputPositions),t.compiledMasks[a[0].index]}};un.MaskedDynamic=ib;class ab extends Ii{constructor(t){super({...ab.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:n,...r}=t;if(n){const i=n.map(u=>u.length),a=Math.min(...i),o=Math.max(...i)-a;r.mask="*".repeat(a),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,Wt.FORCE_RIGHT),this.value.length),i=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+t,r));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,u)=>{const d=i[0][u];u>=this.value.length||d===o.value||(o.reset(),o._appendChar(d,n))});const a=super._appendCharRaw(i[0][this.value.length],n);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(o=>a.aggregate(super._appendCharRaw(o))),a}return new xn({skip:!this.isComplete})}extractTail(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),new Cs("",t)}remove(t,n){if(t===void 0&&(t=0),n===void 0&&(n=this.displayValue.length),t===n)return new xn;const r=Math.min(super.nearestInputPos(0,Wt.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 a=super.remove(i,n);return a.tailShift+=i-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}ab.DEFAULTS={...Ii.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n};un.MaskedEnum=ab;class M$ extends Di{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}}un.MaskedFunction=M$;var nF;class ga extends Di{constructor(t){super({...ga.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",r=(this.scale?"("+vx(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+n+r),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(vx).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(vx(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 a=this._value;this._value+=t;const o=this.number;let u=!isNaN(o),d=!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(ga.UNMASKED_RADIX,this.radix),d||(d=a===this._value&&!n.tail)):u=!1),u&&(u=!!this._value.match(this._numberRegExp))}let m;u?m=new xn({inserted:this._value.slice(a.length),rawInserted:d?"":t,skip:d}):(this._value=a,m=new xn),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),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));const o=this._separatorsCountFromSlice(r);return new xn({tailShift:(o-a)*this.thousandsSeparator.length})}nearestInputPos(t,n){if(!this.thousandsSeparator)return t;switch(n){case Wt.NONE:case Wt.LEFT:case Wt.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===Wt.FORCE_LEFT)return r}break}case Wt.RIGHT:case Wt.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,a,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===ga.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,ga.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(ga.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)||ga.EMPTY_VALUES.includes(t)&&ga.EMPTY_VALUES.includes(this.typedValue))&&!(t===0&&this.value==="")}}nF=ga;ga.UNMASKED_RADIX=".";ga.EMPTY_VALUES=[...Di.EMPTY_VALUES,0];ga.DEFAULTS={...Di.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[nF.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})};un.MaskedNumber=ga;const gR={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function rF(e,t,n){t===void 0&&(t=gR.MASKED),n===void 0&&(n=gR.MASKED);const r=Oo(e);return i=>r.runIsolated(a=>(a[t]=i,a[n]))}function D$(e,t,n,r){return rF(t,n,r)(e)}un.PIPE_TYPE=gR;un.createPipe=rF;un.pipe=D$;class I$ extends Ii{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:a,...o}=Fm(t);this._blockOpts=Object.assign({},this._blockOpts,o);const u=Oo(this._blockOpts);this.repeat=(n=(r=a!=null?a: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(Oo(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(t,n){n===void 0&&(n={});const r=new xn;for(let d=(i=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?i:Math.max(this._blocks.length-1,0),m,v;m=(o=this._blocks[d])!=null?o:v=!v&&this._allocateBlock(d);++d){var i,a,o,u;const g=m._appendChar(t,{...n,_beforeTailState:(u=n._beforeTailState)==null||(u=u._blocks)==null?void 0:u[d]});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 a=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 d=o;a<=d&&!this._blocks[d].unmaskedValue;--d,++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}}un.RepeatBlock=I$;try{globalThis.IMask=un}catch(e){}const iF={mask:ce.oneOfType([ce.array,ce.func,ce.string,ce.instanceOf(RegExp),ce.oneOf([Date,Number,un.Masked]),ce.instanceOf(un.Masked)]),value:ce.any,unmask:ce.oneOfType([ce.bool,ce.oneOf(["typed"])]),prepare:ce.func,prepareChar:ce.func,validate:ce.func,commit:ce.func,overwrite:ce.oneOfType([ce.bool,ce.oneOf(["shift"])]),eager:ce.oneOfType([ce.bool,ce.oneOf(["append","remove"])]),skipInvalid:ce.bool,onAccept:ce.func,onComplete:ce.func,placeholderChar:ce.string,displayChar:ce.string,lazy:ce.bool,definitions:ce.object,blocks:ce.object,enum:ce.arrayOf(ce.string),maxLength:ce.number,from:ce.number,to:ce.number,pattern:ce.string,format:ce.func,parse:ce.func,autofix:ce.oneOfType([ce.bool,ce.oneOf(["pad"])]),radix:ce.string,thousandsSeparator:ce.string,mapToRadix:ce.arrayOf(ce.string),scale:ce.number,normalizeZeros:ce.bool,padFractionalZeros:ce.bool,min:ce.oneOfType([ce.number,ce.instanceOf(Date)]),max:ce.oneOfType([ce.number,ce.instanceOf(Date)]),dispatch:ce.func,inputRef:ce.oneOfType([ce.func,ce.shape({current:ce.object})])},aF=Object.keys(iF).filter(e=>e!=="value"),P$=["value","unmask","onAccept","onComplete","inputRef"],j$=aF.filter(e=>P$.indexOf(e)<0);function T$(e){var t;const n=(t=class extends st.Component{constructor(a){super(a),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const a=this.props,o=this._extractMaskOptionsFromProps(a);if(o.mask)this.maskRef?(this.maskRef.updateOptions(o),"value"in a&&a.value!==void 0&&(this.maskValue=a.value)):this.initMask(o);else if(this.destroyMask(),"value"in a&&a.value!==void 0){var u;(u=this.element)!=null&&u.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=a.value:this.element.value=a.value}}componentWillUnmount(){this.destroyMask()}_inputRef(a){this.element=a,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=a:this.props.inputRef(a))}initMask(a){a===void 0&&(a=this._extractMaskOptionsFromProps(this.props)),this.maskRef=un(this.element,a).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(a){const{...o}=a;return Object.keys(o).filter(u=>j$.indexOf(u)<0).forEach(u=>{delete o[u]}),o}_extractNonMaskProps(a){const{...o}=a;return aF.forEach(u=>{u!=="maxLength"&&delete o[u]}),"defaultValue"in o||(o.defaultValue=a.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(a){this.maskRef&&(a=a==null&&this.props.unmask!=="typed"?"":a,this.props.unmask==="typed"?this.maskRef.typedValue=a:this.props.unmask?this.maskRef.unmaskedValue=a:this.maskRef.value=a)}_onAccept(a){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,a)}_onComplete(a){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,a)}render(){return st.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=iF,st.forwardRef((i,a)=>st.createElement(n,{...i,ref:a}))}const _$=T$(e=>{let{inputRef:t,...n}=e;return st.createElement("input",{...n,ref:t})}),N$=(e,t)=>st.createElement(_$,{...e,ref:t}),C0=st.forwardRef(N$),B$=({setShowWhatsappDialog:e})=>{const[t,n]=_.useState(null),r=v$(),i=ln(),a=()=>{if(!A0(t))return Ce.error("Please enter a valid phone number.",{id:"invalid-phone"});r.mutate({email:null,phoneNumber:t},{onSuccess:()=>{i.invalidateQueries(ig()),Ce.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"whatsapp-success"}),e(!1)},onError:o=>{Ce.error(`There was an error processing your request: ${(o==null?void 0:o.message)||"Unknown error"}`,{id:"whatsapp-error",duration:5e3})}})};return c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.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"}),c.jsx("div",{className:"text-md text-brand",children:"Enter the number associated with your WhatsApp account below."}),c.jsx("label",{htmlFor:"",className:"!text-brand !block !mt-5 !mb-0",children:"Phone Number with Country Code"}),c.jsx(C0,{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"}),c.jsxs("div",{className:"flex justify-end",children:[c.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue",onClick:()=>a(),disabled:r.isPending,children:r.isPending?c.jsx(Zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},k$=({setShowMessageDialog:e})=>{const[t,n]=_.useState(null),r=_.useRef(null),i=p$(),a=ln(),o=()=>{var u,d;if(!rg((u=r==null?void 0:r.current)==null?void 0:u.value))return Ce.error("Please enter a valid email.",{id:"invalid-icloud-email"});if(!A0(t))return Ce.error("Please enter a valid phone number.",{id:"invalid-phone"});i.mutate({email:(d=r==null?void 0:r.current)==null?void 0:d.value,phoneNumber:t},{onSuccess:()=>{a.invalidateQueries(ig()),Ce.success("Thank you, your request has been received and mobile set up will continue on your device.",{id:"imessage-success"}),e(!1)},onError:m=>{Ce.error(`There was an error processing your request: ${(m==null?void 0:m.message)||"Unknown error"}`,{id:"imessage-error",duration:5e3})}})};return c.jsxs("div",{className:"p-3",children:[c.jsxs("button",{className:"flex items-center text-blue-900 uppercase font-semibold absolute top-3 right-8 hover:cursor-pointer",onClick:()=>e(!1),children:[c.jsx(Ae,{size:"medium",className:"mr-1",icon:bn})," Close"]}),c.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"}),c.jsx("div",{className:"text-md text-brand",children:"Please use the email that is associated with your iCloud account."}),c.jsx("label",{htmlFor:"",className:"!text-brand !block !mt-5 !mb-0",children:"iCloud Email"}),c.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"}),c.jsx("label",{htmlFor:"",className:"!text-brand !block !mt-5 !mb-0",children:"Phone Number with Country Code"}),c.jsx(C0,{onAccept:(u,d)=>{n(d.unmaskedValue)},mask:[{mask:"+1 (000) 000-0000",startsWith:"+1",country:"US"},{mask:"+{0}000000000000000",startsWith:"+",country:"INTL"}],dispatch:(u,d)=>(d.value+u).replace(/\D/g,"").startsWith("1")?d.compiledMasks.find(v=>v.country==="US"):d.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"}),c.jsxs("div",{className:"flex justify-end",children:[c.jsx("button",{className:"btn-transparent",onClick:()=>e(!1),children:"Cancel"}),c.jsx("button",{className:"btn-blue",onClick:()=>o(),disabled:i.isPending,children:i.isPending?c.jsx(Zt,{size:"sm",colorClass:"color-white"}):"Save"})]})]})},sF="data:image/png;base64,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",L$=({classList:e=""})=>{var m,v,g,b,y,x;const[t,n]=_.useState(!1),[r,i]=_.useState(!1),{data:a,isLoading:o}=Gt(ig()),u=((m=a==null?void 0:a.iMessage)==null?void 0:m.status)&&((v=a==null?void 0:a.iMessage)==null?void 0:v.status)!=3&&((g=a==null?void 0:a.iMessage)==null?void 0:g.id)!=0,d=((b=a==null?void 0:a.whatsApp)==null?void 0:b.status)&&((y=a==null?void 0:a.whatsApp)==null?void 0:y.status)!=3&&((x=a==null?void 0:a.whatsApp)==null?void 0:x.id)!=0;return c.jsxs("div",{className:`${e}`,children:[c.jsx(Ba,{title:"",children:o?c.jsx(Zt,{size:"md"}):c.jsxs(c.Fragment,{children:[c.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:[c.jsx("img",{src:sF,className:"w-[24px] h-[24px]",alt:""}),"Connect iMessage",c.jsx(Ae,{icon:u?Dn:yj,className:`${u?"text-light-gray":"text-link-color"}`,size:"small"})]}),c.jsxs("a",{className:`flex items-center gap-2 cursor-pointer font-semibold ${d?"text-light-gray":"text-link-color"}`,onClick:()=>d?null:i(!0),children:[c.jsx(Ae,{icon:eL,className:"text-green-800",size:"xlarge"}),"Connect WhatsApp",c.jsx(Ae,{icon:d?Dn:yj,className:`${d?"text-light-gray":"text-link-color"}`,size:"small"})]})]})}),t&&c.jsx(jn,{title:"",width:700,onClose:()=>n(!1),children:c.jsx(k$,{setShowMessageDialog:n})}),r&&c.jsx(jn,{title:"",width:700,onClose:()=>i(!1),children:c.jsx(B$,{setShowWhatsappDialog:i})})]})},F$=({className:e=""})=>{var g,b,y,x;const{data:t,isLoading:n,isSuccess:r}=Gt(ig()),i=ir(),a=[i.accessor("name",{cell:A=>A.getValue(),header:()=>"Name",size:300}),i.accessor("imessage",{cell:A=>{const w=A.getValue();return c.jsx(bi,{status:w})},header:"iMessage",size:130,maxSize:160,enableGlobalFilter:!1}),i.accessor("whatsapp",{cell:A=>{const w=A.getValue();return c.jsx(bi,{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:"unavailable",statusTitle:"N/A"}:w0((b=t==null?void 0:t.whatsApp)==null?void 0:b.status),d=((y=t==null?void 0:t.iMessage)==null?void 0:y.id)==0?{status:"unavailable",statusTitle:"N/A"}:w0((x=t==null?void 0:t.iMessage)==null?void 0:x.status),m=_.useMemo(()=>[{name:"Your Mobile Accounts",id:"your_mobile_accounts",imessage:d,whatsapp:u}],[t]),v=or({data:m,columns:a,getCoreRowModel:ar(),getPaginationRowModel:sr(),getFilteredRowModel:gr(),getRowId:A=>A.id,globalFilterFn:"includesString",enableRowSelection:!0,autoResetPageIndex:!0});return c.jsxs("div",{className:`${e}`,children:[c.jsx("div",{children:c.jsx("h5",{className:"text-dark text-2xl font-semibold uppercase leading-9 mb-2.5",children:"Archived Mobile Accounts"})}),n?c.jsx(Zt,{}):c.jsx(Dr,{table:v,hasGlobalFilter:!1,filterButtons:o,searchPlaceholder:"Search Accounts",itemsLabel:"Account",bordered:!0,emptyMessage:n?"Loading...":"No accounts found"})]})},q$=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 1 of 5: Connect Your Text Messaging Accounts"}),c.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."})]}),c.jsx(L$,{}),c.jsx(F$,{className:"mt-10"}),c.jsx(rr,{prevLink:"/setup/hierarchy/website-reviewers",prevProgress:5,nextLink:"/setup/mobile/firm-accounts",nextProgress:6})]}),al={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}},ss=({activeChoiceId:e,choices:t,onChange:n,mode:r="blue"})=>{const i=a=>{n&&n(a)};return c.jsx("div",{className:`border ${al[r].border} rounded-sm flex w-fit max-w-full gap-0 overflow-clip`,children:t.map((a,o)=>c.jsx("span",{onClick:()=>i(a),className:`whitespace-nowrap ${al[r].padding} cursor-pointer ${al[r].horizontalBorders&&t.length>o+1?`border-r ${al[r].border}`:""} ${a.id==e?`${al[r].activeBackground} ${al[r].activeTextColor}`:`${al[r].background} ${al[r].textColor}`}`,children:a.title},o))})},z$=[{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"}],oF=({description:e=null,isSettings:t=!1})=>{const n=Xt(o=>o.setAccountSettings),r=Xt(o=>o.accountSettings),i=xi(),a=Dt({mutationKey:["updateReviewPeriodLimit"],mutationFn:async o=>{console.log(o);const u=await i.executeRequest("/accountsettings/mobilelimit","PUT",{limit:o});if(!u||u.error)throw new Error("Error updating review period limit");return o},onSuccess:o=>{n({...r,mobileLimit:o}),Ce.success("Review period limit updated successfully")},onError:o=>{console.error("Mutation error:",o),Ce.error("Error updating review period limit")}});return c.jsxs(Ba,{title:t?"Maximum Review Period Size":"Set Maximum Review Period Size",children:[e&&c.jsxs("div",{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),c.jsx("div",{className:"h-[50px]"})]}),c.jsx("h6",{className:"underlined-subtitle",children:"NUMBER OF ITEMS"}),c.jsx(ss,{activeChoiceId:r==null?void 0:r.mobileLimit,onChange:o=>{a.mutate(o.id)},choices:z$,disabled:a.isLoading})]})};function Q$(e,t,n,r){const i=_.useRef(null),a=_.useRef(0),o=_.useRef(0),u=_.useRef(null),d=_.useRef([]),m=_.useRef(),v=_.useRef(),g=_.useRef(e),b=_.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,j="debounceOnServer"in n&&!!n.debounceOnServer,D=C?Math.max(+n.maxWait||0,t):null;return _.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),_.useMemo(()=>{const S=L=>{const F=d.current,V=m.current;return d.current=m.current=null,a.current=L,o.current=o.current||L,v.current=g.current.apply(V,F)},T=(L,F)=>{x&&cancelAnimationFrame(u.current),u.current=x?requestAnimationFrame(L):setTimeout(L,F)},O=L=>{if(!b.current)return!1;const F=L-i.current;return!i.current||F>=t||F<0||C&&L-a.current>=D},M=L=>(u.current=null,w&&d.current?S(L):(d.current=m.current=null,v.current)),P=()=>{const L=Date.now();if(A&&o.current===a.current&&N(),O(L))return M(L);if(!b.current)return;const F=t-(L-i.current),V=C?Math.min(F,D-(L-a.current)):F;T(P,V)},N=()=>{r&&r({})},B=(...L)=>{if(!y&&!j)return;const F=Date.now(),V=O(F);if(d.current=L,m.current=this,i.current=F,V){if(!u.current&&b.current)return a.current=i.current,T(P,t),A?S(i.current):v.current;if(C)return T(P,t),S(i.current)}return u.current||T(P,t),v.current};return B.cancel=()=>{u.current&&(x?cancelAnimationFrame(u.current):clearTimeout(u.current)),a.current=0,d.current=i.current=m.current=u.current=null},B.isPending=()=>!!u.current,B.flush=()=>u.current?M(Date.now()):v.current,B},[A,C,t,D,w,x,y,j,r])}function H$(e,t){return e===t}function lF(e,t,n){const r=H$,i=_.useRef(e),[,a]=_.useState({}),o=Q$(_.useCallback(d=>{i.current=d,a({})},[a]),t,n,a),u=_.useRef(e);return r(u.current,e)||(o(e),u.current=e),[i.current,o]}const qj=[{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%"}],uF=({description:e=null,isSettings:t=!1})=>{const n=Xt(g=>g.setAccountSettings),r=Xt(g=>g.accountSettings),i=xi(),[a,o]=_.useState(""),[u]=lF(a,500),d=_.useRef(null),m=Dt({mutationFn:async g=>{const b=await i.executeRequest("/accountsettings/mobilesampling","PUT",{sampling:g});if(!b||b.error)throw new Error("Error updating sample percentage");return g},onSuccess:g=>{n({...r,mobileSampling:g}),Ce.success("Sample percentage updated successfully")},onError:()=>{Ce.error("Error updating sample percentage")}});_.useEffect(()=>{u!==""&&!isNaN(u)&&u>=0&&u<=100&&m.mutate(Number(u))},[u]),_.useEffect(()=>{qj.find(g=>g.id==(r==null?void 0:r.mobileSampling))||(d.current.value=r==null?void 0:r.mobileSampling)},[r==null?void 0:r.mobileSampling]);const v=g=>{const b=Math.floor(g.target.value);if(b<0){d.current.value=0,o(0);return}if(b>100){d.current.value=100,o(100);return}o(b)};return c.jsxs(Ba,{title:t?"Mobile Sample Percentage":"Set Mobile Sample Percentage",children:[e&&c.jsxs("div",{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),c.jsx("div",{className:"h-[50px]"})]}),c.jsx("h6",{className:"underlined-subtitle",children:"SAMPLE PERCENTAGE RATE"}),c.jsx(ss,{activeChoiceId:r==null?void 0:r.mobileSampling,onChange:g=>{d.current.value="",m.mutate(g.id)},choices:qj}),c.jsx("div",{className:"h-[50px]"}),c.jsx("h6",{className:"underlined-subtitle",children:"CUSTOM PERCENTAGE RATE"}),c.jsxs("div",{children:[c.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:a,onChange:v,ref:d}),c.jsx("p",{className:"text-sm",children:"Enter a number or percentage"})]})]})},V$=e=>({queryKey:["account",e],queryFn:()=>wt.executeRequest(`/accounts/${e}`,"GET")}),TO={queryKey:["settings"],queryFn:()=>wt.executeRequest("/accountsettings","GET"),retry:!1},ag=({archivingType:e,pageType:t})=>{const n=ln();return Dt({mutationFn:r=>{const i={archivingType:e,pageType:t,frequency:r};return wt.executeRequest("/accountsettings","PUT",i)},onSuccess:()=>{n.invalidateQueries(TO),Ce.success("Review frequency updated!")},onError:()=>{Ce.error("Error occurred while setting review frequency")}})},cF=({description:e=null,isSettings:t=!1})=>{const n=Xt(i=>i.accountSettings),{mutate:r}=ag({archivingType:"mobile",pageType:"setup"});return c.jsx("section",{className:"",children:c.jsx(Ba,{title:t?"Mobile Review Frequency":"Set Mobile Review Frequency",children:c.jsxs("div",{className:"",children:[e&&c.jsxs("div",{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:e}}),c.jsx("div",{className:"h-[50px]"})]}),c.jsx("h6",{className:"underlined-subtitle uppercase",children:"REVIEW FREQUENCY"}),c.jsx(ss,{activeChoiceId:n==null?void 0:n.mobileFrequency,onChange:i=>{r(i.id)},choices:fL})]})})})},Y$=()=>c.jsxs("section",{className:"flex flex-col w-full !mb-3",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-brand text-2xl font-semibold leading-9",children:"Step 3 of 5: Set Review Frequency and Size"}),c.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."})]}),c.jsx(cF,{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>`}),c.jsx("div",{className:"mt-10"}),c.jsx(uF,{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."}),c.jsx("div",{className:"mt-10"}),c.jsx(oF,{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>
|