PageSourceSearch

https://pay.gov.sg/_next/static/chunks/pages/admin/services/[payme…/collaborators-2185449d85013b18.js

js pay.gov.sg collected 2026-10-08 14:55:38 UTC 11,763 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6889],{14532:(e,n,i)=>{"use strict";i.d(n,{a:()=>b,b:()=>g});var l=i(78488),o=i(80269),t=i(91263),a=i(16263),s=i(45879),r=i(20179),d=i(3353),c=i(5941),u=i(90043),m=i(41783),x=i(19671),p=i(80167),h=i(19149);let g=e=>{let{instance:n,isFetching:i,totalRowCount:g,tablePropOverrides:b,emptyPlaceholder:j,onClickRow:v,tableHeaderProps:E,tableHeaderOverrides:y,tableCellProps:f,containerProps:w,...S}=e,{rows:R}=n.getRowModel();return(0,l.jsxs)(t.s,{position:"relative",flexDirection:"column",flex:1,overflowX:"auto",height:"100%",maxHeight:"100%",...w,children:[i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.s,{position:"absolute",zIndex:"1",top:0,right:0,bottom:0,left:0,padding:"1rem",background:"whiteAlpha.800"}),(0,l.jsx)(t.s,{position:"fixed",top:0,right:0,bottom:0,left:0,width:"100vw",height:"$100vh",children:(0,l.jsx)(a.a,{margin:"auto",children:(0,l.jsx)(s.y,{})})})]}),(0,l.jsxs)(r.X,{sx:{tableLayout:"fixed"},...S,position:"relative",children:[R.length>0&&(0,l.jsx)(d.d,{children:n.getHeaderGroups().map(e=>(0,l.jsx)(c.Tr,{color:"interaction.sub.default",borderColor:"brand.secondary.100",borderBottomWidth:"1px","data-group":!0,children:e.headers.map(e=>{var n,i;return(0,l.jsxs)(u.Th,{textTransform:"none",background:"base.canvas.alt",_first:{paddingInlineStart:"16px"},_last:{paddingInlineEnd:"16px"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,paddingInline:"8px",style:{width:e.getSize()===Number.MAX_SAFE_INTEGER?"auto":"".concat(e.getSize(),"px")},...E,...null==y||null==(n=y[e.id])?void 0:n.th,children:[(0,h.Kv)(e.column.columnDef.header,e.getContext()),null!=(i=({asc:(0,l.jsx)(m.I,{as:o.lCq,marginLeft:"-0.5rem",fontSize:"1rem"}),desc:(0,l.jsx)(m.I,{as:o.oVj,marginLeft:"-0.5rem",fontSize:"1rem"})})[e.column.getIsSorted()])?i:null]},e.id)})},e.id))}),(0,l.jsxs)(x.N,{children:[0===R.length&&j,R.map((e,n)=>(0,l.jsx)(c.Tr,{cursor:v?"pointer":"auto",onClick:()=>null==v?void 0:v(e.original),role:"group",children:e.getVisibleCells().map(e=>{var i,o;return(0,l.jsx)(p.Td,{verticalAlign:"center",background:"white",borderBottomWidth:n===R.length-1?0:"1px",_first:{paddingInlineStart:"16px"},_last:{paddingInlineEnd:"16px"},_groupHover:v?{backgroundColor:"interaction.muted.main.hover"}:{},paddingInline:"8px",paddingY:"12px",transitionDuration:"100ms",transitionProperty:"background-color",transitionTimingFunction:"ease-in",...f,...null==b||null==(i=b[e.column.id])?void 0:i.td,...null==b||null==(o=b[e.id])?void 0:o.td,children:(0,h.Kv)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id))]})]})]})},b=()=>({position:"sticky",left:0,opacity:.95,zIndex:1})},20089:(e,n,i)=>{"use strict";i.d(n,{_:()=>S});var l=i(78488),o=i(81204),t=i(70150),a=i(53908),s=i(68021),r=i(77412),d=i(73890),c=i(28885),u=i(12860),m=i(94908),x=i(5678),p=i(97298),h=i(42033),g=i(17494),b=i(43498),j=i(9177),v=i(20607),E=i(25231),y=i(30484),f=i(93486);let w=[{subroute:"payments",label:"Payments",allowedRoles:[p.E.Admin,p.E.View,p.E.Billing,p.E.Refund]},{subroute:"forms",label:"Forms",allowedRoles:[p.E.Admin,p.E.View,p.E.Billing,p.E.Refund]},{subroute:"subscriptions",label:"Subscriptions",allowedRoles:[p.E.Admin,p.E.View,p.E.Billing,p.E.Refund],shouldDisplay:e=>e.paymentModels.includes(x.Iq.SUBSCRIPTION)},{subroute:"reports",label:"Reports",allowedRoles:[p.E.Admin,p.E.View,p.E.Billing,p.E.Refund]},{subroute:"payment-service",label:"Payment service",allowedRoles:[p.E.Admin,p.E.View,p.E.Billing,p.E.Refund]},{subroute:"collaborators",label:"Collaborators",allowedRoles:[p.E.Admin]}],S=e=>{let{children:n,currentTab:i}=e,{user:x,logout:S}=(0,y.A)(),R=(0,d.d)(),C=(0,m.useRouter)(),{isPaymentServiceIdValid:k,paymentServiceId:I}=(0,h.O)(),_=k?I:"",{is_onboarding_failed:T}=C.query,{paymentService:A,isPaymentServiceLoading:B,isErrorFetchingPaymentService:P}=(0,v.d)(_,{enabled:k}),z=(0,o.useMemo)(()=>null==A?void 0:A.name,[A]),L=(0,o.useCallback)(e=>{C.push("/admin/services/".concat(_,"/").concat(e))},[_,C]),{jobs:D,isJobsLoading:V}=(0,E.D)({paymentServiceId:null==A?void 0:A.id},{enabled:!!(null==A?void 0:A.id)}),{generatePaymentServiceJobResultReportUrl:N,isGeneratePaymentServiceJobResultReportUrlLoading:O}=(0,j.n)({paymentServiceId:null==A?void 0:A.id}),F=(0,o.useMemo)(()=>w.filter(e=>!e.shouldDisplay||A&&e.shouldDisplay(A)),[A]);return(0,o.useEffect)(()=>{T&&R({status:"error",description:"There was an error while connecting to Stripe. Please try again."})},[T]),(0,o.useEffect)(()=>{C.isReady&&(k||C.push("/admin/services"),P&&C.push("/admin/services"))},[k,C,C.isReady,P]),(0,l.jsx)(f.q,{children:(0,l.jsxs)(l.Fragment,{children:[!B&&(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(t.T,{alignItems:"stretch",flexGrow:1,minWidth:"768px",background:"brand.secondary.50",spacing:i.includes("settings")?"0px":"24px",children:[(0,l.jsx)(b.A,{onLogout:S,userEmail:null==x?void 0:x.email,paymentServiceName:z,jobs:D,isJobsLoading:V,generateJobReportUrl:N,isPaymentServicePage:!0,isGenerateJobReportUrlLoading:O}),(0,l.jsx)(a.E,{isLoaded:!!z,children:(0,l.jsx)(s.E,{textStyle:"h4",paddingX:"24px",children:z})}),(0,l.jsx)(c.t,{index:F.findIndex(e=>e.subroute===i),flexGrow:0,children:(0,l.jsx)(r.z,{paddingX:"24px",spacing:"24px",children:F.map(e=>e.allowedRoles.includes(p.E.View)?(0,l.jsx)(u.o,{paddingTop:0,marginTop:0,paddingBottom:"2px",onClick:()=>L(e.subroute),"data-dd-action-name":"Payment service nav bar ".concat(e.label," tab"),children:(0,l.jsx)(s.E,{textStyle:e.subroute===i?"subhead-2":"body-2",textTransform:"none",children:e.label})},e.subroute):(0,l.jsx)(g.l,{allowedRoles:e.allowedRoles,loadingComponent:null,children:(0,l.jsx)(u.o,{paddingTop:0,marginTop:0,paddingBottom:"2px",onClick:()=>L(e.subroute),"data-dd-action-name":"Payment service nav bar ".concat(e.label," tab"),children:(0,l.jsx)(s.E,{textStyle:e.subroute===i?"subhead-2":"body-2",textTransform:"none",children:e.label})})},e.subroute))})}),(0,l.jsx)(t.T,{align:"stretch",flexGrow:1,overflowY:"hidden",children:n})]})}),!!P&&(0,l.jsx)(a.E,{flexGrow:1,isLoaded:!B})]})})}},42537:(e,n,i)=>{"use strict";i.d(n,{U:()=>o});var l=i(97298);let o=e=>[l.E.View,l.E.Admin,l.E.Billing,l.E.Refund].filter(n=>e.includes(n))},46176:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>U});var l=i(78488),o=i(20089),t=i(81204),a=i(28869),s=i(70150),r=i(91263),d=i(34556),c=i(77412),u=i(39978),m=i(26643),x=i(73890),p=i(25393),h=i(94908),g=i(97298),b=i(92107),j=i(42033),v=i(82918),E=i(3801),y=i(29007),f=i(49205),w=i(18914),S=i(68021),R=i(16263),C=i(74087),k=i(89308),I=i(19149),_=i(14532),T=i(42537);let A={[g.E.Admin]:"Administrator",[g.E.View]:"View",[g.E.Billing]:"Billing",[g.E.Refund]:"Refund"},B=(0,k.FB)(),P=[B.accessor("email",{header:()=>(0,l.jsx)(S.E,{textStyle:"subhead-2",color:"interaction.sub.default",children:"Email address"}),cell:e=>(0,l.jsx)(S.E,{textStyle:"body-2",color:"base.content.medium",children:e.getValue()})}),B.accessor("roles",{header:()=>(0,l.jsx)(S.E,{textStyle:"subhead-2",color:"interaction.sub.default",children:"Permissions"}),cell:e=>
1(0,l.jsx)(c.z,{children:(0,T.U)(e.getValue()).map(e=>(0,l.jsx)(C.vw,{_hover:{background:"interaction.main-subtle.default"},children:A[e]},e))})}),B.display({id:"actions",header:()=>(0,l.jsx)(S.E,{textStyle:"subhead-2",color:"interaction.sub.default",children:"Actions"}),cell:e=>(0,l.jsxs)(c.z,{justifyContent:"end",children:[(0,l.jsx)(p.$,{variant:"link",onClick:n=>{n.stopPropagation(),e.row.original.onEdit()},minW:"16px",children:(0,l.jsx)(S.E,{textStyle:"subhead-2",children:"Edit"})}),e.row.original.shouldShowRemoveButton&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(S.E,{textStyle:"subhead-2",children:"|"}),(0,l.jsx)(p.$,{variant:"link",onClick:n=>{n.stopPropagation(),e.row.original.onRemove()},minW:"16px",children:(0,l.jsx)(S.E,{textStyle:"subhead-2",children:"Remove"})})]})]})})],z=e=>{let{collaboratorsData:n}=e,i=(0,I.N4)({columns:P,data:n,pageCount:-1,getCoreRowModel:(0,k.HT)(),enableSortingRemoval:!1,manualSorting:!0,manualPagination:!0,manualFiltering:!0,enableSorting:!1,state:{sorting:[]},defaultColumn:{size:200}});return(0,l.jsx)(R.a,{borderWidth:"1px",borderColor:"base.divider.medium",borderRadius:"".concat(4,"px"),children:(0,l.jsx)(_.b,{isFetching:!1,instance:i,tableHeaderProps:{background:"base.canvas.alt",height:"44px",_last:{textAlign:"end",paddingInlineEnd:"16px"}},onClickRow:e=>e.onEdit(),containerProps:{borderRadius:"".concat(3,"px")}})})};var L=i(35364),D=i(15468),V=i(36441),N=i(98255),O=i(98834),F=i(20095);let G=e=>{let{isOpen:n,onClose:i,collaboratorEmail:o,isDeleteLoading:t,onDelete:a}=e;return(0,l.jsxs)(L.aF,{closeOnOverlayClick:!t,isOpen:n,onClose:i,children:[(0,l.jsx)(D.m,{}),(0,l.jsxs)(V.$,{background:"brand.secondary.50",children:[(0,l.jsx)(N.s,{isDisabled:t,onClick:i}),(0,l.jsx)(O.c,{marginTop:"32px",marginRight:"44px",children:(0,l.jsxs)(S.E,{textStyle:"h4",children:["Are you sure you want to remove ",o,"?"]})}),(0,l.jsx)(F.j,{children:(0,l.jsxs)(c.z,{spacing:"16px",children:[(0,l.jsx)(p.$,{variant:"clear",onClick:i,isDisabled:t,colorScheme:"brand.secondary",children:"Not now"}),(0,l.jsx)(p.$,{onClick:async()=>{await a(),i()},isLoading:t,children:"Remove"})]})})]})]})};var X=i(30484);let H=()=>{let e=(0,x.d)(),n=(0,h.useRouter)(),{user:i}
1=(0,X.A)(),{isPaymentServiceIdValid:o,paymentServiceId:S}=(0,j.O)(),{roles:R,isLoading:C}=(0,b.u)();(0,t.useEffect)(()=>{C||!R||R.has(g.E.Admin)||n.push("/admin/services/".concat(S,"/payments"))},[C,S,R,n]);let{collaborators:k}=(0,w.I)({paymentServiceId:S},{enabled:o}),I=(0,t.useMemo)(()=>{if(!k||!i)return null;let e=k.findIndex(e=>e.user.id===i.id);return -1===e?k:[k[e],...k.slice(0,e),...k.slice(e+1)]},[k,i]),{isDeletePaymentServiceCollaboratorLoading:_,deletePaymentServiceCollaborator:T}=(e=>{let{paymentServiceId:n}=e,i=(0,v.jE)(),l=async e=>await f.Gf.delete("/payment-services/".concat(encodeURIComponent(n),"/payment-service-collaborators/").concat(encodeURIComponent(e))),{isLoading:o,mutateAsync:t}=(0,E.n)(l,{onSuccess:async()=>{await i.invalidateQueries(y.l.paymentServices.details(n)._ctx.collaborators)}});return{isDeletePaymentServiceCollaboratorLoading:o,deletePaymentServiceCollaborator:t}})({paymentServiceId:S}),A=(0,a.j)(),[B,P]=(0,t.useState)(null),L=(0,t.useCallback)(async()=>{B&&(await T(B.id),P(null),e({status:"success",description:"".concat(B.email," has been removed as a collaborator")}))},[B,T,e]),D=(0,t.useCallback)(()=>{A.onClose(),P(null)},[A]);return n.isReady?(0,l.jsxs)(s.T,{align:"stretch",flexGrow:1,alignSelf:"stretch",boxSizing:"content-box",marginX:"24px",paddingBottom:"20px",spacing:"24px",children:[(0,l.jsx)(r.s,{justifyContent:"end",children:(0,l.jsx)(p.$,{size:"sm",onClick:()=>{n.push("/admin/services/".concat(S,"/collaborators/new"))},cursor:"pointer",children:"Add collaborator"})}),I?(0,l.jsx)(d.z,{in:!!I,children:(0,l.jsx)(z,{collaboratorsData:I.map(e=>({email:e.user.email,onEdit:()=>{var i;i=e.id,n.push("/admin/services/".concat(S,"/collaborators/").concat(i,"/edit"))},onRemove:()=>{P({id:e.id,email:e.user.email}),A.onOpen()},roles:e.roles,shouldShowRemoveButton:e.user.email!==(null==i?void 0:i.email)}))})}):(0,l.jsxs)(c.z,{background:"standard.white",borderRadius:"base",paddingX:4,paddingY:2,spacing:3,children:[(0,l.jsx)(u.Q,{size:"10"}),(0,l.jsx)(m.r,{flexGrow:1,noOfLines:1,skeletonHeight:6})]}),B&&(0,l.jsx)(G,{collaboratorEmail:B.email,isDeleteLoading:_,isOpen:A.isOpen,onClose:D,onDelete:L})]}):null},M=()=>(0,l.jsx)(H,{});M.getLayout=e=>(0,l.jsx)(o._,{currentTab:"collaborators",children:e});let U=M},72346:(e,n,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/services/[paymentServiceId]/collaborators",function(){return i(46176)}])}},e=>{e.O(0,[7825,4702,4715,4694,3524,5359,9766,6871,7403,8794,8304,636,6593,8792],()=>e(e.s=72346)),_N_E=e.O()}]);

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.