staffwriter-cdn 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +268 -111
- package/.next/app-path-routes-manifest.json +27 -8
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +15 -15
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +14 -6
- package/.next/server/app/(app)/delivery/page.js +2 -2
- package/.next/server/app/(app)/delivery/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/registry/cloud/[id]/page.js +2 -2
- package/.next/server/app/(app)/registry/cloud/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/registry/page.js +2 -2
- package/.next/server/app/(app)/registry/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/renderer/cloud/[id]/page.js +2 -2
- package/.next/server/app/(app)/renderer/cloud/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/renderer/page.js +1 -1
- package/.next/server/app/(app)/renderer/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/services/[service]/page.js +2 -0
- package/.next/server/app/(app)/services/[service]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/(app)/services/page.js +2 -0
- package/.next/server/app/(app)/services/page_client-reference-manifest.js +1 -0
- package/.next/server/app/(app)/themes/page.js +18 -18
- package/.next/server/app/(app)/themes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[alias]/page.js +2 -2
- package/.next/server/app/[alias]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/api/aliases/route.js +1 -1
- package/.next/server/app/api/aliases/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/config/route.js +1 -1
- package/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/connections/route.js +1 -1
- package/.next/server/app/api/connections/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/control/route.js +1 -1
- package/.next/server/app/api/control/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/debug/route.js +1 -1
- package/.next/server/app/api/debug/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external/available/route.js +1 -0
- package/.next/server/app/api/external/available/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/external/route.js +1 -0
- package/.next/server/app/api/external/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/health/route.js +1 -1
- package/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/home/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/me/route.js +1 -1
- package/.next/server/app/api/me/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/network/route.js +4 -1
- package/.next/server/app/api/network/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/node/route.js +1 -1
- package/.next/server/app/api/node/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/pages/route.js +1 -1
- package/.next/server/app/api/pages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/pod/bots/route.js +1 -0
- package/.next/server/app/api/pod/bots/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/chats/route.js +1 -0
- package/.next/server/app/api/pod/chats/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/command/route.js +1 -0
- package/.next/server/app/api/pod/command/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/mail/relay/route.js +1 -0
- package/.next/server/app/api/pod/mail/relay/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/mail/route.js +1 -0
- package/.next/server/app/api/pod/mail/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/mail/send/route.js +1 -0
- package/.next/server/app/api/pod/mail/send/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/mail/sent/route.js +1 -0
- package/.next/server/app/api/pod/mail/sent/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/messages/route.js +1 -0
- package/.next/server/app/api/pod/messages/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/outline-vpn/key/route.js +1 -0
- package/.next/server/app/api/pod/outline-vpn/key/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/outline-vpn/route.js +1 -0
- package/.next/server/app/api/pod/outline-vpn/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/peer/route.js +4 -0
- package/.next/server/app/api/pod/peer/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/tunnels/route.js +4 -0
- package/.next/server/app/api/pod/tunnels/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/tunnels/send/route.js +4 -0
- package/.next/server/app/api/pod/tunnels/send/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/vpn/file/route.js +1 -0
- package/.next/server/app/api/pod/vpn/file/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/pod/vpn/route.js +1 -0
- package/.next/server/app/api/pod/vpn/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/services/route.js +1 -0
- package/.next/server/app/api/services/route_client-reference-manifest.js +1 -0
- package/.next/server/app/delivery.html +2 -2
- package/.next/server/app/delivery.rsc +4 -4
- package/.next/server/app/page/[uid]/[id]/page.js +2 -2
- package/.next/server/app/page/[uid]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/registry.html +2 -2
- package/.next/server/app/registry.rsc +4 -4
- package/.next/server/app/renderer.html +2 -2
- package/.next/server/app/renderer.rsc +5 -5
- package/.next/server/app/services.html +23 -0
- package/.next/server/app/{activity.meta → services.meta} +3 -3
- package/.next/server/app/{activity.rsc → services.rsc} +5 -5
- package/.next/server/app/themes.html +2 -2
- package/.next/server/app/themes.rsc +4 -4
- package/.next/server/app-paths-manifest.json +27 -8
- package/.next/server/chunks/11.js +1 -0
- package/.next/server/chunks/1238.js +1 -0
- package/.next/server/chunks/2443.js +1 -0
- package/.next/server/chunks/249.js +1 -0
- package/.next/server/chunks/2881.js +1 -0
- package/.next/server/chunks/308.js +1 -1
- package/.next/server/chunks/3345.js +1 -0
- package/.next/server/chunks/355.js +1 -0
- package/.next/server/chunks/3813.js +1 -0
- package/.next/server/chunks/4474.js +1 -0
- package/.next/server/chunks/{887.js → 4887.js} +1 -1
- package/.next/server/chunks/{611.js → 5611.js} +1 -1
- package/.next/server/chunks/6290.js +1 -0
- package/.next/server/chunks/6297.js +1 -0
- package/.next/server/chunks/{550.js → 6550.js} +1 -1
- package/.next/server/chunks/6884.js +1 -0
- package/.next/server/chunks/6925.js +3 -0
- package/.next/server/chunks/7278.js +1 -0
- package/.next/server/chunks/8377.js +1 -0
- package/.next/server/chunks/8413.js +1 -0
- package/.next/server/chunks/850.js +2 -2
- package/.next/server/chunks/8638.js +1 -0
- package/.next/server/chunks/9068.js +1 -0
- package/.next/server/chunks/9209.js +1 -0
- package/.next/server/chunks/{477.js → 9477.js} +1 -1
- package/.next/server/chunks/9631.js +1 -0
- package/.next/server/chunks/969.js +1 -0
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +2 -2
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_document.js +1 -1
- package/.next/server/pages/_error.js +2 -2
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/server/webpack-runtime.js +1 -1
- package/.next/static/chunks/1758-2514470f25b31b22.js +1 -0
- package/.next/static/chunks/2134-2f7a404728a7c319.js +1 -0
- package/.next/static/chunks/31-c86250907ab7b523.js +1 -0
- package/.next/static/chunks/3223-46e4f16d7c0bf0f3.js +1 -0
- package/.next/static/chunks/3861-8344fb02393c9435.js +1 -0
- package/.next/static/chunks/4477-6f2be11646923f51.js +1 -0
- package/.next/static/chunks/5094.df042006e4e3718d.js +1 -0
- package/.next/static/chunks/6252-ae540930d80a7cf6.js +1 -0
- package/.next/static/chunks/7254-605918695936361b.js +1 -0
- package/.next/static/chunks/8031-045f9d0d668c0c32.js +1 -0
- package/.next/static/chunks/8245-ed756357d8e74f48.js +1 -0
- package/.next/static/chunks/8297-297b6bab95fa5fe6.js +1 -0
- package/.next/static/chunks/8349-74dc381229789791.js +1 -0
- package/.next/static/chunks/8769-1b62d70bc1432ade.js +1 -0
- package/.next/static/chunks/8859-7da4ae08cbe3632d.js +1 -0
- package/.next/static/chunks/9057-88fc5ab4ff755ba8.js +1 -0
- package/.next/static/chunks/app/(app)/delivery/page-c950ef62ab7d98da.js +1 -0
- package/.next/static/chunks/app/(app)/{layout-018c19697d98a239.js → layout-5286ba00b484976e.js} +1 -1
- package/.next/static/chunks/app/(app)/registry/cloud/[id]/{page-aeda6c5aa24d77cd.js → page-047a4478de4c03c4.js} +1 -1
- package/.next/static/chunks/app/(app)/registry/page-c94616bfda87c693.js +1 -0
- package/.next/static/chunks/app/(app)/renderer/cloud/[id]/{page-f9385bc941a480cb.js → page-20bafb43c5a1c764.js} +1 -1
- package/.next/static/chunks/app/(app)/renderer/{page-b66d847affd2e6d4.js → page-877c6d4c44b9c0e1.js} +1 -1
- package/.next/static/chunks/app/(app)/services/[service]/page-6e693fb1832351cd.js +1 -0
- package/.next/static/chunks/app/(app)/services/page-637b34abd2236ecc.js +1 -0
- package/.next/static/chunks/app/(app)/themes/page-de160b10f5d6c1f8.js +1 -0
- package/.next/static/chunks/app/[alias]/page-f89113e70c4a4716.js +1 -0
- package/.next/static/chunks/app/api/aliases/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/config/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/connections/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/control/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/debug/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/external/available/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/external/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/health/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/home/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/me/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/network/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/node/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pages/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/bots/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/chats/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/command/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/mail/relay/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/mail/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/mail/send/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/mail/sent/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/messages/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/outline-vpn/key/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/outline-vpn/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/peer/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/tunnels/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/tunnels/send/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/vpn/file/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/pod/vpn/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/api/services/route-c7f85e20799f51ae.js +1 -0
- package/.next/static/chunks/app/page/[uid]/[id]/page-f89113e70c4a4716.js +1 -0
- package/.next/static/chunks/app/page-0cbd8e64bffc8453.js +1 -0
- package/.next/static/chunks/{webpack-8cca20063c431502.js → webpack-ba64640acea4d61a.js} +1 -1
- package/.next/static/rBvzd62Jfjfj8K7FMSfCB/_buildManifest.js +1 -0
- package/LICENSE +661 -0
- package/README.md +18 -4
- package/package.json +3 -3
- package/source.tar.gz +0 -0
- package/.next/server/app/(app)/activity/page.js +0 -2
- package/.next/server/app/(app)/activity/page_client-reference-manifest.js +0 -1
- package/.next/server/app/activity.html +0 -23
- package/.next/server/chunks/278.js +0 -1
- package/.next/server/chunks/306.js +0 -1
- package/.next/server/chunks/413.js +0 -1
- package/.next/server/chunks/443.js +0 -1
- package/.next/server/chunks/631.js +0 -1
- package/.next/server/chunks/7.js +0 -1
- package/.next/server/chunks/70.js +0 -1
- package/.next/server/chunks/749.js +0 -1
- package/.next/server/chunks/811.js +0 -1
- package/.next/server/chunks/813.js +0 -1
- package/.next/server/chunks/831.js +0 -1
- package/.next/server/chunks/925.js +0 -3
- package/.next/static/chunks/1388-d052a282c5484536.js +0 -1
- package/.next/static/chunks/1438-2324766c596cbd0b.js +0 -1
- package/.next/static/chunks/2134-f48d970ae9776c5d.js +0 -1
- package/.next/static/chunks/2567-8be3558f3397f3ba.js +0 -1
- package/.next/static/chunks/4715-82331ca540b96608.js +0 -1
- package/.next/static/chunks/5094.750b2e7b30f33107.js +0 -1
- package/.next/static/chunks/5248-8e58352a4a85d319.js +0 -1
- package/.next/static/chunks/7379-091c15b5a6ec3547.js +0 -1
- package/.next/static/chunks/7465-746c42789367d2ea.js +0 -1
- package/.next/static/chunks/8245-c2dd75b8de2b5864.js +0 -1
- package/.next/static/chunks/app/(app)/activity/page-6fc1f31796806b02.js +0 -1
- package/.next/static/chunks/app/(app)/delivery/page-36f2ec56dd38b120.js +0 -1
- package/.next/static/chunks/app/(app)/registry/page-53dbe59fc5a3226c.js +0 -1
- package/.next/static/chunks/app/(app)/themes/page-4a75580bc6a6eb0f.js +0 -1
- package/.next/static/chunks/app/[alias]/page-dfc775ab3f94d158.js +0 -1
- package/.next/static/chunks/app/api/aliases/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/config/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/connections/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/control/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/debug/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/health/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/home/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/me/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/network/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/node/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/api/pages/route-f28148114d2bf5da.js +0 -1
- package/.next/static/chunks/app/page/[uid]/[id]/page-dfc775ab3f94d158.js +0 -1
- package/.next/static/chunks/app/page-0807857f6c80baee.js +0 -1
- package/.next/static/f4vik1k-gk--Tisf5zLte/_buildManifest.js +0 -1
- /package/.next/static/{f4vik1k-gk--Tisf5zLte → rBvzd62Jfjfj8K7FMSfCB}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5248],{6114:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M2 4v16h20V4zm18 4.67h-2.5V6H20zm-2.5 2H20v2.67h-2.5zM4 6h11.5v12H4zm13.5 12v-2.67H20V18z"}),"ViewSidebarOutlined")},8964:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M15 20H5V7c0-.55-.45-1-1-1s-1 .45-1 1v13c0 1.1.9 2 2 2h10c.55 0 1-.45 1-1s-.45-1-1-1m5-4V4c0-1.1-.9-2-2-2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2m-2 0H9V4h9z"}),"ContentCopyRounded")},9958:(e,r,a)=>{a.d(r,{A:()=>H});var t=a(88945),o=a(67810),i=a(12115),l=a(57001),n=a(2914),d=a(74223),c=a(33859);function s(e){return(0,c.SX)("MuiDialogActions",e)}(0,c.WN)("MuiDialogActions",["root"]);var v=a(37594),h=a(22162),u=a(7784);let p=(0,c.WN)("MuiCard",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);var x=a(91122),m=a(7488),g=a(95155);let A=(0,d.A)("div")(e=>{var r;let{ownerState:a}=e;return(0,t.A)({"--Button-radius":"var(--Card-childRadius)","--IconButton-radius":"var(--Card-childRadius)",display:"flex"},(null==(r=a.orientation)?void 0:r.startsWith("horizontal"))&&{alignItems:"center"},{flexDirection:"horizontal"===a.orientation?"row":"column"},"horizontal-reverse"===a.orientation&&{flexDirection:"row-reverse"},{zIndex:1,gap:"calc(0.625 * var(--Card-padding))",padding:"var(--unstable_padding)","--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 0 0",[".".concat(x.A.root," > &")]:{"--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 var(--Card-padding)"},[".".concat(p.root," > .").concat(m.A.root," + &")]:{"--unstable_padding":"0"}},a.buttonFlex?{["& > :not(.".concat(u.A.root,")")]:{flex:a.buttonFlex},["& > :not(button) > .".concat(h.A.root)]:{width:"100%"}}:{["& > .".concat(h.A.root,":only-child")]:{flex:"auto"}})});(0,d.A)(A,{name:"JoyCardActions",slot:"Root",overridesResolver:(e,r)=>r.root})({});let f=["component","children","buttonFlex","orientation","slots","slotProps"],T=(0,d.A)(A,{name:"JoyDialogActions",slot:"Root",overridesResolver:(e,r)=>r.root})({}),H=i.forwardRef(function(e,r){let a=(0,n.A)({props:e,name:"JoyDialogActions"}),{component:i="div",children:d,buttonFlex:c,orientation:h="horizontal-reverse",slots:u={},slotProps:p={}}=a,x=(0,o.A)(a,f),m=(0,t.A)({},x,{component:i,slots:u,slotProps:p}),A=(0,t.A)({},a,{component:i,buttonFlex:c,orientation:h}),H=(0,l.A)({root:["root"]},s,{}),[b,z]=(0,v.A)("root",{ref:r,className:H.root,elementType:T,externalForwardedProps:m,ownerState:A});return(0,g.jsx)(b,(0,t.A)({},z,{children:d}))})},11966:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M4 9h12c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1m0 4h12c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1m0 4h12c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1m15 0h2v-2h-2zm0-10v2h2V7zm0 6h2v-2h-2z"}),"TocRounded")},13673:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"}),"AddRounded")},14458:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M5 5.5C5 6.33 5.67 7 6.5 7h4v10.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V7h4c.83 0 1.5-.67 1.5-1.5S18.33 4 17.5 4h-11C5.67 4 5 4.67 5 5.5"}),"TitleRounded")},15577:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M14.59 2.59c-.38-.38-.89-.59-1.42-.59H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8.83c0-.53-.21-1.04-.59-1.41zM15 16h-2v2c0 .55-.45 1-1 1s-1-.45-1-1v-2H9c-.55 0-1-.45-1-1s.45-1 1-1h2v-2c0-.55.45-1 1-1s1 .45 1 1v2h2c.55 0 1 .45 1 1s-.45 1-1 1m-2-8V3.5L18.5 9H14c-.55 0-1-.45-1-1"}),"NoteAddRounded")},21704:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M4 13h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1m0 8h6c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1m10 0h6c.55 0 1-.45 1-1v-8c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1M13 4v4c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1"}),"DashboardRounded")},23937:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"m6.14 11.86-2.78 2.79c-.19.2-.19.51 0 .71l2.78 2.79c.31.32.85.09.85-.35V16H13c.55 0 1-.45 1-1s-.45-1-1-1H6.99v-1.79c0-.45-.54-.67-.85-.35m14.51-3.21-2.78-2.79c-.31-.32-.85-.09-.85.35V8H11c-.55 0-1 .45-1 1s.45 1 1 1h6.01v1.79c0 .45.54.67.85.35l2.78-2.79c.2-.19.2-.51.01-.7"}),"SwapHorizRounded")},31709:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h5c.55 0 1-.45 1-1s-.45-1-1-1H5c-1.11 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6c0-.55-.45-1-1-1s-1 .45-1 1v5c0 .55-.45 1-1 1M14 4c0 .55.45 1 1 1h2.59l-9.13 9.13c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L19 6.41V9c0 .55.45 1 1 1s1-.45 1-1V4c0-.55-.45-1-1-1h-5c-.55 0-1 .45-1 1"}),"OpenInNewRounded")},32763:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3-8c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3"}),"AdjustRounded")},34809:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2zM9 9h6c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H9c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1m6.5-5-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1z"}),"DeleteOutlineRounded")},35378:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0s.39-1.02 0-1.41l-6.59-6.59a.996.996 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded")},36279:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)([(0,o.jsx)("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),(0,o.jsx)("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")],"ArticleOutlined")},49953:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zm0-12H5V6h14zm-7 5h5v5h-5z"}),"EventOutlined")},59275:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M14 9h2.87c1.46 0 2.8.98 3.08 2.42.31 1.64-.74 3.11-2.22 3.48l1.53 1.53c1.77-.91 2.95-2.82 2.7-5.01C21.68 8.86 19.37 7 16.79 7H14c-.55 0-1 .45-1 1s.45 1 1 1M3.51 3.51a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l2.64 2.64c-1.77.91-2.95 2.82-2.7 5.01C2.32 15.14 4.63 17 7.21 17H10c.55 0 1-.45 1-1s-.45-1-1-1H7.13c-1.46 0-2.8-.98-3.08-2.42-.31-1.64.75-3.11 2.22-3.48l2.12 2.12c-.23.19-.39.46-.39.78 0 .55.45 1 1 1h1.17l8.9 8.9c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41zM14 11l1.71 1.71c.18-.18.29-.43.29-.71 0-.55-.45-1-1-1z"}),"LinkOffRounded")},67714:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)([(0,o.jsx)("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),(0,o.jsx)("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),(0,o.jsx)("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),(0,o.jsx)("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),(0,o.jsx)("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")],"PaletteOutlined")},72179:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"}),"VisibilityOutlined")},78373:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M5 10h14v2h2V6c0-1.1-.9-2-2-2h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h7v-2H5zm0-4h14v2H5zm17.84 10.28-.71.71-2.12-2.12.71-.71c.39-.39 1.02-.39 1.41 0l.71.71c.39.39.39 1.02 0 1.41m-3.54-.7 2.12 2.12-5.3 5.3H14v-2.12z"}),"EditCalendarOutlined")},83730:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M8.12 9.29 12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7a.996.996 0 0 1 0-1.41c.39-.38 1.03-.39 1.42 0"}),"KeyboardArrowDownRounded")},87974:(e,r,a)=>{a.d(r,{A:()=>D});var t=a(67810),o=a(88945),i=a(12115),l=a(88133),n=a(57001),d=a(30365),c=a(42003),s=a(89255),v=a(95155);let h=["onChange","maxRows","minRows","style","value"];function u(e){return parseInt(e,10)||0}let p={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},x=i.forwardRef(function(e,r){let{onChange:a,maxRows:l,minRows:n=1,style:x,value:m}=e,g=(0,t.A)(e,h),{current:A}=i.useRef(null!=m),f=i.useRef(null),T=(0,d.A)(r,f),H=i.useRef(null),b=i.useRef(null),z=i.useCallback(()=>{let r=f.current,a=(0,c.A)(r).getComputedStyle(r);if("0px"===a.width)return{outerHeightStyle:0,overflowing:!1};let t=b.current;t.style.width=a.width,t.value=r.value||e.placeholder||"x","\n"===t.value.slice(-1)&&(t.value+=" ");let o=a.boxSizing,i=u(a.paddingBottom)+u(a.paddingTop),d=u(a.borderBottomWidth)+u(a.borderTopWidth),s=t.scrollHeight;t.value="x";let v=t.scrollHeight,h=s;return n&&(h=Math.max(Number(n)*v,h)),l&&(h=Math.min(Number(l)*v,h)),{outerHeightStyle:(h=Math.max(h,v))+("border-box"===o?i+d:0),overflowing:1>=Math.abs(h-s)}},[l,n,e.placeholder]),y=i.useCallback(()=>{let e=z();if(null==e||0===Object.keys(e).length||0===e.outerHeightStyle&&!e.overflowing)return;let r=e.outerHeightStyle,a=f.current;H.current!==r&&(H.current=r,a.style.height="".concat(r,"px")),a.style.overflow=e.overflowing?"hidden":""},[z]);return(0,s.A)(()=>{let e,r,a=()=>{y()},t=function(e,r=166){let a;function t(...o){let i=()=>{e.apply(this,o)};clearTimeout(a),a=setTimeout(i,r)}return t.clear=()=>{clearTimeout(a)},t}(a),o=f.current,i=(0,c.A)(o);return i.addEventListener("resize",t),"undefined"!=typeof ResizeObserver&&(r=new ResizeObserver(a)).observe(o),()=>{t.clear(),cancelAnimationFrame(e),i.removeEventListener("resize",t),r&&r.disconnect()}},[z,y]),(0,s.A)(()=>{y()}),(0,v.jsxs)(i.Fragment,{children:[(0,v.jsx)("textarea",(0,o.A)({value:m,onChange:e=>{A||y(),a&&a(e)},ref:T,rows:n,style:x},g)),(0,v.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:b,tabIndex:-1,style:(0,o.A)({},p.shadow,x,{paddingTop:0,paddingBottom:0})})]})});var m=a(74223),g=a(2914),A=a(37594),f=a(33859);function T(e){return(0,f.SX)("MuiTextarea",e)}let H=(0,f.WN)("MuiTextarea",["root","textarea","startDecorator","endDecorator","formControl","disabled","error","focused","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft"]);var b=a(24080);let z=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","size","color","variant","startDecorator","endDecorator","minRows","maxRows","component","slots","slotProps"],y=(0,m.A)("div",{name:"JoyTextarea",slot:"Root",overridesResolver:(e,r)=>r.root})(e=>{var r,a,t,i,l,n;let{theme:d,ownerState:c}=e,s=null==(r=d.variants["".concat(c.variant)])?void 0:r[c.color];return[(0,o.A)({"--Textarea-radius":d.vars.radius.sm,"--Textarea-gap":"0.5rem","--Textarea-placeholderColor":"inherit","--Textarea-placeholderOpacity":.64,"--Textarea-decoratorColor":d.vars.palette.text.icon,"--Textarea-focused":"0","--Textarea-focusedThickness":d.vars.focus.thickness,"--Textarea-focusedHighlight":null==(a=d.vars.palette["neutral"===c.color?"primary":c.color])?void 0:a[500],'&:not([data-inverted-colors="false"])':(0,o.A)({},c.instanceColor&&{"--_Textarea-focusedHighlight":null==(t=d.vars.palette["neutral"===c.instanceColor?"primary":c.instanceColor])?void 0:t[500]},{"--Textarea-focusedHighlight":"var(--_Textarea-focusedHighlight, ".concat(d.vars.palette.focusVisible,")")})},"sm"===c.size&&{"--Textarea-minHeight":"2rem","--Textarea-paddingBlock":"calc(0.375rem - 0.5px - var(--variant-borderWidth, 0px))","--Textarea-paddingInline":"0.5rem","--Textarea-decoratorChildHeight":"min(1.5rem, var(--Textarea-minHeight))","--Icon-fontSize":d.vars.fontSize.xl},"md"===c.size&&{"--Textarea-minHeight":"2.25rem","--Textarea-paddingBlock":"calc(0.375rem - var(--variant-borderWidth, 0px))","--Textarea-paddingInline":"0.75rem","--Textarea-decoratorChildHeight":"min(1.75rem, var(--Textarea-minHeight))","--Icon-fontSize":d.vars.fontSize.xl2},"lg"===c.size&&{"--Textarea-minHeight":"3rem","--Textarea-paddingBlock":"calc(0.75rem - var(--variant-borderWidth, 0px))","--Textarea-paddingInline":"1rem","--Textarea-gap":"0.75rem","--Textarea-decoratorChildHeight":"min(2.375rem, var(--Textarea-minHeight))","--Icon-fontSize":d.vars.fontSize.xl2},{"--_Textarea-paddingBlock":"max((var(--Textarea-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Textarea-decoratorChildHeight)) / 2, 0px)","--Textarea-decoratorChildRadius":"max(var(--Textarea-radius) - var(--variant-borderWidth, 0px) - var(--_Textarea-paddingBlock), min(var(--_Textarea-paddingBlock) + var(--variant-borderWidth, 0px), var(--Textarea-radius) / 2))","--Button-minHeight":"var(--Textarea-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Textarea-decoratorChildHeight)","--Button-radius":"var(--Textarea-decoratorChildRadius)","--IconButton-radius":"var(--Textarea-decoratorChildRadius)",boxSizing:"border-box"},"plain"!==c.variant&&{boxShadow:d.shadow.xs},{minWidth:0,minHeight:"var(--Textarea-minHeight)",cursor:"text",position:"relative",display:"flex",flexDirection:"column",paddingInlineStart:"var(--Textarea-paddingInline)",paddingBlock:"var(--Textarea-paddingBlock)",borderRadius:"var(--Textarea-radius)"},d.typography["body-".concat(c.size)],s,{backgroundColor:null!=(i=null==s?void 0:s.backgroundColor)?i:d.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Textarea-focusedInset, inset) 0 0 0 calc(var(--Textarea-focused) * var(--Textarea-focusedThickness)) var(--Textarea-focusedHighlight)"}}),{"&:hover":(0,o.A)({},null==(l=d.variants["".concat(c.variant,"Hover")])?void 0:l[c.color],{backgroundColor:null,cursor:"text"}),["&.".concat(H.disabled)]:null==(n=d.variants["".concat(c.variant,"Disabled")])?void 0:n[c.color],"&:focus-within::before":{"--Textarea-focused":"1"}}]}),C=(0,m.A)(x,{name:"JoyTextarea",slot:"Textarea",overridesResolver:(e,r)=>r.textarea})({resize:"none",border:"none",minWidth:0,outline:0,padding:0,paddingInlineEnd:"var(--Textarea-paddingInline)",flex:"auto",alignSelf:"stretch",color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit","&::-webkit-input-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"}}),S=(0,m.A)("div",{name:"JoyTextarea",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})({display:"flex",marginInlineStart:"calc(var(--Textarea-paddingBlock) - var(--Textarea-paddingInline))",marginInlineEnd:"var(--Textarea-paddingBlock)",marginBlockEnd:"var(--Textarea-gap)",color:"var(--Textarea-decoratorColor)",cursor:"initial"}),R=(0,m.A)("div",{name:"JoyTextarea",slot:"EndDecorator",overridesResolver:(e,r)=>r.endDecorator})({display:"flex",marginInlineStart:"calc(var(--Textarea-paddingBlock) - var(--Textarea-paddingInline))",marginInlineEnd:"var(--Textarea-paddingBlock)",marginBlockStart:"var(--Textarea-gap)",color:"var(--Textarea-decoratorColor)",cursor:"initial"}),D=i.forwardRef(function(e,r){var a,i,d,c,s,h,u,p;let x=(0,g.A)({props:e,name:"JoyTextarea"}),m=(0,b.A)(x,H),{propsToForward:f,rootStateClasses:D,inputStateClasses:M,getRootProps:w,getInputProps:j,formControl:V,focused:k,error:I=!1,disabled:B=!1,size:N="md",color:W="neutral",variant:O="outlined",startDecorator:P,endDecorator:L,minRows:E,maxRows:_,component:J,slots:F={},slotProps:X={}}=m,q=(0,t.A)(m,z),G=null!=(a=null!=(i=e.disabled)?i:null==V?void 0:V.disabled)?a:B,K=null!=(d=null!=(c=e.error)?c:null==V?void 0:V.error)?d:I,U=null!=(s=null!=(h=e.size)?h:null==V?void 0:V.size)?s:N,Z=null!=(u=e.color)?u:K?"danger":null!=(p=null==V?void 0:V.color)?p:W,Q=(0,o.A)({instanceColor:K?"danger":e.color},x,{color:Z,disabled:G,error:K,focused:k,size:U,variant:O}),Y=(e=>{let{disabled:r,variant:a,color:t,size:o}=e,i={root:["root",r&&"disabled",a&&"variant".concat((0,l.A)(a)),t&&"color".concat((0,l.A)(t)),o&&"size".concat((0,l.A)(o))],textarea:["textarea"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,n.A)(i,T,{})})(Q),$=(0,o.A)({},q,{component:J,slots:F,slotProps:X}),[ee,er]=(0,A.A)("root",{ref:r,className:[Y.root,D],elementType:y,externalForwardedProps:$,getSlotProps:w,ownerState:Q}),[ea,et]=(0,A.A)("textarea",{additionalProps:{id:null==V?void 0:V.htmlFor,"aria-describedby":null==V?void 0:V["aria-describedby"]},className:[Y.textarea,M],elementType:C,internalForwardedProps:(0,o.A)({},f,{minRows:E,maxRows:_}),externalForwardedProps:$,getSlotProps:j,ownerState:Q}),[eo,ei]=(0,A.A)("startDecorator",{className:Y.startDecorator,elementType:S,externalForwardedProps:$,ownerState:Q}),[el,en]=(0,A.A)("endDecorator",{className:Y.endDecorator,elementType:R,externalForwardedProps:$,ownerState:Q});return(0,v.jsxs)(ee,(0,o.A)({},er,{children:[P&&(0,v.jsx)(eo,(0,o.A)({},ei,{children:P})),(0,v.jsx)(ea,(0,o.A)({},et)),L&&(0,v.jsx)(el,(0,o.A)({},en,{children:L}))]}))})},89089:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M11 5v11.17l-4.88-4.88c-.39-.39-1.03-.39-1.42 0s-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41a.996.996 0 0 0-1.41 0L13 16.17V5c0-.55-.45-1-1-1s-1 .45-1 1"}),"ArrowDownwardRounded")},89167:(e,r,a)=>{a.d(r,{A:()=>i});var t=a(83694),o=a(95155);let i=(0,t.A)((0,o.jsx)("path",{d:"M20 11H4c-.55 0-1 .45-1 1s.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1M4 18h10c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1M20 6H4c-.55 0-1 .45-1 1v.01c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V7c0-.55-.45-1-1-1"}),"NotesRounded")},90272:(e,r,a)=>{a.d(r,{A:()=>H});var t=a(67810),o=a(88945),i=a(12115),l=a(2821),n=a(57001),d=a(88133),c=a(25191),s=a(74223),v=a(2914),h=a(37594),u=a(33859);function p(e){return(0,u.SX)("MuiAlert",e)}(0,u.WN)("MuiAlert",["root","startDecorator","endDecorator","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);var x=a(14522),m=a(95155);let g=["children","className","color","invertedColors","role","variant","size","startDecorator","endDecorator","component","slots","slotProps"],A=(0,s.A)("div",{name:"JoyAlert",slot:"Root",overridesResolver:(e,r)=>r.root})(e=>{var r;let{theme:a,ownerState:t}=e,{p:i,padding:l,borderRadius:n}=(0,x.x)({theme:a,ownerState:t},["p","padding","borderRadius"]);return[(0,o.A)({"--Alert-radius":a.vars.radius.sm,"--Alert-decoratorChildRadius":"max((var(--Alert-radius) - var(--variant-borderWidth, 0px)) - var(--Alert-padding), min(var(--Alert-padding) + var(--variant-borderWidth, 0px), var(--Alert-radius) / 2))","--Button-minHeight":"var(--Alert-decoratorChildHeight)","--IconButton-size":"var(--Alert-decoratorChildHeight)","--Button-radius":"var(--Alert-decoratorChildRadius)","--IconButton-radius":"var(--Alert-decoratorChildRadius)","--Icon-color":"currentColor"},"sm"===t.size&&{"--Alert-padding":"0.5rem","--Alert-decoratorChildHeight":"1.5rem","--Icon-fontSize":a.vars.fontSize.xl,gap:"0.5rem"},"md"===t.size&&{"--Alert-padding":"0.75rem","--Alert-decoratorChildHeight":"2rem","--Icon-fontSize":a.vars.fontSize.xl,gap:"0.625rem"},"lg"===t.size&&{"--Alert-padding":"1rem","--Alert-decoratorChildHeight":"2.375rem","--Icon-fontSize":a.vars.fontSize.xl2,gap:"0.875rem"},{backgroundColor:a.vars.palette.background.surface,display:"flex",position:"relative",alignItems:"center",padding:"var(--Alert-padding)",borderRadius:"var(--Alert-radius)"},a.typography["body-".concat({sm:"xs",md:"sm",lg:"md"}[t.size])],{fontWeight:a.vars.fontWeight.md},"solid"===t.variant&&t.color&&t.invertedColors&&(0,c.Hm)(t.color)(a),"soft"===t.variant&&t.color&&t.invertedColors&&(0,c.qG)(t.color)(a),null==(r=a.variants[t.variant])?void 0:r[t.color]),void 0!==i&&{"--Alert-padding":i},void 0!==l&&{"--Alert-padding":l},void 0!==n&&{"--Alert-radius":n}]}),f=(0,s.A)("span",{name:"JoyAlert",slot:"StartDecorator",overridesResolver:(e,r)=>r.startDecorator})({display:"inherit",flex:"none"}),T=(0,s.A)("span",{name:"JoyAlert",slot:"EndDecorator",overridesResolver:(e,r)=>r.endDecorator})({display:"inherit",flex:"none",marginLeft:"auto"}),H=i.forwardRef(function(e,r){let a=(0,v.A)({props:e,name:"JoyAlert"}),{children:i,className:c,color:s="neutral",invertedColors:u=!1,role:x="alert",variant:H="soft",size:b="md",startDecorator:z,endDecorator:y,component:C,slots:S={},slotProps:R={}}=a,D=(0,t.A)(a,g),M=(0,o.A)({},a,{color:s,invertedColors:u,variant:H,size:b}),w=(e=>{let{variant:r,color:a,size:t}=e,o={root:["root",t&&"size".concat((0,d.A)(t)),a&&"color".concat((0,d.A)(a)),r&&"variant".concat((0,d.A)(r))],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return(0,n.A)(o,p,{})})(M),j=(0,o.A)({},D,{component:C,slots:S,slotProps:R}),[V,k]=(0,h.A)("root",{ref:r,className:(0,l.A)(w.root,c),elementType:A,externalForwardedProps:j,ownerState:M,additionalProps:{role:x}}),[I,B]=(0,h.A)("startDecorator",{className:w.startDecorator,elementType:f,externalForwardedProps:j,ownerState:M}),[N,W]=(0,h.A)("endDecorator",{className:w.endDecorator,elementType:T,externalForwardedProps:j,ownerState:M});return(0,m.jsxs)(V,(0,o.A)({},k,{children:[z&&(0,m.jsx)(I,(0,o.A)({},B,{children:z})),i,y&&(0,m.jsx)(N,(0,o.A)({},W,{children:y}))]}))})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7379],{8341:(e,t,n)=>{n.d(t,{A:()=>u,W:()=>d});var r=n(95155);n(12115);var l=n(41530),o=n(35326),i=n(83561),c=n(20258),a=n(87344);function d(e){return!!(e.title.trim()||e.description.trim())}function u(e){let{page:t,sections:n}=e,d=t.title.trim(),u=t.description.trim();return(0,r.jsxs)(l.A,{role:"group","aria-label":"Page introduction",sx:{minWidth:0},children:[d?(0,r.jsx)(c.A,{markdown:"# {{title}}",values:{title:d},sx:{"& .sw-prose h1":{my:0,fontSize:"2em",lineHeight:1.25}}}):null,u?(0,r.jsx)(o.Ay,{level:"body-md",textColor:"text.tertiary",sx:{mt:.75*!!d,whiteSpace:"pre-line",overflowWrap:"anywhere"},children:u}):null,(0,r.jsx)(l.A,{sx:{mt:2,mb:1},children:(0,r.jsx)(c.A,{markdown:"---"})}),(0,r.jsx)(a.A,{createdAt:t.createdAt,editedAt:(0,i.u8)(t,n)})]})}},20892:(e,t,n)=>{n.d(t,{l:()=>o});var r=n(83561),l=n(58245);function o(e,t){let n=(0,r.KJ)(e=>e.themes),o=(0,r.KJ)(e=>e.page.themeId),i=null==e?void 0:e.cards.find(e=>e.id===t);(0,l.VV)(e?(0,r.s1)(n,o,e,i).themeId:void 0)}},47254:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(95155);n(12115);var l=n(83561),o=n(44503);function i(e){let{section:t,card:n,...i}=e,c=(0,l.KJ)(e=>e.themes),a=(0,l.KJ)(e=>e.page.themeId),{themeId:d,mode:u}=(0,l.s1)(c,a,t,n);return(0,r.jsx)(l.WB,{theme:(0,l.eW)(c,d),fonts:o.e,mode:u,...i})}},57794:(e,t,n)=>{n.d(t,{r:()=>l});var r=n(12115);function l(e){r.useEffect(()=>{let t=()=>{document.title!==e&&(document.title=e)};t();let n=new MutationObserver(t);return n.observe(document.head,{childList:!0,characterData:!0,subtree:!0}),()=>n.disconnect()},[e])}},87344:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(95155);n(12115);var l=n(41530),o=n(35326),i=n(78373),c=n(49953);let a=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"}),d=new Intl.DateTimeFormat("en-GB",{dateStyle:"long",timeStyle:"short"});function u(e){let{label:t,at:n,icon:i}=e;return(0,r.jsxs)(l.A,{component:"span",title:"".concat(t," ").concat(d.format(n)),sx:{display:"inline-flex",alignItems:"center",gap:.5,color:"text.tertiary","& svg":{fontSize:14}},children:[i,(0,r.jsxs)(o.Ay,{level:"body-xs",textColor:"inherit",noWrap:!0,children:[t," ",(0,r.jsx)("time",{dateTime:new Date(n).toISOString(),children:a.format(n)})]})]})}function s(e){let{createdAt:t,editedAt:n}=e;return t||n?(0,r.jsxs)(l.A,{role:"group","aria-label":"Page dates",sx:{display:"flex",flexWrap:"wrap",columnGap:2,rowGap:.5},children:[t?(0,r.jsx)(u,{label:"Created",at:t,icon:(0,r.jsx)(c.A,{})}):null,n?(0,r.jsx)(u,{label:"Edited",at:n,icon:(0,r.jsx)(i.A,{})}):null]}):null}},89280:(e,t,n)=>{n.d(t,{z:()=>h});var r=n(12115),l=n(57763),o=n(41897),i=n(18565),c=n(24794);let a=o.rs.contentStreamTopReserveShellPx,d=o.rs.contentStreamTopReserveCompactPx;function u(){return window.matchMedia("(min-width: 1200px)").matches?a:d}function s(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"smooth";if(!e||!r)return;let a=e.closest("[data-block-stream]");if(!a)return void e.scrollIntoView({behavior:l,block:"start"});let d=a.getBoundingClientRect(),s=e.getBoundingClientRect(),m=r===e?s:r.getBoundingClientRect();if("vertical"===a.getAttribute("data-block-stream")){let t=a.clientHeight-o.rs.topReserve,i=r===e?s.height:m.bottom-s.top,c=i<=t?s.top-(d.top+o.rs.topReserve)-(t-i)/2:s.top-u();null==(n=a.scrollTo)||n.call(a,{top:Math.max(0,a.scrollTop+c),behavior:l});return}let f=Number.parseFloat(getComputedStyle(a).paddingLeft)||0,h=a.clientWidth-f,v=r===e?s.width:m.right-s.left;if(v>h)return void function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smooth";if(!e)return;let n=e.closest('[data-block-stream="vertical"]');if(n){let r=function(e,t){let{top:n}=e.getBoundingClientRect();return n-t}(e,u());n.scrollTo({top:Math.max(0,n.scrollTop+r),behavior:t});return}let r=e.closest('[data-block-stream="horizontal"]');if(r){let n=function(e,t){let n=t.getBoundingClientRect(),r=Number.parseFloat(getComputedStyle(t).paddingLeft)||0,l=n.left+r+t.clientLeft,o=(0,i.Zp)(t),{left:c}=e.getBoundingClientRect();return c-(l+o)}(e,r),l=Math.min((0,c.jU)(r.scrollWidth,r.clientWidth),Math.max(0,r.scrollLeft+n));r.scrollTo({left:l,behavior:t});let o=()=>(0,c.kd)(r);"smooth"===t?requestAnimationFrame(()=>requestAnimationFrame(o)):o();return}e.scrollIntoView({behavior:t,block:"center"})}(e,l);let g=s.left-(d.left+f)-(h-v)/2,p=(0,c.jU)(a.scrollWidth,a.clientWidth);null==(t=a.scrollTo)||t.call(a,{left:Math.min(p,Math.max(0,a.scrollLeft+g)),behavior:l})}var m=n(99640),f=n(35454);function h(e,t){var n,o;let i=null==(n=(0,f.rv)(e,(0,f.g1)()))?void 0:n.id,[c,a]=r.useState({cardId:null}),[d,u]=r.useState(null),h=r.useRef(!1),v=e.some(e=>e.id===c.sectionId),g=v?c.sectionId:null==(o=e[0])?void 0:o.id,p=v?c.cardId:null,w=r.useRef(()=>{}),x=r.useRef(null),b=r.useCallback((e,t)=>{h.current=!0;let n={sectionId:e,cardId:null!=t?t:null};x.current=n,a(n),u(n)},[]);r.useEffect(()=>{let e=0,t=()=>{var t;if(e=0,h.current)return;let n=(0,m.VL)();if(!n)return;let{sectionId:r}=n,l=null!=(t=n.cardId)?t:null;a(e=>e.sectionId===r&&e.cardId===l?e:{sectionId:r,cardId:l})},n=()=>{e||(e=window.requestAnimationFrame(t))};w.current=n,n();let r=()=>{h.current=!1},l=e=>{var t,n;(null==(n=e.target)||null==(t=n.closest)?void 0:t.call(n,"[data-block-stream]"))&&r()},o={capture:!0,passive:!0};return document.addEventListener("scroll",n,o),document.addEventListener("wheel",r,o),document.addEventListener("touchstart",r,o),document.addEventListener("keydown",l,o),document.addEventListener("pointerdown",l,o),window.addEventListener("resize",n),()=>{window.cancelAnimationFrame(e),e=0,w.current=()=>{},document.removeEventListener("scroll",n,o),document.removeEventListener("wheel",r,o),document.removeEventListener("touchstart",r,o),document.removeEventListener("keydown",l,o),document.removeEventListener("pointerdown",l,o),window.removeEventListener("resize",n)}},[]),r.useEffect(()=>{w.current()},[e]),r.useEffect(()=>{if(!d)return;let e=()=>(function(e){var t,n;let{sectionId:r,cardId:o}=e;if(!r)return;if(o){let e=document.getElementById("".concat(l.L).concat(o));s(e,e);return}let i=document.querySelectorAll("[".concat(m.jW,'="').concat(r.replace(/["\\]/g,"\\$&"),'"]'));s(null!=(t=i[0])?t:null,null!=(n=i[i.length-1])?n:null)})(d),t=window.requestAnimationFrame(e),n=window.setTimeout(e,250);return()=>{window.cancelAnimationFrame(t),window.clearTimeout(n)}},[d]),r.useEffect(()=>{h.current&&x.current?u({...x.current}):w.current()},[t]);let A=r.useRef(null);return r.useEffect(()=>{i&&A.current!==i&&(A.current=i,b(i))},[i,b]),{activeSectionId:g,activeCardId:p,requestedSectionId:i,select:b,remeasure:w}}},99640:(e,t,n)=>{n.d(t,{Cx:()=>i,VL:()=>c,jW:()=>l});var r=n(41897);let l="data-section-id",o="data-card-id";function i(e,t){return{[l]:e,...t?{[o]:t}:null}}function c(){let e=Array.from(document.querySelectorAll("[".concat(l,"]")));if(0===e.length)return;let t=e[0].closest("[data-block-stream]"),n=(null==t?void 0:t.getAttribute("data-block-stream"))==="horizontal",i=null!=t?t:document.documentElement,c=n?i.scrollLeft:i.scrollTop,a=n?i.scrollWidth-i.clientWidth:i.scrollHeight-i.clientHeight,d=null==t?void 0:t.getBoundingClientRect(),u=window.innerHeight/2;d&&(u=n?(d.left+d.right)/2:(d.top+r.rs.topReserve+d.bottom)/2);let s=e.map(e=>{var t;let r=e.getBoundingClientRect();return{sectionId:e.getAttribute(l),cardId:null!=(t=e.getAttribute(o))?t:void 0,start:n?r.left:r.top,end:n?r.right:r.bottom}}),m=a>2;return function(e,t,n,r){var l;if(0===e.length)return;let o=n?e[0]:r?e[e.length-1]:null,i=o?e.filter(e=>e.sectionId===o.sectionId):e,c=e=>{let{start:n,end:r}=e;return Math.max(n-t,t-r,0)},a=i.reduce((e,t)=>c(t)<c(e)?t:e);return a.cardId?a:null!=(l=i.find(e=>e.sectionId===a.sectionId&&e.cardId))?l:a}(s,u,m&&c<=2,m&&c>=a-2)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7465],{12361:(e,t,n)=>{n.d(t,{A:()=>x});var i=n(95155);n(12115);var a=n(41530),r=n(296),l=n(88504),o=n(22681),s=n(65572),d=n(2312),c=n(35326),u=n(83561);function x(e){let{list:t,label:n="Themes",value:x,onPick:h}=e,p=(0,u.mu)(),{themes:m,page:g}=(0,u.b8)(),f=(0,u.eW)(m,null!=x?x:g.themeId);return(0,i.jsx)(r.A,{size:"sm","aria-label":n,sx:{"--ListItem-radius":"8px",gap:.25},children:(null!=t?t:[...u.Cn,...m]).map(e=>{var t;return(0,i.jsx)(l.A,{children:(0,i.jsxs)(o.A,{selected:e.id===f.id,"aria-current":e.id===f.id?"true":void 0,onClick:()=>h?h(e.id):p.updatePage({themeId:e.id}),children:[(0,i.jsx)(d.A,{children:(0,i.jsx)(a.A,{"aria-hidden":!0,sx:{width:20,height:20,borderRadius:"50%",border:"1px solid",borderColor:"divider",backgroundImage:u.C3[e.gradient].light,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,i.jsx)(a.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:null!=(t=e.swatch)?t:e.primary}})})}),(0,i.jsx)(s.A,{children:e.name||"Untitled theme"}),(0,i.jsx)(c.Ay,{level:"body-xs",textColor:"text.tertiary",children:(0,u.nB)(e.id)?"built-in":"local"})]})},e.id)})})}},32153:(e,t,n)=>{n.d(t,{i:()=>a});var i=n(12115);function a(e){let[t,n]=i.useState({value:null,loading:!!e,error:null}),[a,r]=i.useState(0);return i.useEffect(()=>{if(!e)return void n({value:null,loading:!1,error:null});let t=!0;return n(e=>({...e,loading:!0,error:null})),e().then(e=>t&&n({value:e,loading:!1,error:null}),e=>t&&n(t=>({...t,loading:!1,error:e instanceof Error?e.message:"Something went wrong."}))),()=>{t=!1}},[e,a]),{...t,reload:i.useCallback(()=>r(e=>e+1),[]),set:i.useCallback(e=>n({value:e,loading:!1,error:null}),[])}}},35042:(e,t,n)=>{n.d(t,{R:()=>o,w:()=>s});var i=n(12115),a=n(89742),r=n(8518),l=n(32153);function o(){let{user:e,admin:t,adapter:n,live:o}=(0,r.Z)(),s=null==e?void 0:e.uid,d=i.useMemo(()=>s?()=>(0,a.AI)(s):null,[s,o]),c=(0,l.i)(d),[u,x]=i.useState(!1),[h,p]=i.useState(null),{set:m,value:g,reload:f}=c,j=i.useMemo(()=>{var e;return s&&null!=(e=null==g?void 0:g.filter(e=>e.uid===s))?e:null},[s,g]),v=i.useCallback(async(e,t,i)=>{x(!0),p(null);try{m(await (0,a.RD)(n,{uid:e,projectId:t},i))}catch(e){p(e instanceof Error?e.message:"The public pages were not saved.")}finally{x(!1)}},[n,m]);return{list:j,admin:t,busy:u,error:null!=h?h:c.error,find:(e,t)=>null==j?void 0:j.find(n=>n.uid===e&&n.projectId===t),set:v,reload:f}}function s(e,t,n){return n?"/".concat(n):"/page/".concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t))}},38182:(e,t,n)=>{n.d(t,{R:()=>r,U:()=>a});var i=n(90717);function a(e,t,n){let i=new Set([e,...t,...t.flatMap(e=>e.cards)].map(e=>e.themeId));return{page:e,sections:t,themes:n.filter(e=>i.has(e.id))}}function r(e){if(!(0,i.u4)(e)||!(0,i.u4)(e.page))return null;let{sections:t,themes:n}=e;if(!Array.isArray(t)||!Array.isArray(n))return null;let r=t.map(i.Bz),l=n.map(i.N_);return r.includes(null)||l.includes(null)?null:a((0,i.NL)(e.page),r,l.filter(e=>!(0,i.nB)(e.id)))}},42380:(e,t,n)=>{n.d(t,{v:()=>i});function i(e,t){let n=e.replace(/(\s+copy(\s+\d+)?)+$/i,""),i=/^(.*?)(\d+)$/.exec(n),a=i?i[1]:"".concat(n," "),r=new Set(t),l=i?Number(i[2]):1;do l+=1;while(r.has("".concat(a).concat(l)));return"".concat(a).concat(l)}},46315:(e,t,n)=>{n.d(t,{A:()=>ez});var i=n(95155),a=n(12115),r=n(90272),l=n(41530),o=n(5262),s=n(13673),d=n(15577),c=n(83561),u=n(58754),x=n(83351),h=n(20258),p=n(42380),m=n(87654),g=n(99640),f=n(33473),j=n(95189),v=n(55059),A=n(97360);function y(e){let{title:t,storageKey:n,reveal:r,children:o}=e,[s,d]=(0,A.d)(n,!0);return a.useEffect(()=>{r&&!s&&d()},[r]),(0,i.jsxs)(m.A,{component:"section","aria-label":t,sx:{p:1.25},children:[(0,i.jsxs)(l.A,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[(0,i.jsx)(l.A,{sx:{flex:1,minWidth:0},children:(0,i.jsx)(v.xw,{title:t})}),(0,i.jsx)(l.A,{sx:{height:32,display:"flex",alignItems:"center"},children:(0,i.jsx)(j.A,{label:t,collapsed:!s,onToggle:d})})]}),s?o:null]})}var b=n(31021),w=n(59456),C=n(12361),k=n(89280),I=n(60905),S=n(8374),z=n(20892),T=n(57364),L=n(82494),E=n(94540),P=n(11438),M=n(97363),W=n(89089),D=n(35378),R=n(8964),K=n(34809),U=n(36229),B=n(89167),N=n(57763),F=n(64213);function O(e,t,n){let[i,r]=a.useState(!1),l=(0,F.H)(e,t,n);return{over:l.over,target:l.target,header:{...l.source,draggable:i,onPointerDown:e=>r(!e.target.closest('input, textarea, button, a, form, [role="toolbar"], .MuiInput-root, .MuiSelect-root')),onPointerUp:()=>r(!1)}}}var G=n(47254),_=n(35866),H=n(35326);function J(){let e=new Set,t=new Map,n=new Map,i=null,a=null,r=()=>e.forEach(e=>e());return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),activeCard:e=>{var n;return null!=(n=t.get(e))?n:null},editor:e=>{var t;return null!=(t=n.get(e))?t:null},edited:()=>a,open(e,n,l){(t.get(e)!==n||a!==e)&&(i={sectionId:e,cardId:n,caret:l},t.set(e,n),a=e,r())},close(e,n){t.get(e)===n&&(t.delete(e),a===e&&(a=null),r())},release(){null!==a&&(a=null,r())},attach(e,t){n.set(e,t),r()},detach(e,t){n.get(e)===t&&(n.delete(e),r())},caret:e=>(null==i?void 0:i.cardId)===e?i.caret:"end"}}function X(e,t){return a.useSyncExternalStore(e.subscribe,t,t)}let Y=e=>"color-mix(in srgb, var(--joy-palette-primary-plainColor) ".concat(e,"%, transparent)"),$={border:"1px solid",borderColor:Y(18),borderRadius:"sm",px:1.25,py:.75,maxHeight:320,overflowY:"auto",cursor:"text","& .sw-prose":{fontSize:"calc(var(--sw-prose-font-size, 16px) * 0.9)"},"&:hover":{borderColor:Y(34)},"&:focus-within":{borderColor:Y(60)},"&:focus-visible":{outline:"none"}};function q(e){let{hub:t,sectionId:n,card:r,label:o,onChange:s}=e,d=X(t,()=>t.activeCard(n)===r.id),u=a.useMemo(()=>(0,c.Of)(r.content,(0,c.$P)(c.GM).schema),[r.content]),x=a.useRef(null),h=a.useCallback(e=>{e?t.attach(n,e):x.current&&t.detach(n,x.current),x.current=e},[t,n]);a.useEffect(()=>()=>t.close(n,r.id),[t,n,r.id]);let p=a.useRef(null);if(a.useEffect(()=>{var e;if(!d)return;let i=e=>{var t;return e instanceof Element&&!(null==(t=p.current)?void 0:t.contains(e))&&!e.closest('[data-heading-of="'.concat(n,'"], [role="listbox"]'))},a=()=>t.close(n,r.id),l=!1,o=e=>{l=i(e.target)},s=e=>{l&&i(e.target)&&a(),l=!1},c=!!(null==(e=p.current)?void 0:e.contains(document.activeElement)),u=e=>{var t;(null==(t=p.current)?void 0:t.contains(e.target))?c=!0:c&&i(e.target)&&a()};return document.addEventListener("pointerdown",o,!0),document.addEventListener("click",s,!0),document.addEventListener("focusin",u,!0),()=>{document.removeEventListener("pointerdown",o,!0),document.removeEventListener("click",s,!0),document.removeEventListener("focusin",u,!0)}},[d,t,n,r.id]),u.length>0)return(0,i.jsxs)(l.A,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,i.jsxs)(H.Ay,{level:"body-sm",color:"warning",role:"alert",children:["Editing is off: this card uses blocks this editor does not know (",u.join(", "),")."]}),(0,i.jsx)(l.A,{sx:$,children:(0,i.jsx)(c.GL,{content:r.content})})]});let m="Content of ".concat(o);return d?(0,i.jsx)(l.A,{ref:p,"data-testid":"card-editor",sx:$,children:(0,i.jsx)(c.N,{content:r.content,onChange:s,ariaLabel:m,onEditor:h,focusAt:t.caret(r.id),saveDelayMs:300,fallback:(0,i.jsx)(c.GL,{content:r.content})})}):(0,i.jsx)(l.A,{role:"textbox","aria-label":m,"aria-multiline":"true","aria-readonly":"true",tabIndex:0,onMouseDown:e=>{0===e.button&&(e.preventDefault(),t.open(n,r.id,{x:e.clientX,y:e.clientY}))},onClick:e=>{e.preventDefault(),t.open(n,r.id,"end")},onFocus:()=>t.open(n,r.id,"end"),sx:[$,{contentVisibility:"auto",containIntrinsicSize:"auto 120px"}],children:(0,i.jsx)(c.GL,{content:r.content})})}var V=n(87082),Z=n(10913),Q=n(84560),ee=n(9435),et=n(83147),en=n(13909),ei=n(59275),ea=n(65094),er=n(94886),el=n(64729),eo=n(78131),es=n(48627);let ed={"--IconButton-size":"".concat(20,"px"),"--IconButton-radius":"50%",minWidth:20,minHeight:20,"& svg":{fontSize:14}};function ec(e){var t;let{name:n,parent:a,following:r,look:l,choosing:o,onFollow:s,onMode:d,onChooseTheme:u}=e,x=(0,c.KJ)(e=>e.themes),h=(0,c.eW)(x,l.themeId),p=function(){let{mode:e,systemMode:t}=(0,Z.Ut)();return"dark"===("system"===e?t:e)?"dark":"light"}(),m=null!=(t=l.mode)?t:p,g="dark"===m?"light":"dark",f=h.name||"Untitled theme",j="Follow ".concat(a);return(0,i.jsx)(el.A,{compact:!0,lead:(0,i.jsx)(ee.A,{title:r?"Following the ".concat(a):j,variant:"soft",children:(0,i.jsx)(Q.Ay,{size:"sm",variant:"plain",color:"neutral","aria-label":j,"aria-pressed":r,onClick:s,sx:{...ed,color:r?es.r:"text.tertiary",'&:hover, &:active, &[aria-pressed="true"]':{bgcolor:"transparent",color:r?es.r:"text.primary"}},children:r?(0,i.jsx)(ea.A,{}):(0,i.jsx)(ei.A,{})})}),mode:(0,i.jsx)(ee.A,{title:"".concat("dark"===m?"Dark":"Light",". Switch to ").concat(g),variant:"soft",children:(0,i.jsx)(Q.Ay,{size:"sm",variant:"plain",color:"neutral","aria-label":"Switch ".concat(n," to ").concat(g),onClick:()=>d(g),sx:ed,children:"dark"===m?(0,i.jsx)(et.A,{}):(0,i.jsx)(en.A,{})})}),children:(0,i.jsx)(eo.A,{theme:h,look:o?"dynamic":"page",hint:"Theme: ".concat(f),label:"Theme of ".concat(n),"aria-pressed":o,"data-theme":h.id,"data-theme-drop":"",buttonSize:16,onClick:u,sx:{minWidth:20,minHeight:20,borderWidth:"1.5px","& svg":{fontSize:12}},children:(0,i.jsx)(er.A,{})})})}var eu=n(9958),ex=n(35447),eh=n(5058),ep=n(93609),em=n(87974);function eg(e){let{content:t,onApply:n,onClose:r}=e,[l,s]=a.useState(()=>(0,c.Mu)(t)),[d,u]=a.useState(!1);return(0,i.jsx)(eh.Ay,{open:!0,onClose:r,children:(0,i.jsxs)(ep.A,{component:"form",onSubmit:e=>{e.preventDefault();try{n((0,c.Kl)(l)),r()}catch(e){u(!0)}},sx:{width:"min(720px, 92vw)"},children:[(0,i.jsx)(ex.A,{children:"Card markdown"}),(0,i.jsx)(H.Ay,{level:"body-sm",textColor:"text.tertiary",children:"Applying replaces the card content. Formatting that markdown cannot express may be lost."}),(0,i.jsx)(em.A,{autoFocus:!0,minRows:10,maxRows:18,value:l,onChange:e=>s(e.target.value),slotProps:{textarea:{"aria-label":"Markdown"}},sx:{fontFamily:"code"}}),d?(0,i.jsx)(H.Ay,{level:"body-sm",color:"danger",role:"alert",children:"This markdown could not be converted."}):null,(0,i.jsxs)(eu.A,{children:[(0,i.jsx)(o.A,{type:"submit",children:"Apply"}),(0,i.jsx)(o.A,{variant:"plain",color:"neutral",onClick:r,children:"Cancel"})]})]})})}let ef="".concat(V.oo+V.Ah-8,"px"),ej=a.memo(function(e){let{sectionId:t,sectionThemeId:n,sectionFollow:r,sectionMode:o,choosingTheme:d,card:u,index:h,total:p,firstSection:f,lastSection:j,actions:v,hub:A}=e,[y,w]=a.useState(!1),C=(0,c.KJ)(e=>e.themes),k=(0,c.KJ)(e=>e.page.themeId),I=O(x.Xz,(0,x.qm)({sectionId:t,cardId:u.id}),(e,t)=>v.drop((0,x.Uv)(e),(0,x.Uv)(t))),S=(0,b.PY)(u.name,h),z={themeId:n,follow:r,mode:o},T=(0,c.s1)(C,k,z,u),L=a.useCallback(e=>v.change(t,u.id,e),[v,t,u.id]),E=a.useCallback(e=>L({content:e}),[L]),P=a.useMemo(()=>(0,c.Of)(u.content,(0,c.$P)(c.GM).schema).length>0,[u.content]);return(0,i.jsxs)(l.A,{component:"section",id:"".concat(N.L).concat(u.id),"aria-label":S,...(0,g.Cx)(t,u.id),...I.target,children:[(0,i.jsx)(G.A,{section:z,card:u,children:(0,i.jsxs)(m.A,{sx:{...V.Lt,outline:I.over?"2px solid":"none",outlineColor:"primary.solidBg"},children:[(0,i.jsx)(V.Ay,{"data-testid":"card-header",...I.header,sx:{cursor:"grab"},lead:(0,i.jsx)(l.A,{component:"span",title:"Drag to move",sx:{display:"inline-flex"},children:(0,i.jsx)(U.A,{"aria-hidden":!0})}),tools:(0,i.jsx)(ec,{name:S,parent:"section",following:(0,c.pk)(u),look:T,choosing:d,onFollow:()=>L({follow:!(0,c.pk)(u)}),onMode:e=>L((0,c.eK)(u,T,{mode:e})),onChooseTheme:()=>v.chooseTheme(t,u.id)}),actions:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_.Ay,{label:"Move card up",disabled:f&&0===h,onClick:()=>v.step({sectionId:t,cardId:u.id},-1),children:(0,i.jsx)(D.A,{})}),(0,i.jsx)(_.Ay,{label:"Move card down",disabled:j&&h===p-1,onClick:()=>v.step({sectionId:t,cardId:u.id},1),children:(0,i.jsx)(W.A,{})}),(0,i.jsx)(_.jx,{}),(0,i.jsx)(_.Ay,{label:"Add card",onClick:()=>v.addAfter(t,h),children:(0,i.jsx)(s.A,{})}),(0,i.jsx)(_.Ay,{label:"Duplicate card",onClick:()=>v.duplicate(t,u,h),children:(0,i.jsx)(R.A,{})}),(0,i.jsx)(_.jx,{}),(0,i.jsx)(_.Ay,{label:"Edit as markdown",disabled:P,onClick:()=>w(!0),children:(0,i.jsx)(B.A,{})}),(0,i.jsx)(_.Ay,{label:"Delete card",disabled:1===p,onClick:()=>v.remove(t,u.id),children:(0,i.jsx)(K.A,{})})]}),children:(0,i.jsx)(V.Xe,{text:u.name||S,weight:"lg",size:"sm",children:(0,i.jsx)(M.Ay,{size:"sm",variant:"plain",value:u.name,placeholder:S,onChange:e=>L({name:e.target.value}),slotProps:{input:{"aria-label":"Name of card ".concat(h+1),size:1}},sx:{fontWeight:"lg"}})})}),(0,i.jsx)(l.A,{sx:{pl:"".concat(V.Ah,"px"),py:.25,minWidth:0},children:(0,i.jsx)(q,{hub:A,sectionId:t,card:u,label:S,onChange:E})})]})}),y?(0,i.jsx)(eg,{content:u.content,onApply:E,onClose:()=>w(!1)}):null]})});var ev=n(86400),eA=n(41897),ey=n(81864);function eb(e){let{hub:t,sectionId:n}=e,a=X(t,()=>t.editor(n));return(0,i.jsx)(l.A,{"data-testid":"section-toolbar",sx:{pl:"".concat(V.Ah-4,"px"),pt:.25,cursor:"default"},children:(0,i.jsx)(c.tj,{editor:a})})}let ew=a.memo(function(e){let{section:t,index:n,total:a,inStream:r,collapsed:o,choosingTheme:d,actions:u,hub:p}=e,f=(0,c.KJ)(e=>e.themes),v=(0,c.KJ)(e=>e.page.themeId),A=(0,c.s1)(f,v,t),y=(0,c.KJ)(e=>e.page.barContent.length+e.page.barControls.length>0),w=X(p,()=>null!==p.activeCard(t.id))&&r,C=O("section-lane",t.id,u.drop),k=(0,x.vu)(t.id,u.dropCard),I=(0,b.a9)(t.title),S=e=>u.change(t.id,e);return(0,i.jsx)(l.A,{component:"section","aria-label":"Section: ".concat(I),"data-heading-of":t.id,...r?(0,g.Cx)(t.id):null,...(0,F.z)(C.target,k.target),"data-stuck":w||void 0,sx:w?{position:"sticky",top:function(e){let t=e?eA.rs.topOffset+eA.rs.glassBarHeightPx+8:eA.rs.topOffset,n=e?0:eA.rs.topReserve-eA.rs.topOffset;return{xs:"".concat(t-(eA.rs.contentStreamTopReserveCompactPx-n),"px"),lg:"".concat(t-(eA.rs.contentStreamTopReserveShellPx-n),"px")}}(y),zIndex:1}:void 0,children:(0,i.jsxs)(m.A,{"data-testid":"section-header",...C.header,sx:{...V.Lt,cursor:"grab",outline:C.over||k.over?"2px solid":"none",outlineColor:"primary.solidBg",...w?{"&&":{backgroundColor:"var(--joy-palette-background-surface)"}}:null},children:[(0,i.jsx)(V.Ay,{lead:(0,i.jsx)(l.A,{component:"span",title:"Drag to reorder",sx:{display:"inline-flex"},children:(0,i.jsx)(U.A,{"aria-hidden":!0})}),meta:(0,i.jsx)(h.A,{"data-testid":"section-meta",sx:V.Mo,markdown:"_{{number}} of {{total}}_ \xb7 =={{cards}}==",values:{number:n+1,total:a,cards:(0,ey.h)(t.cards.length,"card")}}),tools:(0,i.jsx)(ec,{name:I,parent:"page",following:(0,c.pk)(t),look:A,choosing:d,onFollow:()=>u.follow(t.id),onMode:e=>{var n;let i=(0,c.eK)(t,A,{mode:e});S({...i,themeId:null!=(n=i.themeId)?n:t.themeId})},onChooseTheme:()=>u.chooseTheme(t.id)}),actions:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_.Ay,{label:"Add section",onClick:()=>u.addAfter(t.id),children:(0,i.jsx)(s.A,{})}),(0,i.jsx)(_.Ay,{label:"Duplicate section",onClick:()=>u.duplicate(t.id),children:(0,i.jsx)(R.A,{})}),(0,i.jsx)(_.jx,{}),(0,i.jsx)(_.Ay,{label:"Delete section",color:"danger",onClick:()=>u.remove(t),children:(0,i.jsx)(K.A,{})}),(0,i.jsx)(_.jx,{}),(0,i.jsx)(j.A,{label:I,collapsed:o,onToggle:()=>u.toggle(t.id)})]}),children:(0,i.jsx)(V.Xe,{text:t.title||"Untitled section",weight:"lg",children:(0,i.jsx)(M.Ay,{size:"sm",variant:"plain",value:t.title,placeholder:"Untitled section",onChange:e=>S({title:e.target.value}),slotProps:{input:{"aria-label":"Section name",size:1}},sx:{fontSize:"md",fontWeight:"lg"}})})}),o?null:(0,i.jsx)(eb,{hub:p,sectionId:t.id})]})})});function eC(e){let t=new Set(e.map(e=>e.name)),n=e.length+1;for(;t.has("Card ".concat(n));)n+=1;return"Card ".concat(n)}function ek(e){let t=new Set(e.map(e=>e.title)),n=e.length+1;for(;t.has("Section ".concat(n));)n+=1;return"Section ".concat(n)}function eI(e){let{onClick:t,children:n="New section"}=e;return(0,i.jsx)(o.A,{variant:"outlined",color:"neutral",size:"sm",startDecorator:(0,i.jsx)(d.A,{}),onClick:t,children:n})}function eS(e){let{sectionId:t,onAdd:n,onDropCard:a}=e,r=(0,x.vu)(t,a);return(0,i.jsx)(l.A,{"data-testid":"empty-section",...(0,g.Cx)(t),...r.target,sx:{pl:ef,borderRadius:"md",outline:r.over?"2px dashed":"none",outlineColor:"primary.solidBg"},children:(0,i.jsx)(o.A,{size:"sm",variant:"plain",color:"neutral",startDecorator:(0,i.jsx)(s.A,{}),onClick:n,children:"Add card"})})}function ez(){var e,t,n;let{intro:o,data:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=(0,c.mu)(),{ready:g,sections:j,error:v}=(0,c.b8)(),{viewLayout:A}=(0,T.O)(),M="horizontal"===A,{activeSectionId:W,activeCardId:D,requestedSectionId:R,select:K,remeasure:U}=(0,k.z)(j,A),B=j.find(e=>e.id===W),N=(0,S.P)(R),[F]=a.useState(J),O=X(F,F.edited),G=null!=(e=j.find(e=>e.id===O))?e:B;a.useEffect(()=>F.release(),[F,W]),(0,z.l)(B,D);let _=(0,c.KJ)(e=>e.themes),H=(0,c.KJ)(e=>e.page),[Y,$]=a.useState(null),q=function(e,t){let n=e.find(e=>e.id===(null==t?void 0:t.sectionId));if(!n)return null;if(!(null==t?void 0:t.cardId))return{section:n,card:void 0};let i=n.cards.find(e=>e.id===t.cardId);return i?{section:n,card:i}:null}(j,Y),V=q?(0,c.s1)(_,H.themeId,q.section,q.card):null,Z=(0,E.c)(),Q=!!Y;a.useEffect(()=>{if(!Q)return;let e=e=>{var t,n;(null==(t=(n=e.target).closest)?void 0:t.call(n,"[data-theme-drop]"))||$(null)},t=e=>{"Escape"===e.key&&$(null)};return document.addEventListener("click",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("click",e),document.removeEventListener("keydown",t)}},[Q]);let ee=(0,I.K)((e,t)=>{let n=(null==Y?void 0:Y.sectionId)===e&&Y.cardId===t;$(n?null:{sectionId:e,cardId:t}),!n&&(null==Z?void 0:Z.paneCollapsed)&&Z.togglePane()}),et=(0,I.K)((e,t)=>{t&&N.expand(e),K(e,t)});(0,L.tT)(W,et);let en=(0,I.K)((e,t)=>{let n=d.getSnapshot().sections,i=n.findIndex(e=>e.id===t),a=i<0?void 0:n[i+1];d.saveSection(e),a&&d.moveSection(e.id,a.id),K(e.id)}),ei=()=>en((0,c.WI)(ek(j))),ea=(0,I.K)((e,t)=>{let n=d.getSnapshot().sections.find(t=>t.id===e);n&&d.saveSection(t(n))}),er=(0,I.K)((e,t)=>ea(e,e=>({...e,cards:t(e.cards)}))),el=(0,I.K)((e,t,n)=>{er(e,e=>[...e.slice(0,t),n,...e.slice(t)]),et(e,n.id)}),eo=(0,I.K)(e=>{N.toggle(e),M?K(e):U.current()}),es=(0,I.K)((e,t)=>{let n=d.getSnapshot().sections.find(e=>e.id===t.sectionId);if(!n)return;let i=t.cardId?n.cards.findIndex(e=>e.id===t.cardId):void 0;-1!==i&&d.moveCard(e,n.id,i)}),ed=(0,I.K)((e,t)=>{let n=(0,x.qN)(d.getSnapshot().sections,e,t);return n?(n.sectionId!==e.sectionId&&N.expand(n.sectionId),d.moveCard(e,n.sectionId,n.index)):null}),ec=a.useMemo(()=>({change:(e,t,n)=>{var i;let a=d.getSnapshot().sections,r=e=>e.cards.some(e=>e.id===t),l=null!=(i=a.find(t=>t.id===e&&r(t)))?i:a.find(r);l&&er(l.id,e=>e.map(e=>e.id===t?{...e,...n}:e))},chooseTheme:ee,step:ed,drop:es,addAfter:(e,t)=>{let n=d.getSnapshot().sections.find(t=>t.id===e);n&&el(e,t+1,(0,c.zY)(eC(n.cards)))},duplicate:(e,t,n)=>{let i=d.getSnapshot().sections.find(t=>t.id===e);if(!i)return;let a=(0,p.v)((0,b.PY)(t.name,n),i.cards.map(e=>e.name));el(e,n+1,(0,c.yM)(t,a))},remove:(e,t)=>{window.confirm("Delete this card?")&&er(e,e=>e.filter(e=>e.id!==t))}}),[d,er,el,ed,es,ee]),eu=a.useMemo(()=>({change:(e,t)=>ea(e,e=>({...e,...t})),chooseTheme:ee,follow:e=>ea(e,e=>{let t=!(0,c.pk)(e);return{...e,follow:t,cards:e.cards.map(e=>({...e,follow:t}))}}),drop:(e,t)=>d.moveSection(e,t),dropCard:es,addAfter:e=>en((0,c.WI)(ek(d.getSnapshot().sections)),e),duplicate:e=>{let t=d.getSnapshot().sections,n=t.find(t=>t.id===e);if(!n)return;let i=(0,p.v)((0,b.a9)(n.title),t.map(e=>e.title)),a=(0,c.WI)(i,n.themeId),r=n.cards.map(e=>(0,c.yM)(e,e.name)),{follow:l,mode:o}=n;en({...a,follow:l,mode:o,cards:r},e)},remove:e=>{window.confirm('Delete the section "'.concat((0,b.a9)(e.title),'"?'))&&d.deleteSection(e.id)},toggle:eo}),[d,ea,eo,en,es,ee]),ex=e=>(0,i.jsx)(ew,{section:e,index:j.indexOf(e),total:j.length,inStream:!M,collapsed:N.isCollapsed(e.id),choosingTheme:(null==q?void 0:q.section.id)===e.id&&!q.card,actions:eu,hub:F});return(0,i.jsxs)(P.default.View,{streamHeader:g?(0,i.jsxs)(l.A,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[(0,i.jsx)(ev.Ay,{}),G?(0,i.jsx)(a.Fragment,{children:ex(G)},G.id):null]}):null,sideNav:(0,i.jsx)(b.Ay,{sections:j,activeSectionId:W,activeCardId:D,onSelect:et,onMoveSection:eu.drop,onMoveCard:es,onStepCard:ed}),sidePane:(0,i.jsx)(u.p,{children:(0,i.jsxs)(u.SK,{children:[(0,i.jsx)(y,{title:null!=(t=null==s?void 0:s.title)?t:"Local data",storageKey:"sw.cdn.registry.data.open.v1",children:(0,i.jsx)(w.A,{hint:null==s?void 0:s.hint})}),(0,i.jsxs)(y,{title:"Theme",storageKey:"sw.cdn.registry.themes.open.v1",reveal:Y?"".concat(Y.sectionId," ").concat(null!=(n=Y.cardId)?n:""):void 0,children:[(0,i.jsx)(h.A,{"data-testid":"theme-target",sx:{px:.5,mb:.5},markdown:"=={{name}}==",values:{name:q?function(e){let{section:t,card:n}=e,i=(0,b.a9)(t.title);return n?"".concat(i," \xb7 ").concat((0,b.PY)(n.name,t.cards.indexOf(n))):i}(q):"Page"}}),(0,i.jsx)(C.A,{value:null==V?void 0:V.themeId,onPick:e=>{if(!q||!V)return void d.updatePage({themeId:e});let{section:t,card:n}=q;n?ec.change(t.id,n.id,(0,c.eK)(n,V,{themeId:e})):eu.change(t.id,(0,c.eK)(t,V,{themeId:e}))}})]})]})}),children:[v?(0,i.jsx)(l.A,{children:(0,i.jsx)(r.A,{color:"warning",children:v})}):null,g&&!M?(0,i.jsx)(l.A,{children:(0,i.jsx)(ev.Ay,{})}):null,g?o:null,g?0===j.length?(0,i.jsx)(l.A,{component:"section",children:(0,i.jsxs)(m.A,{sx:{textAlign:"center",py:5},children:[(0,i.jsx)(h.A,{markdown:"## No sections yet\n\nA section is a named group of cards. Create one to start writing.",sx:{mb:1.5,"& .sw-prose":{textAlign:"center"}}}),(0,i.jsx)(eI,{onClick:ei,children:"Create a section"})]})}):(0,i.jsx)(f.A,{gap:10,sections:j,isCollapsed:N.isCollapsed,onExpand:eo,renderHeader:ex,renderCards:e=>0===e.cards.length?(0,i.jsx)(eS,{sectionId:e.id,onAdd:()=>el(e.id,0,(0,c.zY)(eC(e.cards))),onDropCard:es}):e.cards.map((t,n)=>{var a;return(0,i.jsx)(ej,{sectionId:e.id,sectionThemeId:e.themeId,sectionFollow:e.follow,sectionMode:e.mode,choosingTheme:(null==q?void 0:q.section.id)===e.id&&(null==(a=q.card)?void 0:a.id)===t.id,card:t,index:n,total:e.cards.length,firstSection:e.id===j[0].id,lastSection:e.id===j[j.length-1].id,actions:ec,hub:F},t.id)}),onDropCard:es,renderTail:(e,t)=>t?(0,i.jsx)(l.A,{sx:{pl:ef},children:(0,i.jsx)(eI,{onClick:ei})}):null}):null]})}},48627:(e,t,n)=>{n.d(t,{r:()=>i});let i="#3b82f6"},59456:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(95155),a=n(12115),r=n(41530),l=n(5262),o=n(35326),s=n(83561),d=n(20258);let c={all:{hint:"The page, its sections and themes live in this browser. Importing replaces the page settings and entries with the same id.",file:"staffwriter-registry.json",exportLabel:"Export JSON",importLabel:"Import JSON",inputLabel:"Registry file"},themes:{hint:"Exports every theme. Importing adds them, replacing local themes with the same id; built-ins stay as they are.",file:"staffwriter-themes.json",exportLabel:"Export themes",importLabel:"Import themes",inputLabel:"Themes file"}};function u(e){let{scope:t="all",hint:n}=e,u=(0,s.mu)(),x=a.useRef(null),[h,p]=a.useState(""),m=c[t],g=async e=>{var n;let i=null==(n=e.target.files)?void 0:n[0];if(e.target.value="",i){if(i.size>5242880)return void p("The file is larger than 5 MB.");try{let e=u.importBundle(await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(String(n.result)),n.onerror=()=>t(n.error),n.readAsText(i)}),{themesOnly:"themes"===t});p(e.ok?["themes"===t?"Imported ".concat(e.themes," theme(s)."):"Imported ".concat(e.sections," section(s) and ").concat(e.themes," theme(s)."),...e.errors].join(" "):e.errors.join(" "))}catch(e){p("The file could not be read.")}}};return(0,i.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,i.jsx)(d.A,{markdown:"{{hint}}",values:{hint:null!=n?n:m.hint},sx:{color:"text.tertiary","& .sw-prose.sw-prose":{color:"inherit"}}}),(0,i.jsxs)(r.A,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:[(0,i.jsx)(l.A,{size:"sm",variant:"soft",onClick:()=>{let e="themes"===t?u.exportThemes():u.exportBundle(),n=URL.createObjectURL(new Blob([e],{type:"application/json"})),i=document.createElement("a");i.href=n,i.download=m.file,i.click(),URL.revokeObjectURL(n)},children:m.exportLabel}),(0,i.jsx)(l.A,{size:"sm",variant:"outlined",color:"neutral",onClick:()=>{var e;return null==(e=x.current)?void 0:e.click()},children:m.importLabel})]}),(0,i.jsx)("input",{ref:x,type:"file",accept:"application/json,.json","aria-label":m.inputLabel,onChange:g,hidden:!0}),(0,i.jsx)(o.Ay,{level:"body-xs",role:"status",children:h})]})}},86400:(e,t,n)=>{n.d(t,{aT:()=>U,Ay:()=>Z});var i=n(95155),a=n(12115),r=n(41530),l=n(5262),o=n(99021),s=n(64652),d=n(97363),c=n(87974),u=n(93485),x=n(36279),h=n(21704),p=n(31709),m=n(72179),g=n(83561),f=n(32763),j=n(67714),v=n(23937),A=n(14458),y=n(11966),b=n(6114);let w={logo:{label:"Logo",Icon:f.A},title:{label:"Title",Icon:A.A},sections:{label:"Sections",Icon:y.A}},C={layout:{label:"Layout",Icon:b.A},orientation:{label:"Orientation",Icon:v.A},style:{label:"Style",Icon:j.A}};var k=n(59779),I=n(58245),S=n(22969),z=n(35866),T=n(20258),L=n(35454),E=n(95189),P=n(81864),M=n(87654),W=n(87344),D=n(97360),R=n(87082);let K=a.createContext(null),U=K.Provider;function B(e){let{label:t,children:n}=e;return(0,i.jsxs)(o.A,{size:"sm",orientation:"horizontal",sx:{alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[(0,i.jsx)(s.A,{sx:{width:F,m:0},children:t}),n]})}function N(e,t){return e.map(e=>{let{label:n,Icon:a}=t[e];return(0,i.jsx)(l.A,{value:e,startDecorator:(0,i.jsx)(a,{}),children:n},e)})}let F=92,O="@container (max-width: 700px)",G={gridArea:"actions",justifySelf:"end",height:32,display:"flex",alignItems:"center",gap:"1px",mr:"-".concat(9,"px")},_={display:"flex",flexWrap:"wrap",alignItems:"center",columnGap:2,rowGap:.5,minHeight:28,[O]:{flexDirection:"column",justifyContent:"center",'& > [role="group"]':{justifyContent:"center"}}},H={display:"flex",flexWrap:"wrap",alignItems:"center",gap:.5,ml:"auto","& + *":{ml:0},[O]:{mx:"auto",justifyContent:"center","& + *":{mx:"auto"}}},J={ml:"auto",maxWidth:"100%",[O]:{mx:"auto","& .sw-prose.sw-prose p":{whiteSpace:"normal",textAlign:"center"}}},X={display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",width:312,maxWidth:"100%","& > button":{minWidth:0,whiteSpace:"nowrap",px:.5,fontSize:"xs","--Button-gap":"4px"},"& > button svg":{fontSize:16},"@container (max-width: 380px)":{"& > button":{flexDirection:"column",justifyContent:"center",py:.5,px:"2px"},"& > button > span":{margin:0}}};function Y(e){let{label:t,modes:n,options:a,value:r,onChange:l}=e;return(0,i.jsx)(u.A,{size:"sm",variant:"outlined",color:"neutral","aria-label":t,value:r,onChange:(e,t)=>t&&l(t),sx:X,children:N(n,a)})}function $(e){let{label:t,choices:n,options:a,value:r,onChange:l}=e;return(0,i.jsx)(u.A,{size:"sm",variant:"outlined",color:"neutral","aria-label":t,value:r,onChange:(e,t)=>l(n.filter(e=>t.includes(e))),sx:X,children:N(n,a)})}function q(){let e=(0,g.mu)(),{page:t}=(0,g.b8)();return(0,i.jsx)(r.A,{"data-testid":"page-settings",sx:{flexShrink:0,minWidth:0},children:(0,i.jsxs)(r.A,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,i.jsx)(B,{label:"Background",children:(0,i.jsx)(Y,{label:"Page background",modes:g.k_,options:k.M,value:t.background,onChange:t=>e.updatePage({background:t})})}),(0,i.jsx)(B,{label:"Glass bar",children:(0,i.jsx)($,{label:"Glass bar",choices:g.Dz,options:w,value:t.barContent,onChange:t=>e.updatePage({barContent:t})})}),(0,i.jsx)(B,{label:"Appearance",children:(0,i.jsx)($,{label:"Appearance",choices:g.fj,options:C,value:t.barControls,onChange:t=>e.updatePage({barControls:t})})})]})})}function V(){let e=(0,g.mu)(),{page:t}=(0,g.b8)();return(0,i.jsx)(c.A,{size:"sm",variant:"plain",minRows:1,maxRows:6,value:t.description,placeholder:"Add a preface",onChange:t=>e.updatePage({description:t.target.value}),slotProps:{textarea:{"aria-label":"Page preface",maxLength:g.Ku}},sx:{"--Textarea-paddingInline":"0px",bgcolor:"transparent",fontSize:"sm",color:"text.tertiary"}})}function Z(){let e=(0,g.mu)(),{page:t,sections:n}=(0,g.b8)(),l=(0,g.u8)(t,n),o=(0,I.wM)(),[s,c]=(0,D.d)("sw.cdn.page.open.v1",!0),u=n.reduce((e,t)=>e+t.cards.length,0),{currentId:f}=(0,g.tF)(),j=a.useContext(K),v={render:f?(0,L.lf)("/renderer",f):S.y3,preview:f?(0,L.lf)("/",f):"/"},A=null!=j?j:v;return(0,i.jsx)(r.A,{component:"section","aria-label":"Page settings",children:(0,i.jsxs)(M.A,{"data-testid":"page-header",sx:{...R.Lt,containerType:"inline-size"},children:[(0,i.jsxs)(r.A,{sx:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gridTemplateAreas:s?'"title actions" "preface settings"':'"title actions"',alignItems:"start",columnGap:3,rowGap:.5,[O]:{gridTemplateAreas:s?'"title actions" "preface preface" "settings settings"':'"title actions"',rowGap:1}},children:[(0,i.jsx)(R.Ay,{lead:(0,i.jsx)(x.A,{"aria-hidden":!0}),sx:{gridArea:"title",minHeight:32,minWidth:0},children:(0,i.jsx)(R.Xe,{text:t.title,weight:"xl",children:(0,i.jsx)(d.Ay,{size:"sm",variant:"plain",value:t.title,onChange:t=>e.updatePage({title:t.target.value}),slotProps:{input:{"aria-label":"Page title",size:1}},sx:{fontSize:"md",fontWeight:"xl",...t.title?null:{"&&":{minWidth:160}}}})})}),(0,i.jsxs)(r.A,{sx:G,children:[f||j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(z.Ay,{label:"All pages",href:"/registry",sameTab:!0,children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(z.jx,{})]}):null,(0,i.jsx)(z.Ay,{label:"Render",href:A.render,sameTab:!0,children:(0,i.jsx)(m.A,{})}),A.preview?(0,i.jsx)(z.Ay,{label:"Preview",href:A.preview,children:(0,i.jsx)(p.A,{})}):null,(0,i.jsx)(z.jx,{}),(0,i.jsx)(E.A,{label:"page settings",collapsed:!s,onToggle:c})]}),s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.A,{sx:{gridArea:"preface",pl:"".concat(R.Ah,"px"),minWidth:0},children:(0,i.jsx)(V,{})}),(0,i.jsx)(r.A,{sx:{gridArea:"settings",justifySelf:"end",minWidth:0,maxWidth:"100%"},children:(0,i.jsx)(q,{})})]}):null]}),s?(0,i.jsxs)(r.A,{sx:{pl:"".concat(R.Ah,"px"),mt:6,[O]:{pl:0}},children:[(0,i.jsx)(T.A,{markdown:"---"}),(0,i.jsxs)(r.A,{sx:_,children:[(0,i.jsx)(W.A,{createdAt:t.createdAt,editedAt:l}),j?(0,i.jsx)(r.A,{sx:H,children:j.state}):null,(0,i.jsx)(T.A,{"data-testid":"page-meta",sx:[R.Mo,J],markdown:"_Page_ \xb7 =={{sections}}== \xb7 =={{cards}}== \xb7 =={{theme}}== \xb7 =={{background}}==",values:{sections:(0,P.h)(n.length,"section"),cards:(0,P.h)(u,"card"),theme:o.name||"Untitled theme",background:k.M[t.background].label}})]})]}):null]})})}},87082:(e,t,n)=>{n.d(t,{Ah:()=>s,Ay:()=>u,Lt:()=>c,Mo:()=>h,Xe:()=>x,oo:()=>d});var i=n(95155);n(12115);var a=n(41530),r=n(35866),l=n(60459);let o=l.$S,s=o+l.kA,d=l.yx-1,c={pl:"".concat(d,"px"),pr:"".concat(l.T-1,"px"),py:.75};function u(e){let{lead:t,meta:n,tools:s,actions:d,children:c,sx:u,...x}=e;return(0,i.jsxs)(a.A,{...x,sx:[{containerType:"inline-size",display:"flex",alignItems:"center",flexWrap:{xs:"wrap",sm:"nowrap"},columnGap:"".concat(8,"px")},...Array.isArray(u)?u:u?[u]:[]],children:[(0,i.jsx)(a.A,{component:"span",sx:{width:o,mr:"".concat(l.kA-8,"px"),flexShrink:0,display:"inline-flex",justifyContent:"center",color:"text.tertiary","--Icon-fontSize":"16px","& svg":{fontSize:16}},children:t}),(0,i.jsxs)(a.A,{sx:{flex:"1 1 0",minWidth:{xs:120,sm:160},"@container (max-width: 560px)":{gap:1,minWidth:120},display:"flex",alignItems:"center",gap:1.25,"& .MuiInput-root":{"--Input-paddingInline":"0px","--Input-minHeight":"".concat(r.mc,"px")}},children:[c,n?(0,i.jsx)(a.A,{sx:{flex:s?"0 1 auto":"1 1 0",minWidth:0},children:n}):null,s?(0,i.jsx)(a.A,{sx:{flexShrink:0,display:"flex"},children:s}):null]}),d?(0,i.jsx)(a.A,{sx:{flexShrink:0,ml:"auto",mr:"-".concat(6,"px"),display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"1px"},children:d}):null]})}function x(e){let{text:t,weight:n,size:r="md",children:l}=e;return(0,i.jsx)(a.A,{"data-value":t,sx:{display:"grid",gridTemplateColumns:"minmax(0, auto)",flex:"0 1 auto",minWidth:0,fontFamily:"body",fontSize:r,fontWeight:n,"&::after":{content:'attr(data-value) " "',gridArea:"1 / 1",height:0,overflow:"hidden",visibility:"hidden",whiteSpace:"pre"},"& > *":{gridArea:"1 / 1",minWidth:0}},children:l})}let h={"& .sw-prose":{fontSize:"calc(var(--sw-prose-font-size, 16px) * 0.75)"},"& .sw-prose.sw-prose p":{my:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},89742:(e,t,n)=>{async function i(e){let t=await e.json().catch(()=>null);if(e.ok&&t)return t;throw Error("string"==typeof(null==t?void 0:t.error)?t.error:"The server answered ".concat(e.status,"."))}async function a(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET",a=arguments.length>3?arguments[3]:void 0,r=await (null==e?void 0:e.idToken());if(!r)throw Error("Sign in first.");return i(await fetch(t,{method:n,cache:"no-store",headers:{authorization:"Bearer ".concat(r),...void 0===a?null:{"content-type":"application/json"}},body:void 0===a?void 0:JSON.stringify(a)}))}async function r(){return(await i(await fetch("/api/home",{cache:"no-store"}))).home}async function l(e,t){return(await a(e,"/api/home",t?"PUT":"DELETE",null!=t?t:void 0)).home}async function o(e){let t="/api/pages?uid=".concat(encodeURIComponent(e));return(await i(await fetch(t,{cache:"no-store"}))).pages}async function s(e,t,n){return(await a(e,"/api/pages",n?"POST":"DELETE",t)).pages}async function d(e,t){await a(e,"/api/pages","PUT",{projects:t.map(e=>{let{id:t,title:n,draft:i,urlAlias:a}=e;return{projectId:t,title:n,published:!i,...a?{urlAlias:a}:null}})})}async function c(e,t,n){await a(e,"/api/aliases","PUT",{projectId:t,alias:n})}async function u(e){return(await a(e,"/api/connections")).connections}async function x(e,t){return(await a(e,"/api/connections","PUT",{connections:t})).connections}n.d(t,{AI:()=>o,If:()=>u,Iz:()=>d,RD:()=>s,XA:()=>l,fH:()=>x,qi:()=>r,sV:()=>c})},90717:(e,t,n)=>{n.d(t,{Bz:()=>i.Bz,NL:()=>i.NL,N_:()=>a.N_,nB:()=>a.nB,u4:()=>i.u4}),n(65991);var i=n(22545);n(29460);var a=n(94673)},97360:(e,t,n)=>{n.d(t,{d:()=>a});var i=n(12115);function a(e,t){let[n,a]=i.useState(()=>(function(e,t){try{let n=window.localStorage.getItem(e);return"true"===n||"false"===n?"true"===n:t}catch(e){return t}})(e,t)),r=i.useCallback(()=>{let t=!n;try{window.localStorage.setItem(e,String(t))}catch(e){}a(t)},[e,n]);return[n,r]}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8245],{8518:(e,t,r)=>{r.d(t,{L:()=>u,Z:()=>p});var n=r(95155),i=r(12115);let l={user:null,admin:!1,adminReason:null,problem:null,live:0},a={...l,status:"loading"},o=e=>"function"==typeof(null==e?void 0:e.then);function s(e){let t=new Set,r=a,n=null,i=!1;function s(e){r=e,t.forEach(e=>e())}let d=e=>s({...l,status:"unavailable",problem:e});function c(e,t){var n;(null==(n=r.user)?void 0:n.uid)===e&&s({...r,admin:t.admin,adminReason:t.reason})}function u(e){if(!e)return s({...l,status:"signedOut"});let t=(null==(i=r.user)?void 0:i.uid)===e.uid;if(s({...t?r:l,status:"signedIn",user:e}),t||!n)return;var i,a=e.uid;let d=()=>{var e;(null==(e=r.user)?void 0:e.uid)===a&&s({...r,live:r.live+1})};null==n||n.publishLive(a).then(d,d);let u=()=>c(e.uid,{admin:!1,reason:"The server could not check this account."});try{let t=n.isAdmin();o(t)?t.then(t=>c(e.uid,t),u):c(e.uid,t)}catch(e){u()}}function h(e){if(!e)return d("Sign-in is not set up on this server.");n=e,e.subscribe(u)}return{getState:()=>r,adapter:()=>n,subscribe:e=>(t.add(e),()=>{t.delete(e)}),start(){if(i)return;i=!0;let t=()=>d("Sign-in could not be started. Reload to try again.");try{let r=e();o(r)?r.then(h).catch(t):h(r)}catch(e){t()}}}}let d=s(()=>null),c=i.createContext(d);function u(e){let{connect:t,children:r}=e,[l]=i.useState(()=>s(t));return(0,n.jsx)(c.Provider,{value:l,children:r})}let h=e=>e;function p(){let e=i.useContext(c);return{...function(e){let t=i.useContext(c);return i.useEffect(()=>t.start(),[t]),i.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(a))}(h),adapter:e.adapter()}}},22545:(e,t,r)=>{r.d(t,{Bz:()=>s,NL:()=>c,u4:()=>a});var n=r(65991),i=r(63960),l=r(29460);function a(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function o(e){let{mode:t,follow:r}=e;return{..."light"===t||"dark"===t?{mode:t}:null,..."boolean"==typeof r?{follow:r}:null}}function s(e){if(!a(e)||e.schemaVersion!==l.f$||"string"!=typeof e.id||!e.id||!Array.isArray(e.cards))return null;let t=new Set,r=[];for(let i of e.cards){let e=function(e){var t;if(!a(e)||"string"!=typeof e.id||!e.id)return null;let r=void 0===e.content?(0,n.jg)():function e(t,r){return!(r>64)&&!!a(t)&&"string"==typeof t.type&&(void 0===t.text||"string"==typeof t.text)&&(void 0===t.attrs||null===t.attrs||!!a(t.attrs))&&(void 0===t.marks||!!Array.isArray(t.marks)&&!!t.marks.every(e=>a(e)&&"string"==typeof e.type))&&(void 0===t.content||Array.isArray(t.content)&&t.content.every(t=>e(t,r+1)))}(t=e.content,0)&&"doc"===t.type?t:null;if(!r)return null;let{themeId:i,mode:l,follow:s,...d}=e;return{...d,id:e.id,name:"string"==typeof e.name?e.name:"",content:r,..."string"==typeof i?{themeId:i}:null,...o(e)}}(i);if(!e)return null;t.has(e.id)&&(e.id=(0,n.sX)("card")),t.add(e.id),r.push(e)}let{mode:s,follow:d,...c}=e;return{...c,...o(e),schemaVersion:l.f$,id:e.id,title:"string"==typeof e.title?e.title:"",themeId:"string"==typeof e.themeId?e.themeId:"default",cards:r,updatedAt:(0,i.vE)(e.updatedAt)}}function d(e,t,r){return Array.isArray(e)?t.filter(t=>e.includes(t)):r}function c(e){let{glassBar:t,showLayoutControls:r,showOrientationControls:n,showStyleControls:o,...s}=a(e)?e:{},c=function(e){if("none"===e.glassBar)return{barContent:[],barControls:[]};let t={layout:"showLayoutControls",orientation:"showOrientationControls",style:"showStyleControls"};return{barContent:"sections"===e.glassBar?["logo","sections"]:[...l._U.barContent],barControls:l.fj.filter(r=>!1!==e[t[r]])}}(a(e)?e:{});return{...s,title:"string"==typeof s.title?s.title:l._U.title,description:"string"==typeof s.description?s.description.slice(0,l.Ku):l._U.description,createdAt:(0,i.vE)(s.createdAt),updatedAt:(0,i.vE)(s.updatedAt),themeId:"string"==typeof s.themeId&&s.themeId?s.themeId:l._U.themeId,background:l.k_.includes(s.background)?s.background:l._U.background,barContent:d(s.barContent,l.Dz,c.barContent),barControls:d(s.barControls,l.fj,c.barControls)}}},29460:(e,t,r)=>{r.d(t,{Dz:()=>a,Ku:()=>s,_U:()=>d,aX:()=>i,f$:()=>n,fj:()=>o,k_:()=>l});let n=1,i="",l=["none","page","dynamic"],a=["logo","title","sections"],o=["layout","orientation","style"],s=600,d={title:"",description:"",createdAt:0,updatedAt:0,themeId:"default",background:"dynamic",barContent:["logo","title"],barControls:[...o]}},44503:(e,t,r)=>{r.d(t,{H:()=>v,e:()=>b});var n=r(35057),i=r.n(n),l=r(65105),a=r.n(l),o=r(8196),s=r.n(o),d=r(38958),c=r.n(d),u=r(91729),h=r.n(u),p=r(21358),g=r.n(p),f=r(65114),m=r.n(f),y=r(83561);let v={sans:"Inter",serif:"Georgia",book:"Lora",mono:"Source Code Pro",display:"Playfair Display",rounded:"Nunito",apple:"SF Pro \xb7 Geist",news:"New York \xb7 Newsreader"},b={sans:i().style.fontFamily,serif:y.ms.serif,book:c().style.fontFamily,mono:a().style.fontFamily,display:s().style.fontFamily,rounded:h().style.fontFamily,apple:'-apple-system, BlinkMacSystemFont, "SF Pro Text", '.concat(g().style.fontFamily),news:"ui-serif, ".concat(m().style.fontFamily)}},49236:(e,t,r)=>{r.d(t,{B:()=>i,D:()=>l});let n={apiKey:/^[\w-]{20,128}$/,authDomain:/^[a-z0-9.-]{4,253}$/i,projectId:/^[a-z0-9-]{4,40}$/,storageBucket:/^[a-z0-9][a-z0-9._-]{1,220}[a-z0-9]$/,appId:/^[\w:.-]{1,128}$/};function i(e,t){return"string"==typeof t&&n[e].test(t)}function l(e){if("object"!=typeof e||null===e)return null;let{apiKey:t,authDomain:r,projectId:n,storageBucket:l,appId:a}=e;return i("apiKey",t)&&i("authDomain",r)&&i("projectId",n)&&i("storageBucket",l)?{apiKey:t,authDomain:r,projectId:n,storageBucket:l,...i("appId",a)?{appId:a}:null}:null}},50797:(e,t,r)=>{r.d(t,{Ob:()=>o,eU:()=>d,mt:()=>c});var n=r(95155),i=r(12115),l=r(83561);let a=i.createContext(null);function o(e){let{children:t}=e,r=(0,l.mu)(),[o]=i.useState(()=>(function(e){let t=new Set,r=e,n=null,i=()=>t.forEach(e=>e()),l=()=>{null==n||n(),n=t.size?r.subscribe(i):null};return{store:{getSnapshot:()=>r.getSnapshot(),subscribe:e=>(t.add(e),n||l(),()=>{t.delete(e),t.size||l()}),updatePage:e=>r.updatePage(e),saveSection:e=>r.saveSection(e),deleteSection:e=>r.deleteSection(e),moveSection:(e,t)=>r.moveSection(e,t),moveCard:(e,t,n)=>r.moveCard(e,t,n),saveTheme:e=>r.saveTheme(e),deleteTheme:e=>r.deleteTheme(e),exportBundle:()=>r.exportBundle(),exportThemes:()=>r.exportThemes(),importBundle:(e,t)=>r.importBundle(e,t)},show(t){let n=null!=t?t:e;n!==r&&(r=n,l(),i())}}})(r)),s=i.useMemo(()=>({base:r,show:o.show}),[r,o]);return(0,n.jsx)(a.Provider,{value:s,children:(0,n.jsx)(l.xF,{store:o.store,children:t})})}function s(){let e=i.useContext(a);if(!e)throw Error("This needs <OpenRegistry>.");return e}function d(){return s().base}function c(e){let{show:t}=s(),[r,n]=i.useState(null);return i.useLayoutEffect(()=>{if(e)return t(e),n(e),()=>t(null)},[e,t]),!!e&&r===e}},58245:(e,t,r)=>{r.d(t,{eF:()=>I,default:()=>O,Wi:()=>j,wM:()=>A,VV:()=>C});var n=r(95155),i=r(12115),l=r(10913),a=r(6344),o=r(4224),s=r(83561),d=r(8518),c=r(49236);let u=async()=>{let e=await fetch("/api/config",{cache:"no-store"});if(!e.ok)throw Error("The server answered ".concat(e.status,"."));let t=(0,c.D)((await e.json()).firebase);if(!t)return null;let{firebaseAdapter:n}=await Promise.all([r.e(5310),r.e(2319),r.e(5094)]).then(r.bind(r,85094));return n(t)},h={...s.SS,id:"app",name:"App",primary:"#52525b",gradient:"softGray",glass:{blur:20,lightOpacity:.32,darkOpacity:.42},surface:void 0,prose:{...s.SS.prose,headingTone:"ink"}};var p=r(44503),g=r(74286),f=r(20063),m=r(22390);function y(e){let{options:t,CacheProvider:r=m.C,children:l}=e,[a]=i.useState(()=>{let e=(0,g.A)(t);e.compat=!0;let r=e.insert,n=[];return e.insert=function(){for(var t=arguments.length,i=Array(t),l=0;l<t;l++)i[l]=arguments[l];let[a,o]=i;return void 0===e.inserted[o.name]&&n.push({name:o.name,isGlobal:!a}),r(...i)},{cache:e,flush:()=>{let e=n;return n=[],e}}});return(0,f.useServerInsertedHTML)(()=>{let e=a.flush();if(0===e.length)return null;let t="",r=a.cache.key,l=[];return e.forEach(e=>{let{name:n,isGlobal:i}=e,o=a.cache.inserted[n];"boolean"!=typeof o&&void 0!==o&&(i?l.push({name:n,style:o}):(t+=o,r+=" ".concat(n)))}),(0,n.jsxs)(i.Fragment,{children:[l.map(e=>{let{name:t,style:r}=e;return(0,n.jsx)("style",{"data-emotion":"".concat(a.cache.key,"-global ").concat(t),dangerouslySetInnerHTML:{__html:r}},t)}),t&&(0,n.jsx)("style",{"data-emotion":r,dangerouslySetInnerHTML:{__html:t}})]})}),(0,n.jsx)(r,{value:a.cache,children:l})}var v=r(50797);let b={styleOverrides:{root:{backgroundColor:"transparent"}}},x=(0,s.H8)(h,p.e,{JoyInput:b,JoySelect:b,JoyTextarea:b}),k={":root":(0,s.P4)(h)},w=i.createContext(s.SS),S=i.createContext(()=>{});function A(){let e=(0,s.KJ)(e=>e.themes),t=(0,s.KJ)(e=>e.page.themeId);return(0,s.eW)(e,t)}function j(){let e=(0,s.KJ)(e=>e.page),t=i.useContext(w),r=A(),n="dynamic"===e.background?t:r;return{mode:e.background,theme:n,gradient:"none"===e.background?null:n.gradient}}function C(e){let t=i.useContext(S);i.useEffect(()=>(t(null!=e?e:null),()=>t(null)),[e,t])}function B(e){let{children:t}=e,r=(0,s.KJ)(e=>e.themes),l=(0,s.KJ)(e=>e.page),[a,o]=i.useState(null),d=(0,s.eW)(r,(0,s.CA)(r,a,l.themeId));return(0,n.jsx)(S.Provider,{value:o,children:(0,n.jsx)(w.Provider,{value:d,children:t})})}function I(e){let{store:t,children:r}=e;return(0,n.jsx)(s.xF,{store:t,children:(0,n.jsx)(B,{children:r})})}function z(e){let{children:t}=e;return(0,n.jsx)(v.Ob,{children:(0,n.jsx)(B,{children:t})})}function O(e){let{store:t,library:r,cloud:c=u,children:h}=e,[p]=i.useState(()=>t?null:null!=r?r:(0,s.xI)((0,s.UB)()));return(0,n.jsx)(y,{options:{key:"joy"},children:(0,n.jsxs)(l.Zr,{theme:x,children:[(0,n.jsx)(a.A,{}),(0,n.jsx)(o.A,{styles:k}),(0,n.jsx)(d.L,{connect:c,children:p?(0,n.jsx)(s.C2,{library:p,children:(0,n.jsx)(z,{children:h})}):(0,n.jsx)(s.xF,{store:t,children:(0,n.jsx)(z,{children:h})})})]})})}},63960:(e,t,r)=>{function n(e){return"number"==typeof e&&e>0&&e<=864e13?e:0}function i(e){return e.reduce((e,t)=>{let{updatedAt:r}=t;return r&&(!e||r<e)?r:e},0)}function l(e,t){return t.reduce((e,t)=>{let{updatedAt:r}=t;return Math.max(e,r)},e.updatedAt)}r.d(t,{R8:()=>i,u8:()=>l,vE:()=>n})},65991:(e,t,r)=>{r.d(t,{DO:()=>c,WI:()=>o,WQ:()=>d,jg:()=>l,sX:()=>i,yM:()=>s,zY:()=>a});var n=r(29460);function i(e){var t;let r=new Uint8Array(6);return"function"==typeof(null==(t=globalThis.crypto)?void 0:t.getRandomValues)?globalThis.crypto.getRandomValues(r):r.forEach((e,t)=>r[t]=Math.floor(256*Math.random())),"".concat(e,"-").concat(Array.from(r,e=>e.toString(16).padStart(2,"0")).join(""))}function l(){return{type:"doc",content:[{type:"paragraph"}]}}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l();return{id:i("card"),name:e,content:t}}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.aX;return{schemaVersion:n.f$,id:i("section"),title:e,themeId:t,cards:[a("Card 1")],updatedAt:Date.now()}}function s(e,t){return{...JSON.parse(JSON.stringify(e)),id:i("card"),name:t}}function d(e,t,r){let n=e.findIndex(e=>e.id===t),i=e.findIndex(e=>e.id===r);return n<0||i<0?e:function(e,t,r){let n=t+r;if(t<0||t>=e.length||n<0||n>=e.length)return e;let i=[...e],[l]=i.splice(t,1);return i.splice(n,0,l),i}(e,n,i-n)}function c(e,t,r,n){let l=e.find(e=>e.id===t.sectionId),a=e.find(e=>e.id===r),o=l?l.cards.findIndex(e=>e.id===t.cardId):-1;if(!l||!a||o<0)return e;let s=l.cards.filter((e,t)=>t!==o),d=l===a?s:[...a.cards],c=Math.max(0,Math.min(null!=n?n:d.length,d.length));if(l===a&&c===o)return e;let u=l.cards[o];return d.some(e=>e.id===u.id)&&(u={...u,id:i("card")}),d.splice(c,0,u),e.map(e=>e===a?{...e,cards:d}:e===l?{...e,cards:s}:e)}},83561:(e,t,r)=>{r.d(t,{k_:()=>n.k_,Dz:()=>n.Dz,fj:()=>n.fj,Cn:()=>d.Cn,zs:()=>O,T0:()=>s.T,N:()=>eE,GL:()=>eW,_U:()=>n._U,mn:()=>d.mn,SS:()=>d.SS,Ku:()=>n.Ku,tj:()=>e7,C3:()=>o.C,C2:()=>Y,Ny:()=>F,xF:()=>V,f$:()=>n.f$,ms:()=>u,HK:()=>d.HK,WB:()=>z,Mu:()=>eS,zY:()=>i.zY,sX:()=>i.sX,xI:()=>$,dZ:()=>R,WI:()=>i.WI,GM:()=>ei,yM:()=>i.yM,$P:()=>ep,Of:()=>eb,pk:()=>y,V4:()=>A,nB:()=>d.nB,fd:()=>d.fd,u8:()=>a.u8,UB:()=>J,Kl:()=>ew,z0:()=>_,eK:()=>b,CA:()=>d.CA,s1:()=>v,eW:()=>d.eW,YJ:()=>eA,P4:()=>S,H8:()=>m,tF:()=>ee,gG:()=>Z,b8:()=>en,KJ:()=>er,mu:()=>et});var n=r(29460),i=r(65991),l=r(22545),a=r(63960),o=r(93952),s=r(97300),d=r(94673),c=r(27427);let u={sans:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',serif:'Georgia, "Times New Roman", serif',book:'Cambria, "Palatino Linotype", Georgia, serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",display:'"Palatino Linotype", "Book Antiqua", Georgia, serif',rounded:'ui-rounded, "Segoe UI", system-ui, sans-serif',apple:'-apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif',news:'ui-serif, "New York", Cambria, Georgia, serif'},h=(e,t,r)=>"color-mix(in srgb, ".concat(e," ").concat(t,"%, ").concat(r,")");function p(e){let t=t=>h(e,t,"white");return{solidBg:e,solidHoverBg:h(e,85,"black"),solidActiveBg:h(e,70,"black"),plainColor:e,plainHoverBg:t(10),plainActiveBg:t(20),outlinedColor:e,outlinedBorder:t(45),outlinedHoverBg:t(10),outlinedActiveBg:t(20),softColor:h(e,80,"black"),softBg:t(12),softHoverBg:t(20),softActiveBg:t(30)}}function g(e){let t=h(e,45,"white"),r=t=>h(e,t,"black");return{solidBg:e,solidHoverBg:h(e,85,"white"),solidActiveBg:h(e,70,"white"),plainColor:t,plainHoverBg:r(25),plainActiveBg:r(35),outlinedColor:t,outlinedBorder:r(60),outlinedHoverBg:r(25),outlinedActiveBg:r(35),softColor:h(e,30,"white"),softBg:r(30),softHoverBg:r(40),softActiveBg:r(50)}}function f(e){return{xs:"".concat(Math.round(.25*e),"px"),sm:"".concat(Math.round(.75*e),"px"),md:"".concat(e,"px"),lg:"".concat(Math.round(1.5*e),"px"),xl:"".concat(2*e,"px")}}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r=arguments.length>2?arguments[2]:void 0,{primary:n,radius:i}=e;return(0,c.A)({components:r,fontFamily:{body:t[e.font],display:t[e.headingFont],code:t.mono},radius:f(i),colorSchemes:{light:{palette:{primary:p(n)}},dark:{palette:{primary:g(n)}}}})}function y(e){var t;return null!=(t=e.follow)?t:!e.themeId}function v(e,t,r,n){var i;let l=[n,r].filter(e=>!!e&&!y(e));return{themeId:(0,d.CA)(e,...l.map(e=>e.themeId),t),mode:null==(i=l.find(e=>e.mode))?void 0:i.mode}}function b(e,t,r){var n;return y(e)?{themeId:e.themeId||t.themeId||"",mode:null!=(n=e.mode)?n:t.mode,...r,follow:!1}:{...r,follow:!1}}let x=e=>[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)).join(", "),k={thin:{width:1,light:42,dark:48},regular:{width:2,light:46,dark:52},bold:{width:3,light:62,dark:66}},w={light:"rgba(255,255,255,0.55)",dark:"rgba(255,255,255,0.10)"};function S(e){var t,r,n,i,l,a;let{headingScale:o,headingTone:s,headingWeight:c}=e.prose,u=e=>"".concat(Number((o**e).toFixed(3)),"em");return{"--sw-prose-heading-weight":String(c),"--sw-prose-h1":u(3),"--sw-prose-h2":u(2),"--sw-prose-h3":u(1),"--sw-prose-heading-color":"accent"===s?"var(--joy-palette-primary-plainColor)":"inherit","--sw-ink-light":null!=(n=null==(t=e.ink)?void 0:t.light)?n:"var(--joy-palette-text-primary)","--sw-ink-dark":null!=(i=null==(r=e.ink)?void 0:r.dark)?i:"var(--joy-palette-text-primary)",...function(e){var t,r;let{border:n="off",primary:i}=e,l="off"===n?null:k[n],a=(e,t)=>"color-mix(in srgb, ".concat(t," ").concat(e,"%, transparent)");return{"--sw-card-edge-width":"".concat(null!=(t=null==l?void 0:l.width)?t:1,"px"),"--sw-card-edge-light":l?a(l.light,i):w.light,"--sw-card-edge-dark":l?a(l.dark,"color-mix(in srgb, ".concat(i," 65%, white)")):w.dark,"--sw-card-frame-width":"".concat(null!=(r=null==l?void 0:l.width)?r:0,"px"),"--sw-card-frame-pad":l?"24px":"0px"}}(e),"--sw-glass-blur":"".concat(e.glass.blur,"px"),"--sw-glass-light-rgb":x((null!=(l=e.surface)?l:d.mn).light),"--sw-glass-dark-rgb":x((null!=(a=e.surface)?a:d.mn).dark),"--sw-glass-light-opacity":String(e.glass.lightOpacity),"--sw-glass-dark-opacity":String(e.glass.darkOpacity),"--sw-prose-font-size":"".concat(e.prose.fontSize,"px"),"--sw-prose-line-height":String(e.prose.lineHeight)}}let A=e=>({backdropFilter:"blur(var(--sw-glass-blur, 20px)) saturate(180%)",WebkitBackdropFilter:"blur(var(--sw-glass-blur, 20px)) saturate(180%)",backgroundColor:"rgba(var(--sw-glass-light-rgb, 255, 255, 255), var(--sw-glass-light-opacity, 0.32))",borderStyle:"solid",borderWidth:"var(--sw-card-edge-width, 1px)",borderColor:"var(--sw-card-edge-light, ".concat(w.light,")"),boxShadow:"0 1px 2px rgba(15,18,23,0.06), 0 8px 24px -12px rgba(15,18,23,0.18)",[e.getColorSchemeSelector("dark")]:{backgroundColor:"rgba(var(--sw-glass-dark-rgb, 15, 18, 23), var(--sw-glass-dark-opacity, 0.42))",borderColor:"var(--sw-card-edge-dark, ".concat(w.dark,")"),boxShadow:"0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.55)"}}),j=(e,t)=>Object.fromEntries(Object.entries(t).map(t=>{let[r,n]=t;return["".concat(e).concat(r),n]}));var C=r(95155),B=r(12115),I=r(41530);let z=B.forwardRef(function(e,t){let{theme:r,fonts:n=u,mode:i,sx:l,...a}=e;return(0,C.jsx)(I.A,{ref:t,...a,"data-theme-scope":r.id,...i?{"data-joy-color-scheme":i}:null,sx:[e=>{var t;return{...i?(t=S(r),{...t,"--sw-glass-light-opacity":String(.94),"--sw-glass-dark-opacity":String(.94),..."light"===i?{"--sw-glass-dark-rgb":t["--sw-glass-light-rgb"],"--sw-card-edge-dark":t["--sw-card-edge-light"],"--sw-ink-dark":t["--sw-ink-light"]}:null,color:"var(--joy-palette-text-primary)"}):S(r),"--joy-fontFamily-body":n[r.font],"--joy-fontFamily-display":n[r.headingFont],...j("--joy-radius-",f(r.radius)),...j("--joy-palette-primary-",p(r.primary)),fontFamily:"var(--joy-fontFamily-body)",...i?{"&&":j("--joy-palette-primary-",p(r.primary))}:null,..."light"===i?null:{[e.getColorSchemeSelector("dark")]:j("--joy-palette-primary-",g(r.primary))},..."dark"===i?{"&&&":j("--joy-palette-primary-",g(r.primary))}:null}},...Array.isArray(l)?l:l?[l]:[]]})});function O(e){let{gradient:t,sx:r,...n}=e;return(0,C.jsx)(I.A,{"aria-hidden":!0,...n,"data-backdrop":null!=t?t:"none",sx:[{position:"absolute",inset:0,zIndex:-1,pointerEvents:"none"},...Array.isArray(r)?r:r?[r]:[]],children:Object.entries(o.C).map(e=>{let[r,n]=e;return(0,C.jsx)(I.A,{"data-backdrop-layer":r,sx:e=>{var i;return{position:"absolute",inset:0,backgroundImage:n.light,backgroundRepeat:null!=(i=n.repeat)?i:"no-repeat",opacity:+(r===t),transition:"opacity ".concat(120,"ms ease-out"),"@media (prefers-reduced-motion: reduce)":{transition:"none"},[e.getColorSchemeSelector("dark")]:{backgroundImage:n.dark}}}},r)})})}let T="sw.cdn.registry.v1",W="staffwriter.registry",F=3,N=[1,2,3],E={page:n._U,sections:[],themes:[]},L={...E,ready:!1,error:null};function H(e,t){let r=[],n=[];for(let i of Array.isArray(e)?e:[]){let e=t(i);e?r.push(e):n.push(i)}return{items:r,rejected:n}}let M=e=>({...e,updatedAt:Date.now()});function P(e,t){return e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t]}function R(e){let t=new Set,r=null,n=null,o=!1,s=null,c={sections:[],themes:[]};function u(){var t;let r=null;c={sections:[],themes:[]};try{r=e.read()}catch(e){return{...E,ready:!0,error:"Local storage is not available."}}if(n=r,null===r)return{...E,ready:!0,error:null};let i=function(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!(0,l.u4)(t))return null;let r=!Array.isArray(t.sections)&&Array.isArray(t.pages),n=H(r?t.pages:t.sections,l.Bz),i=H(t.themes,d.N_),o=(0,l.NL)(r?{themeId:t.activeThemeId}:t.page);return{data:{page:{...o,createdAt:o.createdAt||(0,a.R8)(n.items)},sections:n.items,themes:i.items.filter(e=>!(0,d.nB)(e.id))},unreadable:{sections:n.rejected,themes:i.rejected},legacy:r}}(r);i&&(c=i.unreadable);let o=i&&!c.sections.length&&!c.themes.length;return((!o||i.legacy)&&function(t){try{e.backup(t)}catch(e){}}(r),o)?{...i.data,ready:!0,error:null}:{...null!=(t=null==i?void 0:i.data)?t:E,ready:!0,error:"Some saved entries could not be read. A backup copy was kept."}}function h(){return null!=r||(r=u()),r}function p(){t.forEach(e=>e())}function g(t){let i=o?h():function(){if(r)try{if(e.read()===n)return r}catch(e){}return u()}(),{page:l,sections:a,themes:s}=i,d=t({page:l,sections:a,themes:s}),g=d.page.createdAt||d.page===l&&d.sections===a?d:{...d,page:{...d.page,createdAt:Date.now()}},f=i.error;try{let t=JSON.stringify({version:F,...g,sections:[...g.sections,...c.sections],themes:[...g.themes,...c.themes]});e.write(t),n=t,o&&(f=null),o=!1}catch(e){o=!0,f="Could not save to local storage. Export your work to keep it."}r={...g,ready:!0,error:f},p()}let f=e=>JSON.stringify({format:W,schemaVersion:F,...e},null,2);return{getSnapshot:h,subscribe:n=>(t.add(n),null!=s||(s=e.subscribe(()=>{o=!1,r=u(),p()})),()=>{t.delete(n),0===t.size&&(null==s||s(),s=null,o||(r=null))}),updatePage(e){g(t=>({...t,page:M((0,l.NL)({...t.page,...e}))}))},saveSection(e){g(t=>({...t,sections:P(t.sections,{...e,updatedAt:Date.now()})}))},deleteSection(e){g(t=>{let r=t.sections.filter(t=>t.id!==e);return r.length===t.sections.length?t:{...t,sections:r,page:M(t.page)}})},moveSection(e,t){g(r=>{let n=(0,i.WQ)(r.sections,e,t);return n===r.sections?r:{...r,sections:n,page:M(r.page)}})},moveCard(e,t,r){let n=null;return g(l=>{var a,o,s;let d=(0,i.DO)(l.sections,e,t,r);if(d===l.sections)return l;let c=new Set(null==(a=l.sections.find(e=>e.id===t))?void 0:a.cards.map(e=>e.id));n=null!=(s=null==(o=d.find(e=>e.id===t).cards.find(e=>!c.has(e.id)))?void 0:o.id)?s:e.cardId;let u=Date.now();return{...l,sections:d.map((e,t)=>e===l.sections[t]?e:{...e,updatedAt:u})}}),n},saveTheme(e){let t=(0,d.N_)(e);!t||(0,d.nB)(t.id)||g(e=>({...e,themes:P(e.themes,t)}))},deleteTheme(e){g(t=>({...t,page:t.page.themeId===e?{...t.page,themeId:d.SS.id}:t.page,themes:t.themes.filter(t=>t.id!==e)}))},exportBundle(){let{page:e,sections:t,themes:r}=h();return f({page:e,sections:t,themes:r})},exportThemes:()=>f({sections:[],themes:[...d.Cn,...h().themes]}),importBundle(e,t){let r,n=e=>({ok:!1,sections:0,themes:0,errors:[e]});try{r=JSON.parse(e)}catch(e){return n("The file is not valid JSON.")}let i=(0,l.u4)(r)?r.schemaVersion:void 0;if(!(0,l.u4)(r)||r.format!==W||!N.includes(i))return n("The file is not a StaffWriter registry export.");let o=1===i?r.pages:r.sections,s=H((null==t?void 0:t.themesOnly)?[]:o,l.Bz),c=H(r.themes,d.N_),u=c.items.filter(e=>!(0,d.nB)(e.id)),h=!(null==t?void 0:t.themesOnly)&&(0,l.u4)(r.page)?(0,l.NL)(r.page):null,p=[];return s.rejected.length&&p.push("".concat(s.rejected.length," section(s) could not be read.")),c.rejected.length&&p.push("".concat(c.rejected.length," theme(s) could not be read.")),g(e=>{let t=h?{...h,createdAt:h.createdAt||e.page.createdAt||(0,a.R8)(s.items)}:e.page;return{page:h||s.items.length?M(t):t,sections:s.items.reduce(P,e.sections),themes:u.reduce(P,e.themes)}}),{ok:!0,sections:s.items.length,themes:u.length,errors:p}}}}function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;return{read:()=>window.localStorage.getItem(e),write:t=>window.localStorage.setItem(e,t),backup:t=>window.localStorage.setItem("".concat(e,".backup"),t),subscribe(t){let r=r=>{(r.key===e||null===r.key)&&t()};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}}}function _(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e,r=[],n=new Set;return{backups:r,read:()=>t,write(e){t=e},backup(e){r.push(e)},subscribe:e=>(n.add(e),()=>{n.delete(e)}),writeExternally(e){t=e,n.forEach(e=>e())}}}let D="".concat(T,".");function J(){return{at:e=>U(e),remove:e=>window.localStorage.removeItem(e)}}let K={ready:!1,pages:[],currentId:""};function G(e){if(null===e)return null;try{let t=JSON.parse(e);return(0,l.u4)(t)?t:null}catch(e){return null}}function $(e){let t=new Set,r=new Set,a=new Map,o=null,s=null,d=null,c=()=>e.at("sw.cdn.pages.v1");function u(e){o=e;try{c().write(JSON.stringify({version:1,...e}))}catch(e){}}function h(){if(o)return o;let e=null;try{let t=c().read();e=function(e){let t=G(e);if(!t||!Array.isArray(t.pages))return null;let r=t.pages.filter(e=>(0,l.u4)(e)&&"string"==typeof e.id&&!!e.id&&"string"==typeof e.key&&(e.key===T||e.key.startsWith(D)));if(!r.length)return null;let n=r.some(e=>e.id===t.current)?t.current:r[0].id;return{pages:r,current:n}}(t),null===t||e||c().backup(t)}catch(e){}if(e)o=e;else{let e=(0,i.sX)("doc");u({pages:[{id:e,key:T}],current:e})}return o}function p(t){var r,i;let{key:l}=t;return l===T?e.at(l):(r=e.at(l),i=e.at(T),{read(){var e;let t=r.read(),n=G(t);if(!n)return t;let l=null==(e=G(i.read()))?void 0:e.themes;return JSON.stringify({...n,themes:Array.isArray(l)?l:[]})},write(e){let{themes:t,...l}=JSON.parse(e),a=i.read(),o=G(a);if(null!==a&&!o)throw Error("The shared themes cannot be read.");r.write(JSON.stringify(l)),i.write(JSON.stringify({...null!=o?o:{version:F,page:n._U,sections:[]},themes:t}))},backup:e=>r.backup(e),subscribe(e){let t=[r.subscribe(e),i.subscribe(e)];return()=>t.forEach(e=>e())}})}let g=e=>h().pages.find(t=>t.id===e),f=()=>{var e;let t;return e=g(h().current),(t=a.get(e.id))||(t=R(p(e)),a.set(e.id,t)),t};function m(){s=null,t.forEach(e=>e())}function y(){r.forEach(e=>e()),m()}function v(){let e=null==o?void 0:o.current;o=null;let t=h();e&&t.pages.some(t=>t.id===e)&&(o={...t,current:e}),b(),y()}function b(){if(null==d||d(),d=null,!t.size&&!r.size)return;let{pages:n,current:i}=h(),l=[f().subscribe(y),c().subscribe(v),...n.filter(e=>e.id!==i).map(t=>e.at(t.key).subscribe(m))];d=()=>l.forEach(e=>e())}function x(e,n){return e.add(n),d||b(),()=>{e.delete(n),t.size||r.size||(null==d||d(),d=null)}}function k(e){let t=e.current!==h().current;u(e),b(),t&&r.forEach(e=>e()),m()}function w(t,r){let n=(0,i.sX)("doc"),l="".concat(D).concat(n);try{e.at(l).write(JSON.stringify({version:F,page:t,sections:r}))}catch(e){}let{pages:a,current:o}=h();return k({pages:[...a,{id:n,key:l}],current:o}),n}function S(e){let t=e.id===h().current?f().getSnapshot():R(p(e)).getSnapshot();return{id:e.id,page:t.page,sections:t.sections}}return{store:{getSnapshot:()=>f().getSnapshot(),subscribe:e=>x(r,e),updatePage:e=>f().updatePage(e),saveSection:e=>f().saveSection(e),deleteSection:e=>f().deleteSection(e),moveSection:(e,t)=>f().moveSection(e,t),moveCard:(e,t,r)=>f().moveCard(e,t,r),saveTheme:e=>f().saveTheme(e),deleteTheme:e=>f().deleteTheme(e),exportBundle:()=>f().exportBundle(),exportThemes:()=>f().exportThemes(),importBundle:(e,t)=>f().importBundle(e,t)},getSnapshot:()=>(null!=s||(s={ready:!0,pages:h().pages.map(S),currentId:h().current}),s),subscribe:e=>x(t,e),open:e=>!!g(e)&&(h().current!==e&&k({...h(),current:e}),!0),create:()=>w(n._U,[]),duplicate(e,t){let r=g(e);if(!r)return null;let{page:n,sections:l}=S(r),a=Date.now(),o=l.map(e=>({...e,id:(0,i.WI)(e.title,e.themeId).id,cards:e.cards.map(e=>(0,i.yM)(e,e.name))}));return w({...n,title:t,createdAt:a,updatedAt:a},o)},remove(t){let{pages:r,current:i}=h(),l=g(t);if(!l||1===r.length)return!1;let o=r.filter(e=>e.id!==t);k({pages:o,current:i===t?o[0].id:i}),a.delete(t);try{if(l.key===T){var s,d;let t=e.at(l.key),r=null!=(d=null==(s=G(t.read()))?void 0:s.themes)?d:[];t.write(JSON.stringify({version:F,page:n._U,sections:[],themes:r}))}else e.remove(l.key)}catch(e){}return!0}}}let q=B.createContext(null);function V(e){let{store:t,children:r}=e,[n]=B.useState(()=>null!=t?t:R(U()));return(0,C.jsx)(q.Provider,{value:n,children:r})}let X=B.createContext(null);function Y(e){let{library:t,children:r}=e,[n]=B.useState(()=>t);return(0,C.jsx)(X.Provider,{value:n,children:(0,C.jsx)(V,{store:n.store,children:r})})}function Z(){return B.useContext(X)}let Q=()=>()=>{};function ee(){var e;let t=Z();return B.useSyncExternalStore(null!=(e=null==t?void 0:t.subscribe)?e:Q,()=>{var e;return null!=(e=null==t?void 0:t.getSnapshot())?e:K},()=>K)}function et(){let e=B.useContext(q);if(!e)throw Error("useRegistryStore must be used inside <RegistryProvider>");return e}function er(e){let t=et();return B.useSyncExternalStore(t.subscribe,()=>e(t.getSnapshot()),()=>e(L))}function en(){let e=et();return B.useSyncExternalStore(e.subscribe,e.getSnapshot,()=>L)}let ei=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Set;for(let{type:r}of e){if(t.has(r))throw Error('Block type "'.concat(r,'" is registered twice'));t.add(r)}let r=[...e];return{list:()=>r}}();var el=r(76908),ea=r(12751),eo=r(63660),es=r(75699),ed=r(19148),ec=r(80762),eu=r(35895);let eh=new WeakMap;function ep(e){let t=eh.get(e);if(!t){let r=[eu.W.configure({link:{openOnClick:!1,defaultProtocol:"https"}}),ea.f4,eo._V,es.R0,ed.n.configure({types:["heading","paragraph"]}),ec.oz,...e.list().flatMap(e=>e.extension?[e.extension]:[])];t={extensions:r,schema:(0,el._w)(r)},eh.set(e,t)}return t}let eg=["http","https","mailto","tel"],ef=["http","https"],em=/^data:image\/(png|jpe?g|gif|webp|avif);base64,/i;function ey(e,t){var r;if("string"!=typeof e)return!1;let n=Array.from(e).filter(e=>{var t,r;return!((r=null!=(t=e.codePointAt(0))?t:0)<=32||r>=127&&r<=160||r>=8192&&r<=8207||8232===r||8233===r||65279===r)}).join("");if(!n)return!1;if("image"===t&&em.test(n))return!0;let i=null==(r=/^([a-z][a-z0-9+.-]*):/i.exec(n))?void 0:r[1];return!i||("link"===t?eg:ef).includes(i.toLowerCase())}function ev(e){let t={...e};return e.marks&&(t.marks=e.marks.filter(e=>{var t;return"link"!==e.type||ey(null==(t=e.attrs)?void 0:t.href,"link")})),e.content&&(t.content=e.content.filter(e=>{var t;return"image"!==e.type||ey(null==(t=e.attrs)?void 0:t.src,"image")}).map(ev)),t}function eb(e,t){let r=new Set,n=e=>{var i,l;e.type&&!t.nodes[e.type]&&r.add(e.type),null==(i=e.marks)||i.forEach(e=>{t.marks[e.type]||r.add(e.type)}),null==(l=e.content)||l.forEach(n)};return n(e),Array.from(r)}let ex=new WeakMap;function ek(e){let t=ex.get(e);return t||(t=new ec.db({extensions:ep(e).extensions}),ex.set(e,t)),t}function ew(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ei,n=ek(r).parse(e);return(null==(t=n.content)?void 0:t.length)?ev(n):(0,i.jg)()}function eS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ei;return ek(t).serialize(e)}function eA(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ei,n=e=>({...e,...void 0!==e.text?{text:e.text.replace(/\{\{(\w+)\}\}/g,(e,r)=>{var n;return String(null!=(n=t[r])?n:e)})}:null,...e.content?{content:e.content.map(n)}:null});return n(ew(e,r))}let ej=e=>"color-mix(in srgb, var(--joy-palette-primary-plainColor) ".concat(e,"%, transparent)"),eC={fontFamily:"body",fontSize:"var(--sw-prose-font-size, 16px)",lineHeight:"var(--sw-prose-line-height, 1.65)",color:"var(--sw-ink-light, var(--joy-palette-text-primary))","[data-joy-color-scheme='dark'] &":{color:"var(--sw-ink-dark, var(--joy-palette-text-primary))"},width:"100%",textAlign:"left",minWidth:0,overflowWrap:"break-word",whiteSpace:"pre-wrap","& .ProseMirror":{outline:"none",minHeight:"1.65em"},"& p, & ul, & ol, & blockquote, & pre":{my:"0.6em"},"& h1, & h2, & h3, & h4, & h5, & h6":{fontFamily:"display",fontWeight:"var(--sw-prose-heading-weight, 700)",color:"var(--sw-prose-heading-color, inherit)",lineHeight:1.25,mt:"1em",mb:"0.4em"},"& h1":{fontSize:"var(--sw-prose-h1, 1.95em)"},"& h2":{fontSize:"var(--sw-prose-h2, 1.56em)"},"& h3":{fontSize:"var(--sw-prose-h3, 1.25em)"},"& h4, & h5, & h6":{fontSize:"1em"},"& :is(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6)":{mt:"0.35em"},"& p:empty::before":{content:'"\\00a0"'},"& ul, & ol":{pl:"1.9em"},"& ul":{listStyleType:"disc"},"& ul ul":{listStyleType:"circle"},"& li > p":{my:"0.2em"},"& a":{color:"primary.plainColor"},"& mark":{display:"inline-block",bgcolor:ej(11),color:"primary.plainColor",borderRadius:"999px",px:"0.7em",py:"0.1em",fontSize:"0.86em",fontWeight:600,lineHeight:1.5,maxWidth:"100%",verticalAlign:"baseline"},"& :is(h1, h2, h3, h4, h5, h6) mark":{fontSize:"0.7em",px:"0.65em",py:"0.15em",verticalAlign:"middle"},"& blockquote":{mx:0,pl:"1em",borderLeft:"2px solid",borderColor:ej(40),opacity:.85,fontStyle:"italic"},"& code":{fontFamily:"code",fontSize:"0.88em",bgcolor:ej(8),borderRadius:"xs",px:"0.3em"},"& pre":{bgcolor:ej(7),borderRadius:"md",p:"0.8em 1em",overflowX:"auto"},"& pre code":{bgcolor:"transparent",p:0},"& .tableWrapper":{overflowX:"auto"},"& table":{width:"100%",borderCollapse:"collapse",my:"0.8em",fontSize:"0.92em"},"& th, & td":{textAlign:"left",verticalAlign:"top",p:"0.4em 0.7em",borderBottom:"1px solid",borderColor:ej(16)},"& th:first-of-type, & td:first-of-type":{pl:0},"& th:last-of-type, & td:last-of-type":{pr:0},"& th":{fontWeight:600,color:"primary.plainColor",borderColor:ej(45)},"& th p, & td p":{my:0},"& td":{fontVariantNumeric:"tabular-nums"},"& tr:hover > td":{bgcolor:ej(6)},"& .selectedCell":{bgcolor:"primary.softHoverBg"},"& hr":{border:0,borderTop:"1px solid",borderColor:ej(18),my:"1.2em",mx:0},"& img":{display:"block",maxWidth:"100%",height:"auto",borderRadius:"sm"},"& img.ProseMirror-selectednode":{outline:"2px solid",outlineColor:"primary.solidBg"},"& > *:first-child, & .ProseMirror > *:first-child":{mt:0},"& > *:last-child, & .ProseMirror > *:last-child":{mb:0}};var eB=r(78779),eI=r(35326);function ez(e){let{name:t}=e;return(0,C.jsxs)(eI.Ay,{level:"body-sm",color:"warning",variant:"soft","data-unsupported-block":t,sx:{px:1,py:.5,my:1,borderRadius:"sm"},children:["Unsupported block: ",t]})}function eO(e){let{content:t,registry:r}=e;return B.useMemo(()=>{let e=function(e){var t;let r=e.content;if(!r)return e;let n=r.length;for(;n>1&&"paragraph"===r[n-1].type&&!(null==(t=r[n-1].content)?void 0:t.length);)n-=1;return n===r.length?e:{...e,content:r.slice(0,n)}}(t),n={};for(let{type:e,View:t}of r.list())t&&(n[e]=e=>{let{node:r,children:n}=e;return(0,C.jsx)(t,{attrs:r.attrs,children:n})});return(0,C.jsx)(C.Fragment,{children:(0,eB.xu)({extensions:ep(r).extensions,content:ev(e),options:{nodeMapping:n,unhandledNode:e=>{let{node:t}=e;return(0,C.jsx)(ez,{name:t.type.name})},unhandledMark:e=>{let{children:t}=e;return(0,C.jsx)(C.Fragment,{children:t})}}})})},[t,r])}class eT extends B.Component{static getDerivedStateFromError(){return{failed:!0}}static getDerivedStateFromProps(e,t){return e.content===t.content?null:{failed:!1,content:e.content}}render(){return this.state.failed?(0,C.jsx)(eI.Ay,{level:"body-sm",color:"danger",role:"alert",children:"This card could not be rendered."}):this.props.children}constructor(...e){super(...e),this.state={failed:!1,content:this.props.content}}}let eW=B.memo(function(e){let{content:t,registry:r=ei}=e;return(0,C.jsx)(I.A,{className:"sw-prose",sx:eC,children:(0,C.jsx)(eT,{content:t,children:(0,C.jsx)(eO,{content:t,registry:r})})})});var eF=r(51876),eN=r(154);function eE(e){let{content:t,onChange:r,registry:n=ei,ariaLabel:i="Card content",onEditor:l,focusAt:a=null,saveDelayMs:o=0,fallback:s=null,sx:d}=e,c=B.useRef({onChange:r,onEditor:l,saveDelayMs:o,focusAt:a});c.current={onChange:r,onEditor:l,saveDelayMs:o,focusAt:a};let u=B.useRef(null),h=B.useRef(),p=B.useCallback(()=>{window.clearTimeout(h.current);let e=u.current;e&&(u.current=null,c.current.onChange(e))},[]),g=(0,eN.hGv)({extensions:ep(n).extensions,content:ev(t),immediatelyRender:!1,editorProps:{attributes:{"aria-label":i,role:"textbox","aria-multiline":"true"}},onUpdate:e=>{let{editor:t}=e;u.current=t.getJSON(),window.clearTimeout(h.current),c.current.saveDelayMs>0?h.current=window.setTimeout(p,c.current.saveDelayMs):p()},onBlur:p},[n]);return(B.useEffect(()=>(window.addEventListener("pagehide",p),()=>{window.removeEventListener("pagehide",p),p()}),[p]),B.useEffect(()=>{var e,t;if(g)return null==(e=(t=c.current).onEditor)||e.call(t,g),()=>{var e,t;return null==(e=(t=c.current).onEditor)?void 0:e.call(t,null)}},[g]),B.useEffect(()=>{let e=c.current.focusAt;if(!g||!e)return;let t=window.requestAnimationFrame(()=>{g.isDestroyed||function(e,t){var r,n,i;let l=null;if(t)try{l=null!=(i=null==(n=e.view.posAtCoords({left:t.x,top:t.y}))?void 0:n.pos)?i:null}catch(e){}let a=t=>{var r,n;let i=e.state.doc.resolve(t);return i.parent.inlineContent?i.pos:null==(r=null!=(n=eF.LN.findFrom(i,1,!0))?n:eF.LN.findFrom(i,-1,!0))?void 0:r.from},{doc:o}=e.state,s=a(null!=l?l:o.content.size);void 0!==s&&(null!==l||(null==(r=o.lastChild)?void 0:r.isTextblock))||(e.commands.insertContentAt(o.content.size,{type:"paragraph"}),s=a(e.state.doc.content.size)),e.commands.focus(null!=s?s:"end",{scrollIntoView:!1})}(g,"end"===e?null:e)});return()=>window.cancelAnimationFrame(t)},[g]),B.useEffect(()=>{if(!g||g.isDestroyed||u.current)return;let e=ev(t);try{if(g.schema.nodeFromJSON(e).eq(g.state.doc))return}catch(e){return}g.commands.setContent(e,{emitUpdate:!1})},[g,t]),g)?(0,C.jsx)(I.A,{className:"sw-prose",sx:[eC,...Array.isArray(d)?d:d?[d]:[]],children:(0,C.jsx)(eN.$Z$,{editor:g,className:"sw-editor"})}):(0,C.jsx)(C.Fragment,{children:s})}var eL=r(5262),eH=r(84560),eM=r(97363),eP=r(9435),eR=r(68909),eU=r(59951),e_=r(18991),eD=r(77387),eJ=r(13124),eK=r(44894),eG=r(25939),e$=r(79040),eq=r(36163),eV=r(3447),eX=r(55806),eY=r(21307),eZ=r(78096),eQ=r(15039),e0=r(68042),e5=r(65094),e1=r(32430),e2=r(25464);function e4(e){let{idle:t,label:r,active:n,disabled:i,onClick:l,children:a}=e,o=t||i,s=(0,C.jsx)(eH.Ay,{size:"sm",variant:n?"soft":"plain",color:n?"primary":"neutral","aria-label":r,"aria-pressed":n,disabled:o,onMouseDown:e=>e.preventDefault(),onClick:l,sx:{"--IconButton-size":"clamp(19px, calc((100cqi - 36px) / 21), 24px)","--Icon-fontSize":"16px",borderRadius:"5px",p:0},children:a});return o?s:(0,C.jsx)(eP.A,{title:r,variant:"soft",children:s})}function e6(){return(0,C.jsx)(I.A,{"aria-hidden":!0,sx:{width:"1px",height:14,mx:"clamp(1px, 0.5cqi, 3px)",bgcolor:"divider"}})}let e8=[1,2,3],e9=[{value:"left",label:"Align left",Icon:eD.A},{value:"center",label:"Align center",Icon:e_.A},{value:"right",label:"Align right",Icon:eJ.A}],e3={bold:!1,italic:!1,underline:!1,strike:!1,code:!1,highlight:!1,heading:0,bulletList:!1,orderedList:!1,blockquote:!1,codeBlock:!1,link:!1,align:"",canUndo:!1,canRedo:!1};function e7(e){let{editor:t}=e,[r,n]=B.useState(null),[i,l]=B.useState(""),a=(0,eN.erU)({editor:t,selector:e=>{var t,r,n;let{editor:i}=e;return i&&{bold:i.isActive("bold"),italic:i.isActive("italic"),underline:i.isActive("underline"),strike:i.isActive("strike"),code:i.isActive("code"),highlight:i.isActive("highlight"),heading:null!=(r=e8.find(e=>i.isActive("heading",{level:e})))?r:0,bulletList:i.isActive("bulletList"),orderedList:i.isActive("orderedList"),blockquote:i.isActive("blockquote"),codeBlock:i.isActive("codeBlock"),link:i.isActive("link"),align:null!=(n=null==(t=e9.find(e=>{let{value:t}=e;return i.isActive({textAlign:t})}))?void 0:t.value)?n:"left",canUndo:i.can().undo(),canRedo:i.can().redo()}}}),o=t&&a||e3,s=!t,d=()=>t.chain().focus(),c=e=>{var r;l("link"===e?String(null!=(r=null==t?void 0:t.getAttributes("link").href)?r:""):""),n(e)},u=null!==r&&ey(i.trim(),r);return(0,C.jsxs)(I.A,{sx:{containerType:"inline-size",display:"flex",flexDirection:"column",gap:.5},children:[(0,C.jsxs)(I.A,{role:"toolbar","aria-label":"Formatting",sx:{display:"flex",flexWrap:"wrap",alignItems:"center",columnGap:"clamp(0px, calc(100cqi - 540px), 1px)"},children:[(0,C.jsx)(e4,{idle:s,label:"Undo",disabled:!o.canUndo,onClick:()=>d().undo().run(),children:(0,C.jsx)(e2.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Redo",disabled:!o.canRedo,onClick:()=>d().redo().run(),children:(0,C.jsx)(e1.A,{})}),(0,C.jsx)(e6,{}),(0,C.jsx)(e4,{idle:s,label:"Bold",active:o.bold,onClick:()=>d().toggleBold().run(),children:(0,C.jsx)(eK.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Italic",active:o.italic,onClick:()=>d().toggleItalic().run(),children:(0,C.jsx)(eG.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Underline",active:o.underline,onClick:()=>d().toggleUnderline().run(),children:(0,C.jsx)(eY.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Strikethrough",active:o.strike,onClick:()=>d().toggleStrike().run(),children:(0,C.jsx)(eX.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Inline code",active:o.code,onClick:()=>d().toggleCode().run(),children:(0,C.jsx)(eR.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Badge",active:o.highlight,onClick:()=>d().toggleHighlight().run(),children:(0,C.jsx)(e0.A,{})}),(0,C.jsx)(e6,{}),e8.map(e=>(0,C.jsx)(e4,{idle:s,label:"Heading ".concat(e),active:o.heading===e,onClick:()=>d().toggleHeading({level:e}).run(),children:(0,C.jsxs)(eI.Ay,{textColor:"inherit",sx:{fontSize:11,fontWeight:700,lineHeight:1},children:["H",e]})},e)),(0,C.jsx)(e6,{}),e9.map(e=>{let{value:t,label:r,Icon:n}=e;return(0,C.jsx)(e4,{idle:s,label:r,active:o.align===t,onClick:()=>"left"===t?d().unsetTextAlign().run():d().setTextAlign(t).run(),children:(0,C.jsx)(n,{})},t)}),(0,C.jsx)(e6,{}),(0,C.jsx)(e4,{idle:s,label:"Bullet list",active:o.bulletList,onClick:()=>d().toggleBulletList().run(),children:(0,C.jsx)(e$.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Numbered list",active:o.orderedList,onClick:()=>d().toggleOrderedList().run(),children:(0,C.jsx)(eq.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Quote",active:o.blockquote,onClick:()=>d().toggleBlockquote().run(),children:(0,C.jsx)(eV.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Code block",active:o.codeBlock,onClick:()=>d().toggleCodeBlock().run(),children:(0,C.jsx)(eU.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Divider",onClick:()=>d().setHorizontalRule().run(),children:(0,C.jsx)(eZ.A,{})}),(0,C.jsx)(e6,{}),(0,C.jsx)(e4,{idle:s,label:"Link",active:o.link,onClick:()=>c("link"),children:(0,C.jsx)(e5.A,{})}),(0,C.jsx)(e4,{idle:s,label:"Image",onClick:()=>c("image"),children:(0,C.jsx)(eQ.A,{})})]}),r&&t?(0,C.jsxs)(I.A,{component:"form",onSubmit:e=>{e.preventDefault();let l=i.trim();if("link"===r)if(l)if(!u)return;else(null==t?void 0:t.state.selection.empty)&&!o.link?d().insertContent({type:"text",text:l,marks:[{type:"link",attrs:{href:l}}]}).run():d().extendMarkRange("link").setLink({href:l}).run();else d().extendMarkRange("link").unsetLink().run();else{if(!u)return;d().setImage({src:l}).run()}n(null)},sx:{display:"flex",gap:.5},children:[(0,C.jsx)(eM.Ay,{size:"sm",autoFocus:!0,value:i,onChange:e=>l(e.target.value),placeholder:"link"===r?"https://… (empty removes the link)":"https://…/image.png",slotProps:{input:{"aria-label":"link"===r?"Link URL":"Image URL"}},error:""!==i.trim()&&!u,sx:{flex:1,minWidth:0}}),(0,C.jsx)(eL.A,{size:"sm",type:"submit",disabled:!u&&!("link"===r&&!i.trim()),children:"Apply"}),(0,C.jsx)(eL.A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>n(null),children:"Cancel"})]}):null]})}},93952:(e,t,r)=>{r.d(t,{C:()=>n});let n={softBlue:{light:"radial-gradient(circle at 50% 50%, hsla(210, 100%, 92%, 0.85), hsla(210, 100%, 98%, 0.4) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(210, 80%, 22%, 0.55), hsla(220, 40%, 10%, 0.6) 55%, hsl(220, 30%, 5%))",repeat:"no-repeat"},softGray:{light:"radial-gradient(circle at 50% 50%, hsla(220, 25%, 92%, 0.85), hsla(220, 20%, 97%, 0.45) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(220, 30%, 16%, 0.6), hsla(220, 25%, 10%, 0.55) 55%, hsl(220, 25%, 8%))",repeat:"no-repeat"},softLavender:{light:"radial-gradient(circle at 50% 50%, hsla(265, 42%, 92%, 0.65), hsla(255, 34%, 96%, 0.45) 45%, hsl(260, 30%, 98%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(264, 24%, 19%, 0.55), hsla(256, 18%, 12%, 0.5) 55%, hsl(250, 14%, 7%))",repeat:"no-repeat"},flarePrimary:{light:"radial-gradient(circle at 50% 50%, hsla(270, 80%, 90%, 0.6), hsla(260, 70%, 96%, 0.35) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(270, 55%, 24%, 0.5), hsla(260, 40%, 14%, 0.5) 55%, hsl(220, 28%, 6%))",repeat:"no-repeat"},flareSuccess:{light:"radial-gradient(circle at 50% 50%, hsla(152, 60%, 88%, 0.6), hsla(146, 55%, 94%, 0.35) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(152, 45%, 20%, 0.5), hsla(146, 35%, 14%, 0.5) 55%, hsl(220, 26%, 6%))",repeat:"no-repeat"},flareDanger:{light:"radial-gradient(circle at 50% 50%, hsla(355, 80%, 92%, 0.55), hsla(8, 75%, 95%, 0.35) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(355, 50%, 24%, 0.5), hsla(8, 45%, 16%, 0.45) 55%, hsl(218, 28%, 6%))",repeat:"no-repeat"},flareWarning:{light:"radial-gradient(circle at 50% 50%, hsla(38, 95%, 90%, 0.55), hsla(32, 80%, 95%, 0.35) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(38, 65%, 22%, 0.5), hsla(32, 50%, 14%, 0.45) 55%, hsl(220, 24%, 6%))",repeat:"no-repeat"},flareInfo:{light:"radial-gradient(circle at 50% 50%, hsla(200, 95%, 90%, 0.6), hsla(210, 80%, 95%, 0.35) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(200, 55%, 22%, 0.5), hsla(210, 45%, 14%, 0.5) 55%, hsl(220, 28%, 6%))",repeat:"no-repeat"},flareNote:{light:"radial-gradient(circle at 50% 50%, hsla(50, 48%, 91%, 0.65), hsla(52, 34%, 95%, 0.45) 45%, hsl(52, 24%, 98%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(50, 18%, 16%, 0.55), hsla(48, 12%, 11%, 0.5) 55%, hsl(48, 8%, 7%))",repeat:"no-repeat"},flareNeutral:{light:"radial-gradient(circle at 50% 50%, hsla(40, 50%, 94%, 0.7), hsla(200, 30%, 96%, 0.35) 45%, hsl(0, 0%, 100%) 75%)",dark:"radial-gradient(circle at 50% 50%, hsla(40, 30%, 16%, 0.55), hsla(200, 30%, 12%, 0.5) 55%, hsl(220, 22%, 7%))",repeat:"no-repeat"}}},94673:(e,t,r)=>{r.d(t,{CA:()=>v,Cn:()=>o,HK:()=>u,N_:()=>y,SS:()=>a,eW:()=>x,fd:()=>f,mn:()=>b,nB:()=>c});var n=r(22545),i=r(93952),l=r(97300);let a={id:"default",name:"Notebook",primary:"#46618a",swatch:"#3a5bd9",gradient:"softBlue",font:"sans",headingFont:"sans",radius:8,glass:{blur:20,lightOpacity:.55,darkOpacity:.52},surface:{light:"#f8fafd",dark:"#161b25"},prose:{fontSize:16,lineHeight:1.65,maxWidth:720,headingWeight:700,headingScale:1.25,headingTone:"accent"}},o=[a,{id:"paper",name:"Paper",primary:"#92400e",gradient:"flareNeutral",font:"serif",headingFont:"serif",radius:4,glass:{blur:12,lightOpacity:.55,darkOpacity:.55},prose:{fontSize:18,lineHeight:1.75,maxWidth:680,headingWeight:700,headingScale:1.25,headingTone:"ink"}},{id:"editorial",name:"Editorial",primary:"#7d6c48",gradient:"flareNote",font:"book",headingFont:"book",radius:14,glass:{blur:28,lightOpacity:.66,darkOpacity:.58},surface:{light:"#fbf8ee",dark:"#2a2822"},ink:{light:"#3d382c",dark:"#e6e0d0"},border:"thin",prose:{fontSize:17,lineHeight:1.75,maxWidth:680,headingWeight:600,headingScale:1.26,headingTone:"ink"}},{id:"lavender",name:"Lavender",primary:"#6b5b8c",gradient:"softLavender",font:"sans",headingFont:"rounded",radius:14,glass:{blur:26,lightOpacity:.5,darkOpacity:.5},surface:{light:"#f9f7fd",dark:"#1c1925"},prose:{fontSize:16,lineHeight:1.7,maxWidth:720,headingWeight:700,headingScale:1.25,headingTone:"accent"}},{id:"sunset",name:"Sunset",primary:"#c2410c",gradient:"flareWarning",font:"rounded",headingFont:"rounded",radius:18,glass:{blur:22,lightOpacity:.45,darkOpacity:.45},prose:{fontSize:16,lineHeight:1.7,maxWidth:720,headingWeight:800,headingScale:1.24,headingTone:"accent"}},{id:"graphite",name:"Graphite",primary:"#475569",gradient:"softGray",font:"sans",headingFont:"display",radius:6,glass:{blur:18,lightOpacity:.5,darkOpacity:.5},prose:{fontSize:15,lineHeight:1.6,maxWidth:760,headingWeight:500,headingScale:1.34,headingTone:"ink"}},{id:"terminal",name:"Terminal",primary:"#047857",gradient:"flareSuccess",font:"mono",headingFont:"mono",radius:2,glass:{blur:8,lightOpacity:.4,darkOpacity:.6},prose:{fontSize:14,lineHeight:1.6,maxWidth:800,headingWeight:600,headingScale:1.18,headingTone:"accent"}}],s={ocean:"lavender"},d=e=>Object.prototype.hasOwnProperty.call(s,e)?s[e]:e;function c(e){return o.some(t=>t.id===d(e))}let u={radius:{min:0,max:24,step:1},blur:{min:0,max:40,step:1},opacity:{min:0,max:1,step:.05},fontSize:{min:12,max:24,step:1},lineHeight:{min:1.2,max:2.2,step:.05},maxWidth:{min:360,max:960,step:20},headingWeight:{min:300,max:900,step:100},headingScale:{min:1.1,max:1.45,step:.01}},h=/^#[0-9a-f]{6}$/i,p=["sans","serif","book","mono","display","rounded","apple","news"];function g(e,t){return p.includes(e)?e:t}function f(e){return"string"==typeof e&&h.test(e)}function m(e,t,r){return"number"==typeof e&&Number.isFinite(e)?Math.min(t.max,Math.max(t.min,e)):r}function y(e){if(!(0,n.u4)(e)||"string"!=typeof e.id||!e.id||"string"!=typeof e.name)return null;let t=(0,n.u4)(e.glass)?e.glass:{},r=(0,n.u4)(e.prose)?e.prose:{},o=g(e.font,a.font),s=e=>(0,n.u4)(e)&&f(e.light)&&f(e.dark)?{light:e.light,dark:e.dark}:null,d=s(e.surface),c=s(e.ink),h=l.T.includes(e.border)?e.border:null;return{id:e.id,name:e.name,primary:f(e.primary)?e.primary:a.primary,gradient:"string"==typeof e.gradient&&Object.prototype.hasOwnProperty.call(i.C,e.gradient)?e.gradient:a.gradient,font:o,headingFont:g(e.headingFont,o),radius:m(e.radius,u.radius,a.radius),glass:{blur:m(t.blur,u.blur,a.glass.blur),lightOpacity:m(t.lightOpacity,u.opacity,a.glass.lightOpacity),darkOpacity:m(t.darkOpacity,u.opacity,a.glass.darkOpacity)},...f(e.swatch)?{swatch:e.swatch}:null,...d?{surface:d}:null,...c?{ink:c}:null,...h?{border:h}:null,prose:{fontSize:m(r.fontSize,u.fontSize,a.prose.fontSize),lineHeight:m(r.lineHeight,u.lineHeight,a.prose.lineHeight),maxWidth:m(r.maxWidth,u.maxWidth,a.prose.maxWidth),headingWeight:m(r.headingWeight,u.headingWeight,a.prose.headingWeight),headingScale:m(r.headingScale,u.headingScale,a.prose.headingScale),headingTone:"accent"===r.headingTone?"accent":"ink"}}}function v(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];let i=r.find(t=>{let r;return!!t&&(c(r=d(t))||e.some(e=>e.id===r))});return void 0===i?void 0:d(i)}let b={light:"#ffffff",dark:"#0f1217"};function x(e,t){var r,n;let i=t?d(t):t;return null!=(n=null!=(r=o.find(e=>e.id===i))?r:e.find(e=>e.id===i))?n:a}},97300:(e,t,r)=>{r.d(t,{T:()=>n});let n=["off","thin","regular","bold"]}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9845],{628:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var r=t(95155);t(12115);var l=t(41530),i=t(87654),a=t(55059),s=t(60459);function o(e){let{title:n,actions:t,children:o}=e;return(0,r.jsxs)(i.A,{component:"section","aria-label":n,sx:{...s.Lc,pt:"".concat(a.CJ-1,"px"),pb:{xs:2,sm:3}},children:[(0,r.jsxs)(l.A,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[(0,r.jsx)(l.A,{sx:{flex:1,minWidth:0},children:(0,r.jsx)(a.xw,{title:n,flush:!0})}),t?(0,r.jsx)(l.A,{sx:{minHeight:32,display:"flex",alignItems:"center"},children:t}):null]}),o]})}},7451:(e,n,t)=>{Promise.resolve().then(t.bind(t,51474))},32153:(e,n,t)=>{"use strict";t.d(n,{i:()=>l});var r=t(12115);function l(e){let[n,t]=r.useState({value:null,loading:!!e,error:null}),[l,i]=r.useState(0);return r.useEffect(()=>{if(!e)return void t({value:null,loading:!1,error:null});let n=!0;return t(e=>({...e,loading:!0,error:null})),e().then(e=>n&&t({value:e,loading:!1,error:null}),e=>n&&t(n=>({...n,loading:!1,error:e instanceof Error?e.message:"Something went wrong."}))),()=>{n=!1}},[e,l]),{...n,reload:r.useCallback(()=>i(e=>e+1),[]),set:r.useCallback(e=>t({value:e,loading:!1,error:null}),[])}}},35042:(e,n,t)=>{"use strict";t.d(n,{R:()=>s,w:()=>o});var r=t(12115),l=t(89742),i=t(8518),a=t(32153);function s(){let{user:e,admin:n,adapter:t,live:s}=(0,i.Z)(),o=null==e?void 0:e.uid,c=r.useMemo(()=>o?()=>(0,l.AI)(o):null,[o,s]),d=(0,a.i)(c),[u,p]=r.useState(!1),[h,f]=r.useState(null),{set:x,value:m,reload:g}=d,v=r.useMemo(()=>{var e;return o&&null!=(e=null==m?void 0:m.filter(e=>e.uid===o))?e:null},[o,m]),y=r.useCallback(async(e,n,r)=>{p(!0),f(null);try{x(await (0,l.RD)(t,{uid:e,projectId:n},r))}catch(e){f(e instanceof Error?e.message:"The public pages were not saved.")}finally{p(!1)}},[t,x]);return{list:v,admin:n,busy:u,error:null!=h?h:d.error,find:(e,n)=>null==v?void 0:v.find(t=>t.uid===e&&t.projectId===n),set:y,reload:g}}function o(e,n,t){return t?"/".concat(t):"/page/".concat(encodeURIComponent(e),"/").concat(encodeURIComponent(n))}},51474:(e,n,t)=>{"use strict";t.d(n,{default:()=>g});var r=t(95155);t(12115);var l=t(41530),i=t(28257),a=t(35326),s=t(11438),o=t(81864),c=t(96129),d=t(628),u=t(54295),p=t(67057),h=t(8518),f=t(35042);function x(){var e;let{user:n}=(0,h.Z)(),{list:t,error:i}=(0,f.R)(),s=(null!=t?t:[]).filter(e=>e.alias);return n?(0,r.jsxs)(d.A,{title:"Public addresses",children:[(0,r.jsx)(a.Ay,{level:"body-sm",textColor:i?void 0:"text.tertiary",color:i?"danger":void 0,role:"status",children:null!=i?i:null===(e=t&&s.length)?"Reading the addresses…":e?"".concat(e," ").concat(1===e?"address":"addresses"," served"):"No public addresses yet."}),s.length?(0,r.jsx)(l.A,{component:"ul","aria-label":"Public addresses",sx:{listStyle:"none",m:0,mt:1.5,p:0},children:s.map(e=>(0,r.jsxs)(l.A,{component:"li",sx:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:1.5,py:.75,borderTop:"1px solid",borderColor:"divider"},children:[(0,r.jsxs)(p.A,{href:"/".concat(e.alias),target:"_blank",rel:"noopener",level:"title-sm",sx:{flex:1,minWidth:0,overflowWrap:"anywhere"},children:["/",e.alias]}),(0,r.jsx)(a.Ay,{level:"body-sm",children:e.title})]},e.alias))}):null]}):null}let m=[{name:"user-codes",running:!0},{name:"group-activities",running:!0},{name:"live-classroom",running:!1}];function g(){let e=m.filter(e=>e.running).length;return(0,r.jsxs)(s.default.View,{barTitle:"Activity",children:[(0,r.jsx)(x,{}),(0,r.jsxs)(d.A,{title:"Microservices",actions:(0,r.jsx)(i.A,{size:"sm",variant:"soft",color:"warning",children:"Sample data"}),children:[(0,r.jsx)(c.P,{children:(0,r.jsx)(c.d,{label:"Running locally",children:"".concat(e," of ").concat((0,o.h)(m.length,"service"))})}),(0,r.jsx)(l.A,{component:"ul","aria-label":"Local microservices",sx:{listStyle:"none",m:0,mt:1.5,p:0},children:m.map(e=>(0,r.jsxs)(l.A,{component:"li",sx:{display:"flex",alignItems:"center",gap:1.5,py:.75,borderTop:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(u.A,{tone:e.running?"up":"down"}),(0,r.jsx)(a.Ay,{level:"title-sm",noWrap:!0,sx:{flex:1},children:e.name}),(0,r.jsx)(a.Ay,{level:"body-sm",children:e.running?"Running":"Stopped"})]},e.name))})]})]})}},54295:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});var r=t(95155);t(12115);var l=t(41530);let i={up:"success.400",paused:"warning.400",down:"danger.400"};function a(e){let{tone:n}=e;return(0,r.jsx)(l.A,{"aria-hidden":!0,"data-tone":n,sx:{width:8,height:8,borderRadius:"50%",flexShrink:0,bgcolor:i[n]}})}},81864:(e,n,t)=>{"use strict";function r(e,n){return"".concat(e," ").concat(n).concat(1===e?"":"s")}t.d(n,{h:()=>r})},89742:(e,n,t)=>{"use strict";async function r(e){let n=await e.json().catch(()=>null);if(e.ok&&n)return n;throw Error("string"==typeof(null==n?void 0:n.error)?n.error:"The server answered ".concat(e.status,"."))}async function l(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET",l=arguments.length>3?arguments[3]:void 0,i=await (null==e?void 0:e.idToken());if(!i)throw Error("Sign in first.");return r(await fetch(n,{method:t,cache:"no-store",headers:{authorization:"Bearer ".concat(i),...void 0===l?null:{"content-type":"application/json"}},body:void 0===l?void 0:JSON.stringify(l)}))}async function i(){return(await r(await fetch("/api/home",{cache:"no-store"}))).home}async function a(e,n){return(await l(e,"/api/home",n?"PUT":"DELETE",null!=n?n:void 0)).home}async function s(e){let n="/api/pages?uid=".concat(encodeURIComponent(e));return(await r(await fetch(n,{cache:"no-store"}))).pages}async function o(e,n,t){return(await l(e,"/api/pages",t?"POST":"DELETE",n)).pages}async function c(e,n){await l(e,"/api/pages","PUT",{projects:n.map(e=>{let{id:n,title:t,draft:r,urlAlias:l}=e;return{projectId:n,title:t,published:!r,...l?{urlAlias:l}:null}})})}async function d(e,n,t){await l(e,"/api/aliases","PUT",{projectId:n,alias:t})}async function u(e){return(await l(e,"/api/connections")).connections}async function p(e,n){return(await l(e,"/api/connections","PUT",{connections:n})).connections}t.d(n,{AI:()=>s,If:()=>u,Iz:()=>c,RD:()=>o,XA:()=>a,fH:()=>p,qi:()=>i,sV:()=>d})},96129:(e,n,t)=>{"use strict";t.d(n,{P:()=>a,d:()=>s});var r=t(95155);t(12115);var l=t(41530),i=t(35326);function a(e){let{children:n}=e;return(0,r.jsx)(l.A,{component:"dl",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:2,m:0},children:n})}function s(e){let{label:n,children:t}=e;return(0,r.jsxs)(l.A,{sx:{minWidth:0},children:[(0,r.jsx)(i.Ay,{component:"dt",level:"body-xs",textColor:"text.tertiary",children:n}),(0,r.jsx)(i.Ay,{component:"dd",level:"title-sm",sx:{m:0,overflowWrap:"anywhere"},children:t})]})}}},e=>{e.O(0,[9627,277,5004,2246,7240,2567,8245,1388,1438,8441,1255,7358],()=>e(e.s=7451)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8624],{628:(e,n,t)=>{"use strict";t.d(n,{A:()=>i});var l=t(95155);t(12115);var r=t(41530),o=t(87654),s=t(55059),a=t(60459);function i(e){let{title:n,actions:t,children:i}=e;return(0,l.jsxs)(o.A,{component:"section","aria-label":n,sx:{...a.Lc,pt:"".concat(s.CJ-1,"px"),pb:{xs:2,sm:3}},children:[(0,l.jsxs)(r.A,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[(0,l.jsx)(r.A,{sx:{flex:1,minWidth:0},children:(0,l.jsx)(s.xw,{title:n,flush:!0})}),t?(0,l.jsx)(r.A,{sx:{minHeight:32,display:"flex",alignItems:"center"},children:t}):null]}),i]})}},48627:(e,n,t)=>{"use strict";t.d(n,{r:()=>l});let l="#3b82f6"},54295:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var l=t(95155);t(12115);var r=t(41530);let o={up:"success.400",paused:"warning.400",down:"danger.400"};function s(e){let{tone:n}=e;return(0,l.jsx)(r.A,{"aria-hidden":!0,"data-tone":n,sx:{width:8,height:8,borderRadius:"50%",flexShrink:0,bgcolor:o[n]}})}},62853:(e,n,t)=>{Promise.resolve().then(t.bind(t,86346))},81864:(e,n,t)=>{"use strict";function l(e,n){return"".concat(e," ").concat(n).concat(1===e?"":"s")}t.d(n,{h:()=>l})},86346:(e,n,t)=>{"use strict";let l;t.d(n,{default:()=>ei});var r=t(95155),o=t(12115);function s(e,n,t){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e4;o.useEffect(()=>{if(!t)return;let l=!0,o=async()=>{if(document.hidden)return;let t=await e();l&&n(t)};o();let s=window.setInterval(o,r);return()=>{l=!1,window.clearInterval(s)}},[e,n,t,l,r])}async function a(){let e=performance.now();try{let{ok:n}=await fetch("/api/health",{method:"HEAD",cache:"no-store"});return{running:n,latencyMs:n?Math.round(performance.now()-e):null}}catch(e){return{running:!1,latencyMs:null}}}var i=t(11438),c=t(41530),u=t(5262),d=t(97363),h=t(35326),p=t(628),f=t(8518);let x="sw.cdn.controlKey",m=new Set(["restart","debug","undebug"]),y=e=>new Promise(n=>window.setTimeout(n,e));async function g(e){for(let n=0;n<40;n+=1){await y(500);try{let n=await fetch("/api/node",{cache:"no-store"});if(n.ok&&(await n.json()).instance!==e)return!0}catch(e){}}return!1}let v={log:"text.secondary",request:"text.primary",warn:"warning.plainColor",error:"danger.plainColor"};function j(e){let{entries:n}=e,t=o.useRef(null),l=o.useRef(!0);return o.useLayoutEffect(()=>{l.current&&t.current&&(t.current.scrollTop=t.current.scrollHeight)},[n]),(0,r.jsx)(c.A,{ref:t,role:"log","aria-label":"Server log",tabIndex:0,onScroll:e=>{let{scrollTop:n,scrollHeight:t,clientHeight:r}=e.currentTarget;l.current=t-n-r<24},sx:{maxHeight:360,overflow:"auto",fontFamily:"code",fontSize:"xs",lineHeight:1.7},children:n.map(e=>(0,r.jsxs)(c.A,{sx:{display:"flex",gap:1.5},children:[(0,r.jsx)(c.A,{component:"span",sx:{color:"text.tertiary",flexShrink:0},children:new Date(e.at).toLocaleTimeString("en-GB",{hour12:!1})}),(0,r.jsx)(c.A,{component:"span",sx:{color:v[e.level],whiteSpace:"pre-wrap",overflowWrap:"anywhere",minWidth:0},children:e.text})]},e.seq))})}function A(e){let{onKey:n}=e,[t,l]=o.useState("");return(0,r.jsxs)(c.A,{component:"form",onSubmit:e=>{e.preventDefault(),t.trim()&&n(t.trim())},sx:{display:"flex",flexWrap:"wrap",gap:1},children:[(0,r.jsx)(d.Ay,{size:"sm",type:"password",autoComplete:"off",placeholder:"Control key",value:t,onChange:e=>l(e.target.value),slotProps:{input:{"aria-label":"Control key for the log"}}}),(0,r.jsx)(u.A,{size:"sm",type:"submit",variant:"soft",color:"neutral",disabled:!t.trim(),children:"Show log"})]})}function w(e){let{leftMs:n,needsKey:t}=e,{entries:l,wantsKey:a,error:i,giveKey:u}=function(e){let{adapter:n}=(0,f.Z)(),[t,l]=o.useState([]),[r,a]=o.useState(null),[i,c]=o.useState(()=>{var e;return null!=(e=window.sessionStorage.getItem(x))?e:""}),u=o.useRef({instance:"",seq:0}),d=e&&!i;return s(o.useCallback(async()=>{try{let e=await (null==n?void 0:n.idToken()),t=await fetch("/api/debug?after=".concat(u.current.seq),{cache:"no-store",headers:{...e?{authorization:"Bearer ".concat(e)}:null,...i?{"x-sw-control-key":i}:null}}),l=await t.json();if(t.ok)return{log:l};return{refused:String(l.error),wrongKey:401===t.status}}catch(e){return null}},[n,i]),o.useCallback(e=>{if(!e)return;if("refused"in e){a(e.refused),e.wrongKey&&(window.sessionStorage.removeItem(x),c(""));return}a(null);let{instance:n,entries:t}=e.log;if(n!==u.current.instance){let e=""===u.current.instance;if(u.current={instance:n,seq:0},!e)return void l([])}let r=t.filter(e=>e.seq>u.current.seq);r.length&&(u.current.seq=r[r.length-1].seq,l(e=>[...e,...r].slice(-500)))},[]),!d,0,2e3),{entries:t,wantsKey:d,error:r,giveKey:e=>{window.sessionStorage.setItem(x,e),a(null),c(e)}}}(t);return(0,r.jsx)(p.A,{title:"Debug",actions:(0,r.jsx)(h.Ay,{level:"body-xs",children:"Ends in ".concat(Math.max(1,Math.ceil(n/6e4))," min")}),children:(0,r.jsxs)(c.A,{sx:{mt:1.5,display:"flex",flexDirection:"column",gap:1.5},children:[i?(0,r.jsx)(h.Ay,{role:"alert",level:"body-sm",color:"danger",children:i}):null,a?(0,r.jsx)(A,{onKey:u}):null,l.length?(0,r.jsx)(j,{entries:l}):null,l.length||a||i?null:(0,r.jsx)(h.Ay,{level:"body-sm",children:"No lines yet."})]})})}var S=t(20258),b=t(81864),M=t(54295);let C=["........................................................######..................................................................................","..................................################################...........................................##.................................","...........................#..#..#########.#####################.............#####............................####..............................","........................###.##.##.######....####################................................#.#..........########..........##...............","......................####...#..###.#####........###############.............................##.........################.##.....................",".........#............########..###.########......#############...................##.........#.....##################################.#.........","#.....#########################.#####.##.####.....############................##########.....###################################################","####.##################################..######....#######.....###...........###################################################################","......##############################..#....###.....#####.......###.........#####################################################################",".....##############################......###........###...................#####.#######################################################.######..",".......####.....###################......######...........................#####..################################################...##.##.......","........#..........##################....#######......................#....###..###############################################.......###.......","....................###################.##########..................####..######################################################......##........",".....................#############################....................############################################################..............","......................########################..###....................#########################################################................","......................#########################........................#####################.##################################.................","......................#######################........................########.#####....####.##################################..##..............","......................######################........................#####..#.###############.###############################....#...............",".......................###################..........................####........#.##########.###########################..#.....#...............",".......................###################...........................##.####.......######################################.##..##................","........................#################............................########.........##################################....###.................",".........................###############............................###########.#########################################.......................","..........................########.....#...........................######################################################.......................","............................#####......#..........................##########################..##########################........................",".............................####.................................####################.########....####################.#.......................","..............................###...#...##.......................######################.########....#######..########...........................","..............................#######......#.....................######################.#######......#####...#######............................","................................#####............................#######################.####........####.....#####.....#.......................","...................................####..........................##########################...........##.......#####....#.......................",".....................................##...###.....................########################.#..........##.......#.###............................","......................................##########...................#########################............#......#.........#......................",".........................................#########.................#########################............#.......#.....#.........................",".........................................###########.......................################...................###....##.........................","........................................############........................##############.....................###..###....#....................","........................................##############......................#############.......................##..###.#....#..................","........................................#################...................############.........................#...#.##....#####..............","........................................##################...................###########..........................##...........####.............","........................................##################...................###########........................................#.##............",".........................................################....................###########........................................................",".........................................################....................###########...#..............................#.###..#..............","..........................................###############....................###########..##.............................######.##..............","............................................############.....................##########...##............................###########.............","............................................############.....................#########...##...........................##############............","............................................##########........................########...##..........................################...........","............................................#########.........................#######................................################...........","...........................................#########..........................#######.................................################..........","...........................................#########...........................#####..................................###############...........","...........................................########............................####...................................####....#######...........","...........................................######...............................................................................####............","..........................................#######................................................................................##...........#.","..........................................#####...................................................................................#..........##.","..........................................####.............................................................................................##...","..........................................###..............................................................................................#....","..........................................###...................................................................................................","..........................................###...................................................................................................","...........................................##...................................................................................................","................................................................................................................................................"],k={AD:[1.5,42.5],AE:[54.5,23.5],AF:[66.5,34.2],AG:[-61.8,17.4],AI:[-63,18.2],AL:[20.1,40.7],AM:[44.8,40.5],AO:[18,-12.2],AQ:[35.9,-79.8],AR:[-64.2,-33.5],AS:[-170.7,-14.3],AT:[14.1,47.5],AU:[134,-24.1],AW:[-70,12.5],AX:[19.9,60.2],AZ:[47.2,40.4],BA:[18.1,44.1],BB:[-59.6,13.2],BD:[89.7,24.2],BE:[4.8,50.8],BF:[-1.4,12.7],BG:[25.2,42.5],BH:[50.6,26.1],BI:[29.9,-3.3],BJ:[2.4,10.3],BL:[-62.8,17.9],BM:[-64.8,32.3],BN:[114.6,4.4],BO:[-64.6,-16.7],BR:[-49.6,-12.1],BS:[-77.1,26.4],BT:[90,27.5],BW:[24.2,-22.1],BY:[28.4,53.8],BZ:[-88.7,17.2],CA:[-101.9,60.3],CD:[23.5,-1.9],CF:[20.9,7],CG:[15.9,.1],CH:[7.5,46.7],CI:[-5.6,7.5],CK:[-159.8,-21.2],CL:[-72.3,-38.2],CM:[12.5,4.6],CN:[106.3,32.5],CO:[-73.2,3.4],CR:[-84.1,10.1],CU:[-78,21.3],CV:[-23.6,15.1],CW:[-68.9,12.1],CY:[33.1,34.9],CZ:[15.4,49.9],DE:[9.7,51],DJ:[42.5,12],DK:[9,56],DM:[-61.3,15.5],DO:[-70.7,19.1],DZ:[2.8,27.4],EC:[-78.2,-1.3],EE:[25.9,58.7],EG:[29.4,26.2],EH:[-12.6,24],ER:[38.3,15.8],ES:[-3.5,40.1],ET:[39.1,8],FI:[27.3,63.3],FJ:[178,-17.8],FK:[-58.7,-51.6],FM:[158.2,6.9],FO:[-7.1,62.2],FR:[2.6,46.7],GA:[11.8,-.4],GB:[-2.1,54.4],GD:[-61.7,12.1],GE:[43.7,41.9],GG:[-2.6,49.5],GH:[-1,7.7],GL:[-39.3,74.3],GM:[-15,13.6],GN:[-10,10.6],GQ:[9,2.3],GR:[21.7,39.5],GS:[-31.1,-55.7],GT:[-90.5,15],GU:[144.7,13.4],GW:[-14.5,12.2],GY:[-58.9,5.1],HK:[114.1,22.4],HM:[73.5,-53.1],HN:[-86.9,14.8],HR:[16.4,45.8],HT:[-72.2,19.3],HU:[19.4,47.1],ID:[101.9,-1],IE:[-7.8,53.1],IL:[34.8,30.9],IM:[-4.5,54.2],IN:[79.4,22.7],IO:[71.3,-6.2],IQ:[43.3,33.1],IR:[54.9,32.2],IS:[-18.7,64.8],IT:[11.1,44.7],JE:[-2.1,49.2],JM:[-77.3,18.1],JO:[36.4,30.8],JP:[138.4,36.1],KE:[37.9,.5],KG:[74.5,41.7],KH:[104.5,12.6],KI:[-157.4,1.8],KM:[43.3,-11.7],KN:[-62.8,17.3],KP:[126.4,39.9],KR:[128.1,36.4],KW:[47.3,29.4],KY:[-81.2,19.3],KZ:[68.7,49.1],LA:[102.5,19.4],LB:[36,34.1],LC:[-61,13.9],LI:[9.6,47.1],LK:[80.7,7.6],LR:[-9.5,6.4],LS:[28.2,-29.5],LT:[24.1,55.1],LU:[6.1,49.7],LV:[25.5,57.1],LY:[18,26.6],MA:[-7.2,31.7],MC:[7.4,43.7],MD:[28.5,47.4],ME:[19.1,42.8],MF:[-63,18.1],MG:[46.7,-18.6],MH:[171.2,7.1],MK:[21.6,41.6],ML:[-2,18.7],MM:[95.8,21.6],MN:[104.2,46],MO:[113.6,22.1],MP:[145.7,15.2],MR:[-9.7,19.6],MS:[-62.2,16.7],MT:[14.4,35.9],MU:[57.6,-20.3],MV:[73.5,4.2],MW:[33.6,-13.4],MX:[-102.3,23.9],MY:[113.8,2.5],MZ:[37.8,-13.9],NA:[17.1,-20.6],NC:[165.1,-21.1],NE:[9.5,17.4],NF:[168,-29],NG:[7.5,9.4],NI:[-85.1,12.7],NL:[5.6,52.4],NO:[9.7,61.4],NP:[83.6,28.3],NR:[166.9,-.5],NU:[-169.9,-19],NZ:[172.8,-39.8],OM:[57.3,22.1],PA:[-80.4,8.7],PE:[-72.9,-13],PF:[-149.5,-17.6],PG:[143.9,-5.7],PH:[122.5,11.2],PK:[68.5,29.3],PL:[19.5,52],PM:[-56.3,47],PN:[-128.3,-24.4],PR:[-66.5,18.2],PS:[35.3,32],PT:[-8.3,39.6],PW:[134.6,7.5],PY:[-60.1,-21.7],QA:[51.1,25.2],RO:[25,45.7],RS:[20.8,44.2],RU:[44.7,58.2],RW:[30.1,-1.9],SA:[44.7,23.8],SB:[159.2,-8],SC:[55.5,-4.7],SD:[29.3,16.3],SE:[19,65.9],SG:[103.8,1.4],SH:[-5.7,-16],SI:[14.9,46.1],SK:[19,48.7],SL:[-11.8,8.6],SM:[12.4,43.9],SN:[-14.8,15.1],SO:[45.2,3.6],SR:[-55.9,4.1],SS:[30.4,7.2],ST:[7,1],SV:[-88.9,13.7],SX:[-63.1,18],SY:[38.3,35],SZ:[31.5,-26.5],TC:[-71.8,21.8],TD:[18.6,15.1],TF:[69.1,-49.3],TG:[1.1,8.8],TH:[101.1,15.5],TJ:[72.6,38.2],TL:[125.9,-8.8],TM:[58.7,39.9],TN:[9,33.7],TO:[-175.2,-21.2],TR:[34.5,39.3],TT:[-60.9,11],TV:[179.2,-8.5],TW:[120.9,23.7],TZ:[35,-6.1],UA:[32.1,49.7],UG:[32.9,2],US:[-97.5,39.5],UY:[-56,-33],UZ:[64,41.7],VA:[12.5,41.9],VC:[-61.3,13.1],VE:[-64.6,7.2],VG:[-64.6,18.4],VI:[-64.8,17.7],VN:[105.4,21.7],VU:[166.9,-15.4],WF:[-178.1,-14.3],WS:[-172.4,-13.6],XK:[20.9,42.6],YE:[45.9,15.3],ZA:[23.7,-29.7],ZM:[26.4,-14.7],ZW:[29.9,-18.9]},T=C[0].length,I=C.length,R=(e,n)=>Math.min(Math.max(e,0),n);function N(e){var n;return null!=l||(l=new Intl.DisplayNames(["en"],{type:"region"})),null!=(n=l.of(e))?n:e}function L(e){return e.country?N(e.country):null===e.lat?"Location not set":"".concat(e.lat,", ").concat(e.lon)}let B=C.map((e,n)=>Array.from(e,(e,t)=>"#"===e?"M".concat(t+.5," ").concat(n+.5,"h0"):"").join("")).join(""),P={online:"var(--joy-palette-success-500)",partial:"var(--joy-palette-warning-500)",offline:"var(--joy-palette-danger-500)"};function E(e){let{place:n,online:t,paused:l,total:r,self:o}=e,s=["".concat(n,": ").concat(t," of ").concat(r," online")];return l&&s.push("".concat(l," paused")),o&&s.push("with this server"),s.join(", ")}function G(e){let{nodes:n}=e,t=function(e){let n=new Map;for(let o of e){var t,l,r;let e=null!==o.lat&&null!==o.lon?[o.lon,o.lat]:o.country?k[o.country]:void 0;if(!e)continue;let{x:s,y:a}=(l=e[0],r=e[1],{x:R((l+180)/2.5,T),y:R((85-r)/2.5,I)}),i="".concat(Math.round(s/2)," ").concat(Math.round(a/2)),c=null!=(t=n.get(i))?t:{x:s,y:a,place:L(o),online:0,paused:0,total:0,self:!1};c.total+=1,o.online&&(c.online+=1),o.paused&&(c.paused+=1),o.self&&(c.self=!0),n.set(i,c)}return[...n.values()]}(n),l=t.length?t.map(E).join("; "):"no server location known";return(0,r.jsxs)(c.A,{component:"svg",viewBox:"0 0 ".concat(T," ").concat(I),role:"img","aria-label":"World map of servers. ".concat(l),sx:{display:"block",width:"100%",height:"auto"},children:[(0,r.jsx)("path",{d:B,fill:"none",stroke:"var(--joy-palette-text-tertiary)",strokeOpacity:.45,strokeWidth:.62,strokeLinecap:"round"}),t.map(e=>{let n=function(e){let{online:n,paused:t,total:l}=e;return n===l?"online":n||t?"partial":"offline"}(e);return(0,r.jsxs)("g",{"data-marker":n,transform:"translate(".concat(e.x," ").concat(e.y,")"),children:[(0,r.jsx)("title",{children:E(e)}),e.self?(0,r.jsx)("circle",{"data-self":"",r:2.8,fill:P[n],fillOpacity:.18,stroke:P[n],strokeWidth:.3}):null,(0,r.jsx)("circle",{r:e.total>1?1.7:1.2,fill:P[n],stroke:"var(--joy-palette-background-surface)",strokeWidth:.35}),e.total>1?(0,r.jsx)("text",{dy:"0.35em",textAnchor:"middle",fontSize:1.9,fontWeight:700,fill:"#fff",children:e.total}):null]},"".concat(e.x," ").concat(e.y))})]})}function K(e){let{node:n}=e;return(0,r.jsxs)(c.A,{component:"li",sx:{display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) minmax(0, 1fr) auto",alignItems:"center",columnGap:1.5,py:.75,borderTop:"1px solid",borderColor:"divider"},children:[(0,r.jsx)(M.A,{tone:n.paused?"paused":n.online?"up":"down"}),(0,r.jsxs)(h.Ay,{level:"title-sm",noWrap:!0,children:[n.id,n.self?(0,r.jsxs)(h.Ay,{level:"body-xs",textColor:"text.tertiary",children:[" ","\xb7 this server"]}):null]}),(0,r.jsx)(h.Ay,{level:"body-sm",noWrap:!0,children:L(n)}),(0,r.jsx)(h.Ay,{level:"body-sm",textAlign:"right",children:function(e){let{online:n,paused:t,latencyMs:l}=e;return t?"Paused":n?null===l?"Online":"Online \xb7 ".concat(l," ms"):"Offline"}(n)})]})}function O(e){let{network:n,state:t}=e,l=o.useMemo(()=>{var e;return(null!=(e=null==n?void 0:n.nodes)?e:[]).map(e=>e.self?{...e,online:"running"===t,paused:"paused"===t}:e)},[n,t]),s=l.filter(e=>e.online).length;return(0,r.jsxs)(p.A,{title:"Network",children:[(0,r.jsx)(S.A,{role:"status","aria-label":"Servers online",markdown:n?"=={{online}} of {{servers}} online==":"_Checking the servers…_",values:{online:s,servers:(0,b.h)(l.length,"server")}}),(null==n?void 0:n.problem)?(0,r.jsx)(h.Ay,{level:"body-sm",color:"warning",children:n.problem}):null,(0,r.jsx)(c.A,{sx:{my:1.5},children:(0,r.jsx)(G,{nodes:l})}),(0,r.jsx)(c.A,{component:"ul","aria-label":"Servers",sx:{listStyle:"none",m:0,p:0},children:l.map(e=>(0,r.jsx)(K,{node:e},e.id))})]})}var W=t(84560),H=t(5058),D=t(93609),V=t(9435),F=t(83694);let z=(0,F.A)((0,r.jsx)("path",{d:"M19 8h-1.81c-.45-.78-1.07-1.45-1.82-1.96l.93-.93c.39-.39.39-1.02 0-1.41a.996.996 0 0 0-1.41 0l-1.47 1.47C12.96 5.06 12.49 5 12 5s-.96.06-1.41.17L9.11 3.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l.92.93C7.88 6.55 7.26 7.22 6.81 8H5c-.55 0-1 .45-1 1s.45 1 1 1h1.09c-.05.33-.09.66-.09 1v1H5c-.55 0-1 .45-1 1s.45 1 1 1h1v1c0 .34.04.67.09 1H5c-.55 0-1 .45-1 1s.45 1 1 1h1.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H19c.55 0 1-.45 1-1s-.45-1-1-1h-1.09c.05-.33.09-.66.09-1v-1h1c.55 0 1-.45 1-1s-.45-1-1-1h-1v-1c0-.34-.04-.67-.09-1H19c.55 0 1-.45 1-1s-.45-1-1-1m-6 8h-2c-.55 0-1-.45-1-1s.45-1 1-1h2c.55 0 1 .45 1 1s-.45 1-1 1m0-4h-2c-.55 0-1-.45-1-1s.45-1 1-1h2c.55 0 1 .45 1 1s-.45 1-1 1"}),"BugReportRounded"),U=(0,F.A)((0,r.jsx)("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2m6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2"}),"PauseRounded"),Z=(0,F.A)((0,r.jsx)("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82"}),"PlayArrowRounded"),Y=(0,F.A)((0,r.jsx)("path",{d:"M12 3c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1s1-.45 1-1V4c0-.55-.45-1-1-1m5.14 2.86c-.39.39-.38 1-.01 1.39 1.13 1.2 1.83 2.8 1.87 4.57.09 3.83-3.08 7.13-6.91 7.17C8.18 19.05 5 15.9 5 12c0-1.84.71-3.51 1.87-4.76.37-.39.37-1-.01-1.38-.4-.4-1.05-.39-1.43.02C3.98 7.42 3.07 9.47 3 11.74c-.14 4.88 3.83 9.1 8.71 9.25 5.1.16 9.29-3.93 9.29-9 0-2.37-.92-4.51-2.42-6.11-.38-.41-1.04-.42-1.44-.02"}),"PowerSettingsNewRounded"),J=(0,F.A)((0,r.jsx)("path",{d:"M12 5V3.21c0-.45-.54-.67-.85-.35l-2.8 2.79c-.2.2-.2.51 0 .71l2.79 2.79c.32.31.86.09.86-.36V7c3.31 0 6 2.69 6 6 0 2.72-1.83 5.02-4.31 5.75-.42.12-.69.52-.69.95 0 .65.62 1.16 1.25.97C17.57 19.7 20 16.64 20 13c0-4.42-3.58-8-8-8m-6 8c0-1.34.44-2.58 1.19-3.59.3-.4.26-.95-.09-1.31-.42-.42-1.14-.38-1.5.1-1 1.34-1.6 3-1.6 4.8 0 3.64 2.43 6.7 5.75 7.67.63.19 1.25-.32 1.25-.97 0-.43-.27-.83-.69-.95C7.83 18.02 6 15.72 6 13"}),"RestartAltRounded");var _=t(48627);let q={pause:"Pause server",resume:"Resume server",restart:"Restart server",stop:"Stop server",debug:"Start debugging",undebug:"End debugging"};function Q(e){let{action:n,icon:t,controls:l,running:o,color:s="neutral",on:a=!1}=e,i=function(e,n,t){let{status:l}=n;return t?l?n.admin?"off"===l.access?"Off: the server has no control key (SW_CONTROL_KEY)":"pause"===e||"resume"===e||l.power?null:"Only on the built server":"Only a server admin may order it":"Asking the server":"The server does not answer"}(n,l,o);return(0,r.jsx)(V.A,{title:i?"".concat(q[n],". ").concat(i):q[n],variant:"soft",children:(0,r.jsx)("span",{children:(0,r.jsx)(W.Ay,{size:"sm",variant:"soft",color:s,"aria-label":q[n],disabled:!!i||null!==l.busy,loading:l.busy===n,onClick:()=>l.order(n),sx:{"--IconButton-size":"28px","--IconButton-radius":"50%",...a&&!i?{"--Icon-color":_.r}:null},children:t})})})}function X(e){let{pending:n,controls:t}=e,[l,s]=o.useState(""),{action:a,needsKey:i}=n,p="stop"===a;return(0,r.jsx)(H.Ay,{open:!0,onClose:t.cancel,children:(0,r.jsxs)(D.A,{role:p?"alertdialog":"dialog","aria-labelledby":"control-order-title",sx:{width:360,maxWidth:"100%"},children:[(0,r.jsx)(h.Ay,{id:"control-order-title",level:"title-md",children:p?"Stop the server?":q[a]}),p?(0,r.jsx)(h.Ay,{level:"body-sm",children:"This page cannot start it again."}):null,(0,r.jsxs)(c.A,{component:"form",onSubmit:e=>{e.preventDefault(),t.confirm(l)},sx:{display:"flex",flexDirection:"column",gap:1.5},children:[i?(0,r.jsx)(d.Ay,{autoFocus:!0,type:"password",autoComplete:"off",placeholder:"Control key",value:l,onChange:e=>s(e.target.value),slotProps:{input:{"aria-label":"Control key"}}}):null,t.error?(0,r.jsx)(h.Ay,{role:"alert",level:"body-sm",color:"danger",children:t.error}):null,(0,r.jsxs)(c.A,{sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[(0,r.jsx)(u.A,{size:"sm",variant:"plain",color:"neutral",onClick:t.cancel,children:"Cancel"}),(0,r.jsx)(u.A,{size:"sm",type:"submit",color:p?"danger":"primary",disabled:i&&!l.trim(),children:p?"Stop":"Continue"})]})]})]})})}function $(e){var n,t,l;let{controls:o,running:s}=e,a=null!=(l=null==(n=o.status)?void 0:n.paused)&&l,i=!!(null==(t=o.status)?void 0:t.debugLeftMs),u={controls:o,running:s};return o.signedIn?(0,r.jsxs)(c.A,{role:"group","aria-label":"Server controls",sx:{display:"flex",gap:.75},children:[(0,r.jsx)(Q,{...u,action:a?"resume":"pause",icon:a?(0,r.jsx)(Z,{fontSize:"small"}):(0,r.jsx)(U,{fontSize:"small"})}),(0,r.jsx)(Q,{...u,action:"restart",icon:(0,r.jsx)(J,{fontSize:"small"})}),(0,r.jsx)(Q,{...u,action:i?"undebug":"debug",on:i,icon:(0,r.jsx)(z,{fontSize:"small"})}),(0,r.jsx)(Q,{...u,action:"stop",color:"danger",icon:(0,r.jsx)(Y,{fontSize:"small"})}),o.pending?(0,r.jsx)(X,{pending:o.pending,controls:o}):null]}):null}var ee=t(96129);let en={running:{tone:"up",words:"Running"},paused:{tone:"paused",words:"Paused"},stopped:{tone:"down",words:"Stopped"}};function et(e){var n,t;let{state:l,latencyMs:o,node:s,port:a,controls:i}=e,u="stopped"!==l,{tone:d,words:f}=null!==i.busy&&m.has(i.busy)?{tone:"paused",words:"Restarting…"}:en[l];return(0,r.jsxs)(p.A,{title:"Server",actions:(0,r.jsx)($,{controls:i,running:u}),children:[(0,r.jsxs)(ee.P,{children:[(0,r.jsx)(ee.d,{label:"Status",children:(0,r.jsxs)(c.A,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:1},children:[(0,r.jsx)(M.A,{tone:d}),f]})}),(0,r.jsx)(ee.d,{label:"Port",children:a||"—"}),(0,r.jsx)(ee.d,{label:"Response",children:null===o?"—":"".concat(o," ms")}),(0,r.jsx)(ee.d,{label:"Uptime",children:u&&s?function(e){let n=Math.floor(e/60),t=Math.floor(n/60),l=Math.floor(t/24);return l?"".concat(l," d ").concat(t%24," h"):t?"".concat(t," h ").concat(n%60," min"):n?"".concat(n," min"):"".concat(e," s")}(s.uptimeSeconds):"—"}),(0,r.jsx)(ee.d,{label:"Name",children:null!=(n=null==s?void 0:s.id)?n:"—"}),(0,r.jsx)(ee.d,{label:"Location",children:s?function(e){let{country:n,region:t}=e,l=[n?N(n):null,t].filter(Boolean);return l.length?l.join(" \xb7 "):"Not set"}(s):"—"}),(0,r.jsx)(ee.d,{label:"Version",children:s?[s.version,s.commit].filter(Boolean).join(" \xb7 "):"—"}),(0,r.jsx)(ee.d,{label:"Runtime",children:null!=(t=null==s?void 0:s.runtime)?t:"—"})]}),i.error&&!i.pending?(0,r.jsx)(h.Ay,{role:"alert",level:"body-sm",color:"danger",sx:{mt:1.5},children:i.error}):null]})}async function el(e,n){try{let t=await fetch(e,{cache:"no-store"});if(!t.ok)return null;let l=await t.json();return n(l)?l:null}catch(e){return null}}let er=()=>el("/api/node",e=>"string"==typeof(null==e?void 0:e.id)),eo=()=>el("/api/network",e=>Array.isArray(null==e?void 0:e.nodes)),es=()=>el("/api/control",e=>"boolean"==typeof(null==e?void 0:e.paused));function ea(e,n){let[t,l]=o.useState(null);return s(e,o.useCallback(e=>e&&l(e),[]),!0,n),[t,l]}function ei(){let{health:e,state:n,node:t,network:l,control:c,setControl:u,refresh:d}=function(){let[e,n]=o.useState(0),t=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[t,l]=o.useState({running:!0,latencyMs:null});return s(a,l,e,n),t}(!0,e),[l]=ea(er,e),[r]=ea(eo,e),[i,c]=ea(es,e),u=o.useCallback(()=>n(e=>e+1),[]),d=t.running?(null==i?void 0:i.paused)?"paused":"running":"stopped";return{health:t,state:d,node:l,network:r,control:i,setControl:c,refresh:u}}(),h=function(e){let{status:n,instance:t,onStatus:l,refresh:r}=e,[s,a]=o.useState(null),[i,c]=o.useState(null),[u,d]=o.useState(null),{admin:h,adapter:p,user:v}=(0,f.Z)(),j=async(e,n)=>{c(null),d(null),a(e);try{let o=await (null==p?void 0:p.idToken()),s=await fetch("/api/control",{method:"POST",headers:{"Content-Type":"application/json",...o?{authorization:"Bearer ".concat(o)}:null,...n?{"x-sw-control-key":n}:null},body:JSON.stringify({action:e})}),a=await s.json();if(401===s.status){window.sessionStorage.removeItem(x),c({action:e,needsKey:!0}),d(a.error);return}if(!s.ok)return void d(a.error);n&&window.sessionStorage.setItem(x,n),l(a),m.has(e)&&!await g(t)&&d("The server has not come back yet."),"stop"===e&&await y(1e3),r()}catch(e){d("The server did not take the order.")}finally{a(null)}},A=()=>{var e;return null!=(e=window.sessionStorage.getItem(x))?e:""};return{status:n,signedIn:!!v,admin:h,busy:s,pending:i,error:u,order:e=>{let t=(null==n?void 0:n.access)==="key"&&!A();"stop"===e||t?(d(null),c({action:e,needsKey:t})):j(e,A())},confirm:e=>{i&&j(i.action,i.needsKey?e.trim():A())},cancel:()=>{c(null),d(null)}}}({status:c,instance:null==t?void 0:t.instance,onStatus:u,refresh:d}),p=function(){let[e,n]=o.useState("");return o.useEffect(()=>{let{port:e,protocol:t}=window.location;n(e||("https:"===t?"443":"80"))},[]),e}();return(0,r.jsxs)(i.default.View,{barTitle:"Delivery",children:[(0,r.jsx)(et,{state:n,latencyMs:e.latencyMs,node:t,port:p,controls:h}),h.admin&&(null==c?void 0:c.debugLeftMs)&&"off"!==c.access?(0,r.jsx)(w,{leftMs:c.debugLeftMs,needsKey:"key"===c.access}):null,(0,r.jsx)(O,{network:l,state:n})]})}},96129:(e,n,t)=>{"use strict";t.d(n,{P:()=>s,d:()=>a});var l=t(95155);t(12115);var r=t(41530),o=t(35326);function s(e){let{children:n}=e;return(0,l.jsx)(r.A,{component:"dl",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:2,m:0},children:n})}function a(e){let{label:n,children:t}=e;return(0,l.jsxs)(r.A,{sx:{minWidth:0},children:[(0,l.jsx)(o.Ay,{component:"dt",level:"body-xs",textColor:"text.tertiary",children:n}),(0,l.jsx)(o.Ay,{component:"dd",level:"title-sm",sx:{m:0,overflowWrap:"anywhere"},children:t})]})}}},e=>{e.O(0,[9627,277,5004,2246,7240,2567,8245,1388,1438,8441,1255,7358],()=>e(e.s=62853)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4671],{8138:(e,t,l)=>{"use strict";l.d(t,{wJ:()=>g,Pf:()=>w,ed:()=>A,IW:()=>k,UO:()=>y,Rg:()=>j,TP:()=>b});let n=e=>e.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e]),r=/^(https?:|mailto:|tel:|#|\/(?!\/))/i,a=/^(https?:\/\/|data:image\/(png|jpe?g|gif|webp);)/i,o={bold:"strong",italic:"em",underline:"u",strike:"s",code:"code"},i=e=>{var t;return null!=(t=e.content)?t:[]};function s(e){var t,l,c,d,u;if("hardBreak"===e.type)return"<br>";if("image"===e.type){let r=String(null!=(c=null==(t=e.attrs)?void 0:t.src)?c:"");return a.test(r)?'<img src="'.concat(n(r),'" alt="').concat(n(String(null!=(d=null==(l=e.attrs)?void 0:l.alt)?d:"")),'">'):""}return void 0===e.text?i(e).map(s).join(""):(null!=(u=e.marks)?u:[]).reduce((e,t)=>{if("link"===t.type){var l,a;let o=String(null!=(a=null==(l=t.attrs)?void 0:l.href)?a:"");return r.test(o)?'<a href="'.concat(n(o),'" target="_blank">').concat(e,"</a>"):e}let i=o[t.type];return i?"<".concat(i,">").concat(e,"</").concat(i,">"):e},n(e.text))}let c=e=>{var t;return null!=(t=e.text)?t:i(e).map(c).join("")};function d(e,t){return i(e).map(e=>{let l=i(e).filter(e=>{var t;return!/List$/.test(null!=(t=e.type)?t:"")}),n=i(e).filter(e=>{var t;return/List$/.test(null!=(t=e.type)?t:"")}),r=t?' class="ql-indent-'.concat(Math.min(t,8),'"'):"";return"<li".concat(r,">").concat(l.map(s).join("<br>")||"<br>","</li>").concat(n.map(e=>d(e,t+1)).join(""))}).join("")}function u(e){switch(e.type){case"paragraph":return"<p>".concat(s(e)||"<br>","</p>");case"heading":{var t;let l=Math.min(3,Math.max(1,Number(null==(t=e.attrs)?void 0:t.level)||1));return"<h".concat(l,">").concat(s(e),"</h").concat(l,">")}case"bulletList":return"<ul>".concat(d(e,0),"</ul>");case"orderedList":return"<ol>".concat(d(e,0),"</ol>");case"blockquote":return"<blockquote>".concat(i(e).map(s).join("<br>"),"</blockquote>");case"codeBlock":return'<pre class="ql-syntax">'.concat(n(c(e)),"</pre>");case"horizontalRule":return"<p>———</p>";case"image":return"<p>".concat(s(e),"</p>");case"table":return i(e).map(e=>"<p>".concat(i(e).map(s).join(" \xb7 "),"</p>")).join("");default:return i(e).map(u).join("")}}let p={click:[],"mouse-enter":[],"mouse-leave":[]},h={cornersSize:0,corners:[],margin:[0,0,0,0],borders:[],border:[0,"solid","#000000"],transform:{scale:1,rotate:0,translate:[0,0]},shadowDirection:[],shadow:[0,"#000000"],backgroundImage:null,backgroundPosition:[0,0],backgroundScale:1,backgroundType:"none",backgroundFilter:[],backgroundGradient:{0:["#ffffff",50],1:["#ffffff",100]},gradientAngle:0,gradientStop:50},x={lg:15,md:12,sm:9,xs:6};function m(e){return e.map((e,t)=>{let l=i(e.content).map(u).join(""),n=Math.min(40,Math.max(2,i(e.content).length+Math.ceil(c(e.content).length/80)));return{id:t+1,name:e.name||"card-".concat(t+1),background:1,layout:Object.fromEntries(Object.entries(x).map(e=>{let[t,l]=e;return[t,[{i:"2",x:0,y:0,w:l,h:n}]]})),actionsByEvent:{enter:[],exit:[]},variables:[],storage:[],items:[{...h,id:1,kind:"plain",padding:[0,0,0,0],actionsByEvent:p,typeParams:{name:"plain-1"}},{...h,id:2,kind:"text",padding:[2,2,2,2],actionsByEvent:p,typeParams:{name:"text-1",text:l}}]}})}var f=l(38182);let g=1,v="StaffWriter Server";function b(e){return"sw-".concat(e.replace(/^doc-/,""))}function j(e,t){let l={projectId:b(e),title:t.page.title,description:t.page.description,cards:m(t.sections.flatMap(e=>e.cards)),snapshot:JSON.stringify(t)};if(new Blob([l.snapshot,JSON.stringify(l.cards)]).size>921600)throw Error("This page is too large for the database. Use smaller or linked pictures.");return l}function y(e,t){return{category:"Server",author:t,origin:v,language:"en",variables:[],storage:[],actionsByEvent:{start:[],finish:[]},export:{isDraft:!0,isTemplate:!1,restoreLastSession:!1,topOffset:0,playbackMode:"static",backgroundColor:"#ffffff",header:{title:e.title,subtitle:e.description},template:{path:"templates/solid",style:"default",skin:[]},footer:{title:"",notes:""}}}}function A(e,t){let l=e.sw;return e.origin===v&&t(null==l?void 0:l.savedAt,e.updateTime)}function w(e,t,l){let{title:n,description:r}=e.page;return{title:n,description:r,updateTime:t,...l?{cards:m(e.sections.flatMap(e=>e.cards))}:null,sw:{format:g,savedAt:t,snapshot:JSON.stringify(e),edited:!0}}}function k(e,t){let l=e.sw;if((null==l?void 0:l.format)===g&&"string"==typeof l.snapshot&&t(l.savedAt,e.updateTime))try{var n;return null!=(n=(0,f.R)(JSON.parse(l.snapshot)))?n:void 0}catch(e){return}}},8374:(e,t,l)=>{"use strict";l.d(t,{P:()=>o});var n=l(12115);let r="sw.cdn.sections.collapsed.v1";function a(){try{var e;let t=JSON.parse(null!=(e=window.localStorage.getItem(r))?e:"[]");return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch(e){return[]}}function o(e){let[t,l]=n.useState([]),o=n.useCallback(e=>{let t=a(),n=e(t);if(n!==t)try{window.localStorage.setItem(r,JSON.stringify(n))}catch(e){}l(n)},[]);n.useEffect(()=>{l(a())},[]);let i=n.useCallback(e=>o(t=>t.includes(e)?t.filter(t=>t!==e):t),[o]),s=n.useCallback(e=>o(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),[o]);return n.useEffect(()=>{e&&i(e)},[e,i]),{isCollapsed:n.useCallback(e=>t.includes(e),[t]),toggle:s,expand:i}}},20892:(e,t,l)=>{"use strict";l.d(t,{l:()=>a});var n=l(83561),r=l(58245);function a(e,t){let l=(0,n.KJ)(e=>e.themes),a=(0,n.KJ)(e=>e.page.themeId),o=null==e?void 0:e.cards.find(e=>e.id===t);(0,r.VV)(e?(0,n.s1)(l,a,e,o).themeId:void 0)}},33473:(e,t,l)=>{"use strict";l.d(t,{A:()=>f,o:()=>m});var n=l(95155),r=l(12115),a=l(41530),o=l(83351),i=l(41897),s=l(57364),c=l(20258),d=l(95189),u=l(87654),p=l(99640),h=l(31021),x=l(60459);function m(e){let{section:t,onExpand:l,onDropCard:r}=e,i=(0,h.a9)(t.title),s=(0,o.vu)(t.id,r);return(0,n.jsx)(a.A,{component:"section","aria-label":l?"Folded section: ".concat(i):"Empty section: ".concat(i),"data-block-stream-narrow":"",...(0,p.Cx)(t.id),...s.target,children:(0,n.jsxs)(u.A,{sx:{...x.Lc,display:"flex",alignItems:"center",gap:1,outline:s.over?"2px solid":"none",outlineColor:"primary.solidBg"},children:[(0,n.jsx)(c.A,{markdown:l?"**{{title}}**":"**{{title}}** \xb7 _No cards_",values:{title:i}}),l?(0,n.jsx)(d.A,{label:i,collapsed:!0,onToggle:l}):null]})})}function f(e){let{sections:t,isCollapsed:l,onExpand:o,renderHeader:c,renderCards:d,renderTail:u,onDropCard:p,gap:h=i.rs.sectionGapPx}=e,x="horizontal"===(0,s.O)().viewLayout;return(0,n.jsx)(n.Fragment,{children:t.map((e,i)=>{let s=l(e.id),f=s?null:d(e),g=null==u?void 0:u(e,i===t.length-1,s);return x?(0,n.jsxs)(r.Fragment,{children:[i>0?(0,n.jsx)(a.A,{"aria-hidden":!0,"data-block-stream-out-of-band":"","data-testid":"section-break",sx:{alignSelf:"flex-start",height:72,borderLeft:"1px solid",borderColor:"divider"}}):null,s?(0,n.jsx)(m,{section:e,onExpand:()=>o(e.id),onDropCard:p}):f,g]},e.id):(0,n.jsxs)(a.A,{"data-section-group":e.id,sx:{display:"flex",flexDirection:"column",gap:"".concat(h,"px")},children:[c(e),f,g]},e.id)})})}},35866:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>u,Tk:()=>d,jx:()=>p,mc:()=>c});var n=l(95155);l(12115);var r=l(52619),a=l.n(r),o=l(41530),i=l(84560),s=l(9435);let c=26,d={"--IconButton-size":"".concat(c,"px"),"--Icon-fontSize":"17px",borderRadius:"6px"};function u(e){let{label:t,href:l,sameTab:r=!1,color:o="neutral",children:c,...u}=e;return(0,n.jsx)(s.A,{title:t,variant:"soft",size:"sm",children:(0,n.jsx)(i.Ay,{size:"sm",variant:"plain",color:o,"aria-label":t,sx:d,...l?r?{component:a(),href:l}:{component:"a",href:l,target:"_blank",rel:"noopener"}:null,...u,children:c})})}function p(){return(0,n.jsx)(o.A,{"aria-hidden":!0,sx:{width:"1px",height:14,mx:"3px",flexShrink:0,bgcolor:"divider"}})}},36080:(e,t,l)=>{"use strict";l.d(t,{default:()=>i});var n=l(95155),r=l(12115),a=l(83561),o=l(35454);function i(e){let{children:t}=e,l=(0,o.g1)(),i=(0,a.gG)(),{currentId:s}=(0,a.tF)(),[c,d]=r.useState(!1);return(r.useLayoutEffect(()=>{let e=i&&(0,o.zV)(i.getSnapshot().pages,l);e&&i.open(e.id),d(!0)},[i,l]),i&&!c)?null:(0,n.jsx)(r.Fragment,{children:t},s)}},47254:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var n=l(95155);l(12115);var r=l(83561),a=l(44503);function o(e){let{section:t,card:l,...o}=e,i=(0,r.KJ)(e=>e.themes),s=(0,r.KJ)(e=>e.page.themeId),{themeId:c,mode:d}=(0,r.s1)(i,s,t,l);return(0,n.jsx)(r.WB,{theme:(0,r.eW)(i,c),fonts:a.e,mode:d,...o})}},54295:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var n=l(95155);l(12115);var r=l(41530);let a={up:"success.400",paused:"warning.400",down:"danger.400"};function o(e){let{tone:t}=e;return(0,n.jsx)(r.A,{"aria-hidden":!0,"data-tone":t,sx:{width:8,height:8,borderRadius:"50%",flexShrink:0,bgcolor:a[t]}})}},81864:(e,t,l)=>{"use strict";function n(e,t){return"".concat(e," ").concat(t).concat(1===e?"":"s")}l.d(t,{h:()=>n})},83157:(e,t,l)=>{Promise.resolve().then(l.bind(l,92843))},87344:(e,t,l)=>{"use strict";l.d(t,{A:()=>u});var n=l(95155);l(12115);var r=l(41530),a=l(35326),o=l(78373),i=l(49953);let s=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"}),c=new Intl.DateTimeFormat("en-GB",{dateStyle:"long",timeStyle:"short"});function d(e){let{label:t,at:l,icon:o}=e;return(0,n.jsxs)(r.A,{component:"span",title:"".concat(t," ").concat(c.format(l)),sx:{display:"inline-flex",alignItems:"center",gap:.5,color:"text.tertiary","& svg":{fontSize:14}},children:[o,(0,n.jsxs)(a.Ay,{level:"body-xs",textColor:"inherit",noWrap:!0,children:[t," ",(0,n.jsx)("time",{dateTime:new Date(l).toISOString(),children:s.format(l)})]})]})}function u(e){let{createdAt:t,editedAt:l}=e;return t||l?(0,n.jsxs)(r.A,{role:"group","aria-label":"Page dates",sx:{display:"flex",flexWrap:"wrap",columnGap:2,rowGap:.5},children:[t?(0,n.jsx)(d,{label:"Created",at:t,icon:(0,n.jsx)(i.A,{})}):null,l?(0,n.jsx)(d,{label:"Edited",at:l,icon:(0,n.jsx)(o.A,{})}):null]}):null}},89280:(e,t,l)=>{"use strict";l.d(t,{z:()=>x});var n=l(12115),r=l(57763),a=l(41897),o=l(18565),i=l(24794);let s=a.rs.contentStreamTopReserveShellPx,c=a.rs.contentStreamTopReserveCompactPx;function d(){return window.matchMedia("(min-width: 1200px)").matches?s:c}function u(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"smooth";if(!e||!n)return;let s=e.closest("[data-block-stream]");if(!s)return void e.scrollIntoView({behavior:r,block:"start"});let c=s.getBoundingClientRect(),u=e.getBoundingClientRect(),p=n===e?u:n.getBoundingClientRect();if("vertical"===s.getAttribute("data-block-stream")){let t=s.clientHeight-a.rs.topReserve,o=n===e?u.height:p.bottom-u.top,i=o<=t?u.top-(c.top+a.rs.topReserve)-(t-o)/2:u.top-d();null==(l=s.scrollTo)||l.call(s,{top:Math.max(0,s.scrollTop+i),behavior:r});return}let h=Number.parseFloat(getComputedStyle(s).paddingLeft)||0,x=s.clientWidth-h,m=n===e?u.width:p.right-u.left;if(m>x)return void function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smooth";if(!e)return;let l=e.closest('[data-block-stream="vertical"]');if(l){let n=function(e,t){let{top:l}=e.getBoundingClientRect();return l-t}(e,d());l.scrollTo({top:Math.max(0,l.scrollTop+n),behavior:t});return}let n=e.closest('[data-block-stream="horizontal"]');if(n){let l=function(e,t){let l=t.getBoundingClientRect(),n=Number.parseFloat(getComputedStyle(t).paddingLeft)||0,r=l.left+n+t.clientLeft,a=(0,o.Zp)(t),{left:i}=e.getBoundingClientRect();return i-(r+a)}(e,n),r=Math.min((0,i.jU)(n.scrollWidth,n.clientWidth),Math.max(0,n.scrollLeft+l));n.scrollTo({left:r,behavior:t});let a=()=>(0,i.kd)(n);"smooth"===t?requestAnimationFrame(()=>requestAnimationFrame(a)):a();return}e.scrollIntoView({behavior:t,block:"center"})}(e,r);let f=u.left-(c.left+h)-(x-m)/2,g=(0,i.jU)(s.scrollWidth,s.clientWidth);null==(t=s.scrollTo)||t.call(s,{left:Math.min(g,Math.max(0,s.scrollLeft+f)),behavior:r})}var p=l(99640),h=l(35454);function x(e,t){var l,a;let o=null==(l=(0,h.rv)(e,(0,h.g1)()))?void 0:l.id,[i,s]=n.useState({cardId:null}),[c,d]=n.useState(null),x=n.useRef(!1),m=e.some(e=>e.id===i.sectionId),f=m?i.sectionId:null==(a=e[0])?void 0:a.id,g=m?i.cardId:null,v=n.useRef(()=>{}),b=n.useRef(null),j=n.useCallback((e,t)=>{x.current=!0;let l={sectionId:e,cardId:null!=t?t:null};b.current=l,s(l),d(l)},[]);n.useEffect(()=>{let e=0,t=()=>{var t;if(e=0,x.current)return;let l=(0,p.VL)();if(!l)return;let{sectionId:n}=l,r=null!=(t=l.cardId)?t:null;s(e=>e.sectionId===n&&e.cardId===r?e:{sectionId:n,cardId:r})},l=()=>{e||(e=window.requestAnimationFrame(t))};v.current=l,l();let n=()=>{x.current=!1},r=e=>{var t,l;(null==(l=e.target)||null==(t=l.closest)?void 0:t.call(l,"[data-block-stream]"))&&n()},a={capture:!0,passive:!0};return document.addEventListener("scroll",l,a),document.addEventListener("wheel",n,a),document.addEventListener("touchstart",n,a),document.addEventListener("keydown",r,a),document.addEventListener("pointerdown",r,a),window.addEventListener("resize",l),()=>{window.cancelAnimationFrame(e),e=0,v.current=()=>{},document.removeEventListener("scroll",l,a),document.removeEventListener("wheel",n,a),document.removeEventListener("touchstart",n,a),document.removeEventListener("keydown",r,a),document.removeEventListener("pointerdown",r,a),window.removeEventListener("resize",l)}},[]),n.useEffect(()=>{v.current()},[e]),n.useEffect(()=>{if(!c)return;let e=()=>(function(e){var t,l;let{sectionId:n,cardId:a}=e;if(!n)return;if(a){let e=document.getElementById("".concat(r.L).concat(a));u(e,e);return}let o=document.querySelectorAll("[".concat(p.jW,'="').concat(n.replace(/["\\]/g,"\\$&"),'"]'));u(null!=(t=o[0])?t:null,null!=(l=o[o.length-1])?l:null)})(c),t=window.requestAnimationFrame(e),l=window.setTimeout(e,250);return()=>{window.cancelAnimationFrame(t),window.clearTimeout(l)}},[c]),n.useEffect(()=>{x.current&&b.current?d({...b.current}):v.current()},[t]);let y=n.useRef(null);return n.useEffect(()=>{o&&y.current!==o&&(y.current=o,j(o))},[o,j]),{activeSectionId:f,activeCardId:g,requestedSectionId:o,select:j,remeasure:v}}},92843:(e,t,l)=>{"use strict";l.d(t,{default:()=>e3});var n=l(95155),r=l(12115),a=l(83561),o=l(90272),i=l(41530),s=l(5262),c=l(89647),d=l(8518),u=l(50499),p=l(11438),h=l(35326),x=l(83694);let m=(0,x.A)((0,n.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1"}),"HomeRounded"),f=(0,x.A)((0,n.jsx)("path",{d:"M11 8.17 6.49 3.66C8.07 2.61 9.96 2 12 2c5.52 0 10 4.48 10 10 0 2.04-.61 3.93-1.66 5.51l-1.46-1.46C19.59 14.87 20 13.48 20 12c0-3.35-2.07-6.22-5-7.41V5c0 1.1-.9 2-2 2h-2zm9.49 13.73c-.39.39-1.02.39-1.41 0l-1.56-1.56c-2.07 1.37-4.68 2-7.45 1.48-3.95-.75-7.13-3.92-7.88-7.88-.52-2.77.1-5.38 1.48-7.45L2.1 4.93a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0l16.97 16.97c.4.39.4 1.02.01 1.41M11 18c-1.1 0-2-.9-2-2v-1l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.08 3.05 7.44 7 7.93z"}),"PublicOffRounded");var g=l(4697);let v=(0,x.A)((0,n.jsx)("path",{d:"M17.65 6.35c-1.63-1.63-3.94-2.57-6.48-2.31-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20c3.19 0 5.93-1.87 7.21-4.56.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53-1.13 2.43-3.84 3.97-6.8 3.31-2.22-.49-4.01-2.3-4.48-4.52C5.31 9.44 8.26 6 12 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71z"}),"RefreshRounded");var b=l(35866),j=l(81864),y=l(87344),A=l(52619),w=l.n(A),k=l(28257),C=l(87654);let S={display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",overflowWrap:"anywhere"};function I(e){let{label:t,title:l,href:r,badges:a=[],description:o,children:s,actions:c}=e,d=a.filter(Boolean);return(0,n.jsx)(i.A,{component:"li","aria-label":t,sx:{display:"flex",minWidth:0},children:(0,n.jsxs)(C.A,{sx:{flex:1,display:"flex",flexDirection:"column",gap:1,p:1.5,...r?{transition:"box-shadow 120ms ease-out","&:hover":{boxShadow:"md"}}:null},children:[(0,n.jsxs)(i.A,{...r?{component:w(),href:r,"aria-label":"Open ".concat(t)}:null,sx:{display:"flex",flexDirection:"column",gap:.75,flex:1,color:"inherit",textDecoration:"none",borderRadius:"sm","&:focus-visible":{outline:"2px solid",outlineColor:"primary.solidBg",outlineOffset:2}},children:[(0,n.jsxs)(i.A,{sx:{display:"flex",alignItems:"flex-start",gap:1,minHeight:24},children:[(0,n.jsx)(h.Ay,{level:"title-md",sx:{flex:1,minWidth:0,...S},children:l}),d.length?(0,n.jsx)(i.A,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:.5},children:d.map(e=>{var t;return(0,n.jsx)(k.A,{size:"sm",variant:"soft",color:null!=(t=e.color)?t:"neutral",children:e.text},e.text)})}):null]}),o?(0,n.jsx)(h.Ay,{level:"body-sm",textColor:"text.tertiary",sx:S,children:o}):null,(0,n.jsx)(i.A,{sx:{mt:"auto",display:"flex",flexDirection:"column",gap:.5},children:s})]}),c?(0,n.jsx)(i.A,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"1px",pt:.75,borderTop:"1px solid",borderColor:"divider"},children:c}):null]})})}function T(e){let{children:t}=e;return(0,n.jsx)(h.Ay,{level:"body-xs",textColor:"text.secondary",sx:{overflowWrap:"anywhere"},children:t})}var E=l(95189),R=l(97360),F=l(60459);function L(e){let{title:t,count:l,storageKey:r,actions:a,children:o}=e,[s,c]=(0,R.d)("sw.cdn.dashboard.".concat(r,".open.v1"),!0);return(0,n.jsxs)(i.A,{component:"section","aria-label":t,sx:{display:"flex",flexDirection:"column",gap:1.5},children:[(0,n.jsxs)(C.A,{sx:{...F.Lc,py:.5,display:"flex",alignItems:"center",gap:1,minHeight:40},children:[(0,n.jsx)(h.Ay,{component:"h2",level:"title-md",noWrap:!0,children:t}),void 0===l?null:(0,n.jsx)(h.Ay,{level:"body-xs",textColor:"text.tertiary",children:l}),(0,n.jsxs)(i.A,{sx:{ml:"auto",mr:"-6px",display:"flex",alignItems:"center",gap:"2px"},children:[a,(0,n.jsx)(E.A,{label:t,collapsed:!s,onToggle:c})]})]}),s?o:null]})}function W(e){let{label:t,children:l}=e;return(0,n.jsx)(i.A,{component:"ul","aria-label":t,sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 1fr))",gap:1.5,listStyle:"none",m:0,p:0},children:l})}function P(e){let{children:t,color:l}=e;return(0,n.jsx)(h.Ay,{level:"body-sm",role:l?"alert":"status",color:l,textColor:l?void 0:"text.tertiary",sx:{pl:"".concat(F.yx+F.$S+F.kA,"px"),pr:"".concat(F.T,"px")},children:t})}function z(e){var t;let{project:l,uid:a,state:o,pages:i,reload:s}=e,c=(null==(t=o.home)?void 0:t.uid)===a&&o.home.projectId===l.id,u=!!i.find(a,l.id),p=function(e,t,l,n,a){let{adapter:o}=(0,d.Z)(),[i,s]=r.useState(!1),[c,u]=r.useState(null);return{busy:i,error:c,toggle:async()=>{let r=t.draft;if(o&&(r||!l||window.confirm("This is the home page: as a draft it is no longer shown at /. Make it a draft?"))){s(!0),u(null);try{await o.setPublished(e,t.id,r),n.admin&&r?await n.set(e,t.id,!0):(await o.publishLive(e),n.reload())}catch(e){u(e instanceof Error?e.message:"The project was not changed.")}finally{a(),s(!1)}}}}}(a,l,c,i,s);return(0,n.jsxs)(I,{label:l.title||l.id,title:l.title,href:"/registry/cloud/".concat(encodeURIComponent(l.id)),description:l.description,badges:[c&&{text:"Home",color:"primary"},u&&{text:"Live",color:"primary"},l.template&&{text:"Template"},l.draft?{text:"Draft",color:"warning"}:{text:"Published",color:"success"}],actions:(0,n.jsxs)(n.Fragment,{children:[c?null:(0,n.jsx)(b.Ay,{label:l.draft?"Only a published project can be the home page":"Set as home page",disabled:!o.admin||o.busy||l.draft,onClick:()=>o.change({uid:a,projectId:l.id}),children:(0,n.jsx)(m,{})}),(0,n.jsx)(b.Ay,{label:l.draft?"Draft: publish it":"Published: make it a draft",color:l.draft?"neutral":"primary",disabled:p.busy||i.busy,loading:p.busy,onClick:p.toggle,children:l.draft?(0,n.jsx)(f,{}):(0,n.jsx)(g.A,{})})]}),children:[(0,n.jsxs)(T,{children:[(0,j.h)(l.cards,"card"),l.category?" \xb7 ".concat(l.category):""]}),l.urlAlias?(0,n.jsxs)(T,{children:["/",l.urlAlias]}):null,(0,n.jsx)(y.A,{createdAt:l.createdAt,editedAt:l.updatedAt}),p.error?(0,n.jsx)(h.Ay,{level:"body-xs",color:"danger",role:"alert",children:p.error}):null]})}function H(e){let{uid:t,projects:l,state:r,pages:a}=e,{value:o,loading:i,error:s,reload:c}=l;return(0,n.jsxs)(L,{title:"Cloud pages",count:null==o?void 0:o.length,storageKey:"cloud",actions:(0,n.jsx)(b.Ay,{label:"Read cloud pages again",disabled:i,onClick:c,children:(0,n.jsx)(v,{})}),children:[s?(0,n.jsxs)(P,{color:"danger",children:["Your cloud pages could not be read. ",s]}):null,(null==o?void 0:o.length)?(0,n.jsx)(W,{label:"Cloud pages",children:o.map(e=>(0,n.jsx)(z,{project:e,uid:t,state:r,pages:a,reload:c},e.id))}):s?null:(0,n.jsx)(P,{children:i?"Reading your cloud pages…":"No cloud pages in this account."})]})}var M=l(50445),B=l(13673),D=l(34809);let O=(0,x.A)((0,n.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined"),N=(0,x.A)((0,n.jsx)("path",{d:"M15.9 5c-.17 0-.32.09-.41.23l-.07.15-5.18 11.65c-.16.29-.26.61-.26.96 0 1.11.9 2.01 2.01 2.01.96 0 1.77-.68 1.96-1.59l.01-.03L16.4 5.5c0-.28-.22-.5-.5-.5M2.06 10.06c.51.51 1.33.55 1.89.09 2.76-2.26 6.24-3.18 9.58-2.76l1.19-2.68c-4.35-.78-8.96.3-12.57 3.25-.64.53-.68 1.51-.09 2.1m19.88 0c.59-.59.55-1.57-.1-2.1-1.36-1.11-2.86-1.95-4.44-2.53l-.53 2.82c1.13.47 2.19 1.09 3.17 1.89.58.46 1.39.43 1.9-.08m-4.03 4.03c.6-.6.56-1.63-.14-2.12-.46-.33-.94-.61-1.44-.86l-.55 2.92c.11.07.22.14.32.22.57.4 1.33.32 1.81-.16m-11.83-.01c.5.5 1.27.54 1.85.13.94-.66 2.01-1.06 3.1-1.22l1.28-2.88c-2.13-.06-4.28.54-6.09 1.84-.69.51-.74 1.53-.14 2.13"}),"NetworkCheckRounded");var K=l(49236);let J="(default)",q=/^[\w-]{1,64}$/,G=/^(\(default\)|[a-z][a-z0-9-]{2,62})$/;function U(e){let t={},l=t=>"string"==typeof e[t]?e[t].trim():"";return(!l("name")||l("name").length>64)&&(t.name="Give it a name of up to ".concat(64," characters.")),l("apiKey")&&!(0,K.B)("apiKey",l("apiKey"))&&(t.apiKey="This is not a web API key."),"firestore"===e.kind?((0,K.B)("projectId",l("projectId"))||(t.projectId="Lower-case letters, digits and hyphens, as in the Firebase console."),G.test(l("databaseId"))||(t.databaseId="Use ".concat(J," or the database's id."))):(0,K.B)("storageBucket",l("bucket"))||(t.bucket="The bucket name, without gs://."),t}let V=(e,t)=>({state:e,message:t});async function _(e){let t,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fetch,n="firestore"===e.kind?"database":"bucket",r="";try{var a,o;let n=await l(function(e){let t=e.apiKey?"key=".concat(encodeURIComponent(e.apiKey)):"";if("firestore"===e.kind){let{projectId:l,databaseId:n}=e;return"".concat("https://firestore.googleapis.com/v1","/projects/").concat(encodeURIComponent(l),"/databases/").concat(n,"/documents/").concat("sw_probe/none","?").concat(t)}return"".concat("https://firebasestorage.googleapis.com/v0","/b/").concat(encodeURIComponent(e.bucket),"/o?maxResults=1&").concat(t)}(e),{cache:"no-store",referrerPolicy:"strict-origin-when-cross-origin",signal:AbortSignal.timeout(8e3)});t=n.status;let i=await n.json().catch(()=>null);r=null!=(o=null==i||null==(a=i.error)?void 0:a.message)?o:""}catch(e){return V("failed","No answer. Check the network.")}return 200===t?V("reachable","Connected: the ".concat(n," answers.")):403===t?V("refused","The ".concat(n," is there; its rules refuse anonymous reading.")):404===t&&/^document\b/i.test(r)?V("reachable","Connected: the database answers."):404===t?V("failed","There is no such ".concat(n,".")):400===t&&/api key/i.test(r)?V("failed","The API key is not valid."):V("failed","Refused with status ".concat(t,"."))}async function Z(e,t,l){try{if("firestore"===t){let t=(await e.listProjects(l)).length;return V("reachable","Connected: ".concat(t," of your projects can be read."))}return await e.checkOwnFiles(l),V("reachable","Connected: your files can be listed.")}catch(t){var n;let e=String(null!=(n=t.code)?n:"");return/permission-denied|unauthorized/.test(e)?V("refused","The rules refuse this account."):V("failed","No connection. Check the network and try again.")}}var $=l(54295),X=l(35447),Y=l(99021),Q=l(88945),ee=l(67810),et=l(30365),el=l(57001),en=l(74223),er=l(2914),ea=l(33859);function eo(e){return(0,ea.SX)("MuiFormHelperText",e)}(0,ea.WN)("MuiFormHelperText",["root"]);var ei=l(3275),es=l(36520),ec=l(23388),ed=l(37594);let eu=["children","component","slots","slotProps"],ep=(0,en.A)("div",{name:"JoyFormHelperText",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let{theme:t}=e;return{"--Icon-fontSize":"calc(var(--FormHelperText-lineHeight) * 1em)",display:"flex",alignItems:"center",gap:"2px",fontFamily:t.vars.fontFamily.body,fontSize:"var(--FormHelperText-fontSize, ".concat(t.vars.fontSize.sm,")"),lineHeight:"var(--FormHelperText-lineHeight, ".concat(t.vars.lineHeight.sm,")"),color:"var(--FormHelperText-color, ".concat(t.vars.palette.text.tertiary,")"),margin:"var(--FormHelperText-margin, 0px)",[".".concat(ec.A.root," + &")]:{"--FormHelperText-margin":"0px"},[".".concat(es.A.error," &")]:{"--Icon-color":"currentColor"}}}),eh=r.forwardRef(function(e,t){let l=(0,er.A)({props:e,name:"JoyFormHelperText"}),{children:a,component:o,slots:i={},slotProps:s={}}=l,c=(0,ee.A)(l,eu),d=r.useRef(null),u=(0,et.A)(d,t),p=r.useContext(ei.A),h=null==p?void 0:p.setHelperText;r.useEffect(()=>(null==h||h(d.current),()=>{null==h||h(null)}),[h]);let x=(0,el.A)({root:["root"]},eo,{}),m=(0,Q.A)({},c,{component:o,slots:i,slotProps:s}),[f,g]=(0,ed.A)("root",{ref:u,elementType:ep,externalForwardedProps:m,ownerState:l,additionalProps:{as:o,id:null==p?void 0:p["aria-describedby"]},className:x.root});return(0,n.jsx)(f,(0,Q.A)({},g,{children:a}))});var ex=l(64652),em=l(97363),ef=l(5058),eg=l(36464),ev=l(93609),eb=l(86175);let ej={firestore:{one:"database",title:"Firestore database"},storage:{one:"bucket",title:"Firebase Storage bucket"}},ey={name:"name",label:"Name",placeholder:"What to call it"},eA={name:"apiKey",label:"Web API key",placeholder:"AIza…",optional:!0},ew={firestore:[ey,{name:"projectId",label:"Project ID",placeholder:"my-project"},{name:"databaseId",label:"Database ID",placeholder:J},eA],storage:[ey,{name:"bucket",label:"Bucket",placeholder:"my-project.appspot.com"},eA]};function ek(e){var t;let{kind:l,connection:o,busy:c,error:d,onSave:u,onClose:p}=e,[x,m]=r.useState(()=>({databaseId:J,...o})),[f,g]=r.useState(!1),v={...x,kind:l,id:null!=(t=null==o?void 0:o.id)?t:"draft"},b=f?U(v):{},j="".concat(o?"Edit":"Add"," ").concat(ej[l].title);return(0,n.jsx)(ef.Ay,{open:!0,onClose:p,children:(0,n.jsxs)(ev.A,{"aria-labelledby":"connection-title",sx:{width:440,maxWidth:"100%",overflowY:"auto"},children:[(0,n.jsx)(eg.A,{}),(0,n.jsx)(X.A,{id:"connection-title",children:j}),(0,n.jsx)("form",{noValidate:!0,onSubmit:e=>{var t;e.preventDefault(),g(!0);let l=function(e){if("object"!=typeof e||null===e)return null;let{kind:t,id:l}=e;if("firestore"!==t&&"storage"!==t||"string"!=typeof l||!q.test(l)||Object.keys(U(e)).length)return null;let n=t=>"string"==typeof e[t]?e[t].trim():"",r={id:l,name:n("name"),apiKey:n("apiKey")};return"firestore"===t?{...r,kind:t,projectId:n("projectId"),databaseId:n("databaseId")}:{...r,kind:t,bucket:n("bucket")}}({...v,id:null!=(t=null==o?void 0:o.id)?t:(0,a.sX)("link")});l&&u(l)},children:(0,n.jsxs)(eb.A,{spacing:1.5,children:[ew[l].map((e,t)=>{var l;return(0,n.jsxs)(Y.A,{error:!!b[e.name],children:[(0,n.jsxs)(ex.A,{children:[e.label,e.optional?(0,n.jsx)(h.Ay,{level:"body-xs",textColor:"text.tertiary",sx:{ml:.5},children:"optional"}):null]}),(0,n.jsx)(em.Ay,{autoFocus:0===t,autoComplete:"off",placeholder:e.placeholder,value:null!=(l=x[e.name])?l:"",onChange:t=>m({...x,[e.name]:t.target.value}),slotProps:{input:{spellCheck:!1}}}),b[e.name]?(0,n.jsx)(eh,{children:b[e.name]}):null]},e.name)}),d?(0,n.jsx)(h.Ay,{role:"alert",level:"body-sm",color:"danger",children:d}):null,(0,n.jsxs)(i.A,{sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[(0,n.jsx)(s.A,{variant:"plain",color:"neutral",onClick:p,children:"Cancel"}),(0,n.jsx)(s.A,{type:"submit",loading:c,children:o?"Save":"Add"})]})]})})]})})}let eC={reachable:"up",refused:"paused",failed:"down"};function eS(e){let{connection:t,builtIn:l,state:a,onEdit:o}=e,{adapter:s,user:c}=(0,d.Z)(),[u,p]=r.useState(!1),[x,m]=r.useState(null);r.useEffect(()=>m(null),[t]);let f=async()=>{p(!0),m(null),m(l&&s&&c?await Z(s,t.kind,c.uid):await _(t)),p(!1)};return(0,n.jsxs)(I,{label:t.name,title:t.name,badges:[l?{text:"Built-in"}:{text:"Server",color:"success"}],actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.Ay,{label:"Test ".concat(t.name),disabled:u,onClick:f,sx:{mr:"auto"},children:(0,n.jsx)(N,{})}),l?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.Ay,{label:"Edit ".concat(t.name),disabled:!a.admin,onClick:o,children:(0,n.jsx)(O,{})}),(0,n.jsx)(b.jx,{}),(0,n.jsx)(b.Ay,{label:"Remove ".concat(t.name),color:"danger",disabled:!a.admin||a.busy,onClick:()=>{window.confirm('Remove the connection "'.concat(t.name,'"?'))&&a.save(a.list.filter(e=>e.id!==t.id))},children:(0,n.jsx)(D.A,{})})]})]}),children:["firestore"===t.kind?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(T,{children:["Project ",t.projectId]}),(0,n.jsxs)(T,{children:["Database ",t.databaseId]})]}):(0,n.jsxs)(T,{children:["gs://",t.bucket]}),(0,n.jsxs)(i.A,{role:"status",sx:{display:"flex",alignItems:"center",gap:1,minHeight:20},children:[u?(0,n.jsx)(M.A,{size:"sm",sx:{"--CircularProgress-size":"14px"}}):null,x?(0,n.jsx)($.A,{tone:eC[x.state]}):null,(0,n.jsx)(h.Ay,{level:"body-xs",children:u?"Testing…":null==x?void 0:x.message})]})]})}function eI(e){let{title:t,kind:l,state:a}=e,{adapter:o}=(0,d.Z)(),[i,c]=r.useState(null),u=null==o?void 0:o.config.projectId,p=null==o?void 0:o.config.storageBucket,h=r.useMemo(()=>u&&p?function(e,t,l){let n={id:"staffwriter-".concat(e),name:"StaffWriter",apiKey:""};return"firestore"===e?{...n,kind:e,projectId:t,databaseId:J}:{...n,kind:e,bucket:l}}(l,u,p):null,[l,u,p]),x=a.list.filter(e=>e.kind===l),m=()=>{c(null),a.clearSaveError()};return(0,n.jsxs)(L,{title:t,count:x.length+ +!!h,storageKey:l,actions:(0,n.jsxs)(s.A,{size:"sm",variant:"plain",color:"neutral",disabled:!a.admin||!a.known,startDecorator:(0,n.jsx)(B.A,{}),onClick:()=>c("new"),children:["Add ",ej[l].one]}),children:[a.error?(0,n.jsx)(P,{color:"danger",children:a.error}):null,a.saveError&&!i?(0,n.jsx)(P,{color:"danger",children:a.saveError}):null,(0,n.jsxs)(W,{label:t,children:[h?(0,n.jsx)(eS,{connection:h,builtIn:!0,state:a,onEdit:()=>{}}):null,x.map(e=>(0,n.jsx)(eS,{connection:e,state:a,onEdit:()=>c(e)},e.id))]}),i?(0,n.jsx)(ek,{kind:l,connection:"new"===i?void 0:i,busy:a.busy,error:a.saveError,onClose:m,onSave:async e=>{let t="new"===i?[...a.list,e]:a.list.map(t=>t.id===e.id?e:t);await a.save(t)&&m()}}):null]})}var eT=l(21704),eE=l(59275),eR=l(65094),eF=l(31709),eL=l(87082);let eW=new Intl.DateTimeFormat("en-GB",{dateStyle:"medium",timeStyle:"short"});function eP(e){let{state:t}=e,{home:l,known:r,admin:a,busy:o,change:s}=t;return(0,n.jsx)(eL.Ay,{"data-testid":"home-page",lead:(0,n.jsx)(m,{"aria-hidden":!0}),actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.Ay,{label:"Open the home page",href:"/",children:(0,n.jsx)(eF.A,{})}),l?(0,n.jsx)(b.Ay,{label:"Remove the home page",disabled:!a||o,onClick:()=>s(null),children:(0,n.jsx)(eE.A,{})}):null]}),children:(0,n.jsxs)(i.A,{sx:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:1,rowGap:.5,minWidth:0},children:[(0,n.jsx)(h.Ay,{level:"body-sm",textColor:"text.tertiary",children:"Home page"}),l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.Ay,{level:"title-sm",sx:{overflowWrap:"anywhere",minWidth:0},children:l.title}),(0,n.jsxs)(h.Ay,{level:"body-xs",textColor:"text.tertiary",children:["Set ",eW.format(l.publishedAt)]})]}):(0,n.jsx)(h.Ay,{level:"title-sm",children:r?"Not set":"…"})]})})}function ez(e){let{pages:t}=e;return(0,n.jsx)(i.A,{component:"ul","aria-label":"Public addresses",sx:{listStyle:"none",m:0,p:0},children:t.map(e=>{let{alias:t,title:l}=e;return(0,n.jsx)(i.A,{component:"li",sx:{borderTop:"1px solid",borderColor:"divider",py:.5},children:(0,n.jsx)(eL.Ay,{lead:(0,n.jsx)(eR.A,{titleAccess:"Public address"}),actions:(0,n.jsx)(b.Ay,{label:"Open /".concat(t),href:"/".concat(t),children:(0,n.jsx)(eF.A,{})}),children:(0,n.jsxs)(i.A,{sx:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:1,minWidth:0},children:[(0,n.jsxs)(h.Ay,{level:"title-sm",sx:{overflowWrap:"anywhere",minWidth:0},children:["/",t]}),(0,n.jsx)(h.Ay,{level:"body-xs",textColor:"text.tertiary",sx:{overflowWrap:"anywhere"},children:l})]})})},t)})})}function eH(e){let{published:t,aliases:l,local:r,cloud:a,state:o}=e,{user:s}=(0,d.Z)();return(0,n.jsxs)(C.A,{component:"section","aria-label":"Dashboard",sx:{...eL.Lt,py:1.25,display:"flex",flexDirection:"column",gap:1},children:[(0,n.jsx)(eL.Ay,{lead:(0,n.jsx)(eT.A,{"aria-hidden":!0}),sx:{minHeight:32},actions:(0,n.jsxs)(h.Ay,{level:"body-xs",textColor:"text.tertiary",sx:{mr:"6px"},children:[null===t?"":"".concat((0,j.h)(t,"public page")," \xb7 "),(0,j.h)(r,"local page"),null===a?"":" \xb7 ".concat((0,j.h)(a,"cloud page"))]}),children:(0,n.jsx)(h.Ay,{component:"h1",level:"title-lg",children:"Dashboard"})}),s?(0,n.jsx)(i.A,{sx:{borderTop:"1px solid",borderColor:"divider",pt:1},children:(0,n.jsx)(eP,{state:o})}):null,l.length?(0,n.jsx)(ez,{pages:l}):null,s&&o.error?(0,n.jsx)(h.Ay,{role:"alert",level:"body-sm",color:"danger",children:o.error}):null]})}var eM=l(20063);let eB=(0,x.A)((0,n.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"CloudUploadOutlined");var eD=l(8964),eO=l(38182),eN=l(8138),eK=l(42380),eJ=l(35454);function eq(e){let{entry:t,index:l,titles:o,only:i,projects:s}=e,c=(0,a.gG)(),u=(0,a.KJ)(e=>e.themes),p=function(e,t){var l;let{user:n,adapter:o}=(0,d.Z)(),i=(0,a.KJ)(e=>e.themes),[s,c]=r.useState(!1),[u,p]=r.useState(null),h=async()=>{if(n&&o){c(!0),p(null);try{let l=(0,eN.Rg)(e.id,(0,eO.U)(e.page,e.sections,i)),r=await o.uploadPage(n.uid,l,!1);"changed"===r&&window.confirm("The cloud copy has been changed since this page was uploaded. Replace it with this page?")&&(r=await o.uploadPage(n.uid,l,!0)),"saved"===r&&t.reload()}catch(e){p(e instanceof Error?e.message:"The page was not saved to the cloud.")}finally{c(!1)}}};return{offered:!!n,saved:!!(null==(l=t.value)?void 0:l.some(t=>t.id===(0,eN.TP)(e.id))),busy:s,error:u,upload:h}}(t,s),{id:x,page:m,sections:f}=t,g=t.page.title.trim()||"Page ".concat(l+1),v=f.reduce((e,t)=>e+t.cards.length,0);return(0,n.jsxs)(I,{label:g,title:m.title,href:(0,eJ.lf)("/registry",x),description:m.description,badges:[p.saved&&{text:"In cloud",color:"success"}],actions:(0,n.jsxs)(n.Fragment,{children:[p.offered?(0,n.jsx)(b.Ay,{label:p.saved?"Update cloud copy":"Upload to cloud",disabled:p.busy,loading:p.busy,onClick:p.upload,children:(0,n.jsx)(eB,{})}):null,(0,n.jsx)(b.Ay,{label:"Preview",href:(0,eJ.lf)("/",x),children:(0,n.jsx)(eF.A,{})}),(0,n.jsx)(b.jx,{}),(0,n.jsx)(b.Ay,{label:"Duplicate page",onClick:()=>null==c?void 0:c.duplicate(x,m.title.trim()?(0,eK.v)(m.title,o):""),children:(0,n.jsx)(eD.A,{})}),(0,n.jsx)(b.Ay,{label:"Delete page",color:"danger",disabled:i,onClick:()=>{window.confirm('Delete the page "'.concat(g,'"?'))&&(null==c||c.remove(x))},children:(0,n.jsx)(D.A,{})})]}),children:[(0,n.jsxs)(T,{children:[(0,j.h)(f.length,"section")," \xb7 ",(0,j.h)(v,"card")," \xb7"," ",(0,a.eW)(u,m.themeId).name||"Untitled theme"]}),(0,n.jsx)(y.A,{createdAt:m.createdAt,editedAt:(0,a.u8)(m,f)}),p.error?(0,n.jsx)(h.Ay,{level:"body-xs",color:"danger",role:"alert",children:p.error}):null]})}function eG(e){let{pages:t,projects:l}=e,r=(0,a.gG)(),o=(0,eM.useRouter)(),i=t.map(e=>e.page.title);return(0,n.jsx)(L,{title:"Local pages",count:t.length,storageKey:"local",actions:(0,n.jsx)(s.A,{size:"sm",variant:"plain",color:"neutral",startDecorator:(0,n.jsx)(B.A,{}),onClick:()=>{let e=null==r?void 0:r.create();e&&o.push((0,eJ.lf)("/registry",e))},children:"New page"}),children:(0,n.jsx)(W,{label:"Local pages",children:t.map((e,r)=>(0,n.jsx)(eq,{entry:e,index:r,titles:i,only:1===t.length,projects:l},e.id))})})}var eU=l(35042);function eV(e){var t;let{page:l,index:r,pages:a,state:o}=e,{uid:i,projectId:s,title:c}=l,{user:u}=(0,d.Z)(),p=(0,eU.w)(i,s,l.alias),h=(null==(t=o.home)?void 0:t.uid)===i&&o.home.projectId===s;return(0,n.jsxs)(I,{label:c||"Public page ".concat(r+1),title:c,href:p,description:l.description,badges:[h&&{text:"Home",color:"primary"}],actions:(0,n.jsxs)(n.Fragment,{children:[u&&!h?(0,n.jsx)(b.Ay,{label:"Set as home page",disabled:!a.admin||o.busy,onClick:()=>o.change({uid:i,projectId:s}),children:(0,n.jsx)(m,{})}):null,(0,n.jsx)(b.Ay,{label:"Open page",href:p,children:(0,n.jsx)(eF.A,{})}),u?(0,n.jsx)(b.Ay,{label:"Hide from public pages",disabled:!a.admin||a.busy,onClick:()=>a.set(i,s,!1),children:(0,n.jsx)(f,{})}):null]}),children:[l.alias?(0,n.jsxs)(T,{children:["/",l.alias]}):null,(0,n.jsx)(y.A,{createdAt:l.createdAt,editedAt:l.updatedAt})]})}function e_(e){let{pages:t,state:l}=e,{list:r,error:a}=t;return(0,n.jsxs)(L,{title:"Public pages",count:null==r?void 0:r.length,storageKey:"public",children:[a?(0,n.jsx)(P,{color:"danger",children:a}):null,(null==r?void 0:r.length)?(0,n.jsx)(W,{label:"Public pages",children:r.map((e,r)=>(0,n.jsx)(eV,{page:e,index:r,pages:t,state:l},"".concat(e.uid,"/").concat(e.projectId)))}):a?null:(0,n.jsx)(P,{children:r?"No public pages yet.":"Reading the public pages…"})]})}var eZ=l(89742),e$=l(32153);let eX=async()=>({home:await (0,eZ.qi)()}),eY={display:"flex",flexDirection:"column",gap:1.5};function eQ(){let[e,t]=r.useState(!1),l=r.useCallback(()=>t(!1),[]);return(0,n.jsxs)(i.A,{sx:{display:"flex",justifyContent:"center",pt:1},children:[(0,n.jsx)(s.A,{startDecorator:(0,n.jsx)(c.A,{}),onClick:()=>t(!0),children:"Sign in / Sign up"}),(0,n.jsx)(u.A,{open:e,onClose:l})]})}function e0(){var e,t,l,s,c,u;let{pages:p}=(0,a.tF)(),h=(0,a.KJ)(e=>e.error),{status:x,user:m,adapter:f}=(0,d.Z)(),g=function(){var e,t;let{admin:l,adapter:n}=(0,d.Z)(),a=(0,e$.i)(eX),[o,i]=r.useState(!1),[s,c]=r.useState(null),{set:u}=a,p=r.useCallback(async e=>{i(!0),c(null);try{u({home:await (0,eZ.XA)(n,e)})}catch(e){c(e instanceof Error?e.message:"The home page was not saved.")}finally{i(!1)}},[n,u]);return{home:null!=(t=null==(e=a.value)?void 0:e.home)?t:null,known:null!==a.value,admin:l,busy:o,error:null!=s?s:a.error,change:p}}(),v=function(e,t){let l=r.useMemo(()=>e&&t?()=>e.listProjects(t):null,[e,t]);return(0,e$.i)(l)}(f,null==m?void 0:m.uid),b=(0,eU.R)(),j=function(){var e;let{admin:t,adapter:l}=(0,d.Z)(),n=r.useMemo(()=>t?()=>(0,eZ.If)(l):null,[t,l]),a=(0,e$.i)(n),[o,i]=r.useState(!1),[s,c]=r.useState(null),{set:u}=a,p=r.useCallback(async e=>{i(!0),c(null);try{return u(await (0,eZ.fH)(l,e)),!0}catch(e){return c(e instanceof Error?e.message:"The connections were not saved."),!1}finally{i(!1)}},[l,u]);return{admin:t,list:null!=(e=a.value)?e:[],known:null!==a.value,busy:o,error:a.error,saveError:s,save:p,clearSaveError:r.useCallback(()=>c(null),[])}}();return(0,n.jsxs)(n.Fragment,{children:[h?(0,n.jsx)(i.A,{children:(0,n.jsx)(o.A,{color:"warning",children:h})}):null,(0,n.jsx)(i.A,{children:(0,n.jsx)(eH,{published:null!=(s=null==(e=b.list)?void 0:e.length)?s:null,aliases:null!=(c=null==(t=b.list)?void 0:t.filter(e=>e.alias))?c:[],local:p.length,cloud:m&&null!=(u=null==(l=v.value)?void 0:l.length)?u:null,state:g})}),(0,n.jsxs)(i.A,{sx:eY,children:[m?(0,n.jsx)(e_,{pages:b,state:g}):null,m?(0,n.jsx)(H,{uid:m.uid,projects:v,state:g,pages:b}):null,(0,n.jsx)(eG,{pages:p,projects:v}),"signedOut"===x?(0,n.jsx)(eQ,{}):null]}),m?(0,n.jsx)(i.A,{sx:eY,children:(0,n.jsx)(eI,{title:"Databases",kind:"firestore",state:j})}):null,m?(0,n.jsx)(i.A,{sx:eY,children:(0,n.jsx)(eI,{title:"Storage",kind:"storage",state:j})}):null]})}function e1(){let{ready:e}=(0,a.tF)();return(0,n.jsx)(p.default.View,{barTitle:"Registry",children:e?(0,n.jsx)(e0,{}):null})}var e5=l(36080),e2=l(46315);function e3(){let e=(0,eJ.g1)(),{ready:t,pages:l}=(0,a.tF)();return e&&(!t||(0,eJ.zV)(l,e))?(0,n.jsx)(e5.default,{children:(0,n.jsx)(e2.A,{})}):(0,n.jsx)(e1,{})}},95189:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var n=l(95155);l(12115);var r=l(84560),a=l(83730),o=l(35866);function i(e){let{label:t,collapsed:l,onToggle:i}=e;return(0,n.jsx)(r.Ay,{size:"sm",variant:"plain",color:"neutral",onClick:i,"aria-expanded":!l,"aria-label":"".concat(l?"Expand":"Collapse"," ").concat(t),title:"".concat(l?"Expand":"Collapse"," ").concat(t),sx:{...o.Tk,flexShrink:0},children:(0,n.jsx)(a.A,{sx:{transition:"transform 120ms ease-out",transform:l?"rotate(-90deg)":"none"}})})}},99640:(e,t,l)=>{"use strict";l.d(t,{Cx:()=>o,VL:()=>i,jW:()=>r});var n=l(41897);let r="data-section-id",a="data-card-id";function o(e,t){return{[r]:e,...t?{[a]:t}:null}}function i(){let e=Array.from(document.querySelectorAll("[".concat(r,"]")));if(0===e.length)return;let t=e[0].closest("[data-block-stream]"),l=(null==t?void 0:t.getAttribute("data-block-stream"))==="horizontal",o=null!=t?t:document.documentElement,i=l?o.scrollLeft:o.scrollTop,s=l?o.scrollWidth-o.clientWidth:o.scrollHeight-o.clientHeight,c=null==t?void 0:t.getBoundingClientRect(),d=window.innerHeight/2;c&&(d=l?(c.left+c.right)/2:(c.top+n.rs.topReserve+c.bottom)/2);let u=e.map(e=>{var t;let n=e.getBoundingClientRect();return{sectionId:e.getAttribute(r),cardId:null!=(t=e.getAttribute(a))?t:void 0,start:l?n.left:n.top,end:l?n.right:n.bottom}}),p=s>2;return function(e,t,l,n){var r;if(0===e.length)return;let a=l?e[0]:n?e[e.length-1]:null,o=a?e.filter(e=>e.sectionId===a.sectionId):e,i=e=>{let{start:l,end:n}=e;return Math.max(l-t,t-n,0)},s=o.reduce((e,t)=>i(t)<i(e)?t:e);return s.cardId?s:null!=(r=o.find(e=>e.sectionId===s.sectionId&&e.cardId))?r:s}(u,d,p&&i<=2,p&&i>=s-2)}}},e=>{e.O(0,[9627,277,5004,2246,7240,2567,5248,8245,1388,1438,7465,8441,1255,7358],()=>e(e.s=83157)),_N_E=e.O()}]);
|