PageSourceSearch

https://zop.dev/zopnight/app/assets/index-DB-GErVi.js

js zop.dev collected 2026-10-03 19:46:58 UTC 579,632 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProductMessages-DoiK9sWr.js","assets/react-vendor-xjz46aeH.js","assets/tanstack-vendor-CK-H18W-.js","assets/sentry-vendor-B7Zxq--p.js","assets/SortablePinnedList-DSlN16HI.js","assets/sortable.esm-DUZemtcE.js","assets/MyWorkPage-DmSRRSgN.js","assets/HomeHeader-DerIZuVw.js","assets/CostInfoBanner-DabANHFh.js","assets/actionFailure-B9bV-6re.js","assets/Pagination-CrLnsmAm.js","assets/dateRange-BnwWrnqN.js","assets/date-vendor-CF6zyQJ7.js","assets/date-vendor-Bw916Bj0.css","assets/ErrorState-DlvwccLP.js","assets/PermissionNotice-CDEYbonH.js","assets/usePaginationParams-DbdleRB1.js","assets/index-DctxNkkm.js","assets/useScheduleSuccess-BuYOW4yR.js","assets/useSmartTags-DQguorb0.js","assets/dateUtils-BLHMZBe5.js","assets/ProductsPage-BzklY5zV.js","assets/DashboardPage-BfDdLLOY.js","assets/PageHeader-BdDybfPf.js","assets/ReadOnlyContext-BF6yHbx8.js","assets/StatCardSkeleton-BW2z5c_5.js","assets/CloudAccountPrompt-C2j2yzJO.js","assets/Card-B1YLK7F3.js","assets/useUnsavedChangesGuard-CSw-1y6N.js","assets/BudgetHealthWidget-CZ9nl3iP.js","assets/useBudgets-CyUPUhEC.js","assets/useGroups-CnQVitgV.js","assets/useResourceNamesByUIDs-CwN4_ylA.js","assets/encodeUIDsParam-VbhU02I5.js","assets/useDashboard-BMFQ3TOL.js","assets/useRecommendations-aDh5BAyi.js","assets/useRecommendationMutations-DX2tnWAt.js","assets/useSchedules-CuIxbL-Q.js","assets/cron-vendor-Bqcy7K0E.js","assets/changedByUtils-Bd9ELIcW.js","assets/recBadges-DKOkRq-w.js","assets/recSections-ywQCVcei.js","assets/InfoTooltip-I_YM7wGk.js","assets/CostDataNote-Dw03pI8k.js","assets/ConfirmDialog-DH3ybaP-.js","assets/TypeToConfirmInput-PzKwsIrP.js","assets/useCopyToClipboard-D3JgiyXp.js","assets/useDashboards-CfeOKbY5.js","assets/DashboardsListPage-117868gk.js","assets/CardGridSkeleton-3iHR7401.js","assets/useDebouncedValue-BGg0Nx9L.js","assets/NewDashboardPage-S5bzOGUW.js","assets/ResourcesPage-CQ1_6oKF.js","assets/TableSkeleton-C9Pu8LvF.js","assets/CurrencyValue-CxMJfgrF.js","assets/CostBasisBadges-AmFSc45l.js","assets/purchaseType-CIa57y6h.js","assets/PurchaseTypeBadge-C8EBkzCc.js","assets/DataTable-DHou1xit.js","assets/InventoryViewSwitcher-3tUxy7JA.js","assets/SegmentedControl-B3DoYUD_.js","assets/SearchInput-COn497_X.js","assets/useResources-C_XK_T1L.js","assets/TagsBadge-CZ45VyDK.js","assets/SearchableSelect-DyTTeEMu.js","assets/GroupedAccountDropdown-Bh-4E3aH.js","assets/GroupedTypeDropdown-DixluBFy.js","assets/FilterChips-BytGSXAs.js","assets/statusStyles-CWjwV87F.js","assets/CopyableUID-0V37iUnh.js","assets/useClusterNamespaces-Dw2evNwX.js","assets/useTableSort-DnsJajMq.js","assets/resourceFormatters-Cxc1Saxu.js","assets/resourceStatus-CBHR0vys.js","assets/useActivityView-DC6hk5qt.js","assets/encoding-ey2XRjyj.js","assets/recharts-vendor-gU3RjD-X.js","assets/useBulkResourceActions-CwCGommZ.js","assets/OverrideCascadeWarning-BdpOREVE.js","assets/BudgetForm-BnT_RVrM.js","assets/formDirty-BcOfVH4k.js","assets/useTeamResources-pggCj2AK.js","assets/useResourceTeams-Cf4HnC5r.js","assets/useTeams-C9ojzVQf.js","assets/useTeamMutations-9Cy7l5J0.js","assets/useScheduleMutations-PQs2EhM9.js","assets/SchedulesPage-DyRzmnq1.js","assets/Tabs-CxK_PcU3.js","assets/ReviewedBlastRadiusNote-D5P2L37n.js","assets/useBlastReturnStore-VYR_r0l8.js","assets/ScheduleCard-A6JbpBP9.js","assets/ScheduleForm-DF6Nu7DE.js","assets/ScheduleDetailPage-BgFzUIVs.js","assets/DetailSkeleton-BU_RgEsp.js","assets/useResourceFilterState-DKqLdQQm.js","assets/ResourcePickerItem-Dn_kQBPV.js","assets/HistoryPage-BEGmuyYB.js","assets/StatusBadge-BxwdwQU4.js","assets/DateRangePicker-Ce2Wjv8W.js","assets/AuditLogsPage-DXW0ygMR.js","assets/cronstrue-BBsN_tsP.js","assets/AlertsPage-BrWlco8J.js","assets/ResourceGroupsPage-EUSw0FGv.js","assets/ExecutionPlanPreview-CmHOE78J.js","assets/useGroupMutations-BUzwT5Kq.js","assets/GroupDetailPage-DIWwWijo.js","assets/ResourcePickerPanel-M26VcG47.js","assets/ReportsPage-D9_tjFlL.js","assets/StatCard-B91o18fs.js","assets/UnitMetricsPage-CmklXOM_.js","assets/CostTrendWidget-CxYL0o1f.js","assets/useShowback-B92wky0H.js","assets/chartPalette-D9RFRE1c.js","assets/TagFilter-DrTgSs7q.js","assets/tagFilter-Cn9usdjQ.js","assets/useTagShowback-DGF5Wgrh.js","assets/AKSAccessGuide-zG-mqPtB.js","assets/AiSpendTab-nI9ijUmQ.js","assets/hooks-BUOm1otM.js","assets/AiNotConnected-3aBQIqyR.js","assets/tierStyle-JMtr5g9q.js","assets/TierBadge-fBbGch68.js","assets/notC
1onnected-DTiCVQG8.js","assets/BudgetsPage-sIDgbhYy.js","assets/RecommendationsPage-Cw2cCCZ5.js","assets/useRecommendationFilterFields-DIo3HyeZ.js","assets/RecommendationDrawer-CZGsl_JQ.js","assets/useCloudAccountPermissions-Czyj3T8i.js","assets/useJiraIntegration-CbZz77_N.js","assets/useServiceNowIntegration-BsrBoaZI.js","assets/AssigneeSelect-BrJlNLh-.js","assets/ShareDrawer-udWchQ9_.js","assets/useChannels-BKH5b1YD.js","assets/policyLink-BS1nLdra.js","assets/SmartTagsPage-Bs-MLDTA.js","assets/RecommendationHistoryPage-sZ4-3bzy.js","assets/TopologyPage-CsdJRBYg.js","assets/xyflow-vendor-D6MhcEFj.js","assets/xyflow-vendor-BZV40eAE.css","assets/useKeyboardNavigation-EuIwNzA1.js","assets/TopologyPage-DnGlPm0h.css","assets/GlobePage-DgtJjyRZ.js","assets/globe-vendor-CRBBOgCf.js","assets/K8sClustersPage-DUTdFOj9.js","assets/K8sClusterShell-DfmXISSt.js","assets/SelectionCard-BSHphHck.js","assets/OverviewPage-B5ftq6q_.js","assets/LiveBadge-D9T7SBmG.js","assets/EventDetailDrawer-BefJurcn.js","assets/RecommendationDetailDrawer-BlbcCLGw.js","assets/RecommendationDetailDrawer-xXbxtKzH.css","assets/PodsPage-2z4jV5bO.js","assets/ResourceSearchInput-CjzG8RxE.js","assets/ContainerResourceChart-xQDzPDHu.js","assets/DeploymentsPage-DQ_cXQhz.js","assets/GenericResourcePage-BoVTuzy8.js","assets/ServicesPage-DW-oBBhj.js","assets/ConfigMapsPage-pCtzPgoy.js","assets/SecretsPage-dkVvMqEz.js","assets/JobsPage-BNmvaxcz.js","assets/DaemonSetsPage-Dumjd_A8.js","assets/StatefulSetsPage-DgW6UhWM.js","assets/ReplicaSetsPage-D47zmuse.js","assets/NodesPage-DXU_i2I-.js","assets/EventsPage-JPoMvCZC.js","assets/IngressesPage-DJUbeKRl.js","assets/EndpointsPage-BqEZxb3z.js","assets/RoutesPage-Cz6qleyu.js","assets/ProjectsPage-DGi-_2z2.js","assets/ImageStreamsPage-DrHgPVKw.js","assets/DeploymentConfigsPage-DUKCVjrf.js","assets/BuildConfigsPage-CFusPGiD.js","assets/NetworkPoliciesPage-BV3rnkwl.js","assets/HPAPage-BmXV73OG.js","assets/StoragePage-CTBa0OSR.js","assets/ServiceAccountsPage-C5unqGgv.js","assets/NamespacesPage-CFiSwyb6.js","assets/QuotasPage-DWvOkB-Y.js","assets/CRDsPage-Dan7JReJ.js","assets/RecommendationsPage-zb91jg--.js","assets/SettingsPage-5IvzUhtx.js","assets/instanceTypes-DEITav2W.js","assets/NotificationsPage-D0k8qDi-.js","assets/SettingsPage--RMPkAyj.js","assets/useBilling-Ui14IFB-.js","assets/PreferencesPage-dS3UZdky.js","assets/useOrganizationMutations-BGnMJIKk.js","assets/useCapturePolicy-DOlJyJv-.js","assets/CloudAccountsPage-DPshLun0.js","assets/useUsers-CNnUuBOB.js","assets/disconnectNextStep-Diz36gck.js","assets/DiscoverySummary-Cwi-cRc8.js","assets/IAMImportDrawer-CXeGGTgs.js","assets/KebabMenu-DEUsrnY7.js","assets/GcpOAuthCallback-B5cWBK1Z.js","assets/OrganizationPage-CjNW1qoU.js","assets/Toggle-DarifWY4.js","assets/mcp-CEnoIusp.js","assets/ImportedFromChip-BP0zFmtN.js","assets/importedName-COnM7k1A.js","assets/RoleSelect-DQXO7YJi.js","assets/useRoleMutations-CgmxU1Yx.js","assets/useTeamHref-CuG5_eU3.js","assets/BillingPage-B1Fjy_v5.js","assets/PolicyPage-CGGBhe0h.js","assets/usePolicyData-DQ0YydBj.js","assets/SetupPage-CrgYD7pG.js","assets/TeamsPage-MqI8dBW_.js","assets/MemberAccessInfo-FZiS7EFV.js","assets/TeamDetailPage-Bb6zqHpC.js","assets/RolesPage-DLtSLXed.js","assets/DeveloperSettingsPage-DbdKEXwL.js","assets/OAuthConsentPage-Ca1BVOG-.js","assets/IntegrationsPage-DItvyBuk.js","assets/GitHubAppCallbackPage-C3ba1YRl.js","assets/AutoscalerPage-DMXwxAY-.js","assets/useAutoscalerPolicies-R3Iq62bY.js","assets/ChoiceCard-C2Y_xxvC.js","assets/ManageIAMPage-BJtnpFva.js","assets/EventReadinessPage-D62bt_1-.js","assets/LegacyRecommendationsRedirect-D-YokeJu.js","assets/AiGatewayPage-Cfa41xR7.js","assets/InferenceKeysPage-DsYg0ySi.js","assets/CostFlowPage-Dbq9FyLN.js","assets/GovernancePage-DgV45SFn.js","assets/bits-C85JEsbM.js","assets/bits-0EOHZmfr.css","assets/PolicyWizard-Bn-mlEgH.js","assets/RepositoryDetailPage-CEV-Y2-P.js","assets/GovHeader-CQHyz6_E.js","assets/ValidationRunPage-BvpG1YMO.js"])))=>i.map(i=>d[i]);
2import{r as m,u as pe,f as Se,e as F,h as dl,j as r,i as fl,R as Xa,d as pr,k as qe,N as ei,L as Ie,O as Kt,l as te,B as ml,m as gl,n as k,o as pl}from"./react-vendor-xjz46aeH.js";import{Q as hl,a as Et,b as me,c as ke,d as re,k as go,e as po,f as yl}from"./tanstack-vendor-CK-H18W-.js";import{c as ti,i as xl,b as vl,r as bl}from"./sentry-vendor-B7Zxq--p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"53c0c37b9d0458a05694e8ed0430da9c4ec6eaca"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d37e969e-6e20-47e1-a27c-2498acf23bd1",e._sentryDebugIdIdentifier="sentry-dbid-d37e969e-6e20-47e1-a27c-2498acf23bd1")}catch{}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function s(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(n){if(n.ep)return;n.ep=!0;const a=s(n);fetch(n.href,a)}})();const dr=new hl({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchIntervalInBackgroun
2d:!1}}});function t2(e,t){const s=t?.status;return s!=null&&s>=400&&s<500&&s!==408&&s!==429?!1:e<1}const wl="modulepreload",Al=function(e){return"/zopnight/app/"+e},ln={},U=function(t,s,o){let n=Promise.resolve();if(s&&s.length>0){let u=function(l){return Promise.all(l.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),c=i?.nonce||i?.getAttribute("nonce");n=u(s.map(l=>{if(l=Al(l),l in ln)return;ln[l]=!0;const f=l.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":wl,f||(g.as="script"),g.crossOrigin="",g.href=l,c&&g.setAttribute("nonce",c),document.head.appendChild(g),f)return new Promise((p,y)=>{g.addEventListener("load",p),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return n.then(i=>{for(const c of i||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})},Vs="/zopnight/playground",ht=[{slug:"finance",label:"Finance",description:"Trading platform workloads, compliance-driven tagging, and high-availability clusters."},{slug:"retail",label:"Retail",description:"E-commerce peaks, seasonal autoscaling, and multi-region storefronts."},{slug:"healthcare",label:"Healthcare",description:"HIPAA-aware environments, imaging workloads, and research compute."}],Ur="zopdev_playground_industry";function ve(e){const t=e??(typeof window<"u"?window.location.pathname:"");return t===Vs||t.startsWith(Vs+"/")}function ri(e){return ve(),!0}const _l="https://api.zop.dev/ai-gateway";function r2(){return ve()?_l:"https://api.zop.dev/ai-gateway"}function s2(){return ve()}function o2(e){return ve(e)}function n2(e){return ve(e)}function Sl(e){return typeof e!="string"||!e||!e.startsWith("/")||e.startsWith("//")?null:e}function hr(){try{return sessionStorage.getItem(Ur)}catch{return null}}function a2(){return ve()?hr()==="finance"?"servicenow":"jira":null}function si(e){try{e?sessionStorage.setItem(Ur,e):sessionStorage.removeItem(Ur)}catch{}}function kl(){try{sessionStorage.removeItem(Ur)}catch{}}function El(e){return e==="succeeded"?"success":e==="failed"?"failure":e==="declined"?"declined":"n/a"}const Rl="phc_D35Z6LUduRcmPJGvZxEgEw6p8DVsj2KgqMkWzuoc4LBm",jl="https://us.i.posthog.com",ho="production";let qs=!1;try{qs=ve()}catch{qs=!1}const Mt=!qs;let Br=null,ft=null;const se={userId:null,orgId:null,userRole:null,userScope:null,userName:null},Cl=/token|secret|password|credential|api[-_]?key|authorization|cookie|email|ssn|card|jwt/i,Nl=/[?&](code|credential|token|samlcode|samlresponse|id_token|access_token|refresh_token)=/i;function Ol(e){let t=e.split("#")[0];const s=t.indexOf("?");return s!==-1&&Nl.test(t.slice(s))&&(t=t.slice(0,s)),t}function Tl(){return!Mt||ft||(ft=U(async()=>{const{default:e}=await import("./module-DEu6LURI.js");return{default:e}},[]).then(({default:e})=>(e.init(Rl,{api_host:jl,capture_pageview:!1,capture_pageleave:!0,autocapture:!0,capture_performance:!1,person_profiles:"identified_only",disable_capture_url_hashes:!0,before_send:t=>{if(!t)return t;for(const s of[t.properties,t.$set,t.$set_once])if(s)for(const o of["$current_url","$referrer","$initial_current_url","$initial_referrer"])typeof s[o]=="string"&&(s[o]=Ol(s[o]));return t},persistence:"localStorage+cookie"}),Br=e,e.register({app:"zopnight",env:ho}),e)).catch(e=>(console.warn("[analytics] posthog-js failed to load/init",e),null))),ft}function Rt(e){if(Mt){if(Br){try{e(Br)}catch(t){console.warn("[analytics] capture failed",t)}return}ft&&ft.then(t=>{if(t)try{e(t)}catch(s){console.warn("[analytics] capture failed",s)}})}}function rs({email:e,name:t,role:s,scope:o,orgId:n}={}){if(!Mt)return;if(!e){console.warn("[analytics] identifyUser skipped — no email; session stays anonymous");return}se.userId=e,n&&(se.orgId=n),s&&(se.userRole=s),o&&(se.userScope=o),t&&(se.userName=t);const a={email:e};se.userName&&(a.name=se.userName),se.userRole&&(a.user_role=se.userRole),se.userScope&&(a.access_scope=se.userScope),se.orgId&&(a.org_id=se.orgId);const i={app:"zopnight",env:ho};se.orgId&&(i.org_id=se.orgId),se.userRole&&(i.user_role=se.userRole),se.userScope&&(i.access_scope=se.userScope),Rt(c=>{c.identify(e,a),c.register(i)})}function oi(e,t={}){!Mt||!e||(se.orgId=e,Rt(s=>{s.group("organization",e,yo(t)),s.register({org_id:e})}))}function Ml(e={}){!Mt||!se.orgId||Rt(t=>t.group("organization",se.orgId,yo(e)))}function Ll(){se.userId=null,se.orgId=null,se.userRole=null,se.userScope=null,se.userName=null,Rt(e=>{e.reset(),e.register({app:"zopnight",env:ho})})}function Pl(e){Rt(t=>t.capture("$pageview",e?{$current_url:e}:void 0))}function yo(e){const t={};for(const[s,o]of Object.entries(e||{}))o!=null&&(Cl.test(s)||(t[s]=o));return t}const Dl=500;function Il(e=Dl){if(!Mt||Br||!ft)return Promise.resolve();let t;const s=new Promise(o=>{t=setTimeout(o,e)});return Promise.race([ft.then(()=>{}),s]).finally(()=>clearTimeout(t))}function we(e,t={},s={}){if(!Mt||!e||e.deferred)return;const o=yo({...t,feature:e.feature,lifecycle_stage:e.stage,outcome:El(e.stage),action:e.name,source:"app",org_id:se.orgId,user_id:se.userId,user_role:se.userRole});if(s?.beforeUnload){Rt(n=>n.capture(e.name,o,{send_instantly:!0,transport:"sendBeacon"}));return}Rt(n=>n.capture(e.name,o))}var Fl={};const xo=Ul();function xe(e,...t){if(!xo)return;const s=zl(e,...t);performance.mark(s);try{console.log(e,...t)}catch{console.log(s)}}function i2(e,...t){xo&&console.warn(e,...t)}function zl(e,...t){return e.replace(/%[sfdO]/g,s=>{const o=t.shift();return s==="%O"&&o?JSON.stringify(o).replace(/"([^"]+)":/g,"$1:"):String(o)})}function Ul(){if(typeof window>"u")return(Fl.DEBUG||"").includes("nuqs");try{const e="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(e,e);const t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const Bl={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cac
2he. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function yr(e){return`[nuqs] ${Bl[e]}
3  See https://nuqs.dev/NUQS-${e}`}function $l(e){if(e.size===0)return"";const t=[];for(const[o,n]of e.entries()){const a=o.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${a}=${Vl(n)}`)}return"?"+t.join("&")}function Vl(e){return e.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,t=>encodeURIComponent(t))}const jt=m.createContext({useAdapter(){throw new Error(yr(404))}});jt.displayName="NuqsAdapterContext";xo&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==jt&&console.error(yr(303)),window.__NuqsAdapterContext=jt);function ql(e){return({children:t,defaultOptions:s,processUrlSearchParams:o,...n})=>m.createElement(jt.Provider,{...n,value:{useAdapter:e,defaultOptions:s,processUrlSearchParams:o}},t)}function c2(e){const t=m.useContext(jt);if(!("useAdapter"in t))throw new Error(yr(404));return t.useAdapter(e)}const l2=()=>m.useContext(jt).defaultOptions,u2=()=>m.useContext(jt).processUrlSearchParams;function Wl(){if(typeof window>"u"||!window.GestureEvent)return 50;try{const e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function Gl(e){return{method:"throttle",timeMs:e}}const vs=Gl(Wl());function d2(e){return e===null||Array.isArray(e)&&e.length===0}function Kl(e,t,s){if(typeof e=="string")s.set(t,e);else{s.delete(t);for(const o of e)s.append(t,o);s.has(t)||s.set(t,"")}return s}function ni(){const e=new Map;return{on(t,s){const o=e.get(t)||[];return o.push(s),e.set(t,o),()=>this.off(t,s)},off(t,s){const o=e.get(t);o&&e.set(t,o.filter(n=>n!==s))},emit(t,s){e.get(t)?.forEach(o=>o(s))}}}function Ws(e,t,s){function o(){e(),s.removeEventListener("abort",a)}const n=setTimeout(o,t);function a(){clearTimeout(n),s.removeEventListener("abort",a)}s.addEventListener("abort",a)}function Gs(){const e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},s=()=>{};return{promise:new e((o,n)=>{t=o,s=n}),resolve:t,reject:s}}function Hl(e,t){let s=t;for(let o=e.length-1;o>=0;o--){const n=e[o];if(!n)continue;const a=s;s=()=>n(a)}s()}function Ks(){return new URLSearchParams(location.search)}var ai=class{updateMap=new Map;options={history:"replace",scroll:!1,shallow:!0};timeMs=vs.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:s},o=vs.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),xe("[nuqs gtq] Enqueueing %s=%s %O",e,t,s),this.updateMap.set(e,t),s.history==="push"&&(this.options.history="push"),s.scroll&&(this.options.scroll=!0),s.shallow===!1&&(this.options.shallow=!1),s.startTransition&&this.transitions.add(s.startTransition),(!Number.isFinite(this.timeMs)||o>this.timeMs)&&(this.timeMs=o)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=Ks}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=Ks,rateLimitFactor:t=1,...s},o){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return xe("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=Gs();const n=()=>{this.lastFlushedAt=performance.now();const[i,c]=this.applyPendingUpdates({...s,autoResetQueueOnUpdate:s.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},o);c===null?(this.resolvers.resolve(i),this.resetQueueOnNextPush=!0):this.resolvers.reject(i),this.resolvers=null};return Ws(()=>{const i=performance.now()-this.lastFlushedAt,c=this.timeMs,u=t*Math.max(0,c-i);xe("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",u,c,t),u===0?n():Ws(n,u,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const e=Array.from(this.updateMap.keys());return xe("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=vs.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:s,getSearchParamsSnapsh
3ot:o}=e;let n=o();if(xe("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,n.toString()),this.updateMap.size===0)return[n,null];const a=Array.from(this.updateMap.entries()),i={...this.options},c=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),xe("[nuqs gtq] Flushing queue %O with options %O",a,i);for(const[u,l]of a)l===null?n.delete(u):n=Kl(l,u,n);t&&(n=t(n));try{return Hl(c,()=>{s(n,i)}),[n,null]}catch(u){return console.error(yr(429),a.map(([l])=>l).join(),u),[n,u]}}};const ii=new ai;function Zl(e,t,s){const o=m.useCallback(()=>{const a=Object.fromEntries(e.map(i=>[i,s(i)]));return[JSON.stringify(a),a]},[e.join(","),s]),n=m.useRef(null);return n.current===null&&(n.current=o()),m.useSyncExternalStore(m.useCallback(a=>{const i=e.map(c=>t(c,a));return()=>i.forEach(c=>c())},[e.join(","),t]),()=>{const[a,i]=o();return n.current[0]===a?n.current[1]:(n.current=[a,i],i)},()=>n.current[1])}var Ql=class{callback;resolvers=Gs();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,Ws(()=>{const s=this.resolvers;try{xe("[nuqs dq] Flushing debounce queue",e);const o=this.callback(e);xe("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=Gs(),o.then(n=>s.resolve(n)).catch(n=>s.reject(n))}catch(o){this.queuedValue=void 0,s.reject(o)}},t,this.controller.signal),this.resolvers.promise}},Yl=class{throttleQueue;queues=new Map;queuedQuerySync=ni();constructor(e=new ai){this.throttleQueue=e}useQueuedQueries(e){return Zl(e,(t,s)=>this.queuedQuerySync.on(t,s),t=>this.getQueuedQuery(t))}push(e,t,s,o){if(!Number.isFinite(t)){const i=s.getSearchParamsSnapshot??Ks;return Promise.resolve(i())}const n=e.key;if(!this.queues.has(n)){xe("[nuqs dqc] Creating debounce queue for `%s`",n);const i=new Ql(c=>(this.throttleQueue.push(c),this.throttleQueue.flush(s,o).finally(()=>{this.queues.get(c.key)?.queuedValue===void 0&&(xe("[nuqs dqc] Cleaning up empty queue for `%s`",c.key),this.queues.delete(c.key)),this.queuedQuerySync.emit(c.key)})));this.queues.set(n,i)}xe("[nuqs dqc] Enqueueing debounce update %O",e);const a=this.queues.get(n).push(e,t);return this.queuedQuerySync.emit(n),a}abort(e){const t=this.queues.get(e);return t?(xe("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),s=>(s.then(t.resolvers.resolve,t.resolvers.reject),s)):s=>s}abortAll(){for(const[e,t]of this.queues.entries())xe("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){const t=this.queues.get(e)?.queuedValue?.query;return t!==void 0?t:this.throttleQueue.getQueuedQuery(e)}};const un=new Yl(ii);function Jl(e,t){return e===t?!0:e===null||t===null||typeof e=="string"||typeof t=="string"||e.length!==t.length?!1:e.every((s,o)=>s===t[o])}function dn(e,t,s){return o=>{if(!(t.length===0||t.some(a=>!Jl(o.getAll(a),e.getAll(a)))))return xe("[nuqs `%s`] no change, returning previous",t.join(","),o),o;const n=Hs(e,t,s);return xe("[nuqs `%s`] subbed search params change\n  from %O\n  to   %O",t.join(","),o,n),n}}function Hs(e,t,s){if(t.length===0)return e;const o=s?new URLSearchParams(e):e;for(const n of e.keys())t.includes(n)||o.delete(n);return o}let Mr=0;function Xl(e=1){Mr=e}function eu(e=ci){Mr=Math.max(0,Mr-1),!(Mr>0)&&e()}function ci(){xe("[nuqs] Aborting queues"),un.abortAll(),ii.abort().forEach(e=>un.queuedQuerySync.emit(e))}const Zs="__nuqs__";function tu(e){if(e instanceof URL)return e.searchParams;if(e.startsWith("?"))return new URLSearchParams(e);try{return new URL(e,location.origin).searchParams}catch{return new URLSearchParams(e)}}function ru(e){return typeof history>"u"?!1:history.nuqs?.version&&history.nuqs.version!=="2.8.9"?(console.error(yr(409),history.nuqs.version,"2.8.9",e),!1):!history.nuqs?.adapters?.includes(e)}function su(e){history.nuqs=history.nuqs??{version:"2.8.9",adapters:[]},history.nuqs.adapters.push(e)}function ou(e,t){if(!ru(t))return;let s=typeof location=="object"?location.search:"";e.on("update",i=>{const c=i.toString();s=c.length?"?"+c:""}),window.addEventListener("popstate",()=>{s=location.search,ci()}),xe("[nuqs %s] Patching history (%s adapter)","2.8.9",t);function o(i){eu();
3try{if(new URL(i,location.origin).search===s)return}catch{}try{e.emit("update",tu(i))}catch(c){console.error(c)}}const n=history.pushState,a=history.replaceState;history.pushState=function(c,u,l){n.call(history,c,"",l),l&&u!==Zs&&o(l)},history.replaceState=function(c,u,l){a.call(history,c,"",l),l&&u!==Zs&&o(l)},su(t)}function nu({adapter:e,useNavigate:t,useSearchParams:s}){const o=ni();function n(i){const c=t();return{searchParams:a(i),updateUrl:m.useCallback((u,l)=>{m.startTransition(()=>{o.emit("update",u)});const f=new URL(location.href);f.search=$l(u),xe(`[nuqs ${e}] Updating url: %s`,f);const d=l.history==="push"?history.pushState:history.replaceState;Xl(l.shallow?1:2),d.call(history,history.state,Zs,f),l.shallow===!1&&c({hash:f.hash,search:f.search},{replace:!0,preventScrollReset:!0,state:history.state?.usr}),l.scroll&&window.scrollTo(0,0)},[c]),autoResetQueueOnUpdate:!1}}function a(i=[]){const[c]=s(typeof location>"u"?new URLSearchParams:new URLSearchParams(location.search)),[u,l]=m.useState(()=>typeof location>"u"?Hs(c,i,!0):Hs(new URLSearchParams(location.search),i,!1));return m.useEffect(()=>{function f(){m.startTransition(()=>{l(dn(new URLSearchParams(location.search),i,!1))})}function d(g){m.startTransition(()=>{l(dn(g,i,!0))})}return o.on("update",d),window.addEventListener("popstate",f),()=>{o.off("update",d),window.removeEventListener("popstate",f)}},[i.join("&")]),u}return ou(o,e),{NuqsAdapter:ql(n),useOptimisticSearchParams:a}}const au=nu({adapter:"react-router-v7",useNavigate:pe,useSearchParams:Se}),iu=au.NuqsAdapter;function cu(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const lu=e=>{switch(e){case"success":return fu;case"info":return gu;case"warning":return mu;case"error":return pu;default:return null}},uu=Array(12).fill(0),du=({visible:e,className:t})=>F.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},F.createElement("div",{className:"sonner-spinner"},uu.map((s,o)=>F.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),fu=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),mu=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),gu=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),pu=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),hu=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},F.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),F.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yu=()=>{const[e,t]=F.useState(document.hidden);return F.useEffect(()=>{const s=()=>{t(document.hidden)};
vendor: 3,892 bytes, line 3
3return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let Qs=1;class xu{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var s;const{message:o,...n}=t,a=typeof t?.id=="number"||((s=t.id)==null?void 0:s.length)>0?t.id:Qs++,i=this.toasts.find(u=>u.id===a),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...t,id:a,title:o}),{...u,...t,id:a,dismissible:c,title:o}):u):this.addToast({title:o,...n,dismissible:c,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:t,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(o=>o({id:s.id,dismiss:!0}))}),t),this.message=(t,s)=>this.create({...s,message:t}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let o;s.loading!==void 0&&(o=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const n=Promise.resolve(t instanceof Function?t():t);let a=o!==void 0,i;const c=n.then(async l=>{if(i=["resolve",l],F.isValidElement(l))a=!1,this.create({id:o,type:"default",message:l});else if(bu(l)&&!l.ok){a=!1;const d=typeof s.error=="function"?await s.error(`HTTP error! status: ${l.status}`):s.error,g=typeof s.description=="function"?await s.description(`HTTP error! status: ${l.status}`):s.description,y=typeof d=="object"&&!F.isValidElement(d)?d:{message:d};this.create({id:o,type:"error",description:g,...y})}else if(l instanceof Error){a=!1;const d=typeof s.error=="function"?await s.error(l):s.error,g=typeof s.description=="function"?await s.description(l):s.description,y=typeof d=="object"&&!F.isValidElement(d)?d:{message:d};this.create({id:o,type:"error",description:g,...y})}else if(s.success!==void 0){a=!1;const d=typeof s.success=="function"?await s.success(l):s.success,g=typeof s.description=="function"?await s.description(l):s.description,y=typeof d=="object"&&!F.isValidElement(d)?d:{message:d};this.create({id:o,type:"success",description:g,...y})}}).catch(async l=>{if(i=["reject",l],s.error!==void 0){a=!1;const f=typeof s.error=="function"?await s.error(l):s.error,d=typeof s.description=="function"?await s.description(l):s.description,p=typeof f=="object"&&!F.isValidElement(f)?f:{message:f};this.create({id:o,type:"error",description:d,...p})}}).finally(()=>{a&&(this.dismiss(o),o=void 0),s.finally==null||s.finally.call(s)}),u=()=>new Promise((l,f)=>c.then(()=>i[0]==="reject"?f(i[1]):l(i[1])).catch(f));return typeof o!="string"&&typeof o!="number"?{unwrap:u}:Object.assign(o,{unwrap:u})},this.custom=(t,s)=>{const o=s?.id||Qs++;return this.create({jsx:t(o),id:o,...s}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Oe=new xu,vu=(e,t)=>{const s=t?.id||Qs++;return Oe.addToast({title:e,...t,id:s}),s},bu=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",wu=vu,Au=()=>Oe.toasts,_u=()=>Oe.getActiveToasts(),fe=Object.assign(wu,{success:Oe.success,info:Oe.info,warning:Oe.warning,error:Oe.error,custom:Oe.custom,message:Oe.message,promise:Oe.promise,dismiss:Oe.dismiss,loading:Oe.loading},{getHistory:Au,getToasts:_u});cu
vendor: 4,787 bytes, line 3
3("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;
vendor: 10,086 bytes, line 3
3left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function 
vendor: 2,394 bytes, line 3
3kr(e){return e.label!==void 0}const Su=3,ku="24px",Eu="16px",fn=4e3,Ru=356,ju=14,Cu=45,Nu=200;function Je(...e){return e.filter(Boolean).join(" ")}function Ou(e){const[t,s]=e.split("-"),o=[];return t&&o.push(t),s&&o.push(s),o}const Tu=e=>{var t,s,o,n,a,i,c,u,l;const{invert:f,toast:d,unstyled:g,interacting:p,setHeights:y,visibleToasts:h,heights:v,index:x,toasts:b,expanded:w,removeToast:A,defaultRichColors:E,closeButton:L,style:P,cancelButtonStyle:j,actionButtonStyle:N,className:z="",descriptionClassName:Q="",duration:G,position:I,gap:S,expandByDefault:B,classNames:D,icons:M,closeButtonAriaLabel:C="Close toast"}=e,[R,_]=F.useState(null),[O,V]=F.useState(null),[q,Y]=F.useState(!1),[Z,T]=F.useState(!1),[J,K]=F.useState(!1),[ne,he]=F.useState(!1),[Ce,Ee]=F.useState(!1),[hs,or]=F.useState(0),[el,Xo]=F.useState(0),nr=F.useRef(d.duration||G||fn),en=F.useRef(null),st=F.useRef(null),tl=x===0,rl=x+1<=h,Le=d.type,Dt=d.dismissible!==!1,sl=d.className||"",ol=d.descriptionClassName||"",Ar=F.useMemo(()=>v.findIndex(X=>X.toastId===d.id)||0,[v,d.id]),nl=F.useMemo(()=>{var X;return(X=d.closeButton)!=null?X:L},[d.closeButton,L]),tn=F.useMemo(()=>d.duration||G||fn,[d.duration,G]),ys=F.useRef(0),It=F.useRef(0),rn=F.useRef(0),Ft=F.useRef(null),[al,il]=I.split("-"),sn=F.useMemo(()=>v.reduce((X,ye,_e)=>_e>=Ar?X:X+ye.height,0),[v,Ar]),on=yu(),cl=d.invert||f,xs=Le==="loading";It.current=F.useMemo(()=>Ar*S+sn,[Ar,sn]),F.useEffect(()=>{nr.current=tn},[tn]),F.useEffect(()=>{Y(!0)},[]),F.useEffect(()=>{const X=st.current;if(X){const ye=X.getBoundingClientRect().height;return Xo(ye),y(_e=>[{toastId:d.id,height:ye,position:d.position},..._e]),()=>y(_e=>_e.filter(Pe=>Pe.toastId!==d.id))}},[y,d.id]),F.useLayoutEffect(()=>{if(!q)return;const X=st.current,ye=X.style.height;X.style.height="auto";const _e=X.getBoundingClientRect().height;X.style.height=ye,Xo(_e),y(Pe=>Pe.find(be=>be.toastId===d.id)?Pe.map(be=>be.toastId===d.id?{...be,height:_e}:be):[{toastId:d.id,height:_e,position:d.position},...Pe])},[q,d.title,d.description,y,d.id,d.jsx,d.action,d.cancel]);const ut=F.useCallback(()=>{T(!0),or(It.current),y(X=>X.filter(ye=>ye.toastId!==d.id)),setTimeout(()=>{A(d)},Nu)},[d,A,y,It]);F.useEffect(()=>{if(d.promise&&Le==="loading"||d.duration===1/0||d.type==="loading")return;let X;return w||p||on?(()=>{if(rn.current<ys.current){const Pe=new Date().getTime()-ys.current;nr.current=nr.current-Pe}
vendor: 4,632 bytes, line 3
3rn.current=new Date().getTime()})():nr.current!==1/0&&(ys.current=new Date().getTime(),X=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),ut()},nr.current)),()=>clearTimeout(X)},[w,p,d,Le,on,ut]),F.useEffect(()=>{d.delete&&(ut(),d.onDismiss==null||d.onDismiss.call(d,d))},[ut,d.delete]);function ll(){var X;if(M?.loading){var ye;return F.createElement("div",{className:Je(D?.loader,d==null||(ye=d.classNames)==null?void 0:ye.loader,"sonner-loader"),"data-visible":Le==="loading"},M.loading)}return F.createElement(du,{className:Je(D?.loader,d==null||(X=d.classNames)==null?void 0:X.loader),visible:Le==="loading"})}const ul=d.icon||M?.[Le]||lu(Le);var nn,an;return F.createElement("li",{tabIndex:0,ref:st,className:Je(z,sl,D?.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D?.default,D?.[Le],d==null||(s=d.classNames)==null?void 0:s[Le]),"data-sonner-toast":"","data-rich-colors":(nn=d.richColors)!=null?nn:E,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":q,"data-promise":!!d.promise,"data-swiped":Ce,"data-removed":Z,"data-visible":rl,"data-y-position":al,"data-x-position":il,"data-index":x,"data-front":tl,"data-swiping":J,"data-dismissible":Dt,"data-type":Le,"data-invert":cl,"data-swipe-out":ne,"data-swipe-direction":O,"data-expanded":!!(w||B&&q),"data-testid":d.testId,style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${Z?hs:It.current}px`,"--initial-height":B?"auto":`${el}px`,...P,...d.style},onDragEnd:()=>{K(!1),_(null),Ft.current=null},onPointerDown:X=>{X.button!==2&&(xs||!Dt||(en.current=new Date,or(It.current),X.target.setPointerCapture(X.pointerId),X.target.tagName!=="BUTTON"&&(K(!0),Ft.current={x:X.clientX,y:X.clientY})))},onPointerUp:()=>{var X,ye,_e;if(ne||!Dt)return;Ft.current=null;const Pe=Number(((X=st.current)==null?void 0:X.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),_r=Number(((ye=st.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),be=new Date().getTime()-((_e=en.current)==null?void 0:_e.getTime()),ze=R==="x"?Pe:_r,Sr=Math.abs(ze)/be;if(Math.abs(ze)>=Cu||Sr>.11){or(It.current),d.onDismiss==null||d.onDismiss.call(d,d),V(R==="x"?Pe>0?"right":"left":_r>0?"down":"up"),ut(),he(!0);return}else{var We,Ge;(We=st.current)==null||We.style.setProperty("--swipe-amount-x","0px"),(Ge=st.current)==null||Ge.style.setProperty("--swipe-amount-y","0px")}Ee(!1),K(!1),_(null)},onPointerMove:X=>{var ye,_e,Pe;if(!Ft.current||!Dt||((ye=window.getSelection())==null?void 0:ye.toString().length)>0)return;const be=X.clientY-Ft.current.y,ze=X.clientX-Ft.current.x;var Sr;const We=(Sr=e.swipeDirections)!=null?Sr:Ou(I);!R&&(Math.abs(ze)>1||Math.abs(be)>1)&&_(Math.abs(ze)>Math.abs(be)?"x":"y");let Ge={x:0,y:0};const cn=vt=>1/(1.5+Math.abs(vt)/20);if(R==="y"){if(We.includes("top")||We.includes("bottom"))if(We.includes("top")&&be<0||We.includes("bottom")&&be>0)Ge.y=be;else{const vt=be*cn(be);Ge.y=Math.abs(vt)<Math.abs(be)?vt:be}}else if(R==="x"&&(We.includes("left")||We.includes("right")))if(We.includes("left")&&ze<0||We.includes("right")&&ze>0)Ge.x=ze;else{const vt=ze*cn(ze);Ge.x=Math.abs(vt)<Math.abs(ze)?vt:ze}(Math.abs(Ge.x)>0||Math.abs(Ge.y)>0)&&Ee(!0),(_e=st.current)==null||_e.style.setProperty("--swipe-amount-x",`${Ge.x}px`),(Pe=st.current)==null||Pe.style.setProperty("--swipe-amount-y",`${Ge.y}px`)}},nl&&!d.jsx&&Le!=="loading"?F.createElement("button",{"aria-label":C,"data-disabled":xs,"data-close-button":!0,onClick:xs||!Dt?()=>{}:()=>{ut(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Je(D?.closeButton,d==null||(o=d.classNames)==null?void 0:o.closeButton)},(an=M?.close)!=null?an:hu):null,(Le||d.icon||d.promise)&&d.icon!==null&&(M?.[Le]!==null||d.icon)?F.createElement("div",{"data-icon":"",className:Je(D?.icon,d==null||(n=d.classNames)==null?void 0:n.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||ll():null,d.type!=="loading"?ul:null):null,F.createElement("div",{"data-content":"",className:Je(D?.content,d==null||(a=d.classNames)==null?void 0:a.content)},F.createElement("div",{"data-title":"",className:Je(D?.title,d==null||(i=d.classNames)==null?void 0:i.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?F.createElement("div",{"data-description":"",className:Je(Q,ol,D?.description,d==null||(c=d.classNames)==null?void 0:c.description)},typeof d.description=="function"?d.description():d.description):null),F.isValidElement(d.cancel)?d.cancel:d.cancel&&kr(d.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||j,onClick:X=>{kr(d.cancel)&&Dt&&(d.cancel.onClick==null||d.cancel.onClick.call(
vendor: 5,220 bytes, line 3
3d.cancel,X),ut())},className:Je(D?.cancelButton,d==null||(u=d.classNames)==null?void 0:u.cancelButton)},d.cancel.label):null,F.isValidElement(d.action)?d.action:d.action&&kr(d.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||N,onClick:X=>{kr(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,X),!X.defaultPrevented&&ut())},className:Je(D?.actionButton,d==null||(l=d.classNames)==null?void 0:l.actionButton)},d.action.label):null)};function mn(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Mu(e,t){const s={};return[e,t].forEach((o,n)=>{const a=n===1,i=a?"--mobile-offset":"--offset",c=a?Eu:ku;function u(l){["top","right","bottom","left"].forEach(f=>{s[`${i}-${f}`]=typeof l=="number"?`${l}px`:l})}typeof o=="number"||typeof o=="string"?u(o):typeof o=="object"?["top","right","bottom","left"].forEach(l=>{o[l]===void 0?s[`${i}-${l}`]=c:s[`${i}-${l}`]=typeof o[l]=="number"?`${o[l]}px`:o[l]}):u(c)}),s}const Lu=F.forwardRef(function(t,s){const{id:o,invert:n,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:c,closeButton:u,className:l,offset:f,mobileOffset:d,theme:g="light",richColors:p,duration:y,style:h,visibleToasts:v=Su,toastOptions:x,dir:b=mn(),gap:w=ju,icons:A,containerAriaLabel:E="Notifications"}=t,[L,P]=F.useState([]),j=F.useMemo(()=>o?L.filter(q=>q.toasterId===o):L.filter(q=>!q.toasterId),[L,o]),N=F.useMemo(()=>Array.from(new Set([a].concat(j.filter(q=>q.position).map(q=>q.position)))),[j,a]),[z,Q]=F.useState([]),[G,I]=F.useState(!1),[S,B]=F.useState(!1),[D,M]=F.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),C=F.useRef(null),R=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=F.useRef(null),O=F.useRef(!1),V=F.useCallback(q=>{P(Y=>{var Z;return(Z=Y.find(T=>T.id===q.id))!=null&&Z.delete||Oe.dismiss(q.id),Y.filter(({id:T})=>T!==q.id)})},[]);return F.useEffect(()=>Oe.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{P(Y=>Y.map(Z=>Z.id===q.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{dl.flushSync(()=>{P(Y=>{const Z=Y.findIndex(T=>T.id===q.id);return Z!==-1?[...Y.slice(0,Z),{...Y[Z],...q},...Y.slice(Z+1)]:[q,...Y]})})})}),[L]),F.useEffect(()=>{if(g!=="system"){M(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window>"u")return;const q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:Y})=>{M(Y?"dark":"light")})}catch{q.addListener(({matches:Z})=>{try{M(Z?"dark":"light")}catch(T){console.error(T)}})}},[g]),F.useEffect(()=>{L.length<=1&&I(!1)},[L]),F.useEffect(()=>{const q=Y=>{var Z;if(i.every(K=>Y[K]||Y.code===K)){var J;I(!0),(J=C.current)==null||J.focus()}Y.code==="Escape"&&(document.activeElement===C.current||(Z=C.current)!=null&&Z.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[i]),F.useEffect(()=>{if(C.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,O.current=!1)}},[C.current]),F.createElement("section",{ref:s,"aria-label":`${E} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((q,Y)=>{var Z;const[T,J]=q.split("-");return j.length?F.createElement("ol",{key:q,dir:b==="auto"?mn():b,tabIndex:-1,ref:C,className:l,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":T,"data-x-position":J,style:{"--front-toast-height":`${((Z=z[0])==null?void 0:Z.height)||0}px`,"--width":`${Ru}px`,"--gap":`${w}px`,...h,...Mu(f,d)},onBlur:K=>{O.current&&!K.currentTarget.contains(K.relatedTarget)&&(O.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||O.current||(O.current=!0,_.current=K.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{S||I(!1)},onDragEnd:()=>I(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},j.filter(K=>!K.position&&Y===0||K.position===q).map((K,ne)=>{var he,Ce;return F.createElement(Tu,{key:K.id,icons:A,index:ne,toast:K,defaultRichColors:p,duration:(he=x?.duration)!=null?he:y,className:x?.className,descriptionClassName:x?.descriptionClassName,invert:n,visibleToasts:v,closeButton:(Ce=x?.closeButton)!=null?Ce:u,interacting:S,position:q,style:x?.style,unstyled:x?.unstyled,classNames:x?.classNames,cancelButtonStyle:x?.cancelButtonStyle,actionButtonStyle:x?.actionButtonStyle,closeButtonAriaLabel:x?.closeButtonAriaLabel,removeToast:V,toasts:j.filter(Ee=>Ee.position==K.position),heights:z.filter(Ee=>Ee.position==K.position),setHeights:Q,expandByDefault:c,gap:w,expanded:G,swipeDirections:t.swipeDirections})})):null}))}),gn=e=>{let t;const s=new Set,o=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const g=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({}
3,t,d),s.forEach(p=>p(t,g))}},n=()=>t,c={setState:o,getState:n,getInitialState:()=>u,subscribe:l=>(s.add(l),()=>s.delete(l))},u=t=e(o,n,c);return c},Pu=(e=>e?gn(e):gn),Du=e=>e;function Iu(e,t=Du){const s=F.useSyncExternalStore(e.subscribe,F.useCallback(()=>t(e.getState()),[e,t]),F.useCallback(()=>t(e.getInitialState()),[e,t]));return F.useDebugValue(s),s}const pn=e=>{const t=Pu(e),s=o=>Iu(t,o);return Object.assign(s,t),s},vo=(e=>e?pn(e):pn),Fu=typeof window<"u"&&window.location.protocol==="https:";function f2(e,t,s){let o=`${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/; SameSite=Lax`;s&&(o+=`; expires=${s.toUTCString()}`),Fu&&(o+="; Secure"),document.cookie=o}function hn(e){const t=encodeURIComponent(e),s=document.cookie.split("; ");for(const o of s){const[n,...a]=o.split("=");if(n===t)return decodeURIComponent(a.join("="))}return null}function yn(e){document.cookie=`${encodeURIComponent(e)}=; path=/; max-age=0`}function tr(e){return typeof e=="string"?e.trim().toLowerCase():""}function bo(e){try{const t=localStorage.getItem(e),s=t?JSON.parse(t):null;return!s||typeof s!="object"||Array.isArray(s)?null:s}catch{return null}}function li(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];for(const s of Object.keys(e))if(tr(s)===t)return e[s]}function ui(e,t,s){const o=bo(e)??{};for(const n of Object.keys(o))n!==t&&tr(n)===t&&delete o[n];o[t]=s,localStorage.setItem(e,JSON.stringify(o))}function ss(e,t){const s=tr(t);if(!s)return null;const o=bo(e);return o&&li(o,s)||null}function Ct(e,t,s){const o=tr(t);!o||!s||ui(e,o,s)}const Ht="zopdev_last_product";function wo(e,t){const s=tr(t);if(!s)return null;const o=bo(e);if(!o)return null;const n=li(o,s);return typeof n=="string"&&n?n:null}function Ao(e,t,s){const o=tr(t);if(!o||!s)return!1;try{return ui(e,o,s),!0}catch{return!1}}const Zt="zopdev_auth_meta",xn="zopdev_saml_domain",$e="zopdev_return_to",Qe="zopdev_last_org",Nt={GOOGLE:"GOOGLE",GITHUB:"GITHUB",AZURE_SAML:"AZURE_SAML",EMAIL:"EMAIL"},ot={LOGIN:"/auth/login",SIGNUP:"/auth/signup",REFRESH:"/auth/refresh",LOGOUT:"/auth/logout",EMAIL_VERIFY:"/auth/email/verify",EMAIL_OTP_VALIDATE:"/auth/otp/validate",PASSWORD_FORGET:"/auth/password/forget",PASSWORD_RESET:"/auth/password/reset",SAML_INITIATE:"/auth/saml/initiate"},vn={minLength:8};function os(e){try{const t=e.split(".");if(t.length!==3)return null;const o=t[1].replace(/-/g,"+").replace(/_/g,"/"),n=o+"=".repeat((4-o.length%4)%4),a=atob(n);return JSON.parse(a)}catch{return null}}function $r(e){if(!e)return!0;const t=os(e);if(!t||!t.exp)return!0;const s=Math.floor(Date.now()/1e3);return t.exp-30<=s}function di(e,t=60){if(!e)return!0;const s=os(e);if(!s||!s.exp)return!0;const o=Math.floor(Date.now()/1e3);return s.exp-t<=o}function zu(e){if(!e)return null;const t=os(e);return t&&(t["tenant-id"]||t.org_id)||null}function Qt(e){if(!e)return null;const t=os(e);return t?{email:t.email||t.sub||null,name:t.name||null,tenantId:t["tenant-id"]||t.org_id||null}:null}function it(e){if(typeof e!="string"||!e.startsWith("/"))return null;try{if(new URL(e,window.location.origin).origin!==window.location.origin)return null}catch{return null}return e}function Vr(e){const t=[];return(!e||e.length<vn.minLength)&&t.push(`At least ${vn.minLength} characters`),/[A-Z]/.test(e)||t.push("At least 1 uppercase letter"),/[0-9]/.test(e)||t.push("At least 1 number"),/[^A-Za-z0-9]/.test(e)||t.push("At least 1 special character"),{valid:t.length===0,errors:t}}const oe={resources:{all:["resources"],list:e=>["resources","list",e],byIds:e=>["resources","byIds",e],batch:e=>["resources","batch",e],filterFields:e=>["resources","filterFields",e??{}],lastSynced:()=>["resources","lastSynced"],summary:e=>["resources",e,"summary"]},schedules:{all:["schedules"],list:e=>e?["schedules","list",e]:["schedules","list"],count:e=>e?["schedules","count",e]:["schedules","count"],detail:e=>["schedules","detail",e]},resourceGroups:{all:["resourceGroups"],list:e=>e?["resourceGroups","list",e]:["resourceGroups","list"],count:e=>e?["resourceGroups","count",e]:["resourceGroups","count"],detail:e=>["resourceGroups","detail",e],groupSchedules:e=>["resourceGroups","groupSchedules",e]},overrides:{all:["overrides"],list:e=>e?["overrides","list",e]:["overrides","list"],byGroup:(e,t)=>t?["overrides","byGroup",e,t]:["overrides","byGroup",e],byResourceUids:(e,t)=>t?["overrides","byResourceUids",e,t]:["overrides","byResourceUids",e],candidates:e=>e?["overrides","candidates",e]:["overrides","candidates"]},history:{all:["history"],list:e=>["history","list",e]},scheduleSuccess:{all:["reports","schedule-success"],rate:e=>["reports","schedule-success","rate",e],missed:e=>["reports","schedule-success","missed",e]},actions:{status:e=>["actions","status",e],bulkStatus:e=>["actions","bulk",e],bulkLatest:e=>["actions","bulk","latest",e]},recommendations:{all:["recommendations"],list:e=>["recommendations","list",e],count:e=>e?["recommendations","count",e]:["recommendations","count"],byResource:e=>["recommendations","byResource",e],filterFields:e=>["recommendations","filterFields",e??{}],bookmarks:()=>["recommendations","bookmarks"],costHistory:(e,t,s)=>["recommendations","costHistory",e,t,s],byRule:(e,t)=>
3["recommendations","rule",e,t]},policies:{all:e=>["policies",e],lists:e=>["policies",e,"list"],catalog:(e,t)=>["policies",e,"catalog",t],metricsCatalog:(e,t,s)=>["policies",e,"metrics-catalog",t,s],list:(e,t,s)=>s?["policies",e,"list",t,s]:["policies",e,"list",t],byId:(e,t)=>["policies",e,"byId",t],filterFields:(e,t)=>["policies",e,"filterFields",t??"all"]},cloudAccounts:{all:e=>["cloudAccounts",e],list:(e,t)=>t?["cloudAccounts",e,"list",t]:["cloudAccounts",e,"list"],count:(e,t)=>t?["cloudAccounts",e,"count",t]:["cloudAccounts",e,"count"],detail:(e,t)=>["cloudAccounts",e,"detail",t],subscriptions:(e,t,s)=>s?["cloudAccounts",e,"subscriptions",t,s]:["cloudAccounts",e,"subscriptions",t],databricksCredential:(e,t)=>["cloudAccounts",e,"databricksCredential",t],snowflakeCredential:(e,t)=>["cloudAccounts",e,"snowflakeCredential",t]},events:{all:["events"],list:e=>["events","list",e],byResource:e=>["events","byResource",e]},costs:{all:["costs"],byResource:e=>["costs","byResource",e]},metrics:{all:["metrics"],byResource:e=>["metrics","resource",e],byResources:e=>["metrics","byResources",e]},resourceActivity:{all:["resource-activity"],byResource:(e,t)=>["resource-activity",e,t]},teams:{all:["teams"],list:e=>e?["teams","list",e]:["teams","list"],detail:e=>["teams","detail",e],members:e=>["teams","members",e]},users:{all:["users"],list:e=>e?["users","list",e]:["users","list"]},roles:{all:["roles"],list:e=>e?["roles","list",e]:["roles","list"],detail:e=>["roles","detail",e]},rolePolicies:{all:["rolePolicies"],list:()=>["rolePolicies","list"]},organisations:{all:["organisations"],list:()=>["organisations","list"],detail:()=>["organisations","detail"]},assignments:{all:["assignments"],list:e=>["assignments","list",e]},discoverySummary:{byAccount:e=>["discoverySummary",e],permissions:e=>["discoverySummary",e,"permissions"]},databricksHealth:{byConnection:e=>["databricksHealth",e]},apiTokens:{all:["apiTokens"],list:()=>["apiTokens","list"]},budgets:{all:["budgets"],list:e=>["budgets","list",e],summary:()=>["budgets","summary"],byResource:e=>["budgets","resource",e],byGroup:e=>["budgets","group",e],byCloudAccount:e=>["budgets","cloudAccount",e],teamSummary:e=>["budgets","team",e]},autoscalerPolicies:{all:["autoscalerPolicies"],list:e=>e?["autoscalerPolicies","list",e]:["autoscalerPolicies","list"],count:e=>e?["autoscalerPolicies","count",e]:["autoscalerPolicies","count"],detail:e=>["autoscalerPolicies","detail",e],events:e=>["autoscalerPolicies","events",e],targets:()=>["autoscalerPolicies","targets"],smartDefaults:(e,t)=>["autoscalerPolicies","smartDefaults",e,t],requiredPermissions:e=>["autoscalerPolicies","requiredPermissions",e],instances:(e,t)=>["autoscalerPolicies","instances",e,t],existingPolicies:e=>["autoscalerPolicies","existingPolicies",e]},eventReadiness:{all:["eventReadiness"],list:e=>e?["eventReadiness","list",e]:["eventReadiness","list"],count:e=>e?["eventReadiness","count",e]:["eventReadiness","count"],detail:e=>["eventReadiness","detail",e],logs:e=>["eventReadiness","logs",e],calculate:(e,t)=>["eventReadiness","calculate",e,t],readinessCheck:e=>["eventReadiness","readinessCheck",e],calculateDB:e=>["eventReadiness","calculateDB",e],costEstimate:e=>["eventReadiness","costEstimate",e],dbImpact:e=>["eventReadiness","dbImpact",e]},showback:{all:["reports","teams"],teams:e=>["reports","teams","list",e],teamDetail:(e,t)=>["reports","teams","detail",e,t],teamResources:(e,t)=>["reports","teams","resources",e,t],trends:e=>["reports","teams","trends",e]},aiSeats:{all:e=>["reports","ai-seats",e],list:(e,t,s)=>["reports","ai-seats",e,t,s]},globe:{all:["globe-resources"],byAccounts:e=>["globe-resources","byAccounts",e],connections:e=>["globe-resources","connections",e]},integrations:{all:e=>["integrations",e],list:e=>["integrations",e,"list"]},itsm:{recTicket:e=>["itsm","rec",e,"ticket"],assignableUsers:(e,t)=>["itsm","jira","assignable",e,t]},governance:{all:["governance"],policies:()=>["governance","policies"],catalog:()=>["governance","catalog"],runs:()=>["governance","runs"],run:e=>["governance","run",e],repos:()=>["governance","repos"],ciStatus:(e,t)=>["governance","ciStatus",e,t],budgets:()=>["governance","budgets"],cost:()=>["governance","cost"],compliance:()=>["governance","compliance"],audit:()=>["governance","audit"],bundles:()=>["governance","bundles"],settings:()=>["governance","settings"]},productMessages:{all:["productMessages"],list:e=>["productMessages","list",e]},dashboards:{all:["dashboards"],list:()=>["dashboards","list"],detail:e=>["dashboards","detail",e],widgets:{summary:()=>["dashboards","widgets","summary"],resourceCount:e=>e?["dashboards","widgets","resourceCount",e]:["dashboards","widgets","resourceCount"],recentActivity:()=>["dashboards","widgets","recentActivity"]}}},Uu=new Set(["changelog"]);function _o(e){return e.resetQueries({predicate:t=>!Uu.has(t.queryKey?.[0])})}const Lr=new Map,bn="<unknown-email>";function Bu(e){return typeof e!="string"?bn:e.trim().toLowerCase()||bn}function wn(e,t){const s=Bu(e),o=Lr.get(s);if(o)return o;let n;try{n=Promise.resolve(t())}catch(i){return Promise.reject(i)}const a=n.catch(i=>{throw Lr.delete(s),i});return Lr.set(s,a),a}
3function $u(){Lr.clear()}const So="zopdev_signin_shared";function Vu(){try{sessionStorage.setItem(So,"1")}catch{}}function qu(){try{return!!sessionStorage.getItem(So)}catch{return!1}}function ns(){try{sessionStorage.removeItem(So)}catch{}}const An="zopdev_access_token",_n="zopdev_refresh_token";function Ys(){try{const e=localStorage.getItem(Zt),t=e?JSON.parse(e):null;if(!t?.accessToken){const s=hn(An),o=hn(_n);if(s||o){const n={...t,accessToken:s||null,refreshToken:o||null};try{localStorage.setItem(Zt,JSON.stringify(n))}catch{}return yn(An),yn(_n),n}}return t}catch{return null}}function bs(e){try{localStorage.setItem(Zt,JSON.stringify(e))}catch{}}function Wu(){const e=Ys(),t=e?.accessToken||null,s=e?.refreshToken||null,o=e?.tenants||[],n=e?.user||null;let a=!1;return(t&&!$r(t)||s&&!$r(s))&&(a=!0),{accessToken:t,refreshToken:s,tenants:o,user:n,isAuthenticated:a,sessionExpired:!1}}const W=vo(e=>({...Wu(),setTokensQuiet:(t,s)=>{const o=Ys()||{};bs({...o,accessToken:t,refreshToken:s}),e({accessToken:t,refreshToken:s})},clearQuietTokens:()=>{const t=Ys()||{};bs({...t,accessToken:null,refreshToken:null}),e({accessToken:null,refreshToken:null,isAuthenticated:!1})},setTokens:({accessToken:t,refreshToken:s,tenants:o})=>{const n=Qt(t),a=o||[];bs({accessToken:t,refreshToken:s,tenants:a,user:n});const i=n?.tenantId||a[0]?.id;i&&n?.email&&Ct(Qe,n.email,i),e({accessToken:t,refreshToken:s,tenants:a,user:n,isAuthenticated:!0,sessionExpired:!1})},logout:()=>{try{localStorage.removeItem(Zt)}catch{}Ll(),$u(),ns(),e({accessToken:null,refreshToken:null,tenants:[],user:null,isAuthenticated:!1,sessionExpired:!1})},setSessionExpired:t=>{e({sessionExpired:t}),t&&dr.clear()},switchOrg:t=>{const{user:s}=W.getState();s?.email&&Ct(Qe,s.email,t)}}));typeof window<"u"&&window.addEventListener("storage",e=>{if(e.key===Zt)if(!e.newValue)W.getState().logout(),dr.clear();else{const t=JSON.parse(e.newValue),s=t?.accessToken||null,o=t?.refreshToken||null;let n=!1;(s&&!$r(s)||o&&!$r(o))&&(n=!0);const i=W.getState().user?.tenantId!==t?.user?.tenantId;W.setState({accessToken:s,refreshToken:o,tenants:t?.tenants||[],user:t?.user||null,isAuthenticated:n}),i&&_o(dr)}});const Gu=Object.freeze(Object.defineProperty({__proto__:null,useAuthStore:W},Symbol.toStringTag,{value:"Module"}));class ko extends Error{constructor(t,s){super(t),this.name="AuthError",this.status=s}}const fi="https://api.zop.dev",Ku="https://zopnight.com/api";async function Ke(e,t,s){const o=`${fi}${t}`,a={method:e,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}};s&&(a.body=JSON.stringify(s));const i=await fetch(o,a);if(!i.ok){const u=await i.json().catch(()=>({error:i.statusText})),l=(typeof u.error=="object"?u.error?.message:u.error)||u.message||`HTTP ${i.status}`;throw new ko(l,i.status)}if(i.status===204||i.headers.get("content-length")==="0")return null;const c=await i.json();return c.data!==void 0?c.data:c}async function bt(e,t,s){const{useAuthStore:o}=await U(async()=>{const{useAuthStore:f}=await Promise.resolve().then(()=>Gu);return{useAuthStore:f}},void 0),n=o.getState().accessToken,a=`${fi}${t}`,i={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"};n&&(i.Authorization=`Bearer ${n}`);const c={method:e,headers:i};s&&(c.body=JSON.stringify(s));const u=await fetch(a,c);if(!u.ok){const f=await u.json().catch(()=>({error:u.statusText})),d=(typeof f.error=="object"?f.error?.message:f.error)||f.message||`HTTP ${u.status}`;throw new ko(d,u.status)}if(u.status===204||u.headers.get("content-length")==="0")return null;const l=await u.json();return l.data!==void 0?l.data:l}const ue={login:(e,t)=>{const s=e.toLowerCase(),o=s==="azure_saml"?"azureSaml":s;if(o==="google"||o==="github"||o==="azure"||o==="azureSaml"){const n=t.token||t.code||t.credential;return Ke("GET",`/auth/${o}/callback?code=${encodeURIComponent(n)}`)}return Ke("POST",ot.LOGIN,{provider:s,email:t.email,password:t.password})},signup:e=>Ke("POST",ot.SIGNUP,{provider:"email",email:e.email,password:e.password,name:e.name}),refresh:(e,t)=>Ke("POST",ot.REFRESH,{refresh_token:e,...t?{claims:{"tenant-id":t}}:{}}),logout:e=>Ke("POST",ot.LOGOUT,{refresh_token:e}),forgotPassword:e=>Ke("POST",ot.PASSWORD_FORGET,{email:e}),resetPassword:e=>Ke("PATCH",ot.PASSWORD_RESET,e),validateOtp:e=>
3Ke("PATCH",ot.EMAIL_OTP_VALIDATE,e),sendVerificationEmail:e=>Ke("POST",ot.EMAIL_VERIFY,{email:e}),samlInitiate:e=>Ke("POST",ot.SAML_INITIATE,{domain:e,callback_url:`${Ku}/auth/saml/callback`,redirect_url:`${window.location.origin}/zopnight/app/auth/saml/callback`}),createOrganization:e=>bt("POST","/organisations",{name:e}),listOrganizations:()=>bt("GET","/organisations"),createTeam:(e,t,s="")=>bt("POST","/teams",{name:t,description:s}),addOrganizationUser:(e,t,s="")=>bt("POST","/users",{name:s,email:t}),listRoles:async e=>{const t=await bt("GET","/roles");return Array.isArray(t)?t:Array.isArray(t?.items)?t.items:[]},assignRole:(e,t,s)=>bt("POST","/assignments",{assigneeType:"user",assigneeId:t,roleId:s}),resolveMarketplaceToken:e=>Ke("POST","/marketplace/resolve",{token:e}),registerMarketplace:e=>bt("POST","/marketplace/register",e)};let dt=null,Sn=Promise.resolve();const qr="zopdev_refresh_lock",mi=15e3;function Hu(){try{const e=Date.now(),t=localStorage.getItem(qr);if(t){const s=parseInt(t,10);if(e-s<mi)return!1}return localStorage.setItem(qr,String(e)),!0}catch{return!0}}function kn(){try{localStorage.removeItem(qr)}catch{}}function Zu(){return new Promise(e=>{const t=setTimeout(()=>{window.removeEventListener("storage",s),e(!1)},mi);function s(o){o.key===Zt&&o.newValue&&(clearTimeout(t),window.removeEventListener("storage",s),e(!0)),o.key===qr&&!o.newValue&&(clearTimeout(t),window.removeEventListener("storage",s),e(!0))}window.addEventListener("storage",s)})}async function En(e){if(Hu())try{return await e()}finally{kn()}if(await Zu())return!0;try{return await e()}finally{kn()}}function gi(e,t){if(dt&&dt.tenantId===t)return dt.promise;const s=Sn.then(()=>En(e),()=>En(e));return Sn=s.then(()=>{dt?.promise===s&&(dt=null)},()=>{dt?.promise===s&&(dt=null)}),dt={promise:s,tenantId:t},s}const Qu="https://api.zop.dev",Yu="https://api.zop.dev/playground-api";function Ju(){return ve()?Yu:Qu}async function pi(e=null){const{accessToken:t,refreshToken:s,tenants:o,user:n,setTokens:a,setSessionExpired:i}=W.getState();if(!s)return i(!0),!1;try{const c=e??(zu(t)||n?.tenantId||o?.[0]?.id||null),u=await ue.refresh(s,c),l=W.getState();return!l.isAuthenticated&&!l.refreshToken?!1:(a({accessToken:u.access_token??u.accessToken,refreshToken:u.refresh_token??u.refreshToken,tenants:u.tenants?.length>0?u.tenants:l.tenants}),!0)}catch(c){if(c instanceof ko&&(c.status===401||c.status===403)){const l=W.getState().refreshToken;if(l&&l!==s)return!0;i(!0)}return!1}}function ws(){return W.getState().accessToken||""}function Js(){return gi(()=>pi(),null)}function Eo(e){return gi(()=>pi(e),e)}function lt(){return W(e=>e.user?.tenantId??e.tenants?.[0]?.id??"")}async function zt(e,t,{params:s,body:o,multipart:n=!1}={}){const a=ve();let i=`${Ju()}${t}`;if(s){const h=new URLSearchParams;for(const[x,b]of Object.entries(s))if(!(b==null||b===""))if(Array.isArray(b))for(const w of b)w!=null&&w!==""&&h.append(x,w);else h.set(x,b);const v=h.toString();v&&(i+=`?${v}`)}if(!a){const h=ws();if(!h||di(h)){const{refreshToken:v}=W.getState();v&&await Js()}}const c=n?{"X-Requested-With":"XMLHttpRequest"}:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"};if(a){const h=hr();h&&(c["X-Industry"]=h)}else{const h=ws();h&&(c.Authorization=`Bearer ${h}`)}const{user:u,tenants:l}=W.getState(),f=u?.tenantId||l?.[0]?.id;f&&(c["X-Org-Id"]=f);const d={method:e,headers:c};o&&(d.body=n?o:JSON.stringify(o)),t.startsWith("/oauth/")&&(d.credentials="include");let g=await fetch(i,d);if(g.status===401&&!a)if(await Js()){const v=ws();v&&(c.Authorization=`Bearer ${v}`),g=await fetch(i,{method:e,headers:c,body:d.body,credentials:d.credentials})}else{const{sessionExpired:v}=W.getState(),x=new Error(v?"Session expired":"Unable to refresh session — please try again");throw x.status=401,x}if(!g.ok){const h=await g.json().catch(()=>({})),v=(typeof h.error=="object"?h.error?.message:h.error)||h.message,x=String(v??"").replace(/^'\d+' invalid parameter\(s\):\s*/,"")||v,b=h.code==="rbac_denied"||String(x).toLowerCase()==="forbidden",w=g.status===403?!b&&x||"You don't have permission to perform this action":x||g.statusText||`HTTP ${g.status}`,A=new Error(w);A.status=g.status;const E=h.error?.reason??h.reason;throw E&&(A.code=E),A}if(g.status===204||g.headers.get("content-length")==="0")return null;const p=await g.text();if(!p)return null;const y=JSON.parse(p);return"data"in y?y.data:null}const H={get:(e,t)=>zt("GET",e,{params:t}),post:(e,t,s)=>zt("POST",e,{body:t,params:s}),put:(e,t,s)=>zt("PUT",e,{body:t,params:s}),patch:(e,t)=>zt("PATCH",e,{body:t}),del:(e,t)=>
3zt("DELETE",e,{body:t}),upload:(e,t)=>zt("POST",e,{body:t,multipart:!0})},Xu=300*1e3,ed=30*1e3,td=1e3;function rd(){const e=m.useRef(0);m.useEffect(()=>{e.current=Date.now();let t=0;function s(){const n=Date.now();n-t>=td&&(e.current=n,t=n)}window.addEventListener("mousemove",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("touchstart",s);const o=setInterval(async()=>{const{isAuthenticated:n,accessToken:a}=W.getState();!n||!a||Date.now()-e.current>=Xu||di(a)&&await Js()},ed);return()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("touchstart",s),clearInterval(o)}},[])}function sd(){try{const e=localStorage.getItem("zopdev_theme");if(e==="light"||e==="dark")return e;if(typeof window.matchMedia=="function")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return"light"}function Rn(e){try{document.documentElement.setAttribute("data-theme",e),document.documentElement.style.colorScheme=e,localStorage.setItem("zopdev_theme",e)}catch{}}const Yt=vo(e=>({modalOpen:null,openModal:t=>e({modalOpen:t}),closeModal:()=>e({modalOpen:null}),theme:typeof window<"u"?sd():"light",setTheme:t=>{Rn(t),e({theme:t})},toggleTheme:()=>e(t=>{const s=t.theme==="dark"?"light":"dark";return Rn(s),{theme:s}})}));try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{try{const o=localStorage.getItem("zopdev_theme");if(o==="light"||o==="dark")return}catch{}const s=t.matches?"dark":"light";document.documentElement.setAttribute("data-theme",s),document.documentElement.style.colorScheme=s,Yt.setState({theme:s})})}catch{}function Lt({label:e="Loading"}){return r.jsxs("div",{className:"flex items-center justify-center py-8",role:"status",children:[r.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary-600 border-t-transparent shadow-glow-sm"}),r.jsx("span",{className:"sr-only",children:e})]})}const As="chunk-retry",od=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module","'text/html' is not a valid javascript mime type","is not a valid javascript mime type","expected a javascript-or-wasm module script","unable to preload css","module source URI is not allowed"];function nd(e){const t=e?.message??"";return od.some(s=>t.toLowerCase().includes(s.toLowerCase()))}function $(e){return m.lazy(()=>e().catch(t=>{if(!nd(t))throw t;if(sessionStorage.getItem(As))throw sessionStorage.removeItem(As),t;return sessionStorage.setItem(As,"1"),window.location.reload(),new Promise(()=>{})}))}const ad=["/zopnight/app",Vs],id="/zopnight/app";function cd(e){const t=typeof window<"u"?window.location.pathname:"/";for(const s of ad)if(t===s||t.startsWith(s+"/"))return s;return id}function ld(){const e=Yt(s=>s.theme),t=Yt(s=>s.toggleTheme);return r.jsx("button",{onClick:t,className:"p-2 rounded-lg text-text-secondary hover:text-text-primary hover:bg-surface-tertiary transition-colors duration-fast","aria-label":`Switch to ${e==="dark"?"light":"dark"} theme`,children:e==="dark"?r.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):r.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})}const hi="#2A4494";function ud({className:e="w-6 h-6"}){return r.jsxs("svg",{role:"img","aria-label":"ZopDev",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",className:`block ${e}`,children:[r.jsx("rect",{x:"0",y:"0",width:"16",height:"16",className:"fill-[#2A4494] dark:fill-[#4A66D4]"}),r.jsx("rect",{x:"16",y:"0",width:"16",height:"16",fill:"#F58549"}),r.jsx("rect",{x:"16",y:"16",width:"16",height:"16",fill:"#7FB236"})]})}function m2({className:e="w-6 h-6"}){return r.jsxs("svg",{role:"img","aria-label":"ZopDay",xmlns:"http://www.w3.org/2000/svg",viewBox:"-1125 530 952 952",className:`block ${e}
3`,children:[r.jsx("rect",{x:"-1125",y:"530",width:"952",height:"952",fill:"#F58549"}),r.jsx("circle",{cx:"-649",cy:"1006",r:"238",fill:"#FFFFFF"})]})}function yi({className:e="w-6 h-6"}){return r.jsxs("svg",{role:"img","aria-label":"ZopNight",xmlns:"http://www.w3.org/2000/svg",viewBox:"-1125 530 952 952",className:`block ${e}`,children:[r.jsx("rect",{x:"-1125",y:"530",width:"952",height:"952",fill:hi}),r.jsx("circle",{cx:"-649",cy:"1006",r:"238",fill:"#FFFFFF"})]})}function Wr({className:e="w-32"}){return r.jsxs("svg",{role:"img","aria-label":"ZopNight",xmlns:"http://www.w3.org/2000/svg",viewBox:"-1125 530 4943.43 952",className:`block text-text-primary ${e}`,children:[r.jsx("rect",{x:"-1125",y:"530",width:"952",height:"952",fill:hi}),r.jsx("circle",{cx:"-649",cy:"1006",r:"238",fill:"#FFFFFF"}),r.jsx("path",{fill:"currentColor",d:"M27.00054931640625 1250.0V1145.7156982421875L279.14434814453125 861.7127685546875H30.28631591796875V754.0H427.42791748046875V858.2843017578125L171.85565185546875 1142.2872314453125H432.42791748046875V1250.0Z M732.8571166992188 1262.0Q658.2857666015625 1262.0 598.2858581542969 1229.1428833007812Q538.2859497070312 1196.2857666015625 503.214599609375 1137.3572082519531Q468.14324951171875 1078.4286499023438 468.14324951171875 1001.9838279868072Q468.14324951171875 924.5713500976562 503.2860412597656 866.1427917480469Q538.4288330078125 807.7142333984375 598.9287414550781 774.8571166992188Q659.4286499023438 742.0 733.1310610014816 742.0Q807.8571166992188 742.0 867.7855834960938 774.8571166992188Q927.7140502929688 807.7142333984375 962.785400390625 866.1427917480469Q997.8567504882812 924.5713500976562 997.8567504882812 1001.9838279868072Q997.8567504882812 1078.4286499023438 962.7139587402344 1137.3572082519531Q927.5711669921875 1196.2857666015625 867.5712585449219 1229.1428833007812Q807.5713500976562 1262.0 732.8571166992188 1262.0ZM732.7415504026949 1149.7158813476562Q769.0003662109375 1149.7158813476562 798.8578491210938 1133.2156982421875Q828.71533203125 1116.7155151367188 846.4298400878906 1083.898556271115Q864.1443481445312 1051.081597405511 864.1443481445312 1002.4092539194468Q864.1443481445312 952.9994506835938 846.0727233886719 920.1419677734375Q828.0010986328125 887.2844848632812 798.5721740722656 870.7843017578125Q769.1432495117188 854.2841186523438 733.5714416503906 854.2841186523438Q697.9996337890625 854.2841186523438 667.9998198774524 870.9115803654033Q638.0000059658423 887.5390420784628 619.9278289106555 920.0549672062236Q601.8556518554688 952.5708923339844 601.8556518554688 1002.0837783239838Q601.8556518554688 1050.857666015625 619.5701599121094 1083.7865905761719Q637.28466796875 1116.7155151367188 667.2536891980118 1133.2156982421875Q697.2227104272736 1149.7158813476562 732.7415504026949 1149.7158813476562Z M1042.5720825195312 1470.0V754.0H1172.5702514648438V824.5718994140625Q1196.5702514648438 791.714599609375 1236.2133178710938 766.8572998046875Q1275.8563842773438 742.0 1338.142333984375 742.0Q1407.9996337890625 742.0 1462.9996337890625 776.0Q1517.9996337890625 810.0 1549.7853088378906 869.0Q1581.5709838867188 928.0 1581.5709838867188 1003.0Q1581.5709838867188 1077.1428833007812 1549.7853088378906 1136.0714416503906Q1517.9996337890625 1195.0 1462.9996337890625 1228.5Q1407.9996337890625 1262.0 1337.9994506835938 1262.0Q1281.8563842773438 1262.0 1240.2133178710938 1241.0712585449219Q1198.5702514648438 1220.1425170898438 1172.5702514648438 1182.57080078125V1470.0ZM1309.2859497070312 1148.7158813476562Q1350.2863159179688 1148.7158813476562 1382.1437072753906 1129.7156982421875Q1414.0010986328125 1110.7155151367188 1431.8583984375 1077.7865905761719Q1449.7156982421875 1044.857666015625 1449.7156982421875 1002.8571166992188Q1449.7156982421875 959.9994506835938 1431.8583984375 926.5705261230469Q1414.0010986328125 893.1416015625 1382.1437072753906 874.2128601074219Q1350.2863159179688 855.2841186523438 1309.2859497070312 855.2841186523438Q1268.428466796875 855.2841186523438 1236.9281921386719 874.2128601074219Q1205.4279174804688 893.1416015625 1187.5706176757812 926.1419677734375Q1169.7133178710938 959.142333984375 1169.7133178710938 1002.0Q1169.7133178710938 1044.857666015625 1187.5706176757812 1077.7865905761719Q1205.4279174804688 1110.7155151367188 1236.9281921386719 1129.7156982421875Q1268.428466796875 1148.7158813476562 1309.2859497070312 1148.7158813476562Z M1623.7151489257812 1250.0V754.0H1753.7133178710938V828.8574829101562Q1777.856201171875 788.8572998046875 1819.8562927246094 765.4286499023438Q1861.8563842773438 742.0 1917.7135009765625 742.0Q2010.5704345703125 742.0 2060.9990844726562 800.4283752441406Q2111.427734375 858.8567504882812 2111.427734375 970.7138671875V1250.0H1981.4295654296875V982.9994506835938Q1981.4295654296875 918.9989013671875 1955.500732421875 885.4272766113281Q1929.5718994140625 851.8556518554688 1874.8572998046875 851.8556518554688Q1822.285400390625 851.8556518554688 1787.9993591308594 889.2845764160156Q1753.7133178710938 926.7135009765625 1753.7133178710938 993.8571166992188V1250.0Z M2173.143798828125 1250.0V754.0H2303.1419677734375V1250.0ZM2176.0003662109375 671.8565673828125V545.7144165039062H2301.7138671875V671.8565673828125Z M2636.8567504882812 1482.0Q2573.4281005859375 1482.0 2515.785400390625 1461.1427917480469Q2458.1427001953125 1440.2855834960938 2418.0714416503906 1395.7856750488281Q2378.0001831054688 1351.2857666015625 2369.571533203125 1281.4290161132812H2498.5697021484375Q2507.8556518554688 1321.8580322265625 2545.2845764160156 1345.7155151367188Q2582.7135009765625 1369.572998046875 2634.285400390625 1369.572998046875Q2671.7144165039062 1369.572998046875 2703.3575744628906 1353.929931640625Q2735.000732421875 1338.286865234375 2753.8580322265625 1306.5721740722656Q2772.71533203125 1274.8574829101562 2772.71533203125 1226.1427001953125V1163.9994506835938Q2757.5724487304688 1187.8567504882812 2733.929473876953 1207.9283752441406Q2710.2864990234375 1228.0 2677.714874267578 1240.2858581542969Q2645.1432495117188 1252.5717163085938 2602.7144165039062 1252.5717163085938Q2532.0001831054688 1252.5717163085938 2475.428741455078 1219.0002746582031Q2418.8572998046875 1185.4288330078125 2386.2144165039062 1127.2859497070312Q2353.571533203125 1069.14306640625 2353.571533203125 99
36.7144165039062Q2353.571533203125 924.2857666015625 2386.2144165039062 866.6428833007812Q2418.8572998046875 809.0 2475.428741455078 775.5Q2532.0001831054688 742.0 2602.8572998046875 742.0Q2659.857666015625 742.0 2703.715057373047 765.3573913574219Q2747.5724487304688 788.7147827148438 2772.71533203125 823.2864990234375V754.0H2902.7135009765625V1219.2857666015625Q2902.7135009765625 1305.2855834960938 2866.4279174804688 1363.7855834960938Q2830.142333984375 1422.2855834960938 2769.7138671875 1452.1427917480469Q2709.285400390625 1482.0 2636.8567504882812 1482.0ZM2628.8567504882812 1140.1447143554688Q2671.5713500976562 1140.1447143554688 2703.357391357422 1121.14453125Q2735.1434326171875 1102.1443481445312 2753.215057373047 1069.9296569824219Q2771.2866821289062 1037.7149658203125 2771.2866821289062 997.571533203125Q2771.2866821289062 956.4281005859375 2753.215057373047 924.3562927246094Q2735.1434326171875 892.2844848632812 2703.357391357422 873.7843017578125Q2671.5713500976562 855.2841186523438 2628.8567504882812 855.2841186523438Q2586.999267578125 855.2841186523438 2554.78466796875 873.7843017578125Q2522.570068359375 892.2844848632812 2504.4984436035156 923.927734375Q2486.4268188476562 955.5709838867188 2486.4268188476562 996.7144165039062Q2486.4268188476562 1036.8578491210938 2504.4984436035156 1069.5010986328125Q2522.570068359375 1102.1443481445312 2554.78466796875 1121.14453125Q2586.999267578125 1140.1447143554688 2628.8567504882812 1140.1447143554688Z M2964.1436157226562 1250.0V530.0H3094.1417846679688V829.1432495117188Q3118.4275512695312 789.0001831054688 3161.4990844726562 765.5000915527344Q3204.5706176757812 742.0 3259.427734375 742.0Q3351.1417846679688 742.0 3401.498992919922 800.4283752441406Q3451.856201171875 858.8567504882812 3451.856201171875 970.7138671875V1250.0H3322.8580322265625V982.9994506835938Q3322.8580322265625 918.9989013671875 3297.5720825195312 885.4272766113281Q3272.2861328125 851.8556518554688 3217.571533203125 851.8556518554688Q3164.1425170898438 851.8556518554688 3129.1421508789062 889.2845764160156Q3094.1417846679688 926.7135009765625 3094.1417846679688 993.8571166992188V1250.0Z M3715.8563842773438 1250.0Q3665.8567504882812 1250.0 3631.6427001953125 1238.2857666015625Q3597.4286499023438 1226.571533203125 3580.0716247558594 1193.214599609375Q3562.714599609375 1159.857666015625 3562.714599609375 1097.143798828125V862.8556518554688H3477.5717163085938V754.0H3562.714599609375V621.0005493164062H3692.7127685546875V754.0H3818.427734375V862.8556518554688H3692.7127685546875V1080.71533203125Q3692.7127685546875 1105.5728149414062 3697.784210205078 1118.1443481445312Q3702.8556518554688 1130.7158813476562 3716.7843017578125 1135.072998046875Q3730.7129516601562 1139.4301147460938 3755.28466796875 1139.4301147460938H3814.5704345703125V1250.0Z"})]})}const dd=[{title:"Smart Cost Optimization",content:r.jsxs("svg",{viewBox:"0 0 340 280",className:"w-full h-auto select-none",fill:"none",children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"cost-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.18"}),r.jsx("stop",{offset:"100%",stopColor:"#3b82f6",stopOpacity:"0"})]})}),r.jsx("rect",{x:"0",y:"0",width:"340",height:"80",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"24",y:"30",fontSize:"8",fontWeight:"500",fill:"var(--color-text-muted)",letterSpacing:"0.05em",children:"AVG. MONTHLY COST"}),r.jsx("text",{x:"24",y:"56",fontSize:"22",fontWeight:"600",fill:"var(--color-text-primary)",fontFamily:"var(--font-display, sans-serif)",children:"$4,280"}),r.jsx("text",{x:"108",y:"56",fontSize:"10",fill:"var(--color-text-muted)",children:"/mo"}),r.jsx("line",{x1:"170",y1:"18",x2:"170",y2:"64",stroke:"var(--color-border)",strokeWidth:"1"}),r.jsx("text",{x:"194",y:"30",fontSize:"8",fontWeight:"500",fill:"var(--color-text-muted)",letterSpacing:"0.05em",children:"TOTAL SAVINGS"}),r.jsx("text",{x:"194",y:"56",fontSize:"22",fontWeight:"600",fill:"#10b981",fontFamily:"var(--font-display, sans-serif)",children:"$1,820"}),r.jsx("text",{x:"278",y:"56",fontSize:"10",fill:"var(--color-text-muted)",children:"/mo"}),r.jsx("rect",{x:"0",y:"96",width:"340",height:"184",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"122",fontSize:"10",fontWeight:"500",fill:"var(--color-text-secondary)",children:"Cost Optimization Trend"}),r.jsx("line",{x1:"20",y1:"145",x2:"320",y2:"145",stroke:"var(--color-border)",strokeOpacity:"0.3"}),r.jsx("line",{x1:"20",y1:"175",x2:"320",y2:"175",stroke:"var(--color-border)",strokeOpacity:"0.3"}),r.jsx("line",{x1:"20",y1:"205",x2:"320",y2:"205",stroke:"var(--color-border)",strokeOpacity:"0.3"}),r.jsx("line",{x1:"20",y1:"235",x2:"320",y2:"235",stroke:"var(--color-border)",strokeOpacity:"0.3"}),r.jsx("path",{d:"M20,220 Q60,210 100,195 T180,170 T260,155 T320,140",stroke:"#3b82f6",strokeWidth:"2"}),r.jsx("path",{d:"M20,220 Q60,210 100,195 T180,170 T260,155 T320,140 V235 H20 Z",fill:"url(#cost-grad)"}),r.jsx("path",{d:"M20,230 Q60,225 100,218 T180,205 T260,200 T320,190",stroke:"#10b981",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.7"}),r.jsx("circle",{cx:"24",cy:"258",r:"4",fill:"#3b82f6"}),r.jsx("text",{x:"34",y:"261",fontSize:"9",fill:"var(--color-text-muted)",children:"Cost"}),r.jsx("line",{x1:"70",y1:"258",x2:"82",y2:"258",stroke:"#10b981",strokeWidth:"1.5"}),r.jsx("text",{x:"88",y:"261",fontSize:"9",fill:"var(--color-text-muted)",children:"Savings"})]})},{title:"Automated Scheduling",content:r.jsxs("svg",{viewBox:"0 0 340 280",className:"w-full h-auto select-none",fill:"none",children:[r.jsx("rect",{x:"0",y:"0",width:"340",height:"220",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"30",fontSize:"10",fontWeight:"500",fill:"var(--color-text-secondary)",children:"Active Schedules"}),r.jsx("text",{x:"20",y:"62",fontSize:"12",fill:"var(--color-text-primary)",children:"Dev Environment"}),r.jsx("text",{x:"20",y:"76",fontSize:"9",fill:"var(--color-text-muted)",children:"Week
3days 9am–6pm"}),r.jsx("rect",{x:"290",y:"56",width:"30",height:"16",rx:"8",fill:"#10b981",fillOpacity:"0.2"}),r.jsx("circle",{cx:"309",cy:"64",r:"5.5",fill:"#10b981"}),r.jsx("line",{x1:"20",y1:"90",x2:"320",y2:"90",stroke:"var(--color-border)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"112",fontSize:"12",fill:"var(--color-text-primary)",children:"Staging Cluster"}),r.jsx("text",{x:"20",y:"126",fontSize:"9",fill:"var(--color-text-muted)",children:"Business hours only"}),r.jsx("rect",{x:"290",y:"106",width:"30",height:"16",rx:"8",fill:"#10b981",fillOpacity:"0.2"}),r.jsx("circle",{cx:"309",cy:"114",r:"5.5",fill:"#10b981"}),r.jsx("line",{x1:"20",y1:"140",x2:"320",y2:"140",stroke:"var(--color-border)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"162",fontSize:"12",fill:"var(--color-text-primary)",children:"QA Resources"}),r.jsx("text",{x:"20",y:"176",fontSize:"9",fill:"var(--color-text-muted)",children:"Mon–Fri"}),r.jsx("rect",{x:"290",y:"156",width:"30",height:"16",rx:"8",fill:"#10b981",fillOpacity:"0.2"}),r.jsx("circle",{cx:"309",cy:"164",r:"5.5",fill:"#10b981"}),r.jsx("rect",{x:"20",y:"196",width:"300",height:"6",rx:"3",fill:"var(--color-border)",fillOpacity:"0.3"}),r.jsx("rect",{x:"20",y:"196",width:"210",height:"6",rx:"3",fill:"#3b82f6",fillOpacity:"0.6"}),r.jsx("circle",{cx:"230",cy:"199",r:"4",fill:"#3b82f6"}),r.jsx("rect",{x:"0",y:"236",width:"340",height:"44",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"263",fontSize:"12",fontWeight:"500",fill:"var(--color-text-primary)",children:"Auto-scheduling"}),r.jsx("rect",{x:"282",y:"249",width:"36",height:"20",rx:"10",fill:"#3b82f6"}),r.jsx("circle",{cx:"306",cy:"259",r:"7.5",fill:"white"})]})},{title:"Multi-Cloud Support",content:r.jsxs("svg",{viewBox:"0 0 340 280",className:"w-full h-auto select-none",fill:"none",children:[r.jsx("rect",{x:"0",y:"0",width:"340",height:"210",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"30",fontSize:"10",fontWeight:"500",fill:"var(--color-text-secondary)",children:"Connected Providers"}),r.jsx("text",{x:"20",y:"60",fontSize:"12",fill:"var(--color-text-primary)",children:"Amazon Web Services"}),r.jsx("text",{x:"260",y:"60",fontSize:"10",fill:"var(--color-text-muted)",textAnchor:"end",children:"142 resources"}),r.jsx("rect",{x:"20",y:"68",width:"300",height:"6",rx:"3",fill:"var(--color-border)",fillOpacity:"0.2"}),r.jsx("rect",{x:"20",y:"68",width:"300",height:"6",rx:"3",fill:"#f59e0b"}),r.jsx("text",{x:"20",y:"100",fontSize:"12",fill:"var(--color-text-primary)",children:"Google Cloud Platform"}),r.jsx("text",{x:"260",y:"100",fontSize:"10",fill:"var(--color-text-muted)",textAnchor:"end",children:"84 resources"}),r.jsx("rect",{x:"20",y:"108",width:"300",height:"6",rx:"3",fill:"var(--color-border)",fillOpacity:"0.2"}),r.jsx("rect",{x:"20",y:"108",width:"177",height:"6",rx:"3",fill:"#3b82f6"}),r.jsx("text",{x:"20",y:"140",fontSize:"12",fill:"var(--color-text-primary)",children:"Microsoft Azure"}),r.jsx("text",{x:"260",y:"140",fontSize:"10",fill:"var(--color-text-muted)",textAnchor:"end",children:"56 resources"}),r.jsx("rect",{x:"20",y:"148",width:"300",height:"6",rx:"3",fill:"var(--color-border)",fillOpacity:"0.2"}),r.jsx("rect",{x:"20",y:"148",width:"118",height:"6",rx:"3",fill:"#8a3ffc"}),r.jsx("circle",{cx:"30",cy:"180",r:"4",fill:"#f59e0b"}),r.jsx("text",{x:"40",y:"183",fontSize:"9",fill:"var(--color-text-muted)",children:"AWS"}),r.jsx("circle",{cx:"80",cy:"180",r:"4",fill:"#3b82f6"}),r.jsx("text",{x:"90",y:"183",fontSize:"9",fill:"var(--color-text-muted)",children:"GCP"}),r.jsx("circle",{cx:"130",cy:"180",r:"4",fill:"#8a3ffc"}),r.jsx("text",{x:"140",y:"183",fontSize:"9",fill:"var(--color-text-muted)",children:"Azure"}),r.jsx("rect",{x:"0",y:"226",width:"340",height:"54",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"170",y:"250",fontSize:"22",fontWeight:"700",fill:"var(--color-text-primary)",textAnchor:"middle",fontFamily:"var(--font-display, sans-serif)",children:"282"}),r.jsx("text",{x:"170",y:"268",fontSize:"10",fill:"var(--color-text-muted)",textAnchor:"middle",children:"Total managed resources"})]})},{title:"Actionable Recommendations",content:r.jsxs("svg",{viewBox:"0 0 340 280",className:"w-full h-auto select-none",fill:"none",children:[r.jsx("rect",{x:"0",y:"0",width:"340",height:"200",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"30",fontSize:"10",fontWeight:"500",fill:"var(--color-text-secondary)",children:"Open Recommendations"}),r.jsx("text",{x:"20",y:"60",fontSize:"12",fill:"var(--color-text-primary)",children:"Rightsize i3.xlarge instances"}),r.jsx("text",{x:"320",y:"60",fontSize:"11",fontWeight:"600",fill:"#10b981",textAnchor:"end",children:"$320/mo"}),r.jsx("line",{x1:"20",y1:"72",x2:"320",y2:"72",stroke:"var(--color-border)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"96",fontSize:"12",fill:"var(--color-text-primary)",children:"Schedule idle dev databases"}),r.jsx("text",{x:"320",y:"96",fontSize:"11",fontWeight:"600",fill:"#10b981",textAnchor:"end",children:"$180/mo"}),r.jsx("line",{x1:"20",y1:"108",x2:"320",y2:"108",stroke:"var(--color-border)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"132",fontSize:"12",fill:"var(--color-text-primary)",children:"Remove unattached EBS volumes"}),r.jsx("text",{x:"320",y:"132",fontSize:"11",fontWeight:"600",fill:"#10b981",textAnchor:"end",children:"$95/mo"}),r.jsx("rect",{x:"20",y:"155",width:"180",height:"8",rx:"4",fill:"#10b981",fillOpacity:"0.15"}),r.jsx("rect",{x:"20",y:"155",width:"97",height:"8",rx:"4",fill:"#10b981",fillOpacity:"0.5"}),r.jsx("text",{x:"20",y:"178",fontSize:"8",fill:"var(--color-text-muted)",children:"53% of recommendations actioned"}),r.jsx("rect",{x:"0",y:"216",width:"340",height:"64",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"170",y:"246",fontSize:"24",fontWeight:"700",fill:"#10b981",textAnchor:"middle",fontFamily:"var(--font-display, sans-serif)",children:"$595"}),r.jsx("text",{x:"170",y:"264",fontSize:"10",fill:"var(--color-text-muted)",textAnchor:"middle",children:"Potential monthly savings"})]})},{title:"Real-Time State Tracking",content:r.jsxs("svg",{viewBox:"0 0 340 280",className:"w-full h-auto select-none",fill:"none",children:[r.jsx("rect",{x:"0",y:"0",width:"340",height:"220",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"30",fontSize:"10",fontWeight:"500",fill:"var(--color-text-secondary)",children:"Recent Activity"}),r.jsx("circle",{cx:"26",cy:"55",r:"3.5",fill:"#10b981"}),r.jsx("text",{x:"40",y:"59",fontSize:"12",fill:"var(--color-text-primary)",fontFamily:"monospace",children:"i-0c44d17bf..."}),r.jsx("text",{x:"320",y:"59",fontSize:"9",fill:"var(--color-text-muted)",textAnchor:"end",children:"2 min ago"}),r.jsx("circle",{cx:"26",cy:"90",r:"3.5",fill:"#ef4444"}),r.jsx("text",{x:"40",y:"94",fontSize:"12",fill:"var(--color-text-primary)",fontFamily:"monospace",children:"db-staging-01"}),r.jsx("text",{x:"320",y:"94",fontSize:"9",fill:"var(--color-text-muted)",textAnchor:"end",children:"15 min ago"}),r.jsx("circle",{cx:"26",cy:"125",r:"3.5",fill:"#10b981"}),r.jsx("text",{x:"40",y:"129",fontSize:"12",fill:"var(--color-text-primary)",fontFamily:"monospace",children:"k8s-dev-pool"}),r.jsx("text",{x:"320",y:"129",fontSize:"9",fill:"var(--color-text-muted)",textAnchor:"end",children:"1 hr ago"}),r.jsx("circle",{cx:"26",cy:"160",r:"3.5",fill:"#ef4444"}),r.jsx("text",{x:"40",y:"164",fontSize:"12",fill:"var(--color-text-primary)",fontFamily:"monospace",children:"redis-cache-02"}),r.jsx("text",{x:"320",y:"164",fontSize:"9",fill:"var(--color-text-muted)",textAnchor:"end",children:"2 hr ago"}),r.jsx("line",{x1:"20",y1:"180",x2:"320",y2:"180",stroke:"var(--color-border)",strokeOpacity:"0.3"}),r.jsx("circle",{cx:"30",cy:"200",r:"4",fill:"#10b981",fillOpacity:"0.2"}),r.jsx("circle",{cx:"30",cy:"200",r:"2.5",fill:"#10b981"}),r.jsx("text",{x:"42",y:"203",fontSize:"9",fill:"var(--color-text-muted)",children:"2 started"}),r.jsx("circle",{cx:"110",cy:"200",r:"4",fill:"#ef4444",fillOpacity:"0.2"}),r.jsx("circle",{cx:"110",cy:"200",r:"2.5",fill:"#ef4444"}),r.jsx("text",{x:"122",y:"203",fontSize:"9",fill:"var(--color-text-muted)",children:"2 stopped"}),r.jsx("rect",{x:"0",y:"236",width:"340",height:"44",rx:"12",fill:"var(--color-surface)",stroke:"var(--color-border-strong)",strokeOpacity:"0.4"}),r.jsx("text",{x:"20",y:"263",fontSize:"12",fontWeight:"500",fill:"var(--color-text-primary)",children:"Live monitoring"}),r.jsx("circle",{cx:"290",cy:"258",r:"4",fill:"#10b981",children:r.jsx("animate",{attributeName:"opacity",values:"1;0.4;
31",dur:"2s",repeatCount:"indefinite"})}),r.jsx("text",{x:"300",y:"262",fontSize:"10",fill:"#10b981",children:"Active"})]})}],fd=2e3;function md(e){const t=[...e];for(let s=t.length-1;s>0;s--){const o=Math.floor(Math.random()*(s+1));[t[s],t[o]]=[t[o],t[s]]}return t}function gd(){const[e]=m.useState(()=>md(dd)),[t,s]=m.useState(0),[o,n]=m.useState(!1);return m.useEffect(()=>{if(o)return;const a=setInterval(()=>{s(i=>(i+1)%e.length)},fd);return()=>clearInterval(a)},[o,e.length]),r.jsxs("div",{className:"hidden lg:flex bg-primary-600/5 rounded-l-2xl flex-col items-center justify-center p-10 relative overflow-hidden",children:[r.jsx("div",{className:"absolute top-[-20%] right-[-10%] w-[400px] h-[400px] rounded-full bg-primary-600/8 blur-[100px] pointer-events-none"}),r.jsx("div",{className:"absolute bottom-[-15%] left-[-5%] w-[300px] h-[300px] rounded-full bg-primary-700/6 blur-[80px] pointer-events-none"}),r.jsxs("div",{className:"relative z-10 w-full max-w-sm",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[r.jsx("div",{className:"relative min-h-[320px]",children:e.map((a,i)=>r.jsx("div",{className:"absolute inset-0 transition-opacity duration-500",style:{opacity:i===t?1:0,pointerEvents:i===t?"auto":"none"},children:a.content},a.title))}),r.jsx("div",{className:"flex items-center justify-center gap-2 mt-6",children:e.map((a,i)=>r.jsx("button",{onClick:()=>s(i),className:`rounded-full transition-all duration-300 ${i===t?"w-6 h-2.5 bg-primary-600":"w-2.5 h-2.5 bg-primary-600/25"}`,"aria-label":a.title},a.title))})]})]})}function Re({subtitle:e,children:t,logo:s}){return r.jsxs("div",{className:"min-h-screen bg-surface-secondary flex flex-col items-center justify-center px-4 py-8",children:[r.jsx("div",{className:"absolute top-4 right-4 z-20",children:r.jsx(ld,{})}),r.jsx("div",{className:"flex justify-center mb-8",children:s??r.jsx(Wr,{className:"w-36"})}),r.jsxs("div",{className:"w-full max-w-5xl min-h-[600px] bg-surface border border-border-strong rounded-2xl shadow-card overflow-hidden grid grid-cols-1 lg:grid-cols-2 animate-fade-in",children:[r.jsx(gd,{}),r.jsxs("div",{className:"px-8 py-10 sm:px-12 flex flex-col justify-center",children:[e&&r.jsx("p",{className:"text-sm text-text-secondary mb-6",children:e}),t]})]})]})}const pd="00000000-0000-4000-8000-0000000000";function Ro(e){const t=ht.findIndex(o=>o.slug===e);if(t<0)return null;const s=String(t+1).padStart(2,"0");return`${pd}${s}`}function xi(e){for(const t of ht)if(Ro(t.slug)===e)return t.slug;return null}function hd(){return ht.map(e=>({id:Ro(e.slug),name:`${e.label} Demo`,playgroundIndustry:e.slug}))}function vi(){const e=hr();if(!e||!ht.find(o=>o.slug===e))return!1;const s=Ro(e);return W.setState({accessToken:null,refreshToken:null,tenants:hd(),user:{email:`demo@${e}.zopnight.example`,tenantId:s},isAuthenticated:!0,sessionExpired:!1}),!0}function bi(e){const t=xi(e);return t?(si(t),W.setState(s=>({...s,user:{...s.user||{},tenantId:e,email:`demo@${t}.zopnight.example`}})),_o(dr),!0):!1}function yd(){const e=pe(),[t]=Se(),s=o=>{si(o),vi(),e(Sl(t.get("returnTo"))??"/dashboard",{replace:!0})};return r.jsx(Re,{subtitle:"Explore ZopNight with realistic sample data. Pick an industry to see the dashboard, resources, and recommendations populated with an example cloud estate. No sign-in, nothing persists.",children:r.jsxs("div",{className:"flex flex-col gap-6",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Playground"}),r.jsx("ul",{role:"list",className:"flex flex-col gap-3",children:ht.map(o=>r.jsx("li",{children:r.jsx("button",{type:"button","aria-label":o.label,onClick:()=>s(o.slug),className:"group w-full text-left bg-surface-tertiary hover:bg-surface-elevated border border-border-strong hover:border-primary-600/40 rounded-xl px-4 py-3 transition-all duration-fast focus:outline-none focus:ring-2 focus:ring-primary-600/30",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{"aria-hidden":"true",className:"shrink-0 w-10 h-10 rounded-lg bg-primary-600/10 text-primary-600 flex items-center justify-center font-semibold",children:o.label.charAt(0)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-text-primary",children:o.label}),r.jsx("div",{className:"text-xs text-text-muted mt-0.5 leading-snug",children:o.description})]}),r.jsx("svg",{"aria-hidden":"true",className:"shrink-0 w-4 h-4 text-text-muted group-hover:text-primary-600 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.75",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})})},o.slug))}),r.jsxs("div",{className:"pt-4 border-t border-border text-sm text-text-secondary",children:["Ready to connect your own cloud accounts?"," ",r.jsx("a",{href:"/zopnight/app/signup",className:"text-primary-600 hover:text-primary-700 font-medium",children:"Create a free account →"})]})]})})}function Ve({className:e="",size:t="md",...s}){return r.jsx("input",{className:`w-full px-3 ${t==="sm"?"py-1.5 text-xs":"py-2 text-sm"} bg-surface-tertiary border border-border-strong rounded-lg text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary-600/30 focus:border-primary-600/40 transition-all duration-fast ${e}`,...s})}const xd={primary:"bg-primary-600 text-text-inverse hover:bg-primary-700 focus-visible:ring-primary-600/40 hover:shadow-glow",action:"bg-surface-tertiary text-text-primary border border-border hover:bg-surface-elevated hover:border-border-strong focus-visible:ring-primary-600/30",delete:"bg-danger-400/10 text-danger-500 border border-danger-400/20 hover:bg-danger-400/15 focu
3s-visible:ring-danger-400/30",secondary:"bg-surface-tertiary text-text-primary border border-border-strong hover:bg-surface-elevated hover:border-primary-600/20 focus-visible:ring-primary-600/30"},vd={xs:"px-3 py-1.5 text-xs",sm:"px-2.5 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-2.5 text-sm",compact:"h-8 px-3 text-xs"};function ge({variant:e="primary",size:t="md",rounded:s=!1,disabled:o=!1,children:n,className:a="",...i}){return r.jsx("button",{disabled:o,className:`inline-flex items-center justify-center gap-2 font-semibold ${s?"rounded-full":"rounded-lg"} transition-all duration-normal focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:opacity-disabled disabled:cursor-not-allowed disabled:shadow-none ${xd[e]} ${vd[t]} ${a}`,...i,children:n})}function De({label:e,required:t,children:s}){return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:[e,t&&r.jsx("span",{className:"text-danger-500 ml-0.5",children:"*"})]}),s]})}function xt({message:e}){return e?r.jsxs("div",{role:"alert","aria-live":"assertive",className:"flex items-center gap-2.5 p-3 mb-4 text-sm text-danger-500 bg-danger-400/8 border border-danger-400/15 rounded-lg",children:[r.jsx("svg",{className:"w-4 h-4 shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z",clipRule:"evenodd"})}),r.jsx("span",{children:e})]}):null}const bd=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,wd=new Set(["gmail.com","googlemail.com","yahoo.com","yahoo.co.uk","yahoo.co.in","yahoo.fr","yahoo.de","ymail.com","rocketmail.com","outlook.com","outlook.in","hotmail.com","hotmail.co.uk","hotmail.fr","live.com","live.co.uk","msn.com","icloud.com","me.com","mac.com","aol.com","aol.co.uk","proton.me","protonmail.com","pm.me","gmx.com","gmx.net","gmx.de","mail.com","zoho.com","zohomail.com","yandex.com","yandex.ru","hey.com"]),Ad=new Set(["mailinator.com","tempmail.com","temp-mail.org","tempmail.dev","10minutemail.com","guerrillamail.com","yopmail.com","throwaway.email","getnada.com","nada.email","maildrop.cc","mohmal.com","sharklasers.com","trashmail.com","dispostable.com","fakeinbox.com","mailnesia.com","mintemail.com","spam4.me","tempr.email","discard.email","guerrillamail.info","grr.la","spamgourmet.com"]);function jn(e){const t=e.lastIndexOf("@");if(t<=0||t===e.length-1)return"";const s=e.slice(t+1).replace(/\.$/,"");return!s.includes(".")||/[\s@]/.test(s)?"":s}function _d(e){const t=typeof e=="string"?e.trim().toLowerCase():"";if(!t||!bd.test(t)||!jn(t))return{ok:!1,error:"Please enter a valid email address."};const s=jn(t);return Ad.has(s)?{ok:!1,error:"That email provider isn't allowed. Please use your company email."}:wd.has(s)?{ok:!1,error:"Please use your company email address. Personal email providers aren't supported."}:{ok:!0,email:t}}const Cn="https://api.zop.dev/marketing-hub".replace(/\/$/,""),Nn="lhp_live_X67QbiUG71P5THO6Jda1k5uRCUZvaxgG";function wi(e){if(!e)return"";if(typeof e=="string")return e;if(Array.isArray(e.errors)&&e.errors[0]){const t=e.errors[0];if(typeof t=="string")return t;if(typeof t?.message=="string")return t.message}return typeof e.error=="string"?e.error:typeof e.error?.message=="string"?e.error.message:typeof e.message=="string"?e.message:""}async function jo(e,t){if(!Cn||!Nn)throw new Error("Playground access is not configured. Please try again later.");const s=await fetch(Cn+e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Nn}`},body:JSON.stringify(t),credentials:"omit"});let o=null;try{o=await s.json()}catch{}if(!s.ok){const n=new Error(wi(o)||`Request failed (${s.status})`);throw n.status=s.status,n}return o?.data??o}function Ai({email:e,name:t,source:s}){return jo("/v1/registrations",{email:e,first_name:t||void 0,campaign_slug:"weekly-digest",source:s,consent_marketing:!0})}function Sd(){return"https://api.zop.dev/marketing-hub".replace(/\/$/,"")}async function g2({product:e,token:t}){const s=Sd();if(!s)throw new Error("Product messages are not configured.");
3if(!t)throw new Error("Product messages require a signed-in session (not signed in).");const o=await fetch(`${s}/app/v1/product-messages?product=${encodeURIComponent(e)}`,{method:"GET",headers:{Authorization:`Bearer ${t}`},credentials:"omit"});let n=null;try{n=await o.json()}catch{}if(!o.ok){const a=new Error(wi(n)||`Request failed (${o.status})`);throw a.status=o.status,a}return n?.data??n}function kd({email:e,name:t,company:s}){return jo("/v1/playground/access-requests",{email:e,first_name:t||void 0,company:s||void 0,product:"zopnight"})}function Ed(e){return jo("/v1/playground/access-grants",{token:e})}function Rd(){const[e,t]=m.useState(null),[s,o]=m.useState(null),[n,a]=m.useState(!1),i=Et({defaultValues:{name:"",email:"",company:"",consent:!1},onSubmit:async({value:c})=>{t(null);const u=_d(c.email);if(!u.ok){t(u.error);return}a(!0);try{await kd({email:u.email,name:c.name,company:c.company}),o(u.email),c.consent&&Ai({email:u.email,name:c.name,source:"zopnight-playground"}).catch(()=>{})}catch(l){t(l.message||"Something went wrong. Please try again.")}finally{a(!1)}}});return s?r.jsx(Re,{subtitle:"Explore ZopNight with realistic sample data across finance, retail, and healthcare estates.",children:r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsx("div",{"aria-hidden":"true",className:"w-12 h-12 rounded-full bg-primary-600/10 text-primary-600 flex items-center justify-center",children:r.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.75",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Check your inbox"}),r.jsxs("p",{className:"text-sm text-text-secondary leading-relaxed",children:["We sent an access link to ",r.jsx("span",{className:"font-medium text-text-primary",children:s}),". It expires in 15 minutes and can be used once. Open it on this device to enter the playground."]}),r.jsx("button",{type:"button",onClick:()=>{o(null),t(null)},className:"text-sm text-text-link hover:text-text-link-hover self-start transition-colors duration-fast",children:"Use a different email"})]})}):r.jsx(Re,{subtitle:"Explore ZopNight with realistic sample data across finance, retail, and healthcare estates. Enter your work email and we'll send you an access link.",children:r.jsxs("form",{onSubmit:c=>{c.preventDefault(),i.handleSubmit()},className:"flex flex-col gap-4",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Access the Playground"}),r.jsx(xt,{message:e}),r.jsx(i.Field,{name:"name",validators:{onSubmit:({value:c})=>c?.trim()?void 0:"Full name is required"},children:c=>r.jsx(De,{label:"Full name",children:r.jsx(Ve,{type:"text",placeholder:"Ada Lovelace",value:c.state.value,onChange:u=>c.handleChange(u.target.value),onBlur:c.handleBlur,autoComplete:"name",required:!0})})}),r.jsx(i.Field,{name:"email",validators:{onSubmit:({value:c})=>c?.trim()?void 0:"Work email is required"},children:c=>r.jsx(De,{label:"Work email",children:r.jsx(Ve,{type:"email",placeholder:"[email protected]",value:c.state.value,onChange:u=>c.handleChange(u.target.value),onBlur:c.handleBlur,autoComplete:"email",required:!0})})}),r.jsx(i.Field,{name:"company",validators:{onSubmit:({value:c})=>c?.trim()?void 0:"Company is required"},children:c=>r.jsx(De,{label:"Company",children:r.jsx(Ve,{type:"text",placeholder:"Acme Inc.",value:c.state.value,onChange:u=>c.handleChange(u.target.value),onBlur:c.handleBlur,autoComplete:"organization",required:!0})})}),r.jsx(i.Field,{name:"consent",children:c=>r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("input",{id:"playground-marketing-consent",type:"checkbox",checked:c.state.value,onChange:u=>c.handleChange(u.target.checked),className:"accent-primary-600 w-4 h-4 cursor-pointer mt-0.5"}),r.jsx("label",{htmlFor:"playground-marketing-consent",className:"text-sm text-text-secondary cursor-pointer max-w-[58ch]",children:"Yes, I’d like to receive product updates and promotional emails from zopdev. You can unsubscribe at any time."})]})}),r.jsx(ge,{type:"submit",disabled:n,className:"w-full",children:n?"Sending…":"Send access link"}),r.jsxs("div",{className:"pt-4 border-t border-border text-sm text-text-secondary",children:["Ready to connect your own cloud accounts?"," ",r.jsx("a",{href:"/zopnight/app/signup",className:"text-primary-600 hover:text-primary-700 font-medium",children:"Create a free account →"})]})]})})}const Co="zopnight_playground_access";
3function jd(e){try{let s=e.split("~")[0].replace(/-/g,"+").replace(/_/g,"/");for(;s.length%4;)s+="=";const n=atob(s).split("|"),a=Number(n[n.length-1]);return Number.isFinite(a)?a:0}catch{return 0}}function Cd(e,t){try{localStorage.setItem(Co,JSON.stringify({token:e,email:t}))}catch{}}function Nd(){try{const e=localStorage.getItem(Co);return e?JSON.parse(e):null}catch{return null}}function _i(){const e=Nd();if(!e?.token)return!1;const t=jd(e.token);return t>0&&Date.now()<t*1e3}function Od(){try{localStorage.removeItem(Co)}catch{}}const Pr=new Map;function Td(e){return Pr.has(e)||Pr.set(e,Ed(e)),Pr.get(e)}function On(){const{token:e}=fl(),[t]=Se(),s=pe(),[o,n]=m.useState("verifying"),[a,i]=m.useState("");return m.useEffect(()=>{const c=e||t.get("token");if(!c){n("error"),i("This link is invalid or has expired. Request a new one below.");return}Td(c).then(({email:u,access_token:l})=>{Cd(l,u),s("/",{replace:!0})}).catch(u=>{Pr.delete(c),n("error"),i(u.message||"This link has expired or was already used.")})},[e,t,s]),o==="verifying"?r.jsx(Re,{subtitle:"Verifying your access link…",children:r.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[r.jsx(Lt,{className:"w-8 h-8"}),r.jsx("p",{className:"text-sm text-text-secondary",children:"Signing you in to the playground…"})]})}):r.jsx(Re,{subtitle:"Explore ZopNight with realistic sample data.",children:r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsx("h1",{className:"text-2xl font-semibold text-text-primary",children:"Link expired"}),r.jsx("p",{className:"text-sm text-text-secondary leading-relaxed",children:a}),r.jsx(ge,{type:"button",className:"w-full",onClick:()=>s("/",{replace:!0}),children:"Request a new access link"})]})})}class Md extends m.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,s){console.error("ErrorBoundary caught:",t,s.componentStack),ti(t,{contexts:{react:{componentStack:s.componentStack}}})}render(){return this.state.hasError?r.jsxs("div",{className:"py-16 text-center",children:[r.jsx("p",{className:"text-base font-semibold text-text-primary mb-1",children:"Something went wrong"}),r.jsx("p",{className:"text-sm text-text-muted mb-4 max-w-sm mx-auto",children:this.state.error?.message||"An unexpected error occurred."}),r.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-lg bg-primary-600 text-white hover:bg-primary-700 transition-colors",children:"Reload page"})]}):this.props.children}}const Ae={USER_SIGNED_UP:{name:"zn_user_signed_up",feature:"auth",stage:"came"},USER_LOGGED_IN:{name:"zn_user_logged_in",feature:"auth",stage:"used"},USER_LOGGED_OUT:{name:"zn_user_logged_out",feature:"auth",stage:"used"},ORG_CREATED:{name:"zn_org_created",feature:"onboarding",stage:"succeeded"},ORG_CREATE_FAILED:{name:"zn_org_create_failed",feature:"onboarding",stage:"failed"},RECOMMENDATIONS_VIEWED:{name:"zn_recommendations_viewed",feature:"recommendation",stage:"saw"},RECOMMENDATION_OPENED:{name:"zn_recommendation_opened",feature:"recommendation",stage:"saw"},RECOMMENDATION_APPLY_STARTED:{name:"zn_recommendation_apply_started",feature:"recommendation",stage:"used"},RECOMMENDATION_RESOLVED:{name:"zn_recommendation_resolved",feature:"recommendation",stage:"used"},RECOMMENDATION_SCHEDULED:{name:"zn_recommendation_scheduled",feature:"recommendation",stage:"used"},RECOMMENDATION_DISMISSED:{name:"zn_recommendation_dismissed",feature:"recommendation",stage:"declined"},REC_TITLE_TOKEN_COPIED:{name:"zn_rec_title_token_copied",feature:"recommendation",stage:"na"},REMEDIATION_WIZARD_OPENED:{name:"zn_remediation_wizard_opened",feature:"remediation",stage:"saw"},REMEDIATION_CANCELLED:{name:"zn_remediation_cancelled",feature:"remediation",stage:"declined"},ARCHITECTURE_VIEWED:{name:"zn_architecture_viewed",feature:"architecture",stage:"saw"},ARCHITECTURE_INTERACTED:{name:"zn_architecture_interacted",feature:"architecture",stage:"used"},BLAST_RADIUS_VIEWED:{name:"zn_blast_radius_viewed",feature:"architecture",stage:"used"},DESTRUCTIVE_APPLY:{name:"zn_destructive_apply",feature:"architecture",stage:"na",deferred:!0}
3,SCHEDULES_VIEWED:{name:"zn_schedules_viewed",feature:"schedule",stage:"saw"},SCHEDULE_CREATED:{name:"zn_schedule_created",feature:"schedule",stage:"used"},SCHEDULE_UPDATED:{name:"zn_schedule_updated",feature:"schedule",stage:"used"},SCHEDULE_ATTACHED:{name:"zn_schedule_attached",feature:"schedule",stage:"used"},SCHEDULE_DELETED:{name:"zn_schedule_deleted",feature:"schedule",stage:"declined"},OVERRIDE_CREATED:{name:"zn_override_created",feature:"schedule",stage:"declined"},OVERRIDE_CANCELLED:{name:"zn_override_cancelled",feature:"schedule",stage:"used"},RESOURCE_ACTION_CONFIRMED:{name:"zn_resource_action_confirmed",feature:"resource",stage:"used"},RESOURCE_BULK_ACTION:{name:"zn_resource_bulk_action",feature:"resource",stage:"used"},GLOBAL_SCHEDULE_VIEWED:{name:"zn_global_schedule_viewed",feature:"global_schedule",stage:"saw",deferred:!0},AUTOSCALER_POLICIES_VIEWED:{name:"zn_autoscaler_policies_viewed",feature:"autoscaler",stage:"saw"},AUTOSCALER_EXISTING_READ:{name:"zn_autoscaler_existing_read",feature:"autoscaler",stage:"saw"},EVENT_READINESS_VIEWED:{name:"zn_event_readiness_viewed",feature:"event_readiness",stage:"saw"},EVENT_READINESS_CALCULATED:{name:"zn_event_readiness_calculated",feature:"event_readiness",stage:"saw"},RESOURCES_VIEWED:{name:"zn_resources_viewed",feature:"discovery",stage:"saw"},CLOUD_ACCOUNT_CONNECT_STARTED:{name:"zn_cloud_account_connect_started",feature:"cloud_account",stage:"saw"},CLOUD_ACCOUNT_CONNECT_SUCCEEDED:{name:"zn_cloud_account_connect_succeeded",feature:"cloud_account",stage:"succeeded"},CLOUD_ACCOUNT_CONNECT_FAILED:{name:"zn_cloud_account_connect_failed",feature:"cloud_account",stage:"failed"},CLOUD_ACCOUNT_CONNECT_ABANDONED:{name:"zn_cloud_account_connect_abandoned",feature:"cloud_account",stage:"declined"},DASHBOARD_VIEWED:{name:"zn_dashboard_viewed",feature:"dashboard",stage:"saw"},DASHBOARD_WIDGET_CONFIGURED:{name:"zn_dashboard_widget_configured",feature:"dashboard",stage:"used"},DASHBOARD_WIDGET_ERROR:{name:"zn_dashboard_widget_error",feature:"dashboard",stage:"failed"},BUDGETS_VIEWED:{name:"zn_budgets_viewed",feature:"budget",stage:"saw"},BUDGET_ALERT_ACTIONED:{name:"zn_budget_alert_actioned",feature:"budget",stage:"used"},CHANNELS_VIEWED:{name:"zn_channels_viewed",feature:"notification",stage:"saw"},NOTIFICATION_CLICKED:{name:"zn_notification_clicked",feature:"notification",stage:"succeeded",deferred:!0},ANOMALY_VIEWED:{name:"zn_anomaly_viewed",feature:"notification",stage:"saw"},ANOMALY_ACTIONED:{name:"zn_anomaly_actioned",feature:"notification",stage:"used"},SMART_TAGS_VIEWED:{name:"zn_smart_tags_viewed",feature:"smart_tags",stage:"saw"},COST_REPORTS_VIEWED:{name:"zn_cost_reports_viewed",feature:"cost_reports",stage:"saw"},COST_SANKEY_DRILLED:{name:"zn_cost_sankey_drilled",feature:"cost_reports",stage:"used"},SAVINGS_OVERLAY_TOGGLED:{name:"zn_savings_overlay_toggled",feature:"cost_reports",stage:"used"},DEVELOPER_SETTINGS_VIEWED:{name:"zn_developer_settings_viewed",feature:"developer",stage:"saw"},MCP_TOKEN_CREATED:{name:"zn_mcp_token_created",feature:"mcp",stage:"used"},MCP_TOKEN_REVOKED:{name:"zn_mcp_token_revoked",feature:"mcp",stage:"declined"},MCP_ENABLED:{name:"zn_mcp_enabled",feature:"mcp",stage:"na"},MCP_DISABLED:{name:"zn_mcp_disabled",feature:"mcp",stage:"na"},MCP_CONNECT_CONFIG_COPIED:{name:"zn_mcp_connect_config_copied",feature:"mcp",stage:"succeeded"},MCP_SETUP_CLIENT_SELECTED:{name:"zn_mcp_setup_client_selected",feature:"mcp",stage:"na"},OAUTH_CONSENT_VIEWED:{name:"zn_oauth_consent_viewed",feature:"oauth",stage:"saw"},OAUTH_CONSENT_APPROVED:{name:"zn_oauth_consent_approved",feature:"oauth",stage:"succeeded"},OAUTH_CONSENT_DENIED:{name:"zn_oauth_consent_denied",feature:"oauth",stage:"declined"},OAUTH_CONSENT_EXPIRED:{name:"zn_oauth_consent_expired",feature:"oauth",stage:"failed"},PRODUCT_MESSAGE_SHOWN:{name:"zn_product_message_shown",feature:"product_message",stage:"saw"},PRODUCT_MESSAGE_CTA_CLICKED:{name:"zn_product_message_cta_clicked",feature:"product_message",stage:"used"},PRODUCT_MESSAGE_DISMISSED:{name:"zn_product_message_dismissed",feature:"product_message",stage:"declined"},NAV_ITEM_CLICKED:{name:"zn_nav_item_clicked",feature:"nav",stage:"used"}
3,NEW_MENU_OPENED:{name:"zn_new_menu_opened",feature:"nav",stage:"saw"},NEW_MENU_ITEM_CLICKED:{name:"zn_new_menu_item_clicked",feature:"nav",stage:"used"},COMMAND_PALETTE_OPENED:{name:"zn_command_palette_opened",feature:"nav",stage:"saw"},COMMAND_PALETTE_NAVIGATED:{name:"zn_command_palette_navigated",feature:"nav",stage:"used"},PRODUCT_PICKER_VIEWED:{name:"zn_product_picker_viewed",feature:"product",stage:"saw"},PRODUCT_SELECTED:{name:"zn_product_selected",feature:"product",stage:"used"},PRODUCT_SWITCHED:{name:"zn_product_switched",feature:"product",stage:"na"},ONBOARDING_STEP_VIEWED:{name:"zn_onboarding_step_viewed",feature:"onboarding",stage:"saw"},ONBOARDING_COMPLETED:{name:"zn_onboarding_completed",feature:"onboarding",stage:"used"},ONBOARDING_SKIPPED:{name:"zn_onboarding_skipped",feature:"onboarding",stage:"declined"},SCHEDULE_ACTION_SUCCEEDED:{name:"zn_schedule_action_succeeded",feature:"schedule",stage:"succeeded"},SCHEDULE_ACTION_FAILED:{name:"zn_schedule_action_failed",feature:"schedule",stage:"failed"},RECOMMENDATION_ACTION_SUCCEEDED:{name:"zn_recommendation_action_succeeded",feature:"recommendation",stage:"succeeded"},RECOMMENDATION_ACTION_FAILED:{name:"zn_recommendation_action_failed",feature:"recommendation",stage:"failed"},RECOMMENDATION_APPLY_UNDONE:{name:"zn_recommendation_apply_undone",feature:"recommendation",stage:"na"},REMEDIATION_ACTION_SUCCEEDED:{name:"zn_remediation_action_succeeded",feature:"remediation",stage:"succeeded"},REMEDIATION_ACTION_FAILED:{name:"zn_remediation_action_failed",feature:"remediation",stage:"failed"},MCP_TOKEN_CREATE_FAILED:{name:"zn_mcp_token_create_failed",feature:"mcp",stage:"failed"},BUDGET_ACTION_SUCCEEDED:{name:"zn_budget_action_succeeded",feature:"budget",stage:"succeeded"},BUDGET_ACTION_FAILED:{name:"zn_budget_action_failed",feature:"budget",stage:"failed"},AUTOSCALER_ACTION_SUCCEEDED:{name:"zn_autoscaler_action_succeeded",feature:"autoscaler",stage:"succeeded"},AUTOSCALER_ACTION_FAILED:{name:"zn_autoscaler_action_failed",feature:"autoscaler",stage:"failed"},COST_REPORTS_ACTION_SUCCEEDED:{name:"zn_cost_reports_action_succeeded",feature:"cost_reports",stage:"succeeded"},COST_REPORTS_ACTION_FAILED:{name:"zn_cost_reports_action_failed",feature:"cost_reports",stage:"failed"},EVENT_READINESS_ACTION_SUCCEEDED:{name:"zn_event_readiness_action_succeeded",feature:"event_readiness",stage:"succeeded"},EVENT_READINESS_ACTION_FAILED:{name:"zn_event_readiness_action_failed",feature:"event_readiness",stage:"failed"}};function as(){return typeof window<"u"}function rr(e){return No(e)?(e.nodeName||"").toLowerCase():"#document"}function Te(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rt(e){var t;return(t=(No(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function No(e){return as()?e instanceof Node||e instanceof Te(e).Node:!1}function ce(e){return as()?e instanceof Element||e instanceof Te(e).Element:!1}function Me(e){return as()?e instanceof HTMLElement||e instanceof Te(e).HTMLElement:!1}function Gr(e){return!as()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Te(e).ShadowRoot}function xr(e){const{overflow:t,overflowX:s,overflowY:o,display:n}=Fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+s)&&n!=="inline"&&n!=="contents"}function Ld(e){return/^(table|td|th)$/.test(rr(e))}function is(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Pd=/transform|translate|scale|rotate|perspective|filter/,Dd=/paint|layout|strict|content/,wt=e=>!!e&&e!=="none";let _s;function Oo(e){const t=ce(e)?Fe(e):e;return wt(t.transform)||wt(t.translate)||wt(t.scale)||wt(t.rotate)||wt(t.perspective)||!cs()&&(wt(t.backdropFilter)||wt(t.filter))||Pd.test(t.willChange||"")||Dd.test(t.contain||"")}function Id(e){let t=ct(e);for(;Me(t)&&!nt(t);){if(Oo(t))return t;if(is(t))return null;t=ct(t)}return null}function cs(){return _s==null&&(_s=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_s}function nt(e){return/^(html|body|#document)$/.test(rr(e))}function Fe(e){return Te(e).getComputedStyle(e)}function ls(e){return ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ct(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gr(e)&&e.host||rt(e);return Gr(t)?t.host:t}function Si(e){const t=ct(e);return nt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Me(t)&&xr(t)?t:Si(t)}function gt(e,t,s){var o;t===void 0&&(t=[]),s===void 0&&(s=!0);const n=Si(e),a=n===((o=e.ownerDocument)==null?void 0:o.body),i=Te(n);if(a){const c=Xs(i);
vendor: 5,823 bytes, line 3
3return t.concat(i,i.visualViewport||[],xr(n)?n:[],c&&s?gt(c):[])}else return t.concat(n,gt(n,[],s))}function Xs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Jt=Math.min,kt=Math.max,Kr=Math.round,Er=Math.floor,tt=e=>({x:e,y:e}),Fd={left:"right",right:"left",bottom:"top",top:"bottom"};function eo(e,t,s){return kt(e,Jt(t,s))}function vr(e,t){return typeof e=="function"?e(t):e}function Ot(e){return e.split("-")[0]}function br(e){return e.split("-")[1]}function ki(e){return e==="x"?"y":"x"}function To(e){return e==="y"?"height":"width"}function mt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Mo(e){return ki(mt(e))}function zd(e,t,s){s===void 0&&(s=!1);const o=br(e),n=Mo(e),a=To(n);let i=n==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Hr(i)),[i,Hr(i)]}function Ud(e){const t=Hr(e);return[to(e),t,to(t)]}function to(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Tn=["left","right"],Mn=["right","left"],Bd=["top","bottom"],$d=["bottom","top"];function Vd(e,t,s){switch(e){case"top":case"bottom":return s?t?Mn:Tn:t?Tn:Mn;case"left":case"right":return t?Bd:$d;default:return[]}}function qd(e,t,s,o){const n=br(e);let a=Vd(Ot(e),s==="start",o);return n&&(a=a.map(i=>i+"-"+n),t&&(a=a.concat(a.map(to)))),a}function Hr(e){const t=Ot(e);return Fd[t]+e.slice(t.length)}function Wd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ei(e){return typeof e!="number"?Wd(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:s,width:o,height:n}=e;return{width:o,height:n,top:s,left:t,right:t+o,bottom:s+n,x:t,y:s}}var Gd=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ro=Gd.join(","),Ri=typeof Element>"u",fr=Ri?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Qr=!Ri&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Yr=function(t,s){var o;s===void 0&&(s=!0);var n=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),a=n===""||n==="true",i=a||s&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Yr(t.parentNode));return i},Kd=function(t){var s,o=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"contenteditable");return o===""||o==="true"},Hd=function(t,s,o){if(Yr(t))return[];var n=Array.prototype.slice.apply(t.querySelectorAll(ro));return s&&fr.call(t,ro)&&n.unshift(t),n=n.filter(o),n},so=function(t,s,o){for(var n=[],a=Array.from(t);a.length;){var i=a.shift();if(!Yr(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),u=c.length?c:i.children,l=so(u,!0,o);o.flatten?n.push.apply(n,l):n.push({scopeParent:i,candidates:l})}else{var f=fr.call(i,ro);f&&o.filter(i)&&(s||!t.includes(i))&&n.push(i);var d=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!Yr(d,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(d&&g){var p=so(d===!0?i.children:d.children,!0,o);o.flatten?n.push.apply(n,p):n.push({scopeParent:i,candidates:p})}else a.unshift.apply(a,i.children)}}return n},ji=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Ci=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Kd(t))&&!ji(t)?0:t.tabIndex},Zd=function(t,s){var o=Ci(t);return o<0&&s&&!ji(t)?0:o},Qd=function(t,s){return t.tabIndex===s.tabIndex?t.documentOrder-s.documentOrder:t.tabIndex-s.tabIndex},Ni=function(t){return t.tagName==="INPUT"},Yd=function(t){return Ni(t)&&t.type==="hidden"},Jd=function(t){var s=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return s},Xd=function(t,s){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===s)return t[o]},ef=function(t){if(!t.name)return!0;var s=t.form||Qr(t),o=function(c){return s.querySelectorAll('input[type="radio"][name="'+c+'"]')},n;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")n=o(window.CSS.escape(t.name));else try{n=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var a=Xd(n,t.form);return!a||a===t},tf=function(t){return Ni(t)&&t.type==="radio"},rf=function(t){return tf(t)&&!ef(t)},sf=function(t){var s,o=t&&Qr(t),n=(s=o)===null||s===void 0?void 0:s.host,a=!1;if(o&&o!==t){var i,c,u;for(a=!!((i=n)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(n)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!a&&n;){var l,f,d;o=Qr(n),n=(l=o)===null||l===void 0?void 0:l.host,a=!!((f=n)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(n))}}return a},Ln=function(t){var s=t.getBoundingClientRect(),o=s.width,n=s.height;return o===0&&n===0},of=function(t,s){var o=s.displayCheck,n=s.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var a=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(t).visibility==="hidden")return!0;var i=fr.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(fr.call(c,"details:not([open]) *"))return!0;
3if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof n=="function"){for(var u=t;t;){var l=t.parentElement,f=Qr(t);if(l&&!l.shadowRoot&&n(l)===!0)return Ln(t);t.assignedSlot?t=t.assignedSlot:!l&&f!==t.ownerDocument?t=f.host:t=l}t=u}if(sf(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Ln(t);return!1},nf=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var s=t.parentElement;s;){if(s.tagName==="FIELDSET"&&s.disabled){for(var o=0;o<s.children.length;o++){var n=s.children.item(o);if(n.tagName==="LEGEND")return fr.call(s,"fieldset[disabled] *")?!0:!n.contains(t)}return!0}s=s.parentElement}return!1},af=function(t,s){return!(s.disabled||Yd(s)||of(s,t)||Jd(s)||nf(s))},Pn=function(t,s){return!(rf(s)||Ci(s)<0||!af(t,s))},cf=function(t){var s=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(s)||s>=0)},Oi=function(t){var s=[],o=[];return t.forEach(function(n,a){var i=!!n.scopeParent,c=i?n.scopeParent:n,u=Zd(c,i),l=i?Oi(n.candidates):c;u===0?i?s.push.apply(s,l):s.push(c):o.push({documentOrder:a,tabIndex:u,item:n,isScope:i,content:l})}),o.sort(Qd).reduce(function(n,a){return a.isScope?n.push.apply(n,a.content):n.push(a.content),n},[]).concat(s)},Ti=function(t,s){s=s||{};var o;return s.getShadowRoot?o=so([t],s.includeContainer,{filter:Pn.bind(null,s),flatten:!1,getShadowRoot:s.getShadowRoot,shadowRootFilter:cf}):o=Hd(t,s.includeContainer,Pn.bind(null,s)),Oi(o)};function lf(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function uf(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:s,version:o}=t;return s+"/"+o}).join(" "):navigator.userAgent}function Mi(){return/apple/i.test(navigator.vendor)}function df(){return lf().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function ff(){return uf().includes("jsdom/")}const Dn="data-floating-ui-focusable",mf="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function oo(e){let t=e.activeElement;for(;((s=t)==null||(s=s.shadowRoot)==null?void 0:s.activeElement)!=null;){var s;
3t=t.shadowRoot.activeElement}return t}function Xt(e,t){if(!e||!t)return!1;const s=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(s&&Gr(s)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function $t(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ss(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const s=e;return s.target!=null&&t.contains(s.target)}function gf(e){return e.matches("html,body")}function et(e){return e?.ownerDocument||document}function Li(e){return Me(e)&&e.matches(mf)}function pf(e){if(!e||ff())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function hf(e){return e?e.hasAttribute(Dn)?e:e.querySelector("["+Dn+"]")||e:null}function Dr(e,t,s){return s===void 0&&(s=!0),e.filter(n=>{var a;return n.parentId===t&&(!s||((a=n.context)==null?void 0:a.open))}).flatMap(n=>[n,...Dr(e,n.id,s)])}function yf(e){return"nativeEvent"in e}function mr(e,t){const s=["mouse","pen"];return t||s.push("",void 0),s.includes(e)}var xf=typeof document<"u",vf=function(){},Ye=xf?m.useLayoutEffect:vf;const bf={...Xa};function Rr(e){const t=m.useRef(e);return Ye(()=>{t.current=e}),t}const wf=bf.useInsertionEffect,Af=wf||(e=>e());function Xe(e){const t=m.useRef(()=>{});return Af(()=>{t.current=e}),m.useCallback(function(){for(var s=arguments.length,o=new Array(s),n=0;n<s;n++)o[n]=arguments[n];return t.current==null?void 0:t.current(...o)},[])}const Pi=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Di(e,t){const s=Ti(e,Pi()),o=s.length;if(o===0)return;const n=oo(et(e)),a=s.indexOf(n),i=a===-1?t===1?0:o-1:a+t;return s[i]}function _f(e){return Di(et(e).body,1)||e}function Sf(e){return Di(et(e).body,-1)||e}function ks(e,t){const s=t||e.currentTarget,o=e.relatedTarget;return!o||!Xt(s,o)}function kf(e){Ti(e,Pi()).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function In(e){e.querySelectorAll("[data-tabindex]").forEach(s=>{const o=s.dataset.tabindex;delete s.dataset.tabindex,o?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")})}function Fn(e,t,s){let{reference:o,floating:n}=e;const a=mt(t),i=Mo(t),c=To(i),u=Ot(t),l=a==="y",f=o.x+o.width/2-n.width/2,d=o.y+o.height/2-n.height/2,g=o[c]/2-n[c]/2;let p;switch(u){case"top":p={x:f,y:o.y-n.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-n.width,y:d};break;default:p={x:o.x,y:o.y}}switch(br(t)){case"start":p[i]-=g*(s&&l?-1:1);break;case"end":p[i]+=g*(s&&l?-1:1);break}return p}async function Ef(e,t){var s;t===void 0&&(t={});const{x:o,y:n,platform:a,rects:i,elements:c,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:p=0}=vr(t,e),y=Ei(p),v=c[g?d==="floating"?"reference":"floating":d],x=Zr(await a.getClippingRect({element:(s=await(a.isElement==null?void 0:a.isElement(v)))==null||s?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:u})),b=d==="floating"?{x:o,y:n,width:i.floating.width,height:i.floating.height}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),A=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Zr(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:w,strategy:u}):b);return{top:(x.top-E.top+y.top)/A.y,bottom:(E.bottom-x.bottom+y.bottom)/A.y,left:(x.left-E.left+y.left)/A.x,right:(E.right-x.right+y.right)/A.x}}const Rf=50,jf=async(e,t,s)=>{const{placement:o="bottom",strategy:n="absolute",middleware:a=[],platform:i}=s,c=i.detectOverflow?i:{...i,detectOverflow:Ef},u=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:f,y:d}=Fn(l,o,u),g=o,p=0;const y={};for(let h=0;h<a.length;h++){const v=a[h];if(!v)continue;const{name:x,fn:b}=v,{x:w,y:A,data:E,reset:L}=await b({x:f,y:d,initialPlacement:o,placement:g,strategy:n,middlewareData:y,rects:l,platform:c,elements:{reference:e,floating:t}});f=w??f,d=A??d,y[x]={...y[x],...E},L&&p<Rf&&(p++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(l=L.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:n}):L.rects),{x:f,y:d}=Fn(l,g,u)),h=-1)}return{x:f,y:d,placement:g,strategy:n,middlewareData:y}},Cf=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:o,placement:n,rects:a,platform:i,elements:c,middlewareData:u}=t,{element:l,padding:f=0}=vr(e,t)||{};if(l==null)return{};const d=Ei(f),g={x:s,y:o},p=Mo(n),y=To(p),h=await i.getDimensions(l),v=p==="y",x=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",A=a.reference[y]+a.reference[p]-g[p]-a.floating[y],E=g[p]-a.reference[p],L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let P=L?L[w]:0;(!P||!await(i.isElement==null?void 0:i.isElement(L)))&&(P=c.floating[w]||a.floating[y]);const j=A/2-E/2,N=P/2-h[y]/2-1,z=Jt(d[x],N),Q=Jt(d[b],N),G=z,I=P-h[y]-Q,S=P/2-h[y]/2+j,B=eo(G,S,I),D=!u.arrow&&br(n)!=null&&S!==B&&a.reference[y]/2-(S<G?z:Q)-h[y]/2<0,M=D?S<G?S-G:S-I:0;return{[p]:g[p]+M,data:{[p]:B,centerOffset:S-B-M,...D&&{alignmentOffset:M}},reset:D}}}),Nf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,o;const{placement:n,middlewareData:a,rects:i,initialPlacement:c,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:h=!0,...v}=vr(e,t);if((s=a.arrow)!=null&&s.alignmentOffset)return{};const x=Ot(n),b=mt(c),w=Ot(c)===c,A=await(u.isRTL==null?void 0:u.isRTL(l.floating)),E=g||(w||!h?[Hr(c)]:Ud(c)),L=y!=="none";!g&&L&&E.push(...qd(c,h,y,A));const P=[c,...E],j=await u.detectOverflow(t,v),N=[];let z=((o=a.flip)==null?void 0:o.overflows)||[];if(f&&N.push(j[x]),d){const S=zd(n,i,A);N.push(j[S[0]],j[S[1]])}if(z=[...z,{placement:n,overflows:N}],!N.every(S=>S<=0)){var Q,G;const S=(((Q=a.flip)==null?void 0:Q.index)||0)+1,B=P[S];if(B&&(!(d==="alignment"?b!==mt(B):!1)||z.every(C=>mt(C.placement)===b?C.overflows[0]>0:!0)))return{data:{index:S,overflows:z},reset:{placement:B}};let D=(G=z.filter(M=>M.overflows[0]<=0).sort((M,C)=>M.overflows[1]-C.overflows[1])[0])==null?void 0:G.placement;if(!D)switch(p){case"bestFit":{var I;const M=(I=z.filter(C=>{if(L){const R=mt(C.placement);return R===b||R==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(R=>R>0).reduce((R,_)=>R+_,0)]).sort((C,R)=>C[1]-R[1])[0])==null?void 0:I[0];M&&(D=M);break}case"initialPlacement":D=c;break}if(n!==D)return{reset:{placement:D}}}return{}}}},Of=new Set(["left","top"]);async function Tf(e,t){const{placement:s,platform:o,elements:n}=e,a=await(o.isRTL==null?void 0:o.isRTL(n.floating)),i=Ot(s),c=br(s),u=mt(s)==="y",l=Of.has(i)?-1:1,f=a&&u?-1:1,d=vr(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}
vendor: 5,787 bytes, line 3
3:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof y=="number"&&(p=c==="end"?y*-1:y),u?{x:p*f,y:g*l}:{x:g*l,y:p*f}}const Mf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,o;const{x:n,y:a,placement:i,middlewareData:c}=t,u=await Tf(t,e);return i===((s=c.offset)==null?void 0:s.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:n+u.x,y:a+u.y,data:{...u,placement:i}}}}},Lf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:o,placement:n,platform:a}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:x=>{let{x:b,y:w}=x;return{x:b,y:w}}},...l}=vr(e,t),f={x:s,y:o},d=await a.detectOverflow(t,l),g=mt(Ot(n)),p=ki(g);let y=f[p],h=f[g];if(i){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=y+d[x],A=y-d[b];y=eo(w,y,A)}if(c){const x=g==="y"?"top":"left",b=g==="y"?"bottom":"right",w=h+d[x],A=h-d[b];h=eo(w,h,A)}const v=u.fn({...t,[p]:y,[g]:h});return{...v,data:{x:v.x-s,y:v.y-o,enabled:{[p]:i,[g]:c}}}}}};function Ii(e){const t=Fe(e);let s=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=Me(e),a=n?e.offsetWidth:s,i=n?e.offsetHeight:o,c=Kr(s)!==a||Kr(o)!==i;return c&&(s=a,o=i),{width:s,height:o,$:c}}function Lo(e){return ce(e)?e:e.contextElement}function qt(e){const t=Lo(e);if(!Me(t))return tt(1);const s=t.getBoundingClientRect(),{width:o,height:n,$:a}=Ii(t);let i=(a?Kr(s.width):s.width)/o,c=(a?Kr(s.height):s.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Pf=tt(0);function Fi(e){const t=Te(e);return!cs()||!t.visualViewport?Pf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Df(e,t,s){return t===void 0&&(t=!1),!s||t&&s!==Te(e)?!1:t}function Tt(e,t,s,o){t===void 0&&(t=!1),s===void 0&&(s=!1);const n=e.getBoundingClientRect(),a=Lo(e);let i=tt(1);t&&(o?ce(o)&&(i=qt(o)):i=qt(e));const c=Df(a,s,o)?Fi(a):tt(0);let u=(n.left+c.x)/i.x,l=(n.top+c.y)/i.y,f=n.width/i.x,d=n.height/i.y;if(a){const g=Te(a),p=o&&ce(o)?Te(o):o;let y=g,h=Xs(y);for(;h&&o&&p!==y;){const v=qt(h),x=h.getBoundingClientRect(),b=Fe(h),w=x.left+(h.clientLeft+parseFloat(b.paddingLeft))*v.x,A=x.top+(h.clientTop+parseFloat(b.paddingTop))*v.y;u*=v.x,l*=v.y,f*=v.x,d*=v.y,u+=w,l+=A,y=Te(h),h=Xs(y)}}return Zr({width:f,height:d,x:u,y:l})}function us(e,t){const s=ls(e).scrollLeft;return t?t.left+s:Tt(rt(e)).left+s}function zi(e,t){const s=e.getBoundingClientRect(),o=s.left+t.scrollLeft-us(e,s),n=s.top+t.scrollTop;return{x:o,y:n}}function If(e){let{elements:t,rect:s,offsetParent:o,strategy:n}=e;const a=n==="fixed",i=rt(o),c=t?is(t.floating):!1;if(o===i||c&&a)return s;let u={scrollLeft:0,scrollTop:0},l=tt(1);const f=tt(0),d=Me(o);if((d||!d&&!a)&&((rr(o)!=="body"||xr(i))&&(u=ls(o)),d)){const p=Tt(o);l=qt(o),f.x=p.x+o.clientLeft,f.y=p.y+o.clientTop}const g=i&&!d&&!a?zi(i,u):tt(0);return{width:s.width*l.x,height:s.height*l.y,x:s.x*l.x-u.scrollLeft*l.x+f.x+g.x,y:s.y*l.y-u.scrollTop*l.y+f.y+g.y}}function Ff(e){return Array.from(e.getClientRects())}function zf(e){const t=rt(e),s=ls(e),o=e.ownerDocument.body,n=kt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=kt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-s.scrollLeft+us(e);const c=-s.scrollTop;return Fe(o).direction==="rtl"&&(i+=kt(t.clientWidth,o.clientWidth)-n),{width:n,height:a,x:i,y:c}}const zn=25;function Uf(e,t){const s=Te(e),o=rt(e),n=s.visualViewport;let a=o.clientWidth,i=o.clientHeight,c=0,u=0;if(n){a=n.width,i=n.height;const f=cs();(!f||f&&t==="fixed")&&(c=n.offsetLeft,u=n.offsetTop)}const l=us(o);if(l<=0){const f=o.ownerDocument,d=f.body,g=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,y=Math.abs(o.clientWidth-d.clientWidth-p);y<=zn&&(a-=y)}else l<=zn&&(a+=l);return{width:a,height:i,x:c,y:u}}function Bf(e,t){const s=Tt(e,!0,t==="fixed"),o=s.top+e.clientTop,n=s.left+e.clientLeft,a=Me(e)?qt(e):tt(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,u=n*a.x,l=o*a.y;return{width:i,height:c,x:u,y:l}}function Un(e,t,s){let o;if(t==="viewport")o=Uf(e,s);else if(t==="document")o=zf(rt(e));else if(ce(t))o=Bf(t,s);else{const n=Fi(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zr(o)}function Ui(e,t){const s=ct(e);return s===t||!ce(s)||nt(s)?!1:Fe(s).position==="fixed"||Ui(s,t)}function $f(e,t){const s=t.get(e);if(s)return s;let o=gt(e,[],!1).filter(c=>ce(c)&&rr(c)!=="body"),n=null;const a=Fe(e).position==="fixed";let i=a?ct(e):e;for(;ce(i)&&!nt(i);){const c=Fe(i),u=Oo(i);!u&&c.position==="fixed"&&(n=null),(a?!u&&!n:!u&&c.position==="static"&&!!n&&(n.position==="absolute"||n.position==="fixed")||xr(i)&&!u&&Ui(e,i))?o=o.filter(f=>f!==i):n=c,i=ct(i)}return t.set(e,o),o}function Vf(e){let{element:t,boundary:s,rootBoundary:o,strategy:n}=e;const i=[...s==="clippingAncestors"?is(t)?[]:$f(t,this._c):[].concat(s),o],c=Un(t,i[0],n);let u=c.top,l=c.right,f=c.bottom,d=c.left;for(let g=1;g<i.length;g++){const p=Un(t,i[g],n);u=kt(p.top,u),l=Jt(p.right,l),f=Jt(p.bottom,f),d=kt(p.left,d)}return{width:l-d,height:f-u,x:d,y:u}}function qf(e){const{width:t,height:s}=Ii(e);return{width:t,height:s}}function Wf(e,t,s){const o=Me(t),n=rt(t),a=s==="fixed",i=Tt(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const u=tt(0);function l(){u.x=us(n)}if(o||!o&&!a)if((rr(t)!=="body"||xr(n))&&(c=ls(t)),o){const p=Tt(t,!0,a,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else n&&l();a&&!o&&n&&l();const f=n&&!o&&!a?zi(n,c):tt(0),d=i.left+c.scrollLeft-u.x-f.x,g=i.top+c.scrollTop-u.y-f.y;return{x:d,y:g,width:i.width,height:i.height}}function Es(e){return Fe(e).position==="static"}function Bn(e,t){if(!Me(e)||Fe(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return rt(e)===s&&(s=s.ownerDocument.body),s}function Bi(e,t){const s=Te(e);
3if(is(e))return s;if(!Me(e)){let n=ct(e);for(;n&&!nt(n);){if(ce(n)&&!Es(n))return n;n=ct(n)}return s}let o=Bn(e,t);for(;o&&Ld(o)&&Es(o);)o=Bn(o,t);return o&&nt(o)&&Es(o)&&!Oo(o)?s:o||Id(e)||s}const Gf=async function(e){const t=this.getOffsetParent||Bi,s=this.getDimensions,o=await s(e.floating);return{reference:Wf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Kf(e){return Fe(e).direction==="rtl"}const Hf={convertOffsetParentRelativeRectToViewportRelativeRect:If,getDocumentElement:rt,getClippingRect:Vf,getOffsetParent:Bi,getElementRects:Gf,getClientRects:Ff,getDimensions:qf,getScale:qt,isElement:ce,isRTL:Kf};function $i(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zf(e,t){let s=null,o;const n=rt(e);function a(){var c;clearTimeout(o),(c=s)==null||c.disconnect(),s=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),a();const l=e.getBoundingClientRect(),{left:f,top:d,width:g,height:p}=l;if(c||t(),!g||!p)return;const y=Er(d),h=Er(n.clientWidth-(f+g)),v=Er(n.clientHeight-(d+p)),x=Er(f),w={rootMargin:-y+"px "+-h+"px "+-v+"px "+-x+"px",threshold:kt(0,Jt(1,u))||1};let A=!0;function E(L){const P=L[0].intersectionRatio;if(P!==u){if(!A)return i();P?i(!1,P):o=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!$i(l,e.getBoundingClientRect())&&i(),A=!1}try{s=new IntersectionObserver(E,{...w,root:n.ownerDocument})}catch{s=new IntersectionObserver(E,w)}s.observe(e)}return i(!0),a}function Vi(e,t,s,o){o===void 0&&(o={});const{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,l=Lo(e),f=n||a?[...l?gt(l):[],...t?gt(t):[]]:[];f.forEach(x=>{n&&x.addEventListener("scroll",s,{passive:!0}),a&&x.addEventListener("resize",s)});const d=l&&c?Zf(l,s):null;let g=-1,p=null;i&&(p=new ResizeObserver(x=>{let[b]=x;b&&b.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),s()}),l&&!u&&p.observe(l),t&&p.observe(t));let y,h=u?Tt(e):null;u&&v();function v(){const x=Tt(e);h&&!$i(h,x)&&s(),h=x,y=requestAnimationFrame(v)}return s(),()=>{var x;f.forEach(b=>{n&&b.removeEventListener("scroll",s),a&&b.removeEventListener("resize",s)}),d?.(),(x=p)==null||x.disconnect(),p=null,u&&cancelAnimationFrame(y)}}const Qf=Mf,Yf=Lf,Jf=Nf,$n=Cf,Xf=(e,t,s)=>{const o=new Map,n={platform:Hf,...s},a={...n.platform,_c:o};return jf(e,t,{...n,platform:a})};var em=typeof document<"u",tm=function(){},Ir=em?m.useLayoutEffect:tm;function Jr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let s,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(o=s;o--!==0;)if(!Jr(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),s=n.length,s!==Object.keys(t).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=s;o--!==0;){const a=n[o];if(!(a==="_owner"&&e.$$typeof)&&!Jr(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function qi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vn(e,t){const s=qi(e);return Math.round(t*s)/s}function Rs(e){const t=m.useRef(e);return Ir(()=>{t.current=e}),t}function rm(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:o=[],platform:n,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[f,d]=m.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=m.useState(o);Jr(g,o)||p(o);const[y,h]=m.useState(null),[v,x]=m.useState(null),b=m.useCallback(C=>{C!==L.current&&(L.current=C,h(C))},[]),w=m.useCallback(C=>{C!==P.current&&(P.current=C,x(C))},[]),A=a||y,E=i||v,L=m.useRef(null),P=m.useRef(null),j=m.useRef(f),N=u!=null,z=Rs(u),Q=Rs(n),G=Rs(l),I=m.useCallback(()=>{if(!L.current||!P.current)return;const C={placement:t,strategy:s,middleware:g};Q.current&&(C.platform=Q.current),Xf(L.current,P.current,C).then(R=>{const _={...R,isPositioned:G.current!==!1};S.current&&!Jr(j.current,_)&&(j.current=_,pr.flushSync(()=>{d(_)}))})},[g,t,s,Q,G]);Ir(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,d(C=>({...C,isPositioned:!1})))},[l]);const S=m.useRef(!1);Ir(()=>(S.current=!0,()=>{S.current=!1}),[]),Ir(()=>{if(A&&(L.current=A),E&&(P.current=E),A&&E){if(z.current)return z.current(A,E,I);I()}},[A,E,I,z,N]);const B=m.useMemo(()=>({reference:L,floating:P,setReference:b,setFloating:w}),[b,w]),D=m.useMemo(()=>({reference:A,floating:E}),[A,E]),M=m.useMemo(()=>{const C={position:s,left:0,top:0};if(!D.floating)return C;const R=Vn(D.floating,f.x),_=Vn(D.floating,f.y);return c?{...C,transform:"translate("+R+"px, "+_+"px)",...qi(D.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:R,top:_}},[s,c,D.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:I,refs:B,elements:D,floatingStyles:M}),[f,I,B,D,M])}const sm=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:o,padding:n}=typeof e=="function"?e(s):e;return o&&t(o)?o.current!=null?$n({element:o.current,padding:n}).fn(s):{}:o?$n({element:o,padding:n}).fn(s):{}}}},Wi=(e,t)=>{const s=Qf(e);return{name:s.name,fn:s.fn,options:[e,t]}},Gi=(e,t)=>{const s=Yf(e);return{name:s.name,fn:s.fn,options:[e,t]}},Ki=(e,t)=>{const s=Jf(e);return{name:s.name,fn:s.fn,options:[e,t]}},om=(e,t)=>{const s=sm(e);return{name:s.name,fn:s.fn,options:[e,t]}},nm="data-floating-ui-focusable",qn="active",Wn="selected",am={...Xa};let Gn=!1,im=0;const Kn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+im++;function cm(){const[e,t]=m.useState(()=>Gn?Kn():void 0);return Ye(()=>{e==null&&t(Kn())},[]),m.useEffect(()=>{Gn=!0},[]),e}const lm=am.useId,ds=lm||cm,um=m.forwardRef(function(t,s){const{context:{placement:o,elements:{floating:n},middlewareData:{arrow:a,shift:i}},width:c=14,height:u=7,tipRadius:l=0,strokeWidth:f=0,staticOffset:d,stroke:g,d:p,style:{transform:y,...h}={},...v}=t,x=ds(),[b,w]=m.useState(!1);if(Ye(()=>{if(!n)return;Fe(n).direction==="rtl"&&w(!0)},[n]),!n)return null;const[A,E]=o.split("-"),L=A==="top"||A==="bottom";let P=d;(L&&i!=null&&i.x||!L&&i!=null&&i.y)&&(P=null);const j=f*2,N=j/2,z=c/2*(l/-8+1),Q=u/2*l/4,G=!!p,I=P&&E==="end"?"bottom":"top";let S=P&&E==="end"?"right":"left";P&&b&&(S=E==="end"?"left":"right");const B=a?.x!=null?P||a.x:"",D=a?.y!=null?P||a.y:"",M=p||"M0,0"+(" H"
3+c)+(" L"+(c-z)+","+(u-Q))+(" Q"+c/2+","+u+" "+z+","+(u-Q))+" Z",C={top:G?"rotate(180deg)":"",left:G?"rotate(90deg)":"rotate(-90deg)",bottom:G?"":"rotate(180deg)",right:G?"rotate(-90deg)":"rotate(90deg)"}[A];return r.jsxs("svg",{...v,"aria-hidden":!0,ref:s,width:G?c:c+j,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[S]:B,[I]:D,[A]:L||G?"100%":"calc(100% - "+j/2+"px)",transform:[C,y].filter(R=>!!R).join(" "),...h},children:[j>0&&r.jsx("path",{clipPath:"url(#"+x+")",fill:"none",stroke:g,strokeWidth:j+(p?0:1),d:M}),r.jsx("path",{stroke:j&&!p?v.fill:"none",d:M}),r.jsx("clipPath",{id:x,children:r.jsx("rect",{x:-N,y:N*(G?-1:1),width:c+j,height:c})})]})});function dm(){const e=new Map;return{emit(t,s){var o;(o=e.get(t))==null||o.forEach(n=>n(s))},on(t,s){e.has(t)||e.set(t,new Set),e.get(t).add(s)},off(t,s){var o;(o=e.get(t))==null||o.delete(s)}}}const fm=m.createContext(null),mm=m.createContext(null),Po=()=>{var e;return((e=m.useContext(fm))==null?void 0:e.id)||null},Do=()=>m.useContext(mm);function wr(e){return"data-floating-ui-"+e}function Ne(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Hn=wr("safe-polygon");function js(e,t,s){if(s&&!mr(s))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function Cs(e){return typeof e=="function"?e():e}function gm(e,t){t===void 0&&(t={});const{open:s,onOpenChange:o,dataRef:n,events:a,elements:i}=e,{enabled:c=!0,delay:u=0,handleClose:l=null,mouseOnly:f=!1,restMs:d=0,move:g=!0}=t,p=Do(),y=Po(),h=Rr(l),v=Rr(u),x=Rr(s),b=Rr(d),w=m.useRef(),A=m.useRef(-1),E=m.useRef(),L=m.useRef(-1),P=m.useRef(!0),j=m.useRef(!1),N=m.useRef(()=>{}),z=m.useRef(!1),Q=Xe(()=>{var M;const C=(M=n.current.openEvent)==null?void 0:M.type;return C?.includes("mouse")&&C!=="mousedown"});m.useEffect(()=>{if(!c)return;function M(C){let{open:R}=C;R||(Ne(A),Ne(L),P.current=!0,z.current=!1)}return a.on("openchange",M),()=>{a.off("openchange",M)}},[c,a]),m.useEffect(()=>{if(!c||!h.current||!s)return;function M(R){Q()&&o(!1,R,"hover")}const C=et(i.floating).documentElement;return C.addEventListener("mouseleave",M),()=>{C.removeEventListener("mouseleave",M)}},[i.floating,s,o,c,h,Q]);const G=m.useCallback(function(M,C,R){C===void 0&&(C=!0),R===void 0&&(R="hover");const _=js(v.current,"close",w.current);_&&!E.current?(Ne(A),A.current=window.setTimeout(()=>o(!1,M,R),_)):C&&(Ne(A),o(!1,M,R))},[v,o]),I=Xe(()=>{N.current(),E.current=void 0}),S=Xe(()=>{if(j.current){const M=et(i.floating).body;M.style.pointerEvents="",M.removeAttribute(Hn),j.current=!1}}),B=Xe(()=>n.current.openEvent?["click","mousedown"].includes(n.current.openEvent.type):!1);m.useEffect(()=>{if(!c)return;function M(V){if(Ne(A),P.current=!1,f&&!mr(w.current)||Cs(b.current)>0&&!js(v.current,"open"))return;const q=js(v.current,"open",w.current);q?A.current=window.setTimeout(()=>{x.current||o(!0,V,"hover")},q):s||o(!0,V,"hover")}function C(V){if(B()){S();return}N.current();const q=et(i.floating);if(Ne(L),z.current=!1,h.current&&n.current.floatingContext){s||Ne(A),E.current=h.current({...n.current.floatingContext,tree:p,x:V.clientX,y:V.clientY,onClose(){S(),I(),B()||G(V,!0,"safe-polygon")}});const Z=E.current;q.addEventListener("mousemove",Z),N.current=()=>{q.removeEventListener("mousemove",Z)};return}(w.current!=="touch"||!Xt(i.floating,V.relatedTarget))&&G(V)}function R(V){B()||n.current.floatingContext&&(h.current==null||h.current({...n.current.floatingContext,tree:p,x:V.clientX,y:V.clientY,onClose(){S(),I(),B()||G(V)}})(V))}function _(){Ne(A)}function O(V){B()||G(V,!1)}if(ce(i.domReference)){const V=i.domReference,q=i.floating;return s&&V.addEventListener("mouseleave",R),g&&V.addEventListener("mousemove",M,{once:!0}),V.addEventListener("mouseenter",M),V.addEventListener("mouseleave",C),q&&(q.addEventListener("mouseleave",R),q.addEventListener("mouseenter",_),q.addEventListener("mouseleave",O)),()=>{s&&V.removeEventListener("mouseleave",R),g&&V.removeEventListener("mousemove",M),V.removeEventListener("mouseenter",M),V.removeEventListener("mouseleave",C),q&&(q.removeEventListener("mouseleave",R),q.removeEventListener("mouseenter",_),q.removeEventListener("mouseleave",O))}}},[i,c,e,f,g,G,I,S,o,s,x,p,v,h,n,B,b]),Ye(()=>{var M;if(c&&s&&(M=h.current)!=null&&(M=M.__options)!=null&&M.blockPointerEvents&&Q()){j.current=!0;const R=i.floating;if(ce(i.domReference)&&R){var C;const _=et(i.floating).body;_.setAttribute(Hn,"");const O=i.domReference,V=p==null||(C=p.nodesRef.current.find(q=>q.id===y))==null||(C=C.context)==null?void 0:C.elements.floating;return V&&(V.style.pointerEvents=""),_.style.pointerEvents="none",O.style.pointerEvents="auto",R.style.pointerEvents="auto",()=>{_.style.pointerEvents="",O.style.pointerEvents="",R.style.pointerEvents=""}}}},[c,s,y,i,p,h,Q]),Ye(()=>{s||(w.current=void 0,z.current=!1,I(),S())},[s,I,S]),m.useEffect(()=>()=>{I(),Ne(A),Ne(L),S()},[c,i.domReference,I,S]);const D=m.useMemo(()=>{function M(C){w.current=C.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(C){const{nativeEvent:R}=C;function _(){!P.current&&!x.current&&o(!0,R,"hover")}f&&!mr(w.current)||s||Cs(b.current)===0||z.current&&C.movementX**2+C.movementY**2<2||(Ne(L),w.current==="touch"?_():(z.current=!0,L.current=window.setTimeout(_,Cs(b.current))))}}},[f,o,s,x,b]);return m.useMemo(()=>c?{reference:D}:{},[c,D])}function Ns(e,t){if(!e||!t)return!1;const s=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;
3if(s&&Gr(s)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function pm(e){return"composedPath"in e?e.composedPath()[0]:e.target}const hm={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Zn=m.forwardRef(function(t,s){const[o,n]=m.useState();Ye(()=>{Mi()&&n("button")},[]);const a={ref:s,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[wr("focus-guard")]:"",style:hm};return r.jsx("span",{...t,...a})}),ym={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Hi=m.createContext(null),Qn=wr("portal");function xm(e){e===void 0&&(e={});const{id:t,root:s}=e,o=ds(),n=vm(),[a,i]=m.useState(null),c=m.useRef(null);return Ye(()=>()=>{a?.remove(),queueMicrotask(()=>{c.current=null})},[a]),Ye(()=>{if(!o||c.current)return;const u=t?document.getElementById(t):null;if(!u)return;const l=document.createElement("div");l.id=o,l.setAttribute(Qn,""),u.appendChild(l),c.current=l,i(l)},[t,o]),Ye(()=>{if(s===null||!o||c.current)return;let u=s||n?.portalNode;u&&!No(u)&&(u=u.current),u=u||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,u.appendChild(l));const f=document.createElement("div");f.id=o,f.setAttribute(Qn,""),u=l||u,u.appendChild(f),c.current=f,i(f)},[t,s,o,n]),a}function Zi(e){const{children:t,id:s,root:o,preserveTabOrder:n=!0}=e,a=xm({id:s,root:o}),[i,c]=m.useState(null),u=m.useRef(null),l=m.useRef(null),f=m.useRef(null),d=m.useRef(null),g=i?.modal,p=i?.open,y=!!i&&!i.modal&&i.open&&n&&!!(o||a);return m.useEffect(()=>{if(!a||!n||g)return;function h(v){a&&ks(v)&&(v.type==="focusin"?In:kf)(a)}return a.addEventListener("focusin",h,!0),a.addEventListener("focusout",h,!0),()=>{a.removeEventListener("focusin",h,!0),a.removeEventListener("focusout",h,!0)}},[a,n,g]),m.useEffect(()=>{a&&(p||In(a))},[p,a]),r.jsxs(Hi.Provider,{value:m.useMemo(()=>({preserveTabOrder:n,beforeOutsideRef:u,afterOutsideRef:l,beforeInsideRef:f,afterInsideRef:d,portalNode:a,setFocusManagerState:c}),[n,a]),children:[y&&a&&r.jsx(Zn,{"data-type":"outside",ref:u,onFocus:h=>{if(ks(h,a)){var v;(v=f.current)==null||v.focus()}else{const x=i?i.domReference:null,b=Sf(x);b?.focus()}}}),y&&a&&r.jsx("span",{"aria-owns":a.id,style:ym}),a&&pr.createPortal(t,a),y&&a&&r.jsx(Zn,{"data-type":"outside",ref:l,onFocus:h=>{if(ks(h,a)){var v;(v=d.current)==null||v.focus()}else{const x=i?i.domReference:null,b=_f(x);b?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,h.nativeEvent,"focus-out")}}})]})}const vm=()=>m.useContext(Hi);function Yn(e){return Me(e.target)&&e.target.tagName==="BUTTON"}function bm(e){return Me(e.target)&&e.target.tagName==="A"}function Jn(e){return Li(e)}function p2(e,t){t===void 0&&(t={});const{open:s,onOpenChange:o,dataRef:n,elements:{domReference:a}}=e,{enabled:i=!0,event:c="click",toggle:u=!0,ignoreMouse:l=!1,keyboardHandlers:f=!0,stickIfOpen:d=!0}=t,g=m.useRef(),p=m.useRef(!1),y=m.useMemo(()=>({onPointerDown(h){g.current=h.pointerType},onMouseDown(h){const v=g.current;h.button===0&&c!=="click"&&(mr(v,!0)&&l||(s&&u&&(!(n.current.openEvent&&d)||n.current.openEvent.type==="mousedown")?o(!1,h.nativeEvent,"click"):(h.preventDefault(),o(!0,h.nativeEvent,"click"))))},onClick(h){const v=g.current;if(c==="mousedown"&&g.current){g.current=void 0;return}mr(v,!0)&&l||(s&&u&&(!(n.current.openEvent&&d)||n.current.openEvent.type==="click")?o(!1,h.nativeEvent,"click"):o(!0,h.nativeEvent,"click"))},onKeyDown(h){g.current=void 0,!(h.defaultPrevented||!f||Yn(h))&&(h.key===" "&&!Jn(a)&&(h.preventDefault(),p.current=!0),!bm(h)&&h.key==="Enter"&&o(!(s&&u),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!f||Yn(h)||Jn(a)||h.key===" "&&p.current&&(p.current=!1,o(!(s&&u),h.nativeEvent,"click"))}}),[n,a,c,l,f,o,s,d,u]);return m.useMemo(()=>i?{reference:y}:{},[i,y])}const wm={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Am={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Xn=e=>{var t,s;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(s=e?.outsidePress)!=null?s:!0}};function _m(e,t){t===void 0&&(t={});const{open:s,onOpenChange:o,elements:n,dataRef:a}=e,{enabled:i=!0,escapeKey:c=!0,outsidePress:u=!0,outsidePressEvent:l="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:g=!1,bubbles:p,capture:y}=t,h=Do(),v=Xe(typeof u=="function"?u:()=>!1),x=typeof u=="function"?v:u,b=m.useRef(!1),{escapeKey:w,outsidePress:A}=Xn(p),{escapeKey:E,outsidePress:L}=Xn(y),P=m.useRef(!1),j=Xe(S=>{var B;if(!s||!i||!c||S.key!=="Escape"||P.current)return;const D=(B=a.current.floatingContext)==null?void 0:B.nodeId,M=h?Dr(h.nodesRef.current,D):[];if(!w&&(S.stopPropagation(),M.length>0)){let C=!0;
3if(M.forEach(R=>{var _;if((_=R.context)!=null&&_.open&&!R.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}o(!1,yf(S)?S.nativeEvent:S,"escape-key")}),N=Xe(S=>{var B;const D=()=>{var M;j(S),(M=$t(S))==null||M.removeEventListener("keydown",D)};(B=$t(S))==null||B.addEventListener("keydown",D)}),z=Xe(S=>{var B;const D=a.current.insideReactTree;a.current.insideReactTree=!1;const M=b.current;if(b.current=!1,l==="click"&&M||D||typeof x=="function"&&!x(S))return;const C=$t(S),R="["+wr("inert")+"]",_=et(n.floating).querySelectorAll(R);let O=ce(C)?C:null;for(;O&&!nt(O);){const Z=ct(O);if(nt(Z)||!ce(Z))break;O=Z}if(_.length&&ce(C)&&!gf(C)&&!Xt(C,n.floating)&&Array.from(_).every(Z=>!Xt(O,Z)))return;if(Me(C)&&I){const Z=nt(C),T=Fe(C),J=/auto|scroll/,K=Z||J.test(T.overflowX),ne=Z||J.test(T.overflowY),he=K&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,Ce=ne&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,Ee=T.direction==="rtl",hs=Ce&&(Ee?S.offsetX<=C.offsetWidth-C.clientWidth:S.offsetX>C.clientWidth),or=he&&S.offsetY>C.clientHeight;if(hs||or)return}const V=(B=a.current.floatingContext)==null?void 0:B.nodeId,q=h&&Dr(h.nodesRef.current,V).some(Z=>{var T;return Ss(S,(T=Z.context)==null?void 0:T.elements.floating)});if(Ss(S,n.floating)||Ss(S,n.domReference)||q)return;const Y=h?Dr(h.nodesRef.current,V):[];if(Y.length>0){let Z=!0;if(Y.forEach(T=>{var J;if((J=T.context)!=null&&J.open&&!T.context.dataRef.current.__outsidePressBubbles){Z=!1;return}}),!Z)return}o(!1,S,"outside-press")}),Q=Xe(S=>{var B;const D=()=>{var M;z(S),(M=$t(S))==null||M.removeEventListener(l,D)};(B=$t(S))==null||B.addEventListener(l,D)});m.useEffect(()=>{if(!s||!i)return;a.current.__escapeKeyBubbles=w,a.current.__outsidePressBubbles=A;let S=-1;function B(_){o(!1,_,"ancestor-scroll")}function D(){window.clearTimeout(S),P.current=!0}function M(){S=window.setTimeout(()=>{P.current=!1},cs()?5:0)}const C=et(n.floating);c&&(C.addEventListener("keydown",E?N:j,E),C.addEventListener("compositionstart",D),C.addEventListener("compositionend",M)),x&&C.addEventListener(l,L?Q:z,L);let R=[];return g&&(ce(n.domReference)&&(R=gt(n.domReference)),ce(n.floating)&&(R=R.concat(gt(n.floating))),!ce(n.reference)&&n.reference&&n.reference.contextElement&&(R=R.concat(gt(n.reference.contextElement)))),R=R.filter(_=>{var O;return _!==((O=C.defaultView)==null?void 0:O.visualViewport)}),R.forEach(_=>{_.addEventListener("scroll",B,{passive:!0})}),()=>{c&&(C.removeEventListener("keydown",E?N:j,E),C.removeEventListener("compositionstart",D),C.removeEventListener("compositionend",M)),x&&C.removeEventListener(l,L?Q:z,L),R.forEach(_=>{_.removeEventListener("scroll",B)}),window.clearTimeout(S)}},[a,n,c,x,l,s,o,g,i,w,A,j,E,N,z,L,Q]),m.useEffect(()=>{a.current.insideReactTree=!1},[a,x,l]);const G=m.useMemo(()=>({onKeyDown:j,...f&&{[wm[d]]:S=>{o(!1,S.nativeEvent,"reference-press")},...d!=="click"&&{onClick(S){o(!1,S.nativeEvent,"reference-press")}}}}),[j,o,f,d]),I=m.useMemo(()=>{function S(B){B.button===0&&(b.current=!0)}return{onKeyDown:j,onMouseDown:S,onMouseUp:S,[Am[l]]:()=>{a.current.insideReactTree=!0}}},[j,l,a]);return m.useMemo(()=>i?{reference:G,floating:I}:{},[i,G,I])}function Sm(e){const{open:t=!1,onOpenChange:s,elements:o}=e,n=ds(),a=m.useRef({}),[i]=m.useState(()=>dm()),c=Po()!=null,[u,l]=m.useState(o.reference),f=Xe((p,y,h)=>{a.current.openEvent=p?y:void 0,i.emit("openchange",{open:p,event:y,reason:h,nested:c}),s?.(p,y,h)}),d=m.useMemo(()=>({setPositionReference:l}),[]),g=m.useMemo(()=>({reference:u||o.reference||null,floating:o.floating||null,domReference:o.reference}),[u,o.reference,o.floating]);return m.useMemo(()=>({dataRef:a,open:t,onOpenChange:f,elements:g,events:i,floatingId:n,refs:d}),[t,f,g,i,n,d])}function Qi(e){e===void 0&&(e={});const{nodeId:t}=e,s=Sm({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||s,n=o.elements,[a,i]=m.useState(null),[c,u]=m.useState(null),f=n?.domReference||a,d=m.useRef(null),g=Do();Ye(()=>{f&&(d.current=f)},[f]);const p=rm({...e,elements:{...n,...c&&{reference:c}}}),y=m.useCallback(w=>{const A=ce(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;u(A),p.refs.setReference(A)},[p.refs]),h=m.useCallback(w=>{(ce(w)||w===null)&&(d.current=w,i(w)),(ce(p.refs.reference.current)||p.refs.reference.current===null||w!==null&&!ce(w))&&p.refs.setReference(w)},[p.refs]),v=m.useMemo(()=>({...p.refs,setReference:h,setPositionReference:y,domReference:d}),[p.refs,h,y]),x=m.useMemo(()=>({...p.elements,domReference:f}),[p.elements,f]),b=m.useMemo(()=>({...p,...o,refs:v,elements:x,nodeId:t}),[p,v,x,t,o]);return Ye(()=>{o.dataRef.current.floatingContext=b;const w=g?.nodesRef.current.find(A=>A.id===t);w&&(w.context=b)}),m.useMemo(()=>({...p,context:b,refs:v,elements:x}),[p,v,x,b])}function Os(){return df()&&Mi()}function km(e,t){t===void 0&&(t={});const{open:s,onOpenChange:o,events:n,dataRef:a,elements:i}=e,{enabled:c=!0,visibleOnly:u=!0}=t,l=m.useRef(!1),f=m.useRef(-1),d=m.useRef(!0);m.useEffect(()=>{if(!c)return;const p=Te(i.domReference);function y(){!s&&Me(i.domReference)&&i.domReference===oo(et(i.domReference))&&(l.current=!0)}function h(){d.current=!0}function v(){d.current=!1}return p.addEventListener("blur",y),Os()&&(p.addEventListener("keydown",h,!0),p.addEventListener("pointerdown",v,!0)),()=>{p.removeEventListener("blur",y),Os()&&(p.removeEventListener("keydown",h,!0),p.removeEventListener("pointerdown",v,!0))}},[i.domReference,s,c]),m.useEffect(()=>{if(!c)return;function p(y){let{reason:h}=y;(h==="reference-press"||h==="escape-key")&&(l.current=!0)}return n.on("openchange",p),()=>{n.off("openchange",p)}},[n,c]),m.useEffect(()=>()=>{Ne(f)},[]);const g=m.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(p){if(l.current)return;const y=$t(p.nativeEvent);
3if(u&&ce(y)){if(Os()&&!p.relatedTarget){if(!d.current&&!Li(y))return}else if(!pf(y))return}o(!0,p.nativeEvent,"focus")},onBlur(p){l.current=!1;const y=p.relatedTarget,h=p.nativeEvent,v=ce(y)&&y.hasAttribute(wr("focus-guard"))&&y.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var x;const b=oo(i.domReference?i.domReference.ownerDocument:document);!y&&b===i.domReference||Xt((x=a.current.floatingContext)==null?void 0:x.refs.floating.current,b)||Xt(i.domReference,b)||v||o(!1,h,"focus")})}}),[a,i.domReference,o,u]);return m.useMemo(()=>c?{reference:g}:{},[c,g])}function Ts(e,t,s){const o=new Map,n=s==="item";let a=e;if(n&&e){const{[qn]:i,[Wn]:c,...u}=e;a=u}return{...s==="floating"&&{tabIndex:-1,[nm]:""},...a,...t.map(i=>{const c=i?i[s]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i,c)=>(c&&Object.entries(c).forEach(u=>{let[l,f]=u;if(!(n&&[qn,Wn].includes(l)))if(l.indexOf("on")===0){if(o.has(l)||o.set(l,[]),typeof f=="function"){var d;(d=o.get(l))==null||d.push(f),i[l]=function(){for(var g,p=arguments.length,y=new Array(p),h=0;h<p;h++)y[h]=arguments[h];return(g=o.get(l))==null?void 0:g.map(v=>v(...y)).find(v=>v!==void 0)}}}else i[l]=f}),i),{})}}function Em(e){e===void 0&&(e=[]);const t=e.map(c=>c?.reference),s=e.map(c=>c?.floating),o=e.map(c=>c?.item),n=m.useCallback(c=>Ts(c,e,"reference"),t),a=m.useCallback(c=>Ts(c,e,"floating"),s),i=m.useCallback(c=>Ts(c,e,"item"),o);return m.useMemo(()=>({getReferenceProps:n,getFloatingProps:a,getItemProps:i}),[n,a,i])}const Rm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function h2(e,t){var s,o;t===void 0&&(t={});const{open:n,elements:a,floatingId:i}=e,{enabled:c=!0,role:u="dialog"}=t,l=ds(),f=((s=a.domReference)==null?void 0:s.id)||l,d=m.useMemo(()=>{var b;return((b=hf(a.floating))==null?void 0:b.id)||i},[a.floating,i]),g=(o=Rm.get(u))!=null?o:u,y=Po()!=null,h=m.useMemo(()=>g==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:n?d:void 0}:{"aria-expanded":n?"true":"false","aria-haspopup":g==="alertdialog"?"dialog":g,"aria-controls":n?d:void 0,...g==="listbox"&&{role:"combobox"},...g==="menu"&&{id:f},...g==="menu"&&y&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[g,d,y,n,f,u]),v=m.useMemo(()=>{const b={id:d,...g&&{role:g}};return g==="tooltip"||u==="label"?b:{...b,...g==="menu"&&{"aria-labelledby":f}}},[g,d,f,u]),x=m.useCallback(b=>{let{active:w,selected:A}=b;const E={role:"option",...w&&{id:d+"-fui-option"}};switch(u){case"select":case"combobox":return{...E,"aria-selected":A}}return{}},[d,u]);return m.useMemo(()=>c?{reference:h,floating:v,item:x}:{},[c,h,v,x])}function Yi(e,t,s){return s===void 0&&(s=!0),e.filter(n=>{var a;return n.parentId===t&&(!s||((a=n.context)==null?void 0:a.open))}).flatMap(n=>[n,...Yi(e,n.id,s)])}function ea(e,t){const[s,o]=e;let n=!1;const a=t.length;for(let i=0,c=a-1;i<a;c=i++){const[u,l]=t[i]||[0,0],[f,d]=t[c]||[0,0];l>=o!=d>=o&&s<=(f-u)*(o-l)/(d-l)+u&&(n=!n)}return n}function jm(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Cm(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:s=!1,requireIntent:o=!0}=e,n={current:-1};let a=!1,i=null,c=null,u=typeof performance<"u"?performance.now():0;function l(d,g){const p=performance.now(),y=p-u;if(i===null||c===null||y===0)return i=d,c=g,u=p,null;const h=d-i,v=g-c,b=Math.sqrt(h*h+v*v)/y;return i=d,c=g,u=p,b}const f=d=>{let{x:g,y:p,placement:y,elements:h,onClose:v,nodeId:x,tree:b}=d;return function(A){function E(){Ne(n),v()}if(Ne(n),!h.domReference||!h.floating||y==null||g==null||p==null)return;const{clientX:L,clientY:P}=A,j=[L,P],N=pm(A),z=A.type==="mouseleave",Q=Ns(h.floating,N),G=Ns(h.domReference,N),I=h.domReference.getBoundingClientRect(),S=h.floating.getBoundingClientRect(),B=y.split("-")[0],D=g>S.right-S.width/2,M=p>S.bottom-S.height/2,C=jm(j,I),R=S.width>I.width,_=S.height>I.height,O=(R?I:S).left,V=(R?I:S).right,q=(_?I:S).top,Y=(_?I:S).bottom;if(Q&&(a=!0,!z))return;if(G&&(a=!1),G&&!z){a=!0;return}if(z&&ce(A.relatedTarget)&&Ns(h.floating,A.relatedTarget)||b&&Yi(b.nodesRef.current,x).length)return;if(B==="top"&&p>=I.bottom-1||B==="bottom"&&p<=I.top+1||B==="left"&&g>=I.right-1||B==="right"&&g<=I.left+1)return E();let Z=[];switch(B){case"top":Z=[[O,I.top+1],[O,S.bottom-1],[V,S.bottom-1],[V,I.top+1]];break;case"bottom":Z=[[O,S.top+1],[O,I.bottom-1],[V,I.bottom-1],[V,S.top+1]];break;case"left":Z=[[S.right-1,Y],[S.right-1,q],[I.left+1,q],[I.left+1,Y]];break;case"right":Z=[[I.right-1,Y],[I.right-1,q],[S.left+1,q],[S.left+1,Y]];break}function T(J){let[K,ne]=J;switch(B){case"top":{const he=[R?K+t/2:D?K+t*4:K-t*4,ne+t+1],Ce=[R?K-t/2:D?K+t*4:K-t*4,ne+t+1],Ee=[[S.left,D||R?S.bottom-t:S.top],[S.right,D?R?S.bottom-t:S.top:S.bottom-t]];return[he,Ce,...Ee]}case"bottom":{const he=[R?K+t/2:D?K+t*4:K-t*4,ne-t],Ce=[R?K-t/2:D?K+t*4:K-t*4,ne-t],Ee=[[S.left,D||R?S.top+t:S.bottom],[S.right,D?R?S.top+t:S.bottom:S.top+t]];return[he,Ce,...Ee]}case"left":{const he=[K+t+1,_?ne+t/2:M?ne+t*4:ne-t*4],Ce=[K+t+1,_?ne-t/2:M?ne+t*4:ne-t*4];return[...[[M||_?S.right-t:S.left,S.top],[M?_?S.right-t:S.left:S.right-t,S.bottom]],he,Ce]}case"right":{const he=[K-t,_?ne+t/2:M?ne+t*4:ne-t*4],Ce=[K-t,_?ne-t/2:M?ne+t*4:ne-t*4],Ee=[[M||_?S.left+t:S.right,S.top],[M?_?S.left+t:S.right:S.left+t,S.bottom]];return[he,Ce,...Ee]}}}if(!ea([L,P],Z)){if(a&&!C)return E();if(!z&&o){const J=l(A.clientX,A.clientY);if(J!==null&&J<.1)return E()}ea([L,P],T([g,p]))?!a&&o&&(n.current=window.setTimeout(E,40)):E()}}};return f.__options={blockPointerEvents:s},f}const no="zopdev_switcher_hint",Ji="v1";function Nm(e){if(!e||typeof e!="string")return!1;try{const t=localStorage.getItem(no);if(t==null)return!0;const s=JSON.parse(t);if(!s||typeof s!="object"||Array.isArray(s))return!1;const o=s[e];return o==null?!0:typeof o!="string"?!1:o!==Ji}catch{return!1}}
3function Om(e){if(!e||typeof e!="string")return!1;let t={};try{const s=localStorage.getItem(no),o=s?JSON.parse(s):null;o&&typeof o=="object"&&!Array.isArray(o)&&(t=o)}catch{}try{return localStorage.setItem(no,JSON.stringify({...t,[e]:Ji})),!0}catch{return!1}}const Tm=600,Mm="(min-width: 1024px)",Lm="(prefers-reduced-motion: reduce)",Pm=/(^|\/)setup(\/|$)/,Dm={x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0};function Xi(e){try{return typeof window>"u"||typeof window.matchMedia!="function"?null:window.matchMedia(e).matches===!0}catch{return null}}function Im(){return Xi(Mm)===!0}function Fm(){return Xi(Lm)===!0}function zm(){try{return Pm.test(window.location?.pathname??"")}catch{return!0}}function Um({anchorRef:e,panelRef:t,switcherRef:s,menuOpen:o=!1,userInteracted:n=!1,onRequestOpen:a,onDismissed:i,onPulseChange:c}){const u=W(I=>I.isAuthenticated),l=W(I=>I.tenants),f=W(I=>I.user?.email),d=!!u&&Array.isArray(l)&&l.some(I=>I?.id),[g]=m.useState(()=>d&&!ve()&&!zm()&&Im()&&Nm(f)),[p]=m.useState(()=>Fm()),[y,h]=m.useState(!1),[v,x]=m.useState(!1),b=m.useRef(null),w=m.useRef(null),A=m.useRef({onRequestOpen:a,onDismissed:i});m.useEffect(()=>{A.current={onRequestOpen:a,onDismissed:i}},[a,i]);const E=m.useCallback(()=>{Om(f),x(!0),h(!1),A.current.onDismissed?.()},[f]),L=m.useMemo(()=>({getBoundingClientRect(){const I=[e?.current,t?.current].map(C=>C?.getBoundingClientRect?.()).filter(Boolean);if(I.length===0)return Dm;const S=Math.min(...I.map(C=>C.left)),B=Math.max(...I.map(C=>C.right)),D=Math.min(...I.map(C=>C.top)),M=Math.max(...I.map(C=>C.bottom));return{x:S,y:D,width:B-S,height:M-D,top:D,right:B,bottom:M,left:S}}}),[e,t]),{refs:P,floatingStyles:j,context:N,update:z}=Qi({open:y,placement:"right",whileElementsMounted:Vi,middleware:[Wi(14),Ki({fallbackPlacements:["right-start","bottom-start"]}),Gi({padding:12}),om({element:w})]}),{setReference:Q,setPositionReference:G}=P;return m.useEffect(()=>{g&&(Q(e?.current??null),G(L))},[g,e,L,Q,G]),m.useEffect(()=>{y&&z()},[y,o,z]),m.useEffect(()=>{if(!g||v)return;const I=setTimeout(()=>{A.current.onRequestOpen?.(),h(!0)},Tm);return()=>clearTimeout(I)},[g,v]),m.useEffect(()=>{!g||v||!n||E()},[g,v,n,E]),m.useEffect(()=>{if(c)return c(g&&y&&!v&&!p),()=>c(!1)},[c,g,y,v,p]),m.useEffect(()=>{if(!y||v)return;function I(B){B.key==="Escape"&&E()}function S(B){b.current?.contains(B.target)||s?.current?.contains(B.target)||E()}return document.addEventListener("keydown",I),document.addEventListener("mousedown",S),document.addEventListener("touchstart",S),()=>{document.removeEventListener("keydown",I),document.removeEventListener("mousedown",S),document.removeEventListener("touchstart",S)}},[y,v,E,s]),!g||v||!y?null:r.jsx(Zi,{children:r.jsx("div",{ref:P.setFloating,style:j,className:"z-[60] w-max max-w-[17rem]",children:r.jsxs("div",{ref:b,role:"status","aria-live":"polite","data-switcher-hint":"true","data-testid":"switcher-hint",className:`relative rounded-xl border border-border-strong bg-surface-elevated px-3.5 py-3 shadow-xl ${p?"zn-switcher-hint-fade":"zn-switcher-hint-enter"}`,children:[r.jsx(um,{ref:w,context:N,width:12,height:6,tipRadius:1,fill:"var(--color-surface-elevated)",stroke:"var(--color-border-strong)",strokeWidth:1}),r.jsx("p",{className:"text-[0.8125rem] leading-snug text-text-primary",children:"Switch products here — zopday, zopcloud and zopnight all live in one account."}),r.jsx("div",{className:"mt-2.5 flex justify-end",children:r.jsx("button",{type:"button",onClick:E,className:"rounded-md px-2.5 py-1 text-xs font-medium text-text-secondary transition-colors duration-fast hover:bg-surface-secondary hover:text-text-primary focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-600",children:"Got it"})})]})})})}function Bm({className:e,...t}){return r.jsxs("svg",{viewBox:"0 0 32 32",className:e,"aria-hidden":"true",...t,children:[r.jsx("rect",{x:"0",y:"0",width:"32",height:"32",className:"fill-[#2A4494] dark:fill-[#4A66D4]"}),r.jsx("circle",{cx:"16",cy:"16",r:"8",fill:"#FFFFFF"})]})}function $m({className:e,...t}){return r.jsxs("svg",{viewBox:"0 0 32 32",className:e,"aria-hidden":"true",...t,children:[r.jsx("rect",{x:"0",y:"0",width:"32",height:"32",fill:"#F58549"}
3),r.jsx("circle",{cx:"16",cy:"16",r:"8",fill:"#FFFFFF"})]})}function Vm({className:e,...t}){return r.jsxs("svg",{viewBox:"0 0 32 32",className:e,"aria-hidden":"true",...t,children:[r.jsx("rect",{width:"32",height:"32",className:"fill-[#7FB236]"}),r.jsx("rect",{x:"12",y:"8",width:"8",height:"6",fill:"#FFFFFF"}),r.jsx("rect",{x:"6",y:"14",width:"20",height:"10",fill:"#FFFFFF"})]})}const qm=[{id:"zopday",name:"zopday",href:"/zopday/app",Mark:$m},{id:"zopcloud",name:"zopcloud",href:"/zopday/app",Mark:Vm},{id:"zopnight",name:"zopnight",href:"/zopnight/app",Mark:Bm}],Ms="zopnight";function Wm(e){typeof window>"u"||window.location.assign(e)}function Gm({open:e}){return r.jsx("svg",{className:`w-3.5 h-3.5 text-text-muted shrink-0 transition-transform duration-fast ${e?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})}function Km(){return r.jsx("svg",{className:"w-4 h-4 text-primary-600 shrink-0",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}function ta({collapsed:e}){return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"hidden lg:block",children:e?r.jsx(yi,{className:"w-8 h-8",idPrefix:"zni-sb"}):r.jsx(Wr,{className:"w-28",idPrefix:"zn-sb"})}),r.jsx("span",{className:"lg:hidden",children:r.jsx(Wr,{className:"w-28",idPrefix:"zn-sbm"})})]})}function Hm({collapsed:e=!1}){const t=W(j=>j.user?.email),[s,o]=m.useState(!1),[n,a]=m.useState(!1),[i,c]=m.useState(!1),u=m.useRef(!1),l=m.useRef(null),f=m.useRef(null),d=m.useRef(null),g=m.useRef(!1);m.useEffect(()=>{function j(N){N?.persisted&&(g.current=!1)}return window.addEventListener("pageshow",j),()=>window.removeEventListener("pageshow",j)},[]);const p=()=>Array.from(d.current?.querySelectorAll('[role="menuitem"]')??[]),y=ve(),h=m.useCallback(({focusTrigger:j=!1}={})=>{o(!1),j&&f.current?.focus()},[]),v=m.useCallback(()=>{u.current=!1},[]),x=m.useCallback(()=>{u.current=!1,c(!0)},[]),b=m.useCallback(()=>{u.current=!0,o(!0)},[]),w=m.useCallback(()=>{u.current&&(u.current=!1,o(!1))},[]);if(m.useEffect(()=>{if(!s)return;function j(N){N.target?.closest?.("[data-switcher-hint]")||l.current&&!l.current.contains(N.target)&&o(!1)}return document.addEventListener("mousedown",j),document.addEventListener("touchstart",j),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("touchstart",j)}},[s]),y)return r.jsx("span",{className:"flex items-center","data-testid":"product-brand-static",children:r.jsx(ta,{collapsed:e})});function A(j){if(x(),j.id===Ms){h({focusTrigger:!0});return}if(g.current){h();return}g.current=!0,Ao(Ht,t,j.id),h(),we(Ae.PRODUCT_SWITCHED,{from:Ms,to:j.id},{beforeUnload:!0}),Il().then(()=>Wm(j.href))}function E(j){const N=p();if(N.length===0)return;const z=(j+N.length)%N.length;N[z]?.focus()}function L(j){v();const N=p(),z=N.indexOf(document.activeElement);if(j.key==="Escape"){j.preventDefault(),h({focusTrigger:!0});return}if(j.key==="ArrowDown"){j.preventDefault(),E(z+1);return}if(j.key==="ArrowUp"){j.preventDefault(),E(z<=0?N.length-1:z-1);return}if(j.key==="Home"){j.preventDefault(),E(0);return}j.key==="End"&&(j.preventDefault(),E(N.length-1))}function P(j){if(j.key==="Escape"&&s){j.preventDefault(),x(),h({focusTrigger:!0});return}j.key==="ArrowDown"&&(j.preventDefault(),x(),o(!0),requestAnimationFrame(()=>E(0)))}return r.jsxs("div",{className:"relative",ref:l,children:[r.jsxs("button",{ref:f,type:"button",onClick:()=>{x(),o(j=>!j)},onKeyDown:P,"aria-haspopup":"menu","aria-expanded":s,"aria-label":"Switch product",title:"Switch product",className:`flex items-center ${e?"lg:gap-0.5":"gap-1.5"} rounded-md px-1 py-1 -ml-1 transition-colors duration-fast ${s?"bg-surface-secondary":"hover:bg-surface-secondary"} ${n&&!s?"zn-switcher-hint-pulse":""}`,children:[r.jsx(ta,{collapsed:e}),r.jsx(Gm,{open:s})]}),r.jsx(Um,{anchorRef:f,panelRef:d,switcherRef:l,menuOpen:s,userInteracted:i,onRequestOpen:b,onDismissed:w,onPulseChange:a}),s&&r.jsx("div",{ref:d,role:"menu","aria-label":"Products",onKeyDown:L,className:`absolute -left-3 top-full mt-1 w-64 bg-surface-elevated border border-border-strong rounded-xl shadow-xl z-50 overflow-hidden animate-fade-in lg:w-56 ${n?"zn-switcher-hint-pulse":""}`,children:r.jsx("div",{className:"divide-y divide-border-strong",children:qm.map(j=>{const N=j.id===Ms,{Mark:z}=j;return r.jsxs("button",{type:"button",role:"menuitem","aria-current":N?"true":void 0,className:`w-full text-left flex items-center gap-2.5 px-3 py-2.5 text-sm lg:text-[0.8125rem] rounded-md transition-colors duration-fast focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-600 ${N?"bg-surface-secondary text-text-primary font-medium":"text-text-secondary hover:text-text-primary hover:bg-surface-secondary"}`,onClick:()=>A(j),children:[r.jsx(z,{className:"w-5 h-5 shrink-0 rounded-[3px]","data-testid":`product-mark-${j.id}`}),r.jsx("span",{className:"flex-1 truncate",children:j.name}),N&&r.jsx(Km,{})]},j.id)})})})]})}const je=vo(e=>({policies:[],policyDetails:[],loaded:!1,error:!1,fetchPermissions:async()=>{try{const s=(await H.get("/permissions"))?.policies??[],o=s.map(n=>n.policyName);e({policies:o,policyDetails:s,loaded:!0,error:!1})}catch{e({policies:[],policyDetails:[],loaded:!1,error:!0})}},clearPermissions:()=>e({policies:[],policyDetails:[],loaded:!1,error:!1})}
3)),Zm=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function ra(e){return e?Array.from(e.querySelectorAll(Zm)).filter(t=>!t.hasAttribute("disabled")&&t.tabIndex!==-1):[]}let ur=0,ao="";function Qm(){ur===0&&(ao=document.body.style.overflow,document.body.style.overflow="hidden"),ur+=1}function Ym(){ur=Math.max(0,ur-1),ur===0&&(document.body.style.overflow=ao,ao="")}function ec({open:e,onClose:t,title:s,initialFocusRef:o,describedby:n,widthClass:a="max-w-lg",hideTitle:i=!1,padded:c=!0,container:u=void 0,lockScroll:l=u===void 0,children:f}){const d=m.useId(),g=m.useRef(null),p=m.useRef(null),y=m.useCallback(h=>{if(!e)return;if(h.key==="Escape"){h.stopPropagation(),t?.();return}if(h.key!=="Tab")return;const v=ra(g.current);if(v.length===0){h.preventDefault();return}const x=v[0],b=v[v.length-1],w=document.activeElement;h.shiftKey?(w===x||!g.current?.contains(w))&&(h.preventDefault(),b.focus()):w===b&&(h.preventDefault(),x.focus())},[e,t]);return m.useEffect(()=>{if(!e)return;p.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const h=o?.current??ra(g.current)[0]??g.current;try{h?.focus?.({preventScroll:!0})}catch{h?.focus?.()}return()=>{const v=p.current;v&&document.body.contains(v)&&v.focus?.(),p.current=null}},[e,o]),m.useEffect(()=>{if(!(!e||!l))return Qm(),Ym},[e,l]),m.useEffect(()=>{if(e)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,y]),e?pr.createPortal(r.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",children:[r.jsx("div",{"data-testid":"modal-backdrop",className:"absolute inset-0 bg-backdrop backdrop-blur-sm",onClick:t}),r.jsxs("div",{ref:g,role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":n,className:`relative bg-surface-elevated rounded-xl ${c?"p-6":""} w-full ${a} max-h-[80vh] overflow-y-auto overscroll-contain shadow-xl animate-fade-in`,onClick:h=>h.stopPropagation(),children:[r.jsxs("div",{className:i?"absolute right-4 top-4 z-10":"flex justify-between items-center mb-4",children:[r.jsx("h3",{id:d,className:i?"sr-only":"text-lg font-semibold text-text-primary font-display",children:s}),r.jsx("button",{type:"button",onClick:t,"aria-label":"Close",className:["relative h-8 w-8 inline-flex items-center justify-center transition-colors duration-fast",i?"rounded-full bg-black/55 text-white backdrop-blur-[2px] hover:bg-black/75 before:absolute before:-inset-1.5 before:content-['']":"rounded-md text-text-muted hover:text-text-secondary hover:bg-surface-tertiary"].join(" "),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"h-4 w-4",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),f]})]}),u??document.getElementById("overlay-root")):null}const sa="/oauth/consent",tc="mcp_oauth";function fs(e){const t=it(e);return t?t===sa||t.startsWith(`${sa}?`):!1}function Io(e){return fs(e)?tc:void 0}const ee=Object.freeze({INVALID_CREDENTIALS:"invalid_credentials",PERMISSION_DENIED:"permission_denied",NOT_FOUND:"not_found",ALREADY_CONNECTED:"already_connected",VALIDATION_FAILED:"validation_failed",RATE_LIMITED:"rate_limited",TIMEOUT:"timeout",NETWORK_ERROR:"network_error",SERVER_ERROR:"server_error",UNKNOWN:"unknown",OAUTH_URL_MISSING:"oauth_url_missing",OAUTH_AUTHORIZATION_FAILED:"oauth_authorization_failed",OAUTH_CALLBACK_MALFORMED:"oauth_callback_malformed",GCP_NO_PROJECTS:"gcp_no_projects",STATE_INVA
3LID:"oauth_state_invalid",STATE_EXPIRED:"oauth_state_expired"}),Jm=Object.freeze({WIZARD_CLOSED:"wizard_closed",PROVIDER_SWITCHED:"provider_switched",NAVIGATED_AWAY:"navigated_away",PAGE_HIDDEN:"page_hidden",OAUTH_REDIRECT_RETURNED:"oauth_redirect_returned",HANDOFF_NOT_RETURNED:"handoff_not_returned",OAUTH_CONSENT_DENIED:"oauth_consent_denied",OAUTH_AUTHORIZATION_FAILED:"oauth_authorization_failed",OAUTH_CALLBACK_MALFORMED:"oauth_callback_malformed",OAUTH_EXCHANGE_FAILED:"oauth_exchange_failed"});Object.freeze(Object.values(ee));Object.freeze(Object.values(Jm));const Xm=[[ee.INVALID_CREDENTIALS,/InvalidClientTokenId|UnrecognizedClientException|InvalidAccessKeyId|SignatureDoesNotMatch|invalid[_ ]grant|invalid[_ ]client|AuthenticationFailed|authentication failed|invalid (token|credential|api key|personal access token)|\bunauthori[sz]ed\b/i],[ee.PERMISSION_DENIED,/AccessDenied|AccessDeniedException|UnauthorizedOperation|forbidden|permission denied|insufficient (permission|privilege|scope)|not authori[sz]ed|PERMISSION_DENIED/i],[ee.NOT_FOUND,/NoSuchEntity|ResourceNotFound|does not exist|not found|NOT_FOUND|InvalidSubscriptionId|unknown (project|workspace|account)/i],[ee.ALREADY_CONNECTED,/already (exists|connected|registered|added)|duplicate|AlreadyExists|conflict/i],[ee.VALIDATION_FAILED,/invalid param|validation|must be|is required|malformed|bad request/i],[ee.RATE_LIMITED,/rate ?limit|throttl|TooManyRequests|quota exceeded/i],[ee.TIMEOUT,/timed? ?out|timeout|deadline exceeded|context deadline/i],[ee.NETWORK_ERROR,/failed to fetch|network ?error|networkerror|load failed|ERR_|ECONNREFUSED|socket hang up/i],[ee.SERVER_ERROR,/internal server error|service unavailable|bad gateway|gateway timeout/i]],oa={accessDenied:ee.PERMISSION_DENIED,forbidden:ee.PERMISSION_DENIED,permission_denied:ee.PERMISSION_DENIED,invalid_credentials:ee.INVALID_CREDENTIALS,notFound:ee.NOT_FOUND,not_found:ee.NOT_FOUND,alreadyExists:ee.ALREADY_CONNECTED,already_connected:ee.ALREADY_CONNECTED,badRequest:ee.VALIDATION_FAILED,validation_failed:ee.VALIDATION_FAILED,rateLimitExceeded:ee.RATE_LIMITED,rate_limited:ee.RATE_LIMITED,timeout:ee.TIMEOUT,backendError:ee.SERVER_ERROR,server_error:ee.SERVER_ERROR,gcp_no_projects:ee.GCP_NO_PROJECTS,oauth_state_invalid:ee.STATE_INVA
3LID,oauth_state_expired:ee.STATE_EXPIRED};function eg(e){return Number.isFinite(e)?e===401?ee.INVALID_CREDENTIALS:e===403?ee.PERMISSION_DENIED:e===404?ee.NOT_FOUND:e===409?ee.ALREADY_CONNECTED:e===408||e===504?ee.TIMEOUT:e===429?ee.RATE_LIMITED:e===400||e===422?ee.VALIDATION_FAILED:e>=500?ee.SERVER_ERROR:null:null}function y2(e){const t=Number(e?.status??e?.statusCode??e?.response?.status),s=typeof e?.message=="string"?e.message:"",o=typeof e?.code=="string"?e.code:"";if(o&&Object.hasOwn(oa,o))return oa[o];for(const[n,a]of Xm)if(a.test(s))return n;return eg(t)??ee.UNKNOWN}function x2(e,t,s){return e===ee.GCP_NO_PROJECTS?s?"This Google account has no Google Cloud projects. Deploy on ZopCloud instead, no cloud account needed, or create a GCP project and connect again.":"This Google account has no Google Cloud projects. Sign in with the Google account that owns this project.":t||"Failed to exchange authorization code."}function tg(e){const t=Number(e?.status??e?.statusCode??e?.response?.status);return Number.isFinite(t)?t:void 0}const Ze=Object.freeze({DUPLICATE_NAME:"duplicate_name",INVALID_NAME:"invalid_name",FORBIDDEN:"forbidden",SERVER_ERROR:"server_error",NETWORK:"network",MISSING_ORG_ID:"missing_org_id",MCP_ENABLE_FAILED:"mcp_enable_failed",UNKNOWN:"unknown"}),rg=new Map([[409,Ze.DUPLICATE_NAME],[400,Ze.INVALID_NAME],[422,Ze.INVALID_NAME],[401,Ze.FORBIDDEN],[403,Ze.FORBIDDEN]]);function sg(e){const t=rc(e),s=typeof e?.message=="string"?e.message:"";if(t>=500)return Ze.SERVER_ERROR;if(/already\s+exists|\bduplicate\b|\btaken\b/i.test(s))return Ze.DUPLICATE_NAME;if(t!==void 0){const o=rg.get(t);if(o)return o}return t===void 0&&s?Ze.NETWORK:Ze.UNKNOWN}function rc(e){const t=tg(e);return typeof t=="number"&&t>=100?t:void 0}const Wt="/products",og="/onboarding",sc=["/login","/signin"],oc="/login",ng=new Set(["zopnight"]);function ag(){return Fo(void 0)}function Fo(e){if(typeof e=="string"&&e)return e;try{const t=new URLSearchParams(window.location.search).get("returnTo");return t||sessionStorage.getItem($e)||null}catch{return null}}function ig(e){const t=Fo(e);return t?!(t===Wt||t.startsWith(`${Wt}?`)):!1}function Xr(e){try{if(fs(Fo(e)))return;if(qu()){if(!ig(e))return;ns()}const t=Qt(W.getState().accessToken)?.email;if(!t||ng.has(wo(Ht,t)))return;Ao(Ht,t,"zopnight")}catch{}}const nc="zopnight_signup_seen",cg=20,lg=["zop.dev","gofr.dev"],zo=new Set;function ms(e){return String(e||"").trim().toLowerCase()}function ug(e){const t=ms(e),s=t.lastIndexOf("@");if(s===-1)return!1;const o=t.slice(s+1);return lg.some(n=>o===n||o.endsWith(`.${n}`))}function Uo(e){const t=ms(e);return t?{internal:ug(t)}:{}}const dg={EMAIL:"EMAIL",GOOGLE:"GOOGLE",GITHUB:"GITHUB",AZURE_SAML:"AZURE_SAML"};function Bo(e){const t=String(e||"").trim();return t?dg[t.toUpperCase()]||t.toUpperCase():"UNKNOWN"}function ac(){let e;try{e=localStorage.getItem(nc)}catch{return null}try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function ic(e,t){if(zo.add(e),t!==null)try{localStorage.setItem(nc,JSON.stringify([...t,e].slice(-cg)))}catch{}}function fg(e){const t=ms(e);if(!t||zo.has(t))return;const s=ac();s?.includes(t)||ic(t,s)}function cc(e,{hasOrganisation:t,orgListFailed:s}={}){const o=ms(e);if(!o||s||t||zo.has(o))return!1;const n=ac();return n?.includes(o)?!1:(ic(o,n),!0)}function sr(){const e=W(t=>t.setTokens);return me({mutationFn:async({provider:t,providerData:s})=>{const o=await ue.login(t,s),{access_token:n,refresh_token:a}=o,c=Qt(n)?.email||"";W.getState().setTokensQuiet(n,a);try{let u=[],l=!1,f=!1;try{const h=await ue.listOrganizations();f=h==null||Array.isArray(h),u=h??[]}catch{l=!0}if(l){const h=W.getState().tenants?.filter(v=>v.id&&v.name)??[];if(h.length>0)u=h;else return e({accessToken:n,refreshToken:a,tenants:[]}),{email:c,hasOrganisation:!1,orgListFailed:!0}}if(u.length===0)return Ct(Qe,c,""),e({accessToken:n,refreshToken:a,tenants:[]}),{email:c,hasOrganisation:!1,orgListFailed:l||!f};const d=ss(Qe,c),p=(d?u.find(h=>String(h.id)===String(d)):null)||u[0];Ct(Qe,c,p.id);const y=await ue.refresh(a,p.id);return e({accessToken:y.access_token,refreshToken:y.refresh_token,tenants:u.map(h=>({id:h.id,name:h.name}))}),{email:c,hasOrganisation:!0,orgListFailed:l||!f}}catch(u){throw W.getState().clearQuietTokens(),u}},onMutate:()=>({signInDestination:ag()}),onSuccess:(t,s,o)=>{const n=Qt(W.getState().accessToken);if(rs({email:n?.email,name:n?.name}),Xr(o?.signInDestination),cc(t?.email,{hasOrganisation:!!t?.hasOrganisation,orgListFailed:!!t?.orgListFailed})){const a=Io(o?.signInDestination);we(Ae.USER_SIGNED_UP,{method:Bo(s?.provider),inferred:!0,...Uo(t?.email),...a&&{entry_point:a}})}we(Ae.USER_LOGGED_IN,{method:s?.provider})}})}function mg({entryPoint:e}={}){return me({mutationFn:t=>ue.signup(t),onSuccess:(t,s)=>{rs({email:s?.email,name:s?.name}),fg(s?.email),we(Ae.USER_SIGNED_UP,{method:Bo(s?.provider||Nt.EMAIL),inferred:!1,...Uo(s?.email),...e&&{entry_point:e}})}})}function gg(){return me({mutationFn:e=>ue.validateOtp(e)})}function pg(){return me({mutationFn:e=>ue.sendVerificationEmail(e)})}function na(){return me({mutationFn:e=>ue.forgotPassword(e)})}function hg(){return me({mutationFn:e=>ue.resetPassword(e)})}function yg(){return me({mutationFn:e=>ue.samlInitiate(e)})}function xg(e){return typeof e=="string"?e:e?.name}function jr(e){return typeof e=="string"?"manual":e?.flow??"manual"}function lc({entryPoint:e}={}){const t=W(a=>a.setTokens),s=ke(),o=e===tc,n=e?{entry_point:e}:{};return me({mutationFn:a=>ue.createOrganization(xg(a)),onSuccess:async(a,i)=>{const c=a?.id;if(c){const[u,l]=await Promise.allSettled([Eo(c),ue.listOrganizations()]);u.status==="fulfilled"&&u.value&&oi(c,{name:a?.name}),we(Ae.ORG_CREATED,{new_org_id:c,flow:jr(i),...n});const f=l.status==="fulfilled"?l.value:null;if(f?.length){const{accessToken:d,refreshToken:g}=W.getState();t({accessToken:d,refreshToken:g,tenants:f.map(p=>({id:p.id,name:p.name}))})}try{await H.put("/organisation",{name:a?.name||"",settings:{timezone:"UTC",currency:"USD",mcp_enabled:o?"true":"false"}}),o&&(we(Ae.MCP_ENABLED,n),Ml({mcp_enabled:!0}))}catch{o&&(we(Ae.ORG_CREATE_FAILED,{failure_reason:Ze.MCP_ENABLE_FAILED,flow:jr(i),new_org_id:c,...n}),fe.warning("Your organization is ready, but MCP access couldn't be turned on. An admin can enable it in Settings → API & MCP."))}if(s.clear(),l.status==="rejected"){const d=l.reason;throw d&&typeof d=="object"&&(d.postCreate=!0),d}}else we(Ae.ORG_CREATE_FAILED,{failure_reason:Ze.MISSING_ORG_ID,flow:jr(i),...n})},onError:(a,i)=>{we(Ae.ORG_CREATE_FAILED,{failure_reason:sg(a),http_status:rc(a),flow:jr(i),post_create:a?.postCreate===!0||void 0,...n})}})}function vg(e={},{enabled:t=!0}={}){return re({queryKey:oe.assignments.list(e),queryFn:()=>H.get("/assignments",e??{}),select:s=>Array.isArray(s)?s:s?.items??[],enabled:t&&e!==null})}function v2(){const e=ke();return me({mutationFn:({email:t,roleId:s})=>H.post("/assignments",{assigneeType:"user",assigneeId:t,roleId:s}),onSuccess:()=>
3{fe.success("Role assigned"),e.invalidateQueries({queryKey:oe.assignments.all}),e.invalidateQueries({queryKey:oe.users.all}),je.getState().fetchPermissions()},onError:t=>fe.error(`Failed to assign role: ${t.message}`)})}function b2(){const e=ke();return me({mutationFn:({id:t,roleId:s,replaceAll:o})=>H.put(`/assignments/${t}`,{roleId:s,replaceAll:o}),onSuccess:()=>{fe.success("Role updated"),e.invalidateQueries({queryKey:oe.assignments.all}),e.invalidateQueries({queryKey:oe.users.all}),je.getState().fetchPermissions()},onError:t=>fe.error(`Failed to update role: ${t.message}`)})}function w2(){const e=ke();return me({mutationFn:t=>H.del(`/assignments/${t}`),onSuccess:()=>{fe.success("Role removed"),e.invalidateQueries({queryKey:oe.assignments.all}),e.invalidateQueries({queryKey:oe.users.all}),je.getState().fetchPermissions()},onError:t=>fe.error(`Failed to remove role: ${t.message}`)})}function bg(e){return re({queryKey:oe.roles.list(),queryFn:()=>H.get("/roles",e),select:t=>Array.isArray(t)?t:t?.items??[]})}function A2(){return re({queryKey:oe.rolePolicies.list(),queryFn:()=>H.get("/roles/policies"),select:e=>Array.isArray(e)?e:[]})}const $o="admin-role-0000-0000-000000000000",io="editor-role-0000-0000-000000000000",co="viewer-role-0000-0000-000000000000",aa={[$o]:1e3,[io]:900,[co]:800};function ia(e,t){if(!e)return-1;if(aa[e]!==void 0)return aa[e];const s=t?.[e];return Array.isArray(s?.policies)?s.policies.length:0}function wg(e,t){if(!(!Array.isArray(e)||e.length===0))return[...e].sort((s,o)=>ia(o,t)-ia(s,t))[0]}function Ag(e){return(Array.isArray(e?.policies)?e.policies:[]).length===0&&!!e?.metadata?.importedFrom}function _2(e){return e===$o}function S2(e){if(!Array.isArray(e)||e.length===0)return{visible:[],subsumed:[]};const t=e.includes($o),s=e.includes(io),o=[];return{visible:e.filter(a=>t&&(a===io||a===co)||s&&a===co?(o.push(a),!1):!0),subsumed:o}}function _g(e,t,s){return!s||!e.length?null:t.every(n=>n.allResources)?"Viewer":"Member"}function uc(){const e=W(i=>i.user?.email),t=je(i=>i.policies),s=je(i=>i.policyDetails),o=je(i=>i.loaded),{data:n=[]}=vg(void 0,{enabled:!!e&&!ve()}),{data:a}=bg();return m.useMemo(()=>{const i=Array.isArray(a)?a:a?.items??[],c=Object.fromEntries(i.map(d=>[d.id,d])),u=n.filter(d=>d.assigneeType==="user"&&d.assigneeId===e&&d.roleId).map(d=>d.roleId).filter(d=>!Ag(c[d])),l=wg(u,c),f=l?c[l]?.name:void 0;return f||_g(t,s,o)},[n,a,e,t,s,o])}async function dc(e,t){ve()?bi(e):(await Eo(e),W.getState().switchOrg(e)),_o(t),je.getState().clearPermissions(),je.getState().fetchPermissions()}function Sg(e){const[t]=Se(),s=ke(),o=W(f=>f.user),[n,a]=m.useState(null),i=m.useRef(!1),c=t.get("org"),u=o?.tenantId||ss(Qe,o?.email),l=c&&c!==u&&e.some(f=>f.id===c)?c:null;return m.useEffect(()=>{!l||n===l||i.current||(i.current=!0,dc(l,s).catch(()=>{}).finally(()=>{i.current=!1,a(l)}))},[l,n,s]),!!l&&n!==l}function ca(){return r.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})}function kg({position:e="below",collapsed:t=!1}){const[s,o]=m.useState(!1),[n,a]=m.useState(!1),[i,c]=m.useState(null),[u,l]=m.useState(!1),[f,d]=m.useState(""),g=lc(),p=m.useRef(null),y=m.useRef(null),h=pe(),v=ke(),x=W(_=>_.user),b=W(_=>_.tenants),w=W(_=>_.logout),A=Yt(_=>_.theme),E=Yt(_=>_.toggleTheme),L=uc(),P=x?.tenantId||ss(Qe,x?.email),j=b.find(_=>_.id===P)||b[0],N=m.useCallback(()=>{},[e]);m.useEffect(()=>{function _(O){p.current&&!p.current.contains(O.target)&&(o(!1),a(!1))}return s&&(document.addEventListener("mousedown",_),document.addEventListener("touchstart",_)),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("touchstart",_)}},[s]),m.useEffect(()=>{s&&e==="above"&&N()},[s,e,N]);async function z(_){if(_!==P){c(_);try{await dc(_,v),o(!1)}catch{}finally{c(null)}}}async function Q(){if(ve()){kl(),Od(),v.clear(),je.getState().clearPermissions(),w(),h("/");return}try{const{refreshToken:_}=W.getState();await ue.logout(_)}catch{}v.clear(),je.getState().clearPermissions(),we(Ae.USER_LOGGED_OUT),w(),h("/login")}function G(){!f.trim()||g.isPending||g.mutate(f.trim(),{onSuccess:()=>{fe.success("Organization created"),d(""),l(!1)},onError:_=>fe.error(_.message||"Failed to create organization")})}const I=r.jsx(ec,{open:u,onClose:()=>{l(!1),d("")},title:"Create Organization",children:r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsx(Ve,{value:f,onChange:_=>d(_.target.value),placeholder:"Organization name",disabled:g.isPending,autoFocus:!0,onKeyDown:_=>{_.key==="Enter"&&G(),_.key==="Escape"&&(l(!1),d(""))}}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(ge,{variant:"secondary",size:"sm",onClick:()=>{l(!1),d("")},children:"Cancel"}),r.jsx(ge,{size:"sm",onClick:G,disabled:!f.trim()||g.isPending,children:g.isPending?"Creating...":"Create"})]})]})}),S=x?.name?x.name.split(" ").map(_=>_[0]).join("").toUpperCase().slice(0,2):(x?.email?.[0]||"?").toUpperCase(),B=x?.name||x?.email||"",D=[L,j?.name].filter(
3Boolean).join(" · "),M=x?.name&&x?.email?x.email:"",C=s?M:D,R=_=>_.id===P&&L?`${_.name} · ${L}`:_.name;return e==="above"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:p,className:"relative",children:[s&&r.jsxs("div",{className:"absolute bottom-full left-0 mb-1 min-w-[13rem] bg-surface-elevated border border-border-strong rounded-xl shadow-xl z-50 py-1 animate-fade-in",role:"menu",children:[b.length>0&&r.jsxs("div",{className:"px-3 py-2 border-b border-border-strong",children:[r.jsx("p",{className:"text-[0.6875rem] text-text-muted mb-1.5",children:"Organization"}),r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:_=>{_.stopPropagation(),a(O=>!O)},className:"w-full flex items-center justify-between px-2.5 py-1.5 text-[0.8125rem] rounded-md border border-border-strong transition-colors duration-fast text-text-primary bg-surface hover:bg-surface-tertiary",children:[r.jsxs("span",{className:"truncate",children:[j?.name??"",L?` · ${L}`:""]}),i&&r.jsx("div",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-primary-600 border-t-transparent shrink-0"}),!i&&r.jsx("svg",{className:`w-3.5 h-3.5 text-text-muted shrink-0 transition-transform duration-fast ${n?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]}),n&&r.jsxs("div",{className:"absolute left-0 right-0 mt-1 bg-surface-elevated border border-border-strong rounded-lg shadow-lg z-10 py-1",children:[r.jsx("div",{className:"max-h-24 overflow-y-auto",children:b.map(_=>r.jsxs("button",{onClick:()=>{a(!1),z(_.id)},role:"menuitemradio","aria-checked":_.id===P,className:`w-full text-left px-2.5 py-1.5 text-[0.8125rem] flex items-center justify-between transition-colors duration-fast ${_.id===P?"text-primary-600 font-medium":"text-text-primary hover:bg-surface-tertiary"}`,children:[r.jsx("span",{className:"truncate",children:R(_)}),_.id===P&&r.jsx("svg",{className:"w-3.5 h-3.5 text-primary-600 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]},_.id))}),r.jsxs("button",{onClick:()=>{a(!1),o(!1),l(!0)},className:"w-full text-left px-2.5 py-1.5 text-[0.8125rem] text-text-secondary hover:bg-surface-tertiary flex items-center gap-1.5 border-t border-border-strong mt-1 pt-1.5",children:[r.jsx(ca,{}),r.jsx("span",{children:"Create organization"})]})]})]})]}),r.jsx("div",{className:"border-b border-border-strong",children:r.jsx("button",{onClick:_=>{_.stopPropagation(),E()},role:"menuitem",className:"w-full flex items-center justify-between px-3 py-2 text-[0.8125rem] text-text-primary hover:bg-surface-tertiary transition-colors duration-fast",children:r.jsxs("div",{className:"flex items-center gap-2.5",children:[A==="dark"?r.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):r.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})}),r.jsx("span",{children:A==="dark"?"Light mode":"Dark mode"})]})})}),r.jsx("div",{className:"border-b border-border-strong",children:r.jsxs("button",{onClick:()=>{o(!1),h("/developer")},role:"menuitem",className:"w-full flex items-center gap-2.5 px-3 py-2 text-[0.8125rem] text-text-primary hover:bg-surface-tertiary transition-colors duration-fast",children:[r.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})}),r.jsx("span",{children:"Developer Settings"})]})}),r.jsx("div",{className:"py-0.5",children:r.jsxs("button",{onClick:Q,role:"menuitem",className:"w-full flex items-center gap-2.5 px-3 py-2 text-[0.8125rem] text-danger-500 hover:bg-surface-tertiary transition-colors duration-fast",children:[r.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3-3l3-3m0 0l-3-3m3 3H9"})}),r.jsx("span",{children:"Log out"})]})})]}),r.jsxs("button",{ref:y,onClick:()=>o(!s),className:`w-full flex items-center ${t?"justify-center":"gap-2.5"} px-2 py-2 rounded-md transition-colors duration-fast ${s?"bg-surface-elevated":"hover:bg-surface-secondary"}`,"aria-haspopup":"true","aria-expanded":s,"aria-label":"User menu",title:t?B:void 0,children:[r.jsx("div",{className:"w-7 h-7 rounded-full bg-primary-600 text-text-inverse flex items-center justify-center text-[0.6875rem] font-semibold shrink-0",children:S}),!t&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[r.jsx("p",{className:"text-[0.8125rem] font-medium text-text-primary truncate leading-tight",children:B}),C&&r.jsx("p",{className:"text-[0.6875rem] text-text-muted truncate leading-tight",title:C,children:C})]}),r.jsx("svg",{className:`w-4 h-4 text-text-muted shrink-0 transition-transform duration-fast ${s?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M14.77 12.79a.75.75 0 01-1.06-.02L10 9.832l-3.71 3.938a.75.75 0 11-1.08-1.04l4.25-4.5a.75.75 0 011.08 0l4.25 4.5a.75.75 0 01-.02 1.06z",clipRule:"evenodd"})})]})]})]}),I]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative",ref:p,children:[r.jsx("button",{onClick:()=>o(!s),className:"flex items-center justify-center p-1 rounded-lg hover:bg-surface-tertiary transition-all duration-fast","aria-haspopup":"true","aria-expanded":s,"aria-label":"User menu",children:r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary-600 text-text-inverse flex items-center justify-center text-xs font-semibold shadow-glow-sm",children:S})}),s&&r.jsxs("div",{className:"absolute right-0 mt-2 w-64 bg-surface-elevated border border-border-strong rounded-xl shadow-xl z-50 py-1 animate-fade-in",role:"menu",children:[r.jsxs("div",{className:"px-4 py-2.5 border-b border-border-strong flex items-center gap-3",children:[r.jsx("div",{className:"w-9 h-9 rounded-full bg-primary-600 text-text-inverse flex items-center justify-center text-sm font-semibold shadow-glow-sm shrink-0",children:S}),r.jsxs("div",{className:"min-w-0",children:[x?.name&&r.jsx("p",{className:"text-sm font-medium text-text-primary truncate",children:x.name}),r.jsx("p",{className:"text-xs text-text-muted truncate",children:x?.email})]})]}),b.length>0&&r.jsxs("div",{className:"px-4 py-2 border-b border-border-strong",children:[r.jsx("p",{className:"text-xs text-text-muted uppercase tracking-wider mb-1.5",children:"Organization"}),r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:_=>{_.stopPropagation(),a(O=>!O)},className:"w-full flex items-center justify-between px-3 py-1.5 text-sm rounded-lg border border-border-strong transition-colors duration-fast text-text-primary bg-surface hover:bg-surface-tertiary",children:[r.jsxs("span",{className:"truncate",children:[j?.name??"",L?` · ${L}`:""]}),i&&r.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary-600 border-t-transparent shrink-0"}),!i&&b.length>1&&r.jsx("svg",{className:`w-4 h-4 text-text-muted shrink-0 transition-transform duration-fast ${n?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]}),n&&r.jsxs("div",{className:"absolute left-0 right-0 mt-1 bg-surface-elevated border border-border-strong rounded-lg shadow-lg z-10 py-1 max-h-40 overflow-y-auto",children:[b.map(_=>r.jsxs("button",{onClick:()=>{a(!1),z(_.id)},role:"menuitemradio","aria-checked":_.id===P,className:`w-full text-left px-3 py-1.5 text-sm flex items-center justify-between transition-colors duration-fast ${_.id===P?"text-primary-600 font-medium":"text-text-primary hover:bg-surface-tertiary"}`,children:[r.jsx("span",{className:"truncate",children:R(_)}),_.id===P&&r.jsx("svg",{className:"w-4 h-4 text-primary-600 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]},_.id)),r.jsxs("button",{onClick:()=>{a(!1),o(!1),l(!0)},className:"w-full text-left px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-tertiary flex items-center gap-1.5 border-t border-border-strong mt-1 pt-1.5",children:[r.jsx(ca,{}),r.jsx("span",{children:"Create organization"})]})]})]})]}),r.jsx("div",{className:"border-b border-border-strong",children:r.jsxs("button",{onClick:()=>{o(!1),h("/developer")},role:"menuitem",className:"w-full flex items-center gap-2.5 px-4 py-1.5 text-sm text-text-primary hover:bg-surface-tertiary transition-colors duration-fast",children:[r.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})}),r.jsx("span",{children:"Developer Settings"})]})}),r.jsx("div",{className:"py-1",children:r.jsx("button",{onClick:Q,role:"menuitem",className:"w-full text-left px-4 py-1.5 text-sm text-danger-500 hover:bg-surface-tertiary transition-colors duration-fast",children:"Log out"})})]})]}),I]})}function Vo(e){const{policies:t,loaded:s,error:o}=je();return s?t.some(n=>n===e||n.startsWith(e+":"))?"granted":"denied":o?"granted":"loading"}function At(e){return Vo(e)!=="denied"}function Eg(){const{policyDetails:e,loaded:t}=je();return!t||e.length===0?!1:e.some(s=>s.allResources===!1)}const de={RESOURCE_VIEW:"resource:view",RESOURCE_UPDATE:"resource:update",RESOURCE_DELETE:"resource:delete",SCHEDULE_VIEW:"schedule:view",SCHEDULE_CREATE:"schedule:create",SCHEDULE_UPDATE:"schedule:update",SCHEDULE_DELETE:"schedule:delete",RESOURCE_GROUP_VIEW:"resource-group:view",RESOURCE_GROUP_CREATE:"resource-group:create",RESOURCE_GROUP_UPDATE:"resource-group:update",RESOURCE_GROUP_DELETE:"resource-group:delete",OVERRIDE_CREATE:"override:create",OVERRIDE_DELETE:"override:delete",CLOUD_ACCOUNT_VIEW:"cloud-account:view",CLOUD_ACCOUNT_CREATE:"cloud-account:create",CLOUD_ACCOUNT_UPDATE:"cloud-account:update",CLOUD_ACCOUNT_DELETE:"cloud-account:delete",ALERT_VIEW:"alert:view",ALERT_RESOLVE:"alert:resolve",NOTIFICATION_CREATE:"notification:create",NOTIFICATION_UPDATE:"notification:update",NOTIFICATION_DELET
3E:"notification:delete",TEAM_VIEW:"team:view",TEAM_CREATE:"team:create",TEAM_UPDATE:"team:update",TEAM_DELETE:"team:delete",ROLE_CREATE:"role:create",ROLE_UPDATE:"role:update",ROLE_DELETE:"role:delete",USER_CREATE:"user:create",USER_UPDATE:"user:update",USER_DELETE:"user:delete",ORGANISATION_VIEW:"organisation:view",ORGANISATION_UPDATE:"organisation:update",ASSIGNMENT_CREATE:"assignment:create",ASSIGNMENT_UPDATE:"assignment:update",STATE_HISTORY_VIEW:"state-history:view",REPORT_VIEW:"report:view",AUDIT_LOG_VIEW:"audit-log:view",RECOMMENDATION_VIEW:"recommendation:view",RECOMMENDATION_UPDATE:"recommendation:update",SMART_TAGS_VIEW:"smart-tags:view",SMART_TAGS_UPDATE:"smart-tags:update",POLICY_VIEW:"policy:view",POLICY_CREATE:"policy:create",POLICY_UPDATE:"policy:update",POLICY_DELETE:"policy:delete",BUDGET_VIEW:"budget:view",BUDGET_CREATE:"budget:create",BUDGET_UPDATE:"budget:update",BUDGET_DELETE:"budget:delete",AUTOSCALER_CREATE:"autoscaler-policy:create",AUTOSCALER_UPDATE:"autoscaler-policy:update",AUTOSCALER_DELET
3E:"autoscaler-policy:delete",EVENT_READINESS_CREATE:"event-readiness:create",EVENT_READINESS_UPDATE:"event-readiness:update",EVENT_READINESS_DELETE:"event-readiness:delete",BILLING_VIEW:"billing:view",BILLING_UPDATE:"billing:update",BILLING_DELETE:"billing:delete",DASHBOARD_VIEW:"dashboard:view",DASHBOARD_CREATE:"dashboard:create",DASHBOARD_UPDATE:"dashboard:update",DASHBOARD_DELETE:"dashboard:delete",UNIT_METRIC_CREATE:"unit-metric:create",UNIT_METRIC_UPDATE:"unit-metric:update",UNIT_METRIC_DELETE:"unit-metric:delete",UNIT_METRIC_VALUE_CREATE:"unit-metric-value:create",AI_USAGE_VIEW:"ai-usage:view",VIRTUAL_KEY_CREATE:"virtual-key:create",VIRTUAL_KEY_UPDATE:"virtual-key:update",VIRTUAL_KEY_DELETE:"virtual-key:delete",AI_MODEL_CREATE:"ai-model:create",AI_MODEL_UPDATE:"ai-model:update",IAC_POLICY_MANAGE:"iac-policy:manage",IAC_VALIDATION_OVERRIDE:"iac-validation:override"},k2="You don't have permission. Contact your admin.",qo="zopdev_marketplace_pending";function Rg(e){try{sessionStorage.setItem(qo,JSON.stringify(e))}catch{}}function fc(){try{const e=sessionStorage.getItem(qo);return e?JSON.parse(e):null}catch{return null}}function lo(){try{sessionStorage.removeItem(qo)}catch{}}async function mc(){const e=fc();if(e?.customerID)try{await ue.registerMarketplace({customerID:e.customerID,productCode:e.productCode}),lo()}catch(t){(t?.status===400||t?.status===404||t?.status===409)&&lo(),console.error("marketplace: failed to link AWS customer to org",t)}}const jg={list:()=>H.get("/dashboards"),getById:e=>H.get(`/dashboards/${e}`),create:e=>H.post("/dashboards",e),update:(e,t)=>H.patch(`/dashboards/${e}`,t),remove:e=>H.del(`/dashboards/${e}`),setOrgDefault:e=>H.put("/dashboards/default",{id:e})},la=document.querySelector('meta[name="build-version"]')?.content??"";let ua=0;const gc=6e4,Wo="version-reload-target:app",Cg=5*6e4;let Ls=null;function Ng(){try{return JSON.parse(sessionStorage.getItem(Wo)||"null")}catch{return null}}function Og(e){try{sessionStorage.setItem(Wo,JSON.stringify(e))}catch{}}function Tg(){try{sessionStorage.removeItem(Wo)}catch{}}let Cr=null;function Mg(e,t){Cr&&window.removeEventListener("pagehide",Cr),Cr=()=>Og({version:e,ts:Date.now(),attempts:t}),window.addEventListener("pagehide",Cr,{once:!0}),window.location.reload()}function da(){la&&(Date.now()-ua<gc||(ua=Date.now(),fetch(`/zopnight/app/version.json?t=${Date.now()}`,{cache:"no-store"}).then(e=>{const t=e.headers.get("content-type")||"";return e.ok&&t.includes("json")?e.json():null}).then(e=>{if(!e?.version)return;if(e.version===la){Ls=null,Tg();return}if(e.version!==Ls){Ls=e.version;return}const t=Ng(),s=t&&Date.now()-t.ts<Cg;s&&(t.version===e.version||(t.attempts??1)>=2)||Mg(e.version,(s?t.attempts??1:0)+1)}).catch(()=>{})))}function Lg(){const e=qe();m.useEffect(()=>{da()},[e.pathname]),m.useEffect(()=>{const t=setInterval(da,gc/2);return()=>clearInterval(t)},[])}let Nr=0,uo=0,_t=null;function Pg(){uo=window.scrollY;const{style:e}=document.body;_t={overflow:e.overflow,position:e.position,top:e.top,width:e.width},e.overflow="hidden",e.position="fixed",e.top=`-${uo}px`,e.width="100%"}function Dg(){if(!_t)return;const{style:e}=document.body;e.overflow=_t.overflow,e.position=_t.position,e.top=_t.top,e.width=_t.width,_t=null,window.scrollTo(0,uo)}function pc(e){m.useEffect(()=>{if(!(!e||typeof document>"u"))return Nr+=1,Nr===1&&Pg(),()=>{Nr-=1,Nr===0&&Dg()}},[e])}function hc({options:e=[],className:t="",size:s="md",tone:o="surface",...n}){return r.jsxs("div",{className:"relative",children:[r.jsx("select",{className:`w-full appearance-none pl-3 pr-9 ${s==="sm"?"py-1.5 text-xs":"py-2 text-sm"} ${o==="tertiary"?"bg-surface-tertiary":"bg-surface"} border border-border-strong rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-600/30 focus:border-primary-600/40 transition-all duration-fast ${t}`,...n,children:e.map(a=>{const i=typeof a=="string"?a:a.value,c=typeof a=="string"?a:a.label,u=typeof a=="string"?void 0:a.title,l=typeof a=="string"?void 0:a.disabled;return r.jsx("option",{value:i,title:u,disabled:l,children:c},i)})}),r.jsx("svg",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})]})}const Ig="00000000-0000-4000-8000-0000000000";function Fg(e){const t=ht.findIndex(s=>s.slug===e);return t<0?null:`${Ig}${String(t+1).padStart(2,"0")}`}function zg(){const e=W(o=>o.user?.tenantId),t=xi(e)??hr()??ht[0].slug,s=o=>{const n=o.target.value,a=Fg(n);a&&bi(a)};return r.jsxs("div",{role:"region","aria-label":"Playground demo",className:"flex items-center gap-3 h-10 px-4 sm:px-6 lg:px-8 bg-surface border-b border-border text-xs",children:[r.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-primary-600/15 text-primary-600 font-medium",children:[r.jsx("span",{"aria-hidden":"true",className:"w-1.5 h-1.5 rounded-full bg-primary-600 animate-pulse"}),"Demo"]}),r.jsx("span",{className:"text-text-secondary hidden sm:inline",children:"You're viewing the ZopNight playground — 
3changes aren't saved."}),r.jsx("div",{className:"flex-1"}),r.jsxs("label",{className:"inline-flex items-center gap-2 text-text-secondary",children:[r.jsx("span",{className:"hidden sm:inline",children:"Industry"}),r.jsx(hc,{"aria-label":"Playground industry",value:t,onChange:s,options:ht.map(o=>({value:o.slug,label:o.label})),className:"!py-1 !text-xs w-32"})]}),r.jsxs("a",{href:"/zopnight/app/signup",className:"inline-flex items-center gap-1 px-3 py-1.5 rounded-md bg-primary-600 hover:bg-primary-700 text-black text-xs font-medium transition-colors",children:["Get started",r.jsx("svg",{"aria-hidden":"true",className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})}const le=e=>r.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e}),ie={home:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M3 10.5 12 3l9 7.5"}),r.jsx("path",{d:"M5 9.5V21h14V9.5"}),r.jsx("path",{d:"M10 21v-6h4v6"})]})),inventory:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}),r.jsx("path",{d:"m7 16.5-4.74-2.85"}),r.jsx("path",{d:"m7 16.5 5-3"}),r.jsx("path",{d:"M7 16.5v5.17"}),r.jsx("path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}),r.jsx("path",{d:"m17 16.5-5-3"}),r.jsx("path",{d:"m17 16.5 4.74-2.85"}),r.jsx("path",{d:"M17 16.5v5.17"}),r.jsx("path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}),r.jsx("path",{d:"M12 8 7.26 5.15"}),r.jsx("path",{d:"m12 8 4.74-2.85"}),r.jsx("path",{d:"M12 13.5V8"})]})),kubernetes:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),r.jsx("path",{d:"M2 17l10 5 10-5"}),r.jsx("path",{d:"M2 12l10 5 10-5"})]})),groups:le(r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),r.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),r.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),r.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})),tags:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),r.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]})),teams:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),r.jsx("circle",{cx:"9",cy:"7",r:"4"}),r.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),r.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})),reports:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"}),r.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),r.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),r.jsx("polyline",{points:"10 9 9 9 8 9"})]})),costFlow:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M4 6h16"}),r.jsx("path",{d:"M4 12h10"}),r.jsx("path",{d:"M4 18h16"}),r.jsx("circle",{cx:"7",cy:"6",r:"1.5"}),r.jsx("circle",{cx:"17",cy:"12",r:"1.5"}),r.jsx("circle",{cx:"10",cy:"18",r:"1.5"})]})),unitEconomics:le(r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"10"}),r.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"4"}),r.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"16"}),r.jsx("line",{x1:"3",y1:"20",x2:"21",y2:"20"})]})),budgets:le(r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),r.jsx("line",{x1:"2",y1:"10",x2:"22",y2:"10"})]})),aiGateway:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"}),r.jsx("polyline",{points:"10 17 15 12 10 7"}),r.jsx("line",{x1:"15",y1:"12",x2:"3",y2:"12"})]})),inferenceKeys:le(r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"7.5",cy:"15.5",r:"4.5"}),r.jsx("path",{d:"M10.5 12.5L21 2"}),r.jsx("path",{d:"M17 6l3 3"}),r.jsx("path",{d:"M14 9l3 3"})]})),recCost:le(r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{d:"M12 6v12"}),r.jsx("path",{d:"M15 9.5c0-1.1-1.34-2-3-2s-3 .9-3 2 1.34 2 3 2 3 .9 3 2-1.34 2-3 2-3-.9-3-2"})]})),recCompliance:le(r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{d:"M8 12l3 3 5-6"})]})),recRisk:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),r.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),r.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})),recAdvisory:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M9 18h6"}),r.jsx("path",{d:"M10 22h4"}),r.jsx("path",{d:"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5.76.76 1.23 1.52 1.41 2.5"})]})),policies:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),r.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})]}
3)),validations:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M12 3 4 6v6c0 4.4 3.4 8.2 8 9 4.6-.8 8-4.6 8-9V6z"}),r.jsx("path",{d:"M9 12l2 2 4-4"})]})),schedules:le(r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("polyline",{points:"12 6 12 12 16 14"})]})),autoScaling:le(r.jsx("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),eventReadiness:le(r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),r.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})),history:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M3 3v5h5"}),r.jsx("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 8"}),r.jsx("path",{d:"M12 7v5l4 2"})]})),auditLogs:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"}),r.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),r.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})),alerts:le(r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),r.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})),settings:le(r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"3"}),r.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}))},Ue={to:"/dashboard",label:"Home",icon:ie.home,isActiveFn:e=>e.pathname==="/dashboard"||e.pathname.startsWith("/dashboard/")||e.pathname.startsWith("/dashboards")||e.pathname==="/my-work"},Ug=[{to:"/dashboard",label:"Overview"},{to:"/my-work",label:"Needs attention"}],yc=[{key:"cloud-estate",label:"Cloud Estate",items:[{to:"/resources",label:"Inventory",icon:ie.inventory},{to:"/kubernetes",label:"Kubernetes",icon:ie.kubernetes,isActiveFn:e=>e.pathname==="/kubernetes"||e.pathname.startsWith("/k8s/")}]},{key:"ai-estate",label:"AI Estate",items:[{to:"/ai-agents/spend",label:"AI Gateway",icon:ie.aiGateway,flag:"aiGateway"},{to:"/ai-agents/keys",label:"Inference Keys",icon:ie.inferenceKeys,flag:"aiGateway"}]},{key:"recommendations",label:"Recommendations",items:[{to:"/recommendations/lifecycle",label:"Overview",pinLabel:"Recommendations Overview",icon:ie.history},{to:"/recommendations/cost",label:"Savings",pinLabel:"Savings Recommendations",icon:ie.recCost},{to:"/recommendations/compliance",label:"Compliance",pinLabel:"Compliance Recommendations",icon:ie.recCompliance},{to:"/recommendations/risk",label:"Risk",pinLabel:"Risk Recommendations",icon:ie.recRisk},{to:"/recommendations/advisory",label:"Advisory",pinLabel:"Advisory Recommendations",icon:ie.recAdvisory}]},{key:"costs",label:"Costs",items:[{to:"/cost-reports",label:"Reports",pinLabel:"Cost Reports",icon:ie.reports},{to:"/cost/flow",label:"Flow",icon:ie.costFlow},{to:"/cost/unit-economics",label:"Unit Economics",icon:ie.unitEconomics},{to:"/budgets",label:"Budgets",icon:ie.budgets}]},{key:"automate",label:"Automate",items:[{to:"/schedules",label:"Schedules",icon:ie.schedules,isActiveFn:e=>e.pathname==="/schedules"||e.pathname.startsWith("/schedules/")},{to:"/automation/policies",label:"Auto Scaling",icon:ie.autoScaling,isActiveFn:e=>e.pathname.startsWith("/automation/policies")},{to:"/automation/events",label:"Event Readiness",icon:ie.eventReadiness,isActiveFn:e=>e.pathname.startsWith("/automation/events")}]},{key:"governance",label:"Governance",items:[{to:"/resource-groups",label:"Resource Groups",icon:ie.groups}
3,{to:"/teams",label:"Teams",icon:ie.teams},{to:"/smart-tags",label:"Smart Tags",icon:ie.tags},{to:"/policies",label:"Policies",icon:ie.policies},{to:"/governance",label:"IaC Validations",icon:ie.validations,isActiveFn:e=>e.pathname.startsWith("/governance")}]},{key:"activity",label:"Activity",items:[{to:"/history",label:"History",icon:ie.history},{to:"/audit-logs",label:"Audit Logs",icon:ie.auditLogs},{to:"/alerts",label:"Alerts",icon:ie.alerts,requiresPermission:de.ALERT_VIEW}]}],Vt=["/resources","/schedules","/recommendations/cost","/cost-reports"],ar={to:"/settings",label:"Settings",icon:ie.settings},Bg="zopnight_nav_pins:v1",xc=new Set(yc.flatMap(e=>e.items.map(t=>t.to)));function $g(e,t){return e?`${Bg}:${e}:${t||""}`:null}function Vg(e){return Array.isArray(e)?[...new Set(e.filter(t=>typeof t=="string"&&xc.has(t)))]:null}function Ps(e){if(!e)return[...Vt];try{const t=localStorage.getItem(e);return t==null?[...Vt]:Vg(JSON.parse(t))??[...Vt]}catch{return[...Vt]}}function qg(e,t){if(e)try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function Wg(e){if(e)try{localStorage.removeItem(e)}catch{}}const Gg=(e,t)=>e.length===t.length&&e.every((s,o)=>s===t[o]);function Kg(){const e=W(d=>d.user?.email),t=lt(),s=$g(e,t),[o,n]=m.useState(()=>({key:s,pins:Ps(s),persist:!1}));let a=o.pins;o.key!==s&&(a=Ps(s),n({key:s,pins:a,persist:!1})),m.useEffect(()=>{o.persist&&qg(o.key,o.pins)},[o]);const i=m.useCallback(d=>{n(g=>{const p=g.key===s?g.pins:Ps(s),y=d(p);return y===p?g:{key:s,pins:y,persist:!0}})},[s]),c=m.useCallback(d=>i(g=>!xc.has(d)||g.includes(d)?g:[...g,d]),[i]),u=m.useCallback(d=>i(g=>g.includes(d)?g.filter(p=>p!==d):g),[i]),l=m.useCallback((d,g)=>i(p=>{const y=p.indexOf(d),h=p.indexOf(g);if(y===-1||h===-1||y===h)return p;const v=[...p];return v.splice(y,1),v.splice(h,0,d),v}),[i]),f=m.useCallback(()=>{Wg(s),n({key:s,pins:[...Vt],persist:!1})},[s]);return{pins:a,pin:c,unpin:u,reorder:l,reset:f,isPinned:d=>a.includes(d),isDefault:Gg(a,Vt)}}function Hg(e,t){return e.isActiveFn?e.isActiveFn(t):t.pathname===e.to||t.pathname.startsWith(`${e.to}/`)}const Zg=r.jsxs("svg",{"data-icon":"pin",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M12 17v5"}),r.jsx("path",{d:"M9 3h6l-1 6 3 3v2H7v-2l3-3z"})]}),Qg=r.jsxs("svg",{"data-icon":"pin-off",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M12 17v5"}),r.jsx("path",{d:"M9 3h6l-1 6 3 3v2H7v-2l3-3z"}),r.jsx("path",{d:"M3 3l18 18"})]}),Yg=r.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),vc="opacity-100 lg:opacity-0 lg:group-hover/row:opacity-100 lg:group-has-[:focus-visible]/row:opacity-100",bc=`absolute right-1.5 top-1/2 -translate-y-1/2 w-[22px] h-[22px] grid place-items-center rounded-[5px] bg-surface-secondary hover:bg-border-strong transition-[opacity,background-color] duration-fast ${vc}`,Jg="linear-gradient(to right, #000 calc(100% - 20px), transparent)",Xg="linear-gradient(to right, transparent, #000 16px)";function ep({text:e,revealed:t,className:s=""}){const o=m.useRef(null),n=m.useRef(null),[a,i]=m.useState(0);m.useLayoutEffect(()=>{const f=o.current,d=n.current;if(!f||!d)return;const g=()=>i(Math.max(0,Math.ceil(d.scrollWidth-f.clientWidth)));if(g(),typeof ResizeObserver>"u")return;const p=new ResizeObserver(g);return p.observe(f),()=>p.disconnect()},[e]);const c=a>0,u=c&&t,l=c?u?Xg:Jg:void 0;return r.jsx("span",{ref:o,title:c?e:void 0,className:`min-w-0 overflow-hidden whitespace-nowrap ${s}`,style:l?{maskImage:l,WebkitMaskImage:l}:void 0,children:r.jsx("span",{ref:n,className:"inline-block motion-reduce:!transform-none motion-reduce:!transition-none",style:{transform:u?`translateX(-${a}px)`:"translateX(0)",transition:`transform ${Math.max(.5,a/45).toFixed(2)}s ease-in-out`},children:e})})}function St({to:e,label:t,group:s,trackLabel:o,icon:n,onClick:a,collapsed:i,isActiveFn:c,hasControl:u=!1,gripInset:l=!1,draggable:f}){const d=qe(),[g,p]=m.useState(!1),y=()=>{we(Ae.NAV_ITEM_CLICKED,{group:s??null,item:o??t}),a?.()};return r.jsxs(ei,{to:e,onClick:y,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onFocus:()=>p(!0),onBlur:()=>p(!1),draggable:f,title:i?t:void 0,className:({isActive:h})=>{const v=c?c(d):h;return`flex items-center gap-2.5 ${i?"lg:justify-center lg:gap-0":""} ${u?`${l?"pl-3.5":"pl-2"} pr-8`:"px-2"} py-2 lg:py-1.5 text-sm lg:text-[0.8125rem] rounded-md transition-colors duration-fast ${v?"bg-surface-tertiary text-text-primary font-medium":"text-text-secondary hover:text-text-primary hover:bg-surface-secondary"}`},children:[r.jsx("span",{className:"w-[18px] h-[18px] shrink-0",children:n}),r.jsx(ep,{text:t,revealed:g,className:i?"lg:hidden":""})]})}function tp({item:e,section:t,pinned:s,onTogglePin:o,onNavigate:n}){return r.jsxs("li",{className:"relative group/row",children:[r.jsx(St,{to:e.to,label:e.label,group:t,icon:e.icon,onClick:n,isActiveFn:e.isActiveFn,hasControl:!0}),r.jsx("button",{type:"button",onClick:()=>o(e.to),"aria-pressed":s,"aria-label":s?`Unpin ${e.label}`:`Pin ${e.label}`,title:s?"Unpin":"Pin to top",className:`${bc} ${s?"text-primary-600 hover:text-primary-500":"text-text-muted hover:text-text-primary"}`,children:s?Qg:Zg})]})}function rp({item:e,onUnpin:t,onNavigate:s,sortable:o}){const n=e.pinLabel??e.label;return r.jsxs("li",{ref:o?.setNodeRef,style:o?.style,className:`relative group/row ${o?.isDragging?"opacity-45 z-10":""}`,"data-testid":`pinned-row-${e.to}`,...o?.rowProps,children:[r.jsx("button",{type:"button","aria-label":`Reorder ${n}`,title:"Drag to reorder",className:`absolute left-0.5 top-1/2 -translate-y-1/2 z-[1] w-2 h-6 grid place-items-center text-[10px] tracking-[-2px] leading-none text-text-muted cursor-grab active:cursor-grabbing touch-none ${vc}`,tabIndex:o?void 0:-1,"aria-hidden":o?void 0:!0,...o?.handleProps,children:r.jsx("span",{"aria-hidden":"true",children:"⋮⋮"})}),r.jsx(St,{to:e.to,label:n,trackLabel:e.label,group:"Pinned",icon:e.icon,onClick:s,isActiveFn:e.isActiveFn,hasControl:!0,gripInset:!0,draggable:!1}),r.jsx("button",{type:"button",onClick:()=>t(e.to),"aria-label":`Unpin ${n}`,title:"Unpin",className:`${bc} text-text-muted hover:text-text-primary`,children:Yg})]})}function sp({items:e,onUnpin:t,onNavigate:s}){return r.jsx("ul",{"aria-label":"Pinned pages",children:e.map(o=>r.jsx(rp,{item:o,onUnpin:t,onNavigate:s},o.to))})}const op=[{label:"Schedule",to:"/schedules/new",permission:de.SCHEDULE_CREATE},{label:"Resource group",to:"/resource-groups?new=1",permission:de.RESOURCE_GROUP_CREATE},{label:"Budget",to:"/budgets?new=1",permission:de.BUDGET_CREATE},{label:"Team",to:"/teams?new=1",permission:de.TEAM_CREATE},{label:"Custom recommendation",to:"/policies?domain=watch",permission:de.POLICY_CREATE},{label:"Cloud account",to:"/settings/cloud-accounts",permission:de.CLOUD_ACCOUNT_CREATE}];function np({collapsed:e=!1}){const[t,s]=m.useState(!1),o=m.useRef(null),n=m.useRef(null),a=m.useRef([]),i=m.useRef(!1),c=pe(),u={[de.SCHEDULE_CREATE]:At(de.SCHEDULE_CREATE),[de.RESOURCE_GROUP_CREATE]:At(de.RESOURCE_GROUP_CREATE),[de.BUDGET_CREATE]:At(de.BUDGET_CREATE),[de.TEAM_CREATE]:At(de.TEAM_CREATE),[de.POLICY_CREATE]:At(de.POLICY_CREATE),[de.CLOUD_ACCOUNT_CREATE]:At(de.CLOUD_ACCOUNT_CREATE)},l=op.filter(p=>u[p.permission]);m.useEffect(()=>{if(!t)return;const p=h=>{o.current&&!o.current.contains(h.target)&&s(!1)};document.addEventListener("mousedown",p);const y=requestAnimationFrame(()=>
3a.current[0]?.focus());return()=>{document.removeEventListener("mousedown",p),cancelAnimationFrame(y),i.current||n.current?.focus(),i.current=!1}},[t]);const f=p=>{const y=a.current.filter(Boolean),h=y.indexOf(document.activeElement);p.key==="Escape"?(p.preventDefault(),s(!1)):p.key==="Tab"?(i.current=!0,s(!1)):p.key==="ArrowDown"?(p.preventDefault(),y[(h+1)%y.length]?.focus()):p.key==="ArrowUp"?(p.preventDefault(),y[(h-1+y.length)%y.length]?.focus()):p.key==="Home"?(p.preventDefault(),y[0]?.focus()):p.key==="End"&&(p.preventDefault(),y[y.length-1]?.focus())},d=()=>{s(p=>(p||we(Ae.NEW_MENU_OPENED),!p))},g=p=>{s(!1),we(Ae.NEW_MENU_ITEM_CLICKED,{item:p.label}),c(p.to)};return l.length===0?null:r.jsxs("div",{className:"relative",ref:o,children:[r.jsxs("button",{type:"button",ref:n,onClick:d,"aria-haspopup":"menu","aria-expanded":t,title:e?"New":void 0,className:`w-full flex items-stretch h-9 rounded-md border border-border-strong text-sm font-medium text-text-primary transition-colors duration-fast ${t?"bg-surface-tertiary":"bg-surface-tertiary/60 hover:bg-surface-tertiary"} ${e?"lg:justify-center":""}`,children:[r.jsx("span",{"aria-hidden":"true",className:`self-center flex items-center justify-center w-5 h-5 rounded bg-primary-600 text-text-inverse shrink-0 ml-[7px] ${e?"lg:ml-0":""}`,children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:r.jsx("path",{d:"M12 6v12M6 12h12"})})}),r.jsx("span",{className:`flex-1 flex items-center pl-[9px] ${e?"lg:hidden":""}`,children:"New"}),r.jsx("span",{"aria-hidden":"true",className:`w-[30px] grid place-items-center border-l border-border-strong text-text-muted ${e?"lg:hidden":""}`,children:r.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`transition-transform duration-fast ${t?"rotate-180":""}`,children:r.jsx("path",{d:"M6 9l6 6 6-6"})})})]}),t&&r.jsx("div",{role:"menu",onKeyDown:f,className:"absolute left-0 right-0 top-full mt-1 z-50 min-w-44 py-1 rounded-md border border-border bg-surface shadow-lg",children:l.map((p,y)=>r.jsx("button",{type:"button",role:"menuitem",ref:h=>{a.current[y]=h},onClick:()=>g(p),className:"w-full text-left px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary hover:bg-surface-secondary focus-visible:bg-surface-secondary focus-visible:text-text-primary focus-visible:outline-none transition-colors duration-fast",children:p.label},p.label))})]})}function ap({onClose:e,items:t}){const[s,o]=m.useState(""),[n,a]=m.useState(0),i=m.useRef(null),c=m.useId(),u=pe(),l=m.useMemo(()=>{const y=s.trim().toLowerCase();return y?t.filter(h=>h.label.toLowerCase().includes(y)||(h.group??"").toLowerCase().includes(y)):t},[t,s]),f=Math.min(n,Math.max(l.length-1,0)),d=l[f]?`${c}-opt-${f}`:void 0;m.useEffect(()=>{we(Ae.COMMAND_PALETTE_OPENED);const y=document.activeElement,h=requestAnimationFrame(()=>i.current?.focus());return()=>{cancelAnimationFrame(h),y?.focus?.()}},[]),m.useEffect(()=>(document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p))),m.useEffect(()=>{d&&document.getElementById(d)?.scrollIntoView?.({block:"nearest"})},[d]);const g=y=>{we(Ae.COMMAND_PALETTE_NAVIGATED,{destination:y.to,item:y.label}),e(),u(y.to)},p=y=>{y.key==="ArrowDown"?(y.preventDefault(),a(Math.min(f+1,l.length-1))):y.key==="ArrowUp"?(y.preventDefault(),a(Math.max(f-1,0))):y.key==="Enter"?(y.preventDefault(),l[f]&&g(l[f])):y.key==="Escape"?(y.preventDefault(),e()):y.key==="Tab"&&(y.preventDefault(),i.current?.focus())};return r.jsx("div",{className:"fixed inset-0 z-[60] flex items-start justify-center pt-[15vh] px-4 bg-black/50 backdrop-blur-sm",onClick:e,role:"dialog","aria-modal":"true","aria-label":"Search navigation",children:r.jsxs("div",{className:"w-full max-w-lg rounded-lg border border-border bg-surface shadow-2xl overflow-hidden",onClick:y=>y.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 border-b border-border",children:[r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"text-text-muted shrink-0",children:[r.jsx("circle",{cx:"11",cy:"11",r:"8"}),r.jsx("path",{d:"M21 21l-4.35-4.35"})]}),r.jsx("input",{ref:i,value:s,onChange:y=>o(y.target.value),placeholder:"Go to…","aria-label":"Search pages",role:"combobox","aria-expanded":"true","aria-controls":c,"aria-activedescendant":d,"aria-autocomplete":"list",className:"w-full h-11 bg-transparent text-sm text-text-primary placeholder:text-text-muted outline-none"}),r.jsx("kbd",{className:"text-[0.6875rem] text-text-muted border border-border rounded px-1.5 py-0.5 shrink-0",children:"esc"})]}),r.jsxs("ul",{id:c,className:"max-h-80 overflow-y-auto overscroll-contain py-1",role:"listbox",children:[l.length===0&&r.jsx("li",{className:"px-3 py-6 text-sm text-text-muted text-center",children:"No matching pages"}),l.map((y,h)=>r.jsxs("li",{id:`${c}-opt-${h}`,role:"option","aria-selected":h===f,onClick:()=>g(y),onMouseMove:()=>a(h),className:`flex items-center justify-between gap-3 px-3 py-2 text-sm cursor-pointer transition-colors duration-fast ${h===f?"bg-surface-secondary text-text-primary":"text-text-secondary"}`,children:[r.jsx("span",{children:y.label}),y.group&&r.jsx("span",{className:"text-[0.6875rem] text-text-muted uppercase tracking-wide shrink-0",children:y.group})]},y.to))]})]})})}const fa={success:"bg-success-400/10 text-success-600",danger:"bg-danger-400/10 text-danger-500",warning:"bg-warning-400/10 text-warning-700",orange:"bg-[rgba(249,115,22,0.1)] text-[#f97316]",info:"bg-primary-400/10 text-primary-600",blue:"bg-[rgba(59,130,246,0.1)] text-[#3b82f6]",neutral:"bg-neutral-500/10 text-neutral-600"},er=m.forwardRef(function({variant:t="neutral",children:s,className:o="",...n},a){return r.jsx("span",{ref:a,className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium tracking-wide ${fa[t]||fa.neutral} ${o}`,...n,children:s})});function yt({content:e,placement:t="bottom",className:s="",onlyOnOverflow:o=!1,wrapDisabled:n=!1,wrapClassName:a="inline-flex",interactive:i=!1,open:c,children:u}){const[l,f]=m.useState(!1),d=c!==void 0?c:l,g=m.useCallback(E=>{if(c===void 0){if(E&&o){const L=p.reference.current,P=L?.firstElementChild??L;if(P&&P.scrollWidth<=P.clientWidth&&P.scrollHeight<=P.clientHeight)return}f(E)}},[o,c]),{refs:p,floatingStyles:y,context:h}=Qi({open:d,onOpenChange:g,placement:t,whileElementsMounted:Vi,middleware:[Wi(4),Ki(),Gi({padding:8})]}),v=gm(h,{move:!1,handleClose:i?Cm():null}),x=km(h),b=_m(h),{getReferenceProps:w,getFloatingProps:A}=Em([v,x,b]);return r.jsxs(r.Fragment,{children:[n?r.jsx("span",{ref:p.setReference,tabIndex:e?0:void 0,className:a,...w(),children:u}):m.cloneElement(u,{ref:p.setReference,...w()}),d&&e&&r.jsx(Zi,{children:r.jsx("div",{ref:p.setFloating,style:y,...A(),className:`z-[9999] bg-surface-tertiary text-text-primary border border-border-default text-[11px] px-2 py-1.5 rounded shadow-lg max-w-[360px] break-words ${s}`,children:e})})]})}const wc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20fill='%2329b5e8'%3e%3cpath%20d='M9.86%2015.298l13.008%207.8a3.72%203.72%200%200%200%204.589-.601%204.01%204.01%200%200%200%201.227-2.908V3.956a3.81%203.81%200%200%200-1.861-3.42%203.81%203.81%200%200%200-3.893%200%203.81%203.81%200%200%200-1.861%203.42v8.896l-7.387-4.43a3.79%203.79%200%200%200-2.922-.4c-.986.265-1.818.94-2.3%201.844-1.057%201.9-.44%204.28%201.4%205.422m31.27%207.8l13.008-7.8c1.84-1.143%202.458-3.533%201.4-5.424a3.75%203.75%200%200%200-5.22-1.452l-7.3%204.37v-8.84a3.81%203.81%200%201%200-7.615%200v15.323a4.08%204.08%200%200%200%20.494%202.367c.482.903%201.314%201.57%202.3%201.844a3.71%203.71%200%200%200%202.922-.4M29.552%2031.97c.013-.25.108-.5.272-.68l1.52-1.58a1.06%201.06%200%200%201%20.658-.282h.057a1.05%201.05%200%200%201%20.656.282l1.52%201.58a1.12%201.12%200%200%201%20.272.681v.06a1.13%201.13%200%200%201-.272.683l-1.52%201.58a1.04%201.04%200%200%201-.656.284h-.057c-.246-.014-.48-.115-.658
3-.284l-1.52-1.58a1.13%201.13%200%200%201-.272-.683zm-4.604-.65v1.364a1.54%201.54%200%200%200%20.372.93l5.16%205.357a1.42%201.42%200%200%200%20.895.386h1.312a1.42%201.42%200%200%200%20.895-.386l5.16-5.357a1.54%201.54%200%200%200%20.372-.93V31.32a1.54%201.54%200%200%200-.372-.93l-5.16-5.357a1.42%201.42%200%200%200-.895-.386h-1.312a1.42%201.42%200%200%200-.895.386L25.32%2030.4a1.55%201.55%200%200%200-.372.93M3.13%2027.62l7.365%204.417L3.13%2036.45a4.06%204.06%200%200%200-1.399%205.424%203.75%203.75%200%200%200%202.3%201.844c.986.274%202.042.133%202.922-.392l13.008-7.8c1.2-.762%201.9-2.078%201.9-3.492a4.16%204.16%200%200%200-1.9-3.492l-13.008-7.8a3.79%203.79%200%200%200-2.922-.4c-.986.265-1.818.94-2.3%201.844-1.057%201.9-.44%204.278%201.4%205.422m38.995%204.442a4%204%200%200%200%201.91%203.477l13%207.8c.88.524%201.934.666%202.92.392s1.817-.94%202.3-1.843a4.05%204.05%200%200%200-1.4-5.424L53.5%2032.038l7.365-4.417c1.84-1.143%202.457-3.53%201.4-5.422a3.74%203.74%200%200%200-2.3-1.844c-.987-.274-2.042-.134-2.92.4l-13%207.8a4%204%200%200%200-1.91%203.507M25.48%2040.508a3.7%203.7%200%200%200-2.611.464l-13.008%207.8c-1.84%201.143-2.456%203.53-1.4%205.422.483.903%201.314%201.57%202.3%201.843a3.75%203.75%200%200%200%202.922-.392l7.387-4.43v8.83a3.81%203.81%200%201%200%207.614%200V44.4a3.91%203.91%200%200%200-3.205-3.903m28.66%208.276l-13.008-7.8a3.75%203.75%200%200%200-2.922-.392%203.74%203.74%200%200%200-2.3%201.843%204.09%204.09%200%200%200-.494%202.37v15.25a3.81%203.81%200%201%200%207.614%200V51.28l7.287%204.37a3.79%203.79%200%200%200%202.922.4c.986-.265%201.818-.94%202.3-1.844%201.057-1.9.44-4.28-1.4-5.422'/%3e%3c/svg%3e";function Ac({className:e="h-4 w-4 shrink-0"}){return r.jsx("svg",{className:e,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:r.jsx("path",{fill:"#FF3621",d:"M1.155,4.93v.512L9,9.868l7.006-3.957,0,1.6L9,11.491,1.55,7.258l-.395.22V10.54L9,14.955l7.006-3.942,0,1.586L9,16.581,1.55,12.347l-.395.22v.519L9,17.5l7.845-4.414V10.021l-.4-.218L9,14.036,1.992,10.054V8.476L9,12.414,16.845,8V4.978l-.4-.219L9,8.993,2.352,5.215,9,1.46l5.476,3.094.479-.269V3.863L9,.5Z"})})}function _c({className:e="h-4 w-4 shrink-0"}){return r.jsxs("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[r.jsx("path",{fill:"#f25022",d:"M2 2h9.2v9.2H2z"}),r.jsx("path",{fill:"#7fba00",d:"M12.8 2H22v9.2h-9.2z"}),r.jsx("path",{fill:"#00a4ef",d:"M2 12.8h9.2V22H2z"}),r.jsx("path",{fill:"#ffb900",d:"M12.8 12.8H22V22h-9.2z"})]})}function Sc({className:e="h-4 w-4 shrink-0"}){return r.jsxs("svg",{className:e,viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[r.jsx("path",{fill:"#c62828",d:"M44,24c0,0.33-0.01,0.66-0.03,0.99c-0.01,0.13-0.01,0.26-0.03,0.39C43.24,35.79,34.59,44,24,44 c-5.72,0-10.88-2.4-14.51-6.25c-0.03-0.02-0.05-0.05-0.07-0.07c-0.63-0.67-1.22-1.39-1.75-2.14l7.02-2.48 c0.67,0.7,1.43,1.32,2.25,1.85c0.06,0.04,0.11,0.07,0.17,0.1C19.1,36.27,21.47,37,24,37c5.74,0,10.61-3.73,12.33-8.88 c0.05-0.12,0.08-0.24,0.12-0.36c0.24-0.82,0.41-1.67,0.49-2.55l7.01-2.48C43.99,23.15,44,23.57,44,24z"}),r.jsx("path",{fill:"#d32f2f",d:"M24,4C12.95,4,4,12.95,4,24c0,0.41,0.01,0.82,0.04,1.23l7.02-2.47C11.68,16.16,17.24,11,24,11 c3.64,0,6.94,1.5,9.29,3.92l7.02-2.48C36.7,7.33,30.74,4,24,4z"}),r.jsx("path",{fill:"#c62828",d:"M14.19,25.4l-6.65,2.35c-0.17-0.71-0.31-1.44-0.41-2.19c-0.06-0.45-0.1-0.92-0.13-1.38l7.02-2.47 c-0.04,0.41-0.06,0.82-0.06,1.24v0.16C13.97,23.89,14.05,24.66,14.19,25.4z"}),r.jsx("path",{fill:"#c62828",d:"M45.09,14.5l-6.65,2.35c-0.38-0.72-0.83-1.4-1.35-2.03c-0.26-0.33-0.54-0.65-0.84-0.95l7.02-2.48 c0.23,0.32,0.45,0.65,0.66,0.98C44.36,13.05,44.75,13.76,45.09,14.5z"}),r.jsx("path",{fill:"#e53935",d:"M11.71,34.16l-7.02,2.48c-1.42-2.01-2.48-4.28-3.09-6.74l6.65-2.35C8.74,30.1,9.97,32.38,11.71,34.16z"}),r.jsx("path",{fill:"#e53935",d:"M33.96,26.31c0.04-0.4,0.06-0.8,0.06-1.21c0-2.2-0.55-4.28-1.52-6.1l6.65-2.35 c1.03,2.2,1.67,4.63,1.82,7.18L33.96,26.31z"}),r.jsx("path",{fill:"#ad213b",d:"M16.94,34.91c0.06,0.04,0.11,0.07,0.17,0.1l-7.62,2.74c-0.03-0.02-0.05-0.05-0.07-0.07 c-0.63-0.67-1.22-1.39-1.75-2.14l7.02-2.48C15.36,33.76,16.12,34.38,16.94,34.91z"}),r.jsx("path",{fill:"#ad213b",d:"M44,24c0,0.33-0.01,0.66-0.03,0.99c-0.01,0.13-0.01,0.26-0.03,0.39l-7.61,2.74 c0.05-0.12,0.08-0.24,0.12-0.36c0.24-0.82,0.41-1.67,0.49-2.55l7.01-2.48C43.99,23.15,44,23.57,44,24z"}),r.jsx("path",{fill:"#ad213b",d:"M7,24.18l7.02-2.47c-0.04,0.41-0.06,0.82-0.06,1.24v0.16l-6.83,2.45C7.07,25.11,7.03,24.64,7,24.18z"}),r.jsx("path",{fill:"#ad213b",d:"M43.93,12.37l-6.84,2.45c-0.26-0.33-0.54-0.65-0.84-0.95l7.02-2.48C43.5,11.71,43.72,12.04,43.93,12.37z"})]})}function ip(){return r.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.374 6.18 6.18 0 0 1-.248-.47c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59
3-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.032-.863.104-.296.072-.583.16-.863.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.024c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.28-.144.616-.264 1.01-.36a4.84 4.84 0 0 1 1.244-.152c.95 0 1.644.216 2.091.647.44.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.264-.168.312a.549.549 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.216-.151-.248-.223a.504.504 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.415-.287-.806-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.176 0 .36.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.878.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z",fill:"currentColor"}),r.jsx("path",{d:"M21.725 16.92C19.16 18.89 15.35 19.94 12.07 19.94c-4.578 0-8.702-1.693-11.818-4.51-.247-.223-.024-.527.272-.352 3.364 1.955 7.523 3.136 11.818 3.136 2.898 0 6.085-.6 9.02-1.845.44-.2.814.288.383.55z",fill:"#FF9900"}),r.jsx("path",{d:"M22.638 15.867c-.335-.43-2.219-.207-3.068-.104-.255.032-.295-.192-.064-.36 1.5-1.053 3.967-.75 4.254-.394.287.36-.08 2.826-1.485 4.007-.216.183-.423.088-.327-.152.32-.79 1.03-2.57.69-2.997z",fill:"#FF9900"})]})}function cp(){return r.jsxs("svg",{className:"w-full h-full",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[r.jsx("path",{fill:"#1976d2",d:"M38.193,18.359c-0.771-2.753-2.319-5.177-4.397-7.03l-4.598,4.598c1.677,1.365,2.808,3.374,3.014,5.648v1.508c0.026,0,0.05-0.008,0.076-0.008c2.322,0,4.212,1.89,4.212,4.212S34.61,31.5,32.288,31.5c-0.026,0-0.05-0.007-0.076-0.008V31.5h-6.666H24V38h8.212v-0.004c0.026,0,0.05,0.004,0.076,0.004C38.195,38,43,33.194,43,27.288C43,23.563,41.086,20.279,38.193,18.359z"}),r.jsx("path",{fill:"#ff3d00",d:"M24,7.576c-8.133,0-14.75,6.617-14.75,14.75c0,0.233,0.024,0.46,0.035,0.69h6.5c-0.019-0.228-0.035-0.457-0.035-0.69c0-4.549,3.701-8.25,8.25-8.25c1.969,0,3.778,0.696,5.198,1.851l4.598-4.598C31.188,9.003,27.761,7.576,24,7.576z"}),r.jsx("path",{fill:"#4caf50",d:"M15.712,31.5L15.712,31.5c-0.001,0-0.001,0-0.002,0c-0.611,0-1.188-0.137-1.712-0.373l-4.71,4.71C11.081,37.188,13.301,38,15.71,38c0.001,0,0.001,0,0.002,0v0H24v-6.5H15.712z"}),r.jsx("path",{fill:"#ffc107",d:"M11.5,27.29c0-2.32,1.89-4.21,4.21-4.21c1.703,0,3.178,1.023,3.841,2.494l4.717-4.717c-1.961-2.602-5.065-4.277-8.559-4.277C9.81,16.58,5,21.38,5,27.29c0,3.491,1.691,6.59,4.288,8.547l4.71-4.71C12.53,30.469,11.5,28.999,11.5,27.29z"})]})}function lp(){const e=m.useId().replace(/:/g,""),t=`azure-${e}-a`,s=`azure-${e}-b`,o=`azure-${e}-c`;return r.jsxs("svg",{className:"w-full h-full",role:"img","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:t,x1:"-1254.397",x2:"-1261.911",y1:"877.268",y2:"899.466",gradientTransform:"translate(1981.75 -1362.063) scale(1.5625)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:"0",stopColor:"#114a8b"}),r.jsx("stop",{offset:"1",stopColor:"#0669bc"})]}),r.jsxs("linearGradient",{id:s,x1:"-1252.05",x2:"-1253.788",y1:"887.612",y2:"888.2",gradientTransform:"translate(1981.75 -1362.063) scale(1.5625)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:"0",stopOpacity:".3"}),r.jsx("stop",{offset:".071",stopOpacity:".2"}),r.jsx("stop",{offset:".321",stopOpacity:".1"}),r.jsx("stop",{offset:".623",stopOpacity:".05"}),r.jsx("stop",{offset:"1",stopOpacity:"0"})]}
3),r.jsxs("linearGradient",{id:o,x1:"-1252.952",x2:"-1244.704",y1:"876.6",y2:"898.575",gradientTransform:"translate(1981.75 -1362.063) scale(1.5625)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:"0",stopColor:"#3ccbf4"}),r.jsx("stop",{offset:"1",stopColor:"#2892df"})]})]}),r.jsx("path",{fill:`url(#${t})`,d:"M17.634,6h11.305L17.203,40.773c-0.247,0.733-0.934,1.226-1.708,1.226H6.697 c-0.994,0-1.8-0.806-1.8-1.8c0-0.196,0.032-0.39,0.094-0.576L15.926,7.227C16.173,6.494,16.86,6,17.634,6L17.634,6z"}),r.jsx("path",{fill:"#0078d4",d:"M34.062,29.324H16.135c-0.458-0.001-0.83,0.371-0.831,0.829c0,0.231,0.095,0.451,0.264,0.608 l11.52,10.752C27.423,41.826,27.865,42,28.324,42h10.151L34.062,29.324z"}),r.jsx("path",{fill:`url(#${s})`,d:"M17.634,6c-0.783-0.003-1.476,0.504-1.712,1.25L5.005,39.595 c-0.335,0.934,0.151,1.964,1.085,2.299C6.286,41.964,6.493,42,6.702,42h9.026c0.684-0.122,1.25-0.603,1.481-1.259l2.177-6.416 l7.776,7.253c0.326,0.27,0.735,0.419,1.158,0.422h10.114l-4.436-12.676l-12.931,0.003L28.98,6H17.634z"}),r.jsx("path",{fill:`url(#${o})`,d:"M32.074,7.225C31.827,6.493,31.141,6,30.368,6h-12.6c0.772,0,1.459,0.493,1.705,1.224 l10.935,32.399c0.318,0.942-0.188,1.963-1.13,2.281C29.093,41.968,28.899,42,28.703,42h12.6c0.994,0,1.8-0.806,1.8-1.801 c0-0.196-0.032-0.39-0.095-0.575L32.074,7.225z"})]})}function up(){return r.jsx("img",{src:wc,alt:"Snowflake",className:"w-full h-full"})}function dp(){return r.jsx(Ac,{className:"w-full h-full"})}function fp(){return r.jsx("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"#000000",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M21.6 9.9a5.8 5.8 0 0 0-.5-4.8 5.9 5.9 0 0 0-6.3-2.8A5.8 5.8 0 0 0 4.6 4.6a5.8 5.8 0 0 0-3.9 2.8 5.9 5.9 0 0 0 .7 6.9 5.8 5.8 0 0 0 .5 4.8 5.9 5.9 0 0 0 6.3 2.8 5.8 5.8 0 0 0 10.2-2.3 5.8 5.8 0 0 0 3.9-2.8 5.9 5.9 0 0 0-.7-6.9Zm-8.7 12.2a4.3 4.3 0 0 1-2.8-1l5.6-3.2a.9.9 0 0 0 .5-.8V9.2l2.4 1.4v5.5a4.4 4.4 0 0 1-5.7 6Zm-9.4-4a4.3 4.3 0 0 1-.5-2.9l5.6 3.2a.9.9 0 0 0 .9 0l5.8-3.3v2.7L9.9 21a4.4 4.4 0 0 1-6-1.6Zm-1.5-12a4.3 4.3 0 0 1 2.3-1.9v5.6a.9.9 0 0 0 .4.8l5.8 3.3-2.4 1.4-5.6-3.2a4.4 4.4 0 0 1-.5-6Zm16.5 3.8L13.2 6.6l2.4-1.4 5.6 3.2a4.4 4.4 0 0 1-.7 7.9v-5.6a.9.9 0 0 0-.4-.8Zm2.4-3.5-5.6-3.3a.9.9 0 0 0-.9 0L8.6 5.9V3.2A4.4 4.4 0 0 1 16.5 6l-.1.1Zm-12.6 4.7-2.4-1.4V8.2a4.4 4.4 0 0 1 7.2-3.4l-5.6 3.2a.9.9 0 0 0-.5.8Zm1.3-2.8L12 8.9l3.1 1.8v3.6L12 16.1l-3.1-1.8Z"})})}function mp(){return r.jsx("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"#D97757",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M15.4 4h-3l5 16h3l-5-16Zm-7.1 0L3.3 20h3.1l1-2.9h5.3l1 2.9h3.1L11.8 4H8.3Zm.1 9.6 1.7-5 1.7 5H8.4Z"})})}function gp(){return r.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"none",stroke:"#4F46E5",strokeWidth:"2",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M3 7h6l3 5 3-5h6M3 17h6l3-5 3 5h6",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("circle",{cx:"12",cy:"12",r:"1.6",fill:"#4F46E5",stroke:"none"})]})}function ma(){return r.jsx("svg",{className:"w-full h-full",viewBox:"0 0 24 24",fill:"#FF9900",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("path",{d:"M12 2 3 6.5v11L12 22l9-4.5v-11L12 2Zm0 2.2 6.5 3.3L12 10.8 5.5 7.5 12 4.2ZM5 9.1l6 3v7.2l-6-3V9.1Zm8 10.2V12l6-3v7.3l-6 3Z"})})}function pp(){return r.jsx(Sc,{className:"w-full h-full"})}function hp(){return r.jsx(_c,{className:"w-full h-full"})}const yp={aws:{label:"AWS",Svg:ip},gcp:{label:"GCP",Svg:cp},azure:{label:"Azure",Svg:lp},snowflake:{label:"Snowflake",Svg:up},databricks:{label:"Databricks",Svg:dp},openshift:{label:"Red Hat OpenShift",Svg:pp},microsoft365:{label:"Microsoft 365",Svg:hp},openai:{label:"OpenAI",Svg:fp},anthropic:{label:"Anthropic",Svg:mp},openrouter:{label:"OpenRouter",Svg:gp},bedrock:{label:"AWS Bedrock",Svg:ma},aws_bedrock:{label:"AWS Bedrock",Svg:ma}};function Go({provider:e,className:t="w-5 h-5"}){const s=e?.toLowerCase(),o=yp[s];return o?r.jsx(yt,{content:o.label,children:r.jsx("span",{className:`inline-flex items-center justify-center shrink-0 ${t}`,"aria-label":o.label,children:r.jsx(o.Svg,{})})}):r.jsx(yt,{content:e,children:r.jsx("span",{className:`inline-flex items-center justify-center rounded text-[9px] font-bold text-white bg-text-muted shrink-0 ${t}`,children:(e||"?").charAt(0).toUpperCase()})})}const xp={nodePools:"gke-nodepool,eks-nodegroup,aks-agentpool,openshift-machinepool"};function vp(e){if(!e)return[];const t=[e];return e.includes("/zones/")?t.push(e.replace("/zones/","/locations/")):e.includes("/locations/")&&t.push(e.replace("/locations/","/zones/")),t}async function bp(e,t,{limit:s=50,page:o=1,include:n="metadata"}={}){const a=vp(e),i=await Promise.all(a.map(d=>H.get("/resources",{view:"children",parent_uid:d,type:t,include:n,page:o,limit:s}).catch(()=>({items:[],total:0,hasMore:!1})))),c=new Set,u=[];let l=0,f=!1;for(const d of i){l=Math.max(l,d?.total??0),d?.hasMore&&(f=!0);for(const g of d?.items??[]){const p=g.id||g.uid;
3c.has(p)||(c.add(p),u.push(g))}}return{items:u,total:l,hasMore:f,page:o,limit:s}}function E2({search:e="",page:t=1,limit:s=10,provider:o="",status:n=""}={}){const a={"":"gke-cluster,aks-cluster,eks-cluster,openshift-cluster",aws:"eks-cluster",gcp:"gke-cluster",azure:"aks-cluster",openshift:"openshift-cluster"},i={type:a[o]||a[""],view:"parents",page:t,limit:s};return e&&(i.search=e),n&&(i.status=n),re({queryKey:["k8s-clusters",e,t,s,o,n],queryFn:()=>H.get("/resources",i),refetchInterval:6e4})}function wp(e){return re({queryKey:["k8s-cluster",e],queryFn:()=>H.get(`/resources/${e}`),enabled:!!e,staleTime:3e4,placeholderData:go})}function R2(e){return re({queryKey:["k8s-nodepools",e],queryFn:()=>bp(e,xp.nodePools,{limit:20}),enabled:!!e,staleTime:3e4})}function j2(){return me({mutationFn:({provider:e,region:t,resourceType:s,cloudAccountId:o,resourceUid:n,name:a,config:i})=>H.post("/provisioning-jobs",{kind:"update",provider:e,region:t,resourceType:s,cloudAccountId:o,resourceUid:n,name:a,config:i})})}function C2(e,t=!0,s=!1){return re({queryKey:["k8s-live-probe",e],queryFn:async()=>{try{return await H.get(`/resources/${e}/live`,{type:"namespace",limit:1}),{accessible:!0}}catch(o){if(o.status===424||o.message?.includes("forbidden")||o.message?.includes("unauthorized"))return{accessible:!1,principal:o.message?.match(/User\s+"([^"]+)"/)?.[1]||null,message:o.message};throw o}},enabled:!!e&&t,staleTime:1/0,refetchOnMount:!1,refetchOnReconnect:!1,retry:!1,refetchInterval:o=>s&&!o.state.data?.accessible?s:!1,refetchIntervalInBackground:!!s,refetchOnWindowFocus:!!s})}function N2(e,{enabled:t=!0}={}){return re({queryKey:["k8s-cluster-access",e],queryFn:async()=>{try{return await H.get(`/resources/${e}/access`)}catch(s){if(s.status===401||s.status===403)return{accessible:!1,principal:null};throw s}},enabled:t&&!!e,staleTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1})}function O2(e,t=!0){return re({queryKey:["openshift-access-methods",e],queryFn:()=>H.get(`/resources/${e}/access/methods`),enabled:!!e&&t,staleTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1,retry:!1})}function T2(){const e=ke();return me({mutationFn:({clusterResId:t,method:s,username:o,password:n,token:a})=>H.put(`/resources/${t}/access`,{method:s,username:o,password:n,token:a}),onSuccess:(t,{clusterResId:s})=>{kc(e,s)}})}function M2(){const e=ke();return me({mutationFn:({clusterResId:t})=>H.del(`/resources/${t}/access`),onSuccess:(t,{clusterResId:s})=>{kc(e,s),fe.success("Cluster disconnected")}})}function L2(e,t=!0){return re({queryKey:["openshift-account-clusters",e],queryFn:()=>H.get("/resources",{type:"openshift-cluster",view:"parents",cloud_account_id:e,limit:100}),enabled:!!e&&t})}function P2(e,t=!0){return re({queryKey:["openshift-cluster-access",e],queryFn:()=>H.get("/resources/access",{cloud_account_id:e}),enabled:!!e&&t,retry:!1})}function kc(e,t){for(const s of[["k8s-cluster-access",t],["k8s-live-probe",t],["openshift-access-methods",t]])e.invalidateQueries({queryKey:s});e.invalidateQueries({queryKey:["openshift-cluster-access"]})}function D2(e=[]){const[t,s]=m.useState([""]),[o,n]=m.useState(0),a=t[o]||"",i=m.useCallback(l=>{s(f=>[...f.slice(0,o+1),l]),n(f=>f+1)},[o]),c=m.useCallback(()=>{n(l=>Math.max(0,l-1))},[]),u=m.useCallback(()=>{s([""]),n(0)},[]);return m.useEffect(()=>{u()},e),{page:o+1,currentToken:a||void 0,goNext:i,goPrev:c,reset:u}}
3const Ec="k8s-live-children",Ap="k8s-live-children-all";function ae(e,t,s,o={}){const n={type:t};return s&&s!=="all"&&(n.ns=s),o.search&&(n.search=o.search),o.limit&&(n.limit=o.limit),o.continue&&(n.continue=o.continue),o.node&&(n.node=o.node),re({queryKey:[Ec,e,t,s,o.continue,o.search,o.limit,o.node],queryFn:()=>H.get(`/resources/${e}/live`,n),enabled:!!e,refetchInterval:o.interval??6e4,staleTime:o.staleTime??5e3,placeholderData:go})}const _p=20;function I2(e,t,s,o={}){const n={type:t,limit:500};return re({queryKey:[Ap,e,t,s],queryFn:async()=>{let a=[],i="",c=0;do{const u={...n};i&&(u.continue=i);const l=await H.get(`/resources/${e}/live`,u);a=a.concat(l?.items??[]),i=l?.continue??"",c++}while(i&&c<_p);return{items:a}},enabled:!!e,refetchInterval:o.interval??6e4,staleTime:o.staleTime??15e3})}function F2(e,t,s={}){return ae(e,"pod",t,s)}function z2(e,t,s){return ae(e,"event",t,{interval:6e4,...s})}function Sp(e,t){return ae(e,"namespace",null,{interval:6e4,staleTime:6e4,...t})}function U2(e,t,s){return ae(e,"daemonset",t,s)}function B2(e,t,s){return ae(e,"job",t,s)}function $2(e,t,s){return ae(e,"cronjob",t,s)}function V2(e,t,s){return ae(e,"replicaset",t,s)}function q2(e,t,s){return ae(e,"statefulset",t,s)}function W2(e,t,s){return ae(e,"service",t,s)}function G2(e,t,s){return ae(e,"ingress",t,s)}function K2(e,t,s){return ae(e,"endpoint",t,s)}function H2(e,t,s){return ae(e,"networkpolicy",t,s)}
3function Z2(e,t,s){return ae(e,"configmap",t,s)}function Q2(e,t,s){return ae(e,"secret",t,s)}function Y2(e,t,s){return ae(e,"hpa",t,s)}function J2(e,t,s){return ae(e,"resourcequota",t,s)}function X2(e,t,s){return ae(e,"limitrange",t,s)}function ev(e,t,s){return ae(e,"serviceaccount",t,s)}function tv(e,t,s){return ae(e,"pvc",t,s)}function rv(e,t){return ae(e,"pv",null,t)}function sv(e,t){return ae(e,"storageclass",null,t)}function ov(e,t){return ae(e,"crd",null,{interval:6e4,...t})}function nv(e,t){return ae(e,"node",null,t)}function av(e,t,s){return ae(e,"route",t,s)}function iv(e,t,s){return ae(e,"deploymentconfig",t,s)}function cv(e,t,s){return ae(e,"buildconfig",t,s)}function lv(e,t,s){return ae(e,"imagestream",t,s)}function uv(e,t){return ae(e,"project",null,t)}function kp(e,t){return re({queryKey:["k8s-pod-metrics",e],queryFn:()=>H.get(`/resources/${e}/metrics/live`,{scope:"pods",uid:t}),enabled:!!e&&!!t,refetchInterval:6e4,staleTime:15e3})}function dv(e,t){const{data:s}=kp(e,t);return m.useMemo(()=>{const o={};for(const n of s?.pods??[])for(const a of n.containers??[])o[`${n.namespace}/${n.name}/${a.name}`]=a;return o},[s])}const Ep=["pod","deployment","service","statefulset","daemonset","configmap","cronjob","ingress"];function fv(e,t,s){return re({queryKey:["k8s-search",e,t,s],queryFn:async()=>{const o=a=>{const i={type:a,search:t,limit:10};return s&&s!=="all"&&(i.ns=s),i};return(await Promise.all(Ep.map(a=>H.get(`/resources/${e}/live`,o(a)).then(i=>(i?.items??[]).map(c=>({...c,kind:c.kind||a.charAt(0).toUpperCase()+a.slice(1)}))).catch(()=>[])))).flat()},enabled:!!e&&!!t&&t.length>=2,staleTime:1e4})}function mv(e,t,s,o){return re({queryKey:["k8s-detail",e,t,s,o],queryFn:()=>{const n={kind:t,name:o};return s&&s!=="all"&&(n.ns=s),H.get(`/resources/${e}/live`,n)},enabled:!!e&&!!t&&!!o,staleTime:1e4})}function gv(){const e=ke();return me({mutationFn:({clusterResId:t,kind:s,namespace:o,name:n,provider:a,region:i,cloudAccountId:c,clusterName:u,clusterUid:l})=>{const f=o||"-",d=new URLSearchParams({provider:a,region:i,cloudAccountId:c,clusterName:u,clusterUid:l}).toString();return H.del(`/resources/${t}/children/${s}/${f}/${n}?${d}`)},onSuccess:()=>{e.invalidateQueries({queryKey:["k8s-live"]}),e.invalidateQueries({queryKey:[Ec]}),e.invalidateQueries({queryKey:["k8s-namespaces"]}),e.invalidateQueries({queryKey:["k8s-cluster-resources"]}),fe.success("Resource deleted")},onError:t=>fe.error(t?.message??"Failed to delete resource")})}const Rp=["eks-","gke-","aks-"];function jp(e){return typeof e=="string"&&Rp.some(t=>e.startsWith(t))}const ga=100,Ds=1e3;function Cp(e){const t=Array.isArray(e?.evidenceMetrics)?e.evidenceMetrics:[],s=Array.isArray(e?.nonMetricEvidence)?e.nonMetricEvidence:[];return{id:e?.id,resource_uid:e?.resourceUid??"",situation:{rule_type:e?.ruleType||e?.title||e?.ruleId||"recommendation",category:e?.category??"",severity:e?.severity??"",evidence:[...t.map(o=>({metric:o?.metricName,value:o?.average,unit:o?.unit,stat:"avg"})),...s.map(o=>({metric:o?.label,value:o?.value,kind:o?.kind??"property"}))],detected_at:e?.generatedAt}}}async function Np(){const e=new Map,t=[];let s=1,o=!1;for(let n=0;n<Ds;n++){const a=await H.get("/recommendations",{status:"open",page:s,limit:ga}),i=a?.items??[];if(i.length===0)break;for(const c of i){if(!jp(c?.resourceType))continue;const u=Cp(c);u.id?e.set(u.id,u):t.push(u)}if(s+=1,a?.hasMore===!1||a?.hasMore!==!0&&i.length<ga)break;n===Ds-1&&(o=!0)}return o&&console.warn(`[useK8sRecommendations] MAX_PAGES (${Ds}) reached at page=${s}; additional recommendations may exist but were not fetched.`),{items:[...e.values(),...t]}}function Op(){return re({queryKey:["recommendations","k8s","paginated"],queryFn:Np,staleTime:300*1e3,select:e=>{const t=e?.items??[],s=new Map;for(const o of t){const n=o?.resource_uid??"";if(!n)continue;const a=s.get(n)??[];a.push(o),s.set(n,a)}return{items:t,byResource:s}}})}const pa=500,Tp=50,Mp=new Set(["gke-nodepool","eks-nodegroup","aks-nodepool","aks-agentpool"]);function Lp(e){if(!e)return[];const t=[e];return e.includes("/zones/")?t.push(e.replace("/zones/","/locations/")):e.includes("/locations/")&&t.push(e.replace("/locations/","/zones/")),t}async function ha(e){const t=Lp(e),s=[],o=new Set;for(const n of t){let a=1;for(let i=0;i<Tp;i++){const c=await H.get("/resources",{view:"children",parent_uid:n,include:"metadata",page:a,limit:pa}),u=c?.items??[];for(const l of u){const f=l.id||l.uid;o.has(f)||(o.add(f),s.push(l))}if(!c?.hasMore||u.length<pa)break;a++}}return s}function Pp(e){return re({queryKey:["k8s-cluster-descendant-uids",e],enabled:!!e,staleTime:3e4,queryFn:async()=>{const t=await ha(e),s=t.filter(a=>Mp.has(a.type)).map(a=>
3a.uid).filter(Boolean);let o=[];s.length>0&&(o=(await Promise.all(s.map(ha))).flat());const n=new Set([e]);for(const a of t)a.uid&&n.add(a.uid);for(const a of o)a.uid&&n.add(a.uid);return n}})}const ya=new Map;function Dp(e){const t=e?.uid,s=Op(),o=Pp(t),n=m.useMemo(()=>{const c=s.data?.items??[],u=s.data?.byResource??ya;if(!t)return{items:c,byResource:u};const l=o.data;if(!l)return{items:[],byResource:ya};const f=c.filter(g=>l.has(g.resource_uid)),d=new Map;for(const[g,p]of u.entries())l.has(g)&&d.set(g,p);return{items:f,byResource:d}},[t,s.data,o.data]),a=!!t&&o.isLoading,i=!!t&&o.isError;return{items:n.items,byResource:n.byResource,isLoading:s.isLoading||a,isError:s.isError||i,error:s.error||(i?o.error:void 0),refetch:()=>{s.refetch?.(),o.refetch?.()}}}const Ip={k8s_minreplicas_below_two:{title:"Workload running with fewer than 2 replicas",description:"A single-replica workload has no availability slack — one node drain or pod restart takes it to zero.",category:"Reliability",severity:"high",fix:"Bump spec.replicas to >= 2, or set the HPA minReplicas floor."},k8s_singleton_with_hpa:{title:"HPA configured with minReplicas: 1",description:"Even with the autoscaler, one disruption can take all replicas down before HPA can react.",category:"Reliability",severity:"high",fix:"Raise the HPA minReplicas floor to 2 or more."},k8s_no_pdb:{title:"Multi-replica workload has no PodDisruptionBudget",description:"Without a PDB, voluntary disruptions (node drain, kubectl drain) can take all replicas down at once.",category:"Reliability",severity:"medium",fix:"Add a PDB with minAvailable that matches this workload's selector."},k8s_liveness_equals_readiness:{title:"Liveness and readiness probes share path + port",description:"Liveness can kill the pod; readiness only gates traffic. Sharing the handler means a slow-warming pod gets killed instead of just unready-listed.",category:"Reliability",severity:"high",fix:"Give liveness and readiness different paths or ports."},k8s_missing_startup_probe:{title:"Long liveness delay with no startup probe",description:"A high initialDelaySeconds on liveness silently delays detection of a broken container — startupProbe is the modern pattern.",category:"Reliability",severity:"low",fix:"Add a startupProbe; tighten liveness initialDelaySeconds."},k8s_no_topology_spread:{title:"No topologySpreadConstraints configured",description:"No explicit guarantee that replicas span zones/nodes. Modern K8s default-spreads pods, so this is an audit hint, not a confirmed placement issue.",category:"Reliability",severity:"low",fix:"Add a topologySpreadConstraint (maxSkew: 1, topologyKey: kubernetes.io/hostname)."},k8s_no_cpu_request:{title:"Container has no CPU request",description:"Without a CPU request the pod schedules with BestEffort QoS — first to evict under pressure, and the scheduler can over-commit the node's CPU to it.",category:"Reliability",severity:"high",fix:"Set spec.containers[].resources.requests.cpu (e.g. 100m)."},k8s_no_memory_request:{title:"Container has no memory request",description:"Without a memory request the pod schedules with BestEffort QoS — first to evict under memory pressure.",category:"Reliability",severity:"high",fix:"Set spec.containers[].resources.requests.memory (e.g. 256Mi)."},k8s_no_memory_limit:{title:"Container has no memory limit",description:"Without a limit, a leak / runaway can consume the node's memory and OOMKill the OTHER pods on the node. Burstable workloads can legitimately omit this — audit hint, not alarm.",category:"Reliability",severity:"medium",fix:"Set spec.containers[].resources.limits.memory (need not equal request)."},k8s_go_missing_gomemlimit:{title:"Go container without GOMEMLIMIT",description:"Without GOMEMLIMIT bound to limits.memory, the Go GC is blind to the cgroup limit and may OOMKill the container.",category:"Runtime",severity:"high",fix:"Set GOMEMLIMIT via downward API (resourceFieldRef → limits.memory)."},k8s_go_gomaxprocs_unset:{title:"Go container with fractional CPU + unpinned GOMAXPROCS",description:"Go defaults GOMAXPROCS to the host CPU count, not the cgroup limit. Fractional-CPU containers spin up dozens of OS threads thrashing for a half-core.",category:"Runtime",severity:"medium",fix:"Set GOMAXPROCS explicitly or use Uber automaxprocs."},k8s_cpu_request_overprovisioned:{title:"CPU request is over-provisioned",description:"p95 CPU is below 30% of the request — paying for headroom the workload never uses.",category:"Cost",severity:"medium",fix:"Lower CPU request to ~p95 + safety margin."},k8s_cpu_request_underprovisioned:{title:"CPU request is under-prov
3isioned",description:"p95 CPU is above 80% of the request — the container is constantly pressed against its reservation.",category:"Reliability",severity:"medium",fix:"Raise the CPU request to match actual usage."},k8s_memory_request_overprovisioned:{title:"Memory request is over-provisioned",description:"p95 memory is below 40% of the request. Note: memory rightsize on p95 is aggressive — one OOMKill is much worse than wasted memory. Verify against max usage before shrinking.",category:"Cost",severity:"low",fix:"Lower memory request to ~p95 + safety margin, after checking max usage."},k8s_memory_request_underprovisioned:{title:"Memory request is under-provisioned",description:"p95 memory is above 80% of the request — the container risks OOMKill under bursts.",category:"Reliability",severity:"medium",fix:"Raise the memory request to match actual usage."},k8s_memory_limit_too_tight:{title:"Memory limit is too tight — OOMKills observed",description:"At least one OOMKill has happened in the 7-day window. The kernel is reclaiming above the limit.",category:"Reliability",severity:"high",fix:"Raise memory limit; consider matching limit to request to make QoS Guaranteed."},k8s_cpu_limit_throttling:{title:"Container is being CPU-throttled",description:"cpu_cfs_throttled_seconds > 5% of runnable time — the limit is throttling user-visible work.",category:"Reliability",severity:"high",fix:"Raise the CPU limit, or remove it if the workload is well-behaved."},k8s_hpa_min_equals_max:{title:"HPA min and max replicas are equal",description:"The HorizontalPodAutoscaler has minReplicas equal to maxReplicas, so it cannot actually scale the workload. The HPA controller has no headroom to react to load and the workload behaves like a fixed-replica Deployment with extra moving parts.",category:"Reliability",severity:"medium",fix:"Raise maxReplicas above minReplicas so the HPA has room to scale up under load, or remove the HPA if elasticity is not required for this workload."},k8s_hpa_max_one:{title:"HPA maxReplicas is 1",description:"The HorizontalPodAutoscaler is capped at a single replica. The HPA cannot scale a singleton up, so the workload has no availability slack — a node drain or pod OOM takes it to zero before scaling can react.",category:"Reliability",severity:"medium",fix:"Raise maxReplicas to at least 2 so the HPA can keep at least one replica available during disruptions, or delete the HPA if the workload is intended to stay a singleton."},k8s_hpa_min_zero:{title:"HPA minReplicas is 0",description:"The HorizontalPodAutoscaler is configured with minReplicas=0. The HPA will scale the workload to zero replicas on idle, which means the first request after an idle period pays the full cold-start tax.",category:"Reliability",severity:"medium",fix:"Set minReplicas to at least 1 (or 2 for production workloads) so the workload always has a warm replica ready to serve traffic."},k8s_hpa_no_metrics:{title:"HPA has no metrics configured",description:"The HorizontalPodAutoscaler has an empty or absent metrics array. With no metrics configured the HPA has no signal to scale on — it sits at minReplicas forever, defeating the point of owning an HPA resource.",category:"Reliability",severity:"medium",fix:"Attach at least one metric (CPU utilisation is the canonical default; memory or custom metrics also work) to the HPA spec, or delete the HPA if it serves no purpose."},k8s_hpa_scaling_limited:{title:"HPA is being throttled by maxReplicas",description:"The HPA controller has reported a ScalingLimited=True condition. The HPA would scale the workload further but is pinned at the configured maxReplicas ceiling — load is high enough that the configured maximum is the binding constraint.",category:"Reliability",severity:"high",fix:"Raise maxReplicas so the HPA can keep scaling, or investigate whether the per-pod resource targets are too aggressive and a vertical change would relieve the pressure."},k8s_pdb_no_pods_match:{title:"PDB selector matches no pods",description:"The PodDisruptionBudget covers zero pods (expectedPods=0). The PDB provides no disruption protection — it is most likely the result of a selector typo, a label rename on the target workload, or a workload that has been deleted while the PDB w
3as left behind.",category:"Reliability",severity:"medium",fix:"Correct the selector to point at the intended workload, or delete the PDB if the workload it was meant to cover is gone."},k8s_pdb_blocks_all_disruption:{title:"PDB blocks all voluntary disruptions",description:"The PodDisruptionBudget allows zero disruptions while covering one or more pods. Voluntary disruptions (kubectl drain, cluster autoscaler scale-down, node upgrades) will block indefinitely against this PDB and may stall or fail outright on managed clouds with drain timeouts.",category:"Reliability",severity:"medium",fix:"Loosen the budget by raising maxUnavailable (or lowering minAvailable) so at least one pod can be down at a time during voluntary disruptions."},k8s_pdb_max_unavailable_zero:{title:"PDB maxUnavailable is 0",description:"The PodDisruptionBudget spec sets maxUnavailable to 0 or 0%. This is a strict-no-voluntary-disruptions configuration — every drain operation will be blocked. It is rarely intentional and most often the result of a hand-typed YAML mistake or a templating accident.",category:"Reliability",severity:"medium",fix:"Set maxUnavailable to a positive integer or percentage (for example 1 or 25%), or switch to minAvailable to express the protection budget more clearly."},k8s_cronjob_concurrency_allow:{title:"CronJob concurrencyPolicy is Allow",description:"concurrencyPolicy=Allow lets a slow run be joined by the next scheduled tick — Jobs stack up on the worker fleet, doubling CPU/memory spend and corrupting workloads that mutate shared state. Forbid (skip the next tick while the previous still runs) or Replace (kill the previous tick on launch) are the safer defaults.",category:"Reliability",severity:"medium",fix:"Edit the CronJob spec and set spec.concurrencyPolicy to Forbid or Replace based on whether the workload is idempotent."},k8s_cronjob_suspended_stale:{title:"CronJob is suspended",description:"spec.suspend is true so this CronJob will not launch any Jobs. Suspended CronJobs still consume etcd quota and audit-log noise — operators usually mean to either re-enable them or delete them. Advisory hint: no time-window check, so a just-suspended CronJob under debugging will also fire.",category:"Hygiene",severity:"low",fix:"Either set spec.suspend to false to re-enable scheduling or delete the CronJob if it is no longer needed."},k8s_cronjob_missed_schedule:{title:"CronJob missed its schedule",description:"status.lastScheduleTime is more than 24 hours old and spec.suspend is not true — a non-suspended CronJob that has not launched a Job in over a day is almost always failing silently (startingDeadline missed, concurrency block on a hung Job, controller wedged, or a broken schedule expression). Simplification: a fixed 24h floor is used instead of (2 × cron-parsed interval), so CronJobs scheduled less frequently than daily (weekly/monthly) will false-positive and should be disabled per-org.",category:"Reliability",severity:"high",fix:"Inspect the CronJob and namespace controller logs. Verify spec.schedule is valid, check startingDeadlineSeconds, and clear any hung Jobs blocking concurrency."},k8s_secret_legacy_sa_token:{title:"Legacy service-account token Secret",description:"This Secret carries the deprecated kubernetes.io/service-account-token type. Long-lived ServiceAccount token Secrets were superseded by the TokenRequest API in Kubernetes 1.24 — they never rotate automatically and effectively live for the cluster's lifetime, which violates standard credential-hygiene baselines.",category:"Security",severity:"medium",fix:"Migrate the consumer to a projected ServiceAccount token volume (projected.sources.serviceAccountToken with expirationSeconds + audience) so credentials rotate automatically, then delete this Secret once nothing references it."},k8s_configmap_high_data_count:{title:"ConfigMap has too many keys",description:"This ConfigMap holds more than the configured number of keys (default >50). Dense ConfigMaps usually bundle unrelated config domains (DB + cache + feature flags + log levels) and amplify blast radius — a single key edit triggers volume re-projection for every pod that mounts the ConfigMap.",category:"Hygiene",severity:"low",fix:"Split the ConfigMap by configuration domain (one ConfigMap per concern: DB settings, feature flags, log levels, etc.) so unrelated changes don't re-roll unrelated workloads."},k8s_secret_high_data_count:{title:"Secret has too many keys",description:"This Secret holds more than the configured number of keys (default >30). Dense Secrets widen blast radius (every consumer of any single key gets the full Secret mounted) and create unnecessary rotation churn when a single credential changes.",category:"Hygiene",severity:"low",fix:"Split the Secret by domain (one Secret per credential set: DB password, API tokens, TLS material, etc.) so leakage and rotation stay scoped to the credentials that actually changed."},k8s_resourcequota_exhausted:{title:"ResourceQuota exhausted",description:"At least one ResourceQuota dimension (cpu, memory, pods, etc.) has used >= hard. The next pod / PVC / service create in this namespace will be rejected by the API server with `forbidden: exceeded quota`. New w
3ork cannot land in the namespace until the cap is raised or in-use resources are released.",category:"Reliability",severity:"high",fix:"Either raise the saturated dimension in the ResourceQuota spec, evict unused workloads in the namespace, or move new workloads to a less-loaded namespace. The rule surfaces the worst-saturated key in evidence so you know which dimension to act on."},k8s_resourcequota_near_limit:{title:"ResourceQuota near limit",description:"At least one ResourceQuota dimension is at or above 85% saturation (and below 100%). Admission still succeeds today, but a single HPA scale-up or a routine deployment can push the namespace past the hard cap and start rejecting new pods.",category:"Reliability",severity:"medium",fix:"Plan a cap increase before traffic forces the boundary: raise the relevant ResourceQuota dimension(s), evict idle workloads, or distribute new workloads across additional namespaces. Tune the firing band via the `threshold` field if your team runs hotter or cooler than the 0.85 default."},k8s_service_no_endpoints:{title:"Service has zero ready endpoints",description:"The EndpointSlice has neither ready nor not-ready endpoints. The parent Service is selecting nothing — requests to it black-hole. Typical causes: selector/label drift, all pods CrashLoopBackOff, or workload scaled to zero with the Service left behind.",category:"Reliability",severity:"high",fix:"Check the Service selector matches current pod labels, verify backing workload pods are Running, or delete the orphaned Service."},k8s_service_lb_pending:{title:"LoadBalancer Service has no assigned address",description:"Service is type=LoadBalancer but the cloud LoadBalancer has not been provisioned (no IP/hostname assigned). External traffic cannot reach the workload.",category:"Reliability",severity:"high",fix:"Inspect cloud controller events for the Service — common causes: quota limits, missing subnet tags, IAM permissions on the controller, or unsupported annotation combinations."},k8s_ingress_no_tls:{title:"Ingress exposes hosts without TLS",description:"Ingress has no TLS configuration — hosts are served over plaintext HTTP. Traffic is vulnerable to passive interception and active downgrade.",category:"Security",severity:"medium",fix:"Add a tls: block referencing a TLS Secret (or wire cert-manager) and configure the controller to redirect HTTP to HTTPS."},k8s_ingress_pending_lb:{title:"Ingress LoadBalancer address is pending",description:"Ingress has no LoadBalancer address assigned (status=pending). External traffic cannot reach the Ingress until the controller assigns an address.",category:"Reliability",severity:"high",fix:"Verify an ingress controller is installed and watching this Ingress class; inspect cloud controller events for provisioning errors (subnet tags, IAM, certificates)."},k8s_networkpolicy_empty_rules:{title:"NetworkPolicy has no ingress or egress rules",description:"The NetworkPolicy selects pods but defines neither ingress nor egress rules. It enforces nothing and creates operator confusion.",category:"Security",severity:"low",fix:"Either populate explicit allow/deny rules to enforce the intended boun
3dary, or delete the policy if it is no longer needed."},k8s_service_external_ip_set:{title:"Service exposed via NodePort bypasses ingress",description:"Service is type=NodePort, which opens a port on every node IP and bypasses Ingress (no TLS termination, no path routing, no WAF). If node security groups expose the NodePort range publicly the service is effectively internet-facing without managed protection.",category:"Security",severity:"medium",fix:"Re-front the service through a LoadBalancer Service or an Ingress with TLS, and confirm node security groups restrict access to the NodePort range."},k8s_node_not_ready:{title:"Node not ready",description:"Node reports a non-ready status (notready or unknown). It still consumes capacity but schedules no pods; cordon, drain, and replace.",category:"Reliability",severity:"high",fix:"Investigate kubelet logs and instance health; cordon, drain, and replace the node, or fix the underlying networking / IAM / disk issue keeping the kubelet from reporting Ready."},k8s_node_memory_pressure:{title:"Node under memory pressure",description:"Kubelet has set MemoryPressure=True and is evicting pods in QoS-priority order. Workloads on this node are actively being terminated.",category:"Reliability",severity:"high",fix:"Scale the nodegroup, swap to a memory-optimised instance type, or tighten container memory limits on the workloads scheduled to this node."},k8s_node_disk_pressure:{title:"Node under disk pressure",description:"Kubelet has set DiskPressure=True. Image GC and pod eviction are running; new image pulls are likely to fail.",category:"Reliability",severity:"high",fix:"Expand the node's image filesystem, prune unused images, or move workloads off the node and replace it with a larger-disk instance."},k8s_node_pid_pressure:{title:"Node under PID pressure",description:"Kubelet has set PIDPressure=True; the node is close to its kernel process / PID limit. New pods or containers may fail to start.",category:"Reliability",severity:"medium",fix:"Raise the kernel PID limit on the node, scale the nodegroup, or identify and cap the workload spawning unbounded threads."},k8s_pvc_orphan:{title:"PVC bound to a released or lost volume",description:"PVC is in a non-active state; the underlying PV is no longer usable.",category:"Cost",severity:"high",fix:"Delete the PVC if no longer needed, or restore from snapshot."},k8s_pvc_pending:{title:"PVC stuck in pending phase",description:"PVC has not been provisioned, blocking pods that mount it from scheduling.",category:"Reliability",severity:"high",fix:"Check the StorageClass, CSI driver health, and cloud-side quota for the failed provisioner."},k8s_pv_released_retained:{title:"Released PV with Retain reclaim policy",description:"PV remains and the cloud disk keeps billing after its PVC was deleted.",category:"Cost",severity:"medium",fix:"Delete the PV (and the underlying cloud disk) once the data is confirmed unneeded."},k8s_storageclass_no_expansion:{title:"StorageClass does not allow volume expansion",description:"PVCs from this class cannot grow online; resizing requires PVC recreate and data migration.",category:"Reliability",severity:"low",fix:"Edit the StorageClass to set allowVolumeExpansion: true (non-disruptive change)."},k8s_storageclass_immediate_binding:{title:"StorageClass uses Immediate volume binding",description:"Disks provision before pod placement, risking idle disks in wrong zones and scheduling failures.",category:"Cost",severity:"medium",fix:"Edit the StorageClass to set volumeBindingMode: WaitForFirstConsumer."},k8s_pvc_no_storageclass:{title:"PVC does not name a StorageClass",description:"PVC relies on the cluster default; misconfigured defaults leave it Pending or bound to the wrong class.",category:"Reliability",severity:"medium",fix:"Set spec.storageClassName explicitly on the PVC manifest."},k8s_image_tag_latest:{title:"Container image uses :latest (or no tag)",description:"One or more containers in this workload run an image pinned to the floating ':latest' tag (or have no tag at all — Kubernetes defaults missing tags to ':latest'). Floating tags break reproducibility, make rollbacks impossible, and silently pull unreviewed upstream changes on every pod restart.",category:"Reliability",severity:"medium",fix:"Replace ':latest' with a pinned semver tag (preferred: an image digest like 'nginx@sha256:...'). Update the Deployment/StatefulSet/DaemonSet spec and redeploy."},k8s_workload_hostnetwork:{title:"Workload uses hostNetwork outside a system namespace",description:"Pod spec sets 'hostNetwork: true' in a user namespace. Host-network pods share the node's network stack, bypass NetworkPolicy, expose container ports directly on node interfaces, and break kube-dns service discovery. System namespaces (kube-system, kube-public, kube-node-lease, kubeadm, calico-system, tigera-operator) are skipped — cluster components legitimately need hostNetwork.",category:"Security",severity:"medium",fix:"Remove 'hostNetwork: true' from the pod spec and expose the workload via a Service (ClusterIP) and optional Ingress. If host networking is genuinely required (e.g. a node-local agent), move the workload to a 
3system namespace or add a per-org allowlist."},k8s_deployment_strategy_recreate:{title:"Deployment uses Recreate strategy (causes downtime on every deploy)",description:"This Deployment's spec.strategy is 'Recreate', which kills ALL existing pods before any new pod is scheduled. Every rolling update of this workload causes a hard downtime window. The default 'RollingUpdate' strategy stages new pods alongside old ones.",category:"Reliability",severity:"medium",fix:"Switch spec.strategy to 'RollingUpdate' (the default). If the workload genuinely cannot run two replicas simultaneously (e.g. PVC-bound singleton), consider migrating to a StatefulSet which is designed for ordered, single-replica-at-a-time updates."},k8s_statefulset_no_headless_service:{title:"StatefulSet has no governing headless service",description:"This StatefulSet's spec.serviceName is empty or absent — no governing headless service. The governing Service is what gives each StatefulSet pod its stable DNS name (pod-0.svc.ns.svc.cluster.local). Without it, ordered pod identity is meaningless, peer discovery for clustered stateful systems breaks, and rolling updates lose DNS continuity between old and new pods.",category:"Reliability",severity:"high",fix:"Create a headless Service (clusterIP: None) that selects this StatefulSet's pods, then set spec.serviceName on the StatefulSet to reference it. The Service can carry no ports if pods only need DNS identity."}};function pv(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Unknown"}function Fp(e){return Ip[e]??null}function zp(e){return(e?.type??"").toLowerCase().startsWith("openshift")}const Up={running:"success",active:"success",ready:"success",pending:"warning",stopped:"danger",failed:"danger"},Bp={overview:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"}),r.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),nodes:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"2",y:"2",width:"9",height:"9",rx:"1"}),r.jsx("rect",{x:"13",y:"2",width:"9",height:"9",rx:"1"}),r.jsx("rect",{x:"2",y:"13",width:"9",height:"9",rx:"1"}),r.jsx("rect",{x:"13",y:"13",width:"9",height:"9",rx:"1"})]}),namespaces:r.jsx(r.Fragment,{children:r.jsx("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"})}),events:r.jsx(r.Fragment,{children:r.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"})}),recommendations:r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"}),r.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),pods:r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"3"}),r.jsx("path",{d:"M12 2v4m0 12v4M2 12h4m12 0h4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83"})]}),deployments:r.jsx(r.Fragment,{children:r.jsx("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),daemonsets:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),r.jsx("line",{x1:"3",y1:"15",x2:"21",y2:"15"}),r.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"}),r.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]}),statefulsets:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"4",y:"2",width:"16",height:"6",rx:"1"}),r.jsx("rect",{x:"4",y:"10",width:"16",height:"6",rx:"1"}),r.jsx("rect",{x:"4",y:"18",width:"16",height:"4",rx:"1"})]}),replicasets:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"6",y:"6",width:"14",height:"14",rx:"2"}),r.jsx("path",{d:"M4 16V6a2 2 0 012-2h10"})]}),jobs:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"}),r.jsx("rect",{x:"9",y:"3",width:"6",height:"4",rx:"1"}),r.jsx("path",{d:"M9 14l2 2 4-4"})]}),configmaps:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),r.jsx("polyline",{points:"14 2 14 8 20 8"}),r.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),r.jsx("line",{x1:"8",y1:"17",x2:"12",y2:"17"})]}),secrets:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),r.jsx("path",{d:"M7 11V7a5 5 0 0110 0v4"}),r.jsx("circle",{cx:"12",cy:"16",r:"1"})]}),quotas:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M12 20V10"}),r.jsx("path",{d:"M18 20V4"}),r.jsx("path",{d:"M6 20v-4"})]}),autoscaler:r.jsx(r.Fragment,{children:r.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),services:r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),r.jsx("path",{d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})]}),ingresses:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"}),r.jsx("path",{d:"M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"})]}),endpoints:r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"2"}),r.jsx("circle",{cx:"5",cy:"5",r:"2"}),r.jsx("circle",{cx:"19",cy:"5",r:"2"}),r.jsx("circle",{cx:"5",cy:"19",r:"2"}),r.jsx("circle",{cx:"19",cy:"19",r:"2"}),r.jsx("line",{x1:"7",y1:"7",x2:"10",y2:"10"}),r.jsx("line",{x1:"17",y1:"7",x2:"14",y2:"10"}),r.jsx("line",{x1:"7",y1:"17",x2:"10",y2:"14"}),r.jsx("line",{x1:"17",y1:"17",x2:"14",y2:"14"})]}),policies:r.jsx(r.Fragment,{children:r.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),storage:r.jsxs(r.Fragment,{children:[r.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),r.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),r.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]}),serviceaccounts:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),r.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),crds:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),r.jsx("path",{d:"M2 17l10 5 10-5"}),r.jsx("path",{d:"M2 12l10 5 10-5"})]}),routes:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M4 4h4v4H4z"}),r.jsx("path",{d:"M16 16h4v4h-4z"}),r.jsx("path",{d:"M8 6h6a2 2 0 012 2v8"}),r.jsx("circle",{cx:"18",cy:"6",r:"2"})]}),projects:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"}),r.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"})]}),imagestreams:r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:"3",y:"3",width:"18",height:"14",rx:"2"}),r.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),r.jsx("path",{d:"M21 15l-5-5L5 21"})]}),buildconfigs:r.jsx(r.Fragment,{children:r.jsx("path",{d:"M14.7 6.3a4 4 0 01-5.4 5.4L4 17v3h3l5.3-5.3a4 4 0 015.4-5.4z"})}),deploymentconfigs:r.jsxs(r.Fragment,{children:[r.jsx("path",{d:"M12 2v6m0 0l3-3m-3 3L9 5"}),r.jsx("rect",{x:"3",y:"10",width:"18",height:"11",rx:"2"}),r.jsx("line",{x1:"8",y1:"15",x2:"16",y2:"15"})]}),settings:r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"12",cy:"12",r:"3"}),r.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 
319.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})},xa=[{label:"General",items:[{to:"overview",label:"Overview",iconKey:"overview"},{to:"recommendations",label:"Recommendations",iconKey:"recommendations",badgeKey:"recs"},{to:"nodes",label:"Nodes",iconKey:"nodes"},{to:"namespaces",label:"Namespaces",iconKey:"namespaces"},{to:"projects",label:"Projects",iconKey:"projects",openShiftOnly:!0},{to:"events",label:"Events",iconKey:"events"}]},{label:"Workloads",items:[{to:"pods",label:"Pods",iconKey:"pods"},{to:"deployments",label:"Deployments",iconKey:"deployments"},{to:"deploymentconfigs",label:"Deployment Configs",iconKey:"deploymentconfigs",openShiftOnly:!0},{to:"daemonsets",label:"DaemonSets",iconKey:"daemonsets"},{to:"statefulsets",label:"StatefulSets",iconKey:"statefulsets"},{to:"replicasets",label:"ReplicaSets",iconKey:"replicasets"},{to:"jobs",label:"Jobs",iconKey:"jobs"},{to:"buildconfigs",label:"Build Configs",iconKey:"buildconfigs",openShiftOnly:!0},{to:"imagestreams",label:"Image Streams",iconKey:"imagestreams",openShiftOnly:!0}]},{label:"Config",items:[{to:"configmaps",label:"ConfigMaps",iconKey:"configmaps"},{to:"secrets",label:"Secrets",iconKey:"secrets"},{to:"quotas",label:"Quotas",iconKey:"quotas"},{to:"hpa",label:"HPA",iconKey:"autoscaler"}]},{label:"Network",items:[{to:"services",label:"Services",iconKey:"services"},{to:"ingresses",label:"Ingresses",iconKey:"ingresses"},{to:"routes",label:"Routes",iconKey:"routes",openShiftOnly:!0},{to:"endpoints",label:"Endpoints",iconKey:"endpoints"},{to:"networkpolicies",label:"Policies",iconKey:"policies"}]},{label:"Storage",items:[{to:"storage",label:"PV/PVC",iconKey:"storage"}]},{label:"Access",items:[{to:"serviceaccounts",label:"Svc Accounts",iconKey:"serviceaccounts"}]},{label:"Custom",items:[{to:"crds",label:"CRDs",iconKey:"crds"}]}];function $p(e){return zp(e)?xa:xa.map(t=>({...t,items:t.items.filter(s=>!s.openShiftOnly)})).filter(t=>t.items.length>0)}function Vp({iconKey:e}){return r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:Bp[e]})}function qp({clusterId:e,onClose:t,basePath:s,backTo:o,backLabel:n}){const a=s||`/k8s/clusters/${e}`,i=pe(),[c,u]=Se(),l=c.get("ns")||"all",{data:f,isLoading:d}=wp(e),g=f?.id||e,{data:p}=Sp(g),y=p?.items??(Array.isArray(p)?p:[]),{items:h,isError:v}=Dp(f),x=(()=>{let P=0;const j=h.length;for(const N of h)Fp(N?.situation?.rule_type)?.severity==="high"&&(P+=1);return{high:P,total:j}})(),b={recs:v?{value:"!",variant:"warning"}:x.high>0?{value:x.high,variant:"danger"}:x.total>0?{value:x.total,variant:"neutral"}:null},w=m.useCallback(P=>{const j=P.target.value;u(N=>{const z=new URLSearchParams(N);return j==="all"?z.delete("ns"):z.set("ns",j),z})},[u]),A=[{value:"all",label:"All Namespaces"},...y.map(P=>({value:P.Name||P.name||P,label:P.Name||P.name||P}))],E=f?.status?.toLowerCase()??"unknown",L=m.useMemo(()=>$p(f),[f]);return r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:()=>i(o||"/kubernetes"),className:"flex items-center gap-2 w-full px-3 py-2 mb-2 text-xs font-medium text-text-secondary bg-surface-secondary/50 hover:bg-surface-tertiary rounded-lg transition-colors group",children:[r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-muted group-hover:text-primary-500 transition-colors shrink-0",children:[r.jsx("path",{d:"M19 12H5"}),r.jsx("path",{d:"M12 19l-7-7 7-7"})]}),r.jsx("span",{className:"truncate",children:n||"Kubernetes"})]}),d?r.jsxs("div",{className:"px-2 py-2",children:[r.jsx("div",{className:"h-4 w-32 bg-surface-tertiary rounded animate-pulse"}),r.jsx("div",{className:"h-3 w-20 bg-surface-tertiary rounded animate-pulse mt-2"})]}):f?r.jsxs("div",{className:"px-2 py-2",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(Go,{provider:f.provider,size:16}),r.jsx(yt,{content:f.name,onlyOnOverflow:!0,children:r.jsx("span",{className:"text-sm font-semibold text-text-primary truncate",children:f.name})})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx(er,{variant:Up[E]??"neutral",size:"sm",children:f.status}),r.jsx("span",{className:"text-[10px] text-text-muted",children:f.region})]})]}):null,r.jsx("div",{className:"border-b border-border my-1"}),r.jsx("div",{className:"px-2 mb-2",children:r.jsx(hc,{value:l,onCh
3ange:w,options:A,className:"text-xs"})}),L.map(P=>r.jsxs("div",{className:"mb-2",children:[r.jsx("p",{className:"text-[0.6875rem] font-medium text-text-muted px-2 mb-1",children:P.label}),r.jsx("ul",{className:"space-y-0.5",children:P.items.map(j=>r.jsx("li",{children:r.jsxs(ei,{to:`${a}/${j.to}${l!=="all"?`?ns=${l}`:""}`,onClick:N=>{if(N.button===0&&!N.metaKey&&!N.ctrlKey&&!N.shiftKey){N.preventDefault();const z=c.get("ns"),Q=z?`${a}/${j.to}?ns=${z}`:`${a}/${j.to}`;i(Q),t&&t()}},className:({isActive:N})=>`flex items-center gap-2.5 px-2 py-2 lg:py-1.5 text-sm lg:text-[0.8125rem] rounded-lg transition-all duration-fast ${N?"bg-primary-400/10 text-primary-600 font-medium shadow-sm":"text-text-secondary hover:text-text-primary hover:bg-surface-secondary"}`,children:[r.jsx("span",{className:"w-[18px] h-[18px] shrink-0",children:r.jsx(Vp,{iconKey:j.iconKey})}),r.jsx("span",{className:"flex-1",children:j.label}),j.badgeKey&&b[j.badgeKey]&&r.jsx(er,{variant:b[j.badgeKey].variant,size:"sm",children:b[j.badgeKey].value})]})},j.to))})]},P.label))]})}const Is=100,Wp=20;function hv(){const e=lt(),{data:t=[]}=re({queryKey:oe.cloudAccounts.list(e,{limit:Is,include_children:!0,all:!0}),queryFn:async()=>{const s=[];for(let o=1;o<=Wp;o++){const n=await H.get("/cloud-accounts",{page:o,limit:Is,include_children:!0}),a=Array.isArray(n)?n:n?.items??[];if(s.push(...a),!n?.hasMore||a.length<Is)break}return s}});return m.useMemo(()=>{const s=new Map;for(const o of t){const n=(o?.name??"").trim();n&&(o.cloudAccountId&&s.set(o.cloudAccountId,n),o.id&&s.set(o.id,n))}return s},[t])}function Rc({enabled:e=!0}={}){const t=lt();return re({queryKey:oe.cloudAccounts.list(t),queryFn:()=>H.get("/cloud-accounts",{limit:200}),select:s=>Array.isArray(s)?s:s?.items??[],enabled:e})}function yv({page:e=1,limit:t=20,search:s=""}={}){const o=lt(),n={page:e,limit:t};return s&&(n.search=s),re({queryKey:oe.cloudAccounts.list(o,n),queryFn:()=>H.get("/cloud-accounts",n)})}function xv(){const e=lt(),t=ke();return me({mutationFn:s=>H.post("/cloud-accounts",s),onSuccess:()=>{t.invalidateQueries({queryKey:oe.cloudAccounts.all(e)}),t.invalidateQueries({queryKey:["refreshStatus"]})},onError:s=>fe.error(`Failed to connect account: ${s.message}`)})}function vv(){return me({mutationFn:e=>H.post("/cloud-accounts/test-connection",e)})}function bv(e){const t=lt();return re({queryKey:oe.cloudAccounts.snowflakeCredential(t,e),queryFn:()=>H.get(`/cloud-accounts/${e}/snowflake-credential`),enabled:!!e,retry:!1})}function wv(){const e=lt(),t=ke();return me({mutationFn:({id:s,...o})=>H.put(`/cloud-accounts/${s}`,o),onSuccess:()=>{fe.success("Cloud account updated — syncing resources"),t.invalidateQueries({queryKey:oe.cloudAccounts.all(e)}),t.invalidateQueries({queryKey:["refreshStatus"]})},onError:s=>fe.error(`Failed to update account: ${s.message}`)})}function Av(){const e=lt(),t=ke();return me({mutationFn:s=>H.del(`/cloud-accounts/${s}`),onSuccess:()=>{fe.success("Cloud account removed"),t.invalidateQueries({queryKey:oe.cloudAccounts.all(e)}),t.invalidateQueries({queryKey:oe.resources.all}),t.invalidateQueries({queryKey:oe.recommendations.all}),t.invalidateQueries({queryKey:["iam-import"]})},onError:s=>fe.error(`Failed to remove account: ${s.message}`)})}function Gp(e){const t=[...new Set((e??[]).filter(Boolean))];return po({queries:t.map(s=>({queryKey:oe.discoverySummary.permissions(s),queryFn:()=>H.get("/resources/discovery-summary",{cloud_account_id:s,include_permissions:"true"}),staleTime:3e4,enabled:!!s})),combine:s=>{const o={};let n=!0;return s.forEach((a,i)=>{o[t[i]]={permissions:a.data?.permissions??[],loading:a.isLoading,error:a.error},a.isLoading&&(n=!1)}),{byAccount:o,allLoaded:n}}})}const Kp="users_only",Hp="users_and_groups";function Ko(e){if(!e)return null;if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return null}}function Zp(e){const t=e?.linkedFrom;return Array.isArray(t)?t:t&&typeof t=="object"?[t]:[]}function Qp(e,t){return t?Zp(e).find(s=>s?.cloudAccountId===t)??null:null}function _v(e,t){const s=Ko(e?.metadata);return s?s.importedFrom?.cloudAccountId===t&&s.importedFrom?.syncMode?s.importedFrom.syncMode:Qp(s,t)?.syncMode||"":""}function Sv(e){return e===Kp||e===Hp}function Yp(e){const t=Array.isArray(e)?e:[];let s=0,o=0,n=0;for(const a of t){if(!a?.uid||a.uid==="_end")continue;s+=1;const c=Ko(a.metadata)?.accessStatus;c==="accessible"?o+=1:c==="denied"&&(n+=1)}return{total:s,accessible:o,denied:n,needsAttention:n>0}}function kv(e){const t=Array.isArray(e)?e:[],s=[];for(const o of t){if(!o?.uid||o.uid==="_end")continue;const n=Ko(o.metadata);s.push({uid:o.uid,name:o.name||o.uid,accessStatus:n?.accessStatus||"unknown"})}return s}const Jp={type:"databricks",limit:100,include:"metadata"},Xp=3e4;function eh(e){const t=(e??[]).filter(s=>s?.provider==="databricks"&&s?.cloudAccountId);return po({queries:t.map(s=>({queryKey:oe.databricksHealth.byConnection(s.cloudAccountId),queryFn:()=>H.get("/resources",{...Jp,cloud_account_id:s.cloudAccountId}),staleTime:Xp,enabled:!!s.cloudAccountId})),combine:s=>{const o={};let n=!0;
3return s.forEach((a,i)=>{const c=t[i];if(!c)return;const u=a.isSuccess&&!a.isError,l=Array.isArray(a.data)?a.data:a.data?.items??[],f=u?Yp(l):{total:0,denied:0,needsAttention:!1};o[c.id]={needsAttention:u?f.needsAttention:!1,denied:f.denied,total:f.total,loaded:u},a.isLoading&&(n=!1)}),{byAccount:o,allLoaded:n}}})}const jc=e=>({type:"databricks",provider:"azure",cloud_account_id:e,limit:100}),Cc=e=>(e?.items??[]).filter(t=>t?.uid&&t.uid!=="_end"),th=e=>e.length>0&&e.some(t=>(t?.childCount??0)===0);function Ev(e,{enabled:t=!0}={}){const s=jc(e),{data:o}=re({queryKey:oe.resources.list(s),queryFn:()=>H.get("/resources",s),enabled:t&&!!e,staleTime:3e4});return m.useMemo(()=>Cc(o),[o])}function rh(e){const t=(e??[]).filter(s=>s?.provider==="azure"&&s?.cloudAccountId);return po({queries:t.map(s=>{const o=jc(s.cloudAccountId);return{queryKey:oe.resources.list(o),queryFn:()=>H.get("/resources",o),staleTime:3e4,enabled:!!s.cloudAccountId}}),combine:s=>{const o={};return s.forEach((n,a)=>{const i=Cc(n.data);o[t[a].id]={hasWorkspaces:i.length>0,needsAttention:th(i),loaded:!n.isLoading}}),{byAccount:o}}})}const sh={"acm:AddTagsToCertificate":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"acm:DescribeCertificate":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"acm:ListCertificates":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"acm:ListTagsForCertificate":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"acm-pca:ListCertificateAuthorities":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"airflow:GetEnvironment":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"airflow:ListEnvironments":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"apigateway:DELETE":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"apigateway:POST":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"apigateway:PUT":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"application-autoscaling:DeleteScalingPolicy":{category:"write",feature:"scheduling",role:"ZopNightWritePolicy"},"application-autoscaling:DeleteScheduledAction":{category:"write",feature:"scheduling",role:"ZopNightWritePolicy"},"application-autoscaling:DeregisterScalableTarget":{category:"write",feature:"scheduling",role:"ZopNightWritePolicy"},"application-autoscaling:DescribeScalableTargets":{category:"read",feature:"scheduling",role:"ReadOnlyAccess"},"application-autoscaling:DescribeScalingPolicies":{category:"read",feature:"scheduling",role:"ReadOnlyAccess"},"application-autoscaling:DescribeScheduledActions":{category:"read",feature:"scheduling",role:"ReadOnlyAccess"},"application-autoscaling:PutScalingPolicy":{category:"write",feature:"scheduling",role:"ZopNightWritePolicy"},"application-autoscaling:PutScheduledAction":{category:"write",feature:"scheduling",role:"ZopNightWritePolicy"},"application-autoscaling:RegisterScalableTarget":{category:"write",feature:"scheduling",role:"ZopNightWritePolicy"},"apprunner:PauseService":{category:"write",feature:"scheduling",resource_type:"apprunner",role:"ZopNightWritePolicy"},"apprunner:ResumeService":{category:"write",feature:"scheduling",resource_type:"apprunner",role:"ZopNightWritePolicy"},"appstream:DescribeFleets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"autoscaling:CreateAutoScalingGroup":{category:"write",feature:"scheduling",resource_type:"asg",role:"ZopNightWritePolicy"},"autoscaling:DeletePolicy":{category:"write",feature:"scheduling",resource_type:"asg",role:"ZopNightWritePolicy"},"autoscaling:DeleteScheduledAction":{category:"write",feature:"scheduling",resource_type:"asg",role:"ZopNightWritePolicy"},"autoscaling:DescribeAutoScalingGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"autoscaling:DescribePolicies":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"autoscaling:DescribeScheduledActions":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"autoscaling:PutScalingPolicy":{category:"write",feature:"scheduling",resource_type:"asg",role:"ZopNightWritePolicy"},"autoscaling:PutScheduledUpdateGroupAction":{category:"write",feature:"scheduling",resource_type:"asg",role:"ZopNightWritePolicy"},"autoscaling:UpdateAutoScalingGroup":{category:"write",feature:"scheduling",resource_type:"asg",role:"ZopNightWritePolicy"},"bcm-data-exports:GetExport":{category:"read",feature:"cost",role:"ReadOnlyAccess"},"bcm-data-exports:ListExports":{category:"read",feature:"cost",role:"ReadOnlyAccess"},"backup:ListBackupVaults":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"backup:ListRecoveryPointsByBackupVault":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:DeleteAgent":{category:"write",feature:"remediation",resource_type:"bedrock-agent",role:"ZopNightRemediationPolicy"},"bedrock:DeleteCustomModel":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"bedrock:DeleteGuardrail":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"bedrock:DeleteImportedModel":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"bedrock:DeleteKnowledgeBase":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"bedrock:DeleteProvisionedModelThroughput":{category:"write",feature:"remediation",resource_type:"bedrock-pt",role:"ZopNightRemediationPolicy"},"bedrock:GetAgent":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:GetCustomModel":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:GetEvaluationJob":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:GetGuardrail":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:GetKnowledgeBase":{category:"read",feature:"discovery",role:"ReadOnlyAccess"}
3,"bedrock:GetMarketplaceModelEndpoint":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:GetModelInvocationLoggingConfiguration":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:GetProvisionedModelThroughput":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:InvokeModel":{category:"write",feature:"ai-gateway",role:"ZopNightWritePolicy"},"bedrock:ListAgentActionGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListAgentAliases":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListAgentVersions":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListAgents":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListCustomModelDeployments":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListCustomModels":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListDataAutomationProjects":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListDataSources":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListEvaluationJobs":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListFlowAliases":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListFlowVersions":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListFlows":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListFoundationModels":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListGuardrails":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListImportedModels":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListInferenceProfiles":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListKnowledgeBases":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListMarketplaceModelEndpoints":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListModelCopyJobs":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListModelCustomizationJobs":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListModelInvocationJobs":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListPrompts":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListProvisionedModelThroughputs":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"bedrock:ListTagsForResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"ce:GetCostAndUsage":{category:"read",feature:"cost",role:"ReadOnlyAccess"},"ce:GetCostAndUsageWithResources":{category:"read",feature:"cost",role:"ReadOnlyAccess"},"ce:GetDimensionValues":{category:"read",feature:"cost",role:"ReadOnlyAccess"},"cloudfront:DeleteDistribution":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"cloudfront:GetDistribution":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cloudfront:GetDistributionConfig":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"cloudfront:ListDistributions":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cloudfront:UpdateDistribution":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"cloudtrail:DescribeTrails":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cloudtrail:GetTrailStatus":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cloudtrail:LookupEvents":{category:"read",feature:"recommendations",role:"ReadOnlyAccess"},"cloudwatch:DeleteAlarms":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"cloudwatch:DeleteDashboards":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"cloudwatch:DescribeAlarms":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cloudwatch:GetMetricData":{category:"read",feature:"recommendations",role:"ReadOnlyAccess"},"cloudwatch:GetMetricStatistics":{category:"read",feature:"recommendations",role:"ReadOnlyAccess"},"cloudwatch:ListDashboards":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cloudwatch:ListMetrics":{category:"read",feature:"recommendations",role:"ReadOnlyAccess"},"cloudwatch:ListMetricStreams":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cloudwatch:ListTagsForResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"cloudwatch:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"codebuild:BatchGetProjects":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"codebuild:DeleteProject":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"codebuild:ListBuildsForProject":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"codebuild:ListProjects":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"codecommit:DeleteRepository":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"config:DescribeConfigRuleEvaluationStatus":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"config:DescribeConfigRules":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"config:DescribeConfigurationRecorderStatus":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"config:DescribeConfigurationRecorders":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"cost-optimization-hub:GetPreferences":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"ReadOnlyAccess"},"cost-optimization-hub:ListEnrollmentStatuses":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"ReadOnlyAccess"},"cost-optimization-hub:ListRecommendations":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"ReadOnlyAccess"}
3,"dax:DescribeClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"dms:DescribeReplicationInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"dynamodb:DescribeContinuousBackups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"dynamodb:DescribeTable":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"dynamodb:ListTables":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"dynamodb:ListTagsOfResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"dynamodb:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"ec2:CreateLaunchTemplate":{category:"write",feature:"scheduling",resource_type:"ec2",role:"ZopNightWritePolicy"},"ec2:CreateTags":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"ec2:DeleteInternetGateway":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"ec2:DeleteLaunchTemplate":{category:"write",feature:"scheduling",resource_type:"ec2",role:"ZopNightWritePolicy"},"ec2:DeleteSnapshot":{category:"write",feature:"remediation",resource_type:"ebs-snapshot",role:"ZopNightRemediationPolicy"},"ec2:DeleteTransitGateway":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"ec2:DeleteVolume":{category:"write",feature:"remediation",resource_type:"ebs-volume",role:"ZopNightRemediationPolicy"},"ec2:DeleteVpcEndpoints":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"ec2:DeleteVpcPeeringConnection":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"ec2:DescribeAddresses":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeAvailabilityZones":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeFlowLogs":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeImages":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeLaunchTemplates":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeNatGateways":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeNetworkInterfaces":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeRegions":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeRouteTables":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeSecurityGroupRules":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeSecurityGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeSnapshots":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeSubnets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeTags":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"ec2:DescribeTransitGatewayPeeringAttachments":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeTransitGateways":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeVolumes":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeVpcEndpoints":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeVpcPeeringConnections":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeVpcs":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DescribeVpnConnections":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ec2:DisassociateAddress":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"ec2:ModifyInstanceAttribute":{category:"write",feature:"remediation",resource_type:"ec2",role:"ZopNightRemediationPolicy"},"ec2:ModifySnapshotTier":{category:"write",feature:"remediation",resource_type:"ebs-snapshot",role:"ZopNightRemediationPolicy"},"ec2:ModifyVolume":{category:"write",feature:"remediation",resource_type:"ebs-volume",role:"ZopNightRemediationPolicy"},"ec2:ReleaseAddress":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"ec2:RestoreSnapshotTier":{category:"write",feature:"remediation",resource_type:"ebs-snapshot",role:"ZopNightRemediationPolicy"},"ec2:StartInstances":{category:"write",feature:"scheduling",resource_type:"ec2",role:"ZopNightWritePolicy"},"ec2:StopInstances":{category:"write",feature:"scheduling",resource_type:"ec2",role:"ZopNightWritePolicy"},"ecr:DescribeImages":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecr:DescribeRepositories":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecr:GetAuthorizationToken":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecr:GetLifecyclePolicy":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecr:GetRepositoryPolicy":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecr:ListTagsForResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"ecr:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"ecs:DeleteCluster":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"ecs:DeleteService":{category:"write",feature:"remediation",resource_type:"ecs-service",role:"ZopNightRemediationPolicy"},"ecs:DeregisterTaskDefinition":{category:"write",feature:"remediation",resource_type:"ecs-service",role:"ZopNightRemediationPolicy"}
3,"ecs:DescribeClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:DescribeContainerInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:DescribeServices":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:DescribeTaskDefinition":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:DescribeTasks":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:ListClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:ListContainerInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:ListServices":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:ListTasks":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ecs:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"ecs:RegisterTaskDefinition":{category:"write",feature:"remediation",resource_type:"ecs-service",role:"ZopNightRemediationPolicy"},"ecs:UpdateService":{category:"write",feature:"scheduling",resource_type:"ecs-service",role:"ZopNightWritePolicy"},"eks:DeleteNodegroup":{category:"write",feature:"remediation",resource_type:"eks-nodegroup",role:"ZopNightRemediationPolicy"},"eks:DescribeAddon":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"eks:DescribeCluster":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"eks:DescribeNodegroup":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"eks:DescribeUpdate":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"eks:ListAccessEntries":{category:"read",feature:"discovery",role:"ReadOnlyAccess"}
3,"eks:ListClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"eks:ListFargateProfiles":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"eks:ListNodegroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"eks:TagResource":{category:"write",feature:["scheduling","tagging"],role:"ZopNightWritePolicy"},"eks:UpdateNodegroupConfig":{category:"write",feature:"scheduling",resource_type:"eks-nodegroup",role:"ZopNightWritePolicy"},"elasticache:AddTagsToResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"elasticache:DescribeCacheClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticache:DescribeCacheSubnetGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticache:DescribeGlobalReplicationGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticache:DescribeReplicationGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticache:ListTagsForResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"elasticbeanstalk:DescribeConfigurationSettings":{category:"read",feature:"scheduling",resource_type:"beanstalk-env",role:"ReadOnlyAccess"},"elasticbeanstalk:DescribeEnvironments":{category:"read",feature:"scheduling",resource_type:"beanstalk-env",role:"ReadOnlyAccess"},"elasticbeanstalk:UpdateEnvironment":{category:"write",feature:"scheduling",resource_type:"beanstalk-env",role:"ZopNightWritePolicy"},"elasticfilesystem:CreateTags":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"elasticfilesystem:DeleteFileSystem":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"elasticfilesystem:DeleteMountTarget":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"elasticfilesystem:DescribeFileSystems":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticfilesystem:DescribeMountTargets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticfilesystem:DescribeReplicationConfigurations":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticfilesystem:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"elasticloadbalancing:DescribeLoadBalancerAttributes":{category:"write",feature:"remediation",resource_type:"load-balancer",role:"ZopNightRemediationPolicy"},"elasticloadbalancing:DescribeLoadBalancers":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticloadbalancing:DescribeTags":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"elasticloadbalancing:AddTags":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"elasticloadbalancing:DescribeTargetGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticloadbalancing:DescribeTargetHealth":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticloadbalancing:ModifyLoadBalancerAttributes":{category:"write",feature:"remediation",resource_type:"load-balancer",role:"ZopNightRemediationPolicy"},"elasticmapreduce:DescribeCluster":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticmapreduce:ListClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticmapreduce:ListInstanceFleets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"elasticmapreduce:ListInstanceGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"emr-serverless:GetApplication":{category:"read",feature:"scheduling",resource_type:"emr-serverless",role:"ReadOnlyAccess"},"emr-serverless:ListApplications":{category:"read",feature:"discovery",resource_type:"emr-serverless",role:"ReadOnlyAccess"},"emr-serverless:StartApplication":{category:"write",feature:"scheduling",resource_type:"emr-serverless",role:"ZopNightWritePolicy"},"emr-serverless:StopApplication":{category:"write",feature:"scheduling",resource_type:"emr-serverless",role:"ZopNightWritePolicy"},"es:AddTags":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"es:DeleteDomain":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"es:DescribeDomains":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"es:DescribeOutboundConnections":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"es:ListDomainNames":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"es:ListTags":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"fsx:DescribeFileSystems":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"glacier:ListVaults":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"glue:GetJob":{category:"read",feature:["discovery","remediation"],resource_type:"glue-job",role:"ReadOnlyAccess"},"glue:GetJobs":{category:"read",feature:"discovery",resource_type:"glue-job",role:"ReadOnlyAccess"},"glue:GetTags":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"glue:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"glue:UpdateJob":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"guardduty:GetDetector":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"guardduty:ListDetectors":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GenerateCredentialReport":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetAccountPasswordPolicy":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetAccountSummary":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetCredentialReport":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetGroup":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetInstanceProfile":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetLoginProfile":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetOpenIDConnectProvider":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:GetRole":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListAccessKeys":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListAttachedRolePolicies":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListGroupPolicies":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListGroupsForUser":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListMFADevices":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListOpenIDConnectProviders":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListRolePolicies":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListRoles":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListUserPolicies":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListUserTags":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:ListUsers":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"iam:SimulatePrincipalPolicy":{category:"read",feature:"probe",role:"ReadOnlyAccess"},"identitystore:ListUsers":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"inspector2:BatchGetAccountStatus":{category:"read",feature:"discovery",role:"ReadOnlyAccess"}
3,"kafka:ListClustersV2":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"kafka:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"kinesis:DeleteStream":{category:"write",feature:"remediation",resource_type:"kinesis",role:"ZopNightRemediationPolicy"},"kinesis:DescribeStream":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"kinesis:DescribeStreamSummary":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"kinesis:ListStreams":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"kms:DescribeKey":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"kms:ListKeys":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"kms:ListResourceTags":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"kms:ScheduleKeyDeletion":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"kms:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"lambda:DeleteFunction":{category:"write",feature:"remediation",resource_type:"lambda",role:"ZopNightRemediationPolicy"},"lambda:DeleteFunctionConcurrency":{category:"write",feature:"scheduling",resource_type:"lambda",role:"ZopNightWritePolicy"},"lambda:GetFunction":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"lambda:GetFunctionConcurrency":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"lambda:GetFunctionConfiguration":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"lambda:ListEventSourceMappings":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"lambda:ListFunctions":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"lambda:ListTags":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"lambda:PutFunctionConcurrency":{category:"write",feature:"scheduling",resource_type:"lambda",role:"ZopNightWritePolicy"},"lambda:TagResource":{category:"write",feature:["scheduling","tagging"],role:"ZopNightWritePolicy"},"lambda:UpdateFunctionConfiguration":{category:"write",feature:"remediation",resource_type:"lambda",role:"ZopNightRemediationPolicy"},"lightsail:GetInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"lightsail:StartInstance":{category:"write",feature:"scheduling",resource_type:"lightsail",role:"ZopNightWritePolicy"},"lightsail:StopInstance":{category:"write",feature:"scheduling",resource_type:"lightsail",role:"ZopNightWritePolicy"},"logs:DeleteRetentionPolicy":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"logs:DescribeLogGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"logs:DescribeMetricFilters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"logs:DescribeSubscriptionFilters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"logs:GetQueryResults":{category:"read",feature:"recommendations",role:"ReadOnlyAccess"},"logs:ListTagsForResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"logs:PutRetentionPolicy":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"logs:StartQuery":{category:"read",feature:"recommendations",role:"ReadOnlyAccess"},"logs:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"memorydb:DescribeClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"mq:DescribeBroker":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"mq:ListBrokers":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:AddTagsToResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"rds:DeleteDBProxy":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"rds:DescribeDBClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:DescribeDBInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:DescribeDBProxies":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:DescribeDBProxyTargets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:DescribeDBSnapshots":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:DescribeDBSubnetGroups":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:DescribeGlobalClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"rds:ListTagsForResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"rds:ModifyDBInstance":{category:"write",feature:"remediation",resource_type:"rds",role:"ZopNightRemediationPolicy"},"rds:StartDBCluster":{category:"write",feature:"scheduling",resource_type:"rds-cluster",role:"ZopNightWritePolicy"},"rds:StartDBInstance":{category:"write",feature:"scheduling",resource_type:"rds",role:"ZopNightWritePolicy"},"rds:StopDBCluster":{category:"write",feature:"scheduling",resource_type:"rds-cluster",role:"ZopNightWritePolicy"},"rds:StopDBInstance":{category:"write",feature:"scheduling",resource_type:"rds",role:"ZopNightWritePolicy"},"redshift:CreateTags":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"}
3,"redshift:DescribeClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"redshift:PauseCluster":{category:"write",feature:"scheduling",resource_type:"redshift",role:"ZopNightWritePolicy"},"redshift:ResumeCluster":{category:"write",feature:"scheduling",resource_type:"redshift",role:"ZopNightWritePolicy"},"resource-explorer-2:Search":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"route53:ChangeTagsForResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"route53:DeleteHealthCheck":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"route53:GetChange":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"route53:GetHealthCheckStatus":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"route53:GetHostedZone":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"route53:ListHealthChecks":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"route53:ListHostedZones":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"route53:ListResourceRecordSets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"route53:ListTagsForResources":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"route53resolver:ListResolverEndpoints":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"s3:GetAccelerateConfiguration":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"s3:GetBucketAccelerateConfiguration":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"s3:GetBucketPolicy":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"s3:GetBucketPolicyStatus":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"s3:GetBucketReplication":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"s3:GetBucketRequestPayment":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"s3:GetBucketTagging":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"s3:GetIntelligentTieringConfiguration":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"s3:GetLifecycleConfiguration":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"s3:GetObject":{category:"read",feature:"cost",role:"ReadOnlyAccess"},"s3:ListAllMyBuckets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"s3:PutBucketTagging":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"s3:ListBucket":{category:"read",feature:"cost",role:"ReadOnlyAccess"},"s3:ListBucketMultipartUploads":{category:"read",feature:"discovery",resource_type:"s3-bucket",role:"ReadOnlyAccess"},"s3:ListBucketVersions":{category:"read",feature:"discovery",resource_type:"s3-bucket",role:"ReadOnlyAccess"},"s3:PutAccelerateConfiguration":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"s3:PutIntelligentTieringConfiguration":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"s3:PutLifecycleConfiguration":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"sagemaker:CreateEndpoint":{category:"write",feature:"scheduling",resource_type:"sagemaker-endpoint",role:"ZopNightWritePolicy"},"sagemaker:CreateEndpointConfig":{category:"write",feature:"remediation",resource_type:"sagemaker-endpoint",role:"ZopNightRemediationPolicy"},"sagemaker:DeleteEndpoint":{category:"write",feature:"remediation",resource_type:"sagemaker-endpoint",role:"ZopNightWritePolicy"},"sagemaker:DeleteNotebookInstance":{category:"write",feature:"remediation",resource_type:"sagemaker-notebook",role:"ZopNightRemediationPolicy"},"sagemaker:DescribeApp":{category:"read",feature:"discovery",resource_type:"sagemaker-studio-app",role:"ReadOnlyAccess"},"sagemaker:DescribeAutoMLJobV2":{category:"read",feature:"discovery",resource_type:"sagemaker-automl-job",role:"ReadOnlyAccess"},"sagemaker:DescribeCluster":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"sagemaker:DescribeCompilationJob":{category:"read",feature:"discovery",resource_type:"sagemaker-compilation-job",role:"ReadOnlyAccess"},"sagemaker:DescribeEndpoint":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"sagemaker:DescribeEndpointConfig":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"sagemaker:DescribeFeatureGroup":{category:"read",feature:"discovery",resource_type:"sagemaker-feature-group",role:"ReadOnlyAccess"},"sagemaker:DescribeHyperParameterTuningJob":{category:"read",feature:"discovery",resource_type:"sagemaker-tuning-job",role:"ReadOnlyAccess"},"sagemaker:DescribeInferenceComponent":{category:"read",feature:"discovery",resource_type:"sagemaker-inference-component",role:"ReadOnlyAccess"},"sagemaker:DescribeLabelingJob":{category:"read",feature:"discovery",resource_type:"sagemaker-labeling-job",role:"ReadOnlyAccess"},"sagemaker:DescribeNotebookInstance":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"sagemaker:DescribeProcessingJob":{category:"read",feature:"discovery",resource_type:"sagemaker-processing-job",role:"ReadOnlyAccess"},"sagemaker:DescribeSpace":{category:"read",feature:"discovery",resource_type:"sagemaker-space",role:"ReadOnlyAccess"},"sagemaker:DescribeTrainingJob":{category:"read",feature:"discovery",resource_type:"sagemaker-training-job",role:"ReadOnlyAccess"},"sagemaker:DescribeTransformJob":{category:"read",feature:"discovery",resource_type:"sagemaker-batch-transform-job",role:"ReadOnlyAccess"},"sagemaker:ListApps":{category:"read",feature:"discovery",resource_type:"sagemaker-studio-app",role:"ReadOnlyAccess"},"sagemaker:ListAutoMLJobs":{category:"read",feature:"discovery",resource_type:"sagemaker-automl-job",role:"ReadOnlyAccess"}
3,"sagemaker:ListClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"sagemaker:ListCompilationJobs":{category:"read",feature:"discovery",resource_type:"sagemaker-compilation-job",role:"ReadOnlyAccess"},"sagemaker:ListEndpoints":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"sagemaker:ListFeatureGroups":{category:"read",feature:"discovery",resource_type:"sagemaker-feature-group",role:"ReadOnlyAccess"},"sagemaker:ListHyperParameterTuningJobs":{category:"read",feature:"discovery",resource_type:"sagemaker-tuning-job",role:"ReadOnlyAccess"},"sagemaker:ListInferenceComponents":{category:"read",feature:"discovery",resource_type:"sagemaker-inference-component",role:"ReadOnlyAccess"},"sagemaker:ListLabelingJobs":{category:"read",feature:"discovery",resource_type:"sagemaker-labeling-job",role:"ReadOnlyAccess"},"sagemaker:ListNotebookInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"sagemaker:ListProcessingJobs":{category:"read",feature:"discovery",resource_type:"sagemaker-processing-job",role:"ReadOnlyAccess"},"sagemaker:ListSpaces":{category:"read",feature:"discovery",resource_type:"sagemaker-space",role:"ReadOnlyAccess"},"sagemaker:ListTags":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"sagemaker:ListTrainingJobs":{category:"read",feature:"discovery",resource_type:"sagemaker-training-job",role:"ReadOnlyAccess"},"sagemaker:ListTransformJobs":{category:"read",feature:"discovery",resource_type:"sagemaker-batch-transform-job",role:"ReadOnlyAccess"},"sagemaker:StartNotebookInstance":{category:"write",feature:"scheduling",resource_type:"sagemaker-notebook",role:"ZopNightWritePolicy"},"sagemaker:StopNotebookInstance":{category:"write",feature:"scheduling",resource_type:"sagemaker-notebook",role:"ZopNightWritePolicy"},"sagemaker:UpdateCluster":{category:"write",feature:"scheduling",resource_type:"sagemaker-cluster",role:"ZopNightWritePolicy"},"sagemaker:UpdateEndpoint":{category:"write",feature:"remediation",resource_type:"sagemaker-endpoint",role:"ZopNightRemediationPolicy"},"secretsmanager:DeleteSecret":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"secretsmanager:ListSecrets":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ssm:DescribeInstanceInformation":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ses:ListEmailIdentities":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"ses:DeleteEmailIdentity":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"sns:DeleteTopic":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"sqs:DeleteQueue":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"sso:ListInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"states:DeleteStateMachine":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"states:ListExecutions":{category:"read",feature:"scheduling",role:"ReadOnlyAccess"},"states:StopExecution":{category:"write",feature:"scheduling",role:"ZopNightWritePolicy"},"sts:GetCallerIdentity":{category:"read",feature:"probe",role:"ReadOnlyAccess"},"tag:GetResources":{category:"read",feature:["discovery","remediation","tagging"],role:"ReadOnlyAccess"},"tag:TagResources":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"wafv2:DeleteWebACL":{category:"write",feature:"remediation",role:"ZopNightRemediationPolicy"},"wafv2:GetWebACL":{category:"read",feature:"remediation",role:"ReadOnlyAccess"},"wafv2:ListTagsForResource":{category:"read",feature:["discovery","tagging"],role:"ReadOnlyAccess"},"wafv2:TagResource":{category:"write",feature:"tagging",role:"ZopNightRemediationPolicy"},"workspaces:DescribeWorkspaces":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"workspaces:StartWorkspaces":{category:"write",feature:"scheduling",resource_type:"workspace",role:"ZopNightWritePolicy"},"workspaces:StopWorkspaces":{category:"write",feature:"scheduling",resource_type:"workspace",role:"ZopNightWritePolicy"},"xray:GetSamplingRules":{category:"read",feature:"recommendations",role:"ReadOnlyAccess"}
3,"cloudhsm:DescribeClusters":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"timestream-influxdb:ListDbInstances":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"network-firewall:ListFirewalls":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"network-firewall:DescribeFirewall":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"apprunner:ListServices":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"apprunner:DescribeService":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"transfer:ListServers":{category:"read",feature:"discovery",role:"ReadOnlyAccess"},"transfer:DescribeServer":{category:"read",feature:"discovery",role:"ReadOnlyAccess"}},oh={"compute.instances.get":{category:"read",feature:["remediation","tagging"],role:"roles/compute.instanceAdmin.v1"},"container.nodePools.get":{category:"read",feature:"remediation",role:"roles/container.clusterAdmin"},"aiplatform.endpoints.deploy":{category:"write",feature:"scheduling",resource_type:"vertex-endpoint",role:"roles/aiplatform.user"},"aiplatform.endpoints.undeploy":{category:"write",feature:"scheduling",resource_type:"vertex-endpoint",role:"roles/aiplatform.user"},"aiplatform.models.list":{category:"read",feature:"discovery",resource_type:"vertex-model",role:"roles/aiplatform.viewer"},"aiplatform.batchPredictionJobs.list":{category:"read",feature:"discovery",resource_type:"vertex-batch-prediction-job",role:"roles/aiplatform.viewer"},"aiplatform.deploymentResourcePools.list":{category:"read",feature:"discovery",resource_type:"vertex-deployment-resource-pool",role:"roles/aiplatform.viewer"},"aiplatform.customJobs.list":{category:"read",feature:"discovery",resource_type:"vertex-custom-job",role:"roles/aiplatform.viewer"},"aiplatform.hyperparameterTuningJobs.list":{category:"read",feature:"discovery",resource_type:"vertex-tuning-job",role:"roles/aiplatform.viewer"},"aiplatform.tuningJobs.list":{category:"read",feature:"discovery",resource_type:"vertex-tuning-job",role:"roles/aiplatform.viewer"},"aiplatform.nasJobs.list":{category:"read",feature:"discovery",resource_type:"vertex-nas-job",role:"roles/aiplatform.viewer"},"aiplatform.pipelineJobs.list":{category:"read",feature:"discovery",resource_type:"vertex-pipeline-job",role:"roles/aiplatform.viewer"},"aiplatform.trainingPipelines.list":{category:"read",feature:"discovery",resource_type:"vertex-training-pipeline",role:"roles/aiplatform.viewer"},"aiplatform.notebookExecutionJobs.list":{category:"read",feature:"discovery",resource_type:"vertex-notebook-execution-job",role:"roles/aiplatform.viewer"},"artifactregistry.dockerimages.list":{category:"read",feature:"discovery",role:"roles/artifactregistry.reader"},"artifactregistry.repositories.list":{category:"read",feature:"discovery",role:"roles/artifactregistry.reader"},"bigquery.jobs.create":{category:"read",feature:"cost",role:"roles/bigquery.jobUser"},"bigquery.tables.getData":{category:"read",feature:"cost",role:"roles/bigquery.dataViewer"},"cloudasset.assets.searchAllResources":{category:"read",feature:"discovery",role:"roles/cloudasset.viewer"},"monitoring.timeSeries.list":{category:"read",feature:["discovery"],resource_type:"vertex-provisioned-throughput",role:"roles/monitoring.viewer"},"recommender.computeAddressIdleResourceRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.computeViewer"},"recommender.computeDiskIdleResourceRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.computeViewer"},"recommender.computeImageIdleResourceRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.computeViewer"},"recommender.computeInstanceGroupManagerMachineTypeRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.computeViewer"},"recommender.computeInstanceIdleResourceRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.computeViewer"},"recommender.computeInstanceMachineTypeRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.computeViewer"},"recommender.cloudsqlIdleInstanceRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.cloudsqlViewer"},"recommender.cloudsqlOverprovisionedInstanceRecommendations.list":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"roles/recommender.cloudsqlViewer"},"cloudsql.backupRuns.list":{category:"read",feature:"discovery",resource_type:"cloudsql",role:"roles/cloudsql.viewer"},"cloudsql.databases.list":{category:"read",feature:"discovery",resource_type:"cloudsql",role:"roles/cloudsql.viewer"},"cloudsql.instances.get":{category:"read",feature:["remediation","tagging"],resource_type:"cloudsql",role:"roles/cloudsql.editor"},"cloudsql.instances.list":{category:"read",feature:"discovery",resource_type:"cloudsql",role:"roles/cloudsql.viewer"},"cloudsql.instances.update":{category:"write",feature:["scheduling","tagging"],resource_type:"cloudsql",role:"roles/cloudsql.editor"},"compute.autoscalers.create":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.autoscalers.get":{category:"read",feature:"scheduling",resource_type:"compute",role:"roles/compute.viewer"},"compute.autoscalers.delete":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.autoscalers.update":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.disks.delete":{category:"write",feature:"remediation",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.instanceGroupManagers.create":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.instanceTemplates.create":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.instanceTemplates.delete":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.instances.list":{category:"read",feature:"discovery",resource_type:"compute",role:"roles/compute.viewer"},"compute.instances.setMachineType":{category:"write",feature:"remediation",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.instances.start":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.instances.stop":{category:"write",feature:"scheduling",resource_type:"compute",role:"roles/compute.instanceAdmin.v1"},"compute.snapshots.delete":{category:"write",feature:"remediation",role:"roles/compute.instanceAdmin.v1"},"compute.zoneOperations.get":{category:"write",feature:"remediation",role:"roles/compute.instanceAdmin.v1"},"container.clusters.get":{category:"read",feature:["discovery","tagging"],role:"roles/container.viewer"},"container.clusters.list":{category:"read",feature:"discovery",role:"roles/container.viewer"},"container.clusters.update":{category:"write",feature:["scheduling","tagging"],resource_type:"gke-cluster",role:"roles/container.clusterAdmin"},"container.cronJobs.update":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.daemonSets.update":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.deployments.list":{category:"write",feature:"scheduling",resource_type:"gke-cluster",role:"roles/container.developer"},"container.deployments.update":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.horizontalPodAutoscalers.create":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.horizontalPodAutoscalers.delete":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.operations.get":{category:"write",feature:"remediation",resource_type:"gke-cluster",role:"roles/container.clusterAdmin"},"container.podDisruptionBudgets.create":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.podDisruptionBudgets.delete":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.statefulSets.update":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.thirdPartyObjects.create":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"},"container.thirdPartyObjects.delete":{category:"write",feature:"namespace_scheduling",resource_type:"gke-namespace",role:"roles/container.developer"}
3,"dataproc.clusters.delete":{category:"write",feature:"remediation",role:"roles/dataproc.editor"},"dataproc.clusters.list":{category:"read",feature:"discovery",role:"roles/dataproc.viewer"},"dataproc.jobs.list":{category:"read",feature:"discovery",role:"roles/dataproc.viewer"},"dataproc.operations.get":{category:"write",feature:"remediation",role:"roles/dataproc.editor"},"notebooks.instances.delete":{category:"write",feature:"remediation",resource_type:"notebooks",role:"roles/notebooks.admin"},"notebooks.instances.start":{category:"write",feature:"scheduling",resource_type:"notebooks",role:"roles/notebooks.admin"},"notebooks.instances.stop":{category:"write",feature:"scheduling",resource_type:"notebooks",role:"roles/notebooks.admin"},"osconfig.inventories.get":{category:"read",feature:"recommendations",role:"roles/osconfig.inventoryViewer"},"osconfig.patchJobs.exec":{category:"write",feature:"observability",role:"roles/osconfig.patchJobExecutor"},"osconfig.patchJobs.get":{category:"write",feature:"observability",role:"roles/osconfig.patchJobExecutor"},"redis.instances.update":{category:"write",feature:"scheduling",resource_type:"memorystore",role:"roles/redis.editor"},"run.services.get":{category:"read",feature:["remediation","tagging"],resource_type:"cloudrun",role:"roles/run.developer"},"run.services.update":{category:"write",feature:["scheduling","tagging"],resource_type:"cloudrun",role:"roles/run.developer"},"storage.buckets.get":{category:"read",feature:["remediation","tagging"],resource_type:"gcs-bucket",role:"roles/storage.admin"},"storage.buckets.update":{category:"write",feature:["remediation","tagging"],resource_type:"gcs-bucket",role:"roles/storage.admin"},"iam.serviceAccountKeys.list":{category:"read",feature:"discovery",resource_type:"iam-user",role:"roles/iam.securityReviewer"}},nh={"Microsoft.CognitiveServices/accounts/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.CognitiveServices/accounts/deployments/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.CognitiveServices/accounts/projects/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.CognitiveServices/accounts/raiPolicies/read":{category:"read",feature:"discovery",resource_type:"ai-rai-policy",role:"Reader"},"Microsoft.CognitiveServices/accounts/raiBlocklists/read":{category:"read",feature:"discovery",resource_type:"ai-rai-blocklist",role:"Reader"},"Microsoft.CognitiveServices/accounts/connections/read":{category:"read",feature:"discovery",resource_type:"ai-connection",role:"Reader"},"Microsoft.CognitiveServices/accounts/projects/connections/read":{category:"read",feature:"discovery",resource_type:"ai-connection",role:"Reader"},"Microsoft.CognitiveServices/accounts/commitmentPlans/read":{category:"read",feature:"discovery",resource_type:"ai-commitment-plan",role:"Reader"},"Microsoft.CognitiveServices/accounts/managedComputeDeployments/read":{category:"read",feature:"discovery",resource_type:"ai-managed-compute-deployment",role:"Reader"},"Microsoft.CognitiveServices/accounts/capabilityHosts/read":{category:"read",feature:"discovery",resource_type:"ai-capability-host",role:"Reader"},"Microsoft.CognitiveServices/accounts/encryptionScopes/read":{category:"read",feature:"discovery",resource_type:"ai-encryption-scope",role:"Reader"},"Microsoft.CognitiveServices/accounts/defenderForAISettings/read":{category:"read",feature:"discovery",resource_type:"ai-defender-setting",role:"Reader"},"Microsoft.CognitiveServices/accounts/networkSecurityPerimeterConfigurations/read":{category:"read",feature:"discovery",resource_type:"ai-network-perimeter",role:"Reader"},"Microsoft.CognitiveServices/accounts/openai/read":{category:"read",feature:"discovery",resource_type:["azure-openai-finetuning-job","azure-openai-batch-job","azure-openai-vector-store","ai-agent"],role:"Cognitive Services OpenAI User"},"Microsoft.MachineLearningServices/workspaces/jobs/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/models/read":{category:"read",feature:"discovery",role:"Reader"}
3,"Microsoft.MachineLearningServices/workspaces/datastores/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/environments/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/components/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/schedules/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/connections/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/data/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/featuresets/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/featurestoreentities/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/registries/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Search/searchServices/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Search/searchServices/listAdminKeys/action":{category:"read",feature:"discovery",role:"Search Service Contributor"},"Microsoft.Databricks/workspaces/write":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.DataFactory/factories/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.DataFactory/factories/write":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.Web/sites/write":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.Web/serverfarms/read":{category:"read",feature:"remediation",role:"Reader"},"Microsoft.KeyVault/vaults/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Network/ddosProtectionPlans/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Network/virtualNetworks/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Network/networkSecurityGroups/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Network/publicIPAddresses/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Network/virtualNetworks/virtualNetworkPeerings/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Advisor/recommendations/read":{category:"read",feature:"recommendations",resource_type:"native-recommendation",role:"Reader"},"Microsoft.App/containerApps/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.App/containerApps/start/action":{category:"write",feature:"scheduling",resource_type:"containerapp",role:"Zopnight Write Access"},"Microsoft.App/containerApps/stop/action":{category:"write",feature:"scheduling",resource_type:"containerapp",role:"Zopnight Write Access"},"Microsoft.Authorization/roleAssignments/read":{category:"read",feature:"probe",role:"Reader"},"Microsoft.Authorization/roleDefinitions/read":{category:"read",feature:"probe",role:"Reader"},"Microsoft.Automation/automationAccounts/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Batch/batchAccounts/pools/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Batch/batchAccounts/pools/write":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.CognitiveServices/accounts/write":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.Compute/disks/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Compute/disks/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Compute/disks/write":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Compute/snapshots/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Compute/snapshots/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Compute/virtualMachineScaleSets/deallocate/action":{category:"write",feature:"scheduling",resource_type:"vmss",role:"Zopnight Write Access"},"Microsoft.Compute/virtualMachineScaleSets/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Compute/virtualMachineScaleSets/start/action":{category:"write",feature:"scheduling",resource_type:"vmss",role:"Zopnight Write Access"},"Microsoft.Compute/virtualMachineScaleSets/write":{category:"write",feature:"scheduling",resource_type:"vmss",role:"Zopnight Write Access"},"Microsoft.Compute/virtualMachines/deallocate/action":{category:"write",feature:"scheduling",resource_type:"vm",role:"Zopnight Write Access"},"Microsoft.Compute/virtualMachines/extensions/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Compute/virtualMachines/read":{category:"read",feature:["discovery","remediation"],resource_type:"vm",role:"Reader"},"Microsoft.Compute/virtualMachines/start/action":{category:"write",feature:"scheduling",resource_type:"vm",role:"Zopnight Write Access"},"Microsoft.Compute/virtualMachines/write":{category:"write",feature:"remediation",resource_type:"vm",role:"Zopnight Write Access"},"Microsoft.ContainerRegistry/registries/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.ContainerService/managedClusters/agentPools/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.ContainerService/managedClusters/agentPools/write":{category:"write",feature:"scheduling",resource_type:"aks-cluster",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apiextensions.k8s.io/customresourcedefinitions/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/controllerrevisions/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/daemonsets/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/daemonsets/write":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/deployments/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/deployments/write":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/replicasets/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/statefulsets/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/apps/statefulsets/write":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/autoscaling/horizontalpodautoscalers/delete":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/autoscaling/horizontalpodautoscalers/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/autoscaling/horizontalpodautoscalers/write":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/batch/cronjobs/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/batch/cronjobs/write":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/batch/jobs/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/configmaps/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/customresources/delete":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/customresources/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/customresources/write":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/discovery.k8s.io/endpointslices/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/endpoints/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/events.k8s.io/events/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/events/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/extensions/daemonsets/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/extensions/deployments/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/extensions/ingresses/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/extensions/networkpolicies/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/extensions/replicasets/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/limitranges/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/listClusterUserCredential/action":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/metrics.k8s.io/nodes/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/metrics.k8s.io/pods/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/namespaces/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/networking.k8s.io/ingresses/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/networking.k8s.io/networkpolicies/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/nodes/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/persistentvolumeclaims/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/persistentvolumes/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/pods/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/policy/poddisruptionbudgets/delete":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/policy/poddisruptionbudgets/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/policy/poddisruptionbudgets/write":{category:"write",feature:"namespace_scheduling",resource_type:"aks-namespace",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterrolebindings/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/clusterroles/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/rolebindings/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/rbac.authorization.k8s.io/roles/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.ContainerService/managedClusters/replicationcontrollers/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/resourcequotas/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/secrets/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/serviceaccounts/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/services/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/start/action":{category:"write",feature:"scheduling",resource_type:"aks-cluster",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/stop/action":{category:"write",feature:"scheduling",resource_type:"aks-cluster",role:"Zopnight AKS Access"},"Microsoft.ContainerService/managedClusters/storage.k8s.io/storageclasses/read":{category:"read",feature:"discovery",role:"Zopnight AKS Access"},"Microsoft.CostManagement/query/read":{category:"read",feature:"cost",role:"Cost Management Reader"},"Microsoft.DBforMySQL/flexibleServers/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.DBforMySQL/flexibleServers/start/action":{category:"write",feature:"scheduling",resource_type:"mysql-flexible",role:"Zopnight Write Access"},"Microsoft.DBforMySQL/flexibleServers/stop/action":{category:"write",feature:"scheduling",resource_type:"mysql-flexible",role:"Zopnight Write Access"},"Microsoft.DBforMySQL/flexibleServers/write":{category:"write",feature:"remediation",resource_type:"mysql-flexible",role:"Zopnight Write Access"},"Microsoft.DBforPostgreSQL/flexibleServers/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.DBforPostgreSQL/flexibleServers/start/action":{category:"write",feature:"scheduling",resource_type:"postgresql-flexible",role:"Zopnight Write Access"},"Microsoft.DBforPostgreSQL/flexibleServers/stop/action":{category:"write",feature:"scheduling",resource_type:"postgresql-flexible",role:"Zopnight Write Access"},"Microsoft.DataFactory/factories/integrationRuntimes/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.DataFactory/factories/integrationRuntimes/start/action":{category:"write",feature:"scheduling",resource_type:"ssis-ir",role:"Zopnight Write Access"},"Microsoft.DataFactory/factories/integrationRuntimes/stop/action":{category:"write",feature:"scheduling",resource_type:"ssis-ir",role:"Zopnight Write Access"},"Microsoft.DataFactory/factories/triggers/start/action":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.DataFactory/factories/triggers/stop/action":{category:"write",feature:"scheduling",role:"Zopnight Write Access"}
3,"Microsoft.Databricks/workspaces/read":{category:"read",feature:"discovery",role:"Reader"},"Databricks/clusters/list":{category:"read",feature:"discovery",role:"Zopnight Databricks Access",probe:"data-plane"},"Databricks/instance-pools/list":{category:"read",feature:"discovery",role:"Zopnight Databricks Access",probe:"data-plane"},"Databricks/sql/warehouses/list":{category:"read",feature:"discovery",role:"Zopnight Databricks Access",probe:"data-plane"},"Databricks/jobs/list":{category:"read",feature:"discovery",role:"Zopnight Databricks Access",probe:"data-plane"},"Databricks/jobs/runs/list":{category:"read",feature:"discovery",role:"Zopnight Databricks Access",probe:"data-plane"},"Databricks/sql/history/queries":{category:"read",feature:"discovery",role:"Zopnight Databricks Access",probe:"data-plane"},"Databricks/serving-endpoints/list":{category:"read",feature:"discovery",role:"Zopnight Databricks Access",probe:"data-plane"},"Microsoft.EventHub/namespaces/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Insights/autoscalesettings/delete":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.Insights/autoscalesettings/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Insights/autoscalesettings/write":{category:"write",feature:"scheduling",role:"Zopnight Write Access"},"Microsoft.Insights/metricAlerts/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Insights/scheduledQueryRules/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Insights/eventTypes/values/read":{category:"read",feature:"recommendations",role:"Reader"},"Microsoft.Insights/metrics/read":{category:"read",feature:"recommendations",role:"Reader"},"Microsoft.Kusto/Clusters/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Kusto/Clusters/start/action":{category:"write",feature:"scheduling",resource_type:"data-explorer",role:"Zopnight Write Access"},"Microsoft.Kusto/Clusters/stop/action":{category:"write",feature:"scheduling",resource_type:"data-explorer",role:"Zopnight Write Access"},"Microsoft.MachineLearningServices/workspaces/computes/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.MachineLearningServices/workspaces/computes/start/action":{category:"write",feature:"scheduling",resource_type:"ml-compute-instance",role:"Zopnight Write Access"},"Microsoft.MachineLearningServices/workspaces/computes/stop/action":{category:"write",feature:"scheduling",resource_type:"ml-compute-instance",role:"Zopnight Write Access"},"Microsoft.MachineLearningServices/workspaces/computes/write":{category:"write",feature:"scheduling",resource_type:"ml-compute-instance",role:"Zopnight Write Access"},"Microsoft.OperationalInsights/workspaces/read":{category:"read",feature:"remediation",role:"Reader"},"Microsoft.OperationalInsights/workspaces/write":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.RecoveryServices/vaults/backupPolicies/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.RecoveryServices/vaults/backupPolicies/write":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.RecoveryServices/vaults/backupProtectedItems/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.RecoveryServices/vaults/backupconfig/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.RecoveryServices/vaults/backupstorageconfig/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.RecoveryServices/vaults/backupstorageconfig/write":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.RecoveryServices/vaults/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.RecoveryServices/vaults/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.RecoveryServices/vaults/write":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.ResourceGraph/resources/read":{category:"read",feature:["discovery","recommendations"],role:"Reader"}
3,"Microsoft.Resources/subscriptions/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Resources/subscriptions/resourceGroups/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Security/locations/jitNetworkAccessPolicies/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.ServiceBus/namespaces/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Sql/servers/databases/pause/action":{category:"write",feature:"scheduling",resource_type:"sqldatabase",role:"Zopnight Write Access"},"Microsoft.Sql/servers/databases/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Sql/servers/databases/resume/action":{category:"write",feature:"scheduling",resource_type:"sqldatabase",role:"Zopnight Write Access"},"Microsoft.Sql/servers/securityAlertPolicies/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Storage/storageAccounts/managementPolicies/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Storage/storageAccounts/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Storage/storageAccounts/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Storage/storageAccounts/write":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Synapse/workspaces/sqlPools/pause/action":{category:"write",feature:"scheduling",resource_type:"synapse-pool",role:"Zopnight Write Access"},"Microsoft.Synapse/workspaces/sqlPools/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Synapse/workspaces/sqlPools/resume/action":{category:"write",feature:"scheduling",resource_type:"synapse-pool",role:"Zopnight Write Access"},"Microsoft.Web/serverfarms/delete":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Web/serverfarms/write":{category:"write",feature:"remediation",role:"Zopnight Write Access"},"Microsoft.Web/sites/config/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Web/sites/read":{category:"read",feature:"discovery",role:"Reader"},"Microsoft.Web/sites/start/action":{category:"write",feature:"scheduling",resource_type:"functionapp",role:"Zopnight Write Access"},"Microsoft.Web/sites/stop/action":{category:"write",feature:"scheduling",resource_type:"functionapp",role:"Zopnight Write Access"}},ah={category:"read",feature:"cost",resource_type:"account",role:"ZOPNIGHT_READ_ROLE",grant:{privilege:"IMPORTED PRIVILEGES",level:"database-snowflake"}},ih={category:"read",feature:"cost",resource_type:"account",role:"ZOPNIGHT_READ_ROLE",grant:{privilege:"MONITOR USAGE",level:"account"}},ch={category:"read",feature:"discovery",resource_type:"warehouse",role:"ZOPNIGHT_READ_ROLE",grant:{privilege:"USAGE",level:"warehouse"}},lh={category:"read",feature:"discovery",resource_type:"warehouse",role:"ZOPNIGHT_READ_ROLE",grant:{privilege:"MONITOR",level:"warehouse"}},uh={category:"read",feature:"discovery",resource_type:"account",role:"ZOPNIGHT_READ_ROLE"},dh={category:"write",feature:"scheduling",resource_type:"warehouse",role:"ZOPNIGHT_WRITE_ROLE",grant:{privilege:"OPERATE",level:"warehouse"}},fh={IMPORTED_PRIVILEGES_ON_DATABASE_SNOWFLAKE:ah,MONITOR_USAGE_ON_ACCOUNT:ih,USAGE_ON_WAREHOUSE:ch,MONITOR_ON_WAREHOUSE:lh,SHOW_GRANTS:uh,OPERATE_ON_WAREHOUSE:dh},mh={"Organization.Read.All":{category:"read",feature:"discovery",resource_type:["m365_license_sku","m365_copilot_seat"],role:"ZopNight Entra application (admin consent)"},"User.Read.All":{category:"read",feature:"discovery",resource_type:"m365_copilot_seat",role:"ZopNight Entra application (admin consent)"},"Reports.Read.All":{category:"read",feature:"recommendations",resource_type:"m365_copilot_seat",role:"ZopNight Entra application (admin consent)"},"ReportSettings.Read.All":{category:"read",feature:"recommendations",resource_type:"m365_copilot_seat",role:"ZopNight Entra application (admin consent)"},"Microsoft.Billing/billingAccounts/read":{category:"read",feature:"cost",resource_type:"account",role:"Billing account reader"},"Microsoft.Billing/billingAccounts/products/read":{category:"read",feature:"cost",resource_type:"m365_license_sku",role:"Billing account reader"},"Microsoft.Billing/billingAccounts/invoices/read":{category:"read",feature:"cost",resource_type:"account",role:"Billing account reader"},"Microsoft.Billing/billingAccounts/invoices/transactions/read":{category:"read",feature:"cost",resource_type:"m365_license_sku",role:"Billing account reader"}},gh={"cloudsql.databases.create":{category:"write",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"cloudsql.instances.create":{category:"write",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"cloudsql.instances.delete":{category:"write",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"cloudsql.instances.update":{category:"write",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"cloudsql.databases.list":{category:"read",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"cloudsql.instances.export":{category:"write",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"cloudsql.instances.get":{category:"read",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"cloudsql.instances.import":{category:"write",feature:"provisioning",resource_type:"cloudsql",role:"roles/cloudsql.admin"},"storage.buckets.create":{category:"write",feature:"provisioning",resource_type:"gcs-bucket",role:"roles/storage.admin"},"storage.buckets.delete":{category:"write",feature:"provisioning",resource_type:"gcs-bucket",role:"roles/storage.admin"},"storage.buckets.get":{category:"read",feature:"provisioning",resource_type:"gcs-bucket",role:"roles/storage.admin"},"storage.buckets.getIamPolicy":{category:"read",feature:"provisioning",resource_type:"gcs-bucket",role:"roles/storage.admin"},"storage.buckets.setIamPolicy":{category:"write",feature:"provisioning",resource_type:"gcs-bucket",role:"roles/storage.admin"},"storage.objects.delete":{category:"write",feature:"provisioning",resource_type:"gcs-bucket",role:"roles/storage.admin"},"storage.objects.list":{category:"read",feature:"provisioning",resource_type:"gcs-bucket",role:"roles/storage.admin"},"compute.addresses.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.addresses.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.backendServices.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.backendServices.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.backendServices.update":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.firewalls.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.firewalls.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.firewalls.update":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.forwardingRules.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.forwardingRules.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.globalAddresses.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.globalAddresses.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.globalForwardingRules.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.globalForwardingRules.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.globalOperations.get":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.healthChecks.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.healthChecks.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.instanceGroupManagers.create":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instanceGroupManagers.delete":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instanceGroups.create":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instanceGroups.delete":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instanceGroups.update":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instanceTemplates.create":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instanceTemplates.delete":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.create":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.delete":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.getGuestAttributes":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.osAdminLogin":{category:"write",feature:"deployments",resource_type:"compute",role:"roles/compute.osAdminLogin"},"compute.instances.osLogin":{category:"write",feature:"deployments",resource_type:"compute",role:"roles/compute.osLogin"},"compute.networks.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.networks.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.networks.updatePolicy":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.regionOperations.get":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.routers.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.routers.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.routers.update":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.sslCertificates.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.sslCertificates.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.subnetworks.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.subnetworks.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/compute.admin"},"compute.targetHttpProxies.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.targetHttpProxies.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.targetHttpsProxies.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.targetHttpsProxies.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.urlMaps.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.urlMaps.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster"],role:"roles/compute.admin"},"compute.zoneOperations.get":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"container.clusters.create":{category:"write",feature:"provisioning",resource_type:"gke-cluster",role:"roles/container.clusterAdmin"},"container.clusters.delete":{category:"write",feature:"provisioning",resource_type:"gke-cluster",role:"roles/container.clusterAdmin"},"dns.changes.create":{category:"write",feature:"provisioning",resource_type:["gke-cluster","compute"],role:"roles/dns.admin"},"dns.managedZones.create":{category:"write",feature:"provisioning",resource_type:"gke-cluster",role:"roles/dns.admin"},"dns.managedZones.delete":{category:"write",feature:"provisioning",resource_type:"gke-cluster",role:"roles/dns.admin"},"dns.managedZones.get":{category:"read",feature:"provisioning",resource_type:"compute",role:"roles/dns.admin"},"dns.managedZones.list":{category:"read",feature:"provisioning",resource_type:"compute",role:"roles/dns.admin"},"dns.resourceRecordSets.create":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/dns.admin"},"dns.resourceRecordSets.delete":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/dns.admin"},"dns.resourceRecordSets.list":{category:"read",feature:"provisioning",resource_type:"compute",role:"roles/dns.admin"},"dns.resourceRecordSets.update":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/dns.admin"},"iam.serviceAccounts.actAs":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/iam.serviceAccountUser"},"iam.serviceAccounts.create":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/iam.serviceAccountAdmin"},"iam.serviceAccounts.delete":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/iam.serviceAccountAdmin"},"iam.serviceAccounts.setIamPolicy":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/iam.serviceAccountAdmin"},"iap.tunnelInstances.accessViaIAP":{category:"write",feature:"deployments",role:"roles/iap.tunnelResourceAccessor"},"redis.instances.create":{category:"write",feature:"provisioning",resource_type:"memorystore",role:"roles/redis.admin"},"redis.instances.delete":{category:"write",feature:"provisioning",resource_type:"memorystore",role:"roles/redis.admin"},"resourcemanager.projects.setIamPolicy":{category:"write",feature:"provisioning",resource_type:["compute","gke-cluster","cloudsql","memorystore"],role:"roles/resourcemanager.projectIamAdmin"},"logging.logEntries.list":{category:"read",feature:"deployments",resource_type:"compute",role:"roles/logging.viewer"},"monitoring.timeSeries.list":{category:"read",feature:"deployments",resource_type:"compute",role:"roles/monitoring.viewer"},"secretmanager.secrets.create":{category:"write",feature:"deployments",role:"roles/secretmanager.admin"},"secretmanager.secrets.delete":{category:"write",feature:"deployments",role:"roles/secretmanager.admin"},"secretmanager.versions.access":{category:"write",feature:"deployments",role:"roles/secretmanager.admin"},"secretmanager.versions.add":{category:"write",feature:"deployments",role:"roles/secretmanager.admin"},"secretmanager.versions.get":{category:"read",feature:"deployments",role:"roles/secretmanager.admin"
3},"servicenetworking.operations.get":{category:"write",feature:"provisioning",resource_type:["cloudsql","memorystore"],role:"roles/servicenetworking.networksAdmin"},"servicenetworking.services.addPeering":{category:"write",feature:"provisioning",resource_type:["cloudsql","memorystore"],role:"roles/servicenetworking.networksAdmin"},"compute.instances.get":{category:"read",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.list":{category:"read",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.stop":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.start":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.instances.setMachineType":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.disks.get":{category:"read",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"},"compute.disks.resize":{category:"write",feature:"provisioning",resource_type:"compute",role:"roles/compute.admin"}},ph={"audit-logging":{category:"Management & Governance",label:"Audit & Logging"},"ebs-snapshot-parent":{category:"Storage",label:"EBS Snapshots"},"rds-snapshot-parent":{category:"Storage",label:"RDS Snapshots"},"gcp-snapshot-parent":{category:"Storage",label:"Disk Snapshots"},"azure-snapshot-parent":{category:"Storage",label:"Disk Snapshots"},"security-group-parent":{category:"Security",label:"Security Groups"},"nsg-parent":{category:"Security",label:"Network Security Groups"},"vnet-peering-parent":{category:"Networking",label:"VNet Peerings"},"developer-tools":{category:"Developer Tools",label:"Developer Tools"},"iam-account-security":{category:"Security",label:"IAM Account Security"},messaging:{category:"Messaging",label:"Messaging"},"security-services":{category:"Security",label:"Security Services"},apprunner:{category:"Compute",label:"App Runner Services"},asg:{category:"Compute",label:"Auto Scaling Groups"},"beanstalk-env":{category:"Compute",label:"Elastic Beanstalk"},"bedrock-agent":{category:"ML",label:"Bedrock Agents"},"bedrock-agent-action-group":{category:"ML",label:"Bedrock Agent Action Groups"},"bedrock-agent-alias":{category:"ML",label:"Bedrock Agent Aliases"},"bedrock-agent-version":{category:"ML",label:"Bedrock Agent Versions"},"bedrock-batch-job":{category:"ML",label:"Bedrock Batch Inference Job"},"bedrock-batch-job-parent":{category:"ML",label:"Bedrock Batch Inference Jobs"},"bedrock-custom-model":{category:"ML",label:"Bedrock Custom Models"},"bedrock-custom-model-deployment":{category:"ML",label:"Bedrock Custom Model Deployments"},"vertex-provisioned-throughput":{category:"ML",label:"Vertex Provisioned Throughput"},"native-recommendation":{category:"Recommendations",label:"Native Recommendations"},"bedrock-customization-job":{category:"ML",label:"Bedrock Customization Job"},"bedrock-customization-job-parent":{category:"ML",label:"Bedrock Customization Jobs"},"bedrock-data-automation-project":{category:"ML",label:"Bedrock Data Automation Projects"},"bedrock-data-source":{category:"ML",label:"Bedrock Data Sources"},"bedrock-evaluation-job":{category:"ML",label:"Bedrock Evaluation Job"},"bedrock-evaluation-job-parent":{category:"ML",label:"Bedrock Evaluation Jobs"},"bedrock-flow":{category:"ML",label:"Bedrock Flows"},"bedrock-flow-alias":{category:"ML",label:"Bedrock Flow Aliases"},"bedrock-flow-version":{category:"ML",label:"Bedrock Flow Versions"},"bedrock-guardrail":{category:"ML",label:"Bedrock Guardrails"},"bedrock-imported-model":{category:"ML",label:"Bedrock Imported Models"},"bedrock-inference-profile":{category:"ML",label:"Bedrock Inference Profiles"},"bedrock-kb":{category:"ML",label:"Bedrock Knowledge Bases"},"bedrock-marketplace-endpoint":{category:"ML",label:"Bedrock Marketplace Endpoints"},"bedrock-model-copy-job":{category:"ML",label:"Bedrock Model Copy Job"},"bedrock-model-copy-job-parent":{category:"ML",label:"Bedrock Model Copy Jobs"},"bedrock-prompt":{category:"ML",label:"Bedrock Prompts"},"bedrock-pt":{category:"ML",label:"Bedrock Provisioned Throughput"},"ebs-snapshot":{category:"Storage",label:"EBS Snapshots"},"rds-snapshot":{category:"Storage",label:"RDS Snapshots"},"rds-snapshot-orphan":{category:"Storage",label:"Orphan RDS Snapshots"},"gcp-snapshot":{category:"Storage",label:"GCP Disk Snapshots"},"gcp-snapshot-orphan":{category:"Storage",label:"Orphan GCP Snapshots"}
3,"azure-snapshot":{category:"Storage",label:"Azure Disk Snapshots"},"azure-snapshot-orphan":{category:"Storage",label:"Orphan Azure Snapshots"},"security-group":{category:"Security",label:"Security Groups"},nsg:{category:"Security",label:"Network Security Groups"},"vnet-peering":{category:"Networking",label:"VNet Peerings"},"ebs-volume":{category:"Storage",label:"EBS Volumes"},ec2:{category:"Compute",label:"EC2 Instances"},ecr:{category:"Container",label:"ECR Repositories"},"ecs-service":{category:"Container",label:"ECS Services"},"eks-cluster":{category:"Kubernetes",label:"EKS Clusters"},"eks-namespace":{category:"Kubernetes",label:"EKS Namespaces"},"eks-nodegroup":{category:"Kubernetes",label:"EKS Node Groups"},elasticache:{category:"Cache",label:"ElastiCache"},"elasticache-node":{category:"Cache",label:"ElastiCache Nodes"},"documentdb-cluster":{category:"Database",label:"DocumentDB Clusters"},"documentdb-instance":{category:"Database",label:"DocumentDB Instances"},"emr-serverless":{category:"Data & Analytics",label:"EMR Serverless"},"glue-job":{category:"Data & Analytics",label:"Glue Jobs"},"iam-user":{category:"Security",label:"IAM Users"},kinesis:{category:"Messaging",label:"Kinesis Streams"},lambda:{category:"Serverless",label:"Lambda Functions"},lightsail:{category:"Compute",label:"Lightsail"},"load-balancer":{category:"Network",label:"Load Balancers"},rds:{category:"Database",label:"RDS Instances"},"rds-cluster":{category:"Database",label:"RDS Clusters"},redshift:{category:"Database",label:"Redshift"},"s3-bucket":{category:"Storage",label:"S3 Buckets"},"sagemaker-async-endpoint":{category:"ML",label:"SageMaker Async Endpoints"},"sagemaker-automl-job":{category:"ML",label:"SageMaker AutoML Job"},"sagemaker-automl-job-parent":{category:"ML",label:"SageMaker AutoML Jobs"},"sagemaker-batch-transform-job":{category:"ML",label:"SageMaker Batch Transform Job"},"sagemaker-batch-transform-job-parent":{category:"ML",label:"SageMaker Batch Transform Jobs"},"sagemaker-cluster":{category:"ML",label:"SageMaker Clusters"},"sagemaker-compilation-job":{category:"ML",label:"SageMaker Compilation Job"},"sagemaker-compilation-job-parent":{category:"ML",label:"SageMaker Compilation Jobs"},"sagemaker-domain":{category:"ML",label:"SageMaker Studio Domains"},"sagemaker-endpoint":{category:"ML",label:"SageMaker Endpoints"},"sagemaker-feature-group":{category:"ML",label:"SageMaker Feature Groups"},"sagemaker-inference-component":{category:"ML",label:"SageMaker Inference Components"},"sagemaker-labeling-job":{category:"ML",label:"SageMaker Labeling Job"},"sagemaker-labeling-job-parent":{category:"ML",label:"SageMaker Labeling Jobs"},"sagemaker-notebook":{category:"ML",label:"SageMaker Notebooks"},"sagemaker-processing-job":{category:"ML",label:"SageMaker Processing Job"},"sagemaker-processing-job-parent":{category:"ML",label:"SageMaker Processing Jobs"},"sagemaker-serverless-endpoint":{category:"ML",label:"SageMaker Serverless Endpoints"},"sagemaker-space":{category:"ML",label:"SageMaker Studio Spaces"},"sagemaker-studio-app":{category:"ML",label:"SageMaker Studio Apps"},"sagemaker-training-job":{category:"ML",label:"SageMaker Training Job"},"sagemaker-training-job-parent":{category:"ML",label:"SageMaker Training Jobs"},"sagemaker-tuning-job":{category:"ML",label:"SageMaker Tuning Job"},"sagemaker-tuning-job-parent":{category:"ML",label:"SageMaker Tuning Jobs"},vpc:{category:"Network",label:"VPC & Networking"},workspace:{category:"Compute",label:"WorkSpaces"},alloydb:{category:"Database",label:"AlloyDB"},bigtable:{category:"Database",label:"Bigtable"},cloudrun:{category:"Serverless",label:"Cloud Run"},cloudsql:{category:"Database",label:"Cloud SQL"},compute:{category:"Compute",label:"Compute Engine"},dns:{category:"Network",label:"Cloud DNS"},"gcs-bucket":{category:"Storage",label:"GCS Buckets"},"gke-cluster":{category:"Kubernetes",label:"GKE Clusters"},"gke-namespace":{category:"Kubernetes",label:"GKE Namespaces"},memorystore:{category:"Cache",label:"Memorystore"},notebooks:{category:"ML",label:"Vertex AI Notebooks"},spanner:{category:"Database",label:"Spanner"},"vertex-batch-prediction-job":{category:"ML",label:"Vertex AI Batch Prediction Job"},"vertex-batch-prediction-job-parent":{category:"ML",label:"Vertex AI Batch Prediction Jobs"},"vertex-custom-job":{category:"ML",label:"Vertex AI Custom Job"},"vertex-custom-job-parent":{category:"ML",label:"Vertex AI Custom Jobs"},"vertex-data-labeling-job":{category:"ML",label:"Vertex AI Data Labeling Job"},"vertex-data-labeling-job-parent":{category:"ML",label:"Vertex AI Data Labeling Jobs"},"vertex-dataset":{category:"ML",label:"Vertex AI Datasets"},"vertex-deployment-resource-pool":{category:"ML",label:"Vertex AI Deployment Resource Pools"},"vertex-endpoint":{category:"ML",label:"Vertex AI Endpoints"},"vertex-feature-group":{category:"ML",label:"Vertex AI Feature Groups"},"vertex-feature-online-store":{category:"ML",label:"Vertex AI Feature Online Stores"},"vertex-featurestore":{category:"ML",label:"Vertex AI Feature Stores"},"vertex-index":{category:"ML",label:"Vertex AI Vector Search Indexes"},"vertex-index-endpoint":{category:"ML",label:"Vertex AI Vector Search Index Endpoints"},"vertex-metadata-store":{category:"ML",label:"Vertex AI Metadata Stores"},"vertex-model":{category:"ML",label:"Vertex AI Models"},"vertex-model-monitoring-job":{category:"ML",label:"Vertex AI Model Monitoring Jobs"},"vertex-nas-job":{category:"ML",label:"Vertex AI NAS Job"},"vertex-nas-job-parent":{category:"ML",label:"Vertex AI NAS Jobs"},"vertex-notebook":{category:"ML",label:"Vertex AI Workbench Notebooks"},"vertex-notebook-execution-job":{category:"ML",label:"Vertex AI Notebook Execution Job"},"vertex-notebook-execution-job-parent":{category:"ML",label:"Vertex AI Notebook Execution Jobs"},"vertex-notebook-runtime":{category:"ML",label:"Vertex AI Notebook Runtimes"},"vertex-notebook-runtime-template":{category:"ML",label:"Vertex AI Notebook Runtime Templates"},"vertex-pipeline-job":{category:"ML",label:"Vertex AI Pipeline Job"},"vertex-pipeline-job-parent":{category:"ML",label:"Vertex AI Pipeline Jobs"},"vertex-reasoning-engine":{category:"ML",label:"Vertex AI Reasoning Engines"},"vertex-tensorboard":{category:"ML",label:"Vertex AI TensorBoards"},"vertex-training-pipeline":{category:"ML",label:"Vertex AI Training Pipeline"},"vertex-training-pipeline-parent":{category:"ML",label:"Vertex AI Training Pipelines"},"vertex-tuning-job":{category:"ML",label:"Vertex AI Tuning Job"},"vertex-tuning-job-parent":{category:"ML",label:"Vertex AI Tuning Jobs"},"aks-cluster":{category:"Kubernetes",label:"AKS Clusters"},"aks-namespace":{category:"Kubernetes",label:"AKS Namespaces"},containerapp:{category:"Container",label:"Container Apps"},databricks:{category:"Data & Analytics",label:"Databricks"},"databricks-cluster":{category:"Data & Analytics",label:"Databricks Cluster"},"databricks-job":{category:"Data & Analytics",label:"Databricks Job"},"databricks-model-endpoint":{category:"Data & Analytics",label:"Databricks Model Endpoint"},"databricks-pool":{category:"Data & Analytics",label:"Databricks Pool"},"databricks-sqlwarehouse":{category:"Data & Analytics",label:"Databricks SQL Warehouse"},account:{category:"Management & Governance",label:"Snowflake Account"},database:{category:"Data & Analytics",label:"Snowflake Database"},"materialized-view":{category:"Data & Analytics",label:"Snowflake Materialized View"},pipe:{category:"Data & Analytics",label:"Snowflake Pipe"},"resource-monitor":{category:"Management & Governance",label:"Snowflake Resource Monitor"},stage:{category:"Data & Analytics",label:"Snowflake Stage"},table:{category:"Data & Analytics",label:"Snowflake Table"},user:{category:"Security",label:"Snowflake User"},warehouse:{category:"Data & Analytics",label:"Snowflake Warehouse"},"data-explorer":{category:"Data & Analytics",label:"Data Explorer"},functionapp:{category:"Serverless",label:"Function Apps"},"ml-workspace":{category:"ML",label:"ML Workspace"},"ml-compute-instance":{category:"ML",label:"ML Compute Instances"}
3,"ml-compute-cluster":{category:"ML",label:"ML Compute Clusters"},"ml-registry":{category:"ML",label:"ML Registries"},"ml-job":{category:"ML",label:"ML Jobs"},"ml-job-parent":{category:"ML",label:"ML Jobs"},"ml-automl-job":{category:"ML",label:"ML AutoML Jobs"},"ml-automl-job-parent":{category:"ML",label:"ML AutoML Jobs"},"ml-pipeline-job":{category:"ML",label:"ML Pipeline Jobs"},"ml-pipeline-job-parent":{category:"ML",label:"ML Pipeline Jobs"},"ml-model":{category:"ML",label:"ML Models"},"ml-datastore":{category:"ML",label:"ML Datastores"},"ml-data-asset":{category:"ML",label:"ML Data Assets"},"ml-environment":{category:"ML",label:"ML Environments"},"ml-component":{category:"ML",label:"ML Components"},"ml-schedule":{category:"ML",label:"ML Schedules"},"ml-connection":{category:"ML",label:"ML Connections"},"ml-feature-store":{category:"ML",label:"ML Feature Stores"},"ml-featureset":{category:"ML",label:"ML Feature Sets"},"ml-featurestore-entity":{category:"ML",label:"ML Feature Store Entities"},"ml-online-endpoint":{category:"ML",label:"ML Online Endpoints"},"ml-online-deployment":{category:"ML",label:"ML Online Deployments"},"ml-batch-endpoint":{category:"ML",label:"ML Batch Endpoints"},"ml-batch-deployment":{category:"ML",label:"ML Batch Deployments"},"ml-serverless-endpoint":{category:"ML",label:"ML Serverless Endpoints"},"ml-inference-pool":{category:"ML",label:"ML Inference Pools"},"azure-openai":{category:"ML",label:"Azure OpenAI"},"azure-openai-deployment":{category:"ML",label:"Azure OpenAI Deployments"},"azure-openai-deployment-parent":{category:"ML",label:"Model Deployments"},"azure-openai-finetuning-job":{category:"ML",label:"Azure OpenAI Fine-Tuning Jobs"},"azure-openai-finetuning-job-parent":{category:"ML",label:"Fine-Tuning Jobs"},"azure-openai-batch-job":{category:"ML",label:"Azure OpenAI Batch Jobs"},"azure-openai-batch-job-parent":{category:"ML",label:"Batch Jobs"},"azure-openai-vector-store":{category:"ML",label:"Azure OpenAI Vector Stores"},"azure-openai-vector-store-parent":{category:"ML",label:"Vector Stores"},"ai-foundry":{category:"ML",label:"Azure AI Foundry"},"ai-foundry-hub":{category:"ML",label:"Azure AI Foundry Hubs"},"ai-foundry-project":{category:"ML",label:"Azure AI Foundry Projects"},"ai-foundry-project-classic":{category:"ML",label:"Azure AI Foundry Projects"},"ai-foundry-deployment":{category:"ML",label:"AI Foundry Deployments"},"ai-foundry-deployment-parent":{category:"ML",label:"Model Deployments"},"ai-search":{category:"ML",label:"AI Search"},"ai-search-index":{category:"ML",label:"AI Search Indexes"},"ai-search-indexer":{category:"ML",label:"AI Search Indexers"},"ai-search-skillset":{category:"ML",label:"AI Search Skillsets"},"ai-search-datasource":{category:"ML",label:"AI Search Data Sources"},"ai-search-alias":{category:"ML",label:"AI Search Aliases"},"ai-commitment-plan":{category:"ML",label:"AI Commitment Plans"},"ai-managed-compute-deployment":{category:"ML",label:"AI Managed Compute Deployments"},"ai-rai-policy":{category:"ML",label:"AI Content Filter Policies"},"ai-rai-policy-parent":{category:"ML",label:"Content Filter Policies"},"ai-rai-blocklist":{category:"ML",label:"AI Content Filter Blocklists"},"ai-rai-blocklist-parent":{category:"ML",label:"Content Filter Blocklists"},"ai-connection":{category:"ML",label:"AI Connections"},"ai-capability-host":{category:"ML",label:"AI Capability Hosts"},"ai-encryption-scope":{category:"ML",label:"AI Encryption Scopes"},"ai-defender-setting":{category:"ML",label:"AI Defender Settings"},"ai-network-perimeter":{category:"ML",label:"AI Network Perimeter Configs"},"ai-agent":{category:"ML",label:"AI Agents"},"ai-agent-parent":{category:"ML",label:"Agents"},"cognitive-services":{category:"ML",label:"Cognitive Services"},"mysql-flexible":{category:"Database",label:"MySQL Flexible"},"postgresql-flexible":{category:"Database",label:"PostgreSQL Flexible"},"sql-managed-instance":{category:"Database",label:"SQL Managed Instances"},sqldatabase:{category:"Database",label:"SQL Databases"},sqlvm:{category:"Database",label:"SQL VMs"},"ssis-ir":{category:"Data & Analytics",label:"SSIS Runtimes"},"synapse-pool":{category:"Data & Analytics",label:"Synapse SQL Pools"},vm:{category:"Compute",label:"Virtual Machines"},vmss:{category:"Compute",label:"VM Scale Sets"},"azure-redis":{category:"Cache",label:"Azure Cache for Redis"},m365_copilot_seat:{category:"Licensing",label:"Copilot Seats"},m365_license_sku:{category:"Licensing",label:"Licence Plans"}};function Ho(e){return e?ph[e]?.label??e:""}const Zo="__probe__";function hh(e){return Array.isArray(e)?e.some(t=>t?.status==="probe_blocked"||t?.permission===Zo):!1}function Rv(e){return Array.isArray(e)?e.find(t=>t?.status==="probe_blocked"||t?.permission===Zo)??null:null}function jv(e){return Array.isArray(e)?e.some(t=>t?.status==="scp_restricted"):!1}function Cv(e){return!Array.isArray(e)||e.length===0?!1:e.every(t=>t?.status==="error")}const yh="__credentials__";function Nv(e){return Array.isArray(e)?e.some(t=>t?.status==="credentials_invalid"||t?.permission===yh):!1}const xh=180*1e3;function Ov(e){if(e)try{sessionStorage.setItem(`upgraded:${e}`,String(Date.now()))}catch{}}function va(e){if(!e)return!1;try{const t=parseInt(sessionStorage.getItem(`upgraded:${e}`)??"0",10);return t?Date.now()-t>xh?(sessionStorage.removeItem(`upgraded:${e}`),!1):!0:!1}catch{return!1}}const Qo={zopnight:{aws:sh,gcp:oh,azure:nh,snowflake:fh,microsoft365:mh}
3,zopday:{gcp:gh}},vh={zopnight:["probe","discovery","scheduling","namespace_scheduling","recommendations","remediation","tagging","observability","ai-gateway","cost","others"],zopday:["probe","provisioning","deployments"]};function ba(e,t){const o=(vh[e]??[]).indexOf(t);return o===-1?Number.MAX_SAFE_INTEGER:o}function Yo(e){const t=e?.feature;return Array.isArray(t)?t:t?[t]:[]}function bh(e,t){return Yo(e).flatMap(s=>(gr(s)?t:[""]).map(o=>`${s}::${o}`))}const wh={discovery:"Resource Discovery",scheduling:"Scheduling",namespace_scheduling:"Scheduling",recommendations:"Recommendations",remediation:"Recommendation Auto-Remediation",tagging:"Smart Tags",observability:"VM Observability",cost:"Cost",others:"Others",provisioning:"Provisioning",deployments:"Deployments","ai-gateway":"AI Gateway",probe:"Permissions check"},Ah=new Set(["scheduling","namespace_scheduling","provisioning","remediation"]);function gr(e){return Ah.has(e)}function _h(e,t){const s=Nc(e);if(!t||!gr(e))return s;const o=Ho(t);return o?`${o} ${s}`:s}const Sh={discovery:"Find all resources running in this account.",cost:"Pull spend data so trends and breakdowns show up in the dashboard.",scheduling:"Start and stop",namespace_scheduling:"Start and stop workloads in",provisioning:"Create and tear down",recommendations:"Suggest right-sizing and savings opportunities.",remediation:"Automatically right-size or clean up",tagging:"Read your cloud tags, and apply Smart Tags back to your resources.",deployments:"Deploy changes to apps and containers.",others:"Other operations.",probe:""};function kh(e,t){const s=Sh[e]??"";if(!s)return"";if(gr(e)){if(!t)return`${s} resources.`;const o=Ho(t);return e==="scheduling"||e==="namespace_scheduling"?`${s} ${o}
3 on a schedule.`:`${s} ${o}.`}return s}function Eh(e,t,s=["zopnight","zopday"]){const o=Array.isArray(e)?e:[],n=new Map;for(const c of o)c?.permission&&c.permission!==Zo&&(n.has(c.permission)||n.set(c.permission,[]),n.get(c.permission).push(c));const a=new Map;for(const c of s){const u=Pt(c,t);if(u)for(const[l,f]of Object.entries(u)){if(f.feature==="probe"||f.probe==="data-plane")continue;const d=Yo(f),g=f.resource_type,p=Array.isArray(g)?g:g?[g]:[],y=jh(n.get(l)),h={permission:l,category:f.category,role:f.role,status:y.status};for(const v of d){if(v==="probe"||gr(v)&&p.length===0)continue;const x=gr(v)?p:[""];for(const b of x){const w=`${c}::${v}::${b}`;a.has(w)||a.set(w,{product:c,feature:v,resourceType:b,label:_h(v,b),description:kh(v,b),perms:[],roleCounts:new Map});const A=a.get(w);A.perms.push(h),A.roleCounts.set(f.role,(A.roleCounts.get(f.role)??0)+1)}}}}const i=[];for(const c of a.values()){let u=0,l=0,f=0,d=0;const g=[];for(const v of c.perms)v.status==="granted"||v.status==="partial"?u++:v.status==="scp_restricted"?f++:v.status==="denied"?(l++,g.push(v.permission)):d++;let p="not_probed";l>0?p="needs_attention":f>0?p="cant_verify":u>0&&(p="granted");const y=[...c.roleCounts.keys()],h=y.length===0?"":y.reduce((v,x)=>(c.roleCounts.get(x)??0)>(c.roleCounts.get(v)??0)?x:v,y[0]);i.push({product:c.product,feature:c.feature,resourceType:c.resourceType,label:c.label,description:c.description,status:p,perms:c.perms.sort((v,x)=>v.permission.localeCompare(x.permission)),missingPerms:g.sort(),roles:y,primaryRole:h,counts:{granted:u,denied:l,scpRestricted:f,unknown:d,total:c.perms.length}})}return i.sort((c,u)=>{if(c.product!==u.product)return c.product.localeCompare(u.product);const l=ba(c.product,c.feature),f=ba(u.product,u.feature);return l!==f?l-f:c.label.localeCompare(u.label)}),i}function Pt(e,t){return Qo[e]?.[t]??null}function Tv(e,t,s){return Pt(e,t)?.[s]??null}function Mv(e,t,s=["zopnight"]){const o=Array.isArray(e)?e:[],n=s.map(a=>Pt(a,t)).filter(Boolean);return n.length===0?o:o.filter(a=>a?.permission&&n.some(i=>i[a.permission]))}function Nc(e){return wh[e]??e}function Lv(e,t,s){const o=Pt(e,t);if(!o)return[];const n=new Set;for(const a of Object.values(o))a.probe!=="data-plane"&&(s==="read"&&a.category==="read"||s==="write")&&n.add(a.role);return[...n].sort()}function Pv(e,t){const s=Pt(e,t);if(!s)return[];const o=new Set,n=new Set;for(const a of Object.values(s))o.add(a.role),a.scope!=="organization"&&n.add(a.role);return[...o].filter(a=>!n.has(a)).sort()}function Dv(e,t,s){const o=Pt(e,t);return o?Object.keys(o).filter(n=>o[n].role===s).sort():[]}function Rh(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")+"Permissions"}function jh(e){if(!e||e.length===0)return{status:"unknown",regions:[],deniedRegions:[],latestCheckedAt:null};const t=[],s=[],o=[],n=[];let a=0,i=null;for(const l of e){const f=l.region??"global";l.status==="granted"?t.push(f):l.status==="scp_restricted"?n.push(f):l.status==="partial"?o.push(f):l.status==="denied"?s.push(f):l.status==="error"&&a++;const d=l.checkedAt?new Date(l.checkedAt).getTime():0;d&&(!i||d>i)&&(i=d)}let c;n.length?c="scp_restricted":o.length||t.length&&s.length?c="partial":t.length&&s.length===0&&a===0?c="granted":s.length&&t.length===0?c="denied":a>0?c="error":c="unknown";const u=[...new Set([...t,...s])].filter(l=>l&&l!=="global").sort();return{status:c,regions:u,deniedRegions:s.filter(l=>l&&l!=="global").sort(),latestCheckedAt:i}}const Ch=new Set(["ZopNightWritePolicy","ZopNightRemediationPolicy","Zopnight Write Access","Zopnight AKS Access","Zopnight Databricks Access","ZopDay Infrastructure Access","ZopDayProvisionPolicy"]),Nh=new Set(["Zopnight Databricks Access"]);function Oh(e){return Nh.has(e)}function Th(e){return Ch.has(e)}function Iv(e){if(!Array.isArray(e)||e.length===0)return null;let t=0;for(const s of e){const o=s?.checkedAt?new Date(s.checkedAt).getTime():0;o>t&&(t=o)}return t||null}function Mh(e,t){if(t!=="read_write")return!1;let s=0,o=0;for(const n of e??[])for(const a of n.perms??[])a.category==="write"&&(s++,(a.status==="granted"||a.status==="partial"||a.status==="scp_restricted")&&o++);return s>0&&o===0}function Fv(e,t,s=["zopnight","zopday"],o={}){const n=o.tier,a=o.featureKeys instanceof Set&&o.featureKeys.size>0?o.featureKeys:null,i=Array.isArray(e)?e:[],c=new Map;for(const f of i){if(!f?.permission)continue;(!c.get(f.permission)||f.status==="denied")&&c.set(f.permission,f.status)}const u=new Map;for(const f of s){const d=Pt(f,t);if(d)for(const[g,p]of Object.entries(d)){if(n==="read"&&p.category!=="read"||p.probe==="data-plane")continue;const y=p.resource_type,h=Array.isArray(y)?y:y?[y]:[""],v=bh(p,h),x=!a||v.some(L=>a.has(L)),b=a?v.find(L=>
3a.has(L))??v[0]:v[0],w=c.get(g)??"unknown",A=`${f}::${p.role}`;u.has(A)||u.set(A,{role:p.role,product:f,missingPerms:[],allPerms:[],allPermsForReplace:[],grantedPermsForReplace:[],grantedCount:0,totalCount:0,grantedWriteCount:0,writeCount:0,features:new Set,featureKeys:new Set});const E=u.get(A);if(E.allPermsForReplace.push(g),w==="granted"&&E.grantedPermsForReplace.push(g),p.category==="write"&&(E.writeCount++,w==="granted"&&E.grantedWriteCount++),!!x){if(E.totalCount++,E.allPerms.push(g),w==="granted")E.grantedCount++;else if(w==="denied"){E.missingPerms.push(g);for(const L of Yo(p))E.features.add(L);E.featureKeys.add(b)}}}}const l=[];for(const f of u.values())f.missingPerms.length!==0&&l.push({role:f.role,product:f.product,perms:f.missingPerms.sort(),allPerms:f.allPerms.sort(),allPermsForReplace:f.allPermsForReplace.sort(),grantedPermsForReplace:f.grantedPermsForReplace.sort(),features:[...f.features].sort(),featureKeys:[...f.featureKeys].sort(),status:f.grantedCount===0?"all-missing":"partial",grantedCount:f.grantedCount,totalCount:f.totalCount,grantedWriteCount:f.grantedWriteCount,writeCount:f.writeCount});return l.sort((f,d)=>f.role.localeCompare(d.role))}function Lh(e){const t=Array.isArray(e)?[...e].sort():[];if(t.length===0)return{Version:"2012-10-17",Statement:[]};const s=new Map;for(const n of t){const a=n.indexOf(":");if(a<0)continue;const i=n.slice(0,a);s.has(i)||s.set(i,[]),s.get(i).push(n)}return{Version:"2012-10-17",Statement:[...s.entries()].sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>({Sid:Rh(n),Effect:"Allow",Action:a.sort(),Resource:"*"}))}}function Or(e){return`"${String(e).replace(/"/g,'""')}"`}function zv(e,t,s={}){const o=[...new Set(s.warehouses??[])].sort(),n=[...new Set(s.databases??[])].sort(),a=[],i=c=>a.push(`-- ${c}`);for(const c of[...e??[]].sort()){const u=Qo.zopnight.snowflake[c]?.grant;if(!u)continue;const{privilege:l,level:f}=u;switch(f){case"account":a.push(`GRANT ${l} ON ACCOUNT TO ROLE ${t};`);break;case"database-snowflake":a.push(`GRANT ${l} ON DATABASE SNOWFLAKE TO ROLE ${t};`);break;case"warehouse":if(o.length===0){i(`No warehouses discovered yet — re-run discovery, then re-open to grant ${l} ON WAREHOUSE.`);break}for(const d of o)a.push(`GRANT ${l} ON WAREHOUSE ${Or(d)} TO ROLE ${t};`);break;case"database":if(n.length===0){i(`No databases discovered yet — re-run discovery, then re-open to grant ${l} ON DATABASE.`);break}for(const d of n)a.push(`GRANT ${l} ON DATABASE ${Or(d)} TO ROLE ${t};`);break;case"schema-in-database":if(n.length===0){i(`No databases discovered yet — re-run discovery, then re-open to grant ${l} ON SCHEMAS.`);break}for(const d of n){const g=Or(d);a.push(`GRANT ${l} ON ALL SCHEMAS IN DATABASE ${g} TO ROLE ${t};`),a.push(`GRANT ${l} ON FUTURE SCHEMAS IN DATABASE ${g} TO ROLE ${t};`)}break;case"table-in-database":if(n.length===0){i(`No databases discovered yet — re-run discovery, then re-open to grant ${l} ON TABLES.`);break}for(const d of n){const g=Or(d);a.push(`GRANT ${l} ON ALL TABLES IN DATABASE ${g} TO ROLE ${t};`),a.push(`GRANT ${l} ON FUTURE TABLES IN DATABASE ${g} TO ROLE ${t};`)}break}}return a}function Ph(e,t={}){const s=Qo.zopnight.snowflake[e]?.grant;if(!s)return!0;const o=(t.warehouses??[]).length>0,n=(t.databases??[]).length>0;switch(s.level){case"warehouse":return o;case"database":case"schema-in-database":case"table-in-database":return n;default:return!0}}function Dh(e,t,s){return t!=="snowflake"||!Array.isArray(e)?e:e.filter(o=>o?.status!=="denied"||Ph(o.permission,s))}const Ih=new Set(["ReadOnlyAccess"]);function Fh(e){return Ih.has(e)}const zh=new Set(["Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action","Microsoft.ContainerService/managedClusters/listClusterUserCredential/action","Microsoft.ContainerService/managedClusters/start/action","Microsoft.ContainerService/managedClusters/stop/action","Microsoft.ContainerService/managedClusters/agentPools/write"]);function Uh(e,t,s){const o=t?.cloudAccountId??"<subscription-id>",n=[...s??[]].sort(),a=e==="Zopnight AKS Access",i=[],c=[];if(a)for(const u of n)zh.has(u)?i.push(u):c.push(u);else i.push(...n);return JSON.stringify({properties:{roleName:e,description:`Custom role for ${e} on ZopNight`,assignableScopes:[`/subscriptions/${o}`],permissions:[{actions:i,notActions:[],dataActions:c,notDataActions:[]}]}},null,2)}function Uv({provider:e,role:t,account:s,missingPerms:o,allPermsInRole:n}){if(!e||!t)return null;if(Oh(t))return{kind:"workspace-admin",label:"Grant workspace access",helpText:"Open your Databricks workspace and go to Settings → Identity and access. On the Service principals row, add the ZopNight service principal by its Application (client) ID. Then on the Groups row, open the admins group and add it — this grants workspace Admin (required, since Databricks only lists what the principal can access).",payload:null};if(e==="aws"){if(Fh(t)){const c=s?.authMethod==="assume_role"||s?.authMethod==="workload_identity_federation"?s?.roleName?`IAM role ${s.roleName}`:"cross-account IAM role":"IAM user";return{kind:"console",label:`Attach ${t}`,helpText:`${t} is an AWS managed policy. Attach it to your ${c} and ZopNight will pick up the new access on the next probe.`,payload:null}}const a=o??[];return{kind:"copy-json",label:`Update ${t}`,helpText:`Add the statements from the JSON below to your ${t} to grant the missing permissions.`,payload:JSON.stringify(Lh(a),null,2)}}if(e==="gcp"){const a=s?.cloudAccountId;if(!a)return null;const i=`zopnight-sa@${a}.iam.gserviceaccount.com`;return{kind:"console",label:`Grant ${t}`,helpText:`Grant the ${t} predefined role to ${i}
3 from the GCP Console.`,payload:null,saEmail:i}}if(e==="azure"){if(!s?.cloudAccountId)return null;if(Th(t)){const i=n??o??[];return{kind:"copy-json",label:`Update ${t}`,helpText:`Edit your ${t} custom role in the Azure Portal and replace its definition with the JSON below. The role assignment stays in place — just the actions list gets refreshed.`,payload:Uh(t,s,i)}}return{kind:"console",label:`Assign ${t}`,helpText:`Assign the ${t} built-in role to your ZopNight service principal at subscription scope from the Azure Portal.`,payload:null}}return null}function Bv({provider:e,account:t,kind:s}={}){return!e||!t?null:e==="aws"?s==="policy"?"https://console.aws.amazon.com/iam/home#/policies":s==="user"?"https://console.aws.amazon.com/iam/home#/users":"https://console.aws.amazon.com/iam/home#/roles":e==="gcp"&&t.cloudAccountId?`https://console.cloud.google.com/iam-admin/iam?project=${encodeURIComponent(t.cloudAccountId)}`:e==="azure"&&t.cloudAccountId?`https://portal.azure.com/#@/resource/subscriptions/${encodeURIComponent(t.cloudAccountId)}/IamAccessControl`:null}const Bh=new Set(["SNOWFLAKE","SNOWFLAKE_SAMPLE_DATA"]),Oc=e=>e.filter(t=>!/^SYSTEM\$/i.test(t)),Tc=e=>e.filter(t=>!Bh.has(String(t).toUpperCase())),wa=e=>(e?.items??[]).filter(t=>t?.name&&t.uid!=="_end").map(t=>t.name),Aa=(e,t)=>({type:t,provider:"snowflake",cloud_account_id:e,limit:200});function $v(e,{enabled:t=!0}={}){const s=Aa(e,"warehouse"),o=Aa(e,"database"),n=t&&!!e,{data:a,isLoading:i}=re({queryKey:oe.resources.list(s),queryFn:()=>H.get("/resources",s),enabled:n,staleTime:3e4}),{data:c,isLoading:u}=re({queryKey:oe.resources.list(o),queryFn:()=>H.get("/resources",o),enabled:n,staleTime:3e4});return m.useMemo(()=>({warehouses:Oc(wa(a)),databases:Tc(wa(c)),isLoading:i||u}),[a,c,i,u])}const _a=e=>({type:e,provider:"snowflake",limit:1e3}),Sa=e=>{const t={};for(const s of e?.items??[])!s?.name||s.uid==="_end"||!s.cloudAccountId||(t[s.cloudAccountId]??=[]).push(s.name);return t};function $h({enabled:e=!0}={}){const t=_a("warehouse"),s=_a("database"),{data:o,isLoading:n}=re({queryKey:oe.resources.list(t),queryFn:()=>H.get("/resources",t),enabled:e,staleTime:3e4}),{data:a,isLoading:i}=re({queryKey:oe.resources.list(s),queryFn:()=>H.get("/resources",s),enabled:e,staleTime:3e4});return{lookup:m.useMemo(()=>{const u=Sa(o),l=Sa(a);return f=>({warehouses:Oc(u[f]??[]),databases:Tc(l[f]??[])})},[o,a]),isLoading:n||i}}function Vh(e,t){const s=e!==1,o=s?"cloud accounts":"1 cloud account",a=s?`${s?e:""} ${o}`:o;switch(t){case"discovery":return`${a} could discover more resources`;case"scheduling":return`${a} could schedule more resources`;case"recommendations":return`${a} could surface more recommendations`;case"remediation":return`${a} could automatically apply more recommendations`;case"cost":return`${a} could show more cost data`;default:return`${a} can do more`}}function qh(e){switch(e){case"discovery":case"scheduling":case"recommendations":case"remediation":case"cost":return". Grant access to unlock.";default:return". See what's available."}}function Wh(e){return e.length<=3?e.join(", "):`${e.slice(0,2).join(", ")}, +${e.length-2} more`}function Gh(e,t){const s=(t??[]).map(Ho).filter(Boolean),o=s.length>0?Wh(s):"";switch(e){case"scheduling":return{title:"Scheduling",benefit:o?`Schedule ${o} to save on idle workloads.`:"Schedule more resource types to save on idle workloads.",extendBenefit:o?`Extend your scheduling to ${o} for extra savings.`:"Extend your scheduling to more resource types for extra savings."};case"namespace_scheduling":return{title:"Namespace Scheduling",benefit:o?`Schedule ${o} to save on idle workloads.`:"Schedule k8s namespaces to save on idle workloads.",extendBenefit:o?`Extend your scheduling to ${o} for extra savings.`:"Extend your scheduling to more k8s namespaces for extra savings."};case"recommendations":return{title:"Recommendations",benefit:o?`Find idle and over-provisioned ${o} you can downsize for savings on waste.`:"Find idle and over-provisioned resources you can downsize for savings on waste.",extendBenefit:o?`Get cost-saving suggestions for ${o} to cut more waste.`:"Get cost-saving suggestions for more resource types to cut more waste."};case"remediation":return{title:"Recommendation Auto-Remediation",benefit:o?`Automatically right-size and clean up ${o} to cut waste.`:"Automatically right-size and clean up idle resources to cut waste.",extendBenefit:o?`Extend automatic recommendation fixes to ${o} to cut waste hands-free.`:"Extend automatic recommendation fixes to more resource types to cut waste hands-free."};case"cost":return{title:"Cost Reports",benefit:"Unlock spend trends, budgets, and anomaly alerts for this account.",extendBenefit:"Surface additional spend trends, budgets, and anomaly alerts on this account."};case"databricks_discovery":return{title:"Databricks discovery",benefit:"ZopNight couldn't read inside this Databricks workspace. If it isn't empty, grant workspace admin so ZopNight can read it.",extendBenefit:"ZopNight couldn't read inside this Databricks workspace. If it isn't empty, grant workspace admin so ZopNight can read it."};case"provision":return{title:"Provisioning",benefit:o?`Provision ${o} directly from ZopNight.`:"Provision more cloud resources directly from ZopNight.",extendBenefit:o?`Add ${o} to your provisioning workflows.`:"Provision more resource types from ZopNight."};case"discovery":return{title:"Resource Discovery",benefit:o?`Read access on ${o} lets ZopNight track their cost and surface savings opportunities.`:"Read access on more resource types lets ZopNight track their cost and surface savings opportunities.",extendBenefit:o?`Grant read access on ${o} to track their cost and surface savings opportunities.`:"Grant read access on more resource types to track their cost and surface savings opportunities."};default:return null}}const ka=["discovery","scheduling","namespace_scheduling","recommendations","remediation","cost","provision"],Kh=2,Mc="permsBannerHiddenAccounts";function Hh(){try{const e=localStorage.getItem(Mc);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t):new Set}catch{return new Set}}function Zh(e){try{localStorage.setItem(Mc,JSON.stringify([...e]))}catch{}}function Qh(e){const[t,s]=m.useState(()=>{try{return sessionStorage.getItem(e)??""}catch{return""}}),o=m.useCallback(n=>{try{sessionStorage.setItem(e,n)}catch{}s(n)},[e]);return[t,o]}function Yh(e,t){const s=e.map(n=>`B:${n.cloudAccountId??n.id}`),o=t.map(({account:n})=>`M:${n.cloudAccountId??n.id}`);return[...s,...o].sort().join(",")}function Jh({contextFeature:e}={}){const{data:t=[]}=Rc(),s=m.useMemo(()=>[...new Set(t.map(w=>
3w.cloudAccountId).filter(Boolean))],[t]),{byAccount:o,allLoaded:n}=Gp(s),{byAccount:a}=rh(t),{byAccount:i,allLoaded:c}=eh(t),u=m.useMemo(()=>t.some(w=>w.provider==="snowflake"),[t]),{lookup:l,isLoading:f}=$h({enabled:u}),d=m.useMemo(()=>{if(!c)return[];const w=[];for(const A of t){if(A?.provider!=="databricks")continue;const E=i[A.id];!E?.loaded||!E.needsAttention||w.push({account:A,isDatabricks:!0,featureCodes:[],customBullets:[{key:"databricks-denied",text:s0(E.denied)}]})}return w},[c,i,t]),g=m.useMemo(()=>{if(!n)return[];const w=[];for(const A of t){const E=o[A.cloudAccountId];E&&(va(A.cloudAccountId)||hh(E.permissions??[])&&w.push(A))}return w},[n,o,t]),p=m.useMemo(()=>new Set(g.map(w=>w.cloudAccountId)),[g]),y=m.useMemo(()=>{if(!n)return[];const w=[];for(const A of t){if(p.has(A.cloudAccountId))continue;const E=o[A.cloudAccountId];if(!E||va(A.cloudAccountId)||A.provider==="snowflake"&&f)continue;const L=Dh(E.permissions??[],A.provider,l(A.cloudAccountId)),P=Eh(L,A.provider,["zopnight"]),j=A.permissionLevel==="read_only",N=new Map;for(const B of P)N.has(B.feature)||N.set(B.feature,[]),N.get(B.feature).push(B);const z=[],Q=new Map,G=new Map;for(const[B,D]of N){const M=D.some(O=>O.perms.some(V=>V.status==="granted"||V.status==="partial"));if(!D.some(O=>O.perms.some(V=>V.status==="denied")))continue;const R=D.some(O=>O.perms.some(V=>V.category==="write"));if(j&&R)continue;z.push(B),Q.set(B,M?"partial":"unavailable");const _=D.filter(O=>O.status==="needs_attention"&&O.resourceType).map(O=>O.resourceType);G.set(B,[...new Set(_)])}const I=a[A.id];A.provider==="azure"&&I?.loaded&&I.needsAttention&&(z.push("databricks_discovery"),Q.set("databricks_discovery","unavailable"),G.set("databricks_discovery",[])),z.length>0&&w.push({account:A,featureCodes:z,featureLabels:z.map(B=>B==="databricks_discovery"?"Databricks discovery":Nc(B)),featureStateMap:Q,deniedResourceTypesByFeature:G,writeNotGranted:Mh(P,A.permissionLevel)})}return w},[n,o,t,p,a,l,f]),h=m.useMemo(()=>[...y,...d],[y,d]),v=Yh(g,h),[x,b]=Qh("dismissedPermsBanner");return g.length===0&&h.length===0||x===v?null:g.length>0?r.jsx(o0,{blockedAccounts:g,onDismiss:()=>b(v)}):r.jsx(e0,{accountsWithIssues:h,contextFeature:e,onDismiss:()=>b(v)})}function Xh(e){const t=`permsBannerCollapsed:${e}`,[s,o]=m.useState(()=>{try{return sessionStorage.getItem(t)!=="0"}catch{return!0}}),n=m.useCallback(a=>{try{sessionStorage.setItem(t,a?"1":"0")}catch{}o(a)},[t]);return[s,n]}function e0({accountsWithIssues:e,contextFeature:t,onDismiss:s}){const[o,n]=m.useState(Hh),a=m.useMemo(()=>e.filter(({account:x})=>!o.has(x.cloudAccountId??x.id??"")),[e,o]),i=m.useCallback(()=>{const x=new Set;Zh(x),n(x)},[]),c=m.useMemo(()=>e.filter(({account:x})=>o.has(x.cloudAccountId??x.id??"")).length,[e,o]),u=m.useMemo(()=>a.map(({account:x,featureCodes:b})=>`${x.cloudAccountId}:${[...b].sort().join(",")}`).sort().join("|"),[a]),[l,f]=Xh(u),d=m.useMemo(()=>{let x=a;if(t){const b=a.filter(({featureCodes:w,isDatabricks:A})=>A||w?.includes(t));b.length>0&&(x=b)}return[...x].sort((b,w)=>(b.account.name??"").localeCompare(w.account.name??""))},[a,t]),g=m.useMemo(()=>t?a.filter(({featureCodes:x,isDatabricks:b})=>b||x?.includes(t)):a,[a,t]);if(a.length===0)return c===0?null:r.jsxs("div",{className:"border-b border-l-2 border-l-border border-b-border bg-surface-secondary/30 px-4 sm:px-6 lg:px-8 py-1.5 text-[11px] text-text-muted",children:[c," ",c===1?"account is":"accounts are"," missing access but hidden from this banner."," ",r.jsx("button",{type:"button",onClick:i,className:"font-medium text-primary-600 hover:underline",children:"Show all"})]});const p=t&&g.length>0,y=p?g.length:a.length,h=p?t:void 0,v=p?g:a;return r.jsxs("div",{role:"alert",className:"border-b border-l-2 border-l-primary-500 border-b-border bg-surface",children:[r.jsxs("div",{className:"flex items-center gap-3 px-4 sm:px-6 lg:px-8 py-2.5",children:[r.jsxs("button",{type:"button",onClick:()=>f(!l),"aria-expanded":!l,className:"flex-1 flex items-center gap-3 min-w-0 text-left rounded-md px-1 -mx-1 py-0.5 hover:bg-primary-500/[0.06] transition-colors",children:[r.jsx(Pc,{accounts:v}),r.jsxs("span",{className:"text-sm min-w-0 truncate",children:[r.jsx("span",{className:"font-semibold text-primary-700",children:Vh(y,h)}),r.jsx("span",{className:"hidden sm:inline text-text-secondary",children:qh(h
3)})]}),r.jsx(Lc,{collapsed:l})]}),r.jsx(yt,{content:"Dismiss for this session",children:r.jsx("button",{type:"button",onClick:s,className:"p-1 rounded text-text-muted hover:text-text-primary hover:bg-primary-500/10 shrink-0","aria-label":"Dismiss for this session",children:r.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})]}),!l&&r.jsx(a0,{sortedAccounts:d,contextFeature:t})]})}const Ea=new Map;function t0(){return"See which features are working on this account and which new ones you could unlock."}function r0(){return"Write access isn't set up. Grant the write policy to unlock scheduling and recommendation auto-remediation."}function s0(e){const t=e>0?e:1;return`ZopNight can't read ${t} ${t===1?"workspace":"workspaces"} in this Databricks connection. Grant the service principal workspace admin so ZopNight can discover ${t===1?"it":"them"}.`}function Lc({collapsed:e}){return r.jsx("svg",{className:`h-4 w-4 shrink-0 ml-auto text-text-muted transition-transform ${e?"":"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})}function o0({blockedAccounts:e,onDismiss:t}){const[s,o]=m.useState(!0),n=e.length,a=n===1?"cloud account":"cloud accounts",i=e.map(l=>({account:l})),c=n===1&&e[0].cloudAccountId?`/settings/cloud-accounts?viewPermissions=${encodeURIComponent(e[0].cloudAccountId)}`:null,u=r.jsxs(r.Fragment,{children:[r.jsx(Pc,{accounts:i}),r.jsxs("span",{className:"text-sm min-w-0 truncate",children:[r.jsxs("span",{className:"font-semibold text-warning-600",children:[n," ",a," could be missing out"]}),r.jsx("span",{className:"hidden sm:inline text-text-secondary",children:". See what's available."})]})]});return r.jsxs("div",{role:"alert",className:"border-b border-l-2 border-l-warning-500 border-b-border bg-surface",children:[r.jsxs("div",{className:"flex items-center gap-3 px-4 sm:px-6 lg:px-8 py-2.5",children:[c?r.jsx(Ie,{to:c,className:"flex-1 flex items-center gap-3 min-w-0 text-left rounded-md px-1 -mx-1 py-0.5 hover:bg-warning-500/[0.06] transition-colors",children:u}):r.jsxs("button",{type:"button",onClick:()=>o(!s),"aria-expanded":!s,className:"flex-1 flex items-center gap-3 min-w-0 text-left rounded-md px-1 -mx-1 py-0.5 hover:bg-warning-500/[0.06] transition-colors",children:[u,r.jsx(Lc,{collapsed:s})]}),r.jsx(yt,{content:"Dismiss for this session",children:r.jsx("button",{type:"button",onClick:t,className:"p-1 rounded text-text-muted hover:text-text-primary hover:bg-warning-500/10 shrink-0","aria-label":"Dismiss for this session",children:r.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})]}),!s&&n>1&&r.jsxs("div",{className:"border-t border-border",children:[r.jsx("div",{className:"divide-y divide-border",children:e.slice(0,lr).map(l=>r.jsx(Dc,{account:l,featureCodes:[],featureStateMap:Ea,deniedResourceTypesByFeature:Ea,highlighted:!1,customBullets:[{key:"probe-blocked",text:t0()}]},l.id??l.cloudAccountId))}),n>lr&&r.jsxs(Ie,{to:"/settings/cloud-accounts",className:"block px-4 sm:px-6 lg:px-8 py-2 text-[11px] font-medium text-primary-600 hover:bg-surface-secondary/40 border-t border-border",children:["View ",n-lr," more ",n-lr===1?"account":"accounts"," in Settings →"]})]})]})}const Ra=["aws","gcp","azure","snowflake","databricks"];function Pc({accounts:e}){const t=m.useMemo(()=>{const s=new Set;for(const o of e){const n=o?.account?.provider;n&&s.add(n)}return Ra.filter(o=>s.has(o)).concat([...s].filter(o=>!Ra.includes(o)))},[e]);return t.length===0?null:r.jsx("span",{className:"flex items-center gap-1.5 shrink-0",children:t.map(s=>r.jsx(Go,{provider:s,className:"w-4 h-4"},s))})}function n0(e,t,s){const o=[...e].sort((a,i)=>{const c=ka.indexOf(a),u=ka.indexOf(i);return(c===-1?99:c)-(u===-1?99:u)}),n=[];for(const a of o){if(n.length>=Kh)break;const i=s?.get(a)??[],c=Gh(a,i);if(!c)continue;const l=(t?.get(a)??"unavailable")==="partial"?c.extendBenefit:c.benefit;l&&n.push({key:a,text:l})}return n}const lr=3;function a0({sortedAccounts:e,contextFeature:t}){const s=e.length,o=e.slice(0,lr),n=s-o.length;return r.jsxs("div",{className:"border-t border-border",children:[r.jsx("div",{className:"divide-y divide-border",children:o.map(a=>r.jsx(Dc,{account:a.account,featureCodes:a.featureCodes,featureStateMap:a.featureStateMap,deniedResourceTypesByFeature:a.deniedResourceTypesByFeature,highlighted:t&&a.featureCodes.includes(t),customBullets:a.customBullets?a.customBullets:a.writeNotGranted?[{key:"write-not-set",text:r0()}]:void 0},a.account.cloudAccountId||a.account.id))}),n>0&&r.jsxs(Ie,{to:"/settings/cloud-accounts",className:"block px-4 sm:px-6 lg:px-8 py-2 text-[11px] font-medium text-primary-600 hover:bg-surface-secondary/40 border-t border-border",children:["View ",n," more ",n===1?"account":"accounts"," in Settings →"]})]})}function Dc({account:e,featureCodes:t,featureStateMap:s,deniedResourceTypesByFeature:o,highlighted:n,customBullets:a}){const i=e?.cloudAccountId?`/settings/cloud-accounts?viewPermissions=${encodeURIComponent(e.cloudAccountId)}`:"/settings/cloud-accounts",c=m.useMemo(()=>n0(t,s,o),[t,s,o]),u=a??c;return r.jsxs(Ie,{to:i,className:`flex items-start gap-3 px-4 sm:px-6 lg:px-8 py-2.5 hover:bg-surface-secondary/50 transition-colors ${n?"bg-primary-500/[0.04]":""}`,children:[e?.provider&&r.jsx(Go,{provider:e.provider,className:"w-4 h-4 shrink-0 mt-0.5"}),r.jsxs("div",{className:"min-w-0 flex-1 space-y-0.5",children:[r.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[r.jsx("span",{className:"text-sm font-medium text-text-primary truncate",children:e.name||e.cloudAccountId}),e.name&&e.cloudAccountId&&r.jsx("span",{className:"text-[11px] text-text-muted font-mono truncate",children:e.cloudAccountId})]}),u.length>0&&r.jsx("ul",{className:"text-xs text-text-secondary leading-relaxed space-y-0.5",children:u.map(l=>r.jsxs("li",{className:"flex items-baseline gap-2",children:[r.jsx("span",{className:"w-1 h-1 rounded-full bg-text-muted shrink-0 translate-y-[-2px]"}),r.jsx("span",{children:l.text})]},l.key))})]}),r.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-4 h-4 text-text-muted shrink-0 mt-1",children:[r.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),r.jsx("polyline",{points:"12 5 19 12 12 19"})]})]})}
3const Ic=/^\/(?!\/)[a-zA-Z0-9/_\-?&=]*$/;function Fc(e){if(typeof e!="string"||!/^https:\/\//i.test(e))return"";let t;try{t=new URL(e)}catch{return""}return t.username||t.password?"":e}function Vv(e){return typeof e=="string"&&Ic.test(e)?e:""}const i0="https://zop.dev/changelog-latest.xml",c0=new Set(["new","improved","fixed"]),l0=new Set(["primary","orange","neutral"]),at="https://zop.dev/ns/changelog/1.0";function He(e,t,s){if(!e)return"";const n=(s?e.getElementsByTagNameNS(s,t):e.getElementsByTagName(t))[0];return n&&n.textContent?n.textContent.trim():""}function u0(e){if(!e)return{version:"",title:""};const t=" — ",s=e.indexOf(t);return s===-1?{version:"",title:e.trim()}:{version:e.slice(0,s).trim(),title:e.slice(s+t.length).trim()}}function d0(e,t){const s=He(e,"slug",at);if(s)return s;const o=He(e,"guid");if(o)return o;const n=He(e,"link");if(n){const a=n.replace(/\/$/,"").split("/").pop();if(a)return a}return t?t.replace(/\./g,"-").toLowerCase():""}function f0(e){const t=e.getAttribute("route")?.trim()??"",s=e.getAttribute("label")?.trim()??"";if(!t||!s||!Ic.test(t))return null;const o=e.getAttribute("linkTo")?.trim()==="site"?"site":"app";return{label:s,route:t,linkTo:o}}function m0(e){const t=e.getElementsByTagNameNS(at,"changes")[0];if(!t)return[];const s=t.getElementsByTagNameNS(at,"change"),o=[];for(let n=0;n<s.length;n++){const a=s[n],i=a.getAttribute("type")??"",c=a.textContent?.trim()??"";c&&o.push({type:c0.has(i)?i:"new",text:c,appLink:f0(a)})}return o}function g0(e){const t=e.getElementsByTagNameNS(at,"tags")[0];if(!t)return[];const s=t.getElementsByTagNameNS(at,"tag"),o=[];for(let n=0;n<s.length;n++){const a=s[n].textContent?.trim()??"";a&&o.push(a)}return o}
3function p0(e){const t=He(e,"versionTone",at).toLowerCase();return l0.has(t)?t:"neutral"}function h0(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()}function y0(e){const t=He(e,"title"),s=u0(t),o=He(e,"version",at)||s.version;if(!o)return null;const n=s.title||t,a=He(e,"date",at)||h0(He(e,"pubDate"));return{version:o,slug:d0(e,o),title:n,date:a,tagline:He(e,"tagline",at),summary:He(e,"description"),versionTone:p0(e),tags:g0(e),changes:m0(e),url:Fc(He(e,"link"))}}function x0(e){if(!e)return{releases:[]};const s=new DOMParser().parseFromString(e,"application/xml");if(s.getElementsByTagName("parsererror").length>0)return{releases:[]};const o=s.getElementsByTagName("item"),n=[];for(let a=0;a<o.length;a++){const i=y0(o[a]);i&&n.push(i)}return{releases:n}}async function v0(e){let t;try{t=await fetch(e,{credentials:"omit"})}catch{return{releases:[]}}if(!t.ok)return{releases:[]};if((t.headers.get("content-type")||"").includes("text/html"))return{releases:[]};let o;try{o=await t.text()}catch{return{releases:[]}}const n=x0(o);let a="";try{a=new URL(e,window.location?.href).origin}catch{a=""}for(const i of n.releases)for(const c of i.changes??[])c.appLink?.linkTo==="site"&&(c.appLink.href=Fc(a?`${a}${c.appLink.route}`:""));return n}function zc(){const e=i0;return re({queryKey:["changelog",e],queryFn:()=>v0(e),staleTime:300*1e3,gcTime:1800*1e3,retry:1})}const b0="lastSeenRelease:";function Uc(e){return e?`${b0}${e}`:null}function ja(e){const t=Uc(e);if(!t)return null;try{return localStorage.getItem(t)}catch{return null}}function w0(e,t){const s=Uc(e);if(s)try{localStorage.setItem(s,t)}catch{}}function A0(e,t){const[s,o]=m.useState(()=>ja(e));m.useEffect(()=>{o(ja(e))},[e]);const n=m.useCallback(()=>{!e||!t||(w0(e,t),o(t))},[e,t]);return{hasUnseen:!!t&&!!e&&s!==t,lastSeen:s,markSeen:n}}const ir=[];function Bc({open:e,onClose:t,onCloseButton:s,title:o,subtitle:n,wide:a,medium:i,half:c,narrow:u,fullScreen:l,subHeader:f,footer:d,headerRight:g,bgClass:p="bg-surface-elevated",children:y}){const h=m.useRef(null),v=m.useRef(null),x=m.useId();if(m.useEffect(()=>{if(e)return v.current=document.activeElement instanceof HTMLElement?document.activeElement:null,h.current?.focus(),()=>{const E=v.current;E&&document.body.contains(E)&&E.focus?.(),v.current=null}},[e]),m.useEffect(()=>{if(!e)return;ir.push(x);const E=L=>{L.key==="Escape"&&ir[ir.length-1]===x&&t()};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E);const L=ir.lastIndexOf(x);L!==-1&&ir.splice(L,1)}},[e,t,x]),pc(e),!e)return null;const b=l?"w-full":u?"w-full max-w-md":c?"w-full md:w-1/2":a?"w-full max-w-4xl":i?"w-full max-w-3xl":"w-full max-w-2xl",w="fixed inset-0 flex justify-end",A=`relative ${p} h-full flex flex-col animate-slide-in-right ${b} ${l?"":"border-l border-border shadow-xl"}`;return pr.createPortal(r.jsxs("div",{className:w,children:[r.jsx("div",{className:"absolute inset-0 bg-backdrop backdrop-blur-sm",onMouseDown:t}),r.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":x,className:A,children:[r.jsxs("div",{className:"flex justify-between items-start px-6 py-4 border-b border-border-default shrink-0",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h3",{id:x,className:"text-lg font-semibold text-text-primary font-display",children:o}),n&&r.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:n})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[g,r.jsx("button",{ref:h,onClick:s??t,"aria-label":"Close",className:"h-8 w-8 inline-flex items-center justify-center rounded-md text-text-muted hover:text-text-secondary hover:bg-surface-tertiary transition-colors duration-fast",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"h-4 w-4",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})]}),f&&r.jsx("div",{className:"shrink-0 border-b border-border-default",children:f}),r.jsx("div",{className:"flex-1 flex flex-col overflow-y-auto overflow-x-hidden min-h-0 px-6 py-4 [scrollbar-gutter:stable]",children:y}),d&&r.jsx("div",{className:`shrink-0 flex justify-start gap-3 px-6 py-4 border-t border-border ${p}`,children:d})]})]}),document.getElementById("overlay-root"))}function _0({message:e="No items found.",title:t,description:s,icon:o,action:n}){return t||o||n?r.jsxs("div",{className:"py-16 text-center",children:[o&&r.jsx("div",{className:"flex justify-center mb-4",children:o}),t&&r.jsx("p",{className:"text-base font-semibold text-text-primary mb-1",children:t}),(s||!t&&e)&&r.jsx("p",{className:"text-sm text-text-muted mb-4 max-w-sm mx-auto",children:s||e}),n&&r.jsx("div",{className:"mt-2",children:n})]}):r.jsx("p",{className:"text-sm text-text-muted py-8 text-center",children:e})}const S0={primary:"info",orange:"warning",neutral:"neutral"},k0={new:{label:"New",labelColor:"text-warning-500",dotColor:"bg-warning-400"},improved:{label:"Improved",labelColor:"text-primary-300",dotColor:"bg-primary-400"},fixed:{label:"Fixed",labelColor:"text-success-500",dotColor:"bg-success-400"}},E0=["new","improved","fixed"],Ca="text-text-link hover:underline font-medium inline-flex items-center gap-1 align-baseline";function Na(){return r.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-3 h-3","aria-hidden":"true",children:r.jsx("path",{d:"M5 12h14M13 6l6 6-6 6"})})}const R0=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function j0(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:R0.format(t)}function C0({release:e,onClose:t}
3){const s=pe(),o=j0(e.date),n=S0[e.versionTone]??"neutral",a=m.useCallback(c=>{c?.route&&(s(c.route),t?.())},[s,t]),i=m.useMemo(()=>{const c={new:[],improved:[],fixed:[]};for(const u of e.changes??[])c[u.type]&&c[u.type].push(u);return E0.filter(u=>c[u].length>0).map(u=>({type:u,items:c[u]}))},[e.changes]);return r.jsxs("article",{children:[r.jsxs("header",{className:"flex items-center justify-between gap-3",children:[r.jsx(er,{variant:n,className:"font-mono",children:e.version}),o&&r.jsx("time",{className:"text-xs text-text-muted",children:o})]}),e.title&&r.jsx("h3",{className:"text-2xl font-semibold text-text-primary tracking-tight leading-snug mt-3",children:e.title}),e.summary&&r.jsx("p",{className:"text-sm text-text-secondary leading-relaxed mt-2",children:e.summary}),i.map(({type:c,items:u},l)=>{const f=k0[c];return r.jsxs("section",{className:l===0?"mt-7":"mt-6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx("span",{className:`text-[11px] font-bold tracking-[0.1em] uppercase ${f.labelColor}`,children:f.label}),r.jsx("span",{className:"rounded-full bg-surface-tertiary text-text-muted text-xs font-medium px-2 py-0.5",children:u.length}),r.jsx("span",{className:"flex-1 h-px bg-border"})]}),r.jsx("ul",{className:"flex flex-col gap-3.5 list-none p-0 m-0",children:u.map((d,g)=>r.jsxs("li",{className:"flex gap-3 items-start text-sm text-text-secondary leading-relaxed",children:[r.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 mt-[9px] ${f.dotColor}`,"aria-hidden":"true"}),r.jsxs("span",{children:[d.text,d.appLink&&r.jsxs(r.Fragment,{children:[" ",d.appLink.linkTo==="site"?r.jsxs("a",{href:d.appLink.href||"#",target:"_blank",rel:"noopener noreferrer",className:Ca,children:[d.appLink.label,r.jsx(Na,{})]}):r.jsxs("button",{type:"button",onClick:()=>a(d.appLink),className:Ca,children:[d.appLink.label,r.jsx(Na,{})]})]})]})]},g))})]},c)}),e.url&&r.jsx("footer",{className:"mt-6 pt-5 border-t border-border-default",children:r.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-text-link text-xs font-medium hover:underline inline-flex items-center gap-1",children:["Read full notes",r.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-3 h-3","aria-hidden":"true",children:[r.jsx("path",{d:"M7 17 17 7"}),r.jsx("path",{d:"M7 7h10v10"})]})]})})]})}function Fs(){return r.jsxs("div",{className:"py-5 animate-pulse",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("div",{className:"h-5 w-20 bg-surface-tertiary rounded"}),r.jsx("div",{className:"h-4 w-24 bg-surface-tertiary rounded"})]}),r.jsx("div",{className:"h-5 w-3/4 bg-surface-tertiary rounded mb-2"}),r.jsx("div",{className:"h-4 w-full bg-surface-tertiary rounded mb-1.5"}),r.jsx("div",{className:"h-4 w-5/6 bg-surface-tertiary rounded"})]})}function $c({open:e,onClose:t,releases:s=[],isLoading:o=!1}){let n;if(o)n=r.jsxs("div",{className:"divide-y divide-border",children:[r.jsx(Fs,{}),r.jsx(Fs,{}),r.jsx(Fs,{})]});else if(!s.length)n=r.jsx(_0,{title:"No release notes yet",description:"When new releases ship, they'll show up here."});else{const a=s[0];n=r.jsx(C0,{release:a,onClose:t},a.slug)}return r.jsx(Bc,{open:e,onClose:t,title:"What's new",medium:!0,children:n})}function N0({className:e=""}){return r.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[r.jsx("path",{d:"M12 3v3"}),r.jsx("path",{d:"M12 18v3"}),r.jsx("path",{d:"M3 12h3"}),r.jsx("path",{d:"M18 12h3"}),r.jsx("path",{d:"m5.6 5.6 2.1 2.1"}),r.jsx("path",{d:"m16.3 16.3 2.1 2.1"}),r.jsx("path",{d:"m5.6 18.4 2.1-2.1"}),r.jsx("path",{d:"m16.3 7.7 2.1-2.1"})]})}function O0(){const e=W(d=>d.user?.email),{data:t,isLoading:s}=zc(),o=t?.releases??[],n=o[0]??null,{hasUnseen:a,markSeen:i}=A0(e,n?.version),[c,u]=m.useState(!1);if(s||!n||!a&&!c)return null;const l=()=>{u(!0),i()},f=d=>{d.stopPropagation(),i()};return r.jsxs(r.Fragment,{children:[a&&r.jsx("div",{role:"region","aria-label":"What's new",className:"border-b border-l-2 border-l-primary-500 border-b-border bg-surface",children:r.jsxs("div",{className:"flex items-center gap-3 px-4 sm:px-6 lg:px-8 py-2.5",children:[r.jsxs("button",{type:"button",onClick:l,className:"flex-1 flex items-center gap-3 min-w-0 text-left rounded-md px-1 -mx-1 py-0.5 hover:bg-primary-500/[0.06] transition-colors",children:[r.jsx(N0,{className:"w-4 h-4 text-primary-600 shrink-0"}),r.jsx(er,{variant:"info",className:"font-mono shrink-0",children:n.version}),r.jsxs("span",{className:"text-sm min-w-0 truncate",children:[r.jsx("span",{className:"font-semibold text-text-primary",children:"What's new"}),n.title&&r.jsxs("span",{className:"text-text-secondary",children:[" — ",n.title]})]})]}),r.jsx("button",{type:"button",onClick:l,className:"hidden sm:inline-flex text-xs font-semibold text-text-link hover:underline px-2 py-1 rounded shrink-0",children:"See what's new →"}),r.jsx(yt,{content:"Dismiss",children:r.jsx("button",{type:"button",onClick:f,"aria-label":"Dismiss",className:"p-1 rounded text-text-muted hover:text-text-primary hover:bg-primary-500/10 shrink-0",children:r.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})]})}),r.jsx($c,{open:c,onClose:()=>u(!1),releases:o,isLoading:s})]})}function T0(){const{data:e,isLoading:t}=zc(),s=e?.releases??[],o=s[0]??null,[n,a]=m.useState(!1);return t||!o?null:r.jsxs(r.Fragment,{children:[r.jsx(yt,{content:"What's new",children:r.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":"What's new",className:"inline-flex items-center justify-center w-7 h-7 rounded-md text-text-muted hover:text-text-primary hover:bg-surface-secondary transition-colors duration-fast",children:r.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4","aria-hidden":"true",children:[r.jsx("path",{d:"m3 11 18-5v12L3 14v-3z"}),r.jsx("path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6"})]})})}),r.jsx($c,{open:n,onClose:()=>a(!1),releases:s,isLoading:t})]})}function M0({className:e}){return r.jsxs("svg",{className:e,"aria-hidden":"true",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.374 6.18 6.18 0 0 1-.248-.47c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59
3-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.032-.863.104-.296.072-.583.16-.863.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.024c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.28-.144.616-.264 1.01-.36a4.84 4.84 0 0 1 1.244-.152c.95 0 1.644.216 2.091.647.44.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.264-.168.312a.549.549 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.216-.151-.248-.223a.504.504 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.415-.287-.806-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.176 0 .36.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.878.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z",fill:"currentColor"}),r.jsx("path",{d:"M21.725 16.92C19.16 18.89 15.35 19.94 12.07 19.94c-4.578 0-8.702-1.693-11.818-4.51-.247-.223-.024-.527.272-.352 3.364 1.955 7.523 3.136 11.818 3.136 2.898 0 6.085-.6 9.02-1.845.44-.2.814.288.383.55z",fill:"#FF9900"}),r.jsx("path",{d:"M22.638 15.867c-.335-.43-2.219-.207-3.068-.104-.255.032-.295-.192-.064-.36 1.5-1.053 3.967-.75 4.254-.394.287.36-.08 2.826-1.485 4.007-.216.183-.423.088-.327-.152.32-.79 1.03-2.57.69-2.997z",fill:"#FF9900"})]})}function L0({className:e}){return r.jsxs("svg",{className:e,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[r.jsx("path",{fill:"#1976d2",d:"M38.193,18.359c-0.771-2.753-2.319-5.177-4.397-7.03l-4.598,4.598c1.677,1.365,2.808,3.374,3.014,5.648v1.508c0.026,0,0.05-0.008,0.076-0.008c2.322,0,4.212,1.89,4.212,4.212S34.61,31.5,32.288,31.5c-0.026,0-0.05-0.007-0.076-0.008V31.5h-6.666H24V38h8.212v-0.004c0.026,0,0.05,0.004,0.076,0.004C38.195,38,43,33.194,43,27.288C43,23.563,41.086,20.279,38.193,18.359z"}),r.jsx("path",{fill:"#ff3d00",d:"M24,7.576c-8.133,0-14.75,6.617-14.75,14.75c0,0.233,0.024,0.46,0.035,0.69h6.5c-0.019-0.228-0.035-0.457-0.035-0.69c0-4.549,3.701-8.25,8.25-8.25c1.969,0,3.778,0.696,5.198,1.851l4.598-4.598C31.188,9.003,27.761,7.576,24,7.576z"}),r.jsx("path",{fill:"#4caf50",d:"M15.712,31.5L15.712,31.5c-0.001,0-0.001,0-0.002,0c-0.611,0-1.188-0.137-1.712-0.373l-4.71,4.71C11.081,37.188,13.301,38,15.71,38c0.001,0,0.001,0,0.002,0v0H24v-6.5H15.712z"}),r.jsx("path",{fill:"#ffc107",d:"M11.5,27.29c0-2.32,1.89-4.21,4.21-4.21c1.703,0,3.178,1.023,3.841,2.494l4.717-4.717c-1.961-2.602-5.065-4.277-8.559-4.277C9.81,16.58,5,21.38,5,27.29c0,3.491,1.691,6.59,4.288,8.547l4.71-4.71C12.53,30.469,11.5,28.999,11.5,27.29z"})]})}function P0({className:e}){const t=m.useId().replace(/:/g,""),s=`azure-${t}-a`,o=`azure-${t}-b`,n=`azure-${t}-c`;return r.jsxs("svg",{className:e,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:s,x1:"-1254.397",x2:"-1261.911",y1:"877.268",y2:"899.466",gradientTransform:"translate(1981.75 -1362.063) scale(1.5625)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:"0",stopColor:"#114a8b"}),r.jsx("stop",{offset:"1",stopColor:"#0669bc"})]}),r.jsxs("linearGradient",{id:o,x1:"-1252.05",x2:"-1253.788",y1:"887.612",y2:"888.2",gradientTransform:"translate(1981.75 -1362.063) scale(1.5625)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:"0",stopOpacity:".3"}),r.jsx("stop",{offset:".071",stopOpacity:".2"}),r.jsx("stop",{offset:".321",stopOpacity:".1"}),r.jsx("stop",{offset:".623",stopOpacity:".05"}),r.jsx("stop",{offset:"1",stopOpacity:"0"})]}
3),r.jsxs("linearGradient",{id:n,x1:"-1252.952",x2:"-1244.704",y1:"876.6",y2:"898.575",gradientTransform:"translate(1981.75 -1362.063) scale(1.5625)",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{offset:"0",stopColor:"#3ccbf4"}),r.jsx("stop",{offset:"1",stopColor:"#2892df"})]})]}),r.jsx("path",{fill:`url(#${s})`,d:"M17.634,6h11.305L17.203,40.773c-0.247,0.733-0.934,1.226-1.708,1.226H6.697 c-0.994,0-1.8-0.806-1.8-1.8c0-0.196,0.032-0.39,0.094-0.576L15.926,7.227C16.173,6.494,16.86,6,17.634,6L17.634,6z"}),r.jsx("path",{fill:"#0078d4",d:"M34.062,29.324H16.135c-0.458-0.001-0.83,0.371-0.831,0.829c0,0.231,0.095,0.451,0.264,0.608 l11.52,10.752C27.423,41.826,27.865,42,28.324,42h10.151L34.062,29.324z"}),r.jsx("path",{fill:`url(#${o})`,d:"M17.634,6c-0.783-0.003-1.476,0.504-1.712,1.25L5.005,39.595 c-0.335,0.934,0.151,1.964,1.085,2.299C6.286,41.964,6.493,42,6.702,42h9.026c0.684-0.122,1.25-0.603,1.481-1.259l2.177-6.416 l7.776,7.253c0.326,0.27,0.735,0.419,1.158,0.422h10.114l-4.436-12.676l-12.931,0.003L28.98,6H17.634z"}),r.jsx("path",{fill:`url(#${n})`,d:"M32.074,7.225C31.827,6.493,31.141,6,30.368,6h-12.6c0.772,0,1.459,0.493,1.705,1.224 l10.935,32.399c0.318,0.942-0.188,1.963-1.13,2.281C29.093,41.968,28.899,42,28.703,42h12.6c0.994,0,1.8-0.806,1.8-1.801 c0-0.196-0.032-0.39-0.095-0.575L32.074,7.225z"})]})}function D0({className:e}){return r.jsx("img",{src:wc,className:e,alt:""})}const Vc={aws:{label:"AWS",Icon:M0},gcp:{label:"GCP",Icon:L0},azure:{label:"Azure",Icon:P0},snowflake:{label:"Snowflake",Icon:D0},databricks:{label:"Databricks",Icon:Ac},openshift:{label:"Red Hat OpenShift",Icon:Sc},microsoft365:{label:"Microsoft 365",Icon:_c}};function I0({provider:e,className:t="h-4 w-4 shrink-0"}){const s=Vc[e]?.Icon;return s?r.jsx(s,{className:t}):null}function F0({provider:e}){const t=Vc[e]?.label;return t?r.jsx("span",{className:"sr-only",children:t}):null}function z0(){return re({queryKey:oe.organisations.detail(),queryFn:()=>H.get("/organisation")})}function U0(){return re({queryKey:["exchange-rate"],queryFn:()=>H.get("/currency-exchange-rate"),staleTime:3600*1e3,refetchOnWindowFocus:!1})}const Oa=[{code:"USD",symbol:"$",name:"US Dollar"},{code:"EUR",symbol:"€",name:"Euro"},{code:"GBP",symbol:"£",name:"British Pound"},{code:"INR",symbol:"₹",name:"Indian Rupee"},{code:"JPY",symbol:"¥",name:"Japanese Yen"},{code:"AUD",symbol:"A$",name:"Australian Dollar"},{code:"CAD",symbol:"C$",name:"Canadian Dollar"},{code:"SGD",symbol:"S$",name:"Singapore Dollar"},{code:"AED",symbol:"د.إ",name:"UAE Dirham"},{code:"BRL",symbol:"R$",name:"Brazilian Real"},{code:"CHF",symbol:"CHF",name:"Swiss Franc"}];function qc(e){return Oa.find(t=>t.code===e)??Oa[0]}function Wc(e,t="USD"){if(e==null)return"—";const s=Number(e);if(isNaN(s))return"—";const o=Math.abs(s),n=s<0?"-":"",a=qc(t).symbol;return o>=1e9?`${n}${a}${(o/1e9).toFixed(1)}B`:o>=1e6?`${n}${a}${(o/1e6).toFixed(1)}M`:o>=1e4?`${n}${a}${(o/1e3).toFixed(1)}K`:Jo(s,t)}function Jo(e,t="USD",s={}){if(e==null)return"—";const o=s.minimumFractionDigits??2,n=s.maximumFractionDigits??2;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:o,maximumFractionDigits:n}).format(Number(e))}catch{return`${qc(t).symbol}${Number(e).toLocaleString(void 0,{minimumFractionDigits:o,maximumFractionDigits:n})}`}}const qv=["UTC","Africa/Cairo","Africa/Johannesburg","Africa/Lagos","Africa/Nairobi","America/Anchorage","America/Argentina/Buenos_Aires","America/Bogota","America/Chicago","America/Denver","America/Halifax","America/Lima","America/Los_Angeles","America/Mexico_City","America/New_York","America/Phoenix","America/Santiago","America/Sao_Paulo","America/St_Johns","America/Toronto","America/Vancouver","Asia/Bangkok","Asia/Colombo","Asia/Dhaka","Asia/Dubai","Asia/Hong_Kong","Asia/Jakarta","Asia/Karachi","Asia/Kolkata","Asia/Kuala_Lumpur","Asia/Manila","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Taipei","Asia/Tehran","Asia/Tokyo","Atlantic/Reykjavik","Australia/Adelaide","Australia/Brisbane","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Athens","Europe/Berlin","Europe/Brussels","Europe/Dublin","Europe/Helsinki","Europe/Istanbul","Europe/Lisbon","Europe/London","Europe/Madrid","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Rome","Europe/Stockholm","Europe/Warsaw","Europe/Zurich","Pacific/Auckland","Pacific/Fiji","Pacific/Honolulu"],B0={"Asia/Calcutta":"Asia/Kolkata","Asia/Saigon":"Asia/Ho_Chi_Minh","Asia/Katmandu":"Asia/Kathmandu","Asia/Rangoon":"Asia/Yangon","Pacific/Ponape":"Pacific/Pohnpei","Pacific/Truk":"Pacific/Chuuk","America/Buenos_Aires":"America/Argentina/Buenos_Aires"};function $0(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return B0[e]||e}catch{return"UTC"}}function Wv(e){try{const t=new Date;return new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"shortOffset"}).formatToParts(t).find(a=>a.type==="timeZoneName")?.value||""}catch{return""}}function V0(e,t){const s=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(e),o={};for(const a of s)a.type!=="literal"&&(o[a.type]=Number(a.value));return Date.UTC(o.year,o.month-1,o.day,o.hour,o.minute,o.second)-e.getTime()}function Gv(e,t){if(!e)return new Date(NaN);const s=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(e);if(!s||!t)return new Date(e);const[,o,n,a,i,c]=s.map(Number),u=Date.UTC(o,n-1,a,i,c);try{const l=V0(new Date(u),t);return new Date(u-l)}catch{return new Date(e)}}function Kv(e,t){if(!e||isNaN(e.getTime()))return"";const s=o=>String(o).padStart(2,"0");try{const o=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).formatToParts(e),n={};for(const a of o)a.type!=="literal"&&(n[a.type]=a.value);return`${n.year}-${n.month}-${n.day}T${n.hour}:${n.minute}`}catch{return`${e.getFullYear()}-${s(e.getMonth()+1)}-${s(e.getDate())}T${s(e.getHours())}:${s(e.getMinutes())}`}}function es(e,{timezone:t}={}){if(e==null)return"—";const s=new Date(e);if(isNaN(s.getTime()))return"—";try{return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",timeZone:t,timeZoneName:"short"}).format(s)}
3catch{return s.toLocaleString()}}function Gc(e,{timezone:t}={}){if(e==null)return"—";const s=new Date(e);if(isNaN(s.getTime()))return"—";const n=Math.floor((new Date-s)/1e3);if(n<0){const a=-n;return a<60?"in <1 min":a<3600?`in ${Math.floor(a/60)} min`:a<86400?`in ${Math.floor(a/3600)} hr`:a<86400*7?`in ${Math.floor(a/86400)} day${Math.floor(a/86400)===1?"":"s"}`:a<86400*30?`in ${Math.floor(a/(86400*7))} week${Math.floor(a/(86400*7))===1?"":"s"}`:es(e,{timezone:t})}if(n<60)return"Just now";if(n<3600)return`${Math.floor(n/60)} min ago`;if(n<86400)return`${Math.floor(n/3600)} hr ago`;if(n<86400*7){const a=Math.floor(n/86400);return`${a} day${a===1?"":"s"} ago`}if(n<86400*30){const a=Math.floor(n/604800);return`${a} week${a===1?"":"s"} ago`}if(n<86400*365){const a=Math.floor(n/2592e3);return`${a} month${a===1?"":"s"} ago`}return es(e,{timezone:t})}const Kc=m.createContext({currency:"USD",rate:1,timezone:"UTC",fmtCurrency:(e,t)=>Jo(e,"USD",t),fmtCurrencyCompact:e=>Wc(e,"USD"),fmtDate:e=>es(e),fmtRelativeDate:e=>Gc(e),usdAmount:e=>e});function Ta({children:e}){const{data:t}=z0(),{data:s}=U0(),o=t?.settings?.currency??"USD",n=t?.settings?.timezone??$0(),a=o!=="USD"&&s?.currency===o&&s.rate>0?s.rate:1,i=m.useMemo(()=>({currency:o,rate:a,timezone:n,fmtCurrency:(g,p)=>{if(g==null)return"—";const y=Number(g);if(isNaN(y))return"—";const h=y*a;return Jo(h,o,p)},fmtCurrencyCompact:g=>{if(g==null)return"—";const p=Number(g);if(isNaN(p))return"—";const y=p*a;return Wc(y,o)},fmtDate:g=>es(g,{timezone:n}),fmtRelativeDate:g=>Gc(g,{timezone:n}),usdAmount:g=>a<=0||a===1?g:Number(g)/a}),[o,a,n]);return r.jsx(Kc.Provider,{value:i,children:e})}function q0(){return m.useContext(Kc)}const W0={capacity:"Cloud Capacity Unavailable",credential_expiry:"Cloud Credentials Invalid or Expired",permission:"Missing Cloud Permission",quota:"Cloud Quota Exceeded",throttling:"Cloud Provider Throttling",service_degradation:"Cloud Provider Service Degraded",connector_sync:"Account Sync Failed"},G0="Provider Incident",K0={execution:"Start/stop failure",discovery:"Account sync failure",workflow:"Remediation failure",cloud_account:"Account connection failure",billing_sync:"Billing sync failure",generation:"Recommendation failure",deploy:"Deployment failure",account_deleted:"Cloud account removed"};function H0(e){const t=e.slice(9);return K0[t]||t}function Z0(e){return e.kind==="provider_incident"?G0:e.category?.startsWith("internal:")?H0(e.category):W0[e.category]||e.category||"Cloud Alert"}function Q0(e){return e==="critical"?"danger":e==="warning"?"warning":"neutral"}function Y0(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}const Fr=[{name:"executor",path:"/actions/alerts"},{name:"discoverer",path:"/resources/alerts"},{name:"provisioner",path:"/provisioning-jobs/alerts"},{name:"config",path:"/cloud-accounts/alerts"},{name:"aggregator",path:"/reports/alerts"},{name:"recommender",path:"/recommendations/alerts"}],pt={all:()=>["alerts"],list:e=>[...pt.all(),"list",e],feed:()=>[...pt.all(),"feed"],cursor:()=>[...pt.all(),"cursor"]};function J0(e){const t=Fr.find(s=>s.name===e);if(!t)throw new Error(`Unknown alert source: ${e}`);return t.path}const Ma={critical:3,warning:2,info:1,unknown:0};function X0(e){const t=new Map;for(const s of e){const o=s.fingerprint||`id:${s.alertSource}:${s.id}`,n=t.get(o);if(!n){t.set(o,{...s,sources:[{source:s.alertSource,id:s.id}]});continue}if(n.sources.push({source:s.alertSource,id:s.id}),n.occurrenceCount=(n.occurrenceCount??0)+(s.occurrenceCount??0),new Date(s.firstSeen)<new Date(n.firstSeen)&&(n.firstSeen=s.firstSeen),new Date(s.lastSeen)>new Date(n.lastSeen)){const{sources:a,occurrenceCount:i,firstSeen:c,status:u,severity:l}=n;Object.assign(n,s,{sources:a,occurrenceCount:i,firstSeen:c,status:u,severity:l})}s.status==="open"&&(n.status="open"),(Ma[s.severity]??0)>(Ma[n.severity]??0)&&(n.severity=s.severity)}return[...t.values()]}async function Hc(e){const t=await Promise.allSettled(Fr.map(c=>H.get(c.path,e))),s=[],o=[];let n=0;if(t.forEach((c,u)=>{const{name:l}=Fr[u];if(c.status==="rejected"){n++,c.reason?.status!==404&&o.push(l);return}for(const f of c.value?.items??[])s.push({...f,alertSource:l})}),n===Fr.length&&o.length>0)throw new Error("Alerts are unavailable right now.");const a=X0(s);a.sort((c,u)=>new Date(u.lastSeen)-new Date(c.lastSeen));const i=t.some(c=>
3c.status==="fulfilled"&&c.value?.hasMore);return{items:a,hasMore:i,failedSources:o}}function Hv({status:e="",page:t=1,limit:s=20,startDate:o,endDate:n,includeInternal:a=!1,enabled:i=!0}={}){const c={limit:s,offset:(t-1)*s};return e&&(c.status=e),o&&(c.from=o),n&&(c.to=n),a&&(c.includeInternal="true"),re({queryKey:pt.list(c),queryFn:()=>Hc(c),placeholderData:go,enabled:i})}function Zv(){const e=ke();return me({mutationFn:async t=>{const s=t.sources?.length?t.sources:[{source:t.alertSource,id:t.id}],o=await Promise.allSettled(s.map(a=>H.post(`${J0(a.source)}/${a.id}/resolve`))),n=s.filter((a,i)=>o[i].status==="rejected").map(a=>a.source);if(n.length===s.length)throw new Error(o[0].reason?.message||"every service rejected the resolve");return{failed:n}},onSuccess:({failed:t})=>{if(e.invalidateQueries({queryKey:pt.all()}),t.length){fe.warning(`Alert resolved, except in: ${t.join(", ")}`);return}fe.success("Alert resolved")},onError:t=>fe.error(`Failed to resolve alert: ${t.message}`)})}const ey=20;function Zc(){return re({queryKey:pt.feed(),queryFn:()=>Hc({limit:ey,offset:0}),refetchInterval:6e4,refetchIntervalInBackground:!1})}function Qc(){return re({queryKey:pt.cursor(),queryFn:()=>H.get("/notifications/read-cursor"),select:e=>{const t=e?.last_read_at?new Date(e.last_read_at):null;return t&&!isNaN(t.getTime())&&t.getFullYear()>1?t:null},refetchInterval:6e4,refetchIntervalInBackground:!1})}function ty(e,t){return{id:e.fingerprint||`${e.alertSource}:${e.id}`,title:e.cause,provider:e.provider,severity:e.severity,category:e.category,kind:e.kind,status:e.status,body:[e.resourceUid||e.cloudAccountId,e.region].filter(Boolean).join(" · "),createdAt:e.lastSeen,deepLink:"/alerts",read:!!t&&new Date(e.lastSeen)<=t}}function ry(){const e=Zc(),t=Qc().data,s=(e.data?.items??[]).map(o=>ty(o,t));return{isLoading:e.isLoading,isError:e.isError,error:e.error,data:{items:s,hasMore:e.data?.hasMore??!1,failedSources:e.data?.failedSources??[]}}}function sy(){const e=Zc(),t=Qc().data;return{data:(e.data?.items??[]).filter(n=>!t||new Date(n.lastSeen)>t).length}}function oy(){const e=ke();return me({mutationFn:()=>H.put("/notifications/read-cursor"),onSuccess:()=>{e.invalidateQueries({queryKey:pt.cursor()})},onError:()=>{fe.error("Couldn't mark notifications as read.")}})}const ny={critical:"border-danger-500",warning:"border-warning-500"};function ay(e){return ny[e]||"border-neutral-400"}function iy(e){return typeof e=="string"&&e.startsWith("/")&&!e.startsWith("//")}function zs(e){if(typeof e!="string"||e==="")return null;if(e.startsWith("/")&&!e.startsWith("//"))return e;try{const{protocol:t}=new URL(e);return t==="http:"||t==="https:"?e:null}catch{return null}}function La({children:e,className:t=""}){return r.jsx("p",{className:`text-[11px] font-semibold uppercase tracking-wide text-text-muted mb-1 ${t}`,children:e})}function Pa({n:e,fmtRelativeDate:t}){const s=e.status==="resolved";return r.jsx("li",{className:`py-3 ${e.read?"opacity-60":""}`,children:r.jsxs("div",{className:`border-l-2 pl-2.5 ${s?"border-neutral-400":ay(e.severity)}`,children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsx("p",{className:"text-sm font-medium text-text-primary min-w-0",children:Z0(e)}),s?r.jsx(er,{variant:"success",className:"shrink-0",children:"Resolved"}):e.severity&&r.jsx(er,{variant:Q0(e.severity),className:"shrink-0",children:Y0(e.severity)})]}),e.title&&r.jsx("p",{className:"text-xs text-text-secondary mt-1",children:e.title}),(e.provider||e.body)&&r.jsxs("p",{className:"text-xs text-text-muted mt-1 flex items-center gap-1.5",children:[r.jsx(I0,{provider:e.provider,className:"h-3.5 w-3.5 shrink-0"}),r.jsx(F0,{provider:e.provider}),r.jsx("span",{className:"min-w-0 break-all",children:e.body})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[r.jsx("span",{className:"text-[11px] text-text-muted/70",children:t(e.createdAt)}),zs(e.deepLink)&&(iy(e.deepLink)?r.jsx(Ie,{to:zs(e.deepLink),className:"text-[11px] font-medium text-primary-600 hover:underline",children:"View"}):r.jsx("a",{href:zs(e.deepLink),rel:"noopener noreferrer",className:"text-[11px] font-medium text-primary-600 hover:underline",children:"View"}))]})]})})}function cy(){const[e,t]=m.useState(!1),{fmtRelativeDate:s}=q0(),o=sy().data??0,n=ry(),a=oy(),i=n.data?.items??[],c=i.filter(l=>!l.read),u=i.filter(l=>l.read);return r.jsxs(r.Fragment,{children:[r.jsx(yt,{content:"Notifications",children:r.jsxs("button",{type:"button",onClick:()=>t(!0),"aria-label":o>0?`Notifications (${o} unread)`:"Notifications",className:"relative inline-flex items-center justify-center w-7 h-7 rounded-md text-text-muted hover:text-text-primary hover:bg-surface-secondary transition-colors duration-fast",children:[r.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4","aria-hidden":"true",children:[r.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"}),r.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),o>0&&r.jsx("span",{className:"absolute -top-0.5 -right-0.5 min-w-[15px] h-[15px] px-1 rounded-full bg-danger-500 text-white text-[9px] leading-[15px] font-semibold text-center",children:o>9?"9+":o})]})}),r.jsx(Bc,{open:e,onClose:()=>t(!1),title:"Notifications",narrow:!0,headerRight:o>0?r.jsx("button",{type:"button",onClick:()=>a.mutate(),disabled:a.isPending,className:"text-xs font-medium text-text-muted hover:text-text-primary transition-colors disabled:opacity-50",children:"Mark all read"}):null,children:n.isError?r.jsx("p",{className:"text-sm text-danger-600 py-10 text-center",children:"Couldn't load notifications. Please try again."}):n.isLoading?r.jsx("div",{className:"space-y-2",children:[0,1,2].map(l=>
3r.jsx("div",{className:"h-14 rounded-md bg-surface-secondary/50 animate-pulse"},l))}):i.length===0?r.jsx("p",{className:"text-sm text-text-muted py-10 text-center",children:"No notifications yet."}):r.jsxs(r.Fragment,{children:[c.length>0&&r.jsxs(r.Fragment,{children:[r.jsxs(La,{children:["New (",c.length,")"]}),r.jsx("ul",{className:"divide-y divide-border",children:c.map(l=>r.jsx(Pa,{n:l,fmtRelativeDate:s},l.id))})]}),u.length>0&&r.jsxs(r.Fragment,{children:[c.length>0&&r.jsx(La,{className:"mt-5",children:"Earlier"}),r.jsx("ul",{className:"divide-y divide-border",children:u.map(l=>r.jsx(Pa,{n:l,fmtRelativeDate:s},l.id))})]})]})})]})}const ly=m.lazy(()=>U(()=>import("./ProductMessages-DoiK9sWr.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.ProductMessages}))),uy=$(()=>U(()=>import("./SortablePinnedList-DSlN16HI.js"),__vite__mapDeps([4,1,5,2,3])));function dy(e){if(e.startsWith("/resources")||e.startsWith("/architecture"))return"discovery";if(e.startsWith("/schedules")||e.startsWith("/overrides")||e.startsWith("/groups")||e.startsWith("/resource-groups"))return"scheduling";if(e.startsWith("/recommendations")||e.startsWith("/smart-tags")||e.startsWith("/auto-tagging"))return"recommendations";if(e.startsWith("/budgets")||e.startsWith("/reports")||e.startsWith("/cost-reports")||e.startsWith("/cost/"))return"cost"}const fy=r.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:r.jsx("path",{d:"M9 18l6-6-6-6"})});class my extends m.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,s){console.error("ProductMessages boundary caught:",t,s.componentStack),ti(t,{contexts:{react:{componentStack:s.componentStack}}})}render(){return this.state.hasError?null:this.props.children}}function gy(){Lg();const[e,t]=m.useState(!1),[s,o]=m.useState(!1),n=qe(),a=n.pathname.includes("/k8s/clusters/"),i=a?n.pathname.match(/\/k8s\/clusters\/([^/]+)/)?.[1]??null:null,c=W(T=>T.user),u=W(T=>T.user?.tenantId),l=je(T=>T.fetchPermissions),f=je(T=>T.clearPermissions),d=Vo(de.ALERT_VIEW)==="granted",g=lt(),p=W(T=>T.tenants),y=Eg(),h=uc(),v=ke();m.useEffect(()=>{c?.email&&(v.prefetchQuery({queryKey:oe.cloudAccounts.list(g),queryFn:()=>H.get("/cloud-accounts"),staleTime:5*6e4}),v.prefetchQuery({queryKey:oe.dashboards.list(),queryFn:()=>jg.list(),staleTime:3e4}))},[c?.email,g,v]);const x=m.useRef(!1);m.useEffect(()=>{g&&!x.current&&(x.current=!0,mc())},[g]);const b=m.useRef(!1);m.useEffect(()=>{if(!c?.email){f();return}b.current||(b.current=!0,l().finally(()=>{b.current=!1}))},[c?.email,u,l,f]),m.useEffect(()=>{if(!c?.email||!g)return;rs({email:c.email,name:c.name,role:h,scope:y?"scoped":"org_wide",orgId:g});const T=(p||[]).find(J=>J.id===g)?.name;oi(g,{name:T})},[c?.email,g,y,h,p]),m.useEffect(()=>{if(!c?.email)return;const T=()=>{document.visibilityState!=="visible"||b.current||(b.current=!0,l().finally(()=>{b.current=!1}))};return window.addEventListener("focus",T),document.addEventListener("visibilitychange",T),()=>{window.removeEventListener("focus",T),document.removeEventListener("visibilitychange",T)}},[c?.email,l]);const w=()=>t(!1);m.useEffect(()=>{t(!1)},[n.pathname]),pc(e);const[A,E]=m.useState(!1);m.useEffect(()=>{const T=J=>{J.key&&(J.metaKey||J.ctrlKey)&&J.key.toLowerCase()==="k"&&(J.preventDefault(),E(K=>!K))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[]);const L={[de.ALERT_VIEW]:d},P=T=>T.flag==="aiGateway"&&!ri()?!1:T.requiresPermission?L[T.requiresPermission]===!0:!0,j=yc.map(T=>({...T,items:T.items.filter(P)})).filter(T=>T.items.length>0),N=new Map(j.flatMap(T=>T.items.map(J=>[J.to,J]))),{pins:z,pin:Q,unpin:G,reorder:I,reset:S,isDefault:B}=Kg(),D=z.map(T=>N.get(T)).filter(Boolean),M=new Set(D.map(T=>T.to)),C=T=>M.has(T)?G(T):Q(T),R=j.find(T=>T.items.some(J=>Hg(J,n)))?.key??null,[_,O]=m.useState(R),[V,q]=m.useState({path:n.pathname,key:R});(V.path!==n.pathname||V.key===null&&R!==null)&&(q({path:n.pathname,key:R}),R&&O(R));const Z=[{to:Ue.to,label:Ue.label},...Ug.filter(T=>T.to!==Ue.to).map(T=>({to:T.to,label:T.label,group:Ue.label})),...j.flatMap(T=>T.items.map(J=>({to:J.to,label:J.label,group:T.label}))),{to:ar.to,label:ar.label}];return r.jsxs("div",{className:"flex min-h-dvh bg-surface-secondary",children:[r.jsx("div",{className:`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm lg:hidden transition-opacity duration-300 ${e?"opacity-100":"opacity-0 pointer-events-none"}`,onClick:w}),r.jsxs("aside",{className:`fixed top-0 left-0 z-50 w-64 lg:relative ${a?"lg:w-56":s?"lg:w-14":"lg:w-56"} h-dvh bg-surface border-r border-border flex flex-col transition-all duration-300 ease-in-out lg:sticky lg:top-0 lg:translate-x-0 lg:overflow-visible ${e?"translate-x-0 shadow-2xl":"-translate-x-full"}`,children:[r.jsxs("div",{className:"flex items-center justify-between h-12 px-3 border-b border-border shrink-0",children:[r.jsx(Hm,{collapsed:s}),r.jsxs("div",{className:"flex items-center gap-1",children:[d&&r.jsx(cy,{}),!s&&r.jsx(T0,{}),r.jsx("button",{onClick:w,className:"lg:hidden flex items-center justify-center p-1.5 -mr-1 rounded-md text-text-muted hover:text-text-primary hover:bg-surface-secondary transition-colors duration-fast","aria-label":"Close navigation menu",children:r.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M18 6L6 18"}),r.jsx("path",{d:"M6 6l12 12"})]})})]})]}),r.jsx("button",{onClick:()=>o(T=>!T),className:`${a?"hidden":"hidden lg:flex"} items-center justify-center absolute top-5 -right-3 z-10 w-6 h-6 rounded-full bg-surface border border-border shadow-sm text-text-muted hover:text-text-primary transition-colors duration-fast`,"aria-label":s?"Expand sidebar":"Collapse sidebar",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s?r.jsx("path",{d:"M9 18l6-6-6-6"}):r.jsx("path",{d:"M15 18l-6-6 6-6"})})}),r.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain py-3 px-2",children:a&&i?r.jsx(qp,{clusterId:i,onClose:w}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(np,{collapsed:s}),r.jsxs("button",{type:"button",onClick:()=>E(!0),title:s?"Search (⌘K)":void 0,className:`w-full flex items-center ${s?"lg:justify-center lg:px-0":"justify-between px-2.5"} gap-2 h-9 rounded-md border border-border text-sm text-text-muted hover:text-text-secondary hover:border-border-strong transition-colors duration-fast`,children:[r.jsxs("span",{className:`flex items-center gap-2 ${s?"lg:gap-0":""}`,children:[r.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[r.jsx("circle",{cx:"11",cy:"11",r:"8"}),r.jsx("path",{d:"M21 21l-4.35-4.35"})]}),r.jsx("span",{className:s?"lg:hidden":"",children:"Search…"})]}),r.jsx("kbd",{className:`text-[0.6875rem] border border-border rounded px-1 py-0.5 ${s?"lg:hidden":""}`,children:"⌘K"})]})]}),r.jsxs("div",{className:s?"lg:hidden":"","data-testid":"sidebar-nav",children:[r.jsx("ul",{children:r.jsx("li",{children:r.jsx(St,{to:Ue.to,label:Ue.label,icon:Ue.icon,onClick:w,isActiveFn:Ue.isActiveFn})})}),r.jsxs("div",{className:"flex items-center justify-between px-2 pt-2.5 pb-1 text-xs font-medium text-text-muted",children:[r.jsx("span",{children:"Pinned"}),!B&&r.jsx("button",{type:"button",onClick:S,className:"text-[0.6875rem] text-primary-600 hover:underline",children:"Reset"})]}),D.length>
30?r.jsx(m.Suspense,{fallback:r.jsx(sp,{items:D,onUnpin:G,onNavigate:w}),children:r.jsx(uy,{items:D,onReorder:I,onUnpin:G,onNavigate:w})}):r.jsx("p",{className:"text-[0.71875rem] text-text-muted p-2 border border-dashed border-border-strong rounded-[7px]",children:"Nothing pinned. Hover any page and click the pin."}),r.jsx("div",{className:"h-px bg-border my-2 mx-1",role:"separator"}),j.map(T=>{const J=_===T.key,K=`nav-section-${T.key}`,ne=!J&&R===T.key;return r.jsxs("div",{children:[r.jsxs("button",{type:"button",onClick:()=>O(J?null:T.key),"aria-expanded":J,"aria-controls":J?K:void 0,"aria-label":ne?`${T.label}, current section`:void 0,className:"group/sec w-full flex items-center gap-1.5 px-2 pt-[9px] pb-1 text-left text-xs font-medium tracking-[0.01em] text-text-muted hover:text-text-secondary transition-colors duration-fast",children:[r.jsx("span",{children:T.label}),ne&&r.jsx("span",{className:"w-[5px] h-[5px] rounded-full bg-primary-600","aria-hidden":"true"}),r.jsx("span",{className:`ml-auto w-[11px] h-[11px] shrink-0 text-text-muted opacity-60 group-hover/sec:opacity-100 transition-transform duration-fast ${J?"rotate-90":""}`,children:fy})]}),J&&r.jsx("ul",{id:K,className:"mb-0.5",children:T.items.map(he=>r.jsx(tp,{item:he,section:T.label,pinned:M.has(he.to),onTogglePin:C,onNavigate:w},he.to))})]},T.key)})]}),s&&r.jsxs("div",{className:"hidden lg:block space-y-4","data-testid":"sidebar-rail",children:[r.jsxs("ul",{className:"space-y-0.5 pb-3 border-b border-border",children:[r.jsx("li",{children:r.jsx(St,{to:Ue.to,label:Ue.label,icon:Ue.icon,onClick:w,collapsed:!0,isActiveFn:Ue.isActiveFn})}),D.map(T=>r.jsx("li",{children:r.jsx(St,{to:T.to,label:T.pinLabel??T.label,trackLabel:T.label,group:"Pinned",icon:T.icon,onClick:w,collapsed:!0,isActiveFn:T.isActiveFn})},T.to))]}),j.map(T=>{const J=T.items.filter(K=>!M.has(K.to));return J.length===0?null:r.jsx("ul",{className:"space-y-0.5",children:J.map(K=>r.jsx("li",{children:r.jsx(St,{to:K.to,label:K.label,group:T.label,icon:K.icon,onClick:w,collapsed:!0,isActiveFn:K.isActiveFn})},K.to))},T.key)})]})]})}),!a&&r.jsx(my,{children:r.jsx(m.Suspense,{fallback:null,children:r.jsx(ly,{suppressCard:s})})}),r.jsx("div",{className:`shrink-0 border-t border-border px-2 pt-2 pb-1 ${a?"hidden":""}`,children:r.jsx("ul",{children:r.jsx("li",{children:r.jsx(St,{to:ar.to,label:ar.label,icon:ar.icon,onClick:w,collapsed:s})})})}),r.jsx("div",{className:"border-t border-border px-1 py-1 shrink-0",children:r.jsx(kg,{position:"above",collapsed:s})})]}),A&&r.jsx(ap,{onClose:()=>E(!1),items:Z}),r.jsxs("div",{className:"flex flex-1 flex-col min-w-0",children:[ve()&&r.jsx(zg,{}),r.jsxs("header",{className:"flex items-center gap-3 h-12 px-4 bg-surface border-b border-border lg:hidden",children:[r.jsx("button",{onClick:()=>t(!0),className:"p-2 -ml-1 rounded-lg text-text-secondary hover:text-text-primary hover:bg-surface-tertiary active:bg-surface-tertiary transition-colors duration-fast","aria-label":"Open navigation menu",children:r.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 6h18M3 12h18M3 18h18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),r.jsx(Wr,{className:"w-28",idPrefix:"zn-hdr"})]}),r.jsx(Jh,{contextFeature:dy(n.pathname)}),r.jsx(O0,{}),r.jsx("main",{className:`relative z-0 flex-1 flex flex-col px-4 sm:px-6 lg:px-8 pb-6 animate-fade-in ${n.pathname.startsWith("/governance")?"pt-4":"pt-6"}`,children:r.jsx(Md,{children:r.jsx(Kt,{})})},n.pathname)]})]})}function py(){return!1}function hy(){return py()}function yy({enabled:e=!0}={}){const t=At("cloud-account:view"),s=e&&t,{data:o=[],isLoading:n,isError:a}=Rc({enabled:s});return t?{hasAccounts:a||o.length>0,isLoading:s&&n}:{hasAccounts:!0,isLoading:!1}}const xy="zopnight_setup";function vy(){try{const e=localStorage.getItem(xy);return e?!!JSON.parse(e)?.complete:!1}catch{return!1}}function Da(){const e=W(g=>g.isAuthenticated),t=W(g=>g.tenants),s=qe(),o=ve(),n=hy(),a=o?!!hr():!0,i=t?.filter(g=>g.id&&g.name)??[],c=Sg(i),{hasAccounts:u,isLoading:l}=yy({enabled:!o&&e&&i.length>0});if(m.useEffect(()=>{o&&a&&!e&&vi()},[o,a,e]),m.useEffect(()=>{},[o,n,e]),o){if(!_i())return r.jsx(te,{to:"/",replace:!0});if(!a){const g=s.pathname+s.search,p=g&&g!=="/"?`/?returnTo=${encodeURIComponent(g)}`:"/";return r.jsx(te,{to:p,replace:!0})}return e?r.jsx(Ta,{children:r.jsx(Kt,{})}):null}if(!e){const g=s.pathname+s.search;return r.jsx(te,{to:`/login?returnTo=${encodeURIComponent(g)}`,replace:!0})}if(c)return null;if(i.length===0){const g=s.pathname+s.search,p=g&&g!=="/onboarding"?`/onboarding?returnTo=${encodeURIComponent(g)}`:"/onboarding";return r.jsx(te,{to:p,replace:!0})}const f=s.pathname.startsWith("/setup"),d=s.pathname.startsWith("/settings");return!l&&!u&&!vy()&&!f&&!d?r.jsx(te,{to:"/setup",replace:!0}):r.jsx(Ta,{children:r.jsx(Kt,{})})}function by(){const e=W(s=>s.isAuthenticated),t=qe();if(!e){const s=t.pathname+t.search,o=fs(s)?"/signin":"/login";return r.jsx(te,{to:`${o}?returnTo=${encodeURIComponent(s)}`,replace:!0})}return r.jsx(Kt,{})}function wy(){const e=W(o=>o.isAuthenticated),t=W(o=>o.tenants),[s]=Se();if(e){const o=it(s.get("returnTo"));if((t?.filter(a=>a.id&&a.name)??[]).length===0){const a=o?`/onboarding?returnTo=${encodeURIComponent(o)}`:"/onboarding";return r.jsx(te,{to:a,replace:!0})}return o?r.jsx(te,{to:o,replace:!0}):r.jsx(te,{to:ve()?"/dashboard":"/",replace:!0})}return r.jsx(Kt,{})}function Ay(){const e=W(i=>i.sessionExpired),t=W(i=>i.logout),s=pe(),o=qe(),n=ke();if(!e)return null;const a=o.pathname+o.search;return pr.createPortal(r.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",children:[r.jsx("div",{className:"absolute inset-0 bg-backdrop backdrop-blur-sm"}),r.jsxs("div",{className:"relative bg-surface-elevated border border-border-strong rounded-xl p-8 w-full max-w-sm shadow-xl text-center animate-fade-in",children:[r.jsx("h3",{className:"text-lg font-semibold text-text-primary font-display mb-2",children:"Session Expired"}),r.jsx("p",{className:"text-sm text-text-secondary mb-6",children:"Your session has expired. Please log in again."}),r.jsx(ge,{onClick:()=>{n.clear(),je.getState().clearPermissions(),t(),s(`/login?returnTo=${encodeURIComponent(a)}`)},children:"Log in"})]})]}),document.getElementById("overlay-root"))}function _y(){const{pathname:e}=qe();return m.useEffect(()=>{window.scrollTo(0,0)},[e]),null}function Sy(){const{pathname:e,search:t}=qe();return m.useEffect(()=>{Pl(window.location.href)},[e,t]),null}function zr({icon:e,label:t,onClick:s,loading:o=!1,disabled:n=!1}){return r.jsxs("button",{type:"button",onClick:s,disabled:n||o,className:"w-full inline-flex items-center justify-center gap-3 px-4 py-2 text-sm font-medium text-text-primary bg-surface-tertiary border border-border-strong rounded-lg transition-all duration-normal hover:bg-surface-elevated hover:border-primary-600/20 focus:outline-none focus:ring-2 focus:ring-primary-600/30 focus:ring-offset-2 focus:ring-offset-surface disabled:opacity-disabled disabled:cursor-not-allowed",children:[o?r.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary-600 border-t-transparent"}):e,r.jsx("span",{children:t})]})}function ky({text:e="OR"}){return r.jsxs("div",{className:"flex items-center gap-4 my-5",children:[r.jsx("div",{className:"flex-1 h-px bg-border-strong"}),r.jsx("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:e}),r.jsx("div",{className:"flex-1 h-px bg-border-strong"})]})}const Ey=()=>
3r.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:r.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})}),Ry=()=>r.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[r.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),r.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),r.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),r.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),jy=()=>r.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[r.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),r.jsx("path",{d:"M7 11V7a5 5 0 0110 0v4"})]});function Cy({onGithub:e,onGoogle:t,onSaml:s,loadingProvider:o=null}){return r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(zr,{icon:r.jsx(Ey,{}),label:"Continue with GitHub",onClick:e,loading:o==="GITHUB",disabled:!!o}),r.jsx(zr,{icon:r.jsx(Ry,{}),label:"Continue with Google",onClick:t,loading:o==="GOOGLE",disabled:!!o}),r.jsx(zr,{icon:r.jsx(jy,{}),label:"Continue with SSO",onClick:s,loading:o==="AZURE_SAML",disabled:!!o})]})}function Ny({open:e,onClose:t,onSubmit:s,isLoading:o=!1}){const n=Et({defaultValues:{domain:""},onSubmit:({value:a})=>{const i=a.domain.trim();try{localStorage.setItem(xn,i)}catch{}s(i)}});return m.useEffect(()=>{if(e){let a="";try{a=localStorage.getItem(xn)||""}catch{}n.setFieldValue("domain",a)}},[e,n.setFieldValue]),r.jsxs(ec,{open:e,onClose:t,title:"",children:[r.jsxs("div",{className:"flex flex-col items-center -mt-2",children:[r.jsx(yi,{className:"w-20 h-20 mb-0.5"}),r.jsx("h2",{className:"text-xl font-bold text-text-primary font-display",children:"Enterprise SSO"}),r.jsx("p",{className:"text-sm text-text-muted mt-1.5 text-center",children:"Sign in securely with your company's identity provider"})]}),r.jsx("div",{className:"mt-6 mb-2 border-t border-border"}),r.jsxs("form",{onSubmit:a=>{a.preventDefault(),n.handleSubmit()},className:"space-y-4",children:[r.jsx(n.Field,{name:"domain",validators:{onSubmit:({value:a})=>a.trim()?void 0:"Domain is required"},children:a=>r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-text-secondary mb-1.5",children:"Domain"}),r.jsx(Ve,{type:"text",placeholder:"Enter your domain",value:a.state.value,onChange:i=>a.handleChange(i.target.value),onBlur:a.handleBlur,required:!0}),r.jsx("p",{className:"text-xs text-text-muted mt-1.5",children:"Enter your organization's domain (e.g. acme.com)"})]})}),r.jsxs("div",{className:"flex gap-3 pt-2",children:[r.jsx(ge,{variant:"secondary",type:"button",onClick:t,children:"Cancel"}),r.jsx(n.Subscribe,{selector:a=>
3a.values.domain,children:a=>r.jsx(ge,{type:"submit",disabled:o||!a.trim(),children:o?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Connecting..."]}):"Continue"})})]})]})]})}function Oy({onGithub:e,onGoogle:t,onSaml:s,loadingProvider:o,error:n,defaultReturnTo:a,loginPath:i}){const[c]=Se(),u=new URLSearchParams(c);!u.has("returnTo")&&a&&u.set("returnTo",a),i&&u.set("from",i);const l=`/login/email${u.toString()?`?${u.toString()}`:""}`,f=`/signup${u.toString()?`?${u.toString()}`:""}`;return r.jsxs("div",{children:[r.jsx(xt,{message:n}),r.jsx(Cy,{onGithub:e,onGoogle:t,onSaml:s,loadingProvider:o}),r.jsx(ky,{}),r.jsx(Ie,{to:l,children:r.jsx(zr,{icon:r.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[r.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"3"}),r.jsx("path",{d:"M2 7l10 7 10-7"})]}),label:"Continue with Email"})}),r.jsxs("p",{className:"mt-6 text-center text-sm text-text-secondary",children:["Don't have an account?"," ",r.jsx(Ie,{to:f,className:"text-text-link hover:text-text-link-hover font-medium transition-colors duration-fast",children:"Create an account"})]})]})}function Ty({samlcode:e,logo:t,defaultReturnTo:s,loginPath:o}){const n=pe(),a=sr(),[i,c]=m.useState(null);return m.useEffect(()=>{a.mutate({provider:Nt.AZURE_SAML,providerData:{token:e}},{onSuccess:()=>{const u=sessionStorage.getItem($e)||s;n(u,{replace:!0})},onError:u=>{c(u.message||"SSO sign-in failed. Please try again.")}})},[]),i?r.jsxs(Re,{subtitle:"Sign in to your account to continue.",logo:t,children:[r.jsx(xt,{message:i}),r.jsx(Ie,{to:o,className:"text-sm text-text-link hover:text-text-link-hover font-medium",children:"Back to login"})]}):r.jsx(Re,{subtitle:"Completing SSO sign in...",logo:t,children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[r.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary-600 border-t-transparent"}),r.jsx("p",{className:"mt-4 text-sm text-text-secondary",children:"Completing sign in..."})]})})}function My(e,t){return e.get("returnTo")||t}const Ia={"Missing SAML response data":"Sign-in failed. SAML response was missing. Please try again.","SAML callback error":"Sign-in failed due to an unexpected error. Please try again.","SAML response data too large":"Sign-in failed. The response was too large. Please try again."};function Yc({logo:e,defaultReturnTo:t="/resources",loginPath:s="/login"}){const[o]=Se(),n=o.get("samlcode");return n?r.jsx(Ty,{samlcode:n,logo:e,defaultReturnTo:t,loginPath:s}):r.jsx(Ly,{logo:e,defaultReturnTo:t,loginPath:s})}function Ly({logo:e,defaultReturnTo:t,loginPath:s}){const[o]=Se(),[n,a]=m.useState(null),[i,c]=m.useState(!1),[u,l]=m.useState(()=>{const x=o.get("error");return x==="oauth_cancelled"?"OAuth sign-in was cancelled.":x==="oauth_failed"?"OAuth sign-in failed. Please try again.":Ia[x]?Ia[x]:x||null});sr();const f=yg(),d=My(o,t);function g(){const x="Iv23liLBfQFq4sQZvZX6";a("GITHUB"),sessionStorage.setItem($e,d);const b=`${window.location.origin}/zopnight/app/auth/callback/github`;window.location.href=`https://github.com/login/oauth/authorize?client_id=${x}&scope=user:email&redirect_uri=${encodeURIComponent(b)}`}function p(x){sessionStorage.setItem($e,d);const b=`${window.location.origin}/zopnight/app/auth/callback/google`,w=crypto.randomUUID(),A=new URLSearchParams({client_id:x,redirect_uri:b,response_type:"id_token",scope:"openid email profile",nonce:w,prompt:"select_account"});window.location.href=`https://accounts.google.com/o/oauth2/v2/auth?${A}`}function y(){const x="754543883934-1i2r96l86jjd8iclrn01rkht2cu2bnhl.apps.googleusercontent.com";a("GOOGLE"),l(null),p(x)}function h(){c(!0)}function v(x){a("AZURE_SAML"),f.mutate(x,{onSuccess:b=>{sessionStorage.setItem($e,d),window.location.href=b.redirectURL},onError:b=>{a(null),c(!1),l(b.message||"SSO initiation failed.")}})}return r.jsxs(Re,{subtitle:"Sign in to your account to continue.",logo:e,children:[r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-6",children:"Welcome back"}),r.jsx(Oy,{onGithub:g,onGoogle:y,onSaml:h,loadingProvider:n,error:u,defaultReturnTo:t,loginPath:s}),r.jsx(Ny,{open:i,onClose:()=>c(!1),onSubmit:v,isLoading:f.isPending})]})}function gs({className:e=""}){return r.jsxs("div",{className:`flex items-center gap-2.5 ${e}`,children:[r.jsx(ud,{className:"h-8 w-8"}),r.jsx("span",{className:"font-display text-3xl font-bold leading-none tracking-tight text-text-primary lowercase",children:"zop
3dev"})]})}const Py={name:"orange",light:"#F58549",dark:"#F58549",textLight:"#C54C0B",textDark:"#F58549",on:"#111827"},Dy={name:"blue",light:"#2A4494",dark:"#4A66D4",textLight:"#2A4494",textDark:"#8094E1",on:"#FFFFFF"},Iy={name:"green",light:"#7FB236",dark:"#7FB236",textLight:"#597D26",textDark:"#7FB236",on:"#111827"},Fy=[{id:"zopnight",name:"zopnight",tagline:"Stop paying for cloud no one is using.",description:"Your cloud advisor showed you 14%. The other 86% is where the savings live — 684 rules, reconciled against your actual bill.",bullets:["Recommendations: finds the waste across AWS, GCP and Azure","Smart scheduling across 30+ resource types","Smart autoscaling by tide: sizes for the moment, not the peak"],href:"/zopnight/app",accent:Dy,mark:"disc"},{id:"zopcloud",name:"zopcloud",tagline:"Push your repo, get a URL.",description:"Connect a repo and click. zopcloud detects the framework, builds without a Dockerfile, and hands back a live HTTPS URL. No cluster. No YAML.",bullets:["Quick Deploy: repo, name, click","No Dockerfile for Go, Node, Python, Java, Rust, PHP or Ruby","Custom domains with DNS and certificates handled"],href:"/zopday/app",accent:Iy,mark:"cloud"},{id:"zopday",name:"zopday",tagline:"Ship faster, sleep through your deploys.",description:"The platform engineering layer your cloud doesn't ship with — landing zone, deploy pipeline and audit trail, built once and running on AWS, GCP and Azure.",bullets:["Landing zones: production-ready clusters in minutes","Push code to production, with every step in the audit log","Live cluster state across every cloud, one workspace"],href:"/zopday/app",accent:Py,mark:"disc"}];function Gt(e){return!e||typeof e!="string"?null:Fy.find(t=>t.id===e)??null}function zy(e){return`${e.href}/login?app=${encodeURIComponent(e.id)}`}function Qv(e){return Gt(wo(Ht,e))}function Uy(e,t){return Gt(t)?(ns(),Ao(Ht,e,t)):!1}const By=`${"/zopnight/app".replace(/\/+$/,"")}/favicon-zopdev.svg`;function ps(e){m.useEffect(()=>{if(!e)return;const t=document.querySelector('link[rel="icon"]'),s=document.title,o=t?.getAttribute("href");return document.title=e,t?.setAttribute("href",By),()=>{document.title=s,o!=null&&t?.setAttribute("href",o)}},[e])}function $y(e){return Gt(wo(Ht,e))?.href??null}function Vy(){ps("Sign in · zopdev");const e=W(l=>l.isAuthenticated),t=W(l=>l.user?.email),s=W(l=>(l.tenants?.filter(f=>f.id&&f.name)??[]).length>0),o=pe(),[n]=Se(),a=n.get("returnTo"),i=fs(a)?it(a):null,u=(i?null:Gt(n.get("app")))?.id;return m.useEffect(()=>{e||u||Vu()},[e,u]),m.useEffect(()=>{e||!u||(ns(),window.location.replace(zy(Gt(u))))},[e,u]),m.useEffect(()=>{if(!e)return;if(i){o(i,{replace:!0});return}if(u){Uy(t,u),window.location.assign(Gt(u).href);return}if(!s){o(`${og}?returnTo=${encodeURIComponent(Wt)}`,{replace:!0});return}const l=$y(t);if(l){window.location.assign(l);return}o(Wt,{replace:!0})},[e,s,t,o,i,u]),e||u?null:r.jsx(Yc,{logo:r.jsx(gs,{}),defaultReturnTo:Wt,loginPath:"/signin"})}function ts({showToggle:e=!0,className:t="",...s}){const[o,n]=m.useState(!1);return r.jsxs("div",{className:"relative",children:[r.jsx(Ve,{type:o?"text":"password",className:`pr-10 ${t}`,...s}),e&&r.jsx("button",{type:"button",onClick:()=>n(!o),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary text-xs font-medium transition-colors duration-fast",tabIndex:-1,children:o?"Hide":"Show"})]})}function qy({onSubmit:e,error:t=null,isLoading:s=!1}){const o=Et({defaultValues:{email:"",password:""},onSubmit:({value:n})=>e(n)});return r.jsxs("form",{onSubmit:n=>{n.preventDefault(),o.handleSubmit()},className:"space-y-4",children:[r.jsx(xt,{message:t}),r.jsx(o.Field,{name:"email",validators:{onSubmit:({value:n})=>n?void 0:"Email is required"},children:n=>r.jsx(De,{label:"Email",children:r.jsx(Ve,{type:"email",placeholder:"[email protected]",value:n.state.value,onChange:a=>n.handleChange(a.target.value),onBlur:n.handleBlur,required:!0,autoComplete:"email"})})}),r.jsx(o.Field,{name:"password",validators:{onSubmit:({value:n})=>n?void 0:"Password is required"},children:n=>r.jsx(De,{label:"Password",children:r.jsx(ts,{placeholder:"Enter your password",value:n.state.value,onChange:a=>n.handleChange(a.target.value),onBlur:n.handleBlur,required:!0,autoComplete:"current-password"})})}),r.jsx(ge,{type:"submit",disabled:s,className:"w-full",children:s?"Signing in...":"Sign in"})]})}function Wy(){const e=pe(),[t]=Se(),[s,o]=m.useState(null),n=sr(),a=t.get("returnTo"),i=it(
3a)??"/resources",c=["/login","/signin"],u=t.get("from"),l=c.includes(u)?u:"/login",f=l==="/signin";ps(f?"Sign in · zopdev":void 0);const d=new URLSearchParams(t);d.delete("from"),a&&d.set("returnTo",i);const g=`${l}${d.toString()?`?${d.toString()}`:""}`;function p({email:y,password:h}){o(null),n.mutate({provider:Nt.EMAIL,providerData:{email:y,password:h}},{onSuccess:()=>e(i,{replace:!0}),onError:v=>o(v.message||"Sign in failed.")})}return r.jsxs(Re,{subtitle:"Enter your email and password to continue.",logo:f?r.jsx(gs,{}):void 0,children:[r.jsxs("button",{onClick:()=>e(g),className:"flex items-center gap-1 text-sm text-text-secondary hover:text-text-primary mb-4 transition-colors duration-fast",children:[r.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 01-.75.75H5.612l4.158 3.96a.75.75 0 11-1.04 1.08l-5.5-5.25a.75.75 0 010-1.08l5.5-5.25a.75.75 0 111.04 1.08L5.612 9.25H16.25A.75.75 0 0117 10z",clipRule:"evenodd"})}),"Back"]}),r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-6",children:"Sign in with email"}),r.jsx(qy,{onSubmit:p,error:s,isLoading:n.isPending}),r.jsxs("div",{className:"mt-4 flex justify-between text-sm",children:[r.jsx(Ie,{to:"/forgot-password",className:"text-text-link hover:text-text-link-hover transition-colors duration-fast",children:"Forgot password?"}),r.jsx(Ie,{to:"/signup",className:"text-text-link hover:text-text-link-hover transition-colors duration-fast",children:"Create an account"})]})]})}const Gy=/[A-Z]/,Ky=/[0-9]/,Hy=/[^A-Za-z0-9]/,Zy=[{label:"At least 8 characters",met:e=>e.length>=8},{label:"1 uppercase letter",met:e=>Gy.test(e)},{label:"1 number",met:e=>Ky.test(e)},{label:"1 special character",met:e=>Hy.test(e)}];function Qy({onSubmit:e,error:t=null,isLoading:s=!1}){const o=Et({defaultValues:{name:"",email:"",password:"",consent:!1},onSubmit:({value:n})=>e(n)});return r.jsxs("form",{onSubmit:n=>{n.preventDefault(),o.handleSubmit()},className:"space-y-4",children:[r.jsx(xt,{message:t}),r.jsx(o.Field,{name:"name",validators:{onSubmit:({value:n})=>n?void 0:"Name is required"},children:n=>r.jsx(De,{label:"Name",children:r.jsx(Ve,{type:"text",placeholder:"Your name",value:n.state.value,onChange:a=>n.handleChange(a.target.value),onBlur:n.handleBlur,required:!0,autoComplete:"name"})})}),r.jsx(o.Field,{name:"email",validators:{onSubmit:({value:n})=>n?void 0:"Email is required"},children:n=>r.jsx(De,{label:"Email",children:r.jsx(Ve,{type:"email",placeholder:"[email protected]",value:n.state.value,onChange:a=>n.handleChange(a.target.value),onBlur:n.handleBlur,required:!0,autoComplete:"email"})})}),r.jsx(o.Field,{name:"password",validators:{onSubmit:({value:n})=>Vr(n).valid?void 0:"Password does not meet requirements"},children:n=>{const a=n.state.value;return r.jsxs(r.Fragment,{children:[r.jsx(De,{label:"Password",children:r.jsx(ts,{placeholder:"Create a password",value:a,onChange:i=>n.handleChange(i.target.value),onBlur:n.handleBlur,required:!0,autoComplete:"new-password"})}),a&&r.jsx("ul",{className:"space-y-1 text-xs",children:Zy.map(i=>{const c=i.met(a);return r.jsxs("li",{className:`flex items-center gap-1.5 ${c?"text-success-600":"text-text-muted"}`,children:[r.jsx("span",{children:c?"✓":"✗"}),r.jsx("span",{children:i.label})]},i.label)})})]})}}),r.jsx(o.Field,{name:"consent",children:n=>r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx("input",{id:"signup-marketing-consent",type:"checkbox",checked:n.state.value,onChange:a=>n.handleChange(a.target.checked),className:"accent-primary-600 w-4 h-4 cursor-pointer mt-0.5"}),r.jsx("label",{htmlFor:"signup-marketing-consent",className:"text-sm text-text-secondary cursor-pointer max-w-[58ch]",children:"Yes, I’d like to receive product updates and promotional emails from zopdev. You can unsubscribe at any time."})]})}),r.jsx("p",{className:"text-xs text-text-secondary max-w-[58ch]",children:"We’ll always respond to messages you send us. Marketing emails are sent only with your consent."}),r.jsx(o.Subscribe,{selector:n=>n.values.password,children:n=>{const a=Vr(n).valid;return r.jsx(ge,{type:"submit",disabled:s||!a,className:"w-full",children:s?"Creating account...":"Create account"})}})]})}function Yy({status:e,error:t}){return e==="error"?r.jsxs("div",{className:"mb-6 rounded-lg border border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-200",children:["We couldn’t confirm your AWS Mar
3ketplace subscription",t?`: ${t}`:"."," Return to AWS Marketplace and click “Set up your account” again to retry."]}):e==="loading"?r.jsx("div",{className:"mb-6 rounded-lg border border-border bg-surface-secondary p-4 text-sm text-text-secondary",children:"Confirming your AWS Marketplace subscription…"}):e==="ready"?r.jsxs("div",{className:"mb-6 rounded-lg border border-emerald-300 bg-emerald-50 p-4 text-sm text-emerald-900 dark:border-emerald-500/40 dark:bg-emerald-950/40 dark:text-emerald-200",children:[r.jsx("span",{className:"font-semibold",children:"Your AWS Marketplace purchase is confirmed."})," ","Create your account below to activate your subscription — billing continues through AWS."]}):null}function Jy(){const e=pe(),[t,s]=m.useState(null),[o]=Se(),n=qe(),a=o.get("from"),i=sc.includes(a)?a:oc,c=i==="/signin",u=it(o.get("returnTo")),l=mg({entryPoint:Io(u)});ps(c?"Create an account · zopdev":void 0);const f=o.get("token"),[d,g]=m.useState(f?"loading":"none"),[p,y]=m.useState(null),h=m.useRef(!1),v=m.useRef(!0);m.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),m.useEffect(()=>{if(!f)return;const w=()=>{const E=new URLSearchParams(o);E.delete("token");const L=E.toString();return L?`${n.pathname}?${L}`:n.pathname},A=fc();if(A?.customerID&&A.token===f){g("ready"),e(w(),{replace:!0});return}A?.customerID&&lo(),!h.current&&(h.current=!0,g("loading"),e(w(),{replace:!0}),ue.resolveMarketplaceToken(f).then(E=>{v.current&&(Rg({customerID:E?.customerID??"",productCode:E?.productCode??"",token:f}),g("ready"))}).catch(E=>{v.current&&(y(E?.message??null),g("error"))}))},[f,e,n.pathname,o]);const x=`${i}${u?`?returnTo=${encodeURIComponent(u)}`:""}`;function b({name:w,email:A,password:E,consent:L}){s(null),l.mutate({name:w,email:A,password:E},{onSuccess:()=>{e("/verify-email",{state:{email:A,returnTo:u,from:i}}),L&&Ai({email:A,name:w,source:"zopnight-signup"}).catch(()=>{})},onError:P=>s(P.message||"Sign up failed.")})}return r.jsxs(Re,{subtitle:"Enter your details to get started.",logo:c?r.jsx(gs,{}):void 0,children:[r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-6",children:"Create an account"}),r.jsx(Yy,{status:d,error:p}),r.jsx(Qy,{onSubmit:b,error:t,isLoading:l.isPending}),r.jsxs("p",{className:"mt-6 text-center text-sm text-text-secondary",children:["Already have an account?"," ",r.jsx(Ie,{to:x,className:"text-text-link hover:text-text-link-hover font-medium transition-colors duration-fast",children:"Sign in"})]})]})}const Xy=/[^0-9]/g,e1=/^[0-9]$/;function Jc({length:e=6,value:t="",onChange:s,disabled:o=!1}){const n=m.useRef([]),a=t.split("").concat(Array(e).fill("")).slice(0,e);function i(u,l){if(l.length>1){const g=l.replace(Xy,"").slice(0,e);s(g);const p=Math.min(g.length,e-1);n.current[p]?.focus();return}if(l&&!e1.test(l))return;const f=[...a];f[u]=l;const d=f.join("");s(d),l&&u<e-1&&n.current[u+1]?.focus()}function c(u,l){l.key==="Backspace"&&!a[u]&&u>0&&n.current[u-1]?.focus()}return r.jsx("div",{className:"flex gap-3 justify-center",children:a.map((u,l)=>r.jsx("input",{ref:f=>n.current[l]=f,type:"text",inputMode:"numeric",maxLength:e,value:u,disabled:o,onChange:f=>i(l,f.target.value),onKeyDown:f=>c(l,f),className:"w-12 h-12 text-center text-lg font-semibold bg-surface-tertiary border border-border-strong rounded-lg text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-600/30 focus:border-primary-600/40 disabled:opacity-disabled disabled:cursor-not-allowed transition-all duration-fast"},l))})}function t1(){const e=pe(),t=qe(),s=t.state?.email,o=it(t.state?.returnTo),n=sc.includes(t.state?.from)?t.state.from:oc,a=(()=>{const v=new URLSearchParams;return o&&v.set("returnTo",o),v.set("from",n),`/login/email?${v.toString()}`})(),[i,c]=m.useState(""),[u,l]=m.useState(null),[f,d]=m.useState(0),g=gg(),p=pg();m.useEffect(()=>{s||e("/signup",{replace:!0})},[s,e]),m.useEffect(()=>{if(f<=0)return;const v=setTimeout(()=>d(f-1),1e3);return()=>clearTimeout(v)},[f]);function y(v){v.preventDefault(),i.length===6&&(l(null),g.mutate({email:s,otp:i},{onSuccess:()=>e(a,{state:{verified:!0}}),onError:x=>l(x.message||"Verification failed.")}))}function h(){l(null),p.mutate(s,{onSuccess:()=>d(60),onError:v=>{v.status===429&&d(60),l(v.message||"Failed to resend code.")}})}return s?r.jsxs(Re,{subtitle:"Enter the verification code we sent to your email.",children:[r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-2",children:"Verify your email"}),r.jsxs("p",{className:"text-sm text-text-secondary mb-6",children:["We sent a code to ",r.jsx("span",{className:"font-medium text-text-primary",children:s})]}),r.jsx(xt,{message:u}),r.jsxs("form",{onSubmit:y,className:"space-y-6",children:[r.jsx(Jc,{value:i,onChange:c,disabled:g.isPending}),r.jsx(ge,{type:"submit",disabled:i.length!==6||g.isPending,className:"w-full",children:g.isPending?"Verifying...":"
3Verify"})]}),r.jsxs("p",{className:"mt-4 text-center text-sm text-text-secondary",children:["Didn't receive a code?"," ",r.jsx("button",{onClick:h,disabled:f>0||p.isPending,className:"text-text-link hover:text-text-link-hover font-medium disabled:text-text-muted disabled:cursor-not-allowed transition-colors duration-fast",children:f>0?`Resend in ${f}s`:"Resend code"})]}),r.jsx("p",{className:"mt-2 text-center text-sm text-text-secondary",children:"Use the most recent code — resending replaces the previous one."})]}):null}const Fa="email",za="otp",Ua="password",Tr="success",r1=/[A-Z]/,s1=/[0-9]/,o1=/[^A-Za-z0-9]/,n1=[{label:"At least 8 characters",met:e=>e.length>=8},{label:"1 uppercase letter",met:e=>r1.test(e)},{label:"1 number",met:e=>s1.test(e)},{label:"1 special character",met:e=>o1.test(e)}];function a1(){const e=pe(),[t,s]=m.useState(Fa),[o,n]=m.useState(""),[a,i]=m.useState(""),[c,u]=m.useState(null),[l,f]=m.useState(0),d=na(),g=na(),p=hg();m.useEffect(()=>{if(l<=0)return;const b=setTimeout(()=>f(l-1),1e3);return()=>clearTimeout(b)},[l]);const y=Et({defaultValues:{email:""},onSubmit:({value:b})=>{u(null),n(b.email),d.mutate(b.email,{onSuccess:()=>s(za),onError:w=>u(w.message||"Request failed.")})}});function h(b){b.preventDefault(),a.length===6&&(u(null),s(Ua))}function v(){u(null),g.mutate(o,{onSuccess:()=>f(60),onError:b=>u(b.message||"Failed to resend code.")})}const x=Et({defaultValues:{password:"",confirm:""},onSubmit:({value:b})=>{u(null),p.mutate({email:o,otp:a,password:b.password},{onSuccess:()=>s(Tr),onError:w=>u(w.message||"Reset failed.")})}});return r.jsxs(Re,{subtitle:t!==Tr?"Enter your email to receive a reset code.":void 0,children:[t!==Tr&&r.jsxs(r.Fragment,{children:[r.jsxs(Ie,{to:"/login/email",className:"flex items-center gap-1 text-sm text-text-secondary hover:text-text-primary mb-4 transition-colors duration-fast",children:[r.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 01-.75.75H5.612l4.158 3.96a.75.75 0 11-1.04 1.08l-5.5-5.25a.75.75 0 010-1.08l5.5-5.25a.75.75 0 111.04 1.08L5.612 9.25H16.25A.75.75 0 0117 10z",clipRule:"evenodd"})}),"Back"]}),r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-6",children:"Reset your password"}),r.jsx(xt,{message:c})]}),t===Fa&&r.jsxs("form",{onSubmit:b=>{b.preventDefault(),y.handleSubmit()},className:"space-y-4",children:[r.jsx(y.Field,{name:"email",validators:{onSubmit:({value:b})=>b?void 0:"Email is required"},children:b=>r.jsx(De,{label:"Email",children:r.jsx(Ve,{type:"email",placeholder:"[email protected]",value:b.state.value,onChange:w=>b.handleChange(w.target.value),onBlur:b.handleBlur,required:!0,autoComplete:"email"})})}),r.jsx(ge,{type:"submit",disabled:d.isPending,className:"w-full",children:d.isPending?"Sending...":"Send OTP"})]}),t===za&&r.jsxs("div",{className:"space-y-6",children:[r.jsxs("p",{className:"text-sm text-text-secondary text-center",children:["We sent a code to"," ",r.jsx("span",{className:"font-medium text-text-primary",children:o})]}),r.jsxs("form",{onSubmit:h,className:"space-y-6",children:[r.jsx(Jc,{value:a,onChange:i}),r.jsx(ge,{type:"submit",disabled:a.length!==6,className:"w-full",children:"Continue"})]}),r.jsxs("p",{className:"text-center text-sm text-text-secondary",children:["Didn't receive a code?"," ",r.jsx("button",{onClick:v,disabled:l>0||g.isPending,className:"text-text-link hover:text-text-link-hover font-medium disabled:text-text-muted disabled:cursor-not-allowed transition-colors duration-fast",children:l>0?`Resend in ${l}s`:"Resend code"})]})]}),t===Ua&&r.jsxs("form",{onSubmit:b=>{b.preventDefault(),x.handleSubmit()},className:"space-y-4",children:[r.jsx(x.Field,{name:"password",validators:{onSubmit:({value:b})=>Vr(b).valid?void 0:"Password does not meet requirements"},children:b=>{const w=b.state.value;return r.jsxs(r.Fragment,{children:[r.jsx(De,{label:"New password",children:r.jsx(ts,{placeholder:"Enter new password",value:w,onChange:A=>b.handleChange(A.target.value),onBlur:b.handleBlur,required:!0,autoComplete:"new-password"})}),w&&r.jsx("ul",{className:"space-y-1 text-xs",children:n1.map(A=>{const E=A.met(w);return r.jsxs("li",{className:`flex items-center gap-1.5 ${E?"text-success-600":"text-text-muted"}`,children:[r.jsx("span",{children:E?"✓":"✗"}),r.jsx("span",{children:A.label})]},A.label)})})]})}}),r.jsx(x.Field,{name:"confirm",validators:{onSubmit:({value:b,fieldApi:w})=>{const A=w.form.getFieldValue("password");if(!b)return"Please confirm your password";if(b!==A)return"Passwords do not match"}},children:b=>r.jsxs(r.Fragment,{children:[r.jsx(De,{label:"Confirm password",children:r.jsx(ts,{placeholder:"Confirm new password",value:b.state.value,onChange:w=>b.handleChange(w.target.value),onBlur:b.handleBlur,required:!0,autoComplete:"new-password"})}),b.state.meta.errors?.length>0&&b.state.meta.isTouched&&r.jsx("p",{className:"text-xs text-danger-500",children:b.state.meta.errors[0]})]})}),r.jsx(x.Subscribe,{selector:b=>b.values,children:b=>{const w=Vr(b.password).valid,A=b.password===b.confirm;return r.jsx(ge,{type:"submit",disabled:!w||!A||p.isPending,className:"w-full",children:p.isPending?"Resetting...":"Reset password"})}})]}),t===Tr&&r.jsxs("div",{className:"text-center space-y-6",children:[r.jsx("div",{className:"mx-auto w-14 h-14 roun
3ded-full bg-primary-600/10 flex items-center justify-center",children:r.jsx("svg",{className:"w-7 h-7 text-primary-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-2",children:"Password reset"}),r.jsx("p",{className:"text-sm text-text-secondary",children:"Your password has been updated. You can now sign in with your new password."})]}),r.jsx(ge,{onClick:()=>e("/login/email",{replace:!0}),className:"w-full",children:"Sign in"})]})]})}function i1(){const e=pe(),[t]=Se(),s=sr(),o=m.useRef(!1),n=t.get("code");return m.useEffect(()=>{if(!o.current){if(o.current=!0,!n){e("/login?error=oauth_cancelled",{replace:!0});return}s.mutateAsync({provider:Nt.GITHUB,providerData:{token:n}}).then(()=>{const a=sessionStorage.getItem($e)||"/resources";sessionStorage.removeItem($e),e(a,{replace:!0})}).catch(()=>{e("/login?error=oauth_failed",{replace:!0})})}},[]),r.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-surface-secondary",children:[r.jsx(Lt,{}),r.jsx("p",{className:"mt-4 text-sm text-text-secondary",children:"Completing sign in..."})]})}function c1(){const e=window.location.hash.substring(1);return new URLSearchParams(e).get("id_token")}function l1(){const e=pe(),[t]=Se(),s=sr(),o=m.useRef(!1),n=t.get("code")||t.get("credential")||c1();return m.useEffect(()=>{if(!o.current){if(o.current=!0,!n){e("/login?error=oauth_cancelled",{replace:!0});return}s.mutateAsync({provider:Nt.GOOGLE,providerData:{token:n}}).then(()=>{const a=sessionStorage.getItem($e)||"/resources";sessionStorage.removeItem($e),e(a,{replace:!0})}).catch(()=>{e("/login?error=oauth_failed",{replace:!0})})}},[]),r.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-surface-secondary",children:[r.jsx(Lt,{}),r.jsx("p",{className:"mt-4 text-sm text-text-secondary",children:"Completing sign in..."})]})}function Ba(){const e=pe(),[t]=Se(),s=sr(),o=W(l=>l.setTokens),n=m.useRef(!1),a=t.get("code")||t.get("SAMLResponse")||t.get("token")||t.get("samlcode"),i=t.get("access_token"),c=t.get("refresh_token"),u=t.get("error")||t.get("error_description");return m.useEffect(()=>{if(n.current)return;n.current=!0;const l=it(sessionStorage.getItem($e)),f=l||"/resources";if(u){e(`/login?error=${encodeURIComponent(u)}`,{replace:!0});return}if(i&&c){sessionStorage.removeItem($e);const d=Qt(i),g=d?.email||"";W.getState().setTokensQuiet(i,c);let p=!1;ue.listOrganizations().then(y=>y==null?[]:(Array.isArray(y)||(p=!0),y)).catch(()=>(p=!0,W.getState().tenants?.filter(h=>h.id&&h.name)??[])).then(async y=>{if(y.length===0){Ct(Qe,g,""),o({accessToken:i,refreshToken:c,tenants:[]}),rs({email:g,name:d?.name}),cc(g,{hasOrganisation:!1,orgListFailed:p})&&we(Ae.USER_SIGNED_UP,{method:Bo(Nt.AZURE_SAML),inferred:!0,...Uo(g)}),Xr(f),e(l?`/onboarding?returnTo=${encodeURIComponent(l)}`:"/onboarding",{replace:!0});return}const h=ss(Qe,g),x=(h?y.find(w=>String(w.id)===String(h)):null)||y[0];Ct(Qe,g,x.id);const b=await ue.refresh(c,x.id);o({accessToken:b.access_token,refreshToken:b.refresh_token,tenants:y.map(w=>({id:w.id,name:w.name}))}),Xr(f),e(f,{replace:!0})}).catch(()=>{e("/login?error=oauth_failed",{replace:!0})});return}if(!a){e("/login?error=oauth_cancelled",{replace:!0});return}s.mutateAsync({provider:Nt.AZURE_SAML,providerData:{token:a}}).then(()=>{sessionStorage.removeItem($e),e(f,{replace:!0})}).catch(()=>{e("/login?error=oauth_failed",{replace:!0})})},[]),r.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-surface-secondary",children:[r.jsx(Lt,{}),r.jsx("p",{className:"mt-4 text-sm text-text-secondary",children:"Completing sign in..."})]})}const u1=/^\S+@\S+\.\S+$/;function fo(e){return typeof e=="string"?e.trim().toLowerCase():""}function d1(e){const t=fo(e);return t!==""&&u1.test(t)}const Us=25,f1="w-full flex items-center justify-between gap-1.5 px-2.5 py-2 text-sm bg-surface-tertiary border border-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-600/30 focus:border-primary-600/40 disabled:opacity-disabled disabled:cursor-not-allowed transition-all duration-fast",mo=240,m1=120,$a=8;function g1(e){for(let t=e.parentElement;t;t=t.parentElement){const s=window.getComputedStyle(t).overflowY;if(s&&s!=="visible"){const o=t.getBoundingClientRect();return{top:o.top,bottom:o.bottom}}}return{top:0,bottom:window.innerHeight}}function p1(e){const t=e.getBoundingClientRect(),s=g1(e),o=s.bottom-t.bottom-$a,n=t.top-s.top-$a,a=o<Math.min(mo,n);return{up:a,maxHeight:Math.min(mo,Math.max(a?n:o,m1))}}function Va(e){return e.name||"Unnamed role"}function h1({id:e,label:t,roles:s,value:o,placeholder:n,disabled:a=!1,invalid:i=!1,className:c="",onCh
3ange:u}){const[l,f]=m.useState(!1),[d,g]=m.useState(-1),[p,y]=m.useState({up:!1,maxHeight:mo}),h=m.useRef(null),v=m.useRef(null),x=m.useRef(null),b=s.findIndex(N=>N.id===o),w=b>=0?s[b]:null,A=m.useCallback(N=>{f(!1),g(-1),N&&v.current?.focus()},[]),E=m.useCallback(N=>{v.current&&y(p1(v.current)),g(s.length===0?-1:Math.min(Math.max(N,0),s.length-1)),f(!0)},[s.length]);m.useEffect(()=>{l&&x.current?.focus()},[l]),m.useEffect(()=>{if(!l)return;function N(z){h.current?.contains(z.target)||(f(!1),g(-1))}return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[l]);function L(N){u(N.id),A(!0)}function P(N){if(N.key==="ArrowDown"||N.key==="Enter"||N.key===" "){N.preventDefault(),E(b>=0?b:0);return}N.key==="ArrowUp"&&(N.preventDefault(),E(b>=0?b:s.length-1))}function j(N){switch(N.key){case"ArrowDown":N.preventDefault(),g(z=>Math.min(z+1,s.length-1));break;case"ArrowUp":N.preventDefault(),g(z=>Math.max(z-1,0));break;case"Home":N.preventDefault(),g(0);break;case"End":N.preventDefault(),g(s.length-1);break;case"Enter":case" ":N.preventDefault(),s[d]&&L(s[d]);break;case"Escape":N.preventDefault(),A(!0);break;case"Tab":A(!1);break}}return r.jsxs("div",{ref:h,className:`relative ${c}`,children:[r.jsxs("button",{ref:v,type:"button",disabled:a,"aria-label":t,"aria-haspopup":"listbox","aria-expanded":l,"aria-controls":l?`${e}-list`:void 0,"aria-invalid":i?"true":void 0,onClick:()=>l?A(!1):E(b),onKeyDown:P,className:`${f1} ${w?"text-text-primary":"text-text-muted"} ${i?"border-danger-400/60":""}`,children:[r.jsx("span",{className:"truncate",children:w?Va(w):n}),r.jsx("svg",{className:`h-4 w-4 shrink-0 text-text-muted transition-transform duration-fast ${l?"rotate-180":""}`,fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),l&&r.jsx("ul",{ref:x,id:`${e}-list`,role:"listbox",tabIndex:-1,"aria-label":`${t} options`,"aria-activedescendant":d>=0?`${e}-opt-${d}`:void 0,onKeyDown:j,style:{maxHeight:p.maxHeight},className:`absolute right-0 z-30 w-64 min-w-full max-w-[calc(100vw-3rem)] overflow-y-auto overscroll-contain rounded-lg border border-border-strong bg-surface-elevated py-1 shadow-lg focus:outline-none ${p.up?"bottom-full mb-1":"top-full mt-1"}`,children:s.map((N,z)=>{const Q=N.id===o;return r.jsxs("li",{id:`${e}-opt-${z}`,role:"option","aria-selected":Q,onClick:()=>L(N),onMouseMove:()=>g(z),className:`cursor-pointer px-3 py-2 ${z===d?"bg-primary-600/10":""}`,children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`truncate text-sm ${Q?"font-medium text-primary-600":"text-text-primary"}`,children:Va(N)}),N.isSystem?r.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-wider text-text-muted",children:"System"}):null]}),N.description?r.jsx("span",{className:"mt-0.5 block text-xs text-text-muted",children:N.description}):null]},N.id)})})]})}const qa="shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border-strong bg-surface-tertiary text-text-secondary hover:text-text-primary hover:border-primary-600/40 focu
3s:outline-none focus-visible:ring-2 focus-visible:ring-primary-600/40 transition-all duration-fast",Ut={LOADING:"loading",READY:"ready",ERROR:"error"};let Wa=0;function Ga(){return Wa+=1,{id:`invite-row-${Wa}`,email:"",roleId:""}}function y1(e,{selfEmail:t,requireRole:s}){const o=fo(t),n=new Map,a=[],i=[];let c=!1,u=!1;return e.forEach((l,f)=>{const d=fo(l.email),g=y=>i.push({id:l.id,row:f+1,message:y});if(!d)return;if(o&&d===o){c=!0;return}if(u=!0,!d1(d)){g(`"${l.email.trim()}" is not a valid email address.`);return}const p=n.get(d);if(p){g(`${d} is already on row ${p}.`);return}if(n.set(d,f+1),s&&!l.roleId){g(`Choose a role for ${d}.`);return}a.push({email:d,roleId:l.roleId})}),{entries:a,errors:i,skippedSelf:c,hasEmail:u}}function x1({orgId:e,orgName:t,selfEmail:s,onDone:o}){const[n,a]=m.useState(()=>[Ga()]),[i,c]=m.useState([]),[u,l]=m.useState(Ut.LOADING),[f,d]=m.useState(0),[g,p]=m.useState(0),[y,h]=m.useState(!1),[v,x]=m.useState(null),b=m.useRef(null),w=m.useRef(!1);m.useEffect(()=>{let O=!0;return ue.listRoles(e).then(V=>{O&&(c(Array.isArray(V)?V:[]),l(Ut.READY))}).catch(()=>{O&&(c([]),l(Ut.ERROR))}),()=>{O=!1}},[e,f]),m.useEffect(()=>{w.current&&(w.current=!1,b.current?.focus())},[n.length]);const A=i.length>0,E=u===Ut.LOADING,L=E||A,{entries:P,errors:j,skippedSelf:N,hasEmail:z}=y1(n,{selfEmail:s,requireRole:A}),Q=new Map(j.map(O=>[O.id,O.message])),G=(v??[]).filter(O=>!O.ok),I=g>0,S=m.useCallback(()=>{a(O=>O.length>=Us?O:(w.current=!0,[...O,Ga()]))},[]),B=n.length>=Us,D=m.useCallback(O=>{a(V=>V.length>1?V.filter(q=>q.id!==O):V)},[]),M=m.useCallback((O,V)=>{a(q=>q.map(Y=>Y.id===O?{...Y,...V}:Y))},[]);async function C({email:O,roleId:V}){if(await ue.addOrganizationUser(e,O),!V)return{email:O,roleId:V,ok:!0};try{await ue.assignRole(e,O,V)}catch{return{email:O,roleId:V,ok:!0,roleFailed:!0}}return{email:O,roleId:V,ok:!0}}async function R(O){p(O.length);const V=await Promise.allSettled(O.map(q=>C(q)));x(O.map((q,Y)=>{const Z=V[Y];return Z.status==="fulfilled"?Z.value:{email:q.email,roleId:q.roleId,ok:!1,error:Z.reason?.message??"Could not send invite."}})),p(0)}function _(){if(!z){o();return}if(j.length>0){h(!0);return}h(!1),R(P)}return I?r.jsxs("div",{className:"text-center",role:"status","aria-live":"polite",children:[r.jsx("div",{className:"mx-auto h-8 w-8 animate-spin rounded-full border-2 border-primary-600 border-t-transparent"}),r.jsxs("p",{className:"mt-4 text-sm text-text-secondary",children:["Sending ",g," invite",g===1?"":"s","…"]})]}):v?r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-2",children:"Invites sent"}),r.jsx("p",{className:"text-sm text-text-secondary mb-6",children:G.length===0?"Everyone will get an email with a link to join.":"Some invites did not go through. You can invite them again later from Settings."}),r.jsx("ul",{className:"space-y-2 mb-6","data-testid":"invite-results",children:v.map(O=>r.jsxs("li",{className:"flex items-start gap-2 p-2.5 rounded-lg bg-surface-tertiary border border-border text-sm",children:[r.jsx("span",{"aria-hidden":"true",className:`mt-0.5 shrink-0 ${O.ok?"text-success-500":"text-danger-500"}`,children:O.ok?"✓":"✕"}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block text-text-primary break-all",children:O.email}),r.jsx("span",{className:`block text-xs ${O.ok?"text-text-muted":"text-danger-500"}`,children:O.ok?O.roleFailed?"Added, but the role could not be applied. Set it in Settings.":"Invited":O.error})]})]},O.email))}),r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(ge,{type:"button",className:"w-full",onClick:o,children:"Continue"}),G.length>0&&r.jsx(ge,{type:"button",variant:"secondary",className:"w-full",onClick:()=>{R(G.map(O=>({email:O.email,roleId:O.roleId})))},children:"Retry failed invites"})]})]}):r.jsxs("div",{children:[r.jsxs("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-2",children:["Invite people to ",t]}),r.jsxs("p",{className:"text-sm text-text-secondary mb-6",children:[t," is ready. Add members now, or skip and do it later from Settings."]}),r.jsx(De,{label:L?"Members":"Email addresses",children:r.jsx("ul",{className:"space-y-2","data-testid":"inv
3ite-rows",children:n.map((O,V)=>{const q=V===n.length-1,Y=y||O.email.trim()?Q.get(O.id)??null:null,Z=`${O.id}-error`;return r.jsxs("li",{children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(Ve,{type:"email",autoComplete:"off","aria-label":`Email address ${V+1}`,"aria-invalid":Y?"true":void 0,"aria-describedby":Y?Z:void 0,ref:q?b:null,value:O.email,onChange:T=>M(O.id,{email:T.target.value}),onKeyDown:T=>{T.key!=="Enter"||!q||(T.preventDefault(),O.email.trim()&&S())},placeholder:"[email protected]",className:`min-w-0 basis-full sm:min-w-[7rem] sm:flex-1 sm:basis-0 ${Y?"border-danger-400/60":""}`}),L&&r.jsx(h1,{id:`${O.id}-role`,label:`Role for member ${V+1}`,roles:i,value:O.roleId,placeholder:E?"Loading roles…":"Select role",disabled:E,invalid:!!Y,onChange:T=>M(O.id,{roleId:T}),className:"min-w-0 flex-1 sm:w-32 sm:flex-none sm:basis-32"}),q?r.jsx("button",{type:"button","aria-label":"Add another member",onClick:S,disabled:B,className:`${qa} hover:text-primary-600`,children:r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v14M5 12h14"})})}):r.jsx("button",{type:"button","aria-label":`Remove member ${V+1}`,onClick:()=>D(O.id),className:`${qa} hover:text-danger-500`,children:r.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24","aria-hidden":"true",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 7h12M9 7V5.5A1.5 1.5 0 0 1 10.5 4h3A1.5 1.5 0 0 1 15 5.5V7m2 0v11.5A1.5 1.5 0 0 1 15.5 20h-7A1.5 1.5 0 0 1 7 18.5V7"})})})]}),Y&&r.jsx("p",{id:Z,className:"mt-1 text-xs text-danger-500 break-words",children:Y})]},O.id)})})}),r.jsxs("p",{className:"mt-1.5 text-xs text-text-muted","data-testid":"invite-hint",children:[A?"One person per row. Every address needs a role.":"One person per row. Roles can be assigned later from Settings.",P.length>0&&` ${P.length} invite${P.length===1?"":"s"} ready to send.`,N&&" Your own address is already a member, so it is skipped."]}),B&&r.jsxs("p",{className:"mt-1.5 text-xs text-text-muted","data-testid":"invite-cap",children:["That's the most you can invite here (",Us,"). Add the rest from Settings → Members once you're in."]}),u===Ut.ERROR&&r.jsxs("p",{className:"mt-1.5 text-xs text-text-muted","data-testid":"invite-roles-error",children:["We couldn't load this organization's roles, so invites will be sent without one."," ",r.jsx("button",{type:"button",onClick:()=>{l(Ut.LOADING),d(O=>O+1)},className:"underline text-text-secondary hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-600/40 rounded",children:"Try loading roles again"})]}),r.jsxs("div",{className:"flex flex-col gap-3 mt-6",children:[r.jsx(ge,{type:"button",className:"w-full",onClick:_,disabled:!z||j.length>0||I,children:"Send invites"}),r.jsx(ge,{type:"button",variant:"secondary",className:"w-full",onClick:o,children:"Skip for now"})]})]})}const v1=/[._+-]/;function b1(e){if(typeof e!="string")return null;const t=e.trim(),s=t.indexOf("@");if(s<=0)return null;const a=t.slice(0,s).split(v1)[0].replace(/\d+$/,"");if(!a)return null;const i=a.toLowerCase();return i.charAt(0).toUpperCase()+i.slice(1)}function w1(e){const t=b1(e);return t?{name:t,orgName:`${t} Org`,teamName:`${t} Team`}:null}const A1="/setup",Ka="/",Be={CHECKING:"checking",PROVISIONING:"provisioning",INVITE:"invite",MANUAL:"manual"},_1={[Be.MANUAL]:{step:"create_org",step_index:0},[Be.INVITE]:{step:"invite_team",step_index:1}};function Bs(e){return(e??[]).filter(t=>t?.id&&t?.name)}function S1(){const[e]=Se(),t=it(e.get("returnTo"))===Wt,s=t?r.jsx(gs,{}):void 0;ps(t?"Set up your organisation · zopdev":void 0);const o=pe(),[n,a]=m.useState(Be.CHECKING),[i,c]=m.useState(null),[u,l]=m.useState(null),[f,d]=m.useState(null),[g,p]=m.useState("org"),[y,h]=m.useState(!1),v=lc({entryPoint:Io(e.get("returnTo"))}),x=W(R=>R.logout),b=W(R=>R.setTokens),w=m.useRef(!1),A=m.useRef(!1),E=m.useRef(null),L=m.useRef(!1),[P]=m.useState(()=>{const{user:R,accessToken:_}=W.getState(),O=R?.email??Qt(_)?.email??"";return{email:O,derived:w1(O)}}),j=P.email,N=P.derived;function z(R=A1){o(it(e.get("returnTo"))??R,{replace:!0})}async function Q(R){const _=R[0];Ct(Qe,j,_.id);try{await Eo(_.id)}catch{}const{accessToken:O,refreshToken:V}=W.getState();return b({accessToken:O,refreshToken:V,tenants:R.map(q=>({id:q.id,name:q.name}))}),t||Xr(),_}async function G(R,_){if(E.current=R,c(R),_){p("team");try{await ue.createTeam(R.id,_)}catch(O){d(`We couldn't create the "${_}" team (${O?.message??"unknown error"}). Your organization is ready — you can add teams from Settings.`)}}mc(),a(Be.INVITE)}
3async function I(R){if(A.current)return;A.current=!0,a(Be.PROVISIONING),p("org"),l(null);let _;try{L.current=!0,_=await wn(j,()=>v.mutateAsync({name:R.orgName,flow:"auto"}))}catch(O){l(O?.message??"Failed to create organization."),a(Be.MANUAL);return}if(!_?.id){l("Your organization could not be confirmed. Please try again."),a(Be.MANUAL);return}await G({id:_.id,name:_.name??R.orgName},R.teamName)}async function S(){if(Bs(W.getState().tenants).length>0){z(Ka);return}let _;try{_=Bs(await ue.listOrganizations())}catch{l("We could not check your organizations. Please name yours to continue."),a(Be.MANUAL);return}if(_.length>0){await Q(_),z(Ka);return}if(!N){a(Be.MANUAL);return}await I(N)}m.useEffect(()=>{w.current||(w.current=!0,S())},[]);async function B(R){l(null),h(!0);try{if(E.current){await G(E.current,null);return}let _=[];try{_=Bs(await ue.listOrganizations())}catch{if(L.current){l("We could not confirm whether your organization was created. Please try again in a moment.");return}_=[]}if(_.length>0){const V=await Q(_);await G(V,null);return}L.current=!0;const O=await wn(j,()=>v.mutateAsync({name:R,flow:"manual"}));if(!O?.id){l("Your organization could not be confirmed. Please try again.");return}await G({id:O.id,name:O.name??R},N?.teamName??`${R} Team`)}catch(_){l(_?.message??"Failed to create organization.")}finally{h(!1)}}const D=Et({defaultValues:{orgName:N?.orgName??""},onSubmit:({value:R})=>B(R.orgName.trim())}),M=m.useRef(new Set);m.useEffect(()=>{const R=_1[n];!R||M.current.has(n)||(M.current.add(n),we(Ae.ONBOARDING_STEP_VIEWED,{flow:"onboarding",...R}))},[n]);function C(){x(),o("/login",{replace:!0})}return n===Be.CHECKING?r.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-surface-secondary",children:[r.jsx(Lt,{}),r.jsx("p",{className:"mt-4 text-sm text-text-secondary",children:"Checking your account..."})]}):n===Be.PROVISIONING?r.jsx(Re,{subtitle:"This only takes a moment.",logo:s,children:r.jsxs("div",{role:"status","aria-live":"polite",children:[r.jsxs("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-2",children:["Setting up ",N.orgName,"…"]}),r.jsx("p",{className:"text-sm text-text-secondary mb-6",children:"We're creating your workspace from your email address. You can rename anything later."}),r.jsxs("ul",{className:"space-y-3",children:[r.jsx(Ha,{label:`Creating ${N.orgName}`,state:g==="org"?"active":"done"}),r.jsx(Ha,{label:`Creating ${N.teamName}`,state:g==="org"?"pending":"active"})]})]})}):n===Be.INVITE&&i?r.jsxs(Re,{subtitle:"You're in. One last, optional step.",logo:s,children:[f&&r.jsx("div",{role:"status",className:"flex items-start gap-2.5 p-3 mb-4 text-sm text-warning-600 bg-warning-400/8 border border-warning-400/20 rounded-lg",children:r.jsx("span",{children:f})}),r.jsx(x1,{orgId:i.id,orgName:i.name,selfEmail:j,onDone:()=>z()})]}):r.jsxs(Re,{subtitle:"Set up your organization to get started.",logo:s,children:[r.jsx("h2",{className:"text-2xl font-bold text-text-primary font-display tracking-tight mb-2",children:"Create your organization"}),r.jsx("p",{className:"text-sm text-text-secondary mb-6",children:"Name your organization to get started. You can change it later in Settings."}),r.jsx(xt,{message:u}),r.jsxs("form",{onSubmit:R=>{R.preventDefault(),D.handleSubmit()},children:[r.jsx(D.Field,{name:"orgName",validators:{onSubmit:({value:R})=>R.trim()?void 0:"Organization name is required"},children:R=>r.jsx(De,{label:"Organization Name",children:r.jsx(Ve,{id:"org-name",placeholder:"Enter organization name",value:R.state.value,onChange:_=>R.handleChange(_.target.value),onBlur:R.handleBlur,required:!0,disabled:y})})}),r.jsx(D.Subscribe,{selector:R=>R.values.orgName,children:R=>r.jsx(ge,{type:"submit",className:"w-full mt-6",disabled:!R.trim()||y,children:y?"Creating...":"Create Organization"})})]}),r.jsx("div",{className:"mt-4 text-center",children:r.jsx("button",{type:"button",onClick:C,className:"text-sm text-text-secondary hover:text-text-primary transition-colors duration-fast",children:"Log out"})})]})}function Ha({label:e,state:t}){const s=t==="done"?"bg-success-500":t==="active"?"bg-primary-600 animate-pulse":"bg-border-strong";return r.jsxs("li",{className:"flex items-center gap-3 text-sm",children:[r.jsx("span",{"aria-hidden":"true",className:`h-2.5 w-2.5 rounded-full shrink-0 ${s}`}),r.jsx("span",{className:t==="pending"?"text-text-muted":"text-text-primary",children:e}),t==="done"&&r.jsx("span",{className:"sr-only",children:"done"})]})}function k1(){return r.jsx("div",{className:"min-h-screen bg-surface-secondary flex items-center justify-center",children:r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"text-6xl font-bold text-primary-600 font-display",children:"404"}),r.jsx("h1",{className:"mt-4 text-xl font-semibold text-text-primary font-display",children:"Page not found"}),r.jsx("p",{className:"mt-2 text-sm text-text-secondary",children:"The page you're looking for doesn't exist or has been moved."}),r.jsx("div",{className:"mt-6",children:r.jsx(Ie,{to:"/resources",children:r.jsx(ge,{children:"Back to Resources"})})})]})})}function E1(){const e=W(n=>n.isAuthenticated),t=W(n=>(n.tenants?.filter(a=>a.id&&a.name)??[]).length>0),s=qe(),o=s.pathname+s.search;return e?t?r.jsx(Kt,{}):r.jsx(te,{to:`/onboarding?returnTo=${encodeURIComponent(o)}`,replace:!0}):r.jsx(te,{to:`/signin?returnTo=${encodeURIComponent(o)}`,replace:!0})}const Za="/dashboard",R1="/my-work";function j1(){const e=W(s=>!!s.user?.email),t=Vo(de.DASHBOARD_VIEW);return e?t==="loading"?r.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:r.jsx(Lt,{})}):t==="denied"?r.jsx(te,{to:R1,replace:!0}):r.jsx(te,{to:Za,replace:!0}):r.jsx(te,{to:Za,replace:!0})}const C1=$(()=>U(()=>import("./MyWorkPage-DmSRRSgN.js"),__vite__mapDeps([6,1,7,8,2,9,10,11,12,13,14,15,16,17,18,19,20,3]))),N1=$(()=>U(()=>import("./ProductsPage-BzklY5zV.js"),__vite__mapDeps([21,1,2,3]))),Qa=$(()=>U(()=>import("./DashboardPage-BfDdLLOY.js"),__vite__mapDeps([22,1,23,8,2,9,7,24,14,25,26,27,28,5,29,30,31,32,33,34,35,36,20,37,38,39,18,12,13,40,41,42,43,44,45,46,47,3]))),O1=$(()=>U(()=>import("./DashboardsListPage-117868gk.js"),__vite__mapDeps([48,1,23,8,2,9,14,44,45,46,49,15,10,50,47,3]))),T1=$(()=>U(()=>import("./NewDashboardPage-S5bzOGUW.js"),__vite__mapDeps([51,1,23,8,2,9,14,25,44,45,46,28,5,29,30,31,32,33,34,35,36,20,24,37,38,39,18,12,13,40,41,42,43,47,3]))),M1=$(()=>U(()=>import("./ResourcesPage-CQ1_6oKF.js"),__vite__mapDeps([52,1,17,53,10,14,54,55,56,57,58,2,23,8,9,59,60,61,62,63,64,65,66,67,68,69,46,70,50,16,71,72,73,74,75,76,77,78,19,36,35,20,40,39,79,80,30,81,82,83,84,37,85,44,45,42,34,31,26,27,32,33,3]))),Ya=$(()=>U(()=>import("./SchedulesPage-DyRzmnq1.js"),__vite__mapDeps([86,1,87,61,64,14,44,45,46,88,89,49,23,8,2,9,10,90,91,38,20,80,37,85,32,33,16,17,50,78,3]))),L1=$(()=>U(()=>import("./ScheduleDetailPage-BgFzUIVs.js"),__vite__mapDeps([92,1,93,14,87,37,2,85,9,44,45,46,78,88,89,91,38,20,64,80,62,31,63,65,66,67,94,50,42,95,70,77,3]))),P1=$(()=>U(()=>import("./HistoryPage-BEGmuyYB.js"),__vite__mapDeps([96,1,17,53,97,10,14,23,8,2,9,58,64,98,12,13,11,39,16,71,67,3]))),D1=$(()=>U(()=>import("./AuditLogsPage-DXW0ygMR.js"),__vite__mapDeps([99,1,17,53,14,23,8,2,9,58,10,64,61,67,98,12,13,11,97,100,16,71,3]))),I1=$(()=>U(()=>import("./AlertsPage-BrWlco8J.js"),__vite__mapDeps([101,1,17,23,8,2,9,14,58,10,98,12,13,11,42,53,16,24,3]))),F1=$(()=>U(()=>import("./ResourceGroupsPage-EUSw0FGv.js"),__vite__mapDeps([102,1,103,2,49,53,14,23,8,9,61,44,45,46,10,31,30,104,77,54,16,17,50,37,64,80,3]))),z1=$(()=>U(()=>
3import("./GroupDetailPage-DIWwWijo.js"),__vite__mapDeps([105,1,2,103,8,9,93,14,44,45,46,78,54,95,106,63,64,65,66,67,62,94,50,31,73,104,37,85,91,38,20,80,90,100,77,72,79,30,83,3]))),U1=$(()=>U(()=>import("./ReportsPage-D9_tjFlL.js"),__vite__mapDeps([107,1,27,108,42,25,14,23,8,2,9,98,12,13,11,109,60,76,53,10,16,17,80,110,34,29,30,31,32,33,46,43,87,58,111,44,45,112,55,56,57,64,61,113,114,71,50,115,75,116,117,118,119,120,121,122,24,69,3]))),B1=$(()=>U(()=>import("./BudgetsPage-sIDgbhYy.js"),__vite__mapDeps([123,1,23,8,2,9,44,45,46,50,75,30,79,80,58,61,60,14,53,10,69,3]))),cr=$(()=>U(()=>import("./RecommendationsPage-Cw2cCCZ5.js"),__vite__mapDeps([124,1,2,17,67,57,56,74,75,76,27,23,8,9,14,10,108,42,25,87,65,61,64,66,36,35,20,98,12,13,11,125,126,46,45,91,38,80,85,127,33,40,69,50,128,129,130,41,131,132,3,133,16]))),$1=$(()=>U(()=>import("./SmartTagsPage-Bs-MLDTA.js"),__vite__mapDeps([134,1,23,8,2,9,108,42,25,87,14,10,44,45,46,19,133,3]))),V1=$(()=>U(()=>import("./RecommendationHistoryPage-sZ4-3bzy.js"),__vite__mapDeps([135,1,17,23,8,2,9,10,14,108,42,25,53,98,12,13,11,125,41,40,20,76,65,66,3]))),q1=$(()=>U(()=>import("./TopologyPage-CsdJRBYg.js"),__vite__mapDeps([136,1,137,76,2,138,23,8,9,59,60,64,14,26,27,113,114,139,74,75,35,36,20,126,46,17,45,91,38,80,85,127,33,56,40,10,42,69,50,128,129,130,24,131,132,3,82,89,140]))),W1=$(()=>U(()=>import("./GlobePage-DgtJjyRZ.js"),__vite__mapDeps([141,1,14,26,27,113,114,59,60,42,139,2,73,142,76,12,13,112,3]))),G1=$(()=>U(()=>import("./K8sClustersPage-DUTdFOj9.js"),__vite__mapDeps([143,1,23,8,2,9,14,61,58,10,68,64,53,50,16,17,3]))),K1=$(()=>U(()=>import("./K8sClusterShell-DfmXISSt.js"),__vite__mapDeps([144,1,14,116,46,145,2,3]))),H1=$(()=>U(()=>import("./OverviewPage-B5ftq6q_.js"),__vite__mapDeps([146,1,108,42,27,14,147,2,148,149,150,3]))),Z1=$(()=>U(()=>import("./PodsPage-2z4jV5bO.js"),__vite__mapDeps([151,1,58,2,14,10,147,152,50,153,76,3]))),Q1=$(()=>U(()=>import("./DeploymentsPage-DQ_cXQhz.js"),__vite__mapDeps([154,1,58,2,14,155,10,147,152,50,153,76,3]))),Y1=$(()=>U(()=>import("./ServicesPage-DW-oBBhj.js"),__vite__mapDeps([156,1,155,2,58,10,14,147,152,50,3]))),J1=$(()=>U(()=>import("./ConfigMapsPage-pCtzPgoy.js"),__vite__mapDeps([157,1,155,2,58,10,14,147,152,50,3]))),X1=$(()=>U(()=>import("./SecretsPage-dkVvMqEz.js"),__vite__mapDeps([158,1,155,2,58,10,14,147,152,50,3]))),ex=$(()=>U(()=>import("./JobsPage-BNmvaxcz.js"),__vite__mapDeps([159,1,58,2,14,155,10,147,152,50,3]))),tx=$(()=>U(()=>import("./DaemonSetsPage-Dumjd_A8.js"),__vite__mapDeps([160,1,58,2,14,155,10,147,152,50,153,76,3]))),rx=$(()=>U(()=>import("./StatefulSetsPage-DgW6UhWM.js"),__vite__mapDeps([161,1,58,2,14,155,10,147,152,50,153,76,3]))),sx=$(()=>U(()=>import("./ReplicaSetsPage-D47zmuse.js"),__vite__mapDeps([162,1,58,2,14,155,10,147,152,50,153,76,3]))),ox=$(()=>U(()=>import("./NodesPage-DXU_i2I-.js"),__vite__mapDeps([163,1,2,58,14,155,10,147,152,50,3]))),nx=$(()=>U(()=>import("./EventsPage-JPoMvCZC.js"),__vite__mapDeps([164,1,58,2,14,10,147,152,50,148,3]))),ax=$(()=>U(()=>import("./IngressesPage-DJUbeKRl.js"),__vite__mapDeps([165,1,155,2,58,10,14,147,152,50,3]))),ix=$(()=>U(()=>import("./EndpointsPage-BqEZxb3z.js"),__vite__mapDeps([166,1,155,2,58,10,14,147,152,50,3]))),cx=$(()=>U(()=>import("./RoutesPage-Cz6qleyu.js"),__vite__mapDeps([167,1,155,2,58,10,14,147,152,50,3]))),lx=$(()=>U(()=>import("./ProjectsPage-DGi-_2z2.js"),__vite__mapDeps([168,1,155,2,58,10,14,147,152,50,3]))),ux=$(()=>U(()=>import("./ImageStreamsPage-DrHgPVKw.js"),__vite__mapDeps([169,1,155,2,58,10,14,147,152,50,3]))),dx=$(()=>U(()=>import("./DeploymentConfigsPage-DUKCVjrf.js"),__vite__mapDeps([170,1,155,2,58,10,14,147,152,50,3]))),fx=$(()=>U(()=>import("./BuildConfigsPage-CFusPGiD.js"),__vite__mapDeps([171,1,155,2,58,10,14,147,152,50,3]))),mx=$(()=>U(()=>import("./NetworkPoliciesPage-BV3rnkwl.js"),__vite__mapDeps([172,1,155,2,58,10,14,147,152,50,3]))),gx=$(()=>U(()=>import("./HPAPage-BmXV73OG.js"),__vite__mapDeps([173,1,155,2,58,10,14,147,152,50,3]))),px=$(()=>U(()=>import("./StoragePage-CTBa0OSR.js"),__vite__mapDeps([174,1,155,2,58,10,14,147,152,50,3]))),hx=$(()=>U(()=>import("./ServiceAccountsPage-C5unqGgv.js"),__vite__mapDeps([175,1,155,2,58,10,14,147,152,50,3]))),yx=$(()=>U(()=>import("./NamespacesPage-CFiSwyb6.js"),__vite__mapDeps([176,1,58,2,14,10,147,152,50,155,3]))),xx=$(()=>U(()=>import("./QuotasPage-DWvOkB-Y.js"),__vite__mapDeps([177,1,155,2,58,10,14,147,152,50,3]))),vx=$(()=>U(()=>import("./CRDsPage-Dan7JReJ.js"),__vite__mapDeps([178,1,155,2,58,10,14,147,152,50,3]))),bx=$(()=>U(()=>import("./RecommendationsPage-zb91jg--.js"),__vite__mapDeps([179,1,14,61,147,2,149,150,3]))),wx=$(()=>U(()=>import("./SettingsPage-5IvzUhtx.js"),__vite__mapDeps([180,1,87,64,14,181,2,44,45,46,3]))),Ja=$(()=>U(()=>import("./NotificationsPage-D0k8qDi-.js"),__vite__mapDeps([182,1,87,14,44,45,46,132,2,80,31,83,3]))
3),Ax=$(()=>U(()=>import("./SettingsPage--RMPkAyj.js"),__vite__mapDeps([183,1,23,8,2,9,184,3]))),_x=$(()=>U(()=>import("./PreferencesPage-dS3UZdky.js"),__vite__mapDeps([185,1,27,64,14,186,2,187,3]))),Sx=$(()=>U(()=>import("./CloudAccountsPage-DPshLun0.js").then(e=>e.C),__vite__mapDeps([188,1,189,2,83,61,64,14,27,44,45,46,190,191,192,58,10,187,62,87,42,193,16,17,50,127,145]))),kx=$(()=>U(()=>import("./GcpOAuthCallback-B5cWBK1Z.js"),__vite__mapDeps([194,1,2,191,46,192,189,58,3]))),Ex=$(()=>U(()=>import("./OrganizationPage-CjNW1qoU.js"),__vite__mapDeps([195,1,46,27,196,93,14,44,45,186,2,197,10,53,198,199,61,189,200,201,66,83,202,50,3]))),Rx=$(()=>U(()=>import("./UnitMetricsPage-CmklXOM_.js").then(e=>e.U),__vite__mapDeps([109,1,23,8,2,9,27,14,60,11,12,13,76,53,10,16,17,80]))),jx=$(()=>U(()=>import("./BillingPage-B1Fjy_v5.js"),__vite__mapDeps([203,1,27,44,45,46,58,2,10,93,14,184,3]))),Cx=$(()=>U(()=>import("./PolicyPage-CGGBhe0h.js").then(e=>e.P),__vite__mapDeps([204,1,15,23,8,2,9,205,128,58,61,64,14,196,53,44,45,46,10,132,130,80,193,181,42]))),Nx=$(()=>U(()=>import("./SetupPage-CrgYD7pG.js"),__vite__mapDeps([206,1,188,189,2,83,61,64,14,27,44,45,46,190,191,192,58,10,187,62,87,42,193,16,17,50,127,145,3]))),Ox=$(()=>U(()=>import("./TeamsPage-MqI8dBW_.js"),__vite__mapDeps([207,1,23,8,2,9,10,14,64,53,198,199,61,16,17,50,83,84,208,200,201,66,189,3]))),Tx=$(()=>U(()=>import("./TeamDetailPage-Bb6zqHpC.js"),__vite__mapDeps([209,1,23,8,2,9,10,14,93,83,84,31,104,81,106,63,64,65,66,67,62,94,50,208,200,199,201,189,80,202,30,111,112,3]))),Mx=$(()=>U(()=>import("./RolesPage-DLtSLXed.js"),__vite__mapDeps([210,1,10,14,42,64,53,198,199,61,50,118,2,201,66,80,3]))),Lx=$(()=>U(()=>import("./DeveloperSettingsPage-DbdKEXwL.js"),__vite__mapDeps([211,1,46,44,45,58,2,14,12,13,64,53,9,212,27,87,197,97,69,10,3]))),Px=$(()=>U(()=>import("./OAuthConsentPage-Ca1BVOG-.js").then(e=>e.a),__vite__mapDeps([212,1,2,27,64,14,87]))),Dx=$(()=>U(()=>import("./IntegrationsPage-DItvyBuk.js"),__vite__mapDeps([213,1,196,44,45,46,193,24,80,2,190,122,129,128,205,118,14,58,53,121,120,3]))),Ix=$(()=>U(()=>import("./GitHubAppCallbackPage-C3ba1YRl.js"),__vite__mapDeps([214,1,2,27,3]))),Fx=$(()=>U(()=>import("./AutoscalerPage-DMXwxAY-.js"),__vite__mapDeps([215,1,61,64,14,49,10,44,45,46,88,89,23,8,2,9,193,216,31,217,42,80,16,17,50,3]))),zx=$(()=>U(()=>import("./ManageIAMPage-BJtnpFva.js"),__vite__mapDeps([218,1,14,58,2,108,42,87,199,189,83,192,46,3]))),Ux=$(()=>U(()=>import("./EventReadinessPage-D62bt_1-.js"),__vite__mapDeps([219,1,61,64,14,49,10,44,45,46,2,216,9,31,12,13,16,17,50,3]))),Bx=$(()=>U(()=>import("./LegacyRecommendationsRedirect-D-YokeJu.js"),__vite__mapDeps([220,1,35,2,40,20,41,3]))),$x=$(()=>U(()=>import("./AiGatewayPage-Cfa41xR7.js"),__vite__mapDeps([221,1,23,8,2,9,117,14,108,42,25,118,119,120,27,121,122,10,58,53,24,87,60,76,69,46,3]))),Vx=$(()=>U(()=>import("./InferenceKeysPage-DsYg0ySi.js"),__vite__mapDeps([222,1,23,8,2,9,14,58,44,45,46,64,53,24,118,61,87,122,119,80,3]))),qx=$(()=>U(()=>import("./CostFlowPage-Dbq9FyLN.js"),__vite__mapDeps([223,1,23,8,2,9,98,12,13,11,64,14,76,43,67,20,3]))),Wx=$(()=>U(()=>import("./GovernancePage-DgV45SFn.js"),__vite__mapDeps([224,1,23,8,2,9,14,54,53,225,226,64,227,196,3]))),Gx=$(()=>U(()=>import("./RepositoryDetailPage-CEV-Y2-P.js"),__vite__mapDeps([228,1,14,53,20,225,2,226,229,3]))),Kx=$(()=>U(()=>import("./ValidationRunPage-BvpG1YMO.js"),__vite__mapDeps([230,1,14,54,93,225,2,226,229,3])));function Bt({to:e}){const{search:t,hash:s}=qe();return r.jsx(te,{to:`${e}${t??""}${s??""}`,replace:!0})}function Hx(){return _i()?r.jsx(yd,{}):r.jsx(Rd,{})}function Zx(){const e=Yt(s=>s.theme);rd();const t=ve();return r.jsxs(ml,{basename:cd(),children:[r.jsx(_y,{}),r.jsx(Sy,{}),r.jsxs(iu,{children:[r.jsx(Lu,{position:"top-right",richColors:!0,closeButton:!0,theme:e}),r.jsx(Ay,{}),r.jsx(m.Suspense,{fallback:r.jsx("div",{className:"flex items-center justify-center h-dvh",children:r.jsx(Lt,{className:"w-8 h-8"})}),children:r.jsxs(gl,{children:[t&&r.jsx(k,{path:"/",element:r.jsx(Hx,{})}),t&&r.jsx(k,{path:"/verify/:token",element:r.jsx(On,{})}),t&&r.jsx(k,{path:"/verify",element:r.jsx(On,{})}),r.jsxs(k,{element:r.jsx(wy,{}),children:[r.jsx(k,{path:"/login",element:r.jsx(Yc,{})}),r.jsx(k,{path:"/login/email",element:r.jsx(Wy,{})}),r.jsx(k,{path:"/signup",element:r.jsx(Jy,{})}),r.jsx(k,{path:"/verify-email",element:r.jsx(t1,{})}),r.jsx(k,{path:"/forgot-password",element:r.jsx(a1,{})})]}),r.jsx(k,{path:"/signin",element:r.jsx(Vy,{})}),r.jsx(k,{element:r.jsx(E1,{}),children:r.jsx(k,{path:"/products",element:r.jsx(N1,{})})}),r.jsx(k,{path:"/auth/callback/github",element:r.jsx(i1,{})}),r.jsx(k,{path:"/auth/callback/google",element:r.jsx(l1,{})}),r.jsx(k,{path:"/auth/saml/callback",element:r.jsx(Ba,{})}),r.jsx(k,{path:"/api/saml/callback",element:r.jsx(Ba,{})}),r.jsxs(k,{element:r.jsx(by,{}),children:[r.jsx(k,{path:"/onboarding",element:r.jsx(S1,{})}),r.jsx(k,{path:"/oauth/consent",element:r.jsx(Px,{})})]}),r.jsxs(k,{element:r.jsx(Da,{}),children:[r.jsx(k,{path:"/setup",element:r.jsx(Nx,{})}),r.jsx(k,{path:"/integrations/github/callback",element:r.jsx(Ix,{})})]}),r.jsx(k,{element:r.jsx(Da,{}),children:r.jsxs(k,{element:r.jsx(gy,{}),children:[!t&&r.jsx(k,{path:"/",element:r.jsx(j1,{})}),r.jsx(k,{path:"/my-work",element:r.jsx(C1,{})}),r.jsx(k,{path:"/dashboard",element:r.jsx(Qa,{})}),r.jsx(k,{path:"/dashboard/:dashboardId",element:r.jsx(Qa,{})}),r.jsx(k,{path:"/dashboards",element:r.jsx(O1,{})}),r.jsx(k,{path:"/dashboards/create",element:r.jsx(T1,{})}),r.jsx(k,{path:"/resources",element:r.jsx(M1,{})}),r.jsx(k,{path:"/schedules",element:r.jsx(Ya,{})}),r.jsx(k,{path:"/schedules/new",element:r.jsx(Ya,{})}),r.jsx(k,{path:"/schedules/resources",element:r.jsx(te,{to:"/resources?schedulable=schedulable&view=scheduled",replace:!0})}),r.jsx(k,{path:"/schedules/:id",element:r.jsx(L1,{})}),r.jsx(k,{path:"/resource-groups",element:r.jsx(F1,{})}),r.jsx(k,{path:"/resource-groups/:id",element:r.jsx(z1,{})}),r.jsx(k,{path:"/groups",element:r.jsx(te,{to:"/resource-groups",replace:!0})}),r.jsx(k,{path:"/teams",element:r.jsx(Ox,{})}),r.jsx(k,{path:"/teams/:id",element:r.jsx(Tx,{})}),r.jsx(k,{path:"/overrides",element:r.jsx(te,{to:"/schedules?tab=overrides",replace:!0})}),r.jsx(k,{path:"/cost-reports",element:r.jsx(U1,{})}),r.jsx(k,{path:"/reports",element:r.jsx(Bt,{to:"/cost-reports"})}),r.jsx(k,{path:"/budgets",element:r.jsx(B1,{})}),r.jsx(k,{path:"/cost/flow",element:r.jsx(qx,{})}),r.jsx(k,{path:"/cost/unit-economics",element:r.jsx(Rx,{})}),r.jsx(k,{path:"/policies",element:r.jsx(Cx,{})}),r.jsx(k,{path:"/recommendations",element:r.jsx(Bx,{})}),r.jsx(k,{path:"/recommendations/cost",element:r.jsx(cr,{section:"cost"})}),r.jsx(k,{path:"/recommendations/compliance",element:r.jsx(cr,{section:"compliance"})}),r.jsx(k,{path:"/recommendations/risk",element:r.jsx(cr,{section:"risk"})}),r.jsx(k,{path:"/recommendations/advisory",element:r.jsx(cr,{section:"advisory"})}),r.jsx(k,{path:"/recommendations/lifecycle",element:r.jsx(V1,{})}),r.jsx(k,{path:"/recommendations/user-defined",element:r.jsx(cr,{view:"user-defined"})}),r.jsx(k,{path:"/architecture",element:r.jsx(W1,{})}),r.jsx(k,{path:"/architecture/canvas",element:r.jsx(q1,{})}),r.jsx(k,{path:"/kubernetes",element:r.jsx(G1,{})}),r.jsx(k,{path:"/cloud-iam/:caID",element:r.jsx(zx,{})}),r.jsxs(k,{path:"/k8s/clusters/:clusterId",element:r.jsx(K1,{}),children:[r.jsx(k,{index:!0,element:r.jsx(te,{to:"overview",replace:!0})}),r.jsx(k,{path:"overview",element:r.jsx(H1,{})}),r.jsx(k,{path:"recommendations",element:r.jsx(bx,{})}),r.jsx(k,{path:"settings",element:r.jsx(wx,{})}),r.jsx(k,{path:"pods",element:r.jsx(Z1,{})}),r.jsx(k,{path:"deployments",element:r.jsx(Q1,{})}),r.jsx(k,{path:"services",element:r.jsx(Y1,{})}),r.jsx(k,{path:"configmaps",element:r.jsx(J1,{})}),r.jsx(k,{path:"secrets",element:r.jsx(X1,{})}),r.jsx(k,{path:"jobs",element:r.jsx(ex,{})}),r.jsx(k,{path:"daemonsets",element:r.jsx(tx,{})}),r.jsx(k,{path:"statefulsets",element:r.jsx(rx,{})}),r.jsx(k,{path:"replicasets",element:r.jsx(sx,{})}),r.jsx(k,{path:"nodes",element:r.jsx(ox,{})}),r.jsx(k,{path:"events",element:r.jsx(nx,{})}),r.jsx(k,{path:"ingresses",element:r.jsx(ax,{})}),r.jsx(k,{path:"endpoints",element:r.jsx(ix,{})}),r.jsx(k,{path:"routes",element:r.jsx(cx,{})}),r.jsx(k,{path:"projects",element:r.jsx(lx,{})}),r.jsx(k,{path:"imagestreams",element:r.jsx(ux,{})}),r.jsx(k,{path:"deploymentconfigs",element:r.jsx(dx,{})}),r.jsx(k,{path:"buildconfigs",element:r.jsx(fx,{})}),r.jsx(k,{path:"networkpolicies",element:r.jsx(mx,{})}),r.jsx(k,{path:"hpa",element:r.jsx(gx,{})}),r.jsx(k,{path:"storage",element:r.jsx(px,{})}),r.jsx(k,{path:"serviceaccounts",element:r.jsx(hx,{})}),r.jsx(k,{path:"namespaces",element:r.jsx(yx,{})}),r.jsx(k,{path:"quotas",element:r.jsx(xx,{})}),r.jsx(k,{path:"crds",element:r.jsx(vx,{})})]}),r.jsx(k,{path:"/smart-tags",element:r.jsx($1,{})}),r.jsx(k,{path:"/auto-tagging",element:r.jsx(te,{to:"/smart-tags",replace:!0})}),r.jsx(k,{path:"/tag-compliance",element:r.jsx(te,{to:"/smart-tags",replace:!0})}),r.jsx(k,{path:"/history",element:r.jsx(P1,{})}),r.jsx(k,{path:"/audit-logs",element:r.jsx(D1,{})}),r.jsx(k,{path:"/alerts",element:r.jsx(I1,{})}),r.jsx(k,{path:"/notifications",element:r.jsx(Ja,{})}),r.jsx(k,{path:"/developer",element:r.jsx(Bt,{to:"/settings/api-mcp"})}),r.jsx(k,{path:"/automation/policies",element:r.jsx(Fx,{})}),r.jsx(k,{path:"/automation/events",element:r.jsx(Ux,{})}),r.jsx(k,{path:"/governance",element:r.jsx(Wx,{})}),r.jsx(k,{path:"/governance/repositories/:repoRef",element:r.jsx(Gx,{})}),r.jsx(k,{path:"/governance/validations/:runId",element:r.jsx(Kx,{})}),ri()?r.jsxs(r.Fragment,{children:[r.jsx(k,{path:"/ai-agents/spend",element:r.jsx($x,{})}),r.jsx(k,{path:"/ai-agents/keys",element:r.jsx(Vx,{})}),r.jsx(k,{path:"/ai-agents",element:r.jsx(Bt,{to:"/ai-agents/spend"})}),r.jsx(k,{path:"/ai-gateway",element:r.jsx(te,{to:"/ai-agents/spend",replace:!0})}),r.jsx(k,{path:"/ai-gateway/overview",element:r.jsx(te,{to:"/ai-agents/spend",replace:!0})}),r.jsx(k,{path:"/ai-gateway/policy",element:r.jsx(te,{to:"/policies?domain=ai",replace:!0})}),r.jsx(k,{path:"/ai-gateway/keys",element:r.jsx(te,{to:"/ai-agents/keys",replace:!0})})]}):r.jsxs(r.Fragment,{children:[r.jsx(k,{path:"/ai-gateway/policy",element:r.jsx(te,{to:"/policies",replace:!0})}),r.jsx(k,{path:"/ai-agents/*",element:r.jsx(te,{to:"/cost-reports",replace:!0})}),r.jsx(k,{path:"/ai-gateway/*",element:r.jsx(te,{to:"/cost-reports",replace:!0})}),r.jsx(k,{path:"/ai-agents",element:r.jsx(te,{to:"/cost-reports",replace:!0})}),r.jsx(k,{path:"/ai-gateway",element:r.jsx(te,{to:"/cost-reports",replace:!0})})]}),r.jsx(k,{path:"/ai-agents/estate",element:r.jsx(te,{to:"/cost-reports?tab=ai",replace:!0})}),r.jsx(k,{path:"/ai-agents/mcp",element:r.jsx(Bt,{to:"/settings/api-mcp"})}),r.jsxs(k,{path:"/settings",element:r.jsx(Ax,{}),children:[r.jsx(k,{index:!0,element:r.jsx(te,{to:"organization",replace:!0})}),r.jsx(k,{path:"organization",element:r.jsx(Ex,{})}),r.jsx(k,{path:"organisation",element:r.jsx(te,{to:"/settings/organization",replace:!0})}),r.jsx(k,{path:"cloud-accounts",element:r.jsx(Sx,{})}),r.jsx(k,{path:"cloud-accounts/gcp-callback",element:r.jsx(kx,{})}),r.jsx(k,{path:"notifications",element:r.jsx(Ja,{})}),r.jsx(k,{path:"preferences",element:r.jsx(_x,{})}),r.jsx(k,{path:"billing",element:r.jsx(jx,{})}),r.jsx(k,{path:"api-mcp",element:r.jsx(Lx,{})}),r.jsx(k,{path:"budgets",element:r.jsx(Bt,{to:"/budgets"})}),r.jsx(k,{path:"policy",element:r.jsx(Bt,{to:"/policies"})}),r.jsx(k,{path:"teams",element:r.jsx(te,{to:"/teams",replace:!0})}),r.jsx(k,{path:"unit-metrics",element:r.jsx(te,{to:"/cost/unit-economics",replace:!0})}),r.jsx(k,{path:"members",element:r.jsx(te,{to:"/settings/organization",replace:!0})}),r.jsx(k,{path:"roles",element:r.jsx(Mx,{})}),r.jsx(k,{path:"autoscaler",element:r.jsx(te,{to:"/automation/policies",replace:!0})}),r.jsx(k,{path:"integrations",element:r.jsx(Dx,{})})]})]})}),r.jsx(k,{path:"*",element:r.jsx(k1,{})})]})})]})]})}const Qx="https://ba0df3884da206ab8ab6813f8446cc5a@o4510934923083776.ingest.us.sentry.io/4511148589449216";xl({dsn:Qx,environment:"production",sendDefaultPii:!0,integrations:[vl(),bl({maskAllText:!1,maskAllInputs:!1,blockAllMedia:!1})],tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,enableLogs:!0,beforeSend(e){return(e.exception?.values?.[0]?.value||"").includes("Transition was skipped")?null:e}});Tl();const $s=localStorage.getItem("zopdev_theme"),Xc=$s==="light"||$s==="dark"?$s:window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
3k":"light";document.documentElement.setAttribute("data-theme",Xc);document.documentElement.style.colorScheme=Xc;pl.createRoot(document.getElementById("root")).render(r.jsx(m.StrictMode,{children:r.jsx(yl,{client:dr,children:r.jsx(Zx,{})})}));export{ri as $,oe as A,ge as B,fe as C,Bc as D,_0 as E,De as F,jg as G,Ug as H,hv as I,Rc as J,Go as K,$0 as L,ec as M,Ve as N,Zv as O,de as P,Q0 as Q,F0 as R,Lt as S,ld as T,s2 as U,lt as V,N2 as W,C2 as X,E2 as Y,gs as Z,U as _,Hv as a,mv as a$,Yt as a0,fv as a1,wp as a2,zp as a3,O2 as a4,T2 as a5,I2 as a6,z2 as a7,Dp as a8,Fp as a9,gm as aA,Cm as aB,km as aC,_m as aD,h2 as aE,Em as aF,Zi as aG,Vi as aH,Wi as aI,Ki as aJ,Gi as aK,Jo as aL,Wc as aM,V0 as aN,qv as aO,Wv as aP,pc as aQ,t2 as aR,_c as aS,Kc as aT,Eh as aU,p2 as aV,hc as aW,a2 as aX,Ec as aY,Ap as aZ,pv as a_,D2 as aa,F2 as ab,dv as ac,ae as ad,gv as ae,W2 as af,Z2 as ag,Q2 as ah,B2 as ai,$2 as aj,U2 as ak,hn as al,f2 as am,l2 as an,u2 as ao,vs as ap,c2 as aq,un as ar,xe as as,yr as at,ii as au,Jl as av,d2 as aw,ni as ax,i2 as ay,Qi as az,ps as b,_v as b$,q2 as b0,V2 as b1,nv as b2,G2 as b3,K2 as b4,av as b5,uv as b6,lv as b7,iv as b8,cv as b9,Th as bA,zv as bB,Lh as bC,Uh as bD,Nv as bE,Mv as bF,Cv as bG,Ev as bH,Mh as bI,jv as bJ,gr as bK,kv as bL,L2 as bM,P2 as bN,M2 as bO,yv as bP,rh as bQ,$h as bR,va as bS,xv as bT,Av as bU,bg as bV,Jm as bW,vv as bX,wv as bY,bv as bZ,Kp as b_,H2 as ba,Y2 as bb,tv as bc,rv as bd,sv as be,ev as bf,Sp as bg,J2 as bh,X2 as bi,ov as bj,R2 as bk,j2 as bl,Gp as bm,z0 as bn,Oa as bo,Pv as bp,Lv as bq,$v as br,Dh as bs,Fv as bt,Iv as bu,hh as bv,Rv as bw,Nc as bx,Bv as by,Uv as bz,W as c,Sv as c0,Ko as c1,Hp as c2,y2 as c3,tg as c4,ee as c5,Yp as c6,Pt as c7,Dv as c8,Tv as c9,Zp as cA,r2 as cB,Fc as cC,Vv as cD,g2 as cE,rp as cF,Gv as cG,Kv as cH,Js as cI,Ov as ca,x2 as cb,vg as cc,v2 as cd,b2 as ce,w2 as cf,Ag as cg,ia as ch,S2 as ci,_2 as cj,Eo as ck,_o as cl,je as cm,Ml as cn,k2 as co,Wr as cp,A2 as cq,ue as cr,og as cs,ud as ct,Wt as cu,yi as cv,m2 as cw,o2 as cx,n2 as cy,Qp as cz,Fy as d,ns as e,we as f,Ae as g,Qv as h,rs as i,At as j,yt as k,Z0 as l,q0 as m,yy as n,ve as o,Gt as p,I0 as q,$ as r,Uy as s,Y0 as t,Vo as u,er as v,Il as w,qc as x,vo as y,H as z};

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.