1import{r as I,j as e}from"./jsx-runtime-Dt5Dsy05.js";import{N as M,f as P,e as C,l as T,C as _,w as D,G}from"./index-6cgge6b1.js";import{F as u}from"./index-C63jUOGq.js";import{$ as W}from"./Button-CvYW20f_.js";import{$,a as O}from"./ListBox-D9QAid_3.js";import{$ as V}from"./Popover-C37uG8Ur.js";import{$ as R,a as K}from"./Select-LJO08_Sn.js";import{t as b}from"./bundle-mjs-D43wmME5.js";import{i as L}from"./tiny-invariant-CopsF_GD.js";import{C as q}from"./create-organization-modal-Cwo9OWT8.js";import{E as X}from"./external-organization-badge-CXZy4ePz.js";import{S as Z}from"./secondary-button-dAshlNoR.js";import{S as H}from"./secondary-nav-link-button-BMjlHqZN.js";import{G as J}from"./error-boundary-DFW-X5Hb.js";import{P as y}from"./primary-nav-link-button-DQ84tyHb.js";import{W as Q,a as Y}from"./warning-banner-qsZc_VVM.js";import{e as F}from"./utils-DD_Jjyzs.js";import{u as U}from"./root-DExJCkr-.js";import{u as ee}from"./app-BSk4WopT.js";import{u as j,j as ae,L as te}from"./components-ZktkP2zq.js";import{a as N,O as ne,u as S,e as k}from"./index-DuATMukp.js";const z=({label:a,value:n})=>e.jsxs("div",{className:"flex flex-col items-center gap-1 sm:items-start",children:[e.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase leading-[11px] tracking-[0.1em] text-[#000000d9]",children:a}),e.jsx("p",{className:"m-0 text-[18px] font-[500] leading-[28px] tracking-[-0.25px] text-[#000000d9]",children:n})]});function se({name:a,logoUrl:n,stats:r,currentPlan:s,showIncreaseSeats:t,isExternalOrganization:o,externalPlanLabel:i}){const{projects:m,files:c}=r,[f,x]=I.useState(!1);return e.jsxs("div",{className:"flex flex-col items-start justify-between space-y-5 md:flex-row md:items-center md:space-x-2 md:space-y-0",children:[e.jsxs("div",{className:"flex-1.5 flex items-center gap-[10px]",children:[e.jsx("img",{alt:"Organization logo",src:n,height:40,width:40,className:"rounded-full"}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("p",{className:"m-0 whitespace-nowrap text-[16px] font-[500] leading-[28px] tracking-[-0.25px] text-[#000000d9]",children:a}),o&&i&&e.jsx(X,{planLabel:i})]})]}),e.jsxs("div",{className:"flex w-full flex-grow flex-col items-start space-y-2 md:flex-row md:items-center md:space-x-2 md:space-y-0",children:[e.jsxs("div",{className:"flex w-full items-center justify-around rounded-md border bg-white p-2 shadow-none md:rounded-none md:border-0 md:bg-transparent md:p-0",children:[e.jsx(z,{label:"Projects",value:m}),e.jsx(z,{label:"Files",value:c})]}),!["free","enterprise","enterprise-member"].includes(s.type)&&t&&e.jsx(H,{to:"/app/subscription/update",className:"h-[32px] w-full max-w-[150px] text-inherit no-underline",children:"Increase seats"}),s.type==="enterprise-member"&&t&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{onPress:()=>x(!0),className:"h-[32px] w-full max-w-[150px] text-inherit no-underline",children:"Increase seats"}),e.jsx(q,{open:f,onClose:()=>x(!1)})]})]})]})}const re=({children:a})=>e.jsx("p",{className:"m-0 text-left text-[12px] font-normal leading-[18px] tracking-[-0.25px] text-error",children:a}),oe=({children:a})=>e.jsxs("div",{className:"flex rounded-sm bg-[#FFD8D8]",children:[e.jsx("div",{className:"w-[6px] rounded-l-md bg-error"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex items-center p-2",children:e.jsx(u,{icon:M,className:"h-[16px] w-[16px] text-error"})}),e.jsx("div",{className:"flex flex-grow flex-col space-y-2 pb-2 pr-2 pt-2",children:a})]})]}),ie={personal:"Essentials",team:"Pro",enterprise:"Enterprise"};function le(a){return ie[a]??a}function ce(a,n){const r=!a;return{isExternalOrganization:r,externalPlanLabel:r?le(n):null}}const Ie=()=>ae("routes/app.dashboard.organizations_.$id"),Me=()=>e.jsx(J,{});function B(a,n){return!a||n==="personal"?!1:a["own:organization"]?!0:a["read:organization"]&&a["update:organization"]}function E(a,n){return!a||n==="personal"?!1:a["own:organization"]?!0:a["delete:organization"]}function A({id:a,canUpdateOrgProfile:n,canDeleteOrg:r,canViewSSOManagement:s}){const t=[{text:"Collaborators",to:`/app/dashboard/organizations/${a}/collaborators-list`,icon:_}];
1return n&&t.push({text:"Profile",to:`/app/dashboard/organizations/${a}/profile`,icon:D}),r&&t.push({text:"Advanced",to:`/app/dashboard/organizations/${a}/advanced`,icon:G}),t}const xe=()=>{const a=N(),{id:n}=S();L(n);const{organization:r,permissions:s,currentPlan:t,orgFeatures:o}=j(),i=k().pathname,m=!!(o!=null&&o.archiveNotice),c=B(s,r.metadata.organizationType)&&!m,f=E(s,r.metadata.organizationType),x=(t==null?void 0:t.type)==="enterprise",h=A({id:n,canUpdateOrgProfile:c,canDeleteOrg:f,canViewSSOManagement:x});return e.jsx("div",{className:"hidden rounded-[4px] border border-gray-200 bg-white p-[20px] shadow-[0px_0px_5px_rgba(0,0,0,0.04)] md:p-[32px] lg:flex",children:e.jsx($,{"aria-label":"navigation",className:"p-1 outline-none",items:h,selectionMode:"single",selectionBehavior:"toggle",selectedKeys:[i],onAction:l=>{a(l)},children:({to:l,text:d,icon:g})=>e.jsx(O,{id:l,textValue:d,"aria-label":"navigation-item",className:"group flex cursor-default select-none items-center gap-2 rounded px-2 py-2 text-gray-900 outline-none data-[selected]:rounded",children:({isSelected:p})=>e.jsxs("div",{className:"flex items-center gap-[15px]",children:[e.jsx(u,{icon:g,className:b("h-[18px] w-[18px]",p?"text-primary":"text-[#00000080]")}),e.jsx(te,{to:l,className:"flex-1 !no-underline",children:e.jsx("span",{className:b("group-selected:font-medium flex flex-1 items-center gap-2 truncate text-[16px] font-normal capitalize",p?"text-primary":"!text-[#00000080]"),children:d})})]})},l)})})},de=()=>{const a=N(),{id:n}=S();L(n);const{organization:r,permissions:s,currentPlan:t,orgFeatures:o}=j(),i=k().pathname,m=!!(o!=null&&o.archiveNotice),c=B(s,r.metadata.organizationType)&&!m,f=E(s,r.metadata.organizationType),x=(t==null?void 0:t.type)==="enterprise",h=A({id:n,canUpdateOrgProfile:c,canDeleteOrg:f,canViewSSOManagement:x});return e.jsx("div",{className:"mb-[10px] flex sm:flex md:flex lg:hidden",children:e.jsxs(R,{className:"flex w-full flex-col gap-0.5","aria-label":"Select Navigation",defaultSelectedKey:i,onSelectionChange:l=>{a(l)},children:[e.jsxs(W,{className:"pressed:bg-opacity-100 flex cursor-default items-center rounded border border-gray-300 bg-white bg-opacity-90 px-2.5 py-2 pr-2 text-left text-base leading-normal text-gray-700 ring-white ring-offset-2 ring-offset-[#4000BF] transition focus:outline-none focus-visible:ring-2",children:[e.jsx(K,{className:"flex-1 truncate text-[14px] placeholder-shown:italic"}),e.jsx(u,{icon:T,className:"h-3 w-3"})]}),e.jsx(V,{className:"entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out max-h-60 w-[--trigger-width] overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black/5",children:e.jsx($,{className:"p-1 outline-none",items:h,children:({to:l,text:d,icon:g})=>e.jsx(O,{id:l,textValue:d,"aria-label":"navigation-item",className:"group flex cursor-default select-none items-center gap-2 rounded px-2 py-2 text-gray-900 outline-none focus:bg-gray-100 data-[selected]:rounded data-[selected]:bg-[#4000bf14] data-[selected]:hover:bg-[#4000bf0c]",children:({isSelected:p})=>e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsx(u,{icon:g,className:b("h-[18px] w-[18px]",p?"text-primary":"text-[#00000080]")}),e.jsx("span",{className:b("group-selected:font-medium flex flex-1 items-center gap-2 truncate text-[14px] font-normal capitalize",p?"text-primary":"text-[#00000080]"),children:d})]})},l)})})]})})};function Pe(){var l,d,g,p,w,v;const{currentPlan:a,organization:n,stats:r,orgFeatures:s}=j(),{currentUser:t,enterpriseMemberDetails:o}=U(),{enterpriseDetails:i}=ee(),m=N(),c=F(o==null?void 0:o.personalWorkspaceStorages),f=!!(s!=null&&s.archiveNotice),{isExternalOrganization:x,externalPlanLabel:h}=ce(n.metadata.ownerAccountId===(t==null?void 0:t.id),n.metadata.organizationType);return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"mb-6",children:[((l=s==null?void 0:s.billing)==null?void 0:l.expirationWarningMessage)&&e.jsx(Q,{children:e.jsx(Y,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[(d=s==null?void 0:s.billing)==null?void 0:d.expirationWarningMessage,(i==null?void 0:i.ownerAccountId)===(t==null?void 0:t.id)&&e.jsx(y,{className:"h-[25px] w-[100px] text-sm",to:"https://insomnia.rest/pricing/contact",children:"Contact sales"})]})})}),((g=s==null?void 0:s.billing)==null?void 0:g.expirationErrorMessage)&&e.jsx(oe,{children:e.jsx(re,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[(p=s==null?void 0:s.billing)==null?void 0:p.expirationErrorMessage,(i==null?void 0:i.ownerAccountId)===(t==null?void 0:t.id)&&e.jsx(y,{className:"h-[25px] w-[100px] text-sm",to:"https://insomnia.rest/pricing/contact",children:"Contact sales"})]})})})]}),e.jsxs("span",{className:"mb-[35px] flex w-full max-w-[150px] cursor-pointer items-center gap-[5px] space-x-1.5 text-sm font-normal leading-[28px] tracking-tighter text-[#00000080] no-underline",onClick:()=>{m("/app/dashboard/organizations")},children:[e.jsx(u,{icon:P,className:"h-4 w-4 text-[#00000080]"}),"Go Back"]}),e.jsx(se,{name:n==null?void 0:n.display_name,logoUrl:(w=n==null?void 0:n.branding)==null?void 0:w.logo_url,stats:r,currentPlan:a,showIncreaseSeats:((v=n.metadata)==null?void 0:v.ownerAccountId)===(t==null?void 0:t.id)&&!f,isExternalOrganization:x,externalPlanLabel:h}),e.jsxs("div",{className:"mt-[20px] flex min-h-[600px] flex-col space-x-0 lg:mt-[20px] lg:flex-row lg:space-x-2.5",children:[e.jsx(xe,{}),e.jsx(de,{}),e.jsxs("div",{className:"w-auto flex-1 rounded-[4px] border border-gray-200 bg-white p-[20px] shadow-[0px_0px_5px_rgba(0,0,0,0.04)] md:p-[32px]",children:[n.metadata.organizationType==="personal"&&n.metadata.ownerAccountId===(t==null?void 0:t.id)&&a.type==="enterprise-member"&&e.jsxs("div",{className:"relative mb-[16px] flex items-center gap-[10px] rounded-[2px] bg-purple-100 px-[16px] py-[18px]",children:[e.jsx("div",{className:"absolute left-0 top-0 h-full w-1 bg-purple-400"}),e.jsx(u,{icon:C,className:"h-4 w-4 text-purple-800"}),e.jsxs("div",{className:"flex flex-1 flex-col",children:[e.jsx("p",{className:"m-0 text-[14px] font-[500] leading-[20px] tracking-[-0.25px] text-purple-800",children:"This is an enterprise corporate account."}),e.jsx("p",{className:"m-0 text-[14px] font-normal leading-[20px] tracking-[-0.25px] text-purple-800",children:"As such, you may lose access to the account if you and the organization part ways."}),!!c&&e.jsxs("p",{className:"m-0 mt-2 text-[14px] font-normal leading-[20px] tracking-[-0.25px] text-purple-800",children:["The owner of this corporate account has mandated the use of"," ",e.jsx("b",{className:"lowercase",children:c})," storage for project creation within personal workspaces."]})]})]}),e.jsx(ne,{})]})]})]})}export{oe as E,Pe as M,re as a,Me as b,Ie as u}; 2//# sourceMappingURL=app.dashboard.organizations_._id-CfMRJp3y.js.map
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.