@riab/cpm-archiving 1.1.21-beta.1 → 1.1.21-beta.2
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
|
@@ -403,7 +403,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
403
403
|
focus-visible:bg-brand-dark-50 focus-visible:text-brand-medium-500
|
|
404
404
|
shadow-[0_2px_4px_0_var(--color-brand-alpha-200)]
|
|
405
405
|
disabled:bg-near-neutral-100 disabled:text-near-neutral-600 disabled:border-near-neutral-400 disabled:cursor-not-allowed disabled:pointer-events-none
|
|
406
|
-
${e!=null?e:""}`,Ude=({status:e,contacts:t,hasActiveFilters:n,refetch:r})=>e==="error"?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx(se,{icon:jf,size:"xxxlarge",className:"mb-2 text-true-neutral-500"}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"Failed to load excluded contacts"}),o.jsx("p",{className:"text-brand-dark-800 text-center text-sm mb-4",children:"Something went wrong. Please try again."}),o.jsx(Gr,{onClick:r,className:"h-10 bg-white",children:"Reload"})]}):e==="pending"?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx("div",{className:"mb-2",children:o.jsx(qt,{size:"lg",colorClass:"border-true-neutral-500"})}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"Loading..."})]}):(t==null?void 0:t.length)===0?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx(se,{icon:Hde,size:"xxxlarge",className:"mb-2 text-true-neutral-500"}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"No excluded numbers added yet."}),o.jsx("p",{className:"text-brand-dark-800 text-center text-sm",children:"Add numbers to be excluded from your review period."})]}):n?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx(se,{icon:Yu,size:"xxxlarge",className:"mb-2 text-true-neutral-500"}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"No results found"}),o.jsx("p",{className:"text-brand-dark-800 text-center text-sm",children:"Try adjusting your search or clear the filters."})]}):"No items found",Wde=[{value:"Family",label:"Family"},{value:"Personal Friend",label:"Personal Friend"},{value:"Non-client Business Contact",label:"Non-client Business Contact"},{value:"Others",label:"Others"}],Yde=({isFormDisabled:e,onSearch:t,onClear:n})=>{const{data:r,status:a}=It(_p()),i=a==="pending",[l,u]=D.useState(null),[d,f]=D.useState(null),[g,p]=D.useState(""),[b,v]=D.useState(""),y=()=>{t({deviceOwner:(l==null?void 0:l.value)||"",contactName:g,phoneNumber:b,relationship:(d==null?void 0:d.value)||""})},w=()=>{u(null),f(null),p(""),v(""),n()};return o.jsx("div",{className:"bg-near-neutral-300 p-3",children:o.jsxs("div",{className:"flex gap-2 items-end flex-wrap",children:[o.jsxs("div",{className:"flex-1 min-w-37.5",children:[o.jsx("label",{htmlFor:"device-owner",className:"block text-sm text-brand-dark-800 mb-1",children:"Device Owner"}),o.jsx(lp._default,{inputId:"device-owner",value:l,onChange:A=>u(A),options:(r==null?void 0:r.map(A=>({value:`${A.firstName} ${A.lastName}`,label:`${A.firstName} ${A.lastName}`})))||[],placeholder:"Choose an option",isDisabled:e||i,isLoading:i,isClearable:!0,isSearchable:!0,menuPosition:"fixed",components:{IndicatorSeparator:null},styles:{control:(A,E)=>({...A,minHeight:"40px",borderRadius:"6px",borderColor:E.isFocused?"var(--color-brand-dark-500)":"var(--color-near-neutral-400)",boxShadow:"none","&:hover":{borderColor:"var(--color-brand-dark-500)"}}),placeholder:A=>({...A,color:"var(--color-brand-dark-800)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),option:(A,E)=>({...A,backgroundColor:E.isSelected?"var(--color-brand-medium-50)":E.isFocused?"var(--color-brand-bright-50)":"white",color:"var(--color-brand-dark-800)",cursor:"pointer"}),singleValue:A=>({...A,color:"var(--color-brand-dark-800)"})}})]}),o.jsxs("div",{className:"flex-1 min-w-37.5",children:[o.jsx("label",{htmlFor:"contact-name",className:"block text-sm text-brand-dark-800 mb-1",children:"Search Contact"}),o.jsxs("div",{className:"relative",children:[o.jsx(se,{icon:Yu,className:"absolute! left-3 top-3 text-brand-dark-800"}),o.jsx("input",{id:"contact-name",type:"text",value:g,onChange:A=>p(Kce(A.target.value)),placeholder:"",disabled:e,className:`w-full h-10 pl-10 py-2 bg-white border border-near-neutral-400 rounded-md text-brand-dark-800 focus:outline-none focus:border-brand-dark-500 hover:border-brand-dark-500 transition-colors duration-200 disabled:cursor-not-allowed disabled:bg-white disabled:opacity-60 ${g?"pr-10":"pr-3"}`}),g?o.jsx("button",{type:"button",onClick:()=>p(""),disabled:e,"aria-label":"Clear contact search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-brand-dark-800 hover:bg-near-neutral-400 rounded-sm transition-colors disabled:opacity-60",children:o.jsx(se,{icon:Ht,size:"medium",className:"opacity-70"})}):null]})]}),o.jsxs("div",{className:"flex-1 min-w-37.5",children:[o.jsx("label",{htmlFor:"phone-number",className:"block text-sm text-brand-dark-800 mb-1",children:"Search Phone number"}),o.jsxs("div",{className:"relative",children:[o.jsx(se,{icon:Yu,className:"absolute! left-3 top-3 text-brand-dark-800"}),o.jsx("input",{id:"phone-number",type:"text",value:b,onChange:A=>v(Zce(A.target.value)),placeholder:"",disabled:e,className:`w-full h-10 pl-10 py-2 bg-white border border-near-neutral-400 rounded-md text-brand-dark-800 focus:outline-none focus:border-brand-dark-500 hover:border-brand-dark-500 transition-colors duration-200 disabled:cursor-not-allowed disabled:bg-white disabled:opacity-60 ${b?"pr-10":"pr-3"}`}),b?o.jsx("button",{type:"button",onClick:()=>v(""),disabled:e,"aria-label":"Clear phone number search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-brand-dark-800 hover:bg-near-neutral-400 rounded-sm transition-colors disabled:opacity-60",children:o.jsx(se,{icon:Ht,size:"medium",className:"opacity-70"})}):null]})]}),o.jsxs("div",{className:"flex-1 min-w-45",children:[o.jsx("label",{htmlFor:"relationship",className:"block text-sm text-brand-dark-800 mb-1",children:"Relationship"}),o.jsx(lp._default,{inputId:"relationship",value:d,onChange:A=>f(A),options:Wde,placeholder:"Choose an option",isDisabled:e,isClearable:!0,isSearchable:!0,menuPosition:"fixed",components:{IndicatorSeparator:null},styles:{control:(A,E)=>({...A,minHeight:"40px",borderRadius:"6px",borderColor:E.isFocused?"var(--color-brand-dark-500)":"var(--color-near-neutral-400)",boxShadow:"none","&:hover":{borderColor:"var(--color-brand-dark-500)"}}),placeholder:A=>({...A,color:"var(--color-brand-dark-800)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),option:(A,E)=>({...A,backgroundColor:E.isSelected?"var(--color-brand-medium-50)":E.isFocused?"var(--color-brand-bright-50)":"white",color:"var(--color-brand-dark-800)",cursor:"pointer"}),singleValue:A=>({...A,color:"var(--color-brand-dark-800)"})}})]}),o.jsx(Gr,{onClick:y,disabled:e,className:"h-10 bg-white disabled:opacity-60",children:"Search"}),o.jsx(Gr,{onClick:w,disabled:e,className:"h-10 bg-white disabled:opacity-60",children:"Clear"})]})})},Gde=e=>e===0?"review_only":"review_and_archive",Kde=e=>e==="review_only"?"0":"1",Fl=({icon:e,label:t,iconClassName:n})=>o.jsxs("div",{className:"border border-near-neutral-400 rounded-md px-2 py-1 flex gap-2 items-center text-sm text-brand-dark-800",children:[o.jsx(se,{icon:e,size:"small",className:n}),o.jsx("span",{children:t})]}),WP=({selected:e,title:t,pills:n,onSelect:r,children:a})=>o.jsxs("div",{className:`border rounded-lg p-5 flex flex-col gap-4 ${e?"bg-near-neutral-100 border-brand-medium-200":"bg-white border-near-neutral-300"}`,children:[o.jsxs("div",{className:"flex gap-4 items-center",children:[o.jsxs("label",{className:"grid place-items-center cursor-pointer",children:[o.jsx("input",{type:"radio",name:"visibility-mode",checked:e,onChange:r,className:"peer col-start-1 row-start-1 appearance-none shrink-0 w-5 h-5 border-2 border-brand-dark-500 rounded-full cursor-pointer"}),o.jsx("div",{className:"col-start-1 row-start-1 w-2.5 h-2.5 rounded-full peer-checked:bg-brand-dark-500 pointer-events-none"})]}),o.jsxs("div",{className:"flex flex-col gap-2.5",children:[o.jsx("p",{className:`text-base font-semibold ${e?"text-brand-dark-500":"text-brand-dark-800"}`,children:t}),o.jsx("div",{className:"flex gap-2",children:n})]})]}),a]}),Zde=({className:e})=>{var M,I;const t=on(S=>S.accountSettings),n=on(S=>S.setAccountSettings),r=Fde(),a=t.mobileExclusionVisibility,i=a?Gde(a.mode):"review_only",l=(M=a==null?void 0:a.lastUpdatedBy)!=null?M:null,u=(I=a==null?void 0:a.lastUpdatedAt)!=null?I:null,[d,f]=D.useState(!1),[g,p]=D.useState(i),b=i==="review_only",v=i==="review_and_archive",y=()=>{p(i),f(!0)},w=()=>{p(i),f(!1)},A=()=>{if(!g||g===i)return;const S=Kde(g);r.mutate({visibilityMode:S},{onSuccess:()=>{n({...t,mobileExclusionVisibility:{mode:parseInt(S),lastUpdatedBy:"Current User",lastUpdatedAt:new Date().toISOString()}}),f(!1)}})},E=S=>S?new Date(S).toLocaleString("en-US",{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"";return o.jsxs("div",{className:`bg-white rounded-lg p-5 flex flex-col gap-4 shadow-elevation-400 ${e||""}`,children:[o.jsx("h3",{className:"text-lg font-semibold text-brand-dark-800",children:"Excluded Communication Visibility Settings"}),d&&o.jsxs("div",{className:"flex gap-1 items-center text-blue-500 text-sm",children:[o.jsx(se,{icon:Ez,size:"medium"}),o.jsx("span",{children:"All communications are always retained in backend storage for audit and compliance purposes"})]}),!d&&b&&o.jsxs("div",{className:"bg-near-neutral-100 border border-brand-medium-200 rounded-lg p-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2.5",children:[o.jsx("p",{className:"text-base font-semibold text-brand-dark-500",children:"Exclude from Review Only"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:bc,label:"Visible in my archive",iconClassName:"text-brand-medium-500"})]})]}),o.jsx("p",{className:`text-xs text-near-neutral-600 ${l&&u?"":"invisible"}`,children:l&&u?`Last updated by ${l} on ${E(u)}`:"Placeholder"})]}),o.jsxs(Gr,{onClick:y,className:"flex items-center gap-2 h-10 bg-white",children:[o.jsx(se,{icon:Q7,size:"medium"}),"Change"]})]}),!d&&v&&o.jsxs("div",{className:"bg-near-neutral-100 border border-brand-medium-200 rounded-lg p-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2.5",children:[o.jsx("p",{className:"text-base font-semibold text-brand-dark-500",children:"Exclude from Review + My Archive"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:rf,label:"Hidden from my archive",iconClassName:"text-contextual-danger"})]})]}),o.jsx("p",{className:`text-xs text-near-neutral-600 ${l&&u?"":"invisible"}`,children:l&&u?`Last updated by ${l} on ${E(u)}`:"Placeholder"})]}),o.jsxs(Gr,{onClick:y,className:"flex items-center gap-2 h-10 bg-white",children:[o.jsx(se,{icon:Q7,size:"medium"}),"Change"]})]}),!d&&!i,d&&o.jsxs(o.Fragment,{children:[o.jsx(WP,{selected:g==="review_only",title:"Exclude from Review Only",onSelect:()=>p("review_only"),pills:o.jsxs(o.Fragment,{children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:bc,label:"Visible in my archive",iconClassName:"text-brand-medium-500"})]})}),o.jsx(WP,{selected:g==="review_and_archive",title:"Exclude from Review + My Archive",onSelect:()=>p("review_and_archive"),pills:o.jsxs(o.Fragment,{children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:rf,label:"Hidden from my archive",iconClassName:"text-contextual-danger"})]}),children:g==="review_and_archive"&&o.jsxs("div",{className:"bg-contextual-warning-50 border-l-4 border-contextual-warning-500 rounded-xs p-3 flex gap-3 items-start",children:[o.jsx(se,{icon:X6,size:"medium",className:"text-contextual-warning-500 shrink-0 mt-0.5"}),o.jsx("p",{className:"text-sm text-brand-dark-800",children:"Restricting access from my archive may limit investigation capabilities."})]})}),o.jsxs("div",{className:"flex gap-4 justify-end",children:[o.jsx(Gr,{onClick:w,children:"Cancel"}),o.jsx(rn,{onClick:A,disabled:!g||g===i,children:"Confirm Change"})]})]})]})},YP=[{id:"one-to-one",title:"1:1 Communications",description:"Between device owner & excluded contact"},{id:"personal-only-groups",title:"Personal-only groups communications",description:"Between device owner & excluded contacts only"}],$de={id:"mixed-group",title:"Mixed group communication",description:"Between device owner, excluded contacts & other participants"},Jde=e=>e===!0||e===1||e==="1"||e==="true",efe=({variant:e})=>e==="excluded"?o.jsx("span",{className:"rounded-full border border-contextual-danger-400 bg-contextual-danger-50 px-2 py-0.5 text-sm text-contextual-danger-400",children:"Excluded"}):o.jsx("span",{className:"rounded-full border border-contextual-success-400 bg-contextual-success-50 px-2 py-0.5 text-sm text-contextual-success-500",children:"Included"}),GP=({rule:e,icon:t,chip:n})=>o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[o.jsx("div",{className:"grid size-12 shrink-0 place-items-center rounded-sm bg-neutral-green-50 text-brand-dark-800",children:o.jsx(se,{icon:t,size:"medium"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-near-neutral-900",children:e.title}),o.jsx("p",{className:"text-sm text-neutral-grey-500",children:e.description})]})]}),n&&o.jsx(efe,{variant:n})]}),Sv=()=>o.jsx("div",{className:"h-px w-full bg-near-neutral-300","aria-hidden":"true"}),tfe=({className:e})=>{const t=on(l=>l.accountSettings),n=on(l=>l.setAccountSettings),r=Xde(),a=Jde(t.excludeMixedGroupFromReview),i=l=>{r.mutate({excludeMixedGroupFromReview:l},{onSuccess:()=>{n({...t,excludeMixedGroupFromReview:l})}})};return o.jsxs("section",{className:`bg-white rounded-lg p-5 flex flex-col gap-4 shadow-elevation-400 ${e||""}`,children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-lg font-medium text-brand-dark-800",children:"Communication Exclusion Rules"}),o.jsx("p",{className:"text-sm text-brand-dark-800",children:"The rules define how communication involving excluded contact are handled."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-neutral-green-200 bg-white p-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("h4",{className:"text-base font-medium text-near-neutral-900",children:"Always excluded"}),o.jsxs("span",{className:"flex items-center gap-2 rounded-md border border-brand-medium-200 px-2 py-1 text-sm text-true-neutral-600",children:[o.jsx(se,{icon:_te,size:"small"}),"Non-configurable"]})]}),o.jsx(Sv,{}),YP.map((l,u)=>o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx(GP,{rule:l,icon:u===0?q6:wz,chip:"excluded"}),u<YP.length-1&&o.jsx(Sv,{})]},l.id))]}),o.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-neutral-green-200 bg-white p-4",children:[o.jsx("h4",{className:"text-base font-medium text-near-neutral-900",children:"Configurable"}),o.jsx(Sv,{}),o.jsx(GP,{rule:$de,icon:Dte,chip:a?"excluded":"included"}),o.jsx(Sv,{}),o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsx("span",{className:"text-sm font-medium text-near-neutral-900",children:"Exclude mixed group communication from review"}),o.jsx(ib,{ariaLabel:"Exclude mixed group communication from review",checked:a,disabled:r.isPending,onChange:i})]}),a&&o.jsxs("div",{className:"flex items-center gap-4 rounded-xs border-l-4 border-contextual-warning-500 bg-contextual-warning-50 px-4 py-2",children:[o.jsx(se,{icon:X6,size:"medium",className:"text-contextual-warning-500 shrink-0"}),o.jsx("p",{className:"text-sm text-true-neutral-700",children:"May hide business-related communications involving other employees or external parties."})]})]})]})]})},nfe=({className:e})=>{const t=vr(),[n,r]=D.useState(!1),[a,i]=D.useState(!1),[l,u]=D.useState(null),{data:d,status:f,refetch:g}=It(_de()),p=D.useMemo(()=>d==null?void 0:d.map(I=>({...I,deviceOwner:I.userName,phoneNumber:I.countryCode?`${I.countryCode}${I.contactNumber}`:I.contactNumber,relationship:I.relationshipName})),[d]),b=Wn(),v=[b.accessor("deviceOwner",{header:"Device Owner",size:150,cell:I=>I.getValue(),filterFn:"includesString"}),b.accessor("contactName",{header:"Contact Name",size:150,cell:I=>I.getValue(),filterFn:"includesString"}),b.accessor("phoneNumber",{header:"Phone Number",size:150,cell:I=>H8(I.getValue())||I.getValue(),filterFn:"includesString"}),b.accessor("relationship",{header:"Relationship",size:160,cell:I=>I.getValue(),filterFn:"equalsString"}),b.accessor("dateCreated",{header:"Date Added",size:120,cell:I=>{const S=I.getValue();if(!S)return"";const R=Cc(S);return R?Mn(R,"MMMM d, yyyy"):S}}),b.display({id:"delete",size:48,header:()=>null,cell:({row:I})=>o.jsx(Jo,{onClick:S=>{S.stopPropagation(),i(!0),u(I.original)},className:"hover:bg-transparent active:bg-transparent",children:o.jsx(se,{className:"text-brand-dark-800",icon:Ti,size:"medium"})})})],y=Nn({data:p!=null?p:[],columns:v,getCoreRowModel:Pn(),getPaginationRowModel:Qn(),getFilteredRowModel:Kn(),getRowId:I=>I.id.toString(),autoResetPageIndex:!1}),w=I=>{const S=[{id:"deviceOwner",value:I.deviceOwner},{id:"contactName",value:I.contactName},{id:"phoneNumber",value:I.phoneNumber},{id:"relationship",value:I.relationship}].filter(R=>R.value);y.setColumnFilters(S)},A=()=>{y.setColumnFilters([])},E=y.getState().columnFilters.length>0,M=f!=="success";return o.jsxs("div",{className:`flex flex-col gap-5 ${e||""}`,children:[o.jsx(Zde,{}),o.jsx(tfe,{}),o.jsxs("div",{className:"border border-brand-dark-800 rounded-lg overflow-hidden",children:[o.jsxs("div",{className:"bg-near-neutral-300 p-3 flex justify-end gap-2 rounded-t-lg",children:[o.jsxs(Gr,{className:"flex items-center gap-2 h-10 bg-white",onClick:()=>t({to:"/settings/mobile/excluded-contacts/bulk-add"}),children:[o.jsx(se,{icon:Fte,size:"medium"}),"Bulk Add"]}),o.jsxs(rn,{className:"flex items-center gap-2 h-10",onClick:()=>r(!0),children:[o.jsx(se,{icon:jr,size:"medium"}),"Add Number"]})]}),o.jsx(Yde,{isFormDisabled:M,onSearch:w,onClear:A}),o.jsx(Er,{table:y,hasGlobalFilter:!1,filterButtons:[],emptyMessage:o.jsx(Ude,{status:f,contacts:d,hasActiveFilters:E,refetch:g}),bordered:!1,outerBorder:!1,maxHeight:null,paginationControlLabel:null}),o.jsx(qde,{isOpen:n,onClose:()=>r(!1)}),o.jsx(Qde,{isOpen:a,contact:l,onClose:()=>{i(!1),u(null)}})]})]})},rfe=()=>o.jsxs("section",{className:"flex flex-col w-full mb-3",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-brand-dark-800 text-2xl font-semibold leading-9",children:"Excluded Numbers"}),o.jsx("p",{className:"mb-10 max-w-150",children:"Exclude specific contacts from your mobile archiving review. Changes to review settings will go into effect in your next review period."})]}),o.jsx(nfe,{})]}),Ev=["Download template & upload file","Review and confirm","Done"],lw=32,afe=120,ife=-88/2,sfe=({currentStep:e})=>o.jsxs("div",{className:"w-full mb-10 box-border pl-14 pr-11",children:[o.jsx("div",{className:"flex flex-col gap-8",children:o.jsx("div",{className:"flex items-center w-full",children:Ev.map((t,n)=>{const r=n+1,a=r<e||e===3&&r===3,i=r===e&&e!==3;return o.jsxs(D.Fragment,{children:[o.jsx("div",{className:["shrink-0 rounded-full border-2 flex items-center justify-center text-sm font-semibold transition-colors",a?"bg-brand-medium-500 border-brand-medium-500 text-white":i?"border-brand-medium-500 text-brand-medium-500 bg-white":"border-near-neutral-400 text-near-neutral-500 bg-white"].join(" "),style:{width:lw,height:lw},children:a?o.jsx(se,{icon:On,size:"small"}):r}),n<Ev.length-1&&o.jsx("div",{className:["flex-1 h-px",a?"bg-brand-medium-500":"bg-near-neutral-400"].join(" ")})]},r)})})}),o.jsx("div",{className:"flex items-start mt-2 w-full",children:Ev.map((t,n)=>o.jsxs(D.Fragment,{children:[o.jsx("div",{className:"shrink-0",style:{width:lw},children:o.jsx("div",{className:"text-xs text-brand-dark-800 text-center leading-tight",style:{width:afe,marginLeft:ife},children:t})}),n<Ev.length-1&&o.jsx("div",{className:"flex-1"})]},n))})]});function AQ(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function wQ(e,t,n="text/plain;charset=utf-8;"){AQ(new Blob([e],{type:n}),t)}async function SQ(e,t){var r;const n=await e.blob();AQ(n,(r=ofe(e))!=null?r:t)}function ofe(e){var r;const t=e.headers.get("content-disposition");if(!t)return null;const n=t.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);return((r=n==null?void 0:n[1])==null?void 0:r.replace(/['"]/g,""))||null}const KP=e=>{const t=e.name.trim(),n=t.lastIndexOf(".");return!(n<=0||n===t.length-1||t.slice(n+1).toLowerCase()!=="csv"||t.toLowerCase().includes(".csv."))},lfe="Device Owner Email,Excluded Contact Name,Phone Number (with Country Code),Relationship,Error",EQ=e=>{const t=e.map(r=>{var a;return`${t0(r.deviceOwnerEmail)},${t0(r.contactName)},${t0(r.phoneNumber)},${t0(r.relationship)},${t0((a=r.errorMessage)!=null?a:"")}`}),n=[lfe,...t].join(`\r
|
|
406
|
+
${e!=null?e:""}`,Ude=({status:e,contacts:t,hasActiveFilters:n,refetch:r})=>e==="error"?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx(se,{icon:jf,size:"xxxlarge",className:"mb-2 text-true-neutral-500"}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"Failed to load excluded contacts"}),o.jsx("p",{className:"text-brand-dark-800 text-center text-sm mb-4",children:"Something went wrong. Please try again."}),o.jsx(Gr,{onClick:r,className:"h-10 bg-white",children:"Reload"})]}):e==="pending"?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx("div",{className:"mb-2",children:o.jsx(qt,{size:"lg",colorClass:"border-true-neutral-500"})}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"Loading..."})]}):(t==null?void 0:t.length)===0?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx(se,{icon:Hde,size:"xxxlarge",className:"mb-2 text-true-neutral-500"}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"No excluded numbers added yet."}),o.jsx("p",{className:"text-brand-dark-800 text-center text-sm",children:"Add numbers to be excluded from your review period."})]}):n?o.jsxs("div",{className:"flex flex-col items-center py-10",children:[o.jsx(se,{icon:Yu,size:"xxxlarge",className:"mb-2 text-true-neutral-500"}),o.jsx("p",{className:"text-brand-dark-800 text-center",children:"No results found"}),o.jsx("p",{className:"text-brand-dark-800 text-center text-sm",children:"Try adjusting your search or clear the filters."})]}):"No items found",Wde=[{value:"Family",label:"Family"},{value:"Personal Friend",label:"Personal Friend"},{value:"Non-client Business Contact",label:"Non-client Business Contact"},{value:"Others",label:"Others"}],Yde=({isFormDisabled:e,onSearch:t,onClear:n})=>{const{data:r,status:a}=It(_p()),i=a==="pending",[l,u]=D.useState(null),[d,f]=D.useState(null),[g,p]=D.useState(""),[b,v]=D.useState(""),y=()=>{t({deviceOwner:(l==null?void 0:l.value)||"",contactName:g,phoneNumber:b,relationship:(d==null?void 0:d.value)||""})},w=()=>{u(null),f(null),p(""),v(""),n()};return o.jsx("div",{className:"bg-near-neutral-300 p-3",children:o.jsxs("div",{className:"flex gap-2 items-end flex-wrap",children:[o.jsxs("div",{className:"flex-1 min-w-37.5",children:[o.jsx("label",{htmlFor:"device-owner",className:"block text-sm text-brand-dark-800 mb-1",children:"Device Owner"}),o.jsx(lp._default,{inputId:"device-owner",value:l,onChange:A=>u(A),options:(r==null?void 0:r.map(A=>({value:`${A.firstName} ${A.lastName}`,label:`${A.firstName} ${A.lastName}`})))||[],placeholder:"Choose an option",isDisabled:e||i,isLoading:i,isClearable:!0,isSearchable:!0,menuPosition:"fixed",components:{IndicatorSeparator:null},styles:{control:(A,E)=>({...A,minHeight:"40px",borderRadius:"6px",borderColor:E.isFocused?"var(--color-brand-dark-500)":"var(--color-near-neutral-400)",boxShadow:"none","&:hover":{borderColor:"var(--color-brand-dark-500)"}}),placeholder:A=>({...A,color:"var(--color-brand-dark-800)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),option:(A,E)=>({...A,backgroundColor:E.isSelected?"var(--color-brand-medium-50)":E.isFocused?"var(--color-brand-bright-50)":"white",color:"var(--color-brand-dark-800)",cursor:"pointer"}),singleValue:A=>({...A,color:"var(--color-brand-dark-800)"})}})]}),o.jsxs("div",{className:"flex-1 min-w-37.5",children:[o.jsx("label",{htmlFor:"contact-name",className:"block text-sm text-brand-dark-800 mb-1",children:"Search Contact"}),o.jsxs("div",{className:"relative",children:[o.jsx(se,{icon:Yu,className:"absolute! left-3 top-3 text-brand-dark-800"}),o.jsx("input",{id:"contact-name",type:"text",value:g,onChange:A=>p(Kce(A.target.value)),placeholder:"",disabled:e,className:`w-full h-10 pl-10 py-2 bg-white border border-near-neutral-400 rounded-md text-brand-dark-800 focus:outline-none focus:border-brand-dark-500 hover:border-brand-dark-500 transition-colors duration-200 disabled:cursor-not-allowed disabled:bg-white disabled:opacity-60 ${g?"pr-10":"pr-3"}`}),g?o.jsx("button",{type:"button",onClick:()=>p(""),disabled:e,"aria-label":"Clear contact search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-brand-dark-800 hover:bg-near-neutral-400 rounded-sm transition-colors disabled:opacity-60",children:o.jsx(se,{icon:Ht,size:"medium",className:"opacity-70"})}):null]})]}),o.jsxs("div",{className:"flex-1 min-w-37.5",children:[o.jsx("label",{htmlFor:"phone-number",className:"block text-sm text-brand-dark-800 mb-1",children:"Search Phone number"}),o.jsxs("div",{className:"relative",children:[o.jsx(se,{icon:Yu,className:"absolute! left-3 top-3 text-brand-dark-800"}),o.jsx("input",{id:"phone-number",type:"text",value:b,onChange:A=>v(Zce(A.target.value)),placeholder:"",disabled:e,className:`w-full h-10 pl-10 py-2 bg-white border border-near-neutral-400 rounded-md text-brand-dark-800 focus:outline-none focus:border-brand-dark-500 hover:border-brand-dark-500 transition-colors duration-200 disabled:cursor-not-allowed disabled:bg-white disabled:opacity-60 ${b?"pr-10":"pr-3"}`}),b?o.jsx("button",{type:"button",onClick:()=>v(""),disabled:e,"aria-label":"Clear phone number search",className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-brand-dark-800 hover:bg-near-neutral-400 rounded-sm transition-colors disabled:opacity-60",children:o.jsx(se,{icon:Ht,size:"medium",className:"opacity-70"})}):null]})]}),o.jsxs("div",{className:"flex-1 min-w-45",children:[o.jsx("label",{htmlFor:"relationship",className:"block text-sm text-brand-dark-800 mb-1",children:"Relationship"}),o.jsx(lp._default,{inputId:"relationship",value:d,onChange:A=>f(A),options:Wde,placeholder:"Choose an option",isDisabled:e,isClearable:!0,isSearchable:!0,menuPosition:"fixed",components:{IndicatorSeparator:null},styles:{control:(A,E)=>({...A,minHeight:"40px",borderRadius:"6px",borderColor:E.isFocused?"var(--color-brand-dark-500)":"var(--color-near-neutral-400)",boxShadow:"none","&:hover":{borderColor:"var(--color-brand-dark-500)"}}),placeholder:A=>({...A,color:"var(--color-brand-dark-800)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}),option:(A,E)=>({...A,backgroundColor:E.isSelected?"var(--color-brand-medium-50)":E.isFocused?"var(--color-brand-bright-50)":"white",color:"var(--color-brand-dark-800)",cursor:"pointer"}),singleValue:A=>({...A,color:"var(--color-brand-dark-800)"})}})]}),o.jsx(Gr,{onClick:y,disabled:e,className:"h-10 bg-white disabled:opacity-60",children:"Search"}),o.jsx(Gr,{onClick:w,disabled:e,className:"h-10 bg-white disabled:opacity-60",children:"Clear"})]})})},Gde=e=>e===0?"review_only":"review_and_archive",Kde=e=>e==="review_only"?"0":"1",Fl=({icon:e,label:t,iconClassName:n})=>o.jsxs("div",{className:"border border-near-neutral-400 rounded-md px-2 py-1 flex gap-2 items-center text-sm text-brand-dark-800",children:[o.jsx(se,{icon:e,size:"small",className:n}),o.jsx("span",{children:t})]}),WP=({selected:e,title:t,pills:n,onSelect:r,children:a})=>o.jsxs("div",{className:`border rounded-lg p-5 flex flex-col gap-4 ${e?"bg-near-neutral-100 border-brand-medium-200":"bg-white border-near-neutral-300"}`,children:[o.jsxs("div",{className:"flex gap-4 items-center",children:[o.jsxs("label",{className:"grid place-items-center cursor-pointer",children:[o.jsx("input",{type:"radio",name:"visibility-mode",checked:e,onChange:r,className:"peer col-start-1 row-start-1 appearance-none shrink-0 w-5 h-5 border-2 border-brand-dark-500 rounded-full cursor-pointer"}),o.jsx("div",{className:"col-start-1 row-start-1 w-2.5 h-2.5 rounded-full peer-checked:bg-brand-dark-500 pointer-events-none"})]}),o.jsxs("div",{className:"flex flex-col gap-2.5",children:[o.jsx("p",{className:`text-base font-semibold ${e?"text-brand-dark-500":"text-brand-dark-800"}`,children:t}),o.jsx("div",{className:"flex gap-2",children:n})]})]}),a]}),Zde=({className:e})=>{var M,I;const t=on(S=>S.accountSettings),n=on(S=>S.setAccountSettings),r=Fde(),a=t.mobileExclusionVisibility,i=a?Gde(a.mode):"review_only",l=(M=a==null?void 0:a.lastUpdatedBy)!=null?M:null,u=(I=a==null?void 0:a.lastUpdatedAt)!=null?I:null,[d,f]=D.useState(!1),[g,p]=D.useState(i),b=i==="review_only",v=i==="review_and_archive",y=()=>{p(i),f(!0)},w=()=>{p(i),f(!1)},A=()=>{if(!g||g===i)return;const S=Kde(g);r.mutate({visibilityMode:S},{onSuccess:()=>{n({...t,mobileExclusionVisibility:{mode:parseInt(S),lastUpdatedBy:"Current User",lastUpdatedAt:new Date().toISOString()}}),f(!1)}})},E=S=>S?new Date(S).toLocaleString("en-US",{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"";return o.jsxs("div",{className:`bg-white rounded-lg p-5 flex flex-col gap-4 shadow-elevation-400 ${e||""}`,children:[o.jsx("h3",{className:"text-lg font-semibold text-brand-dark-800",children:"Excluded Communication Visibility Settings"}),d&&o.jsxs("div",{className:"flex gap-1 items-center text-blue-500 text-sm",children:[o.jsx(se,{icon:Ez,size:"medium"}),o.jsx("span",{children:"All communications are always retained in backend storage for audit and compliance purposes"})]}),!d&&b&&o.jsxs("div",{className:"bg-near-neutral-100 border border-brand-medium-200 rounded-lg p-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2.5",children:[o.jsx("p",{className:"text-base font-semibold text-brand-dark-500",children:"Exclude from Review Only"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:bc,label:"Visible in My Archive",iconClassName:"text-brand-medium-500"})]})]}),o.jsx("p",{className:`text-xs text-near-neutral-600 ${l&&u?"":"invisible"}`,children:l&&u?`Last updated by ${l} on ${E(u)}`:"Placeholder"})]}),o.jsxs(Gr,{onClick:y,className:"flex items-center gap-2 h-10 bg-white",children:[o.jsx(se,{icon:Q7,size:"medium"}),"Change"]})]}),!d&&v&&o.jsxs("div",{className:"bg-near-neutral-100 border border-brand-medium-200 rounded-lg p-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2.5",children:[o.jsx("p",{className:"text-base font-semibold text-brand-dark-500",children:"Exclude from Review + My Archive"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:rf,label:"Hidden from My Archive",iconClassName:"text-contextual-danger"})]})]}),o.jsx("p",{className:`text-xs text-near-neutral-600 ${l&&u?"":"invisible"}`,children:l&&u?`Last updated by ${l} on ${E(u)}`:"Placeholder"})]}),o.jsxs(Gr,{onClick:y,className:"flex items-center gap-2 h-10 bg-white",children:[o.jsx(se,{icon:Q7,size:"medium"}),"Change"]})]}),!d&&!i,d&&o.jsxs(o.Fragment,{children:[o.jsx(WP,{selected:g==="review_only",title:"Exclude from Review Only",onSelect:()=>p("review_only"),pills:o.jsxs(o.Fragment,{children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:bc,label:"Visible in My Archive",iconClassName:"text-brand-medium-500"})]})}),o.jsx(WP,{selected:g==="review_and_archive",title:"Exclude from Review + My Archive",onSelect:()=>p("review_and_archive"),pills:o.jsxs(o.Fragment,{children:[o.jsx(Fl,{icon:rf,label:"Hidden from review workflows",iconClassName:"text-contextual-danger"}),o.jsx(Fl,{icon:rf,label:"Hidden from My Archive",iconClassName:"text-contextual-danger"})]}),children:g==="review_and_archive"&&o.jsxs("div",{className:"bg-contextual-warning-50 border-l-4 border-contextual-warning-500 rounded-xs p-3 flex gap-3 items-start",children:[o.jsx(se,{icon:X6,size:"medium",className:"text-contextual-warning-500 shrink-0 mt-0.5"}),o.jsx("p",{className:"text-sm text-brand-dark-800",children:"Restricting access from my archive may limit investigation capabilities."})]})}),o.jsxs("div",{className:"flex gap-4 justify-end",children:[o.jsx(Gr,{onClick:w,children:"Cancel"}),o.jsx(rn,{onClick:A,disabled:!g||g===i,children:"Confirm Change"})]})]})]})},YP=[{id:"one-to-one",title:"1:1 Communications",description:"Between device owner & excluded contact"},{id:"personal-only-groups",title:"Personal-only groups communications",description:"Between device owner & excluded contacts only"}],$de={id:"mixed-group",title:"Mixed group communication",description:"Between device owner, excluded contacts & other participants"},Jde=e=>e===!0||e===1||e==="1"||e==="true",efe=({variant:e})=>e==="excluded"?o.jsx("span",{className:"rounded-full border border-contextual-danger-400 bg-contextual-danger-50 px-2 py-0.5 text-sm text-contextual-danger-400",children:"Excluded"}):o.jsx("span",{className:"rounded-full border border-contextual-success-400 bg-contextual-success-50 px-2 py-0.5 text-sm text-contextual-success-500",children:"Included"}),GP=({rule:e,icon:t,chip:n})=>o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[o.jsx("div",{className:"grid size-12 shrink-0 place-items-center rounded-sm bg-neutral-green-50 text-brand-dark-800",children:o.jsx(se,{icon:t,size:"medium"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-near-neutral-900",children:e.title}),o.jsx("p",{className:"text-sm text-neutral-grey-500",children:e.description})]})]}),n&&o.jsx(efe,{variant:n})]}),Sv=()=>o.jsx("div",{className:"h-px w-full bg-near-neutral-300","aria-hidden":"true"}),tfe=({className:e})=>{const t=on(l=>l.accountSettings),n=on(l=>l.setAccountSettings),r=Xde(),a=Jde(t.excludeMixedGroupFromReview),i=l=>{r.mutate({excludeMixedGroupFromReview:l},{onSuccess:()=>{n({...t,excludeMixedGroupFromReview:l})}})};return o.jsxs("section",{className:`bg-white rounded-lg p-5 flex flex-col gap-4 shadow-elevation-400 ${e||""}`,children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-lg font-medium text-brand-dark-800",children:"Communication Exclusion Rules"}),o.jsx("p",{className:"text-sm text-brand-dark-800",children:"The rules define how communication involving excluded contact are handled."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-neutral-green-200 bg-white p-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("h4",{className:"text-base font-medium text-near-neutral-900",children:"Always excluded"}),o.jsxs("span",{className:"flex items-center gap-2 rounded-md border border-brand-medium-200 px-2 py-1 text-sm text-true-neutral-600",children:[o.jsx(se,{icon:_te,size:"small"}),"Non-configurable"]})]}),o.jsx(Sv,{}),YP.map((l,u)=>o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx(GP,{rule:l,icon:u===0?q6:wz,chip:"excluded"}),u<YP.length-1&&o.jsx(Sv,{})]},l.id))]}),o.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-neutral-green-200 bg-white p-4",children:[o.jsx("h4",{className:"text-base font-medium text-near-neutral-900",children:"Configurable"}),o.jsx(Sv,{}),o.jsx(GP,{rule:$de,icon:Dte,chip:a?"excluded":"included"}),o.jsx(Sv,{}),o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsx("span",{className:"text-sm font-medium text-near-neutral-900",children:"Exclude mixed group communication from review"}),o.jsx(ib,{ariaLabel:"Exclude mixed group communication from review",checked:a,disabled:r.isPending,onChange:i})]}),a&&o.jsxs("div",{className:"flex items-center gap-4 rounded-xs border-l-4 border-contextual-warning-500 bg-contextual-warning-50 px-4 py-2",children:[o.jsx(se,{icon:X6,size:"medium",className:"text-contextual-warning-500 shrink-0"}),o.jsx("p",{className:"text-sm text-true-neutral-700",children:"May hide business-related communications involving other employees or external parties."})]})]})]})]})},nfe=({className:e})=>{const t=vr(),[n,r]=D.useState(!1),[a,i]=D.useState(!1),[l,u]=D.useState(null),{data:d,status:f,refetch:g}=It(_de()),p=D.useMemo(()=>d==null?void 0:d.map(I=>({...I,deviceOwner:I.userName,phoneNumber:I.countryCode?`${I.countryCode}${I.contactNumber}`:I.contactNumber,relationship:I.relationshipName})),[d]),b=Wn(),v=[b.accessor("deviceOwner",{header:"Device Owner",size:150,cell:I=>I.getValue(),filterFn:"includesString"}),b.accessor("contactName",{header:"Contact Name",size:150,cell:I=>I.getValue(),filterFn:"includesString"}),b.accessor("phoneNumber",{header:"Phone Number",size:150,cell:I=>H8(I.getValue())||I.getValue(),filterFn:"includesString"}),b.accessor("relationship",{header:"Relationship",size:160,cell:I=>I.getValue(),filterFn:"equalsString"}),b.accessor("dateCreated",{header:"Date Added",size:120,cell:I=>{const S=I.getValue();if(!S)return"";const R=Cc(S);return R?Mn(R,"MMMM d, yyyy"):S}}),b.display({id:"delete",size:48,header:()=>null,cell:({row:I})=>o.jsx(Jo,{onClick:S=>{S.stopPropagation(),i(!0),u(I.original)},className:"hover:bg-transparent active:bg-transparent",children:o.jsx(se,{className:"text-brand-dark-800",icon:Ti,size:"medium"})})})],y=Nn({data:p!=null?p:[],columns:v,getCoreRowModel:Pn(),getPaginationRowModel:Qn(),getFilteredRowModel:Kn(),getRowId:I=>I.id.toString(),autoResetPageIndex:!1}),w=I=>{const S=[{id:"deviceOwner",value:I.deviceOwner},{id:"contactName",value:I.contactName},{id:"phoneNumber",value:I.phoneNumber},{id:"relationship",value:I.relationship}].filter(R=>R.value);y.setColumnFilters(S)},A=()=>{y.setColumnFilters([])},E=y.getState().columnFilters.length>0,M=f!=="success";return o.jsxs("div",{className:`flex flex-col gap-5 ${e||""}`,children:[o.jsx(Zde,{}),o.jsx(tfe,{}),o.jsxs("div",{className:"border border-brand-dark-800 rounded-lg overflow-hidden",children:[o.jsxs("div",{className:"bg-near-neutral-300 p-3 flex justify-end gap-2 rounded-t-lg",children:[o.jsxs(Gr,{className:"flex items-center gap-2 h-10 bg-white",onClick:()=>t({to:"/settings/mobile/excluded-contacts/bulk-add"}),children:[o.jsx(se,{icon:Fte,size:"medium"}),"Bulk Add"]}),o.jsxs(rn,{className:"flex items-center gap-2 h-10",onClick:()=>r(!0),children:[o.jsx(se,{icon:jr,size:"medium"}),"Add Number"]})]}),o.jsx(Yde,{isFormDisabled:M,onSearch:w,onClear:A}),o.jsx(Er,{table:y,hasGlobalFilter:!1,filterButtons:[],emptyMessage:o.jsx(Ude,{status:f,contacts:d,hasActiveFilters:E,refetch:g}),bordered:!1,outerBorder:!1,maxHeight:null,paginationControlLabel:null}),o.jsx(qde,{isOpen:n,onClose:()=>r(!1)}),o.jsx(Qde,{isOpen:a,contact:l,onClose:()=>{i(!1),u(null)}})]})]})},rfe=()=>o.jsxs("section",{className:"flex flex-col w-full mb-3",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-brand-dark-800 text-2xl font-semibold leading-9",children:"Excluded Numbers"}),o.jsx("p",{className:"mb-10 max-w-150",children:"Exclude specific contacts from your mobile archiving review. Changes to review settings will go into effect in your next review period."})]}),o.jsx(nfe,{})]}),Ev=["Download template & upload file","Review and confirm","Done"],lw=32,afe=120,ife=-88/2,sfe=({currentStep:e})=>o.jsxs("div",{className:"w-full mb-10 box-border pl-14 pr-11",children:[o.jsx("div",{className:"flex flex-col gap-8",children:o.jsx("div",{className:"flex items-center w-full",children:Ev.map((t,n)=>{const r=n+1,a=r<e||e===3&&r===3,i=r===e&&e!==3;return o.jsxs(D.Fragment,{children:[o.jsx("div",{className:["shrink-0 rounded-full border-2 flex items-center justify-center text-sm font-semibold transition-colors",a?"bg-brand-medium-500 border-brand-medium-500 text-white":i?"border-brand-medium-500 text-brand-medium-500 bg-white":"border-near-neutral-400 text-near-neutral-500 bg-white"].join(" "),style:{width:lw,height:lw},children:a?o.jsx(se,{icon:On,size:"small"}):r}),n<Ev.length-1&&o.jsx("div",{className:["flex-1 h-px",a?"bg-brand-medium-500":"bg-near-neutral-400"].join(" ")})]},r)})})}),o.jsx("div",{className:"flex items-start mt-2 w-full",children:Ev.map((t,n)=>o.jsxs(D.Fragment,{children:[o.jsx("div",{className:"shrink-0",style:{width:lw},children:o.jsx("div",{className:"text-xs text-brand-dark-800 text-center leading-tight",style:{width:afe,marginLeft:ife},children:t})}),n<Ev.length-1&&o.jsx("div",{className:"flex-1"})]},n))})]});function AQ(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function wQ(e,t,n="text/plain;charset=utf-8;"){AQ(new Blob([e],{type:n}),t)}async function SQ(e,t){var r;const n=await e.blob();AQ(n,(r=ofe(e))!=null?r:t)}function ofe(e){var r;const t=e.headers.get("content-disposition");if(!t)return null;const n=t.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);return((r=n==null?void 0:n[1])==null?void 0:r.replace(/['"]/g,""))||null}const KP=e=>{const t=e.name.trim(),n=t.lastIndexOf(".");return!(n<=0||n===t.length-1||t.slice(n+1).toLowerCase()!=="csv"||t.toLowerCase().includes(".csv."))},lfe="Device Owner Email,Excluded Contact Name,Phone Number (with Country Code),Relationship,Error",EQ=e=>{const t=e.map(r=>{var a;return`${t0(r.deviceOwnerEmail)},${t0(r.contactName)},${t0(r.phoneNumber)},${t0(r.relationship)},${t0((a=r.errorMessage)!=null?a:"")}`}),n=[lfe,...t].join(`\r
|
|
407
407
|
`)+`\r
|
|
408
408
|
`;wQ(n,"exclusion-upload-errors.csv","text/csv;charset=utf-8;")};function t0(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}const CQ="excluded-numbers-template.csv",cfe=`Device Owner Email,Excluded Contact Name,Phone Number (with Country Code),Relationship\r
|
|
409
409
|
john.smith@example.com,Alice Johnson,+19178907661,Family\r
|