"use strict";(globalThis.webpackChunk_affine_web=globalThis.webpackChunk_affine_web||[]).push([[4153],{94153:(e,t,a)=>{a.r(t),a.d(t,{Component:()=>tw});var s=a(36870),n=a(12077),i=a(22563),o=a(21167),r=a(10980),l=a(98504),c=a(61569),d=a(33907),p=a(86326),u=a(42277),h=a(61362),g=a(63234),m=a(37272),C=a(24312),x=a(17049),b=a(70154),w=a(91218),j=a(72254),f=a(28563),v=a(34802),k=a(5863),y=a(84190),$=a(23567),T=a(82834),S=a(56607),A=a(2773),N=a(16220),I=a(16820),M=a(22943),E=a(59481);let L=()=>{let e=(0,r.h1)(E.uR),t=(0,c.S)(e.session.account$),a=(0,r.h1)(x.j).workspace;return(0,p.useEffect)(()=>{if(t&&a)return a.docCollection.awarenessStore.awareness.setLocalStateField("user",{name:t.label}),()=>{a.docCollection.awarenessStore.awareness.setLocalStateField("user",null)}},[a,t]),null},D=()=>{let e=(0,r.h1)(E.uR).session;return"authenticated"===(0,c.S)(e.status$)?(0,s.jsx)(L,{}):null},H=()=>(0,s.jsx)(D,{});var V=a(5445),_=a(77846),P=a(4285),O=a(94002),R=a(88285),B=a(64513),z=a(81527),F=a(45483),Z=a(77219),W=a(37110),q=a(91178),U=a(99685);let K=()=>{let e=(0,C.s9)();return(0,s.jsx)(U.I,{icon:F.TagIcon,message:e["com.arms.rootAppSidebar.tags.empty"](),messageTestId:"slider-bar-tags-empty-message"})},Q=()=>{let{tagService:e,explorerService:t}=(0,r.A$)({TagService:z.w6,ExplorerService:Z.F}),a=t.sections.tags,n=(0,c.S)(a.collapsed$),[i,o]=(0,p.useState)(null),l=(0,c.S)(e.tagList.tags$),d=(0,C.s9)(),u=(0,p.useCallback)(()=>{o(e.tagList.createTag(d["com.arms.rootAppSidebar.tags.new-tag"](),e.randomTagColor())),O.u4.$.navigationPanel.organize.createOrganizeItem({type:"tag"}),a.setCollapsed(!1)},[a,d,e]);return(0,p.useEffect)(()=>{n&&o(null)},[n]),(0,s.jsx)(W.i,{name:"tags",headerClassName:"rhz7lh0",title:d["com.arms.rootAppSidebar.tags"](),actions:(0,s.jsx)(g.K0,{"data-testid":"explorer-bar-add-favorite-button",onClick:u,size:"16",tooltip:d["com.arms.rootAppSidebar.explorer.tag-section-add-tooltip"](),children:(0,s.jsx)(F.PlusIcon,{})}),children:(0,s.jsx)(B._l,{placeholder:(0,s.jsx)(K,{}),children:l.map(e=>(0,s.jsx)(q.A,{tagId:e.id,reorderable:!1,location:{at:"explorer:tags:list"},defaultRenaming:i?.id===e.id},e.id))})})};var X=a(64321),G=a(86639),J=a(81427),Y=a(6503),ee=a(84064),et=a(26605),ea=a(43502);let es=({docCollection:e})=>{let t=(0,C.s9)(),{importFile:a}=(0,et.z)(e),n=(0,P.V)(async()=>{let e=await a();O.u4.$.navigationPanel.workspaceList[e.isWorkspaceFile?"createWorkspace":"createDoc"]({control:"import"})},[a]);return(0,s.jsx)(V.Dr,{icon:(0,s.jsx)(F.ImportIcon,{}),onClick:n,children:t.Import()})};var en="g4998b7",ei="g4998bb",eo="g4998bc",er="var(--g4998b0)",el="g4998b6",ec="g4998b9",ed="g4998ba",ep=a(27502),eu=a(24069);let eh=({docCollection:e})=>{let t=(0,C.s9)(),a=(0,r.h1)(ee.TR).workbench,n=(0,c.S)(a.location$),{openToday:i}=(0,eu.mM)(e),{journalDate:o,isJournal:l}=(0,eu.Bn)(e,n.pathname.split("/")[1]),d=(0,ep.A)(e=>{i((0,G.C4)(e))},[i]),p=l&&o?o.isBefore(new Date,"day")?F.YesterdayIcon:o.isAfter(new Date,"day")?F.TomorrowIcon:F.TodayIcon:F.TodayIcon;return(0,s.jsx)(V.Dr,{"data-testid":"slider-bar-journals-button",active:l,onClick:d,onAuxClick:d,icon:(0,s.jsx)(p,{}),children:t["com.arms.journal.app-sidebar-title"]()})},eg=()=>{let e=(0,C.s9)(),t=(0,r.h1)(b.F),{openConfirmModal:a}=(0,g.fl)(),n=(0,r.h1)(d.q),i=(0,c.S)(n.globalContext.isTrash.$),{dropTargetRef:o,draggedOver:l}=(0,g.Al)(()=>({data:{at:"app-sidebar:trash"},canDrop:e=>e.source.data.entity?.type==="doc",onDrop(s){if(s.source.data.entity?.type==="doc"){let n=s.source.data.entity.id,i=t.list.doc$(n).value;i&&a({title:e["com.arms.moveToTrash.confirmModal.title"](),description:e["com.arms.moveToTrash.confirmModal.description"]({title:i.title$.value||e.Untitled()}),confirmText:e.Delete(),confirmButtonOptions:{variant:"error"},onConfirm(){i.moveToTrash()}})}}}),[t.list,a,e]);return(0,s.jsx)(V.R4,{ref:o,icon:(0,s.jsx)(g.Q8,{closed:l}),active:i||l,to:"/trash",children:(0,s.jsx)("span",{"data-testid":"trash-page",children:e["com.arms.workspaceSubPath.trash"]()})})};var em=a(99971),eC=a(50822),ex=a(37064),eb=a(40971);let ew=(0,p.memo)(({width:e=20,height:t=20})=>{let a=` `;return(0,s.jsx)("div",{style:{lineHeight:0},dangerouslySetInnerHTML:{__html:a}})});ew.displayName="UnknownUserIcon";let ej=()=>{let e=(0,r.h1)(E.uR).session,t=(0,c.S)(e.account$);return t?(0,s.jsx)(ev,{account:t}):(0,s.jsx)(ek,{})},ef={className:"g4998b5"},ev=({account:e})=>(0,s.jsx)(g.W1,{items:(0,s.jsx)(eS,{}),contentOptions:ef,children:(0,s.jsx)(g.K0,{"data-testid":"sidebar-user-avatar",variant:"plain",size:"24",children:(0,s.jsx)(g.eu,{size:24,name:e.label,url:e.avatar})})}),ek=()=>{let e=(0,k.Xr)(_.W7),t=(0,p.useCallback)(()=>{e(e=>({...e,openModal:!0}))},[e]);return(0,s.jsx)(g.K0,{onClick:t,"data-testid":"sidebar-user-avatar",variant:"plain",size:"24",children:(0,s.jsx)(ew,{})})},ey=()=>{let e=(0,k.Xr)(_.JO),t=(0,k.Xr)(_.G4),a=(0,p.useCallback)(()=>{O.u4.$.navigationPanel.profileAndBadge.openSettings({to:"account"}),e(e=>({...e,open:!0,activeTab:"account"}))},[e]),n=(0,p.useCallback)(()=>{t(!0)},[t]),i=(0,C.s9)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.Dr,{preFix:(0,s.jsx)(g.ZB,{children:(0,s.jsx)(F.AccountIcon,{})}),"data-testid":"workspace-modal-account-settings-option",onClick:a,children:i["com.arms.workspace.cloud.account.settings"]()}),(0,s.jsx)(g.Dr,{preFix:(0,s.jsx)(g.ZB,{children:(0,s.jsx)(F.SignOutIcon,{})}),"data-testid":"workspace-modal-sign-out-option",onClick:n,children:i["com.arms.workspace.cloud.account.logout"]()})]})},e$=()=>{let e=(0,C.s9)(),t=(0,r.h1)(E.RK).quota,a=(0,c.S)(t.error$);(0,p.useEffect)(()=>{t.revalidate()},[t]);let n=(0,c.S)(t.color$),i=(0,c.S)(t.usedFormatted$),o=(0,c.S)(t.maxFormatted$),l=(0,c.S)(t.percent$);return null===l?a?(0,s.jsx)(g.Kw,{children:"Failed to load quota"}):(0,s.jsxs)("div",{children:[(0,s.jsx)(g.EA,{height:15,width:50}),(0,s.jsx)(g.EA,{height:10,style:{marginTop:4}})]}):(0,s.jsxs)("div",{className:(0,ex.A)(el,"g4998b8"),style:(0,eC.D)({[er]:n}),children:[(0,s.jsxs)("div",{className:ec,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:ed,children:e["com.arms.user-info.usage.cloud"]()}),(0,s.jsx)("span",{children:i}),(0,s.jsx)("span",{children:" / "}),(0,s.jsx)("span",{children:o})]}),(0,s.jsx)(eb.$,{})]}),(0,s.jsx)("div",{className:ei,children:(0,s.jsx)("div",{className:eo,style:{width:`${l}%`}})})]})},eT=()=>{let e=(0,C.s9)(),t=(0,r.h1)(E.bl),a=(0,r.h1)(E.nC);(0,p.useEffect)(()=>{a.subscription.revalidate()},[a]),(0,p.useEffect)(()=>{t.copilotQuota.revalidate()},[t]);let n=(0,c.S)(t.copilotQuota.copilotActionLimit$),i=(0,c.S)(t.copilotQuota.copilotActionUsed$),o=null===n||null===i,l=(0,c.S)(t.copilotQuota.error$),d=(0,k.Xr)(_.JO),u=(0,p.useCallback)(()=>{d({open:!0,activeTab:"plans",scrollAnchor:"aiPricingPlan"})},[d]),h=(0,p.useCallback)(()=>{d({open:!0,activeTab:"account"})},[d]);if(o)return l&&console.error(l),null;if("unlimited"===n)return(0,s.jsxs)("div",{onClick:h,"data-pro":!0,className:(0,ex.A)(el,en),children:[(0,s.jsx)("div",{className:ec,children:(0,s.jsx)("div",{className:ed,children:e["com.arms.user-info.usage.ai"]()})}),(0,s.jsx)("div",{className:ec,children:e["com.arms.payment.ai.usage-description-purchased"]()})]});let g=Math.min(100,Math.max(.5,Number((i/n*100).toFixed(4)))),m=g>80?(0,em.Vg)("errorColor"):(0,em.Vg)("processingColor");return(0,s.jsxs)("div",{onClick:u,className:(0,ex.A)(el,en),style:(0,eC.D)({[er]:m}),children:[(0,s.jsxs)("div",{className:ec,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:ed,children:e["com.arms.user-info.usage.ai"]()}),(0,s.jsx)("span",{children:i}),(0,s.jsx)("span",{children:" / "}),(0,s.jsx)("span",{children:n})]}),(0,s.jsx)("div",{className:"g4998bd",children:"Free"})]}),(0,s.jsx)("div",{className:ei,children:(0,s.jsx)("div",{className:eo,style:{width:`${g}%`}})})]})},eS=()=>{let e=(0,r.h1)(E.BB),t=(0,c.S)(e.serverConfig.features$);return(0,s.jsxs)(s.Fragment,{children:[t?.copilot?(0,s.jsx)(eT,{}):null,(0,s.jsx)(e$,{}),(0,s.jsx)(g.cG,{}),(0,s.jsx)(ey,{})]})},eA=()=>{let e=(0,r.h1)(x.j).workspace,{appSettings:t}=(0,Y.V)(),a=e.docCollection,n=(0,C.s9)(),i=(0,r.h1)(ee.TR).workbench,o=(0,c.S)(i.location$.map(e=>e.pathname)),l=(0,r.h1)(X.A),d=(0,p.useCallback)(()=>{l.toggle()},[l]),u=(0,et.z)(e.docCollection),h=(0,P.V)(async e=>{u.createPage(!(0,G.C4)(e)||"new-tab").load(),O.u4.$.navigationPanel.$.createDoc()},[u]);(0,p.useEffect)(()=>{if(environment.isDesktop)return J.AZ?.applicationMenu.onNewPageAction(()=>h())},[h]);let g=(0,k.Xr)(_.JO),m=(0,p.useCallback)(()=>{g({activeTab:"appearance",open:!0}),O.u4.$.navigationPanel.$.openSettings()},[g]);return(0,s.jsxs)(V.GK,{clientBorder:t.clientBorder,translucentUI:t.enableBlurBackground,children:[(0,s.jsxs)(V.oe,{children:[(0,s.jsxs)("div",{className:"g4998b1",children:[(0,s.jsx)("div",{className:"g4998b4",children:(0,s.jsx)(ea.h,{})}),(0,s.jsx)(ej,{})]}),(0,s.jsxs)("div",{className:"g4998b2",children:[(0,s.jsx)(V.qs,{className:"g4998b3","data-testid":"slider-bar-quick-search-button","data-event-props":"$.navigationPanel.$.quickSearch",onClick:d}),(0,s.jsx)(V.lB,{onClick:h})]}),(0,s.jsx)(V.R4,{icon:(0,s.jsx)(F.AllDocsIcon,{}),active:"/all"===o,to:"/all",children:(0,s.jsx)("span",{"data-testid":"all-pages",children:n["com.arms.workspaceSubPath.all"]()})}),(0,s.jsx)(eh,{docCollection:e.docCollection}),(0,s.jsx)(V.Dr,{"data-testid":"slider-bar-workspace-setting-button",icon:(0,s.jsx)(F.SettingsIcon,{}),onClick:m,children:(0,s.jsx)("span",{"data-testid":"settings-modal-trigger",children:n["com.arms.settingSidebar.title"]()})})]}),(0,s.jsxs)(V.Ri,{children:[(0,s.jsx)(R.TW,{}),(0,s.jsx)(R.pv,{}),(0,s.jsx)(R.H6,{}),(0,s.jsx)(R.t1,{}),(0,s.jsx)(Q,{}),(0,s.jsx)(V.yz,{label:n["com.arms.rootAppSidebar.others"]()}),(0,s.jsxs)("div",{style:{padding:"0 8px"},children:[(0,s.jsx)(eg,{}),(0,s.jsx)(es,{docCollection:a})]})]})]})};eA.displayName="memo(RootAppSidebar)";var eN=a(8158),eI=a(55683),eM=a(77562),eE=a(69628),eL=a(93965);let eD=e=>(0,s.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor",d:"M3.20837 10.7372C3.20837 6.71015 6.47296 3.44556 10.5 3.44556C12.3672 3.44556 14.0717 4.14815 15.3613 5.30239L15.3633 5.30417L16.5417 6.36801V4.07056C16.5417 3.72538 16.8215 3.44556 17.1667 3.44556C17.5119 3.44556 17.7917 3.72538 17.7917 4.07056V7.77426C17.7917 8.11944 17.5119 8.39926 17.1667 8.39926H13.463C13.1178 8.39926 12.838 8.11944 12.838 7.77426C12.838 7.42908 13.1178 7.14926 13.463 7.14926H15.5417L14.5277 6.23381C14.5273 6.23351 14.527 6.23321 14.5267 6.23291C13.4575 5.2764 12.0473 4.69556 10.5 4.69556C7.16332 4.69556 4.45837 7.4005 4.45837 10.7372C4.45837 14.0739 7.16332 16.7789 10.5 16.7789C13.3745 16.7789 15.7815 14.7708 16.392 12.0804C16.4684 11.7438 16.8032 11.5328 17.1398 11.6092C17.4764 11.6856 17.6874 12.0204 17.611 12.357C16.8742 15.6043 13.971 18.0289 10.5 18.0289C6.47296 18.0289 3.20837 14.7643 3.20837 10.7372Z"})}),eH=e=>(0,s.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor",d:"M9.99962 4.57817C8.29319 3.01965 5.71364 2.60583 3.71072 4.31175C1.58022 6.12634 1.27156 9.1804 2.95519 11.34C3.60283 12.1708 4.87307 13.4256 6.10152 14.5814C7.34198 15.7486 8.57984 16.8517 9.1904 17.3907L9.20124 17.4003C9.25961 17.4519 9.32753 17.5118 9.3919 17.5602C9.46767 17.617 9.57193 17.6842 9.70946 17.7251C9.89501 17.7803 10.0946 17.7803 10.2802 17.7251C10.4177 17.6842 10.522 17.617 10.5977 17.5602C10.6621 17.5118 10.73 17.4519 10.7884 17.4003L10.7992 17.3907C11.4098 16.8517 12.6477 15.7486 13.8881 14.5814C15.1166 13.4256 16.3868 12.1708 17.0344 11.34C18.7125 9.18752 18.4501 6.11052 16.2724 4.30628C14.2452 2.62668 11.7026 3.01918 9.99962 4.57817ZM10.8772 5.46815L12.1086 6.69955C12.2506 6.84161 12.3157 7.0433 12.2836 7.24161C12.2514 7.43991 12.1258 7.61066 11.9461 7.70051L9.38839 8.97938L11.2752 10.8662C11.5193 11.1103 11.5193 11.506 11.2752 11.7501C11.0312 11.9942 10.6354 11.9942 10.3913 11.7501L7.89135 9.2501C7.74929 9.10804 7.68418 8.90635 7.71636 8.70804C7.74854 8.50974 7.87409 8.33899 8.05378 8.24914L10.6115 6.97027L9.55801 5.91677C9.54678 5.90554 9.53598 5.89388 9.52564 5.88183C8.19717 4.33364 6.07983 3.93588 4.52123 5.26337C2.89416 6.64918 2.67381 8.94603 3.94102 10.5715C4.5201 11.3143 5.71945 12.5056 6.95809 13.6711C8.16952 14.8109 9.38104 15.8914 9.99482 16.4335C10.6086 15.8914 11.8201 14.8109 13.0315 13.6711C14.2702 12.5056 15.4695 11.3143 16.0486 10.5715C17.3214 8.93892 17.1194 6.63133 15.4749 5.26884C14.0321 4.07341 12.1948 4.27909 10.8772 5.46815Z"})}),eV=function(){let[e,t]=(0,p.useState)(null),a=(0,r.h1)(x.j).workspace,n=(0,c.S)(a.upgrade.upgrading$),i=(0,C.s9)(),{openPage:o}=(0,eE.P)(),l=(0,P.V)(async()=>{if(!n){O.u4.workspace.$.$.upgradeWorkspace();try{let e=await a.upgrade.upgrade();e?o(e.id,eL.Tk.ALL):location.reload()}catch(e){t(e instanceof Error?e.message:""+e)}}},[n,a.upgrade,o]);return(0,s.jsx)("div",{className:"_13axd4m0",children:(0,s.jsxs)("div",{className:"_13axd4m1",children:[(0,s.jsx)(eM.Ee,{width:180,height:180}),(0,s.jsx)("p",{className:"_13axd4m2",children:e||i["com.arms.upgrade.tips.normal"]()}),(0,s.jsx)(eI.$n,{"data-testid":"upgrade-workspace-button",onClick:l,size:"extraLarge",loading:n,prefix:e?(0,s.jsx)(eH,{}):(0,s.jsx)(eD,{}),variant:e?"error":"secondary",children:e?i["com.arms.upgrade.button-text.error"]():n?i["com.arms.upgrade.button-text.upgrading"]():i["com.arms.upgrade.button-text.pending"]()})]})})};var e_=a(23110),eP=a(74255),eO=a(29007),eR=a(33926),eB=a(53653),ez=a(40274),eF=a(95284),eZ=a(82377);class eW extends eF.k{constructor(){super(),this.tabsStatus$=v.D.from(new eZ.c(e=>{let t;return J.Ok?.ui.getTabsStatus().then(a=>{e.next(a),t=J.AZ?.ui.onTabsStatusChange(t=>{e.next(t)})}).catch(console.error),()=>{t?.()}}),[]),this.showContextMenu=J.Ok?.ui.showTabContextMenu,this.activateView=J.Ok?.ui.activateView,this.closeTab=J.Ok?.ui.closeTab,this.onAddTab=J.Ok?.ui.addTab,this.onAddDocTab=async(e,t,a)=>{await J.Ok?.ui.addTab({view:{path:{pathname:"/"+e}},target:t,edge:a})},this.onAddTagTab=async(e,t,a)=>{await J.Ok?.ui.addTab({view:{path:{pathname:"/tag/"+e}},target:t,edge:a})},this.onAddCollectionTab=async(e,t,a)=>{await J.Ok?.ui.addTab({view:{path:{pathname:"/collection/"+e}},target:t,edge:a})},this.onToggleRightSidebar=J.Ok?.ui.toggleRightSidebar,this.moveTab=J.Ok?.ui.moveTab}}var eq=a(96644),eU=a(17597),eK=a(8790),eQ=a(28138),eX=a(10448);let eG=new eZ.c(e=>(e.next(!1),J.AZ)?J.AZ.ui.onMaximized(t=>{e.next(t)}):()=>{}),eJ=new eZ.c(e=>(e.next(!1),J.AZ)?J.AZ.ui.onFullScreen(t=>{e.next(t)}):()=>{}),eY=(0,eU.zx)(()=>(0,eK.z)([eG,eJ]).pipe((0,eQ.T)(([e,t])=>e||t))),e0=(0,s.jsx)("svg",{width:"10",height:"1",viewBox:"0 0 10 1",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M0.498047 1C0.429688 1 0.364583 0.986979 0.302734 0.960938C0.244141 0.934896 0.192057 0.899089 0.146484 0.853516C0.100911 0.807943 0.0651042 0.755859 0.0390625 0.697266C0.0130208 0.635417 0 0.570312 0 0.501953C0 0.433594 0.0130208 0.370117 0.0390625 0.311523C0.0651042 0.249674 0.100911 0.195964 0.146484 0.150391C0.192057 0.101562 0.244141 0.0641276 0.302734 0.0380859C0.364583 0.0120443 0.429688 -0.000976562 0.498047 -0.000976562H9.50195C9.57031 -0.000976562 9.63379 0.0120443 9.69238 0.0380859C9.75423 0.0641276 9.80794 0.101562 9.85352 0.150391C9.89909 0.195964 9.9349 0.249674 9.96094 0.311523C9.98698 0.370117 10 0.433594 10 0.501953C10 0.570312 9.98698 0.635417 9.96094 0.697266C9.9349 0.755859 9.89909 0.807943 9.85352 0.853516C9.80794 0.899089 9.75423 0.934896 9.69238 0.960938C9.63379 0.986979 9.57031 1 9.50195 1H0.498047Z",fill:"currentColor"})}),e1=(0,s.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 5.70801L0.854492 9.85352C0.756836 9.95117 0.639648 10 0.50293 10C0.359701 10 0.239258 9.9528 0.141602 9.8584C0.0472005 9.76074 0 9.6403 0 9.49707C0 9.36035 0.0488281 9.24316 0.146484 9.14551L4.29199 5L0.146484 0.854492C0.0488281 0.756836 0 0.638021 0 0.498047C0 0.429688 0.0130208 0.364583 0.0390625 0.302734C0.0651042 0.240885 0.100911 0.188802 0.146484 0.146484C0.192057 0.100911 0.245768 0.0651042 0.307617 0.0390625C0.369466 0.0130208 0.43457 0 0.50293 0C0.639648 0 0.756836 0.0488281 0.854492 0.146484L5 4.29199L9.14551 0.146484C9.24316 0.0488281 9.36198 0 9.50195 0C9.57031 0 9.63379 0.0130208 9.69238 0.0390625C9.75423 0.0651042 9.80794 0.100911 9.85352 0.146484C9.89909 0.192057 9.9349 0.245768 9.96094 0.307617C9.98698 0.366211 10 0.429688 10 0.498047C10 0.638021 9.95117 0.756836 9.85352 0.854492L5.70801 5L9.85352 9.14551C9.95117 9.24316 10 9.36035 10 9.49707C10 9.56543 9.98698 9.63053 9.96094 9.69238C9.9349 9.75423 9.89909 9.80794 9.85352 9.85352C9.8112 9.89909 9.75911 9.9349 9.69727 9.96094C9.63542 9.98698 9.57031 10 9.50195 10C9.36198 10 9.24316 9.95117 9.14551 9.85352L5 5.70801Z",fill:"currentColor"})}),e9=(0,s.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M1.47461 10C1.2793 10 1.09212 9.96094 0.913086 9.88281C0.734049 9.80143 0.576172 9.69401 0.439453 9.56055C0.30599 9.42383 0.198568 9.26595 0.117188 9.08691C0.0390625 8.90788 0 8.7207 0 8.52539V1.47461C0 1.2793 0.0390625 1.09212 0.117188 0.913086C0.198568 0.734049 0.30599 0.577799 0.439453 0.444336C0.576172 0.307617 0.734049 0.200195 0.913086 0.12207C1.09212 0.0406901 1.2793 0 1.47461 0H8.52539C8.7207 0 8.90788 0.0406901 9.08691 0.12207C9.26595 0.200195 9.4222 0.307617 9.55566 0.444336C9.69238 0.577799 9.7998 0.734049 9.87793 0.913086C9.95931 1.09212 10 1.2793 10 1.47461V8.52539C10 8.7207 9.95931 8.90788 9.87793 9.08691C9.7998 9.26595 9.69238 9.42383 9.55566 9.56055C9.4222 9.69401 9.26595 9.80143 9.08691 9.88281C8.90788 9.96094 8.7207 10 8.52539 10H1.47461ZM8.50098 8.99902C8.56934 8.99902 8.63281 8.986 8.69141 8.95996C8.75326 8.93392 8.80697 8.89811 8.85254 8.85254C8.89811 8.80697 8.93392 8.75488 8.95996 8.69629C8.986 8.63444 8.99902 8.56934 8.99902 8.50098V1.49902C8.99902 1.43066 8.986 1.36719 8.95996 1.30859C8.93392 1.24674 8.89811 1.19303 8.85254 1.14746C8.80697 1.10189 8.75326 1.06608 8.69141 1.04004C8.63281 1.014 8.56934 1.00098 8.50098 1.00098H1.49902C1.43066 1.00098 1.36556 1.014 1.30371 1.04004C1.24512 1.06608 1.19303 1.10189 1.14746 1.14746C1.10189 1.19303 1.06608 1.24674 1.04004 1.30859C1.014 1.36719 1.00098 1.43066 1.00098 1.49902V8.50098C1.00098 8.56934 1.014 8.63444 1.04004 8.69629C1.06608 8.75488 1.10189 8.80697 1.14746 8.85254C1.19303 8.89811 1.24512 8.93392 1.30371 8.95996C1.36556 8.986 1.43066 8.99902 1.49902 8.99902H8.50098Z",fill:"currentColor"})}),e8=(0,s.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8.99902 2.96387C8.99902 2.69368 8.94531 2.43978 8.83789 2.20215C8.73047 1.96126 8.58398 1.75293 8.39844 1.57715C8.21615 1.39811 8.00293 1.25814 7.75879 1.15723C7.5179 1.05306 7.264 1.00098 6.99707 1.00098H2.08496C2.13704 0.851237 2.21029 0.714518 2.30469 0.59082C2.39909 0.467122 2.50814 0.361328 2.63184 0.273438C2.75553 0.185547 2.89062 0.118815 3.03711 0.0732422C3.18685 0.0244141 3.34147 0 3.50098 0H6.99707C7.41048 0 7.79948 0.0797526 8.16406 0.239258C8.52865 0.395508 8.84603 0.608724 9.11621 0.878906C9.38965 1.14909 9.60449 1.46647 9.76074 1.83105C9.92025 2.19564 10 2.58464 10 2.99805V6.49902C10 6.65853 9.97559 6.81315 9.92676 6.96289C9.88118 7.10938 9.81445 7.24447 9.72656 7.36816C9.63867 7.49186 9.53288 7.60091 9.40918 7.69531C9.28548 7.78971 9.14876 7.86296 8.99902 7.91504V2.96387ZM1.47461 10C1.2793 10 1.09212 9.96094 0.913086 9.88281C0.734049 9.80143 0.576172 9.69401 0.439453 9.56055C0.30599 9.42383 0.198568 9.26595 0.117188 9.08691C0.0390625 8.90788 0 8.7207 0 8.52539V3.47656C0 3.27799 0.0390625 3.09082 0.117188 2.91504C0.198568 2.736 0.30599 2.57975 0.439453 2.44629C0.576172 2.30957 0.732422 2.20215 0.908203 2.12402C1.08724 2.04264 1.27604 2.00195 1.47461 2.00195H6.52344C6.72201 2.00195 6.91081 2.04264 7.08984 2.12402C7.26888 2.20215 7.42513 2.30794 7.55859 2.44141C7.69206 2.57487 7.79785 2.73112 7.87598 2.91016C7.95736 3.08919 7.99805 3.27799 7.99805 3.47656V8.52539C7.99805 8.72396 7.95736 8.91276 7.87598 9.0918C7.79785 9.26758 7.69043 9.42383 7.55371 9.56055C7.42025 9.69401 7.264 9.80143 7.08496 9.88281C6.90918 9.96094 6.72201 10 6.52344 10H1.47461ZM6.49902 8.99902C6.56738 8.99902 6.63086 8.986 6.68945 8.95996C6.7513 8.93392 6.80501 8.89811 6.85059 8.85254C6.89941 8.80697 6.93685 8.75488 6.96289 8.69629C6.98893 8.63444 7.00195 8.56934 7.00195 8.50098V3.50098C7.00195 3.43262 6.98893 3.36751 6.96289 3.30566C6.93685 3.24382 6.90104 3.1901 6.85547 3.14453C6.8099 3.09896 6.75619 3.06315 6.69434 3.03711C6.63249 3.01107 6.56738 2.99805 6.49902 2.99805H1.49902C1.43066 2.99805 1.36556 3.01107 1.30371 3.03711C1.24512 3.06315 1.19303 3.10059 1.14746 3.14941C1.10189 3.19499 1.06608 3.2487 1.04004 3.31055C1.014 3.36914 1.00098 3.43262 1.00098 3.50098V8.50098C1.00098 8.56934 1.014 8.63444 1.04004 8.69629C1.06608 8.75488 1.10189 8.80697 1.14746 8.85254C1.19303 8.89811 1.24512 8.93392 1.30371 8.95996C1.36556 8.986 1.43066 8.99902 1.49902 8.99902H6.49902Z",fill:"currentColor"})}),e4=()=>{let e=(0,p.useCallback)(()=>{J.Ok?.ui.handleMinimizeApp().catch(e=>{console.error(e)})},[]),t=(0,p.useCallback)(()=>{J.Ok?.ui.handleMaximizeApp().catch(e=>{console.error(e)})},[]),a=(0,p.useCallback)(()=>{J.Ok?.ui.handleCloseApp().catch(e=>{console.error(e)})},[]),n=(0,k.md)(eY);return(0,s.jsxs)("div",{"data-platform-target":"win32",className:eX.$r,children:[(0,s.jsx)("button",{"data-type":"minimize",className:eX.t8,onClick:e,children:e0}),(0,s.jsx)("button",{"data-type":"maximize",className:eX.t8,onClick:t,children:n?e8:e9}),(0,s.jsx)("button",{"data-type":"close",className:eX.t8,onClick:a,children:e1})]})};var e2=a(3374);let e6={allDocs:(0,s.jsx)(F.AllDocsIcon,{}),collection:(0,s.jsx)(F.ViewLayersIcon,{}),doc:(0,s.jsx)(F.PageIcon,{}),page:(0,s.jsx)(F.PageIcon,{}),edgeless:(0,s.jsx)(F.EdgelessIcon,{}),journal:(0,s.jsx)(F.TodayIcon,{}),tag:(0,s.jsx)(F.TagIcon,{}),trash:(0,s.jsx)(F.DeleteIcon,{})};var e3=a(59545);let e5=["collection","tag","doc"],e7=e=>t=>!!(t.source.data.from?.at==="app-header:tabs"&&t.source.data.from.tabId!==e?.id||t.source.data.entity?.type&&e5.includes(t.source.data.entity?.type)),te=({workbench:e,active:t,tabsLength:a,dnd:n,onDrop:i})=>{(0,r.Dq)(e3.g);let o=(0,r.h1)(eW),l=e.activeViewIndex??0,c=(0,P.V)(async t=>{let a=await o.showContextMenu?.(e.id,t);switch(a?.type){case"open-in-split-view":O.u4.$.appTabsHeader.$.tabAction({control:"contextMenu",action:"openInSplitView"});break;case"separate-view":O.u4.$.appTabsHeader.$.tabAction({control:"contextMenu",action:"separateTabs"});break;case"pin-tab":a.payload.shouldPin?O.u4.$.appTabsHeader.$.tabAction({control:"contextMenu",action:"pin"}):O.u4.$.appTabsHeader.$.tabAction({control:"contextMenu",action:"unpin"});break;case"close-tab":O.u4.$.appTabsHeader.$.tabAction({control:"contextMenu",action:"close"})}},[o,e.id]),d=(0,P.V)(async a=>{await o.activateView?.(e.id,a),t?O.u4.$.appTabsHeader.$.tabAction({control:"click",action:"switchSplitView"}):O.u4.$.appTabsHeader.$.tabAction({control:"click",action:"switchTab"})},[t,o,e.id]),u=(0,ep.A)(async t=>{1===t.button&&(await o.closeTab?.(e.id),O.u4.$.appTabsHeader.$.tabAction({control:"midClick",action:"close"}))},[o,e.id]),h=(0,ep.A)(async()=>{await o.closeTab?.(e.id),O.u4.$.appTabsHeader.$.tabAction({control:"xButton",action:"close"})},[o,e.id]),{dropTargetRef:m,closestEdge:C}=(0,g.Al)(()=>({closestEdge:{allowedEdges:["left","right"]},onDrop:i,dropEffect:"move",canDrop:e7(e),isSticky:!0}),[i,e]),{dragRef:x}=(0,g.PM)(()=>({canDrag:n,data:{from:{at:"app-header:tabs",tabId:e.id}},dragPreviewPosition:"pointer-outside"}),[n,e.id]);return(0,s.jsxs)("div",{className:"_1wmnsti5",ref:e=>{m.current=e,x.current=e},children:[(0,s.jsxs)("div",{"data-testid":"workbench-tab","data-active":t,"data-pinned":e.pinned,"data-padding-right":a>1&&!e.pinned,className:"_1wmnsti6",children:[e.views.map((a,n)=>(0,s.jsxs)(p.Fragment,{children:[(0,s.jsxs)("button",{"data-testid":"split-view-label",className:"_1wmnsti7","data-active":l===n&&t,onContextMenu:()=>{c(n)},onAuxClick:u,onClick:e=>{e.stopPropagation(),d(n)},children:[(0,s.jsx)("div",{className:"_1wmnstia _1wmnsti9",children:e.ready||!e.loaded?e6[a.iconName??"allDocs"]:(0,s.jsx)(g.Rh,{})}),e.pinned||!a.title?null:(0,s.jsx)("div",{title:a.title,className:"_1wmnsti8",children:a.title})]},a.id),n!==e.views.length-1?(0,s.jsx)("div",{className:"_1wmnsti4"}):null]},a.id)),e.pinned?null:(0,s.jsx)("div",{className:"_1wmnstib",children:a>1?(0,s.jsx)("button",{"data-testid":"close-tab-button",className:"_1wmnstic _1wmnsti9",onClick:h,children:(0,s.jsx)(F.CloseIcon,{})}):null})]},e.id),(0,s.jsx)("div",{className:"_1wmnstie","data-edge":C})]})},tt=()=>{let[e,t]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{J.Ok?.ui.isFullScreen().then(t).then(()=>{J.AZ?.ui.onFullScreen(t)}).catch(console.error)},[]),e},ta=({style:e,mode:t="app",className:a,left:n})=>{let i=(0,C.s9)(),o=(0,k.md)(eq.j5),l=(0,k.md)(V.iG),d=(0,k.md)(V.oq),u=environment.isDesktop&&environment.isMacOs,h=tt(),m=(0,r.h1)(eW),x=(0,c.S)(m.tabsStatus$),[b,w]=(0,e2.A)(x,e=>e.pinned),j=(0,P.V)(async()=>{await m.onAddTab?.(),O.u4.$.appTabsHeader.$.tabAction({control:"click",action:"openInNewTab"})},[m]),f=(0,P.V)(async()=>{await m.onToggleRightSidebar?.()},[m]);(0,p.useEffect)(()=>{"app"===t&&J.Ok?.ui.pingAppLayoutReady().catch(console.error)},[t]);let v=(0,P.V)(async(e,t)=>{let a=e.closestEdge??"right";if((t=t??x.at(-1)?.id)&&"top"!==a&&"bottom"!==a){if(e.source.data.from?.at==="app-header:tabs"){if(t===e.source.data.from.tabId)return;return O.u4.$.appTabsHeader.$.tabAction({control:"dnd",action:"moveTab"}),await m.moveTab?.(e.source.data.from.tabId,t,a)}return e.source.data.entity?.type==="doc"?(O.u4.$.appTabsHeader.$.tabAction({control:"dnd",action:"openInNewTab",type:"doc"}),await m.onAddDocTab?.(e.source.data.entity.id,t,a)):e.source.data.entity?.type==="tag"?(O.u4.$.appTabsHeader.$.tabAction({type:"tag",control:"dnd",action:"openInNewTab"}),await m.onAddTagTab?.(e.source.data.entity.id,t,a)):e.source.data.entity?.type==="collection"?(O.u4.$.appTabsHeader.$.tabAction({type:"collection",control:"dnd",action:"openInNewTab"}),await m.onAddCollectionTab?.(e.source.data.entity.id,t,a)):void 0}},[x,m]),{dropTargetRef:y,draggedOver:$}=(0,g.Al)(()=>({onDrop:v,dropEffect:"move",canDrop:e7()}),[v]),T=u&&!h?70:0;return(0,s.jsxs)("div",{className:(0,ex.A)("_1wmnsti0",a),style:e,"data-mode":t,"data-is-windows":environment.isDesktop&&environment.isWindows,children:[(0,s.jsx)("div",{style:{transition:d?"none":void 0,paddingLeft:12+T,width:l?o:120+T,marginRight:l?-16:0},className:"_1wmnsti1",children:n}),(0,s.jsxs)("div",{className:"_1wmnsti2",children:[b.map(e=>(0,s.jsx)(te,{dnd:"app"===t,tabsLength:b.length,workbench:e,onDrop:t=>v(t,e.id),active:e.active},e.id)),b.length>0&&w.length>0&&(0,s.jsx)("div",{className:"_1wmnsti3"}),w.map(e=>(0,s.jsx)(te,{dnd:"app"===t,tabsLength:x.length,workbench:e,onDrop:t=>v(t,e.id),active:e.active},e.id))]}),(0,s.jsx)("div",{className:"_1wmnstid",ref:y,"data-dragged-over":$,children:(0,s.jsx)(g.K0,{size:22.86,onClick:j,tooltip:i["com.arms.multi-tab.new-tab"](),tooltipShortcut:["$mod","T"],"data-testid":"add-tab-view-button",style:{width:32,height:32},icon:(0,s.jsx)(F.PlusIcon,{})})}),(0,s.jsx)(g.K0,{size:"24",onClick:f,children:(0,s.jsx)(F.RightSidebarIcon,{})}),environment.isDesktop&&environment.isWindows?(0,s.jsx)(e4,{}):null]})};var ts=a(55883),tn=a(49676),ti=a(19918),to=a(41389),tr=a(69737),tl=a(71006),tc=a(47488);let td={suspense:!0,use:[e=>(t,a,s)=>{let n=(0,p.useCallback)(async(...e)=>{(0,tl.Z1)(a);let t=a(...e);return t instanceof Promise?t.catch(e=>{if(e instanceof tr.e||Array.isArray(e)&&e[0]instanceof tr.e){let t=e instanceof tr.e?e:e[0];g.me.error({title:"GraphQL Error",message:t.toString()})}else g.me.error({title:"Error",message:e.toString()});throw e}):t},[a]);return e(t,a?n:a,s)}]},tp=e=>(0,s.jsx)(tc.BE,{value:td,children:e.children}),tu=function({children:e}){return(0,s.jsxs)(tp,{children:[(0,s.jsx)(to.AllWorkspaceModals,{}),(0,s.jsx)(to.CurrentWorkspaceModals,{}),(0,s.jsx)(tx,{children:e})]})},th=({children:e})=>{let t=(0,C.s9)(),a=(0,k.Xr)(m.$A),n=(0,k.Xr)(m.p0),i=(0,r.h1)(x.j).workspace,l=(0,r.h1)(b.F).list,c=(0,r.h1)(ee.TR).workbench;return(0,p.useEffect)(()=>{let e=(0,w.Q)((0,y.n)(({template:e,mode:s})=>(0,j.Sx)(async t=>{let a=await fetch(e,{signal:t}),n=await a.blob();(0,f.T)(t);let[r]=await o.bMW.importDocs(i.docCollection,n);return r&&r.resetHistory(),{doc:r,mode:s}}).pipe((0,$.w)(1e4),(0,T.Z)(({mode:e,doc:t})=>(t&&(l.setMode(t.id,e),c.openDoc(t.id)),S.w)),(0,j.ao)(()=>{a({key:"insert-template"})}),(0,A.W)(e=>(console.error(e),(0,g.oR)(t["com.arms.ai.template-insert.failed"]()),S.w)),(0,N.j)(()=>{n("insert-template")})))),s=M.uj.slots.requestInsertTemplate.on(({template:t,mode:a})=>{e({template:t,mode:a})});return()=>{s.dispose(),e.unsubscribe()}},[i.docCollection,l,a,n,t,c]),(0,eO.tp)(),!function(){let e=(0,k.Pj)(),t=(0,C.s9)(),a=(0,eR.D)(),s=(0,r.h1)(x.j).workspace,n=(0,eB.A)(),i=(0,et.z)(s.docCollection),o=(0,eE.P)(),[l]=(0,ez.U)(),c=(0,r.h1)(X.A);(0,p.useEffect)(()=>{let e=(0,e_.uu)({id:"affine:show-quick-search",preconditionStrategy:e_.ON.Never,category:"affine:general",keyBinding:{binding:"$mod+K",capture:!0},label:"",icon:"",run(){!function(e){let t=e?.host?.std.selection.find("text");return!!(e&&t&&t.from.length>0&&e.host?.querySelector("affine-format-bar-widget"))}(l)&&c.toggle()}});return()=>{e()}},[c,l]),(0,p.useEffect)(()=>{let a=(0,e_.jL)({store:e,t});return()=>{a()}},[e,t]),(0,p.useEffect)(()=>{let a=(0,e_.xP)({store:e,t,docCollection:s.docCollection,navigationHelper:o});return()=>{a()}},[e,t,s.docCollection,o]),(0,p.useEffect)(()=>{let s=(0,e_._o)({store:e,t,theme:a,languageHelper:n,editor:l});return()=>{s()}},[e,t,a,n,l]),(0,p.useEffect)(()=>{let a=(0,e_.To)({t,store:e});return()=>{a()}},[e,t]),(0,p.useEffect)(()=>{let a=(0,e_.Yt)({store:e,pageHelper:i,t});return()=>{a()}},[e,i,t]),(0,p.useEffect)(()=>{let a=(0,e_.uh)({store:e,t});return()=>{a()}},[e,t])}(),!function(){let e=(0,r.h1)(tn.n).navigator;(0,p.useEffect)(()=>{let t=[];return t.push((0,e_.uu)({id:"affine:shortcut-history-go-back",category:"affine:general",preconditionStrategy:e_.ON.Never,icon:"none",label:"go back",keyBinding:{binding:"$mod+["},run(){O.u4.$.cmdk.general.goBack(),e.back()}})),t.push((0,e_.uu)({id:"affine:shortcut-history-go-forward",category:"affine:general",preconditionStrategy:e_.ON.Never,icon:"none",label:"go forward",keyBinding:{binding:"$mod+]"},run(){O.u4.$.cmdk.general.goForward(),e.forward()}})),()=>{t.forEach(e=>e())}},[e])}(),!function(){let e=(0,r.h1)(eP.H).findInPage,t=(0,p.useCallback)(()=>{let t=window.getSelection(),a=t?.toString();e.toggleVisible(a)},[e]);(0,p.useEffect)(()=>{if(!environment.isDesktop)return;let e=[];return e.push((0,e_.uu)({preconditionStrategy:e_.ON.Never,id:"affine:find-in-page",keyBinding:{binding:"$mod+f"},icon:null,label:"",run(){O.u4.$.cmdk.general.findInPage(),t()}})),()=>{e.forEach(e=>e())}},[t])}(),(0,p.useEffect)(()=>{let e=i.docCollection.doc.getMap("meta"),t=e.get("blockVersions");t instanceof I.Map||null==t||"object"!=typeof t||e.set("blockVersions",new I.Map(Object.entries(t)))},[i.docCollection.doc]),(0,s.jsxs)(s.Fragment,{children:[e,(0,s.jsx)(ti.Fr,{}),(0,s.jsx)(H,{})]})},tg=({children:e})=>(0,s.jsxs)("div",{className:"hoy4x41",children:[(0,s.jsx)("div",{className:"hoy4x43",children:(0,s.jsx)(ta,{left:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V.V5,{show:!0}),(0,s.jsx)(ts.yO,{})]})})}),(0,s.jsxs)("div",{className:"hoy4x42",children:[(0,s.jsx)(eA,{}),(0,s.jsx)(eN.J3,{children:e})]})]}),tm=({children:e})=>(0,s.jsxs)("div",{className:"hoy4x40",children:[(0,s.jsx)(eA,{}),(0,s.jsx)(eN.J3,{children:e})]}),tC=({children:e})=>{let t=(0,r.h1)(ee.TR).workbench,a=(0,c.S)(v.D.computed(e=>e(t.basename$)+e(t.location$).pathname)),i=(0,k.md)(V.oq),o=environment.isDesktop?tg:tm;return(0,s.jsx)(n.R,{"data-current-path":a,resizing:i,children:(0,s.jsx)(o,{children:e})})},tx=({children:e})=>{let t=(0,r.h1)(x.j).workspace,a=(0,c.S)(t.upgrade.upgrading$),n=(0,c.S)(t.upgrade.needUpgrade$);return(0,s.jsx)(th,{children:(0,s.jsx)(tC,{children:n||a?(0,s.jsx)(eV,{}):e})})};var tb=a(26582);let tw=()=>{eL.xG.debug("WorkspaceLayout");let e=(0,u.g)(),[t,a]=(0,p.useState)(!1),g=(0,r.h1)(l.q),m=(0,c.S)(g.list.isLoading$),C=(0,c.S)(g.list.workspaces$),x=(0,p.useMemo)(()=>C.find(({id:t})=>t===e.workspaceId),[C,e.workspaceId]),b=(0,i.h)(x),w=(0,r.h1)(d.q).globalContext;(0,p.useEffect)(()=>{g.list.revalidate()},[g]),(0,p.useEffect)(()=>{if(b)return window.currentWorkspace=b??void 0,window.dispatchEvent(new CustomEvent("affine:workspace:change",{detail:{id:b.id}})),window.exportWorkspaceSnapshot=async e=>{let t=await o.bMW.exportDocs(b.docCollection,Array.from(b.docCollection.docs.values()).filter(t=>!e||e.includes(t.id)).map(e=>e.getDoc())),a=URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download=`${b.docCollection.meta.name}.zip`,s.click(),URL.revokeObjectURL(a)},window.importWorkspaceSnapshot=async()=>{let e=document.createElement("input");e.type="file",e.accept=".zip",e.onchange=async()=>{if(e.files&&e.files.length>0){let t=new Blob([e.files[0]],{type:"application/zip"});console.log("imported docs",(await o.bMW.importDocs(b.docCollection,t)).filter(e=>!!e).map(e=>({id:e.id,title:e.meta?.title})))}},e.click()},localStorage.setItem("last_workspace_id",b.id),w.workspaceId.set(b.id),()=>{window.currentWorkspace=void 0,w.workspaceId.set(null)}},[w,x,b]);let j=(0,c.S)(b?.engine.rootDocState$.map(e=>e.ready))??!1;return((0,p.useEffect)(()=>{!1===m&&void 0===x&&a(!0),x&&a(!1)},[m,x,g]),(0,p.useEffect)(()=>{if(t){let e=setInterval(()=>{g.list.revalidate()},3e3);return()=>{clearInterval(e)}}},[t,g]),t)?(0,s.jsx)(tb.PageNotFound,{noPermission:!0}):b?j?(0,s.jsx)(r.xc,{scope:b.scope,children:(0,s.jsx)(h.E,{height:"100vh",children:(0,s.jsx)(tu,{children:(0,s.jsx)(ee.we,{})})})}):(0,s.jsxs)(r.xc,{scope:b.scope,children:[(0,s.jsx)(n.q,{},"workspaceLoading"),(0,s.jsx)(to.AllWorkspaceModals,{})]}):(0,s.jsx)(n.q,{},"workspaceLoading")}}}]); //# sourceMappingURL=chunk.4153.f0d1379d.js.map