PageSourceSearch

https://ads.applovin.com/public/v202609231054_nogit/js/CruhmPe3a071K0VqlG7z.js

js applovin.com collected 2026-09-24 08:26:04 UTC 41,886 bytes, 1 lines download raw bytes

1!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"0.797.0-argo"}}catch(e){}}();try{e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(s=(new e.Error).stack)&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="8f0ca53c-8490-40d7-9dd8-21124a3ce71d",e._sentryDebugIdIdentifier="sentry-dbid-8f0ca53c-8490-40d7-9dd8-21124a3ce71d")}catch(e){}var e,s;import{k as r,r as n,b as t}from"./BH1hkhJJGfROhHZ8U3kF.js";import{c as a,S as i,N as l,s as o,d as c,q as p,r as u,z as d,B as m,a as y,T as f,I as h,e as N,U as v,b,k as x,n as A,C as g,l as E}from"./BriVvJ7JPLhLKhoSVq-n.js";import{cK as _,n as j,bk as T,ag as I,cL as w,cM as R,B as D,cN as O,cO as P,aq as S,bi as C,cP as L,A as U,e as k,g as M,L as V,ad as Y,cQ as B,Q as z,cR as F,cS as W}from"./Dut9G4aA7NF_0NDDKJbZ.js";import{B as G,q as X,U as H,F as q,C as $,Z as Q,d as K,a3 as Z,o as J,T as ee,a4 as se,Y as re,a0 as ne,x as te,$ as ae,a5 as ie,l as le,a2 as oe,a6 as ce,a7 as pe,a8 as ue,V as de,a9 as me,e as ye,aa as fe}from"./BLxw2h3XNSCQLbkTIxUv.js";import{A as he}from"./BMPIvd4_uZO4u82YqLd2.js";import{E as Ne}from"./B2FSDzO-EOMfVlfVQ3rW.js";import{g as ve}from"./DkSsd1hD63baQZR06IV9.js";import"./CZF61sPJTpHkhKbhhAAi.js";import"./kaq5hapTEw9QrBl2mYwp.js";import"./D-q59vvKl54XhnGRAyR-.js";import"./D-9i83SAfg9dI9hpVBgU.js";import"./LiS9axi2xOJNe-HAuQYj.js";import"./BrItgjstsWqKavXs98mZ.js";var be=(e=>(e.INTERNAL="INTERNAL",e.EXTERNAL="EXTERNAL",e))(be||{}),xe=(e=>(e.ADMIN="ACCOUNT_ADMIN",e.STANDARD="ACCOUNT_STANDARD",e.READ="ACCOUNT_READ",e.OWNER="ACCOUNT_OWNER",e.INTERNAL_ADMIN="INTERNAL_ADMIN",e.INTERNAL_READ="INTERNAL_READ",e.INTERNAL_STANDARD="INTERNAL_STANDARD",e.INTERNAL_GLOBAL_STANDARD="INTERNAL_GLOBAL_STANDARD",e.INTERNAL_GLOBAL_ADMIN="INTERNAL_GLOBAL_ADMIN",e.INTERNAL_SUPER_ADMIN="INTERNAL_SUPER_ADMIN",e))(xe||{}),Ae=(e=>(e.NO_CHANGE="NO_CHANGE",e.NEVER="NEVER",e.DAY7="DAY7",e.DAY365="DAY365",e.DAY30="DAY30",e.DAY180="DAY180",e))(Ae||{}),ge=(e=>(e.ALL="ALL",e.SPECIFIC="SPECIFIC",e))(ge||{});const Ee={[xe.INTERNAL_SUPER_ADMIN]:"Internal super admin",[xe.INTERNAL_ADMIN]:"Internal admin",[xe.INTERNAL_GLOBAL_ADMIN]:"Internal global admin",[xe.INTERNAL_READ]:"Internal read-only",[xe.INTERNAL_STANDARD]:"Internal standard",[xe.INTERNAL_GLOBAL_STANDARD]:"Internal global standard",[xe.ADMIN]:"Admin",[xe.READ]:"Read-only",[xe.STANDARD]:"Standard",[xe.OWNER]:"Owner"},_e=[{label:Ee[xe.INTERNAL_ADMIN],value:xe.INTERNAL_ADMIN},{label:Ee[xe.INTERNAL_READ],value:xe.INTERNAL_READ},{label:Ee[xe.INTERNAL_STANDARD],value:xe.INTERNAL_STANDARD}],je=[{label:Ee[xe.ADMIN],value:xe.ADMIN},{label:Ee[xe.STANDARD],value:xe.STANDARD},{label:Ee[xe.READ],value:xe.READ}],Te=[{label:Ee[xe.OWNER],value:xe.OWNER},...je],Ie={[be.INTERNAL]:_e,[be.EXTERNAL]:je},we="_footer_7z3er_1",Re=e=>{const{confirmLoading:s,clickCancel:n,clickConfirm:t,showRemoveUserButton:a}=e;return r.jsxs("div",{className:we,children:[r.jsx(G,{onClick:n,children:"Cancel"}),r.jsx(G,{loading:s,onClick:t,status:a?"danger":"default",type:"primary",children:a?"Remove":"Update"})]})},De="_user-info-block_cmqyr_1",Oe="_avatar_cmqyr_7",Pe="_user-email_cmqyr_12",Se=e=>{let{userEmail:s}=e;return r.jsxs("div",{className:De,children:[r.jsx(_,{arcoAvatarProps:{className:Oe},text:s}),r.jsx(X.Text,{className:Pe,children:s})]})},Ce="_modal-wrapper_117ox_1",Le="_center_117ox_10",Ue="_account-info_117ox_21",ke=X.Text,Me=X.Paragraph,Ve=e=>{let{userEmail:s,currentRole:n,userType:t,setNewAccessType:i}=e;const[l]=q.useForm();return r.jsxs(r.Fragment,{children:[r.jsx(Se,{userEmail:s}),r.jsxs($,{bordered:!0,className:a(Le,Ue),children:[r.jsx("div",{children:"Current role:"}),r.jsx("div",{children:Ee[n]})]}),r.jsx(Me,{style:{marginTop:24,marginBottom:16},children:r.jsx(ke,{type:"secondary",children:"The new setting will override the previous configuration:"})}),r.jsx(q,{form:l,initialValues:{role:n},layout:"vertical",children:r.jsx(q.Item,{field:"role",label:"User role",style:{margin:0},children:r.jsx(Q,{onChange:i,options:Ie[t],renderFormat:(e,s)=>Ee[s],value:n})})})]})},Ye=e=>{let{visible:s,editingUserInfo:t,onCancel:a,onSuccess:i,accountUserType:l}=e;if(!s)return null;const{runAsync:o,loading:c}=j(T.updateUser,{manual:!0}),[p,u]=n.useState(t.accessType);return r.jsx(H,{className:Ce,footer:r.jsx(Re,{clickCancel:a,clickConfirm:async()=>{try{await o({userEmail:t.userEmail,accessType:p,accountUserType:l,expireType:Ae.NO_CHANGE,appPermissionType:t.appPermissionType,appPermissions:t.appPermissions})}catch(e){return}i()},confirmLoading:c}),onCancel:a,title:"Change role",visible:s,children:r.jsx(Ve,{currentRole:t.accessType,setNewAccessType:u,userEmail:t.userEmail,userType:l})})},Be="_modal-wrapper_1bmoa_1",ze=e=>{let{visible:s,editingUserInfo:n,onCancel:t,onSuccess:a,accountUserType:i}=e;if(!s)return null;const{runAsync:l,loading:o}=j(n.pending?T.deletePendingUser:T.deleteUser,{manual:!0}),c=()=>{null==t||t()};return r.jsx(H,{className:Be,footer:r.jsx(Re,{clickCancel:c,clickConfirm:async()=>{try{await l({userEmail:null==n?void 0:n.userEmail,accountUserType:i})}catch(e){return}a()},confirmLoading:o,showRemoveUserButton:!0}),onCancel:c,title:"Remove user",visible:s,children:r.jsx(X.Paragraph,{style:{margin:0},children:r.jsx(X.Text,{type:"primary",children:"Are you sure you want to remove this user? They will no longer have access to this account."})})})},Fe=e=>{const s=K.utc(e);
1return s.year()>4e3?"Never":s.format("YYYY-MM-DD HH:mm")},We=e=>{const s=I();return[{value:Ae.NO_CHANGE,displayValue:`No change (${Fe(e)})`},{value:Ae.DAY7,displayValue:`7 days from now (${s.add(7,"day").format("YYYY-MM-DD")})`},{value:Ae.DAY30,displayValue:`30 days from now (${s.add(30,"day").format("YYYY-MM-DD")})`},{value:Ae.DAY180,displayValue:`180 days from now (${s.add(180,"day").format("YYYY-MM-DD")})`},{value:Ae.DAY365,displayValue:`365 days from now (${s.add(1,"year").format("YYYY-MM-DD")})`},{value:Ae.NEVER,displayValue:"Never"}]},Ge={"modal-wrapper":"_modal-wrapper_117ox_1",center:"_center_117ox_10","account-info":"_account-info_117ox_21","expire-time-wrapper":"_expire-time-wrapper_117ox_32"},Xe=X.Text,He=X.Paragraph,qe=e=>{let{expireDate:s}=e;const n=Fe(s),t=(e=>{const s=K.utc(e),r=I();return`${s.diff(r,"day")} days left`})(s);return"Never"===n?r.jsx(Xe,{bold:!0,className:Ge["main-expire-text"],children:n}):r.jsxs("div",{className:Ge["expire-time-wrapper"],children:[r.jsx(Xe,{bold:!0,className:Ge["main-expire-text"],children:t}),r.jsx(Xe,{className:Ge["sub-expire-text"],children:n})]})},$e=e=>{let{userEmail:s,expireDate:n,newExpireType:t,setNewExpireType:i}=e;const[l]=q.useForm();return r.jsxs(r.Fragment,{children:[r.jsx(Se,{userEmail:s}),r.jsxs($,{bordered:!0,className:a(Ge.center,Ge["account-info"]),children:[r.jsx("div",{children:"Current access expiration:"}),r.jsx(qe,{expireDate:n})]}),r.jsx(He,{style:{marginTop:24,marginBottom:16},children:r.jsx(Xe,{type:"secondary",children:"The new setting will override the previous configuration:"})}),r.jsx(q,{form:l,initialValues:{expireType:t},layout:"vertical",children:r.jsx(q.Item,{field:"expireType",label:"Access expiration",style:{margin:0},children:r.jsx(Q,{onChange:i,children:We(n).map(e=>r.jsx(Q.Option,{value:e.value,children:r.jsx(X.Ellipsis,{showTooltip:!0,children:e.displayValue})},e.value))})})})]})},Qe=e=>{let{visible:s,editingUserInfo:t,onCancel:a,onSuccess:i,accountUserType:l}=e;if(!s)return null;const{runAsync:o,loading:c}=j(T.updateUser,{manual:!0}),[p,u]=n.useState(Ae.NO_CHANGE),d=()=>{null==a||a()};return r.jsx(H,{className:Ge["modal-wrapper"],footer:r.jsx(Re,{clickCancel:d,clickConfirm:async()=>{try{await o({userEmail:t.userEmail,accessType:t.accessType,accountUserType:l,expireType:p,appPermissionType:t.appPermissionType,appPermissions:t.appPermissions})}catch(e){return}i()},confirmLoading:c}),onCancel:d,title:"Update access expiration",visible:s,children:r.jsx($e,{expireDate:t.expireTime,newExpireType:p,setNewExpireType:u,userEmail:null==t?void 0:t.userEmail})})},Ke="_modal-wrapper_13v5o_1",Ze="_have-permission-icon_13v5o_4",Je="_dont-have-permission-icon_13v5o_8",es="_footer_13v5o_12",ss="_group-row_13v5o_15",rs="_common-row_13v5o_18",ns="_table-container_13v5o_21",ts=e=>(s,n)=>n.group?{children:r.jsx("span",{children:s}),props:{colSpan:0}}:r.jsx("span",{children:n[e]?r.jsx(Z,{className:Ze}):r.jsx(J,{className:Je})}),as=[{title:"",filter:!1,dataIndex:"operation",render:(e,s)=>s.group?{children:r.jsx("span",{style:{fontSize:"12px"},children:e}),props:{colSpan:4,style:{height:40,backgroundColor:"var(--color-fill-1)"}}}:e},{title:"Owner/Admin",filter:!1,width:88,dataIndex:xe.OWNER,render:ts(xe.OWNER)},{title:"Standard",filter:!1,width:88,dataIndex:xe.INTERNAL_STANDARD,render:ts(xe.INTERNAL_STANDARD)},{title:"Read-only",filter:!1,width:88,dataIndex:xe.INTERNAL_READ,render:ts(xe.INTERNAL_READ)}],is=[{operation:"Account settings",group:!0},{operation:"View/edit admin users",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!1,[xe.INTERNAL_READ]:!1},{operation:"View/edit non-admin users",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!1,[xe.INTERNAL_READ]:!1},{operation:"View keys",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!1,[xe.INTERNAL_READ]:!1},{operation:"View payment & billing",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!0,[xe.INTERNAL_READ]:!1},{operation:"Edit payment & billing",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!1,[xe.INTERNAL_READ]:!1},{operation:"Other settings",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!0,[xe.INTERNAL_READ]:!1},{operation:"Reporting",group:!0},{operation:"Customize & save reports",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!0,[xe.INTERNAL_READ]:!0},{operation:"Share view (via URL)",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!0,[xe.INTERNAL_READ]:!0},{operation:"Campaigns/Media/Events/Catalogs",group:!0}
1,{operation:"View",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!0,[xe.INTERNAL_READ]:!0},{operation:"Create/edit",[xe.OWNER]:!0,[xe.INTERNAL_STANDARD]:!0,[xe.INTERNAL_READ]:!1}],ls=()=>r.jsx(he,{className:ns,columns:as,data:is,pagination:{pageSize:20},renderPagination:()=>null,rowClassName:e=>e.group?ss:rs}),os=e=>{const{clickOK:s}=e;return r.jsx("div",{className:es,children:r.jsx(G,{onClick:s,type:"primary",children:"Got it"})})},cs=e=>{let{visible:s,onClose:n}=e;return s?r.jsx(H,{className:Ke,footer:r.jsx(os,{clickOK:n}),onCancel:n,title:"Permissions by access level",visible:s,children:r.jsx(ls,{})}):null},ps={"member-wrapper":"_member-wrapper_c4ktx_1","member-text":"_member-text_c4ktx_8","member-email-text":"_member-email-text_c4ktx_16"},us=e=>{let{accountId:s,memberEmail:n,role:t}=e;return r.jsxs("div",{className:a(ps["member-wrapper"]),children:[r.jsx(w,{id:s||n,isCircle:!0,name:n,nsSize:i.XL}),r.jsxs("div",{className:ps["member-text"],children:[r.jsx(l,{className:ps["member-role-text"],nsShowTooltip:!0,nsVariant:o.ELLIPSIS,style:{color:"var(--items-secondary)",font:"var(--typography-body-xxs)"},children:t}),r.jsx(l,{className:ps["member-email-text"],nsShowTooltip:!0,nsVariant:o.ELLIPSIS,style:{font:"var(--typography-label-strong-sm)"},children:n})]})]})},ds="_member-card_158oh_1",ms="_account-info-container_158oh_4",ys="_account-info-owner-container_158oh_10",fs="_account-info-representative-email-container_158oh_13",hs="_representative-label_158oh_20",Ns=e=>{let{ownerInfo:s,accountDetail:n,isAppAccount:l}=e;const{salesOwnerEmail:o,bdOwnerEmail:b}=n,x=[];o&&x.push({memberEmail:o,role:"Client partner"}),!l&&b&&x.push({memberEmail:b,role:"Account manager"});const A=x.length>0,g=2===(E=x).length?"Please contact your client partner or account manager if you encounter any problems":1===E.length?"Client partner"===E[0].role?"Please contact your client partner if you encounter any problems":"Please contact your account manager if you encounter any problems":"";var E;return r.jsxs("div",{className:ms,children:[r.jsx(c,{className:a(ds,ys),children:r.jsx(us,{memberEmail:s.userEmail,role:"Account owner"})}),A&&r.jsxs(c,{className:a(ds,fs),children:[x.map((e,s)=>r.jsxs(t.Fragment,{children:[r.jsx("div",{className:hs,children:r.jsx(us,{memberEmail:e.memberEmail,role:e.role})}),0===s&&2===x.length&&r.jsx(p,{nsOrientation:"vertical",nsSpacing:u.BASE,style:{margin:"auto",height:"16px",background:"var(--border-extra-strong)"}})]},"".concat(e.role,"-").concat(e.memberEmail))),r.jsx(d,{placement:"top",title:g,children:r.jsx(m,{nsIcon:r.jsx(N,{nsIcon:"info",nsSize:i.MD,nsVariant:v.OUTLINED}),nsImportance:h.SECONDARY,nsSize:i.MD,nsTint:f.NEUTRAL,nsVariant:y.ICON})})]})]})};function vs(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function bs(e){for(var s=1;s<arguments.length;s++){var r=null!=arguments[s]?arguments[s]:{};s%2?vs(Object(r),!0).forEach(function(s){xs(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vs(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function xs(e,s,r){return(s=function(e){var s=function(e,s){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,s);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}const As=(e,s)=>((null==e?void 0:e.data)||[]).map(e=>bs(bs({},e),{},{os:s,platform:s}));const gs={[ge.ALL]:"All apps",[ge.SPECIFIC]:"Specific apps"},Es=[{label:gs[ge.ALL],value:ge.ALL},{label:gs[ge.SPECIFIC],value:ge.SPECIFIC}];function _s(e){return e.platform+"_"+e.packageName}const js=n.forwardRef(({title:e,titleId:s,...r},t)=>n.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":s,...r},e?n.createElement("title",{id:s},e):null,n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.332031 7.49998C0.332031 3.81808 3.3168 0.833313 6.9987 0.833313C10.
16806 0.833313 13.6654 3.81808 13.6654 7.49998C13.6654 11.1819 10.6806 14.1666 6.9987 14.1666C3.3168 14.1666 0.332031 11.1819 0.332031 7.49998ZM9.66537 6.83331H4.33203V8.16665H9.66537V6.83331Z",fill:"#F53F3F"}))),Ts={"app-render-item":"_app-render-item_lkf6m_1","platform-icon":"_platform-icon_lkf6m_7","app-name":"_app-name_lkf6m_11","remove-icon":"_remove-icon_lkf6m_15"};function Is(e){let{item:s,onDelete:n}=e;return r.jsxs("div",{className:Ts["app-render-item"],children:[r.jsx(ne,{className:Ts.icon,shape:"square",size:32,children:r.jsx("img",{alt:s.name,className:Ts["app-icon"],src:s.iconUrl})}),ve({platform:s.platform,className:Ts["platform-icon"]}),r.jsx(X.Ellipsis,{className:Ts["app-name"],children:s.name}),n&&r.jsx(js,{className:Ts["remove-icon"],onClick:()=>n(_s(s),s)})]})}const ws={empty:"_empty_1p1hi_1","empty-icon":"_empty-icon_1p1hi_11"};function Rs(e){let{list:s,onChange:n,disabled:t=!1}=e;return r.jsx(te,{className:ws["app-access-select-list"],noDataElement:r.jsxs("div",{className:ws.empty,children:[r.jsx(ae,{className:ws["empty-icon"]}),r.jsx("div",{children:"No apps selected."})]}),pagination:{pageSize:5,total:s.length,showTotal:!0,showJumper:!0,hideOnSinglePage:!0},children:s.map(e=>r.jsx(te.Item,{style:{padding:"8px 20px"},children:r.jsx(Is,{item:e,onDelete:t?null:e=>{n(s.filter(s=>_s(s)!==e))}})},_s(e)))})}const Ds={"app-access-select-wrapper":"_app-access-select-wrapper_x1z3h_1","error-text":"_error-text_x1z3h_6","app-select-placeholder":"_app-select-placeholder_x1z3h_10","app-select-container":"_app-select-container_x1z3h_18",element:"_element_x1z3h_22",title:"_title_x1z3h_25","app-select-dropdown":"_app-select-dropdown_x1z3h_34","app-access-type-select":"_app-access-type-select_x1z3h_40"};function Os(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ps(e){for(var s=1;s<arguments.length;s++){var r=null!=arguments[s]?arguments[s]:{};s%2?Os(Object(r),!0).forEach(function(s){Ss(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Os(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function Ss(e,s,r){return(s=function(e){var s=function(e,s){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,s);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}function Cs(e){return e.map(e=>({value:_s(e),label:r.jsx(Is,{item:e}),extra:Ps({},e)}))}function Ls(e){let{disabled:s=!1,value:t,errorMessage:a,onChange:i}=e;const o=(null==t?void 0:t.appPermissionType)||ge.ALL,c=(null==t?void 0:t.appPermissions)||[],[p,u]=n.useState(Cs(c)),[d,m]=n.useState(!1),[y,f]=n.useState(O),[h,N]=n.useState(!1),[v,b]=n.useState(""),x=n.useRef(null),A=function(e,s,r,t,a,i){return n.useCallback(re(n=>{s.current=Date.now();const l=s.current;t(!0),r([]);let o="",c="fuzzy";try{Number(n)?(o=n,c="exact"):(o=JSON.parse(n).packageName,c="exact")}catch(p){o=n,c="fuzzy"}if(Array.isArray(e)){const n=e.map(e=>R.appSearch({term:o,country:e===D.IOS?a:void 0,platform:e,type:c,limit:i}));Promise.all(n).then(n=>{if(s.current===l){const s=As(n[0],e[0]),a=As(n[1],e[1]),i=[];s.length<a.length?(i.push(...s),i.push(...a)):(i.push(...a),i.push(...s)),t(!1),r(i)}})}else R.appSearch({term:o,country:e===D.IOS?a:void 0,platform:e,type:c}).then(e=>{s.current===l&&r(e.data)}).finally(()=>{t(!1)})},500),[e,a])}([D.ANDROID,D.IOS],x,e=>{u(Cs(e))},N,y===O?void 0:y),g=(E="Use iTunes ID for iOS apps and package name for Android apps for exact match",_=r.jsx(ae,{}),r.jsx(ee,{content:E,position:"top",children:_||r.jsx(se,{})}));var E,_;const j=!d&&!s,T=e=>{i(Ps({appPermissionType:o,appPermissions:c},e))};return r.jsxs("div",{className:Ds["app-access-select-wrapper"],children:[r.jsx(Q,{className:Ds["app-access-type-select"],disabled:s,onChange:e=>{const s=e;e===ge.ALL?i({appPermissionType:s,appPermissions:[]}):T({appPermissionType:s})},value:o,children:Es.map(e=>r.jsx(Q.Option,{value:e.value,children:r.jsx(X.Ellipsis,{showTooltip:!0,children:e.label})},e.value))}),o===ge.SPECIFIC&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:Ds["app-select-container"],children:[d&&r.jsxs("div",{className:Ds.element,children:[r.jsx("div",{style:{display:"flex",justifyContent:"space-between",marginTop:0,marginBottom:8},children:r.jsx("span",{className:Ds.title,children:"Select an App Store country/region"})}),r.jsx(P,{disable:s,onChange:f,value:y})]}),r.jsxs("div",{className:Ds.element,children:[r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:0,marginBottom:8},children:[r.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[r.jsx("span",{className:Ds.title,children:"Select apps"}),g]}),j&&r.jsx("span",{className:Ds.title,onClick:()=>{m(!0)},style:{cursor:"pointer",fontWeight:"600"},children:"Can’t find your app?"})]}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(Q,{className:Ds["app-select"],disabled:s,dropdownMenuClassName:Ds["app-select-dropdown"],filterOption:!1,loading:h,mode:"multiple",notFoundContent:r.jsx(Ne,{isLoading:h,isSearchValueEmpty:""===v.trim()}),onChange:(e,s)=>{const r=(s||[]).map(e=>
1null==e?void 0:e.extra).filter(Boolean);T({appPermissions:r})},onInputValueChange:e=>{b(e)},onSearch:e=>{A(e)},options:p,renderTag:()=>null,showSearch:!0,triggerProps:{getPopupContainer:e=>document.getElementsByClassName("app-access-modal")[0]||e.parentElement},value:c.map(_s)}),0===v.length&&r.jsx("span",{className:Ds["app-select-placeholder"],children:"Type to search"})]}),a?r.jsx(l,{className:Ds["error-text"],children:a}):null]})]}),r.jsx(Rs,{disabled:s,list:c,onChange:e=>T({appPermissions:e})})]})]})}const Us="_edit-app-permission-modal_3cnte_1",ks="_modal-footer_3cnte_4",Ms="_confirm-button_3cnte_9",Vs="_cancel-button_3cnte_10";function Ys(e){let{editingUserInfo:s,visible:t=!1,onCancel:i,onSuccess:l}=e;const[o]=q.useForm();n.useEffect(()=>{t&&s&&o.setFieldsValue({appPermission:{appPermissions:s.appPermissions||[],appPermissionType:s.appPermissionType}})},[t,s]);const{runAsync:c,loading:p}=j(T.updateUser,{manual:!0}),u=()=>{o.resetFields(),null==i||i()};return r.jsx(H,{className:a(Us,"app-access-modal"),footer:r.jsxs("div",{className:ks,children:[r.jsx(G,{className:Vs,onClick:u,children:"Cancel"}),r.jsx(G,{className:Ms,disabled:null==s?void 0:s.pending,loading:p,onClick:async()=>{const{appPermission:e}=o.getFields();try{var r;await o.validate(),await c({accountUserType:s.userType,userEmail:s.userEmail,expireType:Ae.NO_CHANGE,accessType:s.accessType,appPermissionType:null==e?void 0:e.appPermissionType,appPermissions:null==e||null===(r=e.appPermissions)||void 0===r?void 0:r.map(e=>({packageName:e.packageName,platform:e.platform}))})}catch(n){return}null==l||l()},type:"primary",children:"Update"})]}),maskClosable:!1,onCancel:u,title:"Update app access",unmountOnExit:!0,visible:t,children:r.jsx(q,{autoComplete:"off",form:o,children:r.jsx(q.Item,{field:"appPermission",help:null,label:"App access",layout:"vertical",rules:[{validator:(e,s)=>{const{appPermissionType:r,appPermissions:n=[]}=e||{};r!==ge.SPECIFIC||0!==n.length?s():s("Please select at least one app")}}],shouldUpdate:!0,children:(e,s)=>{var n;return r.jsx(Ls,{disabled:o.getFieldValue("accessType")===xe.ADMIN,errorMessage:null===(n=s.getFieldError("appPermission"))||void 0===n?void 0:n.message,onChange:e.onChange,value:e.value})}})})})}const Bs=[{value:Ae.NEVER,displayValue:"Never"},{value:Ae.DAY7,displayValue:"7 days from now"},{value:Ae.DAY30,displayValue:"30 days from now"},{value:Ae.DAY180,displayValue:"180 days from now"},{value:Ae.DAY365,displayValue:"365 days from now"}];function zs(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Fs(e){for(var s=1;s<arguments.length;s++){var r=null!=arguments[s]?arguments[s]:{};s%2?zs(Object(r),!0).forEach(function(s){Ws(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zs(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function Ws(e,s,r){return(s=function(e){var s=function(e,s){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,s);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}const Gs=e=>{let{arcoFormItemProps:s={},arcoInputTagProps:t={},validate:a=()=>{}}=e;const[i,l]=n.useState(""),[o,c]=n.useState("");return r.jsx(q.Item,Fs(Fs({help:i,validateStatus:i?"error":void 0},s),{},{children:r.jsx(ie,Fs({inputValue:o,onChange:()=>{c("")},onInputChange:e=>{l(""),c(e)},saveOnBlur:!0,validate:e=>{if(!e)return;const s=S.validateEmail(e)||a(e);if(s)l(s);else{if(!C(e))return e;l("Sorry, you can't invite this user to this account. Please contact an AppLovin Ads representative for assistance.")}}},t))}))},Xs={"invite-new-user-modal":"_invite-new-user-modal_18dr9_1","invite-user-description":"_invite-user-description_18dr9_4","modal
1-footer":"_modal-footer_18dr9_10","confirm-button":"_confirm-button_18dr9_15","cancel-button":"_cancel-button_18dr9_16"};function Hs(e){let{isAppAccount:s,visible:n=!1,onCancel:t,onSuccess:i,showRolePermissionModal:l,users:o=[]}=e;const[c]=q.useForm(),{loading:p,run:u}=j(T.inviteUsers,{manual:!0,onSuccess(){b.success("Invitation successfully sent."),i()}}),d=()=>{c.resetFields(),t&&t()};return r.jsxs(H,{className:a(Xs["invite-new-user-modal"],"app-access-modal"),footer:r.jsxs("div",{className:Xs["modal-footer"],children:[r.jsx(G,{className:Xs["cancel-button"],onClick:d,children:"Cancel"}),r.jsx(G,{className:Xs["confirm-button"],loading:p,onClick:async()=>{try{await c.validate();const e=c.getFields(),{appPermission:s}=e;u({accountUserType:be.EXTERNAL,users:e.emails.map(r=>({userEmail:r,accessType:e.accessType,expireType:e.expireType,appPermissionType:s.appPermissionType,appPermissions:s.appPermissions.map(e=>({packageName:e.packageName,platform:e.os}))}))})}catch(e){}},type:"primary",children:"Invite"})]}),maskClosable:!1,onCancel:d,title:"Invite new user",unmountOnExit:!0,visible:n,children:[r.jsx("div",{style:{marginBottom:16},children:r.jsx(X.Text,{className:Xs["invite-user-description"],children:"We will send an invitation email to the invited user(s). Once the invitation is accepted, you will see the new member(s) here. You can add multiple users by separating the emails with a comma."})}),r.jsxs(q,{autoComplete:"off",className:Xs["invite-user-form"],form:c,initialValues:{accessType:xe.READ,expireType:Ae.NEVER,appPermission:{appPermissionType:ge.ALL,appPermissions:[]}},onValuesChange:e=>{e.accessType===xe.ADMIN&&c.setFieldsValue({appPermission:{appPermissionType:ge.ALL,appPermissions:[]}})},children:[r.jsx(Gs,{arcoFormItemProps:{className:Xs["email-input"],label:"Email addresses",field:"emails",layout:"vertical",rules:[{required:!0,message:"Email addresses are required"}]},arcoInputTagProps:{placeholder:"Enter email addresses",tokenSeparators:[","]},validate:e=>{if(o.some(s=>s.userEmail===e))return"Some users have already been invited. Please enter new users instead"}}),r.jsxs("div",{style:{display:"flex",gap:16,justifyContent:"space-between"},children:[r.jsxs("div",{style:{width:"100%",display:"flex"},children:[r.jsx(q.Item,{field:"accessType",label:"Access level",layout:"vertical",children:r.jsx(Q,{options:je,placeholder:"please select"})}),r.jsx(G,{icon:r.jsx(ae,{}),iconOnly:!0,onClick:l,style:{margin:"auto 0 20px 8px",width:36}})]}),r.jsx(q.Item,{field:"expireType",label:"Access expiration",layout:"vertical",children:r.jsx(Q,{placeholder:"Select expiration",children:Bs.map(e=>r.jsx(Q.Option,{value:e.value,children:r.jsx(X.Ellipsis,{showTooltip:!0,children:e.displayValue})},e.value))})})]}),s&&r.jsx($,{bodyStyle:{paddingBottom:0},bordered:!0,children:r.jsx(q.Item,{field:"appPermission",help:null,label:"App access",layout:"vertical",rules:[{validator:(e,s)=>{const{appPermissionType:r,appPermissions:n=[]}=e||{};r!==ge.SPECIFIC||0!==n.length?s():s("Please select at least one app")}}],shouldUpdate:!0,children:(e,s)=>{var n;return r.jsx(Ls,{disabled:c.getFieldValue("accessType")===xe.ADMIN,errorMessage:null===(n=s.getFieldError("appPermission"))||void 0===n?void 0:n.message,onChange:e.onChange,value:e.value})}})})]})]})}const qs="_card-header-wrapper_yf6x1_1",$s="_card-header-title_yf6x1_10",Qs="_filter-group_yf6x1_13",Ks=e=>{let{selectedAccessLevels:s,setSelectedAccessLevels:n,searchQuery:t,setSearchQuery:a,showRolePermissionModal:o,showInviteNewUserModal:c}=e;return r.jsxs("div",{className:qs,children:[r.jsx(l,{className:$s,style:{font:"var(--typography-label-strong-md)"},children:"All users"}),r.jsxs("div",{className:Qs,children:[r.jsx(x,{muiTextFieldProps:{value:t,onChange:e=>{const s=e.target.value;a(s)}},nsHasClear:!0,nsLeadSlot:{props:{nsIcon:"search"},type:"icon"},nsPlaceholder:"Search users by email",nsSize:i.XS,style:{width:220}}),r.jsx(A,{muiAutocompleteProps:{limitTags:1,multiple:!0,onChange:(e,s)=>{n(s.map(e=>e.value))}},muiPopperProps:{placement:"bottom-start",style:{width:"260px"}},nsNoWrap:!0,nsOptions:Te,nsPlaceholder:"Access level",nsSize:i.XS,nsSuffix:r.jsx(m,{nsIcon:"info",nsImportance:h.TRANSPARENT,nsSize:i.SM,nsVariant:y.ICON,onClick:o}),nsTint:f.NEUTRAL,nsValue:s,style:{width:260}}),r.jsx(p,{nsOrientation:"vertical",nsSpacing:u.BASE,style:{margin:"auto",height:"16px",background:"var(--border-extra-strong)"}}),r.jsx(m,{nsImportance:h.PRIMARY,nsLabel:"Invite new user",nsSize:i.MD,nsVariant:y.BASIC,onClick:c})]})]})},Zs="_member-table_e1rk4_1",Js="_member-table-loading_e1rk4_5";function er(e){let{className:s="",loading:n,data:t,columns:l}=e;return n?r.jsx("div",{className:Js,children:r.jsx(g,{nsSize:i.MD})}):r.jsx(E,{className:a(Zs,s),columns:l,disableColumnResize:!0,nsPageSize:10,pageSizeOptions:[5,10,20,50],rows:t,style:{height:"100%"}})}const sr="_content_1h3e5_1",rr="_dropdown-button_1h3e5_8",nr="_dropdown-button-icon_1h3e5_12",tr="_menu_1h3e5_16",ar="_disabled_1h3e5_22",ir="_menu-item-icon_1h3e5_25",lr=e=>{let{value:s,pending:n,isChangeRoleDisabled:t,isEditExpirationDisabled:i,isRemoveUserDisabled:l,showChangeRoleModal:o,showEditExpirationModal:c,showRemoveUserModal:p,cancelInvitation:u,resendInvitation:d}=e;return r.jsxs("div",{className:sr,children:[r.jsx(X.Ellipsis,{rows:1,showTooltip:!!s,style:{margin:0,marginRight:"auto",overflow:"hidden"},children:s||L}),n&&r.jsx(le,{style:{justifySelf:"end"},children:"Pending"}),r.jsx(oe,{droplist:r.jsxs(pe,{className:tr,children:[o&&r.jsxs(pe.Item,{disabled:t,onClick:o,children:[r.jsx(ue,{className:a(ir,{[ar]:t})}),"Change role"]},"changeRole"),c&&r.jsxs(pe.Item,{disabled:i,onClick:c,children:[r.jsx(de,{className:a(ir,{[ar]:i})}),"Edit expiration"]},"editExpiration"),d&&r.jsxs(pe.Item,{onClick:d,children:[r.jsx(me,{className:a(ir)}),"Resend invitation"]},"resendInvitation"),p&&r.jsxs(pe.Item,{disabled:l,onClick:p,style:l?{}:{color:"red"},children:[r.jsx(ye,{className:a(ir,{[ar]:l})}),"Remove user"]},"removeUser"),u&&r.jsxs(pe.Item,{onClick:u,style:{color:"red"},children:[r.jsx(ye,{className:a(ir)}),"Remove user"]},"cancelInvitation")]}),position:"br",trigger:"click",children:r.jsx(G,{className:rr,icon:r.
1jsx(ce,{className:nr}),iconOnly:!0,size:"mini"})})]})};function or(e){return e.appPermissionType===ge.ALL?"All apps":`${e.appPermissions.length} apps`}const cr="_operation-button-group-wrapper_s00yk_4";function pr(e){var s;let{record:t,isDisableRemove:a,showDeleteUserModal:i,resendInvitation:l,cancelInvitation:o}=e;const{state:c}=n.useContext(U),p=null==c||null===(s=c.userBasicData)||void 0===s?void 0:s.userEmail,u=t.userEmail===p,N=(v=t.accessType)===xe.INTERNAL_SUPER_ADMIN||v===xe.INTERNAL_GLOBAL_ADMIN||v===xe.INTERNAL_GLOBAL_STANDARD||(e=>e===xe.INTERNAL_ADMIN)(t.accessType)||u;var v;const b=a||N;return r.jsxs("div",{className:cr,children:[l&&r.jsx(d,{title:"Resend invitation",children:r.jsx(m,{nsIcon:"send",nsImportance:h.TRANSPARENT,nsVariant:y.ICON,onClick:l})}),o&&r.jsx(d,{title:"Remove user",children:r.jsx(m,{nsIcon:"do_not_disturb_on",nsImportance:h.TRANSPARENT,nsTint:f.ALERT,nsVariant:y.ICON,onClick:o})}),i&&r.jsx(d,{title:"Remove user",children:r.jsx(m,{disabled:b,nsIcon:"do_not_disturb_on",nsImportance:h.TRANSPARENT,nsTint:b?f.NEUTRAL:f.ALERT,nsVariant:y.ICON,onClick:()=>{i(t)}})})]})}function ur(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function dr(e){for(var s=1;s<arguments.length;s++){var r=null!=arguments[s]?arguments[s]:{};s%2?ur(Object(r),!0).forEach(function(s){mr(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ur(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function mr(e,s,r){return(s=function(e){var s=function(e,s){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,s);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}function yr(e){var s;let{record:t,refreshTable:a,userType:l,updateUser:o}=e;const{loading:c,run:p}=j(T.updateUser,{manual:!0,onSuccess(e,s){let[r]=s;o(dr(dr({},t),r)),null==a||a()},onError(){null==a||a()}}),{state:u}=n.useContext(U),d=null==u||null===(s=u.userBasicData)||void 0===s?void 0:s.currentAccountName;return r.jsx(A,{muiAutocompleteProps:{disabled:!t.modifyAccessLevel||t.pending||c,value:t.accessType,renderValue:e=>Ee[e]},muiPopperProps:{placement:"bottom-start",style:{width:"auto",minWidth:0,maxWidth:"none"}},nsIsDisabled:!t.modifyAccessLevel||t.pending||c,nsLeadSlot:c&&{props:{children:r.jsx(g,{nsSize:i.XS})},type:"custom"},nsOptions:Ie[l],nsSize:i.XS,nsValue:t.accessType,onChange:(e,s)=>{(e=>{const s={userEmail:t.userEmail,expireType:Ae.NO_CHANGE,accessType:e,accountId:d,accountUserType:l,appPermissionType:e===xe.ADMIN?ge.ALL:t.appPermissionType,appPermissions:e===xe.ADMIN?[]:t.appPermissions};p(s)})(s.value)},style:{width:"160px"}})}const fr="_main-content-wrapper_1ccir_1",hr="_account-info-block-wrapper_1ccir_11",Nr="_access-management-card_1ccir_15",vr="_access-members-table_1ccir_29",br="_hover-highlight-cell_1ccir_32",xr="_hover-show-btn_1ccir_38",Ar="_disabled-cell_1ccir_55";function gr(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var s=1;s<arguments.length;s++){var r=null!=arguments[s]?arguments[s]:{};s%2?gr(Object(r),!0).forEach(function(s){_r(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function _r(e,s,r){return(s=function(e){var s=function(e,s){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,s);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}let jr=function(e){return e.NAME="userEmail",e.LAST_SIGN_IN="lastSignedAt",e.ROLE="accessType",e.USER_TYPE="userType",e.EXPIRE_TIME="expireTime",e.INVITED_BY="invitedBy",e.APP_PERMISSION="appPermissions",e.DELETE="delete",e}({});const Tr="App access",Ir=(e,s,n,t,a,i,l,o)=>({field:jr.NAME,headerName:"User email",flex:3,sortable:!1,filterable:!1,disableColumnMenu:!0,resizable:!1,renderCell:c=>{const p=c.row;return r.jsx(lr,Er(Er({isChangeRoleDisabled:p.isOwner||!p.modifyAccessLevel||p.pending,isEditExpirationDisabled:s||p.isOwner||p.userEmail===e||p.pending,isRemoveUserDisabled:n||p.isOwner||p.userEmail===e||p.pending},p.pending?{cancelInvitation:()=>o(p),resendInvitation:()=>l(p)}:{showChangeRoleModal:()=>t(p),showEditExpirationModal:()=>
1a(p),showRemoveUserModal:()=>i(p)}),{},{pending:p.pending,value:p[jr.NAME]}))}}),wr={field:jr.LAST_SIGN_IN,headerName:"Last signed-in (UTC)",flex:2,disableColumnMenu:!0,resizable:!1,renderCell:e=>{var s;const r=e.row.lastSignedAt;return r?null===(s=K.utc(r))||void 0===s?void 0:s.format("YYYY-MM-DD HH:mm"):L}},Rr=(e,s)=>({field:jr.ROLE,headerName:"Access level",flex:2,sortable:!1,filterable:!1,disableColumnMenu:!0,resizable:!1,renderCell:n=>{const t=n.row;return t.isOwner?r.jsx(A,{muiAutocompleteProps:{value:"Owner"},nsIsDisabled:!0,nsOptions:[{label:"Owner",value:"OWNER"}],nsSize:i.XS,style:{width:"160px"}}):r.jsx(yr,{record:t,refreshTable:e,updateUser:s,userType:be.EXTERNAL})}}),Dr=(e,s,n,t)=>({field:jr.APP_PERMISSION,headerName:Tr,flex:2,sortable:!1,filterable:!1,cellClassName:"members-table-col-app-access",disableColumnMenu:!0,resizable:!1,renderCell:i=>{const l=i.row,o=(s||!n||l.isOwner||l.accessType===xe.ADMIN||l.userEmail===e)&&!l.pending;return r.jsxs("div",{className:a(br,{[Ar]:o}),onClick:()=>!o&&t(l),children:[or(l),!l.pending&&r.jsx(fe,{className:xr})]})}}),Or=(e,s,n,t)=>({field:jr.EXPIRE_TIME,headerName:"Expiration (UTC)",flex:2,cellClassName:"members-table-col-expire-time",disableColumnMenu:!0,resizable:!1,renderCell:i=>{const l=i.row,o=s||!n||l.isOwner||l.userEmail===e||l.pending;return r.jsxs("div",{className:a(br,{[Ar]:o}),onClick:()=>!o&&t(l),children:[Fe(l.expireTime),r.jsx(fe,{className:xr})]})}}),Pr=(e,s,n,t)=>({field:"",headerName:"",width:100,sortable:!1,filterable:!1,disableColumnMenu:!0,resizable:!1,renderCell:a=>{const i=a.row;return r.jsx(pr,Er({isDisableRemove:e||i.isOwner,record:i},i.pending?{resendInvitation:()=>{n(i)},cancelInvitation:()=>{t(i)}}:{showDeleteUserModal:()=>s(i)}))}});function Sr(e,s){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);s&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Cr(e){for(var s=1;s<arguments.length;s++){var r=null!=arguments[s]?arguments[s]:{};s%2?Sr(Object(r),!0).forEach(function(s){Lr(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function Lr(e,s,r){return(s=function(e){var s=function(e,s){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,s);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)}(e,"string");return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[s]=r,e}function Ur(){var e;const{permissionSet:s}=k(),[t,i]=n.useState(!1),[l,o]=n.useState(!1),[p,u]=n.useState(),[d,m]=n.useState(!1),[y,f]=n.useState(),[h,N]=n.useState(""),[v,x]=n.useState([]),[A,g]=n.useState(!1),[E,_]=n.useState(!1),[I,w]=n.useState(!1),[R,D]=n.useState(!1),[O,P]=n.useState(!1),[S,C]=n.useState(null),{userListRemoveIsDisabled:L,userListEditIsDisabled:G,isReadAccountProfileDisabled:X}=function(e){return{isAddUserDisabled:!z(e[F.addUsersButton.locator],F.addUsersButton.targetPermissionInfo.write),userListRemoveIsDisabled:!z(e[F.userListListRemoveButton.locator],F.userListListRemoveButton.targetPermissionInfo.write),userListEditIsDisabled:!z(e[F.userListListEditButton.locator],F.userListListEditButton.targetPermissionInfo.write),isReadAccountProfileDisabled:!z(e[W.self.locator],W.self.targetPermissionInfo.read)}}(s||{}),H=M(s),{state:q}=n.useContext(U),$=null==q||null===(e=q.userBasicData)||void 0===e?void 0:e.currentAccountId,{data:Q}=j(async()=>{if($&&!X)return await T.queryAccountProfile()},{refreshDeps:[$,X]}),[K,Z]=n.useState(null),J=async()=>{let e,s;u(!0);try{[e,s]=await Promise.all([T.getUsers({accountUserType:be.EXTERNAL}),T.getPendingUsers({accountUserType:be.EXTERNAL})]),s=s.map(e=>Cr(Cr({},e),{},{pending:!0,lastSignedAt:""})).sort((e,s)=>e.userEmail.localeCompare(s.userEmail)),Z(e.find(e=>e.isOwner)),g(!0),m(!0)}catch(r){}u(!1),f([...s,...e])};n.useEffect(()=>{q.userBasicData.currentAccountId&&J()},[q.userBasicData.currentAccountId]);const ee=null==y?void 0:y.filter(e=>{const s=e.userEmail.toLowerCase().includes(h.toLowerCase()),r=0===v.length||v.includes(e.accessType)||v.includes(xe.OWNER)&&e.isOwner;return s&&r}).map(e=>Cr(Cr({},e),{},{id:e.userEmail}));return r.jsx(r.Fragment,{children:r.jsxs(V,{children:[r.jsx(Y,{isLoading:!K||!Q,children:r.jsxs("div",{className:fr,children:[r.jsx("div",{className:hr,children:r.jsx(Ns,{accountDetail:Q,isAppAccount:H,ownerInfo:K})}),r.jsxs(c,{className:a(Nr),children:[r.jsx(Ks,{searchQuery:h,selectedAccessLevels:v,setSearchQuery:N,setSelectedAccessLevels:x,showInviteNewUserModal:()=>o(!0),showRolePermissionModal:()=>{i(!0),B()}}),r.jsx(er,{className:vr,columns:(()=>{const e=(e=>{let{isAppAccount:s=!1,canOperationOtherUser:r=!0,currentUserEmail:n,onClickChangeRole:t,onClickEditExpireTime:a,onClickDeleteUser:i,onClickEditAppAccess:l,onClickResendInvitation:o,onClickCancelInvitation:c,isDisabledEdit:p=!1,isDisabledRemove:u=!1,refreshTable:d,updateUser:m}=e;return[Ir(n,p,u,t,a,i,o,c),wr,Rr(d,m),Or(n,p,r,a),s&&Dr(n,p,r,l),Pr(u,i,o,
1c)].filter(Boolean)})({isAppAccount:H,canOperationOtherUser:A,currentUserEmail:q.userBasicData.userEmail,onClickChangeRole:e=>{_(!0),C(e)},onClickEditExpireTime:e=>{w(!0),C(e)},onClickDeleteUser:e=>{D(!0),C(e)},onClickEditAppAccess:e=>{P(!0),C(e)},onClickResendInvitation:e=>{T.resendInvitation(e.userEmail).then(()=>{b.success("Invitation email resent successfully.")})},onClickCancelInvitation:e=>{D(!0),C(e)},isDisabledEdit:G,isDisabledRemove:L,refreshTable:J,updateUser:e=>{f(s=>s?s.map(s=>s.userEmail===e.userEmail?e:s):s)}});return e})(),data:ee||[],loading:d&&p})]})]})}),r.jsx(cs,{onClose:()=>i(!1),visible:t}),r.jsx(Ye,{accountUserType:be.EXTERNAL,editingUserInfo:S,onCancel:()=>{_(!1),C(null)},onSuccess:()=>{_(!1),C(null),J()},visible:E}),r.jsx(Qe,{accountUserType:be.EXTERNAL,editingUserInfo:S,onCancel:()=>{w(!1),C(null)},onSuccess:()=>{w(!1),C(null),J()},visible:I}),r.jsx(ze,{accountUserType:be.EXTERNAL,editingUserInfo:S,onCancel:()=>{D(!1),C(null)},onSuccess:()=>{D(!1),C(null),b.success("The user has been removed successfully."),J()},visible:R}),r.jsx(Ys,{editingUserInfo:S,onCancel:()=>{P(!1),C(null)},onSuccess:()=>{P(!1),J()},visible:O}),r.jsx(Hs,{isAppAccount:H,onCancel:()=>o(!1),onSuccess:()=>{o(!1),J()},showRolePermissionModal:()=>i(!0),users:y,visible:l})]})})}Ur.displayName="AccessManagementPage";const kr=()=>r.jsx(Ur,{});export{kr as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.