PageSourceSearch

https://platform.socbyte.ai/_next/static/chunks/2861.40751ca682a86868.js

js socbyte.ai collected 2026-10-05 12:41:32 UTC 12,398 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="191c5839-29b6-4c61-b8de-4bfd53d67f35",e._sentryDebugIdIdentifier="sentry-dbid-191c5839-29b6-4c61-b8de-4bfd53d67f35")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2861],{51230:(e,s,t)=>{t.d(s,{M:()=>l,w:()=>i});var a=t(65161),n=t(34686);let l=async e=>{try{let{user:s,fieldSearch:t,roleId:l,licenseId:i,licenseIds:r,...d}=e,o=s?(0,n.jN)(s):[e.requestedTenant||""],c=Object.fromEntries(Object.entries(d).filter(e=>{let[,s]=e;return null!=s&&("string"!=typeof s||""!==s.trim())})),m={roleId:l};return o.length>0&&(m.requestedTenant=o),t&&(m.fieldSearch=t),i?m.licenseId=i:r&&r.length>0&&(m.licenseIds=r),(await a.A.post("/user-management/role/permission",m,{params:c})).data}catch(e){var s,t;return{success:!1,message:(null==e||null==(t=e.response)||null==(s=t.data)?void 0:s.message)||"Failed to fetch paginated permissions list"}}},i=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let{user:s,fieldSearch:t,roleId:l,parentPermissionId:i,...r}=e,d=s?(0,n.jN)(s):[e.requestedTenant||""],o=Object.fromEntries(Object.entries(r).filter(e=>{let[,s]=e;return null!=s&&("string"!=typeof s||""!==s.trim())})),c={roleId:l,parentPermissionId:i};return d.length>0&&(c.requestedTenant=d),t&&(c.fieldSearch=t),(await a.A.post("/user-management/permission/child/list",c,{params:o})).data}catch(e){var s,t;return{success:!1,message:(null==e||null==(t=e.response)||null==(s=t.data)?void 0:s.message)||"Failed to fetch child permissions list"}}}},61094:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(98422).A)("outline","eye","Eye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]])},72407:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(98422).A)("outline","shield-lock","ShieldLock",[["path",{d:"M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3",key:"svg-0"}],["path",{d:"M11 11a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12 12l0 2.5",key:"svg-2"}]])},72861:(e,s,t)=>{t.r(s),t.d(s,{default:()=>C});var a=t(95155),n=t(12115),l=t(61094),i=t(72407),r=t(68249),d=t(15007),o=t(80069),c=t(70747),m=t(37911),u=t(12877),x=t(25475),h=t(20363),p=t(22980),y=t(51230),g=t(60285),f=t(33210),j=t(51588),v=t(33936),N=t(60002),b=t(3134),S=t(8213),w=t(73124),P=t(45981);function C(){let{t:e}=(0,P.Jl)("administration"),[s,t]=(0,n.useState)(!1),[C,I]=(0,n.useState)(!1),[k,A]=(0,n.use
1State)(""),[M,E]=(0,n.useState)(""),[O,D]=(0,n.useState)(""),[F,_]=(0,n.useState)([{name:"",description:"",action:""}]),{user:T}=(0,p.J)(),[z,L]=(0,n.useState)([]),[V,$]=(0,n.useState)([]),[q,J]=(0,n.useState)({pageIndex:0,pageSize:10}),[B,R]=(0,n.useState)(!0),[K,H]=(0,n.useState)(""),[Q,W]=(0,n.useState)(""),[G,U]=(0,n.useState)([]),[X,Y]=(0,n.useState)(null),[Z,ee]=(0,n.useState)(!1),[es,et]=(0,n.useState)(!1),[ea,en]=(0,n.useState)(0),[el,ei]=(0,n.useState)(!1),[er,ed]=(0,n.useState)(null),[eo,ec]=(0,n.useState)([]),em=(0,n.useMemo)(()=>[{accessorKey:"name",header:e=>{let{column:s}=e;return(0,a.jsx)(v.w,{column:s,title:"Name"})},cell:e=>{let{cell:s}=e;return s.getValue()}},{accessorKey:"desc",header:e=>{let{column:s}=e;return(0,a.jsx)(v.w,{column:s,title:"Description"})},cell:e=>{let{cell:s}=e;return s.getValue()}},{id:"actions",header:()=>(0,a.jsx)("div",{className:"text-center",children:"Actions"}),cell:e=>{let{row:s}=e;return(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsxs)(j.rI,{children:[(0,a.jsx)(j.ty,{asChild:!0,children:(0,a.jsx)(c.$,{className:"h-8 w-8 bg-transparent p-0 hover:bg-transparent",children:(0,a.jsx)(g.A,{className:"h-4 w-4"})})}),(0,a.jsx)(j.SQ,{align:"end",children:(0,a.jsxs)(j._2,{onClick:()=>{ed(s.original),ei(!0)},children:[(0,a.jsx)(l.A,{className:"h-4 w-4 text-[var(--viewIcon)]"})," View"]})})]})})}}],[]);(0,n.useEffect)(()=>{L((null==T?void 0:T.licensesObject)||[])},[T,C]),(0,n.useEffect)(()=>{(async()=>{var e,t,a,n,l,i,r,d,o;if(s&&(null==T||null==(e=T.roleObject)?void 0:e.id)){ee(!0);try{let e=await (0,y.M)({user:T,roleId:T.roleObject.id,page:q.pageIndex,size:q.pageSize,search:Q.trim()?Q.trim():void 0});$((null==e||null==(t=e.data)?void 0:t.content)||(null==e||null==(a=e.data)?void 0:a.results)||[]);let s=null!=(o=null!=(d=null!=(r=null!=(i=null==e||null==(n=e.data)?void 0:n.totalElements)?i:null==e||null==(l=e.data)?void 0:l.total)?r:null==e?void 0:e.totalElements)?d:null==e?void 0:e.total)?o:0;en(s),Y(null)}catch(e){Y(e.message||"Failed to fetch permissions")}finally{ee(!1)}}})()},[s,q.pageIndex,q.pageSize,Q]),(0,n.useEffect)(()=>{(async()=>{if(el&&(null==er?void 0:er.id)){et(!0);try{var e,s;let t=await (0,y.w)({user:T,roleId:null==T||null==(e=T.roleObject)?void 0:e.id,parentPermissionId:er.id});ec((null==t||null==(s=t.data)?void 0:s.results)||[]),Y(null)}catch(e){Y(e.message||"Failed to fetch child permissions")}finally{et(!1)}}})()},[el,er]);let eu=(0,N.N4)({data:V||[],columns:em,getCoreRowModel:(0,b.HT)(),getPaginationRowModel:(0,b.kW)(),getSortedRowModel:(0,b.h5)(),manualPagination:!0,onPaginationChange:J,onSortingChange:U,pageCount:ea>0?Math.ceil(ea/q.pageSize):1,meta:{totalRows:ea},state:{pagination:q,sorting:G}}),ex=()=>{K.trim()&&(W(K),J(e=>({...e,pageIndex:0})))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.$,{onClick:()=>t(!0),variant:"icon","data-sentry-element":"Button","data-sentry-source-file":"Permissions.tsx",children:[(0,a.jsx)(i.A,{className:"text-primary !h-6 !w-6","data-sentry-element":"IconShieldLock","data-sentry-source-file":"Permissions.tsx"}),(0,a.jsx)("span",{className:"text-[11px] font-medium text-gray-100",children:e("Permissions")})]}),(0,a.jsxs)(m.a,{heading:"Permissions",open:s,onOpenChange:t,"data-sentry-element":"Modal","data-sentry-source-file":"Permissions.tsx",children:[(0,a.jsx)("div",{className:"mb-3 flex items-center justify-end",children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[(0,a.jsx)(r.A,{className:"text-muted-foreground h-5 w-5 cursor-pointer",onClick:()=>R(e=>!e),"data-sentry-element":"IconSearch","data-sentry-source-file":"Permissions.tsx"}),(0,a.jsx)("div",{className:"overflow-hidden transition-all duration-500 ease-in-out ".concat(B?"ml-2 w-80 opacity-100":"w-0 opacity-0"),children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(u.p,{placeholder:"Search permissions...",value:K,onChange:e=>{let s=e.target.value,t=!!(null==K?void 0:K.trim()),a=!s.trim();H(s),t&&a&&(W(""),J(e=>({...e,pageIndex:0})))},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ex())},className:"flex-1",autoFocus:B,"data-sentry-element":"Input","data-sentry-source-file":"Permissions.tsx"}),(0,a.jsx)(c.$,{size:"sm",onClick:ex,className:"px-3",title:"Search",disabled:!K.trim(),"data-sentry-element":"Button","data-sentry-source-file":"Permissions.tsx",children:(0,a.jsx)(r.A,{className:"h-4 w-4","data-sentry-element":"IconSearch","data-sentry-source-file":"Permissions.tsx"})}),(null==K?void 0:K.trim())&&(0,a.jsx)(c.$,{size:"sm",variant:"outline",onClick:()=>{H(""),W(""),J(e=>({...e,pageIndex:0}))},className:"px-3",title:"Clear search",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]})})]})}),X&&(0,a.jsxs)("div",{className:"mb-2 text-sm text-red-500",children:["Failed to load permissions: ",X]}),Z?(0,a.jsx)(S.O,{columnCount:5,rowCount:5,withPagination:!0}
1):(0,a.jsx)(w.b,{table:eu})]}),(0,a.jsx)(m.a,{heading:"View Permission",open:el,onOpenChange:()=>{ei(!1),ed(null)},"data-sentry-element":"Modal","data-sentry-source-file":"Permissions.tsx",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-base font-semibold",children:(null==er?void 0:er.name)||"Permission Details"}),(0,a.jsx)("div",{className:"text-muted-foreground text-xs",children:(null==er?void 0:er.desc)||""})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-2 text-base font-semibold text-gray-200",children:[e("Child Permissions")," (",eo.length,")"]}),es?(0,a.jsx)(S.O,{columnCount:3,rowCount:3}):eo.length>0?(0,a.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,a.jsxs)("table",{className:"min-w-full border-collapse bg-[#0F172A] text-left text-sm text-gray-200",children:[(0,a.jsx)("thead",{className:"bg-[var(--primary)] text-white",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"S.No"}),(0,a.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"Name"}),(0,a.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"Description"})]})}),(0,a.jsx)("tbody",{children:eo.map((e,s)=>(0,a.jsxs)("tr",{className:"border-b border-gray-800 transition-colors",children:[(0,a.jsx)("td",{className:"px-4 py-2 text-gray-300",children:s+1}),(0,a.jsx)("td",{className:"px-4 py-2 text-gray-100",children:e.name}),(0,a.jsx)("td",{className:"px-4 py-2 text-gray-400",children:e.desc})]},e.id))})]})}):(0,a.jsx)("p",{className:"text-sm text-gray-400",children:"No child permissions found."})]})]})}),(0,a.jsx)(m.a,{heading:"New Permission",open:C,onOpenChange:I,showClose:!0,"data-sentry-element":"Modal","data-sentry-source-file":"Permissions.tsx",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(h.J,{htmlFor:"license","data-sentry-element":"Label","data-sentry-source-file":"Permissions.tsx",children:"License"}),(0,a.jsxs)(x.l6,{value:k,onValueChange:A,"data-sentry-element":"Select","data-sentry-source-file":"Permissions.tsx",children:[(0,a.jsx)(x.bq,{"data-sentry-element":"SelectTrigger","data-sentry-source-file":"Permissions.tsx",children:(0,a.jsx)(x.yv,{placeholder:"Select License","data-sentry-element":"SelectValue","data-sentry-source-file":"Permissions.tsx"})}),(0,a.jsx)(x.gC,{"data-sentry-element":"SelectContent","data-sentry-source-file":"Permissions.tsx",children:z.map(e=>(0,a.jsx)(x.eb,{value:e.id,children:e.name},e.id))})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(h.J,{htmlFor:"permission-name","data-sentry-element":"Label","data-sentry-source-file":"Permissions.tsx",children:"Permission Name"}),(0,a.jsx)(u.p,{id:"permission-name",placeholder:"Enter Permission Name",value:M,onChange:e=>E(e.target.value),"data-sentry-element":"Input","data-sentry-source-file":"Permissions.tsx"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(h.J,{htmlFor:"permission-description","data-sentry-element":"Label","data-sentry-source-file":"Permissions.tsx",children:"Permission Description"}),(0,a.jsx)(u.p,{id:"permission-description",placeholder:"Enter Permission Description",value:O,onChange:e=>D(e.target.value),"data-sentry-element":"Input","data-sentry-source-file":"Permissions.tsx"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-100",children:"Subpermissions"}),(0,a.jsx)("div",{className:"space-y-3",children:F.map((e,s)=>(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(u.p,{placeholder:"Sub Permission ".concat(s+1),value:e.name,onChange:e=>_(t=>{let a=[...t];return a[s]={...a[s],name:e.target.value},a}),className:"flex-1"}),(0,a.jsx)(u.p,{placeholder:"Description",value:e.description,onChange:e=>_(t=>{let a=[...t];return a[s]={...a[s],description:e.target.value},a}),className:"flex-1"}),(0,a.jsx)(u.p,{placeholder:"Action",value:e.action,onChange:e=>_(t=>{let a=[...t];return a[s]={...a[s],action:e.target.value},a}),className:"flex-1"}),(0,a.jsx)(d.A,{className:"!h-5 !w-5 cursor-pointer text-[var(--deleteIcon)]",onClick:()=>_(e=>{let t=[...e];return t.splice(s,1),t})})]},s))}),(0,a.jsxs)(c.$,{onClick:()=>_(e=>[...e,{name:"",description:"",action:""}]),"data-sentry-element":"Button","data-sentry-source-file":"Permissions.tsx",children:[(0,a.jsx)(o.A,{className:"!h-6 !w-6","data-sentry-element":"IconPlus","data-sentry-source-file":"Permissions.tsx"}),"Add Subpermission"]})]}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(c.$,{onClick:()=>I(!1),"data-sentry-element":"Button","data-sentry-source-file":"Permissions.tsx",children:"Create"})})]})})]})}}}]);

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.