1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6451],{21215:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/subscriptions",function(){return r(41829)}])},17925:function(e,t,r){"use strict";r.d(t,{Ds:function(){return readManagedServicePurchases},Ue:function(){return saveManagedServicePurchase},jx:function(){return removeManagedServicePurchases}});let storageKey=e=>"managed-service-purchases:".concat(e),isBrowser=()=>!0,isManagedServicePurchase=e=>!!e&&"object"==typeof e&&"string"==typeof e.serviceItemId&&"string"==typeof e.subscriptionId&&"string"==typeof e.name&&"string"==typeof e.productCode&&"number"==typeof e.createdAt,readManagedServicePurchases=e=>{if(!isBrowser())return[];try{let t=localStorage.getItem(storageKey(e));if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r.filter(isManagedServicePurchase):[]}catch(e){return[]}},writeManagedServicePurchases=(e,t)=>{if(isBrowser())try{localStorage.setItem(storageKey(e),JSON.stringify(t))}catch(e){}},saveManagedServicePurchase=(e,t)=>{let r=readManagedServicePurchases(e),s=r.filter(e=>e.serviceItemId!==t.serviceItemId);writeManagedServicePurchases(e,[...s,{...t,createdAt:Date.now()}])},removeManagedServicePurchases=(e,t)=>{let r=new Set(t),s=readManagedServicePurchases(e),a=s.filter(e=>!r.has(e.subscriptionId));return a.length!==s.length&&writeManagedServicePurchases(e,a),a}},70458:function(e,t,r){"use strict";r.d(t,{x:function(){return DisableableLink}});var s=r(85893),a=r(41664),n=r.n(a);r(67294);var i=r(746);let DisableableLink=e=>{let{disabled:t=!1,children:r,as:a,href:l,buttonClassName:o,...c}=e;return t?(0,s.jsx)(i.z,{disabled:!0,liftPrimary:!0,liftSecondary:!0,liftViolet:!0,className:o,children:r}):(0,s.jsx)(n(),{href:l,as:a,...c,passHref:!0,legacyBehavior:!0,children:(0,s.jsx)(i.z,{as:"a",liftPrimary:!0,liftSecondary:!0,liftViolet:!0,className:o,children:r})})}},41829:function(e,t,r){"use strict";r.r(t),r.d(t,{SubscriptionsIndex:function(){return SubscriptionsIndex},default:function(){return F}});var s=r(85893),a=r(67294);let n=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z",clipRule:"evenodd"}))});var i=r(17524),l=r(41664),o=r.n(l),c=r(11163),d=r(81758),u=r(59489),m=r(23249),p=r(45738),f=r(37331),g=r(58233),v=r(17925),h=r(16411),x=r(70458),S=r(1920);r(29331);var b=r(23925),N=r(40185),j=r(29774),y=r(14151),w=r(93096),C=r(1955),I=r(8305),P=r(5495),M=r(36778);let L="current",E="status:",classNames=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")},getRegionLabel=e=>{var t,r;return null!==(r=null===(t=w.YV.find(t=>t.id===e))||void 0===t?void 0:t.label)&&void 0!==r?r:e},mapTenantsToServices=e=>e.map(e=>{var t,r,s;let a=getRegionLabel(e.region.toString()),n=null!==(r=null!==(t=w.mx[e.status])&&void 0!==t?t:w.mx[e.status.toString()])&&void 0!==r?r:e.status;return{id:e.id,regionCode:e.region,regionLabel:a,tenantName:e.name,productName:null!==(s=C.wm[e.productCode])&&void 0!==s?s:e.productCode,productCode:e.productCode||"Workspace",vendor:e.vendor,status:e.status,statusText:n,description:a?"Hosted in ".concat(a):"Service"}}),mapPendingManagedServicePurchasesToServices=e=>e.map(e=>{var t;return{id:"pending:".concat(e.serviceItemId),regionCode:"",regionLabel:"",tenantName:e.name,productCode:e.productCode,productName:null!==(t=C.wm[e.productCode])&&void 0!==t?t:e.productCode,status:"PENDING",statusText:"Awaiting billing activation",description:"Awaiting billing activation",pending:!0}}),isDecommissionedServiceStatus=e=>e.startsWith("DECOMMISSION")||"CANCELED"===e,getStatusFilterKey=e=>"".concat(E).concat(e),getStatusFromFilter=e=>e.startsWith(E)?e.slice(E.length):null,getStatusSortLabel=e=>{var t;return null!==(t=w.mx[e])&&void 0!==t?t:e},buildServiceStatusFilterOptions=e=>{let t=Array.from(new Set(e.map(e=>
1e.status).filter(Boolean))).sort((e,t)=>getStatusSortLabel(e).localeCompare(getStatusSortLabel(t))).map(getStatusFilterKey);return[L,"all",...t]},filterServicesByStatus=(e,t)=>{if("all"===t)return e;if(t===L)return e.filter(e=>!isDecommissionedServiceStatus(e.status));let r=getStatusFromFilter(t);return e.filter(e=>e.status===r)},getStatusFilterCount=(e,t)=>filterServicesByStatus(e,t).length,getStatusFilterLabel=(e,t)=>{let r=getStatusFilterCount(e,t);if(t===L)return"Current (".concat(r,")");if("all"===t)return"All (".concat(r,")");let s=getStatusFromFilter(t);return"".concat(s?getStatusSortLabel(s):t," (").concat(r,")")},SubscriptionsIndex=e=>{let{tenants:t,role:r,pendingPurchases:l=[]}=e,d=(0,c.useRouter)(),[m,p]=(0,a.useState)("name"),[f,v]=(0,a.useState)(L),C=(0,a.useMemo)(()=>{let{id:e}=d.query;return"string"==typeof e&&e.length>0?e:null},[d.query.id]),M=(0,a.useMemo)(()=>[...mapPendingManagedServicePurchasesToServices(l),...mapTenantsToServices(t)],[l,t]),E=(0,a.useMemo)(()=>buildServiceStatusFilterOptions(M),[M]),F=(0,a.useMemo)(()=>{let e=filterServicesByStatus(M,f).sort((e,t)=>{if("status"===m)return e.status.localeCompare(t.status);if("product"===m){var r,s;return(null!==(r=e.productCode)&&void 0!==r?r:"").localeCompare(null!==(s=t.productCode)&&void 0!==s?s:"")}return e.tenantName.localeCompare(t.tenantName)});return e},[M,m,f]);return((0,a.useEffect)(()=>{E.includes(f)||v(L)},[f,E]),C)?(0,s.jsx)(N.A,{}):(0,s.jsx)(S.B,{title:"You have no services.",description:"Manage your services and get support from one place.",shouldDisplay:()=>0===M.length,cta:(0,s.jsx)(j.W,{hideLabel:(0,I.z)([y.UB.OWNER,y.UB.ADMIN],r),children:(0,s.jsx)(x.x,{href:(0,h.pH)(),liftPrimary:!0,children:"Browse Platform"})}),children:(0,s.jsxs)("main",{className:"flex min-h-0 min-w-0 flex-col",children:[(0,s.jsxs)("header",{className:"flex shrink-0 flex-wrap items-center justify-between gap-4 border-b border-border bg-surface p-4 sm:p-6 lg:px-8",children:[(0,s.jsx)("h1",{className:"text-base font-semibold text-card-foreground",children:"Services"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)(b.i6,{label:"Status",options:E,active:f,onChange:v,getLabel:e=>getStatusFilterLabel(M,e)}),(0,s.jsxs)("label",{className:"flex items-center gap-x-2 text-sm font-medium text-card-foreground",children:["Sort by",(0,s.jsxs)("span",{className:"relative inline-flex items-center",children:[(0,s.jsxs)("select",{className:"appearance-none rounded-md border border-border bg-card py-1 pl-3 pr-8 text-sm text-card-foreground shadow-sm transition hover:border-primary-300 focus:border-primary-400 focus:outline-none focus:ring-2 focus:ring-primary-200",value:m,onChange:e=>p(e.target.value),"aria-label":"Sort services by",children:[(0,s.jsx)("option",{value:"name",children:"Name"}),(0,s.jsx)("option",{value:"status",children:"Status"}),(0,s.jsx)("option",{value:"product",children:"Product"})]}),(0,s.jsx)(n,{"aria-hidden":"true",className:"pointer-events-none absolute right-2 size-5 text-muted-foreground"})]})]})]})]}),0===F.length?(0,s.jsx)("div",{className:"p-6 lg:px-8",children:(0,s.jsxs)("div",{className:"rounded-lg border border-dashed border-border bg-card p-6 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{className:"font-medium text-card-foreground",children:"No services match this status."}),(0,s.jsx)("p",{className:"mt-1",children:"Choose another status filter to review the remaining services."})]})}):(0,s.jsx)("ul",{role:"list",className:"divide-y divide-border",children:F.map(e=>{let t=e.pending?void 0:(0,g.VT)(e.id);return(0,s.jsxs)("li",{className:"relative flex items-center space-x-4 p-4 odd:bg-background even:bg-surface sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-auto",children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-3",children:[(0,s.jsx)(P.Fl,{productC
1ode:e.productCode,productName:e.tenantName}),(0,s.jsx)("h2",{className:"min-w-0 text-sm font-semibold text-card-foreground",children:t?(0,s.jsx)(o(),{href:t,className:"flex gap-x-2 hover:text-primary-600",children:(0,s.jsx)("span",{className:"truncate",children:e.tenantName})}):(0,s.jsx)("span",{className:"truncate",children:e.tenantName})})]}),(0,s.jsxs)("div",{className:"mt-3 flex items-center gap-x-2.5 text-xs text-muted-foreground",children:[(0,s.jsx)("p",{className:"truncate",children:e.description}),(0,s.jsx)("svg",{viewBox:"0 0 2 2",className:"size-0.5 flex-none fill-border",children:(0,s.jsx)("circle",{r:1,cx:1,cy:1})}),(0,s.jsx)("p",{className:"truncate",children:e.productName})]})]}),(0,s.jsx)(u.C,{className:w.mA[e.status],children:e.statusText}),t?(0,s.jsx)(o(),{href:t,className:classNames("flex gap-x-2 rounded-md p-1 transition-colors hover:text-primary-600","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-200"),"aria-label":"Open ".concat(e.tenantName),children:(0,s.jsx)(i.Z,{"aria-hidden":"true",className:"size-5 flex-none text-muted-foreground hover:text-card-foreground"})}):null]},e.id)})})]})})},Index=()=>{let{currentTeam:e}=(0,m.aC)(),t=(0,M.G)("join-team-path"),r=(0,c.useRouter)();(0,p.Z)();let n=!!(null==e?void 0:e.id),[i,l]=(0,a.useState)([]),o=i.some(e=>Date.now()-e.createdAt<9e5),{data:u}=(0,d.ZP)(n?"/".concat(e.id,"/subscription/list"):null,{refreshInterval:o?1e4:6e4});if((0,a.useEffect)(()=>{var t;if(!(null==e?void 0:e.id)){l([]);return}let r=(null!==(t=null==u?void 0:u.tenants)&&void 0!==t?t:[]).map(e=>{var t;return null===(t=e.subscription)||void 0===t?void 0:t.id}).filter(e=>!!e),s=u?(0,v.jx)(e.id,r):(0,v.Ds)(e.id);l(s)},[null==e?void 0:e.id,u]),(0,a.useEffect)(()=>{t&&r.push("/join/?".concat(t))},[t,r]),t)return null;if(!u)return(0,s.jsx)(SubscriptionsIndex,{tenants:[],role:y.UB.OWNER,pendingPurchases:i});let f=u.tenants;return(0,s.jsx)(SubscriptionsIndex,{tenants:f,role:u.role,pendingPurchases:i})};Index.getLayout=(0,f.q)("Services");var F=Index},29002:function(e,t,r){"use strict";r.d(t,{u:function(){return Tooltip}});var s=r(85893),a=r(29545),n=r(89716),i=r(67294);let Tooltip=e=>{let{label:t,placement:r="bottom",children:l,hideLabel:o}=e,[c,d]=(0,i.useState)(!1),{x:u,y:m,reference:p,floating:f,strategy:g,context:v}=(0,n.YF)({placement:r,open:c,onOpenChange:d,middleware:[(0,a.RR)()]}),{getReferenceProps:h,getFloatingProps:x}=(0,n.NI)([(0,n.XI)(v),(0,n.KK)(v),(0,n.qs)(v,{role:"tooltip"}),(0,n.bQ)(v)]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{ref:p,...h(),children:l}),!o&&c&&(0,s.jsx)("div",{ref:f,className:"my-1 rounded bg-gray-600 px-2 py-1 text-sm font-medium text-white",style:{position:g,top:null!=m?m:0,left:null!=u?u:0},...x(),children:t})]})}},29774:function(e,t,r){"use strict";r.d(t,{W:function(){return UpgradeTooltip}});var s=r(85893),a=r(67294),n=r(29002);let UpgradeTooltip=e=>(0,s.jsx)(n.u,{hideLabel:e.hideLabel,label:"You don't have permission to perform this action",children:(0,a.cloneElement)(e.children,{disabled:!e.hideLabel,...e.children.props})})},36778:function(e,t,r){"use strict";r.d(t,{G:function(){return getSessionStorage}});let getSessionStorage=e=>{var t;return null!==(t=sessionStorage.getItem(e))&&void 0!==t?t:""}}},function(e){e.O(0,[6342,3365,2962,1664,9545,7814,794,8764,8461,6769,1181,5901,7377,8881,9716,10,8010,2959,5449,6263,3096,3646,1298,9774,2888,179],function(){return e(e.s=21215)}),_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.