1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="da218ce5-240b-4f1f-9bc3-f31c2fc2c136",e._sentryDebugIdIdentifier="sentry-dbid-da218ce5-240b-4f1f-9bc3-f31c2fc2c136")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4130],{679:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","target-arrow","TargetArrow",[["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 7a5 5 0 1 0 5 5",key:"svg-1"}],["path",{d:"M13 3.055a9 9 0 1 0 7.941 7.945",key:"svg-2"}],["path",{d:"M15 6v3h3l3 -3h-3v-3l-3 3",key:"svg-3"}],["path",{d:"M15 9l-3 3",key:"svg-4"}]])},12531:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","mail-share","MailShare",[["path",{d:"M13 19h-8a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v6",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}],["path",{d:"M16 22l5 -5",key:"svg-2"}],["path",{d:"M21 21.5v-4.5h-4.5",key:"svg-3"}]])},13364:(e,a,t)=>{t.d(a,{r:()=>l});function l(e){if(null==e||"string"==typeof e&&""===e.trim())return"";let a=new Date(e);return Number.isNaN(a.getTime())?"":a.toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})}},21703:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","layout-dashboard","LayoutDashboard",[["path",{d:"M5 4h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1",key:"svg-0"}],["path",{d:"M5 16h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1",key:"svg-1"}],["path",{d:"M15 12h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1",key:"svg-2"}],["path",{d:"M15 4h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1",key:"svg-3"}]])},26348:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("filled","library-filled","LibraryFilled",[["path",{d:"M18.333 2a3.667 3.667 0 0 1 3.667 3.667v8.666a3.667 3.667 0 0 1 -3.667 3.667h-8.666a3.667 3.667 0 0 1 -3.667 -3.667v-8.666a3.667 3.667 0 0 1 3.667 -3.667zm-4.333 10h-3a1 1 0 0 0 0 2h3a1 1 0 0 0 0 -2m3 -3h-6a1 1 0 0 0 0 2h6a1 1 0 0 0 0 -2m-1 -3h-5a1 1 0 0 0 0 2h5a1 1 0 0 0 0 -2",key:"svg-0"}],["path",{d:"M3.517 6.391a1 1 0 0 1 .99 1.738c-.313 .178 -.506 .51 -.507 .868v10c0 .548 .452 1 1 1h10c.284 0 .405 -.088 .626 -.486a1 1 0 0 1 1.748 .972c-.546 .98 -1.28 1.514 -2.374 1.514h-10c-1.652 0 -3 -1.348 -3 -3v-10.002a3 3 0 0 1 1.517 -2.605",key:"svg-1"}]])},33560:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","message-2-search","Message2Search",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h5",key:"svg-1"}],["path",{d:"M12 21l-.5 -.5l-2.5 -2.5h-3a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v4.5",key:"svg-2"}],["path",{d:"M15 18a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-3"}],["path",{d:"M20.2 20.2l1.8 1.8",key:"svg-4"}]])},36443:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","alert-triangle","AlertTriangle",[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]])},39631:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","user-cog","UserCog",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h2.5",key:"svg-1"}],["path",{d:"M17.001 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M19.001 15.5v1.5",key:"svg-3"}],["path",{d:"M19.001 21v1.5",key:"svg-4"}],["path",{d:"M22.032 17.25l-1.299 .75",key:"svg-5"}],["path",{d:"M17.27 20l-1.3 .75",key:"svg-6"}],["path",{d:"M15.97 17.25l1.3 .75",key:"svg-7"}],["path",{d:"M20.733 20l1.3 .75",key:"svg-8"}]])},43684:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","shield-check","ShieldCheck",[["path",{d:"M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]])},43891:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","message-chatbot","MessageChatbot",[["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-0"}],["path",{d:"M9.5 9h.01",key:"svg-1"}],["path",{d:"M14.5 9h.01",key:"svg-2"}],["path",{d:"M9.5 13a3.5 3.5 0 0 0 5 0",key:"svg-3"}]])},45414:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","fish-hook","FishHook",[["path",{d:"M16 9v6a5 5 0 0 1 -10 0v-4l3 3",key:"svg-0"}],["path",{d:"M14 7a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}
1],["path",{d:"M16 5v-2",key:"svg-2"}]])},46031:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","report-analytics","ReportAnalytics",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2",key:"svg-1"}],["path",{d:"M9 17v-5",key:"svg-2"}],["path",{d:"M12 17v-1",key:"svg-3"}],["path",{d:"M15 17v-3",key:"svg-4"}]])},57846:(e,a,t)=>{t.r(a),t.d(a,{default:()=>q});var l=t(95155),s=t(12115),n=t(61094),r=t(65957);let i=(0,t(98422).A)("outline","license","License",[["path",{d:"M15 21h-9a3 3 0 0 1 -3 -3v-1h10v2a2 2 0 0 0 4 0v-14a2 2 0 1 1 2 2h-2m2 -4h-11a3 3 0 0 0 -3 3v11",key:"svg-0"}],["path",{d:"M9 7l4 0",key:"svg-1"}],["path",{d:"M9 11l4 0",key:"svg-2"}]]);var c=t(74745),d=t(80069),o=t(68249),u=t(58805),h=t(70747),v=t(12877),m=t(37911),p=t(30367),y=t(8213),g=t(13364);function x(e){let{isOpen:a,onClose:t,licenses:s,loading:n=!1}=e;return(0,l.jsx)(m.a,{heading:"Available License",open:a,onOpenChange:t,"data-sentry-element":"Modal","data-sentry-component":"AvailModal","data-sentry-source-file":"AvailModal.tsx",children:n?(0,l.jsx)(y.O,{columnCount:4,rowCount:3}):s.length>0?(0,l.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,l.jsxs)("table",{className:"min-w-full border-collapse bg-[#0F172A] text-left text-sm text-gray-200",children:[(0,l.jsx)("thead",{className:"bg-[var(--primary)] text-white",children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"S.No"}),(0,l.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"Name"}),(0,l.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"Expire At"})]})}),(0,l.jsx)("tbody",{children:s.map((e,a)=>{var t;let s=(0,g.r)(e.expirationDate)||"â";return(0,l.jsxs)("tr",{className:"border-b border-gray-800 transition-colors",children:[(0,l.jsx)("td",{className:"px-4 py-2 text-gray-300",children:a+1}),(0,l.jsx)("td",{className:"px-4 py-2 text-gray-100",children:e.licenseName||"â"}),(0,l.jsx)("td",{className:"px-4 py-2 text-gray-400",children:s})]},"".concat(null!=(t=e.licenseName)?t:"license","-").concat(a))})})]})}):(0,l.jsx)("p",{className:"text-sm text-gray-400",children:"No licenses available."})})}var f=t(22980),j=t(65161),b=t(34686);let N=async e=>{try{let{user:a,fieldSearch:t,requestedTenant:l,...s}=e,n=a?(0,b.jN)(a):[l||""],r=Object.fromEntries(Object.entries(s).filter(e=>{let[,a]=e;return null!=a&&("string"!=typeof a||""!==a.trim())})),i={};return n.length>0&&(i.requestedTenant=n),t&&(i.fieldSearch=t),(await j.A.post("/license-management/allocated-license/list",i,{params:r})).data}catch(e){var a,t;return{success:!1,message:(null==e||null==(t=e.response)||null==(a=t.data)?void 0:a.message)||"Failed to fetch paginated licenses list"}}},k=async e=>{try{return(await j.A.post("/license-management/allocated-license/create",e)).data}catch(e){var a,t;return{success:!1,message:(null==e||null==(t=e.response)||null==(a=t.data)?void 0:a.message)||"Failed to create allocated license"}}},M=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let{user:a,fieldSearch:t,requestedTenant:l,...s}=e,n=a?(0,b.jN)(a):Array.isArray(l)?l:l?[l]:[],r=Object.fromEntries(Object.entries(s).filter(e=>{let[,a]=e;return null!=a&&("string"!=typeof a||""!==a.trim())})),i={};return n.length>0&&(i.requestedTenant=n),t&&(i.fieldSearch=t),(await j.A.post("/license-management/license/list",i,{params:r})).data}catch(e){var a,t;return{success:!1,message:(null==e||null==(t=e.response)||null==(a=t.data)?void 0:a.message)||"Failed to fetch paginated licenses list"}}},A=async e=>{try{let a=await j.A.post("/license-management/license/create",e,{headers:{"Content-Type":"application/json"}});return null==a?void 0:a.data}catch(e){var a,t;return console.error("Error creating license:",e),{success:!1,message:null==e||null==(t=e.response)||null==(a=t.data)?void 0:a.message}}};var w=t(73124),C=t(60002),S=t(3134),L=t(33936),T=t(51588),D=t(60285),E=t(31376),O=t(14749),z=t(99403),F=t(20363),I=t(51861);let _=e=>{let{isOpen:a,onClose:t,onAllocate:n,initialTenantId:r,isEdit:i,availableUserLicenses:c}
1=e,[d,o]=(0,s.useState)(!1),[u,v]=(0,s.useState)(""),{user:p}=(0,f.J)(),[y,g]=(0,s.useState)((null==p?void 0:p.licensesObject)||[]),[x,j]=(0,s.useState)([]),[b,M]=(0,s.useState)(!1),[A,w]=(0,s.useState)({});(0,s.useEffect)(()=>{a&&r&&v(r)},[a,r]),(0,s.useEffect)(()=>{a&&Array.isArray(c)&&c.length>0&&(g((0,I.Uf)(c,e=>e.name)),M(!1))},[a,c]),(0,s.useEffect)(()=>{(async()=>{if(!u)return M(!1);o(!0),M(!1);try{let t=await N({requestedTenant:u});if(t.success){var e,a;let l=((null==p?void 0:p.licensesObject)||[]).map(e=>{var a,t,l,s;return{id:null!=(t=null!=(a=null==e?void 0:e.id)?a:null==e?void 0:e.license)?t:null==e?void 0:e.value,name:null!=(s=null!=(l=null==e?void 0:e.name)?l:null==e?void 0:e.licenseName)?s:null==e?void 0:e.label}}),s=(null==t||null==(e=t.data)?void 0:e.results)||[];if((null==t||null==(a=t.data)?void 0:a.total)===0){g((0,I.Uf)(l,e=>e.name)),M(!1);return}let n=new Set(s.map(e=>e.license)),r=l.filter(e=>!n.has(e.id)),i=l.length>0&&0===r.length;M(i),g((0,I.Uf)(r,e=>e.name))}}catch(e){console.error("Error fetching licenses:",e),M(!1)}finally{o(!1)}})()},[u,null==p?void 0:p.licensesObject]);let C=async()=>{let e={tenant:!u,licenses:0===x.length};if(w(e),Object.values(e).some(Boolean))return void E.toast.error("Please fill in all required fields");let a=await k({license:x,requestedTenant:[u]});a.success?(E.toast.success(a.message),S(),n()):E.toast.error(a.message)},S=()=>{v(""),j([]),M(!1),w({}),t()},L=u?b?"All licenses assigned":"Select licenses":"Choose Tenant first...";return(0,l.jsx)(m.a,{heading:"Allocate License",open:a,onOpenChange:S,showClose:!0,"data-sentry-element":"Modal","data-sentry-component":"AllocateLicenseModal","data-sentry-source-file":"AllocateLicenseModal.tsx",children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(O.F,{id:"allocate-license-tenant",label:"Tenant",placeholder:"Select a tenant",value:u,onValueChange:e=>{v(e),e&&w(e=>({...e,tenant:!1}))},hideForCustomer:!0,required:!0,error:A.tenant?"Tenant is required":void 0,disabled:!!i,"data-sentry-element":"TenantSelect","data-sentry-source-file":"AllocateLicenseModal.tsx"}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)(F.J,{"data-sentry-element":"Label","data-sentry-source-file":"AllocateLicenseModal.tsx",children:["Select Licenses"," ",(0,l.jsx)("span",{className:A.licenses?"text-red-400":"text-white",children:"*"})]}),(0,l.jsx)(z.K,{options:y.map(e=>({value:e.id,label:e.name})),value:x,onChange:e=>{j(e),e.length>0&&w(e=>({...e,licenses:!1}))},disabled:d||!u||b,placeholder:L,emptyMessage:b?"All licenses assigned":"No options available",className:A.licenses?"border-red-500":"","data-sentry-element":"MultiSelect","data-sentry-source-file":"AllocateLicenseModal.tsx"}),A.licenses&&(0,l.jsx)("p",{className:"text-xs text-red-400",children:"Please select at least one license"})]}),(0,l.jsx)("div",{className:"flex justify-end space-y-2",children:(0,l.jsx)(h.$,{onClick:C,disabled:d,"data-sentry-element":"Button","data-sentry-source-file":"AllocateLicenseModal.tsx",children:d?"Allocating...":"Allocate License"})})]})})},P=e=>{let{isOpen:a,onClose:t,onSuccess:n}=e,[r,i]=(0,s.useState)(""),[c,d]=(0,s.useState)(!1),o=async()=>{if(!r.trim())return void E.toast.error("License name cannot be empty");d(!0);try{let e=await A({name:r});e.success?(E.toast.success(e.message||"License created successfully!"),i(""),t(),null==n||n()):E.toast.error(e.message)}catch(e){E.toast.error("An unexpected error occurred. Please try again.")}finally{d(!1)}};return(0,l.jsx)(m.a,{heading:"Create License",open:a,onOpenChange:()=>{t(),i("")},showClose:!0,"data-sentry-element":"Modal","data-sentry-component":"CreateLicenseModal","data-sentry-source-file":"CreateLicense.tsx",children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(F.J,{htmlFor:"license-name","data-sentry-element":"Label","data-sentry-source-file":"CreateLicense.tsx",children:"License Name"}),(0,l.jsx)(v.p,{id:"license-name",placeholder:"Enter license name",value:r,onChange:e=>i(e.target.value),"data-sentry-element":"Input","data-sentry-source-file":"CreateLicense.tsx"})]}),(0,l.jsx)("div",{className:"flex justify-end",children:(0,l.jsx)(h.$,{onClick:o,disabled:c,"data-sentry-element":"Button","data-sentry-source-file":"CreateLicense.tsx",children:c?"Creating...":"Create"})})]})})};var U=t(45981);function q(){var e,a;let{t}
1=(0,U.Jl)("administration"),[j,b]=(0,s.useState)(!1),[k,A]=(0,s.useState)(!1),[E,O]=(0,s.useState)(void 0),[z,F]=(0,s.useState)([]),[q,K]=(0,s.useState)(!1),[R,$]=(0,s.useState)(!1),[J,V]=(0,s.useState)([]),[B,H]=(0,s.useState)(!1),[W,Q]=(0,s.useState)(!1),[Z,G]=(0,s.useState)(null),[X,Y]=(0,s.useState)(!1),{user:ee}=(0,f.J)(),[ea,et]=(0,s.useState)({pageIndex:0,pageSize:10}),[el,es]=(0,s.useState)(!0),[en,er]=(0,s.useState)(""),[ei,ec]=(0,s.useState)(""),[ed,eo]=(0,s.useState)(0),[eu,eh]=(0,s.useState)([]),[ev,em]=(0,s.useState)([]),[ep,ey]=(0,s.useState)(null),[eg,ex]=(0,s.useState)(!1),ef=async()=>{H(!0);try{var e;let a=await M({user:ee}),t=Array.isArray(null==a||null==(e=a.data)?void 0:e.results)?a.data.results:[];V((0,I.Uf)(t.map(e=>{var a,t,l,s;return{licenseName:null!=(t=null!=(a=null==e?void 0:e.licenseName)?a:null==e?void 0:e.name)?t:null,expirationDate:null!=(s=null!=(l=null==e?void 0:e.expirationDate)?l:null==e?void 0:e.expireAt)?s:null}}),e=>e.licenseName))}catch(e){V([])}finally{H(!1)}},ej=async e=>{try{var a;let t=((null==ee?void 0:ee.licensesObject)||[]).map(e=>{var a,t,l,s;return{id:null!=(t=null!=(a=null==e?void 0:e.id)?a:null==e?void 0:e.license)?t:null==e?void 0:e.value,name:null!=(s=null!=(l=null==e?void 0:e.name)?l:null==e?void 0:e.licenseName)?s:null==e?void 0:e.label}}),l=await N({requestedTenant:e}),s=(null==l||null==(a=l.data)?void 0:a.results)||[],n=new Set(s.map(e=>e.license)),r=t.filter(e=>!n.has(e.id));F((0,I.Uf)(r,e=>e.name))}catch(a){let e=(null==ee?void 0:ee.licensesObject)||[];F((0,I.Uf)(e.map(e=>{var a,t,l,s;return{id:null!=(t=null!=(a=null==e?void 0:e.id)?a:null==e?void 0:e.license)?t:null==e?void 0:e.value,name:null!=(s=null!=(l=null==e?void 0:e.name)?l:null==e?void 0:e.licenseName)?s:null==e?void 0:e.label}}),e=>e.name))}finally{O(e),A(!0),b(!0)}};(0,s.useEffect)(()=>{let e=async()=>{try{Y(!0),ey(null);let s={user:ee,page:ea.pageIndex,size:ea.pageSize,search:ei.trim()?ei.trim():void 0};(null==ee?void 0:ee.tenantType)==="mssp"&&(s.tenantType="customer");let n=await (0,p.Dg)(s);if(n&&!1!==n.success){var e,a,t,l;let s=null!=(t=null==n||null==(e=n.data)?void 0:e.results)?t:[],r=null!=(l=null==n||null==(a=n.data)?void 0:a.total)?l:s.length,i=await Promise.all(s.map(async e=>{var a,t,l,s,n,r,i;let c=null==e?void 0:e.id,d=[];try{if(c){let e=await N({requestedTenant:c});(null==e?void 0:e.success)&&Array.isArray(null==e||null==(a=e.data)?void 0:a.results)&&(d=(0,I.Uf)(e.data.results.filter(e=>null==e?void 0:e.licenseName).map(e=>{var a;return{licenseName:e.licenseName,expirationDate:null!=(a=e.expirationDate)?a:""}}),e=>e.licenseName))}}catch(e){console.error("Failed to fetch allocated licenses for tenant ".concat(c),e)}return{id:null!=(t=null==e?void 0:e.id)?t:"",name:null!=(l=null==e?void 0:e.name)?l:"â",createdAt:null!=(s=null==e?void 0:e.createdAt)?s:"",updatedAt:null!=(n=null==e?void 0:e.updatedAt)?n:"",parent:null!=(r=null==e?void 0:e.parent)?r:null,parentName:null!=(i=null==e?void 0:e.parentName)?i:null,availableLicenses:d}}));em(i),eo(r),ey(null)}else ey((null==n?void 0:n.message)||"Failed to fetch MSSP list"),em([]),eo(0)}catch(e){ey((null==e?void 0:e.message)||"Failed to fetch MSSP list"),em([]),eo(0)}finally{Y(!1)}};(j||eg)&&(e(),ex(!1))},[j,ea.pageIndex,ea.pageSize,eg,ei]),(0,s.useEffect)(()=>{if((null==ee?void 0:ee.tenantType)==="customer"){j&&ef();return}R&&ef()},[j,R,null==ee?void 0:ee.tenantType]);let eb=(0,s.useMemo)(()=>[{accessorKey:"name",header:e=>{let{column:a}=e;return(0,l.jsx)(L.w,{column:a,title:"Name"})},cell:e=>{let{cell:a}=e;return a.getValue()}},{accessorKey:"parentName",header:e=>{let{column:a}=e;return(0,l.jsx)(L.w,{column:a,title:"Parent"})},cell:e=>{let{cell:a}=e,t=a.getValue();return t?(0,l.jsx)("div",{className:"capitalize",children:t}):(0,l.jsx)("div",{className:"text-gray-400",children:"-"})}},{accessorKey:"availableLicenses",header:e=>{let{column:a}=e;return(0,l.jsx)(L.w,{column:a,title:"Available Licenses"})},cell:e=>{var a;let{row:t}=e,s=(null!=(a=t.original.availableLicenses)?a:[]).length;return s?(0,l.jsxs)("span",{className:"text-gray-100",children:[s," ",1===s?"license":"licenses"]}):(0,l.jsx)("span",{className:"text-gray-400",children:"No licenses"})}},{accessorKey:"createdAt",header:e=>{let{column:a}=e;return(0,l.jsx)(L.w,{column:a,title:"Created At"})},cell:e=>{let{cell:a}=e,t=(0,g.r)(a.getValue());return t?(0,l.jsx)("div",{children:t}):(0,l.jsx)("div",{className:"text-gray-400",children:"â"})}},{id:"actions",header:()=>(0,l.jsx)("div",{className:"text-center",children:"Actions"}),cell:e=>{var a;let{row:s}=e,i=(null!=(a=s.original.availableLicenses)?a:[]).length>0;return(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsxs)(T.rI,{children:[(0,l.jsx)(T.ty,{asChild:!0,children:(0,l.jsx)(h.$,{className:"h-8 w-8 bg-transparent p-0 hover:bg-transparent",children:(0,l.jsx)(D.A,{className:"h-4 w-4"})})}),(0,l.jsxs)(T.SQ,{align:"end",children:[i&&(0,l.jsxs)(T._2,{onClick:()=>
1{G({tenantName:s.original.name,licenses:(0,I.Uf)(s.original.availableLicenses,e=>e.licenseName)}),Q(!0)},children:[(0,l.jsx)(n.A,{className:"h-4 w-4 text-[var(--viewIcon)]"})," ",t("View")]}),(0,l.jsxs)(T._2,{onClick:()=>ej(s.original.id),children:[(0,l.jsx)(r.A,{className:"h-4 w-4 text-[var(--editIcon)]"})," ",t("Edit")]})]})]})})}}],[t]),eN=(0,C.N4)({data:ev,columns:eb,getCoreRowModel:(0,S.HT)(),getPaginationRowModel:(0,S.kW)(),getSortedRowModel:(0,S.h5)(),onPaginationChange:et,onSortingChange:eh,manualPagination:!0,pageCount:ed>0?Math.ceil(ed/ea.pageSize):1,meta:{totalRows:ed},state:{pagination:ea,sorting:eu}}),ek=()=>{en.trim()&&(ec(en),et(e=>({...e,pageIndex:0})))};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(h.$,{onClick:()=>b(!0),variant:"icon","data-sentry-element":"Button","data-sentry-source-file":"License.tsx",children:[(0,l.jsx)(i,{className:"text-primary !h-6 !w-6","data-sentry-element":"IconLicense","data-sentry-source-file":"License.tsx"}),(0,l.jsx)("span",{className:"text-[11px] font-medium text-gray-100",children:t("License")})]}),(null==ee?void 0:ee.tenantType)!=="customer"?(0,l.jsxs)(m.a,{heading:"License",open:j,onOpenChange:b,showClose:!0,children:[(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)(h.$,{className:"",onClick:()=>$(!0),children:[(0,l.jsx)(c.A,{className:"!h-6 !w-6"}),(0,l.jsx)("span",{className:"text-sm font-medium text-gray-100",children:"Available License"})]}),(0,l.jsxs)(h.$,{className:"ml-2",onClick:()=>{A(!0),O(void 0),b(!0)},children:[(0,l.jsx)(d.A,{className:"!h-6 !w-6"}),(0,l.jsx)("span",{className:"text-sm font-medium text-gray-100",children:"Allocate License"})]})]}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsxs)("div",{className:"relative flex items-center",children:[(0,l.jsx)(o.A,{className:"text-muted-foreground h-5 w-5 cursor-pointer",onClick:()=>es(e=>!e)}),(0,l.jsx)("div",{className:"overflow-hidden transition-all duration-500 ease-in-out ".concat(el?"ml-2 w-80 opacity-100":"w-0 opacity-0"),children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(v.p,{placeholder:"Search tenants...",value:en,onChange:e=>{let a=e.target.value,t=!!(null==en?void 0:en.trim()),l=!a.trim();er(a),t&&l&&(ec(""),et(e=>({...e,pageIndex:0})))},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ek())},className:"flex-1",autoFocus:el}),(0,l.jsx)(h.$,{size:"sm",onClick:ek,className:"px-3",title:"Search",disabled:!en.trim(),children:(0,l.jsx)(o.A,{className:"h-4 w-4"})}),(null==en?void 0:en.trim())&&(0,l.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>{er(""),ec(""),et(e=>({...e,pageIndex:0}))},className:"px-3",title:"Clear search",children:(0,l.jsx)(u.A,{className:"h-4 w-4"})})]})})]})})]})}),X?(0,l.jsx)(y.O,{columnCount:5,rowCount:5,withPagination:!0}):(0,l.jsx)(w.b,{table:eN})]}):(0,l.jsx)(x,{isOpen:j,onClose:()=>b(!1),licenses:J,loading:B}),(0,l.jsx)(x,{isOpen:R,onClose:()=>$(!1),licenses:J,loading:B,"data-sentry-element":"AvailModal","data-sentry-source-file":"License.tsx"}),(0,l.jsx)(_,{isOpen:k,onClose:()=>{A(!1),O(void 0),F([])},onAllocate:()=>ex(!0),initialTenantId:E,isEdit:!!E,availableUserLicenses:z,"data-sentry-element":"AllocateLicenseModal","data-sentry-source-file":"License.tsx"}),(0,l.jsx)(P,{isOpen:q,onClose:()=>K(!1),onSuccess:()=>{b(!0)},"data-sentry-element":"CreateLicenseModal","data-sentry-source-file":"License.tsx"}),(0,l.jsx)(m.a,{heading:"Licenses â ".concat(null!=(a=null==Z?void 0:Z.tenantName)?a:""),open:W,onOpenChange:e=>{e||G(null),Q(e)},showClose:!0,"data-sentry-element":"Modal","data-sentry-source-file":"License.tsx",children:(null==Z||null==(e=Z.licenses)?void 0:e.length)?(0,l.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,l.jsxs)("table",{className:"min-w-full border-collapse bg-[#0F172A] text-left text-sm text-gray-200",children:[(0,l.jsx)("thead",{className:"bg-[var(--primary)] text-white",children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"S.No"}),(0,l.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"Name"}),(0,l.jsx)("th",{className:"px-4 py-3 text-left text-sm font-semibold",children:"Expire At"})]})}),(0,l.jsx)("tbody",{children:Z.licenses.map((e,a)=>{let t=e.expirationDate?(()=>{let a=new Date(e.expirationDate);return Number.isNaN(a.getTime())?"â":a.toLocaleDateString()})():"â";return(0,l.jsxs)("tr",{className:"border-b border-gray-800 transition-colors",children:[(0,l.jsx)("td",{className:"px-4 py-2 text-gray-300",children:a+1}),(0,l.jsx)("td",{className:"px-4 py-2 text-gray-100",children:e.licenseName}),(0,l.jsx)("td",{className:"px-4 py-2 text-gray-400",children:(0,g.r)(t)})]},a)})})]})}):(0,l.jsx)("p",{className:"text-sm text-gray-400",children:"No licenses available."})})]})}},60123:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","alert-hexagon","AlertHexagon",[["path",{d:"M19.875 6.27c.7 .398 1.13 1.143 1.125 1.948v7.284c0 .809 -.443 1.555 -1.158 1.948l-6.75 4.27a2.269 2.269 0 0 1 -2.184 0l-6.75 -4.27a2.225 2.225 0 0 1 -1.158 -1.948v-7.285c0 -.809 .443 -1.554 1.158 -1.947l6.75 -3.98a2.33 2.33 0 0 1 2.25 0l6.75 3.98h-.033",ke
1y:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]])},61094:(e,a,t)=>{t.d(a,{A:()=>l});let l=(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"}]])},63414:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","settings-down","SettingsDown",[["path",{d:"M12.52 20.924c-.87 .262 -1.93 -.152 -2.195 -1.241a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.088 .264 1.502 1.323 1.242 2.192",key:"svg-0"}],["path",{d:"M19 16v6",key:"svg-1"}],["path",{d:"M22 19l-3 3l-3 -3",key:"svg-2"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-3"}]])},64084:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","timeline","Timeline",[["path",{d:"M4 16l6 -7l5 5l5 -6",key:"svg-0"}],["path",{d:"M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}]])},74745:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","check","Check",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]])},90742:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","folders","Folders",[["path",{d:"M9 3h3l2 2h5a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M17 16v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2h2",key:"svg-1"}]])},99060:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(98422).A)("outline","user-screen","UserScreen",[["path",{d:"M19.03 17.818a3 3 0 0 0 1.97 -2.818v-8a3 3 0 0 0 -3 -3h-12a3 3 0 0 0 -3 3v8c0 1.317 .85 2.436 2.03 2.84",key:"svg-0"}],["path",{d:"M10 14a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-1"}],["path",{d:"M8 21a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2",key:"svg-2"}]])},99403:(e,a,t)=>{t.d(a,{K:()=>h});var l=t(95155),s=t(12115),n=t(96703),r=t(66088),i=t(61878),c=t(9316),d=t(40980),o=t(72226),u=t(12877);function h(e){let{options:a,value:t,onChange:h,placeholder:v="Select...",size:m="default",className:p,disabled:y=!1,emptyMessage:g="No options available"}=e,x=s.useRef(null),[f,j]=s.useState(v),[b,N]=s.useState(!1),[k,M]=s.useState(""),A=s.useRef(null),w=a.length>5;s.useEffect(()=>{if(!w||!b)return;let e=setTimeout(()=>{var e;return null==(e=A.current)?void 0:e.focus()},50);return()=>clearTimeout(e)},[k,b,w]);let C=w&&k?a.filter(e=>e.label.toLowerCase().includes(k.toLowerCase())||e.value.toLowerCase().includes(k.toLowerCase())):a,S=e=>{if("all"===e){let e=a.map(e=>e.value);h(e.every(e=>t.includes(e))?[]:e);return}let l=t.includes(e)?t.filter(a=>a!==e):[...t,e];!a.map(e=>e.value).every(e=>l.includes(e))&&l.includes("all")&&(l=l.filter(e=>"all"!==e)),h(l)};s.useLayoutEffect(()=>{if(!x.current)return;if(y)return void j(v);let e=a.map(e=>e.value);if(e.length>0&&e.every(e=>t.includes(e)))return void j("All");let l=a.filter(e=>t.includes(e.value));if(0===l.length)return void j(v);let s=x.current.offsetWidth-70,n=document.createElement("span");n.style.visibility="hidden",n.style.whiteSpace="nowrap",n.style.fontSize="14px",document.body.appendChild(n);let r=[],i=0;for(let e=0;e<l.length;e++)if(n.innerText=[...r,l[e].label].join(", ")+(e<l.length-1?", ":""),n.offsetWidth<=s)r.push(l[e].label);else{i=l.length-e;break}if(document.body.removeChild(n),i>0){if(0===r.length&&l.length>0)return void(1===l.length?j(l[0].label):j("".concat(l[0].label," ,+").concat(l.length-1," more")));j("".concat(r.join(", ")," ,+").concat(i," more"))}else j(r.join(", "))},[t,a,v,y]);let L=a.map(e=>e.value),T=L.length>0&&L.every(e=>t.includes(e)),D=!y&&0===t.length&&!T;return(0,l.jsxs)(n.bL,{open:!y&&b,onOpenChange:e=>{!y&&(N(e),e||M(""))},"data-sentry-element":"DropdownMenu.Root","data-sentry-component":"MultiSelect","data-sentry-source-file":"multi-select.tsx",children:[(0,l.jsxs)(n.l9,{ref:x,className:(0,d.cn)("w-full rounded-lg border border-[var(--primary)] bg-transparent","px-4 py-2 text-sm transition-all duration-200 ease-in-out","focus:border-[var(--primary)] focus:ring-1 focus:ring-[var(--primary)] focus:outline-none","flex items-center justify-between gap-2 truncate","disabled:cursor-not-allowed disabled:opacity-50","data-[size=default]:h-9 data-[size=sm]:h-8","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",p),"data-size":m,disabled:y,"data-sentry-element":"DropdownMenu.Trigger","data-sentry-source-file":"multi-select.tsx",children:[(0,l.jsx)("span",{className:(0,d.cn)("truncate",D&&"text-gray-400"),children:f}),(0,l.jsx)(r.A,{className:"size-4 text-[var(--primary)] opacity-50","data-sentry-element":"ChevronDownIcon","data-sentry-source-file":"multi-select.tsx"})]}),(0,l.jsx)(n.ZL,{"data-sentry-element":"DropdownMenu.Portal","data-sentry-source-file":"multi-select.tsx",children:(0,l.jsxs)(n.UC,{align:"start",className:(0,d.cn)("bg-accent z-50 rounded-md border p-1 shadow-md","max-h-64 w-[var(--radix-dropdown-menu-trigger-width)] overflow-hidden"),onKeyDown:w?e=>{"Escape"!==e.key&&e.stopPropagation()}:void 0,"data-sentry-element":"DropdownMenu.Content","data-sentry-source-file":"multi-select.tsx",children:[w&&(0,l.jsxs)("div",{className:"relative p-2 pb-1",children:[(0,l.jsx)(i.A,{className:"absolute top-1/2 left-3 size-4 -translate-y-1/2 text-[var(--primary)]"}),(0,l.jsx)(u.p,{ref:A,type:"text",placeholder:"Search...",value:k,onChange:e=>M(e.target.value),autoFocus:!0,className:"h-9 pl-6"})]}),(0,l.jsx)(o.F,{className:(0,d.cn)("relative max-h-[200px] overflow-x-hidden overflow-y-auto px-2","[&::-webkit-scrollbar]:w-1.5","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[var(--primary)]/30","[&::-webkit-scrollbar-thumb:hover]:bg-[var(--primary)]/50","scrollbar-thin scrollbar-thumb-[var(--primary)]/30 scrollbar-track-transparent"),"data-sentry-element":"ScrollArea","data-sentry-source-file":"multi-select.tsx",children:0===a.length?(0,l.jsx)("div",{className:"text-muted-foreground py-4 text-center text-sm",children:g}):0===C.length?(0,l.jsx)("div",{className:"text-muted-foreground py-4 text-center text-sm",children:"No results found"}):C.map(e=>(0,l.jsxs)(n.H_,{checked:t.includes(e.value),onSelect:e=>e.preventDefault(),onCheckedChange:()=>S(e.value),className:(0,d.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none","hover:bg-[var(--sidebar-accent)]/30"),children:[(0,l.jsx)("span",{className:"mr-2 flex size-3.5 items-center justify-center",children:(0,l.jsx)(c.S,{id:e.value,checked:t.includes(e.value),onCheckedChange:()=>S(e.value)})}),e.label]},e.value))})]})})]})}}}]);
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.